Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Linux Kernel Patch v2.4, patch-2.4.14 (00/56)

22 views
Skip to first unread message

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:23 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part00

lines added deleted
linux/CREDITS : 10 1 2
linux/Documentation/Configure.help : 184 121 1
linux/Documentation/DocBook/Makefile : 48 7 7
linux/Documentation/DocBook/parportbook.tmpl : 45 7 7
linux/Documentation/arm/SA1100/Assabet : 71 39 13
linux/Documentation/computone.txt : 345 115 62
linux/Documentation/filesystems/devfs/ChangeLog : 10 7 0
linux/Documentation/filesystems/vfat.txt : 17 9 2
linux/Documentation/networking/8139too.txt : 17 1 3
linux/Documentation/pci.txt : 7 1 1
linux/MAINTAINERS : 58 16 6
linux/Makefile : 7 1 1
linux/arch/alpha/config.in : 10 4 0
linux/arch/alpha/kernel/alpha_ksyms.c : 7 1 0
linux/arch/alpha/kernel/osf_sys.c : 67 64 0
linux/arch/alpha/kernel/pci.c : 24 8 6
linux/arch/alpha/kernel/pci_iommu.c : 26 3 3
linux/arch/alpha/kernel/setup.c : 9 2 1
linux/arch/alpha/kernel/time.c : 161 83 35
linux/arch/alpha/kernel/traps.c : 16 7 3
linux/arch/alpha/lib/Makefile : 10 4 0
linux/arch/alpha/lib/dec_and_lock.c : 40 40 0
linux/arch/arm/config.in : 53 16 2
linux/arch/arm/def-configs/adsbitsy : 674 674 0
linux/arch/arm/def-configs/assabet : 556 215 52
linux/arch/arm/def-configs/bitsy : 763 0 763
linux/arch/arm/def-configs/cerf : 434 0 434
linux/arch/arm/def-configs/cerfcube : 887 887 0
linux/arch/arm/def-configs/cerfpda : 981 981 0
linux/arch/arm/def-configs/cerfpod : 908 908 0
linux/arch/arm/def-configs/edb7211 : 401 401 0
linux/arch/arm/def-configs/epxa10db : 662 662 0
linux/arch/arm/def-configs/graphicsclient : 473 139 77
linux/arch/arm/def-configs/graphicsmaster : 755 755 0
linux/arch/arm/def-configs/h3600 : 927 465 108
linux/arch/arm/def-configs/lart : 452 188 41
linux/arch/arm/def-configs/neponset : 577 180 64
linux/arch/arm/def-configs/pangolin : 528 137 94
linux/arch/arm/def-configs/shark : 450 194 14
linux/arch/arm/kernel/Makefile : 8 1 1
linux/arch/arm/kernel/debug-armv.S : 37 31 0
linux/arch/arm/kernel/entry-armv.S : 35 22 0
linux/arch/arm/lib/backtrace.S : 73 26 7
linux/arch/arm/lib/io-acorn.S : 39 0 33
linux/arch/arm/mach-epxa10db/Makefile : 22 22 0
linux/arch/arm/mach-epxa10db/arch.c : 62 62 0
linux/arch/arm/mach-epxa10db/dma.c : 36 36 0
linux/arch/arm/mach-epxa10db/irq.c : 70 70 0
linux/arch/arm/mach-epxa10db/mm.c : 48 48 0
linux/arch/arm/mach-epxa10db/time.c : 33 33 0
linux/arch/arm/mach-sa1100/Makefile : 44 13 4
linux/arch/arm/mach-sa1100/assabet.c : 142 37 24
linux/arch/arm/mach-sa1100/cerf.c : 96 50 16
linux/arch/arm/mach-sa1100/dma-sa1100.c : 8 1 1
linux/arch/arm/mach-sa1100/dma-sa1111.c : 25 2 3
linux/arch/arm/mach-sa1100/freebird.c : 11 5 0
linux/arch/arm/mach-sa1100/graphicsclient.c : 193 175 0
linux/arch/arm/mach-sa1100/graphicsmaster.c : 100 89 0
linux/arch/arm/mach-sa1100/h3600.c : 94 56 3
linux/arch/arm/mach-sa1100/leds-adsbitsy.c : 96 96 0
linux/arch/arm/mach-sa1100/leds-assabet.c : 101 14 12
linux/arch/arm/mach-sa1100/leds-cerf.c : 23 12 0
linux/arch/arm/mach-sa1100/leds-simpad.c : 29 7 3
linux/arch/arm/mach-sa1100/leds.c : 8 2 0
linux/arch/arm/mach-sa1100/leds.h : 4 1 0
linux/arch/arm/mach-sa1100/neponset.c : 27 4 3
linux/arch/arm/mach-sa1100/pm.c : 183 183 0
linux/arch/arm/mach-sa1100/simpad.c : 180 113 15
linux/arch/arm/mach-sa1100/sleep.S : 238 238 0
linux/arch/arm/mach-sa1100/sleep.h : 30 30 0
linux/arch/arm/mach-shark/dma.c : 8 1 1
linux/arch/arm/mach-shark/leds.c : 7 1 1
linux/arch/arm/mach-shark/mm.c : 8 1 1
linux/arch/arm/mm/fault-armv.c : 8 1 1
linux/arch/arm/mm/proc-arm920.S : 246 78 25
linux/arch/arm/mm/proc-sa110.S : 77 10 7
linux/arch/arm/tools/mach-types : 24 5 2
linux/arch/i386/config.in : 7 1 0
linux/arch/i386/defconfig : 40 5 1
linux/arch/i386/kernel/apic.c : 7 1 0
linux/arch/i386/kernel/entry.S : 12 2 2
linux/arch/i386/kernel/io_apic.c : 35 8 3
linux/arch/i386/kernel/irq.c : 19 4 1
linux/arch/i386/kernel/microcode.c : 30 5 5
linux/arch/i386/kernel/mtrr.c : 32 7 16
linux/arch/i386/kernel/pci-i386.c : 8 1 1
linux/arch/i386/kernel/pci-irq.c : 8 1 1
linux/arch/i386/kernel/pci-pc.c : 26 3 3
linux/arch/i386/kernel/pci-visws.c : 8 1 1
linux/arch/i386/kernel/setup.c : 375 289 9
linux/arch/ppc/8260_io/commproc.c : 24 2 4
linux/arch/ppc/8xx_io/commproc.c : 55 26 4
linux/arch/ppc/8xx_io/uart.c : 83 23 10
linux/arch/ppc/config.in : 55 10 7
linux/arch/ppc/configs/IVMS8_defconfig : 166 101 5
linux/arch/ppc/configs/SM850_defconfig : 223 114 8
linux/arch/ppc/configs/SPD823TS_defconfig : 222 114 8
linux/arch/ppc/configs/TQM823L_defconfig : 223 114 8
linux/arch/ppc/configs/TQM850L_defconfig : 223 114 8
linux/arch/ppc/configs/TQM860L_defconfig : 167 101 5
linux/arch/ppc/configs/apus_defconfig : 288 143 15
linux/arch/ppc/configs/bseip_defconfig : 222 114 8
linux/arch/ppc/configs/common_defconfig : 314 91 26
linux/arch/ppc/configs/est8260_defconfig : 199 110 8
linux/arch/ppc/configs/gemini_defconfig : 216 111 10
linux/arch/ppc/configs/ibmchrp_defconfig : 298 141 15
linux/arch/ppc/configs/mbx_defconfig : 222 114 8
linux/arch/ppc/configs/oak_defconfig : 202 111 8
linux/arch/ppc/configs/power3_defconfig : 264 136 14
linux/arch/ppc/configs/rpxcllf_defconfig : 222 114 8
linux/arch/ppc/configs/rpxlite_defconfig : 222 114 8
linux/arch/ppc/configs/walnut_defconfig : 210 112 8
linux/arch/ppc/defconfig : 323 92 27
linux/arch/ppc/kernel/Makefile : 50 10 15
linux/arch/ppc/kernel/apus_setup.c : 16 1 4
linux/arch/ppc/kernel/gemini_pci.c : 12 2 2
linux/arch/ppc/kernel/gemini_setup.c : 37 6 5
linux/arch/ppc/kernel/head.S : 23 3 2
linux/arch/ppc/kernel/head_8xx.S : 92 32 21
linux/arch/ppc/kernel/idle.c : 22 2 3
linux/arch/ppc/kernel/m8260_setup.c : 181 44 48
linux/arch/ppc/kernel/m8xx_setup.c : 78 28 32
linux/arch/ppc/kernel/misc.S : 238 52 51
linux/arch/ppc/kernel/oak_setup.c : 19 1 6
linux/arch/ppc/kernel/open_pic.c : 19 3 4
linux/arch/ppc/kernel/open_pic.h : 15 2 2
linux/arch/ppc/kernel/pci.c : 15 3 1
linux/arch/ppc/kernel/pmac_setup.c : 21 4 6
linux/arch/ppc/kernel/ppc_asm.h : 29 1 20
linux/arch/ppc/kernel/ppc_htab.c : 32 6 3
linux/arch/ppc/kernel/ppc_ksyms.c : 15 2 2
linux/arch/ppc/kernel/prep_setup.c : 676 142 154
linux/arch/ppc/kernel/setup.c : 15 2 2
linux/arch/ppc/kernel/smp.c : 22 2 2
linux/arch/ppc/kernel/syscalls.c : 17 4 4
linux/arch/ppc/kernel/traps.c : 72 28 11
linux/arch/ppc/kernel/walnut_setup.c : 19 1 6
linux/arch/ppc/lib/string.S : 126 23 34
linux/arch/ppc/mm/4xx_mmu.c : 19 4 4
linux/arch/ppc/mm/cachemap.c : 8 2 0
linux/arch/ppc/mm/mmu_decl.h : 7 1 0
linux/arch/sh/kernel/pci-sh7751.c : 8 1 1
linux/arch/sparc/defconfig : 31 3 1
linux/arch/sparc/kernel/check_asm.sh : 8 1 1
linux/arch/sparc/kernel/ioport.c : 23 3 3
linux/arch/sparc/kernel/sparc-stub.c : 88 33 31
linux/arch/sparc/kernel/time.c : 75 34 31
linux/arch/sparc/kernel/windows.c : 28 11 11
linux/arch/sparc/mm/fault.c : 22 6 6
linux/arch/sparc/mm/srmmu.c : 69 20 18
linux/arch/sparc/mm/sun4c.c : 230 99 96
linux/arch/sparc/prom/console.c : 14 3 2
linux/arch/sparc64/defconfig : 51 9 3
linux/arch/sparc64/kernel/ioctl32.c : 70 4 42
linux/arch/sparc64/kernel/setup.c : 20 8 1
linux/arch/sparc64/kernel/smp.c : 62 10 18
linux/arch/sparc64/kernel/sparc64_ksyms.c : 44 7 3
linux/arch/sparc64/kernel/sys_sparc.c : 39 21 7
linux/arch/sparc64/mm/init.c : 173 96 16
linux/arch/sparc64/mm/ultra.S : 65 34 13
linux/drivers/acorn/block/mfmhd.c : 44 3 7
linux/drivers/acorn/char/keyb_ps2.c : 58 22 2
linux/drivers/acorn/scsi/cumana_2.c : 7 1 0
linux/drivers/acorn/scsi/ecoscsi.c : 7 0 1
linux/drivers/acorn/scsi/eesox.c : 9 2 1
linux/drivers/acorn/scsi/powertec.c : 9 2 1
linux/drivers/acpi/Makefile : 13 1 2
linux/drivers/acpi/acpi_ksyms.c : 21 8 1
linux/drivers/acpi/debugger/dbcmds.c : 26 3 3
linux/drivers/acpi/debugger/dbdisasm.c : 106 37 13
linux/drivers/acpi/debugger/dbdisply.c : 72 12 18
linux/drivers/acpi/debugger/dbfileio.c : 132 19 20
linux/drivers/acpi/debugger/dbinput.c : 38 3 5
linux/drivers/acpi/debugger/dbstats.c : 13 2 2
linux/drivers/acpi/debugger/dbutils.c : 66 27 5
linux/drivers/acpi/debugger/dbxface.c : 93 32 18
linux/drivers/acpi/dispatcher/dsfield.c : 594 238 190
linux/drivers/acpi/dispatcher/dsmethod.c : 225 55 67
linux/drivers/acpi/dispatcher/dsobject.c : 117 23 21
linux/drivers/acpi/dispatcher/dsopcode.c : 203 79 28
linux/drivers/acpi/dispatcher/dsutils.c : 197 47 30
linux/drivers/acpi/dispatcher/dswexec.c : 689 158 263
linux/drivers/acpi/dispatcher/dswload.c : 764 217 283
linux/drivers/acpi/dispatcher/dswscope.c : 20 4 3
linux/drivers/acpi/dispatcher/dswstate.c : 143 100 4
linux/drivers/acpi/driver.c : 99 70 2
linux/drivers/acpi/driver.h : 72 0 72
linux/drivers/acpi/events/evevent.c : 30 5 5
linux/drivers/acpi/events/evmisc.c : 34 4 3
linux/drivers/acpi/events/evregion.c : 79 11 11
linux/drivers/acpi/events/evrgnini.c : 97 67 3
linux/drivers/acpi/events/evxface.c : 320 23 84
linux/drivers/acpi/events/evxfevnt.c : 146 22 41
linux/drivers/acpi/events/evxfregn.c : 308 57 65
linux/drivers/acpi/executer/exconfig.c : 128 9 63
linux/drivers/acpi/executer/exconvrt.c : 52 7 5
linux/drivers/acpi/executer/excreate.c : 732 147 325
linux/drivers/acpi/executer/exdump.c : 197 28 33
linux/drivers/acpi/executer/exdyadic.c : 874 0 874
linux/drivers/acpi/executer/exfldio.c : 190 24 34
linux/drivers/acpi/executer/exmisc.c : 707 275 296
linux/drivers/acpi/executer/exmonad.c : 970 0 970
linux/drivers/acpi/executer/exoparg1.c : 878 878 0
linux/drivers/acpi/executer/exoparg2.c : 564 564 0
linux/drivers/acpi/executer/exoparg3.c : 235 235 0
linux/drivers/acpi/executer/exoparg6.c : 276 276 0
linux/drivers/acpi/executer/exprep.c : 364 68 220
linux/drivers/acpi/executer/exregion.c : 143 81 7
linux/drivers/acpi/executer/exresnte.c : 219 43 36
linux/drivers/acpi/executer/exresolv.c : 34 6 4
linux/drivers/acpi/executer/exresop.c : 35 4 4
linux/drivers/acpi/executer/exstore.c : 311 39 54
linux/drivers/acpi/executer/exutils.c : 65 13 10
linux/drivers/acpi/executer/exxface.c : 102 0 102
linux/drivers/acpi/hardware/hwacpi.c : 17 2 2
linux/drivers/acpi/hardware/hwgpe.c : 193 158 1
linux/drivers/acpi/hardware/hwregs.c : 62 14 9
linux/drivers/acpi/hardware/hwsleep.c : 90 18 16
linux/drivers/acpi/hardware/hwtimer.c : 47 1 21
linux/drivers/acpi/include/acconfig.h : 30 7 3
linux/drivers/acpi/include/acdebug.h : 42 8 3
linux/drivers/acpi/include/acdispat.h : 128 28 25
linux/drivers/acpi/include/acevents.h : 29 15 1
linux/drivers/acpi/include/acglobal.h : 30 4 4
linux/drivers/acpi/include/achware.h : 49 21 4
linux/drivers/acpi/include/acinterp.h : 225 83 48
linux/drivers/acpi/include/aclocal.h : 446 109 88
linux/drivers/acpi/include/acmacros.h : 92 10 19
linux/drivers/acpi/include/acnamesp.h : 77 8 10
linux/drivers/acpi/include/acobject.h : 99 18 14
linux/drivers/acpi/include/acparser.h : 47 2 18
linux/drivers/acpi/include/acpixf.h : 94 15 13
linux/drivers/acpi/include/acstruct.h : 162 75 33
linux/drivers/acpi/include/actables.h : 19 1 5
linux/drivers/acpi/include/actbl.h : 17 2 2
linux/drivers/acpi/include/actbl1.h : 17 2 2
linux/drivers/acpi/include/actbl2.h : 60 9 9
linux/drivers/acpi/include/actbl71.h : 76 18 18
linux/drivers/acpi/include/actypes.h : 213 54 29
linux/drivers/acpi/include/acutils.h : 146 32 17
linux/drivers/acpi/include/amlcode.h : 153 79 43
linux/drivers/acpi/include/platform/acenv.h : 21 7 1
linux/drivers/acpi/include/platform/acgcc.h : 55 24 2
linux/drivers/acpi/include/platform/aclinux.h : 24 1 10
linux/drivers/acpi/namespace/nsaccess.c : 57 10 6
linux/drivers/acpi/namespace/nsalloc.c : 270 43 72
linux/drivers/acpi/namespace/nsdump.c : 431 202 62
linux/drivers/acpi/namespace/nseval.c : 78 12 11
linux/drivers/acpi/namespace/nsinit.c : 80 9 9
linux/drivers/acpi/namespace/nsload.c : 105 24 34
linux/drivers/acpi/namespace/nsnames.c : 17 2 2
linux/drivers/acpi/namespace/nsobject.c : 152 6 102
linux/drivers/acpi/namespace/nssearch.c : 86 10 10
linux/drivers/acpi/namespace/nsutils.c : 98 13 13
linux/drivers/acpi/namespace/nswalk.c : 198 36 46
linux/drivers/acpi/namespace/nsxfname.c : 87 6 27
linux/drivers/acpi/namespace/nsxfobj.c : 355 43 90
linux/drivers/acpi/os.c : 40 2 10
linux/drivers/acpi/ospm/ac_adapter/ac.c : 17 2 2
linux/drivers/acpi/ospm/ac_adapter/ac_osl.c : 25 2 3
linux/drivers/acpi/ospm/battery/bt.c : 75 10 10
linux/drivers/acpi/ospm/battery/bt_osl.c : 100 13 14
linux/drivers/acpi/ospm/busmgr/bm.c : 26 3 3
linux/drivers/acpi/ospm/busmgr/bm_osl.c : 56 1 28
linux/drivers/acpi/ospm/busmgr/bmpower.c : 17 2 2
linux/drivers/acpi/ospm/busmgr/bmutils.c : 297 65 67
linux/drivers/acpi/ospm/button/bn.c : 28 4 4
linux/drivers/acpi/ospm/button/bn_osl.c : 115 68 7
linux/drivers/acpi/ospm/ec/ec_osl.c : 61 1 33
linux/drivers/acpi/ospm/ec/ecmain.c : 17 2 2
linux/drivers/acpi/ospm/ec/ecspace.c : 17 2 2
linux/drivers/acpi/ospm/include/bn.h : 8 1 1
linux/drivers/acpi/ospm/include/bt.h : 57 15 15
linux/drivers/acpi/ospm/include/pr.h : 8 1 1
linux/drivers/acpi/ospm/include/tz.h : 180 37 64
linux/drivers/acpi/ospm/processor/pr.c : 57 8 8
linux/drivers/acpi/ospm/processor/pr_osl.c : 35 5 10
linux/drivers/acpi/ospm/processor/prperf.c : 76 22 7
linux/drivers/acpi/ospm/processor/prpower.c : 99 13 19
linux/drivers/acpi/ospm/system/sm.c : 17 2 2
linux/drivers/acpi/ospm/system/sm_osl.c : 7 0 1
linux/drivers/acpi/ospm/thermal/tz.c : 835 205 313
linux/drivers/acpi/ospm/thermal/tz_osl.c : 343 140 81
linux/drivers/acpi/ospm/thermal/tzpolicy.c : 583 119 216
linux/drivers/acpi/parser/psargs.c : 22 3 3
linux/drivers/acpi/parser/psopcode.c : 733 326 324
linux/drivers/acpi/parser/psparse.c : 866 151 272
linux/drivers/acpi/parser/psscope.c : 24 3 1
linux/drivers/acpi/parser/pstree.c : 45 6 5
linux/drivers/acpi/parser/psutils.c : 19 3 3
linux/drivers/acpi/parser/pswalk.c : 56 13 7
linux/drivers/acpi/parser/psxface.c : 127 53 15
linux/drivers/acpi/resources/rsutils.c : 16 1 2
linux/drivers/acpi/resources/rsxface.c : 64 1 29
linux/drivers/acpi/tables/tbconvrt.c : 53 6 6
linux/drivers/acpi/tables/tbget.c : 17 2 2
linux/drivers/acpi/tables/tbinstal.c : 26 3 3
linux/drivers/acpi/tables/tbutils.c : 39 5 5
linux/drivers/acpi/tables/tbxface.c : 85 1 38
linux/drivers/acpi/tables/tbxfroot.c : 97 44 12
linux/drivers/acpi/utilities/utalloc.c : 432 119 75
linux/drivers/acpi/utilities/utcopy.c : 17 2 2
linux/drivers/acpi/utilities/utdebug.c : 115 12 16
linux/drivers/acpi/utilities/utdelete.c : 90 15 30
linux/drivers/acpi/utilities/uteval.c : 89 11 11
linux/drivers/acpi/utilities/utglobal.c : 58 13 13
linux/drivers/acpi/utilities/utinit.c : 17 2 2
linux/drivers/acpi/utilities/utmath.c : 314 314 0
linux/drivers/acpi/utilities/utmisc.c : 45 6 5
linux/drivers/acpi/utilities/utobject.c : 22 1 8
linux/drivers/acpi/utilities/utxface.c : 66 9 19
linux/drivers/atm/Config.in : 7 1 0
linux/drivers/atm/Makefile : 7 1 0
linux/drivers/atm/atmdev_init.c : 19 6 0
linux/drivers/atm/lanai.c : 2917 2917 0
linux/drivers/atm/nicstar.h : 8 1 1
linux/drivers/block/DAC960.c : 25 2 3
linux/drivers/block/acsi.c : 23 1 2
linux/drivers/block/amiflop.c : 7 1 0
linux/drivers/block/ataflop.c : 21 1 3
linux/drivers/block/cciss.c : 149 31 31
linux/drivers/block/cciss_cmd.h : 8 1 1
linux/drivers/block/cpqarray.c : 149 28 38
linux/drivers/block/floppy.c : 75 10 13
linux/drivers/block/ida_cmd.h : 8 1 1
linux/drivers/block/ll_rw_blk.c : 158 33 48
linux/drivers/block/loop.c : 15 2 0
linux/drivers/block/nbd.c : 21 1 2
linux/drivers/block/paride/Config.in : 12 6 0
linux/drivers/block/paride/epat.c : 80 32 10
linux/drivers/block/paride/pcd.c : 51 16 6
linux/drivers/block/paride/pd.c : 25 1 4
linux/drivers/block/paride/pf.c : 38 3 10
linux/drivers/block/ps2esdi.c : 7 1 0
linux/drivers/block/rd.c : 48 2 21
linux/drivers/block/xd.c : 36 2 6
linux/drivers/block/z2ram.c : 31 1 5
linux/drivers/cdrom/aztcd.c : 32 1 4
linux/drivers/cdrom/cdrom.c : 111 8 27
linux/drivers/cdrom/cdu31a.c : 54 12 7
linux/drivers/cdrom/cm206.c : 45 11 3
linux/drivers/cdrom/gscd.c : 29 1 4
linux/drivers/cdrom/mcd.c : 57 11 5
linux/drivers/cdrom/mcdx.c : 89 15 14
linux/drivers/cdrom/optcd.c : 32 1 4
linux/drivers/cdrom/sbpcd.c : 49 11 4
linux/drivers/cdrom/sjcd.c : 34 1 6
linux/drivers/cdrom/sonycd535.c : 40 1 5
linux/drivers/char/Config.in : 9 3 1
linux/drivers/char/Makefile : 7 1 0
linux/drivers/char/README.computone : 231 4 221
linux/drivers/char/applicom.c : 26 12 1
linux/drivers/char/drm/drmP.h : 38 8 8
linux/drivers/char/drm/drm_vm.h : 59 8 8
linux/drivers/char/eurotechwdt.c : 480 480 0
linux/drivers/char/i8k.c : 556 556 0
linux/drivers/char/ip2/i2cmd.c : 8 1 1
linux/drivers/char/ip2/i2ellis.c : 38 17 1
linux/drivers/char/ip2/i2ellis.h : 12 6 0
linux/drivers/char/ip2/i2lib.c : 805 134 164
linux/drivers/char/ip2/i2lib.h : 12 6 0
linux/drivers/char/ip2/ip2.h : 20 10 0
linux/drivers/char/ip2.c : 111 69 5
linux/drivers/char/ip2main.c : 1232 335 241
linux/drivers/char/istallion.c : 24 8 2
linux/drivers/char/joystick/analog.c : 8 1 1
linux/drivers/char/lp.c : 229 103 17
linux/drivers/char/misc.c : 17 4 0
linux/drivers/char/moxa.c : 76 15 17
linux/drivers/char/mxser.c : 97 17 20
linux/drivers/char/random.c : 28 5 4
linux/drivers/char/rio/rio_linux.c : 9 3 0
linux/drivers/char/serial.c : 8 1 1
linux/drivers/char/tty_io.c : 9 0 3
linux/drivers/char/vt.c : 52 26 12
linux/drivers/ide/ataraid.c : 27 1 3
linux/drivers/ide/buddha.c : 240 109 52
linux/drivers/ide/falconide.c : 25 3 2
linux/drivers/ide/icside.c : 235 147 8
linux/drivers/ide/ide-cd.c : 34 4 4
linux/drivers/ide/ide-pci.c : 15 2 0
linux/drivers/ide/ide.c : 44 3 9
linux/drivers/ide/pdc202xx.c : 8 1 1
linux/drivers/ide/piix.c : 17 3 1
linux/drivers/ide/q40ide.c : 11 3 0
linux/drivers/isdn/hisax/md5sums.asc : 30 13 13
linux/drivers/isdn/hisax/niccy.c : 43 6 6
linux/drivers/isdn/hisax/st5481_d.c : 7 0 1
linux/drivers/isdn/hisax/st5481_usb.c : 10 2 2
linux/drivers/isdn/isdn_ppp.c : 35 14 4
linux/drivers/md/lvm.c : 51 2 8
linux/drivers/md/md.c : 7 1 0
linux/drivers/media/video/cpia.c : 82 14 39
linux/drivers/media/video/cpia.h : 26 20 0
linux/drivers/media/video/cpia_pp.c : 52 12 3
linux/drivers/media/video/cpia_usb.c : 49 11 4
linux/drivers/media/video/meye.c : 15 2 0
linux/drivers/media/video/planb.c : 8 1 1
linux/drivers/message/i2o/i2o_block.c : 81 16 17
linux/drivers/message/i2o/i2o_pci.c : 8 2 0
linux/drivers/message/i2o/i2o_proc.c : 15 2 1
linux/drivers/mtd/chips/cfi_cmdset_0002.c : 147 21 15
linux/drivers/mtd/ftl.c : 34 3 8
linux/drivers/mtd/mtdblock.c : 40 1 5
linux/drivers/mtd/mtdblock_ro.c : 32 1 4
linux/drivers/mtd/nftlcore.c : 28 2 5
linux/drivers/net/8139cp.c : 33 10 9
linux/drivers/net/acenic.c : 9 2 1
linux/drivers/net/arcnet/arc-rimi.c : 8 1 1
linux/drivers/net/arcnet/arcnet.c : 8 1 1
linux/drivers/net/arcnet/com20020-isa.c : 8 1 1
linux/drivers/net/arcnet/com20020-pci.c : 8 1 1
linux/drivers/net/arcnet/com20020.c : 8 1 1
linux/drivers/net/arcnet/com90io.c : 8 1 1
linux/drivers/net/arcnet/com90xx.c : 8 1 1
linux/drivers/net/hamradio/scc.c : 33 3 6
linux/drivers/net/irda/Config.in : 19 6 0
linux/drivers/net/irda/Makefile : 19 3 0
linux/drivers/net/irda/ep7211_ir.c : 129 129 0
linux/drivers/net/irda/sa1100_ir.c : 1163 1163 0
linux/drivers/net/natsemi.c : 1371 559 230
linux/drivers/net/pcmcia/xircom_tulip_cb.c : 10 3 1
linux/drivers/net/sunbmac.c : 5 1 1
linux/drivers/net/sunlance.c : 5 1 1
linux/drivers/net/wireless/hermes.h : 7 1 0
linux/drivers/parport/ChangeLog : 35 32 0
linux/drivers/parport/ieee1284.c : 22 5 3
linux/drivers/parport/ieee1284_ops.c : 44 8 9
linux/drivers/parport/parport_pc.c : 239 140 10
linux/drivers/pci/compat.c : 8 1 1
linux/drivers/pci/gen-devlist.c : 8 1 1
linux/drivers/pci/pci.c : 8 1 1
linux/drivers/pci/pci.ids : 1002 231 132
linux/drivers/pci/proc.c : 8 1 1
linux/drivers/pci/quirks.c : 8 1 1
linux/drivers/pcmcia/Config.in : 7 1 0
linux/drivers/pcmcia/Makefile : 19 6 0
linux/drivers/pcmcia/ds.c : 10 2 2
linux/drivers/pcmcia/i82092.c : 909 909 0
linux/drivers/pcmcia/i82092aa.h : 43 43 0
linux/drivers/pcmcia/sa1100_assabet.c : 113 21 21
linux/drivers/pcmcia/sa1100_cerf.c : 161 46 35
linux/drivers/pcmcia/sa1100_generic.c : 36 18 2
linux/drivers/pcmcia/sa1100_neponset.c : 7 1 0
linux/drivers/pcmcia/sa1100_simpad.c : 125 39 19
linux/drivers/pcmcia/sa1100_stork.c : 8 1 1
linux/drivers/pnp/Config.in : 8 0 4
linux/drivers/pnp/quirks.c : 8 1 1
linux/drivers/s390/block/dasd.c : 43 1 6
linux/drivers/s390/block/xpram.c : 23 1 2
linux/drivers/s390/char/tapeblock.c : 27 1 6
linux/drivers/sbus/char/aurora.c : 14 2 2
linux/drivers/sbus/char/jsflash.c : 23 1 2
linux/drivers/sbus/char/zs.c : 32 3 12
linux/drivers/scsi/53c7,8xx.c : 23 6 2
linux/drivers/scsi/53c7xx.c : 6 0 3
linux/drivers/scsi/53c7xx.h : 72 14 27
linux/drivers/scsi/a2091.c : 19 4 2
linux/drivers/scsi/a3000.c : 71 22 16
linux/drivers/scsi/aic7xxx/aic7770.c : 50 23 15
linux/drivers/scsi/aic7xxx/aic7770_linux.c : 55 22 14
linux/drivers/scsi/aic7xxx/aic7xxx.c : 447 135 74
linux/drivers/scsi/aic7xxx/aic7xxx.h : 127 51 22
linux/drivers/scsi/aic7xxx/aic7xxx.reg : 112 34 22
linux/drivers/scsi/aic7xxx/aic7xxx.seq : 220 77 51
linux/drivers/scsi/aic7xxx/aic7xxx_93cx6.c : 8 1 1
linux/drivers/scsi/aic7xxx/aic7xxx_93cx6.h : 46 21 13
linux/drivers/scsi/aic7xxx/aic7xxx_inline.h : 93 25 22
linux/drivers/scsi/aic7xxx/aic7xxx_linux.c : 514 119 156
linux/drivers/scsi/aic7xxx/aic7xxx_linux_host.h : 55 22 14
linux/drivers/scsi/aic7xxx/aic7xxx_linux_pci.c : 371 153 118
linux/drivers/scsi/aic7xxx/aic7xxx_osm.h : 172 57 25
linux/drivers/scsi/aic7xxx/aic7xxx_pci.c : 128 62 19
linux/drivers/scsi/aic7xxx/aic7xxx_proc.c : 56 22 14
linux/drivers/scsi/aic7xxx/aic7xxx_reg.h : 63 9 8
linux/drivers/scsi/aic7xxx/aic7xxx_seq.h : 1624 578 572
linux/drivers/scsi/aic7xxx/aicasm/Makefile : 31 9 4
linux/drivers/scsi/aic7xxx/aicasm/aicasm.c : 71 30 15
linux/drivers/scsi/aic7xxx/aicasm/aicasm.h : 54 22 13
linux/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y : 54 22 13
linux/drivers/scsi/aic7xxx/aicasm/aicasm_insformat.h : 55 21 19
linux/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l : 56 23 14
linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c : 46 21 13
linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h : 46 21 13
linux/drivers/scsi/aic7xxx/cam.h : 17 2 2
linux/drivers/scsi/amiga7xx.c : 15 4 1
linux/drivers/scsi/blz1230.c : 25 3 2
linux/drivers/scsi/blz2060.c : 8 1 1
linux/drivers/scsi/bvme6000.c : 6 3 0
linux/drivers/scsi/constants.c : 27 13 1
linux/drivers/scsi/cpqfc.Readme : 21 15 0
linux/drivers/scsi/cpqfcTScontrol.c : 364 96 62
linux/drivers/scsi/cpqfcTSinit.c : 169 51 16
linux/drivers/scsi/cpqfcTSioctl.h : 27 13 3
linux/drivers/scsi/cpqfcTSstructs.h : 153 49 17
linux/drivers/scsi/cpqfcTSworker.c : 1102 526 249
linux/drivers/scsi/cyberstorm.c : 8 1 1
linux/drivers/scsi/cyberstormII.c : 8 1 1
linux/drivers/scsi/dtc.h : 36 7 7
linux/drivers/scsi/fastlane.c : 17 2 2
linux/drivers/scsi/gdth.c : 17 2 2
linux/drivers/scsi/gvp11.c : 25 6 6
linux/drivers/scsi/jazz_esp.c : 8 1 1
linux/drivers/scsi/mac_esp.c : 8 1 1
linux/drivers/scsi/mca_53c9x.c : 8 1 1
linux/drivers/scsi/megaraid.c : 723 368 80
linux/drivers/scsi/megaraid.h : 70 30 2
linux/drivers/scsi/mvme147.c : 47 20 5
linux/drivers/scsi/mvme16x.c : 6 3 0
linux/drivers/scsi/oktagon_esp.c : 17 2 2
linux/drivers/scsi/osst.c : 23 3 0
linux/drivers/scsi/qlogicfas.c : 31 7 2
linux/drivers/scsi/qlogicfc.c : 67 15 6
linux/drivers/scsi/qlogicisp.c : 44 12 4
linux/drivers/scsi/qlogicpti.c : 19 3 2
linux/drivers/scsi/scsi_merge.c : 7 1 0
linux/drivers/scsi/sd.c : 7 1 0
linux/drivers/scsi/sg.c : 23 3 0
linux/drivers/scsi/sr.c : 33 11 2
linux/drivers/scsi/st.c : 23 3 0
linux/drivers/scsi/sun3_NCR5380.c : 23 5 5
linux/drivers/scsi/sun3_scsi.c : 211 87 17
linux/drivers/scsi/sun3x_esp.c : 283 112 32
linux/drivers/scsi/u14-34f.c : 26 1 5
linux/drivers/scsi/wd33c93.c : 769 136 143
linux/drivers/scsi/wd33c93.h : 34 4 10
linux/drivers/sound/dmasound/dmasound_atari.c : 4 1 0
linux/drivers/sound/dmasound/dmasound_awacs.c : 4 1 0
linux/drivers/sound/dmasound/dmasound_core.c : 7 1 0
linux/drivers/sound/dmasound/dmasound_paula.c : 4 1 0
linux/drivers/sound/dmasound/dmasound_q40.c : 4 1 0
linux/drivers/sound/emu10k1/hwaccess.h : 9 3 0
linux/drivers/sound/i810_audio.c : 618 291 59
linux/drivers/sound/ite8172.c : 7 1 0
linux/drivers/sound/nec_vrc5477.c : 7 1 0
linux/drivers/sound/rme96xx.c : 8 2 0
linux/drivers/sound/sb_ess.c : 31 13 3
linux/drivers/sound/trident.c : 8 1 1
linux/drivers/sound/waveartist.c : 1226 553 352
linux/drivers/sound/waveartist.h : 27 22 0
linux/drivers/telephony/ixj.c : 8 1 1
linux/drivers/usb/Config.in : 7 0 1
linux/drivers/usb/devio.c : 14 8 0
linux/drivers/usb/serial/ir-usb.c : 138 48 21
linux/drivers/usb/storage/sddr09.c : 11 2 0
linux/drivers/usb/usb-ohci.h : 8 1 1
linux/drivers/usb/usb-uhci-debug.h : 8 1 1
linux/drivers/usb/usbnet.c : 10 4 0
linux/drivers/video/Makefile : 8 1 1
linux/drivers/video/aty/atyfb_base.c : 8 1 1
linux/drivers/video/aty/mach64_cursor.c : 8 1 1
linux/drivers/video/clgenfb.c : 224 75 69
linux/drivers/video/cyber2000fb.c : 14 1 2
linux/drivers/video/radeon.h : 143 101 1
linux/drivers/video/radeonfb.c : 1598 846 242
linux/drivers/video/sa1100fb.c : 609 203 132
linux/drivers/video/sa1100fb.h : 14 4 4
linux/drivers/video/sis/sis_main.c : 7 0 1
linux/drivers/zorro/gen-devlist.c : 8 1 1
linux/fs/Config.in : 32 19 0
linux/fs/Makefile : 7 1 0
linux/fs/adfs/map.c : 92 15 50
linux/fs/adfs/super.c : 35 4 4
linux/fs/binfmt_aout.c : 18 5 3
linux/fs/block_dev.c : 31 10 2
linux/fs/buffer.c : 25 4 6
linux/fs/char_dev.c : 9 1 2
linux/fs/cramfs/Makefile : 14 3 4
linux/fs/cramfs/inflate/Makefile : 34 0 34
linux/fs/cramfs/inflate/adler32.c : 48 0 48
linux/fs/cramfs/inflate/infblock.c : 360 0 360
linux/fs/cramfs/inflate/infblock.h : 39 0 39
linux/fs/cramfs/inflate/infcodes.c : 247 0 247
linux/fs/cramfs/inflate/infcodes.h : 27 0 27
linux/fs/cramfs/inflate/inffast.c : 161 0 161
linux/fs/cramfs/inflate/inffast.h : 17 0 17
linux/fs/cramfs/inflate/inffixed.h : 151 0 151
linux/fs/cramfs/inflate/inflate.c : 330 0 330
linux/fs/cramfs/inflate/inftrees.c : 392 0 392
linux/fs/cramfs/inflate/inftrees.h : 58 0 58
linux/fs/cramfs/inflate/infutil.c : 87 0 87
linux/fs/cramfs/inflate/infutil.h : 98 0 98
linux/fs/cramfs/inflate/uncompr.c : 55 0 55
linux/fs/cramfs/inflate/zconf.h : 90 0 90
linux/fs/cramfs/inflate/zlib.h : 893 0 893
linux/fs/cramfs/inflate/zutil.h : 70 0 70
linux/fs/cramfs/inode.c : 14 3 1
linux/fs/cramfs/uncompress.c : 58 18 10
linux/fs/devfs/base.c : 71 27 4
linux/fs/dquot.c : 15 1 1
linux/fs/exec.c : 31 6 2
linux/fs/inflate_fs/Makefile : 33 33 0
linux/fs/inflate_fs/adler32.c : 48 48 0
linux/fs/inflate_fs/infblock.c : 355 355 0
linux/fs/inflate_fs/infblock.h : 44 44 0
linux/fs/inflate_fs/infcodes.c : 204 204 0
linux/fs/inflate_fs/infcodes.h : 33 33 0
linux/fs/inflate_fs/inffast.c : 161 161 0
linux/fs/inflate_fs/inffast.h : 17 17 0
linux/fs/inflate_fs/inffixed.h : 151 151 0
linux/fs/inflate_fs/inflate.c : 293 293 0
linux/fs/inflate_fs/inflate_syms.c : 21 21 0
linux/fs/inflate_fs/inftrees.c : 391 391 0
linux/fs/inflate_fs/inftrees.h : 63 63 0
linux/fs/inflate_fs/infutil.c : 87 87 0
linux/fs/inflate_fs/infutil.h : 197 197 0
linux/fs/inflate_fs/zconf.h : 90 90 0
linux/fs/inflate_fs/zutil.h : 70 70 0
linux/fs/isofs/Makefile : 10 3 0
linux/fs/isofs/compress.c : 363 363 0
linux/fs/isofs/inode.c : 282 116 64
linux/fs/isofs/rock.c : 91 32 5
linux/fs/isofs/rock.h : 71 15 7
linux/fs/isofs/util.c : 7 0 1
linux/fs/isofs/zisofs.h : 21 21 0
linux/fs/jffs2/background.c : 20 6 1
linux/fs/nfs/nfs2xdr.c : 28 8 6
linux/fs/nfs/nfs3xdr.c : 50 17 8
linux/fs/ntfs/dir.c : 7 1 0
linux/fs/ramfs/inode.c : 26 1 12
linux/fs/reiserfs/buffer2.c : 8 1 1
linux/fs/reiserfs/dir.c : 8 1 1
linux/fs/reiserfs/do_balan.c : 8 1 1
linux/fs/reiserfs/ibalance.c : 26 3 3
linux/fs/reiserfs/inode.c : 31 7 4
linux/fs/reiserfs/journal.c : 70 10 10
linux/fs/reiserfs/lbalance.c : 37 6 4
linux/fs/reiserfs/namei.c : 8 1 1
linux/fs/reiserfs/objectid.c : 17 2 2
linux/fs/reiserfs/prints.c : 27 1 19
linux/fs/reiserfs/stree.c : 302 41 53
linux/fs/reiserfs/super.c : 9 2 1
linux/fs/reiserfs/tail_conversion.c : 8 1 1
linux/fs/super.c : 10 3 0
linux/include/asm-alpha/a.out.h : 17 9 1
linux/include/asm-alpha/floppy.h : 6 2 0
linux/include/asm-alpha/hwrpb.h : 12 6 0
linux/include/asm-alpha/pgtable.h : 7 3 0
linux/include/asm-arm/arch-anakin/keyboard.h : 23 3 17
linux/include/asm-arm/arch-arc/keyboard.h : 36 4 16
linux/include/asm-arm/arch-cl7500/keyboard.h : 31 5 19
linux/include/asm-arm/arch-ebsa285/keyboard.h : 94 25 48
linux/include/asm-arm/arch-epxa10db/dma.h : 28 28 0
linux/include/asm-arm/arch-epxa10db/excalibur.h : 91 91 0
linux/include/asm-arm/arch-epxa10db/hardware.h : 65 65 0
linux/include/asm-arm/arch-epxa10db/int_ctrl00.h : 288 288 0
linux/include/asm-arm/arch-epxa10db/io.h : 55 55 0
linux/include/asm-arm/arch-epxa10db/irq.h : 20 20 0
linux/include/asm-arm/arch-epxa10db/irqs.h : 45 45 0
linux/include/asm-arm/arch-epxa10db/memory.h : 63 63 0
linux/include/asm-arm/arch-epxa10db/mode_ctrl00.h : 80 80 0
linux/include/asm-arm/arch-epxa10db/param.h : 21 21 0
linux/include/asm-arm/arch-epxa10db/platform.h : 7 7 0
linux/include/asm-arm/arch-epxa10db/pld_conf00.h : 73 73 0
linux/include/asm-arm/arch-epxa10db/serial.h : 50 50 0
linux/include/asm-arm/arch-epxa10db/system.h : 41 41 0
linux/include/asm-arm/arch-epxa10db/time.h : 61 61 0
linux/include/asm-arm/arch-epxa10db/timer00.h : 98 98 0
linux/include/asm-arm/arch-epxa10db/timex.h : 26 26 0
linux/include/asm-arm/arch-epxa10db/uart00.h : 181 181 0
linux/include/asm-arm/arch-epxa10db/uncompress.h : 50 50 0
linux/include/asm-arm/arch-epxa10db/vmalloc.h : 32 32 0
linux/include/asm-arm/arch-integrator/keyboard.h : 36 4 20
linux/include/asm-arm/arch-l7200/param.h : 13 9 0
linux/include/asm-arm/arch-nexuspci/keyboard.h : 31 4 19
linux/include/asm-arm/arch-rpc/keyboard.h : 32 5 16
linux/include/asm-arm/arch-sa1100/SA-1100.h : 1355 175 964
linux/include/asm-arm/arch-sa1100/SA-1111.h : 265 93 96
linux/include/asm-arm/arch-sa1100/assabet.h : 230 86 94
linux/include/asm-arm/arch-sa1100/bitfield.h : 36 7 17
linux/include/asm-arm/arch-sa1100/cerf.h : 121 102 13
linux/include/asm-arm/arch-sa1100/graphicsclient.h : 27 21 0
linux/include/asm-arm/arch-sa1100/hardware.h : 75 39 10
linux/include/asm-arm/arch-sa1100/keyboard.h : 95 11 61
linux/include/asm-arm/arch-sa1100/simpad.h : 113 20 46
linux/include/asm-arm/arch-sa1100/system.h : 15 7 2
linux/include/asm-arm/arch-shark/dma.h : 8 1 1
linux/include/asm-arm/arch-shark/hardware.h : 8 1 1
linux/include/asm-arm/arch-shark/ide.h : 8 1 1
linux/include/asm-arm/arch-shark/io.h : 8 1 1
linux/include/asm-arm/arch-shark/irq.h : 8 1 1
linux/include/asm-arm/arch-shark/irqs.h : 8 1 1
linux/include/asm-arm/arch-shark/keyboard.h : 61 25 16
linux/include/asm-arm/arch-shark/memory.h : 8 1 1
linux/include/asm-arm/arch-shark/param.h : 13 3 1
linux/include/asm-arm/arch-shark/system.h : 8 1 1
linux/include/asm-arm/arch-shark/time.h : 8 1 1
linux/include/asm-arm/arch-shark/timex.h : 6 1 1
linux/include/asm-arm/arch-shark/uncompress.h : 7 1 1
linux/include/asm-arm/arch-tbox/keyboard.h : 31 4 19
linux/include/asm-arm/hardware/ep7211.h : 40 40 0
linux/include/asm-arm/hardware/ep7212.h : 39 20 0
linux/include/asm-arm/keyboard.h : 63 43 5
linux/include/asm-arm/proc-armv/cache.h : 15 8 1
linux/include/asm-arm/proc-armv/uaccess.h : 24 6 5
linux/include/asm-arm/setup.h : 8 1 1
linux/include/asm-arm/uaccess.h : 9 1 1
linux/include/asm-i386/floppy.h : 6 1 0
linux/include/asm-i386/io.h : 35 24 0
linux/include/asm-i386/spinlock.h : 72 44 13
linux/include/asm-m68k/atarihw.h : 23 10 0
linux/include/asm-m68k/bitops.h : 17 4 0
linux/include/asm-m68k/floppy.h : 33 3 6
linux/include/asm-m68k/hardirq.h : 13 2 2
linux/include/asm-m68k/io.h : 175 57 34
linux/include/asm-m68k/mc146818rtc.h : 24 5 4
linux/include/asm-m68k/pgalloc.h : 16 2 1
linux/include/asm-m68k/pgtable.h : 19 6 1
linux/include/asm-m68k/raw_io.h : 6 1 1
linux/include/asm-m68k/semaphore.h : 17 2 2
linux/include/asm-m68k/serial.h : 8 1 1
linux/include/asm-m68k/softirq.h : 7 1 0
linux/include/asm-m68k/stat.h : 17 2 2
linux/include/asm-m68k/string.h : 15 2 0
linux/include/asm-m68k/sun3xflop.h : 33 6 6
linux/include/asm-m68k/system.h : 8 1 1
linux/include/asm-m68k/uaccess.h : 19 6 0
linux/include/asm-m68k/unistd.h : 77 15 18
linux/include/asm-m68k/zorro.h : 55 44 2
linux/include/asm-mips/floppy.h : 22 2 8
linux/include/asm-mips64/floppy.h : 22 2 8
linux/include/asm-ppc/atomic.h : 18 3 2
linux/include/asm-ppc/byteorder.h : 33 7 5
linux/include/asm-ppc/cache.h : 42 16 11
linux/include/asm-ppc/fads.h : 83 21 29
linux/include/asm-ppc/fcntl.h : 15 2 2
linux/include/asm-ppc/floppy.h : 7 3 0
linux/include/asm-ppc/io.h : 64 15 12
linux/include/asm-ppc/ivms8.h : 116 28 59
linux/include/asm-ppc/m48t35.h : 92 65 9
linux/include/asm-ppc/machdep.h : 16 1 3
linux/include/asm-ppc/mpc8xx.h : 24 3 3
linux/include/asm-ppc/oak.h : 32 7 7
linux/include/asm-ppc/pgtable.h : 93 31 7
linux/include/asm-ppc/ppcboot.h : 95 30 32
linux/include/asm-ppc/serial.h : 21 5 1
linux/include/asm-ppc/smplock.h : 22 5 1
linux/include/asm-ppc/spd8xx.h : 126 26 61
linux/include/asm-ppc/time.h : 22 5 1
linux/include/asm-ppc/uninorth.h : 22 4 2
linux/include/asm-ppc/unistd.h : 22 3 1
linux/include/asm-sparc/atomic.h : 33 10 10
linux/include/asm-sparc/bitops.h : 107 31 31
linux/include/asm-sparc/checksum.h : 118 43 44
linux/include/asm-sparc/floppy.h : 16 2 2
linux/include/asm-sparc/scatterlist.h : 28 13 5
linux/include/asm-sparc/semaphore.h : 179 78 74
linux/include/asm-sparc/spinlock.h : 83 29 27
linux/include/asm-sparc/system.h : 139 44 44
linux/include/asm-sparc/uaccess.h : 33 12 11
linux/include/asm-sparc/xor.h : 343 156 160
linux/include/asm-sparc64/floppy.h : 21 3 2
linux/include/asm-sparc64/pgalloc.h : 17 3 3
linux/include/asm-sparc64/pgtable.h : 66 9 26
linux/include/asm-sparc64/xor.h : 50 10 8
linux/include/linux/blkdev.h : 20 6 3
linux/include/linux/cdrom.h : 26 16 1
linux/include/linux/fs.h : 7 1 0
linux/include/linux/i8k.h : 46 46 0
linux/include/linux/if.h : 18 4 1
linux/include/linux/if_arp.h : 7 1 0
linux/include/linux/if_ether.h : 7 1 0
linux/include/linux/if_vlan.h : 265 265 0
linux/include/linux/iso_fs.h : 34 5 2
linux/include/linux/iso_fs_i.h : 19 7 0
linux/include/linux/iso_fs_sb.h : 8 2 0
linux/include/linux/lp.h : 9 3 0
linux/include/linux/mm.h : 98 8 35
linux/include/linux/netdevice.h : 23 9 1
linux/include/linux/netfilter_ipv4/ip_conntrack.h : 20 7 0
linux/include/linux/netfilter_ipv4/ip_conntrack_irc.h : 47 47 0
linux/include/linux/netfilter_ipv4/ipt_length.h : 9 9 0
linux/include/linux/netfilter_ipv4/ipt_ttl.h : 21 21 0
linux/include/linux/ntfs_fs.h : 18 6 6
linux/include/linux/pagemap.h : 29 5 2
linux/include/linux/pci.h : 19 3 3
linux/include/linux/pci_ids.h : 38 11 0
linux/include/linux/reiserfs_fs.h : 491 80 144
linux/include/linux/sched.h : 7 1 0
linux/include/linux/skbuff.h : 10 3 1
linux/include/linux/sockios.h : 9 3 0
linux/include/linux/swap.h : 52 6 5
linux/include/linux/tcp.h : 8 1 1
linux/include/linux/timer.h : 8 2 0
linux/include/linux/zlib_fs.h : 679 679 0
linux/include/net/inet_ecn.h : 29 0 16
linux/include/net/route.h : 12 0 5
linux/include/net/sock.h : 8 2 0
linux/include/net/tcp_ecn.h : 46 1 31
linux/kernel/exec_domain.c : 8 1 1
linux/kernel/ksyms.c : 39 3 2
linux/kernel/printk.c : 18 8 0
linux/kernel/softirq.c : 17 2 2
linux/mm/Makefile : 8 1 1
linux/mm/filemap.c : 298 133 35
linux/mm/memory.c : 362 68 95
linux/mm/mmap.c : 8 1 1
linux/mm/oom_kill.c : 122 40 53
linux/mm/page_alloc.c : 108 18 22
linux/mm/page_io.c : 22 0 9
linux/mm/shmem.c : 119 8 33
linux/mm/swap.c : 81 8 40
linux/mm/swap_state.c : 37 3 7
linux/mm/swapfile.c : 228 177 24
linux/mm/vmscan.c : 234 56 47
linux/net/802/Makefile : 6 0 3
linux/net/8021q/Makefile : 15 15 0
linux/net/8021q/vlan.c : 622 622 0
linux/net/8021q/vlan.h : 43 43 0
linux/net/8021q/vlan_dev.c : 779 779 0
linux/net/8021q/vlanproc.c : 481 481 0
linux/net/8021q/vlanproc.h : 12 12 0
linux/net/Config.in : 9 3 0
linux/net/Makefile : 7 1 0
linux/net/core/Makefile : 6 0 3
linux/net/core/dev.c : 26 10 1
linux/net/core/dv.c : 8 1 1
linux/net/ethernet/Makefile : 6 0 3
linux/net/ipv4/Makefile : 6 0 3
linux/net/ipv4/af_inet.c : 38 17 1
linux/net/ipv4/ip_gre.c : 16 0 4
linux/net/ipv4/ip_sockglue.c : 25 1 7
linux/net/ipv4/ipconfig.c : 20 8 1
linux/net/ipv4/netfilter/Config.in : 33 13 0
linux/net/ipv4/netfilter/Makefile : 29 9 0
linux/net/ipv4/netfilter/ip_conntrack_ftp.c : 8 1 1
linux/net/ipv4/netfilter/ip_conntrack_irc.c : 277 277 0
linux/net/ipv4/netfilter/ip_nat_ftp.c : 8 1 1
linux/net/ipv4/netfilter/ip_nat_irc.c : 317 317 0
linux/net/ipv4/netfilter/ip_nat_snmp_basic.c : 1354 1354 0
linux/net/ipv4/netfilter/ip_tables.c : 10 4 0
linux/net/ipv4/netfilter/ipt_LOG.c : 30 7 3
linux/net/ipv4/netfilter/ipt_length.c : 55 55 0
linux/net/ipv4/netfilter/ipt_ttl.c : 75 75 0
linux/net/ipv4/route.c : 20 1 5
linux/net/ipv4/syncookies.c : 55 7 10
linux/net/ipv4/sysctl_net_ipv4.c : 19 1 3
linux/net/ipv4/tcp.c : 19 1 3
linux/net/ipv4/tcp_input.c : 19 1 5
linux/net/ipv4/tcp_ipv4.c : 8 1 1
linux/net/ipv4/tcp_output.c : 8 1 1
linux/net/ipv6/netfilter/Config.in : 21 8 0
linux/net/ipv6/netfilter/Makefile : 10 2 0
linux/net/ipv6/netfilter/ip6_tables.c : 10 4 0
linux/net/ipv6/netfilter/ip6t_LOG.c : 355 355 0
linux/net/ipv6/netfilter/ip6t_limit.c : 91 14 14
linux/net/ipv6/netfilter/ip6t_mac.c : 26 3 3
linux/net/ipv6/netfilter/ip6t_multiport.c : 8 1 1
linux/net/ipv6/netfilter/ip6t_owner.c : 158 158 0
linux/net/ipx/Makefile : 6 0 3
linux/net/irda/Makefile : 10 0 7
linux/net/netsyms.c : 30 10 0
linux/net/packet/af_packet.c : 27 13 1
linux/net/unix/af_unix.c : 10 2 2

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:24 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part01

#!/bin/sh -x
# This is a shell archive
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
# existing files will NOT be overwritten unless -c is specified
#
# This is part 01 of a 56 - part archive
# do not concatenate these parts, unpack them in order with /bin/sh
#
if test -r _shar_seq_.tmp; then
echo "Must unpack archives in sequence!"
echo "Please unpack part `cat _shar_seq_.tmp` next"
exit 1
fi
# ============= patch-2.4.14 ==============
if test -f 'patch-2.4.14' -a X"$1" != X"-c"; then
echo 'x - skipping patch-2.4.14 (File already exists)'
rm -f _shar_wnt_.tmp;
else
> _shar_wnt_.tmp;
echo 'x - extracting patch-2.4.14 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'patch-2.4.14' &&
diff -u --recursive --new-file v2.4.13/linux/CREDITS linux/CREDITS
--- v2.4.13/linux/CREDITS Tue Oct 23 22:48:49 2001
+++ linux/CREDITS Sun Nov 4 09:31:57 2001
@@ -1868,9 +1868,8 @@
X S: Bulgaria
X
X N: Martin Mares
-E: m...@suse.cz
X E: m...@ucw.cz
-W: http://atrey.karlin.mff.cuni.cz/~mj/
+W: http://www.ucw.cz/~mj/
X D: BIOS video mode handling code
X D: MOXA C-218 serial board driver
X D: Network autoconfiguration
diff -u --recursive --new-file v2.4.13/linux/Documentation/Configure.help linux/Documentation/Configure.help
--- v2.4.13/linux/Documentation/Configure.help Tue Oct 23 22:48:49 2001
+++ linux/Documentation/Configure.help Mon Nov 5 13:40:59 2001
@@ -1412,6 +1412,12 @@
X have a high-level driver for the type of device that you want to
X support.
X
+Shuttle EPAT c7/c8 extension
+CONFIG_PARIDE_EPATC8
+ This option enables support for the newer Shuttle EP1284 (aka c7 and
+ c8) chip. You need this if you are using any recent Imation SuperDisk
+ (LS-120) drive.
+
X Shuttle EPIA protocol
X CONFIG_PARIDE_EPIA
X This option enables support for the (obsolete) EPIA parallel port
@@ -1934,6 +1940,20 @@
X If you want to compile it as a module, say M here and read
X Documentation/modules.txt. If unsure, say `N'.
X
+IRC Send/Chat support
+CONFIG_IP_NF_IRC
+ There is a commonly-used extension to IRC called
+ Direct Client-to-Client Protocol (DCC). This enables users to send
+ files to each other, and also chat to each other without the need
+ of a server. DCC Sending is used anywhere you send files over IRC,
+ and DCC Chat is most commonly used by Eggdrop bots. If you are
+ using NAT, this extension will enable you to send files and initiate
+ chats. Note that you do NOT need this extension to get files or
+ have others initiate chats, or everything else in IRC.
+
+ If you want to compile it as a module, say 'M' here and read
+ Documentation/modules.txt. If unsure, say 'N'.
+
X FTP protocol support
X CONFIG_IP_NF_FTP
X Tracking FTP connections is problematic: special helpers are
@@ -1960,6 +1980,40 @@
X
X If you want to compile it as a module, say M here and read
X Documentation/modules.txt. If unsure, say `N'.
+CONFIG_IP6_NF_MATCH_LIMIT
+ limit matching allows you to control the rate at which a rule can be
+ matched: mainly useful in combination with the LOG target ("LOG
+ target support", below) and to avoid some Denial of Service attacks.
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
+MAC address match support
+CONFIG_IP6_NF_MATCH_MAC
+ mac matching allows you to match packets based on the source
+ ethernet address of the packet.
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
+Multiple port match support
+CONFIG_IP6_NF_MATCH_MULTIPORT
+ Multiport matching allows you to match TCP or UDP packets based on
+ a series of source or destination ports: normally a rule can only
+ match a single range of ports.
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
+Owner match support (EXPERIMENTAL)
+CONFIG_IP6_NF_MATCH_OWNER
+ Packet owner matching allows you to match locally-generated packets
+ based on who created them: the user, group, process or session.
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
+
X
X limit match support
X CONFIG_IP_NF_MATCH_LIMIT
@@ -1996,6 +2050,22 @@
X If you want to compile it as a module, say M here and read
X Documentation/modules.txt. If unsure, say `N'.
X
+TTL match support
+CONFIG_IP_NF_MATCH_TTL
+ This adds CONFIG_IP_NF_MATCH_TTL option, which enabled the user
+ to match packets by their TTL value.
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
+length match support
+CONFIG_IP_NF_MATCH_LENGTH
+ This option allows you to match the length of a packet against a
+ specific value or range of values.
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
X TOS match support
X CONFIG_IP_NF_MATCH_TOS
X TOS matching allows you to match packets based on the Type Of
@@ -2075,6 +2145,20 @@
X If you want to compile it as a module, say M here and read
X Documentation/modules.txt. If unsure, say `N'.
X
+Basic SNMP-ALG support
+CONFIG_IP_NF_NAT_SNMP_BASIC
+
+ This module implements an Application Layer Gateway (ALG) for
+ SNMP payloads. In conjunction with NAT, it allows a network
+ management system to access multiple private networks with
+ conflicting addresses. It works by modifying IP addresses
+ inside SNMP payloads to match IP-layer NAT mapping.
+
+ This is the "basic" form of SNMP-ALG, as described in RFC 2962
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
X REDIRECT target support
X CONFIG_IP_NF_TARGET_REDIRECT
X REDIRECT is a special case of NAT: all incoming connections are
@@ -2215,6 +2299,14 @@
X If you want to compile it as a module, say M here and read
X Documentation/modules.txt. If unsure, say `N'.
X
+LOG target support
+CONFIG_IP6_NF_TARGET_LOG
+ This option adds a `LOG' target, which allows you to create rules in
+ any ip6tables table which records the packet header to the syslog.
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
X Packet filtering
X CONFIG_IP6_NF_FILTER
X Packet filtering defines a table `filter', which has a series of
@@ -11142,7 +11234,7 @@
X mice, joysticks, graphic tablets, or any other HID based devices
X to your computer via USB. You can't use this driver and the
X HIDBP (Boot Protocol) keyboard and mouse drivers at the same time.
- More information is available: Documentation/usb/input.txt.
+ More information is available: Documentation/input/input.txt.
X
X If unsure, say Y.
X
@@ -12166,6 +12258,15 @@
X http://www.unicode.org for more information). Say Y here if you want
X to be able to read Joliet CDROMs under Linux.
X
+Transparent decompression extension
+CONFIG_ZISOFS
+ This is a Linux-specific extension to RockRidge which lets you store
+ data in compressed form on a CD-ROM and have it transparently
+ decompressed when the CD-ROM is accessed. See
+ <http://www.kernel.org/pub/linux/utils/fs/zisofs/> for the tools
+ necessary to create such a filesystem. Say Y here if you want to be
+ able to read such compressed CD-ROMs.
+
X UDF File System support (read only)
X CONFIG_UDF_FS
X This is the new file system used on some CDROMs and DVDs. Say Y if
@@ -14948,6 +15049,25 @@
X http://www.buzzard.org.uk/toshiba/
X
X Say Y if you intend to run this kernel on a Toshiba portable.
+ Say N otherwise.
+
+Dell Inspiron 8000 support
+CONFIG_I8K
+ This adds a driver to safely access the System Management Mode
+ of the CPU on the Dell Inspiron 8000. The System Management Mode
+ is used to read cpu temperature and cooling fan status and to
+ control the fans on the I8K portables.
+
+ This driver has been tested only on the Inspiron 8000 but it may
+ also work with other Dell laptops. You can force loading on other
+ models by passing the parameter `force=1' to the module. Use at
+ your own risk.
+
+ For information on utilities to make use of this driver see the
+ I8K Linux utilities web site at:
+ http://www.debian.org/~dz/i8k/
+
+ Say Y if you intend to run this kernel on a Dell Inspiron 8000.
X Say N otherwise.
X
X /dev/cpu/microcode - Intel IA32 CPU microcode support
diff -u --recursive --new-file v2.4.13/linux/Documentation/DocBook/Makefile linux/Documentation/DocBook/Makefile
--- v2.4.13/linux/Documentation/DocBook/Makefile Tue Oct 9 17:06:51 2001
+++ linux/Documentation/DocBook/Makefile Fri Nov 2 17:13:53 2001
@@ -8,7 +8,7 @@
X HTML := $(patsubst %.sgml, %, $(BOOKS))
X IMG-parportbook := parport-share.fig parport-multi.fig parport-structure.fig
X EPS-parportbook := $(patsubst %.fig, %.eps, $(IMG-parportbook))
-JPG-parportbook := $(patsubst %.fig, %.jpeg, $(IMG-parportbook))
+PNG-parportbook := $(patsubst %.fig, %.png, $(IMG-parportbook))
X C-procfs-example = procfs_example.sgml
X
X books: $(BOOKS)
@@ -26,8 +26,8 @@
X %.eps: %.fig
X fig2dev -Leps $< $@
X
-%.jpeg: %.fig
- fig2dev -Ljpeg $< $@
+%.png: %.fig
+ fig2dev -Lpng $< $@
X
X %.sgml: %.c
X echo "<programlisting>" > $@
@@ -129,8 +129,8 @@
X $(TOPDIR)/scripts/kernel-doc -man $^ | \
X $(PERL) $(TOPDIR)/scripts/split-man $(TOPDIR)/Documentation/man
X
-parportbook: $(JPG-parportbook)
-parportbook.ps parportbook.pdf: $(EPS-parportbook)
+parportbook parportbook.pdf: $(PNG-parportbook)
+parportbook.ps: $(EPS-parportbook)
X parportbook.sgml: parportbook.tmpl $(TOPDIR)/drivers/parport/init.c
X $(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/parport/init.c <$< >$@
X
@@ -144,7 +144,7 @@
X rm -f core *~
X rm -f $(BOOKS)
X rm -f $(DVI) $(AUX) $(TEX) $(LOG) $(OUT)
- rm -f $(JPG-parportbook) $(EPS-parportbook)
+ rm -f $(PNG-parportbook) $(EPS-parportbook)
X rm -f $(C-procfs-example)
X
X mrproper: clean
@@ -172,7 +172,7 @@
X exit 1)
X rm -rf $@
X db2html $<
- if [ ! -z "$(JPG-$@)" ]; then cp $(JPG-$@) $@; fi
+ if [ ! -z "$(PNG-$@)" ]; then cp $(PNG-$@) $@; fi
X
X #
X # we could have our own dependency generator
diff -u --recursive --new-file v2.4.13/linux/Documentation/DocBook/parportbook.tmpl linux/Documentation/DocBook/parportbook.tmpl
--- v2.4.13/linux/Documentation/DocBook/parportbook.tmpl Sun Sep 23 11:40:54 2001
+++ linux/Documentation/DocBook/parportbook.tmpl Thu Oct 25 00:07:40 2001
@@ -1,5 +1,5 @@
X <!-- -*- sgml -*- -->
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN"[]>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN"[]>
X
X <book id="ParportGuide">
X <bookinfo>
@@ -184,10 +184,10 @@
X
X <mediaobject>
X <imageobject>
- <imagedata fileref="parport-share.eps" format=ps>
+ <imagedata fileref="parport-share" format="eps">
X </imageobject>
X <imageobject>
- <imagedata fileref="parport-share.jpeg" format=jpeg>
+ <imagedata fileref="parport-share.png" format="png">
X </imageobject>
X </mediaobject>
X
@@ -270,10 +270,10 @@
X
X <mediaobject>
X <imageobject>
- <imagedata format=eps fileref="parport-structure.eps">
+ <imagedata fileref="parport-structure" format="eps">
X </imageobject>
X <imageobject>
- <imagedata format=jpeg fileref="parport-structure.jpeg">
+ <imagedata fileref="parport-structure.png" format="png">
X </imageobject>
X </mediaobject>
X
@@ -461,10 +461,10 @@
X
X <mediaobject>
X <imageobject>
- <imagedata format=eps fileref="parport-multi.eps">
+ <imagedata fileref="parport-multi" format="eps">
X </imageobject>
X <imageobject>
- <imagedata format=jpeg fileref="parport-multi.jpeg">
+ <imagedata fileref="parport-multi.png" format="png">
X </imageobject>
X </mediaobject>
X
diff -u --recursive --new-file v2.4.13/linux/Documentation/arm/SA1100/Assabet linux/Documentation/arm/SA1100/Assabet
--- v2.4.13/linux/Documentation/arm/SA1100/Assabet Tue Oct 9 17:06:51 2001
+++ linux/Documentation/arm/SA1100/Assabet Thu Oct 25 13:53:44 2001
@@ -245,32 +245,58 @@
X June 12, 2001
X
X
-Status of peripherals in -rmk tree
-----------------------------------
+Status of peripherals in -rmk tree (updated 14/10/2001)
+-------------------------------------------------------
X
X Assabet:
X Serial ports:
- Radio: TX, RX, CTS, DSR, DCD, RI
- COM: TX, RX, CTS, DSR, DCD, RTS, DTR, PM
- I2C: TX, RX
- L3: No
+ Radio: TX, RX, CTS, DSR, DCD, RI
+ PM: Not tested.
+ COM: TX, RX, CTS, DSR, DCD, RTS, DTR, PM
+ PM: Not tested.
+ I2C: Implemented, not fully tested.
+ L3: Fully tested, pass.
+ PM: Not tested.
X
X Video:
- LCD: PM
- Video out: Not fully
- Touchscreen: No
+ LCD: Fully tested. PM
+ (LCD doesn't like being blanked with
+ neponset connected)
+ Video out: Not fully
X
X Audio:
- Codec: No
- POTS: No
+ UDA1341:
+ Playback: Fully tested, pass.
+ Record: Implemented, not tested.
+ PM: Not tested.
+
+ UCB1200:
+ Audio play: Implemented, not heavily tested.
+ Audio rec: Implemented, not heavily tested.
+ Telco audio play: Implemented, not heavily tested.
+ Telco audio rec: Implemented, not heavily tested.
+ POTS control: No
+ Touchscreen: Yes
+ PM: Not tested.
X
X Other:
- PCMCIA: Yes
- USB: No
+ PCMCIA:
+ LPE: Fully tested, pass.
+ USB: No
+ IRDA:
+ SIR: Fully tested, pass.
+ FIR: Fully tested, pass.
+ PM: Not tested.
X
X Neponset:
X Serial ports:
X COM1,2: TX, RX, CTS, DSR, DCD, RTS, DTR
+ PM: Not tested.
+ USB: Implemented, not heavily tested.
+ PCMCIA: Implemented, not heavily tested.
+ PM: Not tested.
+ CF: Implemented, not heavily tested.
+ PM: Not tested.
X
X More stuff can be found in the -np (Nicolas Pitre's) tree.
X
diff -u --recursive --new-file v2.4.13/linux/Documentation/computone.txt linux/Documentation/computone.txt
--- v2.4.13/linux/Documentation/computone.txt Fri Jul 28 12:50:51 2000
+++ linux/Documentation/computone.txt Fri Nov 2 17:26:17 2001
@@ -4,16 +4,14 @@
X
X Release Notes For Linux Kernel 2.2 and higher.
X These notes are for the drivers which have already been integrated into the
-kernel and have been tested on Linux kernels 2.0, 2.2, and 2.3.
+kernel and have been tested on Linux kernels 2.0, 2.2, 2.3, and 2.4.
X
-Version: 1.2.9
-Date: 04/12/2000
-Author: Andrew Manison <aman...@america.net>
-Testing: lar...@computone.com
+Version: 1.2.14
+Date: 11/01/2001
+Historical Author: Andrew Manison <aman...@america.net>
+Primary Author: Doug McNash
X Support: sup...@computone.com
-Fixes and Updates: Doug McNash <do...@computone.com>
-Proc Filesystem and Kernel Integration: Mike Warfield <m...@wittsend.com>
-
+Fixes and Updates: Mike Warfield <m...@wittsend.com>
X
X This file assumes that you are using the Computone drivers which are
X integrated into the kernel sources. For updating the drivers or installing
@@ -28,7 +26,7 @@
X products previous to the Intelliport II.
X
X This driver was developed on the v2.0.x Linux tree and has been tested up
-to v2.2.14; it will probably not work with earlier v1.X kernels,.
+to v2.4.14; it will probably not work with earlier v1.X kernels,.
X
X
X 2. QUICK INSTALLATION
@@ -42,7 +40,7 @@
X before or after drivers installation.
X
X Note the hardware address from the Computone ISA cards installed into
- the system. These are required for editing ip2.h or editing
+ the system. These are required for editing ip2.c or editing
X /etc/modules.conf, or for specification on the modprobe
X command line.
X
@@ -58,7 +56,7 @@
X Select (m) module for CONFIG_COMPUTONE under character
X devices. CONFIG_PCI and CONFIG_MODULES also may need to be set.
X c) Set address on ISA cards then:
- edit /usr/src/linux/drivers/char/ip2/ip2.h if needed
+ edit /usr/src/linux/drivers/char/ip2.c if needed
X or
X edit /etc/modules.conf if needed (module).
X or both to match this setting.
@@ -77,7 +75,8 @@
X Select (y) kernel for CONFIG_COMPUTONE under character
X devices. CONFIG_PCI may need to be set if you have PCI bus.
X c) Set address on ISA cards then:
- edit /usr/src/linux/drivers/char/ip2/ip2.h
+ edit /usr/src/linux/drivers/char/ip2.c
+ (Optional - may be specified on kernel command line now)
X d) Run "make dep"
X e) Run "make zImage" or whatever target you prefer.
X f) mv /usr/src/linux/arch/i386/boot/zImage to /boot.
@@ -86,6 +85,41 @@
X h) Reboot using this kernel
X i) run ip2mkdev (either the script below or the binary version)
X
+Kernel command line options:
+
+When compiling the driver into the kernel, io and irq may be
+compiled into the driver by editing ip2.c and setting the values for
+io and irq in the appropriate array. An alternative is to specify
+a command line parameter to the kernel at boot up.
+
+ ip2=io0,irq0,io1,irq1,io2,irq2,io3,irq3
+
+Note that this order is very different from the specifications for the
+modload parameters which have separate IRQ and IO specifiers.
+
+The io port also selects PCI (1) and EISA (2) boards.
+
+ io=0 No board
+ io=1 PCI board
+ io=2 EISA board
+ else ISA board io address
+
+You only need to specify the boards which are present.
+
+ Examples:
+
+ 2 PCI boards:
+
+ ip2=1,0,1,0
+
+ 1 ISA board at 0x310 irq 5:
+
+ ip2=0x310,5
+
+This can be added to and "append" option in lilo.conf similar to this:
+
+ append="ip2=1,0,1,0"
+
X
X 3. INSTALLATION
X
@@ -100,7 +134,7 @@
X The driver can be installed as a module (recommended) or built into the
X kernel. This is selected as for other drivers through the `make config`
X command from the root of the Linux source tree. If the driver is built
-into the kernel you will need to edit the file ip2.h to match the boards
+into the kernel you will need to edit the file ip2.c to match the boards
X you are installing. See that file for instructions. If the driver is
X installed as a module the configuration can also be specified on the
X modprobe command line as follows:
@@ -109,13 +143,13 @@
X
X where irqnum is one of the valid Intelliport II interrupts (3,4,5,7,10,11,
X 12,15) and addr1-4 are the base addresses for up to four controllers. If
-the irqs are not specified the driver uses the default in ip2/ip2.h (which
+the irqs are not specified the driver uses the default in ip2.c (which
X selects polled mode). If no base addresses are specified the defaults in
-ip2.h are used. If you are autoloading the driver module with kerneld or
-kmod the base addresses and interrupt number must also be set in ip2/ip2.h
+ip2.c are used. If you are autoloading the driver module with kerneld or
+kmod the base addresses and interrupt number must also be set in ip2.c
X and recompile or just insert and options line in /etc/modules.conf or both.
X The options line is equivalent to the command line and takes precidence over
-what is in ip2.h.
+what is in ip2.c.
X
X /etc/modules.conf sample:
X options ip2 io=1,0x328 irq=1,10
@@ -123,22 +157,18 @@
X alias char-major-72 ip2
X alias char-major-73 ip2
X
-equivelant ip2.h:
-static ip2config_t ip2config =
-{
- {1,10,0,0},
- {
- 0x0001, // Board 0, ttyF0 - ttyF63 /* PCI card */
- 0x0328, // Board 1, ttyF64 - ttyF127 /* ISA card */
- 0x0000, // Board 2, ttyF128 - ttyF191 /* empty */
- 0x0000 // Board 3, ttyF192 - ttyF255 /* empty */
- }
-};
+The equivalent in ip2.c:
+
+static int io[IP2_MAX_BOARDS]= { 1, 0x328, 0, 0 };
+static int irq[IP2_MAX_BOARDS] = { 1, 10, -1, -1 };
+
+The equivalent for the kernel command line (in lilo.conf):
+
+ append="ip2=1,1,0x328,10"
X
X
X Note: Both io and irq should be updated to reflect YOUR system. An "io"
- address of "1/2" indicates a PCI/EISA card in the board table. The
- PCI or EISA irq will be assigned automatically.
+ address of 1 or 2 indicates a PCI or EISA card in the board table. The PCI or EISA irq will be assigned automatically.
X
X Specifying an invalid or in-use irq will default the driver into
X running in polled mode for that card. If all irq entries are 0 then
@@ -162,18 +192,26 @@
X cuf0 - cuf255 for callout devices.
X
X If you are using devfs, existing devices are automatically created within
-the devfs name space. Normal devices will be ttf/0 - ttf/255 and callout
-devices will be cuf/0 - cuf/255. With devfs installed, ip2mkdev will
+the devfs name space. Normal devices will be tts/F0 - tts/F255 and callout
+devices will be cua/F0 - cua/F255. With devfs installed, ip2mkdev will
X create symbolic links in /dev from the old conventional names to the newer
X devfs names as follows:
X
X /dev/ip2ipl[n] -> /dev/ip2/ipl[n] n = 0 - 3
X /dev/ip2stat[n] -> /dev/ip2/stat[n] n = 0 - 3
- /dev/ttyF[n] -> /dev/ttf/[n] n = 0 - 255
- /dev/cuf[n] -> /dev/cuf/[n] n = 0 - 255
+ /dev/ttyF[n] -> /dev/tts/F[n] n = 0 - 255
+ /dev/cuf[n] -> /dev/cua/F[n] n = 0 - 255
X
X Only devices for existing ports and boards will be created.
X
+IMPORTANT NOTE: The naming convention used for devfs by this driver
+was changed from 1.2.12 to 1.2.13. The old naming convention was to
+use ttf/%d for the tty device and cuf/%d for the cua device. That
+has been changed to conform to an agreed-upon standard of placing
+all the tty devices under tts. The device names are now tts/F%d for
+the tty device and cua/F%d for the cua devices. If you were using
+the older devfs names, you must update for the newer convention.
+
X You do not need to run ip2mkdev if you are using devfs and only want to
X use the devfs native device names.
X
@@ -229,18 +267,26 @@
X documentation files, .../linux/Documentation/filesystems/devfs/REAME.
X
X If you are using devfs, existing devices are automatically created within
-the devfs name space. Normal devices will be ttf/0 - ttf/255 and callout
-devices will be cuf/0 - cuf/255. With devfs installed, ip2mkdev will
+the devfs name space. Normal devices will be tts/F0 - tts/F255 and callout
+devices will be cua/F0 - cua/F255. With devfs installed, ip2mkdev will
X create symbolic links in /dev from the old conventional names to the newer
X devfs names as follows:
X
X /dev/ip2ipl[n] -> /dev/ip2/ipl[n] n = 0 - 3
X /dev/ip2stat[n] -> /dev/ip2/stat[n] n = 0 - 3
- /dev/ttyF[n] -> /dev/ttf/[n] n = 0 - 255
- /dev/cuf[n] -> /dev/cuf/[n] n = 0 - 255
+ /dev/ttyF[n] -> /dev/tts/F[n] n = 0 - 255
+ /dev/cuf[n] -> /dev/cua/F[n] n = 0 - 255
X
X Only devices for existing ports and boards will be created.
X
+IMPORTANT NOTE: The naming convention used for devfs by this driver
+was changed from 1.2.12 to 1.2.13. The old naming convention was to
+use ttf/%d for the tty device and cuf/%d for the cua device. That
+has been changed to conform to an agreed-upon standard of placing
+all the tty devices under tts. The device names are now tts/F%d for
+the tty device and cua/F%d for the cua devices. If you were using
+the older devfs names, you must update for the newer convention.
+
X You do not need to run ip2mkdev if you are using devfs and only want to
X use the devfs native device names.
X
@@ -269,19 +315,19 @@
X
X
X #!/bin/sh
-# This is a shell archive (produced by GNU sharutils 4.2).
+# This is a shell archive (produced by GNU sharutils 4.2.1).
X # To extract the files from this archive, save it to some FILE, remove
X # everything before the `!/bin/sh' line above, then type `sh FILE'.
X #
-# Made on 2000-03-10 11:55 EST by <ro...@wittsend.wittsend.com>.
-# Source directory was `/mnt1/src/linux-2.3.50c/Documentation'.
+# Made on 2001-10-29 10:32 EST by <m...@alcove.wittsend.com>.
+# Source directory was `/home2/src/tmp'.
X #
X # Existing files will *not* be overwritten unless `-c' is specified.
X #
X # This shar contains:
X # length mode name
X # ------ ---------- ------------------------------------------
-# 4061 -rwxr-xr-x ip2mkdev
+# 4251 -rwxr-xr-x ip2mkdev
X #
X save_IFS="${IFS}"
X IFS="${IFS}:"
@@ -316,9 +362,12 @@
X export TEXTDOMAIN
X echo="$gettext_dir/gettext -s"
X fi
-touch -am 1231235999 $$.touch >/dev/null 2>&1
-if test ! -f 1231235999 && test -f $$.touch; then
- shar_touch=touch
+if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
+ shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
+elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
+ shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
+elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
+ shar_touch='touch -am $3$4$5$6$2 "$8"'
X else
X shar_touch=:
X echo
@@ -326,9 +375,9 @@
X $echo "installing GNU \`touch', distributed in GNU File Utilities..."
X echo
X fi
-rm -f 1231235999 $$.touch
+rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
X #
-if mkdir _sh17088; then
+if mkdir _sh17581; then
X $echo 'x -' 'creating lock directory'
X else
X $echo 'failed to create lock directory'
@@ -356,11 +405,14 @@
X # before running this script. Running this script will then recreate
X # all the valid devices.
X #
-# =mhw=
X # Michael H. Warfield
+# /\/\|=mhw=|\/\/
X # m...@wittsend.com
X #
-# Updated 03/09/2000 for devfs support in ip2 drivers. =mhw=
+# Updated 10/29/2000 for version 1.2.13 naming convention
+# under devfs. /\/\|=mhw=|\/\/
+#
+# Updated 03/09/2000 for devfs support in ip2 drivers. /\/\|=mhw=|\/\/
X #
X X
X if test -d /dev/ip2 ; then
@@ -375,18 +427,19 @@
X X ln -s ip2/$i ip2$i
X X fi
X X done
-X for i in `ls ttf` ; do
-X if test ! -L ttyF$i ; then
+X for i in `( cd tts ; ls F* )` ; do
+X if test ! -L tty$i ; then
X X # Remove it incase it wasn't a symlink (old device)
-X rm -f ttyF$i
-X ln -s ttyf/$i ttyF$i
+X rm -f tty$i
+X ln -s tts/$i tty$i
X X fi
X X done
-X for i in `ls cuf` ; do
-X if test ! -L cuf$i ; then
+X for i in `( cd cua ; ls F* )` ; do
+X DEVNUMBER=`expr $i : 'F\(.*\)'`
+X if test ! -L cuf$DEVNUMBER ; then
X X # Remove it incase it wasn't a symlink (old device)
-X rm -f cuf$i
-X ln -s cuf/$i cuf$i
+X rm -f cuf$DEVNUMBER
+X ln -s cua/$i cuf$DEVNUMBER
X X fi
X X done
X X exit 0
@@ -508,20 +561,20 @@
X X
X Xexit 0
X SHAR_EOF
- $shar_touch -am 03101153100 'ip2mkdev' &&
+ (set 20 01 10 29 10 32 01 'ip2mkdev'; eval "$shar_touch") &&
X chmod 0755 'ip2mkdev' ||
X $echo 'restore of' 'ip2mkdev' 'failed'
X if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
X && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
X md5sum -c << SHAR_EOF >/dev/null 2>&1 \
X || $echo 'ip2mkdev:' 'MD5 check failed'
-b0671abeba07b0a9266b70aaf24509b3 ip2mkdev
+cb5717134509f38bad9fde6b1f79b4a4 ip2mkdev
X SHAR_EOF
X else
X shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'ip2mkdev'`"
- test 4061 -eq "$shar_count" ||
- $echo 'ip2mkdev:' 'original size' '4061,' 'current size' "$shar_count!"
+ test 4251 -eq "$shar_count" ||
+ $echo 'ip2mkdev:' 'original size' '4251,' 'current size' "$shar_count!"
X fi
X fi
-rm -fr _sh17088
+rm -fr _sh17581
X exit 0
diff -u --recursive --new-file v2.4.13/linux/Documentation/filesystems/devfs/ChangeLog linux/Documentation/filesystems/devfs/ChangeLog
--- v2.4.13/linux/Documentation/filesystems/devfs/ChangeLog Thu Oct 11 08:02:26 2001
+++ linux/Documentation/filesystems/devfs/ChangeLog Sat Nov 3 10:06:38 2001
@@ -1771,3 +1771,10 @@
X - Fixed buffer underrun in <try_modload>
X
X - Moved down_read() from <search_for_entry_in_dir> to <find_entry>
+===============================================================================
+Changes for patch v196
+
+- Fixed race in <devfsd_ioctl> when setting event mask
+ Thanks to Kari Hurtta <hur...@leija.mh.fmi.fi>
+
+- Avoid deadlock in <devfs_follow_link> by using temporary buffer
diff -u --recursive --new-file v2.4.13/linux/Documentation/filesystems/vfat.txt linux/Documentation/filesystems/vfat.txt
--- v2.4.13/linux/Documentation/filesystems/vfat.txt Wed Apr 11 19:02:27 2001
+++ linux/Documentation/filesystems/vfat.txt Thu Oct 25 13:53:44 2001
@@ -48,8 +48,15 @@
X r: relaxed, case insensitive
X n: normal, default setting, currently case insensitive
X
-nocase -- Returning with having the 8.3 format alias kept in
- the disk. Default, return lowercase letter.
+shortname=lower|win95|winnt|mixed
+ -- Shortname display/create setting.
+ lower: convert to lowercase for display,
+ emulate the Windows 95 rule for create.
+ win95: emulate the Windows 95 rule for display/create.
+ winnt: emulate the Windows NT rule for display/create.
+ mixed: emulate the Windows NT rule for display,
+ emulate the Windows 95 rule for create.
+ Default setting is `lower'.
X
X <bool>: 0,1,yes,no,true,false
X
diff -u --recursive --new-file v2.4.13/linux/Documentation/networking/8139too.txt linux/Documentation/networking/8139too.txt
--- v2.4.13/linux/Documentation/networking/8139too.txt Tue Oct 23 22:48:49 2001
+++ linux/Documentation/networking/8139too.txt Thu Oct 25 14:01:51 2001
@@ -17,9 +17,6 @@
X Disclaimer
X ----------
X
-THIS DRIVER IS A DEVELOPMENT RELEASE FOR A DEVELOPMENT KERNEL. DO NOT
-USE IN A PRODUCTION ENVIRONMENT.
-
X DO NOT CONTACT DONALD BECKER FOR SUPPORT OF THIS DRIVER, his driver is
X completely different and maintained independently of the 8139too code base.
X
@@ -95,6 +92,7 @@
X Tested Adapters
X ---------------
X AOpen ALN-325C
+AT-2500TX 10/100 PCI Fast Ethernet Network Adapter Card
X KTI KF-230TX
X KTI KF-230TX/2
X Lantech FastNet TX
diff -u --recursive --new-file v2.4.13/linux/Documentation/pci.txt linux/Documentation/pci.txt
--- v2.4.13/linux/Documentation/pci.txt Sun Aug 12 13:27:58 2001
+++ linux/Documentation/pci.txt Sun Nov 4 09:31:57 2001
@@ -1,6 +1,6 @@
X How To Write Linux PCI Drivers
X
- by Martin Mares <m...@suse.cz> on 07-Feb-2000
+ by Martin Mares <m...@ucw.cz> on 07-Feb-2000
X
X ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X The world of PCI is vast and it's full of (mostly unpleasant) surprises.
diff -u --recursive --new-file v2.4.13/linux/MAINTAINERS linux/MAINTAINERS
--- v2.4.13/linux/MAINTAINERS Tue Oct 23 22:48:49 2001
+++ linux/MAINTAINERS Sun Nov 4 09:31:58 2001
@@ -93,7 +93,12 @@
X L: linux...@vger.kernel.org
X S: Maintained
X
-8139TOO ETHERNET DRIVER
+8139CP 10/100 FAST ETHERNET DRIVER
+P: Jeff Garzik
+M: jga...@mandrakesoft.com
+S: Maintained
+
+8139TOO 10/100 FAST ETHERNET DRIVER
X P: Jeff Garzik
X M: jga...@mandrakesoft.com
X W: http://sourceforge.net/projects/gkernel/
@@ -296,9 +301,7 @@
X S: Supported
X
X COMPUTONE INTELLIPORT MULTIPORT CARD
-P: Doug McNash
X P: Michael H. Warfield
-M: Doug McNash <do...@computone.com>
X M: Michael H. Warfield <m...@wittsend.com>
X W: http://www.computone.com/
X W: http://www.wittsend.com/computone.html
@@ -642,6 +645,13 @@
X L: Linux-...@vger.kernel.org
X S: Maintained
X
+i386 SETUP CODE / CPU ERRATA WORKAROUNDS
+P: Dave Jones
+M: da...@suse.de
+P: H. Peter Anvin
+M: h...@zytor.com
+S: Maintained
+
X i810 TCO TIMER WATCHDOG
X P: Nils Faerber
X M: ni...@kernelconcepts.de
@@ -1141,9 +1151,9 @@
X
X PCI SUBSYSTEM
X P: Martin Mares
-M: m...@suse.cz
+M: m...@ucw.cz
X L: linux-...@vger.kernel.org
-S: Supported
+S: Odd Fixes
X
X PCMCIA SUBSYSTEM
X P: David Hinds
@@ -1391,7 +1401,7 @@
X
X SVGA HANDLING
X P: Martin Mares
-M: m...@suse.cz
+M: m...@ucw.cz
X L: linux...@atrey.karlin.mff.cuni.cz
X S: Maintained
X
diff -u --recursive --new-file v2.4.13/linux/Makefile linux/Makefile
--- v2.4.13/linux/Makefile Tue Oct 23 22:48:49 2001
+++ linux/Makefile Mon Nov 5 12:30:48 2001
@@ -1,6 +1,6 @@
X VERSION = 2
X PATCHLEVEL = 4
-SUBLEVEL = 13
+SUBLEVEL = 14
X EXTRAVERSION =
X
X KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
diff -u --recursive --new-file v2.4.13/linux/arch/alpha/config.in linux/arch/alpha/config.in
--- v2.4.13/linux/arch/alpha/config.in Tue Oct 9 17:06:51 2001
+++ linux/arch/alpha/config.in Mon Nov 5 09:47:41 2001
@@ -217,6 +217,10 @@
X bool 'Symmetric multi-processing support' CONFIG_SMP
X fi
X
+if [ "$CONFIG_SMP" = "y" ]; then
+ define_bool CONFIG_HAVE_DEC_LOCK y
+fi
+
X if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
X bool 'Discontiguous Memory Support' CONFIG_DISCONTIGMEM
X if [ "$CONFIG_DISCONTIGMEM" = "y" ]; then
diff -u --recursive --new-file v2.4.13/linux/arch/alpha/kernel/alpha_ksyms.c linux/arch/alpha/kernel/alpha_ksyms.c
--- v2.4.13/linux/arch/alpha/kernel/alpha_ksyms.c Tue Oct 23 22:48:49 2001
+++ linux/arch/alpha/kernel/alpha_ksyms.c Mon Nov 5 09:47:41 2001
@@ -221,6 +221,7 @@
X EXPORT_SYMBOL(__global_sti);
X EXPORT_SYMBOL(__global_save_flags);
X EXPORT_SYMBOL(__global_restore_flags);
+EXPORT_SYMBOL(atomic_dec_and_lock);
X #if DEBUG_SPINLOCK
X EXPORT_SYMBOL(spin_unlock);
X EXPORT_SYMBOL(debug_spin_lock);
diff -u --recursive --new-file v2.4.13/linux/arch/alpha/kernel/osf_sys.c linux/arch/alpha/kernel/osf_sys.c
--- v2.4.13/linux/arch/alpha/kernel/osf_sys.c Mon Aug 27 12:41:37 2001
+++ linux/arch/alpha/kernel/osf_sys.c Fri Nov 2 17:39:20 2001
@@ -1320,3 +1320,67 @@
X
X return ret;
X }
+
+/* Get an address range which is currently unmapped. Similar to the
+ generic version except that we know how to honor ADDR_LIMIT_32BIT. */
+
+static unsigned long
+arch_get_unmapped_area_1(unsigned long addr, unsigned long len,
+ unsigned long limit)
+{
+ struct vm_area_struct *vma = find_vma(current->mm, addr);
+
+ while (1) {
+ /* At this point: (!vma || addr < vma->vm_end). */
+ if (limit - len < addr)
+ return -ENOMEM;
+ if (!vma || addr + len <= vma->vm_start)
+ return addr;
+ addr = vma->vm_end;
+ vma = vma->vm_next;
+ }
+}
+
+unsigned long
+arch_get_unmapped_area(struct file *filp, unsigned long addr,
+ unsigned long len, unsigned long pgoff,
+ unsigned long flags)
+{
+ unsigned long limit;
+
+ /* "32 bit" actually means 31 bit, since pointers sign extend. */
+ if (current->personality & ADDR_LIMIT_32BIT)
+ limit = 0x80000000;
+ else
+ limit = TASK_SIZE;
+
+ if (len > limit)
+ return -ENOMEM;
+
+ /* First, see if the given suggestion fits.
+
+ The OSF/1 loader (/sbin/loader) relies on us returning an
+ address larger than the requested if one exists, which is
+ a terribly broken way to program.
+
+ That said, I can see the use in being able to suggest not
+ merely specific addresses, but regions of memory -- perhaps
+ this feature should be incorporated into all ports? */
+
+ if (addr) {
+ addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit);
+ if (addr != -ENOMEM)
+ return addr;
+ }
+
+ /* Next, try allocating at TASK_UNMAPPED_BASE. */
+ addr = arch_get_unmapped_area_1 (PAGE_ALIGN(TASK_UNMAPPED_BASE),
+ len, limit);
+ if (addr != -ENOMEM)
+ return addr;
+
+ /* Finally, try allocating in low memory. */
+ addr = arch_get_unmapped_area_1 (PAGE_SIZE, len, limit);
+
+ return addr;
+}
diff -u --recursive --new-file v2.4.13/linux/arch/alpha/kernel/pci.c linux/arch/alpha/kernel/pci.c
--- v2.4.13/linux/arch/alpha/kernel/pci.c Tue Oct 23 22:48:49 2001
+++ linux/arch/alpha/kernel/pci.c Fri Nov 2 17:39:20 2001
@@ -93,16 +93,18 @@
X
X /* The Cypress bridge responds on the PCI bus in the address range
X 0xffff0000-0xffffffff (conventional x86 BIOS ROM). There is no
- way to turn this off, so if we use a large direct-map window, or
- a large SG window, we must avoid this region. */
+ way to turn this off. The bridge also supports several extended
+ BIOS ranges (disabled after power-up), and some consoles do turn
+ them on. So if we use a large direct-map window, or a large SG
+ window, we must avoid entire 0xfff00000-0xffffffff region. */
X else if (dev->class >> 8 == PCI_CLASS_BRIDGE_ISA) {
- if (__direct_map_base + __direct_map_size >= 0xffff0000)
- __direct_map_size = 0xffff0000 - __direct_map_base;
+ if (__direct_map_base + __direct_map_size >= 0xfff00000)
+ __direct_map_size = 0xfff00000 - __direct_map_base;
X else {
X struct pci_controller *hose = dev->sysdata;
X struct pci_iommu_arena *pci = hose->sg_pci;
- if (pci && pci->dma_base + pci->size >= 0xffff0000)
- pci->size = 0xffff0000 - pci->dma_base;
+ if (pci && pci->dma_base + pci->size >= 0xfff00000)
+ pci->size = 0xfff00000 - pci->dma_base;
X }
X }
X }
diff -u --recursive --new-file v2.4.13/linux/arch/alpha/kernel/pci_iommu.c linux/arch/alpha/kernel/pci_iommu.c
--- v2.4.13/linux/arch/alpha/kernel/pci_iommu.c Tue Oct 23 22:48:49 2001
+++ linux/arch/alpha/kernel/pci_iommu.c Mon Nov 5 09:47:41 2001
@@ -250,7 +250,7 @@
X if (dir == PCI_DMA_NONE)
X BUG();
X return pci_map_single_1(pdev, cpu_addr, size,
- (pdev->dma_mask >> 32) != 0);
+ pdev ? (pdev->dma_mask >> 32) != 0 : 0);
X }
X
X dma_addr_t
@@ -260,7 +260,7 @@
X if (dir == PCI_DMA_NONE)
X BUG();
X return pci_map_single_1(pdev, (char *)page_address(page) + offset,
- size, (pdev->dma_mask >> 32) != 0);
+ size, pdev ? (pdev->dma_mask >> 32) != 0 : 0);
X }
X
X /* Unmap a single streaming mode DMA translation. The DMA_ADDR and
@@ -304,7 +304,7 @@
X dma_ofs = (dma_addr - arena->dma_base) >> PAGE_SHIFT;
X if (dma_ofs * PAGE_SIZE >= arena->size) {
X printk(KERN_ERR "Bogus pci_unmap_single: dma_addr %lx "
- " base %x size %x\n", dma_addr, arena->dma_base,
+ " base %lx size %x\n", dma_addr, arena->dma_base,
X arena->size);
X return;
X BUG();
diff -u --recursive --new-file v2.4.13/linux/arch/alpha/kernel/setup.c linux/arch/alpha/kernel/setup.c
--- v2.4.13/linux/arch/alpha/kernel/setup.c Tue Oct 9 17:06:51 2001
+++ linux/arch/alpha/kernel/setup.c Fri Nov 2 17:39:20 2001
@@ -1054,7 +1054,8 @@
X
X static char cpu_names[][8] = {
X "EV3", "EV4", "Simulate", "LCA4", "EV5", "EV45", "EV56",
- "EV6", "PCA56", "PCA57", "EV67", "EV68CB", "EV68AL"
+ "EV6", "PCA56", "PCA57", "EV67", "EV68CB", "EV68AL",
+ "EV68CX", "EV7", "EV79", "EV69"
X };
X
X struct percpu_struct *cpu;
diff -u --recursive --new-file v2.4.13/linux/arch/alpha/kernel/time.c linux/arch/alpha/kernel/time.c
--- v2.4.13/linux/arch/alpha/kernel/time.c Tue Oct 9 17:06:51 2001
+++ linux/arch/alpha/kernel/time.c Fri Nov 2 17:39:20 2001
@@ -169,6 +169,63 @@
X init_rtc_irq();
X }
X
+
+/* Validate a computed cycle counter result against the known bounds for
+ the given processor core. There's too much brokenness in the way of
+ timing hardware for any one method to work everywhere. :-(
+
+ Return 0 if the result cannot be trusted, otherwise return the argument. */
+
+static unsigned long __init
+validate_cc_value(unsigned long cc)
+{
+ static struct bounds {
+ unsigned int min, max;
+ } cpu_hz[] __initdata = {
+ [EV3_CPU] = { 50000000, 200000000 }, /* guess */
+ [EV4_CPU] = { 150000000, 300000000 },
+ [LCA4_CPU] = { 150000000, 300000000 }, /* guess */
+ [EV45_CPU] = { 200000000, 300000000 },
+ [EV5_CPU] = { 266000000, 333333333 },
+ [EV56_CPU] = { 366000000, 667000000 },
+ [PCA56_CPU] = { 400000000, 600000000 }, /* guess */
+ [PCA57_CPU] = { 500000000, 600000000 }, /* guess */
+ [EV6_CPU] = { 466000000, 600000000 },
+ [EV67_CPU] = { 600000000, 750000000 },
+ [EV68AL_CPU] = { 750000000, 940000000 },
+ [EV68CB_CPU] = { 1000000000, 1333333333 },
+ /* None of the following are shipping as of 2001-11-01. */
+ [EV68CX_CPU] = { 1000000000, 1700000000 }, /* guess */
+ [EV69_CPU] = { 1000000000, 1700000000 }, /* guess */
+ [EV7_CPU] = { 800000000, 1400000000 }, /* guess */
+ [EV79_CPU] = { 1000000000, 2000000000 }, /* guess */
+ };
+
+ /* Allow for some drift in the crystal. 10MHz is more than enough. */
+ const unsigned int deviation = 10000000;
+
+ struct percpu_struct *cpu;
+ unsigned int index;
+
+ cpu = (struct percpu_struct *)((char*)hwrpb + hwrpb->processor_offset);
+ index = cpu->type & 0xffffffff;
+
+ /* If index out of bounds, no way to validate. */
+ if (index >= sizeof(cpu_hz)/sizeof(cpu_hz[0]))
+ return cc;
+
+ /* If index contains no data, no way to validate. */
+ if (cpu_hz[index].max == 0)
+ return cc;
+
+ if (cc < cpu_hz[index].min - deviation
+ || cc > cpu_hz[index].max + deviation)
+ return 0;
+
+ return cc;
+}
+
+
X /*
X * Calibrate CPU clock using legacy 8254 timer/counter. Stolen from
X * arch/i386/time.c.
@@ -180,8 +237,7 @@
X static unsigned long __init
X calibrate_cc_with_pic(void)
X {
- int cc;
- unsigned long count = 0;
+ int cc, count = 0;
X
X /* Set the Gate high, disable speaker */
X outb((inb(0x61) & ~0x02) | 0x01, 0x61);
@@ -200,30 +256,18 @@
X cc = rpcc();
X do {
X count++;
- } while ((inb(0x61) & 0x20) == 0);
+ } while ((inb(0x61) & 0x20) == 0 && count > 0);
X cc = rpcc() - cc;
X
- /* Error: ECTCNEVERSET */
+ /* Error: ECTCNEVERSET or ECPUTOOFAST. */
X if (count <= 1)
- goto bad_ctc;
+ return 0;
X
- /* Error: ECPUTOOFAST */
- if (count >> 32)
- goto bad_ctc;
-
- /* Error: ECPUTOOSLOW */
+ /* Error: ECPUTOOSLOW. */
X if (cc <= CALIBRATE_TIME)
- goto bad_ctc;
-
- return ((long)cc * 1000000) / CALIBRATE_TIME;
+ return 0;
X
- /*
- * The CTC wasn't reliable: we got a hit on the very first read,
- * or the CPU was so fast/slow that the quotient wouldn't fit in
- * 32 bits..
- */
- bad_ctc:
- return 0;
+ return (cc * 1000000UL) / CALIBRATE_TIME;
X }
X
X /* The Linux interpretation of the CMOS clock register contents:
@@ -249,31 +293,35 @@
X
X /* Calibrate CPU clock -- attempt #1. */
X if (!est_cycle_freq)
- est_cycle_freq = calibrate_cc_with_pic();
+ est_cycle_freq = validate_cc_value(calibrate_cc_with_pic());
X
X cc1 = rpcc_after_update_in_progress();
X
X /* Calibrate CPU clock -- attempt #2. */
X if (!est_cycle_freq) {
X cc2 = rpcc_after_update_in_progress();
- est_cycle_freq = cc2 - cc1;
+ est_cycle_freq = validate_cc_value(cc2 - cc1);
X cc1 = cc2;
X }
X
- /* If the given value is within 1% of what we calculated,
- accept it. Otherwise, use what we found. */
X cycle_freq = hwrpb->cycle_freq;
- one_percent = cycle_freq / 100;
- diff = cycle_freq - est_cycle_freq;
- if (diff < 0)
- diff = -diff;
- if (diff > one_percent) {
- cycle_freq = est_cycle_freq;
- printk("HWRPB cycle frequency bogus. Estimated %lu Hz\n",
- cycle_freq);
- }
- else {
- est_cycle_freq = 0;
+ if (est_cycle_freq) {
+ /* If the given value is within 1% of what we calculated,
+ accept it. Otherwise, use what we found. */
+ one_percent = cycle_freq / 100;
+ diff = cycle_freq - est_cycle_freq;
+ if (diff < 0)
+ diff = -diff;
+ if (diff > one_percent) {
+ cycle_freq = est_cycle_freq;
+ printk("HWRPB cycle frequency bogus. "
+ "Estimated %lu Hz\n", cycle_freq);
+ } else {
+ est_cycle_freq = 0;
+ }
+ } else if (! validate_cc_value (cycle_freq)) {
+ printk("HWRPB cycle frequency bogus, "
+ "and unable to estimate a proper value!\n");
X }
X
X /* From John Bowman <bow...@math.ualberta.ca>: allow the values
diff -u --recursive --new-file v2.4.13/linux/arch/alpha/kernel/traps.c linux/arch/alpha/kernel/traps.c
--- v2.4.13/linux/arch/alpha/kernel/traps.c Tue Oct 9 17:06:51 2001
+++ linux/arch/alpha/kernel/traps.c Mon Nov 5 09:47:41 2001
@@ -295,9 +295,13 @@
X we get the correct PC. If not, we set a flag
X to correct it every time through.
X */
- if (opDEC_testing && regs.pc == opDEC_test_pc) {
- opDEC_fix = 4;
- printk("opDEC fixup enabled.\n");
+ if (opDEC_testing) {
+ if (regs.pc == opDEC_test_pc) {
+ opDEC_fix = 4;
+ regs.pc += 4;
+ printk("opDEC fixup enabled.\n");
+ }
+ return;
X }
X regs.pc += opDEC_fix;
X
diff -u --recursive --new-file v2.4.13/linux/arch/alpha/lib/Makefile linux/arch/alpha/lib/Makefile
--- v2.4.13/linux/arch/alpha/lib/Makefile Tue Jul 3 17:08:18 2001
+++ linux/arch/alpha/lib/Makefile Mon Nov 5 09:47:41 2001
@@ -49,6 +49,10 @@
X fpreg.o \
X callback_srm.o srm_puts.o srm_printk.o
X
+ifeq ($(CONFIG_SMP),y)
+ OBJS += dec_and_lock.o
+endif
+
X lib.a: $(OBJS)
X $(AR) rcs lib.a $(OBJS)
X
diff -u --recursive --new-file v2.4.13/linux/arch/alpha/lib/dec_and_lock.c linux/arch/alpha/lib/dec_and_lock.c
--- v2.4.13/linux/arch/alpha/lib/dec_and_lock.c Wed Dec 31 16:00:00 1969
+++ linux/arch/alpha/lib/dec_and_lock.c Mon Nov 5 09:47:41 2001
@@ -0,0 +1,40 @@
+/*
+ * arch/alpha/lib/dec_and_lock.c
+ *
+ * ll/sc version of atomic_dec_and_lock()
+ *
+ */
+
+#include <linux/spinlock.h>
+#include <asm/atomic.h>
+
+ asm (".text \n\
+ .global atomic_dec_and_lock \n\
+ .ent atomic_dec_and_lock \n\
+ .align 4 \n\
+atomic_dec_and_lock: \n\
+ .prologue 0 \n\
+1: ldl_l $1, 0($16) \n\
+ subl $1, 1, $1 \n\
+ beq $1, 2f \n\
+ stl_c $1, 0($16) \n\
+ beq $1, 3f \n\
+ mb \n\
+ clr $0 \n\
+ ret \n\
+3: br 1b \n\
+2: lda $27, atomic_dec_and_lock_1 \n\
+ .end atomic_dec_and_lock");
+
+ /* FALLTHRU */
+
+static int __attribute__((unused))
+atomic_dec_and_lock_1(atomic_t *atomic, spinlock_t *lock)
+{
+ /* Slow path */
+ spin_lock(lock);
+ if (atomic_dec_and_test(atomic))
+ return 1;
+ spin_unlock(lock);
+ return 0;
+}
diff -u --recursive --new-file v2.4.13/linux/arch/arm/config.in linux/arch/arm/config.in
--- v2.4.13/linux/arch/arm/config.in Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/config.in Thu Oct 25 13:53:44 2001
@@ -39,6 +39,7 @@
X CLPS711x/EP721x-based CONFIG_ARCH_CLPS711X \
X Co-EBSA285 CONFIG_ARCH_CO285 \
X EBSA-110 CONFIG_ARCH_EBSA110 \
+ Epxa10db CONFIG_ARCH_CAMELOT \
X FootBridge CONFIG_ARCH_FOOTBRIDGE \
X Integrator CONFIG_ARCH_INTEGRATOR \
X LinkUp-L7200 CONFIG_ARCH_L7200 \
@@ -73,7 +74,16 @@
X dep_bool ' Brutus' CONFIG_SA1100_BRUTUS $CONFIG_ARCH_SA1100
X dep_bool ' CerfBoard' CONFIG_SA1100_CERF $CONFIG_ARCH_SA1100
X if [ "$CONFIG_SA1100_CERF" = "y" ]; then
- bool ' 32MB Cerf support' CONFIG_SA1100_CERF_32MB
+ choice 'Cerf RAM available' \
+ "8MB CONFIG_SA1100_CERF_8MB \
+ 16MB CONFIG_SA1100_CERF_16MB \
+ 32MB CONFIG_SA1100_CERF_32MB \
+ 64MB CONFIG_SA1100_CERF_64MB" CerfRam
+ choice 'Cerf Flash available' \
+ "8MB CONFIG_SA1100_CERF_FLASH_8MB \
+ 16MB CONFIG_SA1100_CERF_FLASH_16MB \
+ 32MB CONFIG_SA1100_CERF_FLASH_32MB" CerfFlash
+ bool 'Cerf w/CPLD support (CerfPDA)' CONFIG_SA1100_CERF_CPLD
X fi
X dep_bool ' Compaq iPAQ H3600' CONFIG_SA1100_H3600 $CONFIG_ARCH_SA1100
X #dep_bool ' Empeg' CONFIG_SA1100_EMPEG $CONFIG_ARCH_SA1100
@@ -194,7 +204,8 @@
X "$CONFIG_ARCH_TBOX" = "y" -o "$CONFIG_ARCH_SHARK" = "y" -o \
X "$CONFIG_ARCH_NEXUSPCI" = "y" -o "$CONFIG_ARCH_CLPS711X" = "y" -o \
X "$CONFIG_ARCH_INTEGRATOR" = "y" -o "$CONFIG_ARCH_SA1100" = "y" -o \
- "$CONFIG_ARCH_L7200" = "y" -o "$CONFIG_ARCH_ANAKIN" = "y" ]; then
+ "$CONFIG_ARCH_L7200" = "y" -o "$CONFIG_ARCH_ANAKIN" = "y" -o \
+ "$CONFIG_ARCH_CAMELOT" = "y" ]; then
X define_bool CONFIG_CPU_32v4 y
X else
X define_bool CONFIG_CPU_32v4 n
@@ -369,6 +380,7 @@
X "$CONFIG_ARCH_CATS" = "y" -o \
X "$CONFIG_ARCH_P720T" = "y" -o \
X "$CONFIG_ARCH_CDB89712" = "y" -o \
+ "$CONFIG_ARCH_CAMELOT" = "y" -o \
X "$CONFIG_ARCH_ANAKIN" = "y" ]; then
X string 'Default kernel command string' CONFIG_CMDLINE ""
X fi
@@ -562,7 +574,9 @@
X bool 'Verbose kernel error messages' CONFIG_DEBUG_ERRORS
X bool 'Verbose user fault messages' CONFIG_DEBUG_USER
X bool 'Include debugging information in kernel binary' CONFIG_DEBUG_INFO
+bool 'Debug memory allocations' CONFIG_DEBUG_SLAB
X bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
+bool 'Spinlock debugging' CONFIG_DEBUG_SPINLOCK
X dep_bool 'Disable pgtable cache' CONFIG_NO_PGT_CACHE $CONFIG_CPU_26
X # These options are only for real kernel hackers who want to get their hands dirty.
X dep_bool 'Kernel low-level debugging functions' CONFIG_DEBUG_LL $CONFIG_EXPERIMENTAL
diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/adsbitsy linux/arch/arm/def-configs/adsbitsy
--- v2.4.13/linux/arch/arm/def-configs/adsbitsy Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/def-configs/adsbitsy Thu Oct 25 13:53:44 2001
@@ -0,0 +1,674 @@
+#
+# Automatically generated by make menuconfig: don't edit
+#
+CONFIG_ARM=y
+# CONFIG_EISA is not set
+# CONFIG_SBUS is not set
+# CONFIG_MCA is not set
+CONFIG_UID16=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+# CONFIG_OBSOLETE is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_KMOD is not set
+
+#
+# System Type
+#
+# CONFIG_ARCH_ANAKIN is not set
+# CONFIG_ARCH_ARCA5K is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_RPC is not set
+CONFIG_ARCH_SA1100=y
+# CONFIG_ARCH_SHARK is not set
+
+#
+# Archimedes/A5000 Implementations
+#
+# CONFIG_ARCH_ARC is not set
+# CONFIG_ARCH_A5K is not set
+
+#
+# Footbridge Implementations
+#
+# CONFIG_ARCH_CATS is not set
+# CONFIG_ARCH_PERSONAL_SERVER is not set
+# CONFIG_ARCH_EBSA285_ADDIN is not set
+# CONFIG_ARCH_EBSA285_HOST is not set
+# CONFIG_ARCH_NETWINDER is not set
+
+#
+# SA11x0 Implementations
+#
+# CONFIG_SA1100_ASSABET is not set
+# CONFIG_ASSABET_NEPONSET is not set
+# CONFIG_SA1100_BRUTUS is not set
+# CONFIG_SA1100_CERF is not set
+# CONFIG_SA1100_BITSY is not set
+# CONFIG_SA1100_EXTENEX1 is not set
+# CONFIG_SA1100_FLEXANET is not set
+# CONFIG_SA1100_FREEBIRD is not set
+# CONFIG_SA1100_GRAPHICSCLIENT is not set
+# CONFIG_SA1100_JORNADA720 is not set
+# CONFIG_SA1100_HUW_WEBPANEL is not set
+# CONFIG_SA1100_ITSY is not set
+# CONFIG_SA1100_LART is not set
+# CONFIG_SA1100_NANOENGINE is not set
+# CONFIG_SA1100_OMNIMETER is not set
+# CONFIG_SA1100_PANGOLIN is not set
+# CONFIG_SA1100_PLEB is not set
+# CONFIG_SA1100_SHERMAN is not set
+# CONFIG_SA1100_SIMPAD is not set
+# CONFIG_SA1100_PFS168 is not set
+# CONFIG_SA1100_VICTOR is not set
+# CONFIG_SA1100_XP860 is not set
+# CONFIG_SA1100_YOPY is not set
+# CONFIG_SA1100_GRAPHICSMASTER is not set
+CONFIG_SA1100_ADSBITSY=y
+CONFIG_SA1111=y
+# CONFIG_SA1100_USB is not set
+# CONFIG_SA1100_USB_NETLINK is not set
+# CONFIG_SA1100_USB_CHAR is not set
+
+#
+# CLPS711X/EP721X Implementations
+#
+# CONFIG_ARCH_P720T is not set
+# CONFIG_ARCH_ACORN is not set
+# CONFIG_FOOTBRIDGE is not set
+# CONFIG_FOOTBRIDGE_HOST is not set
+# CONFIG_FOOTBRIDGE_ADDIN is not set
+CONFIG_CPU_32=y
+# CONFIG_CPU_26 is not set
+# CONFIG_CPU_32v3 is not set
+CONFIG_CPU_32v4=y
+# CONFIG_CPU_ARM610 is not set
+# CONFIG_CPU_ARM710 is not set
+# CONFIG_CPU_ARM720T is not set
+# CONFIG_CPU_ARM920T is not set
+# CONFIG_CPU_ARM1020 is not set
+# CONFIG_CPU_SA110 is not set
+CONFIG_CPU_SA1100=y
+CONFIG_DISCONTIGMEM=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+
+#
+# General setup
+#
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_ISA_DMA is not set
+# CONFIG_CPU_FREQ is not set
+CONFIG_HOTPLUG=y
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=y
+# CONFIG_I82365 is not set
+# CONFIG_TCIC is not set
+# CONFIG_PCMCIA_CLPS6700 is not set
+CONFIG_PCMCIA_SA1100=y
+CONFIG_NET=y
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_FASTFPE is not set
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
+# CONFIG_APM is not set
+# CONFIG_ARTHUR is not set
+CONFIG_CMDLINE="ip=off"
+# CONFIG_PFS168_CMDLINE is not set
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+# CONFIG_NETLINK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# PCMCIA network device support
+#
+CONFIG_NET_PCMCIA=y
+# CONFIG_PCMCIA_3C589 is not set
+# CONFIG_PCMCIA_3C574 is not set
+# CONFIG_PCMCIA_FMVJ18X is not set
+CONFIG_PCMCIA_PCNET=y
+# CONFIG_PCMCIA_NMCLAN is not set
+# CONFIG_PCMCIA_SMC91C92 is not set
+# CONFIG_PCMCIA_XIRC2PS is not set
+# CONFIG_ARCNET_COM20020_CS is not set
+# CONFIG_PCMCIA_IBMTR is not set
+# CONFIG_NET_PCMCIA_RADIO is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+CONFIG_IDE=y
+
+#
+# IDE, ATA and ATAPI Block devices
+#
+CONFIG_BLK_DEV_IDE=y
+# CONFIG_BLK_DEV_HD_IDE is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
+# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
+# CONFIG_BLK_DEV_IDEDISK_IBM is not set
+# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set
+# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set
+# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set
+# CONFIG_BLK_DEV_IDEDISK_WD is not set
+# CONFIG_BLK_DEV_COMMERIAL is not set
+# CONFIG_BLK_DEV_TIVO is not set
+CONFIG_BLK_DEV_IDECS=y
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+# CONFIG_BLK_DEV_ISAPNP is not set
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_DMA_NONPCI is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+
+#
+# SCSI support
+#
+# CONFIG_SCSI is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input core support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_KEYBDEV is not set
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+# CONFIG_VT_CONSOLE is not set
+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set
+# CONFIG_SERIAL_AMBA is not set
+# CONFIG_SERIAL_AMBA_CONSOLE is not set
+# CONFIG_SERIAL_CLPS711X is not set
+# CONFIG_SERIAL_CLPS711X_CONSOLE is not set
+CONFIG_SERIAL_SA1100=y
+CONFIG_SERIAL_SA1100_CONSOLE=y
+CONFIG_SA1100_DEFAULT_BAUDRATE=38400
+# CONFIG_SERIAL_8250 is not set
+# CONFIG_SERIAL_8250_CONSOLE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=32
+CONFIG_UCB1200=y
+CONFIG_TOUCHSCREEN_UCB1200=y
+CONFIG_AUDIO_UCB1200=y
+CONFIG_ADC_UCB1200=y
+# CONFIG_TOUCHSCREEN_BITSY is not set
+# CONFIG_PROFILER is not set
+# CONFIG_PFS168_SPI is not set
+# CONFIG_PFS168_DTMF is not set
+# CONFIG_PFS168_MISC is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_JOYSTICK is not set
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_SA1100_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi
echo 'End of part 01'
echo 'File patch-2.4.14 is continued in part 02'
echo "02" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:32 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part09

#!/bin/sh -x
# this is part 09 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh

# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck
if test "$Scheck" != 09; then
echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'


sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks
@@ -407,7 +411,6 @@
X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver
@@ -440,6 +443,7 @@
X # CONFIG_VFAT_FS is not set
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set
@@ -517,6 +521,103 @@
X # USB support
X #
X # CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+# Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set
X
X #
X # Bluetooth support
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/ibmchrp_defconfig linux/arch/ppc/configs/ibmchrp_defconfig
--- v2.4.13/linux/arch/ppc/configs/ibmchrp_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/ibmchrp_defconfig Fri Nov 2 17:43:54 2001
@@ -32,7 +32,6 @@
X CONFIG_ALL_PPC=y
X # CONFIG_APUS is not set
X # CONFIG_GEMINI is not set
-# CONFIG_PPC601_SYNC_FIX is not set
X # CONFIG_SMP is not set
X # CONFIG_ALTIVEC is not set
X # CONFIG_TAU is not set
@@ -63,6 +62,7 @@
X #
X # CONFIG_PARPORT is not set
X CONFIG_PPC_RTC=y
+# CONFIG_PPC601_SYNC_FIX is not set
X CONFIG_PROC_DEVICETREE=y
X CONFIG_PPC_RTAS=y
X # CONFIG_BOOTX_TEXT is not set
@@ -79,7 +79,6 @@
X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices
@@ -105,6 +104,7 @@
X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #
@@ -134,6 +134,7 @@
X #
X CONFIG_IP_NF_CONNTRACK=m
X CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
X # CONFIG_IP_NF_QUEUE is not set
X CONFIG_IP_NF_IPTABLES=m
X CONFIG_IP_NF_MATCH_LIMIT=m
@@ -141,6 +142,8 @@
X CONFIG_IP_NF_MATCH_MARK=m
X CONFIG_IP_NF_MATCH_MULTIPORT=m
X CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
X CONFIG_IP_NF_MATCH_TCPMSS=m
X CONFIG_IP_NF_MATCH_STATE=m
X CONFIG_IP_NF_MATCH_UNCLEAN=m
@@ -152,6 +155,8 @@
X CONFIG_IP_NF_NAT_NEEDED=y
X CONFIG_IP_NF_TARGET_MASQUERADE=m
X CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
X CONFIG_IP_NF_NAT_FTP=m
X # CONFIG_IP_NF_MANGLE is not set
X # CONFIG_IP_NF_TARGET_LOG is not set
@@ -162,6 +167,7 @@
X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set


X
X #
X #

@@ -227,6 +233,7 @@
X # CONFIG_SCSI_AHA1740 is not set
X # CONFIG_SCSI_AIC7XXX is not set
X # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
X # CONFIG_SCSI_ADVANSYS is not set
X # CONFIG_SCSI_IN2000 is not set
X # CONFIG_SCSI_AM53C974 is not set
@@ -295,12 +302,9 @@
X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_HAPPYMEAL is not set
X # CONFIG_SUNBMAC is not set
@@ -319,8 +323,6 @@
X # CONFIG_APRICOT is not set
X # CONFIG_CS89x0 is not set
X # CONFIG_TULIP is not set
-# CONFIG_TULIP_MWI is not set
-# CONFIG_TULIP_MMIO is not set
X CONFIG_DE4X5=y
X # CONFIG_DGRS is not set
X # CONFIG_DM9102 is not set
@@ -331,6 +333,7 @@
X # CONFIG_NE2K_PCI is not set
X # CONFIG_NE3210 is not set
X # CONFIG_ES3210 is not set
+# CONFIG_8139CP is not set
X # CONFIG_8139TOO is not set
X # CONFIG_8139TOO_PIO is not set
X # CONFIG_8139TOO_TUNE_TWISTER is not set
@@ -347,9 +350,9 @@
X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set
@@ -422,9 +425,6 @@
X # CONFIG_FB_IMSTT is not set
X # CONFIG_FB_S3TRIO is not set
X # CONFIG_FB_VGA16 is not set
-# CONFIG_FB_PVR2 is not set
-# CONFIG_FB_PVR2_DEBUG is not set
-# CONFIG_FB_E1355 is not set
X CONFIG_FB_MATROX=y
X CONFIG_FB_MATROX_MILLENIUM=y
X CONFIG_FB_MATROX_MYSTIQUE=y
@@ -432,9 +432,11 @@
X # CONFIG_FB_MATROX_G450 is not set
X # CONFIG_FB_MATROX_MULTIHEAD is not set
X # CONFIG_FB_ATY is not set
+# CONFIG_FB_RADEON is not set
X # CONFIG_FB_ATY128 is not set
-CONFIG_FB_3DFX=y
X # CONFIG_FB_SIS is not set
+CONFIG_FB_3DFX=y
+# CONFIG_FB_VOODOO1 is not set
X # CONFIG_FB_VIRTUAL is not set
X # CONFIG_FBCON_ADVANCED is not set
X CONFIG_FBCON_CFB8=y
@@ -505,11 +507,37 @@
X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+# CONFIG_INPUT_NS558 is not set
+# CONFIG_INPUT_LIGHTNING is not set
+# CONFIG_INPUT_PCIGAME is not set
+# CONFIG_INPUT_CS461X is not set
+# CONFIG_INPUT_EMU10K1 is not set
+# CONFIG_INPUT_SERIO is not set
+# CONFIG_INPUT_SERPORT is not set
X
X #
-# Input core support is needed for joysticks
+# Joysticks
X #
+# CONFIG_INPUT_ANALOG is not set
+# CONFIG_INPUT_A3D is not set
+# CONFIG_INPUT_ADI is not set
+# CONFIG_INPUT_COBRA is not set
+# CONFIG_INPUT_GF2K is not set
+# CONFIG_INPUT_GRIP is not set
+# CONFIG_INPUT_INTERACT is not set
+# CONFIG_INPUT_TMDC is not set
+# CONFIG_INPUT_SIDEWINDER is not set
+# CONFIG_INPUT_IFORCE_USB is not set
+# CONFIG_INPUT_IFORCE_232 is not set
+# CONFIG_INPUT_WARRIOR is not set
+# CONFIG_INPUT_MAGELLAN is not set
+# CONFIG_INPUT_SPACEORB is not set
+# CONFIG_INPUT_SPACEBALL is not set
+# CONFIG_INPUT_STINGER is not set
+# CONFIG_INPUT_DB9 is not set
+# CONFIG_INPUT_GAMECON is not set
+# CONFIG_INPUT_TURBOGRAFX is not set
X # CONFIG_QIC02_TAPE is not set
X
X #
@@ -522,7 +550,6 @@
X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver
@@ -555,6 +582,7 @@
X CONFIG_VFAT_FS=m
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set
@@ -673,6 +701,104 @@
X # USB support
X #
X # CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+# CONFIG_USB_HID is not set
+# CONFIG_USB_HIDDEV is not set
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_WACOM is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set
X
X #
X # Bluetooth support
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/mbx_defconfig linux/arch/ppc/configs/mbx_defconfig
--- v2.4.13/linux/arch/ppc/configs/mbx_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/mbx_defconfig Fri Nov 2 17:43:54 2001
@@ -25,10 +25,12 @@
X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X CONFIG_8xx=y
+# CONFIG_PPC_STD_MMU is not set
X CONFIG_SERIAL_CONSOLE=y
X # CONFIG_RPXLITE is not set
X # CONFIG_RPXCLASSIC is not set
X # CONFIG_BSEIP is not set
+# CONFIG_FADS is not set
X # CONFIG_TQM823L is not set
X # CONFIG_TQM850L is not set
X # CONFIG_TQM855L is not set
@@ -37,10 +39,10 @@
X # CONFIG_TQM860 is not set
X # CONFIG_SPD823TS is not set
X # CONFIG_IVMS8 is not set
+# CONFIG_IVML24 is not set
X # CONFIG_SM850 is not set
X CONFIG_MBX=y
X # CONFIG_WINCEPT is not set
-CONFIG_PPC601_SYNC_FIX=y
X # CONFIG_ALL_PPC is not set
X # CONFIG_SMP is not set
X CONFIG_MATH_EMULATION=y
@@ -83,7 +85,6 @@
X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices
@@ -108,6 +109,7 @@
X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #
@@ -132,6 +134,7 @@
X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set


X
X #
X #

@@ -184,12 +187,9 @@
X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set
@@ -207,9 +207,9 @@
X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set
@@ -270,6 +270,10 @@
X # Input core support
X #
X # CONFIG_INPUT is not set


+# CONFIG_INPUT_KEYBDEV is not set

+# CONFIG_INPUT_MOUSEDEV is not set


+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set

X
X #
X # Macintosh device drivers
@@ -298,7 +302,11 @@
X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks
@@ -315,7 +323,6 @@
X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver
@@ -348,6 +355,7 @@
X # CONFIG_VFAT_FS is not set
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set
@@ -436,11 +444,109 @@
X #
X CONFIG_8xx_COPYBACK=y
X CONFIG_8xx_CPU6=y
+# CONFIG_UCODE_PATCH is not set
X
X #
X # USB support
X #
X # CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+# Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set
X
X #
X # Bluetooth support
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/oak_defconfig linux/arch/ppc/configs/oak_defconfig
--- v2.4.13/linux/arch/ppc/configs/oak_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/oak_defconfig Fri Nov 2 17:43:54 2001
@@ -27,9 +27,9 @@
X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X # CONFIG_8xx is not set
+# CONFIG_PPC_STD_MMU is not set
X CONFIG_OAK=y
X # CONFIG_WALNUT is not set
-CONFIG_PPC601_SYNC_FIX=y
X # CONFIG_ALL_PPC is not set
X # CONFIG_SMP is not set
X # CONFIG_MATH_EMULATION is not set
@@ -70,7 +70,6 @@
X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices
@@ -96,6 +95,7 @@
X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #
@@ -121,6 +121,7 @@
X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set


X
X #
X #

@@ -173,12 +174,9 @@
X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-CONFIG_OAKNET=y
X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set
@@ -196,9 +194,9 @@
X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set
@@ -259,6 +257,10 @@
X # Input core support
X #
X # CONFIG_INPUT is not set


+# CONFIG_INPUT_KEYBDEV is not set

+# CONFIG_INPUT_MOUSEDEV is not set


+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set

X
X #
X # Macintosh device drivers
@@ -288,7 +290,11 @@
X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks
@@ -305,7 +311,6 @@
X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver
@@ -338,6 +343,7 @@
X # CONFIG_VFAT_FS is not set
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set
@@ -402,6 +408,103 @@
X # USB support
X #
X # CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+# Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set
X
X #
X # Bluetooth support
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/power3_defconfig linux/arch/ppc/configs/power3_defconfig
--- v2.4.13/linux/arch/ppc/configs/power3_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/power3_defconfig Fri Nov 2 17:43:54 2001
@@ -86,7 +86,6 @@
X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices
@@ -112,6 +111,7 @@
X CONFIG_MD_RAID0=y
X CONFIG_MD_RAID1=y
X CONFIG_MD_RAID5=y
+# CONFIG_MD_MULTIPATH is not set
X CONFIG_BLK_DEV_LVM=y
X
X #
@@ -137,6 +137,7 @@
X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set


X
X #
X #

@@ -202,6 +203,7 @@
X # CONFIG_SCSI_AHA1740 is not set
X # CONFIG_SCSI_AIC7XXX is not set
X # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
X # CONFIG_SCSI_ADVANSYS is not set
X # CONFIG_SCSI_IN2000 is not set
X # CONFIG_SCSI_AM53C974 is not set
@@ -272,12 +274,9 @@
X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_HAPPYMEAL is not set
X # CONFIG_SUNBMAC is not set
@@ -296,8 +295,6 @@
X # CONFIG_APRICOT is not set
X # CONFIG_CS89x0 is not set
X # CONFIG_TULIP is not set
-# CONFIG_TULIP_MWI is not set
-# CONFIG_TULIP_MMIO is not set
X # CONFIG_DE4X5 is not set
X # CONFIG_DGRS is not set
X # CONFIG_DM9102 is not set
@@ -308,6 +305,7 @@
X # CONFIG_NE2K_PCI is not set
X # CONFIG_NE3210 is not set
X # CONFIG_ES3210 is not set
+# CONFIG_8139CP is not set
X # CONFIG_8139TOO is not set
X # CONFIG_8139TOO_PIO is not set
X # CONFIG_8139TOO_TUNE_TWISTER is not set
@@ -324,9 +322,9 @@
X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set
@@ -399,9 +397,6 @@
X # CONFIG_FB_IMSTT is not set
X # CONFIG_FB_S3TRIO is not set
X # CONFIG_FB_VGA16 is not set
-# CONFIG_FB_PVR2 is not set
-# CONFIG_FB_PVR2_DEBUG is not set
-# CONFIG_FB_E1355 is not set
X CONFIG_FB_MATROX=y
X CONFIG_FB_MATROX_MILLENIUM=y
X CONFIG_FB_MATROX_MYSTIQUE=y
@@ -411,9 +406,11 @@
X # CONFIG_FB_MATROX_G450 is not set
X CONFIG_FB_MATROX_MULTIHEAD=y
X # CONFIG_FB_ATY is not set
+# CONFIG_FB_RADEON is not set
X # CONFIG_FB_ATY128 is not set
-# CONFIG_FB_3DFX is not set
X # CONFIG_FB_SIS is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
X # CONFIG_FB_VIRTUAL is not set
X # CONFIG_FBCON_ADVANCED is not set
X CONFIG_FBCON_CFB8=y
@@ -478,6 +475,7 @@
X CONFIG_I2C_ALGOPCF=y
X # CONFIG_I2C_ELEKTOR is not set
X CONFIG_I2C_CHARDEV=y
+# CONFIG_I2C_PROC is not set
X
X #
X # Mice
@@ -491,11 +489,37 @@
X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+# CONFIG_INPUT_NS558 is not set
+# CONFIG_INPUT_LIGHTNING is not set
+# CONFIG_INPUT_PCIGAME is not set
+# CONFIG_INPUT_CS461X is not set
+# CONFIG_INPUT_EMU10K1 is not set
+# CONFIG_INPUT_SERIO is not set
+# CONFIG_INPUT_SERPORT is not set
X
X #
-# Input core support is needed for joysticks
+# Joysticks
X #
+# CONFIG_INPUT_ANALOG is not set
+# CONFIG_INPUT_A3D is not set
+# CONFIG_INPUT_ADI is not set
+# CONFIG_INPUT_COBRA is not set
+# CONFIG_INPUT_GF2K is not set
+# CONFIG_INPUT_GRIP is not set
+# CONFIG_INPUT_INTERACT is not set
+# CONFIG_INPUT_TMDC is not set
+# CONFIG_INPUT_SIDEWINDER is not set
+# CONFIG_INPUT_IFORCE_USB is not set
+# CONFIG_INPUT_IFORCE_232 is not set
+# CONFIG_INPUT_WARRIOR is not set
+# CONFIG_INPUT_MAGELLAN is not set
+# CONFIG_INPUT_SPACEORB is not set
+# CONFIG_INPUT_SPACEBALL is not set
+# CONFIG_INPUT_STINGER is not set
+# CONFIG_INPUT_DB9 is not set
+# CONFIG_INPUT_GAMECON is not set
+# CONFIG_INPUT_TURBOGRAFX is not set
X # CONFIG_QIC02_TAPE is not set
X
X #
@@ -508,7 +532,6 @@
X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver
@@ -541,6 +564,7 @@
X CONFIG_VFAT_FS=y
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set
@@ -697,6 +721,104 @@
X # USB support
X #
X # CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+# CONFIG_USB_HID is not set
+# CONFIG_USB_HIDDEV is not set
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_WACOM is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set
X
X #
X # Bluetooth support
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/rpxcllf_defconfig linux/arch/ppc/configs/rpxcllf_defconfig
--- v2.4.13/linux/arch/ppc/configs/rpxcllf_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/rpxcllf_defconfig Fri Nov 2 17:43:54 2001
@@ -25,10 +25,12 @@
X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X CONFIG_8xx=y
+# CONFIG_PPC_STD_MMU is not set
X CONFIG_SERIAL_CONSOLE=y
X # CONFIG_RPXLITE is not set
X CONFIG_RPXCLASSIC=y
X # CONFIG_BSEIP is not set
+# CONFIG_FADS is not set
X # CONFIG_TQM823L is not set
X # CONFIG_TQM850L is not set
X # CONFIG_TQM855L is not set
@@ -37,10 +39,10 @@
X # CONFIG_TQM860 is not set
X # CONFIG_SPD823TS is not set
X # CONFIG_IVMS8 is not set
+# CONFIG_IVML24 is not set
X # CONFIG_SM850 is not set
X # CONFIG_MBX is not set
X # CONFIG_WINCEPT is not set
-CONFIG_PPC601_SYNC_FIX=y
X # CONFIG_ALL_PPC is not set
X # CONFIG_SMP is not set
X CONFIG_MATH_EMULATION=y
@@ -83,7 +85,6 @@
X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices
@@ -109,6 +110,7 @@
X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #
@@ -137,6 +139,7 @@
X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set


X
X #
X #

@@ -190,12 +193,9 @@
X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set
@@ -213,9 +213,9 @@
X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set
@@ -276,6 +276,10 @@
X # Input core support
X #
X # CONFIG_INPUT is not set


+# CONFIG_INPUT_KEYBDEV is not set

+# CONFIG_INPUT_MOUSEDEV is not set


+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set

X
X #
X # Macintosh device drivers
@@ -305,7 +309,11 @@
X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks
@@ -322,7 +330,6 @@
X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver
@@ -355,6 +362,7 @@
X # CONFIG_VFAT_FS is not set
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set
@@ -444,11 +452,109 @@
X #
X CONFIG_8xx_COPYBACK=y
X # CONFIG_8xx_CPU6 is not set
+# CONFIG_UCODE_PATCH is not set
X
X #
X # USB support
X #
X # CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+# Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set
X
X #
X # Bluetooth support
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/rpxlite_defconfig linux/arch/ppc/configs/rpxlite_defconfig
--- v2.4.13/linux/arch/ppc/configs/rpxlite_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/rpxlite_defconfig Fri Nov 2 17:43:54 2001
@@ -25,10 +25,12 @@
X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X CONFIG_8xx=y
+# CONFIG_PPC_STD_MMU is not set
X CONFIG_SERIAL_CONSOLE=y
X CONFIG_RPXLITE=y
X # CONFIG_RPXCLASSIC is not set
X # CONFIG_BSEIP is not set
+# CONFIG_FADS is not set
X # CONFIG_TQM823L is not set
X # CONFIG_TQM850L is not set
X # CONFIG_TQM855L is not set
@@ -37,10 +39,10 @@
X # CONFIG_TQM860 is not set
X # CONFIG_SPD823TS is not set
X # CONFIG_IVMS8 is not set
+# CONFIG_IVML24 is not set
X # CONFIG_SM850 is not set
X # CONFIG_MBX is not set
X # CONFIG_WINCEPT is not set
-CONFIG_PPC601_SYNC_FIX=y
X # CONFIG_ALL_PPC is not set
X # CONFIG_SMP is not set
X CONFIG_MATH_EMULATION=y
@@ -83,7 +85,6 @@
X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices
@@ -109,6 +110,7 @@
X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #
@@ -137,6 +139,7 @@
X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set


X
X #
X #

@@ -190,12 +193,9 @@
X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set
@@ -213,9 +213,9 @@
X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set
@@ -276,6 +276,10 @@
X # Input core support
X #
X # CONFIG_INPUT is not set


+# CONFIG_INPUT_KEYBDEV is not set

+# CONFIG_INPUT_MOUSEDEV is not set


+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set

X
X #
X # Macintosh device drivers
@@ -305,7 +309,11 @@
X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks
@@ -322,7 +330,6 @@
X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver
@@ -355,6 +362,7 @@
X # CONFIG_VFAT_FS is not set
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set
@@ -441,11 +449,109 @@
X #
X CONFIG_8xx_COPYBACK=y
X # CONFIG_8xx_CPU6 is not set
+# CONFIG_UCODE_PATCH is not set
X
X #
X # USB support
X #
X # CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+# Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set
X
X #
X # Bluetooth support
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/walnut_defconfig linux/arch/ppc/configs/walnut_defconfig
--- v2.4.13/linux/arch/ppc/configs/walnut_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/walnut_defconfig Fri Nov 2 17:43:54 2001
@@ -27,9 +27,9 @@
X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X # CONFIG_8xx is not set
+# CONFIG_PPC_STD_MMU is not set
X # CONFIG_OAK is not set
X CONFIG_WALNUT=y
-CONFIG_PPC601_SYNC_FIX=y
X # CONFIG_ALL_PPC is not set
X # CONFIG_SMP is not set
X # CONFIG_MATH_EMULATION is not set
@@ -70,7 +70,6 @@
X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices
@@ -96,6 +95,7 @@
X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #
@@ -121,6 +121,7 @@
X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set


X
X #
X #

@@ -173,12 +174,9 @@
X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set
@@ -196,9 +194,9 @@
X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set
@@ -259,6 +257,10 @@
X # Input core support
X #
X # CONFIG_INPUT is not set


+# CONFIG_INPUT_KEYBDEV is not set

+# CONFIG_INPUT_MOUSEDEV is not set


+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set

X
X #
X # Macintosh device drivers
@@ -281,6 +283,7 @@
X # CONFIG_I2C_ALGOBIT is not set
X # CONFIG_I2C_ALGOPCF is not set
X # CONFIG_I2C_CHARDEV is not set
+# CONFIG_I2C_PROC is not set
X
X #
X # Mice
@@ -291,7 +294,11 @@
X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks
@@ -308,7 +315,6 @@
X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver
@@ -341,6 +347,7 @@
X # CONFIG_VFAT_FS is not set
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set
@@ -405,6 +412,103 @@
X # USB support
X #
X # CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+
+#
+# Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set
X
X #
X # Bluetooth support
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/defconfig linux/arch/ppc/defconfig
--- v2.4.13/linux/arch/ppc/defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/defconfig Fri Nov 2 17:43:54 2001
@@ -32,7 +32,6 @@
X CONFIG_ALL_PPC=y
X # CONFIG_APUS is not set
X # CONFIG_GEMINI is not set
-CONFIG_PPC601_SYNC_FIX=y
X # CONFIG_SMP is not set
X CONFIG_ALTIVEC=y
X CONFIG_TAU=y
@@ -69,6 +68,7 @@
X #
X # CONFIG_PARPORT is not set
X CONFIG_PPC_RTC=y
+CONFIG_PPC601_SYNC_FIX=y
X CONFIG_PROC_DEVICETREE=y
X CONFIG_PPC_RTAS=y
X CONFIG_BOOTX_TEXT=y
@@ -86,7 +86,6 @@
X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices
@@ -112,6 +111,7 @@
X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #
@@ -141,6 +141,7 @@
X #
X CONFIG_IP_NF_CONNTRACK=m
X CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
X # CONFIG_IP_NF_QUEUE is not set
X CONFIG_IP_NF_IPTABLES=m
X CONFIG_IP_NF_MATCH_LIMIT=m
@@ -148,6 +149,8 @@
X CONFIG_IP_NF_MATCH_MARK=m
X CONFIG_IP_NF_MATCH_MULTIPORT=m
X CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
X CONFIG_IP_NF_MATCH_TCPMSS=m
X CONFIG_IP_NF_MATCH_STATE=m
X CONFIG_IP_NF_MATCH_UNCLEAN=m
@@ -159,6 +162,8 @@
X CONFIG_IP_NF_NAT_NEEDED=y
X CONFIG_IP_NF_TARGET_MASQUERADE=m
X CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
X CONFIG_IP_NF_NAT_FTP=m
X # CONFIG_IP_NF_MANGLE is not set
X # CONFIG_IP_NF_TARGET_LOG is not set
@@ -169,6 +174,7 @@
X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set


X
X #
X #

@@ -272,6 +278,9 @@
X # CONFIG_IDEDMA_IVB is not set
X # CONFIG_DMA_NONPCI is not set
X CONFIG_BLK_DEV_IDE_MODES=y
+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set
X
X #
X # SCSI support
@@ -315,7 +324,8 @@
X # CONFIG_AIC7XXX_OLD_TCQ_ON_BY_DEFAULT is not set
X CONFIG_AIC7XXX_OLD_CMDS_PER_DEVICE=8
X CONFIG_AIC7XXX_OLD_PROC_STATS=y
-# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_DPT_I2O is not set
+CONFIG_SCSI_ADVANSYS=m
X # CONFIG_SCSI_IN2000 is not set
X # CONFIG_SCSI_AM53C974 is not set
X # CONFIG_SCSI_MEGARAID is not set
@@ -333,7 +343,7 @@
X # CONFIG_SCSI_INIA100 is not set
X # CONFIG_SCSI_NCR53C406A is not set
X # CONFIG_SCSI_NCR53C7xx is not set
-# CONFIG_SCSI_NCR53C8XX is not set
+CONFIG_SCSI_NCR53C8XX=y
X CONFIG_SCSI_SYM53C8XX=y
X CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
X CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32
@@ -389,13 +399,10 @@
X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X CONFIG_MACE=y
X # CONFIG_MACE_AAUI_PORT is not set
X CONFIG_BMAC=y
X CONFIG_GMAC=y
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_HAPPYMEAL is not set
X # CONFIG_SUNBMAC is not set
@@ -426,6 +433,7 @@
X # CONFIG_NE2K_PCI is not set
X # CONFIG_NE3210 is not set
X # CONFIG_ES3210 is not set
+# CONFIG_8139CP is not set
X # CONFIG_8139TOO is not set
X # CONFIG_8139TOO_PIO is not set
X # CONFIG_8139TOO_TUNE_TWISTER is not set
@@ -442,9 +450,9 @@
X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set
@@ -464,7 +472,18 @@
X #
X # Wireless LAN (non-hamradio)
X #
-# CONFIG_NET_RADIO is not set
+CONFIG_NET_RADIO=y
+# CONFIG_STRIP is not set
+# CONFIG_WAVELAN is not set
+# CONFIG_ARLAN is not set
+# CONFIG_AIRONET4500 is not set
+# CONFIG_AIRONET4500_NONCS is not set
+# CONFIG_AIRONET4500_PROC is not set
+# CONFIG_AIRO is not set
+CONFIG_HERMES=m
+CONFIG_APPLE_AIRPORT=m
+# CONFIG_PLX_HERMES is not set
+CONFIG_NET_WIRELESS=y
X
X #
X # Token Ring devices
@@ -521,9 +540,6 @@
X CONFIG_FB_IMSTT=y
X # CONFIG_FB_S3TRIO is not set
X # CONFIG_FB_VGA16 is not set
-# CONFIG_FB_PVR2 is not set
-# CONFIG_FB_PVR2_DEBUG is not set
-# CONFIG_FB_E1355 is not set
X CONFIG_FB_MATROX=y
X CONFIG_FB_MATROX_MILLENIUM=y
X CONFIG_FB_MATROX_MYSTIQUE=y
@@ -533,9 +549,11 @@
X CONFIG_FB_ATY=y
X CONFIG_FB_ATY_GX=y
X CONFIG_FB_ATY_CT=y
+CONFIG_FB_RADEON=y
X CONFIG_FB_ATY128=y
-CONFIG_FB_3DFX=y
X # CONFIG_FB_SIS is not set
+CONFIG_FB_3DFX=y
+# CONFIG_FB_VOODOO1 is not set
X # CONFIG_FB_VIRTUAL is not set
X # CONFIG_FBCON_ADVANCED is not set
X CONFIG_FBCON_CFB8=y
@@ -611,11 +629,37 @@
X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+# CONFIG_INPUT_NS558 is not set
+# CONFIG_INPUT_LIGHTNING is not set
+# CONFIG_INPUT_PCIGAME is not set
+# CONFIG_INPUT_CS461X is not set
+# CONFIG_INPUT_EMU10K1 is not set
+# CONFIG_INPUT_SERIO is not set
+# CONFIG_INPUT_SERPORT is not set
X
X #
-# Input core support is needed for joysticks
+# Joysticks
X #
+# CONFIG_INPUT_ANALOG is not set
+# CONFIG_INPUT_A3D is not set
+# CONFIG_INPUT_ADI is not set
+# CONFIG_INPUT_COBRA is not set
+# CONFIG_INPUT_GF2K is not set
+# CONFIG_INPUT_GRIP is not set
+# CONFIG_INPUT_INTERACT is not set
+# CONFIG_INPUT_TMDC is not set
+# CONFIG_INPUT_SIDEWINDER is not set
+# CONFIG_INPUT_IFORCE_USB is not set
+# CONFIG_INPUT_IFORCE_232 is not set
+# CONFIG_INPUT_WARRIOR is not set
+# CONFIG_INPUT_MAGELLAN is not set
+# CONFIG_INPUT_SPACEORB is not set
+# CONFIG_INPUT_SPACEBALL is not set
+# CONFIG_INPUT_STINGER is not set
+# CONFIG_INPUT_DB9 is not set
+# CONFIG_INPUT_GAMECON is not set
+# CONFIG_INPUT_TURBOGRAFX is not set
X # CONFIG_QIC02_TAPE is not set
X
X #
@@ -628,7 +672,6 @@
X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver
@@ -661,6 +704,7 @@
X CONFIG_VFAT_FS=m
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set
@@ -809,6 +853,8 @@
X #
X CONFIG_USB_DEVICEFS=y
X # CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_LONG_TIMEOUT is not set
+# CONFIG_USB_LARGE_CONFIG is not set
X
X #
X # USB Controllers
@@ -823,13 +869,22 @@
X # CONFIG_USB_AUDIO is not set
X # CONFIG_USB_BLUETOOTH is not set
X # CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
X CONFIG_USB_ACM=m
-# CONFIG_USB_PRINTER is not set
+CONFIG_USB_PRINTER=m
X
X #
X # USB Human Interface Devices (HID)
X #
X CONFIG_USB_HID=y
+# CONFIG_USB_HIDDEV is not set
X # CONFIG_USB_WACOM is not set
X
X #
@@ -837,26 +892,26 @@
X #
X # CONFIG_USB_DC2XX is not set
X # CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
+CONFIG_USB_SCANNER=m
X # CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
X
X #
X # USB Multimedia devices
X #
-# CONFIG_USB_IBMCAM is not set
-# CONFIG_USB_OV511 is not set
-# CONFIG_USB_PWC is not set
-# CONFIG_USB_SE401 is not set
-# CONFIG_USB_DSBR is not set
-# CONFIG_USB_DABUSB is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
X
X #
X # USB Network adaptors
X #
-# CONFIG_USB_PLUSB is not set
X # CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
X # CONFIG_USB_CATC is not set
-# CONFIG_USB_NET1080 is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
X
X #
X # USB port drivers
@@ -874,16 +929,26 @@
X # CONFIG_USB_SERIAL_EMPEG is not set
X # CONFIG_USB_SERIAL_FTDI_SIO is not set
X CONFIG_USB_SERIAL_VISOR=m
+# CONFIG_USB_SERIAL_IR is not set
X # CONFIG_USB_SERIAL_EDGEPORT is not set
X # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
X # CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
X # CONFIG_USB_SERIAL_MCT_U232 is not set
X # CONFIG_USB_SERIAL_PL2303 is not set
X # CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
X # CONFIG_USB_SERIAL_OMNINET is not set
X
X #
-# USB misc drivers
+# USB Miscellaneous drivers
X #
X # CONFIG_USB_RIO500 is not set
X
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/Makefile linux/arch/ppc/kernel/Makefile
--- v2.4.13/linux/arch/ppc/kernel/Makefile Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/Makefile Fri Nov 2 17:43:54 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.32 08/24/01 20:07:37 paulus
+# BK Id: SCCS/s.Makefile 1.34 10/16/01 15:58:42 trini
X #
X #
X # Makefile for the linux kernel.
@@ -15,26 +15,21 @@
X EXTRA_AFLAGS := -Wa,-mppc64bridge
X endif
X
-ifeq ($(CONFIG_4xx),y)
- KHEAD := head_4xx.o
-else
- ifeq ($(CONFIG_8xx),y)
- KHEAD := head_8xx.o
- else
- KHEAD := head.o
- endif
-endif
+# Start off with 'head.o', change as needed.
+HEAD-y := head.o
+HEAD-$(CONFIG_4xx) := head_4xx.o
+HEAD-$(CONFIG_8xx) := head_8xx.o
X
-all: $(KHEAD) kernel.o
+all: $(HEAD-y) kernel.o
X
X O_TARGET := kernel.o
X
X export-objs := ppc_ksyms.o prep_setup.o time.o
X
X obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
- process.o signal.o ptrace.o \
- ppc_htab.o semaphore.o syscalls.o \
- align.o setup.o cputable.o
+ process.o signal.o ptrace.o align.o \
+ semaphore.o syscalls.o setup.o \
+ cputable.o ppc_htab.o
X obj-$(CONFIG_6xx) += l2cr.o
X obj-$(CONFIG_MODULES) += ppc_ksyms.o
X obj-$(CONFIG_POWER4) += xics.o
@@ -68,8 +63,8 @@
X obj-$(CONFIG_NVRAM) += pmac_nvram.o
X obj-$(CONFIG_PMAC_BACKLIGHT) += pmac_backlight.o
X obj-$(CONFIG_PMAC_PBOOK) += sleep.o
-obj-$(CONFIG_PPC_RTAS) += error_log.o proc_rtas.o
X obj-$(CONFIG_PREP_RESIDUAL) += residual.o
+obj-$(CONFIG_PPC_RTAS) += error_log.o proc_rtas.o
X obj-$(CONFIG_GEMINI) += gemini_prom.o gemini_pci.o gemini_setup.o \
X open_pic.o
X obj-$(CONFIG_8260) += m8260_setup.o ppc8260_pic.o
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/apus_setup.c linux/arch/ppc/kernel/apus_setup.c
--- v2.4.13/linux/arch/ppc/kernel/apus_setup.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/apus_setup.c Fri Nov 2 17:43:54 2001
@@ -1,5 +1,5 @@
X /*
- * BK Id: SCCS/s.apus_setup.c 1.20 09/08/01 15:47:42 paulus
+ * BK Id: SCCS/s.apus_setup.c 1.22 10/18/01 11:16:27 trini
X */
X /*
X * linux/arch/ppc/kernel/apus_setup.c
@@ -1111,9 +1111,6 @@
X ppc_md.kbd_unexpected_up = apus_kbd_unexpected_up;
X ppc_md.kbd_leds = apus_kbd_leds;
X ppc_md.kbd_init_hw = apus_kbd_init_hw;
-#ifdef CONFIG_MAGIC_SYSRQ
- ppc_md.kbd_sysrq_xlate = NULL;
-#endif
X
X #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
X ppc_ide_md.ide_init_hwif = apus_ide_init_hwif_ports;
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/gemini_pci.c linux/arch/ppc/kernel/gemini_pci.c
--- v2.4.13/linux/arch/ppc/kernel/gemini_pci.c Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/gemini_pci.c Fri Nov 2 17:43:54 2001
@@ -1,10 +1,10 @@
X /*
- * BK Id: SCCS/s.gemini_pci.c 1.5 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.gemini_pci.c 1.6 10/11/01 08:51:46 trini
X */
X #include <linux/kernel.h>
X #include <linux/init.h>
X #include <linux/pci.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
X
X #include <asm/machdep.h>
X #include <asm/gemini.h>
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/gemini_setup.c linux/arch/ppc/kernel/gemini_setup.c
--- v2.4.13/linux/arch/ppc/kernel/gemini_setup.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/gemini_setup.c Fri Nov 2 17:43:54 2001
@@ -1,5 +1,5 @@
X /*
- * BK Id: SCCS/s.gemini_setup.c 1.11 08/20/01 14:34:41 paulus
+ * BK Id: SCCS/s.gemini_setup.c 1.14 10/18/01 11:16:28 trini
X */
X /*
X * linux/arch/ppc/kernel/setup.c
@@ -150,6 +150,9 @@
X void
X gemini_heartbeat(void)
X {
+ /* We only want to do this on 1 CPU */
+ if ( smp_processor_id() )
+ return;
X static unsigned long led = GEMINI_LEDBASE+(4*8);
X static char direction = 8;
X *(char *)led = 0;
@@ -506,8 +509,8 @@
X static void
X smp_gemini_kick_cpu(int nr)
X {
- openpic_init_processor( 1<<nr );
- openpic_init_processor( 0 );
+ openpic_reset_processor_phys(1 << nr);
+ openpic_reset_processor_phys(0);
X }
X

SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 09'
echo 'File patch-2.4.14 is continued in part 10'
echo "10" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:31 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part08

#!/bin/sh -x
# this is part 08 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 08; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/SM850_defconfig linux/arch/ppc/configs/SM850_defconfig
--- v2.4.13/linux/arch/ppc/configs/SM850_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/SM850_defconfig Fri Nov 2 17:43:54 2001
@@ -27,10 +27,12 @@


X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X CONFIG_8xx=y
+# CONFIG_PPC_STD_MMU is not set
X CONFIG_SERIAL_CONSOLE=y
X # CONFIG_RPXLITE is not set
X # CONFIG_RPXCLASSIC is not set
X # CONFIG_BSEIP is not set
+# CONFIG_FADS is not set
X # CONFIG_TQM823L is not set
X # CONFIG_TQM850L is not set
X # CONFIG_TQM855L is not set

@@ -39,11 +41,11 @@


X # CONFIG_TQM860 is not set
X # CONFIG_SPD823TS is not set
X # CONFIG_IVMS8 is not set
+# CONFIG_IVML24 is not set

X CONFIG_SM850=y


X # CONFIG_MBX is not set
X # CONFIG_WINCEPT is not set

X CONFIG_TQM8xxL=y


-# CONFIG_PPC601_SYNC_FIX is not set

X # CONFIG_ALL_PPC is not set
X # CONFIG_SMP is not set
X CONFIG_MATH_EMULATION=y

@@ -86,7 +88,6 @@


X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices

@@ -111,6 +112,7 @@


X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #

@@ -138,6 +140,7 @@


X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
X
X #
X #

@@ -191,12 +194,9 @@


X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set

@@ -214,9 +214,9 @@


X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set

@@ -277,6 +277,10 @@


X # Input core support
X #
X # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
X
X #
X # Macintosh device drivers

@@ -306,7 +310,11 @@


X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks

@@ -323,7 +331,6 @@


X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver

@@ -356,6 +363,7 @@


X # CONFIG_VFAT_FS is not set
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set
@@ -444,11 +452,109 @@
X #
X CONFIG_8xx_COPYBACK=y

diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/SPD823TS_defconfig linux/arch/ppc/configs/SPD823TS_defconfig
--- v2.4.13/linux/arch/ppc/configs/SPD823TS_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/SPD823TS_defconfig Fri Nov 2 17:43:54 2001
@@ -27,10 +27,12 @@


X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X CONFIG_8xx=y
+# CONFIG_PPC_STD_MMU is not set
X CONFIG_SERIAL_CONSOLE=y
X # CONFIG_RPXLITE is not set
X # CONFIG_RPXCLASSIC is not set
X # CONFIG_BSEIP is not set
+# CONFIG_FADS is not set
X # CONFIG_TQM823L is not set
X # CONFIG_TQM850L is not set
X # CONFIG_TQM855L is not set

@@ -39,10 +41,10 @@


X # CONFIG_TQM860 is not set

X CONFIG_SPD823TS=y


X # CONFIG_IVMS8 is not set
+# CONFIG_IVML24 is not set
X # CONFIG_SM850 is not set
X # CONFIG_MBX is not set
X # CONFIG_WINCEPT is not set

-# CONFIG_PPC601_SYNC_FIX is not set

X # CONFIG_ALL_PPC is not set
X # CONFIG_SMP is not set
X CONFIG_MATH_EMULATION=y

@@ -85,7 +87,6 @@


X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices

@@ -110,6 +111,7 @@


X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #

@@ -443,11 +451,109 @@

diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/TQM823L_defconfig linux/arch/ppc/configs/TQM823L_defconfig
--- v2.4.13/linux/arch/ppc/configs/TQM823L_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/TQM823L_defconfig Fri Nov 2 17:43:54 2001
@@ -27,10 +27,12 @@


X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X CONFIG_8xx=y
+# CONFIG_PPC_STD_MMU is not set
X CONFIG_SERIAL_CONSOLE=y
X # CONFIG_RPXLITE is not set
X # CONFIG_RPXCLASSIC is not set
X # CONFIG_BSEIP is not set
+# CONFIG_FADS is not set

X CONFIG_TQM823L=y


X # CONFIG_TQM850L is not set
X # CONFIG_TQM855L is not set

@@ -39,11 +41,11 @@


X # CONFIG_TQM860 is not set
X # CONFIG_SPD823TS is not set
X # CONFIG_IVMS8 is not set
+# CONFIG_IVML24 is not set
X # CONFIG_SM850 is not set
X # CONFIG_MBX is not set
X # CONFIG_WINCEPT is not set

X CONFIG_TQM8xxL=y


-# CONFIG_PPC601_SYNC_FIX is not set

X # CONFIG_ALL_PPC is not set
X # CONFIG_SMP is not set
X CONFIG_MATH_EMULATION=y

@@ -86,7 +88,6 @@


X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices

@@ -111,6 +112,7 @@


X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #

@@ -138,6 +140,7 @@


X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
X
X #
X #

@@ -191,12 +194,9 @@


X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set

@@ -214,9 +214,9 @@


X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set

@@ -277,6 +277,10 @@


X # Input core support
X #
X # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
X
X #
X # Macintosh device drivers

@@ -306,7 +310,11 @@


X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks

@@ -323,7 +331,6 @@


X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver

@@ -356,6 +363,7 @@

diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/TQM850L_defconfig linux/arch/ppc/configs/TQM850L_defconfig
--- v2.4.13/linux/arch/ppc/configs/TQM850L_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/TQM850L_defconfig Fri Nov 2 17:43:54 2001
@@ -27,10 +27,12 @@


X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X CONFIG_8xx=y
+# CONFIG_PPC_STD_MMU is not set
X CONFIG_SERIAL_CONSOLE=y
X # CONFIG_RPXLITE is not set
X # CONFIG_RPXCLASSIC is not set
X # CONFIG_BSEIP is not set
+# CONFIG_FADS is not set
X # CONFIG_TQM823L is not set

X CONFIG_TQM850L=y


X # CONFIG_TQM855L is not set

@@ -39,11 +41,11 @@


X # CONFIG_TQM860 is not set
X # CONFIG_SPD823TS is not set
X # CONFIG_IVMS8 is not set
+# CONFIG_IVML24 is not set
X # CONFIG_SM850 is not set
X # CONFIG_MBX is not set
X # CONFIG_WINCEPT is not set

X CONFIG_TQM8xxL=y


-# CONFIG_PPC601_SYNC_FIX is not set

X # CONFIG_ALL_PPC is not set
X # CONFIG_SMP is not set
X CONFIG_MATH_EMULATION=y

@@ -86,7 +88,6 @@


X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices

@@ -111,6 +112,7 @@


X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #

@@ -138,6 +140,7 @@


X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
X
X #
X #

@@ -191,12 +194,9 @@


X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set

@@ -214,9 +214,9 @@


X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set

@@ -277,6 +277,10 @@


X # Input core support
X #
X # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
X
X #
X # Macintosh device drivers

@@ -306,7 +310,11 @@


X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks

@@ -323,7 +331,6 @@


X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver

@@ -356,6 +363,7 @@


X # CONFIG_VFAT_FS is not set
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set
@@ -444,11 +452,109 @@
X #
X CONFIG_8xx_COPYBACK=y

diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/TQM860L_defconfig linux/arch/ppc/configs/TQM860L_defconfig
--- v2.4.13/linux/arch/ppc/configs/TQM860L_defconfig Tue Oct 9 17:06:51 2001
+++ linux/arch/ppc/configs/TQM860L_defconfig Fri Nov 2 17:43:54 2001
@@ -27,10 +27,12 @@


X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X CONFIG_8xx=y
+# CONFIG_PPC_STD_MMU is not set
X CONFIG_SERIAL_CONSOLE=y
X # CONFIG_RPXLITE is not set
X # CONFIG_RPXCLASSIC is not set
X # CONFIG_BSEIP is not set
+# CONFIG_FADS is not set
X # CONFIG_TQM823L is not set
X # CONFIG_TQM850L is not set
X # CONFIG_TQM855L is not set

@@ -39,11 +41,11 @@


X # CONFIG_TQM860 is not set
X # CONFIG_SPD823TS is not set
X # CONFIG_IVMS8 is not set
+# CONFIG_IVML24 is not set
X # CONFIG_SM850 is not set
X # CONFIG_MBX is not set
X # CONFIG_WINCEPT is not set

X CONFIG_TQM8xxL=y


-# CONFIG_PPC601_SYNC_FIX is not set

X # CONFIG_ALL_PPC is not set
X # CONFIG_SMP is not set
X CONFIG_MATH_EMULATION=y

@@ -86,7 +88,6 @@


X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices

@@ -139,6 +140,7 @@


X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
X
X #
X #

@@ -238,7 +240,6 @@


X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set

-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set

@@ -373,7 +374,6 @@


X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver

@@ -500,12 +500,108 @@


X CONFIG_8xx_COPYBACK=y
X # CONFIG_8xx_CPU6 is not set

X # CONFIG_UCODE_PATCH is not set
-CONFIG_BLK_DEV_MPC8xx_IDE=y

diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/apus_defconfig linux/arch/ppc/configs/apus_defconfig
--- v2.4.13/linux/arch/ppc/configs/apus_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/apus_defconfig Fri Nov 2 17:43:54 2001
@@ -32,7 +32,6 @@


X # CONFIG_ALL_PPC is not set

X CONFIG_APUS=y


X # CONFIG_GEMINI is not set
-# CONFIG_PPC601_SYNC_FIX is not set
X # CONFIG_SMP is not set
X # CONFIG_ALTIVEC is not set
X # CONFIG_TAU is not set

@@ -105,7 +104,6 @@


X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices

@@ -133,6 +131,7 @@
X CONFIG_MD_RAID0=m
X CONFIG_MD_RAID1=m
X CONFIG_MD_RAID5=m


+# CONFIG_MD_MULTIPATH is not set

X CONFIG_BLK_DEV_LVM=m
X
X #
@@ -161,6 +160,7 @@


X #
X CONFIG_IP_NF_CONNTRACK=m
X CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m

X CONFIG_IP_NF_QUEUE=m
X CONFIG_IP_NF_IPTABLES=m
X CONFIG_IP_NF_MATCH_LIMIT=m
@@ -168,6 +168,8 @@


X CONFIG_IP_NF_MATCH_MARK=m
X CONFIG_IP_NF_MATCH_MULTIPORT=m
X CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
X CONFIG_IP_NF_MATCH_TCPMSS=m
X CONFIG_IP_NF_MATCH_STATE=m
X CONFIG_IP_NF_MATCH_UNCLEAN=m

@@ -179,6 +181,8 @@


X CONFIG_IP_NF_NAT_NEEDED=y
X CONFIG_IP_NF_TARGET_MASQUERADE=m
X CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
X CONFIG_IP_NF_NAT_FTP=m

X CONFIG_IP_NF_MANGLE=m
X CONFIG_IP_NF_TARGET_TOS=m
@@ -191,6 +195,7 @@


X # CONFIG_IPV6 is not set

X CONFIG_KHTTPD=m


X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
X
X #
X #

@@ -261,6 +266,9 @@
X # CONFIG_IDEDMA_AUTO is not set


X # CONFIG_DMA_NONPCI is not set

X # CONFIG_BLK_DEV_IDE_MODES is not set


+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set
X
X #
X # SCSI support

@@ -298,6 +306,7 @@


X # CONFIG_SCSI_AHA1740 is not set
X # CONFIG_SCSI_AIC7XXX is not set
X # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
X # CONFIG_SCSI_ADVANSYS is not set
X # CONFIG_SCSI_IN2000 is not set
X # CONFIG_SCSI_AM53C974 is not set

@@ -334,8 +343,6 @@
X # CONFIG_SCSI_T128 is not set
X # CONFIG_SCSI_U14_34F is not set
X # CONFIG_SCSI_DEBUG is not set
-# CONFIG_SCSI_MESH is not set
-# CONFIG_SCSI_MAC53C94 is not set
X CONFIG_A3000_SCSI=y
X CONFIG_A4000T_SCSI=y
X CONFIG_A2091_SCSI=y
@@ -374,12 +381,9 @@


X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set

X CONFIG_ARIADNE=y
X CONFIG_NE2K_ZORRO=y
X CONFIG_A2065=y
@@ -403,9 +407,9 @@


X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set

@@ -496,14 +500,13 @@


X # CONFIG_FB_IMSTT is not set
X # CONFIG_FB_S3TRIO is not set
X # CONFIG_FB_VGA16 is not set
-# CONFIG_FB_PVR2 is not set
-# CONFIG_FB_PVR2_DEBUG is not set
-# CONFIG_FB_E1355 is not set

X # CONFIG_FB_MATROX is not set


X # CONFIG_FB_ATY is not set
+# CONFIG_FB_RADEON is not set
X # CONFIG_FB_ATY128 is not set

-# CONFIG_FB_3DFX is not set
X # CONFIG_FB_SIS is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
X # CONFIG_FB_VIRTUAL is not set

X CONFIG_FBCON_ADVANCED=y
X # CONFIG_FBCON_MFB is not set
@@ -582,11 +585,38 @@

+# CONFIG_INPUT_AMIJOY is not set


X # CONFIG_QIC02_TAPE is not set
X
X #

@@ -599,7 +629,6 @@


X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver

@@ -632,6 +661,7 @@


X CONFIG_VFAT_FS=y
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set

X CONFIG_CRAMFS=y
X CONFIG_TMPFS=y
X CONFIG_RAMFS=m
@@ -804,6 +834,104 @@

diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/bseip_defconfig linux/arch/ppc/configs/bseip_defconfig
--- v2.4.13/linux/arch/ppc/configs/bseip_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/bseip_defconfig Fri Nov 2 17:43:54 2001


@@ -25,10 +25,12 @@
X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X CONFIG_8xx=y
+# CONFIG_PPC_STD_MMU is not set
X CONFIG_SERIAL_CONSOLE=y
X # CONFIG_RPXLITE is not set
X # CONFIG_RPXCLASSIC is not set

X CONFIG_BSEIP=y

@@ -443,11 +451,109 @@

diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/common_defconfig linux/arch/ppc/configs/common_defconfig
--- v2.4.13/linux/arch/ppc/configs/common_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/common_defconfig Fri Nov 2 17:43:54 2001

-CONFIG_SCSI_ADVANSYS=y


+# CONFIG_SCSI_DPT_I2O is not set
+CONFIG_SCSI_ADVANSYS=m
X # CONFIG_SCSI_IN2000 is not set
X # CONFIG_SCSI_AM53C974 is not set
X # CONFIG_SCSI_MEGARAID is not set

diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/est8260_defconfig linux/arch/ppc/configs/est8260_defconfig
--- v2.4.13/linux/arch/ppc/configs/est8260_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/est8260_defconfig Fri Nov 2 17:43:54 2001
@@ -29,7 +29,6 @@
X CONFIG_PPC_STD_MMU=y
X CONFIG_SERIAL_CONSOLE=y
X CONFIG_EST8260=y


-CONFIG_PPC601_SYNC_FIX=y
X # CONFIG_SMP is not set
X

X #
@@ -69,7 +68,6 @@


X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices

@@ -95,6 +93,7 @@


X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #

@@ -123,6 +122,7 @@


X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
X
X #
X #

@@ -176,12 +176,9 @@


X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set
-# CONFIG_NCR885E is not set
-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set

@@ -199,9 +196,9 @@


X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set

@@ -263,6 +260,10 @@


X # Input core support
X #
X # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
X
X #
X # Macintosh device drivers

@@ -292,7 +293,11 @@


X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks

@@ -309,7 +314,6 @@


X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver

@@ -342,6 +346,7 @@


X # CONFIG_VFAT_FS is not set
X # CONFIG_EFS_FS is not set
X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set
X CONFIG_TMPFS=y
X # CONFIG_RAMFS is not set

@@ -422,6 +427,103 @@

diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/gemini_defconfig linux/arch/ppc/configs/gemini_defconfig
--- v2.4.13/linux/arch/ppc/configs/gemini_defconfig Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/configs/gemini_defconfig Fri Nov 2 17:43:54 2001
@@ -32,7 +32,6 @@


X # CONFIG_ALL_PPC is not set

X # CONFIG_APUS is not set

X CONFIG_GEMINI=y


-# CONFIG_PPC601_SYNC_FIX is not set
X # CONFIG_SMP is not set

X CONFIG_ALTIVEC=y
X CONFIG_TAU=y
@@ -77,7 +76,6 @@


X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
X
X #
X # Block devices

@@ -103,6 +101,7 @@


X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #

@@ -137,6 +136,7 @@


X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
X
X #
X #

@@ -202,6 +202,7 @@


X # CONFIG_SCSI_AHA1740 is not set
X # CONFIG_SCSI_AIC7XXX is not set
X # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
X # CONFIG_SCSI_ADVANSYS is not set
X # CONFIG_SCSI_IN2000 is not set
X # CONFIG_SCSI_AM53C974 is not set

@@ -243,8 +244,6 @@
X # CONFIG_SCSI_T128 is not set
X # CONFIG_SCSI_U14_34F is not set
X # CONFIG_SCSI_DEBUG is not set
-# CONFIG_SCSI_MESH is not set
-# CONFIG_SCSI_MAC53C94 is not set
X
X #
X # IEEE 1394 (FireWire) support (EXPERIMENTAL)
@@ -270,12 +269,9 @@


X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
-# CONFIG_ARM_AM79C961A is not set
X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set

-CONFIG_NCR885E=y


-# CONFIG_OAKNET is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_HAPPYMEAL is not set
X # CONFIG_SUNBMAC is not set

@@ -295,9 +291,9 @@


X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
X # CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set

@@ -359,6 +355,10 @@


X # Input core support
X #
X # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
X
X #
X # Macintosh device drivers

@@ -390,7 +390,11 @@
X #


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 08'
echo 'File patch-2.4.14 is continued in part 09'
echo "09" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:25 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part02

#!/bin/sh -x
# this is part 02 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh

# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 02; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'

sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+#
+# PCMCIA character devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+CONFIG_FAT_FS=y
+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set
+CONFIG_VFAT_FS=y


+# CONFIG_EFS_FS is not set

+# CONFIG_JFFS_FS is not set


+# CONFIG_JFFS2_FS is not set

+CONFIG_CRAMFS=y
+# CONFIG_TMPFS is not set
+CONFIG_RAMFS=y
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_SMB_NLS is not set
+CONFIG_NLS=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ISO8859_1 is not set
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Console drivers
+#
+CONFIG_PC_KEYMAP=y
+# CONFIG_VGA_CONSOLE is not set
+
+#
+# Frame-buffer support
+#
+CONFIG_FB=y
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FB_ACORN is not set
+# CONFIG_FB_CLPS711X is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_SA1100=y
+# CONFIG_FB_ANAKIN is not set
+# CONFIG_FB_E1355 is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FBCON_ADVANCED is not set
+CONFIG_FBCON_CFB2=y
+CONFIG_FBCON_CFB4=y
+CONFIG_FBCON_CFB8=y
+CONFIG_FBCON_CFB16=y
+CONFIG_FBCON_FONTWIDTH8_ONLY=y
+CONFIG_FBCON_FONTS=y
+# CONFIG_FONT_8x8 is not set
+CONFIG_FONT_8x16=y
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set


+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set

+CONFIG_USB_OHCI=y
+CONFIG_USB_OHCI_NOPCI=y


+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set

+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set

+# CONFIG_USB_HID is not set

+# CONFIG_USB_KBD is not set
+CONFIG_USB_MOUSE=y


+# CONFIG_USB_WACOM is not set

+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set

+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_OV511 is not set
+# CONFIG_USB_PWC is not set
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_DSBR is not set
+# CONFIG_USB_DABUSB is not set
+# CONFIG_USB_PLUSB is not set


+# CONFIG_USB_PEGASUS is not set

+# CONFIG_USB_CATC is not set

+# CONFIG_USB_NET1080 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_USS720 is not set
+
+#


+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set

+# CONFIG_USB_RIO500 is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_NO_FRAME_POINTER is not set
+CONFIG_DEBUG_ERRORS=y
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_NO_PGT_CACHE is not set
+# CONFIG_DEBUG_LL is not set
+# CONFIG_DEBUG_DC21285_PORT is not set
+# CONFIG_DEBUG_CLPS711X_UART2 is not set
diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/assabet linux/arch/arm/def-configs/assabet
--- v2.4.13/linux/arch/arm/def-configs/assabet Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/def-configs/assabet Thu Oct 25 13:53:44 2001
@@ -8,6 +8,8 @@
X CONFIG_UID16=y
X CONFIG_RWSEM_GENERIC_SPINLOCK=y
X # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+# CONFIG_GENERIC_BUST_SPINLOCK is not set
+# CONFIG_GENERIC_ISA_DMA is not set
X
X #
X # Code maturity level options
@@ -31,6 +33,7 @@
X # CONFIG_ARCH_CLPS711X is not set
X # CONFIG_ARCH_CO285 is not set
X # CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_CAMELOT is not set
X # CONFIG_ARCH_FOOTBRIDGE is not set
X # CONFIG_ARCH_INTEGRATOR is not set
X # CONFIG_ARCH_L7200 is not set
@@ -62,13 +65,15 @@
X #
X CONFIG_SA1100_ASSABET=y
X # CONFIG_ASSABET_NEPONSET is not set
+# CONFIG_SA1100_ADSBITSY is not set
X # CONFIG_SA1100_BRUTUS is not set
X # CONFIG_SA1100_CERF is not set
-# CONFIG_SA1100_BITSY is not set
+# CONFIG_SA1100_H3600 is not set
X # CONFIG_SA1100_EXTENEX1 is not set
X # CONFIG_SA1100_FLEXANET is not set
X # CONFIG_SA1100_FREEBIRD is not set
X # CONFIG_SA1100_GRAPHICSCLIENT is not set
+# CONFIG_SA1100_GRAPHICSMASTER is not set
X # CONFIG_SA1100_JORNADA720 is not set
X # CONFIG_SA1100_HUW_WEBPANEL is not set
X # CONFIG_SA1100_ITSY is not set
@@ -90,7 +95,12 @@
X #
X # CLPS711X/EP721X Implementations
X #
+# CONFIG_ARCH_CDB89712 is not set
+# CONFIG_ARCH_CLEP7312 is not set
+# CONFIG_ARCH_EDB7211 is not set
X # CONFIG_ARCH_P720T is not set
+# CONFIG_ARCH_EP7211 is not set
+# CONFIG_ARCH_EP7212 is not set
X # CONFIG_ARCH_ACORN is not set
X # CONFIG_FOOTBRIDGE is not set
X # CONFIG_FOOTBRIDGE_HOST is not set
@@ -110,14 +120,14 @@
X # CONFIG_CPU_ARM1020 is not set
X # CONFIG_CPU_SA110 is not set
X CONFIG_CPU_SA1100=y
+# CONFIG_ARM_THUMB is not set
X CONFIG_DISCONTIGMEM=y
-# CONFIG_CPU_BIG_ENDIAN is not set
X
X #
X # General setup
X #
X # CONFIG_PCI is not set
-# CONFIG_ISA is not set
+CONFIG_ISA=y
X # CONFIG_ISA_DMA is not set
X CONFIG_CPU_FREQ=y
X CONFIG_HOTPLUG=y
@@ -134,6 +144,10 @@
X CONFIG_SYSVIPC=y
X # CONFIG_BSD_PROCESS_ACCT is not set
X CONFIG_SYSCTL=y
+
+#
+# At least one math emulation must be selected
+#
X CONFIG_FPE_NWFPE=y
X # CONFIG_FPE_FASTFPE is not set
X CONFIG_KCORE_ELF=y
@@ -142,10 +156,8 @@
X CONFIG_BINFMT_ELF=y
X # CONFIG_BINFMT_MISC is not set
X CONFIG_PM=y
-# CONFIG_APM is not set


X # CONFIG_ARTHUR is not set

X CONFIG_CMDLINE=""
-# CONFIG_PFS168_CMDLINE is not set
X CONFIG_LEDS=y
X CONFIG_LEDS_TIMER=y
X CONFIG_LEDS_CPU=y
@@ -178,6 +190,8 @@
X # RAM/ROM/Flash chip drivers
X #
X CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
X CONFIG_MTD_CFI_ADV_OPTIONS=y
X CONFIG_MTD_CFI_NOSWAP=y
X # CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
@@ -191,47 +205,31 @@
X # CONFIG_MTD_CFI_I4 is not set
X CONFIG_MTD_CFI_INTELEXT=y
X # CONFIG_MTD_CFI_AMDSTD is not set
-# CONFIG_MTD_AMDSTD is not set
-# CONFIG_MTD_SHARP is not set
X # CONFIG_MTD_RAM is not set
X # CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+# CONFIG_MTD_AMDSTD is not set
+# CONFIG_MTD_SHARP is not set
X # CONFIG_MTD_JEDEC is not set
X
X #
X # Mapping drivers for chip access
X #
X # CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_SUN_UFLASH is not set
X # CONFIG_MTD_NORA is not set
-# CONFIG_MTD_PNC2000 is not set
-# CONFIG_MTD_RPXLITE is not set
-# CONFIG_MTD_TQM8XXL is not set
-# CONFIG_MTD_SC520CDP is not set
-# CONFIG_MTD_NETSC520 is not set
-# CONFIG_MTD_SBC_GXX is not set
-# CONFIG_MTD_ELAN_104NC is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_CDB89712 is not set
X CONFIG_MTD_SA1100=y
-CONFIG_MTD_SA1100_REDBOOT_PARTITIONS=y
-# CONFIG_MTD_SA1100_BOOTLDR_PARTITIONS is not set
X # CONFIG_MTD_DC21285 is not set
X # CONFIG_MTD_IQ80310 is not set
-# CONFIG_MTD_DBOX2 is not set
-# CONFIG_MTD_CSTM_MIPS_IXX is not set
-# CONFIG_MTD_CFI_FLAGADM is not set
-# CONFIG_MTD_ARM_INTEGRATOR is not set
-# CONFIG_MTD_SOLUTIONENGINE is not set
-# CONFIG_MTD_MIXMEM is not set
-# CONFIG_MTD_OCTAGON is not set
-# CONFIG_MTD_VMAX is not set


-# CONFIG_MTD_OCELOT is not set

-# CONFIG_MTD_L440GX is not set
+# CONFIG_MTD_PCI is not set
X
X #
X # Self-contained MTD device drivers
X #
X # CONFIG_MTD_PMC551 is not set
X # CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_LART is not set
X # CONFIG_MTD_MTDRAM is not set
X # CONFIG_MTD_BLKMTD is not set
X
@@ -253,6 +251,7 @@


X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set

+# CONFIG_PNPBIOS is not set
X
X #
X # Block devices
@@ -262,6 +261,7 @@
X # CONFIG_PARIDE is not set
X # CONFIG_BLK_CPQ_DA is not set
X # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
X # CONFIG_BLK_DEV_DAC960 is not set
X CONFIG_BLK_DEV_LOOP=m
X # CONFIG_BLK_DEV_NBD is not set
@@ -278,6 +278,7 @@


X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #

@@ -339,6 +340,7 @@


X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y

+# CONFIG_ARM_AM79C961A is not set


X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set

@@ -348,6 +350,9 @@
X # CONFIG_LANCE is not set
X # CONFIG_NET_VENDOR_SMC is not set
X # CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
X # CONFIG_NET_ISA is not set
X # CONFIG_NET_PCI is not set
X # CONFIG_NET_POCKET is not set
@@ -356,8 +361,9 @@


X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set

-# CONFIG_ACENIC_OMIT_TIGON_I is not set
+# CONFIG_DL2K is not set


X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set

@@ -442,6 +448,8 @@
X # CONFIG_WINBOND_FIR is not set
X # CONFIG_TOSHIBA_FIR is not set
X # CONFIG_SMC_IRCC_FIR is not set
+# CONFIG_ALI_FIR is not set
+# CONFIG_VLSI_FIR is not set
X CONFIG_SA1100_FIR=m
X
X #
@@ -486,6 +494,9 @@


X # CONFIG_IDEDMA_AUTO is not set
X # CONFIG_DMA_NONPCI is not set
X # CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set

X
X #
X # SCSI support
@@ -510,6 +521,10 @@


X # Input core support
X #
X # CONFIG_INPUT is not set

+# CONFIG_INPUT_KEYBDEV is not set

+# CONFIG_INPUT_MOUSEDEV is not set

+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set

X
X #
X # Character devices
@@ -519,31 +534,36 @@
X # CONFIG_SERIAL is not set
X # CONFIG_SERIAL_EXTENDED is not set
X # CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_SERIAL_21285 is not set
-# CONFIG_SERIAL_21285_OLD is not set
-# CONFIG_SERIAL_21285_CONSOLE is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_ANAKIN is not set
+# CONFIG_SERIAL_ANAKIN_CONSOLE is not set
X # CONFIG_SERIAL_AMBA is not set
X # CONFIG_SERIAL_AMBA_CONSOLE is not set
X # CONFIG_SERIAL_CLPS711X is not set
X # CONFIG_SERIAL_CLPS711X_CONSOLE is not set


+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set

+# CONFIG_SERIAL_UART00 is not set
+# CONFIG_SERIAL_UART00_CONSOLE is not set
X CONFIG_SERIAL_SA1100=y
X CONFIG_SERIAL_SA1100_CONSOLE=y
X CONFIG_SA1100_DEFAULT_BAUDRATE=38400
X CONFIG_SERIAL_8250=m
X # CONFIG_SERIAL_8250_CONSOLE is not set
+# CONFIG_SERIAL_8250_EXTENDED is not set
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_HUB6 is not set
X CONFIG_SERIAL_CORE=y
X CONFIG_SERIAL_CORE_CONSOLE=y
X CONFIG_UNIX98_PTYS=y
X CONFIG_UNIX98_PTY_COUNT=32
-CONFIG_UCB1200=y
-CONFIG_TOUCHSCREEN_UCB1200=y
-# CONFIG_AUDIO_UCB1200 is not set
-CONFIG_ADC_UCB1200=y
-# CONFIG_TOUCHSCREEN_BITSY is not set
-# CONFIG_PROFILER is not set
-# CONFIG_PFS168_SPI is not set
-# CONFIG_PFS168_DTMF is not set
-# CONFIG_PFS168_MISC is not set
X
X #
X # I2C support
@@ -551,6 +571,19 @@
X # CONFIG_I2C is not set
X
X #
+# L3 serial bus support
+#
+CONFIG_L3=y
+CONFIG_L3_ALGOBIT=y
+CONFIG_L3_BIT_SA1100_GPIO=y
+
+#
+# Other L3 adapters
+#
+# CONFIG_L3_SA1111 is not set
+CONFIG_BIT_SA1100_GPIO=y
+
+#
X # Mice
X #
X # CONFIG_BUSMOUSE is not set
@@ -559,7 +592,11 @@


X #
X # Joysticks
X #

-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#


+# Input core support is needed for gameports
+#

X
X #


X # Input core support is needed for joysticks

@@ -588,6 +625,8 @@
X #
X # PCMCIA character devices
X #
+CONFIG_PCMCIA_SERIAL_CS=m
+# CONFIG_MWAVE is not set
X
X #
X # Multimedia devices
@@ -607,13 +646,16 @@
X # CONFIG_AFFS_FS is not set
X # CONFIG_HFS_FS is not set
X # CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
X CONFIG_FAT_FS=y
X CONFIG_MSDOS_FS=y
X # CONFIG_UMSDOS_FS is not set


X # CONFIG_VFAT_FS is not set
X # CONFIG_EFS_FS is not set

-CONFIG_JFFS_FS=m
-CONFIG_JFFS_FS_VERBOSE=0
+# CONFIG_JFFS_FS is not set
X CONFIG_JFFS2_FS=y
X CONFIG_JFFS2_FS_DEBUG=0


X # CONFIG_CRAMFS is not set

@@ -621,8 +663,9 @@


X # CONFIG_RAMFS is not set

X # CONFIG_ISO9660_FS is not set
X # CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
X # CONFIG_MINIX_FS is not set
-# CONFIG_VXFS_FS is not set
+# CONFIG_FREEVXFS_FS is not set
X # CONFIG_NTFS_FS is not set
X # CONFIG_NTFS_RW is not set
X # CONFIG_HPFS_FS is not set
@@ -645,6 +688,7 @@
X # Network File Systems
X #
X # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
X CONFIG_NFS_FS=y
X # CONFIG_NFS_V3 is not set
X # CONFIG_ROOT_NFS is not set
@@ -662,6 +706,8 @@
X # CONFIG_NCPFS_SMALLDOS is not set
X # CONFIG_NCPFS_NLS is not set
X # CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set
+# CONFIG_ZLIB_FS_INFLATE is not set
X
X #
X # Partition Types
@@ -677,6 +723,7 @@
X # CONFIG_MINIX_SUBPARTITION is not set
X # CONFIG_SOLARIS_X86_PARTITION is not set
X # CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
X # CONFIG_SGI_PARTITION is not set
X # CONFIG_ULTRIX_PARTITION is not set
X # CONFIG_SUN_PARTITION is not set
@@ -736,11 +783,10 @@
X CONFIG_FB=y
X CONFIG_DUMMY_CONSOLE=y
X # CONFIG_FB_ACORN is not set
+# CONFIG_FB_ANAKIN is not set
X # CONFIG_FB_CLPS711X is not set
-# CONFIG_FB_CYBER2000 is not set
X CONFIG_FB_SA1100=y
-# CONFIG_FB_ANAKIN is not set


-# CONFIG_FB_E1355 is not set

+# CONFIG_FB_CYBER2000 is not set


X # CONFIG_FB_VIRTUAL is not set
X # CONFIG_FBCON_ADVANCED is not set

X CONFIG_FBCON_CFB2=y
@@ -759,12 +805,10 @@
X # Sound
X #
X CONFIG_SOUND=y
-CONFIG_SOUND_ASSABET_UDA1341=y
-# CONFIG_SOUND_BITSY_UDA1341 is not set
-# CONFIG_SOUND_SA1111_UDA1341 is not set
-# CONFIG_SOUND_SA1100SSP is not set
+# CONFIG_SOUND_BT878 is not set
X # CONFIG_SOUND_CMPCI is not set
X # CONFIG_SOUND_EMU10K1 is not set
+# CONFIG_MIDI_EMU10K1 is not set
X # CONFIG_SOUND_FUSION is not set
X # CONFIG_SOUND_CS4281 is not set
X # CONFIG_SOUND_ES1370 is not set
@@ -773,21 +817,138 @@
X # CONFIG_SOUND_MAESTRO is not set
X # CONFIG_SOUND_MAESTRO3 is not set
X # CONFIG_SOUND_ICH is not set
+# CONFIG_SOUND_RME96XX is not set
X # CONFIG_SOUND_SONICVIBES is not set
X # CONFIG_SOUND_TRIDENT is not set
X # CONFIG_SOUND_MSNDCLAS is not set
X # CONFIG_SOUND_MSNDPIN is not set
X # CONFIG_SOUND_VIA82CXXX is not set
X # CONFIG_MIDI_VIA82CXXX is not set
+CONFIG_SOUND_SA1100=y
+CONFIG_SOUND_UDA1341=y
+CONFIG_SOUND_ASSABET_UDA1341=y
+# CONFIG_SOUND_H3600_UDA1341 is not set
+# CONFIG_SOUND_PANGOLIN_UDA1341 is not set
+# CONFIG_SOUND_SA1111_UDA1341 is not set
+# CONFIG_SOUND_SA1100SSP is not set
X # CONFIG_SOUND_OSS is not set
+# CONFIG_SOUND_WAVEARTIST is not set
X # CONFIG_SOUND_TVMIXER is not set
X
X #
+# Multimedia Capabilities Port drivers
+#
+CONFIG_MCP=y
+CONFIG_MCP_SA1100=y
+CONFIG_MCP_UCB1200=y
+CONFIG_MCP_UCB1200_AUDIO=m
+CONFIG_MCP_UCB1200_TS=y
+
+#


X # USB support
X #
X # CONFIG_USB is not set

X
X #


+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set

+# CONFIG_USB_OHCI_SA1111 is not set
+
+#


+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set

+# CONFIG_USB_PRINTER is not set
+
+#


+# USB Human Interface Devices (HID)
+#

+
+#


+# Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set

+# CONFIG_USB_HPUSBSCSI is not set
+
+#


+# USB Multimedia devices
+#
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set

+# CONFIG_USB_USBNET is not set
+
+#


+# USB port drivers
+#

+# CONFIG_USB_USS720 is not set
+
+#

+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#


+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set

+# CONFIG_USB_ID75 is not set
+
+#
X # Bluetooth support
X #
X # CONFIG_BLUEZ is not set
@@ -799,7 +960,9 @@
X CONFIG_DEBUG_ERRORS=y
X CONFIG_DEBUG_USER=y
X # CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_SLAB is not set
X CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set
X # CONFIG_NO_PGT_CACHE is not set
X # CONFIG_DEBUG_LL is not set
X # CONFIG_DEBUG_DC21285_PORT is not set
diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/bitsy linux/arch/arm/def-configs/bitsy
--- v2.4.13/linux/arch/arm/def-configs/bitsy Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/def-configs/bitsy Wed Dec 31 16:00:00 1969
@@ -1,763 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-CONFIG_ARM=y
-# CONFIG_EISA is not set
-# CONFIG_SBUS is not set
-# CONFIG_MCA is not set
-CONFIG_UID16=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-# CONFIG_OBSOLETE is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-# CONFIG_KMOD is not set
-
-#
-# System Type
-#
-# CONFIG_ARCH_ANAKIN is not set
-# CONFIG_ARCH_ARCA5K is not set
-# CONFIG_ARCH_CLPS7500 is not set
-# CONFIG_ARCH_CLPS711X is not set
-# CONFIG_ARCH_CO285 is not set
-# CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_INTEGRATOR is not set
-# CONFIG_ARCH_L7200 is not set
-# CONFIG_ARCH_RPC is not set
-CONFIG_ARCH_SA1100=y
-# CONFIG_ARCH_SHARK is not set
-
-#
-# Archimedes/A5000 Implementations
-#
-
-#
-# Archimedes/A5000 Implementations (select only ONE)
-#
-# CONFIG_ARCH_ARC is not set
-# CONFIG_ARCH_A5K is not set
-
-#
-# Footbridge Implementations
-#
-# CONFIG_ARCH_CATS is not set
-# CONFIG_ARCH_PERSONAL_SERVER is not set
-# CONFIG_ARCH_EBSA285_ADDIN is not set
-# CONFIG_ARCH_EBSA285_HOST is not set
-# CONFIG_ARCH_NETWINDER is not set
-
-#
-# SA11x0 Implementations
-#
-# CONFIG_SA1100_ASSABET is not set
-# CONFIG_ASSABET_NEPONSET is not set
-# CONFIG_SA1100_BRUTUS is not set
-# CONFIG_SA1100_CERF is not set
-CONFIG_SA1100_BITSY=y
-# CONFIG_SA1100_EXTENEX1 is not set
-# CONFIG_SA1100_FLEXANET is not set
-# CONFIG_SA1100_FREEBIRD is not set
-# CONFIG_SA1100_GRAPHICSCLIENT is not set
-# CONFIG_SA1100_JORNADA720 is not set
-# CONFIG_SA1100_HUW_WEBPANEL is not set
-# CONFIG_SA1100_ITSY is not set
-# CONFIG_SA1100_LART is not set
-# CONFIG_SA1100_NANOENGINE is not set
-# CONFIG_SA1100_OMNIMETER is not set
-# CONFIG_SA1100_PANGOLIN is not set
-# CONFIG_SA1100_PLEB is not set
-# CONFIG_SA1100_SHERMAN is not set
-# CONFIG_SA1100_SIMPAD is not set
-# CONFIG_SA1100_PFS168 is not set
-# CONFIG_SA1100_VICTOR is not set
-# CONFIG_SA1100_XP860 is not set
-# CONFIG_SA1100_YOPY is not set
-CONFIG_SA1100_USB=m
-CONFIG_SA1100_USB_NETLINK=m
-# CONFIG_SA1100_USB_CHAR is not set
-
-#
-# CLPS711X/EP721X Implementations
-#
-# CONFIG_ARCH_P720T is not set
-# CONFIG_ARCH_ACORN is not set
-# CONFIG_FOOTBRIDGE is not set
-# CONFIG_FOOTBRIDGE_HOST is not set
-# CONFIG_FOOTBRIDGE_ADDIN is not set
-CONFIG_CPU_32=y
-# CONFIG_CPU_26 is not set
-
-#
-# Processor Type
-#
-# CONFIG_CPU_32v3 is not set
-CONFIG_CPU_32v4=y
-# CONFIG_CPU_ARM610 is not set
-# CONFIG_CPU_ARM710 is not set
-# CONFIG_CPU_ARM720T is not set
-# CONFIG_CPU_ARM920T is not set
-# CONFIG_CPU_ARM1020 is not set
-# CONFIG_CPU_SA110 is not set
-CONFIG_CPU_SA1100=y
-CONFIG_DISCONTIGMEM=y
-# CONFIG_CPU_BIG_ENDIAN is not set
-
-#
-# General setup
-#
-# CONFIG_PCI is not set
-# CONFIG_ISA is not set
-# CONFIG_ISA_DMA is not set
-CONFIG_CPU_FREQ=y
-CONFIG_HOTPLUG=y
-
-#
-# PCMCIA/CardBus support
-#
-CONFIG_PCMCIA=y
-# CONFIG_I82365 is not set
-# CONFIG_TCIC is not set
-# CONFIG_PCMCIA_CLPS6700 is not set
-CONFIG_PCMCIA_SA1100=y
-CONFIG_NET=y
-CONFIG_SYSVIPC=y
-# CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
-CONFIG_FPE_NWFPE=y
-# CONFIG_FPE_FASTFPE is not set
-CONFIG_KCORE_ELF=y
-# CONFIG_KCORE_AOUT is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
-CONFIG_PM=y
-CONFIG_APM=m
-# CONFIG_ARTHUR is not set
-CONFIG_CMDLINE=""
-# CONFIG_PFS168_CMDLINE is not set
-# CONFIG_LEDS is not set
-CONFIG_ALIGNMENT_TRAP=y
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
-CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_REDBOOT_PARTS=y
-CONFIG_MTD_BOOTLDR_PARTS=y
-# CONFIG_MTD_AFS_PARTS is not set
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-CONFIG_MTD_CFI=y
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_NOSWAP=y
-# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
-# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
-# CONFIG_MTD_CFI_GEOMETRY is not set
-CONFIG_MTD_CFI_INTELEXT=y
-# CONFIG_MTD_CFI_AMDSTD is not set
-# CONFIG_MTD_AMDSTD is not set
-# CONFIG_MTD_SHARP is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_JEDEC is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_SUN_UFLASH is not set
-# CONFIG_MTD_NORA is not set
-# CONFIG_MTD_PNC2000 is not set
-# CONFIG_MTD_RPXLITE is not set
-# CONFIG_MTD_TQM8XXL is not set
-# CONFIG_MTD_SC520CDP is not set
-# CONFIG_MTD_NETSC520 is not set
-# CONFIG_MTD_SBC_GXX is not set
-# CONFIG_MTD_ELAN_104NC is not set
-# CONFIG_MTD_SA1100 is not set
-# CONFIG_MTD_SA1100_REDBOOT_PARTITIONS is not set
-# CONFIG_MTD_SA1100_BOOTLDR_PARTITIONS is not set
-# CONFIG_MTD_DC21285 is not set
-# CONFIG_MTD_IQ80310 is not set
-# CONFIG_MTD_DBOX2 is not set
-# CONFIG_MTD_CSTM_MIPS_IXX is not set
-# CONFIG_MTD_CFI_FLAGADM is not set
-# CONFIG_MTD_ARM_INTEGRATOR is not set
-# CONFIG_MTD_SOLUTIONENGINE is not set
-# CONFIG_MTD_MIXMEM is not set
-# CONFIG_MTD_OCTAGON is not set
-# CONFIG_MTD_VMAX is not set


-# CONFIG_MTD_OCELOT is not set

-# CONFIG_MTD_L440GX is not set
-
-#
-# Self-contained MTD device drivers
-#
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_LART is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLKMTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC1000 is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set
-
-#
-# NAND Flash Device Drivers
-#
-# CONFIG_MTD_NAND is not set
-
-#
-# Plug and Play configuration
-#
-# CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_XD is not set
-# CONFIG_PARIDE is not set
-# CONFIG_BLK_CPQ_DA is not set
-# CONFIG_BLK_CPQ_CISS_DA is not set
-# CONFIG_BLK_DEV_DAC960 is not set
-CONFIG_BLK_DEV_LOOP=m
-# CONFIG_BLK_DEV_NBD is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=8192
-CONFIG_BLK_DEV_INITRD=y
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-# CONFIG_BLK_DEV_MD is not set
-# CONFIG_MD_LINEAR is not set
-# CONFIG_MD_RAID0 is not set
-# CONFIG_MD_RAID1 is not set
-# CONFIG_MD_RAID5 is not set
-# CONFIG_BLK_DEV_LVM is not set
-
-#
-# Networking options
-#
-# CONFIG_PACKET is not set
-# CONFIG_NETLINK is not set
-# CONFIG_NETFILTER is not set
-# CONFIG_FILTER is not set
-CONFIG_UNIX=y
-CONFIG_INET=y
-# CONFIG_IP_MULTICAST is not set
-# CONFIG_IP_ADVANCED_ROUTER is not set
-# CONFIG_IP_PNP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-# CONFIG_INET_ECN is not set
-# CONFIG_SYN_COOKIES is not set
-# CONFIG_IPV6 is not set
-# CONFIG_KHTTPD is not set
-# CONFIG_ATM is not set
-
-#
-#
-#
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_LLC is not set
-# CONFIG_NET_DIVERT is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_FASTROUTE is not set
-# CONFIG_NET_HW_FLOWCONTROL is not set
-
-#
-# QoS and/or fair queueing
-#
-# CONFIG_NET_SCHED is not set
-
-#
-# Network device support
-#
-CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
-# CONFIG_NET_ETHERNET is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_ACENIC is not set


-# CONFIG_ACENIC_OMIT_TIGON_I is not set

-# CONFIG_MYRI_SBUS is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
-CONFIG_PPP=m
-# CONFIG_PPP_MULTILINK is not set
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-# CONFIG_PPPOE is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#


-# CONFIG_NET_RADIO is not set

-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# PCMCIA network device support
-#
-CONFIG_NET_PCMCIA=y
-# CONFIG_PCMCIA_3C589 is not set
-# CONFIG_PCMCIA_3C574 is not set
-# CONFIG_PCMCIA_FMVJ18X is not set
-CONFIG_PCMCIA_PCNET=y
-# CONFIG_PCMCIA_NMCLAN is not set
-# CONFIG_PCMCIA_SMC91C92 is not set
-# CONFIG_PCMCIA_XIRC2PS is not set
-# CONFIG_ARCNET_COM20020_CS is not set
-# CONFIG_PCMCIA_IBMTR is not set
-# CONFIG_NET_PCMCIA_RADIO is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# ATA/IDE/MFM/RLL support
-#
-CONFIG_IDE=m
-
-#
-# IDE, ATA and ATAPI Block devices
-#
-CONFIG_BLK_DEV_IDE=m
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
-# CONFIG_BLK_DEV_HD_IDE is not set
-# CONFIG_BLK_DEV_HD is not set
-CONFIG_BLK_DEV_IDEDISK=m
-# CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
-# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
-# CONFIG_BLK_DEV_IDEDISK_IBM is not set
-# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set
-# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set
-# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set
-# CONFIG_BLK_DEV_IDEDISK_WD is not set
-# CONFIG_BLK_DEV_COMMERIAL is not set
-# CONFIG_BLK_DEV_TIVO is not set
-# CONFIG_BLK_DEV_IDECS is not set
-CONFIG_BLK_DEV_IDECD=m
-# CONFIG_BLK_DEV_IDETAPE is not set
-# CONFIG_BLK_DEV_IDEFLOPPY is not set
-# CONFIG_BLK_DEV_IDESCSI is not set
-
-#
-# IDE chipset support/bugfixes
-#
-# CONFIG_BLK_DEV_CMD640 is not set
-# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
-# CONFIG_BLK_DEV_ISAPNP is not set
-# CONFIG_IDE_CHIPSETS is not set
-# CONFIG_IDEDMA_AUTO is not set
-# CONFIG_DMA_NONPCI is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-
-#
-# SCSI support
-#
-# CONFIG_SCSI is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
-# ISDN subsystem
-#
-# CONFIG_ISDN is not set
-
-#
-# Input core support
-#
-# CONFIG_INPUT is not set
-
-#
-# Character devices
-#
-CONFIG_VT=y
-# CONFIG_VT_CONSOLE is not set
-CONFIG_SERIAL=m
-# CONFIG_SERIAL_EXTENDED is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_SERIAL_21285 is not set
-# CONFIG_SERIAL_21285_OLD is not set
-# CONFIG_SERIAL_21285_CONSOLE is not set
-# CONFIG_SERIAL_AMBA is not set
-# CONFIG_SERIAL_AMBA_CONSOLE is not set
-# CONFIG_SERIAL_CLPS711X is not set
-# CONFIG_SERIAL_CLPS711X_CONSOLE is not set
-CONFIG_SERIAL_SA1100=y
-CONFIG_SERIAL_SA1100_CONSOLE=y
-CONFIG_SA1100_DEFAULT_BAUDRATE=38400
-CONFIG_SERIAL_8250=m
-# CONFIG_SERIAL_8250_CONSOLE is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=32
-# CONFIG_UCB1200 is not set
-# CONFIG_TOUCHSCREEN_UCB1200 is not set
-# CONFIG_AUDIO_UCB1200 is not set
-# CONFIG_ADC_UCB1200 is not set
-CONFIG_TOUCHSCREEN_BITSY=y
-CONFIG_PROFILER=m
-# CONFIG_PFS168_SPI is not set
-# CONFIG_PFS168_DTMF is not set
-# CONFIG_PFS168_MISC is not set
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-CONFIG_MOUSE=m
-# CONFIG_PSMOUSE is not set
-# CONFIG_82C710_MOUSE is not set
-# CONFIG_PC110_PAD is not set
-
-#
-# Joysticks
-#


-# CONFIG_JOYSTICK is not set

-
-#


-# Input core support is needed for joysticks

-#
-# CONFIG_QIC02_TAPE is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
-# CONFIG_NVRAM is not set
-# CONFIG_RTC is not set
-CONFIG_SA1100_RTC=m
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-
-#
-# Ftape, the floppy tape device driver
-#
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-
-#
-# PCMCIA character devices
-#
-
-#
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# File systems
-#
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_ADFS_FS is not set
-# CONFIG_ADFS_FS_RW is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_BFS_FS is not set
-CONFIG_FAT_FS=m
-CONFIG_MSDOS_FS=m
-# CONFIG_UMSDOS_FS is not set
-CONFIG_VFAT_FS=m
-# CONFIG_EFS_FS is not set
-CONFIG_JFFS_FS=m
-CONFIG_JFFS_FS_VERBOSE=2
-CONFIG_JFFS2_FS=m
-CONFIG_JFFS2_FS_DEBUG=0
-CONFIG_CRAMFS=m
-# CONFIG_TMPFS is not set
-CONFIG_RAMFS=y
-# CONFIG_ISO9660_FS is not set
-# CONFIG_JOLIET is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_NTFS_RW is not set
-# CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-CONFIG_DEVPTS_FS=y
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_QNX4FS_RW is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_EXT2_FS=y
-# CONFIG_SYSV_FS is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UDF_RW is not set
-# CONFIG_UFS_FS is not set
-# CONFIG_UFS_FS_WRITE is not set
-
-#
-# Network File Systems
-#
-# CONFIG_CODA_FS is not set
-CONFIG_NFS_FS=y
-# CONFIG_NFS_V3 is not set
-# CONFIG_ROOT_NFS is not set
-CONFIG_NFSD=m
-# CONFIG_NFSD_V3 is not set
-CONFIG_SUNRPC=y
-CONFIG_LOCKD=y
-CONFIG_SMB_FS=m
-# CONFIG_SMB_NLS_DEFAULT is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_NCPFS_PACKET_SIGNING is not set
-# CONFIG_NCPFS_IOCTL_LOCKING is not set
-# CONFIG_NCPFS_STRONG is not set
-# CONFIG_NCPFS_NFS_NS is not set
-# CONFIG_NCPFS_OS2_NS is not set
-# CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_NCPFS_NLS is not set
-# CONFIG_NCPFS_EXTRAS is not set
-
-#
-# Partition Types
-#
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
-CONFIG_SMB_NLS=y
-CONFIG_NLS=y
-
-#
-# Native Language Support
-#
-CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-# CONFIG_NLS_ISO8859_1 is not set
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
-
-#
-# Console drivers
-#
-CONFIG_PC_KEYMAP=y
-# CONFIG_VGA_CONSOLE is not set
-
-#
-# Frame-buffer support
-#
-CONFIG_FB=y
-CONFIG_DUMMY_CONSOLE=y
-# CONFIG_FB_ACORN is not set
-# CONFIG_FB_CLPS711X is not set
-# CONFIG_FB_CYBER2000 is not set
-CONFIG_FB_SA1100=y
-# CONFIG_FB_ANAKIN is not set


-# CONFIG_FB_E1355 is not set

-# CONFIG_FB_VIRTUAL is not set
-CONFIG_FBCON_ADVANCED=y
-# CONFIG_FBCON_MFB is not set
-# CONFIG_FBCON_CFB2 is not set
-# CONFIG_FBCON_CFB4 is not set
-# CONFIG_FBCON_CFB8 is not set
-CONFIG_FBCON_CFB16=y
-# CONFIG_FBCON_CFB24 is not set
-# CONFIG_FBCON_CFB32 is not set
-# CONFIG_FBCON_AFB is not set
-# CONFIG_FBCON_ILBM is not set
-# CONFIG_FBCON_IPLAN2P2 is not set
-# CONFIG_FBCON_IPLAN2P4 is not set
-# CONFIG_FBCON_IPLAN2P8 is not set
-# CONFIG_FBCON_MAC is not set
-# CONFIG_FBCON_VGA_PLANES is not set
-# CONFIG_FBCON_VGA is not set
-# CONFIG_FBCON_HGA is not set
-CONFIG_FBCON_FONTWIDTH8_ONLY=y
-CONFIG_FBCON_FONTS=y
-CONFIG_FONT_8x8=y
-# CONFIG_FONT_8x16 is not set
-# CONFIG_FONT_SUN8x16 is not set
-# CONFIG_FONT_PEARL_8x8 is not set
-# CONFIG_FONT_ACORN_8x8 is not set
-
-#
-# Sound
-#
-CONFIG_SOUND=y
-# CONFIG_SOUND_ASSABET_UDA1341 is not set
-CONFIG_SOUND_BITSY_UDA1341=m
-# CONFIG_SOUND_SA1111_UDA1341 is not set
-# CONFIG_SOUND_SA1100SSP is not set
-# CONFIG_SOUND_CMPCI is not set
-# CONFIG_SOUND_EMU10K1 is not set
-# CONFIG_SOUND_FUSION is not set
-# CONFIG_SOUND_CS4281 is not set
-# CONFIG_SOUND_ES1370 is not set
-# CONFIG_SOUND_ES1371 is not set
-# CONFIG_SOUND_ESSSOLO1 is not set
-# CONFIG_SOUND_MAESTRO is not set
-# CONFIG_SOUND_MAESTRO3 is not set
-# CONFIG_SOUND_ICH is not set
-# CONFIG_SOUND_SONICVIBES is not set
-# CONFIG_SOUND_TRIDENT is not set
-# CONFIG_SOUND_MSNDCLAS is not set
-# CONFIG_SOUND_MSNDPIN is not set
-# CONFIG_SOUND_VIA82CXXX is not set
-# CONFIG_MIDI_VIA82CXXX is not set
-# CONFIG_SOUND_OSS is not set
-# CONFIG_SOUND_TVMIXER is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BLUEZ is not set
-
-#
-# Kernel hacking
-#
-# CONFIG_NO_FRAME_POINTER is not set
-CONFIG_DEBUG_ERRORS=y
-# CONFIG_DEBUG_USER is not set
-# CONFIG_DEBUG_INFO is not set
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_NO_PGT_CACHE is not set
-# CONFIG_DEBUG_LL is not set
-# CONFIG_DEBUG_DC21285_PORT is not set
-# CONFIG_DEBUG_CLPS711X_UART2 is not set
diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/cerf linux/arch/arm/def-configs/cerf
--- v2.4.13/linux/arch/arm/def-configs/cerf Mon Nov 27 17:07:59 2000
+++ linux/arch/arm/def-configs/cerf Wed Dec 31 16:00:00 1969
@@ -1,434 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-CONFIG_ARM=y
-# CONFIG_SBUS is not set
-CONFIG_UID16=y
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-# CONFIG_OBSOLETE is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-# CONFIG_KMOD is not set
-
-#
-# System Type
-#
-# CONFIG_ARCH_ARCA5K is not set
-# CONFIG_ARCH_CLPS7500 is not set
-# CONFIG_ARCH_CO285 is not set
-# CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_RPC is not set
-CONFIG_ARCH_SA1100=y
-
-#
-# SA11x0 Implementations
-#
-# CONFIG_SA1100_ASSABET is not set
-# CONFIG_SA1100_BRUTUS is not set
-CONFIG_SA1100_CERF=y
-CONFIG_SA1100_CERF_32MB=y
-# CONFIG_SA1100_BITSY is not set
-# CONFIG_SA1100_LART is not set
-# CONFIG_SA1100_THINCLIENT is not set
-# CONFIG_SA1100_GRAPHICSCLIENT is not set
-# CONFIG_SA1100_NANOENGINE is not set
-# CONFIG_SA1100_VICTOR is not set
-# CONFIG_SA1100_XP860 is not set
-# CONFIG_ANGELBOOT is not set
-# CONFIG_SA1100_FREQUENCY_SCALE is not set
-# CONFIG_SA1100_VOLTAGE_SCALE is not set
-# CONFIG_ARCH_ACORN is not set
-# CONFIG_FOOTBRIDGE is not set
-# CONFIG_FOOTBRIDGE_HOST is not set
-# CONFIG_FOOTBRIDGE_ADDIN is not set
-CONFIG_CPU_32=y
-# CONFIG_CPU_26 is not set
-CONFIG_CPU_32v4=y
-CONFIG_CPU_SA1100=y
-CONFIG_DISCONTIGMEM=y
-# CONFIG_PCI is not set
-# CONFIG_ISA is not set
-# CONFIG_ISA_DMA is not set
-CONFIG_PC_KEYMAP=y
-
-#
-# General setup
-#
-# CONFIG_SA1100_CERF_CMDLINE is not set
-CONFIG_HOTPLUG=y
-
-#
-# PCMCIA/CardBus support
-#
-CONFIG_PCMCIA=y
-# CONFIG_PCMCIA_DEBUG is not set
-CONFIG_SA1100_PCMCIA=y
-CONFIG_VIRTUAL_BUS=y
-CONFIG_NET=y
-CONFIG_SYSVIPC=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_SYSCTL=y
-CONFIG_NWFPE=y
-CONFIG_KCORE_ELF=y
-# CONFIG_KCORE_AOUT is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
-# CONFIG_ARTHUR is not set
-CONFIG_CMDLINE="console=ttyS0,38400"
-CONFIG_LEDS=y
-CONFIG_LEDS_TIMER=y
-CONFIG_LEDS_CPU=y
-CONFIG_ALIGNMENT_TRAP=y
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-# CONFIG_MTD is not set
-
-#
-# Plug and Play configuration
-#
-# CONFIG_PNP is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_LOOP is not set
-# CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_LVM is not set
-# CONFIG_BLK_DEV_MD is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_BLK_DEV_FLASH=y
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-# CONFIG_PACKET_MMAP is not set
-# CONFIG_NETLINK is not set
-# CONFIG_NETFILTER is not set
-# CONFIG_FILTER is not set
-CONFIG_UNIX=y
-CONFIG_INET=y
-# CONFIG_IP_MULTICAST is not set
-# CONFIG_IP_ADVANCED_ROUTER is not set
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_BOOTP=y
-# CONFIG_IP_PNP_RARP is not set
-# CONFIG_IP_ROUTER is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-# CONFIG_IP_ALIAS is not set
-# CONFIG_INET_ECN is not set
-# CONFIG_SYN_COOKIES is not set
-# CONFIG_IPV6 is not set
-# CONFIG_KHTTPD is not set
-# CONFIG_ATM is not set
-
-#
-#
-#
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_LLC is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_FASTROUTE is not set
-# CONFIG_NET_HW_FLOWCONTROL is not set
-
-#
-# QoS and/or fair queueing
-#
-# CONFIG_NET_SCHED is not set
-
-#
-# Network device support
-#
-CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_NET_SB1000 is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
-CONFIG_NET_ETHERNET=y
-CONFIG_CERF_CS8900A=y


-# CONFIG_ARM_AM79C961A is not set

-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_LANCE is not set
-# CONFIG_NET_VENDOR_SMC is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_AT1700 is not set
-# CONFIG_DEPCA is not set
-# CONFIG_NET_ISA is not set
-# CONFIG_NET_PCI is not set
-# CONFIG_NET_POCKET is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_YELLOWFIN is not set
-# CONFIG_ACENIC is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#


-# CONFIG_NET_RADIO is not set

-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# PCMCIA network device support
-#
-# CONFIG_NET_PCMCIA is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# ATA/IDE/MFM/RLL support
-#
-CONFIG_IDE=y
-
-#
-# IDE, ATA and ATAPI Block devices
-#
-CONFIG_BLK_DEV_IDE=y
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
-# CONFIG_BLK_DEV_HD_IDE is not set
-# CONFIG_BLK_DEV_HD is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
-# CONFIG_BLK_DEV_COMMERIAL is not set
-CONFIG_BLK_DEV_IDECS=y
-# CONFIG_BLK_DEV_IDECD is not set
-# CONFIG_BLK_DEV_IDETAPE is not set
-# CONFIG_BLK_DEV_IDEFLOPPY is not set
-
-#
-# IDE chipset support/bugfixes
-#
-# CONFIG_BLK_DEV_CMD640 is not set
-# CONFIG_IDE_CHIPSETS is not set
-# CONFIG_IDEDMA_AUTO is not set
-# CONFIG_DMA_NONPCI is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-
-#
-# SCSI support
-#
-# CONFIG_SCSI is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-
-#
-# ISDN subsystem
-#
-# CONFIG_ISDN is not set
-
-#
-# Character devices
-#
-CONFIG_VT=y
-# CONFIG_VT_CONSOLE is not set
-CONFIG_SERIAL_SA1100=y
-CONFIG_SERIAL_SA1100_CONSOLE=y
-CONFIG_TOUCHSCREEN_UCB1200=y
-# CONFIG_TOUCHSCREEN_BITSY is not set
-# CONFIG_SERIAL is not set
-# CONFIG_SERIAL_EXTENDED is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=32
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-# CONFIG_MOUSE is not set
-
-#
-# Joysticks
-#


-# CONFIG_JOYSTICK is not set

-# CONFIG_QIC02_TAPE is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
-# CONFIG_NVRAM is not set
-# CONFIG_RTC is not set
-
-#
-# Video For Linux
-#
-# CONFIG_VIDEO_DEV is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-
-#
-# Ftape, the floppy tape device driver
-#
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-# CONFIG_PCMCIA_SERIAL is not set
-
-#
-# File systems
-#
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_FAT_FS is not set
-# CONFIG_EFS_FS is not set
-CONFIG_JFFS_FS_VERBOSE=0
-# CONFIG_CRAMFS is not set
-# CONFIG_RAMFS is not set
-# CONFIG_ISO9660_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_EXT2_FS=y
-# CONFIG_SYSV_FS is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
-# CONFIG_CODA_FS is not set
-CONFIG_NFS_FS=y
-# CONFIG_NFS_V3 is not set
-# CONFIG_ROOT_NFS is not set
-# CONFIG_NFSD is not set
-CONFIG_SUNRPC=y
-CONFIG_LOCKD=y
-# CONFIG_SMB_FS is not set
-# CONFIG_NCP_FS is not set
-
-#
-# Partition Types
-#
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_NLS is not set
-
-#
-# Console drivers
-#
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_FB=y
-
-#
-# Frame-buffer support
-#
-CONFIG_FB=y
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_FB_SA1100=y
-# CONFIG_FB_VIRTUAL is not set
-# CONFIG_FBCON_ADVANCED is not set
-CONFIG_FBCON_CFB2=y
-CONFIG_FBCON_CFB4=y
-CONFIG_FBCON_CFB8=y
-CONFIG_FBCON_CFB16=y
-# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
-# CONFIG_FBCON_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# Kernel hacking
-#
-CONFIG_FRAME_POINTER=y
-CONFIG_DEBUG_ERRORS=y
-CONFIG_DEBUG_USER=y
-# CONFIG_DEBUG_INFO is not set
-# CONFIG_MAGIC_SYSRQ is not set
-# CONFIG_DEBUG_LL is not set
diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/cerfcube linux/arch/arm/def-configs/cerfcube
--- v2.4.13/linux/arch/arm/def-configs/cerfcube Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/def-configs/cerfcube Thu Oct 25 13:53:44 2001
@@ -0,0 +1,887 @@
+#
+# Automatically generated make config: don't edit

+# Archimedes/A5000 Implementations (select only ONE)


+#
+# CONFIG_ARCH_ARC is not set
+# CONFIG_ARCH_A5K is not set
+
+#
+# Footbridge Implementations
+#
+# CONFIG_ARCH_CATS is not set
+# CONFIG_ARCH_PERSONAL_SERVER is not set
+# CONFIG_ARCH_EBSA285_ADDIN is not set
+# CONFIG_ARCH_EBSA285_HOST is not set
+# CONFIG_ARCH_NETWINDER is not set
+
+#
+# SA11x0 Implementations
+#
+# CONFIG_SA1100_ASSABET is not set
+# CONFIG_ASSABET_NEPONSET is not set

+# CONFIG_SA1100_ADSBITSY is not set


+# CONFIG_SA1100_BRUTUS is not set

+CONFIG_SA1100_CERF=y
+# CONFIG_SA1100_CERF_8MB is not set
+# CONFIG_SA1100_CERF_16MB is not set
+CONFIG_SA1100_CERF_32MB=y
+# CONFIG_SA1100_CERF_64MB is not set
+# CONFIG_SA1100_CERF_FLASH_8MB is not set
+CONFIG_SA1100_CERF_FLASH_16MB=y
+# CONFIG_SA1100_CERF_FLASH_32MB is not set
+# CONFIG_SA1100_CERF_CPLD is not set
+# CONFIG_SA1100_H3600 is not set


+# CONFIG_SA1100_EXTENEX1 is not set
+# CONFIG_SA1100_FLEXANET is not set
+# CONFIG_SA1100_FREEBIRD is not set
+# CONFIG_SA1100_GRAPHICSCLIENT is not set

+# CONFIG_SA1100_GRAPHICSMASTER is not set


+# CONFIG_SA1100_JORNADA720 is not set
+# CONFIG_SA1100_HUW_WEBPANEL is not set
+# CONFIG_SA1100_ITSY is not set
+# CONFIG_SA1100_LART is not set
+# CONFIG_SA1100_NANOENGINE is not set
+# CONFIG_SA1100_OMNIMETER is not set
+# CONFIG_SA1100_PANGOLIN is not set
+# CONFIG_SA1100_PLEB is not set
+# CONFIG_SA1100_SHERMAN is not set
+# CONFIG_SA1100_SIMPAD is not set
+# CONFIG_SA1100_PFS168 is not set
+# CONFIG_SA1100_VICTOR is not set
+# CONFIG_SA1100_XP860 is not set
+# CONFIG_SA1100_YOPY is not set

+CONFIG_SA1100_USB=y
+CONFIG_SA1100_USB_NETLINK=y
+CONFIG_SA1100_USB_CHAR=y


+
+#
+# CLPS711X/EP721X Implementations
+#

+# CONFIG_ARCH_CDB89712 is not set
+# CONFIG_ARCH_CLEP7312 is not set
+# CONFIG_ARCH_EDB7211 is not set


+# CONFIG_ARCH_P720T is not set

+# CONFIG_ARCH_EP7211 is not set
+# CONFIG_ARCH_EP7212 is not set


+# CONFIG_ARCH_ACORN is not set
+# CONFIG_FOOTBRIDGE is not set
+# CONFIG_FOOTBRIDGE_HOST is not set
+# CONFIG_FOOTBRIDGE_ADDIN is not set
+CONFIG_CPU_32=y
+# CONFIG_CPU_26 is not set
+

+#
+# Processor Type
+#


+# CONFIG_CPU_32v3 is not set
+CONFIG_CPU_32v4=y
+# CONFIG_CPU_ARM610 is not set
+# CONFIG_CPU_ARM710 is not set
+# CONFIG_CPU_ARM720T is not set
+# CONFIG_CPU_ARM920T is not set
+# CONFIG_CPU_ARM1020 is not set
+# CONFIG_CPU_SA110 is not set
+CONFIG_CPU_SA1100=y

+# CONFIG_ARM_THUMB is not set
+CONFIG_DISCONTIGMEM=y


+
+#
+# General setup
+#
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_ISA_DMA is not set

+CONFIG_CPU_FREQ=y


+CONFIG_HOTPLUG=y
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=y
+# CONFIG_I82365 is not set
+# CONFIG_TCIC is not set
+# CONFIG_PCMCIA_CLPS6700 is not set
+CONFIG_PCMCIA_SA1100=y
+CONFIG_NET=y
+CONFIG_SYSVIPC=y

+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_SYSCTL=y
+
+#
+# At least one math emulation must be selected
+#


+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_FASTFPE is not set
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
+# CONFIG_APM is not set
+# CONFIG_ARTHUR is not set

+CONFIG_CMDLINE="console=ttySA0 root=1f03 rw"


+# CONFIG_PFS168_CMDLINE is not set

+CONFIG_LEDS=y
+CONFIG_LEDS_TIMER=y
+CONFIG_LEDS_CPU=y


+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Memory Technology Devices (MTD)
+#

+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_BOOTLDR_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_SUN_UFLASH is not set
+# CONFIG_MTD_NORA is not set
+# CONFIG_MTD_PNC2000 is not set
+# CONFIG_MTD_RPXLITE is not set
+# CONFIG_MTD_TQM8XXL is not set
+# CONFIG_MTD_SC520CDP is not set
+# CONFIG_MTD_NETSC520 is not set
+# CONFIG_MTD_SBC_GXX is not set
+# CONFIG_MTD_ELAN_104NC is not set
+# CONFIG_MTD_DBOX2 is not set
+# CONFIG_MTD_CSTM_MIPS_IXX is not set
+# CONFIG_MTD_CFI_FLAGADM is not set
+# CONFIG_MTD_SOLUTIONENGINE is not set
+# CONFIG_MTD_MIXMEM is not set
+# CONFIG_MTD_OCTAGON is not set
+# CONFIG_MTD_VMAX is not set
+# CONFIG_MTD_OCELOT is not set
+# CONFIG_MTD_L440GX is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_CDB89712 is not set
+CONFIG_MTD_SA1100=y
+# CONFIG_MTD_DC21285 is not set
+# CONFIG_MTD_IQ80310 is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_LART is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC1000 is not set
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOCPROBE is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set


+
+#
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set

+# CONFIG_PNPBIOS is not set


+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y

+CONFIG_BLK_DEV_RAM_SIZE=4096


+CONFIG_BLK_DEV_INITRD=y
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set

+CONFIG_NETLINK=y
+CONFIG_RTNETLINK=y
+# CONFIG_NETLINK_DEV is not set


+# CONFIG_NETFILTER is not set

+CONFIG_FILTER=y


+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set

+# CONFIG_IP_PNP is not set


+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set

+# CONFIG_ARPD is not set


+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+

+#
+#
+#

+# CONFIG_ETHERTAP is not set


+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set

+CONFIG_NET_VENDOR_3COM=y
+# CONFIG_EL1 is not set
+# CONFIG_EL2 is not set
+# CONFIG_ELPLUS is not set
+# CONFIG_EL16 is not set
+# CONFIG_ELMC is not set
+# CONFIG_ELMC_II is not set
+CONFIG_CERF_CS8900A=y


+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set

+# CONFIG_DL2K is not set


+# CONFIG_MYRI_SBUS is not set

+# CONFIG_NS83820 is not set

+CONFIG_PCMCIA_PCNET=m

+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#


+# CONFIG_BLK_DEV_HD_IDE is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
+# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set

SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 02'
echo 'File patch-2.4.14 is continued in part 03'
echo "03" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:33 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part10

#!/bin/sh -x
# this is part 10 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 10; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X static void
@@ -574,9 +577,7 @@
X ppc_md.kbd_unexpected_up = NULL;
X ppc_md.kbd_leds = NULL;
X ppc_md.kbd_init_hw = NULL;
-#ifdef CONFIG_MAGIC_SYSRQ
X ppc_md.ppc_kbd_sysrq_xlate = NULL;
-#endif
X ppc_md.pcibios_fixup_bus = gemini_pcibios_fixup;
X
X #ifdef CONFIG_SMP
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/head.S linux/arch/ppc/kernel/head.S
--- v2.4.13/linux/arch/ppc/kernel/head.S Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/head.S Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.head.S 1.29 08/19/01 22:43:23 paulus
+ * BK Id: SCCS/s.head.S 1.31 10/18/01 15:02:09 trini
X */
X /*
X * PowerPC version
@@ -32,6 +32,7 @@
X #include <asm/mmu.h>
X #include <asm/pgtable.h>
X #include <asm/cputable.h>
+#include <asm/cache.h>
X
X #ifdef CONFIG_APUS
X #include <asm/amigappc.h>
@@ -1083,7 +1084,7 @@
X copy_and_flush:
X addi r5,r5,-4
X addi r6,r6,-4
-4: li r0,CACHE_LINE_SIZE/4
+4: li r0,L1_CACHE_LINE_SIZE/4
X mtctr r0
X 3: addi r6,r6,4 /* copy a cache line */
X lwzx r0,r6,r4
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/head_8xx.S linux/arch/ppc/kernel/head_8xx.S
--- v2.4.13/linux/arch/ppc/kernel/head_8xx.S Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/head_8xx.S Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.head_8xx.S 1.21 08/28/01 16:27:27 trini
+ * BK Id: SCCS/s.head_8xx.S 1.23 09/16/01 19:32:54 trini
X */
X /*
X * arch/ppc/kernel/except_8xx.S
@@ -352,16 +352,21 @@
X mtspr MD_TWC, r21 /* Load pte table base address */
X mfspr r21, MD_TWC /* ....and get the pte address */
X lwz r20, 0(r21) /* Get the pte */
-#if 0
+
X ori r20, r20, _PAGE_ACCESSED
X stw r20, 0(r21)
-#endif
X
- /* Set four subpage valid bits (24, 25, 26, and 27).
- * Clear bit 28 (which should be in the PTE, but we do this anyway).
+ /* The Linux PTE won't go exactly into the MMU TLB.
+ * Software indicator bits 21, 22 and 28 must be clear.
+ * Software indicator bits 24, 25, 26, and 27 must be
+ * set. All other Linux PTE bits control the behavior
+ * of the MMU.
X */
+ li r21, 0x0600
+ andc r20, r20, r21 /* Clear 21, 22 */
X li r21, 0x00f0
- rlwimi r20, r21, 0, 24, 28
+ rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */
+
X #ifdef CONFIG_8xx_CPU6
X li r3, 0x2d80
X stw r3, 12(r0)
@@ -441,21 +446,21 @@
X #endif
X mtspr MD_TWC, r21
X
- /* Set PP0 to PP1 (== _PAGE_USER) & ~_PAGE_RW */
- rlwimi r20, r20, 32-1, 21, 21
- rlwinm r21, r20, 4, 21, 21
- andc r20, r20, r21
+ mfspr r21, MD_TWC /* get the pte address again */
+ ori r20, r20, _PAGE_ACCESSED
+ stw r20, 0(r21)
X
- /* Set four subpage valid bits (24, 25, 26, and 27).
- * Clear bit 28 (which should be in the PTE, but we do this anyway).
+ /* The Linux PTE won't go exactly into the MMU TLB.
+ * Software indicator bits 21, 22 and 28 must be clear.
+ * Software indicator bits 24, 25, 26, and 27 must be
+ * set. All other Linux PTE bits control the behavior
+ * of the MMU.
X */
-#if 0
- ori r20, r20, 0x00f0
-#else
+ li r21, 0x0600
+ andc r20, r20, r21 /* Clear 21, 22 */
X li r21, 0x00f0
- rlwimi r20, r21, 0, 24, 28
+ rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */
X
-#endif
X #ifdef CONFIG_8xx_CPU6
X li r3, 0x3d80
X stw r3, 12(r0)
@@ -549,15 +554,21 @@
X
X /* Update 'changed', among others.
X */
- ori r20, r20, _PAGE_DIRTY|_PAGE_ACCESSED
+ ori r20, r20, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
X mfspr r21, MD_TWC /* Get pte address again */
X stw r20, 0(r21) /* and update pte in table */
X
- /* Set four subpage valid bits (24, 25, 26, and 27).
- * Clear bit 28 (which should be in the PTE, but we do this anyway).
+ /* The Linux PTE won't go exactly into the MMU TLB.
+ * Software indicator bits 21, 22 and 28 must be clear.
+ * Software indicator bits 24, 25, 26, and 27 must be
+ * set. All other Linux PTE bits control the behavior
+ * of the MMU.
X */
+ li r21, 0x0600
+ andc r20, r20, r21 /* Clear 21, 22 */
X li r21, 0x00f0
- rlwimi r20, r21, 0, 24, 28
+ rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */
+
X #ifdef CONFIG_8xx_CPU6
X li r3, 0x3d80
X stw r3, 12(r0)
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/idle.c linux/arch/ppc/kernel/idle.c
--- v2.4.13/linux/arch/ppc/kernel/idle.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/idle.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.idle.c 1.14 08/15/01 22:43:06 paulus
+ * BK Id: SCCS/s.idle.c 1.16 10/16/01 15:58:42 trini
X */
X /*
X * Idle daemon for PowerPC. Idle daemon will handle any action
@@ -58,14 +58,13 @@
X init_idle();
X for (;;) {
X #ifdef CONFIG_SMP
- int oldval;
X
X if (!do_power_save) {
X /*
X * Deal with another CPU just having chosen a thread to
X * run here:
X */
- oldval = xchg(&current->need_resched, -1);
+ int oldval = xchg(&current->need_resched, -1);
X
X if (!oldval) {
X while(current->need_resched == -1)
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/m8260_setup.c linux/arch/ppc/kernel/m8260_setup.c
--- v2.4.13/linux/arch/ppc/kernel/m8260_setup.c Tue Oct 9 17:06:51 2001
+++ linux/arch/ppc/kernel/m8260_setup.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.m8260_setup.c 1.26 09/22/01 11:33:22 trini
+ * BK Id: SCCS/s.m8260_setup.c 1.28 10/18/01 11:16:28 trini


X */
X /*
X * linux/arch/ppc/kernel/setup.c

@@ -49,19 +49,14 @@
X #include "ppc8260_pic.h"
X
X static int m8260_set_rtc_time(unsigned long time);
-unsigned long m8260_get_rtc_time(void);
-void m8260_calibrate_decr(void);
-
-extern unsigned long loops_per_jiffy;
+static unsigned long m8260_get_rtc_time(void);
+static void m8260_calibrate_decr(void);
X
X unsigned char __res[sizeof(bd_t)];
X
-extern char saved_command_line[256];
-
-extern unsigned long find_available_memory(void);
X extern void m8260_cpm_reset(void);
X
-void __init
+static void __init
X m8260_setup_arch(void)
X {
X /* Reset the Communication Processor Module.
@@ -69,7 +64,7 @@
X m8260_cpm_reset();
X }
X
-void
+static void
X abort(void)
X {
X #ifdef CONFIG_XMON
@@ -82,7 +77,8 @@
X /* The decrementer counts at the system (internal) clock frequency
X * divided by four.
X */
-void __init m8260_calibrate_decr(void)
+static void __init
+m8260_calibrate_decr(void)
X {
X bd_t *binfo = (bd_t *)__res;
X int freq, divisor;
@@ -98,14 +94,14 @@
X */
X static uint rtc_time;
X
-static int
+static static int
X m8260_set_rtc_time(unsigned long time)
X {
X rtc_time = time;
X return(0);
X }
X
-unsigned long
+static unsigned long
X m8260_get_rtc_time(void)
X {
X
@@ -114,7 +110,7 @@
X return((unsigned long)rtc_time);
X }
X
-void
+static void
X m8260_restart(char *cmd)
X {
X extern void m8260_gorom(bd_t *bi, uint addr);
@@ -134,20 +130,21 @@
X m8260_gorom((unsigned int)__pa(__res), startaddr);
X }
X
-void
+static void
X m8260_power_off(void)
X {
X m8260_restart(NULL);
X }
X
-void
+static void
X m8260_halt(void)
X {
X m8260_restart(NULL);
X }
X
X
-int m8260_setup_residual(char *buffer)
+static int
+m8260_setup_residual(char *buffer)
X {
X int len = 0;
X bd_t *bp;
@@ -170,7 +167,7 @@
X * External interrupts can be either edge or level triggered, and
X * need to be initialized by the appropriate driver.
X */
-void __init
+static void __init
X m8260_init_IRQ(void)
X {
X int i;
@@ -195,7 +192,8 @@
X /*
X * Same hack as 8xx
X */
-unsigned long __init m8260_find_end_of_memory(void)
+static unsigned long __init
+m8260_find_end_of_memory(void)
X {
X bd_t *binfo;
X extern unsigned char __res[];
@@ -241,35 +239,33 @@
X strcpy(cmd_line, (char *)(r6+KERNELBASE));
X }
X
- ppc_md.setup_arch = m8260_setup_arch;
- ppc_md.setup_residual = m8260_setup_residual;
- ppc_md.get_cpuinfo = NULL;
- ppc_md.irq_cannonicalize = NULL;
- ppc_md.init_IRQ = m8260_init_IRQ;
- ppc_md.get_irq = m8260_get_irq;
- ppc_md.init = NULL;
-
- ppc_md.restart = m8260_restart;
- ppc_md.power_off = m8260_power_off;
- ppc_md.halt = m8260_halt;
-
- ppc_md.time_init = NULL;
- ppc_md.set_rtc_time = m8260_set_rtc_time;
- ppc_md.get_rtc_time = m8260_get_rtc_time;
- ppc_md.calibrate_decr = m8260_calibrate_decr;
-
- ppc_md.find_end_of_memory = m8260_find_end_of_memory;
- ppc_md.setup_io_mappings = m8260_map_io;
-
- ppc_md.kbd_setkeycode = NULL;
- ppc_md.kbd_getkeycode = NULL;
- ppc_md.kbd_translate = NULL;
- ppc_md.kbd_unexpected_up = NULL;
- ppc_md.kbd_leds = NULL;
- ppc_md.kbd_init_hw = NULL;


-#ifdef CONFIG_MAGIC_SYSRQ
- ppc_md.kbd_sysrq_xlate = NULL;
-#endif

+ ppc_md.setup_arch = m8260_setup_arch;
+ ppc_md.setup_residual = m8260_setup_residual;
+ ppc_md.get_cpuinfo = NULL;
+ ppc_md.irq_cannonicalize = NULL;
+ ppc_md.init_IRQ = m8260_init_IRQ;
+ ppc_md.get_irq = m8260_get_irq;
+ ppc_md.init = NULL;
+
+ ppc_md.restart = m8260_restart;
+ ppc_md.power_off = m8260_power_off;
+ ppc_md.halt = m8260_halt;
+
+ ppc_md.time_init = NULL;
+ ppc_md.set_rtc_time = m8260_set_rtc_time;
+ ppc_md.get_rtc_time = m8260_get_rtc_time;
+ ppc_md.calibrate_decr = m8260_calibrate_decr;
+
+ ppc_md.find_end_of_memory = m8260_find_end_of_memory;
+ ppc_md.setup_io_mappings = m8260_map_io;
+
+ ppc_md.kbd_setkeycode = NULL;
+ ppc_md.kbd_getkeycode = NULL;
+ ppc_md.kbd_translate = NULL;
+ ppc_md.kbd_unexpected_up = NULL;
+ ppc_md.kbd_leds = NULL;
+ ppc_md.kbd_init_hw = NULL;
+ ppc_md.ppc_kbd_sysrq_xlate = NULL;
X }
X
X /* Mainly for ksyms.
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/m8xx_setup.c linux/arch/ppc/kernel/m8xx_setup.c
--- v2.4.13/linux/arch/ppc/kernel/m8xx_setup.c Tue Oct 23 22:48:49 2001
+++ linux/arch/ppc/kernel/m8xx_setup.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.m8xx_setup.c 1.35 10/11/01 11:55:47 trini
+ * BK Id: SCCS/s.m8xx_setup.c 1.38 10/18/01 11:16:28 trini
X *
X * linux/arch/ppc/kernel/setup.c
X *
@@ -60,8 +60,6 @@
X extern int rd_image_start; /* starting block # of image */
X #endif
X
-extern char saved_command_line[256];
-
X extern unsigned long find_available_memory(void);
X extern void m8xx_cpm_reset(uint);
X
@@ -373,35 +371,33 @@
X strcpy(cmd_line, (char *)(r6+KERNELBASE));
X }
X
- ppc_md.setup_arch = m8xx_setup_arch;
- ppc_md.setup_residual = m8xx_setup_residual;
- ppc_md.get_cpuinfo = NULL;
- ppc_md.irq_cannonicalize = NULL;
- ppc_md.init_IRQ = m8xx_init_IRQ;
- ppc_md.get_irq = m8xx_get_irq;
- ppc_md.init = NULL;
-
- ppc_md.restart = m8xx_restart;
- ppc_md.power_off = m8xx_power_off;
- ppc_md.halt = m8xx_halt;
-
- ppc_md.time_init = NULL;
- ppc_md.set_rtc_time = m8xx_set_rtc_time;
- ppc_md.get_rtc_time = m8xx_get_rtc_time;
- ppc_md.calibrate_decr = m8xx_calibrate_decr;
-
- ppc_md.find_end_of_memory = m8xx_find_end_of_memory;
- ppc_md.setup_io_mappings = m8xx_map_io;
-
- ppc_md.kbd_setkeycode = NULL;
- ppc_md.kbd_getkeycode = NULL;
- ppc_md.kbd_translate = NULL;
- ppc_md.kbd_unexpected_up = NULL;
- ppc_md.kbd_leds = NULL;
- ppc_md.kbd_init_hw = NULL;
-#ifdef CONFIG_MAGIC_SYSRQ
- ppc_md.ppc_kbd_sysrq_xlate = NULL;
-#endif
+ ppc_md.setup_arch = m8xx_setup_arch;
+ ppc_md.setup_residual = m8xx_setup_residual;
+ ppc_md.get_cpuinfo = NULL;
+ ppc_md.irq_cannonicalize = NULL;
+ ppc_md.init_IRQ = m8xx_init_IRQ;
+ ppc_md.get_irq = m8xx_get_irq;
+ ppc_md.init = NULL;
+
+ ppc_md.restart = m8xx_restart;
+ ppc_md.power_off = m8xx_power_off;
+ ppc_md.halt = m8xx_halt;
+
+ ppc_md.time_init = NULL;
+ ppc_md.set_rtc_time = m8xx_set_rtc_time;
+ ppc_md.get_rtc_time = m8xx_get_rtc_time;
+ ppc_md.calibrate_decr = m8xx_calibrate_decr;
+
+ ppc_md.find_end_of_memory = m8xx_find_end_of_memory;
+ ppc_md.setup_io_mappings = m8xx_map_io;
+
+ ppc_md.kbd_setkeycode = NULL;
+ ppc_md.kbd_getkeycode = NULL;
+ ppc_md.kbd_translate = NULL;
+ ppc_md.kbd_unexpected_up = NULL;
+ ppc_md.kbd_leds = NULL;
+ ppc_md.kbd_init_hw = NULL;
+ ppc_md.ppc_kbd_sysrq_xlate = NULL;


X
X #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)

X m8xx_ide_init();
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/misc.S linux/arch/ppc/kernel/misc.S
--- v2.4.13/linux/arch/ppc/kernel/misc.S Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/misc.S Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.misc.S 1.28 08/24/01 20:07:37 paulus
+ * BK Id: SCCS/s.misc.S 1.32 10/18/01 17:29:53 trini
X */
X /*
X * This file contains miscellaneous low-level functions.
@@ -385,21 +385,21 @@
X rlwinm r5,r5,16,16,31
X cmpi 0,r5,1
X beqlr /* for 601, do nothing */
- li r5,CACHE_LINE_SIZE-1
+ li r5,L1_CACHE_LINE_SIZE-1
X andc r3,r3,r5
X subf r4,r3,r4
X add r4,r4,r5
- srwi. r4,r4,LG_CACHE_LINE_SIZE
+ srwi. r4,r4,LG_L1_CACHE_LINE_SIZE
X beqlr
X mtctr r4
X mr r6,r3
X 1: dcbst 0,r3
- addi r3,r3,CACHE_LINE_SIZE
+ addi r3,r3,L1_CACHE_LINE_SIZE
X bdnz 1b
X sync /* wait for dcbst's to get to ram */
X mtctr r4
X 2: icbi 0,r6
- addi r6,r6,CACHE_LINE_SIZE
+ addi r6,r6,L1_CACHE_LINE_SIZE
X bdnz 2b
X sync /* additional sync needed on g4 */
X isync
@@ -412,37 +412,37 @@
X * clean_dcache_range(unsigned long start, unsigned long stop)
X */
X _GLOBAL(clean_dcache_range)
- li r5,CACHE_LINE_SIZE-1
+ li r5,L1_CACHE_LINE_SIZE-1
X andc r3,r3,r5
X subf r4,r3,r4
X add r4,r4,r5
- srwi. r4,r4,LG_CACHE_LINE_SIZE
+ srwi. r4,r4,LG_L1_CACHE_LINE_SIZE
X beqlr
X mtctr r4
X
X 1: dcbst 0,r3
- addi r3,r3,CACHE_LINE_SIZE
+ addi r3,r3,L1_CACHE_LINE_SIZE
X bdnz 1b
X sync /* wait for dcbst's to get to ram */
X blr
X
X /*
- * Write any modified data cache blocks out to memory
- * and invalidate the corresponding instruction cache blocks.
+ * Write any modified data cache blocks out to memory and invalidate them.
+ * Does not invalidate the corresponding instruction cache blocks.
X *
X * flush_dcache_range(unsigned long start, unsigned long stop)
X */
X _GLOBAL(flush_dcache_range)
- li r5,CACHE_LINE_SIZE-1
+ li r5,L1_CACHE_LINE_SIZE-1
X andc r3,r3,r5
X subf r4,r3,r4
X add r4,r4,r5
- srwi. r4,r4,LG_CACHE_LINE_SIZE
+ srwi. r4,r4,LG_L1_CACHE_LINE_SIZE
X beqlr
X mtctr r4
X
X 1: dcbf 0,r3
- addi r3,r3,CACHE_LINE_SIZE
+ addi r3,r3,L1_CACHE_LINE_SIZE
X bdnz 1b
X sync /* wait for dcbst's to get to ram */
X blr
@@ -455,16 +455,16 @@
X * invalidate_dcache_range(unsigned long start, unsigned long stop)
X */
X _GLOBAL(invalidate_dcache_range)
- li r5,CACHE_LINE_SIZE-1
+ li r5,L1_CACHE_LINE_SIZE-1
X andc r3,r3,r5
X subf r4,r3,r4
X add r4,r4,r5
- srwi. r4,r4,LG_CACHE_LINE_SIZE
+ srwi. r4,r4,LG_L1_CACHE_LINE_SIZE
X beqlr
X mtctr r4
X
X 1: dcbi 0,r3
- addi r3,r3,CACHE_LINE_SIZE
+ addi r3,r3,L1_CACHE_LINE_SIZE
X bdnz 1b
X sync /* wait for dcbi's to get to ram */
X blr
@@ -481,18 +481,18 @@
X mfspr r5,PVR
X rlwinm r5,r5,16,16,31
X cmpi 0,r5,1
- beqlr /* for 601, do nothing */
- rlwinm r3,r3,0,0,19 /* Get page base address */
- li r4,4096/CACHE_LINE_SIZE /* Number of lines in a page */
+ beqlr /* for 601, do nothing */
+ rlwinm r3,r3,0,0,19 /* Get page base address */
+ li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */
X mtctr r4
X mr r6,r3
-0: dcbst 0,r3 /* Write line to ram */
- addi r3,r3,CACHE_LINE_SIZE
+0: dcbst 0,r3 /* Write line to ram */
+ addi r3,r3,L1_CACHE_LINE_SIZE
X bdnz 0b
X sync
X mtctr r4
X 1: icbi 0,r6
- addi r6,r6,CACHE_LINE_SIZE
+ addi r6,r6,L1_CACHE_LINE_SIZE
X bdnz 1b
X sync
X isync
@@ -510,11 +510,11 @@
X mfspr r5,PVR
X rlwinm r5,r5,16,16,31
X cmpi 0,r5,1
- beqlr /* for 601, do nothing */
- li r4,4096/CACHE_LINE_SIZE /* Number of lines in a page */
+ beqlr /* for 601, do nothing */
+ li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */
X mtctr r4
X 1: icbi 0,r3
- addi r3,r3,CACHE_LINE_SIZE
+ addi r3,r3,L1_CACHE_LINE_SIZE
X bdnz 1b
X sync
X isync
@@ -526,7 +526,7 @@
X * displaced). This only works on cacheable memory.
X */
X _GLOBAL(clear_page)
- li r0,4096/CACHE_LINE_SIZE
+ li r0,4096/L1_CACHE_LINE_SIZE
X mtctr r0
X #ifdef CONFIG_8xx
X li r4, 0
@@ -537,7 +537,7 @@
X #else
X 1: dcbz 0,r3
X #endif
- addi r3,r3,CACHE_LINE_SIZE
+ addi r3,r3,L1_CACHE_LINE_SIZE
X bdnz 1b
X blr
X
@@ -563,20 +563,20 @@
X li r5,4
X
X #ifndef CONFIG_8xx
-#if MAX_COPY_PREFETCH > 1
- li r0,MAX_COPY_PREFETCH
+#if MAX_L1_COPY_PREFETCH > 1
+ li r0,MAX_L1_COPY_PREFETCH
X li r11,4
X mtctr r0
X 11: dcbt r11,r4
- addi r11,r11,CACHE_LINE_SIZE
+ addi r11,r11,L1_CACHE_LINE_SIZE
X bdnz 11b
-#else /* MAX_COPY_PREFETCH == 1 */
+#else /* MAX_L1_COPY_PREFETCH == 1 */
X dcbt r5,r4
- li r11,CACHE_LINE_SIZE+4
-#endif /* MAX_COPY_PREFETCH */
+ li r11,L1_CACHE_LINE_SIZE+4
+#endif /* MAX_L1_COPY_PREFETCH */
X #endif /* CONFIG_8xx */
X
- li r0,4096/CACHE_LINE_SIZE
+ li r0,4096/L1_CACHE_LINE_SIZE
X mtctr r0
X 1:
X #ifndef CONFIG_8xx
@@ -584,12 +584,12 @@
X dcbz r5,r3
X #endif
X COPY_16_BYTES
-#if CACHE_LINE_SIZE >= 32
+#if L1_CACHE_LINE_SIZE >= 32
X COPY_16_BYTES
-#if CACHE_LINE_SIZE >= 64
+#if L1_CACHE_LINE_SIZE >= 64
X COPY_16_BYTES
X COPY_16_BYTES
-#if CACHE_LINE_SIZE >= 128
+#if L1_CACHE_LINE_SIZE >= 128
X COPY_16_BYTES
X COPY_16_BYTES
X COPY_16_BYTES
@@ -1104,22 +1104,23 @@
X .long sys_ni_syscall /* streams2 */
X .long sys_vfork
X .long sys_getrlimit /* 190 */
- .long sys_ni_syscall /* 191 */ /* Unused */
- .long sys_mmap2 /* 192 */
- .long sys_truncate64 /* 193 */
- .long sys_ftruncate64 /* 194 */
- .long sys_stat64 /* 195 */
- .long sys_lstat64 /* 196 */
- .long sys_fstat64 /* 197 */
- .long sys_pciconfig_read /* 198 */
- .long sys_pciconfig_write /* 199 */
+ .long sys_readahead
+ .long sys_mmap2
+ .long sys_truncate64
+ .long sys_ftruncate64
+ .long sys_stat64 /* 195 */
+ .long sys_lstat64
+ .long sys_fstat64
+ .long sys_pciconfig_read
+ .long sys_pciconfig_write
X .long sys_pciconfig_iobase /* 200 */
X .long sys_ni_syscall /* 201 - reserved - MacOnLinux - new */
- .long sys_getdents64 /* 202 */
- .long sys_pivot_root /* 203 */
- .long sys_fcntl64 /* 204 */
- .long sys_madvise /* 205 */
- .long sys_mincore /* 206 */
+ .long sys_getdents64
+ .long sys_pivot_root
+ .long sys_fcntl64
+ .long sys_madvise /* 205 */
+ .long sys_mincore
+ .long sys_gettid
X .rept NR_syscalls-(.-sys_call_table)/4
X .long sys_ni_syscall
X .endr
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/oak_setup.c linux/arch/ppc/kernel/oak_setup.c
--- v2.4.13/linux/arch/ppc/kernel/oak_setup.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/oak_setup.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.oak_setup.c 1.8 08/15/01 21:48:38 paulus
+ * BK Id: SCCS/s.oak_setup.c 1.10 10/18/01 11:16:28 trini


X */
X /*
X *

@@ -128,12 +128,7 @@
X ppc_md.kbd_unexpected_up = NULL;
X ppc_md.kbd_leds = NULL;
X ppc_md.kbd_init_hw = NULL;
-
-#if defined(CONFIG_MAGIC_SYSRQ)
X ppc_md.ppc_kbd_sysrq_xlate = NULL;
-#endif
-
- return;
X }
X
X /*
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/open_pic.c linux/arch/ppc/kernel/open_pic.c
--- v2.4.13/linux/arch/ppc/kernel/open_pic.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/open_pic.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.open_pic.c 1.28 09/08/01 15:47:42 paulus
+ * BK Id: SCCS/s.open_pic.c 1.31 10/11/01 12:09:11 trini
X */
X /*
X * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling
@@ -515,10 +515,9 @@
X #define physmask(cpumask) (cpumask)
X #endif
X
-void openpic_init_processor(u_int cpumask)
+void openpic_reset_processor_phys(u_int mask)
X {
- openpic_write(&OpenPIC->Global.Processor_Initialization,
- physmask(cpumask));
+ openpic_write(&OpenPIC->Global.Processor_Initialization, mask);
X }
X
X static spinlock_t openpic_setup_lock = SPIN_LOCK_UNLOCKED;
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/open_pic.h linux/arch/ppc/kernel/open_pic.h
--- v2.4.13/linux/arch/ppc/kernel/open_pic.h Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/open_pic.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.open_pic.h 1.12 08/20/01 22:33:28 paulus
+ * BK Id: SCCS/s.open_pic.h 1.14 10/11/01 12:09:12 trini
X */
X /*
X * arch/ppc/kernel/open_pic.h -- OpenPIC Interrupt Handling
@@ -46,7 +46,7 @@
X extern void openpic_request_IPIs(void);
X extern void do_openpic_setup_cpu(void);
X extern int openpic_get_irq(struct pt_regs *regs);
-extern void openpic_init_processor(u_int cpumask);
+extern void openpic_reset_processor_phys(u_int cpumask);
X extern void openpic_setup_ISU(int isu_num, unsigned long addr);
X extern void openpic_cause_IPI(u_int ipi, u_int cpumask);
X extern void smp_openpic_message_pass(int target, int msg, unsigned long data,
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/pci.c linux/arch/ppc/kernel/pci.c
--- v2.4.13/linux/arch/ppc/kernel/pci.c Mon Aug 27 12:41:39 2001
+++ linux/arch/ppc/kernel/pci.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.pci.c 1.28 08/08/01 16:35:43 paulus
+ * BK Id: SCCS/s.pci.c 1.31 11/01/01 12:24:55 trini
X */
X /*
X * Common pmac/prep/chrp pci routines. -- Cort
@@ -39,6 +39,8 @@
X unsigned long isa_io_base = 0;
X unsigned long isa_mem_base = 0;
X unsigned long pci_dram_offset = 0;
+
+void pcibios_make_OF_bus_map(void);
X
X static void pcibios_fixup_resources(struct pci_dev* dev);
X static void fixup_broken_pcnet32(struct pci_dev* dev);
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/pmac_setup.c linux/arch/ppc/kernel/pmac_setup.c
--- v2.4.13/linux/arch/ppc/kernel/pmac_setup.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/pmac_setup.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.pmac_setup.c 1.39 09/08/01 15:47:42 paulus
+ * BK Id: SCCS/s.pmac_setup.c 1.41 10/18/01 11:16:28 trini


X */
X /*
X * linux/arch/ppc/kernel/setup.c

@@ -94,11 +94,9 @@
X char raw_mode);
X extern char mac_hid_kbd_unexpected_up(unsigned char keycode);
X extern void mac_hid_init_hw(void);
-#ifdef CONFIG_MAGIC_SYSRQ
-extern unsigned char mac_hid_kbd_sysrq_xlate[128];
-extern unsigned char pckbd_sysrq_xlate[128];
-extern unsigned char mackbd_sysrq_xlate[128];
-#endif /* CONFIG_MAGIC_SYSRQ */
+extern unsigned char mac_hid_kbd_sysrq_xlate[];
+extern unsigned char pckbd_sysrq_xlate[];
+extern unsigned char mackbd_sysrq_xlate[];
X extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
X extern int pckbd_getkeycode(unsigned int scancode);
X extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/ppc_asm.h linux/arch/ppc/kernel/ppc_asm.h
--- v2.4.13/linux/arch/ppc/kernel/ppc_asm.h Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/ppc_asm.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.ppc_asm.h 1.16 08/15/01 22:43:06 paulus
+ * BK Id: SCCS/s.ppc_asm.h 1.18 10/18/01 15:02:09 trini
X */
X /*
X * arch/ppc/kernel/ppc_asm.h
@@ -156,22 +156,3 @@
X #define MTMSRD(r) mtmsr r
X #define CLR_TOP32(r)
X #endif /* CONFIG_PPC64BRIDGE */
-
-/*
- * Defines for cache-line size etc.
- */
-#if defined(CONFIG_4xx) || defined(CONFIG_8xx)
-#define CACHE_LINE_SIZE 16
-#define LG_CACHE_LINE_SIZE 4
-#define MAX_COPY_PREFETCH 1
-
-#elif !defined(CONFIG_PPC64BRIDGE)
-#define CACHE_LINE_SIZE 32
-#define LG_CACHE_LINE_SIZE 5
-#define MAX_COPY_PREFETCH 4
-
-#else
-#define CACHE_LINE_SIZE 128
-#define LG_CACHE_LINE_SIZE 7
-#define MAX_COPY_PREFETCH 1
-#endif /* CONFIG_4xx || CONFIG_8xx */
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/ppc_htab.c linux/arch/ppc/kernel/ppc_htab.c
--- v2.4.13/linux/arch/ppc/kernel/ppc_htab.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/ppc_htab.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.ppc_htab.c 1.17 08/20/01 22:59:41 paulus
+ * BK Id: SCCS/s.ppc_htab.c 1.19 10/16/01 15:58:42 trini
X */
X /*
X * PowerPC hash table management proc entry. Will show information
@@ -115,10 +115,13 @@
X size_t count, loff_t *ppos)
X {
X unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0;
- int n = 0, valid;
+ int n = 0;
+#ifdef CONFIG_PPC_STD_MMU
+ int valid;
X unsigned int kptes = 0, uptes = 0, zombie_ptes = 0;
X PTE *ptr;
X struct task_struct *p;
+#endif /* CONFIG_PPC_STD_MMU */
X char buffer[512];
X
X if (count < 0)
@@ -206,9 +209,9 @@
X "Evicts\t\t: %lu\n",
X htab_reloads, htab_preloads, htab_hash_searches,
X primary_pteg_full, htab_evicts);
+return_string:
X #endif /* CONFIG_PPC_STD_MMU */
X
-return_string:
X n += sprintf( buffer + n,
X "Non-error misses: %lu\n"
X "Error misses\t: %lu\n",
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/ppc_ksyms.c linux/arch/ppc/kernel/ppc_ksyms.c
--- v2.4.13/linux/arch/ppc/kernel/ppc_ksyms.c Tue Oct 9 17:06:51 2001
+++ linux/arch/ppc/kernel/ppc_ksyms.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.ppc_ksyms.c 1.55 10/02/01 12:33:42 trini
+ * BK Id: SCCS/s.ppc_ksyms.c 1.57 10/16/01 15:58:42 trini
X */
X #include <linux/config.h>
X #include <linux/module.h>
@@ -351,7 +351,7 @@
X EXPORT_SYMBOL(set_context);
X EXPORT_SYMBOL(handle_mm_fault); /* For MOL */
X EXPORT_SYMBOL_NOVERS(disarm_decr);
-#if !defined(CONFIG_8xx) && !defined(CONFIG_4xx)
+#ifdef CONFIG_PPC_STD_MMU
X EXPORT_SYMBOL(flush_hash_page); /* For MOL */
X extern long *intercept_table;
X EXPORT_SYMBOL(intercept_table);
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/prep_setup.c linux/arch/ppc/kernel/prep_setup.c
--- v2.4.13/linux/arch/ppc/kernel/prep_setup.c Tue Oct 23 22:48:49 2001
+++ linux/arch/ppc/kernel/prep_setup.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.prep_setup.c 1.38 09/15/01 09:13:52 trini
+ * BK Id: SCCS/s.prep_setup.c 1.41 10/18/01 11:16:28 trini


X */
X /*
X * linux/arch/ppc/kernel/setup.c

@@ -86,14 +86,14 @@
X extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
X extern int pckbd_getkeycode(unsigned int scancode);
X extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
- char raw_mode);
+ char raw_mode);
X extern char pckbd_unexpected_up(unsigned char keycode);
X extern void pckbd_leds(unsigned char leds);
X extern void pckbd_init_hw(void);
-extern unsigned char pckbd_sysrq_xlate[128];
+extern unsigned char pckbd_sysrq_xlate[];
X
X extern void prep_find_bridges(void);
-extern char saved_command_line[256];
+extern char saved_command_line[];
X
X int _prep_type;
X
@@ -121,7 +121,7 @@
X EXPORT_SYMBOL(ppc_cs4232_dma2);
X #endif
X
-int __prep
+static int __prep
X prep_get_cpuinfo(char *buffer)
X {
X extern char *Motherboard_map_name;
@@ -131,11 +131,11 @@
X #endif
X
X #ifdef CONFIG_SMP
-#define CD(X) (cpu_data[n].X)
+#define CD(X) (cpu_data[n].X)
X #else
X #define CD(X) (X)
X #endif
-
+
X len = sprintf(buffer,"machine\t\t: PReP %s\n",Motherboard_map_name);
X
X
@@ -151,9 +151,10 @@
X goto no_l2;
X }
X len += sprintf(buffer+len,"%sKb,",
- (((*(unsigned char *)0x8000080d)>>2)&1)?"512":"256");
+ (((*(unsigned char *)0x8000080d)>>2)&1)
+ ? "512" : "256");
X len += sprintf(buffer+len,"%ssync\n",
- ((*(unsigned char *)0x8000080d)>>7) ? "":"a");
+ ((*(unsigned char *)0x8000080d)>>7) ? "" : "a");
X break;
X case _PREP_Motorola:
X len += sprintf(buffer+len,"L2\t\t: ");
@@ -174,26 +175,26 @@
X break;
X default:
X len += sprintf(buffer+len, "%x\n",
- *((unsigned char *)CACHECRBA));
+ *((unsigned char *)CACHECRBA));
X }
X
X len += sprintf(buffer+len,",parity %s",
- (*((unsigned char *)CACHECRBA) & L2CACHE_PARITY) ?
- "enabled" : "disabled");
-
+ (*((unsigned char *)CACHECRBA) & L2CACHE_PARITY)
+ ? "enabled" : "disabled");
+
X len += sprintf(buffer+len, " SRAM:");
X
X switch ( ((*((unsigned char *)CACHECRBA) & 0xf0) >> 4) & ~(0x3) )
X {
X case 1: len += sprintf(buffer+len,
- "synchronous,parity,flow-through\n");
+ "synchronous,parity,flow-through\n");
X break;
X case 2: len += sprintf(buffer+len,"asynchronous,no parity\n");
X break;
X case 3: len += sprintf(buffer+len,"asynchronous,parity\n");
X break;
X default:len += sprintf(buffer+len,
- "synchronous,pipelined,no parity\n");
+ "synchronous,pipelined,no parity\n");
X break;
X }
X break;
@@ -214,17 +215,17 @@
X for ( i = 0 ; (res->ActualNumMemories) && (i < MAX_MEMS) ; i++ )
X {
X if ( res->Memories[i].SIMMSize != 0 )
- len += sprintf(buffer+len,"%d:%ldM ",i,
- (res->Memories[i].SIMMSize > 1024) ?
- res->Memories[i].SIMMSize>>20 :
- res->Memories[i].SIMMSize);
+ len += sprintf(buffer+len,"%d:%ldM ", i,
+ (res->Memories[i].SIMMSize > 1024) ?
+ res->Memories[i].SIMMSize>>20 :
+ res->Memories[i].SIMMSize);
X }
X len += sprintf(buffer+len,"\n");
X return len;
X #endif
X }
X
-void __init
+static void __init
X prep_setup_arch(void)
X {
X unsigned char reg;
@@ -277,20 +278,19 @@
X break;
X }
X
- /* Read in NVRAM data */
- init_prep_nvram();
-
- /* if no bootargs, look in NVRAM */
- if ( cmd_line[0] == '\0' ) {
- char *bootargs;
- bootargs = prep_nvram_get_var("bootargs");
- if (bootargs != NULL) {
- strcpy(cmd_line, bootargs);
-
- /* again.. */
- strcpy(saved_command_line, cmd_line);
- }
- }
+ /* Read in NVRAM data */
+ init_prep_nvram();
+
+ /* if no bootargs, look in NVRAM */
+ if ( cmd_line[0] == '\0' ) {
+ char *bootargs;
+ bootargs = prep_nvram_get_var("bootargs");
+ if (bootargs != NULL) {
+ strcpy(cmd_line, bootargs);
+ /* again.. */
+ strcpy(saved_command_line, cmd_line);
+ }
+ }
X
X #ifdef CONFIG_SOUND_CS4232
X /*
@@ -303,11 +303,11 @@
X if ( _machine == _MACH_prep )
X {
X extern struct card_info snd_installed_cards[];
- struct card_info *snd_ptr;
+ struct card_info *snd_ptr;
X
X for ( snd_ptr = snd_installed_cards;
- snd_ptr < &snd_installed_cards[num_sound_cards];
- snd_ptr++ )
+ snd_ptr < &snd_installed_cards[num_sound_cards];
+ snd_ptr++ )
X {
X if ( snd_ptr->card_type == SNDCARD_CS4232 )
X {
@@ -321,7 +321,7 @@
X if ( _prep_type == _PREP_IBM )
X {
X snd_ptr->config.io_base = 0x530;
- snd_ptr->config.irq = 5;
+ snd_ptr->config.irq = 5;
X snd_ptr->config.dma = ppc_cs4232_dma = 1;
X /* this is wrong - but leave it for now */
X snd_ptr->config.dma2 = ppc_cs4232_dma2 = 7;
@@ -357,17 +357,23 @@
X * This allows for a faster boot as we do not need to calibrate the
X * decrementer against another clock. This is important for embedded systems.
X */
-void __init prep_res_calibrate_decr(void)
+static int __init
+prep_res_calibrate_decr(void)
X {
-#ifdef CONFIG_PREP_RESIDUAL
- unsigned long freq, divisor=4;
+#ifdef CONFIG_PREP_RESIDUAL
+ unsigned long freq, divisor = 4;
X
- freq = res->VitalProductData.ProcessorBusHz;
- printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
- (freq/divisor)/1000000, (freq/divisor)%1000000);
- tb_ticks_per_jiffy = freq / HZ / divisor;
- tb_to_us = mulhwu_scale_factor(freq/divisor, 1000000);
+ if ( res->VitalProductData.ProcessorBusHz ) {
+ freq = res->VitalProductData.ProcessorBusHz;
+ printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
+ (freq/divisor)/1000000,
+ (freq/divisor)%1000000);
+ tb_to_us = mulhwu_scale_factor(freq/divisor, 1000000);
+ tb_ticks_per_jiffy = freq / HZ / divisor;
+ return 0;
+ } else
X #endif
+ return 1;
X }
X
X /*
@@ -383,10 +389,8 @@
X static volatile int calibrate_steps __initdata = 3;
X static unsigned tbstamp __initdata = 0;
X
-void __init
-prep_calibrate_decr_handler(int irq,
- void *dev,
- struct pt_regs *regs)
+static void __init
+prep_calibrate_decr_handler(int irq, void *dev, struct pt_regs *regs)
X {
X unsigned long t, freq;
X int step=--calibrate_steps;
@@ -397,44 +401,54 @@
X } else {
X freq = (t - tbstamp)*HZ;
X printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
- freq/1000000, freq%1000000);
+ freq/1000000, freq%1000000);
X tb_ticks_per_jiffy = freq / HZ;
X tb_to_us = mulhwu_scale_factor(freq, 1000000);
X }
X }
X
-void __init prep_calibrate_decr(void)
+static void __init
+prep_calibrate_decr(void)
X {
- unsigned long flags;
+ int res;
+
+ /* Try and get this from the residual data. */
+ res = prep_res_calibrate_decr();
X
+ /* If we didn't get it from the residual data, try this. */
+ if ( res ) {
+ unsigned long flags;
X
- save_flags(flags);
+ save_flags(flags);
X
X #define TIMER0_COUNT 0x40
X #define TIMER_CONTROL 0x43
- /* set timer to periodic mode */
- outb_p(0x34,TIMER_CONTROL);/* binary, mode 2, LSB/MSB, ch 0 */
- /* set the clock to ~100 Hz */
- outb_p(LATCH & 0xff , TIMER0_COUNT); /* LSB */
- outb(LATCH >> 8 , TIMER0_COUNT); /* MSB */
-
- if (request_irq(0, prep_calibrate_decr_handler, 0, "timer", NULL) != 0)
- panic("Could not allocate timer IRQ!");
- __sti();
- while ( calibrate_steps ) /* nothing */; /* wait for calibrate */
- restore_flags(flags);
- free_irq( 0, NULL);
+ /* set timer to periodic mode */
+ outb_p(0x34,TIMER_CONTROL);/* binary, mode 2, LSB/MSB, ch 0 */
+ /* set the clock to ~100 Hz */
+ outb_p(LATCH & 0xff , TIMER0_COUNT); /* LSB */
+ outb(LATCH >> 8 , TIMER0_COUNT); /* MSB */
+
+ if (request_irq(0, prep_calibrate_decr_handler, 0, "timer", NULL) != 0)
+ panic("Could not allocate timer IRQ!");
+ __sti();
+ /* wait for calibrate */
+ while ( calibrate_steps )
+ ;
+ restore_flags(flags);
+ free_irq( 0, NULL);
+ }
X }
X
-
-static long __init mk48t59_init(void) {
+static long __init
+mk48t59_init(void) {
X unsigned char tmp;
X
X tmp = ppc_md.nvram_read_val(MK48T59_RTC_CONTROLB);
X if (tmp & MK48T59_RTC_CB_STOP) {
X printk("Warning: RTC was stopped, date will be wrong.\n");
X ppc_md.nvram_write_val(MK48T59_RTC_CONTROLB,
- tmp & ~MK48T59_RTC_CB_STOP);
+ tmp & ~MK48T59_RTC_CB_STOP);
X /* Low frequency crystal oscillators may take a very long
X * time to startup and stabilize. For now just ignore the
X * the issue, but attempting to calibrate the decrementer
@@ -454,12 +468,13 @@
X * the RTC registers have just been set up in the right state by the
X * preceding routine.
X */
-void __init mk48t59_calibrate_decr(void)
+static void __init
+mk48t59_calibrate_decr(void)
X {
X unsigned long freq;
X unsigned long t1;
- unsigned char save_control;
- long i;
+ unsigned char save_control;
+ long i;
X unsigned char sec;
X
X
@@ -467,7 +482,7 @@
X save_control = ppc_md.nvram_read_val(MK48T59_RTC_CONTROLB);
X
X ppc_md.nvram_write_val(MK48T59_RTC_CONTROLA,
- (save_control & (~MK48T59_RTC_CB_STOP)));
+ (save_control & (~MK48T59_RTC_CB_STOP)));
X
X /* Now make sure the read bit is off so the value will change. */
X save_control = ppc_md.nvram_read_val(MK48T59_RTC_CONTROLA);
@@ -484,27 +499,26 @@
X * stamp with a loop count as parameter would be the solution.
X */
X for (i = 0 ; i < 1000000 ; i++) { /* may take up to 1 second... */
- t1 = get_tbl();
- if (ppc_md.nvram_read_val(MK48T59_RTC_SECONDS) != sec) {
- break;
- }
+ t1 = get_tbl();
+ if (ppc_md.nvram_read_val(MK48T59_RTC_SECONDS) != sec) {
+ break;
+ }
X }
X
X sec = ppc_md.nvram_read_val(MK48T59_RTC_SECONDS);
X for (i = 0 ; i < 1000000 ; i++) { /* Should take up 1 second... */
- freq = get_tbl()-t1;
- if (ppc_md.nvram_read_val(MK48T59_RTC_SECONDS) != sec) {
- break;
- }
+ freq = get_tbl()-t1;
+ if (ppc_md.nvram_read_val(MK48T59_RTC_SECONDS) != sec)
+ break;
X }
X
X printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
- freq/1000000, freq%1000000);
+ freq/1000000, freq%1000000);
X tb_ticks_per_jiffy = freq / HZ;
X tb_to_us = mulhwu_scale_factor(freq, 1000000);
X }
X
-void __prep
+static void __prep
X prep_restart(char *cmd)
X {
X unsigned long i = 10000;
@@ -523,33 +537,7 @@
X panic("restart failed\n");
X }
X
-/*
- * This function will restart a board regardless of port 92 functionality
- */
-void __prep
-prep_direct_restart(char *cmd)
-{
- u32 jumpaddr=0xfff00100;
- u32 defaultmsr=MSR_IP;
-
- /*
- * This will ALWAYS work regardless of port 92
- * functionality
- */
- __cli();
-
- __asm__ __volatile__("\n\
- mtspr 26, %1 /* SRR0 */ \n\
- mtspr 27, %0 /* SRR1 */ \n\
- rfi"
- :
- : "r" (defaultmsr), "r" (jumpaddr));
- /*
- * Not reached
- */
-}
-
-void __prep
+static void __prep
X prep_halt(void)
X {
X unsigned long flags;
@@ -615,7 +603,7 @@
X udelay(100); /* important: let controller recover */
X }
X
-void __prep
+static void __prep
X prep_power_off(void)
X {
X if ( _prep_type == _PREP_IBM) {
@@ -640,19 +628,19 @@
X }
X }
X
-int __prep
+static int __prep
X prep_setup_residual(char *buffer)
X {
- int len = 0;
+ int len = 0;
X
X /* PREP's without residual data will give incorrect values here */
X len += sprintf(len+buffer, "clock\t\t: ");
X #ifdef CONFIG_PREP_RESIDUAL
X if ( res->ResidualLength )
X len += sprintf(len+buffer, "%ldMHz\n",
- (res->VitalProductData.ProcessorHz > 1024) ?
- res->VitalProductData.ProcessorHz>>20 :
- res->VitalProductData.ProcessorHz);
+ (res->VitalProductData.ProcessorHz > 1024) ?
+ res->VitalProductData.ProcessorHz>>20 :
+ res->VitalProductData.ProcessorHz);
X else
X #endif /* CONFIG_PREP_RESIDUAL */
X len += sprintf(len+buffer, "???\n");
@@ -660,7 +648,7 @@
X return len;
X }
X
-u_int __prep
+static unsigned int __prep
X prep_irq_cannonicalize(u_int irq)
X {
X if (irq == 2)
@@ -673,29 +661,29 @@
X }
X }
X
-int __prep
+static int __prep
X prep_get_irq(struct pt_regs *regs)
X {
X return i8259_irq(smp_processor_id());
X }
X
-void __init
+static void __init
X prep_init_IRQ(void)
X {
X int i;
X
X if (OpenPIC_Addr != NULL)
X openpic_init(1, NUM_8259_INTERRUPTS, 0, -1);
- for ( i = 0 ; i < NUM_8259_INTERRUPTS ; i++ )
- irq_desc[i].handler = &i8259_pic;
- i8259_init();
+ for ( i = 0 ; i < NUM_8259_INTERRUPTS ; i++ )
+ irq_desc[i].handler = &i8259_pic;
+ i8259_init();
X }


X
X #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)

X /*
X * IDE stuff.
X */
-int __prep
+static int __prep
X prep_ide_default_irq(ide_ioreg_t base)
X {
X switch (base) {
@@ -709,7 +697,7 @@
X }
X }
X
-ide_ioreg_t __prep
+static ide_ioreg_t __prep
X prep_ide_default_io_base(int index)
X {
X switch (index) {
@@ -718,17 +706,17 @@
X case 2: return 0x1e8;
X case 3: return 0x168;
X default:
- return 0;
+ return 0;
X }
X }
X
-int __prep
+static int __prep
X prep_ide_check_region(ide_ioreg_t from, unsigned int extent)
X {
- return check_region(from, extent);
+ return check_region(from, extent);
X }
X
-void __prep
+static void __prep
X prep_ide_request_region(ide_ioreg_t from,
X unsigned int extent,
X const char *name)
@@ -736,14 +724,14 @@
X request_region(from, extent, name);
X }
X
-void __prep
+static void __prep
X prep_ide_release_region(ide_ioreg_t from,
X unsigned int extent)
X {
X release_region(from, extent);
X }
X
-void __init
+static void __init
X prep_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
X {
X ide_ioreg_t reg = data_port;
@@ -756,7 +744,7 @@
X if (ctrl_port) {
X hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
X } else {
- hw->io_ports[IDE_CONTROL_OFFSET] = hw->io_ports[IDE_DATA_OFFSET] + 0x206;
+ hw->io_ports[IDE_CONTROL_OFFSET] = hw->io_ports[IDE_DATA_OFFSET] + 0x206;
X }
X if (irq != NULL)
X *irq = 0;
@@ -765,7 +753,7 @@
X
X #ifdef CONFIG_SMP
X /* PReP (MTX) support */
-static int
+static int __init
X smp_prep_probe(void)
X {
X extern int mot_multi;
@@ -779,7 +767,7 @@
X return 1;
X }
X
-static void
+static void __init
X smp_prep_kick_cpu(int nr)
X {
X *(unsigned long *)KERNELBASE = nr;
@@ -787,14 +775,14 @@
X printk("CPU1 reset, waiting\n");
X }
X
-static void
+static void __init
X smp_prep_setup_cpu(int cpu_nr)
X {
X if (OpenPIC_Addr)
X do_openpic_setup_cpu();
X }
X
-static struct smp_ops_t prep_smp_ops = {
+static struct smp_ops_t prep_smp_ops __prepdata = {
X smp_openpic_message_pass,
X smp_prep_probe,
X smp_prep_kick_cpu,
@@ -808,7 +796,8 @@
X * this will likely stay separate from the pmac.
X * -- Cort
X */
-unsigned long __init prep_find_end_of_memory(void)
+static unsigned long __init
+prep_find_end_of_memory(void)
X {
X unsigned long total = 0;
X extern unsigned int boot_mem_size;
@@ -819,15 +808,14 @@
X
X if (total == 0 && boot_mem_size != 0)
X total = boot_mem_size;
-
- if (total == 0) {
+ else if (total == 0) {
X /*
X * I need a way to probe the amount of memory if the residual
X * data doesn't contain it. -- Cort
X */
X total = 0x02000000;
X printk(KERN_INFO "Ramsize from residual data was 0"
- " -- defaulting to %ldM\n", total>>20);
+ " -- defaulting to %ldM\n", total>>20);
X }
X
X return (total);
@@ -838,16 +826,17 @@
X * the io areas. RAM was mapped by mapin_ram().
X * -- Cort
X */
-void __init prep_map_io(void)
+static void __init
+prep_map_io(void)
X {
X io_block_mapping(0x80000000, PREP_ISA_IO_BASE, 0x10000000, _PAGE_IO);
X io_block_mapping(0xf0000000, PREP_ISA_MEM_BASE, 0x08000000, _PAGE_IO);
X }
X
-void __init
+static void __init
X prep_init2(void)
X {
-#ifdef CONFIG_NVRAM
+#ifdef CONFIG_NVRAM
X request_region(PREP_NVRAM_AS0, 0x8, "nvram");
X #endif
X request_region(0x20,0x20,"pic1");
@@ -860,7 +849,7 @@
X
X void __init
X prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
- unsigned long r6, unsigned long r7)
+ unsigned long r6, unsigned long r7)
X {
X #ifdef CONFIG_PREP_RESIDUAL
X RESIDUAL *old_res = (RESIDUAL *)(r3 + KERNELBASE);
@@ -869,7 +858,7 @@
X if ( r3 )
X {
X memcpy((void *)res,(void *)(r3+KERNELBASE),
- sizeof(RESIDUAL));
+ sizeof(RESIDUAL));
X }
X #endif
X
@@ -882,7 +871,7 @@
X #endif /* CONFIG_BLK_DEV_INITRD */
X
X /* Copy cmd_line parameters */
- if ( r6)
+ if ( r6 )
X {
X *(char *)(r7 + KERNELBASE) = 0;
X strcpy(cmd_line, (char *)(r6 + KERNELBASE));
@@ -905,7 +894,7 @@
X _prep_type = _PREP_Motorola;
X }
X else /* assume motorola if no residual (netboot?) */
-#endif
+#endif
X {
X _prep_type = _PREP_Motorola;
X }
@@ -928,8 +917,7 @@
X ppc_md.set_rtc_time = mc146818_set_rtc_time;
X ppc_md.get_rtc_time = mc146818_get_rtc_time;
X ppc_md.calibrate_decr = prep_calibrate_decr;
- }
- else {
+ } else {
X ppc_md.set_rtc_time = mk48t59_set_rtc_time;
X ppc_md.get_rtc_time = mk48t59_get_rtc_time;
X ppc_md.calibrate_decr = mk48t59_calibrate_decr;
@@ -940,12 +928,12 @@
X ppc_md.setup_io_mappings = prep_map_io;


X
X #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)

- ppc_ide_md.default_irq = prep_ide_default_irq;
- ppc_ide_md.default_io_base = prep_ide_default_io_base;
- ppc_ide_md.ide_check_region = prep_ide_check_region;
- ppc_ide_md.ide_request_region = prep_ide_request_region;
- ppc_ide_md.ide_release_region = prep_ide_release_region;
- ppc_ide_md.ide_init_hwif = prep_ide_init_hwif_ports;
+ ppc_ide_md.default_irq = prep_ide_default_irq;
+ ppc_ide_md.default_io_base = prep_ide_default_io_base;
+ ppc_ide_md.ide_check_region = prep_ide_check_region;
+ ppc_ide_md.ide_request_region = prep_ide_request_region;
+ ppc_ide_md.ide_release_region = prep_ide_release_region;
+ ppc_ide_md.ide_init_hwif = prep_ide_init_hwif_ports;
X #endif
X
X #ifdef CONFIG_VT
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/setup.c linux/arch/ppc/kernel/setup.c
--- v2.4.13/linux/arch/ppc/kernel/setup.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/setup.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.setup.c 1.57 09/08/01 15:47:42 paulus
+ * BK Id: SCCS/s.setup.c 1.61 10/12/01 16:35:34 trini
X */
X /*
X * Common prep/pmac/chrp boot and setup code.
@@ -496,7 +496,7 @@
X #ifdef CONFIG_BLK_DEV_INITRD
X case BI_INITRD:
X initrd_start = data[0];
- initrd_end = data[0] + rec->size;
+ initrd_end = data[0] + data[1];
X break;
X #endif /* CONFIG_BLK_DEV_INITRD */
X #ifdef CONFIG_ALL_PPC
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/smp.c linux/arch/ppc/kernel/smp.c
--- v2.4.13/linux/arch/ppc/kernel/smp.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/kernel/smp.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.smp.c 1.31 09/08/01 15:47:42 paulus
+ * BK Id: SCCS/s.smp.c 1.34 10/11/01 12:06:01 trini
X */
X /*
X * Smp support for ppc.
@@ -35,7 +35,6 @@
X #include <asm/prom.h>
X #include <asm/smp.h>
X #include <asm/residual.h>
-#include <asm/feature.h>
X #include <asm/time.h>
X
X #include "open_pic.h"
@@ -283,6 +282,7 @@
X printk("Entering SMP Mode...\n");
X smp_num_cpus = 1;
X smp_store_cpu_info(0);
+ cpu_online_map = 1UL;
X
X /*
X * assume for now that the first cpu booted is
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/syscalls.c linux/arch/ppc/kernel/syscalls.c
--- v2.4.13/linux/arch/ppc/kernel/syscalls.c Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/syscalls.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.syscalls.c 1.8 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.syscalls.c 1.11 10/16/01 15:58:42 trini
X */
X /*
X * linux/arch/ppc/kernel/sys_ppc.c
@@ -306,7 +306,7 @@
X * Those are normally defined in arch/ppc/kernel/pci.c. But when CONFIG_PCI is
X * not defined, this file is not linked at all, so here are the "empty" versions
X */
-asmlinkage int sys_pciconfig_read() { return -ENOSYS; }
-asmlinkage int sys_pciconfig_write() { return -ENOSYS; }
-asmlinkage long sys_pciconfig_iobase() { return -ENOSYS; }
+int sys_pciconfig_read(void) { return -ENOSYS; }
+int sys_pciconfig_write(void) { return -ENOSYS; }
+long sys_pciconfig_iobase(void) { return -ENOSYS; }
X #endif
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/traps.c linux/arch/ppc/kernel/traps.c
--- v2.4.13/linux/arch/ppc/kernel/traps.c Tue Oct 9 17:06:51 2001
+++ linux/arch/ppc/kernel/traps.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.traps.c 1.19 08/24/01 20:07:37 paulus
+ * BK Id: SCCS/s.traps.c 1.22 10/11/01 10:33:09 paulus
X */
X /*
X * linux/arch/ppc/kernel/traps.c
@@ -108,6 +108,7 @@
X #ifdef CONFIG_ALL_PPC
X unsigned long fixup;
X #endif /* CONFIG_ALL_PPC */
+ unsigned long msr = regs->msr;
X
X if (user_mode(regs)) {
X _exception(SIGSEGV, regs);
@@ -132,31 +133,47 @@
X * Check if the NIP corresponds to the address of a sync
X * instruction for which there is an entry in the exception
X * table.
+ * Note that the 601 only takes a machine check on TEA
+ * (transfer error ack) signal assertion, and does not
+ * set of the top 16 bits of SRR1.
+ * -- paulus.
X */
- if (regs->msr & (0x80000 | 0x40000)
+ if (((msr & 0xffff0000) == 0 || (msr & (0x80000 | 0x40000)))
X && (fixup = search_exception_table(regs->nip)) != 0) {
X /*
- * Check that it's a sync instruction.
+ * Check that it's a sync instruction, or somewhere
+ * in the twi; isync; nop sequence that inb/inw/inl uses.
X * As the address is in the exception table
X * we should be able to read the instr there.
+ * For the debug message, we look at the preceding
+ * load or store.
X */
- if (*(unsigned int *)regs->nip == 0x7c0004ac) {
- unsigned int lsi = ((unsigned int *)regs->nip)[-1];
- int rb = (lsi >> 11) & 0x1f;
- printk(KERN_DEBUG "%s bad port %lx at %lx\n",
- (lsi & 0x100)? "OUT to": "IN from",
- regs->gpr[rb] - _IO_BASE, regs->nip);
+ unsigned int *nip = (unsigned int *)regs->nip;
+ if (*nip == 0x60000000) /* nop */
+ nip -= 2;
+ else if (*nip == 0x4c00012c) /* isync */
+ --nip;
+ if (*nip == 0x7c0004ac || (*nip >> 26) == 3) {
+ /* sync or twi */
+ unsigned int rb;
+
+ --nip;
+ rb = (*nip >> 11) & 0x1f;
+ printk(KERN_DEBUG "%s bad port %lx at %p\n",
+ (*nip & 0x100)? "OUT to": "IN from",
+ regs->gpr[rb] - _IO_BASE, nip);
X regs->nip = fixup;
X return;
X }
X }
X #endif /* CONFIG_ALL_PPC */
X printk("Machine check in kernel mode.\n");
- printk("Caused by (from SRR1=%lx): ", regs->msr);
- switch (regs->msr & 0xF0000) {
+ printk("Caused by (from SRR1=%lx): ", msr);
+ switch (msr & 0xF0000) {
X case 0x80000:
X printk("Machine check signal\n");
X break;
+ case 0: /* for 601 */
X case 0x40000:
X printk("Transfer error ack signal\n");
X break;
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/kernel/walnut_setup.c linux/arch/ppc/kernel/walnut_setup.c
--- v2.4.13/linux/arch/ppc/kernel/walnut_setup.c Mon May 21 17:04:47 2001
+++ linux/arch/ppc/kernel/walnut_setup.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.walnut_setup.c 1.5 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.walnut_setup.c 1.8 10/18/01 11:16:28 trini


X */
X /*
X *

@@ -123,12 +123,7 @@
X ppc_md.kbd_unexpected_up = NULL;
X ppc_md.kbd_leds = NULL;
X ppc_md.kbd_init_hw = NULL;
-
-#if defined(CONFIG_MAGIC_SYSRQ)
X ppc_md.ppc_kbd_sysrq_xlate = NULL;
-#endif
-
- return;
X }
X
X /*
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/lib/string.S linux/arch/ppc/lib/string.S
--- v2.4.13/linux/arch/ppc/lib/string.S Mon May 21 17:04:47 2001
+++ linux/arch/ppc/lib/string.S Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.string.S 1.5 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.string.S 1.9 10/25/01 10:08:51 trini
X */
X /*
X * String handling functions for PowerPC.
@@ -14,22 +14,9 @@
X #include "../kernel/ppc_asm.tmpl"
X #include <linux/config.h>
X #include <asm/processor.h>
+#include <asm/cache.h>
X #include <asm/errno.h>
X
-#if defined(CONFIG_4xx) || defined(CONFIG_8xx)
-#define CACHE_LINE_SIZE 16
-#define LG_CACHE_LINE_SIZE 4
-#define MAX_COPY_PREFETCH 1
-#elif !defined(CONFIG_PPC64BRIDGE)
-#define CACHE_LINE_SIZE 32
-#define LG_CACHE_LINE_SIZE 5
-#define MAX_COPY_PREFETCH 4
-#else
-#define CACHE_LINE_SIZE 128
-#define LG_CACHE_LINE_SIZE 7
-#define MAX_COPY_PREFETCH 1
-#endif /* CONFIG_4xx || CONFIG_8xx */
-
X #define COPY_16_BYTES \
X lwz r7,4(r4); \
X lwz r8,8(r4); \
@@ -75,11 +62,13 @@
X .long 8 ## n ## 5b,9 ## n ## 1b; \
X .long 8 ## n ## 6b,9 ## n ## 1b; \
X .long 8 ## n ## 7b,9 ## n ## 1b; \
-.text
+ .text
+
+ .text
X
-CACHELINE_BYTES = CACHE_LINE_SIZE
-LG_CACHELINE_BYTES = LG_CACHE_LINE_SIZE
-CACHELINE_MASK = (CACHE_LINE_SIZE-1)
+CACHELINE_BYTES = L1_CACHE_LINE_SIZE
+LG_CACHELINE_BYTES = LG_L1_CACHE_LINE_SIZE
+CACHELINE_MASK = (L1_CACHE_LINE_SIZE-1)
X
X .globl strcpy
X strcpy:
@@ -278,12 +267,12 @@
X dcbz r11,r6
X #endif
X COPY_16_BYTES
-#if CACHE_LINE_SIZE >= 32
+#if L1_CACHE_LINE_SIZE >= 32
X COPY_16_BYTES
-#if CACHE_LINE_SIZE >= 64
+#if L1_CACHE_LINE_SIZE >= 64
X COPY_16_BYTES
X COPY_16_BYTES
-#if CACHE_LINE_SIZE >= 128
+#if L1_CACHE_LINE_SIZE >= 128
X COPY_16_BYTES
X COPY_16_BYTES
X COPY_16_BYTES
@@ -456,23 +445,23 @@
X
X #if !defined(CONFIG_8xx)
X /* Here we decide how far ahead to prefetch the source */
-#if MAX_COPY_PREFETCH > 1
+#if MAX_L1_COPY_PREFETCH > 1
X /* Heuristically, for large transfers we prefetch
- MAX_COPY_PREFETCH cachelines ahead. For small transfers
+ MAX_L1_COPY_PREFETCH cachelines ahead. For small transfers
X we prefetch 1 cacheline ahead. */
- cmpwi r0,MAX_COPY_PREFETCH
+ cmpwi r0,MAX_L1_COPY_PREFETCH
X li r7,1
X li r3,4
X ble 111f
- li r7,MAX_COPY_PREFETCH
+ li r7,MAX_L1_COPY_PREFETCH
X 111: mtctr r7
X 112: dcbt r3,r4
X addi r3,r3,CACHELINE_BYTES
X bdnz 112b
-#else /* MAX_COPY_PREFETCH == 1 */
+#else /* MAX_L1_COPY_PREFETCH == 1 */
X li r3,CACHELINE_BYTES + 4
X dcbt r11,r4
-#endif /* MAX_COPY_PREFETCH */
+#endif /* MAX_L1_COPY_PREFETCH */
X #endif /* CONFIG_8xx */
X
X mtctr r0
@@ -492,12 +481,12 @@
X .text
X /* the main body of the cacheline loop */
X COPY_16_BYTES_WITHEX(0)
-#if CACHE_LINE_SIZE >= 32
+#if L1_CACHE_LINE_SIZE >= 32
X COPY_16_BYTES_WITHEX(1)
-#if CACHE_LINE_SIZE >= 64
+#if L1_CACHE_LINE_SIZE >= 64
X COPY_16_BYTES_WITHEX(2)
X COPY_16_BYTES_WITHEX(3)
-#if CACHE_LINE_SIZE >= 128
+#if L1_CACHE_LINE_SIZE >= 128
X COPY_16_BYTES_WITHEX(4)
X COPY_16_BYTES_WITHEX(5)
X COPY_16_BYTES_WITHEX(6)
@@ -546,12 +535,12 @@
X * 104f (if in read part) or 105f (if in write part), after updating r5
X */
X COPY_16_BYTES_EXCODE(0)
-#if CACHE_LINE_SIZE >= 32
+#if L1_CACHE_LINE_SIZE >= 32
X COPY_16_BYTES_EXCODE(1)
-#if CACHE_LINE_SIZE >= 64
+#if L1_CACHE_LINE_SIZE >= 64
X COPY_16_BYTES_EXCODE(2)
X COPY_16_BYTES_EXCODE(3)
-#if CACHE_LINE_SIZE >= 128
+#if L1_CACHE_LINE_SIZE >= 128
X COPY_16_BYTES_EXCODE(4)
X COPY_16_BYTES_EXCODE(5)
X COPY_16_BYTES_EXCODE(6)
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/mm/4xx_mmu.c linux/arch/ppc/mm/4xx_mmu.c
--- v2.4.13/linux/arch/ppc/mm/4xx_mmu.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/mm/4xx_mmu.c Fri Nov 2 17:43:54 2001
@@ -69,15 +69,15 @@
X * be applied to every page which is a member of a given zone. At
X * present, we utilize only two of the 4xx's zones.
X * The zone index bits (of ZSEL) in the PTE are used for software
- * indicators, except the LSB. For user access, zone 15 is used,
- * for kernel access, zone 14 is used. We set all but zone 15
+ * indicators, except the LSB. For user access, zone 1 is used,
+ * for kernel access, zone 0 is used. We set all but zone 1
X * to zero, allowing only kernel access as indicated in the PTE.
- * For zone 15, we set a 01 binary (a value of 10 will not work)
+ * For zone 1, we set a 01 binary (a value of 10 will not work)
X * to allow user access as indicated in the PTE. This also allows
X * kernel access as indicated in the PTE.
X */
X
- mtspr(SPRN_ZPR, 0x00000001);
+ mtspr(SPRN_ZPR, 0x10000000);
X
X flush_instruction_cache();
X
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/mm/cachemap.c linux/arch/ppc/mm/cachemap.c
--- v2.4.13/linux/arch/ppc/mm/cachemap.c Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/mm/cachemap.c Fri Nov 2 17:43:54 2001
@@ -50,6 +50,8 @@
X #include <asm/smp.h>
X #include <asm/machdep.h>
X
+extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);
+
X void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle)
X {
X int order, rsize;
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/mm/mmu_decl.h linux/arch/ppc/mm/mmu_decl.h
--- v2.4.13/linux/arch/ppc/mm/mmu_decl.h Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/mm/mmu_decl.h Fri Nov 2 17:43:54 2001
@@ -53,6 +53,7 @@
X
X #elif defined(CONFIG_4xx)
X #define flush_HPTE(X, va, pg) _tlbie(va)
+extern void MMU_init_hw(void);
X
X #else
X /* anything except 4xx or 8xx */
diff -u --recursive --new-file v2.4.13/linux/arch/sh/kernel/pci-sh7751.c linux/arch/sh/kernel/pci-sh7751.c
--- v2.4.13/linux/arch/sh/kernel/pci-sh7751.c Sun Sep 23 11:40:56 2001
+++ linux/arch/sh/kernel/pci-sh7751.c Sun Nov 4 09:31:58 2001
@@ -3,7 +3,7 @@
X *
X * Dustin McIntire (dus...@sensoria.com)
X * Derived from arch/i386/kernel/pci-*.c which bore the message:
- * (c) 1999--2000 Martin Mares <m...@suse.cz>
+ * (c) 1999--2000 Martin Mares <m...@ucw.cz>
X *
X * May be copied or modified under the terms of the GNU General Public
X * License. See linux/COPYING for more information.
diff -u --recursive --new-file v2.4.13/linux/arch/sparc/defconfig linux/arch/sparc/defconfig
--- v2.4.13/linux/arch/sparc/defconfig Wed Jul 25 17:10:19 2001
+++ linux/arch/sparc/defconfig Tue Oct 30 15:08:11 2001
@@ -70,7 +70,6 @@
X CONFIG_FB=y
X CONFIG_DUMMY_CONSOLE=y
X # CONFIG_FB_CYBER2000 is not set


-# CONFIG_FB_E1355 is not set

X CONFIG_FB_SBUS=y
X CONFIG_FB_CGSIX=y
X CONFIG_FB_BWTWO=y
@@ -128,6 +127,7 @@


X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set

X CONFIG_BLK_DEV_RAM=y
X CONFIG_BLK_DEV_RAM_SIZE=4096
@@ -153,6 +153,7 @@
X CONFIG_IPV6=m


X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
X
X #
X #

@@ -280,6 +281,7 @@
X CONFIG_VFAT_FS=m
X CONFIG_EFS_FS=m


X # CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
X # CONFIG_CRAMFS is not set

X # CONFIG_TMPFS is not set
X # CONFIG_RAMFS is not set
diff -u --recursive --new-file v2.4.13/linux/arch/sparc/kernel/check_asm.sh linux/arch/sparc/kernel/check_asm.sh
--- v2.4.13/linux/arch/sparc/kernel/check_asm.sh Wed Aug 23 09:30:13 2000
+++ linux/arch/sparc/kernel/check_asm.sh Tue Oct 30 15:08:11 2001
@@ -11,7 +11,7 @@
X echo " sizeof(struct $2_struct)," >> $4
X ;;
X -ints)
- sed -n -e '/check_asm_data:/,/\.size/p' <$2 | sed -e 's/check_asm_data://' -e 's/\.size.*//' -e 's/\.long[ ]\([0-9]*\)/\1,/' >>$3
+ sed -n -e '/check_asm_data:/,/\.size/p' <$2 | sed -e 's/check_asm_data://' -e 's/\.size.*//' -e 's/\.ident.*//' -e 's/\.long[ ]\([0-9]*\)/\1,/' >>$3
X ;;
X *)
X exit 1
diff -u --recursive --new-file v2.4.13/linux/arch/sparc/kernel/ioport.c linux/arch/sparc/kernel/ioport.c
--- v2.4.13/linux/arch/sparc/kernel/ioport.c Sun Feb 18 19:49:44 2001
+++ linux/arch/sparc/kernel/ioport.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: ioport.c,v 1.44 2001/02/13 04:07:38 davem Exp $
+/* $Id: ioport.c,v 1.45 2001/10/30 04:54:21 davem Exp $
X * ioport.c: Simple io mapping allocator.
X *
X * Copyright (C) 1995 David S. Miller (da...@caip.rutgers.edu)
@@ -703,7 +703,7 @@
X }
X }
X }
-#endif CONFIG_PCI
+#endif /* CONFIG_PCI */
X
X #ifdef CONFIG_PROC_FS
X
@@ -725,7 +725,7 @@
X return p-buf;
X }
X
-#endif CONFIG_PROC_FS
+#endif /* CONFIG_PROC_FS */
X
X /*
X * This is a version of find_resource and it belongs to kernel/resource.c.
diff -u --recursive --new-file v2.4.13/linux/arch/sparc/kernel/sparc-stub.c linux/arch/sparc/kernel/sparc-stub.c
--- v2.4.13/linux/arch/sparc/kernel/sparc-stub.c Tue Oct 10 10:33:51 2000
+++ linux/arch/sparc/kernel/sparc-stub.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: sparc-stub.c,v 1.27 2000/10/03 07:28:49 anton Exp $


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 10'
echo 'File patch-2.4.14 is continued in part 11'
echo "11" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:26 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part03

#!/bin/sh -x
# this is part 03 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 03; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+# CONFIG_BLK_DEV_IDEDISK_IBM is not set
+# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set
+# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set
+# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set
+# CONFIG_BLK_DEV_IDEDISK_WD is not set
+# CONFIG_BLK_DEV_COMMERIAL is not set
+# CONFIG_BLK_DEV_TIVO is not set

+CONFIG_BLK_DEV_IDECS=m


+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set

+# CONFIG_BLK_DEV_IDESCSI is not set
+
+#
+# IDE chipset support/bugfixes
+#


+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+# CONFIG_BLK_DEV_ISAPNP is not set
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_DMA_NONPCI is not set

+# CONFIG_BLK_DEV_IDE_MODES is not set


+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set

+
+#
+# SCSI support
+#

+# CONFIG_SCSI is not set
+
+#


+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set

+# CONFIG_I2O_PROC is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set


+
+#
+# Input core support

+#
+# CONFIG_INPUT is not set


+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set

+
+#
+# Character devices
+#
+CONFIG_VT=y
+# CONFIG_VT_CONSOLE is not set
+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set

+# CONFIG_SERIAL_NONSTANDARD is not set


+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_ANAKIN is not set
+# CONFIG_SERIAL_ANAKIN_CONSOLE is not set

+# CONFIG_SERIAL_AMBA is not set
+# CONFIG_SERIAL_AMBA_CONSOLE is not set
+# CONFIG_SERIAL_CLPS711X is not set

+# CONFIG_SERIAL_CLPS711X_CONSOLE is not set


+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set

+CONFIG_SERIAL_SA1100=y
+CONFIG_SERIAL_SA1100_CONSOLE=y
+CONFIG_SA1100_DEFAULT_BAUDRATE=9600


+# CONFIG_SERIAL_8250 is not set

+# CONFIG_SERIAL_8250_CONSOLE is not set


+# CONFIG_SERIAL_8250_EXTENDED is not set
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_HUB6 is not set

+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=32
+# CONFIG_UCB1200 is not set
+# CONFIG_TOUCHSCREEN_UCB1200 is not set
+# CONFIG_AUDIO_UCB1200 is not set
+# CONFIG_ADC_UCB1200 is not set
+# CONFIG_TOUCHSCREEN_H3600 is not set


+# CONFIG_PROFILER is not set
+# CONFIG_PFS168_SPI is not set
+# CONFIG_PFS168_DTMF is not set

+# CONFIG_PFS168_MISC is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#


+# L3 serial bus support
+#

+# CONFIG_L3 is not set
+# CONFIG_L3_ALGOBIT is not set
+# CONFIG_L3_BIT_SA1100_GPIO is not set
+# CONFIG_BIT_SA1100_UCB1200 is not set
+
+#


+# Other L3 adapters
+#
+# CONFIG_L3_SA1111 is not set
+

+#
+# L3 driver support
+#
+# CONFIG_L3_DRV_UDA1341 is not set
+# CONFIG_BIT_SA1100_GPIO is not set
+
+#


+# Mice
+#
+# CONFIG_BUSMOUSE is not set

+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#


+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#

+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#


+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set

+CONFIG_SA1100_RTC=y


+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set

+# CONFIG_SONYPI is not set
+
+#


+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set

+# CONFIG_DRM is not set
+
+#


+# PCMCIA character devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set

+CONFIG_AUTOFS_FS=y
+CONFIG_AUTOFS4_FS=y


+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set

+# CONFIG_REISERFS_PROC_INFO is not set


+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set

+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set

+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_UMSDOS_FS=y


+CONFIG_VFAT_FS=y
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set

+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_CRAMFS is not set


+# CONFIG_TMPFS is not set
+CONFIG_RAMFS=y
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set

+# CONFIG_FREEVXFS_FS is not set


+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set

+CONFIG_ROMFS_FS=y


+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set

+# CONFIG_INTERMEZZO_FS is not set

+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_ROOT_NFS is not set


+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y

+CONFIG_LOCKD_V4=y

+# CONFIG_FB is not set


+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#

+# CONFIG_USB is not set
+
+#


+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+# CONFIG_USB_OHCI_SA1111 is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set

+# CONFIG_USB_DABUSB is not set

+
+#
+# USB Network adaptors
+#

+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set

+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set

+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set

+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set

+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#

+# Miscellaneous USB drivers


+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#

+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_NO_FRAME_POINTER is not set
+CONFIG_DEBUG_ERRORS=y

+CONFIG_DEBUG_USER=y


+# CONFIG_DEBUG_INFO is not set

+CONFIG_MAGIC_SYSRQ=y


+# CONFIG_NO_PGT_CACHE is not set
+# CONFIG_DEBUG_LL is not set
+# CONFIG_DEBUG_DC21285_PORT is not set
+# CONFIG_DEBUG_CLPS711X_UART2 is not set

diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/cerfpda linux/arch/arm/def-configs/cerfpda
--- v2.4.13/linux/arch/arm/def-configs/cerfpda Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/def-configs/cerfpda Thu Oct 25 13:53:44 2001
@@ -0,0 +1,981 @@

+# CONFIG_SA1100_CERF_32MB is not set
+CONFIG_SA1100_CERF_64MB=y


+# CONFIG_SA1100_CERF_FLASH_8MB is not set

+# CONFIG_SA1100_CERF_FLASH_16MB is not set
+CONFIG_SA1100_CERF_FLASH_32MB=y
+CONFIG_SA1100_CERF_CPLD=y

+CONFIG_CMDLINE="console=ttySA0 cpufreq_max=221200 root=1f03 rw"


+# CONFIG_PFS168_CMDLINE is not set

+# CONFIG_LEDS is not set

+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_CFI_B1 is not set
+# CONFIG_MTD_CFI_B2 is not set
+CONFIG_MTD_CFI_B4=y
+# CONFIG_MTD_CFI_I1 is not set
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set

+CONFIG_PACKET_MMAP=y


+CONFIG_NETLINK=y
+CONFIG_RTNETLINK=y
+# CONFIG_NETLINK_DEV is not set
+# CONFIG_NETFILTER is not set
+CONFIG_FILTER=y
+CONFIG_UNIX=y
+CONFIG_INET=y

+CONFIG_IP_MULTICAST=y


+# CONFIG_IP_ADVANCED_ROUTER is not set
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set

+# CONFIG_IP_MROUTE is not set

+CONFIG_NET_RADIO=y
+CONFIG_STRIP=m
+CONFIG_WAVELAN=m
+CONFIG_ARLAN=m
+CONFIG_AIRONET4500=m
+CONFIG_AIRONET4500_NONCS=m
+# CONFIG_AIRONET4500_PNP is not set
+# CONFIG_AIRONET4500_PCI is not set
+# CONFIG_AIRONET4500_ISA is not set
+# CONFIG_AIRONET4500_I365 is not set
+CONFIG_AIRONET4500_PROC=m
+
+#
+# Wireless Pcmcia cards support
+#
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_NET_WIRELESS=y


+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# PCMCIA network device support
+#
+CONFIG_NET_PCMCIA=y

+CONFIG_PCMCIA_3C589=m
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_PCMCIA_XIRC2PS=m


+# CONFIG_ARCNET_COM20020_CS is not set
+# CONFIG_PCMCIA_IBMTR is not set

+CONFIG_NET_PCMCIA_RADIO=y
+CONFIG_PCMCIA_RAYCS=m
+CONFIG_PCMCIA_NETWAVE=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_AIRONET4500_CS=m

+# CONFIG_BLK_DEV_IDEDISK_IBM is not set
+# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set
+# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set
+# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set
+# CONFIG_BLK_DEV_IDEDISK_WD is not set
+# CONFIG_BLK_DEV_COMMERIAL is not set
+# CONFIG_BLK_DEV_TIVO is not set

+CONFIG_BLK_DEV_IDECS=m


+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set

+# CONFIG_BLK_DEV_IDESCSI is not set
+
+#
+# IDE chipset support/bugfixes
+#


+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+# CONFIG_BLK_DEV_ISAPNP is not set
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_DMA_NONPCI is not set

+# CONFIG_BLK_DEV_IDE_MODES is not set


+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set

+
+#
+# SCSI support
+#

+# CONFIG_SCSI is not set
+
+#


+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set

+# CONFIG_I2O_PROC is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set


+
+#
+# Input core support

+#
+# CONFIG_INPUT is not set


+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set

+
+#
+# Character devices
+#
+CONFIG_VT=y

+CONFIG_VT_CONSOLE=y


+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set

+# CONFIG_SERIAL_NONSTANDARD is not set


+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_ANAKIN is not set
+# CONFIG_SERIAL_ANAKIN_CONSOLE is not set

+# CONFIG_SERIAL_AMBA is not set
+# CONFIG_SERIAL_AMBA_CONSOLE is not set
+# CONFIG_SERIAL_CLPS711X is not set

+# CONFIG_SERIAL_CLPS711X_CONSOLE is not set


+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set

+CONFIG_SERIAL_SA1100=y
+CONFIG_SERIAL_SA1100_CONSOLE=y
+CONFIG_SA1100_DEFAULT_BAUDRATE=38400
+CONFIG_SERIAL_8250=y
+# CONFIG_SERIAL_8250_CONSOLE is not set


+# CONFIG_SERIAL_8250_EXTENDED is not set
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_HUB6 is not set

+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=32
+CONFIG_UCB1200=y
+CONFIG_TOUCHSCREEN_UCB1200=y

+CONFIG_CERF_TS_MANUAL=y
+CONFIG_CERF_TS_MAXX="924"
+CONFIG_CERF_TS_MAXY="920"
+CONFIG_CERF_TS_MINX="57"
+CONFIG_CERF_TS_MINY="52"
+CONFIG_CERF_TS_RESX="240"
+CONFIG_CERF_TS_RESY="320"
+# CONFIG_AUDIO_UCB1200 is not set
+# CONFIG_ADC_UCB1200 is not set
+# CONFIG_TOUCHSCREEN_H3600 is not set


+# CONFIG_PROFILER is not set
+# CONFIG_PFS168_SPI is not set
+# CONFIG_PFS168_DTMF is not set
+# CONFIG_PFS168_MISC is not set

+CONFIG_SA1100_CERF_KEYPAD=y


+
+#
+# I2C support
+#

+# CONFIG_I2C is not set
+
+#


+# L3 serial bus support
+#

+# CONFIG_L3 is not set
+# CONFIG_L3_ALGOBIT is not set
+# CONFIG_L3_BIT_SA1100_GPIO is not set
+# CONFIG_BIT_SA1100_UCB1200 is not set
+
+#


+# Other L3 adapters
+#
+# CONFIG_L3_SA1111 is not set
+

+#
+# L3 driver support
+#
+# CONFIG_L3_DRV_UDA1341 is not set
+# CONFIG_BIT_SA1100_GPIO is not set
+
+#


+# Mice
+#
+# CONFIG_BUSMOUSE is not set

+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#


+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#

+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#


+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set

+CONFIG_SA1100_RTC=y


+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set

+# CONFIG_SONYPI is not set
+
+#


+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set

+# CONFIG_DRM is not set
+
+#


+# PCMCIA character devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set

+# CONFIG_REISERFS_PROC_INFO is not set


+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set

+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set

+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_UMSDOS_FS=y


+CONFIG_VFAT_FS=y
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set

+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_CRAMFS is not set


+# CONFIG_TMPFS is not set
+CONFIG_RAMFS=y
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set

+# CONFIG_FREEVXFS_FS is not set


+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set

+CONFIG_ROMFS_FS=y


+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set

+# CONFIG_INTERMEZZO_FS is not set

+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_ROOT_NFS is not set


+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y

+CONFIG_LOCKD_V4=y

+# CONFIG_FB_ANAKIN is not set
+# CONFIG_FB_CLPS711X is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_SA1100=y

+CONFIG_CERF_LCD_38_A=y
+# CONFIG_CERF_LCD_57_A is not set
+# CONFIG_CERF_LCD_72_A is not set
+CONFIG_SA1100_CERF_LCD_BACKLIGHT=y


+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FBCON_ADVANCED is not set
+CONFIG_FBCON_CFB2=y
+CONFIG_FBCON_CFB4=y
+CONFIG_FBCON_CFB8=y
+CONFIG_FBCON_CFB16=y

+# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
+# CONFIG_FBCON_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y


+
+#
+# Sound
+#

+CONFIG_SOUND=y


+# CONFIG_SOUND_BT878 is not set

+# CONFIG_SOUND_CMPCI is not set
+# CONFIG_SOUND_EMU10K1 is not set


+# CONFIG_MIDI_EMU10K1 is not set

+# CONFIG_SOUND_FUSION is not set
+# CONFIG_SOUND_CS4281 is not set
+# CONFIG_SOUND_ES1370 is not set
+# CONFIG_SOUND_ES1371 is not set
+# CONFIG_SOUND_ESSSOLO1 is not set
+# CONFIG_SOUND_MAESTRO is not set
+# CONFIG_SOUND_MAESTRO3 is not set
+# CONFIG_SOUND_ICH is not set


+# CONFIG_SOUND_RME96XX is not set

+# CONFIG_SOUND_SONICVIBES is not set
+# CONFIG_SOUND_TRIDENT is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+# CONFIG_SOUND_VIA82CXXX is not set
+# CONFIG_MIDI_VIA82CXXX is not set
+# CONFIG_SOUND_ASSABET_UDA1341 is not set


+# CONFIG_SOUND_H3600_UDA1341 is not set
+# CONFIG_SOUND_PANGOLIN_UDA1341 is not set
+# CONFIG_SOUND_SA1111_UDA1341 is not set

+CONFIG_SOUND_CERF_UDA1341=y


+# CONFIG_SOUND_SA1100SSP is not set

+# CONFIG_SOUND_OSS is not set


+# CONFIG_SOUND_WAVEARTIST is not set

+# CONFIG_SOUND_TVMIXER is not set


+
+#
+# USB support
+#

+# CONFIG_USB is not set
+
+#


+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+# CONFIG_USB_OHCI_SA1111 is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set

+# CONFIG_USB_DABUSB is not set

+
+#
+# USB Network adaptors
+#

+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set

+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set

+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set

+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set

+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#

+# Miscellaneous USB drivers


+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#

+# Bluetooth support
+#
+CONFIG_BLUEZ=y
+CONFIG_BLUEZ_L2CAP=y
+
+#
+# Bluetooth device drivers
+#
+# CONFIG_BLUEZ_HCIUSB is not set
+CONFIG_BLUEZ_HCIUART=y
+# CONFIG_BLUEZ_HCIVHCI is not set


+
+#
+# Kernel hacking
+#
+# CONFIG_NO_FRAME_POINTER is not set
+CONFIG_DEBUG_ERRORS=y

+CONFIG_DEBUG_USER=y


+# CONFIG_DEBUG_INFO is not set

+CONFIG_MAGIC_SYSRQ=y


+# CONFIG_NO_PGT_CACHE is not set
+# CONFIG_DEBUG_LL is not set
+# CONFIG_DEBUG_DC21285_PORT is not set
+# CONFIG_DEBUG_CLPS711X_UART2 is not set

diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/cerfpod linux/arch/arm/def-configs/cerfpod
--- v2.4.13/linux/arch/arm/def-configs/cerfpod Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/def-configs/cerfpod Thu Oct 25 13:53:44 2001
@@ -0,0 +1,908 @@

+CONFIG_PACKET_MMAP=y


+CONFIG_NETLINK=y
+CONFIG_RTNETLINK=y
+# CONFIG_NETLINK_DEV is not set
+# CONFIG_NETFILTER is not set
+CONFIG_FILTER=y
+CONFIG_UNIX=y
+CONFIG_INET=y

+CONFIG_IP_MULTICAST=y


+# CONFIG_IP_ADVANCED_ROUTER is not set
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set

+# CONFIG_IP_MROUTE is not set

+CONFIG_PCMCIA_PCNET=y

+# CONFIG_BLK_DEV_IDEDISK_IBM is not set
+# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set
+# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set
+# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set
+# CONFIG_BLK_DEV_IDEDISK_WD is not set
+# CONFIG_BLK_DEV_COMMERIAL is not set
+# CONFIG_BLK_DEV_TIVO is not set

+CONFIG_BLK_DEV_IDECS=m


+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set

+# CONFIG_BLK_DEV_IDESCSI is not set
+
+#
+# IDE chipset support/bugfixes
+#


+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+# CONFIG_BLK_DEV_ISAPNP is not set
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_DMA_NONPCI is not set

+# CONFIG_BLK_DEV_IDE_MODES is not set


+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set

+
+#
+# SCSI support
+#

+# CONFIG_SCSI is not set
+
+#


+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set

+# CONFIG_I2O_PROC is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set


+
+#
+# Input core support

+#
+# CONFIG_INPUT is not set


+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set

+
+#
+# Character devices
+#
+CONFIG_VT=y
+# CONFIG_VT_CONSOLE is not set
+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set

+# CONFIG_SERIAL_NONSTANDARD is not set


+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_ANAKIN is not set
+# CONFIG_SERIAL_ANAKIN_CONSOLE is not set

+# CONFIG_SERIAL_AMBA is not set
+# CONFIG_SERIAL_AMBA_CONSOLE is not set
+# CONFIG_SERIAL_CLPS711X is not set

+# CONFIG_SERIAL_CLPS711X_CONSOLE is not set


+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set

+CONFIG_SERIAL_SA1100=y
+CONFIG_SERIAL_SA1100_CONSOLE=y
+CONFIG_SA1100_DEFAULT_BAUDRATE=38400
+# CONFIG_SERIAL_8250 is not set

+# CONFIG_SERIAL_8250_CONSOLE is not set


+# CONFIG_SERIAL_8250_EXTENDED is not set
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_HUB6 is not set

+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=32
+CONFIG_UCB1200=y
+CONFIG_TOUCHSCREEN_UCB1200=y

+# CONFIG_CERF_TS_MANUAL is not set
+CONFIG_AUDIO_UCB1200=y
+# CONFIG_ADC_UCB1200 is not set
+# CONFIG_TOUCHSCREEN_H3600 is not set


+# CONFIG_PROFILER is not set
+# CONFIG_PFS168_SPI is not set
+# CONFIG_PFS168_DTMF is not set

+# CONFIG_PFS168_MISC is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#


+# L3 serial bus support
+#

+# CONFIG_L3 is not set
+# CONFIG_L3_ALGOBIT is not set
+# CONFIG_L3_BIT_SA1100_GPIO is not set
+# CONFIG_BIT_SA1100_UCB1200 is not set
+
+#


+# Other L3 adapters
+#
+# CONFIG_L3_SA1111 is not set
+

+#
+# L3 driver support
+#
+# CONFIG_L3_DRV_UDA1341 is not set
+# CONFIG_BIT_SA1100_GPIO is not set
+
+#


+# Mice
+#
+# CONFIG_BUSMOUSE is not set

+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#


+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#

+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#


+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set

+CONFIG_SA1100_RTC=y


+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set

+# CONFIG_SONYPI is not set
+
+#


+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set

+# CONFIG_DRM is not set
+
+#


+# PCMCIA character devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set

+# CONFIG_REISERFS_PROC_INFO is not set


+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set

+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set

+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_UMSDOS_FS=y


+CONFIG_VFAT_FS=y
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set

+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_CRAMFS is not set


+# CONFIG_TMPFS is not set
+CONFIG_RAMFS=y
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set

+# CONFIG_FREEVXFS_FS is not set


+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set

+CONFIG_ROMFS_FS=y


+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set

+# CONFIG_INTERMEZZO_FS is not set

+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_ROOT_NFS is not set


+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y

+CONFIG_LOCKD_V4=y

+# CONFIG_FB_ANAKIN is not set
+# CONFIG_FB_CLPS711X is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_SA1100=y

+# CONFIG_CERF_LCD_38_A is not set
+CONFIG_CERF_LCD_57_A=y
+# CONFIG_CERF_LCD_72_A is not set


+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FBCON_ADVANCED is not set
+CONFIG_FBCON_CFB2=y
+CONFIG_FBCON_CFB4=y
+CONFIG_FBCON_CFB8=y
+CONFIG_FBCON_CFB16=y

+# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
+# CONFIG_FBCON_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y


+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#

+# CONFIG_USB is not set
+
+#


+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+# CONFIG_USB_OHCI_SA1111 is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set

+# CONFIG_USB_DABUSB is not set

+
+#
+# USB Network adaptors
+#

+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set

+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set

+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set

+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set

+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#

+# Miscellaneous USB drivers


+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#

+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_NO_FRAME_POINTER is not set
+CONFIG_DEBUG_ERRORS=y

+CONFIG_DEBUG_USER=y


+# CONFIG_DEBUG_INFO is not set

+CONFIG_MAGIC_SYSRQ=y


+# CONFIG_NO_PGT_CACHE is not set
+# CONFIG_DEBUG_LL is not set
+# CONFIG_DEBUG_DC21285_PORT is not set
+# CONFIG_DEBUG_CLPS711X_UART2 is not set

diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/edb7211 linux/arch/arm/def-configs/edb7211
--- v2.4.13/linux/arch/arm/def-configs/edb7211 Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/def-configs/edb7211 Thu Oct 25 13:53:44 2001
@@ -0,0 +1,401 @@
+#
+# Automatically generated by make menuconfig: don't edit


+#
+CONFIG_ARM=y
+# CONFIG_EISA is not set
+# CONFIG_SBUS is not set
+# CONFIG_MCA is not set
+CONFIG_UID16=y

+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+# CONFIG_OBSOLETE is not set
+
+#
+# Loadable module support
+#

+# CONFIG_MODULES is not set


+
+#
+# System Type
+#

+# CONFIG_ARCH_ARCA5K is not set
+# CONFIG_ARCH_CLPS7500 is not set

+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set

+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_INTEGRATOR is not set

+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+CONFIG_ARCH_CLPS711X=y


+
+#
+# Archimedes/A5000 Implementations
+#
+
+#

+# Footbridge Implementations
+#
+
+#
+# SA11x0 Implementations
+#
+
+#
+# CLPS711X/EP721X Implementations
+#
+CONFIG_ARCH_EDB7211=y
+CONFIG_EP7211_BOOT_MODE=y


+# CONFIG_ARCH_P720T is not set

+# CONFIG_ARCH_ACORN is not set
+CONFIG_ARCH_EP7211=y


+# CONFIG_ARCH_EP7212 is not set

+# CONFIG_FOOTBRIDGE is not set
+# CONFIG_FOOTBRIDGE_HOST is not set
+# CONFIG_FOOTBRIDGE_ADDIN is not set
+CONFIG_CPU_32=y
+# CONFIG_CPU_26 is not set

+# CONFIG_CPU_32v3 is not set
+CONFIG_CPU_32v4=y
+# CONFIG_CPU_ARM610 is not set
+# CONFIG_CPU_ARM710 is not set

+CONFIG_CPU_ARM720T=y


+# CONFIG_CPU_ARM920T is not set
+# CONFIG_CPU_ARM1020 is not set
+# CONFIG_CPU_SA110 is not set

+# CONFIG_CPU_SA1100 is not set


+CONFIG_DISCONTIGMEM=y
+
+#
+# General setup
+#

+# CONFIG_ANGELBOOT is not set


+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_ISA_DMA is not set

+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set


+CONFIG_NET=y
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y

+CONFIG_NWFPE=y


+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set

+# CONFIG_ARTHUR is not set


+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Memory Technology Devices (MTD)
+#

+# CONFIG_MTD is not set


+
+#
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set

+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set

SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 03'
echo 'File patch-2.4.14 is continued in part 04'
echo "04" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:34 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part11

#!/bin/sh -x
# this is part 11 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 11; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+/* $Id: sparc-stub.c,v 1.28 2001/10/30 04:54:21 davem Exp $
X * sparc-stub.c: KGDB support for the Linux kernel.
X *
X * Modifications to run under Linux
@@ -330,17 +330,19 @@
X * to arrange for a "return 0" upon a memory fault
X */
X __asm__(
- "1: ldub [%0], %1
- inc %0
- .section .fixup,#alloc,#execinstr
- .align 4
- 2: retl
- mov 0, %%o0
- .section __ex_table, #alloc
- .align 4
- .word 1b, 2b
- .text"
- : "=r" (mem), "=r" (ch) : "0" (mem));
+ "\n1:\n\t"
+ "ldub [%0], %1\n\t"
+ "inc %0\n\t"
+ ".section .fixup,#alloc,#execinstr\n\t"
+ ".align 4\n"
+ "2:\n\t"
+ "retl\n\t"
+ " mov 0, %%o0\n\t"
+ ".section __ex_table, #alloc\n\t"
+ ".align 4\n\t"
+ ".word 1b, 2b\n\t"
+ ".text\n"
+ : "=r" (mem), "=r" (ch) : "0" (mem));
X *buf++ = hexchars[ch >> 4];
X *buf++ = hexchars[ch & 0xf];
X }
@@ -364,17 +366,19 @@
X ch |= hex(*buf++);
X /* Assembler code is *mem++ = ch; with return 0 on fault */
X __asm__(
- "1: stb %1, [%0]
- inc %0
- .section .fixup,#alloc,#execinstr
- .align 4
- 2: retl
- mov 0, %%o0
- .section __ex_table, #alloc
- .align 4
- .word 1b, 2b
- .text"
- : "=r" (mem) : "r" (ch) , "0" (mem));
+ "\n1:\n\t"
+ "stb %1, [%0]\n\t"
+ "inc %0\n\t"
+ ".section .fixup,#alloc,#execinstr\n\t"
+ ".align 4\n"
+ "2:\n\t"
+ "retl\n\t"
+ " mov 0, %%o0\n\t"
+ ".section __ex_table, #alloc\n\t"
+ ".align 4\n\t"
+ ".word 1b, 2b\n\t"
+ ".text\n"
+ : "=r" (mem) : "r" (ch) , "0" (mem));
X }
X return mem;
X }
@@ -715,14 +719,12 @@
X
X /* Again, watch those c-prefixes for ELF kernels */
X #if defined(__svr4__) || defined(__ELF__)
- asm(" .globl breakinst
-
- breakinst: ta 1
- ");
+ asm(".globl breakinst\n"
+ "breakinst:\n\t"
+ "ta 1\n");
X #else
- asm(" .globl _breakinst
-
- _breakinst: ta 1
- ");
+ asm(".globl _breakinst\n"
+ "_breakinst:\n\t"
+ "ta 1\n");
X #endif
X }
diff -u --recursive --new-file v2.4.13/linux/arch/sparc/kernel/time.c linux/arch/sparc/kernel/time.c
--- v2.4.13/linux/arch/sparc/kernel/time.c Mon Jan 22 13:30:20 2001
+++ linux/arch/sparc/kernel/time.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.58 2001/01/11 15:07:09 davem Exp $
+/* $Id: time.c,v 1.59 2001/10/30 04:54:21 davem Exp $
X * linux/arch/sparc/kernel/time.c


X *
X * Copyright (C) 1995 David S. Miller (da...@caip.rutgers.edu)

@@ -475,36 +475,39 @@
X * is guarenteed to be atomic, this is why we can run this
X * with interrupts on full blast. Don't touch this... -DaveM
X */
- __asm__ __volatile__("
- sethi %hi(master_l10_counter), %o1
- ld [%o1 + %lo(master_l10_counter)], %g3
- sethi %hi(xtime), %g2
-1: ldd [%g2 + %lo(xtime)], %o4
- ld [%g3], %o1
- ldd [%g2 + %lo(xtime)], %o2
- xor %o4, %o2, %o2
- xor %o5, %o3, %o3
- orcc %o2, %o3, %g0
- bne 1b
- cmp %o1, 0
- bge 1f
- srl %o1, 0xa, %o1
- sethi %hi(tick), %o3
- ld [%o3 + %lo(tick)], %o3
- sethi %hi(0x1fffff), %o2
- or %o2, %lo(0x1fffff), %o2
- add %o5, %o3, %o5
- and %o1, %o2, %o1
-1: add %o5, %o1, %o5
- sethi %hi(1000000), %o2
- or %o2, %lo(1000000), %o2
- cmp %o5, %o2
- bl,a 1f
- st %o4, [%o0 + 0x0]
- add %o4, 0x1, %o4
- sub %o5, %o2, %o5
- st %o4, [%o0 + 0x0]
-1: st %o5, [%o0 + 0x4]");
+ __asm__ __volatile__(
+ "sethi %hi(master_l10_counter), %o1\n\t"
+ "ld [%o1 + %lo(master_l10_counter)], %g3\n\t"
+ "sethi %hi(xtime), %g2\n"
+ "1:\n\t"
+ "ldd [%g2 + %lo(xtime)], %o4\n\t"
+ "ld [%g3], %o1\n\t"
+ "ldd [%g2 + %lo(xtime)], %o2\n\t"
+ "xor %o4, %o2, %o2\n\t"
+ "xor %o5, %o3, %o3\n\t"
+ "orcc %o2, %o3, %g0\n\t"
+ "bne 1b\n\t"
+ " cmp %o1, 0\n\t"
+ "bge 1f\n\t"
+ " srl %o1, 0xa, %o1\n\t"
+ "sethi %hi(tick), %o3\n\t"
+ "ld [%o3 + %lo(tick)], %o3\n\t"
+ "sethi %hi(0x1fffff), %o2\n\t"
+ "or %o2, %lo(0x1fffff), %o2\n\t"
+ "add %o5, %o3, %o5\n\t"
+ "and %o1, %o2, %o1\n"
+ "1:\n\t"
+ "add %o5, %o1, %o5\n\t"
+ "sethi %hi(1000000), %o2\n\t"
+ "or %o2, %lo(1000000), %o2\n\t"
+ "cmp %o5, %o2\n\t"
+ "bl,a 1f\n\t"
+ " st %o4, [%o0 + 0x0]\n\t"
+ "add %o4, 0x1, %o4\n\t"
+ "sub %o5, %o2, %o5\n\t"
+ "st %o4, [%o0 + 0x0]\n"
+ "1:\n\t"
+ "st %o5, [%o0 + 0x4]\n");
X }
X
X void do_settimeofday(struct timeval *tv)
diff -u --recursive --new-file v2.4.13/linux/arch/sparc/kernel/windows.c linux/arch/sparc/kernel/windows.c
--- v2.4.13/linux/arch/sparc/kernel/windows.c Tue Aug 31 11:23:29 1999
+++ linux/arch/sparc/kernel/windows.c Tue Oct 30 15:08:11 2001
@@ -19,17 +19,17 @@
X register int ctr asm("g5");
X
X ctr = 0;
- __asm__ __volatile__("
-1:
- ld [%%g6 + %2], %%g4
- orcc %%g0, %%g4, %%g0
- add %0, 1, %0
- bne 1b
- save %%sp, -64, %%sp
-2:
- subcc %0, 1, %0
- bne 2b
- restore %%g0, %%g0, %%g0"
+ __asm__ __volatile__(
+ "\n1:\n\t"
+ "ld [%%g6 + %2], %%g4\n\t"
+ "orcc %%g0, %%g4, %%g0\n\t"
+ "add %0, 1, %0\n\t"
+ "bne 1b\n\t"
+ " save %%sp, -64, %%sp\n"
+ "2:\n\t"
+ "subcc %0, 1, %0\n\t"
+ "bne 2b\n\t"
+ " restore %%g0, %%g0, %%g0\n"
X : "=&r" (ctr)
X : "0" (ctr),
X "i" ((const unsigned long)(&(((struct task_struct *)0)->thread.uwinmask)))
diff -u --recursive --new-file v2.4.13/linux/arch/sparc/mm/fault.c linux/arch/sparc/mm/fault.c
--- v2.4.13/linux/arch/sparc/mm/fault.c Sun Aug 12 13:27:59 2001
+++ linux/arch/sparc/mm/fault.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: fault.c,v 1.120 2001/07/18 13:40:05 anton Exp $
+/* $Id: fault.c,v 1.121 2001/10/30 04:54:22 davem Exp $
X * fault.c: Page fault handlers for the Sparc.


X *
X * Copyright (C) 1995 David S. Miller (da...@caip.rutgers.edu)

@@ -177,11 +177,11 @@
X memset (&regs, 0, sizeof (regs));
X regs.pc = pc;
X regs.npc = pc + 4;
- __asm__ __volatile__ ("
- rd %%psr, %0
- nop
- nop
- nop" : "=r" (regs.psr));
+ __asm__ __volatile__ (
+ "rd %%psr, %0\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ "nop\n" : "=r" (regs.psr));
X unhandled_fault (address, current, &regs);
X /* Not reached */
X return 0;
diff -u --recursive --new-file v2.4.13/linux/arch/sparc/mm/srmmu.c linux/arch/sparc/mm/srmmu.c
--- v2.4.13/linux/arch/sparc/mm/srmmu.c Sun Sep 23 11:40:56 2001
+++ linux/arch/sparc/mm/srmmu.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: srmmu.c,v 1.231 2001/09/20 00:35:31 davem Exp $
+/* $Id: srmmu.c,v 1.232 2001/10/30 04:54:22 davem Exp $
X * srmmu.c: SRMMU specific routines for memory management.


X *
X * Copyright (C) 1995 David S. Miller (da...@caip.rutgers.edu)

@@ -393,6 +393,7 @@
X static pte_t *srmmu_pte_alloc_one(struct mm_struct *mm, unsigned long address)
X {
X BUG();
+ return NULL;
X }
X
X static void srmmu_free_pte_fast(pte_t *pte)
@@ -812,11 +813,11 @@
X static void cypress_flush_tlb_mm(struct mm_struct *mm)
X {
X FLUSH_BEGIN(mm)
- __asm__ __volatile__("
- lda [%0] %3, %%g5
- sta %2, [%0] %3
- sta %%g0, [%1] %4
- sta %%g5, [%0] %3"
+ __asm__ __volatile__(
+ "lda [%0] %3, %%g5\n\t"
+ "sta %2, [%0] %3\n\t"
+ "sta %%g0, [%1] %4\n\t"
+ "sta %%g5, [%0] %3\n"
X : /* no outputs */
X : "r" (SRMMU_CTX_REG), "r" (0x300), "r" (mm->context),
X "i" (ASI_M_MMUREGS), "i" (ASI_M_FLUSH_PROBE)
@@ -831,13 +832,14 @@
X FLUSH_BEGIN(mm)
X start &= SRMMU_PGDIR_MASK;
X size = SRMMU_PGDIR_ALIGN(end) - start;
- __asm__ __volatile__("
- lda [%0] %5, %%g5
- sta %1, [%0] %5
- 1: subcc %3, %4, %3
- bne 1b
- sta %%g0, [%2 + %3] %6
- sta %%g5, [%0] %5"
+ __asm__ __volatile__(
+ "lda [%0] %5, %%g5\n\t"
+ "sta %1, [%0] %5\n"
+ "1:\n\t"
+ "subcc %3, %4, %3\n\t"
+ "bne 1b\n\t"
+ " sta %%g0, [%2 + %3] %6\n\t"
+ "sta %%g5, [%0] %5\n"
X : /* no outputs */
X : "r" (SRMMU_CTX_REG), "r" (mm->context), "r" (start | 0x200),
X "r" (size), "r" (SRMMU_PGDIR_SIZE), "i" (ASI_M_MMUREGS),
@@ -851,11 +853,11 @@
X struct mm_struct *mm = vma->vm_mm;
X
X FLUSH_BEGIN(mm)
- __asm__ __volatile__("
- lda [%0] %3, %%g5
- sta %1, [%0] %3
- sta %%g0, [%2] %4
- sta %%g5, [%0] %3"
+ __asm__ __volatile__(
+ "lda [%0] %3, %%g5\n\t"
+ "sta %1, [%0] %3\n\t"
+ "sta %%g0, [%2] %4\n\t"
+ "sta %%g5, [%0] %3\n"
X : /* no outputs */
X : "r" (SRMMU_CTX_REG), "r" (mm->context), "r" (page & PAGE_MASK),
X "i" (ASI_M_MMUREGS), "i" (ASI_M_FLUSH_PROBE)
diff -u --recursive --new-file v2.4.13/linux/arch/sparc/mm/sun4c.c linux/arch/sparc/mm/sun4c.c
--- v2.4.13/linux/arch/sparc/mm/sun4c.c Wed Jul 25 17:10:19 2001
+++ linux/arch/sparc/mm/sun4c.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: sun4c.c,v 1.207 2001/07/17 16:17:33 anton Exp $
+/* $Id: sun4c.c,v 1.208 2001/10/30 04:54:22 davem Exp $
X * sun4c.c: Doing in software what should be done in hardware.
X *
X * Copyright (C) 1996 David S. Miller (da...@caip.rutgers.edu)
@@ -135,25 +135,26 @@
X unsigned long nbytes = SUN4C_VAC_SIZE;
X unsigned long lsize = sun4c_vacinfo.linesize;
X
- __asm__ __volatile__("
- add %2, %2, %%g1
- add %2, %%g1, %%g2
- add %2, %%g2, %%g3
- add %2, %%g3, %%g4
- add %2, %%g4, %%g5
- add %2, %%g5, %%o4
- add %2, %%o4, %%o5
-1: subcc %0, %%o5, %0
- sta %%g0, [%0] %3
- sta %%g0, [%0 + %2] %3
- sta %%g0, [%0 + %%g1] %3
- sta %%g0, [%0 + %%g2] %3
- sta %%g0, [%0 + %%g3] %3
- sta %%g0, [%0 + %%g4] %3
- sta %%g0, [%0 + %%g5] %3
- bg 1b
- sta %%g0, [%1 + %%o4] %3
-" : "=&r" (nbytes)
+ __asm__ __volatile__(
+ "add %2, %2, %%g1\n\t"
+ "add %2, %%g1, %%g2\n\t"
+ "add %2, %%g2, %%g3\n\t"
+ "add %2, %%g3, %%g4\n\t"
+ "add %2, %%g4, %%g5\n\t"
+ "add %2, %%g5, %%o4\n\t"
+ "add %2, %%o4, %%o5\n"
+ "1:\n\t"
+ "subcc %0, %%o5, %0\n\t"
+ "sta %%g0, [%0] %3\n\t"
+ "sta %%g0, [%0 + %2] %3\n\t"
+ "sta %%g0, [%0 + %%g1] %3\n\t"
+ "sta %%g0, [%0 + %%g2] %3\n\t"
+ "sta %%g0, [%0 + %%g3] %3\n\t"
+ "sta %%g0, [%0 + %%g4] %3\n\t"
+ "sta %%g0, [%0 + %%g5] %3\n\t"
+ "bg 1b\n\t"
+ " sta %%g0, [%1 + %%o4] %3\n"
+ : "=&r" (nbytes)
X : "0" (nbytes), "r" (lsize), "i" (ASI_FLUSHCTX)
X : "g1", "g2", "g3", "g4", "g5", "o4", "o5", "cc");
X }
@@ -165,26 +166,27 @@
X unsigned long nbytes = SUN4C_VAC_SIZE;
X unsigned long lsize = sun4c_vacinfo.linesize;
X
- __asm__ __volatile__("
- add %2, %2, %%g1
- add %2, %%g1, %%g2
- add %2, %%g2, %%g3
- add %2, %%g3, %%g4
- add %2, %%g4, %%g5
- add %2, %%g5, %%o4
- add %2, %%o4, %%o5
-1: subcc %1, %%o5, %1
- sta %%g0, [%0] %6
- sta %%g0, [%0 + %2] %6
- sta %%g0, [%0 + %%g1] %6
- sta %%g0, [%0 + %%g2] %6
- sta %%g0, [%0 + %%g3] %6
- sta %%g0, [%0 + %%g4] %6
- sta %%g0, [%0 + %%g5] %6
- sta %%g0, [%0 + %%o4] %6
- bg 1b
- add %0, %%o5, %0
-" : "=&r" (addr), "=&r" (nbytes), "=&r" (lsize)
+ __asm__ __volatile__(
+ "add %2, %2, %%g1\n\t"
+ "add %2, %%g1, %%g2\n\t"
+ "add %2, %%g2, %%g3\n\t"
+ "add %2, %%g3, %%g4\n\t"
+ "add %2, %%g4, %%g5\n\t"
+ "add %2, %%g5, %%o4\n\t"
+ "add %2, %%o4, %%o5\n"
+ "1:\n\t"
+ "subcc %1, %%o5, %1\n\t"
+ "sta %%g0, [%0] %6\n\t"
+ "sta %%g0, [%0 + %2] %6\n\t"
+ "sta %%g0, [%0 + %%g1] %6\n\t"
+ "sta %%g0, [%0 + %%g2] %6\n\t"
+ "sta %%g0, [%0 + %%g3] %6\n\t"
+ "sta %%g0, [%0 + %%g4] %6\n\t"
+ "sta %%g0, [%0 + %%g5] %6\n\t"
+ "sta %%g0, [%0 + %%o4] %6\n\t"
+ "bg 1b\n\t"
+ " add %0, %%o5, %0\n"
+ : "=&r" (addr), "=&r" (nbytes), "=&r" (lsize)
X : "0" (addr), "1" (nbytes), "2" (lsize),
X "i" (ASI_FLUSHSEG)
X : "g1", "g2", "g3", "g4", "g5", "o4", "o5", "cc");
@@ -242,26 +244,27 @@
X unsigned long left = PAGE_SIZE;
X unsigned long lsize = sun4c_vacinfo.linesize;
X
- __asm__ __volatile__("
- add %2, %2, %%g1
- add %2, %%g1, %%g2
- add %2, %%g2, %%g3
- add %2, %%g3, %%g4
- add %2, %%g4, %%g5
- add %2, %%g5, %%o4
- add %2, %%o4, %%o5
-1: subcc %1, %%o5, %1
- sta %%g0, [%0] %6
- sta %%g0, [%0 + %2] %6
- sta %%g0, [%0 + %%g1] %6
- sta %%g0, [%0 + %%g2] %6
- sta %%g0, [%0 + %%g3] %6
- sta %%g0, [%0 + %%g4] %6
- sta %%g0, [%0 + %%g5] %6
- sta %%g0, [%0 + %%o4] %6
- bg 1b
- add %0, %%o5, %0
-" : "=&r" (addr), "=&r" (left), "=&r" (lsize)
+ __asm__ __volatile__(
+ "add %2, %2, %%g1\n\t"
+ "add %2, %%g1, %%g2\n\t"
+ "add %2, %%g2, %%g3\n\t"
+ "add %2, %%g3, %%g4\n\t"
+ "add %2, %%g4, %%g5\n\t"
+ "add %2, %%g5, %%o4\n\t"
+ "add %2, %%o4, %%o5\n"
+ "1:\n\t"
+ "subcc %1, %%o5, %1\n\t"
+ "sta %%g0, [%0] %6\n\t"
+ "sta %%g0, [%0 + %2] %6\n\t"
+ "sta %%g0, [%0 + %%g1] %6\n\t"
+ "sta %%g0, [%0 + %%g2] %6\n\t"
+ "sta %%g0, [%0 + %%g3] %6\n\t"
+ "sta %%g0, [%0 + %%g4] %6\n\t"
+ "sta %%g0, [%0 + %%g5] %6\n\t"
+ "sta %%g0, [%0 + %%o4] %6\n\t"
+ "bg 1b\n\t"
+ " add %0, %%o5, %0\n"
+ : "=&r" (addr), "=&r" (left), "=&r" (lsize)
X : "0" (addr), "1" (left), "2" (lsize),
X "i" (ASI_FLUSHPG)
X : "g1", "g2", "g3", "g4", "g5", "o4", "o5", "cc");
@@ -1402,46 +1405,46 @@
X
X if (sun4c_vacinfo.linesize == 32) {
X while (begin < end) {
- __asm__ __volatile__("
- ld [%0 + 0x00], %%g0
- ld [%0 + 0x20], %%g0
- ld [%0 + 0x40], %%g0
- ld [%0 + 0x60], %%g0
- ld [%0 + 0x80], %%g0
- ld [%0 + 0xa0], %%g0
- ld [%0 + 0xc0], %%g0
- ld [%0 + 0xe0], %%g0
- ld [%0 + 0x100], %%g0
- ld [%0 + 0x120], %%g0
- ld [%0 + 0x140], %%g0
- ld [%0 + 0x160], %%g0
- ld [%0 + 0x180], %%g0
- ld [%0 + 0x1a0], %%g0
- ld [%0 + 0x1c0], %%g0
- ld [%0 + 0x1e0], %%g0
- " : : "r" (begin));
+ __asm__ __volatile__(
+ "ld [%0 + 0x00], %%g0\n\t"
+ "ld [%0 + 0x20], %%g0\n\t"
+ "ld [%0 + 0x40], %%g0\n\t"
+ "ld [%0 + 0x60], %%g0\n\t"
+ "ld [%0 + 0x80], %%g0\n\t"
+ "ld [%0 + 0xa0], %%g0\n\t"
+ "ld [%0 + 0xc0], %%g0\n\t"
+ "ld [%0 + 0xe0], %%g0\n\t"
+ "ld [%0 + 0x100], %%g0\n\t"
+ "ld [%0 + 0x120], %%g0\n\t"
+ "ld [%0 + 0x140], %%g0\n\t"
+ "ld [%0 + 0x160], %%g0\n\t"
+ "ld [%0 + 0x180], %%g0\n\t"
+ "ld [%0 + 0x1a0], %%g0\n\t"
+ "ld [%0 + 0x1c0], %%g0\n\t"
+ "ld [%0 + 0x1e0], %%g0\n"
+ : : "r" (begin));
X begin += 512;
X }
X } else {
X while (begin < end) {
- __asm__ __volatile__("
- ld [%0 + 0x00], %%g0
- ld [%0 + 0x10], %%g0
- ld [%0 + 0x20], %%g0
- ld [%0 + 0x30], %%g0
- ld [%0 + 0x40], %%g0
- ld [%0 + 0x50], %%g0
- ld [%0 + 0x60], %%g0
- ld [%0 + 0x70], %%g0
- ld [%0 + 0x80], %%g0
- ld [%0 + 0x90], %%g0
- ld [%0 + 0xa0], %%g0
- ld [%0 + 0xb0], %%g0
- ld [%0 + 0xc0], %%g0
- ld [%0 + 0xd0], %%g0
- ld [%0 + 0xe0], %%g0
- ld [%0 + 0xf0], %%g0
- " : : "r" (begin));
+ __asm__ __volatile__(
+ "ld [%0 + 0x00], %%g0\n\t"
+ "ld [%0 + 0x10], %%g0\n\t"
+ "ld [%0 + 0x20], %%g0\n\t"
+ "ld [%0 + 0x30], %%g0\n\t"
+ "ld [%0 + 0x40], %%g0\n\t"
+ "ld [%0 + 0x50], %%g0\n\t"
+ "ld [%0 + 0x60], %%g0\n\t"
+ "ld [%0 + 0x70], %%g0\n\t"
+ "ld [%0 + 0x80], %%g0\n\t"
+ "ld [%0 + 0x90], %%g0\n\t"
+ "ld [%0 + 0xa0], %%g0\n\t"
+ "ld [%0 + 0xb0], %%g0\n\t"
+ "ld [%0 + 0xc0], %%g0\n\t"
+ "ld [%0 + 0xd0], %%g0\n\t"
+ "ld [%0 + 0xe0], %%g0\n\t"
+ "ld [%0 + 0xf0], %%g0\n"
+ : : "r" (begin));
X begin += 256;
X }
X }
diff -u --recursive --new-file v2.4.13/linux/arch/sparc/prom/console.c linux/arch/sparc/prom/console.c
--- v2.4.13/linux/arch/sparc/prom/console.c Tue May 1 20:59:24 2001
+++ linux/arch/sparc/prom/console.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: console.c,v 1.24 2001/04/27 07:02:42 davem Exp $
+/* $Id: console.c,v 1.25 2001/10/30 04:54:22 davem Exp $
X * console.c: Routines that deal with sending and receiving IO
X * to/from the current console device using the PROM.
X *
@@ -207,6 +207,7 @@
X }
X break;
X default:
- }
+ ;
+ };
X return PROMDEV_O_UNK;
X }
diff -u --recursive --new-file v2.4.13/linux/arch/sparc64/defconfig linux/arch/sparc64/defconfig
--- v2.4.13/linux/arch/sparc64/defconfig Tue Oct 23 22:48:50 2001
+++ linux/arch/sparc64/defconfig Tue Oct 30 15:08:11 2001
@@ -172,8 +172,10 @@
X # Networking options
X #
X CONFIG_PACKET=y


-# CONFIG_PACKET_MMAP is not set
-# CONFIG_NETLINK is not set

+CONFIG_PACKET_MMAP=y
+CONFIG_NETLINK=y
+CONFIG_RTNETLINK=y
+CONFIG_NETLINK_DEV=y
X # CONFIG_NETFILTER is not set
X # CONFIG_FILTER is not set
X CONFIG_UNIX=y
@@ -183,11 +185,13 @@
X # CONFIG_IP_PNP is not set
X # CONFIG_NET_IPIP is not set
X # CONFIG_NET_IPGRE is not set
+CONFIG_ARPD=y
X CONFIG_INET_ECN=y
X # CONFIG_SYN_COOKIES is not set


X CONFIG_IPV6=m
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set

+CONFIG_VLAN_8021Q=m


X
X #
X #

@@ -411,6 +415,7 @@
X CONFIG_BONDING=m
X CONFIG_EQUALIZER=m
X CONFIG_TUN=m
+# CONFIG_ETHERTAP is not set
X
X #
X # Ethernet (10 or 100Mbit)
@@ -453,6 +458,7 @@
X CONFIG_NE2K_PCI=m


X # CONFIG_NE3210 is not set
X # CONFIG_ES3210 is not set
+# CONFIG_8139CP is not set

X CONFIG_8139TOO=m


X # CONFIG_8139TOO_PIO is not set
X # CONFIG_8139TOO_TUNE_TWISTER is not set

@@ -566,7 +572,7 @@


X CONFIG_EFS_FS=m
X # CONFIG_JFFS_FS is not set

X # CONFIG_JFFS2_FS is not set
-CONFIG_CRAMFS=m
+# CONFIG_CRAMFS is not set


X # CONFIG_TMPFS is not set

X CONFIG_RAMFS=m
X CONFIG_ISO9660_FS=m
diff -u --recursive --new-file v2.4.13/linux/arch/sparc64/kernel/ioctl32.c linux/arch/sparc64/kernel/ioctl32.c
--- v2.4.13/linux/arch/sparc64/kernel/ioctl32.c Tue Oct 23 22:48:50 2001
+++ linux/arch/sparc64/kernel/ioctl32.c Sun Nov 4 09:31:57 2001
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.126 2001/10/18 11:41:02 davem Exp $
+/* $Id: ioctl32.c,v 1.127 2001/11/01 23:54:19 davem Exp $
X * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
X *
X * Copyright (C) 1997-2000 Jakub Jelinek (ja...@redhat.com)
@@ -592,44 +592,6 @@
X return err;
X }
X
-static int mii_ioctl(unsigned long fd, unsigned int cmd, unsigned long arg)
-{
- struct ifreq ifr;
- mm_segment_t old_fs;
- int err;
- u32 data;
-
- if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32)))
- return -EFAULT;
- ifr.ifr_data = (__kernel_caddr_t) kmalloc(sizeof(struct mii_ioctl_data),
- GFP_KERNEL);
- if (!ifr.ifr_data)
- return -EAGAIN;
-
- __get_user(data, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_data));
- if (copy_from_user(ifr.ifr_data, (char *)A(data),
- sizeof(struct mii_ioctl_data))) {
- err = -EFAULT;
- goto out;
- }
-
- old_fs = get_fs();
- set_fs(KERNEL_DS);
- err = sys_ioctl(fd, cmd, (unsigned long)&ifr);
- set_fs(old_fs);
-
- if (!err) {
- if (copy_to_user((char *)A(data),
- ifr.ifr_data,
- sizeof(struct mii_ioctl_data)))
- err = -EFAULT;
- }
-
-out:
- kfree(ifr.ifr_data);
- return err;
-}
-
X static inline int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long arg)
X {
X struct ifreq ifr;
@@ -4102,6 +4064,9 @@
X COMPATIBLE_IOCTL(SIOCDRARP)
X COMPATIBLE_IOCTL(SIOCADDDLCI)
X COMPATIBLE_IOCTL(SIOCDELDLCI)
+COMPATIBLE_IOCTL(SIOCGMIIPHY)
+COMPATIBLE_IOCTL(SIOCGMIIREG)
+COMPATIBLE_IOCTL(SIOCSMIIREG)
X /* SG stuff */
X COMPATIBLE_IOCTL(SG_SET_TIMEOUT)
X COMPATIBLE_IOCTL(SG_GET_TIMEOUT)
@@ -4523,9 +4488,6 @@
X HANDLE_IOCTL(SIOCGIFTXQLEN, dev_ifsioc)
X HANDLE_IOCTL(SIOCSIFTXQLEN, dev_ifsioc)
X HANDLE_IOCTL(SIOCETHTOOL, ethtool_ioctl)
-HANDLE_IOCTL(SIOCGMIIPHY, mii_ioctl)
-HANDLE_IOCTL(SIOCGMIIREG, mii_ioctl)
-HANDLE_IOCTL(SIOCSMIIREG, mii_ioctl)
X HANDLE_IOCTL(SIOCADDRT, routing_ioctl)
X HANDLE_IOCTL(SIOCDELRT, routing_ioctl)
X /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
diff -u --recursive --new-file v2.4.13/linux/arch/sparc64/kernel/setup.c linux/arch/sparc64/kernel/setup.c
--- v2.4.13/linux/arch/sparc64/kernel/setup.c Tue Oct 23 22:48:50 2001
+++ linux/arch/sparc64/kernel/setup.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.69 2001/10/18 09:40:00 davem Exp $
+/* $Id: setup.c,v 1.70 2001/10/25 18:48:03 davem Exp $
X * linux/arch/sparc64/kernel/setup.c
X *
X * Copyright (C) 1995,1996 David S. Miller (da...@caip.rutgers.edu)
@@ -195,7 +195,14 @@
X pgd_t *pgdp;
X pmd_t *pmdp;
X pte_t *ptep;
+ int error;
X
+ if ((va >= LOW_OBP_ADDRESS) && (va < HI_OBP_ADDRESS)) {
+ tte = prom_virt_to_phys(va, &error);
+ if (!error)
+ res = PROM_TRUE;
+ goto done;
+ }
X pgdp = pgd_offset_k(va);
X if (pgd_none(*pgdp))
X goto done;
diff -u --recursive --new-file v2.4.13/linux/arch/sparc64/kernel/smp.c linux/arch/sparc64/kernel/smp.c
--- v2.4.13/linux/arch/sparc64/kernel/smp.c Tue Oct 23 22:48:50 2001
+++ linux/arch/sparc64/kernel/smp.c Tue Oct 30 15:08:11 2001
@@ -585,14 +585,12 @@
X extern unsigned long xcall_flush_dcache_page_cheetah;
X extern unsigned long xcall_flush_dcache_page_spitfire;
X
-static spinlock_t dcache_xcall_lock = SPIN_LOCK_UNLOCKED;
-static struct page *dcache_page;
X #ifdef DCFLUSH_DEBUG
X extern atomic_t dcpage_flushes;
X extern atomic_t dcpage_flushes_xcall;
X #endif
X
-static __inline__ void __smp_flush_dcache_page_client(struct page *page)
+static __inline__ void __local_flush_dcache_page(struct page *page)
X {
X #if (L1DCACHE_SIZE > PAGE_SIZE)
X __flush_dcache_page(page->virtual,
@@ -605,37 +603,31 @@
X #endif
X }
X
-void smp_flush_dcache_page_client(void)
-{
- __smp_flush_dcache_page_client(dcache_page);
- spin_unlock(&dcache_xcall_lock);
-}
-
-void smp_flush_dcache_page_impl(struct page *page)
+void smp_flush_dcache_page_impl(struct page *page, int cpu)
X {
X if (smp_processors_ready) {
- int cpu = dcache_dirty_cpu(page);
X unsigned long mask = 1UL << cpu;
X
X #ifdef DCFLUSH_DEBUG
X atomic_inc(&dcpage_flushes);
X #endif
X if (cpu == smp_processor_id()) {
- __smp_flush_dcache_page_client(page);
+ __local_flush_dcache_page(page);
X } else if ((cpu_present_map & mask) != 0) {
X u64 data0;
X
X if (tlb_type == spitfire) {
- spin_lock(&dcache_xcall_lock);
- dcache_page = page;
X data0 = ((u64)&xcall_flush_dcache_page_spitfire);
- spitfire_xcall_deliver(data0, 0, 0, mask);
- /* Target cpu drops dcache_xcall_lock. */
+ if (page->mapping != NULL)
+ data0 |= ((u64)1 << 32);
+ spitfire_xcall_deliver(data0,
+ __pa(page->virtual),
+ (u64) page->virtual,
+ mask);
X } else {
- /* Look mom, no locks... */
X data0 = ((u64)&xcall_flush_dcache_page_cheetah);
X cheetah_xcall_deliver(data0,
- (u64) page->virtual,
+ __pa(page->virtual),
X 0, mask);
X }
X #ifdef DCFLUSH_DEBUG
diff -u --recursive --new-file v2.4.13/linux/arch/sparc64/kernel/sparc64_ksyms.c linux/arch/sparc64/kernel/sparc64_ksyms.c
--- v2.4.13/linux/arch/sparc64/kernel/sparc64_ksyms.c Tue Oct 23 22:48:50 2001
+++ linux/arch/sparc64/kernel/sparc64_ksyms.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: sparc64_ksyms.c,v 1.113 2001/10/17 18:26:58 davem Exp $
+/* $Id: sparc64_ksyms.c,v 1.116 2001/10/26 15:49:21 davem Exp $
X * arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support.
X *
X * Copyright (C) 1996 David S. Miller (da...@caip.rutgers.edu)
@@ -126,7 +126,9 @@
X
X /* Hard IRQ locking */
X EXPORT_SYMBOL(global_irq_holder);
+#ifdef CONFIG_SMP
X EXPORT_SYMBOL(synchronize_irq);
+#endif
X EXPORT_SYMBOL(__global_cli);
X EXPORT_SYMBOL(__global_sti);
X EXPORT_SYMBOL(__global_save_flags);
@@ -136,7 +138,9 @@
X EXPORT_SYMBOL(cpu_data);
X
X /* Misc SMP information */
+#ifdef CONFIG_SMP
X EXPORT_SYMBOL(smp_num_cpus);
+#endif
X EXPORT_SYMBOL(__cpu_number_map);
X EXPORT_SYMBOL(__cpu_logical_map);
X
@@ -151,7 +155,9 @@
X EXPORT_SYMBOL(_do_write_unlock);
X #endif
X
+#ifdef CONFIG_SMP
X EXPORT_SYMBOL(smp_call_function);
+#endif
X
X #endif
X
@@ -307,8 +313,6 @@
X EXPORT_SYMBOL(sys_ioctl);
X EXPORT_SYMBOL(sys32_ioctl);
X EXPORT_SYMBOL(sparc32_open);
-EXPORT_SYMBOL(move_addr_to_kernel);
-EXPORT_SYMBOL(move_addr_to_user);
X #endif
X
X /* Special internal versions of library functions. */
diff -u --recursive --new-file v2.4.13/linux/arch/sparc64/kernel/sys_sparc.c linux/arch/sparc64/kernel/sys_sparc.c
--- v2.4.13/linux/arch/sparc64/kernel/sys_sparc.c Fri Apr 13 20:15:55 2001
+++ linux/arch/sparc64/kernel/sys_sparc.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc.c,v 1.52 2001/04/14 01:12:02 davem Exp $
+/* $Id: sys_sparc.c,v 1.54 2001/10/28 20:49:13 davem Exp $
X * linux/arch/sparc64/kernel/sys_sparc.c
X *
X * This file contains various random system calls that
@@ -255,13 +255,27 @@
X
X asmlinkage int sparc64_personality(unsigned long personality)
X {
- int ret;
- if (current->personality == PER_LINUX32 && personality == PER_LINUX)
- personality = PER_LINUX32;
- ret = sys_personality(personality);
- if (ret == PER_LINUX32)
+ unsigned long ret, trying, orig_ret;
+
+ trying = ret = personality;
+
+ if (current->personality == PER_LINUX32 &&
+ trying == PER_LINUX)
+ trying = ret = PER_LINUX32;
+
+ /* For PER_LINUX32 we want to retain &default_exec_domain. */
+ if (trying == PER_LINUX32)
X ret = PER_LINUX;
- return ret;
+
+ orig_ret = ret;
+ ret = sys_personality(ret);
+
+ if (orig_ret == PER_LINUX && trying == PER_LINUX32) {
+ current->personality = PER_LINUX32;
+ ret = PER_LINUX;
+ }
+
+ return (int) ret;
X }
X
X /* Linux version of mmap */
diff -u --recursive --new-file v2.4.13/linux/arch/sparc64/mm/init.c linux/arch/sparc64/mm/init.c
--- v2.4.13/linux/arch/sparc64/mm/init.c Tue Oct 23 22:48:50 2001
+++ linux/arch/sparc64/mm/init.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.194 2001/10/17 18:26:58 davem Exp $
+/* $Id: init.c,v 1.199 2001/10/25 18:48:03 davem Exp $
X * arch/sparc64/mm/init.c
X *
X * Copyright (C) 1996-1999 David S. Miller (da...@caip.rutgers.edu)
@@ -132,21 +132,69 @@
X #endif
X }
X
+#define PG_dcache_dirty PG_arch_1
+
+#define dcache_dirty_cpu(page) \
+ (((page)->flags >> 24) & (NR_CPUS - 1UL))
+
+static __inline__ void set_dcache_dirty(struct page *page)
+{
+ unsigned long mask = smp_processor_id();
+ unsigned long non_cpu_bits = (1UL << 24UL) - 1UL;
+ mask = (mask << 24) | (1UL << PG_dcache_dirty);
+ __asm__ __volatile__("1:\n\t"
+ "ldx [%2], %%g7\n\t"
+ "and %%g7, %1, %%g5\n\t"
+ "or %%g5, %0, %%g5\n\t"
+ "casx [%2], %%g7, %%g5\n\t"
+ "cmp %%g7, %%g5\n\t"
+ "bne,pn %%xcc, 1b\n\t"
+ " nop"
+ : /* no outputs */
+ : "r" (mask), "r" (non_cpu_bits), "r" (&page->flags)
+ : "g5", "g7");
+}
+
+static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long cpu)
+{
+ unsigned long mask = (1UL << PG_dcache_dirty);
+
+ __asm__ __volatile__("! test_and_clear_dcache_dirty\n"
+ "1:\n\t"
+ "ldx [%2], %%g7\n\t"
+ "srlx %%g7, 24, %%g5\n\t"
+ "cmp %%g5, %0\n\t"
+ "bne,pn %%icc, 2f\n\t"
+ " andn %%g7, %1, %%g5\n\t"
+ "casx [%2], %%g7, %%g5\n\t"
+ "cmp %%g7, %%g5\n\t"
+ "bne,pn %%xcc, 1b\n\t"
+ " nop\n"
+ "2:"
+ : /* no outputs */
+ : "r" (cpu), "r" (mask), "r" (&page->flags)
+ : "g5", "g7");
+}
+
X void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
X {
X struct page *page = pte_page(pte);
+ unsigned long pg_flags;
+
+ if (VALID_PAGE(page) &&
+ page->mapping &&
+ ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) {
+ int cpu = (pg_flags >> 24);
X
- if (VALID_PAGE(page) && page->mapping &&
- test_bit(PG_dcache_dirty, &page->flags)) {
X /* This is just to optimize away some function calls
X * in the SMP case.
X */
- if (dcache_dirty_cpu(page) == smp_processor_id())
+ if (cpu == smp_processor_id())
X flush_dcache_page_impl(page);
X else
- smp_flush_dcache_page_impl(page);
+ smp_flush_dcache_page_impl(page, cpu);
X
- clear_dcache_dirty(page);
+ clear_dcache_dirty_cpu(page, cpu);
X }
X __update_mmu_cache(vma, address, pte);
X }
@@ -162,7 +210,7 @@
X if (dirty) {
X if (dirty_cpu == smp_processor_id())
X return;
- smp_flush_dcache_page_impl(page);
+ smp_flush_dcache_page_impl(page, dirty_cpu);
X }
X set_dcache_dirty(page);
X } else {
@@ -244,12 +292,44 @@
X prom_halt();
X }
X
+#define BASE_PAGE_SIZE 8192
+static pmd_t *prompmd;
+
+/*
+ * Translate PROM's mapping we capture at boot time into physical address.
+ * The second parameter is only set from prom_callback() invocations.
+ */
+unsigned long prom_virt_to_phys(unsigned long promva, int *error)
+{
+ pmd_t *pmdp = prompmd + ((promva >> 23) & 0x7ff);
+ pte_t *ptep;
+ unsigned long base;
+
+ if (pmd_none(*pmdp)) {
+ if (error)
+ *error = 1;
+ return(0);
+ }
+ ptep = (pte_t *)pmd_page(*pmdp) + ((promva >> 13) & 0x3ff);
+ if (!pte_present(*ptep)) {
+ if (error)
+ *error = 1;
+ return(0);
+ }
+ if (error) {
+ *error = 0;
+ return(pte_val(*ptep));
+ }
+ base = pte_val(*ptep) & _PAGE_PADDR;
+ return(base + (promva & (BASE_PAGE_SIZE - 1)));
+}
+
X static void inherit_prom_mappings(void)
X {
X struct linux_prom_translation *trans;
X unsigned long phys_page, tte_vaddr, tte_data;
X void (*remap_func)(unsigned long, unsigned long, int);
- pmd_t *pmdp, *pmd;
+ pmd_t *pmdp;
X pte_t *ptep;
X int node, n, i, tsz;
X extern unsigned int obp_iaddr_patch[2], obp_daddr_patch[2];
@@ -283,21 +363,21 @@
X * in inherit_locked_prom_mappings()).
X */
X #define OBP_PMD_SIZE 2048
-#define BASE_PAGE_SIZE 8192
- pmd = __alloc_bootmem(OBP_PMD_SIZE, OBP_PMD_SIZE, 0UL);
- if (pmd == NULL)
+ prompmd = __alloc_bootmem(OBP_PMD_SIZE, OBP_PMD_SIZE, 0UL);
+ if (prompmd == NULL)
X early_pgtable_allocfail("pmd");
- memset(pmd, 0, OBP_PMD_SIZE);
+ memset(prompmd, 0, OBP_PMD_SIZE);
X for (i = 0; i < n; i++) {
X unsigned long vaddr;
X
- if (trans[i].virt >= 0xf0000000 && trans[i].virt < 0x100000000) {
+ if (trans[i].virt >= LOW_OBP_ADDRESS && trans[i].virt < HI_OBP_ADDRESS) {
X for (vaddr = trans[i].virt;
- vaddr < trans[i].virt + trans[i].size;
+ ((vaddr < trans[i].virt + trans[i].size) &&
+ (vaddr < HI_OBP_ADDRESS));
X vaddr += BASE_PAGE_SIZE) {
X unsigned long val;
X
- pmdp = pmd + ((vaddr >> 23) & 0x7ff);
+ pmdp = prompmd + ((vaddr >> 23) & 0x7ff);
X if (pmd_none(*pmdp)) {
X ptep = __alloc_bootmem(BASE_PAGE_SIZE,
X BASE_PAGE_SIZE,
@@ -321,7 +401,7 @@
X }
X }
X }
- phys_page = __pa(pmd);
+ phys_page = __pa(prompmd);
X obp_iaddr_patch[0] |= (phys_page >> 10);
X obp_iaddr_patch[1] |= (phys_page & 0x3ff);
X flushi((long)&obp_iaddr_patch[0]);
diff -u --recursive --new-file v2.4.13/linux/arch/sparc64/mm/ultra.S linux/arch/sparc64/mm/ultra.S
--- v2.4.13/linux/arch/sparc64/mm/ultra.S Tue Oct 23 22:48:50 2001
+++ linux/arch/sparc64/mm/ultra.S Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: ultra.S,v 1.63 2001/10/17 19:30:21 davem Exp $
+/* $Id: ultra.S,v 1.67 2001/10/23 14:28:20 davem Exp $
X * ultra.S: Don't expand these all over the place...
X *
X * Copyright (C) 1997, 2000 David S. Miller (da...@redhat.com)


@@ -505,7 +505,7 @@
X

X .align 32
X .globl xcall_flush_dcache_page_cheetah
-xcall_flush_dcache_page_cheetah:
+xcall_flush_dcache_page_cheetah: /* %g1 == physical page address */
X sethi %hi(PAGE_SIZE), %g3
X 1: subcc %g3, (1 << 5), %g3
X stxa %g0, [%g1 + %g3] ASI_DCACHE_INVALIDATE
@@ -516,18 +516,39 @@
X nop
X
X .globl xcall_flush_dcache_page_spitfire
-xcall_flush_dcache_page_spitfire:
- rdpr %pstate, %g2
- wrpr %g2, PSTATE_IG | PSTATE_AG, %pstate
- rdpr %pil, %g2
- wrpr %g0, 15, %pil
- sethi %hi(109f), %g7
- b,pt %xcc, etrap_irq
-109: or %g7, %lo(109b), %g7
- call smp_flush_dcache_page_client
+xcall_flush_dcache_page_spitfire: /* %g1 == physical page address
+ %g7 == kernel page virtual address
+ %g5 == (page->mapping != NULL) */
+#if (L1DCACHE_SIZE > PAGE_SIZE)
+ srlx %g1, (13 - 2), %g1 ! Form tag comparitor
+ sethi %hi(L1DCACHE_SIZE), %g3 ! D$ size == 16K
+ sub %g3, (1 << 5), %g3 ! D$ linesize == 32
+1: ldxa [%g3] ASI_DCACHE_TAG, %g2
+ andcc %g2, 0x3, %g0
+ be,pn %xcc, 2f
+ andn %g2, 0x3, %g2
+ cmp %g2, %g1
+
+ bne,pt %xcc, 2f
X nop
- b,pt %xcc, rtrap
- clr %l6
+ stxa %g0, [%g3] ASI_DCACHE_TAG
+ membar #Sync
+2: cmp %g3, 0
+ bne,pt %xcc, 1b
+ sub %g3, (1 << 5), %g3
+
+ brz,pn %g5, 2f
+#endif /* L1DCACHE_SIZE > PAGE_SIZE */
+ sethi %hi(PAGE_SIZE), %g3
+
+1: flush %g7
+ subcc %g3, (1 << 5), %g3
+ bne,pt %icc, 1b
+ add %g7, (1 << 5), %g7
+
+2: retry
+ nop
+ nop
X
X .globl xcall_capture
X xcall_capture:
diff -u --recursive --new-file v2.4.13/linux/drivers/acorn/block/mfmhd.c linux/drivers/acorn/block/mfmhd.c
--- v2.4.13/linux/drivers/acorn/block/mfmhd.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/acorn/block/mfmhd.c Thu Oct 25 13:58:35 2001
@@ -1208,11 +1208,6 @@
X return -EFAULT;
X return 0;
X
- case BLKGETSIZE:
- return put_user (mfm[minor].nr_sects, (unsigned long *)arg);
- case BLKGETSIZE64:
- return put_user ((u64)mfm[minor].nr_sects << 9, (u64 *)arg);
-
X case BLKFRASET:
X if (!capable(CAP_SYS_ADMIN))
X return -EACCES;
@@ -1230,6 +1225,8 @@
X return -EACCES;
X return mfm_reread_partitions(dev);
X
+ case BLKGETSIZE:
+ case BLKGETSIZE64:
X case BLKFLSBUF:
X case BLKROSET:
X case BLKROGET:
@@ -1250,7 +1247,6 @@
X if (dev >= mfm_drives)
X return -ENODEV;
X
- MOD_INC_USE_COUNT;
X while (mfm_info[dev].busy)
X sleep_on (&mfm_wait_open);
X
@@ -1265,7 +1261,6 @@
X static int mfm_release(struct inode *inode, struct file *file)
X {
X mfm_info[DEVICE_NR(MINOR(inode->i_rdev))].access_count--;
- MOD_DEC_USE_COUNT;
X return 0;
X }
X
@@ -1324,6 +1319,7 @@
X
X static struct block_device_operations mfm_fops =
X {
+ owner: THIS_MODULE,
X open: mfm_open,
X release: mfm_release,
X ioctl: mfm_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/acorn/char/keyb_ps2.c linux/drivers/acorn/char/keyb_ps2.c
--- v2.4.13/linux/drivers/acorn/char/keyb_ps2.c Tue Jul 3 17:08:19 2001
+++ linux/drivers/acorn/char/keyb_ps2.c Thu Oct 25 13:53:46 2001
@@ -30,6 +30,7 @@
X #include <asm/bitops.h>
X #include <asm/irq.h>
X #include <asm/hardware.h>
+#include <asm/keyboard.h>
X #include <asm/io.h>
X #include <asm/hardware/iomd.h>
X #include <asm/system.h>
@@ -212,7 +213,7 @@
X };
X
X #ifdef CONFIG_MAGIC_SYSRQ
-unsigned char ps2kbd_sysrq_xlate[] =
+static unsigned char ps2kbd_sysrq_xlate[] =
X {
X 27, 0, 0, 0, 0, 0, 0, 0,
X 0, 0, 0, 0, 0, 0, 0, 0,
@@ -360,7 +361,7 @@
X status = 0;
X }
X
-void ps2kbd_leds(unsigned int leds)
+static void ps2kbd_leds(unsigned char leds)
X {
X ps2kbd_sendbyte(KBD_SETLEDS);
X ps2kbd_sendbyte(leds);
@@ -380,6 +381,17 @@
X {
X }
X
+static int ps2kbd_translate(unsigned char scancode, unsigned char *keycode, char rawmode)
+{
+ *keycode = scancode;
+ return 1;
+}
+
+static char ps2kbd_unexpected_up(unsigned char scancode)
+{
+ return 0200;
+}
+
X int __init ps2kbd_init_hw(void)
X {
X /* Reset the keyboard state machine. */
@@ -391,6 +403,14 @@
X panic("Could not allocate keyboard receive IRQ!");
X if (request_irq (IRQ_KEYBOARDTX, ps2kbd_tx, 0, "keyboard", NULL) != 0)
X panic("Could not allocate keyboard transmit IRQ!");
+
+ k_translate = ps2kbd_translate;
+ k_unexpected_up = ps2kbd_unexpected_up;
+ k_leds = ps2kbd_leds;
+#ifdef CONFIG_MAGIC_SYSRQ
+ k_sysrq_xlate = ps2kbd_sysrq_xlate;
+ k_sysrq_key = 13;
+#endif
X
X return 0;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acorn/scsi/cumana_2.c linux/drivers/acorn/scsi/cumana_2.c
--- v2.4.13/linux/drivers/acorn/scsi/cumana_2.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/acorn/scsi/cumana_2.c Sun Nov 4 09:31:57 2001
@@ -195,6 +195,7 @@
X memcpy(info->sg + 1, SCp->buffer + 1,
X sizeof(struct scatterlist) * bufs);
X info->sg[0].address = SCp->ptr;
+ info->sg[0].page = NULL;
X info->sg[0].length = SCp->this_residual;
X
X if (direction == DMA_OUT)
diff -u --recursive --new-file v2.4.13/linux/drivers/acorn/scsi/ecoscsi.c linux/drivers/acorn/scsi/ecoscsi.c
--- v2.4.13/linux/drivers/acorn/scsi/ecoscsi.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/acorn/scsi/ecoscsi.c Thu Oct 25 13:53:46 2001
@@ -232,7 +232,6 @@
X #endif
X #undef STAT
X
-#ifndef HOSTS_C
X #define NCR5380_implementation_fields \
X int port, ctrl
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acorn/scsi/eesox.c linux/drivers/acorn/scsi/eesox.c
--- v2.4.13/linux/drivers/acorn/scsi/eesox.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/acorn/scsi/eesox.c Sun Nov 4 09:31:57 2001
@@ -199,7 +199,8 @@
X memcpy(info->sg + 1, SCp->buffer + 1,
X sizeof(struct scatterlist) * bufs);
X info->sg[0].address = SCp->ptr;
- info->sg[0].length = SCp->this_residual;
+ info->sg[0].page = NULL;
+ info->sg[0].length = SCp->this_residual;
X
X if (direction == DMA_OUT)
X pci_dir = PCI_DMA_TODEVICE,
diff -u --recursive --new-file v2.4.13/linux/drivers/acorn/scsi/powertec.c linux/drivers/acorn/scsi/powertec.c
--- v2.4.13/linux/drivers/acorn/scsi/powertec.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/acorn/scsi/powertec.c Sun Nov 4 09:31:57 2001
@@ -187,7 +187,8 @@
X memcpy(info->sg + 1, SCp->buffer + 1,
X sizeof(struct scatterlist) * bufs);
X info->sg[0].address = SCp->ptr;
- info->sg[0].length = SCp->this_residual;
+ info->sg[0].page = NULL;
+ info->sg[0].length = SCp->this_residual;
X
X if (direction == DMA_OUT)
X pci_dir = PCI_DMA_TODEVICE,
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/Makefile linux/drivers/acpi/Makefile
--- v2.4.13/linux/drivers/acpi/Makefile Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/Makefile Wed Oct 24 14:06:21 2001
@@ -36,12 +36,11 @@
X subdir-$(CONFIG_ACPI) += $(acpi-subdirs)
X subdir-$(CONFIG_ACPI_BUSMGR) += ospm
X
-obj-$(CONFIG_ACPI) += os.o acpi_ksyms.o
+obj-$(CONFIG_ACPI) += driver.o os.o acpi_ksyms.o
X obj-$(CONFIG_ACPI) += $(foreach dir,$(acpi-subdirs),$(dir)/$(dir).o)
X ifdef CONFIG_ACPI_KERNEL_CONFIG
X obj-$(CONFIG_ACPI) += acpiconf.o osconf.o
X endif
-obj-$(CONFIG_ACPI) += driver.o
X
X ifeq ($(CONFIG_ACPI_BUSMGR),y)
X obj-y += ospm/ospm.o
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/acpi_ksyms.c linux/drivers/acpi/acpi_ksyms.c
--- v2.4.13/linux/drivers/acpi/acpi_ksyms.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/acpi_ksyms.c Wed Oct 24 14:06:21 2001
@@ -38,6 +38,14 @@
X EXPORT_SYMBOL(acpi_db_user_commands);
X #endif
X
+#ifdef ACPI_DEBUG
+EXPORT_SYMBOL(acpi_ut_debug_print_raw);
+EXPORT_SYMBOL(acpi_ut_debug_print);
+EXPORT_SYMBOL(acpi_ut_status_exit);
+EXPORT_SYMBOL(acpi_ut_exit);
+EXPORT_SYMBOL(acpi_ut_trace);
+#endif
+
X EXPORT_SYMBOL(acpi_gbl_FADT);
X
X EXPORT_SYMBOL(acpi_os_free);
@@ -103,6 +111,5 @@
X EXPORT_SYMBOL(acpi_hw_register_read);
X EXPORT_SYMBOL(acpi_set_firmware_waking_vector);
X EXPORT_SYMBOL(acpi_subsystem_status);
-
X
X EXPORT_SYMBOL(acpi_os_signal);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/debugger/dbcmds.c linux/drivers/acpi/debugger/dbcmds.c
--- v2.4.13/linux/drivers/acpi/debugger/dbcmds.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/debugger/dbcmds.c Wed Oct 24 14:06:21 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: dbcmds - debug commands and output routines
- * $Revision: 65 $
+ * $Revision: 66 $
X *
X ******************************************************************************/
X
@@ -422,7 +422,7 @@
X /* Display the subtree */
X
X acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
- acpi_ns_dump_objects (ACPI_TYPE_ANY, max_depth, ACPI_UINT32_MAX, subtree_entry);
+ acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, max_depth, ACPI_UINT32_MAX, subtree_entry);
X acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
X }
X
@@ -466,7 +466,7 @@
X /* Display the subtree */
X
X acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
- acpi_ns_dump_objects (ACPI_TYPE_ANY, max_depth, owner_id, subtree_entry);
+ acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, max_depth, owner_id, subtree_entry);
X acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/debugger/dbdisasm.c linux/drivers/acpi/debugger/dbdisasm.c
--- v2.4.13/linux/drivers/acpi/debugger/dbdisasm.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/debugger/dbdisasm.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: dbdisasm - parser op tree display routines
- * $Revision: 48 $
+ * $Revision: 50 $
X *
X ******************************************************************************/
X
@@ -97,6 +97,7 @@
X
X acpi_status
X acpi_ps_display_object_pathname (
+ acpi_walk_state *walk_state,
X acpi_parse_object *op)
X {
X acpi_parse_object *target_op;
@@ -130,26 +131,43 @@
X
X acpi_status
X acpi_ps_display_object_pathname (
+ acpi_walk_state *walk_state,
X acpi_parse_object *op)
X {
X acpi_status status;
X acpi_namespace_node *node;
X NATIVE_CHAR buffer[MAX_SHOW_ENTRY];
X u32 buffer_size = MAX_SHOW_ENTRY;
+ u32 debug_level;
X
X
- acpi_os_printf (" (Path ");
+ /* Save current debug level so we don't get extraneous debug output */
+
+ debug_level = acpi_dbg_level;
+ acpi_dbg_level = 0;
X
X /* Just get the Node out of the Op object */
X
X node = op->node;
X if (!node) {
- /*
- * No Named obj, so we can't get the pathname since the object
- * is not in the namespace. This can happen during single
- * stepping where a dynamic named object is *about* to be created.
- */
- return (AE_OK);
+ /* Node not defined in this scope, look it up */
+
+ status = acpi_ns_lookup (walk_state->scope_info, op->value.string, ACPI_TYPE_ANY,
+ IMODE_EXECUTE, NS_SEARCH_PARENT, walk_state, &(node));
+
+ if (ACPI_FAILURE (status)) {
+ /*
+ * We can't get the pathname since the object
+ * is not in the namespace. This can happen during single
+ * stepping where a dynamic named object is *about* to be created.
+ */
+ acpi_os_printf (" [Path not found]");
+ goto exit;
+ }
+
+ /* Save it for next time. */
+
+ op->node = node;
X }
X
X /* Convert Named_desc/handle to a full pathname */
@@ -157,11 +175,17 @@
X status = acpi_ns_handle_to_pathname (node, &buffer_size, buffer);
X if (ACPI_FAILURE (status)) {
X acpi_os_printf ("****Could not get pathname****)");
- return (status);
+ goto exit;
X }
X
- acpi_os_printf ("%s)", buffer);
- return (AE_OK);
+ acpi_os_printf (" (Path %s)", buffer);
+
+
+exit:
+ /* Restore the debug level */
+
+ acpi_dbg_level = debug_level;
+ return (status);
X }
X
X #endif
@@ -275,7 +299,7 @@
X if ((op->opcode == AML_INT_NAMEPATH_OP && op->value.name) &&
X (op->parent) &&
X (acpi_gbl_db_opt_verbose)) {
- acpi_ps_display_object_pathname (op);
+ acpi_ps_display_object_pathname (walk_state, op);
X }
X
X acpi_os_printf ("\n");
@@ -561,7 +585,7 @@
X case AML_QWORD_OP:
X
X if (acpi_gbl_db_opt_verbose) {
- acpi_os_printf ("(UINT64) 0x%8.8X%8.8X", op->value.integer64.hi,
+ acpi_os_printf ("(u64) 0x%8.8X%8.8X", op->value.integer64.hi,
X op->value.integer64.lo);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/debugger/dbdisply.c linux/drivers/acpi/debugger/dbdisply.c
--- v2.4.13/linux/drivers/acpi/debugger/dbdisply.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/debugger/dbdisply.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: dbdisply - debug display commands
- * $Revision: 52 $
+ * $Revision: 57 $
X *
X ******************************************************************************/
X
@@ -246,7 +246,7 @@
X }
X
X else {
- acpi_os_printf ("Object Pathname: %s\n", ret_buf.pointer);
+ acpi_os_printf ("Object (%p) Pathname: %s\n", node, ret_buf.pointer);
X }
X
X if (!acpi_os_readable (node, sizeof (acpi_namespace_node))) {
@@ -264,7 +264,7 @@
X return;
X }
X
- acpi_ut_dump_buffer (node->object, sizeof (acpi_operand_object), display, ACPI_UINT32_MAX);
+ acpi_ut_dump_buffer ((void *) node->object, sizeof (acpi_operand_object), display, ACPI_UINT32_MAX);
X acpi_ex_dump_object_descriptor (node->object, 1);
X }


X }
@@ -402,7 +402,7 @@

X break;
X
X case AML_REVISION_OP:
- acpi_os_printf ("[Const] Revision (%X)", ACPI_CA_VERSION);
+ acpi_os_printf ("[Const] Revision (%X)", ACPI_CA_SUPPORT_LEVEL);
X break;
X
X case AML_LOCAL_OP:
@@ -520,28 +520,22 @@
X num_remaining_ops++;
X }
X
- op_info = acpi_ps_get_opcode_info (op->opcode);
- if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) {
- /* Bad opcode or ASCII character */
-
- continue;
- }
-
-
X /* Decode the opcode */
X
- switch (ACPI_GET_OP_CLASS (op_info)) {
- case OPTYPE_CONSTANT: /* argument type only */
- case OPTYPE_LITERAL: /* argument type only */
- case OPTYPE_DATA_TERM: /* argument type only */
- case OPTYPE_LOCAL_VARIABLE: /* argument type only */
- case OPTYPE_METHOD_ARGUMENT: /* argument type only */
+ op_info = acpi_ps_get_opcode_info (op->opcode);
+ switch (op_info->class) {
+ case AML_CLASS_ARGUMENT:
X if (count_remaining) {
X num_remaining_operands++;
X }
X
X num_operands++;
X break;
+
+ case AML_CLASS_UNKNOWN:
+ /* Bad opcode or ASCII character */
+
+ continue;
X
X default:
X if (count_remaining) {
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/debugger/dbfileio.c linux/drivers/acpi/debugger/dbfileio.c
--- v2.4.13/linux/drivers/acpi/debugger/dbfileio.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/debugger/dbfileio.c Wed Oct 24 14:06:22 2001
@@ -2,7 +2,7 @@
X *
X * Module Name: dbfileio - Debugger file I/O commands. These can't usually
X * be used when running the debugger in Ring 0 (Kernel mode)
- * $Revision: 48 $
+ * $Revision: 53 $
X *
X ******************************************************************************/
X
@@ -38,16 +38,18 @@
X MODULE_NAME ("dbfileio")
X
X
+/*
+ * NOTE: this is here for lack of a better place. It is used in all
+ * flavors of the debugger, need LCD file
+ */
X #ifdef ACPI_APPLICATION
X #include <stdio.h>
X FILE *acpi_gbl_debug_file = NULL;
X #endif
X
X
-/*
- * NOTE: this is here for lack of a better place. It is used in all
- * flavors of the debugger, need LCD file
- */
+acpi_table_header *acpi_gbl_db_table_ptr = NULL;
+
X
X /*******************************************************************************
X *
@@ -172,7 +174,7 @@
X u32 *table_length)
X {
X acpi_table_header table_header;
- u8 *aml_ptr;
+ u8 *aml_start;
X u32 aml_length;
X u32 actual;
X acpi_status status;
@@ -209,7 +211,7 @@
X /* Allocate a buffer for the table */
X
X *table_length = table_header.length;
- *table_ptr = ACPI_MEM_ALLOCATE ((size_t) *table_length);
+ *table_ptr = acpi_os_allocate ((size_t) *table_length);
X if (!*table_ptr) {
X acpi_os_printf ("Could not allocate memory for ACPI table %4.4s (size=%X)\n",
X table_header.signature, table_header.length);
@@ -217,8 +219,8 @@
X }
X
X
- aml_ptr = (u8 *) *table_ptr + sizeof (table_header);
- aml_length = *table_length - sizeof (table_header);
+ aml_start = (u8 *) *table_ptr + sizeof (table_header);
+ aml_length = *table_length - sizeof (table_header);
X
X /* Copy the header to the buffer */
X
@@ -226,19 +228,19 @@
X
X /* Get the rest of the table */
X
- actual = fread (aml_ptr, 1, (size_t) aml_length, fp);
+ actual = fread (aml_start, 1, (size_t) aml_length, fp);
X if (actual == aml_length) {
X return (AE_OK);
X }
X
X if (actual > 0) {
X acpi_os_printf ("Warning - reading table, asked for %X got %X\n", aml_length, actual);
- return (AE_OK);
+ return (AE_OK);
X }
X
X
X acpi_os_printf ("Error - could not read the table file\n");
- ACPI_MEM_FREE (*table_ptr);
+ acpi_os_free (*table_ptr);
X *table_ptr = NULL;
X *table_length = 0;
X
@@ -325,7 +327,6 @@
X #ifdef ACPI_APPLICATION
X FILE *fp;
X acpi_status status;
- acpi_table_header *table_ptr;
X u32 table_length;
X
X
@@ -341,7 +342,7 @@
X /* Get the entire file */
X
X acpi_os_printf ("Loading Acpi table from file %s\n", filename);
- status = acpi_db_load_table (fp, &table_ptr, &table_length);
+ status = acpi_db_load_table (fp, &acpi_gbl_db_table_ptr, &table_length);
X fclose(fp);
X
X if (ACPI_FAILURE (status)) {
@@ -349,27 +350,25 @@
X return (status);
X }
X
-
X /* Attempt to recognize and install the table */
- status = ae_local_load_table (table_ptr);
X
+ status = ae_local_load_table (acpi_gbl_db_table_ptr);
X if (ACPI_FAILURE (status)) {
X if (status == AE_EXIST) {
X acpi_os_printf ("Table %4.4s is already installed\n",
- &table_ptr->signature);
+ &acpi_gbl_db_table_ptr->signature);
X }
-
X else {
X acpi_os_printf ("Could not install table, %s\n",
X acpi_format_exception (status));
X }
X
- ACPI_MEM_FREE (table_ptr);
+ acpi_os_free (acpi_gbl_db_table_ptr);
X return (status);
X }
X
X acpi_os_printf ("%4.4s at %p successfully installed and loaded\n",
- &table_ptr->signature, table_ptr);
+ &acpi_gbl_db_table_ptr->signature, acpi_gbl_db_table_ptr);
X
X acpi_gbl_acpi_hardware_present = FALSE;
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/debugger/dbinput.c linux/drivers/acpi/debugger/dbinput.c
--- v2.4.13/linux/drivers/acpi/debugger/dbinput.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/debugger/dbinput.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: dbinput - user front-end to the AML debugger
- * $Revision: 68 $
+ * $Revision: 72 $
X *
X ******************************************************************************/
X
@@ -47,11 +47,10 @@
X NATIVE_CHAR acpi_gbl_db_scope_buf[40];
X NATIVE_CHAR acpi_gbl_db_debug_filename[40];
X NATIVE_CHAR *acpi_gbl_db_args[DB_MAX_ARGS];
-NATIVE_CHAR *acpi_gbl_db_buffer;
+NATIVE_CHAR *acpi_gbl_db_buffer = NULL;
X NATIVE_CHAR *acpi_gbl_db_filename = NULL;
X u8 acpi_gbl_db_output_to_file = FALSE;
X
-
X u32 acpi_gbl_db_debug_level = ACPI_LV_VERBOSITY2;
X u32 acpi_gbl_db_console_debug_level = NORMAL_DEFAULT | ACPI_LV_TABLES;
X u8 acpi_gbl_db_output_flags = DB_CONSOLE_OUTPUT;
@@ -525,7 +524,7 @@
X case CMD_ALLOCATIONS:
X
X #ifdef ACPI_DBG_TRACK_ALLOCATIONS
- acpi_ut_dump_current_allocations ((u32) -1, NULL);
+ acpi_ut_dump_allocations ((u32) -1, NULL);
X #endif
X break;
X
@@ -917,7 +916,6 @@
X * because all the semaphores are deleted during termination
X */
X acpi_terminate ();
-
X return (status);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/debugger/dbstats.c linux/drivers/acpi/debugger/dbstats.c
--- v2.4.13/linux/drivers/acpi/debugger/dbstats.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/debugger/dbstats.c Wed Oct 24 14:06:22 2001


@@ -368,11 +368,11 @@
X

X if (acpi_gbl_memory_lists[i].object_size)
X {
- size = ROUND_UP_TO_1_k (outstanding * acpi_gbl_memory_lists[i].object_size);
+ size = ROUND_UP_TO_1K (outstanding * acpi_gbl_memory_lists[i].object_size);
X }
X else
X {
- size = ROUND_UP_TO_1_k (acpi_gbl_memory_lists[i].current_total_size);
+ size = ROUND_UP_TO_1K (acpi_gbl_memory_lists[i].current_total_size);
X }
X
X acpi_os_printf (" Mem: [Alloc Free Outstanding Size] % 7d % 7d % 7d % 7d Kb\n",
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/debugger/dbutils.c linux/drivers/acpi/debugger/dbutils.c
--- v2.4.13/linux/drivers/acpi/debugger/dbutils.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/debugger/dbutils.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: dbutils - AML debugger utilities
- * $Revision: 43 $
+ * $Revision: 45 $
X *
X ******************************************************************************/
X
@@ -135,7 +135,7 @@
X
X case ACPI_TYPE_INTEGER:
X
- acpi_os_printf ("[Integer] = %X%8.8X\n", HIDWORD (obj_desc->integer.value),
+ acpi_os_printf ("[Integer] = %8.8X%8.8X\n", HIDWORD (obj_desc->integer.value),
X LODWORD (obj_desc->integer.value));
X break;
X
@@ -265,15 +265,37 @@
X acpi_parse_object *start_op;
X acpi_status status = AE_OK;
X u32 base_aml_offset;
+ acpi_walk_state *walk_state;
+
+
+ FUNCTION_ENTRY ();
X
X
X acpi_os_printf ("Pass two parse ....\n");
X
+
X while (op) {
X if (op->opcode == AML_METHOD_OP) {
X method = (acpi_parse2_object *) op;
- status = acpi_ps_parse_aml (op, method->data, method->length, 0,
- NULL, NULL, NULL, acpi_ds_load1_begin_op, acpi_ds_load1_end_op);
+
+ walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
+ NULL, NULL, NULL);
+ if (!walk_state) {
+ return (AE_NO_MEMORY);
+ }
+
+
+ walk_state->parser_state.aml =
+ walk_state->parser_state.aml_start = method->data;
+ walk_state->parser_state.aml_end =
+ walk_state->parser_state.pkg_end = method->data + method->length;
+ walk_state->parser_state.start_scope = op;
+
+ walk_state->descending_callback = acpi_ds_load1_begin_op;
+ walk_state->ascending_callback = acpi_ds_load1_end_op;
+
+
+ status = acpi_ps_parse_aml (walk_state);
X
X
X base_aml_offset = (method->value.arg)->aml_offset + 1;
@@ -297,7 +319,7 @@
X }
X
X if (ACPI_FAILURE (status)) {
- return (status);
+ break;
X }
X
X op = acpi_ps_get_depth_next (root, op);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/debugger/dbxface.c linux/drivers/acpi/debugger/dbxface.c
--- v2.4.13/linux/drivers/acpi/debugger/dbxface.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/debugger/dbxface.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: dbxface - AML Debugger external interfaces
- * $Revision: 41 $
+ * $Revision: 45 $
X *
X ******************************************************************************/
X
@@ -46,7 +46,7 @@
X *
X * PARAMETERS: Walk_state - Current walk
X * Op - Current executing op
- * Op_type - Type of the current AML Opcode
+ * Opcode_class - Class of the current AML Opcode
X *
X * RETURN: Status
X *
@@ -58,7 +58,7 @@
X acpi_db_single_step (
X acpi_walk_state *walk_state,
X acpi_parse_object *op,
- u8 op_type)
+ u32 opcode_class)
X {
X acpi_parse_object *next;
X acpi_status status = AE_OK;
@@ -91,22 +91,11 @@
X return (AE_OK);
X }
X
- switch (op_type) {
- case OPTYPE_UNDEFINED:
- case OPTYPE_CONSTANT: /* argument type only */
- case OPTYPE_LITERAL: /* argument type only */
- case OPTYPE_DATA_TERM: /* argument type only */
- case OPTYPE_LOCAL_VARIABLE: /* argument type only */
- case OPTYPE_METHOD_ARGUMENT: /* argument type only */
+ switch (opcode_class) {
+ case AML_CLASS_UNKNOWN:
+ case AML_CLASS_ARGUMENT: /* constants, literals, etc. do nothing */
X return (AE_OK);
X break;
-
- case OPTYPE_NAMED_OBJECT:
- switch (op->opcode) {
- case AML_INT_NAMEPATH_OP:
- return (AE_OK);
- break;
- }
X }
X
X /*
@@ -270,7 +259,7 @@
X
X /* Init globals */
X
- acpi_gbl_db_buffer = acpi_os_allocate (ACPI_DEBUG_BUFFER_SIZE);
+ acpi_gbl_db_buffer = acpi_os_callocate (ACPI_DEBUG_BUFFER_SIZE);
X
X /* Initial scope is the root */
X
@@ -301,6 +290,31 @@
X }
X
X return (0);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_db_terminate
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Stop debugger
+ *
+ ******************************************************************************/
+
+void
+acpi_db_terminate (void)
+{
+
+ if (acpi_gbl_db_table_ptr) {
+ acpi_os_free (acpi_gbl_db_table_ptr);
+ }
+ if (acpi_gbl_db_buffer) {
+ acpi_os_free (acpi_gbl_db_buffer);
+ }
X }
X
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/dispatcher/dsfield.c linux/drivers/acpi/dispatcher/dsfield.c
--- v2.4.13/linux/drivers/acpi/dispatcher/dsfield.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/dispatcher/dsfield.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /******************************************************************************
X *
X * Module Name: dsfield - Dispatcher field routines
- * $Revision: 44 $
+ * $Revision: 46 $
X *
X *****************************************************************************/
X
@@ -29,78 +29,178 @@
X #include "acdispat.h"
X #include "acinterp.h"
X #include "acnamesp.h"
+#include "acparser.h"
X
X
X #define _COMPONENT ACPI_DISPATCHER
X MODULE_NAME ("dsfield")
X
X
-/*
- * Field flags: Bits 00 - 03 : Access_type (Any_acc, Byte_acc, etc.)
- * 04 : Lock_rule (1 == Lock)
- * 05 - 06 : Update_rule
- */
-
-#define FIELD_ACCESS_TYPE_MASK 0x0F
-#define FIELD_LOCK_RULE_MASK 0x10
-#define FIELD_UPDATE_RULE_MASK 0x60
-
-
X /*******************************************************************************
X *
- * FUNCTION: Acpi_ds_create_field
+ * FUNCTION: Acpi_ds_create_buffer_field
X *
- * PARAMETERS: Op - Op containing the Field definition and args
- * Region_node - Object for the containing Operation Region
- * ` Walk_state - Current method state
+ * PARAMETERS: Opcode - The opcode to be executed
+ * Operands - List of operands for the opcode
+ * Walk_state - Current state
X *
X * RETURN: Status
X *
- * DESCRIPTION: Create a new field in the specified operation region
+ * DESCRIPTION: Execute the Create_field operators:
+ * Create_bit_field_op,
+ * Create_byte_field_op,
+ * Create_word_field_op,
+ * Create_dWord_field_op,


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 11'
echo 'File patch-2.4.14 is continued in part 12'
echo "12" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:27 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part04

#!/bin/sh -x
# this is part 04 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 04; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_LOOP is not set


+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_INITRD=y
+
+#

+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set

+# CONFIG_NETLINK is not set


+# CONFIG_NETFILTER is not set

+# CONFIG_FILTER is not set

+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set

+# CONFIG_IP_ADVANCED_ROUTER is not set
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set

+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set

+# CONFIG_NET_SB1000 is not set


+
+#
+# Ethernet (10 or 100Mbit)
+#

+# CONFIG_NET_ETHERNET is not set


+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set

+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set

+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#

+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#

+# CONFIG_IDE is not set


+# CONFIG_BLK_DEV_IDE_MODES is not set

+# CONFIG_BLK_DEV_HD is not set


+
+#
+# SCSI support
+#
+# CONFIG_SCSI is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set

+
+#
+# Character devices
+#

+# CONFIG_VT is not set


+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set

+CONFIG_SERIAL_CLPS711X=y
+CONFIG_SERIAL_CLPS711X_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256


+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#

+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#

+# CONFIG_JOYSTICK is not set


+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set

+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set

+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#

+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set

+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set

+# CONFIG_FAT_FS is not set


+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set

+# CONFIG_VFAT_FS is not set


+# CONFIG_EFS_FS is not set

+# CONFIG_JFFS_FS is not set

+# CONFIG_CRAMFS is not set

+CONFIG_RAMFS=y
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set

+CONFIG_MINIX_FS=y


+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set

+# CONFIG_ROMFS_FS is not set

+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set

+# CONFIG_SYSV_FS_WRITE is not set


+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set

+# CONFIG_NFS_FS is not set


+# CONFIG_NFS_V3 is not set

+# CONFIG_ROOT_NFS is not set
+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set

+# CONFIG_SUNRPC is not set
+# CONFIG_LOCKD is not set


+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+
+#
+# Partition Types
+#

+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+# CONFIG_MSDOS_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set


+# CONFIG_SMB_NLS is not set

+# CONFIG_NLS is not set


+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#

+# Kernel hacking
+#
+CONFIG_FRAME_POINTER=y


+CONFIG_DEBUG_ERRORS=y
+CONFIG_DEBUG_USER=y
+# CONFIG_DEBUG_INFO is not set
+CONFIG_MAGIC_SYSRQ=y

+CONFIG_DEBUG_LL=y
diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/epxa10db linux/arch/arm/def-configs/epxa10db
--- v2.4.13/linux/arch/arm/def-configs/epxa10db Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/def-configs/epxa10db Thu Oct 25 13:53:44 2001
@@ -0,0 +1,662 @@


+#
+# Automatically generated by make menuconfig: don't edit
+#
+CONFIG_ARM=y
+# CONFIG_EISA is not set
+# CONFIG_SBUS is not set
+# CONFIG_MCA is not set
+CONFIG_UID16=y

+CONFIG_ARCH_CAMELOT=y


+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_RPC is not set

+# CONFIG_ARCH_SA1100 is not set

+# CONFIG_ARCH_SHARK is not set
+
+#
+# Archimedes/A5000 Implementations
+#

+# CONFIG_ARCH_ARC is not set
+# CONFIG_ARCH_A5K is not set
+
+#
+# Footbridge Implementations
+#
+# CONFIG_ARCH_CATS is not set
+# CONFIG_ARCH_PERSONAL_SERVER is not set
+# CONFIG_ARCH_EBSA285_ADDIN is not set
+# CONFIG_ARCH_EBSA285_HOST is not set
+# CONFIG_ARCH_NETWINDER is not set
+
+#
+# SA11x0 Implementations
+#
+# CONFIG_SA1100_ASSABET is not set
+# CONFIG_ASSABET_NEPONSET is not set
+# CONFIG_SA1100_ADSBITSY is not set
+# CONFIG_SA1100_BRUTUS is not set

+# CONFIG_SA1100_CERF is not set


+# CONFIG_SA1100_H3600 is not set
+# CONFIG_SA1100_EXTENEX1 is not set
+# CONFIG_SA1100_FLEXANET is not set
+# CONFIG_SA1100_FREEBIRD is not set
+# CONFIG_SA1100_GRAPHICSCLIENT is not set
+# CONFIG_SA1100_GRAPHICSMASTER is not set
+# CONFIG_SA1100_JORNADA720 is not set
+# CONFIG_SA1100_HUW_WEBPANEL is not set
+# CONFIG_SA1100_ITSY is not set
+# CONFIG_SA1100_LART is not set
+# CONFIG_SA1100_NANOENGINE is not set
+# CONFIG_SA1100_OMNIMETER is not set
+# CONFIG_SA1100_PANGOLIN is not set
+# CONFIG_SA1100_PLEB is not set
+# CONFIG_SA1100_SHERMAN is not set
+# CONFIG_SA1100_SIMPAD is not set
+# CONFIG_SA1100_PFS168 is not set
+# CONFIG_SA1100_VICTOR is not set
+# CONFIG_SA1100_XP860 is not set
+# CONFIG_SA1100_YOPY is not set

+
+#
+# CLPS711X/EP721X Implementations
+#
+# CONFIG_ARCH_CDB89712 is not set
+# CONFIG_ARCH_CLEP7312 is not set
+# CONFIG_ARCH_EDB7211 is not set
+# CONFIG_ARCH_P720T is not set
+# CONFIG_ARCH_EP7211 is not set
+# CONFIG_ARCH_EP7212 is not set
+# CONFIG_ARCH_ACORN is not set
+# CONFIG_FOOTBRIDGE is not set
+# CONFIG_FOOTBRIDGE_HOST is not set
+# CONFIG_FOOTBRIDGE_ADDIN is not set
+CONFIG_CPU_32=y
+# CONFIG_CPU_26 is not set

+# CONFIG_CPU_32v3 is not set
+CONFIG_CPU_32v4=y
+# CONFIG_CPU_ARM610 is not set
+# CONFIG_CPU_ARM710 is not set
+# CONFIG_CPU_ARM720T is not set

+CONFIG_CPU_ARM922T=y
+CONFIG_CPU_ARM92X_CPU_IDLE=y
+CONFIG_CPU_ARM92X_I_CACHE_ON=y
+CONFIG_CPU_ARM92X_D_CACHE_ON=y
+# CONFIG_CPU_ARM92X_WRITETHROUGH is not set


+# CONFIG_CPU_ARM1020 is not set
+# CONFIG_CPU_SA110 is not set
+# CONFIG_CPU_SA1100 is not set

+# CONFIG_ARM_THUMB is not set

+# CONFIG_DISCONTIGMEM is not set
+
+#


+# General setup
+#
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_ISA_DMA is not set

+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
+CONFIG_NET=y
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y

+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_FASTFPE is not set
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set

+CONFIG_BINFMT_AOUT=y


+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
+# CONFIG_ARTHUR is not set

+CONFIG_CMDLINE="console=ttyUA0,38400 root=/dev/mtdblock0 rw"


+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y

+CONFIG_MTD_DEBUG=y
+CONFIG_MTD_DEBUG_VERBOSE=0


+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set

+CONFIG_MTD_BOOTLDR_PARTS=y


+# CONFIG_MTD_AFS_PARTS is not set

+CONFIG_MTD_EPXA10DB=y


+# CONFIG_MTD_CFI_FLAGADM is not set
+# CONFIG_MTD_SOLUTIONENGINE is not set
+# CONFIG_MTD_MIXMEM is not set
+# CONFIG_MTD_OCTAGON is not set
+# CONFIG_MTD_VMAX is not set
+# CONFIG_MTD_OCELOT is not set
+# CONFIG_MTD_L440GX is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_CDB89712 is not set

+# CONFIG_MTD_SA1100 is not set


+# CONFIG_MTD_DC21285 is not set
+# CONFIG_MTD_IQ80310 is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_LART is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set

+# CONFIG_BLK_DEV_LOOP is not set


+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y

+CONFIG_BLK_DEV_RAM_SIZE=8192
+# CONFIG_BLK_DEV_INITRD is not set
+
+#


+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+CONFIG_PACKET=y

+# CONFIG_PACKET_MMAP is not set

+# CONFIG_NETLINK is not set


+# CONFIG_NETFILTER is not set

+# CONFIG_FILTER is not set

+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set

+# CONFIG_IP_ADVANCED_ROUTER is not set

+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set


+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set

+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set

+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y

+CONFIG_ETHER00=y


+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set

+# CONFIG_NET_VENDOR_3COM is not set

+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set

+CONFIG_PPP=y
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=y
+CONFIG_PPP_SYNC_TTY=y
+CONFIG_PPP_DEFLATE=y
+CONFIG_PPP_BSDCOMP=y


+# CONFIG_PPPOE is not set

+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#

+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#

+# CONFIG_IDE is not set


+# CONFIG_BLK_DEV_IDE_MODES is not set

+# CONFIG_BLK_DEV_HD is not set

+# CONFIG_VT is not set


+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_ANAKIN is not set
+# CONFIG_SERIAL_ANAKIN_CONSOLE is not set
+# CONFIG_SERIAL_AMBA is not set
+# CONFIG_SERIAL_AMBA_CONSOLE is not set
+# CONFIG_SERIAL_CLPS711X is not set
+# CONFIG_SERIAL_CLPS711X_CONSOLE is not set
+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set

+CONFIG_SERIAL_UART00=y
+CONFIG_SERIAL_UART00_CONSOLE=y
+# CONFIG_SERIAL_SA1100 is not set
+# CONFIG_SERIAL_SA1100_CONSOLE is not set


+# CONFIG_SERIAL_8250 is not set
+# CONFIG_SERIAL_8250_CONSOLE is not set
+# CONFIG_SERIAL_8250_EXTENDED is not set
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_HUB6 is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y

+CONFIG_UNIX98_PTY_COUNT=256


+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# L3 serial bus support
+#
+# CONFIG_L3 is not set
+# CONFIG_L3_ALGOBIT is not set
+# CONFIG_L3_BIT_SA1100_GPIO is not set

+# CONFIG_L3_SA1111 is not set


+# CONFIG_L3_DRV_UDA1341 is not set
+# CONFIG_BIT_SA1100_GPIO is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set

+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set

+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#

+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set

+# CONFIG_FAT_FS is not set


+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set

+# CONFIG_VFAT_FS is not set


+# CONFIG_EFS_FS is not set

+CONFIG_JFFS_FS=y
+CONFIG_JFFS_FS_VERBOSE=0


+# CONFIG_JFFS2_FS is not set

+# CONFIG_CRAMFS is not set
+# CONFIG_TMPFS is not set

+# CONFIG_RAMFS is not set

+# CONFIG_NFS_V3 is not set

+# CONFIG_ROOT_NFS is not set
+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y

+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_SMB_NLS is not set

+# CONFIG_NLS is not set


+
+#
+# USB support
+#
+# CONFIG_USB is not set

+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+# CONFIG_USB_OHCI_SA1111 is not set

+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set

+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set

+# CONFIG_USB_DABUSB is not set

+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set

+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_NO_FRAME_POINTER is not set
+CONFIG_DEBUG_ERRORS=y
+CONFIG_DEBUG_USER=y

+CONFIG_DEBUG_INFO=y


+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_NO_PGT_CACHE is not set

+CONFIG_DEBUG_LL=y


+# CONFIG_DEBUG_DC21285_PORT is not set
+# CONFIG_DEBUG_CLPS711X_UART2 is not set

diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/graphicsclient linux/arch/arm/def-configs/graphicsclient
--- v2.4.13/linux/arch/arm/def-configs/graphicsclient Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/def-configs/graphicsclient Thu Oct 25 13:53:44 2001
@@ -6,6 +6,8 @@
X # CONFIG_SBUS is not set
X # CONFIG_MCA is not set
X CONFIG_UID16=y


+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set

X
X #


X # Code maturity level options

@@ -23,16 +25,18 @@
X #
X # System Type
X #


+# CONFIG_ARCH_ANAKIN is not set

X # CONFIG_ARCH_ARCA5K is not set
X # CONFIG_ARCH_CLPS7500 is not set


+# CONFIG_ARCH_CLPS711X is not set

X # CONFIG_ARCH_CO285 is not set
X # CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_L7200 is not set
X # CONFIG_ARCH_FOOTBRIDGE is not set
X # CONFIG_ARCH_INTEGRATOR is not set


+# CONFIG_ARCH_L7200 is not set

X # CONFIG_ARCH_RPC is not set
X CONFIG_ARCH_SA1100=y
-# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_SHARK is not set
X
X #
X # Archimedes/A5000 Implementations
@@ -62,23 +66,28 @@
X # CONFIG_SA1100_CERF is not set
X # CONFIG_SA1100_BITSY is not set
X # CONFIG_SA1100_EXTENEX1 is not set


+# CONFIG_SA1100_FLEXANET is not set

X # CONFIG_SA1100_FREEBIRD is not set

X CONFIG_SA1100_GRAPHICSCLIENT=y


+# CONFIG_SA1100_JORNADA720 is not set

X # CONFIG_SA1100_HUW_WEBPANEL is not set


+# CONFIG_SA1100_ITSY is not set

X # CONFIG_SA1100_LART is not set
-# CONFIG_SA1100_PLEB is not set
X # CONFIG_SA1100_NANOENGINE is not set


+# CONFIG_SA1100_OMNIMETER is not set

X # CONFIG_SA1100_PANGOLIN is not set


+# CONFIG_SA1100_PLEB is not set

X # CONFIG_SA1100_SHERMAN is not set


+# CONFIG_SA1100_SIMPAD is not set
+# CONFIG_SA1100_PFS168 is not set

X # CONFIG_SA1100_VICTOR is not set
X # CONFIG_SA1100_XP860 is not set
X # CONFIG_SA1100_YOPY is not set


-# CONFIG_SA1100_PFS168 is not set

-CONFIG_SA1100_USB=m
-CONFIG_SA1100_USB_NETLINK=m
-CONFIG_SA1100_USB_CHAR=m


-# CONFIG_SA1100_FREQUENCY_SCALE is not set

-# CONFIG_SA1100_VOLTAGE_SCALE is not set


+# CONFIG_SA1100_GRAPHICSMASTER is not set

+# CONFIG_SA1100_ADSBITSY is not set

+# CONFIG_SA1100_USB is not set
+# CONFIG_SA1100_USB_NETLINK is not set

+# CONFIG_SA1100_USB_CHAR is not set
X
X #
X # CLPS711X/EP721X Implementations
@@ -104,18 +113,15 @@


X # CONFIG_CPU_SA110 is not set
X CONFIG_CPU_SA1100=y

X CONFIG_DISCONTIGMEM=y
+# CONFIG_CPU_BIG_ENDIAN is not set
X
X #
X # General setup
X #
-
-#
-# Please ensure that you have read the help on the next option
-#
-# CONFIG_ANGELBOOT is not set
X # CONFIG_PCI is not set
X # CONFIG_ISA is not set
X # CONFIG_ISA_DMA is not set
+# CONFIG_CPU_FREQ is not set
X CONFIG_HOTPLUG=y
X
X #
@@ -125,7 +131,7 @@
X # CONFIG_I82365 is not set
X # CONFIG_TCIC is not set
X # CONFIG_PCMCIA_CLPS6700 is not set
-CONFIG_PCMCIA_SA1100=m
+CONFIG_PCMCIA_SA1100=y
X CONFIG_NET=y


X CONFIG_SYSVIPC=y
X # CONFIG_BSD_PROCESS_ACCT is not set

@@ -138,12 +144,14 @@
X CONFIG_BINFMT_ELF=y
X # CONFIG_BINFMT_MISC is not set
X # CONFIG_PM is not set


+# CONFIG_APM is not set

X # CONFIG_ARTHUR is not set

-CONFIG_CMDLINE="root=nfs"
+CONFIG_CMDLINE="ip=off"
X # CONFIG_PFS168_CMDLINE is not set
-# CONFIG_LEDS is not set
+CONFIG_LEDS=y
+CONFIG_LEDS_TIMER=y
+CONFIG_LEDS_CPU=y
X CONFIG_ALIGNMENT_TRAP=y
-# CONFIG_UCB1200 is not set
X
X #
X # Parallel port support
@@ -153,65 +161,87 @@
X #
X # Memory Technology Devices (MTD)
X #
-CONFIG_MTD=m
+CONFIG_MTD=y
X # CONFIG_MTD_DEBUG is not set


+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_BOOTLDR_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set

X
X #
-# Disk-On-Chip Device Drivers


+# User Modules And Translation Layers

X #


-# CONFIG_MTD_DOC1000 is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set

+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set

X
X #
-# RAM/ROM Device Drivers
+# RAM/ROM/Flash chip drivers
X #


-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_SLRAM is not set

+CONFIG_MTD_CFI=y


+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set

+# CONFIG_MTD_AMDSTD is not set

+# CONFIG_MTD_SHARP is not set
X # CONFIG_MTD_RAM is not set
X # CONFIG_MTD_ROM is not set
-# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_JEDEC is not set
X
X #
-# Linearly Mapped Flash Device Drivers


+# Mapping drivers for chip access

X #
-CONFIG_MTD_CFI=m
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_CFI_INTELEXT=m


-# CONFIG_MTD_CFI_AMDSTD is not set
-# CONFIG_MTD_AMDSTD is not set
-# CONFIG_MTD_SHARP is not set

-# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=800000
+CONFIG_MTD_PHYSMAP_LEN=1000000
+CONFIG_MTD_PHYSMAP_BUSWIDTH=4


+# CONFIG_MTD_SUN_UFLASH is not set

X # CONFIG_MTD_NORA is not set
X # CONFIG_MTD_PNC2000 is not set
X # CONFIG_MTD_RPXLITE is not set


+# CONFIG_MTD_TQM8XXL is not set

X # CONFIG_MTD_SC520CDP is not set
-# CONFIG_MTD_SBC_MEDIAGX is not set


+# CONFIG_MTD_NETSC520 is not set
+# CONFIG_MTD_SBC_GXX is not set

X # CONFIG_MTD_ELAN_104NC is not set
-CONFIG_MTD_SA1100=m
+CONFIG_MTD_SA1100=y
+# CONFIG_MTD_SA1100_REDBOOT_PARTITIONS is not set
+# CONFIG_MTD_SA1100_BOOTLDR_PARTITIONS is not set


X # CONFIG_MTD_DC21285 is not set
X # CONFIG_MTD_IQ80310 is not set

-# CONFIG_MTD_CSTM_CFI_JEDEC is not set
-# CONFIG_MTD_JEDEC is not set


+# CONFIG_MTD_DBOX2 is not set
+# CONFIG_MTD_CSTM_MIPS_IXX is not set
+# CONFIG_MTD_CFI_FLAGADM is not set

+# CONFIG_MTD_ARM_INTEGRATOR is not set

+# CONFIG_MTD_SOLUTIONENGINE is not set
X # CONFIG_MTD_MIXMEM is not set
X # CONFIG_MTD_OCTAGON is not set
X # CONFIG_MTD_VMAX is not set


+# CONFIG_MTD_OCELOT is not set
+# CONFIG_MTD_L440GX is not set

X
X #
-# NAND Flash Device Drivers
+# Self-contained MTD device drivers
X #


-# CONFIG_MTD_NAND is not set

-# CONFIG_MTD_NAND_SPIA is not set


+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_LART is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set

X
X #
-# User Modules And Translation Layers
+# Disk-On-Chip Device Drivers
X #
-CONFIG_MTD_CHAR=m
-CONFIG_MTD_BLOCK=m
-# CONFIG_MTD_BLOCK_RO is not set


-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set

+# CONFIG_MTD_DOC1000 is not set
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOCPROBE is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set

X
X #
X # Plug and Play configuration
@@ -258,6 +288,7 @@
X # CONFIG_IP_MULTICAST is not set
X # CONFIG_IP_ADVANCED_ROUTER is not set
X CONFIG_IP_PNP=y


+# CONFIG_IP_PNP_DHCP is not set

X CONFIG_IP_PNP_BOOTP=y
X # CONFIG_IP_PNP_RARP is not set


X # CONFIG_NET_IPIP is not set

@@ -302,22 +333,25 @@
X # CONFIG_BONDING is not set
X # CONFIG_EQUALIZER is not set
X # CONFIG_TUN is not set
-# CONFIG_NET_SB1000 is not set


X
X #
X # Ethernet (10 or 100Mbit)

X #
X CONFIG_NET_ETHERNET=y


+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set

X # CONFIG_NET_VENDOR_3COM is not set


X # CONFIG_LANCE is not set

X CONFIG_NET_VENDOR_SMC=y
X # CONFIG_WD80x3 is not set
+# CONFIG_ULTRAMCA is not set
X # CONFIG_ULTRA is not set
X # CONFIG_ULTRA32 is not set
X CONFIG_SMC9194=y


X # CONFIG_NET_VENDOR_RACAL is not set

-# CONFIG_AT1700 is not set

-# CONFIG_DEPCA is not set


X # CONFIG_NET_ISA is not set
X # CONFIG_NET_PCI is not set
X # CONFIG_NET_POCKET is not set

@@ -326,11 +360,14 @@


X # Ethernet (1000 Mbit)
X #

X # CONFIG_ACENIC is not set
+# CONFIG_ACENIC_OMIT_TIGON_I is not set


+# CONFIG_MYRI_SBUS is not set

X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set
X # CONFIG_FDDI is not set
X # CONFIG_HIPPI is not set


+# CONFIG_PLIP is not set

X # CONFIG_PPP is not set
X # CONFIG_SLIP is not set
X
@@ -359,7 +396,7 @@
X # CONFIG_PCMCIA_3C589 is not set
X # CONFIG_PCMCIA_3C574 is not set
X # CONFIG_PCMCIA_FMVJ18X is not set
-CONFIG_PCMCIA_PCNET=m
+CONFIG_PCMCIA_PCNET=y
X # CONFIG_PCMCIA_NMCLAN is not set
X # CONFIG_PCMCIA_SMC91C92 is not set
X # CONFIG_PCMCIA_XIRC2PS is not set
@@ -380,19 +417,19 @@
X #
X # ATA/IDE/MFM/RLL support
X #
-CONFIG_IDE=m
+CONFIG_IDE=y
X
X #
X # IDE, ATA and ATAPI Block devices
X #
-CONFIG_BLK_DEV_IDE=m
+CONFIG_BLK_DEV_IDE=y
X
X #
X # Please see Documentation/ide.txt for help/info on IDE drives
X #
X # CONFIG_BLK_DEV_HD_IDE is not set
X # CONFIG_BLK_DEV_HD is not set
-CONFIG_BLK_DEV_IDEDISK=m
+CONFIG_BLK_DEV_IDEDISK=y
X # CONFIG_IDEDISK_MULTI_MODE is not set
X # CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
X # CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
@@ -403,7 +440,7 @@
X # CONFIG_BLK_DEV_IDEDISK_WD is not set
X # CONFIG_BLK_DEV_COMMERIAL is not set
X # CONFIG_BLK_DEV_TIVO is not set
-CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECS=y
X # CONFIG_BLK_DEV_IDECD is not set
X # CONFIG_BLK_DEV_IDETAPE is not set
X # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -452,19 +489,31 @@
X # CONFIG_SERIAL is not set
X # CONFIG_SERIAL_EXTENDED is not set
X # CONFIG_SERIAL_NONSTANDARD is not set


+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set
+# CONFIG_SERIAL_AMBA is not set
+# CONFIG_SERIAL_AMBA_CONSOLE is not set
+# CONFIG_SERIAL_CLPS711X is not set
+# CONFIG_SERIAL_CLPS711X_CONSOLE is not set

X CONFIG_SERIAL_SA1100=y
X CONFIG_SERIAL_SA1100_CONSOLE=y
-CONFIG_SA1100_DEFAULT_BAUDRATE=9600


-# CONFIG_TOUCHSCREEN_UCB1200 is not set

+CONFIG_SA1100_DEFAULT_BAUDRATE=38400
+# CONFIG_SERIAL_8250 is not set
+# CONFIG_SERIAL_8250_CONSOLE is not set

+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=32
+CONFIG_UCB1200=y
+CONFIG_TOUCHSCREEN_UCB1200=y

+CONFIG_AUDIO_UCB1200=y
+CONFIG_ADC_UCB1200=y
X # CONFIG_TOUCHSCREEN_BITSY is not set
X # CONFIG_PROFILER is not set
X # CONFIG_PFS168_SPI is not set
X # CONFIG_PFS168_DTMF is not set
X # CONFIG_PFS168_MISC is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=32
X
X #
X # I2C support
@@ -505,7 +554,10 @@
X # CONFIG_FTAPE is not set
X # CONFIG_AGP is not set
X # CONFIG_DRM is not set
-# CONFIG_PCMCIA_SERIAL is not set


+
+#
+# PCMCIA character devices
+#

X
X #
X # Multimedia devices
@@ -525,20 +577,22 @@
X # CONFIG_AFFS_FS is not set
X # CONFIG_HFS_FS is not set
X # CONFIG_BFS_FS is not set
-CONFIG_FAT_FS=m
-CONFIG_MSDOS_FS=m
+CONFIG_FAT_FS=y
+# CONFIG_MSDOS_FS is not set
X # CONFIG_UMSDOS_FS is not set
-CONFIG_VFAT_FS=m
+CONFIG_VFAT_FS=y


X # CONFIG_EFS_FS is not set
-CONFIG_JFFS_FS=m

+CONFIG_JFFS_FS=y
X CONFIG_JFFS_FS_VERBOSE=0
-CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS=y
X CONFIG_JFFS2_FS_DEBUG=0


-# CONFIG_CRAMFS is not set

-CONFIG_RAMFS=m
+CONFIG_CRAMFS=y


+# CONFIG_TMPFS is not set
+CONFIG_RAMFS=y

X # CONFIG_ISO9660_FS is not set
X # CONFIG_JOLIET is not set
X # CONFIG_MINIX_FS is not set
+# CONFIG_VXFS_FS is not set


X # CONFIG_NTFS_FS is not set
X # CONFIG_NTFS_RW is not set
X # CONFIG_HPFS_FS is not set

@@ -552,7 +606,6 @@
X # CONFIG_ROMFS_FS is not set
X CONFIG_EXT2_FS=y
X # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
X # CONFIG_UDF_FS is not set
X # CONFIG_UDF_RW is not set
X # CONFIG_UFS_FS is not set
@@ -607,11 +660,13 @@
X # CONFIG_NLS_CODEPAGE_865 is not set
X # CONFIG_NLS_CODEPAGE_866 is not set
X # CONFIG_NLS_CODEPAGE_869 is not set


-# CONFIG_NLS_CODEPAGE_874 is not set

-# CONFIG_NLS_CODEPAGE_932 is not set
X # CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
X # CONFIG_NLS_CODEPAGE_950 is not set


+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set

X # CONFIG_NLS_ISO8859_1 is not set
X # CONFIG_NLS_ISO8859_2 is not set
X # CONFIG_NLS_ISO8859_3 is not set
@@ -619,11 +674,12 @@
X # CONFIG_NLS_ISO8859_5 is not set
X # CONFIG_NLS_ISO8859_6 is not set
X # CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_8 is not set
X # CONFIG_NLS_ISO8859_9 is not set


+# CONFIG_NLS_ISO8859_13 is not set

X # CONFIG_NLS_ISO8859_14 is not set
X # CONFIG_NLS_ISO8859_15 is not set
X # CONFIG_NLS_KOI8_R is not set


+# CONFIG_NLS_KOI8_U is not set

X # CONFIG_NLS_UTF8 is not set
X
X #
@@ -631,7 +687,6 @@
X #
X CONFIG_PC_KEYMAP=y
X # CONFIG_VGA_CONSOLE is not set
-CONFIG_FB=y
X
X #
X # Frame-buffer support
@@ -642,6 +697,8 @@
X # CONFIG_FB_CLPS711X is not set
X # CONFIG_FB_CYBER2000 is not set
X CONFIG_FB_SA1100=y


+# CONFIG_FB_ANAKIN is not set

+# CONFIG_FB_E1355 is not set


X # CONFIG_FB_VIRTUAL is not set
X # CONFIG_FBCON_ADVANCED is not set
X CONFIG_FBCON_CFB2=y

@@ -665,6 +722,11 @@


X # USB support
X #

X # CONFIG_USB is not set
+
+#


+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set

X
X #
X # Kernel hacking
diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/graphicsmaster linux/arch/arm/def-configs/graphicsmaster
--- v2.4.13/linux/arch/arm/def-configs/graphicsmaster Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/def-configs/graphicsmaster Thu Oct 25 13:53:44 2001
@@ -0,0 +1,755 @@


+#
+# Automatically generated by make menuconfig: don't edit
+#
+CONFIG_ARM=y
+# CONFIG_EISA is not set
+# CONFIG_SBUS is not set
+# CONFIG_MCA is not set
+CONFIG_UID16=y

+# CONFIG_ARCH_ARC is not set
+# CONFIG_ARCH_A5K is not set
+
+#
+# Footbridge Implementations
+#
+# CONFIG_ARCH_CATS is not set
+# CONFIG_ARCH_PERSONAL_SERVER is not set
+# CONFIG_ARCH_EBSA285_ADDIN is not set
+# CONFIG_ARCH_EBSA285_HOST is not set
+# CONFIG_ARCH_NETWINDER is not set
+
+#
+# SA11x0 Implementations
+#
+# CONFIG_SA1100_ASSABET is not set
+# CONFIG_ASSABET_NEPONSET is not set

+# CONFIG_SA1100_BRUTUS is not set
+# CONFIG_SA1100_CERF is not set

+# CONFIG_SA1100_BITSY is not set


+# CONFIG_SA1100_EXTENEX1 is not set
+# CONFIG_SA1100_FLEXANET is not set
+# CONFIG_SA1100_FREEBIRD is not set
+# CONFIG_SA1100_GRAPHICSCLIENT is not set

+# CONFIG_SA1100_JORNADA720 is not set
+# CONFIG_SA1100_HUW_WEBPANEL is not set
+# CONFIG_SA1100_ITSY is not set
+# CONFIG_SA1100_LART is not set
+# CONFIG_SA1100_NANOENGINE is not set
+# CONFIG_SA1100_OMNIMETER is not set
+# CONFIG_SA1100_PANGOLIN is not set
+# CONFIG_SA1100_PLEB is not set
+# CONFIG_SA1100_SHERMAN is not set
+# CONFIG_SA1100_SIMPAD is not set
+# CONFIG_SA1100_PFS168 is not set
+# CONFIG_SA1100_VICTOR is not set
+# CONFIG_SA1100_XP860 is not set
+# CONFIG_SA1100_YOPY is not set

+CONFIG_SA1100_GRAPHICSMASTER=y


+# CONFIG_SA1100_ADSBITSY is not set

+CONFIG_SA1111=y
+# CONFIG_SA1100_USB is not set
+# CONFIG_SA1100_USB_NETLINK is not set

+# CONFIG_SA1100_USB_CHAR is not set
+
+#
+# CLPS711X/EP721X Implementations
+#


+# CONFIG_ARCH_P720T is not set
+# CONFIG_ARCH_ACORN is not set

+# CONFIG_FOOTBRIDGE is not set
+# CONFIG_FOOTBRIDGE_HOST is not set
+# CONFIG_FOOTBRIDGE_ADDIN is not set
+CONFIG_CPU_32=y
+# CONFIG_CPU_26 is not set
+# CONFIG_CPU_32v3 is not set
+CONFIG_CPU_32v4=y
+# CONFIG_CPU_ARM610 is not set
+# CONFIG_CPU_ARM710 is not set

+# CONFIG_CPU_ARM720T is not set
+# CONFIG_CPU_ARM920T is not set
+# CONFIG_CPU_ARM1020 is not set
+# CONFIG_CPU_SA110 is not set
+CONFIG_CPU_SA1100=y

+CONFIG_DISCONTIGMEM=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+
+#


+# General setup
+#
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_ISA_DMA is not set

+# CONFIG_CPU_FREQ is not set

+CONFIG_HOTPLUG=y
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=y
+# CONFIG_I82365 is not set
+# CONFIG_TCIC is not set
+# CONFIG_PCMCIA_CLPS6700 is not set
+CONFIG_PCMCIA_SA1100=y
+CONFIG_NET=y
+CONFIG_SYSVIPC=y

+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y

+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_FASTFPE is not set
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
+# CONFIG_APM is not set
+# CONFIG_ARTHUR is not set

+CONFIG_CMDLINE="ip=off"


+# CONFIG_PFS168_CMDLINE is not set
+CONFIG_LEDS=y
+CONFIG_LEDS_TIMER=y
+CONFIG_LEDS_CPU=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_BOOTLDR_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set

+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y

+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set

+# CONFIG_MTD_AMDSTD is not set

+# CONFIG_MTD_SHARP is not set


+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set

+# CONFIG_MTD_JEDEC is not set


+
+#
+# Mapping drivers for chip access
+#

+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=800000
+CONFIG_MTD_PHYSMAP_LEN=1000000
+CONFIG_MTD_PHYSMAP_BUSWIDTH=4


+# CONFIG_MTD_SUN_UFLASH is not set
+# CONFIG_MTD_NORA is not set
+# CONFIG_MTD_PNC2000 is not set
+# CONFIG_MTD_RPXLITE is not set
+# CONFIG_MTD_TQM8XXL is not set
+# CONFIG_MTD_SC520CDP is not set
+# CONFIG_MTD_NETSC520 is not set
+# CONFIG_MTD_SBC_GXX is not set
+# CONFIG_MTD_ELAN_104NC is not set

+CONFIG_MTD_SA1100=y
+# CONFIG_MTD_SA1100_REDBOOT_PARTITIONS is not set
+# CONFIG_MTD_SA1100_BOOTLDR_PARTITIONS is not set


+# CONFIG_MTD_DC21285 is not set
+# CONFIG_MTD_IQ80310 is not set

+# CONFIG_MTD_DBOX2 is not set
+# CONFIG_MTD_CSTM_MIPS_IXX is not set
+# CONFIG_MTD_CFI_FLAGADM is not set

+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_SOLUTIONENGINE is not set
+# CONFIG_MTD_MIXMEM is not set
+# CONFIG_MTD_OCTAGON is not set
+# CONFIG_MTD_VMAX is not set
+# CONFIG_MTD_OCELOT is not set
+# CONFIG_MTD_L440GX is not set

+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_LART is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set

+# CONFIG_MTD_DOC1000 is not set
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOCPROBE is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+
+#
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set

+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set

+CONFIG_BLK_DEV_LOOP=m


+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y

+CONFIG_BLK_DEV_RAM_SIZE=8192


+CONFIG_BLK_DEV_INITRD=y
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+CONFIG_PACKET=y

+# CONFIG_PACKET_MMAP is not set

+# CONFIG_NETLINK is not set


+# CONFIG_NETFILTER is not set

+# CONFIG_FILTER is not set

+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set

+# CONFIG_IP_ADVANCED_ROUTER is not set

+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y

+# CONFIG_IP_PNP_RARP is not set


+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set

+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set

+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set

+# CONFIG_NET_VENDOR_3COM is not set

+# CONFIG_LANCE is not set

+CONFIG_NET_VENDOR_SMC=y
+# CONFIG_WD80x3 is not set
+# CONFIG_ULTRAMCA is not set
+# CONFIG_ULTRA is not set
+# CONFIG_ULTRA32 is not set
+CONFIG_SMC9194=y


+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set

+# CONFIG_ACENIC_OMIT_TIGON_I is not set


+# CONFIG_MYRI_SBUS is not set

+# CONFIG_BLK_DEV_HD_IDE is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
+# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
+# CONFIG_BLK_DEV_IDEDISK_IBM is not set
+# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set
+# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set
+# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set
+# CONFIG_BLK_DEV_IDEDISK_WD is not set
+# CONFIG_BLK_DEV_COMMERIAL is not set
+# CONFIG_BLK_DEV_TIVO is not set

+CONFIG_BLK_DEV_IDECS=y


+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set

+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+# CONFIG_BLK_DEV_ISAPNP is not set
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_DMA_NONPCI is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set

+
+#
+# SCSI support
+#
+# CONFIG_SCSI is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input core support
+#

+CONFIG_INPUT=y


+# CONFIG_INPUT_KEYBDEV is not set

+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480


+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+# CONFIG_VT_CONSOLE is not set
+# CONFIG_SERIAL is not set
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set

+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set
+# CONFIG_SERIAL_AMBA is not set
+# CONFIG_SERIAL_AMBA_CONSOLE is not set
+# CONFIG_SERIAL_CLPS711X is not set
+# CONFIG_SERIAL_CLPS711X_CONSOLE is not set

+CONFIG_SERIAL_SA1100=y
+CONFIG_SERIAL_SA1100_CONSOLE=y
+CONFIG_SA1100_DEFAULT_BAUDRATE=38400
+# CONFIG_SERIAL_8250 is not set
+# CONFIG_SERIAL_8250_CONSOLE is not set

+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=32
+CONFIG_UCB1200=y
+CONFIG_TOUCHSCREEN_UCB1200=y

+CONFIG_AUDIO_UCB1200=y
+CONFIG_ADC_UCB1200=y
+# CONFIG_TOUCHSCREEN_BITSY is not set


+# CONFIG_PROFILER is not set
+# CONFIG_PFS168_SPI is not set
+# CONFIG_PFS168_DTMF is not set
+# CONFIG_PFS168_MISC is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#

+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#

+# CONFIG_JOYSTICK is not set


+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set

+# CONFIG_SA1100_RTC is not set

+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set

+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set

+CONFIG_FAT_FS=y
+# CONFIG_MSDOS_FS is not set
+# CONFIG_UMSDOS_FS is not set

+CONFIG_VFAT_FS=y
+# CONFIG_EFS_FS is not set

+CONFIG_JFFS_FS=y
+CONFIG_JFFS_FS_VERBOSE=0
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_CRAMFS=y


+# CONFIG_TMPFS is not set
+CONFIG_RAMFS=y
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_MINIX_FS is not set

+# CONFIG_VXFS_FS is not set


+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set

+# CONFIG_ROMFS_FS is not set

+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set

+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+CONFIG_ROOT_NFS=y

+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y

+# CONFIG_FB_CLPS711X is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_SA1100=y

+# CONFIG_FB_ANAKIN is not set

+# CONFIG_FB_E1355 is not set


+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FBCON_ADVANCED is not set
+CONFIG_FBCON_CFB2=y
+CONFIG_FBCON_CFB4=y
+CONFIG_FBCON_CFB8=y
+CONFIG_FBCON_CFB16=y

+CONFIG_FBCON_FONTWIDTH8_ONLY=y
+CONFIG_FBCON_FONTS=y
+# CONFIG_FONT_8x8 is not set
+CONFIG_FONT_8x16=y
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_PEARL_8x8 is not set

+# CONFIG_FONT_ACORN_8x8 is not set


+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#

+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set

+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set

+CONFIG_USB_OHCI=y
+CONFIG_USB_OHCI_NOPCI=y


+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set

+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set

+# CONFIG_USB_HID is not set
+# CONFIG_USB_KBD is not set
+CONFIG_USB_MOUSE=y
+# CONFIG_USB_WACOM is not set

+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set

+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_OV511 is not set
+# CONFIG_USB_PWC is not set
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_DSBR is not set

+# CONFIG_USB_DABUSB is not set

+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set

+# CONFIG_USB_CATC is not set

+# CONFIG_USB_NET1080 is not set


+# CONFIG_USB_USBNET is not set

+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set

+# CONFIG_USB_RIO500 is not set


+
+#
+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_NO_FRAME_POINTER is not set
+CONFIG_DEBUG_ERRORS=y
+CONFIG_DEBUG_USER=y
+# CONFIG_DEBUG_INFO is not set

+# CONFIG_MAGIC_SYSRQ is not set

+# CONFIG_NO_PGT_CACHE is not set
+# CONFIG_DEBUG_LL is not set
+# CONFIG_DEBUG_DC21285_PORT is not set
+# CONFIG_DEBUG_CLPS711X_UART2 is not set

diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/h3600 linux/arch/arm/def-configs/h3600
--- v2.4.13/linux/arch/arm/def-configs/h3600 Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/def-configs/h3600 Thu Oct 25 13:53:44 2001
@@ -2,8 +2,14 @@
X # Automatically generated make config: don't edit
X #
X CONFIG_ARM=y


+# CONFIG_EISA is not set

X # CONFIG_SBUS is not set


+# CONFIG_MCA is not set

X CONFIG_UID16=y


+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set

+# CONFIG_GENERIC_BUST_SPINLOCK is not set

+# CONFIG_GENERIC_ISA_DMA is not set
X
X #


X # Code maturity level options

@@ -16,46 +22,85 @@
X #
X CONFIG_MODULES=y
X # CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y


+# CONFIG_KMOD is not set

X
X #
X # System Type
X #


+# CONFIG_ARCH_ANAKIN is not set

X # CONFIG_ARCH_ARCA5K is not set
X # CONFIG_ARCH_CLPS7500 is not set


+# CONFIG_ARCH_CLPS711X is not set

X # CONFIG_ARCH_CO285 is not set
X # CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_CAMELOT is not set
X # CONFIG_ARCH_FOOTBRIDGE is not set
X # CONFIG_ARCH_INTEGRATOR is not set


+# CONFIG_ARCH_L7200 is not set

X # CONFIG_ARCH_RPC is not set
X CONFIG_ARCH_SA1100=y


+# CONFIG_ARCH_SHARK is not set

X
X #
X # Archimedes/A5000 Implementations
X #
X
X #


+# Archimedes/A5000 Implementations (select only ONE)
+#
+# CONFIG_ARCH_ARC is not set
+# CONFIG_ARCH_A5K is not set
+
+#

X # Footbridge Implementations
X #


+# CONFIG_ARCH_CATS is not set
+# CONFIG_ARCH_PERSONAL_SERVER is not set
+# CONFIG_ARCH_EBSA285_ADDIN is not set
+# CONFIG_ARCH_EBSA285_HOST is not set
+# CONFIG_ARCH_NETWINDER is not set

X
X #
X # SA11x0 Implementations
X #
X # CONFIG_SA1100_ASSABET is not set


+# CONFIG_ASSABET_NEPONSET is not set
+# CONFIG_SA1100_ADSBITSY is not set

X # CONFIG_SA1100_BRUTUS is not set
X # CONFIG_SA1100_CERF is not set
-CONFIG_SA1100_BITSY=y
-# CONFIG_SA1100_LART is not set
+CONFIG_SA1100_H3600=y


+# CONFIG_SA1100_EXTENEX1 is not set
+# CONFIG_SA1100_FLEXANET is not set
+# CONFIG_SA1100_FREEBIRD is not set

X # CONFIG_SA1100_GRAPHICSCLIENT is not set


+# CONFIG_SA1100_GRAPHICSMASTER is not set
+# CONFIG_SA1100_JORNADA720 is not set
+# CONFIG_SA1100_HUW_WEBPANEL is not set
+# CONFIG_SA1100_ITSY is not set
+# CONFIG_SA1100_LART is not set

X # CONFIG_SA1100_NANOENGINE is not set
-# CONFIG_SA1100_VICTOR is not set


+# CONFIG_SA1100_OMNIMETER is not set
+# CONFIG_SA1100_PANGOLIN is not set
+# CONFIG_SA1100_PLEB is not set

X # CONFIG_SA1100_SHERMAN is not set


+# CONFIG_SA1100_SIMPAD is not set
+# CONFIG_SA1100_PFS168 is not set
+# CONFIG_SA1100_VICTOR is not set

X # CONFIG_SA1100_XP860 is not set


-# CONFIG_SA1100_PANGOLIN is not set

-# CONFIG_ANGELBOOT is not set
+# CONFIG_SA1100_YOPY is not set
X CONFIG_SA1100_USB=m
-CONFIG_SA1100_FREQUENCY_SCALE=y


-# CONFIG_SA1100_VOLTAGE_SCALE is not set

+CONFIG_SA1100_USB_NETLINK=m
+# CONFIG_SA1100_USB_CHAR is not set
+
+#


+# CLPS711X/EP721X Implementations
+#
+# CONFIG_ARCH_CDB89712 is not set
+# CONFIG_ARCH_CLEP7312 is not set
+# CONFIG_ARCH_EDB7211 is not set
+# CONFIG_ARCH_P720T is not set
+# CONFIG_ARCH_EP7211 is not set
+# CONFIG_ARCH_EP7212 is not set

X # CONFIG_ARCH_ACORN is not set
X # CONFIG_FOOTBRIDGE is not set
X # CONFIG_FOOTBRIDGE_HOST is not set

@@ -66,42 +111,55 @@
X #
X # Processor Type
X #


+# CONFIG_CPU_32v3 is not set

X CONFIG_CPU_32v4=y


+# CONFIG_CPU_ARM610 is not set
+# CONFIG_CPU_ARM710 is not set
+# CONFIG_CPU_ARM720T is not set
+# CONFIG_CPU_ARM920T is not set
+# CONFIG_CPU_ARM1020 is not set
+# CONFIG_CPU_SA110 is not set

X CONFIG_CPU_SA1100=y


+# CONFIG_ARM_THUMB is not set

X CONFIG_DISCONTIGMEM=y
X
X #


X # General setup
X #
X # CONFIG_PCI is not set
-# CONFIG_ISA is not set
+CONFIG_ISA=y
X # CONFIG_ISA_DMA is not set

-CONFIG_PC_KEYMAP=y
+CONFIG_CPU_FREQ=y
X CONFIG_HOTPLUG=y
X
X #
X # PCMCIA/CardBus support
X #
-CONFIG_PCMCIA=m
-CONFIG_PCMCIA_DEBUG=y
-PCMCIA_DEBUG=1
-CONFIG_SA1100_PCMCIA=y
-CONFIG_VIRTUAL_BUS=y


+CONFIG_PCMCIA=y
+# CONFIG_I82365 is not set
+# CONFIG_TCIC is not set
+# CONFIG_PCMCIA_CLPS6700 is not set
+CONFIG_PCMCIA_SA1100=y

X CONFIG_NET=y


X CONFIG_SYSVIPC=y
X # CONFIG_BSD_PROCESS_ACCT is not set
X CONFIG_SYSCTL=y

-CONFIG_NWFPE=y


+
+#
+# At least one math emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_FASTFPE is not set

X CONFIG_KCORE_ELF=y
X # CONFIG_KCORE_AOUT is not set
-CONFIG_BINFMT_AOUT=y


+# CONFIG_BINFMT_AOUT is not set

X CONFIG_BINFMT_ELF=y
X # CONFIG_BINFMT_MISC is not set
X CONFIG_PM=y

X # CONFIG_ARTHUR is not set
X CONFIG_CMDLINE=""

X # CONFIG_LEDS is not set
-# CONFIG_ALIGNMENT_TRAP is not set
+CONFIG_ALIGNMENT_TRAP=y
X
X #
X # Parallel port support
@@ -112,50 +170,86 @@
X # Memory Technology Devices (MTD)
X #
X CONFIG_MTD=y
-# CONFIG_MTD_DOC1000 is not set


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 04'
echo 'File patch-2.4.14 is continued in part 05'
echo "05" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:35 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part12

#!/bin/sh -x
# this is part 12 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 12; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ * Create_qWord_field_op,
+ * Create_field_op (all of which define fields in buffers)


X *
X ******************************************************************************/
X

X acpi_status
-acpi_ds_create_field (
+acpi_ds_create_buffer_field (
X acpi_parse_object *op,
- acpi_namespace_node *region_node,
X acpi_walk_state *walk_state)
X {
- acpi_status status = AE_AML_ERROR;
X acpi_parse_object *arg;
X acpi_namespace_node *node;
- u8 field_flags;
- u32 field_bit_position = 0;
+ acpi_status status;
+ acpi_operand_object *obj_desc;
X
X
- FUNCTION_TRACE_PTR ("Ds_create_field", op);
+ FUNCTION_TRACE ("Ds_create_buffer_field");
X
X
- /* First arg is the name of the parent Op_region */
+ /* Get the Name_string argument */
X
- arg = op->value.arg;
- if (!region_node) {
- status = acpi_ns_lookup (walk_state->scope_info, arg->value.name,
- ACPI_TYPE_REGION, IMODE_EXECUTE,
- NS_SEARCH_PARENT, walk_state, &region_node);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
+ if (op->opcode == AML_CREATE_FIELD_OP) {
+ arg = acpi_ps_get_arg (op, 3);
X }
+ else {
+ /* Create Bit/Byte/Word/Dword field */
X
- /* Second arg is the field flags */
+ arg = acpi_ps_get_arg (op, 2);
+ }
X
- arg = arg->next;
- field_flags = (u8) arg->value.integer;
+ if (!arg) {
+ return_ACPI_STATUS (AE_AML_NO_OPERAND);
+ }
X
- /* Each remaining arg is a Named Field */
+ /*
+ * Enter the Name_string into the namespace
+ */
+ status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,
+ INTERNAL_TYPE_DEF_ANY, IMODE_LOAD_PASS1,
+ NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
+ walk_state, &(node));
+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }
+
+ /* We could put the returned object (Node) on the object stack for later, but
+ * for now, we will put it in the "op" object that the parser uses, so we
+ * can get it again at the end of this scope
+ */


+ op->node = node;

+
+ /*
+ * If there is no object attached to the node, this node was just created and
+ * we need to create the field object. Otherwise, this was a lookup of an
+ * existing node and we don't want to create the field object again.
+ */
+ if (node->object) {
+ return_ACPI_STATUS (AE_OK);
+ }
+
+ /*
+ * The Field definition is not fully parsed at this time.
+ * (We must save the address of the AML for the buffer and index operands)
+ */
+
+ /* Create the buffer field object */
+
+ obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER_FIELD);
+ if (!obj_desc) {
+ status = AE_NO_MEMORY;
+ goto cleanup;
+ }
+
+ /*
+ * Allocate a method object for this field unit
+ */
+ obj_desc->buffer_field.extra = acpi_ut_create_internal_object (
+ INTERNAL_TYPE_EXTRA);
+ if (!obj_desc->buffer_field.extra) {
+ status = AE_NO_MEMORY;
+ goto cleanup;
+ }
+
+ /*
+ * Remember location in AML stream of the field unit
+ * opcode and operands -- since the buffer and index
+ * operands must be evaluated.
+ */
+ obj_desc->buffer_field.extra->extra.aml_start = ((acpi_parse2_object *) op)->data;
+ obj_desc->buffer_field.extra->extra.aml_length = ((acpi_parse2_object *) op)->length;
+ obj_desc->buffer_field.node = node;
+
+ /* Attach constructed field descriptor to parent node */
+
+ status = acpi_ns_attach_object (node, obj_desc, ACPI_TYPE_BUFFER_FIELD);
+
+
+cleanup:
+
+ /* Remove local reference to the object */
+
+ acpi_ut_remove_reference (obj_desc);
+ return_ACPI_STATUS (status);


+}
+
+
+/*******************************************************************************
+ *

+ * FUNCTION: Acpi_ds_get_field_names
+ *
+ * PARAMETERS: Info - Create_field info structure
+ * ` Walk_state - Current method state
+ * Arg - First parser arg for the field name list


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Process all named fields in a field declaration. Names are
+ * entered into the namespace.


+ *
+ ******************************************************************************/
+

+acpi_status
+acpi_ds_get_field_names (
+ ACPI_CREATE_FIELD_INFO *info,
+ acpi_walk_state *walk_state,
+ acpi_parse_object *arg)
+{
+ acpi_status status;
+
+
+ FUNCTION_TRACE_U32 ("Ds_get_field_names", info);
+
+
+ /* First field starts at bit zero */
+
+ info->field_bit_position = 0;
+
+ /* Process all elements in the field list (of parse nodes) */
X
- arg = arg->next;
X while (arg) {
+ /*
+ * Three types of field elements are handled:
+ * 1) Offset - specifies a bit offset
+ * 2) Access_as - changes the access mode
+ * 3) Name - Enters a new named field into the namespace
+ */
X switch (arg->opcode) {
X case AML_INT_RESERVEDFIELD_OP:
X
- field_bit_position += arg->value.size;
+ info->field_bit_position += arg->value.size;
X break;
X
X
@@ -110,48 +210,57 @@
X * Get a new Access_type and Access_attribute for all
X * entries (until end or another Access_as keyword)
X */
- field_flags = (u8) ((field_flags & FIELD_ACCESS_TYPE_MASK) ||
- ((u8) (arg->value.integer >> 8)));
+ info->field_flags = (u8) ((info->field_flags & FIELD_ACCESS_TYPE_MASK) ||
+ ((u8) (arg->value.integer >> 8)));
X break;
X
X
X case AML_INT_NAMEDFIELD_OP:
X
+ /* Enter a new field name into the namespace */
+
X status = acpi_ns_lookup (walk_state->scope_info,
X (NATIVE_CHAR *) &((acpi_parse2_object *)arg)->name,
- INTERNAL_TYPE_REGION_FIELD, IMODE_LOAD_PASS1,
+ info->field_type, IMODE_LOAD_PASS1,
X NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
- NULL, &node);
+ NULL, &info->field_node);
X if (ACPI_FAILURE (status)) {
X return_ACPI_STATUS (status);
X }
X
- /*
- * Initialize an object for the new Node that is on
- * the object stack
- */
- status = acpi_ex_prep_region_field_value (node, region_node, field_flags,
- field_bit_position, arg->value.size);
+ /* Create and initialize an object for the new Field Node */
+
+ info->field_bit_length = arg->value.size;
+
+ status = acpi_ex_prep_field_value (info);
X if (ACPI_FAILURE (status)) {
X return_ACPI_STATUS (status);
X }
X
- /* Keep track of bit position for *next* field */
+ /* Keep track of bit position for the next field */
+
+ info->field_bit_position += info->field_bit_length;
+ break;
+
+
+ default:
X
- field_bit_position += arg->value.size;
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid opcode in field list: %X\n",
+ arg->opcode));
+ return_ACPI_STATUS (AE_AML_ERROR);
X break;
X }
X
X arg = arg->next;
X }
X
- return_ACPI_STATUS (status);
+ return_ACPI_STATUS (AE_OK);
X }
X
X
X /*******************************************************************************
X *
- * FUNCTION: Acpi_ds_create_bank_field
+ * FUNCTION: Acpi_ds_create_field
X *
X * PARAMETERS: Op - Op containing the Field definition and args
X * Region_node - Object for the containing Operation Region
@@ -159,29 +268,25 @@
X *


X * RETURN: Status
X *

- * DESCRIPTION: Create a new bank field in the specified operation region
+ * DESCRIPTION: Create a new field in the specified operation region


X *
X ******************************************************************************/
X

X acpi_status
-acpi_ds_create_bank_field (
+acpi_ds_create_field (
X acpi_parse_object *op,
X acpi_namespace_node *region_node,
X acpi_walk_state *walk_state)
X {
X acpi_status status = AE_AML_ERROR;
X acpi_parse_object *arg;
- acpi_namespace_node *register_node;
- acpi_namespace_node *node;
- u32 bank_value;
- u8 field_flags;
- u32 field_bit_position = 0;
+ ACPI_CREATE_FIELD_INFO info;
X
X
- FUNCTION_TRACE_PTR ("Ds_create_bank_field", op);
+ FUNCTION_TRACE_PTR ("Ds_create_field", op);
X
X
- /* First arg is the name of the parent Op_region */
+ /* First arg is the name of the parent Op_region (must already exist) */
X
X arg = op->value.arg;
X if (!region_node) {
@@ -193,82 +298,88 @@
X }
X }
X
- /* Second arg is the Bank Register */
+ /* Second arg is the field flags */
X
X arg = arg->next;
+ info.field_flags = arg->value.integer8;
X
- status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,
- INTERNAL_TYPE_BANK_FIELD_DEFN, IMODE_LOAD_PASS1,
- NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
- NULL, &register_node);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
+ /* Each remaining arg is a Named Field */
X
- /* Third arg is the Bank_value */
+ info.field_type = INTERNAL_TYPE_REGION_FIELD;
+ info.region_node = region_node;
X
- arg = arg->next;
- bank_value = arg->value.integer32;
+ status = acpi_ds_get_field_names (&info, walk_state, arg->next);
X
+ return_ACPI_STATUS (status);
+}
X
- /* Next arg is the field flags */
X
- arg = arg->next;
- field_flags = arg->value.integer8;
+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ds_create_bank_field
+ *
+ * PARAMETERS: Op - Op containing the Field definition and args
+ * Region_node - Object for the containing Operation Region
+ * ` Walk_state - Current method state


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Create a new bank field in the specified operation region
+ *
+ ******************************************************************************/
X
- /* Each remaining arg is a Named Field */
+acpi_status
+acpi_ds_create_bank_field (
+ acpi_parse_object *op,
+ acpi_namespace_node *region_node,
+ acpi_walk_state *walk_state)
+{
+ acpi_status status = AE_AML_ERROR;
+ acpi_parse_object *arg;
+ ACPI_CREATE_FIELD_INFO info;
X
- arg = arg->next;
- while (arg) {
- switch (arg->opcode) {
- case AML_INT_RESERVEDFIELD_OP:
X
- field_bit_position += arg->value.size;
- break;
+ FUNCTION_TRACE_PTR ("Ds_create_bank_field", op);
X
X
- case AML_INT_ACCESSFIELD_OP:
+ /* First arg is the name of the parent Op_region (must already exist) */
X
- /*
- * Get a new Access_type and Access_attribute for
- * all entries (until end or another Access_as keyword)
- */
- field_flags = (u8) ((field_flags & FIELD_ACCESS_TYPE_MASK) ||
- ((u8) (arg->value.integer >> 8)));
- break;
+ arg = op->value.arg;
+ if (!region_node) {
+ status = acpi_ns_lookup (walk_state->scope_info, arg->value.name,
+ ACPI_TYPE_REGION, IMODE_EXECUTE,
+ NS_SEARCH_PARENT, walk_state, &region_node);
+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }
+ }
X
+ /* Second arg is the Bank Register (must already exist) */
X
- case AML_INT_NAMEDFIELD_OP:
+ arg = arg->next;
+ status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,
+ INTERNAL_TYPE_BANK_FIELD_DEFN, IMODE_EXECUTE,
+ NS_SEARCH_PARENT, walk_state, &info.register_node);
+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }
X
- status = acpi_ns_lookup (walk_state->scope_info,
- (NATIVE_CHAR *) &((acpi_parse2_object *)arg)->name,
- INTERNAL_TYPE_REGION_FIELD, IMODE_LOAD_PASS1,
- NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
- NULL, &node);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
+ /* Third arg is the Bank_value */
X
- /*
- * Initialize an object for the new Node that is on
- * the object stack
- */
- status = acpi_ex_prep_bank_field_value (node, region_node, register_node,
- bank_value, field_flags, field_bit_position,
- arg->value.size);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
+ arg = arg->next;
+ info.bank_value = arg->value.integer32;
X
- /* Keep track of bit position for the *next* field */
+ /* Fourth arg is the field flags */
X
- field_bit_position += arg->value.size;
- break;
+ arg = arg->next;
+ info.field_flags = arg->value.integer8;
X
- }
+ /* Each remaining arg is a Named Field */
X
- arg = arg->next;
- }
+ info.field_type = INTERNAL_TYPE_BANK_FIELD;
+ info.region_node = region_node;
+
+ status = acpi_ds_get_field_names (&info, walk_state, arg->next);
X
X return_ACPI_STATUS (status);
X }
@@ -296,107 +407,44 @@
X {
X acpi_status status;
X acpi_parse_object *arg;
- acpi_namespace_node *node;
- acpi_namespace_node *index_register_node;
- acpi_namespace_node *data_register_node;
- u8 field_flags;
- u32 field_bit_position = 0;
+ ACPI_CREATE_FIELD_INFO info;
X
X
X FUNCTION_TRACE_PTR ("Ds_create_index_field", op);
X
X
- arg = op->value.arg;
-
- /* First arg is the name of the Index register */
+ /* First arg is the name of the Index register (must already exist) */
X
+ arg = op->value.arg;
X status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,
- ACPI_TYPE_ANY, IMODE_LOAD_PASS1,
- NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
- NULL, &index_register_node);
+ ACPI_TYPE_ANY, IMODE_EXECUTE,
+ NS_SEARCH_PARENT, walk_state, &info.register_node);
X if (ACPI_FAILURE (status)) {
X return_ACPI_STATUS (status);
X }
X
- /* Second arg is the data register */
+ /* Second arg is the data register (must already exist) */
X
X arg = arg->next;
-
X status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,
- INTERNAL_TYPE_INDEX_FIELD_DEFN, IMODE_LOAD_PASS1,
- NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
- NULL, &data_register_node);
+ INTERNAL_TYPE_INDEX_FIELD_DEFN, IMODE_EXECUTE,
+ NS_SEARCH_PARENT, walk_state, &info.data_register_node);
X if (ACPI_FAILURE (status)) {
X return_ACPI_STATUS (status);
X }
X
-
X /* Next arg is the field flags */
X
X arg = arg->next;
- field_flags = (u8) arg->value.integer;
+ info.field_flags = arg->value.integer8;
X
X
X /* Each remaining arg is a Named Field */
X
- arg = arg->next;
- while (arg) {
- switch (arg->opcode) {
- case AML_INT_RESERVEDFIELD_OP:
-
- field_bit_position += arg->value.size;
- break;
-
-
- case AML_INT_ACCESSFIELD_OP:
-
- /*
- * Get a new Access_type and Access_attribute for all
- * entries (until end or another Access_as keyword)
- */
- field_flags = (u8) ((field_flags & FIELD_ACCESS_TYPE_MASK) ||
- ((u8) (arg->value.integer >> 8)));
- break;
-
+ info.field_type = INTERNAL_TYPE_INDEX_FIELD;
+ info.region_node = region_node;
X
- case AML_INT_NAMEDFIELD_OP:
-
- status = acpi_ns_lookup (walk_state->scope_info,
- (NATIVE_CHAR *) &((acpi_parse2_object *)arg)->name,
- INTERNAL_TYPE_INDEX_FIELD, IMODE_LOAD_PASS1,
- NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
- NULL, &node);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-
- /*
- * Initialize an object for the new Node that is on
- * the object stack
- */
- status = acpi_ex_prep_index_field_value (node, index_register_node,
- data_register_node, field_flags,
- field_bit_position, arg->value.size);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-
- /* Keep track of bit position for the *next* field */
-
- field_bit_position += arg->value.size;
- break;
-
-
- default:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid opcode in field list: %X\n",
- arg->opcode));
- status = AE_AML_ERROR;
- break;
- }
-
- arg = arg->next;
- }
+ status = acpi_ds_get_field_names (&info, walk_state, arg->next);
X
X return_ACPI_STATUS (status);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/dispatcher/dsmethod.c linux/drivers/acpi/dispatcher/dsmethod.c
--- v2.4.13/linux/drivers/acpi/dispatcher/dsmethod.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/dispatcher/dsmethod.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: dsmethod - Parser/Interpreter interface - control method parsing


- * $Revision: 65 $

+ * $Revision: 69 $


X *
X *****************************************************************************/
X

@@ -65,6 +65,7 @@
X acpi_parse_object *op;
X acpi_namespace_node *node;
X acpi_owner_id owner_id;
+ acpi_walk_state *walk_state;
X
X
X FUNCTION_TRACE_PTR ("Ds_parse_method", obj_handle);
@@ -77,7 +78,7 @@
X }
X
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Parsing [%4.4s] **** Named_obj=%p\n",
- &((acpi_namespace_node *)obj_handle)->name, obj_handle));
+ (char*)&((acpi_namespace_node *)obj_handle)->name, obj_handle));
X
X
X /* Extract the method object from the method Node */
@@ -88,7 +89,7 @@
X return_ACPI_STATUS (AE_NULL_OBJECT);
X }
X
- /* Create a mutex for the method if there is a concurrency limit */
+ /* Create a mutex for the method if there is a concurrency limit */
X
X if ((obj_desc->method.concurrency != INFINITE_CONCURRENCY) &&
X (!obj_desc->method.semaphore)) {
@@ -114,6 +115,20 @@
X acpi_ps_set_name (op, node->name);
X op->node = node;
X
+ /* Create and initialize a new walk state */


+
+ walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
+ NULL, NULL, NULL);
+ if (!walk_state) {

+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ status = acpi_ds_init_aml_walk (walk_state, op, node, obj_desc->method.aml_start,
+ obj_desc->method.aml_length, NULL, NULL, 1);
+ if (ACPI_FAILURE (status)) {
+ /* TBD: delete walk state */
+ return_ACPI_STATUS (status);
+ }
X
X /*
X * Parse the method, first pass
@@ -125,12 +140,7 @@
X * method so that operands to the named objects can
X * take on dynamic run-time values.
X */
- status = acpi_ps_parse_aml (op, obj_desc->method.pcode,
- obj_desc->method.pcode_length,
- ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE,
- node, NULL, NULL,
- acpi_ds_load1_begin_op, acpi_ds_load1_end_op);
-


+ status = acpi_ps_parse_aml (walk_state);

X if (ACPI_FAILURE (status)) {
X return_ACPI_STATUS (status);
X }
@@ -141,10 +151,7 @@
X obj_desc->method.owning_id = owner_id;
X
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** [%4.4s] Parsed **** Named_obj=%p Op=%p\n",
- &((acpi_namespace_node *)obj_handle)->name, obj_handle, op));
-
- /* Install the parsed tree in the method object */
- /* TBD: [Restructure] Obsolete field? */
+ (char*)&((acpi_namespace_node *)obj_handle)->name, obj_handle, op));
X
X acpi_ps_delete_parse_tree (op);
X
@@ -242,13 +249,12 @@
X acpi_ds_call_control_method (
X acpi_walk_list *walk_list,
X acpi_walk_state *this_walk_state,
- acpi_parse_object *op)
+ acpi_parse_object *op) /* TBD: This operand is obsolete */
X {
X acpi_status status;
X acpi_namespace_node *method_node;
X acpi_operand_object *obj_desc;
X acpi_walk_state *next_walk_state;
- acpi_parse_state *parser_state;
X u32 i;
X
X
@@ -270,7 +276,6 @@
X return_ACPI_STATUS (AE_NULL_OBJECT);
X }
X
-
X /* Init for new method, wait on concurrency semaphore */
X
X status = acpi_ds_begin_method_execution (method_node, obj_desc,
@@ -279,78 +284,62 @@
X return_ACPI_STATUS (status);
X }
X
- /* Create and initialize a new parser state */
-
- parser_state = acpi_ps_create_state (obj_desc->method.pcode,
- obj_desc->method.pcode_length);
- if (!parser_state) {
- return_ACPI_STATUS (AE_NO_MEMORY);
- }
-
- acpi_ps_init_scope (parser_state, NULL);
- parser_state->start_node = method_node;
-
X
- /* Create a new state for the preempting walk */
+ /* 1) Parse: Create a new walk state for the preempting walk */
X
X next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
- NULL, obj_desc, walk_list);
+ op, obj_desc, NULL);
X if (!next_walk_state) {
- /* TBD: delete parser state */
-
X return_ACPI_STATUS (AE_NO_MEMORY);
+ goto cleanup;
X }
X
- next_walk_state->walk_type = WALK_METHOD;
- next_walk_state->method_node = method_node;
- next_walk_state->parser_state = parser_state;
- next_walk_state->parse_flags = this_walk_state->parse_flags;
- next_walk_state->descending_callback = this_walk_state->descending_callback;
- next_walk_state->ascending_callback = this_walk_state->ascending_callback;
-
- /* The Next_op of the Next_walk will be the beginning of the method */
- /* TBD: [Restructure] -- obsolete? */
-
- next_walk_state->next_op = NULL;
+ /* Create and init a Root Node */
X
- /* Open a new scope */
+ op = acpi_ps_alloc_op (AML_SCOPE_OP);
+ if (!op) {
+ status = AE_NO_MEMORY;
+ goto cleanup;
+ }
X
- status = acpi_ds_scope_stack_push (method_node,
- ACPI_TYPE_METHOD, next_walk_state);
+ status = acpi_ds_init_aml_walk (next_walk_state, op, method_node,
+ obj_desc->method.aml_start, obj_desc->method.aml_length,
+ NULL, NULL, 1);
X if (ACPI_FAILURE (status)) {
+ /* TBD: delete walk state */
X goto cleanup;
X }
X
+ /* Begin AML parse */
+
+ status = acpi_ps_parse_aml (next_walk_state);
+ acpi_ps_delete_parse_tree (op);
+
+
+ /* 2) Execute: Create a new state for the preempting walk */
+
+ next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
+ NULL, obj_desc, walk_list);
+ if (!next_walk_state) {
+ status = AE_NO_MEMORY;
+ goto cleanup;
+ }
X
X /*
- * Initialize the arguments for the method. The resolved
- * arguments were put on the previous walk state's operand
+ * The resolved arguments were put on the previous walk state's operand
X * stack. Operands on the previous walk state stack always
X * start at index 0.
+ * Null terminate the list of arguments
X */
- status = acpi_ds_method_data_init_args (&this_walk_state->operands[0],
- this_walk_state->num_operands,
- next_walk_state);
+ this_walk_state->operands [this_walk_state->num_operands] = NULL;
+
+ status = acpi_ds_init_aml_walk (next_walk_state, NULL, method_node,
+ obj_desc->method.aml_start, obj_desc->method.aml_length,
+ &this_walk_state->operands[0], NULL, 3);
X if (ACPI_FAILURE (status)) {
X goto cleanup;
X }
X
-
- /* Create and init a Root Node */
-
- op = acpi_ps_alloc_op (AML_SCOPE_OP);
- if (!op) {
- return_ACPI_STATUS (AE_NO_MEMORY);
- }
-
- status = acpi_ps_parse_aml (op, obj_desc->method.pcode,
- obj_desc->method.pcode_length,
- ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE,
- method_node, NULL, NULL,
- acpi_ds_load1_begin_op, acpi_ds_load1_end_op);
- acpi_ps_delete_parse_tree (op);
-
-
X /*
X * Delete the operands on the previous walkstate operand stack
X * (they were copied to new objects)
@@ -363,7 +352,6 @@
X /* Clear the operand stack */
X
X this_walk_state->num_operands = 0;
-
X
X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Starting nested execution, newstate=%p\n",
X next_walk_state));
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/dispatcher/dsobject.c linux/drivers/acpi/dispatcher/dsobject.c
--- v2.4.13/linux/drivers/acpi/dispatcher/dsobject.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/dispatcher/dsobject.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: dsobject - Dispatcher object management routines
- * $Revision: 75 $
+ * $Revision: 81 $


X *
X *****************************************************************************/
X

@@ -64,7 +64,7 @@
X {
X acpi_object_type8 type;
X acpi_status status;
- ACPI_INIT_WALK_INFO *info = (ACPI_INIT_WALK_INFO *) context;
+ acpi_init_walk_info *info = (acpi_init_walk_info *) context;
X u8 table_revision;
X
X
@@ -118,15 +118,14 @@
X * Always parse methods to detect errors, we may delete
X * the parse tree below
X */
-
X status = acpi_ds_parse_method (obj_handle);
-
- /* TBD: [Errors] what do we do with an error? */
-
X if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] parse failed! %s\n",
- obj_handle, &((acpi_namespace_node *)obj_handle)->name,
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] - parse failure, %s\n",
+ obj_handle, (char*)&((acpi_namespace_node *)obj_handle)->name,
X acpi_format_exception (status)));
+
+ /* This parse failed, but we will continue parsing more methods */
+
X break;
X }
X
@@ -168,7 +167,7 @@
X acpi_namespace_node *start_node)
X {
X acpi_status status;
- ACPI_INIT_WALK_INFO info;
+ acpi_init_walk_info info;
X
X
X FUNCTION_TRACE ("Ds_initialize_objects");


@@ -241,7 +240,7 @@
X

X obj_desc = *ret_obj_desc;
X op_info = acpi_ps_get_opcode_info (opcode);


- if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) {

+ if (op_info->class == AML_CLASS_UNKNOWN) {
X /* Unknown opcode */
X
X return (AE_TYPE);
@@ -308,7 +307,7 @@
X byte_list = (acpi_parse2_object *) arg->next;
X if (byte_list) {
X if (byte_list->opcode != AML_INT_BYTELIST_OP) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Expecting bytelist, got: %x\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Expecting bytelist, got: %p\n",
X byte_list));
X return (AE_TYPE);
X }


@@ -356,8 +355,8 @@
X

X case INTERNAL_TYPE_REFERENCE:


X
- switch (ACPI_GET_OP_CLASS (op_info)) {

- case OPTYPE_LOCAL_VARIABLE:
+ switch (op_info->type) {
+ case AML_TYPE_LOCAL_VARIABLE:
X
X /* Split the opcode into a base opcode + offset */
X
@@ -366,7 +365,7 @@
X break;
X
X
- case OPTYPE_METHOD_ARGUMENT:
+ case AML_TYPE_METHOD_ARGUMENT:
X
X /* Split the opcode into a base opcode + offset */
X
@@ -655,6 +654,15 @@
X FUNCTION_TRACE_PTR ("Ds_create_node", op);
X
X
+ /*
+ * Because of the execution pass through the non-control-method
+ * parts of the table, we can arrive here twice. Only init
+ * the named object node the first time through
+ */
+ if (node->object) {
+ return_ACPI_STATUS (AE_OK);
+ }
+
X if (!op->value.arg) {
X /* No arguments, there is nothing to do */
X
@@ -675,14 +683,8 @@
X /* Init obj */
X
X status = acpi_ns_attach_object (node, obj_desc, (u8) node->type);
- if (ACPI_FAILURE (status)) {
- goto cleanup;
- }
-
- return_ACPI_STATUS (status);
-
X
-cleanup:
+ /* Remove local reference to the object */
X
X acpi_ut_remove_reference (obj_desc);
X return_ACPI_STATUS (status);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/dispatcher/dsopcode.c linux/drivers/acpi/dispatcher/dsopcode.c
--- v2.4.13/linux/drivers/acpi/dispatcher/dsopcode.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/dispatcher/dsopcode.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X *

X * Module Name: dsopcode - Dispatcher Op Region support and handling of
X * "control" opcodes


- * $Revision: 52 $

+ * $Revision: 56 $


X *
X *****************************************************************************/
X

@@ -61,6 +61,7 @@
X acpi_parse_object *field_op;
X acpi_status status;
X acpi_table_desc *table_desc;
+ acpi_walk_state *walk_state;
X
X
X FUNCTION_TRACE_PTR ("Ds_get_buffer_field_arguments", obj_desc);
@@ -78,7 +79,7 @@
X
X DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Field]"));
X ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Buffer_field JIT Init\n",
- &node->name));
+ (char*)&node->name));
X
X
X /*
@@ -101,17 +102,34 @@
X return_ACPI_STATUS (status);
X }
X
+ /* Create and initialize a new parser state */


+
+ walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
+ NULL, NULL, NULL);
+ if (!walk_state) {

+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
+ extra_desc->extra.aml_length, NULL, NULL, 1);
+ if (ACPI_FAILURE (status)) {
+ /* TBD: delete walk state */
+ return_ACPI_STATUS (status);
+ }
+
+ /* TBD: No Walk flags?? */
+
+ walk_state->parse_flags = 0;
+
X /* Pass1: Parse the entire Buffer_field declaration */
X
- status = acpi_ps_parse_aml (op, extra_desc->extra.pcode,
- extra_desc->extra.pcode_length, 0,


- NULL, NULL, NULL, acpi_ds_load1_begin_op, acpi_ds_load1_end_op);

+ status = acpi_ps_parse_aml (walk_state);

X if (ACPI_FAILURE (status)) {
X acpi_ps_delete_parse_tree (op);
X return_ACPI_STATUS (status);
X }
X
- /* Get and init the actual Fiel_unit_op created above */
+ /* Get and init the actual Field_unit Op created above */
X
X field_op = op->value.arg;
X op->node = node;
@@ -121,7 +139,7 @@
X field_op->node = node;
X acpi_ps_delete_parse_tree (op);
X
- /* Acpi_evaluate the address and length arguments for the Op_region */
+ /* Evaluate the address and length arguments for the Op_region */
X
X op = acpi_ps_alloc_op (AML_SCOPE_OP);
X if (!op) {
@@ -130,15 +148,23 @@
X
X op->node = acpi_ns_get_parent_object (node);
X
- status = acpi_ps_parse_aml (op, extra_desc->extra.pcode,
- extra_desc->extra.pcode_length,
- ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE,
- NULL /*Method_desc*/, NULL, NULL,
- acpi_ds_exec_begin_op, acpi_ds_exec_end_op);
- /* All done with the parse tree, delete it */
+ /* Create and initialize a new parser state */
X
- acpi_ps_delete_parse_tree (op);


+ walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
+ NULL, NULL, NULL);
+ if (!walk_state) {

+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
X
+ status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
+ extra_desc->extra.aml_length, NULL, NULL, 3);
+ if (ACPI_FAILURE (status)) {
+ /* TBD: delete walk state */
+ return_ACPI_STATUS (status);


+ }
+
+ status = acpi_ps_parse_aml (walk_state);

+ acpi_ps_delete_parse_tree (op);
X
X /*
X * The pseudo-method object is no longer needed since the region is
@@ -174,6 +200,7 @@
X acpi_parse_object *region_op;
X acpi_status status;
X acpi_table_desc *table_desc;
+ acpi_walk_state *walk_state;
X
X
X FUNCTION_TRACE_PTR ("Ds_get_region_arguments", obj_desc);
@@ -191,9 +218,8 @@
X
X DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Operation Region]"));
X
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Op_region Init at AML %p[%x]\n",
- &node->name, extra_desc->extra.pcode,
- *(u32*) extra_desc->extra.pcode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Op_region Init at AML %p\n",
+ (char*)&node->name, extra_desc->extra.aml_start));
X
X /*
X * Allocate a new parser op to be the root of the parsed
@@ -215,11 +241,28 @@
X return_ACPI_STATUS (status);
X }
X
+ /* Create and initialize a new parser state */


+
+ walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,

+ op, NULL, NULL);
+ if (!walk_state) {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
+ extra_desc->extra.aml_length, NULL, NULL, 1);
+ if (ACPI_FAILURE (status)) {
+ /* TBD: delete walk state */
+ return_ACPI_STATUS (status);
+ }
+
+ /* TBD: No Walk flags?? */
+
+ walk_state->parse_flags = 0;
+
X /* Parse the entire Op_region declaration, creating a parse tree */
X
- status = acpi_ps_parse_aml (op, extra_desc->extra.pcode,
- extra_desc->extra.pcode_length, 0,


- NULL, NULL, NULL, acpi_ds_load1_begin_op, acpi_ds_load1_end_op);

+ status = acpi_ps_parse_aml (walk_state);

X if (ACPI_FAILURE (status)) {
X acpi_ps_delete_parse_tree (op);
X return_ACPI_STATUS (status);
@@ -244,14 +287,22 @@
X
X op->node = acpi_ns_get_parent_object (node);
X
- status = acpi_ps_parse_aml (op, extra_desc->extra.pcode,
- extra_desc->extra.pcode_length,
- ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE,
- NULL /*Method_desc*/, NULL, NULL,
- acpi_ds_exec_begin_op, acpi_ds_exec_end_op);
+ /* Create and initialize a new parser state */


+
+ walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,

+ op, NULL, NULL);
+ if (!walk_state) {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
X
- /* All done with the parse tree, delete it */
+ status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
+ extra_desc->extra.aml_length, NULL, NULL, 3);
+ if (ACPI_FAILURE (status)) {
+ /* TBD: delete walk state */
+ return_ACPI_STATUS (status);
+ }
X

+ status = acpi_ps_parse_aml (walk_state);

X acpi_ps_delete_parse_tree (op);
X
X return_ACPI_STATUS (status);
@@ -668,7 +719,7 @@
X acpi_ut_remove_reference (operand_desc);
X
X
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Rgn_obj %p Addr %8.8lX%8.8lX Len %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Rgn_obj %p Addr %8.8X%8.8X Len %X\n",
X obj_desc, HIDWORD(obj_desc->region.address), LODWORD(obj_desc->region.address),
X obj_desc->region.length));
X
@@ -731,7 +782,7 @@
X * of a loop
X */
X walk_state->control_state->control.aml_predicate_start =
- walk_state->parser_state->aml - 1;
+ walk_state->parser_state.aml - 1;
X /* TBD: can this be removed? */
X /*Acpi_ps_pkg_length_encoding_size (GET8 (Walk_state->Parser_state->Aml));*/
X break;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/dispatcher/dsutils.c linux/drivers/acpi/dispatcher/dsutils.c
--- v2.4.13/linux/drivers/acpi/dispatcher/dsutils.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/dispatcher/dsutils.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*******************************************************************************
X *

X * Module Name: dsutils - Dispatcher utilities
- * $Revision: 72 $
+ * $Revision: 80 $


X *
X ******************************************************************************/
X

@@ -85,8 +85,8 @@
X */
X
X parent_info = acpi_ps_get_opcode_info (op->parent->opcode);
- if (ACPI_GET_OP_TYPE (parent_info) != ACPI_OP_TYPE_OPCODE) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown parent opcode. Op=%X\n", op));
+ if (parent_info->class == AML_CLASS_UNKNOWN) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown parent opcode. Op=%p\n", op));
X return_VALUE (FALSE);
X }
X
@@ -97,11 +97,11 @@
X * Otherwise leave it as is, it will be deleted when it is used
X * as an operand later.
X */
- switch (ACPI_GET_OP_CLASS (parent_info)) {
+ switch (parent_info->class) {
X /*
X * In these cases, the parent will never use the return object
X */
- case OPTYPE_CONTROL: /* IF, ELSE, WHILE only */
+ case AML_CLASS_CONTROL: /* IF, ELSE, WHILE only */
X
X switch (op->parent->opcode) {
X case AML_RETURN_OP:
@@ -109,7 +109,7 @@
X /* Never delete the return value associated with a return opcode */
X
X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Result used, [RETURN] opcode=%X Op=%X\n", op->opcode, op));
+ "Result used, [RETURN] opcode=%X Op=%p\n", op->opcode, op));
X return_VALUE (TRUE);
X break;
X
@@ -123,7 +123,7 @@
X if ((walk_state->control_state->common.state == CONTROL_PREDICATE_EXECUTING) &&
X (walk_state->control_state->control.predicate_op == op)) {
X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Result used as a predicate, [IF/WHILE] opcode=%X Op=%X\n",
+ "Result used as a predicate, [IF/WHILE] opcode=%X Op=%p\n",
X op->opcode, op));
X return_VALUE (TRUE);
X }
@@ -135,7 +135,8 @@
X /* Fall through to not used case below */
X
X
- case OPTYPE_NAMED_OBJECT: /* Scope, method, etc. */
+ case AML_CLASS_NAMED_OBJECT: /* Scope, method, etc. */
+ case AML_CLASS_CREATE:
X
X /*
X * These opcodes allow Term_arg(s) as operands and therefore
@@ -149,13 +150,13 @@
X (op->parent->opcode == AML_CREATE_DWORD_FIELD_OP) ||
X (op->parent->opcode == AML_CREATE_QWORD_FIELD_OP)) {
X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Result used, [Region or Create_field] opcode=%X Op=%X\n",
+ "Result used, [Region or Create_field] opcode=%X Op=%p\n",
X op->opcode, op));
X return_VALUE (TRUE);
X }
X
X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Result not used, Parent opcode=%X Op=%X\n", op->opcode, op));
+ "Result not used, Parent opcode=%X Op=%p\n", op->opcode, op));
X
X return_VALUE (FALSE);
X break;
@@ -338,6 +339,11 @@
X * very serious error at this point
X */
X status = AE_AML_NAME_NOT_FOUND;
+
+ /* TBD: Externalize Name_string and print */
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Object name was not found in namespace\n"));
X }
X }
X
@@ -580,16 +586,21 @@
X
X
X op_info = acpi_ps_get_opcode_info (opcode);


- if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) {

+ if (op_info->class == AML_CLASS_UNKNOWN) {
X /* Unknown opcode */
X
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown AML opcode: %x\n", opcode));
X return (data_type);
X }


X
- switch (ACPI_GET_OP_CLASS (op_info)) {

X
- case OPTYPE_LITERAL:
+/*
+ * TBD: Use op class
+ */
+
+ switch (op_info->type) {
+
+ case AML_TYPE_LITERAL:
X
X switch (opcode) {
X case AML_BYTE_OP:
@@ -618,7 +629,7 @@
X break;
X
X
- case OPTYPE_DATA_TERM:
+ case AML_TYPE_DATA_TERM:
X
X switch (opcode) {
X case AML_BUFFER_OP:
@@ -640,44 +651,49 @@
X break;
X
X
- case OPTYPE_CONSTANT:
- case OPTYPE_METHOD_ARGUMENT:
- case OPTYPE_LOCAL_VARIABLE:
+ case AML_TYPE_CONSTANT:
+ case AML_TYPE_METHOD_ARGUMENT:
+ case AML_TYPE_LOCAL_VARIABLE:
X
X data_type = INTERNAL_TYPE_REFERENCE;
X break;
X
X
- case OPTYPE_MONADIC2:
- case OPTYPE_MONADIC2_r:
- case OPTYPE_DYADIC2:
- case OPTYPE_DYADIC2_r:
- case OPTYPE_DYADIC2_s:
- case OPTYPE_TRIADIC:
- case OPTYPE_QUADRADIC:
- case OPTYPE_HEXADIC:
- case OPTYPE_RETURN:
+ case AML_TYPE_EXEC_1A_0T_1R:
+ case AML_TYPE_EXEC_1A_1T_1R:
+ case AML_TYPE_EXEC_2A_0T_1R:
+ case AML_TYPE_EXEC_2A_1T_1R:
+ case AML_TYPE_EXEC_2A_2T_1R:
+ case AML_TYPE_EXEC_3A_1T_1R:
+ case AML_TYPE_EXEC_6A_0T_1R:
+ case AML_TYPE_RETURN:
X
X flags = OP_HAS_RETURN_VALUE;
X data_type = ACPI_TYPE_ANY;
X break;
X
X
- case OPTYPE_METHOD_CALL:
+ case AML_TYPE_METHOD_CALL:
X
X flags = OP_HAS_RETURN_VALUE;
X data_type = ACPI_TYPE_METHOD;
X break;
X
X
- case OPTYPE_NAMED_OBJECT:
+ case AML_TYPE_NAMED_FIELD:
+ case AML_TYPE_NAMED_SIMPLE:
+ case AML_TYPE_NAMED_COMPLEX:
+ case AML_TYPE_NAMED_NO_OBJ:
X
X data_type = acpi_ds_map_named_opcode_to_data_type (opcode);
X break;
X
X
- case OPTYPE_DYADIC1:
- case OPTYPE_CONTROL:
+ case AML_TYPE_EXEC_1A_0T_0R:
+ case AML_TYPE_EXEC_2A_0T_0R:
+ case AML_TYPE_EXEC_3A_0T_0R:
+ case AML_TYPE_EXEC_1A_1T_0R:
+ case AML_TYPE_CONTROL:
X
X /* No mapping needed at this time */
X
@@ -784,6 +800,7 @@
X data_type = ACPI_TYPE_EVENT;
X break;
X
+ case AML_DATA_REGION_OP:
X case AML_REGION_OP:
X data_type = ACPI_TYPE_REGION;
X break;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/dispatcher/dswexec.c linux/drivers/acpi/dispatcher/dswexec.c
--- v2.4.13/linux/drivers/acpi/dispatcher/dswexec.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/dispatcher/dswexec.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X *

X * Module Name: dswexec - Dispatcher method execution callbacks;
X * dispatch to interpreter.
- * $Revision: 70 $
+ * $Revision: 79 $


X *
X *****************************************************************************/
X

@@ -37,6 +37,21 @@
X #define _COMPONENT ACPI_DISPATCHER
X MODULE_NAME ("dswexec")
X
+/*
+ * Dispatch tables for opcode classes
+ */
+ACPI_EXECUTE_OP acpi_gbl_op_type_dispatch [] = {
+ acpi_ex_opcode_1A_0T_0R,
+ acpi_ex_opcode_1A_0T_1R,
+ acpi_ex_opcode_1A_1T_0R,
+ acpi_ex_opcode_1A_1T_1R,
+ acpi_ex_opcode_2A_0T_0R,
+ acpi_ex_opcode_2A_0T_1R,
+ acpi_ex_opcode_2A_1T_1R,
+ acpi_ex_opcode_2A_2T_1R,
+ acpi_ex_opcode_3A_0T_0R,
+ acpi_ex_opcode_3A_1T_1R,
+ acpi_ex_opcode_6A_0T_1R};
X
X /*****************************************************************************
X *
@@ -53,9 +68,7 @@
X acpi_status
X acpi_ds_get_predicate_value (
X acpi_walk_state *walk_state,
- acpi_parse_object *op,
- u32 has_result_obj)
-{
+ u32 has_result_obj) {


X acpi_status status = AE_OK;

X acpi_operand_object *obj_desc;
X
@@ -77,7 +90,7 @@
X }
X
X else {
- status = acpi_ds_create_operand (walk_state, op, 0);
+ status = acpi_ds_create_operand (walk_state, walk_state->op, 0);
X if (ACPI_FAILURE (status)) {
X return_ACPI_STATUS (status);
X }
@@ -91,7 +104,7 @@
X }
X
X if (!obj_desc) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No predicate Obj_desc=%X State=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No predicate Obj_desc=%p State=%p\n",
X obj_desc, walk_state));
X
X return_ACPI_STATUS (AE_AML_NO_OPERAND);
@@ -104,7 +117,7 @@
X */
X if (obj_desc->common.type != ACPI_TYPE_INTEGER) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Bad predicate (not a number) Obj_desc=%X State=%X Type=%X\n",
+ "Bad predicate (not a number) Obj_desc=%p State=%p Type=%X\n",
X obj_desc, walk_state, obj_desc->common.type));
X
X status = AE_AML_OPERAND_TYPE;
@@ -136,8 +149,8 @@
X
X cleanup:
X
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%X\n",
- walk_state->control_state->common.value, op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%pn",
+ walk_state->control_state->common.value, walk_state->op));
X
X /* Break to debugger to display result */
X
@@ -159,8 +172,7 @@
X * FUNCTION: Acpi_ds_exec_begin_op
X *
X * PARAMETERS: Walk_state - Current state of the parse tree walk
- * Op - Op that has been just been reached in the
- * walk; Arguments have not been evaluated yet.
+ * Out_op - Return op if a new one is created


X *
X * RETURN: Status
X *

@@ -172,26 +184,28 @@
X
X acpi_status
X acpi_ds_exec_begin_op (
- u16 opcode,
- acpi_parse_object *op,
X acpi_walk_state *walk_state,
X acpi_parse_object **out_op)
X {
- const acpi_opcode_info *op_info;
+ acpi_parse_object *op;


X acpi_status status = AE_OK;

- u8 opcode_class;
+ u32 opcode_class;
X
X
- FUNCTION_TRACE_PTR ("Ds_exec_begin_op", op);
+ FUNCTION_TRACE_PTR ("Ds_exec_begin_op", walk_state);
X
X
+ op = walk_state->op;
X if (!op) {
- status = acpi_ds_load2_begin_op (opcode, NULL, walk_state, out_op);
+ status = acpi_ds_load2_begin_op (walk_state, out_op);
X if (ACPI_FAILURE (status)) {
X return_ACPI_STATUS (status);
X }
X
X op = *out_op;
+ walk_state->op = op;
+ walk_state->op_info = acpi_ps_get_opcode_info (op->opcode);
+ walk_state->opcode = op->opcode;
X }
X
X if (op == walk_state->origin) {
@@ -210,7 +224,7 @@
X if ((walk_state->control_state) &&
X (walk_state->control_state->common.state ==
X CONTROL_CONDITIONAL_EXECUTING)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%X State=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n",
X op, walk_state));
X
X walk_state->control_state->common.state = CONTROL_PREDICATE_EXECUTING;
@@ -221,20 +235,19 @@
X }
X
X

- op_info = acpi_ps_get_opcode_info (op->opcode);

- opcode_class = (u8) ACPI_GET_OP_CLASS (op_info);
+ opcode_class = walk_state->op_info->class;
X
X /* We want to send namepaths to the load code */
X
X if (op->opcode == AML_INT_NAMEPATH_OP) {
- opcode_class = OPTYPE_NAMED_OBJECT;
+ opcode_class = AML_CLASS_NAMED_OBJECT;
X }
X
X /*
X * Handle the opcode based upon the opcode type
X */
X switch (opcode_class) {
- case OPTYPE_CONTROL:
+ case AML_CLASS_CONTROL:
X
X status = acpi_ds_result_stack_push (walk_state);
X if (ACPI_FAILURE (status)) {
@@ -245,7 +258,7 @@
X break;
X
X
- case OPTYPE_NAMED_OBJECT:
+ case AML_CLASS_NAMED_OBJECT:
X
X if (walk_state->walk_type == WALK_METHOD) {
X /*
@@ -255,7 +268,7 @@
X * will be deleted upon completion of the execution
X * of this method.
X */
- status = acpi_ds_load2_begin_op (op->opcode, op, walk_state, NULL);
+ status = acpi_ds_load2_begin_op (walk_state, NULL);
X }
X
X
@@ -268,18 +281,8 @@
X
X /* most operators with arguments */
X
- case OPTYPE_MONADIC1:
- case OPTYPE_DYADIC1:
- case OPTYPE_MONADIC2:
- case OPTYPE_MONADIC2_r:
- case OPTYPE_DYADIC2:
- case OPTYPE_DYADIC2_r:
- case OPTYPE_DYADIC2_s:
- case OPTYPE_RECONFIGURATION:
- case OPTYPE_TRIADIC:
- case OPTYPE_QUADRADIC:
- case OPTYPE_HEXADIC:
- case OPTYPE_CREATE_FIELD:
+ case AML_CLASS_EXECUTE:
+ case AML_CLASS_CREATE:
X
X /* Start a new result/operand state */
X
@@ -315,85 +318,53 @@
X
X acpi_status
X acpi_ds_exec_end_op (
- acpi_walk_state *walk_state,
- acpi_parse_object *op)
+ acpi_walk_state *walk_state)
X {
+ acpi_parse_object *op;


X acpi_status status = AE_OK;

- u16 opcode;
- u8 optype;
+ u32 op_type;
+ u32 op_class;
X acpi_parse_object *next_op;
X acpi_parse_object *first_arg;
- acpi_operand_object *result_obj = NULL;
- const acpi_opcode_info *op_info;
X u32 i;
X
X
- FUNCTION_TRACE_PTR ("Ds_exec_end_op", op);
-
+ FUNCTION_TRACE_PTR ("Ds_exec_end_op", walk_state);
X
- opcode = (u16) op->opcode;
X
+ op = walk_state->op;
+ op_type = walk_state->op_info->type;
+ op_class = walk_state->op_info->class;


X
- op_info = acpi_ps_get_opcode_info (op->opcode);
- if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) {

+ if (op_class == AML_CLASS_UNKNOWN) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode %X\n", op->opcode));
X return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
X }
X
- optype = (u8) ACPI_GET_OP_CLASS (op_info);
X first_arg = op->value.arg;
X
X /* Init the walk state */
X
X walk_state->num_operands = 0;
X walk_state->return_desc = NULL;
- walk_state->op_info = op_info;
- walk_state->opcode = opcode;
+ walk_state->result_obj = NULL;
X
X
X /* Call debugger for single step support (DEBUG build only) */
X
- DEBUGGER_EXEC (status = acpi_db_single_step (walk_state, op, optype));
+ DEBUGGER_EXEC (status = acpi_db_single_step (walk_state, op, op_class));
X DEBUGGER_EXEC (if (ACPI_FAILURE (status)) {return_ACPI_STATUS (status);});
X
X
- /* Decode the opcode */
-
- switch (optype) {
- case OPTYPE_UNDEFINED:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Undefined opcode type Op=%X\n", op));
- return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
- break;
-
-
- case OPTYPE_BOGUS:
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Internal opcode=%X type Op=%X\n",
- opcode, op));
- break;
+ switch (op_class) {
+ /* Decode the Opcode Class */
X

- case OPTYPE_CONSTANT: /* argument type only */
- case OPTYPE_LITERAL: /* argument type only */
- case OPTYPE_DATA_TERM: /* argument type only */
- case OPTYPE_LOCAL_VARIABLE: /* argument type only */
- case OPTYPE_METHOD_ARGUMENT: /* argument type only */

+ case AML_CLASS_ARGUMENT: /* constants, literals, etc. do nothing */

X break;
X
-
X /* most operators with arguments */
X
- case OPTYPE_MONADIC1:
- case OPTYPE_DYADIC1:
- case OPTYPE_MONADIC2:
- case OPTYPE_MONADIC2_r:
- case OPTYPE_DYADIC2:
- case OPTYPE_DYADIC2_r:
- case OPTYPE_DYADIC2_s:
- case OPTYPE_RECONFIGURATION:
- case OPTYPE_TRIADIC:
- case OPTYPE_QUADRADIC:
- case OPTYPE_HEXADIC:
-
+ case AML_CLASS_EXECUTE:
X
X /* Build resolved operand stack */
X
@@ -411,14 +382,14 @@
X
X /* Resolve all operands */
X
- status = acpi_ex_resolve_operands (opcode,
+ status = acpi_ex_resolve_operands (walk_state->opcode,
X &(walk_state->operands [walk_state->num_operands -1]),
X walk_state);
X if (ACPI_FAILURE (status)) {
X /* TBD: must pop and delete operands */
X
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%s]: Could not resolve operands, %s\n",
- acpi_ps_get_opcode_name (opcode), acpi_format_exception (status)));
+ acpi_ps_get_opcode_name (walk_state->opcode), acpi_format_exception (status)));
X
X /*
X * On error, we must delete all the operands and clear the
@@ -430,103 +401,31 @@
X }
X
X walk_state->num_operands = 0;
-
X goto cleanup;
X }
X
- DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, acpi_ps_get_opcode_name (opcode),
+ DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, acpi_ps_get_opcode_name (walk_state->opcode),
X walk_state->num_operands, "after Ex_resolve_operands");
X
- switch (optype) {
- case OPTYPE_MONADIC1:
-
- /* 1 Operand, 0 External_result, 0 Internal_result */
-
- status = acpi_ex_monadic1 (opcode, walk_state);
- break;
-
-
- case OPTYPE_MONADIC2:
-
- /* 1 Operand, 0 External_result, 1 Internal_result */
-
- status = acpi_ex_monadic2 (opcode, walk_state, &result_obj);
- break;
-
-
- case OPTYPE_MONADIC2_r:
-
- /* 1 Operand, 1 External_result, 1 Internal_result */
-
- status = acpi_ex_monadic2_r (opcode, walk_state, &result_obj);
- break;
-
-
- case OPTYPE_DYADIC1:
-
- /* 2 Operands, 0 External_result, 0 Internal_result */
-
- status = acpi_ex_dyadic1 (opcode, walk_state);
- break;
-
-
- case OPTYPE_DYADIC2:
-
- /* 2 Operands, 0 External_result, 1 Internal_result */
-
- status = acpi_ex_dyadic2 (opcode, walk_state, &result_obj);
- break;
-
-
- case OPTYPE_DYADIC2_r:
-
- /* 2 Operands, 1 or 2 External_results, 1 Internal_result */
-
- status = acpi_ex_dyadic2_r (opcode, walk_state, &result_obj);
- break;
-
-
- case OPTYPE_DYADIC2_s: /* Synchronization Operator */
-
- /* 2 Operands, 0 External_result, 1 Internal_result */
-
- status = acpi_ex_dyadic2_s (opcode, walk_state, &result_obj);
- break;
-
-
- case OPTYPE_TRIADIC: /* Opcode with 3 operands */
-
- /* 3 Operands, 1 External_result, 1 Internal_result */
-
- status = acpi_ex_triadic (opcode, walk_state, &result_obj);
- break;
-
-
- case OPTYPE_QUADRADIC: /* Opcode with 4 operands */
- break;
-
-
- case OPTYPE_HEXADIC: /* Opcode with 6 operands */
-
- /* 6 Operands, 0 External_result, 1 Internal_result */
-
- status = acpi_ex_hexadic (opcode, walk_state, &result_obj);
- break;
-
-
- case OPTYPE_RECONFIGURATION:
-
- /* 1 or 2 operands, 0 Internal Result */
+ /*
+ * Dispatch the request to the appropriate interpreter handler
+ * routine. There is one routine per opcode "type" based upon the
+ * number of opcode arguments and return type.
+ */
+ status = acpi_gbl_op_type_dispatch [op_type] (walk_state);
X
- status = acpi_ex_reconfiguration (opcode, walk_state);
- break;
- }
X
- /* Clear the operand stack */
+ /* Delete argument objects and clear the operand stack */
X
X for (i = 0; i < walk_state->num_operands; i++) {
+ /*
+ * Remove a reference to all operands, including both
+ * "Arguments" and "Targets".
+ */
+ acpi_ut_remove_reference (walk_state->operands[i]);
X walk_state->operands[i] = NULL;
X }
+
X walk_state->num_operands = 0;
X
X /*
@@ -534,144 +433,140 @@
X * current result stack
X */
X if (ACPI_SUCCESS (status) &&
- result_obj) {
- status = acpi_ds_result_push (result_obj, walk_state);
+ walk_state->result_obj) {
+ status = acpi_ds_result_push (walk_state->result_obj, walk_state);
X }
X
X break;
X
X
- case OPTYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
+ default:
X
- /* 1 Operand, 0 External_result, 0 Internal_result */
+ switch (op_type) {
+ case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
X
- status = acpi_ds_exec_end_control_op (walk_state, op);
+ /* 1 Operand, 0 External_result, 0 Internal_result */
X
- acpi_ds_result_stack_pop (walk_state);
- break;
+ status = acpi_ds_exec_end_control_op (walk_state, op);
X
+ acpi_ds_result_stack_pop (walk_state);
+ break;
X
- case OPTYPE_METHOD_CALL:
X
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%X\n", op));
+ case AML_TYPE_METHOD_CALL:
X
- /*
- * (AML_METHODCALL) Op->Value->Arg->Node contains
- * the method Node pointer
- */
- /* Next_op points to the op that holds the method name */
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", op));
X
- next_op = first_arg;
+ /*
+ * (AML_METHODCALL) Op->Value->Arg->Node contains
+ * the method Node pointer
+ */
+ /* Next_op points to the op that holds the method name */
X
- /* Next_op points to first argument op */
+ next_op = first_arg;
X
- next_op = next_op->next;
+ /* Next_op points to first argument op */
X
- /*
- * Get the method's arguments and put them on the operand stack
- */
- status = acpi_ds_create_operands (walk_state, next_op);
- if (ACPI_FAILURE (status)) {
- break;
- }
-
- /*
- * Since the operands will be passed to another
- * control method, we must resolve all local
- * references here (Local variables, arguments
- * to *this* method, etc.)
- */
- status = acpi_ds_resolve_operands (walk_state);
- if (ACPI_FAILURE (status)) {
- break;
- }
-
- /*
- * Tell the walk loop to preempt this running method and
- * execute the new method
- */
- status = AE_CTRL_TRANSFER;
-
- /*
- * Return now; we don't want to disturb anything,
- * especially the operand count!
- */
- return_ACPI_STATUS (status);
- break;
+ next_op = next_op->next;
X
+ /*
+ * Get the method's arguments and put them on the operand stack
+ */
+ status = acpi_ds_create_operands (walk_state, next_op);
+ if (ACPI_FAILURE (status)) {
+ break;
+ }
X
- case OPTYPE_CREATE_FIELD:
+ /*
+ * Since the operands will be passed to another
+ * control method, we must resolve all local
+ * references here (Local variables, arguments
+ * to *this* method, etc.)
+ */
+ status = acpi_ds_resolve_operands (walk_state);
+ if (ACPI_FAILURE (status)) {
+ break;
+ }
X
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Executing Create_field Buffer/Index Op=%X\n", op));
+ /*
+ * Tell the walk loop to preempt this running method and
+ * execute the new method
+ */
+ status = AE_CTRL_TRANSFER;
X
- status = acpi_ds_load2_end_op (walk_state, op);
- if (ACPI_FAILURE (status)) {
+ /*
+ * Return now; we don't want to disturb anything,
+ * especially the operand count!
+ */
+ return_ACPI_STATUS (status);
X break;
- }
X
- status = acpi_ds_eval_buffer_field_operands (walk_state, op);
- break;
X
+ case AML_TYPE_CREATE_FIELD:
X
- case OPTYPE_NAMED_OBJECT:
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Executing Create_field Buffer/Index Op=%p\n", op));
X
- status = acpi_ds_load2_end_op (walk_state, op);
- if (ACPI_FAILURE (status)) {
+ status = acpi_ds_load2_end_op (walk_state);
+ if (ACPI_FAILURE (status)) {
+ break;
+ }
+
+ status = acpi_ds_eval_buffer_field_operands (walk_state, op);
X break;
- }
X
- switch (op->opcode) {
- case AML_REGION_OP:
X
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Executing Op_region Address/Length Op=%X\n", op));
+ case AML_TYPE_NAMED_FIELD:
+ case AML_TYPE_NAMED_COMPLEX:
+ case AML_TYPE_NAMED_SIMPLE:
X
- status = acpi_ds_eval_region_operands (walk_state, op);
+ status = acpi_ds_load2_end_op (walk_state);
X if (ACPI_FAILURE (status)) {
X break;
X }
X
- status = acpi_ds_result_stack_pop (walk_state);
- break;
+ if (op->opcode == AML_REGION_OP) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Executing Op_region Address/Length Op=%p\n", op));
+
+ status = acpi_ds_eval_region_operands (walk_state, op);
+ if (ACPI_FAILURE (status)) {
+ break;
+ }
X
+ status = acpi_ds_result_stack_pop (walk_state);
+ }
X
- case AML_METHOD_OP:
X break;
X
+ case AML_TYPE_UNDEFINED:
X
- case AML_ALIAS_OP:
-
- /* Alias creation was already handled by call
- to psxload above */
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Undefined opcode type Op=%p\n", op));
+ return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
X break;
X
X
- default:
- /* Nothing needs to be done */
-
- status = AE_OK;
+ case AML_TYPE_BOGUS:
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Internal opcode=%X type Op=%p\n",
+ walk_state->opcode, op));
X break;
- }
-
- break;
X
- default:
+ default:
X
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Unimplemented opcode, type=%X Opcode=%X Op=%X\n",
- optype, op->opcode, op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n",
+ op_class, op_type, op->opcode, op));
X
- status = AE_NOT_IMPLEMENTED;
- break;
+ status = AE_NOT_IMPLEMENTED;
+ break;
+ }


X }
X
-
X /*

X * ACPI 2.0 support for 64-bit integers:
X * Truncate numeric result value if we are executing from a 32-bit ACPI table
X */
- acpi_ex_truncate_for32bit_table (result_obj, walk_state);
+ acpi_ex_truncate_for32bit_table (walk_state->result_obj, walk_state);
X
X /*
X * Check if we just completed the evaluation of a
@@ -682,23 +577,23 @@
X (walk_state->control_state->common.state ==
X CONTROL_PREDICATE_EXECUTING) &&
X (walk_state->control_state->control.predicate_op == op)) {
- status = acpi_ds_get_predicate_value (walk_state, op, (u32) result_obj);
- result_obj = NULL;
+ status = acpi_ds_get_predicate_value (walk_state, (u32) walk_state->result_obj);
+ walk_state->result_obj = NULL;
X }
X
X
X cleanup:
- if (result_obj) {
+ if (walk_state->result_obj) {
X /* Break to debugger to display result */
X
- DEBUGGER_EXEC (acpi_db_display_result_object (result_obj, walk_state));
+ DEBUGGER_EXEC (acpi_db_display_result_object (walk_state->result_obj, walk_state));
X
X /*
X * Delete the result op if and only if:
X * Parent will not use the result -- such as any
X * non-nested type2 op in a method (parent will be method)
X */
- acpi_ds_delete_result_if_not_used (op, result_obj, walk_state);
+ acpi_ds_delete_result_if_not_used (op, walk_state->result_obj, walk_state);
X }
X
X /* Always clear the object stack */
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/dispatcher/dswload.c linux/drivers/acpi/dispatcher/dswload.c
--- v2.4.13/linux/drivers/acpi/dispatcher/dswload.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/dispatcher/dswload.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************

SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 12'
echo 'File patch-2.4.14 is continued in part 13'
echo "13" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:28 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part05

#!/bin/sh -x
# this is part 05 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 05; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set

-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_PMC551 is not set

-# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_REDBOOT_PARTS=y


+CONFIG_MTD_BOOTLDR_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set

X
X #
-# MTD drivers for mapped chips


+# User Modules And Translation Layers
X #

-CONFIG_MTD_CFI=m
-CONFIG_MTD_CFI_INTELEXT=m
-CONFIG_MTD_CFI_AMDSTD=m


-# CONFIG_MTD_JEDEC is not set

+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y

+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_CFI_B1 is not set
+# CONFIG_MTD_CFI_B2 is not set
+CONFIG_MTD_CFI_B4=y
+# CONFIG_MTD_CFI_I1 is not set
+CONFIG_MTD_CFI_I2=y

+# CONFIG_MTD_CFI_I4 is not set


+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set

X # CONFIG_MTD_RAM is not set
X # CONFIG_MTD_ROM is not set

-CONFIG_MTD_PHYSMAP=m
-CONFIG_MTD_PHYSMAP_START=0
-CONFIG_MTD_PHYSMAP_LEN=0


+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set

+# CONFIG_MTD_AMDSTD is not set
+# CONFIG_MTD_SHARP is not set

+# CONFIG_MTD_JEDEC is not set
X
X #

-# Drivers for chip mappings


+# Mapping drivers for chip access
X #

-# CONFIG_MTD_MIXMEM is not set
+# CONFIG_MTD_PHYSMAP is not set


X # CONFIG_MTD_NORA is not set

-# CONFIG_MTD_OCTAGON is not set

-# CONFIG_MTD_PNC2000 is not set
-# CONFIG_MTD_RPXLITE is not set

-# CONFIG_MTD_VMAX is not set


+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_CDB89712 is not set

+CONFIG_MTD_SA1100=y


+# CONFIG_MTD_DC21285 is not set
+# CONFIG_MTD_IQ80310 is not set

+# CONFIG_MTD_PCI is not set
X
X #
-# User modules and translation layers for MTD devices


+# Self-contained MTD device drivers
X #

-CONFIG_MTD_CHAR=m
-CONFIG_MTD_BLOCK=m


-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set

+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set

+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set

+
+#
+# Disk-On-Chip Device Drivers
+#

+# CONFIG_MTD_DOC1000 is not set
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOCPROBE is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
X
X #
X # Plug and Play configuration

X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set


+# CONFIG_PNPBIOS is not set

X
X #
X # Block devices
@@ -164,39 +258,41 @@
X # CONFIG_BLK_DEV_XD is not set
X # CONFIG_PARIDE is not set
X # CONFIG_BLK_CPQ_DA is not set


+# CONFIG_BLK_CPQ_CISS_DA is not set

+# CONFIG_CISS_SCSI_TAPE is not set
X # CONFIG_BLK_DEV_DAC960 is not set
X CONFIG_BLK_DEV_LOOP=m

-CONFIG_BLK_DEV_NBD=m
-# CONFIG_BLK_DEV_LVM is not set


+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=8192

+CONFIG_BLK_DEV_INITRD=y
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set

X # CONFIG_BLK_DEV_MD is not set
X # CONFIG_MD_LINEAR is not set
X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_BLK_DEV_FLASH=y
+# CONFIG_MD_MULTIPATH is not set


+# CONFIG_BLK_DEV_LVM is not set

X
X #
X # Networking options
X #
-CONFIG_PACKET=y


-# CONFIG_PACKET_MMAP is not set

-CONFIG_NETLINK=y
-CONFIG_RTNETLINK=y
-CONFIG_NETLINK_DEV=y
+# CONFIG_PACKET is not set


+# CONFIG_NETLINK is not set

X # CONFIG_NETFILTER is not set
X # CONFIG_FILTER is not set
X CONFIG_UNIX=y

X CONFIG_INET=y
-CONFIG_IP_MULTICAST=y


+# CONFIG_IP_MULTICAST is not set

X # CONFIG_IP_ADVANCED_ROUTER is not set

X # CONFIG_IP_PNP is not set


X # CONFIG_NET_IPIP is not set

X # CONFIG_NET_IPGRE is not set

-# CONFIG_IP_MROUTE is not set
-# CONFIG_ARPD is not set
X # CONFIG_INET_ECN is not set
X # CONFIG_SYN_COOKIES is not set
X # CONFIG_IPV6 is not set
@@ -213,6 +309,7 @@
X # CONFIG_X25 is not set
X # CONFIG_LAPB is not set
X # CONFIG_LLC is not set


+# CONFIG_NET_DIVERT is not set

X # CONFIG_ECONET is not set
X # CONFIG_WAN_ROUTER is not set
X # CONFIG_NET_FASTROUTE is not set
@@ -236,8 +333,6 @@


X # CONFIG_BONDING is not set
X # CONFIG_EQUALIZER is not set
X # CONFIG_TUN is not set

-# CONFIG_ETHERTAP is not set


-# CONFIG_NET_SB1000 is not set
X
X #
X # Ethernet (10 or 100Mbit)

@@ -247,13 +342,19 @@
X #


X # Ethernet (1000 Mbit)
X #

-# CONFIG_YELLOWFIN is not set
X # CONFIG_ACENIC is not set


+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set

X # CONFIG_SK98LIN is not set
X # CONFIG_FDDI is not set
X # CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set

X CONFIG_PPP=m
X # CONFIG_PPP_MULTILINK is not set


+# CONFIG_PPP_FILTER is not set

X CONFIG_PPP_ASYNC=m
X # CONFIG_PPP_SYNC_TTY is not set
X CONFIG_PPP_DEFLATE=m
@@ -286,17 +387,13 @@


X # CONFIG_PCMCIA_3C589 is not set
X # CONFIG_PCMCIA_3C574 is not set
X # CONFIG_PCMCIA_FMVJ18X is not set
-CONFIG_PCMCIA_PCNET=m
+CONFIG_PCMCIA_PCNET=y
X # CONFIG_PCMCIA_NMCLAN is not set
X # CONFIG_PCMCIA_SMC91C92 is not set
X # CONFIG_PCMCIA_XIRC2PS is not set

X # CONFIG_ARCNET_COM20020_CS is not set
X # CONFIG_PCMCIA_IBMTR is not set
-CONFIG_NET_PCMCIA_RADIO=y
-# CONFIG_PCMCIA_RAYCS is not set
-# CONFIG_PCMCIA_NETWAVE is not set
-# CONFIG_PCMCIA_WAVELAN is not set
-# CONFIG_AIRONET4500_CS is not set


+# CONFIG_NET_PCMCIA_RADIO is not set

X
X #
X # Amateur Radio support
@@ -306,7 +403,43 @@
X #
X # IrDA (infrared) support
X #


-# CONFIG_IRDA is not set

+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+# CONFIG_IRDA_ULTRA is not set
+# CONFIG_IRDA_OPTIONS is not set
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+# CONFIG_IRTTY_SIR is not set
+# CONFIG_IRPORT_SIR is not set
+
+#
+# Dongle support
+#
+# CONFIG_DONGLE is not set
+
+#
+# FIR device drivers
+#
+# CONFIG_USB_IRDA is not set
+# CONFIG_NSC_FIR is not set
+# CONFIG_WINBOND_FIR is not set
+# CONFIG_TOSHIBA_FIR is not set
+# CONFIG_SMC_IRCC_FIR is not set


+# CONFIG_ALI_FIR is not set
+# CONFIG_VLSI_FIR is not set

+CONFIG_SA1100_FIR=m
X
X #
X # ATA/IDE/MFM/RLL support
@@ -334,10 +467,10 @@


X # CONFIG_BLK_DEV_IDEDISK_WD is not set
X # CONFIG_BLK_DEV_COMMERIAL is not set
X # CONFIG_BLK_DEV_TIVO is not set
-CONFIG_BLK_DEV_IDECS=m

+# CONFIG_BLK_DEV_IDECS is not set
X CONFIG_BLK_DEV_IDECD=m
-CONFIG_BLK_DEV_IDETAPE=m
-CONFIG_BLK_DEV_IDEFLOPPY=m


+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set

X # CONFIG_BLK_DEV_IDESCSI is not set
X
X #
@@ -350,6 +483,9 @@
X # CONFIG_IDEDMA_AUTO is not set
X # CONFIG_DMA_NONPCI is not set
X # CONFIG_BLK_DEV_IDE_MODES is not set


+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set

+# CONFIG_BLK_DEV_ATARAID_HPT is not set
X
X #
X # SCSI support
@@ -374,20 +510,47 @@
X # Input core support
X #
X # CONFIG_INPUT is not set


+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set

X
X #
X # Character devices
X #
X CONFIG_VT=y
-CONFIG_VT_CONSOLE=y
-# CONFIG_SERIAL is not set
+# CONFIG_VT_CONSOLE is not set
+CONFIG_SERIAL=m


X # CONFIG_SERIAL_EXTENDED is not set
X # CONFIG_SERIAL_NONSTANDARD is not set

+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_ANAKIN is not set
+# CONFIG_SERIAL_ANAKIN_CONSOLE is not set
+# CONFIG_SERIAL_AMBA is not set
+# CONFIG_SERIAL_AMBA_CONSOLE is not set
+# CONFIG_SERIAL_CLPS711X is not set
+# CONFIG_SERIAL_CLPS711X_CONSOLE is not set
+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set

+# CONFIG_SERIAL_UART00 is not set

+# CONFIG_SERIAL_UART00_CONSOLE is not set
X CONFIG_SERIAL_SA1100=y
X CONFIG_SERIAL_SA1100_CONSOLE=y
-CONFIG_SA1100_DEFAULT_BAUDRATE=115200


-# CONFIG_TOUCHSCREEN_UCB1200 is not set

-CONFIG_TOUCHSCREEN_BITSY=y
+CONFIG_SA1100_DEFAULT_BAUDRATE=38400
+CONFIG_SERIAL_8250=m


+# CONFIG_SERIAL_8250_CONSOLE is not set
+# CONFIG_SERIAL_8250_EXTENDED is not set
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_HUB6 is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y

X CONFIG_UNIX98_PTYS=y
X CONFIG_UNIX98_PTY_COUNT=32
X
@@ -397,15 +560,35 @@
X # CONFIG_I2C is not set
X
X #


+# L3 serial bus support
+#

+CONFIG_L3=y
+CONFIG_L3_ALGOBIT=y
+CONFIG_L3_BIT_SA1100_GPIO=y


+
+#
+# Other L3 adapters
+#

+# CONFIG_L3_SA1111 is not set

+CONFIG_BIT_SA1100_GPIO=y
+
+#
X # Mice
X #
X # CONFIG_BUSMOUSE is not set

-# CONFIG_MOUSE is not set

+CONFIG_MOUSE=m
+# CONFIG_PSMOUSE is not set
+# CONFIG_82C710_MOUSE is not set
+# CONFIG_PC110_PAD is not set
X
X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks
@@ -419,6 +602,7 @@
X # CONFIG_INTEL_RNG is not set
X # CONFIG_NVRAM is not set
X # CONFIG_RTC is not set
+CONFIG_SA1100_RTC=m
X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
@@ -429,7 +613,17 @@


X # CONFIG_FTAPE is not set
X # CONFIG_AGP is not set
X # CONFIG_DRM is not set
-# CONFIG_PCMCIA_SERIAL is not set
+
+#
+# PCMCIA character devices
+#

+# CONFIG_PCMCIA_SERIAL_CS is not set
+# CONFIG_MWAVE is not set


+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set

X
X #
X # File systems
@@ -437,23 +631,33 @@
X # CONFIG_QUOTA is not set
X # CONFIG_AUTOFS_FS is not set
X # CONFIG_AUTOFS4_FS is not set


+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set

X # CONFIG_ADFS_FS is not set
X # CONFIG_ADFS_FS_RW is not set


X # CONFIG_AFFS_FS is not set
X # CONFIG_HFS_FS is not set
X # CONFIG_BFS_FS is not set

+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set

X CONFIG_FAT_FS=m
X CONFIG_MSDOS_FS=m


X # CONFIG_UMSDOS_FS is not set

X CONFIG_VFAT_FS=m


X # CONFIG_EFS_FS is not set
-CONFIG_JFFS_FS=m

-CONFIG_JFFS_FS_VERBOSE=2
-CONFIG_CRAMFS=y


+# CONFIG_JFFS_FS is not set

+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_CRAMFS=m


+# CONFIG_TMPFS is not set

X CONFIG_RAMFS=y


X # CONFIG_ISO9660_FS is not set
X # CONFIG_JOLIET is not set

+# CONFIG_ZISOFS is not set


X # CONFIG_MINIX_FS is not set

+# CONFIG_FREEVXFS_FS is not set


X # CONFIG_NTFS_FS is not set
X # CONFIG_NTFS_RW is not set
X # CONFIG_HPFS_FS is not set

@@ -467,7 +671,6 @@


X # CONFIG_ROMFS_FS is not set
X CONFIG_EXT2_FS=y
X # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
X # CONFIG_UDF_FS is not set
X # CONFIG_UDF_RW is not set
X # CONFIG_UFS_FS is not set

@@ -477,15 +680,16 @@


X # Network File Systems
X #
X # CONFIG_CODA_FS is not set

-CONFIG_NFS_FS=m


+# CONFIG_INTERMEZZO_FS is not set
+CONFIG_NFS_FS=y

X # CONFIG_NFS_V3 is not set
X # CONFIG_ROOT_NFS is not set
X CONFIG_NFSD=m
X # CONFIG_NFSD_V3 is not set
-CONFIG_SUNRPC=m
-CONFIG_LOCKD=m
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
X CONFIG_SMB_FS=m
-CONFIG_SMB_NLS_REMOTE=""
+# CONFIG_SMB_NLS_DEFAULT is not set
X # CONFIG_NCP_FS is not set
X # CONFIG_NCPFS_PACKET_SIGNING is not set
X # CONFIG_NCPFS_IOCTL_LOCKING is not set
@@ -493,16 +697,17 @@
X # CONFIG_NCPFS_NFS_NS is not set
X # CONFIG_NCPFS_OS2_NS is not set
X # CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_NCPFS_MOUNT_SUBDIR is not set
-# CONFIG_NCPFS_NDS_DOMAINS is not set


X # CONFIG_NCPFS_NLS is not set
X # CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set

+CONFIG_ZLIB_FS_INFLATE=m
X
X #
X # Partition Types
X #
X # CONFIG_PARTITION_ADVANCED is not set
X CONFIG_MSDOS_PARTITION=y
+CONFIG_SMB_NLS=y
X CONFIG_NLS=y
X
X #
@@ -524,11 +729,13 @@


X # CONFIG_NLS_CODEPAGE_865 is not set
X # CONFIG_NLS_CODEPAGE_866 is not set
X # CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
X # CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
X # CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
X # CONFIG_NLS_ISO8859_1 is not set
X # CONFIG_NLS_ISO8859_2 is not set
X # CONFIG_NLS_ISO8859_3 is not set

@@ -536,69 +743,219 @@


X # CONFIG_NLS_ISO8859_5 is not set
X # CONFIG_NLS_ISO8859_6 is not set
X # CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_8 is not set
X # CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
X # CONFIG_NLS_ISO8859_14 is not set
X # CONFIG_NLS_ISO8859_15 is not set
X # CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
X # CONFIG_NLS_UTF8 is not set
X
X #

X # Console drivers
X #
+CONFIG_PC_KEYMAP=y


X # CONFIG_VGA_CONSOLE is not set
-CONFIG_FB=y
X
X #
X # Frame-buffer support

X #
X CONFIG_FB=y
X CONFIG_DUMMY_CONSOLE=y


-# CONFIG_FB_CYBER2000 is not set

+# CONFIG_FB_ACORN is not set

+# CONFIG_FB_ANAKIN is not set

+# CONFIG_FB_CLPS711X is not set
X CONFIG_FB_SA1100=y


+# CONFIG_FB_CYBER2000 is not set

X # CONFIG_FB_VIRTUAL is not set

-# CONFIG_FBCON_ADVANCED is not set
-CONFIG_FBCON_CFB2=y
-CONFIG_FBCON_CFB4=y
-CONFIG_FBCON_CFB8=y

+CONFIG_FBCON_ADVANCED=y
+# CONFIG_FBCON_MFB is not set
+# CONFIG_FBCON_CFB2 is not set
+# CONFIG_FBCON_CFB4 is not set
+# CONFIG_FBCON_CFB8 is not set
X CONFIG_FBCON_CFB16=y


-# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
-# CONFIG_FBCON_FONTS is not set

+# CONFIG_FBCON_CFB24 is not set
+# CONFIG_FBCON_CFB32 is not set
+# CONFIG_FBCON_AFB is not set
+# CONFIG_FBCON_ILBM is not set
+# CONFIG_FBCON_IPLAN2P2 is not set
+# CONFIG_FBCON_IPLAN2P4 is not set
+# CONFIG_FBCON_IPLAN2P8 is not set
+# CONFIG_FBCON_MAC is not set
+# CONFIG_FBCON_VGA_PLANES is not set
+# CONFIG_FBCON_VGA is not set
+# CONFIG_FBCON_HGA is not set
+CONFIG_FBCON_FONTWIDTH8_ONLY=y
+CONFIG_FBCON_FONTS=y
X CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
+# CONFIG_FONT_8x16 is not set


+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set

X
X #
X # Sound
X #
-CONFIG_SOUND=m
-CONFIG_SOUND_UDA1341=m
-# CONFIG_SOUND_SA1100_SSP is not set
+CONFIG_SOUND=y
+# CONFIG_SOUND_BT878 is not set
X # CONFIG_SOUND_CMPCI is not set
X # CONFIG_SOUND_EMU10K1 is not set
+# CONFIG_MIDI_EMU10K1 is not set
X # CONFIG_SOUND_FUSION is not set
+# CONFIG_SOUND_CS4281 is not set
X # CONFIG_SOUND_ES1370 is not set
X # CONFIG_SOUND_ES1371 is not set
X # CONFIG_SOUND_ESSSOLO1 is not set
X # CONFIG_SOUND_MAESTRO is not set


+# CONFIG_SOUND_MAESTRO3 is not set
+# CONFIG_SOUND_ICH is not set

+# CONFIG_SOUND_RME96XX is not set
X # CONFIG_SOUND_SONICVIBES is not set
X # CONFIG_SOUND_TRIDENT is not set
X # CONFIG_SOUND_MSNDCLAS is not set
X # CONFIG_SOUND_MSNDPIN is not set
X # CONFIG_SOUND_VIA82CXXX is not set


+# CONFIG_MIDI_VIA82CXXX is not set

+CONFIG_SOUND_SA1100=y
+CONFIG_SOUND_UDA1341=y


+# CONFIG_SOUND_ASSABET_UDA1341 is not set

+CONFIG_SOUND_H3600_UDA1341=y


+# CONFIG_SOUND_PANGOLIN_UDA1341 is not set
+# CONFIG_SOUND_SA1111_UDA1341 is not set

+# CONFIG_SOUND_SA1100SSP is not set
X # CONFIG_SOUND_OSS is not set
+# CONFIG_SOUND_WAVEARTIST is not set
X # CONFIG_SOUND_TVMIXER is not set
X
X #


+# Multimedia Capabilities Port drivers
+#

+# CONFIG_MCP is not set
+# CONFIG_MCP_SA1100 is not set
+# CONFIG_MCP_UCB1200 is not set
+# CONFIG_MCP_UCB1200_AUDIO is not set
+# CONFIG_MCP_UCB1200_TS is not set
+
+#


X # USB support
X #
X # CONFIG_USB is not set

X
X #
+# USB Controllers
+#

+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+# CONFIG_USB_OHCI_SA1111 is not set

+
+#
+# USB Device Class drivers
+#

+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set

+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set

+
+#
+# USB Human Interface Devices (HID)
+#

+
+#


+# Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#

+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set

+
+#
+# USB Multimedia devices
+#
+
+#


+# Video4Linux support is needed for USB Multimedia device support
+#

+
+#
+# USB Network adaptors
+#

+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set

+
+#
+# USB port drivers
+#

+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set

+# CONFIG_USB_SERIAL_IR is not set


+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set

+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set

+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set


+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set

+# CONFIG_USB_SERIAL_XIRCOM is not set


+# CONFIG_USB_SERIAL_OMNINET is not set

+
+#
+# USB Miscellaneous drivers
+#

+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
+
+#

X # Kernel hacking
X #
-CONFIG_FRAME_POINTER=y


+# CONFIG_NO_FRAME_POINTER is not set

X CONFIG_DEBUG_ERRORS=y
X # CONFIG_DEBUG_USER is not set
X # CONFIG_DEBUG_INFO is not set


-# CONFIG_MAGIC_SYSRQ is not set

-CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set


+# CONFIG_NO_PGT_CACHE is not set
+# CONFIG_DEBUG_LL is not set
+# CONFIG_DEBUG_DC21285_PORT is not set
+# CONFIG_DEBUG_CLPS711X_UART2 is not set

diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/lart linux/arch/arm/def-configs/lart
--- v2.4.13/linux/arch/arm/def-configs/lart Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/def-configs/lart Thu Oct 25 13:53:44 2001
@@ -62,13 +62,15 @@
X #
X # CONFIG_SA1100_ASSABET is not set
X # CONFIG_ASSABET_NEPONSET is not set


+# CONFIG_SA1100_ADSBITSY is not set
X # CONFIG_SA1100_BRUTUS is not set
X # CONFIG_SA1100_CERF is not set

-# CONFIG_SA1100_BITSY is not set
+# CONFIG_SA1100_H3600 is not set


X # CONFIG_SA1100_EXTENEX1 is not set

X # CONFIG_SA1100_FLEXANET is not set


X # CONFIG_SA1100_FREEBIRD is not set

X # CONFIG_SA1100_GRAPHICSCLIENT is not set
+# CONFIG_SA1100_GRAPHICSMASTER is not set

X # CONFIG_SA1100_JORNADA720 is not set


X # CONFIG_SA1100_HUW_WEBPANEL is not set

X # CONFIG_SA1100_ITSY is not set

@@ -90,7 +92,12 @@
X #
X # CLPS711X/EP721X Implementations
X #


+# CONFIG_ARCH_CDB89712 is not set
+# CONFIG_ARCH_CLEP7312 is not set
+# CONFIG_ARCH_EDB7211 is not set

X # CONFIG_ARCH_P720T is not set


+# CONFIG_ARCH_EP7211 is not set
+# CONFIG_ARCH_EP7212 is not set
X # CONFIG_ARCH_ACORN is not set
X # CONFIG_FOOTBRIDGE is not set
X # CONFIG_FOOTBRIDGE_HOST is not set

@@ -126,6 +133,10 @@


X CONFIG_SYSVIPC=y
X # CONFIG_BSD_PROCESS_ACCT is not set
X CONFIG_SYSCTL=y

+
+#
+# At least one math emulation must be selected
+#

X CONFIG_FPE_NWFPE=y
X # CONFIG_FPE_FASTFPE is not set
X CONFIG_KCORE_ELF=y
@@ -136,7 +147,7 @@
X CONFIG_PM=y
X CONFIG_APM=m


X # CONFIG_ARTHUR is not set

-CONFIG_CMDLINE="console=ttySA0,9600"
+CONFIG_CMDLINE="console=ttySA0,9600 root=/dev/ram"


X # CONFIG_PFS168_CMDLINE is not set

X CONFIG_LEDS=y
X # CONFIG_LEDS_TIMER is not set
@@ -151,10 +162,10 @@


X #
X # Memory Technology Devices (MTD)
X #
-CONFIG_MTD=m
+CONFIG_MTD=y

X CONFIG_MTD_DEBUG=y
X CONFIG_MTD_DEBUG_VERBOSE=1
-# CONFIG_MTD_PARTITIONS is not set
+CONFIG_MTD_PARTITIONS=y
X # CONFIG_MTD_REDBOOT_PARTS is not set
X # CONFIG_MTD_BOOTLDR_PARTS is not set
X # CONFIG_MTD_AFS_PARTS is not set
@@ -162,28 +173,16 @@
X #
X # User Modules And Translation Layers
X #
-CONFIG_MTD_CHAR=m
-CONFIG_MTD_BLOCK=m
-CONFIG_MTD_BLOCK_RO=m
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
X # CONFIG_FTL is not set
X # CONFIG_NFTL is not set
X
X #
X # RAM/ROM/Flash chip drivers
X #
-CONFIG_MTD_CFI=m


-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_NOSWAP=y
-# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
-# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set

-CONFIG_MTD_CFI_GEOMETRY=y
-# CONFIG_MTD_CFI_B1 is not set
-# CONFIG_MTD_CFI_B2 is not set
-CONFIG_MTD_CFI_B4=y
-# CONFIG_MTD_CFI_I1 is not set
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-CONFIG_MTD_CFI_INTELEXT=m
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
X # CONFIG_MTD_CFI_AMDSTD is not set
X # CONFIG_MTD_AMDSTD is not set
X # CONFIG_MTD_SHARP is not set
@@ -204,28 +203,27 @@
X # CONFIG_MTD_NETSC520 is not set
X # CONFIG_MTD_SBC_GXX is not set


X # CONFIG_MTD_ELAN_104NC is not set

-# CONFIG_MTD_SA1100 is not set
-# CONFIG_MTD_SA1100_REDBOOT_PARTITIONS is not set
-# CONFIG_MTD_SA1100_BOOTLDR_PARTITIONS is not set
-# CONFIG_MTD_DC21285 is not set

-# CONFIG_MTD_IQ80310 is not set
X # CONFIG_MTD_DBOX2 is not set
X # CONFIG_MTD_CSTM_MIPS_IXX is not set
X # CONFIG_MTD_CFI_FLAGADM is not set
-# CONFIG_MTD_ARM_INTEGRATOR is not set
X # CONFIG_MTD_SOLUTIONENGINE is not set


X # CONFIG_MTD_MIXMEM is not set
X # CONFIG_MTD_OCTAGON is not set
X # CONFIG_MTD_VMAX is not set

X # CONFIG_MTD_OCELOT is not set
X # CONFIG_MTD_L440GX is not set


+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_CDB89712 is not set
+# CONFIG_MTD_SA1100 is not set
+# CONFIG_MTD_DC21285 is not set
+# CONFIG_MTD_IQ80310 is not set

X
X #
X # Self-contained MTD device drivers
X #


X # CONFIG_MTD_PMC551 is not set
X # CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_LART is not set

+CONFIG_MTD_LART=y
X # CONFIG_MTD_MTDRAM is not set
X # CONFIG_MTD_BLKMTD is not set
X
@@ -247,6 +245,7 @@
X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set


+# CONFIG_PNPBIOS is not set

X
X #
X # Block devices
@@ -296,7 +295,7 @@
X # CONFIG_ATM is not set
X
X #
-#
+#
X #
X # CONFIG_IPX is not set
X # CONFIG_ATALK is not set
@@ -351,8 +350,9 @@


X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set

-# CONFIG_ACENIC_OMIT_TIGON_I is not set
+# CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set


+# CONFIG_NS83820 is not set

X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set

@@ -439,6 +439,8 @@


X # CONFIG_WINBOND_FIR is not set
X # CONFIG_TOSHIBA_FIR is not set
X # CONFIG_SMC_IRCC_FIR is not set
+# CONFIG_ALI_FIR is not set
+# CONFIG_VLSI_FIR is not set
X CONFIG_SA1100_FIR=m
X
X #

@@ -483,6 +485,9 @@
X # CONFIG_IDEDMA_AUTO is not set
X # CONFIG_DMA_NONPCI is not set
X # CONFIG_BLK_DEV_IDE_MODES is not set


+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set

+# CONFIG_BLK_DEV_ATARAID_HPT is not set
X
X #
X # SCSI support
@@ -507,6 +512,10 @@
X # Input core support
X #
X # CONFIG_INPUT is not set


+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set

X
X #
X # Character devices
@@ -515,18 +524,30 @@


X # CONFIG_SERIAL is not set
X # CONFIG_SERIAL_EXTENDED is not set
X # CONFIG_SERIAL_NONSTANDARD is not set

-# CONFIG_SERIAL_21285 is not set
-# CONFIG_SERIAL_21285_OLD is not set

-# CONFIG_SERIAL_21285_CONSOLE is not set


+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_ANAKIN is not set
+# CONFIG_SERIAL_ANAKIN_CONSOLE is not set

X # CONFIG_SERIAL_AMBA is not set
X # CONFIG_SERIAL_AMBA_CONSOLE is not set
X # CONFIG_SERIAL_CLPS711X is not set
X # CONFIG_SERIAL_CLPS711X_CONSOLE is not set


+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set

X CONFIG_SERIAL_SA1100=y
X CONFIG_SERIAL_SA1100_CONSOLE=y
X CONFIG_SA1100_DEFAULT_BAUDRATE=9600
X # CONFIG_SERIAL_8250 is not set
X # CONFIG_SERIAL_8250_CONSOLE is not set


+# CONFIG_SERIAL_8250_EXTENDED is not set
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_HUB6 is not set

X CONFIG_SERIAL_CORE=y
X CONFIG_SERIAL_CORE_CONSOLE=y
X CONFIG_UNIX98_PTYS=y

@@ -535,7 +556,7 @@
X CONFIG_TOUCHSCREEN_UCB1200=m
X CONFIG_AUDIO_UCB1200=m
X CONFIG_ADC_UCB1200=m
-# CONFIG_TOUCHSCREEN_BITSY is not set
+# CONFIG_TOUCHSCREEN_H3600 is not set
X CONFIG_PROFILER=m


X # CONFIG_PFS168_SPI is not set
X # CONFIG_PFS168_DTMF is not set

@@ -547,6 +568,24 @@
X # CONFIG_I2C is not set
X
X #


+# L3 serial bus support
+#
+# CONFIG_L3 is not set
+# CONFIG_L3_ALGOBIT is not set
+# CONFIG_L3_BIT_SA1100_GPIO is not set

+
+#
+# Other L3 adapters
+#

+# CONFIG_L3_SA1111 is not set

+
+#
+# L3 driver support
+#

+# CONFIG_L3_DRV_UDA1341 is not set
+# CONFIG_BIT_SA1100_GPIO is not set
+
+#

X # Mice
X #
X # CONFIG_BUSMOUSE is not set

@@ -555,7 +594,11 @@
X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks
@@ -573,6 +616,7 @@
X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set


+# CONFIG_SONYPI is not set

X
X #
X # Ftape, the floppy tape device driver
@@ -594,18 +638,22 @@
X # CONFIG_AUTOFS4_FS is not set
X CONFIG_REISERFS_FS=m
X # CONFIG_REISERFS_CHECK is not set


+# CONFIG_REISERFS_PROC_INFO is not set

X # CONFIG_ADFS_FS is not set
X # CONFIG_ADFS_FS_RW is not set


X # CONFIG_AFFS_FS is not set
X # CONFIG_HFS_FS is not set
X # CONFIG_BFS_FS is not set

+# CONFIG_CMS_FS is not set

+CONFIG_EXT3_FS=m
+CONFIG_JBD=m


+# CONFIG_JBD_DEBUG is not set

X # CONFIG_FAT_FS is not set
X # CONFIG_MSDOS_FS is not set


X # CONFIG_UMSDOS_FS is not set

X # CONFIG_VFAT_FS is not set


X # CONFIG_EFS_FS is not set

-CONFIG_JFFS_FS=m
-CONFIG_JFFS_FS_VERBOSE=1


+# CONFIG_JFFS_FS is not set

X CONFIG_JFFS2_FS=m
X CONFIG_JFFS2_FS_DEBUG=1
X CONFIG_CRAMFS=m
@@ -614,7 +662,7 @@
X CONFIG_ISO9660_FS=m
X CONFIG_JOLIET=y


X # CONFIG_MINIX_FS is not set

-# CONFIG_VXFS_FS is not set
+# CONFIG_FREEVXFS_FS is not set


X # CONFIG_NTFS_FS is not set
X # CONFIG_NTFS_RW is not set
X # CONFIG_HPFS_FS is not set

@@ -637,6 +685,7 @@


X # Network File Systems
X #

X # CONFIG_CODA_FS is not set


+# CONFIG_INTERMEZZO_FS is not set

X CONFIG_NFS_FS=m
X CONFIG_NFS_V3=y


X # CONFIG_ROOT_NFS is not set

@@ -709,10 +758,7 @@


X # Sound
X #

X CONFIG_SOUND=m


-# CONFIG_SOUND_ASSABET_UDA1341 is not set

-# CONFIG_SOUND_BITSY_UDA1341 is not set
-# CONFIG_SOUND_SA1111_UDA1341 is not set

-CONFIG_SOUND_SA1100SSP=m
+# CONFIG_SOUND_BT878 is not set
X # CONFIG_SOUND_CMPCI is not set
X # CONFIG_SOUND_EMU10K1 is not set
X # CONFIG_SOUND_FUSION is not set
@@ -723,19 +769,120 @@
X # CONFIG_SOUND_MAESTRO is not set
X # CONFIG_SOUND_MAESTRO3 is not set
X # CONFIG_SOUND_ICH is not set
+# CONFIG_SOUND_RME96XX is not set
X # CONFIG_SOUND_SONICVIBES is not set
X # CONFIG_SOUND_TRIDENT is not set
X # CONFIG_SOUND_MSNDCLAS is not set
X # CONFIG_SOUND_MSNDPIN is not set
X # CONFIG_SOUND_VIA82CXXX is not set
X # CONFIG_MIDI_VIA82CXXX is not set


+# CONFIG_SOUND_ASSABET_UDA1341 is not set
+# CONFIG_SOUND_H3600_UDA1341 is not set
+# CONFIG_SOUND_PANGOLIN_UDA1341 is not set
+# CONFIG_SOUND_SA1111_UDA1341 is not set

+CONFIG_SOUND_SA1100SSP=m
X # CONFIG_SOUND_OSS is not set
+# CONFIG_SOUND_WAVEARTIST is not set
X # CONFIG_SOUND_TVMIXER is not set
X
X #


X # USB support
X #
X # CONFIG_USB is not set
+
+#

+# USB Controllers
+#


+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set

+
+#
+# USB Device Class drivers
+#

+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set

+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set

+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set

+
+#
+# USB Human Interface Devices (HID)
+#

+
+#


+# Input core support is needed for USB HID
+#
+
+#
+# USB Imaging devices
+#

+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set

+
+#
+# USB Multimedia devices
+#
+
+#


+# Video4Linux support is needed for USB Multimedia device support
+#

+# CONFIG_USB_DABUSB is not set

+
+#
+# USB Network adaptors
+#

+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set

+
+#
+# USB port drivers
+#

+
+#
+# Miscellaneous USB drivers
+#

+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set

X
X #
X # Bluetooth support
diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/neponset linux/arch/arm/def-configs/neponset
--- v2.4.13/linux/arch/arm/def-configs/neponset Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/def-configs/neponset Thu Oct 25 13:53:45 2001


@@ -8,6 +8,8 @@
X CONFIG_UID16=y
X CONFIG_RWSEM_GENERIC_SPINLOCK=y

X # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set


+# CONFIG_GENERIC_BUST_SPINLOCK is not set
+# CONFIG_GENERIC_ISA_DMA is not set
X
X #
X # Code maturity level options

@@ -31,6 +33,7 @@
X # CONFIG_ARCH_CLPS711X is not set


X # CONFIG_ARCH_CO285 is not set
X # CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_CAMELOT is not set
X # CONFIG_ARCH_FOOTBRIDGE is not set
X # CONFIG_ARCH_INTEGRATOR is not set

X # CONFIG_ARCH_L7200 is not set
@@ -62,13 +65,15 @@
X #
X CONFIG_SA1100_ASSABET=y

X CONFIG_ASSABET_NEPONSET=y


+# CONFIG_SA1100_ADSBITSY is not set
X # CONFIG_SA1100_BRUTUS is not set
X # CONFIG_SA1100_CERF is not set

-# CONFIG_SA1100_BITSY is not set
+# CONFIG_SA1100_H3600 is not set


X # CONFIG_SA1100_EXTENEX1 is not set

X # CONFIG_SA1100_FLEXANET is not set


X # CONFIG_SA1100_FREEBIRD is not set

X # CONFIG_SA1100_GRAPHICSCLIENT is not set
+# CONFIG_SA1100_GRAPHICSMASTER is not set

X # CONFIG_SA1100_JORNADA720 is not set


X # CONFIG_SA1100_HUW_WEBPANEL is not set

X # CONFIG_SA1100_ITSY is not set

@@ -84,6 +89,7 @@


X # CONFIG_SA1100_XP860 is not set
X # CONFIG_SA1100_YOPY is not set

X CONFIG_SA1111=y
+CONFIG_FORCE_MAX_ZONEORDER=9
X CONFIG_SA1100_USB=m
X CONFIG_SA1100_USB_NETLINK=m
X CONFIG_SA1100_USB_CHAR=m
@@ -91,7 +97,12 @@
X #
X # CLPS711X/EP721X Implementations
X #


+# CONFIG_ARCH_CDB89712 is not set
+# CONFIG_ARCH_CLEP7312 is not set
+# CONFIG_ARCH_EDB7211 is not set

X # CONFIG_ARCH_P720T is not set


+# CONFIG_ARCH_EP7211 is not set
+# CONFIG_ARCH_EP7212 is not set
X # CONFIG_ARCH_ACORN is not set
X # CONFIG_FOOTBRIDGE is not set
X # CONFIG_FOOTBRIDGE_HOST is not set

@@ -111,16 +122,16 @@
X # CONFIG_CPU_ARM1020 is not set
X # CONFIG_CPU_SA110 is not set


X CONFIG_CPU_SA1100=y
+# CONFIG_ARM_THUMB is not set
X CONFIG_DISCONTIGMEM=y

-# CONFIG_CPU_BIG_ENDIAN is not set


X
X #
X # General setup
X #

X # CONFIG_PCI is not set
-# CONFIG_ISA is not set
+CONFIG_ISA=y
X # CONFIG_ISA_DMA is not set

-# CONFIG_CPU_FREQ is not set


+CONFIG_CPU_FREQ=y
X CONFIG_HOTPLUG=y
X
X #

@@ -135,6 +146,10 @@


X CONFIG_SYSVIPC=y
X # CONFIG_BSD_PROCESS_ACCT is not set
X CONFIG_SYSCTL=y

+
+#
+# At least one math emulation must be selected
+#

X CONFIG_FPE_NWFPE=y
X # CONFIG_FPE_FASTFPE is not set
X CONFIG_KCORE_ELF=y
@@ -143,10 +158,8 @@


X CONFIG_BINFMT_ELF=y
X # CONFIG_BINFMT_MISC is not set
X # CONFIG_PM is not set

-# CONFIG_APM is not set


X # CONFIG_ARTHUR is not set

X CONFIG_CMDLINE=""
-# CONFIG_PFS168_CMDLINE is not set
X CONFIG_LEDS=y
X CONFIG_LEDS_TIMER=y
X CONFIG_LEDS_CPU=y

@@ -180,50 +193,36 @@
X # RAM/ROM/Flash chip drivers
X #
X CONFIG_MTD_CFI=m


+# CONFIG_MTD_JEDECPROBE is not set

+CONFIG_MTD_GEN_PROBE=m
X # CONFIG_MTD_CFI_ADV_OPTIONS is not set
X CONFIG_MTD_CFI_INTELEXT=m
X # CONFIG_MTD_CFI_AMDSTD is not set


-# CONFIG_MTD_AMDSTD is not set
-# CONFIG_MTD_SHARP is not set

X # CONFIG_MTD_RAM is not set
X # CONFIG_MTD_ROM is not set

+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set

+# CONFIG_MTD_AMDSTD is not set
+# CONFIG_MTD_SHARP is not set

X # CONFIG_MTD_JEDEC is not set
X
X #
X # Mapping drivers for chip access
X #


X # CONFIG_MTD_PHYSMAP is not set

-# CONFIG_MTD_SUN_UFLASH is not set


X # CONFIG_MTD_NORA is not set

-# CONFIG_MTD_PNC2000 is not set
-# CONFIG_MTD_RPXLITE is not set
-# CONFIG_MTD_TQM8XXL is not set
-# CONFIG_MTD_SC520CDP is not set
-# CONFIG_MTD_NETSC520 is not set
-# CONFIG_MTD_SBC_GXX is not set

-# CONFIG_MTD_ELAN_104NC is not set


+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_CDB89712 is not set

X CONFIG_MTD_SA1100=m


-# CONFIG_MTD_SA1100_REDBOOT_PARTITIONS is not set

-# CONFIG_MTD_SA1100_BOOTLDR_PARTITIONS is not set


X # CONFIG_MTD_DC21285 is not set
X # CONFIG_MTD_IQ80310 is not set

-# CONFIG_MTD_DBOX2 is not set
-# CONFIG_MTD_CSTM_MIPS_IXX is not set
-# CONFIG_MTD_CFI_FLAGADM is not set
-# CONFIG_MTD_ARM_INTEGRATOR is not set
-# CONFIG_MTD_SOLUTIONENGINE is not set
-# CONFIG_MTD_MIXMEM is not set
-# CONFIG_MTD_OCTAGON is not set

-# CONFIG_MTD_VMAX is not set


-# CONFIG_MTD_OCELOT is not set

-# CONFIG_MTD_L440GX is not set
+# CONFIG_MTD_PCI is not set
X
X #
X # Self-contained MTD device drivers
X #


X # CONFIG_MTD_PMC551 is not set
X # CONFIG_MTD_SLRAM is not set

-# CONFIG_MTD_LART is not set
X # CONFIG_MTD_MTDRAM is not set
X # CONFIG_MTD_BLKMTD is not set
X
@@ -245,6 +244,7 @@
X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set


+# CONFIG_PNPBIOS is not set

X
X #
X # Block devices
@@ -254,6 +254,7 @@


X # CONFIG_PARIDE is not set
X # CONFIG_BLK_CPQ_DA is not set
X # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
X # CONFIG_BLK_DEV_DAC960 is not set
X CONFIG_BLK_DEV_LOOP=m
X # CONFIG_BLK_DEV_NBD is not set

@@ -270,6 +271,7 @@
X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #
@@ -331,6 +333,7 @@


X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y

+# CONFIG_ARM_AM79C961A is not set
X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set

@@ -345,6 +348,9 @@


X # CONFIG_ULTRA32 is not set
X CONFIG_SMC9194=y
X # CONFIG_NET_VENDOR_RACAL is not set

+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set

+# CONFIG_HP100 is not set


X # CONFIG_NET_ISA is not set
X # CONFIG_NET_PCI is not set
X # CONFIG_NET_POCKET is not set

@@ -353,8 +359,9 @@


X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set

-# CONFIG_ACENIC_OMIT_TIGON_I is not set
+# CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set


+# CONFIG_NS83820 is not set

X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set

@@ -449,6 +456,9 @@
X # CONFIG_IDEDMA_AUTO is not set
X # CONFIG_DMA_NONPCI is not set
X # CONFIG_BLK_DEV_IDE_MODES is not set


+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set

+# CONFIG_BLK_DEV_ATARAID_HPT is not set
X
X #
X # SCSI support
@@ -488,31 +498,36 @@


X # CONFIG_SERIAL is not set
X # CONFIG_SERIAL_EXTENDED is not set
X # CONFIG_SERIAL_NONSTANDARD is not set

-# CONFIG_SERIAL_21285 is not set
-# CONFIG_SERIAL_21285_OLD is not set

-# CONFIG_SERIAL_21285_CONSOLE is not set


+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_ANAKIN is not set
+# CONFIG_SERIAL_ANAKIN_CONSOLE is not set

X # CONFIG_SERIAL_AMBA is not set
X # CONFIG_SERIAL_AMBA_CONSOLE is not set
X # CONFIG_SERIAL_CLPS711X is not set
X # CONFIG_SERIAL_CLPS711X_CONSOLE is not set


+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set

+# CONFIG_SERIAL_UART00 is not set

+# CONFIG_SERIAL_UART00_CONSOLE is not set
X CONFIG_SERIAL_SA1100=y
X CONFIG_SERIAL_SA1100_CONSOLE=y
X CONFIG_SA1100_DEFAULT_BAUDRATE=9600
X CONFIG_SERIAL_8250=m
X # CONFIG_SERIAL_8250_CONSOLE is not set


+# CONFIG_SERIAL_8250_EXTENDED is not set
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_HUB6 is not set

X CONFIG_SERIAL_CORE=y
X CONFIG_SERIAL_CORE_CONSOLE=y
X CONFIG_UNIX98_PTYS=y
X CONFIG_UNIX98_PTY_COUNT=32
-CONFIG_UCB1200=y
-CONFIG_TOUCHSCREEN_UCB1200=y
-# CONFIG_AUDIO_UCB1200 is not set

-# CONFIG_ADC_UCB1200 is not set

-# CONFIG_TOUCHSCREEN_BITSY is not set
-# CONFIG_PROFILER is not set
-# CONFIG_PFS168_SPI is not set
-# CONFIG_PFS168_DTMF is not set

-# CONFIG_PFS168_MISC is not set
X
X #
X # I2C support
@@ -520,6 +535,19 @@
X # CONFIG_I2C is not set
X
X #


+# L3 serial bus support
+#
+# CONFIG_L3 is not set
+# CONFIG_L3_ALGOBIT is not set
+# CONFIG_L3_BIT_SA1100_GPIO is not set

+
+#
+# Other L3 adapters
+#

+# CONFIG_L3_SA1111 is not set

+# CONFIG_BIT_SA1100_GPIO is not set
+
+#

X # Mice
X #
X # CONFIG_BUSMOUSE is not set

@@ -528,11 +556,37 @@
X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set


+# CONFIG_INPUT_GAMEPORT is not set

+# CONFIG_INPUT_NS558 is not set
+# CONFIG_INPUT_LIGHTNING is not set
+# CONFIG_INPUT_PCIGAME is not set
+# CONFIG_INPUT_CS461X is not set
+# CONFIG_INPUT_EMU10K1 is not set
+# CONFIG_INPUT_SERIO is not set

+# CONFIG_INPUT_SERPORT is not set
X
X #


-# Input core support is needed for joysticks
+# Joysticks
X #
+# CONFIG_INPUT_ANALOG is not set
+# CONFIG_INPUT_A3D is not set
+# CONFIG_INPUT_ADI is not set
+# CONFIG_INPUT_COBRA is not set
+# CONFIG_INPUT_GF2K is not set
+# CONFIG_INPUT_GRIP is not set
+# CONFIG_INPUT_INTERACT is not set
+# CONFIG_INPUT_TMDC is not set
+# CONFIG_INPUT_SIDEWINDER is not set
+# CONFIG_INPUT_IFORCE_USB is not set
+# CONFIG_INPUT_IFORCE_232 is not set
+# CONFIG_INPUT_WARRIOR is not set
+# CONFIG_INPUT_MAGELLAN is not set
+# CONFIG_INPUT_SPACEORB is not set
+# CONFIG_INPUT_SPACEBALL is not set
+# CONFIG_INPUT_STINGER is not set
+# CONFIG_INPUT_DB9 is not set
+# CONFIG_INPUT_GAMECON is not set

+# CONFIG_INPUT_TURBOGRAFX is not set
X # CONFIG_QIC02_TAPE is not set
X
X #
@@ -557,6 +611,8 @@
X #


X # PCMCIA character devices
X #
+CONFIG_PCMCIA_SERIAL_CS=m

+# CONFIG_MWAVE is not set
X
X #
X # Multimedia devices
@@ -576,13 +632,16 @@


X # CONFIG_AFFS_FS is not set
X # CONFIG_HFS_FS is not set
X # CONFIG_BFS_FS is not set

+# CONFIG_CMS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set

X CONFIG_FAT_FS=y
X CONFIG_MSDOS_FS=y


X # CONFIG_UMSDOS_FS is not set

X # CONFIG_VFAT_FS is not set


X # CONFIG_EFS_FS is not set

-CONFIG_JFFS_FS=m
-CONFIG_JFFS_FS_VERBOSE=0


+# CONFIG_JFFS_FS is not set

X CONFIG_JFFS2_FS=m
X CONFIG_JFFS2_FS_DEBUG=0


X # CONFIG_CRAMFS is not set

@@ -590,8 +649,9 @@
X # CONFIG_RAMFS is not set


X # CONFIG_ISO9660_FS is not set
X # CONFIG_JOLIET is not set

+# CONFIG_ZISOFS is not set


X # CONFIG_MINIX_FS is not set

-# CONFIG_VXFS_FS is not set
+# CONFIG_FREEVXFS_FS is not set


X # CONFIG_NTFS_FS is not set
X # CONFIG_NTFS_RW is not set
X # CONFIG_HPFS_FS is not set

@@ -614,6 +674,7 @@


X # Network File Systems
X #

X # CONFIG_CODA_FS is not set


+# CONFIG_INTERMEZZO_FS is not set

X CONFIG_NFS_FS=y
X # CONFIG_NFS_V3 is not set
X # CONFIG_ROOT_NFS is not set

@@ -631,6 +692,8 @@


X # CONFIG_NCPFS_SMALLDOS is not set
X # CONFIG_NCPFS_NLS is not set
X # CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set

+# CONFIG_ZLIB_FS_INFLATE is not set
X
X #
X # Partition Types
@@ -646,6 +709,7 @@


X # CONFIG_MINIX_SUBPARTITION is not set
X # CONFIG_SOLARIS_X86_PARTITION is not set
X # CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
X # CONFIG_SGI_PARTITION is not set
X # CONFIG_ULTRIX_PARTITION is not set
X # CONFIG_SUN_PARTITION is not set

@@ -705,11 +769,10 @@
X CONFIG_FB=y
X CONFIG_DUMMY_CONSOLE=y


X # CONFIG_FB_ACORN is not set
+# CONFIG_FB_ANAKIN is not set
X # CONFIG_FB_CLPS711X is not set

-# CONFIG_FB_CYBER2000 is not set
X CONFIG_FB_SA1100=y


-# CONFIG_FB_ANAKIN is not set

-# CONFIG_FB_E1355 is not set
+# CONFIG_FB_CYBER2000 is not set


X # CONFIG_FB_VIRTUAL is not set
X # CONFIG_FBCON_ADVANCED is not set
X CONFIG_FBCON_CFB2=y

@@ -728,12 +791,10 @@


X # Sound
X #
X CONFIG_SOUND=y

-CONFIG_SOUND_ASSABET_UDA1341=m


-# CONFIG_SOUND_BITSY_UDA1341 is not set

-CONFIG_SOUND_SA1111_UDA1341=m


-# CONFIG_SOUND_SA1100SSP is not set
+# CONFIG_SOUND_BT878 is not set
X # CONFIG_SOUND_CMPCI is not set
X # CONFIG_SOUND_EMU10K1 is not set
+# CONFIG_MIDI_EMU10K1 is not set
X # CONFIG_SOUND_FUSION is not set
X # CONFIG_SOUND_CS4281 is not set
X # CONFIG_SOUND_ES1370 is not set

@@ -742,16 +803,34 @@


X # CONFIG_SOUND_MAESTRO is not set
X # CONFIG_SOUND_MAESTRO3 is not set
X # CONFIG_SOUND_ICH is not set
+# CONFIG_SOUND_RME96XX is not set
X # CONFIG_SOUND_SONICVIBES is not set
X # CONFIG_SOUND_TRIDENT is not set
X # CONFIG_SOUND_MSNDCLAS is not set
X # CONFIG_SOUND_MSNDPIN is not set
X # CONFIG_SOUND_VIA82CXXX is not set
X # CONFIG_MIDI_VIA82CXXX is not set
+CONFIG_SOUND_SA1100=y

+# CONFIG_SOUND_UDA1341 is not set


+# CONFIG_SOUND_ASSABET_UDA1341 is not set
+# CONFIG_SOUND_H3600_UDA1341 is not set
+# CONFIG_SOUND_PANGOLIN_UDA1341 is not set
+# CONFIG_SOUND_SA1111_UDA1341 is not set

+# CONFIG_SOUND_SA1100SSP is not set
X # CONFIG_SOUND_OSS is not set
+# CONFIG_SOUND_WAVEARTIST is not set
X # CONFIG_SOUND_TVMIXER is not set
X
X #


+# Multimedia Capabilities Port drivers
+#
+CONFIG_MCP=y
+CONFIG_MCP_SA1100=y
+CONFIG_MCP_UCB1200=y
+CONFIG_MCP_UCB1200_AUDIO=m
+CONFIG_MCP_UCB1200_TS=y
+
+#

X # USB support
X #

X CONFIG_USB=y
@@ -762,6 +841,8 @@
X #
X # CONFIG_USB_DEVICEFS is not set


X # CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_LONG_TIMEOUT is not set

+# CONFIG_USB_LARGE_CONFIG is not set
X
X #
X # USB Controllers
@@ -769,7 +850,7 @@
X # CONFIG_USB_UHCI is not set
X # CONFIG_USB_UHCI_ALT is not set
X CONFIG_USB_OHCI=y
-CONFIG_USB_OHCI_NOPCI=y
+CONFIG_USB_OHCI_SA1111=y
X
X #
X # USB Device Class drivers
@@ -777,6 +858,14 @@
X # CONFIG_USB_AUDIO is not set
X # CONFIG_USB_BLUETOOTH is not set
X # CONFIG_USB_STORAGE is not set


+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set

+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set

+# CONFIG_USB_STORAGE_JUMPSHOT is not set
X # CONFIG_USB_ACM is not set
X # CONFIG_USB_PRINTER is not set
X
@@ -784,6 +873,7 @@


X # USB Human Interface Devices (HID)
X #
X CONFIG_USB_HID=y

+# CONFIG_USB_HIDDEV is not set
X # CONFIG_USB_WACOM is not set
X
X #
@@ -793,24 +883,23 @@
X # CONFIG_USB_MDC800 is not set
X # CONFIG_USB_SCANNER is not set
X # CONFIG_USB_MICROTEK is not set


+# CONFIG_USB_HPUSBSCSI is not set

X
X #


X # USB Multimedia devices
X #
-# CONFIG_USB_IBMCAM is not set
-# CONFIG_USB_OV511 is not set
-# CONFIG_USB_PWC is not set
-# CONFIG_USB_SE401 is not set
-# CONFIG_USB_DSBR is not set

-# CONFIG_USB_DABUSB is not set
+
+#


+# Video4Linux support is needed for USB Multimedia device support

+#
X
X #


X # USB Network adaptors
X #

-# CONFIG_USB_PLUSB is not set
X # CONFIG_USB_PEGASUS is not set


+# CONFIG_USB_KAWETH is not set

X # CONFIG_USB_CATC is not set

-# CONFIG_USB_NET1080 is not set
+# CONFIG_USB_CDCETHER is not set
X # CONFIG_USB_USBNET is not set
X
X #
@@ -822,11 +911,36 @@
X # USB Serial Converter support
X #
X # CONFIG_USB_SERIAL is not set


+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set

+# CONFIG_USB_SERIAL_IR is not set


+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set

+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set

+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set


+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set

+# CONFIG_USB_SERIAL_XIRCOM is not set


+# CONFIG_USB_SERIAL_OMNINET is not set

X
X #
-# USB misc drivers

+# USB Miscellaneous drivers
X #
X # CONFIG_USB_RIO500 is not set


+# CONFIG_USB_ID75 is not set

X
X #
X # Bluetooth support
@@ -840,7 +954,9 @@


X CONFIG_DEBUG_ERRORS=y
X CONFIG_DEBUG_USER=y
X # CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_SLAB is not set
X CONFIG_MAGIC_SYSRQ=y

+# CONFIG_DEBUG_SPINLOCK is not set
X # CONFIG_NO_PGT_CACHE is not set
X # CONFIG_DEBUG_LL is not set
X # CONFIG_DEBUG_DC21285_PORT is not set
diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/pangolin linux/arch/arm/def-configs/pangolin
--- v2.4.13/linux/arch/arm/def-configs/pangolin Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/def-configs/pangolin Thu Oct 25 13:53:45 2001
@@ -1,11 +1,13 @@
X #
-# Automatically generated make config: don't edit


+# Automatically generated by make menuconfig: don't edit

X #
X CONFIG_ARM=y
X # CONFIG_EISA is not set


X # CONFIG_SBUS is not set

X # CONFIG_MCA is not set
X CONFIG_UID16=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
X
X #
X # Code maturity level options

@@ -23,24 +25,22 @@


X #
X # System Type
X #
+# CONFIG_ARCH_ANAKIN is not set
X # CONFIG_ARCH_ARCA5K is not set
X # CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
X # CONFIG_ARCH_CO285 is not set
X # CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_L7200 is not set
X # CONFIG_ARCH_FOOTBRIDGE is not set
X # CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_L7200 is not set
X # CONFIG_ARCH_RPC is not set
X CONFIG_ARCH_SA1100=y
-# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_SHARK is not set
X
X #
X # Archimedes/A5000 Implementations

X #
-
-#
-# Archimedes/A5000 Implementations (select only ONE)
-#
X # CONFIG_ARCH_ARC is not set
X # CONFIG_ARCH_A5K is not set
X
@@ -62,14 +62,20 @@


X # CONFIG_SA1100_CERF is not set
X # CONFIG_SA1100_BITSY is not set
X # CONFIG_SA1100_EXTENEX1 is not set
+# CONFIG_SA1100_FLEXANET is not set
X # CONFIG_SA1100_FREEBIRD is not set

X # CONFIG_SA1100_GRAPHICSCLIENT is not set

+# CONFIG_SA1100_JORNADA720 is not set
X # CONFIG_SA1100_HUW_WEBPANEL is not set
+# CONFIG_SA1100_ITSY is not set
X # CONFIG_SA1100_LART is not set

X # CONFIG_SA1100_NANOENGINE is not set
+# CONFIG_SA1100_OMNIMETER is not set

X CONFIG_SA1100_PANGOLIN=y
+CONFIG_SA1100_PANGOLIN_PCMCIA_IDE=y
X # CONFIG_SA1100_PLEB is not set


X # CONFIG_SA1100_SHERMAN is not set
+# CONFIG_SA1100_SIMPAD is not set

X # CONFIG_SA1100_PFS168 is not set


X # CONFIG_SA1100_VICTOR is not set
X # CONFIG_SA1100_XP860 is not set

@@ -77,8 +83,6 @@
X # CONFIG_SA1100_USB is not set
X # CONFIG_SA1100_USB_NETLINK is not set
X # CONFIG_SA1100_USB_CHAR is not set


-# CONFIG_SA1100_FREQUENCY_SCALE is not set
-# CONFIG_SA1100_VOLTAGE_SCALE is not set

X
X #
X # CLPS711X/EP721X Implementations

@@ -90,10 +94,6 @@
X # CONFIG_FOOTBRIDGE_ADDIN is not set
X CONFIG_CPU_32=y
X # CONFIG_CPU_26 is not set


-
-#
-# Processor Type
-#

X # CONFIG_CPU_32v3 is not set
X CONFIG_CPU_32v4=y
X # CONFIG_CPU_ARM610 is not set
@@ -104,18 +104,15 @@


X # CONFIG_CPU_SA110 is not set
X CONFIG_CPU_SA1100=y
X CONFIG_DISCONTIGMEM=y
+# CONFIG_CPU_BIG_ENDIAN is not set
X
X #
X # General setup
X #
-
-#
-# Please ensure that you have read the help on the next option
-#
-# CONFIG_ANGELBOOT is not set
X # CONFIG_PCI is not set
X # CONFIG_ISA is not set
X # CONFIG_ISA_DMA is not set
+# CONFIG_CPU_FREQ is not set
X CONFIG_HOTPLUG=y
X
X #

@@ -130,20 +127,20 @@


X CONFIG_SYSVIPC=y
X # CONFIG_BSD_PROCESS_ACCT is not set
X CONFIG_SYSCTL=y

-CONFIG_FPE_NWFPE=y
-# CONFIG_FPE_FASTFPE is not set

+# CONFIG_FPE_NWFPE is not set
+CONFIG_FPE_FASTFPE=y


X CONFIG_KCORE_ELF=y
X # CONFIG_KCORE_AOUT is not set

X # CONFIG_BINFMT_AOUT is not set


X CONFIG_BINFMT_ELF=y
X # CONFIG_BINFMT_MISC is not set

X # CONFIG_PM is not set
+# CONFIG_APM is not set
X # CONFIG_ARTHUR is not set

X CONFIG_CMDLINE="keepinitrd"


X # CONFIG_PFS168_CMDLINE is not set

X # CONFIG_LEDS is not set

X CONFIG_ALIGNMENT_TRAP=y
-# CONFIG_UCB1200 is not set
X
X #
X # Parallel port support

@@ -155,62 +152,84 @@
X #
X CONFIG_MTD=y


X # CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_BOOTLDR_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set

+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
X
X #

-# Disk-On-Chip Device Drivers
-#


-# CONFIG_MTD_DOC1000 is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set

-
-#
-# RAM/ROM Device Drivers
-#


-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_SLRAM is not set

-# CONFIG_MTD_RAM is not set

-# CONFIG_MTD_ROM is not set


-# CONFIG_MTD_MTDRAM is not set

-
-#


-# Linearly Mapped Flash Device Drivers

+# RAM/ROM/Flash chip drivers
X #

X CONFIG_MTD_CFI=y


-# CONFIG_MTD_CFI_ADV_OPTIONS is not set

+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_CFI_B1 is not set
+# CONFIG_MTD_CFI_B2 is not set
+CONFIG_MTD_CFI_B4=y

+# CONFIG_MTD_CFI_I1 is not set
+# CONFIG_MTD_CFI_I2 is not set
+CONFIG_MTD_CFI_I4=y
X CONFIG_MTD_CFI_INTELEXT=y
X # CONFIG_MTD_CFI_AMDSTD is not set
X # CONFIG_MTD_AMDSTD is not set
X # CONFIG_MTD_SHARP is not set


+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_JEDEC is not set
+
+#
+# Mapping drivers for chip access
+#

X # CONFIG_MTD_PHYSMAP is not set


+# CONFIG_MTD_SUN_UFLASH is not set

X # CONFIG_MTD_NORA is not set
X # CONFIG_MTD_PNC2000 is not set
X # CONFIG_MTD_RPXLITE is not set
+# CONFIG_MTD_TQM8XXL is not set
X # CONFIG_MTD_SC520CDP is not set
-# CONFIG_MTD_SBC_MEDIAGX is not set
+# CONFIG_MTD_NETSC520 is not set
+# CONFIG_MTD_SBC_GXX is not set
X # CONFIG_MTD_ELAN_104NC is not set

X CONFIG_MTD_SA1100=y

+# CONFIG_MTD_DOC1000 is not set
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOCPROBE is not set

X
X #
-# User Modules And Translation Layers

+# NAND Flash Device Drivers
X #
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y


-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set

+# CONFIG_MTD_NAND is not set
X
X #
X # Plug and Play configuration

@@ -264,10 +283,6 @@
X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
-
-#
-#
-#
X # CONFIG_IPX is not set
X # CONFIG_ATALK is not set
X # CONFIG_DECNET is not set
@@ -295,22 +310,29 @@
X # ARCnet devices
X #
X # CONFIG_ARCNET is not set
-CONFIG_DUMMY=y


+# CONFIG_DUMMY is not set

X # CONFIG_BONDING is not set
X # CONFIG_EQUALIZER is not set
X # CONFIG_TUN is not set
-# CONFIG_NET_SB1000 is not set
X
X #
X # Ethernet (10 or 100Mbit)
X #
X CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNLANCE is not set
+# CONFIG_SUNGEM is not set
X # CONFIG_NET_VENDOR_3COM is not set
X # CONFIG_LANCE is not set

-# CONFIG_NET_VENDOR_SMC is not set


+CONFIG_NET_VENDOR_SMC=y
+# CONFIG_WD80x3 is not set
+# CONFIG_ULTRAMCA is not set
+# CONFIG_ULTRA is not set
+# CONFIG_ULTRA32 is not set
+CONFIG_SMC9194=y

X # CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_AT1700 is not set
-# CONFIG_DEPCA is not set
X # CONFIG_NET_ISA is not set
X # CONFIG_NET_PCI is not set
X # CONFIG_NET_POCKET is not set

@@ -319,11 +341,14 @@


X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+# CONFIG_MYRI_SBUS is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set
X # CONFIG_FDDI is not set
X # CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
X # CONFIG_PPP is not set
X # CONFIG_SLIP is not set
X

@@ -358,8 +383,12 @@


X # CONFIG_PCMCIA_XIRC2PS is not set

X # CONFIG_ARCNET_COM20020_CS is not set
X # CONFIG_PCMCIA_IBMTR is not set


-# CONFIG_NET_PCMCIA_RADIO is not set

-CONFIG_PCMCIA_NETCARD=y
+CONFIG_NET_PCMCIA_RADIO=y
+# CONFIG_PCMCIA_RAYCS is not set
+# CONFIG_PCMCIA_NETWAVE is not set
+# CONFIG_PCMCIA_WAVELAN is not set
+# CONFIG_AIRONET4500_CS is not set
+CONFIG_PCMCIA_WVLAN=y
X
X #
X # Amateur Radio support
@@ -374,19 +403,15 @@


X #
X # ATA/IDE/MFM/RLL support
X #

-CONFIG_IDE=y
+CONFIG_IDE=m


X
X #
X # IDE, ATA and ATAPI Block devices
X #

-CONFIG_BLK_DEV_IDE=y
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
+CONFIG_BLK_DEV_IDE=m


X # CONFIG_BLK_DEV_HD_IDE is not set
X # CONFIG_BLK_DEV_HD is not set

-CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_BLK_DEV_IDEDISK=m


X # CONFIG_IDEDISK_MULTI_MODE is not set
X # CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
X # CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set

@@ -397,15 +422,12 @@


X # CONFIG_BLK_DEV_IDEDISK_WD is not set
X # CONFIG_BLK_DEV_COMMERIAL is not set
X # CONFIG_BLK_DEV_TIVO is not set

-CONFIG_BLK_DEV_IDECS=y
+CONFIG_BLK_DEV_IDECS=m
+# CONFIG_BLK_DEV_PANGOLIN is not set


X # CONFIG_BLK_DEV_IDECD is not set
X # CONFIG_BLK_DEV_IDETAPE is not set
X # CONFIG_BLK_DEV_IDEFLOPPY is not set

X # CONFIG_BLK_DEV_IDESCSI is not set


-
-#
-# IDE chipset support/bugfixes
-#

X # CONFIG_BLK_DEV_CMD640 is not set
X # CONFIG_BLK_DEV_CMD640_ENHANCED is not set
X # CONFIG_BLK_DEV_ISAPNP is not set
@@ -446,19 +468,31 @@


X # CONFIG_SERIAL is not set
X # CONFIG_SERIAL_EXTENDED is not set
X # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set
+# CONFIG_SERIAL_AMBA is not set
+# CONFIG_SERIAL_AMBA_CONSOLE is not set
+# CONFIG_SERIAL_CLPS711X is not set
+# CONFIG_SERIAL_CLPS711X_CONSOLE is not set
X CONFIG_SERIAL_SA1100=y
X CONFIG_SERIAL_SA1100_CONSOLE=y

X CONFIG_SA1100_DEFAULT_BAUDRATE=115200


+# CONFIG_SERIAL_8250 is not set
+# CONFIG_SERIAL_8250_CONSOLE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=32

+# CONFIG_UCB1200 is not set
X # CONFIG_TOUCHSCREEN_UCB1200 is not set


+# CONFIG_AUDIO_UCB1200 is not set

+# CONFIG_ADC_UCB1200 is not set


X # CONFIG_TOUCHSCREEN_BITSY is not set

X CONFIG_PROFILER=y


X # CONFIG_PFS168_SPI is not set
X # CONFIG_PFS168_DTMF is not set
X # CONFIG_PFS168_MISC is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=32
X
X #
X # I2C support

@@ -475,10 +509,6 @@


X # Joysticks
X #

X # CONFIG_JOYSTICK is not set
-
-#
-# Input core support is needed for joysticks
-#
X # CONFIG_QIC02_TAPE is not set
X
X #
@@ -503,7 +533,6 @@
X #


X # PCMCIA character devices
X #

-# CONFIG_PCMCIA_SERIAL_CS is not set
X
X #
X # Multimedia devices
@@ -532,10 +561,12 @@
X CONFIG_JFFS_FS_VERBOSE=0
X # CONFIG_JFFS2_FS is not set
X CONFIG_CRAMFS=y


+# CONFIG_TMPFS is not set

X CONFIG_RAMFS=y


X # CONFIG_ISO9660_FS is not set
X # CONFIG_JOLIET is not set
X # CONFIG_MINIX_FS is not set
+# CONFIG_VXFS_FS is not set
X # CONFIG_NTFS_FS is not set
X # CONFIG_NTFS_RW is not set
X # CONFIG_HPFS_FS is not set

@@ -549,7 +580,6 @@


X # CONFIG_ROMFS_FS is not set
X CONFIG_EXT2_FS=y
X # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set

SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 05'
echo 'File patch-2.4.14 is continued in part 06'
echo "06" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:36 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part13

#!/bin/sh -x
# this is part 13 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 13; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X *
X * Module Name: dswload - Dispatcher namespace load callbacks


- * $Revision: 44 $

+ * $Revision: 50 $


X *
X *****************************************************************************/
X

@@ -39,6 +39,53 @@


X
X /*******************************************************************************
X *

+ * FUNCTION: Acpi_ds_init_callbacks
+ *
+ * PARAMETERS: Walk_state - Current state of the parse tree walk
+ * Pass_number - 1, 2, or 3


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Init walk state callbacks


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ds_init_callbacks (
+ acpi_walk_state *walk_state,
+ u32 pass_number)
+{
+
+ switch (pass_number) {
+ case 1:
+ walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE;


+ walk_state->descending_callback = acpi_ds_load1_begin_op;
+ walk_state->ascending_callback = acpi_ds_load1_end_op;

+ break;
+
+ case 2:
+ walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE;
+ walk_state->descending_callback = acpi_ds_load2_begin_op;
+ walk_state->ascending_callback = acpi_ds_load2_end_op;
+ break;
+
+ case 3:
+ walk_state->parse_flags |= ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE;
+ walk_state->descending_callback = acpi_ds_exec_begin_op;
+ walk_state->ascending_callback = acpi_ds_exec_end_op;
+ break;
+
+ default:
+ return (AE_BAD_PARAMETER);
+ break;
+ }
+
+ return (AE_OK);


+}
+
+
+/*******************************************************************************
+ *

X * FUNCTION: Acpi_ds_load1_begin_op


X *
X * PARAMETERS: Walk_state - Current state of the parse tree walk

@@ -53,49 +100,50 @@
X
X acpi_status
X acpi_ds_load1_begin_op (


- u16 opcode,
- acpi_parse_object *op,
X acpi_walk_state *walk_state,
X acpi_parse_object **out_op)
X {

+ acpi_parse_object *op;
X acpi_namespace_node *node;
X acpi_status status;
X acpi_object_type8 data_type;
X NATIVE_CHAR *path;


- const acpi_opcode_info *op_info;
X

X
X PROC_NAME ("Ds_load1_begin_op");
+


+ op = walk_state->op;

X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
X
X
X /* We are only interested in opcodes that have an associated name */
X
- op_info = acpi_ps_get_opcode_info (opcode);
- if (!(op_info->flags & AML_NAMED)) {
- *out_op = op;
- return (AE_OK);
- }
+ if (walk_state->op) {
+ if (!(walk_state->op_info->flags & AML_NAMED)) {
+ *out_op = op;
+ return (AE_OK);
+ }
X
- /* Check if this object has already been installed in the namespace */
+ /* Check if this object has already been installed in the namespace */
X
- if (op && op->node) {
- *out_op = op;
- return (AE_OK);
+ if (op->node) {
+ *out_op = op;
+ return (AE_OK);
+ }
X }
X
- path = acpi_ps_get_next_namestring (walk_state->parser_state);
+ path = acpi_ps_get_next_namestring (&walk_state->parser_state);
X
X /* Map the raw opcode into an internal object type */
X
- data_type = acpi_ds_map_named_opcode_to_data_type (opcode);
+ data_type = acpi_ds_map_named_opcode_to_data_type (walk_state->opcode);


X
X
X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,

X "State=%p Op=%p Type=%x\n", walk_state, op, data_type));
X
X
- if (opcode == AML_SCOPE_OP) {
+ if (walk_state->opcode == AML_SCOPE_OP) {
X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
X "State=%p Op=%p Type=%x\n", walk_state, op, data_type));
X }
@@ -115,7 +163,7 @@
X if (!op) {
X /* Create a new op */
X
- op = acpi_ps_alloc_op (opcode);
+ op = acpi_ps_alloc_op (walk_state->opcode);
X if (!op) {
X return (AE_NO_MEMORY);
X }
@@ -130,7 +178,7 @@
X * can get it again quickly when this scope is closed
X */


X op->node = node;

- acpi_ps_append_arg (acpi_ps_get_parent_scope (walk_state->parser_state), op);
+ acpi_ps_append_arg (acpi_ps_get_parent_scope (&walk_state->parser_state), op);
X
X *out_op = op;
X return (status);
@@ -154,21 +202,21 @@
X
X acpi_status
X acpi_ds_load1_end_op (


- acpi_walk_state *walk_state,
- acpi_parse_object *op)
+ acpi_walk_state *walk_state)
X {
+ acpi_parse_object *op;

X acpi_object_type8 data_type;


- const acpi_opcode_info *op_info;
X

X
X PROC_NAME ("Ds_load1_end_op");
+


+ op = walk_state->op;

X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
X
X
X /* We are only interested in opcodes that have an associated name */


X
- op_info = acpi_ps_get_opcode_info (op->opcode);

- if (!(op_info->flags & AML_NAMED)) {
+ if (!(walk_state->op_info->flags & AML_NAMED)) {


X return (AE_OK);
X }
X

@@ -216,42 +264,41 @@
X
X acpi_status
X acpi_ds_load2_begin_op (


- u16 opcode,
- acpi_parse_object *op,
X acpi_walk_state *walk_state,
X acpi_parse_object **out_op)
X {

+ acpi_parse_object *op;
X acpi_namespace_node *node;
X acpi_status status;
X acpi_object_type8 data_type;
X NATIVE_CHAR *buffer_ptr;
X void *original = NULL;


- const acpi_opcode_info *op_info;
X

X
X PROC_NAME ("Ds_load2_begin_op");
+


+ op = walk_state->op;

X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
X
X
- /* We only care about Namespace opcodes here */
+ if (op) {
+ /* We only care about Namespace opcodes here */
X
- op_info = acpi_ps_get_opcode_info (opcode);
- if (!(op_info->flags & AML_NSOPCODE) &&
- opcode != AML_INT_NAMEPATH_OP) {
- return (AE_OK);
- }
+ if (!(walk_state->op_info->flags & AML_NSOPCODE) &&
+ walk_state->opcode != AML_INT_NAMEPATH_OP) {
+ return (AE_OK);
+ }
X
- /* TBD: [Restructure] Temp! same code as in psparse */
+ /* TBD: [Restructure] Temp! same code as in psparse */
X
- if (!(op_info->flags & AML_NAMED)) {
- return (AE_OK);
- }
+ if (!(walk_state->op_info->flags & AML_NAMED)) {
+ return (AE_OK);
+ }
X
- if (op) {
X /*
X * Get the name we are going to enter or lookup in the namespace
X */
- if (opcode == AML_INT_NAMEPATH_OP) {
+ if (walk_state->opcode == AML_INT_NAMEPATH_OP) {
X /* For Namepath op, get the path string */
X
X buffer_ptr = op->value.string;
@@ -261,35 +308,33 @@


X return (AE_OK);
X }
X }
-

X else {
X /* Get name from the op */
X
X buffer_ptr = (NATIVE_CHAR *) &((acpi_parse2_object *)op)->name;
X }
X }
-
X else {
- buffer_ptr = acpi_ps_get_next_namestring (walk_state->parser_state);
+ buffer_ptr = acpi_ps_get_next_namestring (&walk_state->parser_state);
X }
X
X
X /* Map the raw opcode into an internal object type */
X
- data_type = acpi_ds_map_named_opcode_to_data_type (opcode);
+ data_type = acpi_ds_map_named_opcode_to_data_type (walk_state->opcode);
X
X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
X "State=%p Op=%p Type=%x\n", walk_state, op, data_type));
X
X
- if (opcode == AML_FIELD_OP ||
- opcode == AML_BANK_FIELD_OP ||
- opcode == AML_INDEX_FIELD_OP) {
+ if (walk_state->opcode == AML_FIELD_OP ||
+ walk_state->opcode == AML_BANK_FIELD_OP ||
+ walk_state->opcode == AML_INDEX_FIELD_OP) {
X node = NULL;
X status = AE_OK;
X }
X
- else if (opcode == AML_INT_NAMEPATH_OP) {
+ else if (walk_state->opcode == AML_INT_NAMEPATH_OP) {
X /*
X * The Name_path is an object reference to an existing object. Don't enter the
X * name into the namespace, but look it up for use later
@@ -326,7 +371,7 @@
X if (!op) {
X /* Create a new op */
X
- op = acpi_ps_alloc_op (opcode);
+ op = acpi_ps_alloc_op (walk_state->opcode);
X if (!op) {
X return (AE_NO_MEMORY);
X }
@@ -374,25 +419,26 @@
X
X acpi_status
X acpi_ds_load2_end_op (


- acpi_walk_state *walk_state,
- acpi_parse_object *op)
+ acpi_walk_state *walk_state)
X {
+ acpi_parse_object *op;
X acpi_status status = AE_OK;

X acpi_object_type8 data_type;
X acpi_namespace_node *node;
X acpi_parse_object *arg;
X acpi_namespace_node *new_node;
- const acpi_opcode_info *op_info;
+ u32 i;
X
X
X PROC_NAME ("Ds_load2_end_op");
+


+ op = walk_state->op;

X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
X
X
X /* Only interested in opcodes that have namespace objects */


X
- op_info = acpi_ps_get_opcode_info (op->opcode);

- if (!(op_info->flags & AML_NSOBJECT)) {
+ if (!(walk_state->op_info->flags & AML_NSOBJECT)) {


X return (AE_OK);
X }
X

@@ -435,323 +481,210 @@
X /*
X * Named operations are as follows:
X *
- * AML_SCOPE
- * AML_DEVICE
- * AML_THERMALZONE
- * AML_METHOD
- * AML_POWERRES
- * AML_PROCESSOR
- * AML_FIELD
- * AML_INDEXFIELD
- * AML_BANKFIELD
- * AML_NAMEDFIELD
- * AML_NAME
X * AML_ALIAS
- * AML_MUTEX
- * AML_EVENT
- * AML_OPREGION
- * AML_CREATEFIELD
+ * AML_BANKFIELD
X * AML_CREATEBITFIELD
X * AML_CREATEBYTEFIELD
- * AML_CREATEWORDFIELD
X * AML_CREATEDWORDFIELD
+ * AML_CREATEFIELD
X * AML_CREATEQWORDFIELD
+ * AML_CREATEWORDFIELD
+ * AML_DATA_REGION
+ * AML_DEVICE
+ * AML_EVENT
+ * AML_FIELD
+ * AML_INDEXFIELD
+ * AML_METHOD
X * AML_METHODCALL
+ * AML_MUTEX
+ * AML_NAME
+ * AML_NAMEDFIELD
+ * AML_OPREGION
+ * AML_POWERRES
+ * AML_PROCESSOR
+ * AML_SCOPE
+ * AML_THERMALZONE
X */
X
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Create-Load [%s] State=%p Op=%p Named_obj=%p\n",
+ acpi_ps_get_opcode_name (op->opcode), walk_state, op, node));
X
X /* Decode the opcode */


X
X arg = op->value.arg;
X

- switch (op->opcode) {
-

- case AML_CREATE_FIELD_OP:
- case AML_CREATE_BIT_FIELD_OP:
- case AML_CREATE_BYTE_FIELD_OP:
- case AML_CREATE_WORD_FIELD_OP:
- case AML_CREATE_DWORD_FIELD_OP:
- case AML_CREATE_QWORD_FIELD_OP:
+ switch (walk_state->op_info->type) {
+ case AML_TYPE_CREATE_FIELD:
X
X /*
X * Create the field object, but the field buffer and index must
X * be evaluated later during the execution phase
X */
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Create_xxx_field: State=%p Op=%p Named_obj=%p\n",
- walk_state, op, node));
-
- /* Get the Name_string argument */
-
- if (op->opcode == AML_CREATE_FIELD_OP) {
- arg = acpi_ps_get_arg (op, 3);
- }
- else {
- /* Create Bit/Byte/Word/Dword field */
-
- arg = acpi_ps_get_arg (op, 2);
- }
-
- if (!arg) {
- status = AE_AML_NO_OPERAND;


- goto cleanup;
- }
-

- /*
- * Enter the Name_string into the namespace
- */


- status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,

- INTERNAL_TYPE_DEF_ANY, IMODE_LOAD_PASS1,
- NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
- walk_state, &(new_node));


- if (ACPI_FAILURE (status)) {
- goto cleanup;
- }
-

- /* We could put the returned object (Node) on the object stack for later, but
- * for now, we will put it in the "op" object that the parser uses, so we
- * can get it again at the end of this scope
- */
- op->node = new_node;
-
- /*
- * If there is no object attached to the node, this node was just created and
- * we need to create the field object. Otherwise, this was a lookup of an
- * existing node and we don't want to create the field object again.
- */
- if (!new_node->object) {
- /*
- * The Field definition is not fully parsed at this time.
- * (We must save the address of the AML for the buffer and index operands)
- */
- status = acpi_ex_create_buffer_field (((acpi_parse2_object *) op)->data,
- ((acpi_parse2_object *) op)->length,
- new_node, walk_state);
- }
+ status = acpi_ds_create_buffer_field (op, walk_state);
X break;
X
X
- case AML_INT_METHODCALL_OP:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "RESOLVING-Method_call: State=%p Op=%p Named_obj=%p\n",
- walk_state, op, node));
-
- /*
- * Lookup the method name and save the Node
- */
- status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,
- ACPI_TYPE_ANY, IMODE_LOAD_PASS2,
- NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE,
- walk_state, &(new_node));
- if (ACPI_SUCCESS (status)) {
- /* TBD: has name already been resolved by here ??*/
-
- /* TBD: [Restructure] Make sure that what we found is indeed a method! */
- /* We didn't search for a method on purpose, to see if the name would resolve! */
+ case AML_TYPE_NAMED_FIELD:
X
- /* We could put the returned object (Node) on the object stack for later, but
- * for now, we will put it in the "op" object that the parser uses, so we
- * can get it again at the end of this scope
- */
- op->node = new_node;
- }


+ arg = op->value.arg;

+ switch (op->opcode) {
+ case AML_INDEX_FIELD_OP:
X
+ status = acpi_ds_create_index_field (op, (acpi_handle) arg->node,
+ walk_state);
+ break;
X
- break;
X
+ case AML_BANK_FIELD_OP:
X
- case AML_PROCESSOR_OP:
+ status = acpi_ds_create_bank_field (op, arg->node, walk_state);
+ break;
X
- /* Nothing to do other than enter object into namespace */
X
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Processor: State=%p Op=%p Named_obj=%p\n",
- walk_state, op, node));
+ case AML_FIELD_OP:
X
- status = acpi_ex_create_processor (op, node);


- if (ACPI_FAILURE (status)) {
- goto cleanup;

+ status = acpi_ds_create_field (op, arg->node, walk_state);
+ break;
X }
-
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Completed Processor Init, Op=%p State=%p entry=%p\n",
- op, walk_state, node));
X break;
X
X
- case AML_POWER_RES_OP:
+ case AML_TYPE_NAMED_SIMPLE:
X
- /* Nothing to do other than enter object into namespace */
-
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Power_resource: State=%p Op=%p Named_obj=%p\n",
- walk_state, op, node));
-
- status = acpi_ex_create_power_resource (op, node);
+ status = acpi_ds_create_operands (walk_state, arg);


X if (ACPI_FAILURE (status)) {
X goto cleanup;
X }
X

- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Completed Power_resource Init, Op=%p State=%p entry=%p\n",
- op, walk_state, node));
- break;
-
-
- case AML_THERMAL_ZONE_OP:
-
- /* Nothing to do other than enter object into namespace */
-
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Thermal_zone: State=%p Op=%p Named_obj=%p\n",
- walk_state, op, node));
- break;
+ switch (op->opcode) {
+ case AML_PROCESSOR_OP:
X
+ status = acpi_ex_create_processor (walk_state);
+ break;
X
- case AML_FIELD_OP:
X
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Field: State=%p Op=%p Named_obj=%p\n",
- walk_state, op, node));
+ case AML_POWER_RES_OP:


X
- arg = op->value.arg;

+ status = acpi_ex_create_power_resource (walk_state);
+ break;
X
- status = acpi_ds_create_field (op, arg->node, walk_state);
- break;
X
+ case AML_MUTEX_OP:
X
- case AML_INDEX_FIELD_OP:
+ status = acpi_ex_create_mutex (walk_state);
+ break;
X
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Index_field: State=%p Op=%p Named_obj=%p\n",
- walk_state, op, node));


X
- arg = op->value.arg;
-

- status = acpi_ds_create_index_field (op, (acpi_handle) arg->node,
- walk_state);
- break;
+ case AML_EVENT_OP:
X
+ status = acpi_ex_create_event (walk_state);
+ break;
X
- case AML_BANK_FIELD_OP:
X
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Bank_field: State=%p Op=%p Named_obj=%p\n",
- walk_state, op, node));
+ case AML_DATA_REGION_OP:


X
- arg = op->value.arg;

- status = acpi_ds_create_bank_field (op, arg->node, walk_state);
- break;
+ status = acpi_ex_create_table_region (walk_state);
+ break;
X
+ case AML_ALIAS_OP:
X
- /*
- * Method_op Pkg_length Names_string Method_flags Term_list
- */
- case AML_METHOD_OP:
+ status = acpi_ex_create_alias (walk_state);
+ break;
X
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Method: State=%p Op=%p Named_obj=%p\n",
- walk_state, op, node));
+ default:
+ /* Unknown opcode */
X
- if (!node->object) {
- status = acpi_ex_create_method (((acpi_parse2_object *) op)->data,
- ((acpi_parse2_object *) op)->length,
- arg->value.integer32, node);
+ status = AE_OK;
+ goto cleanup;
+ break;
X }
- break;
X
+ /* Delete operands */
X
- case AML_MUTEX_OP:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Mutex: Op=%p State=%p\n", op, walk_state));
-
- status = acpi_ds_create_operands (walk_state, arg);


- if (ACPI_FAILURE (status)) {
- goto cleanup;

+ for (i = 1; i < walk_state->num_operands; i++) {


+ acpi_ut_remove_reference (walk_state->operands[i]);

+ walk_state->operands[i] = NULL;
X }
X
- status = acpi_ex_create_mutex (walk_state);
X break;
X
X
- case AML_EVENT_OP:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Event: Op=%p State=%p\n", op, walk_state));
+ case AML_TYPE_NAMED_COMPLEX:
X
- status = acpi_ds_create_operands (walk_state, arg);


- if (ACPI_FAILURE (status)) {
- goto cleanup;
- }

+ switch (op->opcode) {
+ case AML_METHOD_OP:
+ /*
+ * Method_op Pkg_length Names_string Method_flags Term_list
+ */
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "LOADING-Method: State=%p Op=%p Named_obj=%p\n",
+ walk_state, op, node));
X
- status = acpi_ex_create_event (walk_state);
- break;
+ if (!node->object) {
+ status = acpi_ds_create_operands (walk_state, arg);
+ if (ACPI_FAILURE (status)) {
+ goto cleanup;
+ }
X
+ status = acpi_ex_create_method (((acpi_parse2_object *) op)->data,
+ ((acpi_parse2_object *) op)->length,
+ walk_state);
+ }
+ break;
X
- case AML_REGION_OP:
X
- if (node->object) {
+ case AML_REGION_OP:
+ /*
+ * The Op_region is not fully parsed at this time. Only valid argument is the Space_id.
+ * (We must save the address of the AML of the address and length operands)
+ */
+ status = acpi_ex_create_region (((acpi_parse2_object *) op)->data,
+ ((acpi_parse2_object *) op)->length,
+ (ACPI_ADR_SPACE_TYPE) arg->value.integer, walk_state);
X break;
- }
X
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Opregion: Op=%p State=%p Named_obj=%p\n",
- op, walk_state, node));
X
- /*
- * The Op_region is not fully parsed at this time. Only valid argument is the Space_id.
- * (We must save the address of the AML of the address and length operands)
- */
- status = acpi_ex_create_region (((acpi_parse2_object *) op)->data,
- ((acpi_parse2_object *) op)->length,
- (ACPI_ADR_SPACE_TYPE) arg->value.integer, walk_state);
+ case AML_NAME_OP:
X
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Completed Op_region Init, Op=%p State=%p entry=%p\n",
- op, walk_state, node));
+ status = acpi_ds_create_node (walk_state, node, op);
+ break;


+ }
X break;
X
X

- /* Namespace Modifier Opcodes */
-
- case AML_ALIAS_OP:
+ case AML_CLASS_INTERNAL:
X
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Alias: Op=%p State=%p\n", op, walk_state));
-
- status = acpi_ds_create_operands (walk_state, arg);


- if (ACPI_FAILURE (status)) {
- goto cleanup;
- }
-

- status = acpi_ex_create_alias (walk_state);
+ /* case AML_INT_NAMEPATH_OP: */
X break;
X
X
- case AML_NAME_OP:
+ case AML_CLASS_METHOD_CALL:
X
X ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Name: Op=%p State=%p\n", op, walk_state));
+ "RESOLVING-Method_call: State=%p Op=%p Named_obj=%p\n",
+ walk_state, op, node));
X
X /*
- * Because of the execution pass through the non-control-method
- * parts of the table, we can arrive here twice. Only init
- * the named object node the first time through
+ * Lookup the method name and save the Node
X */
- if (!node->object) {
- status = acpi_ds_create_node (walk_state, node, op);
- }
-
- break;


+ status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,

+ ACPI_TYPE_ANY, IMODE_LOAD_PASS2,
+ NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE,
+ walk_state, &(new_node));
+ if (ACPI_SUCCESS (status)) {
+ /* TBD: has name already been resolved by here ??*/
X
+ /* TBD: [Restructure] Make sure that what we found is indeed a method! */
+ /* We didn't search for a method on purpose, to see if the name would resolve! */
X
- case AML_INT_NAMEPATH_OP:


+ /* We could put the returned object (Node) on the object stack for later, but
+ * for now, we will put it in the "op" object that the parser uses, so we
+ * can get it again at the end of this scope
+ */

+ op->node = new_node;
+ }
X
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Name_path object: State=%p Op=%p Named_obj=%p\n",
- walk_state, op, node));
X break;
X
X
@@ -764,7 +697,8 @@
X
X /* Remove the Node pushed at the very beginning */
X
- acpi_ds_obj_stack_pop (1, walk_state);
+ walk_state->operands[0] = NULL;
+ walk_state->num_operands = 0;
X return (status);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/dispatcher/dswscope.c linux/drivers/acpi/dispatcher/dswscope.c
--- v2.4.13/linux/drivers/acpi/dispatcher/dswscope.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/dispatcher/dswscope.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: dswscope - Scope stack manipulation


- * $Revision: 48 $

+ * $Revision: 49 $


X *
X *****************************************************************************/
X

@@ -116,8 +116,9 @@
X
X /* Init new scope object */
X
- scope_info->scope.node = node;
- scope_info->common.value = (u16) type;
+ scope_info->common.data_type = ACPI_DESC_TYPE_STATE_WSCOPE;
+ scope_info->scope.node = node;
+ scope_info->common.value = (u16) type;
X
X /* Push new scope object onto stack */
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/dispatcher/dswstate.c linux/drivers/acpi/dispatcher/dswstate.c
--- v2.4.13/linux/drivers/acpi/dispatcher/dswstate.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/dispatcher/dswstate.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: dswstate - Dispatcher parse tree walk management routines
- * $Revision: 51 $
+ * $Revision: 54 $


X *
X *****************************************************************************/
X

@@ -368,6 +368,7 @@
X return (AE_NO_MEMORY);
X }
X
+ state->common.data_type = ACPI_DESC_TYPE_STATE_RESULT;
X acpi_ut_push_generic_state (&walk_state->results, state);
X
X ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Results=%p State=%p\n",
@@ -744,7 +745,7 @@


X *
X ******************************************************************************/
X

-static void
+void
X acpi_ds_push_walk_state (
X acpi_walk_state *walk_state,
X acpi_walk_list *walk_list)
@@ -855,12 +856,103 @@
X
X /* Put the new state at the head of the walk list */
X
- acpi_ds_push_walk_state (walk_state, walk_list);
+ if (walk_list) {
+ acpi_ds_push_walk_state (walk_state, walk_list);
+ }
X
X return_PTR (walk_state);
X }
X
X
+#ifndef _ACPI_ASL_COMPILER
+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ds_init_aml_walk
+ *
+ * PARAMETERS: Walk_state - New state to be initialized
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Initialize a walk state for a pass 1 or 2 parse tree walk


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ds_init_aml_walk (
+ acpi_walk_state *walk_state,
+ acpi_parse_object *op,
+ acpi_namespace_node *method_node,
+ u8 *aml_start,
+ u32 aml_length,
+ acpi_operand_object **params,
+ acpi_operand_object **return_obj_desc,
+ u32 pass_number)
+{
+ acpi_status status;
+ acpi_parse_state *parser_state = &walk_state->parser_state;
+
+
+ FUNCTION_TRACE ("Ds_init_aml_walk");


+
+
+ walk_state->parser_state.aml =

+ walk_state->parser_state.aml_start = aml_start;
+ walk_state->parser_state.aml_end =
+ walk_state->parser_state.pkg_end = aml_start + aml_length;
+
+ /* The Next_op of the Next_walk will be the beginning of the method */
+ /* TBD: [Restructure] -- obsolete? */
+
+ walk_state->next_op = NULL;
+ walk_state->params = params;
+ walk_state->caller_return_desc = return_obj_desc;
+
+ status = acpi_ps_init_scope (&walk_state->parser_state, op);
+ if (ACPI_FAILURE (status)) {


+ return_ACPI_STATUS (status);
+ }
+

+ if (method_node) {
+ walk_state->parser_state.start_node = method_node;
+ walk_state->walk_type = WALK_METHOD;
+ walk_state->method_node = method_node;
+ walk_state->method_desc = acpi_ns_get_attached_object (method_node);
+
+
+ /* Push start scope on scope stack and make it current */
+
+ status = acpi_ds_scope_stack_push (method_node, ACPI_TYPE_METHOD, walk_state);


+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }
+

+ /* Init the method arguments */
+
+ acpi_ds_method_data_init_args (params, MTH_NUM_ARGS, walk_state);
+ }
+
+ else {
+ /* Setup the current scope */
+
+ parser_state->start_node = parser_state->start_op->node;
+ if (parser_state->start_node) {
+ /* Push start scope on scope stack and make it current */
+
+ status = acpi_ds_scope_stack_push (parser_state->start_node,
+ parser_state->start_node->type, walk_state);


+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }
+ }
+ }

+
+ acpi_ds_init_callbacks (walk_state, pass_number);
+
+ return_ACPI_STATUS (AE_OK);
+}
+#endif
+
+
X /*******************************************************************************
X *
X * FUNCTION: Acpi_ds_delete_walk_state
@@ -893,7 +985,11 @@
X }
X
X
- /* Always must free any linked control states */
+ if (walk_state->parser_state.scope) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p walk still has a scope list\n", walk_state));
+ }
+
+ /* Always must free any linked control states */
X
X while (walk_state->control_state) {
X state = walk_state->control_state;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/driver.c linux/drivers/acpi/driver.c
--- v2.4.13/linux/drivers/acpi/driver.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/driver.c Wed Oct 24 14:06:22 2001
@@ -40,7 +40,6 @@
X #include <linux/acpi.h>
X #include <asm/uaccess.h>
X #include "acpi.h"
-#include "driver.h"
X
X
X #define _COMPONENT OS_DEPENDENT
@@ -50,6 +49,70 @@
X
X static int acpi_disabled = 0;
X
+enum acpi_blacklist_predicates
+{
+ all_versions,
+ less_than_or_equal,
+ equal,
+ greater_than_or_equal,
+};
+
+struct acpi_blacklist_item
+{
+ char oem_id[7];
+ char oem_table_id[9];
+ u32 oem_revision;
+ enum acpi_blacklist_predicates oem_revision_predicate;
+};
+
+/*
+ * Currently, this blacklists based on items in the FADT. We may want to
+ * expand this to using other ACPI tables in the future, too.
+ */
+static struct acpi_blacklist_item acpi_blacklist[] __initdata =
+{
+ {"TOSHIB", "750 ", 0x970814, less_than_or_equal}, /* Portege 7020, BIOS 8.10 */
+ {""}
+};
+
+int
+acpi_blacklisted(FADT_DESCRIPTOR *fadt)
+{
+ int i = 0;
+
+ while (acpi_blacklist[i].oem_id[0] != '\0')
+ {
+ if (strncmp(acpi_blacklist[i].oem_id, fadt->header.oem_id, 6)) {
+ i++;
+ continue;
+ }
+
+ if (strncmp(acpi_blacklist[i].oem_table_id, fadt->header.oem_table_id, 8)) {
+ i++;
+ continue;
+ }
+
+ if (acpi_blacklist[i].oem_revision_predicate == all_versions)
+ return TRUE;
+
+ if (acpi_blacklist[i].oem_revision_predicate == less_than_or_equal
+ && fadt->header.oem_revision <= acpi_blacklist[i].oem_revision)
+ return TRUE;
+
+ if (acpi_blacklist[i].oem_revision_predicate == greater_than_or_equal
+ && fadt->header.oem_revision >= acpi_blacklist[i].oem_revision)
+ return TRUE;
+
+ if (acpi_blacklist[i].oem_revision_predicate == equal
+ && fadt->header.oem_revision == acpi_blacklist[i].oem_revision)
+ return TRUE;
+
+ i++;
+ }
+
+ return FALSE;
+}
+
X /*
X * Start the interpreter
X */
@@ -64,7 +127,6 @@
X return -ENODEV;
X }
X
-
X if (acpi_disabled) {
X printk(KERN_NOTICE "ACPI: disabled by cmdline, exiting\n");
X return -ENODEV;
@@ -89,6 +151,12 @@
X
X if (!ACPI_SUCCESS(acpi_get_table(ACPI_TABLE_FADT, 1, &buffer))) {
X printk(KERN_ERR "ACPI: Could not get FADT\n");
+ acpi_terminate();
+ return -ENODEV;
+ }
+
+ if (acpi_blacklisted(&acpi_fadt)) {
+ printk(KERN_ERR "ACPI: On blacklist -- BIOS not fully ACPI compliant\n");
X acpi_terminate();
X return -ENODEV;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/driver.h linux/drivers/acpi/driver.h
--- v2.4.13/linux/drivers/acpi/driver.h Tue Jul 3 17:08:19 2001
+++ linux/drivers/acpi/driver.h Wed Dec 31 16:00:00 1969
@@ -1,72 +0,0 @@
-/*
- * driver.h - ACPI driver
- *
- * Copyright (C) 2000 Andrew Henroid
- *
- * This 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 __DRIVER_H
-#define __DRIVER_H
-
-#include <linux/tqueue.h>
-#include <linux/wait.h>
-#include <linux/pm.h>
-#include <linux/acpi.h>
-#include <asm/io.h>
-
-#define ACPI_MAX_THROTTLE 10
-#define ACPI_INVALID ~0UL
-#define ACPI_INFINITE ~0UL
-
-/*
- * cpu.c
- */
-int acpi_cpu_init(void);
-u32 acpi_read_pm_timer(void);
-
-extern u32 acpi_c2_exit_latency;
-extern u32 acpi_c3_exit_latency;
-extern u32 acpi_c2_enter_latency;
-extern u32 acpi_c3_enter_latency;
-extern u32 acpi_use_idle;
-extern u32 acpi_c1_count;
-extern u32 acpi_c2_count;
-extern u32 acpi_c3_count;
-
-/*
- * driver.c
- */
-int acpi_run(void (*callback)(void*), void *context);
-
-/*
- * ec.c
- */
-int acpi_ec_init(void);
-
-/*
- * power.c
- */
-int acpi_power_init(void);
-
-/*
- * sys.c
- */
-int acpi_sys_init(void);
-int acpi_enter_sx(acpi_sstate_t state);
-
-extern volatile acpi_sstate_t acpi_sleep_state;
-
-#endif /* __DRIVER_H */
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/events/evevent.c linux/drivers/acpi/events/evevent.c
--- v2.4.13/linux/drivers/acpi/events/evevent.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/events/evevent.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X *

X * Module Name: evevent - Fixed and General Purpose Acpi_event
X * handling and dispatch
- * $Revision: 50 $
+ * $Revision: 51 $


X *
X *****************************************************************************/
X

@@ -354,7 +354,7 @@
X * Allocate the Gpe information block
X */
X acpi_gbl_gpe_registers = ACPI_MEM_CALLOCATE (acpi_gbl_gpe_register_count *
- sizeof (ACPI_GPE_REGISTERS));
+ sizeof (acpi_gpe_registers));
X if (!acpi_gbl_gpe_registers) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
X "Could not allocate the Gpe_registers block\n"));
@@ -442,9 +442,9 @@
X register_index++;
X }
X
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE registers: %X@%p (Blk0) %X@%p (Blk1)\n",
- gpe0register_count, acpi_gbl_FADT->Xgpe0blk.address, gpe1_register_count,
- acpi_gbl_FADT->Xgpe1_blk.address));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE registers: %X@%8.8X%8.8X (Blk0) %X@%8.8X%8.8X (Blk1)\n",
+ gpe0register_count, HIDWORD(acpi_gbl_FADT->Xgpe0blk.address), LODWORD(acpi_gbl_FADT->Xgpe0blk.address),
+ gpe1_register_count, HIDWORD(acpi_gbl_FADT->Xgpe1_blk.address), LODWORD(acpi_gbl_FADT->Xgpe1_blk.address)));
X
X return_ACPI_STATUS (AE_OK);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/events/evmisc.c linux/drivers/acpi/events/evmisc.c
--- v2.4.13/linux/drivers/acpi/events/evmisc.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/events/evmisc.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X *

X * Module Name: evmisc - ACPI device notification handler dispatch
X * and ACPI Global Lock support
- * $Revision: 33 $
+ * $Revision: 35 $


X *
X *****************************************************************************/
X

@@ -88,7 +88,7 @@
X break;
X
X default:
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unknown Notify Value: %lx \n", notify_value));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unknown Notify Value: %X \n", notify_value));
X break;
X }
X
@@ -134,6 +134,7 @@
X return (AE_NO_MEMORY);
X }
X
+ notify_info->common.data_type = ACPI_DESC_TYPE_STATE_NOTIFY;
X notify_info->notify.node = node;
X notify_info->notify.value = (u16) notify_value;
X notify_info->notify.handler_obj = handler_obj;
@@ -173,7 +174,7 @@
X void *context)
X {
X acpi_generic_state *notify_info = (acpi_generic_state *) context;
- ACPI_NOTIFY_HANDLER global_handler = NULL;
+ acpi_notify_handler global_handler = NULL;
X void *global_context = NULL;
X acpi_operand_object *handler_obj;
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/events/evregion.c linux/drivers/acpi/events/evregion.c
--- v2.4.13/linux/drivers/acpi/events/evregion.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/events/evregion.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: evregion - ACPI Address_space (Op_region) handler dispatch
- * $Revision: 110 $
+ * $Revision: 113 $


X *
X *****************************************************************************/
X

@@ -147,17 +147,16 @@
X
X params[1] = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
X if (!params[1]) {
- acpi_ut_remove_reference (params[0]);
- return_ACPI_STATUS (AE_NO_MEMORY);


+ status = AE_NO_MEMORY;
+ goto cleanup;

X }
X
- params[2] = NULL;
-
X /*
X * Set up the parameter objects
X */
X params[0]->integer.value = region_obj->region.space_id;
X params[1]->integer.value = function;
+ params[2] = NULL;
X
X /*
X * Execute the method, no return value
@@ -165,9 +164,10 @@
X DEBUG_EXEC(acpi_ut_display_init_pathname (region_obj->region.extra->extra.method_REG, " [Method]"));
X status = acpi_ns_evaluate_by_handle (region_obj->region.extra->extra.method_REG, params, NULL);
X
+ acpi_ut_remove_reference (params[1]);
X
+cleanup:
X acpi_ut_remove_reference (params[0]);
- acpi_ut_remove_reference (params[1]);


X
X return_ACPI_STATUS (status);
X }

@@ -200,8 +200,8 @@
X u32 *value)
X {
X acpi_status status;
- ACPI_ADR_SPACE_HANDLER handler;
- ACPI_ADR_SPACE_SETUP region_setup;
+ acpi_adr_space_handler handler;
+ acpi_adr_space_setup region_setup;
X acpi_operand_object *handler_desc;
X void *region_context = NULL;
X
@@ -276,7 +276,7 @@
X handler = handler_desc->addr_handler.handler;
X
X ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
- "Addrhandler %p (%p), Address %8.8lX%8.8lX\n",
+ "Addrhandler %p (%p), Address %8.8X%8.8X\n",
X &region_obj->region.addr_handler->addr_handler, handler, HIDWORD(address),
X LODWORD(address)));
X
@@ -335,7 +335,7 @@
X acpi_operand_object *handler_obj;
X acpi_operand_object *obj_desc;
X acpi_operand_object **last_obj_ptr;
- ACPI_ADR_SPACE_SETUP region_setup;
+ acpi_adr_space_setup region_setup;
X void *region_context;
X acpi_status status;
X
@@ -548,7 +548,7 @@
X
X /* Convert and validate the device handle */
X
- node = acpi_ns_convert_handle_to_entry (obj_handle);
+ node = acpi_ns_map_handle_to_node (obj_handle);
X if (!node) {
X return (AE_BAD_PARAMETER);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/events/evrgnini.c linux/drivers/acpi/events/evrgnini.c
--- v2.4.13/linux/drivers/acpi/events/evrgnini.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/events/evrgnini.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: evrgnini- ACPI Address_space (Op_region) init
- * $Revision: 46 $
+ * $Revision: 48 $


X *
X *****************************************************************************/
X

@@ -145,7 +145,7 @@
X acpi_operand_object *handler_obj;
X acpi_namespace_node *node;
X acpi_operand_object *region_obj = (acpi_operand_object *) handle;
- ACPI_DEVICE_ID object_hID;
+ acpi_device_id object_hID;
X
X
X FUNCTION_TRACE ("Ev_pci_config_region_setup");
@@ -158,7 +158,7 @@
X * routine checks before we get here, but we check again just in case.
X */
X ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
- "Attempting to init a region %X, with no handler\n", region_obj));
+ "Attempting to init a region %p, with no handler\n", region_obj));
X return_ACPI_STATUS (AE_NOT_EXIST);
X }
X
@@ -257,6 +257,70 @@
X }
X
X *region_context = pci_id;


+ return_ACPI_STATUS (AE_OK);
+}
+
+

+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ev_pci_bar_region_setup
+ *
+ * PARAMETERS: Region_obj - region we are interested in
+ * Function - start or stop
+ * Handler_context - Address space handler context
+ * Region_context - Region specific context


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Do any prep work for region handling
+ *
+ * MUTEX: Assumes namespace is not locked


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ev_pci_bar_region_setup (
+ acpi_handle handle,
+ u32 function,
+ void *handler_context,
+ void **region_context)
+{
+
+ FUNCTION_TRACE ("Ev_pci_bar_region_setup");
+
+


+ return_ACPI_STATUS (AE_OK);
+}
+
+

+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ev_cmos_region_setup
+ *
+ * PARAMETERS: Region_obj - region we are interested in
+ * Function - start or stop
+ * Handler_context - Address space handler context
+ * Region_context - Region specific context


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Do any prep work for region handling
+ *
+ * MUTEX: Assumes namespace is not locked


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ev_cmos_region_setup (
+ acpi_handle handle,
+ u32 function,
+ void *handler_context,
+ void **region_context)
+{
+
+ FUNCTION_TRACE ("Ev_cmos_region_setup");
+
+
X return_ACPI_STATUS (AE_OK);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/events/evxface.c linux/drivers/acpi/events/evxface.c
--- v2.4.13/linux/drivers/acpi/events/evxface.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/events/evxface.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: evxface - External interfaces for ACPI events
- * $Revision: 112 $
+ * $Revision: 116 $


X *
X *****************************************************************************/
X

@@ -54,7 +54,7 @@
X acpi_status
X acpi_install_fixed_event_handler (
X u32 event,
- ACPI_EVENT_HANDLER handler,
+ acpi_event_handler handler,
X void *context)
X {
X acpi_status status;
@@ -63,13 +63,6 @@
X FUNCTION_TRACE ("Acpi_install_fixed_event_handler");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Parameter validation */
X
X if (event > ACPI_EVENT_MAX) {
@@ -86,12 +79,12 @@
X }
X
X
- /* Install the handler before enabling the event - just in case... */
+ /* Install the handler before enabling the event */
X
X acpi_gbl_fixed_event_handlers[event].handler = handler;
X acpi_gbl_fixed_event_handlers[event].context = context;
X
- status = acpi_enable_event (event, ACPI_EVENT_FIXED);
+ status = acpi_enable_event (event, ACPI_EVENT_FIXED, 0);
X if (!ACPI_SUCCESS (status)) {
X ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Could not enable fixed event.\n"));
X
@@ -129,7 +122,7 @@
X acpi_status
X acpi_remove_fixed_event_handler (
X u32 event,
- ACPI_EVENT_HANDLER handler)
+ acpi_event_handler handler)
X {
X acpi_status status = AE_OK;
X
@@ -137,13 +130,6 @@
X FUNCTION_TRACE ("Acpi_remove_fixed_event_handler");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Parameter validation */
X
X if (event > ACPI_EVENT_MAX) {
@@ -152,21 +138,19 @@
X
X acpi_ut_acquire_mutex (ACPI_MTX_EVENTS);
X
- /* Disable the event before removing the handler - just in case... */
+ /* Disable the event before removing the handler */
X
- status = acpi_disable_event(event, ACPI_EVENT_FIXED);
+ status = acpi_disable_event(event, ACPI_EVENT_FIXED, 0);
X
X /* Always Remove the handler */
X
X acpi_gbl_fixed_event_handlers[event].handler = NULL;
X acpi_gbl_fixed_event_handlers[event].context = NULL;
X
-
- if (!ACPI_SUCCESS(status)) {
+ if (!ACPI_SUCCESS (status)) {
X ACPI_DEBUG_PRINT ((ACPI_DB_WARN,
X "Could not write to fixed event enable register.\n"));
X }
-
X else {
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Disabled fixed event %X.\n", event));
X }
@@ -197,7 +181,7 @@
X acpi_install_notify_handler (
X acpi_handle device,
X u32 handler_type,
- ACPI_NOTIFY_HANDLER handler,
+ acpi_notify_handler handler,
X void *context)
X {
X acpi_operand_object *obj_desc;
@@ -209,13 +193,6 @@
X FUNCTION_TRACE ("Acpi_install_notify_handler");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Parameter validation */
X
X if ((!handler) ||
@@ -227,7 +204,7 @@
X
X /* Convert and validate the device handle */
X
- device_node = acpi_ns_convert_handle_to_entry (device);
+ device_node = acpi_ns_map_handle_to_node (device);
X if (!device_node) {
X status = AE_BAD_PARAMETER;
X goto unlock_and_exit;
@@ -235,7 +212,6 @@
X
X /*
X * Root Object:
- * ------------
X * Registering a notify handler on the root object indicates that the
X * caller wishes to receive notifications for all objects. Note that
X * only one <external> global handler can be regsitered (per notify type).


@@ -266,8 +242,7 @@
X }

X
X /*
- * Other Objects:
- * --------------
+ * All Other Objects:
X * Caller will only receive notifications specific to the target object.
X * Note that only certain object types can receive notifications.
X */
@@ -338,6 +313,7 @@
X }
X }
X
+
X unlock_and_exit:
X acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
X return_ACPI_STATUS (status);
@@ -363,7 +339,7 @@
X acpi_remove_notify_handler (
X acpi_handle device,
X u32 handler_type,
- ACPI_NOTIFY_HANDLER handler)
+ acpi_notify_handler handler)
X {
X acpi_operand_object *notify_obj;
X acpi_operand_object *obj_desc;
@@ -374,13 +350,6 @@
X FUNCTION_TRACE ("Acpi_remove_notify_handler");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Parameter validation */
X
X if ((!handler) ||
@@ -392,18 +361,16 @@
X
X /* Convert and validate the device handle */
X
- device_node = acpi_ns_convert_handle_to_entry (device);
+ device_node = acpi_ns_map_handle_to_node (device);
X if (!device_node) {
X status = AE_BAD_PARAMETER;
X goto unlock_and_exit;
X }
X
X /*
- * Root Object:
- * ------------
+ * Root Object
X */
X if (device == ACPI_ROOT_OBJECT) {
-
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing notify handler for ROOT object.\n"));
X
X if (((handler_type == ACPI_SYSTEM_NOTIFY) &&
@@ -415,20 +382,19 @@
X }
X
X if (handler_type == ACPI_SYSTEM_NOTIFY) {
- acpi_gbl_sys_notify.node = NULL;
+ acpi_gbl_sys_notify.node = NULL;
X acpi_gbl_sys_notify.handler = NULL;
X acpi_gbl_sys_notify.context = NULL;
X }
X else {
- acpi_gbl_drv_notify.node = NULL;
+ acpi_gbl_drv_notify.node = NULL;
X acpi_gbl_drv_notify.handler = NULL;
X acpi_gbl_drv_notify.context = NULL;
X }
X }
X
X /*
- * Other Objects:
- * --------------
+ * All Other Objects
X */
X else {
X /*
@@ -505,7 +471,7 @@
X acpi_install_gpe_handler (
X u32 gpe_number,
X u32 type,
- ACPI_GPE_HANDLER handler,
+ acpi_gpe_handler handler,
X void *context)
X {
X acpi_status status = AE_OK;
@@ -514,13 +480,6 @@
X FUNCTION_TRACE ("Acpi_install_gpe_handler");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Parameter validation */
X
X if (!handler || (gpe_number > ACPI_GPE_MAX)) {
@@ -553,6 +512,7 @@
X acpi_hw_clear_gpe (gpe_number);
X acpi_hw_enable_gpe (gpe_number);
X
+
X cleanup:
X acpi_ut_release_mutex (ACPI_MTX_EVENTS);
X return_ACPI_STATUS (status);
@@ -575,7 +535,7 @@
X acpi_status
X acpi_remove_gpe_handler (
X u32 gpe_number,
- ACPI_GPE_HANDLER handler)
+ acpi_gpe_handler handler)
X {
X acpi_status status = AE_OK;
X
@@ -583,13 +543,6 @@
X FUNCTION_TRACE ("Acpi_remove_gpe_handler");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Parameter validation */
X
X if (!handler || (gpe_number > ACPI_GPE_MAX)) {
@@ -621,6 +574,7 @@
X acpi_gbl_gpe_info[gpe_number].handler = NULL;
X acpi_gbl_gpe_info[gpe_number].context = NULL;
X
+
X cleanup:
X acpi_ut_release_mutex (ACPI_MTX_EVENTS);
X return_ACPI_STATUS (status);
@@ -639,6 +593,7 @@
X * DESCRIPTION: Acquire the ACPI Global Lock
X *
X ******************************************************************************/
+
X acpi_status
X acpi_acquire_global_lock (
X void)
@@ -646,13 +601,6 @@
X acpi_status status;
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {
- return (status);
- }
-
X status = acpi_ex_enter_interpreter ();
X if (ACPI_FAILURE (status)) {
X return (status);
@@ -685,15 +633,6 @@
X acpi_release_global_lock (
X void)
X {
- acpi_status status;
-
-
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {
- return (status);
- }
X
X acpi_ev_release_global_lock ();
X return (AE_OK);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/events/evxfevnt.c linux/drivers/acpi/events/evxfevnt.c
--- v2.4.13/linux/drivers/acpi/events/evxfevnt.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/events/evxfevnt.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
- * $Revision: 36 $
+ * $Revision: 38 $


X *
X *****************************************************************************/
X

@@ -106,13 +106,6 @@
X FUNCTION_TRACE ("Acpi_disable");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Restore original mode */
X
X status = acpi_hw_set_mode (acpi_gbl_original_mode);
@@ -136,6 +129,7 @@
X *
X * PARAMETERS: Event - The fixed event or GPE to be enabled
X * Type - The type of event
+ * Flags - Just enable, or also wake enable?


X *
X * RETURN: Status
X *

@@ -146,7 +140,8 @@
X acpi_status
X acpi_enable_event (
X u32 event,
- u32 type)
+ u32 type,
+ u32 flags)
X {
X acpi_status status = AE_OK;
X u32 register_id;
@@ -155,13 +150,6 @@
X FUNCTION_TRACE ("Acpi_enable_event");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* The Type must be either Fixed Acpi_event or GPE */
X
X switch (type) {
@@ -223,7 +211,13 @@
X
X /* Enable the requested GPE number */
X
- acpi_hw_enable_gpe (event);
+ if (flags & ACPI_EVENT_ENABLE) {
+ acpi_hw_enable_gpe (event);
+ }
+ if (flags & ACPI_EVENT_WAKE_ENABLE) {
+ acpi_hw_enable_gpe_for_wakeup (event);
+ }


+
X break;
X
X

@@ -242,7 +236,8 @@
X * FUNCTION: Acpi_disable_event
X *
X * PARAMETERS: Event - The fixed event or GPE to be enabled
- * Type - The type of event
+ * Type - The type of event, fixed or general purpose
+ * Flags - Wake disable vs. non-wake disable


X *
X * RETURN: Status
X *

@@ -253,7 +248,8 @@
X acpi_status
X acpi_disable_event (
X u32 event,
- u32 type)
+ u32 type,
+ u32 flags)
X {
X acpi_status status = AE_OK;
X u32 register_id;
@@ -262,13 +258,6 @@
X FUNCTION_TRACE ("Acpi_disable_event");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* The Type must be either Fixed Acpi_event or GPE */
X
X switch (type) {
@@ -329,7 +318,13 @@
X
X /* Disable the requested GPE number */
X
- acpi_hw_disable_gpe (event);
+ if (flags & ACPI_EVENT_DISABLE) {
+ acpi_hw_disable_gpe (event);
+ }
+ if (flags & ACPI_EVENT_WAKE_DISABLE) {
+ acpi_hw_disable_gpe_for_wakeup (event);
+ }


+
X break;
X
X

@@ -366,13 +361,6 @@
X FUNCTION_TRACE ("Acpi_clear_event");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* The Type must be either Fixed Acpi_event or GPE */
X
X switch (type) {
@@ -466,13 +454,6 @@
X
X FUNCTION_TRACE ("Acpi_get_event_status");
X
-
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }

X
X if (!event_status) {
X return_ACPI_STATUS (AE_BAD_PARAMETER);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/events/evxfregn.c linux/drivers/acpi/events/evxfregn.c
--- v2.4.13/linux/drivers/acpi/events/evxfregn.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/events/evxfregn.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X *

X * Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
X * Address Spaces.
- * $Revision: 36 $
+ * $Revision: 40 $


X *
X *****************************************************************************/
X

@@ -56,8 +56,8 @@
X acpi_install_address_space_handler (
X acpi_handle device,
X ACPI_ADR_SPACE_TYPE space_id,
- ACPI_ADR_SPACE_HANDLER handler,
- ACPI_ADR_SPACE_SETUP setup,
+ acpi_adr_space_handler handler,
+ acpi_adr_space_setup setup,
X void *context)
X {
X acpi_operand_object *obj_desc;
@@ -71,13 +71,6 @@
X FUNCTION_TRACE ("Acpi_install_address_space_handler");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Parameter validation */
X
X if ((!device) ||


@@ -90,16 +83,16 @@
X

X /* Convert and validate the device handle */
X
- node = acpi_ns_convert_handle_to_entry (device);
+ node = acpi_ns_map_handle_to_node (device);
X if (!node) {
X status = AE_BAD_PARAMETER;
X goto unlock_and_exit;
X }
X
X /*
- * This registration is valid for only the types below
- * and the root. This is where the default handlers
- * get placed.
+ * This registration is valid for only the types below
+ * and the root. This is where the default handlers
+ * get placed.
X */
X if ((node->type != ACPI_TYPE_DEVICE) &&
X (node->type != ACPI_TYPE_PROCESSOR) &&
@@ -115,17 +108,27 @@
X switch (space_id) {
X case ACPI_ADR_SPACE_SYSTEM_MEMORY:
X handler = acpi_ex_system_memory_space_handler;
- setup = acpi_ev_system_memory_region_setup;
+ setup = acpi_ev_system_memory_region_setup;
X break;
X
X case ACPI_ADR_SPACE_SYSTEM_IO:
X handler = acpi_ex_system_io_space_handler;
- setup = acpi_ev_io_space_region_setup;
+ setup = acpi_ev_io_space_region_setup;
X break;
X
X case ACPI_ADR_SPACE_PCI_CONFIG:
X handler = acpi_ex_pci_config_space_handler;
- setup = acpi_ev_pci_config_region_setup;
+ setup = acpi_ev_pci_config_region_setup;
+ break;
+
+ case ACPI_ADR_SPACE_CMOS:
+ handler = acpi_ex_cmos_space_handler;
+ setup = acpi_ev_cmos_region_setup;
+ break;
+
+ case ACPI_ADR_SPACE_PCI_BAR_TARGET:
+ handler = acpi_ex_pci_bar_space_handler;
+ setup = acpi_ev_pci_bar_region_setup;
X break;
X
X default:
@@ -136,20 +139,20 @@
X }
X
X /*
- * If the caller hasn't specified a setup routine, use the default
+ * If the caller hasn't specified a setup routine, use the default
X */
X if (!setup) {
X setup = acpi_ev_default_region_setup;
X }
X
X /*
- * Check for an existing internal object
+ * Check for an existing internal object
X */
X obj_desc = acpi_ns_get_attached_object (node);
X if (obj_desc) {
X /*
- * The object exists.
- * Make sure the handler is not already installed.
+ * The object exists.
+ * Make sure the handler is not already installed.
X */
X
X /* check the address handler the user requested */
@@ -157,8 +160,8 @@
X handler_obj = obj_desc->device.addr_handler;
X while (handler_obj) {
X /*
- * We have an Address handler, see if user requested this
- * address space.
+ * We have an Address handler, see if user requested this
+ * address space.
X */
X if(handler_obj->addr_handler.space_id == space_id) {
X status = AE_EXIST;
@@ -166,7 +169,7 @@
X }
X
X /*
- * Move through the linked list of handlers
+ * Move through the linked list of handlers
X */
X handler_obj = handler_obj->addr_handler.next;
X }
@@ -181,7 +184,6 @@
X if (node->type == ACPI_TYPE_ANY) {
X type = ACPI_TYPE_DEVICE;
X }
-
X else {
X type = node->type;
X }
@@ -210,11 +212,11 @@
X acpi_ut_get_region_name (space_id), space_id, node, obj_desc));
X
X /*
- * Now we can install the handler
+ * Now we can install the handler
X *
- * At this point we know that there is no existing handler.
- * So, we just allocate the object for the handler and link it
- * into the list.
+ * At this point we know that there is no existing handler.
+ * So, we just allocate the object for the handler and link it
+ * into the list.
X */
X handler_obj = acpi_ut_create_internal_object (INTERNAL_TYPE_ADDRESS_HANDLER);
X if (!handler_obj) {
@@ -232,16 +234,16 @@
X handler_obj->addr_handler.setup = setup;
X
X /*
- * Now walk the namespace finding all of the regions this
- * handler will manage.
+ * Now walk the namespace finding all of the regions this
+ * handler will manage.
X *
- * We start at the device and search the branch toward
- * the leaf nodes until either the leaf is encountered or
- * a device is detected that has an address handler of the
- * same type.
+ * We start at the device and search the branch toward
+ * the leaf nodes until either the leaf is encountered or
+ * a device is detected that has an address handler of the
+ * same type.
X *
- * In either case we back up and search down the remainder
- * of the branch
+ * In either case we back up and search down the remainder
+ * of the branch
X */
X status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, device,
X ACPI_UINT32_MAX, NS_WALK_UNLOCK,
@@ -249,7 +251,7 @@
X handler_obj, NULL);
X
X /*
- * Place this handler 1st on the list
+ * Place this handler 1st on the list
X */
X handler_obj->common.reference_count =
X (u16) (handler_obj->common.reference_count +
@@ -280,7 +282,7 @@
X acpi_remove_address_space_handler (
X acpi_handle device,
X ACPI_ADR_SPACE_TYPE space_id,
- ACPI_ADR_SPACE_HANDLER handler)
+ acpi_adr_space_handler handler)
X {
X acpi_operand_object *obj_desc;
X acpi_operand_object *handler_obj;
@@ -293,13 +295,6 @@
X FUNCTION_TRACE ("Acpi_remove_address_space_handler");
X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Parameter validation */
X
X if ((!device) ||
@@ -312,7 +307,7 @@
X
X /* Convert and validate the device handle */
X
- node = acpi_ns_convert_handle_to_entry (device);
+ node = acpi_ns_map_handle_to_node (device);
X if (!node) {
X status = AE_BAD_PARAMETER;
X goto unlock_and_exit;


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 13'
echo 'File patch-2.4.14 is continued in part 14'
echo "14" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:29 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part06

#!/bin/sh -x
# this is part 06 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 06; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X # CONFIG_UDF_FS is not set
X # CONFIG_UDF_RW is not set
X # CONFIG_UFS_FS is not set

@@ -604,11 +634,13 @@


X # CONFIG_NLS_CODEPAGE_865 is not set
X # CONFIG_NLS_CODEPAGE_866 is not set
X # CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
X # CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set

X CONFIG_NLS_CODEPAGE_950=y


+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
X # CONFIG_NLS_ISO8859_1 is not set
X # CONFIG_NLS_ISO8859_2 is not set
X # CONFIG_NLS_ISO8859_3 is not set

@@ -616,11 +648,12 @@


X # CONFIG_NLS_ISO8859_5 is not set
X # CONFIG_NLS_ISO8859_6 is not set
X # CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_8 is not set
X # CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
X # CONFIG_NLS_ISO8859_14 is not set
X # CONFIG_NLS_ISO8859_15 is not set
X # CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
X # CONFIG_NLS_UTF8 is not set
X
X #

@@ -628,7 +661,6 @@
X #
X CONFIG_PC_KEYMAP=y


X # CONFIG_VGA_CONSOLE is not set
-CONFIG_FB=y
X
X #
X # Frame-buffer support

@@ -640,12 +672,14 @@
X # CONFIG_FB_CYBER2000 is not set
X # CONFIG_FB_SA1100 is not set
X CONFIG_FB_MQ200=y


+# CONFIG_FB_ANAKIN is not set

+# CONFIG_FB_E1355 is not set


X # CONFIG_FB_VIRTUAL is not set

X CONFIG_FBCON_ADVANCED=y
X # CONFIG_FBCON_MFB is not set


-# CONFIG_FBCON_CFB2 is not set
-# CONFIG_FBCON_CFB4 is not set

-# CONFIG_FBCON_CFB8 is not set
+CONFIG_FBCON_CFB2=y
+CONFIG_FBCON_CFB4=y
+CONFIG_FBCON_CFB8=y
X CONFIG_FBCON_CFB16=y
X # CONFIG_FBCON_CFB24 is not set
X # CONFIG_FBCON_CFB32 is not set
@@ -670,8 +704,11 @@


X # Sound
X #
X CONFIG_SOUND=y

-CONFIG_SOUND_UDA1341=y


-# CONFIG_SOUND_SA1100_SSP is not set

+# CONFIG_SOUND_ASSABET_UDA1341 is not set

+CONFIG_SOUND_PANGOLIN_UDA1341=y
+# CONFIG_SOUND_BITSY_UDA1341 is not set


+# CONFIG_SOUND_SA1111_UDA1341 is not set
+# CONFIG_SOUND_SA1100SSP is not set

X # CONFIG_SOUND_CMPCI is not set
X # CONFIG_SOUND_EMU10K1 is not set
X # CONFIG_SOUND_FUSION is not set

@@ -687,6 +724,7 @@


X # CONFIG_SOUND_MSNDCLAS is not set
X # CONFIG_SOUND_MSNDPIN is not set
X # CONFIG_SOUND_VIA82CXXX is not set
+# CONFIG_MIDI_VIA82CXXX is not set

X # CONFIG_SOUND_OSS is not set

X # CONFIG_SOUND_TVMIXER is not set
X

@@ -694,6 +732,11 @@


X # USB support
X #
X # CONFIG_USB is not set
+
+#

+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set

X
X #
X # Kernel hacking
diff -u --recursive --new-file v2.4.13/linux/arch/arm/def-configs/shark linux/arch/arm/def-configs/shark
--- v2.4.13/linux/arch/arm/def-configs/shark Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/def-configs/shark Thu Oct 25 13:53:45 2001
@@ -8,6 +8,7 @@


X CONFIG_UID16=y
X CONFIG_RWSEM_GENERIC_SPINLOCK=y
X # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+# CONFIG_GENERIC_BUST_SPINLOCK is not set

X
X #
X # Code maturity level options

@@ -62,13 +63,15 @@


X #
X # CONFIG_SA1100_ASSABET is not set
X # CONFIG_ASSABET_NEPONSET is not set
+# CONFIG_SA1100_ADSBITSY is not set
X # CONFIG_SA1100_BRUTUS is not set
X # CONFIG_SA1100_CERF is not set
-# CONFIG_SA1100_BITSY is not set
+# CONFIG_SA1100_H3600 is not set
X # CONFIG_SA1100_EXTENEX1 is not set
X # CONFIG_SA1100_FLEXANET is not set
X # CONFIG_SA1100_FREEBIRD is not set
X # CONFIG_SA1100_GRAPHICSCLIENT is not set
+# CONFIG_SA1100_GRAPHICSMASTER is not set
X # CONFIG_SA1100_JORNADA720 is not set
X # CONFIG_SA1100_HUW_WEBPANEL is not set
X # CONFIG_SA1100_ITSY is not set

@@ -78,6 +81,7 @@
X # CONFIG_SA1100_PANGOLIN is not set


X # CONFIG_SA1100_PLEB is not set
X # CONFIG_SA1100_SHERMAN is not set
+# CONFIG_SA1100_SIMPAD is not set
X # CONFIG_SA1100_PFS168 is not set
X # CONFIG_SA1100_VICTOR is not set
X # CONFIG_SA1100_XP860 is not set

@@ -86,7 +90,12 @@


X #
X # CLPS711X/EP721X Implementations
X #
+# CONFIG_ARCH_CDB89712 is not set
+# CONFIG_ARCH_CLEP7312 is not set
+# CONFIG_ARCH_EDB7211 is not set
X # CONFIG_ARCH_P720T is not set
+# CONFIG_ARCH_EP7211 is not set
+# CONFIG_ARCH_EP7212 is not set
X # CONFIG_ARCH_ACORN is not set
X # CONFIG_FOOTBRIDGE is not set
X # CONFIG_FOOTBRIDGE_HOST is not set

@@ -106,6 +115,7 @@


X # CONFIG_CPU_ARM1020 is not set

X CONFIG_CPU_SA110=y
X # CONFIG_CPU_SA1100 is not set


+# CONFIG_ARM_THUMB is not set

X # CONFIG_DISCONTIGMEM is not set
X
X #
@@ -121,6 +131,10 @@


X CONFIG_SYSVIPC=y
X # CONFIG_BSD_PROCESS_ACCT is not set
X CONFIG_SYSCTL=y
+
+#
+# At least one math emulation must be selected
+#

X # CONFIG_FPE_NWFPE is not set
X CONFIG_FPE_FASTFPE=y
X CONFIG_KCORE_ELF=y
@@ -140,12 +154,15 @@
X #
X CONFIG_PARPORT=y
X CONFIG_PARPORT_PC=y
+CONFIG_PARPORT_PC_CML1=y
+# CONFIG_PARPORT_SERIAL is not set
X # CONFIG_PARPORT_PC_FIFO is not set
X # CONFIG_PARPORT_PC_SUPERIO is not set
X # CONFIG_PARPORT_ARC is not set
X # CONFIG_PARPORT_AMIGA is not set
X # CONFIG_PARPORT_MFC3 is not set
X # CONFIG_PARPORT_ATARI is not set
+# CONFIG_PARPORT_GSC is not set
X # CONFIG_PARPORT_SUNBPP is not set
X # CONFIG_PARPORT_OTHER is not set
X # CONFIG_PARPORT_1284 is not set
@@ -155,6 +172,7 @@


X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set
+# CONFIG_PNPBIOS is not set
X
X #
X # Block devices

@@ -180,6 +198,7 @@


X # CONFIG_MD_RAID0 is not set
X # CONFIG_MD_RAID1 is not set
X # CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
X # CONFIG_BLK_DEV_LVM is not set
X
X #

@@ -262,8 +281,6 @@


X # CONFIG_APRICOT is not set

X CONFIG_CS89x0=y


X # CONFIG_TULIP is not set
-# CONFIG_TULIP_MWI is not set

-# CONFIG_TULIP_MMIO is not set
X # CONFIG_DE4X5 is not set


X # CONFIG_DGRS is not set
X # CONFIG_DM9102 is not set

@@ -290,8 +307,9 @@


X # Ethernet (1000 Mbit)
X #
X # CONFIG_ACENIC is not set
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
+# CONFIG_DL2K is not set
X # CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
X # CONFIG_HAMACHI is not set
X # CONFIG_YELLOWFIN is not set
X # CONFIG_SK98LIN is not set

@@ -374,6 +392,9 @@


X # CONFIG_IDEDMA_AUTO is not set
X # CONFIG_DMA_NONPCI is not set
X # CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set
X
X #
X # SCSI support

@@ -411,6 +432,7 @@


X # CONFIG_SCSI_AHA1740 is not set
X # CONFIG_SCSI_AIC7XXX is not set
X # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
X # CONFIG_SCSI_ADVANSYS is not set
X # CONFIG_SCSI_IN2000 is not set
X # CONFIG_SCSI_AM53C974 is not set

@@ -449,7 +471,7 @@
X # CONFIG_SCSI_DEBUG is not set
X
X #
-# IEEE 1394 (FireWire) support
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
X #
X # CONFIG_IEEE1394 is not set
X
@@ -472,6 +494,10 @@


X # Input core support
X #
X # CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
X
X #
X # Character devices

@@ -482,17 +508,29 @@
X CONFIG_SERIAL_CONSOLE=y


X # CONFIG_SERIAL_EXTENDED is not set
X # CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_SERIAL_21285 is not set
-# CONFIG_SERIAL_21285_OLD is not set
-# CONFIG_SERIAL_21285_CONSOLE is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_ANAKIN is not set
+# CONFIG_SERIAL_ANAKIN_CONSOLE is not set
X # CONFIG_SERIAL_AMBA is not set
X # CONFIG_SERIAL_AMBA_CONSOLE is not set
X # CONFIG_SERIAL_CLPS711X is not set
X # CONFIG_SERIAL_CLPS711X_CONSOLE is not set
+# CONFIG_SERIAL_21285 is not set
+# CONFIG_SERIAL_21285_OLD is not set
+# CONFIG_SERIAL_21285_CONSOLE is not set

X # CONFIG_SERIAL_SA1100 is not set
X # CONFIG_SERIAL_SA1100_CONSOLE is not set


X # CONFIG_SERIAL_8250 is not set
X # CONFIG_SERIAL_8250_CONSOLE is not set
+# CONFIG_SERIAL_8250_EXTENDED is not set
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_HUB6 is not set

X CONFIG_UNIX98_PTYS=y
X CONFIG_UNIX98_PTY_COUNT=256
X CONFIG_PRINTER=m
@@ -505,6 +543,19 @@


X # CONFIG_I2C is not set
X
X #
+# L3 serial bus support
+#
+# CONFIG_L3 is not set
+# CONFIG_L3_ALGOBIT is not set
+# CONFIG_L3_BIT_SA1100_GPIO is not set
+
+#
+# Other L3 adapters
+#
+# CONFIG_L3_SA1111 is not set
+# CONFIG_BIT_SA1100_GPIO is not set
+
+#
X # Mice
X #
X # CONFIG_BUSMOUSE is not set

@@ -516,7 +567,11 @@


X #
X # Joysticks
X #
-# CONFIG_JOYSTICK is not set
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
X
X #
X # Input core support is needed for joysticks

@@ -533,6 +588,7 @@


X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
X
X #
X # Ftape, the floppy tape device driver

@@ -540,6 +596,7 @@


X # CONFIG_FTAPE is not set
X # CONFIG_AGP is not set
X # CONFIG_DRM is not set

+# CONFIG_MWAVE is not set
X
X #
X # Multimedia devices

@@ -554,11 +611,16 @@


X # CONFIG_AUTOFS4_FS is not set

X # CONFIG_REISERFS_FS is not set


X # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
X # CONFIG_ADFS_FS is not set
X # CONFIG_ADFS_FS_RW is not set
X # CONFIG_AFFS_FS is not set
X # CONFIG_HFS_FS is not set
X # CONFIG_BFS_FS is not set
+# CONFIG_CMS_FS is not set

+CONFIG_EXT3_FS=y
+CONFIG_JBD=y


+# CONFIG_JBD_DEBUG is not set
X CONFIG_FAT_FS=y
X CONFIG_MSDOS_FS=y
X # CONFIG_UMSDOS_FS is not set

@@ -571,8 +633,9 @@


X # CONFIG_RAMFS is not set

X CONFIG_ISO9660_FS=y
X CONFIG_JOLIET=y


+# CONFIG_ZISOFS is not set
X # CONFIG_MINIX_FS is not set
-# CONFIG_VXFS_FS is not set
+# CONFIG_FREEVXFS_FS is not set
X # CONFIG_NTFS_FS is not set
X # CONFIG_NTFS_RW is not set
X # CONFIG_HPFS_FS is not set

@@ -595,6 +658,7 @@


X # Network File Systems
X #
X # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
X CONFIG_NFS_FS=y
X # CONFIG_NFS_V3 is not set
X # CONFIG_ROOT_NFS is not set

@@ -612,6 +676,8 @@


X # CONFIG_NCPFS_SMALLDOS is not set
X # CONFIG_NCPFS_NLS is not set
X # CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set
+# CONFIG_ZLIB_FS_INFLATE is not set
X
X #
X # Partition Types

@@ -627,6 +693,7 @@


X # CONFIG_MINIX_SUBPARTITION is not set
X # CONFIG_SOLARIS_X86_PARTITION is not set
X # CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
X # CONFIG_SGI_PARTITION is not set
X # CONFIG_ULTRIX_PARTITION is not set
X # CONFIG_SUN_PARTITION is not set

@@ -689,17 +756,19 @@
X # CONFIG_FB_RIVA is not set
X # CONFIG_FB_CLGEN is not set
X # CONFIG_FB_PM2 is not set
+# CONFIG_FB_PM3 is not set


X # CONFIG_FB_ACORN is not set
+# CONFIG_FB_ANAKIN is not set
X # CONFIG_FB_CLPS711X is not set

-CONFIG_FB_CYBER2000=y
X # CONFIG_FB_SA1100 is not set


-# CONFIG_FB_ANAKIN is not set
-# CONFIG_FB_E1355 is not set

+CONFIG_FB_CYBER2000=y


X # CONFIG_FB_MATROX is not set
X # CONFIG_FB_ATY is not set
+# CONFIG_FB_RADEON is not set
X # CONFIG_FB_ATY128 is not set
-# CONFIG_FB_3DFX is not set
X # CONFIG_FB_SIS is not set
+# CONFIG_FB_3DFX is not set

+# CONFIG_FB_VOODOO1 is not set


X # CONFIG_FB_VIRTUAL is not set
X # CONFIG_FBCON_ADVANCED is not set

X CONFIG_FBCON_CFB8=y
@@ -714,8 +783,10 @@


X # Sound
X #
X CONFIG_SOUND=m

+# CONFIG_SOUND_BT878 is not set
X # CONFIG_SOUND_CMPCI is not set
X # CONFIG_SOUND_EMU10K1 is not set
+# CONFIG_MIDI_EMU10K1 is not set
X # CONFIG_SOUND_FUSION is not set
X # CONFIG_SOUND_CS4281 is not set
X # CONFIG_SOUND_ES1370 is not set

@@ -724,6 +795,7 @@


X # CONFIG_SOUND_MAESTRO is not set
X # CONFIG_SOUND_MAESTRO3 is not set
X # CONFIG_SOUND_ICH is not set
+# CONFIG_SOUND_RME96XX is not set
X # CONFIG_SOUND_SONICVIBES is not set
X # CONFIG_SOUND_TRIDENT is not set
X # CONFIG_SOUND_MSNDCLAS is not set

@@ -764,9 +836,117 @@


X # CONFIG_SOUND_TVMIXER is not set
X
X #
+# Multimedia Capabilities Port drivers
+#
+# CONFIG_MCP is not set
+# CONFIG_MCP_SA1100 is not set
+# CONFIG_MCP_UCB1200 is not set
+# CONFIG_MCP_UCB1200_AUDIO is not set
+# CONFIG_MCP_UCB1200_TS is not set
+
+#
X # USB support
X #
X # CONFIG_USB is not set

+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set

+# CONFIG_USB_OHCI_SA1111 is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set

+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_DPCM is not set

+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set

+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set

+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#

+# Miscellaneous USB drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_ID75 is not set
X
X #
X # Bluetooth support

diff -u --recursive --new-file v2.4.13/linux/arch/arm/kernel/Makefile linux/arch/arm/kernel/Makefile
--- v2.4.13/linux/arch/arm/kernel/Makefile Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/kernel/Makefile Thu Oct 25 13:53:45 2001
@@ -42,7 +42,7 @@
X
X no-irq-arch := $(CONFIG_ARCH_INTEGRATOR) $(CONFIG_ARCH_CLPS711X) \
X $(CONFIG_FOOTBRIDGE) $(CONFIG_ARCH_EBSA110) \
- $(CONFIG_ARCH_SA1100)
+ $(CONFIG_ARCH_SA1100) $(CONFIG_ARCH_CAMELOT)
X
X ifneq ($(findstring y,$(no-irq-arch)),y)
X obj-y += irq-arch.o
diff -u --recursive --new-file v2.4.13/linux/arch/arm/kernel/debug-armv.S linux/arch/arm/kernel/debug-armv.S
--- v2.4.13/linux/arch/arm/kernel/debug-armv.S Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/kernel/debug-armv.S Thu Oct 25 13:53:45 2001
@@ -333,6 +333,37 @@
X bne 1001b
X .endm
X
+#elif defined(CONFIG_ARCH_CAMELOT)
+
+#include <asm/arch/excalibur.h>
+#define UART00_TYPE
+#include <asm/arch/uart00.h>
+
+ .macro addruart,rx
+ mrc p15, 0, \rx, c1, c0
+ tst \rx, #1 @ MMU enabled?
+ ldr \rx, =EXC_UART00_BASE @ physical base address
+ orrne \rx, \rx, #0xff000000 @ virtual base
+ orrne \rx, \rx, #0x00f00000
+ .endm
+
+ .macro senduart,rd,rx
+ str \rd, [\rx, #UART_TD(0)]
+ .endm
+
+ .macro waituart,rd,rx
+1001: ldr \rd, [\rx, #UART_TSR(0)]
+ and \rd, \rd, #UART_TSR_TX_LEVEL_MSK
+ cmp \rd, #15
+ beq 1001b
+ .endm
+
+ .macro busyuart,rd,rx
+1001: ldr \rd, [\rx, #UART_TSR(0)]
+ ands \rd, \rd, #UART_TSR_TX_LEVEL_MSK
+ bne 1001b
+ .endm
+
X #else
X #error Unknown architecture
X #endif
diff -u --recursive --new-file v2.4.13/linux/arch/arm/kernel/entry-armv.S linux/arch/arm/kernel/entry-armv.S
--- v2.4.13/linux/arch/arm/kernel/entry-armv.S Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/kernel/entry-armv.S Thu Oct 25 13:53:45 2001
@@ -16,6 +16,7 @@
X #include <linux/config.h>
X #include "entry-header.S"
X
+
X #ifdef IOC_BASE
X /* IOC / IOMD based hardware */
X #include <asm/hardware/iomd.h>
@@ -494,6 +495,27 @@
X addeq \irqnr, \irqnr, #1
X moveq \stat, \stat, lsr #1
X tst \stat, #1 @ bit 0 should be set
+ .endm
+
+ .macro irq_prio_table
+ .endm
+
+#elif defined (CONFIG_ARCH_CAMELOT)
+#include <asm/arch/platform.h>
+#undef IRQ_MODE /* same name defined in asm/proc/ptrace.h */
+#include <asm/arch/int_ctrl00.h>
+
+ .macro disable_fiq
+ .endm
+
+ .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
+
+ ldr \irqstat, =INT_ID(IO_ADDRESS(EXC_INT_CTRL00_BASE))
+ ldr \irqnr,[\irqstat]
+ cmp \irqnr,#0
+ subne \irqnr,\irqnr,#1
+
+
X .endm
X
X .macro irq_prio_table
diff -u --recursive --new-file v2.4.13/linux/arch/arm/lib/backtrace.S linux/arch/arm/lib/backtrace.S
--- v2.4.13/linux/arch/arm/lib/backtrace.S Thu Apr 12 12:20:31 2001
+++ linux/arch/arm/lib/backtrace.S Thu Oct 25 13:53:45 2001
@@ -44,33 +44,33 @@
X 1: moveq r0, #-2
X LOADREGS(eqfd, sp!, {r4 - r8, pc})
X
-2: stmfd sp!, {pc} @ calculate offset of PC in STMIA instruction
+2: stmfd sp!, {pc} @ calculate offset of PC in STMIA instruction
X ldr r0, [sp], #4
X adr r1, 2b - 4
X sub offset, r0, r1
X
-3: tst frame, mask @ Check for address exceptions...
+3: tst frame, mask @ Check for address exceptions...
X bne 1b
X
- ldmda frame, {r0, r1, r2, r3} @ fp, sp, lr, pc
+1001: ldmda frame, {r0, r1, r2, r3} @ fp, sp, lr, pc
X mov next, r0
X
- sub save, r3, offset @ Correct PC for prefetching
+ sub save, r3, offset @ Correct PC for prefetching
X bic save, save, mask
X adr r0, .Lfe
X mov r1, save
X bic r2, r2, mask
- bl SYMBOL_NAME(printk)
+ bl SYMBOL_NAME(printk) @ print pc and link register
X
X sub r0, frame, #16
- ldr r1, [save, #4]
+1002: ldr r1, [save, #4] @ get instruction at function+4
X mov r3, r1, lsr #10
X ldr r2, .Ldsi+4
X teq r3, r2 @ Check for stmia sp!, {args}
X addeq save, save, #4 @ next instruction
X bleq .Ldumpstm
X
- ldr r1, [save, #4] @ Get 'stmia sp!, {rlist, fp, ip, lr, pc}' instruction
+1003: ldr r1, [save, #4] @ Get 'stmia sp!, {rlist, fp, ip, lr, pc}' instruction
X mov r3, r1, lsr #10
X ldr r2, .Ldsi
X teq r3, r2
@@ -82,6 +82,24 @@
X bne 3b
X LOADREGS(fd, sp!, {r4 - r8, pc})
X
+/*
+ * Fixup for LDMDB
+ */
+ .section .fixup,"ax"
+ .align 0
+1004: ldr r0, =.Lbad
+ mov r1, frame
+ bl SYMBOL_NAME(printk)
+ LOADREGS(fd, sp!, {r4 - r8, pc})
+ .ltorg
+ .previous
+
+ .section __ex_table,"a"
+ .align 3
+ .long 1001b, 1004b
+ .long 1002b, 1004b
+ .long 1003b, 1004b
+ .previous
X
X #define instr r4
X #define reg r5
@@ -115,6 +133,7 @@
X .Lfe: .asciz "Function entered at [<%p>] from [<%p>]\n"
X .Lfp: .asciz " r%d = %08X%c"
X .Lcr: .asciz "\n"
+.Lbad: .asciz "Backtrace aborted due to bad frame pointer <%p>\n"
X .align
X .Ldsi: .word 0x00e92dd8 >> 2
X .word 0x00e92d00 >> 2
diff -u --recursive --new-file v2.4.13/linux/arch/arm/lib/io-acorn.S linux/arch/arm/lib/io-acorn.S
--- v2.4.13/linux/arch/arm/lib/io-acorn.S Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/lib/io-acorn.S Thu Oct 25 13:53:45 2001
@@ -54,39 +54,6 @@
X mov r1, lr
X b SYMBOL_NAME(printk)
X
-/* Purpose: read a block of data from a hardware register to memory.
- * Proto : void insw(int from_port, void *to, int len_in_words);
- * Notes : increment to, 'to' must be 16-bit aligned
- */
-
-ENTRY(insw)
- addr r0
- teq r2, #0
- bne __raw_readsw
- RETINSTR(mov, pc, lr)
-
-ENTRY(insb)
- addr r0
- teq r2, #0
- bne __raw_readsb
- RETINSTR(mov, pc, lr)
-
-@ Purpose: write a block of data from memory to a hardware register.
-@ Proto : outsw(int to_reg, void *from, int len_in_words);
-@ Notes : increments from
-
-ENTRY(outsw)
- addr r0
- teq r2, #0
- bne __raw_writesw
- RETINSTR(mov, pc, lr)
-
-ENTRY(outsb)
- addr r0
- teq r2, #0
- bne __raw_writesb
- RETINSTR(mov, pc, lr)
-
X @ Purpose: write a memc register
X @ Proto : void memc_write(int register, int value);
X @ Returns: nothing
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-epxa10db/Makefile linux/arch/arm/mach-epxa10db/Makefile
--- v2.4.13/linux/arch/arm/mach-epxa10db/Makefile Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/mach-epxa10db/Makefile Thu Oct 25 13:53:45 2001
@@ -0,0 +1,22 @@
+#
+# Makefile for the linux kernel.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+
+USE_STANDARD_AS_RULE := true
+
+O_TARGET := epxa10db.o
+
+# Object file lists.
+
+obj-y := arch.o irq.o mm.o time.o
+obj-m :=
+obj-n :=
+obj- :=
+
+export-objs :=
+
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-epxa10db/arch.c linux/arch/arm/mach-epxa10db/arch.c
--- v2.4.13/linux/arch/arm/mach-epxa10db/arch.c Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/mach-epxa10db/arch.c Thu Oct 25 13:53:45 2001
@@ -0,0 +1,62 @@
+/*
+ * linux/arch/arm/mach-epxa10db/arch.c
+ *
+ * Copyright (C) 2000 Deep Blue Solutions Ltd
+ * Copyright (C) 2001 Altera Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+
+#include <asm/mach/arch.h>
+
+extern void epxa10db_map_io(void);
+extern void epxa10db_init_irq(void);
+
+
+static void __init
+epxa10db_fixup(struct machine_desc *desc, struct param_struct *params,
+ char **cmdline, struct meminfo *mi)
+{
+
+ mi->nr_banks = 1;
+ mi->bank[0].start = 0;
+ mi->bank[0].size = (32*1024*1024);
+ mi->bank[0].node = 0;
+
+/*
+ ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
+ setup_ramdisk( 1, 0, 0, 8192 );
+ setup_initrd(0xc0200000, 6*1024*1024);
+*/
+}
+
+MACHINE_START(CAMELOT, "Altera Epxa10db")
+ MAINTAINER("Altera Corporation")
+ BOOT_MEM(0x00000000, 0x7fffc000, 0xffffc000)
+ FIXUP(epxa10db_fixup)
+ MAPIO(epxa10db_map_io)
+ INITIRQ(epxa10db_init_irq)
+
+MACHINE_END
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-epxa10db/dma.c linux/arch/arm/mach-epxa10db/dma.c
--- v2.4.13/linux/arch/arm/mach-epxa10db/dma.c Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/mach-epxa10db/dma.c Thu Oct 25 13:53:45 2001
@@ -0,0 +1,36 @@
+/*
+ * linux/arch/arm/mach-epxa10db/dma.c
+ *
+ * Copyright (C) 1999 ARM Limited
+ * Copyright (C) 2000 Deep Blue Solutions Ltd
+ *
+ * This 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/sched.h>
+#include <linux/malloc.h>
+#include <linux/mman.h>
+#include <linux/init.h>
+
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/dma.h>
+#include <asm/io.h>
+#include <asm/hardware.h>
+
+#include <asm/mach/dma.h>
+
+void __init arch_dma_init(dma_t *dma)
+{
+}
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-epxa10db/irq.c linux/arch/arm/mach-epxa10db/irq.c
--- v2.4.13/linux/arch/arm/mach-epxa10db/irq.c Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/mach-epxa10db/irq.c Thu Oct 25 13:53:45 2001
@@ -0,0 +1,70 @@
+/*
+ * linux/arch/arm/mach-epxa10db/irq.c
+ *
+ * Copyright (C) 2001 Altera Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <linux/init.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/mach/irq.h>
+#include <asm/arch/platform.h>
+#include <asm/arch/int_ctrl00.h>
+
+
+static void mask_irq(unsigned int irq)
+{
+ __raw_writel(1 << irq, INT_MC(IO_ADDRESS(EXC_INT_CTRL00_BASE)));
+}
+
+static void unmask_irq(unsigned int irq)
+{
+ __raw_writel(1 << irq, INT_MS(IO_ADDRESS(EXC_INT_CTRL00_BASE)));
+}
+
+void __init epxa10db_init_irq(void)
+{
+ unsigned int i;
+
+ /*
+ * This bit sets up the interrupt controller using
+ * the 6 PLD interrupts mode (the default) each
+ * irqs is assigned a priority which is the same
+ * as its interrupt number. This scheme is used because
+ * its easy, but you may want to change it depending
+ * on the contents of your PLD
+ */
+
+ __raw_writel(3,INT_MODE(IO_ADDRESS(EXC_INT_CTRL00_BASE)));
+ for (i = 0; i < NR_IRQS; i++){
+ __raw_writel(i+1, INT_PRIORITY_P0(IO_ADDRESS(EXC_INT_CTRL00_BASE)) + (4*i));
+ }
+
+
+ for (i = 0; i < NR_IRQS; i++) {
+
+ irq_desc[i].valid = 1;
+ irq_desc[i].probe_ok = 1;
+ irq_desc[i].mask_ack = mask_irq;
+ irq_desc[i].mask = mask_irq;
+ irq_desc[i].unmask = unmask_irq;
+ }
+
+ /* Disable all interrupt */
+ __raw_writel(-1,INT_MC(IO_ADDRESS(EXC_INT_CTRL00_BASE)));
+
+}
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-epxa10db/mm.c linux/arch/arm/mach-epxa10db/mm.c
--- v2.4.13/linux/arch/arm/mach-epxa10db/mm.c Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/mach-epxa10db/mm.c Thu Oct 25 13:53:45 2001
@@ -0,0 +1,48 @@
+/*
+ * linux/arch/arm/mach-epxa10db/mm.c
+ *
+ * MM routines for Altera'a Epxa10db board
+ *
+ * Copyright (C) 2001 Altera Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+
+#include <asm/mach/map.h>
+
+/* Page table mapping for I/O region */
+
+static struct map_desc epxa10db_io_desc[] __initdata = {
+ { IO_ADDRESS(EXC_REGISTERS_BASE), EXC_REGISTERS_BASE, SZ_16K , DOMAIN_IO, 0, 1},
+{IO_ADDRESS(EXC_PLD_BLOCK0_BASE), EXC_PLD_BLOCK0_BASE, SZ_16K , DOMAIN_IO, 0, 1},
+{IO_ADDRESS(EXC_PLD_BLOCK1_BASE), EXC_PLD_BLOCK1_BASE, SZ_16K , DOMAIN_IO, 0, 1},
+{IO_ADDRESS(EXC_PLD_BLOCK2_BASE), EXC_PLD_BLOCK2_BASE, SZ_16K , DOMAIN_IO, 0, 1},
+{IO_ADDRESS(EXC_PLD_BLOCK3_BASE), EXC_PLD_BLOCK3_BASE, SZ_16K , DOMAIN_IO, 0, 1},
+{ FLASH_VADDR(EXC_EBI_BLOCK0_BASE), EXC_EBI_BLOCK0_BASE, SZ_16M , DOMAIN_IO, 0, 1},
+ LAST_DESC
+};
+
+void __init epxa10db_map_io(void)
+{
+ iotable_init(epxa10db_io_desc);
+}
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-epxa10db/time.c linux/arch/arm/mach-epxa10db/time.c
--- v2.4.13/linux/arch/arm/mach-epxa10db/time.c Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/mach-epxa10db/time.c Thu Oct 25 13:53:45 2001
@@ -0,0 +1,33 @@
+/*
+ * linux/arch/arm/mach-epxa10db/time.c
+ *
+ * Copyright (C) 2000 Deep Blue Solutions
+ * Copyright (C) 2001 Altera Corporation
+ *
+ * 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/kernel.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+
+#include <asm/hardware.h>
+
+
+
+extern int (*set_rtc)(void);
+
+static int epxa10db_set_rtc(void)
+{


+ return 1;
+}
+

+static int epxa10db_rtc_init(void)
+{
+ set_rtc = epxa10db_set_rtc;
+


+ return 0;
+}
+

+__initcall(epxa10db_rtc_init);
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/Makefile linux/arch/arm/mach-sa1100/Makefile
--- v2.4.13/linux/arch/arm/mach-sa1100/Makefile Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/mach-sa1100/Makefile Thu Oct 25 13:53:45 2001
@@ -14,9 +14,12 @@
X obj-n :=
X obj- :=
X
-export-objs := assabet.o h3600.o freebird.o huw_webpanel.o yopy.o \
- generic.o hwtimer.o irq.o usb_ctl.o usb_recv.o usb_send.o \
- dma-sa1100.o dma-sa1111.o pcipool.o sa1111-pcibuf.o
+export-objs := assabet.o dma-sa1100.o dma-sa1111.o freebird.o generic.o \
+ h3600.o huw_webpanel.o irq.o pcipool.o sa1111-pcibuf.o \
+ yopy.o
+
+# These aren't present yet, and prevents a plain -ac kernel building.
+# hwtimer.o usb_ctl.o usb_recv.o usb_send.o
X
X # Common support (must be linked before board specific support)
X obj-y += generic.o irq.o dma-sa1100.o
@@ -27,6 +30,7 @@
X # We link the CPU support next, so that RAM timings can be tuned.
X ifeq ($(CONFIG_CPU_FREQ),y)
X obj-$(CONFIG_SA1100_ASSABET) += cpu-sa1110.o
+obj-$(CONFIG_SA1100_CERF) += cpu-sa1110.o
X obj-$(CONFIG_SA1100_LART) += cpu-sa1100.o
X endif
X
@@ -63,14 +67,19 @@
X
X # LEDs support
X leds-y := leds.o
+leds-$(CONFIG_SA1100_ADSBITSY) += leds-adsbitsy.o
X leds-$(CONFIG_SA1100_ASSABET) += leds-assabet.o
X leds-$(CONFIG_SA1100_BRUTUS) += leds-brutus.o
X leds-$(CONFIG_SA1100_CERF) += leds-cerf.o
X leds-$(CONFIG_SA1100_FLEXANET) += leds-flexanet.o
X leds-$(CONFIG_SA1100_GRAPHICSCLIENT) += leds-graphicsclient.o
+leds-$(CONFIG_SA1100_GRAPHICSMASTER) += leds-graphicsmaster.o
X leds-$(CONFIG_SA1100_LART) += leds-lart.o
X leds-$(CONFIG_SA1100_PFS168) += leds-pfs168.o
-leds-$(CONFIG_SA1100_GRAPHICSMASTER) += leds-graphicsmaster.o
+leds-$(CONFIG_SA1100_SIMPAD) += leds-simpad.o
X obj-$(CONFIG_LEDS) += $(leds-y)
+
+# Miscelaneous functions
+obj-$(CONFIG_PM) += pm.o sleep.o
X
X include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/assabet.c linux/arch/arm/mach-sa1100/assabet.c
--- v2.4.13/linux/arch/arm/mach-sa1100/assabet.c Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/mach-sa1100/assabet.c Thu Oct 25 13:53:45 2001
@@ -17,6 +17,7 @@
X #include <linux/tty.h>
X #include <linux/module.h>
X #include <linux/errno.h>
+#include <linux/serial_core.h>
X
X #include <asm/hardware.h>
X #include <asm/setup.h>
@@ -26,13 +27,13 @@
X #include <asm/mach/arch.h>
X #include <asm/mach/map.h>
X #include <asm/mach/serial_sa1100.h>
-#include <linux/serial_core.h>
+#include <asm/arch/assabet.h>
X
X #include "generic.h"
X
X
-unsigned long BCR_value = BCR_DB1110;
-unsigned long SCR_value = SCR_INIT;
+unsigned long BCR_value = ASSABET_BCR_DB1110;
+unsigned long SCR_value = ASSABET_SCR_INIT;
X EXPORT_SYMBOL(BCR_value);
X EXPORT_SYMBOL(SCR_value);
X
@@ -46,7 +47,7 @@
X * This must precede any driver calls to BCR_set()
X * or BCR_clear().
X */
- BCR = BCR_value = BCR_DB1111;
+ ASSABET_BCR = BCR_value = ASSABET_BCR_DB1111;
X NCR_0 = 0;
X
X #ifndef CONFIG_ASSABET_NEPONSET
@@ -68,7 +69,7 @@
X */
X static void __init map_sa1100_gpio_regs( void )
X {
- unsigned long phys = _GPLR & PMD_MASK;
+ unsigned long phys = __PREG(GPLR) & PMD_MASK;
X unsigned long virt = io_p2v(phys);
X int prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO);
X pmd_t pmd;
@@ -185,17 +186,17 @@
X {
X if (port->mapbase == _Ser1UTCR0) {
X if (state)
- BCR_clear(BCR_RS232EN);
+ ASSABET_BCR_clear(ASSABET_BCR_RS232EN);
X else
- BCR_set(BCR_RS232EN);
+ ASSABET_BCR_set(ASSABET_BCR_RS232EN);


X }
X }
X
X /*

X * Note! this can be called from IRQ context.
- * FIXME: You _need_ to handle BCR carefully, which doesn't
+ * FIXME: You _need_ to handle ASSABET_BCR carefully, which doesn't
X * happen at the moment. Suggest putting interrupt save/restore
- * in BCR_set/clear.
+ * in ASSABET_BCR_set/clear.
X *
X * NB: Assabet uses COM_RTS and COM_DTR for both UART1 (com port)
X * and UART3 (radio module). We only handle them for UART1 here.
@@ -206,43 +207,43 @@
X u_int set = 0, clear = 0;
X
X if (mctrl & TIOCM_RTS)
- set |= BCR_COM_RTS;
+ set |= ASSABET_BCR_COM_RTS;
X else
- clear |= BCR_COM_RTS;
+ clear |= ASSABET_BCR_COM_RTS;
X
X if (mctrl & TIOCM_DTR)
- set |= BCR_COM_DTR;
+ set |= ASSABET_BCR_COM_DTR;
X else
- clear |= BCR_COM_DTR;
+ clear |= ASSABET_BCR_COM_DTR;
X
- BCR_clear(clear);
- BCR_set(set);
+ ASSABET_BCR_clear(clear);
+ ASSABET_BCR_set(set);
X }
X }
X
X static int assabet_get_mctrl(struct uart_port *port)
X {
X u_int ret = 0;
- u_int bsr = BSR;
+ u_int bsr = ASSABET_BSR;
X
X /* need 2 reads to read current value */
- bsr = BSR;
+ bsr = ASSABET_BSR;
X
X if (port->mapbase == _Ser1UTCR0) {
- if (bsr & BSR_COM_DCD)
+ if (bsr & ASSABET_BSR_COM_DCD)
X ret |= TIOCM_CD;
- if (bsr & BSR_COM_CTS)
+ if (bsr & ASSABET_BSR_COM_CTS)
X ret |= TIOCM_CTS;
- if (bsr & BSR_COM_DSR)
+ if (bsr & ASSABET_BSR_COM_DSR)
X ret |= TIOCM_DSR;
X } else if (port->mapbase == _Ser3UTCR0) {
- if (bsr & BSR_RAD_DCD)
+ if (bsr & ASSABET_BSR_RAD_DCD)
X ret |= TIOCM_CD;
- if (bsr & BSR_RAD_CTS)
+ if (bsr & ASSABET_BSR_RAD_CTS)
X ret |= TIOCM_CTS;
- if (bsr & BSR_RAD_DSR)
+ if (bsr & ASSABET_BSR_RAD_DSR)
X ret |= TIOCM_DSR;
- if (bsr & BSR_RAD_RI)
+ if (bsr & ASSABET_BSR_RAD_RI)
X ret |= TIOCM_RI;
X } else {
X ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
@@ -304,6 +305,18 @@
X */
X GPDR |= GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM;
X GPCR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM;
+
+ /*
+ * Set up registers for sleep mode.
+ */
+ PWER = PWER_GPIO0;
+ PGSR = 0;
+ PCFR = 0;
+
+ /*
+ * Clear all possible wakeup reasons.
+ */
+ RCSR = RCSR_HWR | RCSR_SWR | RCSR_WDR | RCSR_SMR;
X }
X
X
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/cerf.c linux/arch/arm/mach-sa1100/cerf.c
--- v2.4.13/linux/arch/arm/mach-sa1100/cerf.c Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/mach-sa1100/cerf.c Thu Oct 25 13:53:46 2001
@@ -16,31 +16,60 @@
X #include "generic.h"
X
X
+static void __init cerf_init_irq (void)
+{
+ sa1100_init_irq();
+
+ /* Need to register these as rising edge interrupts
+ * For standard 16550 serial driver support
+ * Basically - I copied it from pfs168.c :)
+ */
+#ifdef CONFIG_SA1100_CERF_CPLD
+ set_GPIO_IRQ_edge(GPIO_GPIO(3), GPIO_RISING_EDGE); /* PDA Full serial port */
+ set_GPIO_IRQ_edge(GPIO_GPIO(2), GPIO_RISING_EDGE); /* PDA Bluetooth */
+ GPDR &= ~(GPIO_GPIO(3)); /* Set the direction of serial port GPIO pin to in */
+ GPDR &= ~(GPIO_GPIO(2)); /* Set the direction of bluetooth GPIO pin to in */
+#endif /* CONFIG_SA1100_CERF_CPLD */
+}
+
X static void __init
X fixup_cerf(struct machine_desc *desc, struct param_struct *params,
X char **cmdline, struct meminfo *mi)
X {
-#ifdef CONFIG_SA1100_CERF_32MB
- // 32MB RAM
+#if defined(CONFIG_SA1100_CERF_64MB)
+ // 64MB RAM
+ SET_BANK( 0, 0xc0000000, 64*1024*1024 );
+ mi->nr_banks = 1;
+#elif defined(CONFIG_SA1100_CERF_32MB) // 32MB RAM
X SET_BANK( 0, 0xc0000000, 32*1024*1024 );
X mi->nr_banks = 1;
-#else
- // 16Meg Ram.
+#elif defined(CONFIG_SA1100_CERF_16MB) // 16Meg Ram.
X SET_BANK( 0, 0xc0000000, 8*1024*1024 );
- SET_BANK( 1, 0xc8000000, 8*1024*1024 ); // comment this out for 8MB Cerfs
+ SET_BANK( 1, 0xc8000000, 8*1024*1024 );
X mi->nr_banks = 2;
+#elif defined(CONFIG_SA1100_CERF_8MB)
+ // 8Meg Ram.
+ SET_BANK( 0, 0xc0000000, 8*1024*1024 );
+ mi->nr_banks = 1;
+#else
+ #error "Undefined memory size for Cerfboard."
X #endif
X
- ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
- setup_ramdisk(1, 0, 0, 8192);
- // Save 2Meg for RAMDisk
- setup_initrd(0xc0500000, 3*1024*1024);
+// ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
+// setup_ramdisk(1, 0, 0, 8192);
+// // Save 2Meg for RAMDisk
+// setup_initrd(0xc0500000, 3*1024*1024);
X }
X
X static struct map_desc cerf_io_desc[] __initdata = {
- /* virtual physical length domain r w c b */
- { 0xe8000000, 0x00000000, 0x01000000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash bank 0 */
- { 0xf0000000, 0x08000000, 0x00100000, DOMAIN_IO, 1, 1, 0, 0 }, /* Crystal Chip */
+ /* virtual physical length domain r w c b */
+ { 0xe8000000, 0x00000000, 0x02000000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash bank 0 */
+ { 0xf0000000, 0x08000000, 0x00100000, DOMAIN_IO, 1, 1, 0, 0 }, /* Crystal Ethernet Chip */
+#ifdef CONFIG_SA1100_CERF_CPLD
+ { 0xf1000000, 0x40000000, 0x00100000, DOMAIN_IO, 1, 1, 0, 0 }, /* CPLD Chip */
+ { 0xf2000000, 0x10000000, 0x00100000, DOMAIN_IO, 1, 1, 0, 0 }, /* CerfPDA Bluetooth */
+ { 0xf3000000, 0x18000000, 0x00100000, DOMAIN_IO, 1, 1, 0, 0 }, /* CerfPDA Serial */
+#endif
X LAST_DESC
X };
X
@@ -49,14 +78,19 @@
X sa1100_map_io();
X iotable_init(cerf_io_desc);
X
- sa1100_register_uart(0, 3);
+ sa1100_register_uart(0, 3);
+#ifdef CONFIG_SA1100_CERF_IRDA_ENABLED
X sa1100_register_uart(1, 1);
+#else
+ sa1100_register_uart(1, 2);
+ sa1100_register_uart(2, 1);
+#endif
X }
X
-MACHINE_START(CERF, "Intrinsyc CerfBoard")
- MAINTAINER("Pieter Truter")
+MACHINE_START(CERF, "Intrinsyc's Cerf Family of Products")
+ MAINTAINER("sup...@intrinsyc.com")
X BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
X FIXUP(fixup_cerf)
X MAPIO(cerf_map_io)
- INITIRQ(sa1100_init_irq)
+ INITIRQ(cerf_init_irq)
X MACHINE_END
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/dma-sa1100.c linux/arch/arm/mach-sa1100/dma-sa1100.c
--- v2.4.13/linux/arch/arm/mach-sa1100/dma-sa1100.c Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/mach-sa1100/dma-sa1100.c Thu Oct 25 13:53:46 2001
@@ -611,7 +611,7 @@
X int channel;
X for (channel = 0; channel < SA1100_DMA_CHANNELS; channel++) {
X dma_chan[channel].regs =
- (dma_regs_t *) io_p2v(_DDAR(channel));
+ (dma_regs_t *) &DDAR(channel);
X dma_chan[channel].irq = IRQ_DMA0 + channel;
X }
X return 0;
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/dma-sa1111.c linux/arch/arm/mach-sa1100/dma-sa1111.c
--- v2.4.13/linux/arch/arm/mach-sa1100/dma-sa1111.c Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/mach-sa1100/dma-sa1111.c Thu Oct 25 13:53:46 2001
@@ -23,7 +23,6 @@
X #include <asm/io.h>
X #include <asm/dma.h>
X
-
X // #define DEBUG
X #ifdef DEBUG
X #define DPRINTK( s, arg... ) printk( "dma<%s>: " s, dma->device_id , ##arg )
@@ -305,7 +304,7 @@
X * SDRAM bank 1 on Neponset). The default configuration selects
X * Assabet, so any address in bank 1 is necessarily invalid.
X */
- if((machine_is_assabet() || machine_is_pfs168()) && addr >= _DRAMBnk1)
+ if((machine_is_assabet() || machine_is_pfs168()) && addr >= 0xc8000000)
X return -1;
X
X /* The bug only applies to buffers located more than one megabyte
@@ -340,7 +339,7 @@
X return -1;
X break;
X default:
- printk(KERN_ERR "%s(): invalid SMCR DRAC value 0%o\n",
+ printk(KERN_ERR "%s(): invalid SMCR DRAC value 0%lo\n",
X __FUNCTION__, FExtr(SBI_SMCR, SMCR_DRAC));
X return -1;
X }
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/freebird.c linux/arch/arm/mach-sa1100/freebird.c
--- v2.4.13/linux/arch/arm/mach-sa1100/freebird.c Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/mach-sa1100/freebird.c Thu Oct 25 13:53:46 2001
@@ -50,6 +50,11 @@
X
X sa1100_register_uart(0, 3);
X sa1100_register_uart(1, 1);
+
+ /* Set up sleep mode registers */
+ PWER = 0x1;
+ PGSR = 0x0;
+ PCFR = PCFR_OPDE | PCFR_FP | PCFR_FS;
X }
X
X MACHINE_START(FREEBIRD, "Freebird-HPC-1.1")
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/graphicsclient.c linux/arch/arm/mach-sa1100/graphicsclient.c
--- v2.4.13/linux/arch/arm/mach-sa1100/graphicsclient.c Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/mach-sa1100/graphicsclient.c Thu Oct 25 13:53:46 2001
@@ -23,6 +23,7 @@
X #include <asm/mach/arch.h>
X #include <asm/mach/map.h>
X #include <asm/mach/serial_sa1100.h>
+#include <linux/serial_core.h>
X
X #include <asm/arch/irq.h>
X
@@ -143,11 +144,185 @@
X LAST_DESC
X };
X
+static struct gc_uart_ctrl_data_t gc_uart_ctrl_data[] = {
+ { GPIO_GC_UART0_CTS, 0, NULL,NULL },
+ { GPIO_GC_UART1_CTS, 0, NULL,NULL },
+ { GPIO_GC_UART2_CTS, 0, NULL,NULL }
+};
+
+static void
+graphicsclient_cts_intr(int irq, void *dev_id, struct pt_regs *regs)
+{
+ struct gc_uart_ctrl_data_t * uart_data = (struct gc_uart_ctrl_data_t *)dev_id;
+ int cts = !(GPLR & uart_data->cts_gpio);
+
+ /* NOTE: I supose that we will no get any interrupt
+ if the GPIO is not changed, so maybe
+ the cts_prev_state can be removed ... */
+ if (cts != uart_data->cts_prev_state) {
+ uart_data->cts_prev_state = cts;
+
+ uart_handle_cts_change(uart_data->info, cts);
+ }
+}
+
+static int
+graphicsclient_register_cts_intr(int gpio, int irq,
+ struct gc_uart_ctrl_data_t *uart_data)
+{
+ int ret = 0;
+
+ set_GPIO_IRQ_edge(gpio, GPIO_BOTH_EDGES);
+
+ ret = request_irq(irq, graphicsclient_cts_intr,
+ 0, "GC RS232 CTS", uart_data);
+ if (ret) {
+ printk(KERN_ERR "uart_open: failed to register CTS irq (%d)\n",
+ ret);
+ free_irq(irq, uart_data);
+ }
+
+ return ret;
+}
+
+static int
+graphicsclient_uart_open(struct uart_port *port, struct uart_info *info)
+{
+ int ret = 0;
+
+ if (port->mapbase == _Ser1UTCR0) {
+ Ser1SDCR0 |= SDCR0_UART;
+ /* Set RTS Output */
+ GPDR |= GPIO_GC_UART0_RTS;
+ GPSR = GPIO_GC_UART0_RTS;
+
+ /* Set CTS Input */
+ GPDR &= ~GPIO_GC_UART0_CTS;
+
+ gc_uart_ctrl_data[0].cts_prev_state = 0;
+ gc_uart_ctrl_data[0].info = info;
+ gc_uart_ctrl_data[0].port = port;
+
+ /* register uart0 CTS irq */
+ ret = graphicsclient_register_cts_intr(GPIO_GC_UART0_CTS,
+ IRQ_GC_UART0_CTS,
+ &gc_uart_ctrl_data[0]);
+ } else if (port->mapbase == _Ser2UTCR0) {
+ Ser2UTCR4 = Ser2HSCR0 = 0;
+ /* Set RTS Output */
+ GPDR |= GPIO_GC_UART1_RTS;
+ GPSR = GPIO_GC_UART1_RTS;
+
+ /* Set CTS Input */
+ GPDR &= ~GPIO_GC_UART1_RTS;
+
+ gc_uart_ctrl_data[1].cts_prev_state = 0;
+ gc_uart_ctrl_data[1].info = info;
+ gc_uart_ctrl_data[1].port = port;
+
+ /* register uart1 CTS irq */
+ ret = graphicsclient_register_cts_intr(GPIO_GC_UART1_CTS,
+ IRQ_GC_UART1_CTS,
+ &gc_uart_ctrl_data[1]);
+ } else if (port->mapbase == _Ser3UTCR0) {
+ /* Set RTS Output */
+ GPDR |= GPIO_GC_UART2_RTS;
+ GPSR = GPIO_GC_UART2_RTS;
+
+ /* Set CTS Input */
+ GPDR &= ~GPIO_GC_UART2_RTS;
+
+ gc_uart_ctrl_data[2].cts_prev_state = 0;
+ gc_uart_ctrl_data[2].info = info;
+ gc_uart_ctrl_data[2].port = port;
+
+ /* register uart2 CTS irq */
+ ret = graphicsclient_register_cts_intr(GPIO_GC_UART2_CTS,
+ IRQ_GC_UART2_CTS,
+ &gc_uart_ctrl_data[2]);
+ }
+ return ret;
+}
+
+static int
+graphicsclient_uart_close(struct uart_port *port, struct uart_info *info)
+{
+ if (port->mapbase == _Ser1UTCR0) {
+ free_irq(IRQ_GC_UART0_CTS, &gc_uart_ctrl_data[0]);
+ } else if (port->mapbase == _Ser2UTCR0) {
+ free_irq(IRQ_GC_UART1_CTS, &gc_uart_ctrl_data[1]);
+ } else if (port->mapbase == _Ser3UTCR0) {
+ free_irq(IRQ_GC_UART2_CTS, &gc_uart_ctrl_data[2]);
+ }
+


+ return 0;
+}
+

+static int graphicsclient_get_mctrl(struct uart_port *port)
+{
+ int result = TIOCM_CD | TIOCM_DSR;
+
+ if (port->mapbase == _Ser1UTCR0) {
+ if (!(GPLR & GPIO_GC_UART0_CTS))
+ result |= TIOCM_CTS;
+ } else if (port->mapbase == _Ser2UTCR0) {
+ if (!(GPLR & GPIO_GC_UART1_CTS))
+ result |= TIOCM_CTS;
+ } else if (port->mapbase == _Ser3UTCR0) {
+ if (!(GPLR & GPIO_GC_UART2_CTS))
+ result |= TIOCM_CTS;
+ } else {
+ result = TIOCM_CTS;
+ }
+
+ return result;
+}
+
+static void graphicsclient_set_mctrl(struct uart_port *port, u_int mctrl)
+{
+ if (port->mapbase == _Ser1UTCR0) {
+ if (mctrl & TIOCM_RTS)
+ GPCR = GPIO_GC_UART0_RTS;
+ else
+ GPSR = GPIO_GC_UART0_RTS;
+ } else if (port->mapbase == _Ser2UTCR0) {
+ if (mctrl & TIOCM_RTS)
+ GPCR = GPIO_GC_UART1_RTS;
+ else
+ GPSR = GPIO_GC_UART1_RTS;
+ } else if (port->mapbase == _Ser3UTCR0) {
+ if (mctrl & TIOCM_RTS)
+ GPCR = GPIO_GC_UART2_RTS;
+ else
+ GPSR = GPIO_GC_UART2_RTS;
+ }
+}
+
+static void
+graphicsclient_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
+{
+ if (!state) {
+ /* make serial ports work ... */
+ Ser2UTCR4 = 0;
+ Ser2HSCR0 = 0;
+ Ser1SDCR0 |= SDCR0_UART;
+ }
+}
+
+static struct sa1100_port_fns graphicsclient_port_fns __initdata = {
+ open: graphicsclient_uart_open,
+ close: graphicsclient_uart_close,
+ get_mctrl: graphicsclient_get_mctrl,
+ set_mctrl: graphicsclient_set_mctrl,
+ pm: graphicsclient_uart_pm,
+};
+
X static void __init graphicsclient_map_io(void)
X {
X sa1100_map_io();
X iotable_init(graphicsclient_io_desc);
X
+ sa1100_register_uart_fns(&graphicsclient_port_fns);
X sa1100_register_uart(0, 3);
X sa1100_register_uart(1, 1);
X sa1100_register_uart(2, 2);
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/graphicsmaster.c linux/arch/arm/mach-sa1100/graphicsmaster.c
--- v2.4.13/linux/arch/arm/mach-sa1100/graphicsmaster.c Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/mach-sa1100/graphicsmaster.c Thu Oct 25 13:53:46 2001
@@ -207,11 +207,100 @@
X LAST_DESC
X };
X
+static int graphicsmaster_uart_open(struct uart_port *port, struct uart_info *info)
+{
+ int ret = 0;
+
+ if (port->mapbase == _Ser1UTCR0) {
+ Ser1SDCR0 |= SDCR0_UART;
+ /* Set RTS Output */
+ GPSR = GPIO_GPIO15;
+ GPDR |= GPIO_GPIO15;
+ /* Set CTS Input */
+ GPDR &= ~GPIO_GPIO14;
+ }
+ else if (port->mapbase == _Ser2UTCR0) {
+ Ser2UTCR4 = Ser2HSCR0 = 0;
+ /* Set RTS Output */
+ GPSR = GPIO_GPIO17;
+ GPDR |= GPIO_GPIO17;
+ /* Set CTS Input */
+ GPDR &= ~GPIO_GPIO16;
+ }
+ else if (port->mapbase == _Ser3UTCR0) {
+ /* Set RTS Output */
+ GPSR = GPIO_GPIO19;
+ GPDR |= GPIO_GPIO19;
+ /* Set CTS Input */
+ GPDR &= ~GPIO_GPIO18;
+ }
+ return ret;
+}
+
+static int graphicsmaster_get_mctrl(struct uart_port *port)
+{
+ int result = TIOCM_CD | TIOCM_DSR;
+
+ if (port->mapbase == _Ser1UTCR0) {
+ if (!(GPLR & GPIO_GPIO14))
+ result |= TIOCM_CTS;
+ } else if (port->mapbase == _Ser2UTCR0) {
+ if (!(GPLR & GPIO_GPIO16))
+ result |= TIOCM_CTS;
+ } else if (port->mapbase == _Ser3UTCR0) {
+ if (!(GPLR & GPIO_GPIO17))
+ result |= TIOCM_CTS;
+ } else {
+ result = TIOCM_CTS;
+ }
+
+ return result;
+}
+
+static void graphicsmaster_set_mctrl(struct uart_port *port, u_int mctrl)
+{
+ if (port->mapbase == _Ser1UTCR0) {
+ if (mctrl & TIOCM_RTS)
+ GPCR = GPIO_GPIO15;
+ else
+ GPSR = GPIO_GPIO15;
+ } else if (port->mapbase == _Ser2UTCR0) {
+ if (mctrl & TIOCM_RTS)
+ GPCR = GPIO_GPIO17;
+ else
+ GPSR = GPIO_GPIO17;
+ } else if (port->mapbase == _Ser3UTCR0) {
+ if (mctrl & TIOCM_RTS)
+ GPCR = GPIO_GPIO19;
+ else
+ GPSR = GPIO_GPIO19;
+ }
+}
+
+static void
+graphicsmaster_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
+{
+ if (!state) {
+ /* make serial ports work ... */
+ Ser2UTCR4 = 0;
+ Ser2HSCR0 = 0;
+ Ser1SDCR0 |= SDCR0_UART;
+ }
+}
+
+static struct sa1100_port_fns graphicsmaster_port_fns __initdata = {
+ open: graphicsmaster_uart_open,
+ get_mctrl: graphicsmaster_get_mctrl,
+ set_mctrl: graphicsmaster_set_mctrl,
+ pm: graphicsmaster_uart_pm,
+};
+
X static void __init graphicsmaster_map_io(void)
X {
X sa1100_map_io();
X iotable_init(graphicsmaster_io_desc);
X
+ sa1100_register_uart_fns(&graphicsmaster_port_fns);
X sa1100_register_uart(0, 3);
X sa1100_register_uart(1, 1);
X sa1100_register_uart(2, 2);
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/h3600.c linux/arch/arm/mach-sa1100/h3600.c
--- v2.4.13/linux/arch/arm/mach-sa1100/h3600.c Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/mach-sa1100/h3600.c Thu Oct 25 13:53:46 2001
@@ -27,14 +27,62 @@
X
X static int h3600_egpio = EGPIO_H3600_RS232_ON;
X
+void init_h3600_egpio(void)
+{
+#ifdef CONFIG_IPAQ_H3100
+ int h3100_controls = (GPIO_H3100_BT_ON
+ | GPIO_H3100_QMUTE
+ | GPIO_H3100_LCD_3V_ON
+ | GPIO_H3100_AUD_ON
+ | GPIO_H3100_AUD_PWR_ON
+ | GPIO_H3100_IR_ON
+ | GPIO_H3100_IR_FSEL);
+ GPDR |= h3100_controls;
+ GPCR = h3100_controls;
+ GAFR = GPIO_SSP_CLK;
+#endif
+}
+
X void clr_h3600_egpio(unsigned long x)
X {
+#ifdef CONFIG_IPAQ_H3100
+ unsigned long gpcr = 0;
+ if (x&EGPIO_H3600_QMUTE)
+ gpcr |= GPIO_H3100_QMUTE;
+ if (x&EGPIO_H3600_LCD_ON)
+ gpcr |= GPIO_H3100_LCD_3V_ON;
+ if (x&EGPIO_H3600_AUD_AMP_ON)
+ gpcr |= GPIO_H3100_AUD_ON;
+ if (x&EGPIO_H3600_AUD_PWR_ON)
+ gpcr |= GPIO_H3100_AUD_PWR_ON;
+ if (x&EGPIO_H3600_IR_ON)
+ gpcr |= GPIO_H3100_IR_ON;
+ if (x&EGPIO_H3600_IR_FSEL)
+ gpcr |= GPIO_H3100_IR_FSEL;
+ GPCR = gpcr;
+#endif
X h3600_egpio &= ~x;
X H3600_EGPIO = h3600_egpio;
X }
X
X void set_h3600_egpio(unsigned long x)
X {
+#ifdef CONFIG_IPAQ_H3100
+ unsigned long gpsr = 0;
+ if (x&EGPIO_H3600_QMUTE)
+ gpsr |= GPIO_H3100_QMUTE;
+ if (x&EGPIO_H3600_LCD_ON)
+ gpsr |= GPIO_H3100_LCD_3V_ON;
+ if (x&EGPIO_H3600_AUD_AMP_ON)
+ gpsr |= GPIO_H3100_AUD_ON;
+ if (x&EGPIO_H3600_AUD_PWR_ON)
+ gpsr |= GPIO_H3100_AUD_PWR_ON;
+ if (x&EGPIO_H3600_IR_ON)
+ gpsr |= GPIO_H3100_IR_ON;
+ if (x&EGPIO_H3600_IR_FSEL)
+ gpsr |= GPIO_H3100_IR_FSEL;
+ GPSR = gpsr;
+#endif
X h3600_egpio |= x;
X H3600_EGPIO = h3600_egpio;
X }
@@ -153,8 +201,8 @@
X /* virtual physical length domain r w c b */
X { 0xe8000000, 0x00000000, 0x02000000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash bank 0 */
X { 0xf0000000, 0x49000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* EGPIO 0 */
- { 0xf1000000, 0x10000000, 0x02000000, DOMAIN_IO, 1, 1, 0, 0 }, /* static memory bank 2 */
- { 0xf3000000, 0x40000000, 0x02000000, DOMAIN_IO, 1, 1, 0, 0 }, /* static memory bank 4 */
+ { 0xf1000000, 0x10000000, 0x02800000, DOMAIN_IO, 1, 1, 0, 0 }, /* static memory bank 2 */
+ { 0xf3800000, 0x40000000, 0x00800000, DOMAIN_IO, 1, 1, 0, 0 }, /* static memory bank 4 */
X LAST_DESC
X };
X
@@ -166,7 +214,7 @@
X sa1100_register_uart_fns(&h3600_port_fns);
X sa1100_register_uart(0, 3);
X sa1100_register_uart(1, 1); /* isn't this one driven elsewhere? */
- sa1100_register_uart(2, 2);
+ init_h3600_egpio();
X
X /*
X * Default GPIO settings.
@@ -179,6 +227,11 @@
X */
X PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
X PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+
+ /* Configure suspend conditions */
+ PGSR = 0;
+ PWER = 0x1 | (1 << 31);
+ PCFR = PCFR_OPDE | PCFR_FP | PCFR_FS;
X }
X
X MACHINE_START(H3600, "Compaq iPAQ")
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/leds-adsbitsy.c linux/arch/arm/mach-sa1100/leds-adsbitsy.c
--- v2.4.13/linux/arch/arm/mach-sa1100/leds-adsbitsy.c Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/mach-sa1100/leds-adsbitsy.c Thu Oct 25 13:53:46 2001
@@ -0,0 +1,96 @@
+/*
+ * linux/arch/arm/mach-sa1100/leds-adsbitsy.c
+ *
+ * ADS Bitsy LED
+ * 7/25/01 Woojung Huh
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+
+#include <asm/hardware.h>
+#include <asm/leds.h>
+#include <asm/system.h>
+
+#include "leds.h"
+
+
+#define LED_STATE_ENABLED 1
+#define LED_STATE_CLAIMED 2
+
+static unsigned int led_state;
+static unsigned int hw_led_state;
+
+#define LED_TIMER GPIO_GPIO20 /* green heartbeat */
+
+#define LED_MASK (LED_TIMER)
+
+void adsbitsy_leds_event(led_event_t evt)
+{
+ unsigned long flags;
+
+ save_flags_cli(flags);
+
+ switch (evt) {
+ case led_start:
+ hw_led_state = 0; /* gc leds are positive logic */
+ led_state = LED_STATE_ENABLED;
+ break;
+
+ case led_stop:
+ led_state &= ~LED_STATE_ENABLED;
+ break;
+
+ case led_claim:
+ led_state |= LED_STATE_CLAIMED;
+ hw_led_state = LED_MASK;
+ break;
+
+ case led_release:
+ led_state &= ~LED_STATE_CLAIMED;
+ hw_led_state = LED_MASK;
+ break;
+
+#ifdef CONFIG_LEDS_TIMER
+ case led_timer:
+ if (!(led_state & LED_STATE_CLAIMED))
+ hw_led_state ^= LED_TIMER;
+ break;
+#endif
+
+#ifdef CONFIG_LEDS_CPU
+ case led_idle_start:
+ break;
+
+ case led_idle_end:
+ break;
+#endif
+
+ case led_green_on:
+ break;
+
+ case led_green_off:
+ break;
+
+ case led_amber_on:
+ break;
+
+ case led_amber_off:
+ break;
+
+ case led_red_on:
+ break;
+
+ case led_red_off:


+ break;
+
+ default:

+ break;
+ }
+
+ if (led_state & LED_STATE_ENABLED) {
+ GPSR = hw_led_state;
+ GPCR = hw_led_state ^ LED_MASK;
+ }
+
+ restore_flags(flags);
+}
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/leds-assabet.c linux/arch/arm/mach-sa1100/leds-assabet.c
--- v2.4.13/linux/arch/arm/mach-sa1100/leds-assabet.c Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/mach-sa1100/leds-assabet.c Thu Oct 25 13:53:46 2001
@@ -15,6 +15,7 @@
X #include <asm/hardware.h>
X #include <asm/leds.h>
X #include <asm/system.h>
+#include <asm/arch/assabet.h>
X
X #include "leds.h"
X
@@ -25,7 +26,7 @@
X static unsigned int led_state;
X static unsigned int hw_led_state;
X
-#define BCR_LED_MASK (BCR_LED_GREEN | BCR_LED_RED)
+#define ASSABET_BCR_LED_MASK (ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED)
X
X void assabet_leds_event(led_event_t evt)
X {
@@ -35,7 +36,7 @@
X
X switch (evt) {
X case led_start:
- hw_led_state = BCR_LED_RED | BCR_LED_GREEN;
+ hw_led_state = ASSABET_BCR_LED_RED | ASSABET_BCR_LED_GREEN;
X led_state = LED_STATE_ENABLED;
X break;
X
@@ -45,30 +46,30 @@
X
X case led_claim:
X led_state |= LED_STATE_CLAIMED;
- hw_led_state = BCR_LED_RED | BCR_LED_GREEN;
+ hw_led_state = ASSABET_BCR_LED_RED | ASSABET_BCR_LED_GREEN;
X break;
X
X case led_release:
X led_state &= ~LED_STATE_CLAIMED;
- hw_led_state = BCR_LED_RED | BCR_LED_GREEN;
+ hw_led_state = ASSABET_BCR_LED_RED | ASSABET_BCR_LED_GREEN;
X break;
X
X #ifdef CONFIG_LEDS_TIMER
X case led_timer:
X if (!(led_state & LED_STATE_CLAIMED))
- hw_led_state ^= BCR_LED_GREEN;
+ hw_led_state ^= ASSABET_BCR_LED_GREEN;
X break;
X #endif
X
X #ifdef CONFIG_LEDS_CPU
X case led_idle_start:
X if (!(led_state & LED_STATE_CLAIMED))
- hw_led_state |= BCR_LED_RED;
+ hw_led_state |= ASSABET_BCR_LED_RED;
X break;
X
X case led_idle_end:
X if (!(led_state & LED_STATE_CLAIMED))
- hw_led_state &= ~BCR_LED_RED;
+ hw_led_state &= ~ASSABET_BCR_LED_RED;
X break;
X #endif
X
@@ -77,12 +78,12 @@
X
X case led_green_on:
X if (led_state & LED_STATE_CLAIMED)
- hw_led_state &= ~BCR_LED_GREEN;
+ hw_led_state &= ~ASSABET_BCR_LED_GREEN;
X break;
X
X case led_green_off:
X if (led_state & LED_STATE_CLAIMED)
- hw_led_state |= BCR_LED_GREEN;
+ hw_led_state |= ASSABET_BCR_LED_GREEN;
X break;
X
X case led_amber_on:
@@ -93,12 +94,12 @@
X
X case led_red_on:
X if (led_state & LED_STATE_CLAIMED)
- hw_led_state &= ~BCR_LED_RED;
+ hw_led_state &= ~ASSABET_BCR_LED_RED;
X break;
X
X case led_red_off:
X if (led_state & LED_STATE_CLAIMED)
- hw_led_state |= BCR_LED_RED;
+ hw_led_state |= ASSABET_BCR_LED_RED;


X break;
X
X default:

@@ -106,7 +107,8 @@
X }
X
X if (led_state & LED_STATE_ENABLED)
- BCR = BCR_value = (BCR_value & ~BCR_LED_MASK) | hw_led_state;
+ ASSABET_BCR = BCR_value = (BCR_value & ~ASSABET_BCR_LED_MASK) |
+ hw_led_state;
X
X local_irq_restore(flags);
X }
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/leds-cerf.c linux/arch/arm/mach-sa1100/leds-cerf.c
--- v2.4.13/linux/arch/arm/mach-sa1100/leds-cerf.c Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/mach-sa1100/leds-cerf.c Thu Oct 25 13:53:46 2001
@@ -19,11 +19,23 @@
X static unsigned int led_state;
X static unsigned int hw_led_state;
X
+#ifdef CONFIG_SA1100_CERF_CPLD
+
+#define LED_D0 GPIO_GPIO(0)
+#define LED_D1 GPIO_GPIO(0)
+#define LED_D2 GPIO_GPIO(0)
+#define LED_D3 GPIO_GPIO(0)
+#define LED_MASK (LED_D0|LED_D1|LED_D2|LED_D3)
+
+#else
+
X #define LED_D0 GPIO_GPIO(0)
X #define LED_D1 GPIO_GPIO(1)
X #define LED_D2 GPIO_GPIO(2)
X #define LED_D3 GPIO_GPIO(3)
X #define LED_MASK (LED_D0|LED_D1|LED_D2|LED_D3)
+
+#endif
X
X void cerf_leds_event(led_event_t evt)
X {
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/leds-simpad.c linux/arch/arm/mach-sa1100/leds-simpad.c
--- v2.4.13/linux/arch/arm/mach-sa1100/leds-simpad.c Mon Aug 27 12:41:38 2001


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 06'
echo 'File patch-2.4.14 is continued in part 07'
echo "07" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:48 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part25

#!/bin/sh -x
# this is part 25 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 25; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ acpi_integer *out_quotient,
+ u32 *out_remainder)
+{
+
+ FUNCTION_TRACE ("Ut_short_divide");
+
+
+ /* Always check for a zero divisor */
+
+ if (divisor == 0) {
+ REPORT_ERROR (("Acpi_ut_short_divide: Divide by zero\n"));
+ return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
+ }
+
+ /* Return only what was requested */
+
+ if (out_quotient) {
+ *out_quotient = *in_dividend / divisor;
+ }
+ if (out_remainder) {
+ *out_remainder = (u32) *in_dividend % divisor;


+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
+

+acpi_status
+acpi_ut_divide (
+ acpi_integer *in_dividend,
+ acpi_integer *in_divisor,
+ acpi_integer *out_quotient,
+ acpi_integer *out_remainder)
+{
+ FUNCTION_TRACE ("Ut_divide");
+
+
+ /* Always check for a zero divisor */
+
+ if (*in_divisor == 0) {
+ REPORT_ERROR (("Acpi_ut_divide: Divide by zero\n"));
+ return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
+ }
+
+
+ /* Return only what was requested */
+
+ if (out_quotient) {
+ *out_quotient = *in_dividend / *in_divisor;
+ }
+ if (out_remainder) {
+ *out_remainder = *in_dividend % *in_divisor;


+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
+

+#endif
+
+
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/utilities/utmisc.c linux/drivers/acpi/utilities/utmisc.c
--- v2.4.13/linux/drivers/acpi/utilities/utmisc.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/utilities/utmisc.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: utmisc - common utility procedures


- * $Revision: 50 $

+ * $Revision: 52 $


X *
X ******************************************************************************/
X

@@ -662,6 +662,7 @@
X
X /* Init fields specific to the update struct */
X
+ state->common.data_type = ACPI_DESC_TYPE_STATE_UPDATE;
X state->update.object = object;
X state->update.value = action;
X
@@ -679,9 +680,7 @@
X *


X * RETURN: Status
X *

- * DESCRIPTION: Create an "Update State" - a flavor of the generic state used
- * to update reference counts and delete complex objects such
- * as packages.
+ * DESCRIPTION: Create a "Package State"


X *
X ******************************************************************************/
X

@@ -706,6 +705,7 @@
X
X /* Init fields specific to the update struct */
X
+ state->common.data_type = ACPI_DESC_TYPE_STATE_PACKAGE;
X state->pkg.source_object = (acpi_operand_object *) internal_object;
X state->pkg.dest_object = external_object;
X state->pkg.index = index;
@@ -748,7 +748,8 @@
X
X /* Init fields specific to the control struct */
X
- state->common.state = CONTROL_CONDITIONAL_EXECUTING;
+ state->common.data_type = ACPI_DESC_TYPE_STATE_CONTROL;
+ state->common.state = CONTROL_CONDITIONAL_EXECUTING;
X
X return_PTR (state);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/utilities/utobject.c linux/drivers/acpi/utilities/utobject.c
--- v2.4.13/linux/drivers/acpi/utilities/utobject.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/utilities/utobject.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: utobject - ACPI object create/delete/size/cache routines
- * $Revision: 55 $
+ * $Revision: 57 $


X *
X *****************************************************************************/
X

@@ -116,13 +116,6 @@
X if (!object) {
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
X "**** Null Object Ptr\n"));
- return (FALSE);
- }
-
- /* Check for a pointer within one of the ACPI tables */
-
- if (acpi_tb_system_table_pointer (object)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Object %p is a Pcode Ptr\n", object));
X return (FALSE);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/utilities/utxface.c linux/drivers/acpi/utilities/utxface.c
--- v2.4.13/linux/drivers/acpi/utilities/utxface.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/utilities/utxface.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: utxface - External interfaces for "global" ACPI functions
- * $Revision: 80 $
+ * $Revision: 82 $


X *
X *****************************************************************************/
X

@@ -240,19 +240,9 @@
X acpi_status
X acpi_terminate (void)


X {
- acpi_status status;
-
-

X FUNCTION_TRACE ("Acpi_terminate");


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Terminate the AML Debugger if present */
X
X DEBUGGER_EXEC(acpi_gbl_db_terminate_threads = TRUE);
@@ -271,10 +261,18 @@
X acpi_ut_mutex_terminate ();
X
X
+#ifdef ENABLE_DEBUGGER
+
+ /* Shut down the debugger */
+
+ acpi_db_terminate ();
+#endif
+
X /* Now we can shutdown the OS-dependent layer */
X
X acpi_os_terminate ();
X

+
X return_ACPI_STATUS (AE_OK);
X }
X

@@ -330,18 +328,10 @@
X {
X acpi_system_info *info_ptr;
X u32 i;
- acpi_status status;
X
X
X FUNCTION_TRACE ("Acpi_get_system_info");


X
-
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }

X
X /*
X * Must have a valid buffer
diff -u --recursive --new-file v2.4.13/linux/drivers/atm/Config.in linux/drivers/atm/Config.in
--- v2.4.13/linux/drivers/atm/Config.in Fri Feb 16 16:02:35 2001
+++ linux/drivers/atm/Config.in Thu Oct 25 13:53:46 2001
@@ -7,6 +7,7 @@
X tristate 'ATM over TCP' CONFIG_ATM_TCP
X fi
X if [ "$CONFIG_PCI" = "y" ]; then
+ tristate 'Efficient Networks Speedstream 3010' CONFIG_ATM_LANAI
X tristate 'Efficient Networks ENI155P' CONFIG_ATM_ENI
X if [ "$CONFIG_ATM_ENI" != "n" ]; then
X bool ' Enable extended debugging' CONFIG_ATM_ENI_DEBUG
diff -u --recursive --new-file v2.4.13/linux/drivers/atm/Makefile linux/drivers/atm/Makefile
--- v2.4.13/linux/drivers/atm/Makefile Sun Sep 23 11:40:57 2001
+++ linux/drivers/atm/Makefile Thu Oct 25 13:53:46 2001
@@ -26,6 +26,7 @@
X obj-$(CONFIG_ATM_TCP) += atmtcp.o
X obj-$(CONFIG_ATM_IA) += iphase.o suni.o
X obj-$(CONFIG_ATM_FIRESTREAM) += firestream.o
+obj-$(CONFIG_ATM_LANAI) += lanai.o
X
X ifeq ($(CONFIG_ATM_FORE200E_PCA),y)
X FORE200E_FW_OBJS += fore200e_pca_fw.o
diff -u --recursive --new-file v2.4.13/linux/drivers/atm/atmdev_init.c linux/drivers/atm/atmdev_init.c
--- v2.4.13/linux/drivers/atm/atmdev_init.c Fri Dec 29 14:35:47 2000
+++ linux/drivers/atm/atmdev_init.c Thu Oct 25 13:53:46 2001
@@ -25,6 +25,9 @@
X #ifdef CONFIG_ATM_FORE200E
X extern int fore200e_detect(void);
X #endif
+#ifdef CONFIG_ATM_LANAI
+extern int lanai_detect(void);
+#endif
X
X
X /*
@@ -55,6 +58,9 @@
X #endif
X #ifdef CONFIG_ATM_FORE200E
X devs += fore200e_detect();
+#endif
+#ifdef CONFIG_ATM_LANAI
+ devs += lanai_detect();
X #endif
X return devs;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/atm/lanai.c linux/drivers/atm/lanai.c
--- v2.4.13/linux/drivers/atm/lanai.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/atm/lanai.c Thu Oct 25 13:53:46 2001
@@ -0,0 +1,2917 @@
+/* lanai.c -- Copyright 1999 by Mitchell Blank Jr <mi...@sfgoth.com>


+ *
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * This driver supports ATM cards based on the Efficient "Lanai"
+ * chipset such as the Speedstream 3010 and the ENI-25p. The
+ * Speedstream 3060 is currently not supported since we don't
+ * have the code to drive the on-board Alcatel DSL chipset (yet).
+ *
+ * Thanks to Efficient for supporting this project with hardware,
+ * documentation, and by answering my questions.
+ *
+ * Things not working yet:
+ *
+ * o We're only set up to compile as a module currently. i.e.
+ * you should put the source in drivers/atm/lanai.c and then
+ * just do "make drivers/atm/lanai.o" from the main
+ * source directory. This will produce a drivers/atm/lanai.o
+ * file suitable for insmod'ing
+ *
+ * o We don't support the Speedstream 3060 yet - this card has
+ * an on-board DSL modem chip by Alcatel and the driver will
+ * need some extra code added to handle it
+ *
+ * o Note that due to limitations of the Lanai only one VCC can be
+ * in CBR at once
+ *
+ * o We don't currently parse the EEPROM at all. The code is all
+ * there as per the spec, but it doesn't actually work. I think
+ * there may be some issues with the docs. Anyway, do NOT
+ * enable it yet - bugs in that code may actually damage your
+ * hardware! Because of this you should hardware an ESI before
+ * trying to use this in a LANE or MPOA environment.
+ *
+ * o AAL0 is stubbed in but the actual rx/tx path isn't written yet:
+ * vcc_tx_aal0() needs to send or queue a SKB
+ * vcc_tx_unqueue_aal0() needs to attempt to send queued SKBs
+ * vcc_rx_aal0() needs to handle AAL0 interrupts
+ * This isn't too much work - I just wanted to get other things
+ * done first.
+ *
+ * o lanai_change_qos() isn't written yet
+ *
+ * o There aren't any ioctl's yet -- I'd like to eventually support
+ * setting loopback and LED modes that way. (see lanai_ioctl)
+ *
+ * o If the segmentation engine or DMA gets shut down we should restart
+ * card as per section 17.0i. (see lanai_reset)
+ *
+ * o setsockopt(SO_CIRANGE) isn't done (although despite what the
+ * API says it isn't exactly commonly implemented)
+ */
+
+/* Version history:
+ * v.0.02 -- 11-JAN-2000 -- Endian fixes
+ * v.0.01 -- 30-NOV-1999 -- Initial release
+ */
+
+#include <linux/module.h>
+#include <linux/mm.h>
+#include <linux/atmdev.h>
+#include <asm/io.h>
+#include <asm/byteorder.h>
+#include <linux/spinlock.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+
+#ifndef PCI_VENDOR_ID_EF_ATM_LANAI2
+/* These need to eventually go into <linux/pci.h> - they're here for now */
+#define PCI_VENDOR_ID_EF_ATM_LANAI2 0x0003
+#define PCI_VENDOR_ID_EF_ATM_LANAIHB 0x0005
+#endif
+
+/* -------------------- TUNABLE PARAMATERS: */
+
+/*
+ * Maximum number of VCIs per card. Setting it lower could theoretically
+ * save some memory, but since we allocate our vcc list with get_free_pages,
+ * it's not really likely for most architectures
+ */
+#define NUM_VCI (1024)
+
+/*
+ * Enable extra debugging
+ */
+#define DEBUG
+/*
+ * Debug _all_ register operations with card, except the memory test.
+ * Also disables the timed poll to prevent extra chattiness. This
+ * isn't for normal use
+ */
+#undef DEBUG_RW
+
+/*
+ * The programming guide specifies a full test of the on-board SRAM
+ * at initialization time. Undefine to remove this
+ */
+#define FULL_MEMORY_TEST
+
+/*
+ * This is the number of (4 byte) service entries that we will
+ * try to allocate at startup. Note that we will end up with
+ * one PAGE_SIZE's worth regardless of what this is set to
+ */
+#define SERVICE_ENTRIES (1024)
+/* TODO: make above a module load-time option */
+
+/*
+ * We normally read the onboard EEPROM in order to discover our MAC
+ * address. Undefine to _not_ do this
+ */
+/* #define READ_EEPROM */ /* ***DONT ENABLE YET*** */
+/* TODO: make above a module load-time option (also) */
+
+/*
+ * Depth of TX fifo (in 128 byte units; range 2-31)
+ * Smaller numbers are better for network latency
+ * Larger numbers are better for PCI latency
+ * I'm really sure where the best tradeoff is, but the BSD driver uses
+ * 7 and it seems to work ok.
+ */
+#define TX_FIFO_DEPTH (7)
+/* TODO: make above a module load-time option */
+
+/*
+ * How often (in jiffies) we will try to unstick stuck connections -
+ * shouldn't need to happen much
+ */
+#define LANAI_POLL_PERIOD (10*HZ)
+/* TODO: make above a module load-time option */
+
+/*
+ * When allocating an AAL5 receiving buffer, try to make it at least
+ * large enough to hold this many max_sdu sized PDUs
+ */
+#define AAL5_RX_MULTIPLIER (3)
+/* TODO: make above a module load-time option */
+
+/*
+ * Same for transmitting buffer
+ */
+#define AAL5_TX_MULTIPLIER (3)
+/* TODO: make above a module load-time option */
+
+/*
+ * When allocating an AAL0 transmiting buffer, how many cells should fit.
+ * Remember we'll end up with a PAGE_SIZE of them anyway, so this isn't
+ * really critical
+ */
+#define AAL0_TX_MULTIPLIER (40)
+/* TODO: make above a module load-time option */
+
+/*
+ * How large should we make the AAL0 receiving buffer. Remember that this
+ * is shared between all AAL0 VC's
+ */
+#define AAL0_RX_BUFFER_SIZE (PAGE_SIZE)
+/* TODO: make above a module load-time option */
+
+/*
+ * Should we use Lanai's "powerdown" feature when no vcc's are bound?
+ */
+/* #define USE_POWERDOWN */
+/* TODO: make above a module load-time option (also) */
+
+/* -------------------- DEBUGGING AIDS: */
+
+#define DEV_LABEL "lanai"
+
+#ifdef DEBUG
+
+#define DPRINTK(format, args...) \
+ printk(KERN_DEBUG DEV_LABEL ": " format, ##args)
+#define APRINTK(truth, format, args...) \
+ do { \
+ if (!(truth)) \
+ printk(KERN_ERR DEV_LABEL ": " format, ##args); \
+ } while (0)
+
+#else /* !DEBUG */
+
+#define DPRINTK(format, args...)
+#define APRINTK(truth, format, args...)
+
+#endif /* DEBUG */
+
+#ifdef DEBUG_RW
+#define RWDEBUG(format, args...) \
+ printk(KERN_DEBUG DEV_LABEL ": " format, ##args)
+#else /* !DEBUG_RW */
+#define RWDEBUG(format, args...)
+#endif
+
+/* -------------------- DATA DEFINITIONS: */
+
+#define LANAI_MAPPING_SIZE (0x40000)
+#define LANAI_EEPROM_SIZE (128)
+
+typedef int vci_t;
+typedef unsigned long bus_addr_t;
+
+/* A bitfield large enough for NUM_VCI */
+#define VCI_BITFIELD_NELEM ((NUM_VCI + BITS_PER_LONG - 1) / BITS_PER_LONG)
+typedef struct {
+ unsigned long ul[VCI_BITFIELD_NELEM];
+} vci_bitfield;
+
+/* DMA buffer in host memory for TX, RX, or service list. */
+struct lanai_buffer {
+ u32 *start; /* From get_free_pages */
+ u32 *end; /* One past last byte */
+ u32 *ptr; /* Pointer to current host location */
+ int order; /* log2(size/PAGE_SIZE) */
+};
+
+struct lanai_vcc_stats {
+ unsigned rx_nomem;
+ union {
+ struct {
+ unsigned rx_badlen;
+ unsigned service_trash;
+ unsigned service_stream;
+ unsigned service_rxcrc;
+ } aal5;
+ struct {
+ } aal0;
+ } x;
+};
+
+struct lanai_dev; /* Forward declaration */
+
+/*
+ * This is the card-specific per-vcc data. Note that unlike some other
+ * drivers there is NOT a 1-to-1 correspondance between these and
+ * atm_vcc's - each one of these represents an actual 2-way vcc, but
+ * an atm_vcc can be 1-way and share with a 1-way vcc in the other
+ * direction. To make it weirder, there can even be 0-way vccs
+ * bound to us, waiting to do a change_qos
+ */
+struct lanai_vcc {
+ bus_addr_t vbase; /* Base of VCC's registers */
+ struct lanai_vcc_stats stats;
+ int nref; /* # of atm_vcc's who reference us */
+ vci_t vci;
+ struct {
+ struct lanai_buffer buf;
+ struct atm_vcc *atmvcc; /* atm_vcc who is receiver */
+ } rx;
+ struct {
+ struct lanai_buffer buf;
+ struct atm_vcc *atmvcc; /* atm_vcc who is transmitter */
+ int endptr; /* last endptr from service entry */
+ struct sk_buff_head backlog;
+ struct sk_buff *inprogress; /* We're streaming this PDU */
+ unsigned char *pptr; /* Where we are in above */
+ int inprogleft; /* Bytes left to send "inprogress" */
+ void (*unqueue)(struct lanai_dev *, struct lanai_vcc *, int);
+ } tx;
+};
+
+enum lanai_type {
+ lanai2 = PCI_VENDOR_ID_EF_ATM_LANAI2,
+ lanaihb = PCI_VENDOR_ID_EF_ATM_LANAIHB
+};
+
+struct lanai_dev_stats {
+ unsigned ovfl_trash; /* # of cells dropped - buffer overflow */
+ unsigned vci_trash; /* # of cells dropped - closed vci */
+ unsigned hec_err; /* # of cells dropped - bad HEC */
+ unsigned atm_ovfl; /* # of cells dropped - rx fifo overflow */
+ unsigned pcierr_parity_detect;
+ unsigned pcierr_serr_set;
+ unsigned pcierr_master_abort;
+ unsigned pcierr_m_target_abort;
+ unsigned pcierr_s_target_abort;
+ unsigned pcierr_master_parity;
+ unsigned service_novcc_rx;
+ unsigned service_novcc_tx;
+ unsigned service_notx;
+ unsigned service_norx;
+ unsigned service_rxnotaal5;
+ unsigned dma_reenable;
+ unsigned card_reset;
+};
+
+struct lanai_dev {
+ bus_addr_t base;
+ struct lanai_dev_stats stats;
+ struct lanai_buffer service;
+ struct lanai_vcc **vccs;
+#ifdef USE_POWERDOWN
+ int nbound; /* number of bound vccs */
+#endif
+ enum lanai_type type;
+ vci_t num_vci; /* Currently just NUM_VCI */
+ u8 eeprom[LANAI_EEPROM_SIZE];
+ u32 serialno, magicno;
+ struct pci_dev *pci;
+ vci_bitfield backlog_vccs; /* VCCs that are backlogged */
+ vci_bitfield transmit_ready; /* VCCs that have transmit space */
+ struct timer_list timer;
+ int naal0;
+ struct lanai_buffer aal0buf; /* AAL0 RX buffers */
+ u32 conf1, conf2; /* CONFIG[12] registers */
+ u32 status; /* STATUS register */
+ spinlock_t txlock;
+ spinlock_t servicelock;
+ struct atm_vcc *cbrvcc;
+ int number;
+ int board_rev;
+ u8 pci_revision;
+/* TODO - look at race conditions with maintence of conf1/conf2 */
+/* TODO - transmit locking: should we use _irq not _irqsave? */
+/* TODO - organize above in some rational fashion (see <asm/cache.h>) */
+};
+
+/* -------------------- VCI_BITFIELD UTILITIES: */
+
+/*
+ * These functions assume that BITS_PER_LONG is a power of two, which
+ * should be safe
+ */
+#if (BITS_PER_LONG & (BITS_PER_LONG - 1))
+#error lanai driver requires type long to have a power of two number of bits
+#endif
+
+/*
+ * In vci_bitfield_{set,clear} we do the operation in three
+ * parts to ensure that gcc doesn't cast anything down to
+ * 32 bits (and then sign extend them later) on 64-bit
+ * platforms like the alpha
+ */
+static inline void vci_bitfield_set(vci_bitfield *bf, vci_t vci)
+{
+ unsigned long bit = 1;
+ bit <<= (unsigned long) (vci & (BITS_PER_LONG - 1));
+ bf->ul[vci / BITS_PER_LONG] |= bit;
+}
+
+static inline void vci_bitfield_clear(vci_bitfield *bf, vci_t vci)
+{
+ unsigned long bit = 1;
+ bit <<= (unsigned long) (vci & (BITS_PER_LONG - 1));
+ bf->ul[vci / BITS_PER_LONG] &= ~bit;
+}
+
+static inline void vci_bitfield_init(vci_bitfield *bf)
+{
+ memset(bf, 0, sizeof(*bf));
+}
+
+static void vci_bitfield_iterate(struct lanai_dev *lanai,
+ const vci_bitfield *bf, void (*func)(struct lanai_dev *,vci_t vci))
+{
+ vci_t vci;
+ unsigned long mask;
+ const unsigned long *lp = &(bf->ul[0]);
+ for (vci = 0; vci < NUM_VCI; lp++)
+ if (*lp == 0)
+ vci += BITS_PER_LONG;
+ else
+ for (mask = 1; mask != 0; mask <<= 1, vci++)
+ if (*lp & mask)
+ func(lanai, vci);
+}
+
+/* -------------------- BUFFER UTILITIES: */
+
+/*
+ * Lanai needs DMA buffers aligned to 256 bytes of at least 1024 bytes -
+ * we assume that any page allocation will do. I'm sure this is
+ * never going to be a problem, but it's good to document assumtions
+ */
+#if PAGE_SIZE < 1024
+#error PAGE_SIZE too small to support LANAI chipset
+#endif
+/*
+ * We also assume that the maximum buffer size will be some number
+ * of whole pages, although that wouldn't be too hard to fix
+ */
+#if PAGE_SIZE > (128 * 1024)
+#error PAGE_SIZE too large to support LANAI chipset
+#endif
+
+/* Convert a size to "order" for __get_free_pages */
+static int bytes_to_order(int bytes)
+{
+ int order = 0;
+ if (bytes > (128 * 1024))
+ bytes = 128 * 1024; /* Max buffer size for lanai */
+ while ((PAGE_SIZE << order) < bytes)
+ order++;
+ return order;
+}
+
+/*
+ * Allocate a buffer in host RAM for service list, RX, or TX
+ * Returns buf->order<0 if no memory
+ * Note that the size will be rounded up to an "order" of pages, and
+ * if we can't allocate that we'll settle for something smaller
+ * until minbytes
+ *
+ * NOTE: buffer must be 32-bit DMA capable - when linux can
+ * make distinction, this will need tweaking for this
+ * to work on BIG memory machines.
+ */
+static void lanai_buf_allocate(struct lanai_buffer *buf,
+ int bytes, int minbytes)
+{
+ unsigned long address;
+ int order = bytes_to_order(bytes);
+ do {
+ address = __get_free_pages(GFP_KERNEL, order);
+ if (address != 0) { /* Success */
+ bytes = PAGE_SIZE << order;
+ buf->start = buf->ptr = (u32 *) address;
+ buf->end = (u32 *) (address + bytes);
+ memset((void *) address, 0, bytes);
+ break;
+ }
+ if ((PAGE_SIZE << --order) < minbytes)
+ order = -1; /* Too small - give up */
+ } while (order >= 0);
+ buf->order = order;
+}
+
+static inline void lanai_buf_deallocate(struct lanai_buffer *buf)
+{
+ if (buf->order >= 0) {
+ APRINTK(buf->start != 0, "lanai_buf_deallocate: start==0!\n");
+ free_pages((unsigned long) buf->start, buf->order);
+ buf->start = buf->end = buf->ptr = 0;
+ }
+}
+
+/* size of buffer in bytes */
+static inline int lanai_buf_size(const struct lanai_buffer *buf)
+{
+ return ((unsigned long) buf->end) - ((unsigned long) buf->start);
+}
+
+/* size of buffer as "card order" (0=1k .. 7=128k) */
+static inline int lanai_buf_size_cardorder(const struct lanai_buffer *buf)
+{
+ return buf->order + PAGE_SHIFT - 10;
+}
+
+/* DMA-able address for this buffer */
+static unsigned long lanai_buf_dmaaddr(const struct lanai_buffer *buf)
+{
+ unsigned long r = virt_to_bus(buf->start);
+ APRINTK((r & ~0xFFFFFF00) == 0, "bad dmaaddr: 0x%lx\n", (long) r);
+ return r;
+}
+
+/* -------------------- HANDLE BACKLOG_VCCS BITFIELD: */
+
+static inline void vcc_mark_backlogged(struct lanai_dev *lanai,
+ const struct lanai_vcc *lvcc)
+{
+ APRINTK(lvcc->vbase != 0, "vcc_mark_backlogged: zero vbase!\n");
+ vci_bitfield_set(&lanai->backlog_vccs, lvcc->vci);
+}
+
+static inline void vcc_unmark_backlogged(struct lanai_dev *lanai,
+ const struct lanai_vcc *lvcc)
+{
+ APRINTK(lvcc->vbase != 0, "vcc_unmark_backlogged: zero vbase!\n");
+ vci_bitfield_clear(&lanai->backlog_vccs, lvcc->vci);
+}
+
+static inline void vcc_backlog_init(struct lanai_dev *lanai)
+{
+ vci_bitfield_init(&lanai->backlog_vccs);
+}
+
+static inline int vcc_is_backlogged(/*const*/ struct lanai_vcc *lvcc)
+{
+ return lvcc->tx.inprogress != NULL ||
+ !skb_queue_empty(&lvcc->tx.backlog);
+}
+
+/* -------------------- PORT I/O UTILITIES: */
+
+/* Registers (and their bit-fields) */
+enum lanai_register {
+ Reset_Reg = 0x00, /* Reset; read for chip type; bits: */
+#define RESET_GET_BOARD_REV(x) (((x)>> 0)&0x03) /* Board revision */
+#define RESET_GET_BOARD_ID(x) (((x)>> 2)&0x03) /* Board ID */
+#define BOARD_ID_LANAI256 (0) /* 25.6M adaptor card */
+ Endian_Reg = 0x04, /* Endian setting */
+ IntStatus_Reg = 0x08, /* Interrupt status */
+ IntStatusMasked_Reg = 0x0C, /* Interrupt status (masked) */
+ IntAck_Reg = 0x10, /* Interrupt acknowledge */
+ IntAckMasked_Reg = 0x14, /* Interrupt acknowledge (masked) */
+ IntStatusSet_Reg = 0x18, /* Get status + enable/disable */
+ IntStatusSetMasked_Reg = 0x1C, /* Get status + en/di (masked) */
+ IntControlEna_Reg = 0x20, /* Interrupt control enable */
+ IntControlDis_Reg = 0x24, /* Interrupt control disable */
+ Status_Reg = 0x28, /* Status */
+#define STATUS_PROMDATA (0x00000001) /* PROM_DATA pin */
+#define STATUS_WAITING (0x00000002) /* Interrupt being delayed */
+#define STATUS_SOOL (0x00000004) /* SOOL alarm */
+#define STATUS_LOCD (0x00000008) /* LOCD alarm */
+#define STATUS_LED (0x00000010) /* LED (HAPPI) output */
+#define STATUS_GPIN (0x00000020) /* GPIN pin */
+#define STATUS_BUTTBUSY (0x00000040) /* Butt register is pending */
+ Config1_Reg = 0x2C, /* Config word 1; bits: */
+#define CONFIG1_PROMDATA (0x00000001) /* PROM_DATA pin */
+#define CONFIG1_PROMCLK (0x00000002) /* PROM_CLK pin */
+#define CONFIG1_SET_READMODE(x) ((x)*0x004) /* PCI BM reads; values: */
+#define READMODE_PLAIN (0) /* Plain memory read */
+#define READMODE_LINE (2) /* Memory read line */
+#define READMODE_MULTIPLE (3) /* Memory read multiple */
+#define CONFIG1_DMA_ENABLE (0x00000010) /* Turn on DMA */
+#define CONFIG1_POWERDOWN (0x00000020) /* Turn off clocks */
+#define CONFIG1_SET_LOOPMODE(x) ((x)*0x080) /* Clock&loop mode; values: */
+#define LOOPMODE_NORMAL (0) /* Normal - no loop */
+#define LOOPMODE_TIME (1)
+#define LOOPMODE_DIAG (2)
+#define LOOPMODE_LINE (3)
+#define CONFIG1_MASK_LOOPMODE (0x00000180)
+#define CONFIG1_SET_LEDMODE(x) ((x)*0x0200) /* Mode of LED; values: */
+#define LEDMODE_NOT_SOOL (0) /* !SOOL */
+#define LEDMODE_OFF (1) /* 0 */
+#define LEDMODE_ON (2) /* 1 */
+#define LEDMODE_NOT_LOCD (3) /* !LOCD */
+#define LEDMORE_GPIN (4) /* GPIN */
+#define LEDMODE_NOT_GPIN (7) /* !GPIN */
+#define CONFIG1_MASK_LEDMODE (0x00000E00)
+#define CONFIG1_GPOUT1 (0x00001000) /* Toggle for reset */
+#define CONFIG1_GPOUT2 (0x00002000) /* Loopback PHY */
+#define CONFIG1_GPOUT3 (0x00004000) /* Loopback lanai */
+ Config2_Reg = 0x30, /* Config word 2; bits: */
+#define CONFIG2_HOWMANY (0x00000001) /* >512 VCIs? */
+#define CONFIG2_PTI7_MODE (0x00000002) /* Make PTI=7 RM, not OAM */
+#define CONFIG2_VPI_CHK_DIS (0x00000004) /* Ignore RX VPI value */
+#define CONFIG2_HEC_DROP (0x00000008) /* Drop cells w/ HEC errors */
+#define CONFIG2_VCI0_NORMAL (0x00000010) /* Treat VCI=0 normally */
+#define CONFIG2_CBR_ENABLE (0x00000020) /* Deal with CBR traffic */
+#define CONFIG2_TRASH_ALL (0x00000040) /* Trashing incoming cells */
+#define CONFIG2_TX_DISABLE (0x00000080) /* Trashing outgoing cells */
+#define CONFIG2_SET_TRASH (0x00000100) /* Turn trashing on */
+ Statistics_Reg = 0x34, /* Statistics; bits: */
+#define STATS_GET_FIFO_OVFL(x) (((x)>> 0)&0xFF) /* FIFO overflowed */
+#define STATS_GET_HEC_ERR(x) (((x)>> 8)&0xFF) /* HEC was bad */
+#define STATS_GET_BAD_VCI(x) (((x)>>16)&0xFF) /* VCI not open */
+#define STATS_GET_BUF_OVFL(x) (((x)>>24)&0xFF) /* VCC buffer full */
+ ServiceStuff_Reg = 0x38, /* Service stuff; bits: */
+#define SSTUFF_SET_SIZE(x) ((x)*0x20000000) /* size of service buffer */
+#define SSTUFF_SET_ADDR(x) ((x)>>8) /* set address of buffer */
+ ServWrite_Reg = 0x3C, /* ServWrite Pointer */
+ ServRead_Reg = 0x40, /* ServRead Pointer */
+ TxDepth_Reg = 0x44, /* FIFO Transmit Depth */
+ Butt_Reg = 0x48, /* Butt register */
+ CBR_ICG_Reg = 0x50,
+ CBR_PTR_Reg = 0x54,
+ PingCount_Reg = 0x58, /* Ping count */
+ DMA_Addr_Reg = 0x5C /* DMA address */
+};
+
+static inline bus_addr_t reg_addr(const struct lanai_dev *lanai,
+ enum lanai_register reg)
+{
+ return lanai->base + (bus_addr_t) reg;
+}
+
+
+static inline u32 reg_read(const struct lanai_dev *lanai,
+ enum lanai_register reg)
+{
+ u32 t;
+ t = readl(reg_addr(lanai, reg));
+ RWDEBUG("R [0x%08X] 0x%02X = 0x%08X\n", (unsigned int) lanai->base,
+ (int) reg, t);
+ return t;
+}
+
+static inline void reg_write(const struct lanai_dev *lanai, u32 val,
+ enum lanai_register reg)
+{
+ RWDEBUG("W [0x%08X] 0x%02X < 0x%08X\n", (unsigned int) lanai->base,
+ (int) reg, val);
+ writel(val, reg_addr(lanai, reg));
+ mdelay(1);
+}
+
+static inline void conf1_write(const struct lanai_dev *lanai)
+{
+ reg_write(lanai, lanai->conf1, Config1_Reg);
+}
+
+static inline void conf2_write(const struct lanai_dev *lanai)
+{
+ reg_write(lanai, lanai->conf2, Config2_Reg);
+}
+
+static inline void reset_board(const struct lanai_dev *lanai)
+{
+ DPRINTK("about to reset board\n");
+ reg_write(lanai, 0, Reset_Reg);
+ /*
+ * If we don't delay a little while here then we can end up
+ * leaving the card in a VERY weird state and lock up the
+ * PCI bus. This isn't documented anywhere but I've convinced
+ * myself after a lot of painful experimentation
+ */
+ udelay(5);
+}
+
+/* -------------------- VCC LIST LOCK: */
+
+/*
+ * The linux-atm code disables local IRQs while managing the list of
+ * VCCs on a card. This is good, but it doesn't save us against
+ * SMP. Unfortunately, fixing this will require changes in the
+ * API which will have to wait a little bit. It's a hard race to
+ * trigger accidentally, so it isn't TOO horrible so far.
+ *
+ * One possible solution would be to have an rwlock which is
+ * always grabbed _irq-style on writing. This would automatically
+ * be grabbed (for writing) by the higher layers on things that
+ * would result in a change in the vcc list (_open, _close,
+ * probably _change_qos) - thus it would also protect the
+ * higher-level list of vccs on each device (atm_dev->vccs).
+ * The driver would be responsible for grabbing it as a read_lock
+ * anytime it wants to consult its table of vccs - for instance
+ * when handling an incoming PDU. This also explains why we would
+ * probably want the write_lock while in _change_qos - to prevent
+ * handling of PDUs while possibly in an inconsistant state.
+ * Also, _send would grab the lock for reading.
+ *
+ * One problem with this is that _open and _close could no longer
+ * do anything that might provoke a schedule. First, it would
+ * force us to use GFP_ATOMIC memory (which is bad), but also
+ * some devices pretty much require scheduling due to long
+ * delays (see lanai_close for an example). So in this case
+ * we need a way to schedule without losing the spinlock.
+ * The cleanest way to do this is probably have a way to mark a
+ * VCC as "in progress" so that the interrupt handler can
+ * still disregard any traffic for it while _open or _close
+ * are sleeping on it. Then it will need to be _open and
+ * _close's job to relinquish the write_lock. Thus, the
+ * lock could be dropped around the times that scheduling
+ * might occur. Perhaps the _READY flag can be used for
+ * this purpose.
+ *
+ * One short note about this "upper layer grabs, driver
+ * relinquishes" write lock - since this needs to be
+ * an _irq lock we're going to have problem saving
+ * and restoring flags (_irqsave/_irqrestore). This
+ * shouldn't be a problem, however - we must just
+ * require that those syscalls are never called with
+ * interrupts disabled so we can use the non-flags-saving
+ * versions.
+ *
+ * Anyway, all of the above is vaporware currently - fixing
+ * this right will require changes in the API and all of
+ * the drivers - this will wait until 2.5.x most likely.
+ * The following NOP macros are just here to mark where
+ * the locks will be needed in the future.
+ */
+#define vcclist_read_lock() do {} while (0)
+#define vcclist_read_unlock() do {} while (0)
+#define vcclist_write_lock() do {} while (0)
+#define vcclist_write_unlock() do {} while (0)
+
+/* -------------------- CARD SRAM UTILITIES: */
+
+/* The SRAM is mapped into normal PCI memory space - the only catch is
+ * that it is only 16-bits wide but must be accessed as 32-bit. The
+ * 16 high bits will be zero. We don't hide this, since they get
+ * programmed mostly like discrete registers anyway
+ */
+#define SRAM_START (0x20000)
+#define SRAM_BYTES (0x20000) /* Again, half don't really exist */
+
+static inline bus_addr_t sram_addr(const struct lanai_dev *lanai, int offset)
+{
+ return lanai->base + SRAM_START + offset;
+}
+
+static inline u32 sram_read(const struct lanai_dev *lanai, int offset)
+{
+ return readl(sram_addr(lanai, offset));
+}
+
+static inline void sram_write(const struct lanai_dev *lanai,
+ u32 val, int offset)
+{
+ writel(val, sram_addr(lanai, offset));
+}
+
+static int __init sram_test_word(
+ const struct lanai_dev *lanai, int offset, u32 pattern)
+{
+ u32 readback;
+ sram_write(lanai, pattern, offset);
+ readback = sram_read(lanai, offset);
+ if (readback == pattern)
+ return 0;
+ printk(KERN_ERR DEV_LABEL
+ "(itf %d): SRAM word at %d bad: wrote 0x%X, read 0x%X\n",
+ lanai->number, offset, pattern, readback);
+ return -EIO;
+}
+
+static int __init sram_test_pass(const struct lanai_dev *lanai, u32 pattern)
+{
+ int offset, result = 0;
+ for (offset = 0; offset < SRAM_BYTES && result == 0; offset += 4)
+ result = sram_test_word(lanai, offset, pattern);


+ return result;
+}
+

+static int __init sram_test_and_clear(const struct lanai_dev *lanai)
+{
+#ifdef FULL_MEMORY_TEST
+ int result;
+ DPRINTK("testing SRAM\n");
+ if ((result = sram_test_pass(lanai, 0x5555)) != 0)
+ return result;
+ if ((result = sram_test_pass(lanai, 0xAAAA)) != 0)
+ return result;
+#endif
+ DPRINTK("clearing SRAM\n");
+ return sram_test_pass(lanai, 0x0000);
+}
+
+/* -------------------- CARD-BASED VCC TABLE UTILITIES: */
+
+/* vcc table */
+enum lanai_vcc_offset {
+ vcc_rxaddr1 = 0x00, /* Location1, plus bits: */
+#define RXADDR1_SET_SIZE(x) ((x)*0x0000100) /* size of RX buffer */
+#define RXADDR1_SET_RMMODE(x) ((x)*0x00800) /* RM cell action; values: */
+#define RMMODE_TRASH (0) /* discard */
+#define RMMODE_PRESERVE (1) /* input as AAL0 */
+#define RMMODE_PIPE (2) /* pipe to coscheduler */
+#define RMMODE_PIPEALL (3) /* pipe non-RM too */
+#define RXADDR1_OAM_PRESERVE (0x00002000) /* Input OAM cells as AAL0 */
+#define RXADDR1_SET_MODE(x) ((x)*0x0004000) /* Reassembly mode */
+#define RXMODE_TRASH (0) /* discard */
+#define RXMODE_AAL0 (1) /* non-AAL5 mode */
+#define RXMODE_AAL5 (2) /* AAL5, intr. each PDU */
+#define RXMODE_AAL5_STREAM (3) /* AAL5 w/o per-PDU intr */
+ vcc_rxaddr2 = 0x04, /* Location2 */
+ vcc_rxcrc1 = 0x08, /* RX CRC claculation space */
+ vcc_rxcrc2 = 0x0C,
+ vcc_rxwriteptr = 0x10, /* RX writeptr, plus bits: */
+#define RXWRITEPTR_LASTEFCI (0x00002000) /* Last PDU had EFCI bit */
+#define RXWRITEPTR_DROPPING (0x00004000) /* Had error, dropping */
+#define RXWRITEPTR_TRASHING (0x00008000) /* Trashing */
+ vcc_rxbufstart = 0x14, /* RX bufstart, plus bits: */
+#define RXBUFSTART_CLP (0x00004000)
+#define RXBUFSTART_CI (0x00008000)
+ vcc_rxreadptr = 0x18, /* RX readptr */
+ vcc_txicg = 0x1C, /* TX ICG */
+ vcc_txaddr1 = 0x20, /* Location1, plus bits: */
+#define TXADDR1_SET_SIZE(x) ((x)*0x0000100) /* size of TX buffer */
+#define TXADDR1_ABR (0x00008000) /* use ABR (doesn't work) */
+ vcc_txaddr2 = 0x24, /* Location2 */
+ vcc_txcrc1 = 0x28, /* TX CRC claculation space */
+ vcc_txcrc2 = 0x2C,
+ vcc_txreadptr = 0x30, /* TX Readptr, plus bits: */
+#define TXREADPTR_GET_PTR(x) ((x)&0x01FFF)
+#define TXREADPTR_MASK_DELTA (0x0000E000) /* ? */
+ vcc_txendptr = 0x34, /* TX Endptr, plus bits: */
+#define TXENDPTR_CLP (0x00002000)
+#define TXENDPTR_MASK_PDUMODE (0x0000C000) /* PDU mode; values: */
+#define PDUMODE_AAL0 (0*0x04000)
+#define PDUMODE_AAL5 (2*0x04000)
+#define PDUMODE_AAL5STREAM (3*0x04000)
+ vcc_txwriteptr = 0x38, /* TX Writeptr */
+#define TXWRITEPTR_GET_PTR(x) ((x)&0x1FFF)
+ vcc_txcbr_next = 0x3C /* # of next CBR VCI in ring */
+#define TXCBR_NEXT_BOZO (0x00008000) /* "bozo bit" */
+};
+
+#define CARDVCC_SIZE (0x40)
+
+static inline bus_addr_t cardvcc_addr(const struct lanai_dev *lanai,
+ vci_t vci)
+{
+ return sram_addr(lanai, vci * CARDVCC_SIZE);
+}
+
+static inline u32 cardvcc_read(const struct lanai_vcc *lvcc,
+ enum lanai_vcc_offset offset)
+{
+ u32 val;
+ APRINTK(lvcc->vbase != 0, "cardvcc_read: unbound vcc!\n");
+ val= readl(lvcc->vbase + (bus_addr_t) offset);
+ RWDEBUG("VR vci=%04d 0x%02X = 0x%08X\n",
+ lvcc->vci, (int) offset, val);
+ return val;
+}
+
+static inline void cardvcc_write(const struct lanai_vcc *lvcc,
+ u32 val, enum lanai_vcc_offset offset)
+{
+ APRINTK(lvcc->vbase != 0, "cardvcc_write: unbound vcc!\n");
+ APRINTK((val & ~0xFFFF) == 0,
+ "cardvcc_write: bad val 0x%X (vci=%d, addr=0x%02X)\n",
+ val, lvcc->vci, (int) offset);
+ RWDEBUG("VW vci=%04d 0x%02X > 0x%08X\n",
+ lvcc->vci, (int) offset, val);
+ writel(val, lvcc->vbase + (bus_addr_t) offset);
+}
+
+/* -------------------- COMPUTE SIZE OF AN AAL5 PDU: */
+
+/* How many bytes will an AAL5 PDU take to transmit - remember that:
+ * o we need to add 8 bytes for length, CPI, UU, and CRC
+ * o we need to round up to 48 bytes for cells
+ */
+static inline int aal5_size(int size)
+{
+ int cells = (size + 8 + 47) / 48;
+ return cells * 48;
+}
+
+/* How many bytes can we send if we have "space" space, assuming we have
+ * to send full cells
+ */
+static inline int aal5_spacefor(int space)
+{
+ int cells = space / 48;
+ return cells * 48;
+}
+
+/* -------------------- FREE AN ATM SKB: */
+
+static inline void lanai_free_skb(struct atm_vcc *atmvcc, struct sk_buff *skb)
+{
+ if (atmvcc->pop != NULL)
+ atmvcc->pop(atmvcc, skb);
+ else
+ dev_kfree_skb_any(skb);
+}
+
+/* -------------------- TURN VCCS ON AND OFF: */
+
+static void host_vcc_start_rx(const struct lanai_vcc *lvcc)
+{
+ u32 addr1;
+ if (lvcc->rx.atmvcc->qos.aal == ATM_AAL5) {
+ unsigned long dmaaddr = lanai_buf_dmaaddr(&lvcc->rx.buf);
+ cardvcc_write(lvcc, 0xFFFF, vcc_rxcrc1);
+ cardvcc_write(lvcc, 0xFFFF, vcc_rxcrc2);
+ cardvcc_write(lvcc, 0, vcc_rxwriteptr);
+ cardvcc_write(lvcc, 0, vcc_rxbufstart);
+ cardvcc_write(lvcc, 0, vcc_rxreadptr);
+ cardvcc_write(lvcc, (dmaaddr >> 16) & 0xFFFF, vcc_rxaddr2);
+ addr1 = ((dmaaddr >> 8) & 0xFF) |
+ RXADDR1_SET_SIZE(lanai_buf_size_cardorder(&lvcc->rx.buf))|
+ RXADDR1_SET_RMMODE(RMMODE_TRASH) | /* ??? */
+ /* RXADDR1_OAM_PRESERVE | --- no OAM support yet */
+ RXADDR1_SET_MODE(RXMODE_AAL5);
+ } else
+ addr1 = RXADDR1_SET_RMMODE(RMMODE_PRESERVE) | /* ??? */
+ RXADDR1_OAM_PRESERVE | /* ??? */
+ RXADDR1_SET_MODE(RXMODE_AAL0);
+ /* This one must be last! */
+ cardvcc_write(lvcc, addr1, vcc_rxaddr1);
+}
+
+static void host_vcc_start_tx(const struct lanai_vcc *lvcc)
+{
+ unsigned long dmaaddr = lanai_buf_dmaaddr(&lvcc->tx.buf);
+ cardvcc_write(lvcc, 0, vcc_txicg);
+ cardvcc_write(lvcc, 0xFFFF, vcc_txcrc1);
+ cardvcc_write(lvcc, 0xFFFF, vcc_txcrc2);
+ cardvcc_write(lvcc, 0, vcc_txreadptr);
+ cardvcc_write(lvcc, 0, vcc_txendptr);
+ cardvcc_write(lvcc, 0, vcc_txwriteptr);
+ cardvcc_write(lvcc,
+ (lvcc->tx.atmvcc->qos.txtp.traffic_class == ATM_CBR) ?
+ TXCBR_NEXT_BOZO | lvcc->vci : 0, vcc_txcbr_next);
+ cardvcc_write(lvcc, (dmaaddr >> 16) & 0xFFFF, vcc_txaddr2);
+ cardvcc_write(lvcc,
+ ((dmaaddr >> 8) & 0xFF) |
+ TXADDR1_SET_SIZE(lanai_buf_size_cardorder(&lvcc->tx.buf)),
+ vcc_txaddr1);
+}
+
+/* Shutdown receiving on card */
+static void lanai_shutdown_rx_vci(const struct lanai_vcc *lvcc)
+{
+ if (lvcc->vbase == 0) /* We were never bound to a VCI */
+ return;
+ /* 15.1.1 - set to trashing, wait one cell time (15us) */
+ cardvcc_write(lvcc,
+ RXADDR1_SET_RMMODE(RMMODE_TRASH) |
+ RXADDR1_SET_MODE(RXMODE_TRASH), vcc_rxaddr1);
+ udelay(15);
+ /* 15.1.2 - clear rest of entries */
+ cardvcc_write(lvcc, 0, vcc_rxaddr2);
+ cardvcc_write(lvcc, 0, vcc_rxcrc1);
+ cardvcc_write(lvcc, 0, vcc_rxcrc2);
+ cardvcc_write(lvcc, 0, vcc_rxwriteptr);
+ cardvcc_write(lvcc, 0, vcc_rxbufstart);
+ cardvcc_write(lvcc, 0, vcc_rxreadptr);
+}
+
+/* Shutdown transmitting on card.
+ * Unfortunately the lanai needs us to wait until all the data
+ * drains out of the buffer before we can dealloc it, so this
+ * can take awhile -- up to 370ms for a full 128KB buffer
+ * assuming everone else is quiet. In theory the time is
+ * boundless if there's a CBR VCC holding things up.
+ */
+static void lanai_shutdown_tx_vci(struct lanai_dev *lanai,
+ struct lanai_vcc *lvcc)
+{
+ struct sk_buff *skb;
+ unsigned long flags, timeout;
+ int read, write, lastread = -1;
+ APRINTK(!in_interrupt(),
+ "lanai_shutdown_tx_vci called w/o process context!\n");
+ if (lvcc->vbase == 0) /* We were never bound to a VCI */
+ return;
+ /* 15.2.1 - wait for queue to drain */
+ spin_lock_irqsave(&lanai->txlock, flags);
+ if (lvcc->tx.inprogress != NULL) {
+ lanai_free_skb(lvcc->tx.atmvcc, lvcc->tx.inprogress);
+ lvcc->tx.inprogress = NULL;
+ }
+ while ((skb = skb_dequeue(&lvcc->tx.backlog)) != NULL)
+ lanai_free_skb(lvcc->tx.atmvcc, skb);
+ vcc_unmark_backlogged(lanai, lvcc);
+ spin_unlock_irqrestore(&lanai->txlock, flags);
+ timeout = jiffies + ((lanai_buf_size(&lvcc->tx.buf) * HZ) >> 17);
+ write = TXWRITEPTR_GET_PTR(cardvcc_read(lvcc, vcc_txwriteptr));
+ goto start;
+ while (time_before_eq(jiffies, timeout)) {
+ schedule_timeout(HZ / 25);
+ start:
+ read = TXREADPTR_GET_PTR(cardvcc_read(lvcc, vcc_txreadptr));
+ if (read == write && /* Is TX buffer empty? */
+ (lvcc->tx.atmvcc->qos.txtp.traffic_class != ATM_CBR ||
+ (cardvcc_read(lvcc, vcc_txcbr_next) &
+ TXCBR_NEXT_BOZO) == 0))
+ goto done;
+ if (read != lastread) { /* Has there been any progress? */
+ lastread = read;
+ timeout += HZ / 10;
+ }
+ }
+ printk(KERN_ERR DEV_LABEL "(itf %d): Timed out on backlog closing "
+ "vci %d\n", lvcc->tx.atmvcc->dev->number, lvcc->vci);
+ DPRINTK("read, write = %d, %d\n", read, write);
+ done:
+ /* 15.2.2 - clear out all tx registers */
+ cardvcc_write(lvcc, 0, vcc_txreadptr);
+ cardvcc_write(lvcc, 0, vcc_txwriteptr);
+ cardvcc_write(lvcc, 0, vcc_txendptr);
+ cardvcc_write(lvcc, 0, vcc_txcrc1);
+ cardvcc_write(lvcc, 0, vcc_txcrc2);
+ cardvcc_write(lvcc, 0, vcc_txaddr2);
+ cardvcc_write(lvcc, 0, vcc_txaddr1);
+}
+
+/* -------------------- MANAGING AAL0 RX BUFFER: */
+
+static inline int aal0_buffer_allocate(struct lanai_dev *lanai)
+{
+ DPRINTK("aal0_buffer_allocate: allocating AAL0 RX buffer\n");
+ lanai_buf_allocate(&lanai->aal0buf, AAL0_RX_BUFFER_SIZE, 80);
+ return (lanai->aal0buf.order < 0) ? -ENOMEM : 0;
+}
+
+static inline void aal0_buffer_free(struct lanai_dev *lanai)
+{
+ DPRINTK("aal0_buffer_allocate: freeing AAL0 RX buffer\n");
+ lanai_buf_deallocate(&lanai->aal0buf);
+}
+
+/* -------------------- EEPROM UTILITIES: */
+
+/* Offsets of data in the EEPROM */
+#define EEPROM_COPYRIGHT (0)
+#define EEPROM_COPYRIGHT_LEN (44)
+#define EEPROM_CHECKSUM (62)
+#define EEPROM_CHECKSUM_REV (63)
+#define EEPROM_MAC (64)
+#define EEPROM_MAC_REV (70)
+#define EEPROM_SERIAL (112)
+#define EEPROM_SERIAL_REV (116)
+#define EEPROM_MAGIC (120)
+#define EEPROM_MAGIC_REV (124)
+
+#define EEPROM_MAGIC_VALUE (0x5AB478D2)
+
+#ifndef READ_EEPROM
+
+/* Stub functions to use if EEPROM reading is disabled */
+static int __init eeprom_read(struct lanai_dev *lanai)
+{
+ printk(KERN_INFO DEV_LABEL "(itf %d): *NOT* reading EEPROM\n",
+ lanai->number);
+ memset(&lanai->eeprom[EEPROM_MAC], 0, 6);


+ return 0;
+}
+

+static int __init eeprom_validate(struct lanai_dev *lanai)
+{
+ lanai->serialno = 0;
+ lanai->magicno = EEPROM_MAGIC_VALUE;


+ return 0;
+}
+

+#else /* READ_EEPROM */
+
+static int __init eeprom_read(struct lanai_dev *lanai)
+{
+ int i, address;
+ u8 data;
+ u32 tmp;
+#define set_config1(x) do { lanai->conf1 = x; conf1_write(lanai); \
+ } while (0)
+#define clock_h() set_config1(lanai->conf1 | CONFIG1_PROMCLK)
+#define clock_l() set_config1(lanai->conf1 &~ CONFIG1_PROMCLK)
+#define data_h() set_config1(lanai->conf1 | CONFIG1_PROMDATA)
+#define data_l() set_config1(lanai->conf1 &~ CONFIG1_PROMDATA)
+#define pre_read() do { data_h(); clock_h(); udelay(5); } while (0)
+#define read_pin() (reg_read(lanai, Status_Reg) & STATUS_PROMDATA)
+#define send_stop() do { data_l(); udelay(5); clock_h(); udelay(5); \
+ data_h(); udelay(5); } while (0)
+ /* start with both clock and data high */
+ data_h(); clock_h(); udelay(5);
+ for (address = 0; address < LANAI_EEPROM_SIZE; address++) {
+ data = (address << 1) | 1; /* Command=read + address */
+ /* send start bit */
+ data_l(); udelay(5);
+ clock_l(); udelay(5);
+ for (i = 128; i != 0; i >>= 1) { /* write command out */
+ tmp = (lanai->conf1 & ~CONFIG1_PROMDATA) |
+ (data & i) ? CONFIG1_PROMDATA : 0;
+ if (lanai->conf1 != tmp) {
+ set_config1(tmp);
+ udelay(5); /* Let new data settle */
+ }
+ clock_h(); udelay(5); clock_l(); udelay(5);
+ }
+ /* look for ack */
+ data_h(); clock_h(); udelay(5);
+ if (read_pin() != 0)
+ goto error; /* No ack seen */
+ clock_l(); udelay(5);
+ /* read back result */
+ for (data = 0, i = 7; i >= 0; i--) {
+ data_h(); clock_h(); udelay(5);
+ data = (data << 1) | !!read_pin();
+ clock_l(); udelay(5);
+ }
+ /* look again for ack */
+ data_h(); clock_h(); udelay(5);
+ if (read_pin() == 0)
+ goto error; /* Spurious ack */
+ clock_l(); udelay(5);
+ send_stop();
+ lanai->eeprom[address] = data;
+ DPRINTK("EEPROM 0x%04X %02X\n", address, data);
+ }
+ return 0;
+ error:
+ clock_l(); udelay(5); /* finish read */
+ send_stop();
+ printk(KERN_ERR DEV_LABEL "(itf %d): error reading EEPROM byte %d\n",
+ lanai->number, address);
+ return -EIO;
+#undef set_config1
+#undef clock_h
+#undef clock_l
+#undef data_h
+#undef data_l
+#undef pre_read
+#undef read_pin
+#undef send_stop
+}
+
+/* read a big-endian 4-byte value out of eeprom */
+static inline u32 eeprom_be4(const struct lanai_dev *lanai, int address)
+{
+ return be32_to_cpup((u32 *) (&lanai->eeprom[address]));
+}
+
+/* Checksum/validate EEPROM contents */
+static int __init eeprom_validate(struct lanai_dev *lanai)
+{
+ int i, s;
+ u32 v;
+ const u8 *e = lanai->eeprom;
+#ifdef DEBUG
+ /* First, see if we can get an ASCIIZ string out of the copyright */
+ for (i = EEPROM_COPYRIGHT;
+ i < (EEPROM_COPYRIGHT + EEPROM_COPYRIGHT_LEN); i++)
+ if (e[i] < 0x20 || e[i] > 0x7E)
+ break;
+ if ( i != EEPROM_COPYRIGHT &&
+ i != EEPROM_COPYRIGHT + EEPROM_COPYRIGHT_LEN && e[i] == '\0')
+ DPRINTK("eeprom: copyright = \"%s\"\n",
+ (char *) &e[EEPROM_COPYRIGHT]);
+ else
+ DPRINTK("eeprom: copyright not found\n");
+#endif
+ /* Validate checksum */
+ for (i = s = 0; i < EEPROM_CHECKSUM; i++)
+ s += e[i];
+ s &= 0xFF;
+ if (s != e[EEPROM_CHECKSUM]) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): EEPROM checksum bad "
+ "(wanted 0x%02X, got 0x%02X)\n", lanai->number,
+ s, e[EEPROM_CHECKSUM]);
+ return -EIO;
+ }
+ s ^= 0xFF;
+ if (s != e[EEPROM_CHECKSUM_REV]) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): EEPROM inverse checksum "
+ "bad (wanted 0x%02X, got 0x%02X)\n", lanai->number,
+ s, e[EEPROM_CHECKSUM_REV]);
+ return -EIO;
+ }
+ /* Verify MAC address */
+ for (i = 0; i < 6; i++)
+ if ((e[EEPROM_MAC + i] ^ e[EEPROM_MAC_REV + i]) != 0xFF) {
+ printk(KERN_ERR DEV_LABEL
+ "(itf %d) : EEPROM MAC addresses don't match "
+ "(0x%02X, inverse 0x%02X)\n", lanai->number,
+ e[EEPROM_MAC + i], e[EEPROM_MAC_REV + i]);
+ return -EIO;
+ }
+ DPRINTK("eeprom: MAC address = %02X:%02X:%02X:%02X:%02X:%02X\n",
+ e[EEPROM_MAC + 0], e[EEPROM_MAC + 1], e[EEPROM_MAC + 2],
+ e[EEPROM_MAC + 3], e[EEPROM_MAC + 4], e[EEPROM_MAC + 5]);
+ /* Verify serial number */
+ lanai->serialno = eeprom_be4(lanai, EEPROM_SERIAL);
+ v = eeprom_be4(lanai, EEPROM_SERIAL_REV);
+ if ((lanai->serialno ^ v) != 0xFFFFFFFF) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): EEPROM serial numbers "
+ "don't match (0x%08X, inverse 0x%08X)\n", lanai->number,
+ lanai->serialno, v);
+ return -EIO;
+ }
+ DPRINTK("eeprom: Serial number = %d\n", lanai->serialno);
+ /* Verify magic number */
+ lanai->magicno = eeprom_be4(lanai, EEPROM_MAGIC);
+ v = eeprom_be4(lanai, EEPROM_MAGIC_REV);
+ if ((lanai->magicno ^ v) != 0xFFFFFFFF) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): EEPROM magic numbers "
+ "don't match (0x%08X, inverse 0x%08X)\n", lanai->number,
+ lanai->magicno, v);
+ return -EIO;
+ }
+ DPRINTK("eeprom: Magic number = 0x%08X\n", lanai->magicno);
+ if (lanai->magicno != EEPROM_MAGIC_VALUE)
+ printk(KERN_WARNING DEV_LABEL "(itf %d): warning - EEPROM "
+ "magic not what expected (got 0x%08X, not 0x%08X)\n",
+ lanai->number, lanai->magicno, EEPROM_MAGIC_VALUE);


+ return 0;
+}
+

+#endif /* READ_EEPROM */
+
+static inline const u8 *eeprom_mac(const struct lanai_dev *lanai)
+{
+ return &lanai->eeprom[EEPROM_MAC];
+}
+
+/* -------------------- INTERRUPT HANDLING UTILITIES: */
+
+/* Interrupt types */
+#define INT_STATS (0x00000002) /* Statistics counter overflow */
+#define INT_SOOL (0x00000004) /* SOOL changed state */
+#define INT_LOCD (0x00000008) /* LOCD changed state */
+#define INT_LED (0x00000010) /* LED (HAPPI) changed state */
+#define INT_GPIN (0x00000020) /* GPIN changed state */
+#define INT_PING (0x00000040) /* PING_COUNT fulfilled */
+#define INT_WAKE (0x00000080) /* Lanai wants bus */
+#define INT_CBR0 (0x00000100) /* CBR sched hit VCI 0 */
+#define INT_LOCK (0x00000200) /* Service list overflow */
+#define INT_MISMATCH (0x00000400) /* TX magic list mismatch */
+#define INT_AAL0_STR (0x00000800) /* Non-AAL5 buffer half filled */
+#define INT_AAL0 (0x00001000) /* Non-AAL5 data available */
+#define INT_SERVICE (0x00002000) /* Service list entries available */
+#define INT_TABORTSENT (0x00004000) /* Target abort sent by lanai */
+#define INT_TABORTBM (0x00008000) /* Abort rcv'd as bus master */
+#define INT_TIMEOUTBM (0x00010000) /* No response to bus master */
+#define INT_PCIPARITY (0x00020000) /* Parity error on PCI */
+
+/* Sets of the above */
+#define INT_ALL (0x0003FFFE) /* All interrupts */
+#define INT_STATUS (0x0000003C) /* Some status pin changed */
+#define INT_DMASHUT (0x00038000) /* DMA engine got shut down */
+#define INT_SEGSHUT (0x00000700) /* Segmentation got shut down */
+
+static inline u32 intr_pending(const struct lanai_dev *lanai)
+{
+ return reg_read(lanai, IntStatusMasked_Reg);
+}
+
+static inline void intr_enable(const struct lanai_dev *lanai, u32 i)
+{
+ reg_write(lanai, i, IntControlEna_Reg);
+}
+
+static inline void intr_disable(const struct lanai_dev *lanai, u32 i)
+{
+ reg_write(lanai, i, IntControlDis_Reg);
+}
+
+/* -------------------- CARD/PCI STATUS: */
+
+static void status_message(int itf, const char *name, int status)
+{
+ static const char *onoff[2] = { "off to on", "on to off" };
+ printk(KERN_INFO DEV_LABEL "(itf %d): %s changed from %s\n",
+ itf, name, onoff[!status]);
+}
+
+static void lanai_check_status(struct lanai_dev *lanai)
+{
+ u32 new = reg_read(lanai, Status_Reg);
+ u32 changes = new ^ lanai->status;
+ lanai->status = new;
+#define e(flag, name) \
+ if (changes & flag) \
+ status_message(lanai->number, name, new & flag)
+ e(STATUS_SOOL, "SOOL");
+ e(STATUS_LOCD, "LOCD");
+ e(STATUS_LED, "LED");
+ e(STATUS_GPIN, "GPIN");
+#undef e
+}
+
+static void pcistatus_got(int itf, const char *name)
+{
+ printk(KERN_INFO DEV_LABEL "(itf %d): PCI got %s error\n", itf, name);
+}
+
+static void pcistatus_check(struct lanai_dev *lanai, int clearonly)
+{
+ u16 s;
+ int result;
+ result = pci_read_config_word(lanai->pci, PCI_STATUS, &s);
+ if (result != PCIBIOS_SUCCESSFUL) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): can't read PCI_STATUS: "
+ "%d\n", lanai->number, result);
+ return;
+ }
+ s &= PCI_STATUS_DETECTED_PARITY | PCI_STATUS_SIG_SYSTEM_ERROR |
+ PCI_STATUS_REC_MASTER_ABORT | PCI_STATUS_REC_TARGET_ABORT |
+ PCI_STATUS_SIG_TARGET_ABORT | PCI_STATUS_PARITY;
+ if (s == 0)
+ return;
+ result = pci_write_config_word(lanai->pci, PCI_STATUS, s);
+ if (result != PCIBIOS_SUCCESSFUL)
+ printk(KERN_ERR DEV_LABEL "(itf %d): can't write PCI_STATUS: "
+ "%d\n", lanai->number, result);
+ if (clearonly)
+ return;
+#define e(flag, name, stat) \
+ if (s & flag) { \
+ pcistatus_got(lanai->number, name); \
+ ++lanai->stats.pcierr_##stat; \
+ }
+ e(PCI_STATUS_DETECTED_PARITY, "parity", parity_detect);
+ e(PCI_STATUS_SIG_SYSTEM_ERROR, "signalled system", serr_set);
+ e(PCI_STATUS_REC_MASTER_ABORT, "master", master_abort);
+ e(PCI_STATUS_REC_TARGET_ABORT, "master target", m_target_abort);
+ e(PCI_STATUS_SIG_TARGET_ABORT, "slave", s_target_abort);
+ e(PCI_STATUS_PARITY, "master parity", master_parity);
+#undef e
+}
+
+/* -------------------- VCC TX BUFFER UTILITIES: */
+
+/* space left in tx buffer in bytes */
+static inline int vcc_tx_space(const struct lanai_vcc *lvcc, int endptr)
+{
+ int r;
+ r = endptr * 16;
+ r -= ((unsigned long) lvcc->tx.buf.ptr) -
+ ((unsigned long) lvcc->tx.buf.start);
+ r -= 16; /* Leave "bubble" - if start==end it looks empty */
+ if (r < 0)
+ r += lanai_buf_size(&lvcc->tx.buf);
+ return r;
+}
+
+/* Bit fields in the segmentation buffer descriptor */
+#define DESCRIPTOR_MAGIC (0xD0000000)
+#define DESCRIPTOR_AAL5 (0x00008000)
+#define DESCRIPTOR_AAL5_STREAM (0x00004000)
+#define DESCRIPTOR_CLP (0x00002000)
+
+/* Add 32-bit descriptor with it's padding */
+static inline void vcc_tx_add_aal5_descriptor(struct lanai_vcc *lvcc,
+ u32 flags, int len)
+{
+ int pos;
+ APRINTK((((unsigned long) lvcc->tx.buf.ptr) & 15) == 0,
+ "vcc_tx_add_aal5_descriptor: bad ptr=%p\n", lvcc->tx.buf.ptr);
+ lvcc->tx.buf.ptr += 4; /* Hope the values REALLY don't matter */
+ pos = ((unsigned char *) lvcc->tx.buf.ptr) -
+ (unsigned char *) lvcc->tx.buf.start;
+ APRINTK((pos & ~0x0001FFF0) == 0,
+ "vcc_tx_add_aal5_descriptor: bad pos (%d) before, vci=%d, "
+ "start,ptr,end=%p,%p,%p\n", pos, lvcc->vci,
+ lvcc->tx.buf.start, lvcc->tx.buf.ptr, lvcc->tx.buf.end);
+ pos = (pos + len) & (lanai_buf_size(&lvcc->tx.buf) - 1);
+ APRINTK((pos & ~0x0001FFF0) == 0,
+ "vcc_tx_add_aal5_descriptor: bad pos (%d) after, vci=%d, "
+ "start,ptr,end=%p,%p,%p\n", pos, lvcc->vci,
+ lvcc->tx.buf.start, lvcc->tx.buf.ptr, lvcc->tx.buf.end);
+ lvcc->tx.buf.ptr[-1] =
+ cpu_to_le32(DESCRIPTOR_MAGIC | DESCRIPTOR_AAL5 |
+ ((lvcc->tx.atmvcc->atm_options & ATM_ATMOPT_CLP) ?
+ DESCRIPTOR_CLP : 0) | flags | pos >> 4);
+ if (lvcc->tx.buf.ptr >= lvcc->tx.buf.end)
+ lvcc->tx.buf.ptr = lvcc->tx.buf.start;
+}
+
+/* Add 32-bit AAL5 trailer and leave room for its CRC */
+static inline void vcc_tx_add_aal5trailer(struct lanai_vcc *lvcc,
+ int len, int cpi, int uu)
+{
+ APRINTK((((unsigned long) lvcc->tx.buf.ptr) & 15) == 8,
+ "vcc_tx_add_aal5_descriptor: bad ptr=%p\n", lvcc->tx.buf.ptr);
+ lvcc->tx.buf.ptr += 2;
+ lvcc->tx.buf.ptr[-2] = cpu_to_be32((uu << 24) | (cpi << 16) | len);
+ if (lvcc->tx.buf.ptr >= lvcc->tx.buf.end)
+ lvcc->tx.buf.ptr = lvcc->tx.buf.start;
+}
+
+static inline void vcc_tx_memcpy(struct lanai_vcc *lvcc,
+ const unsigned char *src, int n)
+{
+ unsigned char *e;
+ int m;
+ e = ((unsigned char *) lvcc->tx.buf.ptr) + n;
+ m = e - (unsigned char *) lvcc->tx.buf.end;
+ if (m < 0)
+ m = 0;
+ memcpy(lvcc->tx.buf.ptr, src, n - m);
+ if (m != 0) {
+ memcpy(lvcc->tx.buf.start, src + n - m, m);
+ e = ((unsigned char *) lvcc->tx.buf.start) + m;
+ }
+ lvcc->tx.buf.ptr = (u32 *) e;
+}
+
+static inline void vcc_tx_memzero(struct lanai_vcc *lvcc, int n)
+{
+ unsigned char *e;
+ int m;
+ if (n == 0)
+ return;
+ e = ((unsigned char *) lvcc->tx.buf.ptr) + n;
+ m = e - (unsigned char *) lvcc->tx.buf.end;
+ if (m < 0)
+ m = 0;
+ memset(lvcc->tx.buf.ptr, 0, n - m);
+ if (m != 0) {
+ memset(lvcc->tx.buf.start, 0, m);
+ e = ((unsigned char *) lvcc->tx.buf.start) + m;
+ }
+ lvcc->tx.buf.ptr = (u32 *) e;
+}
+
+/* Update "butt" register to specify new WritePtr */
+static inline void lanai_endtx(const struct lanai_dev *lanai,
+ const struct lanai_vcc *lvcc)
+{
+ int i, ptr = ((unsigned char *) lvcc->tx.buf.ptr) -
+ (unsigned char *) lvcc->tx.buf.start;
+ APRINTK((ptr & ~0x0001FFF0) == 0,
+ "lanai_endtx: bad ptr (%d), vci=%d, start,ptr,end=%p,%p,%p\n",
+ ptr, lvcc->vci, lvcc->tx.buf.start, lvcc->tx.buf.ptr,
+ lvcc->tx.buf.end);
+ /*
+ * We need to check if the "butt busy" bit is set before
+ * updating the butt register. In theory this should
+ * never happen because the ATM card is plenty fast at
+ * updating the register. Still, we should make sure
+ */
+ for (i = 0; reg_read(lanai, Status_Reg) & STATUS_BUTTBUSY; i++) {
+ if (i > 50) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): butt register "
+ "always busy!\n", lanai->number);
+ break;
+ }
+ udelay(5);
+ }
+ reg_write(lanai, (ptr << 12) | lvcc->vci, Butt_Reg);
+}
+
+/* Try to fill the buffer - don't call unless there is backlog */
+static void vcc_tx_unqueue_aal5(struct lanai_dev *lanai,
+ struct lanai_vcc *lvcc, int endptr)
+{
+ int pad, n;
+ struct sk_buff *skb;
+ int space = vcc_tx_space(lvcc, endptr);
+ APRINTK(vcc_is_backlogged(lvcc),
+ "vcc_tx_unqueue() called with empty backlog (vci=%d)\n",
+ lvcc->vci);
+ if (space < 64)
+ return; /* No space for even 1 cell+descriptor */
+ if (lvcc->tx.inprogress != NULL) {
+ APRINTK((lvcc->tx.inprogleft % 48) == 0,
+ "vcc_tx_unqueue_aal5: bad progleft=%d\n",
+ lvcc->tx.inprogleft);
+ if (lvcc->tx.inprogleft + 16 > space) { /* Can't send all? */
+ n = aal5_spacefor(space - 16); /* Bytes to send */
+ vcc_tx_add_aal5_descriptor(lvcc,
+ DESCRIPTOR_AAL5_STREAM, n);
+ pad = lvcc->tx.pptr + n - lvcc->tx.inprogress->tail;
+ if (pad < 0)
+ pad = 0;
+ vcc_tx_memcpy(lvcc, lvcc->tx.pptr, n - pad);
+ vcc_tx_memzero(lvcc, pad);
+ lvcc->tx.pptr += n;
+ lvcc->tx.inprogleft -= n;
+ goto end; /* Buffer is now full */
+ }
+ /* OK, there's at least space for all of "inprogress" skb */
+ vcc_tx_add_aal5_descriptor(lvcc, 0,
+ lvcc->tx.inprogleft);
+ pad = lvcc->tx.pptr + lvcc->tx.inprogleft -
+ lvcc->tx.inprogress->tail;
+ if (pad >= lvcc->tx.inprogleft) { /* Nothing but pad left */
+ APRINTK(lvcc->tx.inprogleft == 48,
+ "vcc_tx_unqueue_aal5: bad pure-pad=%d\n",
+ lvcc->tx.inprogleft);
+ pad = 48;
+ } else
+ vcc_tx_memcpy(lvcc, lvcc->tx.pptr,
+ lvcc->tx.inprogleft - pad);
+ vcc_tx_memzero(lvcc, pad - 8);
+ vcc_tx_add_aal5trailer(lvcc, lvcc->tx.inprogress->len, 0, 0);
+ lanai_free_skb(lvcc->tx.atmvcc, lvcc->tx.inprogress);
+ lvcc->tx.inprogress = NULL;
+ space -= lvcc->tx.inprogleft + 16;
+ atomic_inc(&lvcc->tx.atmvcc->stats->tx);
+ }
+ while (space >= 64) {
+ if ((skb = skb_dequeue(&lvcc->tx.backlog)) == NULL)
+ break;
+ n = aal5_size(skb->len);
+ if (n + 16 > space) { /* Can only send part */
+ int m = aal5_spacefor(space - 16); /* Bytes to send */
+ vcc_tx_add_aal5_descriptor(lvcc,


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 25'
echo 'File patch-2.4.14 is continued in part 26'
echo "26" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:30 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part07

#!/bin/sh -x
# this is part 07 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 07; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+++ linux/arch/arm/mach-sa1100/leds-simpad.c Thu Oct 25 13:53:46 2001
@@ -22,13 +22,16 @@
X #define LED_GREEN (1)
X #define LED_MASK (1)
X
+extern void set_cs3_bit(int value);
+extern void clear_cs3_bit(int value);
+
X void simpad_leds_event(led_event_t evt)


X {
X unsigned long flags;

X
X //local_irq_save(flags);
X
- switch (evt)
+ switch (evt)
X {
X case led_start:
X hw_led_state = LED_GREEN;
@@ -94,8 +97,9 @@


X }
X
X if (led_state & LED_STATE_ENABLED)

- cs3_shadow |= LED2_ON;
-
+ set_cs3_bit(LED2_ON);
+ else
+ clear_cs3_bit(LED2_ON);
X //local_irq_restore(flags);
X }
X
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/leds.c linux/arch/arm/mach-sa1100/leds.c
--- v2.4.13/linux/arch/arm/mach-sa1100/leds.c Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/mach-sa1100/leds.c Thu Oct 25 13:53:46 2001
@@ -32,6 +32,8 @@
X leds_event = pfs168_leds_event;
X if (machine_is_graphicsmaster())
X leds_event = graphicsmaster_leds_event;
+ if (machine_is_adsbitsy())
+ leds_event = adsbitsy_leds_event;
X
X leds_event(led_start);
X return 0;
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/leds.h linux/arch/arm/mach-sa1100/leds.h
--- v2.4.13/linux/arch/arm/mach-sa1100/leds.h Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/mach-sa1100/leds.h Thu Oct 25 13:53:46 2001
@@ -6,3 +6,4 @@
X extern void lart_leds_event(led_event_t evt);
X extern void pfs168_leds_event(led_event_t evt);
X extern void graphicsmaster_leds_event(led_event_t evt);
+extern void adsbitsy_leds_event(led_event_t evt);
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/neponset.c linux/arch/arm/mach-sa1100/neponset.c
--- v2.4.13/linux/arch/arm/mach-sa1100/neponset.c Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/mach-sa1100/neponset.c Thu Oct 25 13:53:46 2001
@@ -7,6 +7,7 @@
X #include <linux/sched.h>
X #include <linux/interrupt.h>
X #include <linux/ptrace.h>


+#include <linux/serial_core.h>
X
X #include <asm/hardware.h>

X #include <asm/irq.h>
@@ -14,7 +15,7 @@
X #include <asm/mach/irq.h>
X #include <asm/arch/irq.h>


X #include <asm/mach/serial_sa1100.h>
-#include <linux/serial_core.h>
+#include <asm/arch/assabet.h>
X

X #include "sa1111.h"
X
@@ -68,8 +69,8 @@
X irq = NEPONSET_USAR_IRQ;
X irq_desc[irq].valid = 1;
X irq_desc[irq].probe_ok = 1;
- set_GPIO_IRQ_edge( GPIO_NEP_IRQ, GPIO_RISING_EDGE );
- setup_arm_irq( IRQ_GPIO_NEP_IRQ, &neponset_irq );
+ set_GPIO_IRQ_edge(ASSABET_GPIO_NEP_IRQ, GPIO_RISING_EDGE);
+ setup_arm_irq(ASSABET_IRQ_GPIO_NEP_IRQ, &neponset_irq);
X }
X
X static int __init neponset_init(void)
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/pm.c linux/arch/arm/mach-sa1100/pm.c
--- v2.4.13/linux/arch/arm/mach-sa1100/pm.c Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/mach-sa1100/pm.c Thu Oct 25 13:53:46 2001
@@ -0,0 +1,183 @@
+/*
+ * SA1100 Power Management Routines
+ *
+ * Copyright (c) 2001 Cliff Brake <cbr...@accelent.com>


+ *
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License.
+ *
+ * History:
+ *
+ * 2001-02-06: Cliff Brake Initial code
+ *
+ * 2001-02-25: Sukjae Cho <sj...@east.isi.edu> &
+ * Chester Kuo <che...@linux.org.tw>
+ * Save more value for the resume function! Support
+ * Bitsy/Assabet/Freebird board
+ *
+ * 2001-08-29: Nicolas Pitre <ni...@cam.org>
+ * Cleaned up, pushed platform dependent stuff
+ * in the platform specific files.
+ */
+
+/*
+ * Debug macros
+ */
+#define DEBUG 1
+#ifdef DEBUG
+# define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
+#else
+# define DPRINTK(fmt, args...)
+#endif
+
+
+#include <linux/init.h>
+#include <linux/pm.h>
+#include <linux/slab.h>
+#include <linux/sysctl.h>
+#include <linux/acpi.h>
+
+#include <asm/hardware.h>
+#include <asm/memory.h>
+#include <asm/system.h>
+
+#include "sleep.h"
+
+extern void sa1100_cpu_suspend(void);
+extern void sa1100_cpu_resume(void);
+
+extern unsigned long *sleep_save; /* virtual address */
+extern unsigned long sleep_save_p; /* physical address */
+
+#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
+#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
+
+int pm_do_suspend(void)
+{
+ int retval;
+
+ /* set up pointer to sleep parameters */
+ sleep_save = kmalloc (SLEEP_SAVE_SIZE*sizeof(long), GFP_ATOMIC);
+ if (!sleep_save)
+ return -ENOMEM;
+ sleep_save_p = virt_to_phys(sleep_save);
+
+ retval = pm_send_all(PM_SUSPEND, (void *)2);
+ if (retval) {
+ kfree(sleep_save);
+ return retval;
+ }
+
+ cli();
+
+ /* preserve current time */
+ RCNR = xtime.tv_sec;
+
+ /* save vital registers */
+ SAVE(OSCR);
+ SAVE(OSMR0);
+ SAVE(OSMR1);
+ SAVE(OSMR2);
+ SAVE(OSMR3);
+ SAVE(OIER);
+
+ SAVE(GPDR);
+ SAVE(GRER);
+ SAVE(GFER);
+ SAVE(GAFR);
+
+ SAVE(PPDR);
+ SAVE(PPSR);
+ SAVE(PPAR);
+ SAVE(PSDR);
+
+ SAVE(Ser1SDCR0);
+
+ SAVE(ICMR);
+
+ /* ... maybe a global variable initialized by arch code to set this? */
+ GRER = PWER;
+ GFER = 0;
+ GEDR = GEDR;
+
+ /* Clear previous reset status */


+ RCSR = RCSR_HWR | RCSR_SWR | RCSR_WDR | RCSR_SMR;

+
+ /* set resume return address */
+ PSPR = virt_to_phys(sa1100_cpu_resume);
+
+ /* go zzz */
+ sa1100_cpu_suspend();
+
+ /* ensure not to come back here if it wasn't intended */
+ PSPR = 0;
+
+ DPRINTK("*** made it back from resume\n");
+
+ /* restore registers */
+ RESTORE(GPDR);
+ RESTORE(GRER);
+ RESTORE(GFER);
+ RESTORE(GAFR);
+
+ /* clear any edge detect bit */
+ GEDR = GEDR;
+
+ RESTORE(PPDR);
+ RESTORE(PPSR);
+ RESTORE(PPAR);
+ RESTORE(PSDR);
+
+ RESTORE(Ser1SDCR0);
+
+ PSSR = PSSR_PH;
+
+ RESTORE(OSMR0);
+ RESTORE(OSMR1);
+ RESTORE(OSMR2);
+ RESTORE(OSMR3);
+ RESTORE(OSCR);
+ RESTORE(OIER);
+
+ ICLR = 0;
+ ICCR = 1;
+ RESTORE(ICMR);
+
+ /* restore current time */
+ xtime.tv_sec = RCNR;
+
+ sti();
+
+ kfree (sleep_save);
+
+ retval = pm_send_all(PM_RESUME, (void *)0);
+ if (retval)
+ return retval;


+
+ return 0;
+}
+
+

+static struct ctl_table pm_table[] =
+{
+ {ACPI_S1_SLP_TYP, "suspend", NULL, 0, 0600, NULL, (proc_handler *)&pm_do_suspend},
+ {0}
+};
+
+static struct ctl_table pm_dir_table[] =
+{
+ {CTL_ACPI, "pm", NULL, 0, 0555, pm_table},
+ {0}
+};
+
+/*
+ * Initialize power interface
+ */
+static int __init pm_init(void)
+{
+ register_sysctl_table(pm_dir_table, 1);


+ return 0;
+}
+

+__initcall(pm_init);
+
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/simpad.c linux/arch/arm/mach-sa1100/simpad.c
--- v2.4.13/linux/arch/arm/mach-sa1100/simpad.c Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/mach-sa1100/simpad.c Thu Oct 25 13:53:46 2001
@@ -8,6 +8,8 @@
X #include <linux/init.h>
X #include <linux/kernel.h>
X #include <linux/tty.h>
+#include <linux/proc_fs.h>
+#include <linux/string.h>

X
X #include <asm/hardware.h>
X #include <asm/setup.h>

@@ -15,32 +17,46 @@


X #include <asm/mach/arch.h>
X #include <asm/mach/map.h>
X #include <asm/mach/serial_sa1100.h>
+#include <linux/serial_core.h>
X

X #include "generic.h"
X
-void init_simpad_cs3()
+long cs3_shadow;
+
+static int __init simpad_init(void)
+{
+ PSPR = 0xc0008000;
+ GPDR &= ~GPIO_GPIO0;
+ cs3_shadow = (EN1 | EN0 | LED2_ON | DISPLAY_ON | RS232_ON |
+ ENABLE_5V | RESET_SIMCARD);
+ *(CS3BUSTYPE *)(CS3_BASE) = cs3_shadow;


+ return 0;
+}
+

+__initcall(simpad_init);
+
+long get_cs3_shadow()
X {
- cs3_shadow =(DISPLAY_ON | RS232_ON | PCMCIA_BUFF_DIS | RESET_SIMCARD);
- printk("\nCall CS3 init:%x\n",cs3_shadow);
- *(CS3BUSTYPE *)(CS3_BASE) = cs3_shadow;
- cs3_shadow =(DISPLAY_ON| RS232_ON |RESET_SIMCARD);
+ return cs3_shadow;
X }
X
-void PCMCIA_setbit(int value)
+void set_cs3_bit(int value)
X {
- cs3_shadow |= value;
+ cs3_shadow |= value;
+ *(CS3BUSTYPE *)(CS3_BASE) = cs3_shadow;
X }
X
-void PCMCIA_clearbit(int value)
+void clear_cs3_bit(int value)
X {
- cs3_shadow &= ~value;
+ cs3_shadow &= ~value;
+ *(CS3BUSTYPE *)(CS3_BASE) = cs3_shadow;
X }
X
X static void __init
X fixup_simpad(struct machine_desc *desc, struct param_struct *params,


X char **cmdline, struct meminfo *mi)
X {

-#ifdef CONFIG_SA1100_SIMPAD_64MB
+#ifdef CONFIG_SA1100_SIMPAD_DRAM_64MB /* DRAM */
X SET_BANK( 0, 0xc0000000, 64*1024*1024 );
X #else


X SET_BANK( 0, 0xc0000000, 32*1024*1024 );

@@ -48,27 +64,109 @@


X mi->nr_banks = 1;

X ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
X setup_ramdisk( 1, 0, 0, 8192 );
- setup_initrd( __phys_to_virt(0xc0800000), 8*1024*1024 );
+ setup_initrd( __phys_to_virt(0xc0800000), 4*1024*1024 );
X }
X
X
X static struct map_desc simpad_io_desc[] __initdata = {


- /* virtual physical length domain r w c b */

- { 0xe8000000, 0x00000000, 0x02000000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash bank 0, neccessary for mtd */
- { 0xf2800000, 0x4b800000, 0x00800000, DOMAIN_IO, 1, 1, 0, 0 }, /* MQ200 */


+ /* virtual physical length domain r w c b */
+ { 0xe8000000, 0x00000000, 0x02000000, DOMAIN_IO, 1, 1, 0, 0 },

+ { 0xf2800000, 0x4b800000, 0x00800000, DOMAIN_IO, 1, 1, 0, 0 }, /* MQ200 */
X { 0xf1000000, 0x18000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* Paules CS3, write only */
X LAST_DESC
X };
X
+
+static void simpad_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
+{
+ if (port->mapbase == (u_int)&Ser1UTCR0) {
+ if (state)
+ clear_cs3_bit(RS232_ON);
+ else
+ set_cs3_bit(RS232_ON);
+ }
+}
+
+static struct sa1100_port_fns simpad_port_fns __initdata = {
+ pm: simpad_uart_pm,
+};
+
X static void __init simpad_map_io(void)
X {
X sa1100_map_io();
X iotable_init(simpad_io_desc);
X
+#ifndef CONFIG_SERIAL_SA1100_OLD
+ //It is only possible to register 3 UART in serial_sa1100.c
X sa1100_register_uart(0, 3);
- sa1100_register_uart(1, 1);
+ sa1100_register_uart(1, 1);
+#endif
+}
+
+#ifdef CONFIG_PROC_FS
+
+static char* name[]={
+ "VCC_5V_EN",
+ "VCC_3V_EN",
+ "EN1",
+ "EN0",
+ "DISPLAY_ON",
+ "PCMCIA_BUFF_DIS",
+ "MQ_RESET",
+ "PCMCIA_RESET",
+ "DECT_POWER_ON",
+ "IRDA_SD",
+ "RS232_ON",
+ "SD_MEDIAQ",
+ "LED2_ON",
+ "IRDA_MODE",
+ "ENABLE_5V",
+ "RESET_SIMCARD"
+};
+
+static int proc_cs3_read(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ char *p = page;
+ int len, i;
+
+ p += sprintf(p, "Chipselect3 : %x\n", cs3_shadow);
+ for (i = 0; i <= 15; i++) {
+ if(cs3_shadow & (1<<i)) {
+ p += sprintf(p, "%s\t: TRUE \n",name[i]);
+ } else
+ p += sprintf(p, "%s\t: FALSE \n",name[i]);
+ }
+ len = (p - page) - off;
+ if (len < 0)
+ len = 0;
+
+ *eof = (len <= count) ? 1 : 0;
+ *start = page + off;
+
+ return len;
X }
+
+
+static struct proc_dir_entry *proc_cs3;
+
+static int __init cs3_init(void)
+{
+ proc_cs3 = create_proc_entry("cs3", 0, 0);
+ if (proc_cs3)
+ proc_cs3->read_proc = proc_cs3_read;


+ return 0;
+}
+

+static int __exit cs3_exit(void)
+{
+ if (proc_cs3)
+ remove_proc_entry( "cs3", 0);
+ return 0;
+}
+__initcall(cs3_init);
X
+#endif // CONFIG_PROC_FS
X
X MACHINE_START(SIMPAD, "Simpad")
X MAINTAINER("Juergen Messerer")
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/sleep.S linux/arch/arm/mach-sa1100/sleep.S
--- v2.4.13/linux/arch/arm/mach-sa1100/sleep.S Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/mach-sa1100/sleep.S Thu Oct 25 13:53:46 2001
@@ -0,0 +1,238 @@
+/*
+ * SA11x0 Assembler Sleep/WakeUp Management Routines
+ *
+ * Copyright (c) 2001 Cliff Brake <cbr...@accelent.com>


+ *
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License.
+ *
+ * History:
+ *
+ * 2001-02-06: Cliff Brake Initial code
+ *
+ * 2001-08-29: Nicolas Pitre Simplified.
+ */
+
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+#include <asm/hardware.h>
+#include "sleep.h"
+
+/*
+ * sa1100_cpu_suspend()
+ *
+ * Causes sa11x0 to enter sleep state


+ *
+ */
+

+ .text
+
+ENTRY(sleep_save) .word 0 @ virtual address of parameter array
+ENTRY(sleep_save_p) .word 0 @ physical address of parameter array
+
+ENTRY(sa1100_cpu_suspend)
+
+ @ save registers on stack
+ stmfd sp!, {r4 - r12, lr}
+
+ @ load virtual address for sleep_save array
+ ldr r4, sleep_save
+
+ @ save stack pointer
+ str sp, [r4, #(SLEEP_SAVE_SP*4)]
+
+ @ save coprocessor registers
+ mrc p15, 0, r1, c1, c0, 0
+ str r1, [r4, #(SLEEP_SAVE_CP15_R1*4)]
+ mrc p15, 0, r1, c2, c0, 0
+ str r1, [r4, #(SLEEP_SAVE_CP15_R2*4)]
+ mrc p15, 0, r1, c3, c0, 0
+ str r1, [r4, #(SLEEP_SAVE_CP15_R3*4)]
+ mrc p15, 0, r1, c5, c0, 0
+ str r1, [r4, #(SLEEP_SAVE_CP15_R5*4)]
+ mrc p15, 0, r1, c6, c0, 0
+ str r1, [r4, #(SLEEP_SAVE_CP15_R6*4)]
+ mrc p15, 0, r1, c13, c0, 0
+ str r1, [r4, #(SLEEP_SAVE_CP15_R13*4)]
+
+ @ clean data cache and invalidate WB
+ bl cpu_sa1100_cache_clean_invalidate_all
+
+ @ disable clock switching
+ mcr p15, 0, r1, c15, c2, 2
+
+ @ Adjust memory timing before lowering CPU clock
+ @ Clock speed adjustment without changing memory timing makes
+ @ CPU hang in some cases
+ ldr r0, =MDREFR
+ ldr r1, [r0]
+ orr r1, r1, #MDREFR_K1DB2
+ str r1, [r0]
+
+ @ delay 90us and set CPU PLL to lowest speed
+ @ fixes resume problem on high speed SA1110
+ mov r0, #90
+ bl SYMBOL_NAME(udelay)
+ ldr r0, =PPCR
+ mov r1, #0
+ str r1, [r0]
+ mov r0, #90
+ bl SYMBOL_NAME(udelay)
+
+
+/* setup up register contents for jump to page containing SA1110 SDRAM controller bug fix suspend code
+ *
+ * r0 points to MSC0 register
+ * r1 points to MSC1 register
+ * r2 points to MSC2 register
+ * r3 is MSC0 value
+ * r4 is MSC1 value
+ * r5 is MSC2 value
+ * r6 points to MDREFR register
+ * r7 is first MDREFR value
+ * r8 is second MDREFR value
+ * r9 is pointer to MDCNFG register
+ * r10 is MDCNFG value
+ * r11 is third MDREFR value
+ * r12 is pointer to PMCR register
+ * r13 is PMCR value (1)


+ *
+ */
+

+ ldr r0, =MSC0
+ ldr r1, =MSC1
+ ldr r2, =MSC2
+
+ ldr r3, [r0]
+ bic r3, r3, #FMsk(MSC_RT)
+ bic r3, r3, #FMsk(MSC_RT)<<16
+
+ ldr r4, [r1]
+ bic r4, r4, #FMsk(MSC_RT)
+ bic r4, r4, #FMsk(MSC_RT)<<16
+
+ ldr r5, [r2]
+ bic r5, r5, #FMsk(MSC_RT)
+ bic r5, r5, #FMsk(MSC_RT)<<16
+
+ ldr r6, =MDREFR
+
+ ldr r7, [r6]
+ bic r7, r7, #0x0000FF00
+ bic r7, r7, #0x000000F0
+ orr r8, r7, #MDREFR_SLFRSH
+
+ ldr r9, =MDCNFG
+ ldr r10, [r9]
+ bic r10, r10, #(MDCNFG_DE0+MDCNFG_DE1)
+ bic r10, r10, #(MDCNFG_DE2+MDCNFG_DE3)
+
+ bic r11, r8, #MDREFR_SLFRSH
+ bic r11, r11, #MDREFR_E1PIN
+
+ ldr r12, =PMCR
+
+ mov r13, #PMCR_SF
+
+ b sa1110_sdram_controller_fix
+
+ .align 5
+sa1110_sdram_controller_fix:
+
+ @ Step 1 clear RT field of all MSCx registers
+ str r3, [r0]
+ str r4, [r1]
+ str r5, [r2]
+
+ @ Step 2 clear DRI field in MDREFR
+ str r7, [r6]
+
+ @ Step 3 set SLFRSH bit in MDREFR
+ str r8, [r6]
+
+ @ Step 4 clear DE bis in MDCNFG
+ str r10, [r9]
+
+ @ Step 5 clear DRAM refresh control register
+ str r11, [r6]
+
+ @ Wow, now the hardware suspend request pins can be used, that makes them functional for
+ @ about 7 ns out of the entire time that the CPU is running!
+
+ @ Step 6 set force sleep bit in PMCR
+
+ str r13, [r12]
+
+20: b 20b @ loop waiting for sleep
+
+/*
+ * cpu_sa1100_resume()
+ *
+ * entry point from bootloader into kernel during resume


+ *
+ */
+

+ .align 5
+ENTRY(sa1100_cpu_resume)
+
+ @ set SVC, irqs off
+ mov r0, #I_BIT | MODE_SVC
+ msr cpsr_c, r0
+
+ @ load physical address of sleep_save
+ ldr r4, sleep_save_p
+
+ @ restore cp15_r3, domain id
+ ldr r1, [r4, #(SLEEP_SAVE_CP15_R3*4)]
+ mcr p15, 0, r1, c3, c0 ,0
+
+ @ restore cp15_r2, translation table base address
+ ldr r1, [r4, #(SLEEP_SAVE_CP15_R2*4)]
+ mcr p15, 0, r1, c2, c0 ,0
+
+ mov r1, #0
+ mcr p15, 0, r1, c8, c7, 0 @ flush I+D TLBs
+ mcr p15, 0, r1, c7, c7, 0 @ flush I&D cache
+
+ @ get saved cp15 r1 (control register)
+ ldr r1, [r4, #(SLEEP_SAVE_CP15_R1*4)]
+
+ @ get address to jump to after turning on MMU
+ ldr r2, =resume_after_mmu
+
+ cmp r2, #0
+
+ b resume_turn_on_mmu
+
+ .align 5
+resume_turn_on_mmu:
+
+ @ turn on mmu
+ mcr p15, 0, r1, c1, c0 ,0
+
+ @ jump to resume_after_mmu
+ mov pc, r2
+ nop
+ nop
+
+ .align 5
+resume_after_mmu:
+
+ @ load virtual address for sleep_save array
+ ldr r4, sleep_save
+
+ @ restore the rest of CPU state
+ ldr r1, [r4, #(SLEEP_SAVE_CP15_R13*4)]
+ mcr p15, 0, r1, c13, c0, 0
+ ldr r1, [r4, #(SLEEP_SAVE_CP15_R5*4)]
+ mcr p15, 0, r1, c5, c0 ,0
+ ldr r1, [r4, #(SLEEP_SAVE_CP15_R6*4)]
+ mcr p15, 0, r1, c6, c0 ,0
+
+ @ restore stack pointer
+ ldr sp, [r4, #(SLEEP_SAVE_SP*4)]
+
+ @ return to caller
+ ldmfd sp!, {r4 - r12, pc}
+
+
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-sa1100/sleep.h linux/arch/arm/mach-sa1100/sleep.h
--- v2.4.13/linux/arch/arm/mach-sa1100/sleep.h Wed Dec 31 16:00:00 1969
+++ linux/arch/arm/mach-sa1100/sleep.h Thu Oct 25 13:53:46 2001
@@ -0,0 +1,30 @@
+/*
+ * Offsets for register values preserved in RAM while in sleep mode
+ */
+
+#define SLEEP_SAVE_OSCR 0
+#define SLEEP_SAVE_OSMR0 1
+#define SLEEP_SAVE_OSMR1 2
+#define SLEEP_SAVE_OSMR2 3
+#define SLEEP_SAVE_OSMR3 4
+#define SLEEP_SAVE_OIER 5
+#define SLEEP_SAVE_GPDR 6
+#define SLEEP_SAVE_GRER 7
+#define SLEEP_SAVE_GFER 8
+#define SLEEP_SAVE_GAFR 9
+#define SLEEP_SAVE_PPDR 10
+#define SLEEP_SAVE_PPSR 11
+#define SLEEP_SAVE_PPAR 12
+#define SLEEP_SAVE_PSDR 13
+#define SLEEP_SAVE_Ser1SDCR0 14
+#define SLEEP_SAVE_ICMR 15
+#define SLEEP_SAVE_SP 16
+#define SLEEP_SAVE_CP15_R1 17
+#define SLEEP_SAVE_CP15_R2 18
+#define SLEEP_SAVE_CP15_R3 19
+#define SLEEP_SAVE_CP15_R5 20
+#define SLEEP_SAVE_CP15_R6 21
+#define SLEEP_SAVE_CP15_R13 22
+
+#define SLEEP_SAVE_SIZE 23
+
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-shark/dma.c linux/arch/arm/mach-shark/dma.c
--- v2.4.13/linux/arch/arm/mach-shark/dma.c Thu Apr 12 12:20:31 2001
+++ linux/arch/arm/mach-shark/dma.c Thu Oct 25 13:53:46 2001
@@ -1,7 +1,7 @@
X /*
X * linux/arch/arm/mach-shark/dma.c
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X *
X * derived from:
X * arch/arm/kernel/dma-ebsa285.c
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-shark/leds.c linux/arch/arm/mach-shark/leds.c
--- v2.4.13/linux/arch/arm/mach-shark/leds.c Thu Apr 12 12:20:31 2001
+++ linux/arch/arm/mach-shark/leds.c Thu Oct 25 13:53:46 2001
@@ -1,6 +1,6 @@
X /*
X * arch/arm/kernel/leds-shark.c
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X *
X * derived from:
X * arch/arm/kernel/leds-footbridge.c
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mach-shark/mm.c linux/arch/arm/mach-shark/mm.c
--- v2.4.13/linux/arch/arm/mach-shark/mm.c Thu Apr 12 12:20:31 2001
+++ linux/arch/arm/mach-shark/mm.c Thu Oct 25 13:53:46 2001
@@ -1,7 +1,7 @@
X /*
X * linux/arch/arm/mach-shark/mm.c
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X *
X * This program is free software; you can redistribute it and/or modify
X * it under the terms of the GNU General Public License version 2 as
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mm/fault-armv.c linux/arch/arm/mm/fault-armv.c
--- v2.4.13/linux/arch/arm/mm/fault-armv.c Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/mm/fault-armv.c Thu Oct 25 13:53:46 2001
@@ -514,7 +514,7 @@
X * Oops, we didn't handle the instruction.
X */
X printk(KERN_ERR "Alignment trap: not handling instruction "
- "%08lx at [<%08lx>]", instr, instrptr);
+ "%08lx at [<%08lx>]\n", instr, instrptr);
X ai_skipped += 1;
X return 1;
X
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mm/proc-arm920.S linux/arch/arm/mm/proc-arm920.S
--- v2.4.13/linux/arch/arm/mm/proc-arm920.S Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/mm/proc-arm920.S Thu Oct 25 13:53:46 2001
@@ -73,7 +73,7 @@
X sbc r1, r1, r1 @ r1 = C - 1
X and r3, r3, #255
X mov pc, lr
-
+
X /*
X * cpu_arm920_check_bugs()
X */
@@ -150,7 +150,7 @@
X mov r2, #1
X cpu_arm920_cache_clean_invalidate_all_r2:
X mov ip, #0
-#ifdef CONFIG_CPU_ARM920_FORCE_WRITE_THROUGH
+#ifdef CONFIG_CPU_ARM920_WRITETHROUGH
X mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
X #else
X /*
@@ -180,21 +180,33 @@
X * end: Area end address
X * flags: nonzero for I cache as well
X */
- .align 5
+ .align 5
X ENTRY(cpu_arm920_cache_clean_invalidate_range)
X bic r0, r0, #DCACHELINESIZE - 1 @ && added by PGM
+ bic r1, r1, #DCACHELINESIZE - 1 @ && added by DHM
X sub r3, r1, r0
X cmp r3, #MAX_AREA_SIZE
X bgt cpu_arm920_cache_clean_invalidate_all_r2
-1: mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
+1: teq r2, #0
+#ifdef CONFIG_CPU_ARM920_WRITETHROUGH
+ mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
+ mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
+ add r0, r0, #DCACHELINESIZE
+ mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
+ mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
+ add r0, r0, #DCACHELINESIZE
+#else
+ mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
+ mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
X add r0, r0, #DCACHELINESIZE
X mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
+ mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
X add r0, r0, #DCACHELINESIZE
+#endif
X cmp r0, r1
X blt 1b
- teq r2, #0
- movne r0, #0
- mcrne p15, 0, r0, c7, c5, 0 @ invalidate I cache
+
+ mcr p15, 0, r1, c7, c10, 4 @ drain WB
X mov pc, lr
X
X /*
@@ -207,10 +219,17 @@
X .align 5
X ENTRY(cpu_arm920_flush_ram_page)
X mov r1, #PAGESIZE
+#ifdef CONFIG_CPU_ARM920_WRITETHROUGH
+1: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
+ add r0, r0, #DCACHELINESIZE
+ mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
+ add r0, r0, #DCACHELINESIZE
+#else
X 1: mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
X add r0, r0, #DCACHELINESIZE
X mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
X add r0, r0, #DCACHELINESIZE
+#endif
X subs r1, r1, #2 * DCACHELINESIZE
X bne 1b
X mcr p15, 0, r1, c7, c10, 4 @ drain WB
@@ -231,11 +250,14 @@
X */
X .align 5
X ENTRY(cpu_arm920_dcache_invalidate_range)
+#ifndef CONFIG_CPU_ARM920_WRITETHROUGH
X tst r0, #DCACHELINESIZE - 1
- bic r0, r0, #DCACHELINESIZE - 1
X mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
X tst r1, #DCACHELINESIZE - 1
X mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
+#endif @ clean D entry
+ bic r0, r0, #DCACHELINESIZE - 1
+ bic r1, r1, #DCACHELINESIZE - 1
X 1: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
X add r0, r0, #DCACHELINESIZE
X cmp r0, r1
@@ -254,18 +276,21 @@
X */
X .align 5
X ENTRY(cpu_arm920_dcache_clean_range)
+#ifndef CONFIG_CPU_ARM920_WRITETHROUGH
X bic r0, r0, #DCACHELINESIZE - 1
X sub r1, r1, r0
X cmp r1, #MAX_AREA_SIZE
X mov r2, #0
X bgt cpu_arm920_cache_clean_invalidate_all_r2
X
+ bic r1, r1, #DCACHELINESIZE -1
+ add r1, r1, #DCACHELINESIZE
+
X 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
X add r0, r0, #DCACHELINESIZE
- mcr p15, 0, r0, c7, c10, 1 @ clean D entry
- add r0, r0, #DCACHELINESIZE
- subs r1, r1, #2 * DCACHELINESIZE
+ subs r1, r1, #DCACHELINESIZE
X bpl 1b
+#endif
X mcr p15, 0, r2, c7, c10, 4 @ drain WB
X mov pc, lr
X
@@ -284,7 +309,7 @@
X */
X .align 5
X ENTRY(cpu_arm920_dcache_clean_page)
-#ifndef CONFIG_CPU_ARM920_FORCE_WRITE_THROUGH
+#ifndef CONFIG_CPU_ARM920_WRITETHROUGH
X mov r1, #PAGESIZE
X 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
X add r0, r0, #DCACHELINESIZE
@@ -305,7 +330,7 @@
X */
X .align 5
X ENTRY(cpu_arm920_dcache_clean_entry)
-#ifndef CONFIG_CPU_ARM920_FORCE_WRITE_THROUGH
+#ifndef CONFIG_CPU_ARM920_WRITETHROUGH
X mcr p15, 0, r0, c7, c10, 1 @ clean D entry
X #endif
X mcr p15, 0, r0, c7, c10, 4 @ drain WB
@@ -318,22 +343,44 @@
X *
X * invalidate a range of virtual addresses from the Icache
X *
+ * This is a little misleading, it is not intended to clean out
+ * the i-cache but to make sure that any data written to the
+ * range is made consistant. This means that when we execute code
+ * in that region, everything works as we expect.
+ *
+ * This generally means writing back data in the Dcache and
+ * write buffer and flushing the Icache over that region
+ *
X * start: virtual start address
X * end: virtual end address
+ *
+ * NOTE: ICACHELINESIZE == DCACHELINESIZE (so we don't need to
+ * loop twice, once for i-cache, once for d-cache)
X */
X .align 5
X ENTRY(cpu_arm920_icache_invalidate_range)
-1: mcr p15, 0, r0, c7, c10, 1 @ Clean D entry
- add r0, r0, #DCACHELINESIZE
- cmp r0, r1
- blo 1b
+ bic r0, r0, #ICACHELINESIZE - 1 @ Safety check
+ sub r1, r1, r0
+ cmp r1, #MAX_AREA_SIZE
+ bgt cpu_arm920_cache_clean_invalidate_all_r2
+
+ bic r1, r1, #ICACHELINESIZE - 1
+ add r1, r1, #ICACHELINESIZE
+
+1: mcr p15, 0, r0, c7, c5, 1 @ Clean I entry
+ mcr p15, 0, r0, c7, c10, 1 @ Clean D entry
+ add r0, r0, #ICACHELINESIZE
+ subs r1, r1, #ICACHELINESIZE
+ bne 1b
+
X mov r0, #0
X mcr p15, 0, r0, c7, c10, 4 @ drain WB
+ mov pc, lr
+
X ENTRY(cpu_arm920_icache_invalidate_page)
X mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
X mov pc, lr
X
-
X /* ================================== TLB ================================= */
X
X /*
@@ -360,6 +407,12 @@
X ENTRY(cpu_arm920_tlb_invalidate_range)
X mov r3, #0
X mcr p15, 0, r3, c7, c10, 4 @ drain WB
+
+ mov r3, #PAGESIZE
+ sub r3, r3, #1
+ bic r0, r0, r3
+ bic r1, r1, r3
+
X 1: mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
X mcr p15, 0, r0, c8, c5, 1 @ invalidate I TLB entry
X add r0, r0, #PAGESIZE
@@ -396,7 +449,7 @@
X .align 5
X ENTRY(cpu_arm920_set_pgd)
X mov ip, #0
-#ifdef CONFIG_CPU_ARM920_FORCE_WRITE_THROUGH
+#ifdef CONFIG_CPU_ARM920_WRITETHROUGH
X /* Any reason why we don't use mcr p15, 0, r0, c7, c7, 0 here? --rmk */
X mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
X #else
@@ -429,7 +482,7 @@
X */
X .align 5
X ENTRY(cpu_arm920_set_pmd)
-#ifdef CONFIG_CPU_ARM920_FORCE_WRITE_THROUGH
+#ifdef CONFIG_CPU_ARM920_WRITETHROUGH
X eor r2, r1, #0x0a @ C & Section
X tst r2, #0x0b
X biceq r1, r1, #4 @ clear bufferable bit
@@ -463,8 +516,8 @@
X tst r1, #LPTE_PRESENT | LPTE_YOUNG @ Present and Young?
X movne r2, #0
X
-#ifdef CONFIG_CPU_ARM920_FORCE_WRITE_THROUGH
- eor r3, r1, #0x0a @ C & small page?
+#ifdef CONFIG_CPU_ARM920_WRITETHROUGH
+ eor r3, r2, #0x0a @ C & small page?
X tst r3, #0x0b
X biceq r2, r2, #4
X #endif
@@ -476,9 +529,9 @@
X
X
X cpu_manu_name:
- .asciz "ARM/VLSI"
+ .asciz "ARM/CIRRUS"
X ENTRY(cpu_arm920_name)
- .ascii "Arm920"
+ .ascii "Arm920T"
X #if defined(CONFIG_CPU_ARM920_CPU_IDLE)
X .ascii "s"
X #endif
@@ -487,7 +540,7 @@
X #endif
X #if defined(CONFIG_CPU_ARM920_D_CACHE_ON)
X .ascii "d"
-#if defined(CONFIG_CPU_ARM920_FORCE_WRITE_THROUGH)
+#if defined(CONFIG_CPU_ARM920_WRITETHROUGH)
X .ascii "(wt)"
X #else
X .ascii "(wb)"
diff -u --recursive --new-file v2.4.13/linux/arch/arm/mm/proc-sa110.S linux/arch/arm/mm/proc-sa110.S
--- v2.4.13/linux/arch/arm/mm/proc-sa110.S Mon Aug 27 12:41:38 2001
+++ linux/arch/arm/mm/proc-sa110.S Thu Oct 25 13:53:46 2001
@@ -271,7 +271,7 @@
X bic r0, r0, #DCACHELINESIZE - 1
X sub r3, r1, r0
X cmp r3, #MAX_AREA_SIZE
- bgt cpu_sa110_cache_clean_invalidate_all_r2
+ bhi cpu_sa110_cache_clean_invalidate_all_r2
X 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
X mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
X add r0, r0, #DCACHELINESIZE
@@ -279,7 +279,7 @@
X mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
X add r0, r0, #DCACHELINESIZE
X cmp r0, r1
- blt 1b
+ blo 1b
X teq r2, #0
X movne r0, #0
X mcrne p15, 0, r0, c7, c5, 0 @ invalidate I cache
@@ -288,7 +288,7 @@
X ENTRY(cpu_sa1100_cache_clean_invalidate_range)
X sub r3, r1, r0
X cmp r3, #MAX_AREA_SIZE
- bgt cpu_sa1100_cache_clean_invalidate_all_r2
+ bhi cpu_sa1100_cache_clean_invalidate_all_r2
X b 1b
X
X /*
@@ -335,7 +335,7 @@
X 1: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
X add r0, r0, #DCACHELINESIZE
X cmp r0, r1
- blt 1b
+ blo 1b
X mov pc, lr
X
X /*
@@ -354,7 +354,7 @@
X sub r1, r1, r0
X cmp r1, #MAX_AREA_SIZE
X mov r2, #0
- bgt cpu_sa110_cache_clean_invalidate_all_r2
+ bhi cpu_sa110_cache_clean_invalidate_all_r2
X 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
X add r0, r0, #DCACHELINESIZE
X mcr p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -369,7 +369,7 @@
X sub r1, r1, r0
X cmp r1, #MAX_AREA_SIZE
X mov r2, #0
- bgt cpu_sa1100_cache_clean_invalidate_all_r2
+ bhi cpu_sa1100_cache_clean_invalidate_all_r2
X b 1b
X
X /*
@@ -423,6 +423,7 @@
X .align 5
X ENTRY(cpu_sa110_icache_invalidate_range)
X ENTRY(cpu_sa1100_icache_invalidate_range)
+ bic r0, r0, #DCACHELINESIZE - 1
X 1: mcr p15, 0, r0, c7, c10, 1 @ Clean D entry
X add r0, r0, #DCACHELINESIZE
X cmp r0, r1
@@ -460,12 +461,14 @@
X .align 5
X ENTRY(cpu_sa110_tlb_invalidate_range)
X ENTRY(cpu_sa1100_tlb_invalidate_range)
+ bic r0, r0, #0x0ff
+ bic r0, r0, #0xf00
X mov r3, #0
X mcr p15, 0, r3, c7, c10, 4 @ drain WB
X 1: mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
X add r0, r0, #PAGESIZE
X cmp r0, r1
- blt 1b
+ blo 1b
X mcr p15, 0, r3, c8, c5, 0 @ invalidate I TLB
X mov pc, lr
X
diff -u --recursive --new-file v2.4.13/linux/arch/arm/tools/mach-types linux/arch/arm/tools/mach-types
--- v2.4.13/linux/arch/arm/tools/mach-types Tue Oct 23 22:48:49 2001
+++ linux/arch/arm/tools/mach-types Thu Oct 25 13:53:46 2001
@@ -6,7 +6,7 @@
X # To add an entry into this database, please see Documentation/arm/README,
X # or contact r...@arm.linux.org.uk
X #
-# Last update: Fri Oct 5 18:40:53 2001
+# Last update: Mon Oct 22 09:49:06 2001
X #
X # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
X #
@@ -114,7 +114,7 @@
X gator SA1100_GATOR GATOR 103
X granite ARCH_GRANITE GRANITE 104
X consus SA1100_CONSUS CONSUS 105
-agilent_aaed2000 ARCH_AAEC2000_AAED2000 AAEC2000_AAED2000 106
+aaed2000 ARCH_AAED2000 AAED2000 106
X cdb89712 ARCH_CDB89712 CDB89712 107
X graphicsmaster SA1100_GRAPHICSMASTER GRAPHICSMASTER 108
X adsbitsy SA1100_ADSBITSY ADSBITSY 109
@@ -131,3 +131,6 @@
X bluestem SA1100_BLUESTEM BLUESTEM 120
X xingu8 ARCH_XINGU8 XINGU8 121
X bushstb ARCH_BUSHSTB BUSHSTB 122
+epsilon1 SA1100_EPSILON1 EPSILON1 123
+balloon SA1100_BALLOON BALLOON 124
+puppy ARCH_PUPPY PUPPY 125
diff -u --recursive --new-file v2.4.13/linux/arch/i386/config.in linux/arch/i386/config.in
--- v2.4.13/linux/arch/i386/config.in Tue Oct 23 22:48:49 2001
+++ linux/arch/i386/config.in Fri Nov 2 17:46:47 2001
@@ -149,6 +149,7 @@
X define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
X fi
X tristate 'Toshiba Laptop support' CONFIG_TOSHIBA
+tristate 'Dell Inspiron 8000 support' CONFIG_I8K
X
X tristate '/dev/cpu/microcode - Intel IA32 CPU microcode support' CONFIG_MICROCODE
X tristate '/dev/cpu/*/msr - Model-specific register support' CONFIG_X86_MSR
diff -u --recursive --new-file v2.4.13/linux/arch/i386/defconfig linux/arch/i386/defconfig
--- v2.4.13/linux/arch/i386/defconfig Tue Oct 23 22:48:49 2001
+++ linux/arch/i386/defconfig Mon Nov 5 15:24:04 2001
@@ -50,6 +50,7 @@
X CONFIG_X86_PGE=y
X CONFIG_X86_USE_PPRO_CHECKSUM=y
X # CONFIG_TOSHIBA is not set
+# CONFIG_I8K is not set
X # CONFIG_MICROCODE is not set
X # CONFIG_X86_MSR is not set
X # CONFIG_X86_CPUID is not set
@@ -84,6 +85,7 @@
X #
X CONFIG_PCMCIA=y
X CONFIG_CARDBUS=y
+# CONFIG_I82092 is not set


X # CONFIG_I82365 is not set
X # CONFIG_TCIC is not set

X CONFIG_SYSVIPC=y
@@ -612,6 +614,7 @@


X # CONFIG_RAMFS is not set
X CONFIG_ISO9660_FS=y

X # CONFIG_JOLIET is not set

+# CONFIG_ZISOFS is not set
X # CONFIG_MINIX_FS is not set

X # CONFIG_VXFS_FS is not set


X # CONFIG_NTFS_FS is not set

@@ -653,6 +656,8 @@


X # CONFIG_NCPFS_SMALLDOS is not set
X # CONFIG_NCPFS_NLS is not set
X # CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set
+# CONFIG_ZLIB_FS_INFLATE is not set
X
X #
X # Partition Types

@@ -706,7 +711,6 @@
X # CONFIG_USB_DEVICEFS is not set
X # CONFIG_USB_BANDWIDTH is not set
X # CONFIG_USB_LONG_TIMEOUT is not set
-# CONFIG_USB_LARGE_CONFIG is not set
X
X #
X # USB Controllers
diff -u --recursive --new-file v2.4.13/linux/arch/i386/kernel/apic.c linux/arch/i386/kernel/apic.c
--- v2.4.13/linux/arch/i386/kernel/apic.c Tue Oct 9 17:06:51 2001
+++ linux/arch/i386/kernel/apic.c Sat Oct 27 15:39:24 2001
@@ -588,6 +588,7 @@
X goto no_apic;
X case X86_VENDOR_INTEL:
X if (boot_cpu_data.x86 == 6 ||
+ (boot_cpu_data.x86 == 15 && cpu_has_apic) ||
X (boot_cpu_data.x86 == 5 && cpu_has_apic))
X break;
X goto no_apic;
diff -u --recursive --new-file v2.4.13/linux/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S
--- v2.4.13/linux/arch/i386/kernel/entry.S Tue Oct 23 22:48:49 2001
+++ linux/arch/i386/kernel/entry.S Fri Nov 2 17:18:49 2001
@@ -195,10 +195,10 @@
X pushl %eax # save orig_eax
X SAVE_ALL
X GET_CURRENT(%ebx)
- cmpl $(NR_syscalls),%eax
- jae badsys
X testb $0x02,tsk_ptrace(%ebx) # PT_TRACESYS
X jne tracesys
+ cmpl $(NR_syscalls),%eax
+ jae badsys
X call *SYMBOL_NAME(sys_call_table)(,%eax,4)
X movl %eax,EAX(%esp) # save the return value
X ENTRY(ret_from_sys_call)
diff -u --recursive --new-file v2.4.13/linux/arch/i386/kernel/io_apic.c linux/arch/i386/kernel/io_apic.c
--- v2.4.13/linux/arch/i386/kernel/io_apic.c Tue Oct 9 17:06:51 2001
+++ linux/arch/i386/kernel/io_apic.c Fri Nov 2 17:35:05 2001
@@ -750,12 +750,14 @@
X )
X UNEXPECTED_IO_APIC();
X
+ printk(KERN_DEBUG "....... : PRQ implemented: %X\n", reg_01.PRQ);
X printk(KERN_DEBUG "....... : IO APIC version: %04X\n", reg_01.version);
X if ( (reg_01.version != 0x01) && /* 82489DX IO-APICs */
+ (reg_01.version != 0x02) && /* 82801BA IO-APICs (ICH2) */
X (reg_01.version != 0x10) && /* oldest IO-APICs */
X (reg_01.version != 0x11) && /* Pentium/Pro IO-APICs */
X (reg_01.version != 0x13) && /* Xeon IO-APICs */
- (reg_01.entries != 0x20) /* Intel P64H (82806 AA) */
+ (reg_01.version != 0x20) /* Intel P64H (82806 AA) */
X )
X UNEXPECTED_IO_APIC();
X if (reg_01.__reserved_1 || reg_01.__reserved_2)
@@ -1237,14 +1239,17 @@
X ack_APIC_irq();
X
X if (!(v & (1 << (i & 0x1f)))) {
+#ifdef APIC_LOCKUP_DEBUG
+ struct irq_pin_list *entry;
+#endif
+
X #ifdef APIC_MISMATCH_DEBUG
X atomic_inc(&irq_mis_count);
X #endif
X spin_lock(&ioapic_lock);
X __mask_and_edge_IO_APIC_irq(irq);
X #ifdef APIC_LOCKUP_DEBUG
- for (;;) {
- struct irq_pin_list *entry = irq_2_pin + irq;
+ for (entry = irq_2_pin + irq;;) {
X unsigned int reg;
X
X if (entry->pin == -1)
diff -u --recursive --new-file v2.4.13/linux/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
--- v2.4.13/linux/arch/i386/kernel/irq.c Sun Sep 23 11:40:55 2001
+++ linux/arch/i386/kernel/irq.c Thu Oct 25 13:53:46 2001
@@ -512,6 +512,7 @@
X if (!local_irq_count(smp_processor_id())) {
X do {
X barrier();
+ cpu_relax();
X } while (irq_desc[irq].status & IRQ_INPROGRESS);
X }
X }
@@ -766,8 +767,10 @@
X
X #ifdef CONFIG_SMP
X /* Wait to make sure it's not being used on another CPU */
- while (desc->status & IRQ_INPROGRESS)
+ while (desc->status & IRQ_INPROGRESS) {
X barrier();
+ cpu_relax();
+ }
X #endif
X kfree(action);
X return;
diff -u --recursive --new-file v2.4.13/linux/arch/i386/kernel/microcode.c linux/arch/i386/kernel/microcode.c
--- v2.4.13/linux/arch/i386/kernel/microcode.c Tue Oct 23 22:48:49 2001
+++ linux/arch/i386/kernel/microcode.c Tue Oct 30 15:13:17 2001
@@ -47,6 +47,10 @@
X * 1.08 11 Dec 2000, Richard Schaal <richard...@intel.com> and
X * Tigran Aivazian <tig...@veritas.com>
X * Intel Pentium 4 processor support and bugfixes.
+ * 1.09 30 Oct 2001, Tigran Aivazian <tig...@veritas.com>
+ * Bugfix for HT (Hyper-Threading) enabled processors
+ * whereby processor resources are shared by all logical processors
+ * in a single CPU package.
X */
X
X #include <linux/init.h>
@@ -61,7 +65,7 @@
X #include <asm/uaccess.h>
X #include <asm/processor.h>
X
-#define MICROCODE_VERSION "1.08"
+#define MICROCODE_VERSION "1.09"
X
X MODULE_DESCRIPTION("Intel CPU (IA-32) microcode update driver");
X MODULE_AUTHOR("Tigran Aivazian <tig...@veritas.com>");
@@ -240,10 +244,6 @@
X printk(KERN_ERR
X "microcode: CPU%d not 'upgrading' to earlier revision"
X " %d (current=%d)\n", cpu_num, microcode[i].rev, rev);
- } else if (microcode[i].rev == rev) {
- printk(KERN_ERR
- "microcode: CPU%d already up-to-date (revision %d)\n",
- cpu_num, rev);
X } else {
X int sum = 0;
X struct microcode *m = &microcode[i];
diff -u --recursive --new-file v2.4.13/linux/arch/i386/kernel/mtrr.c linux/arch/i386/kernel/mtrr.c
--- v2.4.13/linux/arch/i386/kernel/mtrr.c Tue Oct 23 22:48:49 2001
+++ linux/arch/i386/kernel/mtrr.c Thu Oct 25 14:05:52 2001
@@ -473,25 +473,16 @@
X unsigned long config, dummy;
X struct pci_dev *dev = NULL;
X
- /* ServerWorks LE chipsets have problems with write-combining
- Don't allow it and leave room for other chipsets to be tagged */
+ /* ServerWorks LE chipsets have problems with write-combining
+ Don't allow it and leave room for other chipsets to be tagged */
X
- if ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) != NULL) {
- switch(dev->vendor) {
- case PCI_VENDOR_ID_SERVERWORKS:
- switch (dev->device) {
- case PCI_DEVICE_ID_SERVERWORKS_LE:
+ if ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) != NULL) {
+ if ((dev->vendor == PCI_VENDOR_ID_SERVERWORKS) &&
+ (dev->device == PCI_DEVICE_ID_SERVERWORKS_LE)) {
+ printk (KERN_INFO "mtrr: Serverworks LE detected. Write-combining disabled.\n");
X return 0;
- break;
- default:
- break;
- }
- break;
- default:
- break;
+ }
X }
- }
-
X
X switch ( mtrr_if )
X {
diff -u --recursive --new-file v2.4.13/linux/arch/i386/kernel/pci-i386.c linux/arch/i386/kernel/pci-i386.c
--- v2.4.13/linux/arch/i386/kernel/pci-i386.c Sat May 19 18:07:04 2001
+++ linux/arch/i386/kernel/pci-i386.c Sun Nov 4 09:31:58 2001
@@ -12,7 +12,7 @@
X * Hannover, Germany
X * h...@ix.de
X *
- * Copyright 1997--2000 Martin Mares <m...@suse.cz>
+ * Copyright 1997--2000 Martin Mares <m...@ucw.cz>
X *
X * For more information, please consult the following manuals (look at
X * http://www.pcisig.com/ for how to get them):
diff -u --recursive --new-file v2.4.13/linux/arch/i386/kernel/pci-irq.c linux/arch/i386/kernel/pci-irq.c
--- v2.4.13/linux/arch/i386/kernel/pci-irq.c Tue Oct 23 22:48:49 2001
+++ linux/arch/i386/kernel/pci-irq.c Sun Nov 4 09:31:58 2001


@@ -1,7 +1,7 @@
X /*

X * Low-Level PCI Support for PC -- Routing of Interrupts
X *


- * (c) 1999--2000 Martin Mares <m...@suse.cz>
+ * (c) 1999--2000 Martin Mares <m...@ucw.cz>

X */
X
X #include <linux/config.h>
diff -u --recursive --new-file v2.4.13/linux/arch/i386/kernel/pci-pc.c linux/arch/i386/kernel/pci-pc.c
--- v2.4.13/linux/arch/i386/kernel/pci-pc.c Tue Oct 9 17:06:51 2001
+++ linux/arch/i386/kernel/pci-pc.c Sun Nov 4 09:31:58 2001


@@ -1,7 +1,7 @@
X /*

X * Low-Level PCI Support for PC
X *


- * (c) 1999--2000 Martin Mares <m...@suse.cz>
+ * (c) 1999--2000 Martin Mares <m...@ucw.cz>

X */
X
X #include <linux/config.h>
@@ -521,7 +521,7 @@
X DBG("PCI: BIOS probe returned s=%02x hw=%02x ver=%02x.%02x l=%02x\n",
X status, hw_mech, major_ver, minor_ver, pcibios_last_bus);
X if (status || signature != PCI_SIGNATURE) {
- printk (KERN_ERR "PCI: BIOS BUG #%x[%08x] found, report to <m...@suse.cz>\n",
+ printk (KERN_ERR "PCI: BIOS BUG #%x[%08x] found\n",
X status, signature);
X return 0;
X }
@@ -773,7 +773,7 @@
X if (sum != 0)
X continue;
X if (check->fields.revision != 0) {
- printk("PCI: unsupported BIOS32 revision %d at 0x%p, report to <m...@suse.cz>\n",
+ printk("PCI: unsupported BIOS32 revision %d at 0x%p\n",
X check->fields.revision, check);
X continue;
X }
diff -u --recursive --new-file v2.4.13/linux/arch/i386/kernel/pci-visws.c linux/arch/i386/kernel/pci-visws.c
--- v2.4.13/linux/arch/i386/kernel/pci-visws.c Thu Jun 22 07:17:16 2000
+++ linux/arch/i386/kernel/pci-visws.c Sun Nov 4 09:31:58 2001


@@ -1,7 +1,7 @@
X /*

X * Low-Level PCI Support for SGI Visual Workstation
X *


- * (c) 1999--2000 Martin Mares <m...@suse.cz>
+ * (c) 1999--2000 Martin Mares <m...@ucw.cz>

X */
X
X #include <linux/config.h>
diff -u --recursive --new-file v2.4.13/linux/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- v2.4.13/linux/arch/i386/kernel/setup.c Tue Oct 23 22:48:49 2001
+++ linux/arch/i386/kernel/setup.c Thu Oct 25 13:53:46 2001
@@ -229,8 +229,7 @@
X
X #define SIO_PM_GP_EN 0x80
X
-static void
-visws_get_board_type_and_rev(void)
+static void __init visws_get_board_type_and_rev(void)
X {
X int raw;
X

@@ -402,7 +401,7 @@
X }
X }
X

-void __init add_memory_region(unsigned long long start,
+static void __init add_memory_region(unsigned long long start,
X unsigned long long size, int type)
X {
X int x = e820.nr_map;
@@ -667,7 +666,7 @@
X */
X #define LOWMEMSIZE() (0x9f000)
X
-void __init setup_memory_region(void)
+static void __init setup_memory_region(void)
X {
X char *who = "BIOS-e820";
X
@@ -699,7 +698,7 @@
X } /* setup_memory_region */
X
X
-static inline void parse_mem_cmdline (char ** cmdline_p)
+static void __init parse_mem_cmdline (char ** cmdline_p)
X {
X char c = ' ', *to = command_line, *from = COMMAND_LINE;


X int len = 0;

@@ -1263,11 +1262,11 @@
X /*
X * Read Cyrix DEVID registers (DIR) to get more detailed info. about the CPU
X */
-static void do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
+static void __init do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
X {
X unsigned char ccr2, ccr3;
X unsigned long flags;
-
+
X /* we test for DEVID by checking whether CCR3 is writable */
X local_irq_save(flags);
X ccr3 = getCx86(CX86_CCR3);
@@ -1303,7 +1302,7 @@
X * Actually since bugs.h doesnt even reference this perhaps someone should
X * fix the documentation ???
X */
-unsigned char Cx86_dir0_msb __initdata = 0;
+static unsigned char Cx86_dir0_msb __initdata = 0;
X
X static char Cx86_model[][9] __initdata = {
X "Cx486", "Cx486", "5x86 ", "6x86", "MediaGX ", "6x86MX ",
@@ -1336,7 +1335,7 @@
X static void __init check_cx686_slop(struct cpuinfo_x86 *c)


X {
X unsigned long flags;

-
+
X if (Cx86_dir0_msb == 3) {
X unsigned char ccr3, ccr5;
X
@@ -1503,6 +1502,248 @@
X return;
X }
X
+#ifdef CONFIG_X86_OOSTORE
+
+static u32 __init power2(u32 x)
+{
+ u32 s=1;
+ while(s<=x)
+ s<<=1;
+ return s>>=1;
+}
+
+/*
+ * Set up an actual MCR
+ */
+
+static void __init winchip_mcr_insert(int reg, u32 base, u32 size, int key)
+{
+ u32 lo, hi;
+
+ hi = base & ~0xFFF;
+ lo = ~(size-1); /* Size is a power of 2 so this makes a mask */
+ lo &= ~0xFFF; /* Remove the ctrl value bits */
+ lo |= key; /* Attribute we wish to set */
+ wrmsr(reg+MSR_IDT_MCR0, lo, hi);
+ mtrr_centaur_report_mcr(reg, lo, hi); /* Tell the mtrr driver */
+}
+
+/*
+ * Figure what we can cover with MCR's
+ *
+ * Shortcut: We know you can't put 4Gig of RAM on a winchip
+ */
+
+static u32 __init ramtop(void) /* 16388 */
+{
+ int i;
+ u32 top = 0;
+ u32 clip = 0xFFFFFFFFUL;
+
+ for (i = 0; i < e820.nr_map; i++) {
+ unsigned long start, end;
+
+ if (e820.map[i].addr > 0xFFFFFFFFUL)
+ continue;
+ /*
+ * Don't MCR over reserved space. Ignore the ISA hole
+ * we frob around that catastrophy already
+ */
+
+ if (e820.map[i].type == E820_RESERVED)
+ {
+ if(e820.map[i].addr >= 0x100000UL && e820.map[i].addr < clip)
+ clip = e820.map[i].addr;
+ continue;
+ }
+ start = e820.map[i].addr;
+ end = e820.map[i].addr + e820.map[i].size;
+ if (start >= end)
+ continue;
+ if (end > top)
+ top = end;
+ }
+ /* Everything below 'top' should be RAM except for the ISA hole.
+ Because of the limited MCR's we want to map NV/ACPI into our
+ MCR range for gunk in RAM
+
+ Clip might cause us to MCR insufficient RAM but that is an
+ acceptable failure mode and should only bite obscure boxes with
+ a VESA hole at 15Mb
+
+ The second case Clip sometimes kicks in is when the EBDA is marked
+ as reserved. Again we fail safe with reasonable results
+ */
+
+ if(top>clip)
+ top=clip;
+
+ return top;
+}
+
+/*
+ * Compute a set of MCR's to give maximum coverage
+ */
+
+static int __init winchip_mcr_compute(int nr, int key)
+{
+ u32 mem = ramtop();
+ u32 root = power2(mem);
+ u32 base = root;
+ u32 top = root;
+ u32 floor = 0;
+ int ct = 0;
+
+ while(ct<nr)
+ {
+ u32 fspace = 0;
+
+ /*
+ * Find the largest block we will fill going upwards
+ */
+
+ u32 high = power2(mem-top);
+
+ /*
+ * Find the largest block we will fill going downwards
+ */
+
+ u32 low = base/2;
+
+ /*
+ * Don't fill below 1Mb going downwards as there
+ * is an ISA hole in the way.
+ */
+
+ if(base <= 1024*1024)
+ low = 0;
+
+ /*
+ * See how much space we could cover by filling below
+ * the ISA hole
+ */
+
+ if(floor == 0)
+ fspace = 512*1024;
+ else if(floor ==512*1024)
+ fspace = 128*1024;
+
+ /* And forget ROM space */
+
+ /*
+ * Now install the largest coverage we get
+ */
+
+ if(fspace > high && fspace > low)
+ {
+ winchip_mcr_insert(ct, floor, fspace, key);
+ floor += fspace;
+ }
+ else if(high > low)
+ {
+ winchip_mcr_insert(ct, top, high, key);
+ top += high;
+ }
+ else if(low > 0)
+ {
+ base -= low;
+ winchip_mcr_insert(ct, base, low, key);
+ }
+ else break;
+ ct++;
+ }
+ /*
+ * We loaded ct values. We now need to set the mask. The caller
+ * must do this bit.
+ */
+
+ return ct;
+}
+
+static void __init winchip_create_optimal_mcr(void)
+{
+ int i;
+ /*
+ * Allocate up to 6 mcrs to mark as much of ram as possible
+ * as write combining and weak write ordered.
+ *
+ * To experiment with: Linux never uses stack operations for
+ * mmio spaces so we could globally enable stack operation wc
+ *
+ * Load the registers with type 31 - full write combining, all
+ * writes weakly ordered.
+ */
+ int used = winchip_mcr_compute(6, 31);
+
+ /*
+ * Wipe unused MCRs
+ */
+
+ for(i=used;i<8;i++)
+ wrmsr(MSR_IDT_MCR0+i, 0, 0);
+}
+
+static void __init winchip2_create_optimal_mcr(void)
+{
+ u32 lo, hi;
+ int i;
+
+ /*
+ * Allocate up to 6 mcrs to mark as much of ram as possible
+ * as write combining, weak store ordered.
+ *
+ * Load the registers with type 25
+ * 8 - weak write ordering
+ * 16 - weak read ordering
+ * 1 - write combining
+ */
+
+ int used = winchip_mcr_compute(6, 25);
+
+ /*
+ * Mark the registers we are using.
+ */
+
+ rdmsr(MSR_IDT_MCR_CTRL, lo, hi);
+ for(i=0;i<used;i++)
+ lo|=1<<(9+i);
+ wrmsr(MSR_IDT_MCR_CTRL, lo, hi);
+
+ /*
+ * Wipe unused MCRs
+ */
+
+ for(i=used;i<8;i++)
+ wrmsr(MSR_IDT_MCR0+i, 0, 0);
+}
+
+/*
+ * Handle the MCR key on the Winchip 2.
+ */
+
+static void __init winchip2_unprotect_mcr(void)
+{
+ u32 lo, hi;
+ u32 key;
+
+ rdmsr(MSR_IDT_MCR_CTRL, lo, hi);
+ lo&=~0x1C0; /* blank bits 8-6 */
+ key = (lo>>17) & 7;
+ lo |= key<<6; /* replace with unlock key */
+ wrmsr(MSR_IDT_MCR_CTRL, lo, hi);
+}
+
+static void __init winchip2_protect_mcr(void)
+{
+ u32 lo, hi;
+
+ rdmsr(MSR_IDT_MCR_CTRL, lo, hi);
+ lo&=~0x1C0; /* blank bits 8-6 */
+ wrmsr(MSR_IDT_MCR_CTRL, lo, hi);
+}
+
+#endif
+
X static void __init init_centaur(struct cpuinfo_x86 *c)
X {
X enum {
@@ -1546,6 +1787,19 @@
X fcr_clr=DPDC;
X printk(KERN_NOTICE "Disabling bugged TSC.\n");
X clear_bit(X86_FEATURE_TSC, &c->x86_capability);
+#ifdef CONFIG_X86_OOSTORE
+ winchip_create_optimal_mcr();
+ /* Enable
+ write combining on non-stack, non-string
+ write combining on string, all types
+ weak write ordering
+
+ The C6 original lacks weak read order
+
+ Note 0x120 is write only on Winchip 1 */
+
+ wrmsr(MSR_IDT_MCR_CTRL, 0x01F0001F, 0);
+#endif
X break;
X case 8:
X switch(c->x86_mask) {
@@ -1561,11 +1815,37 @@
X }
X fcr_set=ECX8|DSMC|DTLOCK|EMMX|EBRPRED|ERETSTK|E2MMX|EAMD3D;
X fcr_clr=DPDC;
+#ifdef CONFIG_X86_OOSTORE
+ winchip2_unprotect_mcr();
+ winchip2_create_optimal_mcr();
+ rdmsr(MSR_IDT_MCR_CTRL, lo, hi);
+ /* Enable
+ write combining on non-stack, non-string
+ write combining on string, all types
+ weak write ordering
+ */
+ lo|=31;
+ wrmsr(MSR_IDT_MCR_CTRL, lo, hi);
+ winchip2_protect_mcr();
+#endif
X break;
X case 9:
X name="3";
X fcr_set=ECX8|DSMC|DTLOCK|EMMX|EBRPRED|ERETSTK|E2MMX|EAMD3D;
X fcr_clr=DPDC;
+#ifdef CONFIG_X86_OOSTORE
+ winchip2_unprotect_mcr();
+ winchip2_create_optimal_mcr();
+ rdmsr(MSR_IDT_MCR_CTRL, lo, hi);
+ /* Enable
+ write combining on non-stack, non-string
+ write combining on string, all types
+ weak write ordering
+ */
+ lo|=31;
+ wrmsr(MSR_IDT_MCR_CTRL, lo, hi);
+ winchip2_protect_mcr();
+#endif
X break;
X case 10:
X name="4";
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/8260_io/commproc.c linux/arch/ppc/8260_io/commproc.c
--- v2.4.13/linux/arch/ppc/8260_io/commproc.c Mon May 21 17:04:46 2001
+++ linux/arch/ppc/8260_io/commproc.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.commproc.c 1.5 05/17/01 18:14:19 cort
+ * BK Id: SCCS/s.commproc.c 1.10 10/16/01 16:21:52 trini


X */
X
X /*

@@ -137,7 +137,7 @@
X * Baud rate clocks are zero-based in the driver code (as that maps
X * to port numbers). Documentation uses 1-based numbering.
X */
-#define BRG_INT_CLK (((bd_t *)__res)->bi_brgfreq * 1000000)
+#define BRG_INT_CLK (((bd_t *)__res)->bi_brgfreq)
X #define BRG_UART_CLK (BRG_INT_CLK/16)
X
X /* This function is used by UARTS, or anything else that uses a 16x
@@ -169,8 +169,6 @@
X {
X volatile uint *bp;
X
- /* This is good enough to get SMCs running.....
- */
X if (brg < 4) {
X bp = (uint *)&immr->im_brgc1;
X }
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/8xx_io/commproc.c linux/arch/ppc/8xx_io/commproc.c
--- v2.4.13/linux/arch/ppc/8xx_io/commproc.c Tue Oct 9 17:06:51 2001
+++ linux/arch/ppc/8xx_io/commproc.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.commproc.c 1.13 09/14/01 18:01:16 trini
+ * BK Id: SCCS/s.commproc.c 1.15 10/16/01 16:21:52 trini


X */
X
X /*

@@ -38,6 +38,8 @@
X #include <asm/8xx_immap.h>
X #include <asm/commproc.h>


X
+extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);
+

X static uint dp_alloc_base; /* Starting offset in DP ram */
X static uint dp_alloc_top; /* Max offset + 1 */
X static uint host_buffer; /* One page of host buffer */
@@ -64,6 +66,18 @@
X imp = (immap_t *)IMAP_ADDR;
X commproc = (cpm8xx_t *)&imp->im_cpm;
X
+#ifdef CONFIG_UCODE_PATCH
+ /* Perform a reset.
+ */
+ commproc->cp_cpcr = (CPM_CR_RST | CPM_CR_FLG);
+
+ /* Wait for it.
+ */
+ while (commproc->cp_cpcr & CPM_CR_FLG);
+
+ cpm_load_patch(imp);
+#endif
+
X /* Set SDMA Bus Request priority 5.
X * On 860T, this also enables FEC priority 6. I am not sure
X * this is what we realy want for some applications, but the
@@ -81,9 +95,17 @@
X */
X host_buffer = host_page_addr; /* Host virtual page address */
X host_end = host_page_addr + PAGE_SIZE;
- pte = va_to_pte(host_page_addr);
- pte_val(*pte) |= _PAGE_NO_CACHE;
- flush_tlb_page(init_mm.mmap, host_buffer);
+
+ /* We need to get this page early, so I have to do it the
+ * hard way.
+ */
+ if (get_pteptr(&init_mm, host_page_addr, &pte)) {
+ pte_val(*pte) |= _PAGE_NO_CACHE;
+ flush_tlb_page(init_mm.mmap, host_buffer);
+ }
+ else {
+ panic("Huh? No CPM host page?");
+ }
X
X /* Tell everyone where the comm processor resides.
X */
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/8xx_io/uart.c linux/arch/ppc/8xx_io/uart.c
--- v2.4.13/linux/arch/ppc/8xx_io/uart.c Tue Oct 9 17:06:51 2001
+++ linux/arch/ppc/8xx_io/uart.c Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.uart.c 1.16 09/14/01 18:01:17 trini
+ * BK Id: SCCS/s.uart.c 1.19 10/26/01 09:59:32 trini
X */
X /*
X * UART driver for MPC860 CPM SCC or SMC
@@ -94,10 +94,10 @@
X static int serial_refcount;
X static int serial_console_setup(struct console *co, char *options);
X
-static int serial_console_wait_key(struct console *co);
X static void serial_console_write(struct console *c, const char *s,
X unsigned count);
X static kdev_t serial_console_device(struct console *c);
+static int serial_console_wait_key(struct console *co);
X
X #if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
X static unsigned long break_pressed; /* break, really ... */
@@ -481,7 +481,9 @@
X tty->flip.count++;
X }
X
+#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
X ignore_char:
+#endif
X /* This BD is ready to be used again. Clear status.
X * Get next BD.
X */
@@ -876,7 +878,7 @@
X static void change_speed(ser_info_t *info)
X {
X int baud_rate;
- unsigned cflag, cval, scval, prev_mode;
+ unsigned cflag, cval, scval, prev_mode, new_mode;
X int i, bits, sbits, idx;
X unsigned long flags;
X struct serial_state *state;
@@ -917,10 +919,10 @@
X cval |= SMCMR_PEN;
X scval |= SCU_PMSR_PEN;
X bits++;
- }
- if (!(cflag & PARODD)) {
- cval |= SMCMR_PM_EVEN;
- scval |= (SCU_PMSR_REVP | SCU_PMSR_TEVP);
+ if (!(cflag & PARODD)) {
+ cval |= SMCMR_PM_EVEN;
+ scval |= (SCU_PMSR_REVP | SCU_PMSR_TEVP);
+ }
X }
X
X /* Determine divisor based on baud rate */
@@ -993,7 +995,13 @@
X idx = PORT_NUM(state->smc_scc_num);
X if (state->smc_scc_num & NUM_IS_SCC) {
X sccp = &cpmp->cp_scc[idx];
- sccp->scc_pmsr = (sbits << 12) | scval;
+ new_mode = (sbits << 12) | scval;
+ prev_mode = sccp->scc_pmsr;
+ if (!(prev_mode & SCU_PMSR_PEN))
+ /* If parity is disabled, mask out even/odd */
+ prev_mode &= ~(SCU_PMSR_TPM|SCU_PMSR_RPM);
+ if (prev_mode != new_mode)
+ sccp->scc_pmsr = new_mode;
X }
X else {
X smcp = &cpmp->cp_smc[idx];
@@ -1003,8 +1011,13 @@
X * present.
X */
X 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));
+ new_mode = smcr_mk_clen(bits) | cval | SMCMR_SM_UART;
+ new_mode |= (prev_mode & (SMCMR_REN | SMCMR_TEN));
+ if (!(prev_mode & SMCMR_PEN))
+ /* If parity is disabled, mask out even/odd */
+ prev_mode &= ~SMCMR_PM_EVEN;
+ if (prev_mode != new_mode)
+ smcp->smc_smcmr = new_mode;
X }
X
X m8xx_cpm_setbrg((state - rs_table), baud_rate);
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/config.in linux/arch/ppc/config.in
--- v2.4.13/linux/arch/ppc/config.in Sun Sep 23 11:40:56 2001
+++ linux/arch/ppc/config.in Fri Nov 2 17:43:54 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.config.in 1.40 08/24/01 20:31:47 paulus
+# BK Id: SCCS/s.config.in 1.43 10/16/01 15:18:50 trini
X #
X # For a description of the syntax of this configuration file,
X # see Documentation/kbuild/config-language.txt.
@@ -46,6 +46,8 @@
X if [ "$CONFIG_6xx" = "y" -o "$CONFIG_POWER3" = "y" -o \
X "$CONFIG_POWER4" = "y" ]; then
X define_bool CONFIG_PPC_STD_MMU y
+else
+ define_bool CONFIG_PPC_STD_MMU n
X fi
X
X if [ "$CONFIG_8260" = "y" ]; then
@@ -66,6 +68,7 @@
X "RPX-Lite CONFIG_RPXLITE \
X RPX-Classic CONFIG_RPXCLASSIC \
X BSE-IP CONFIG_BSEIP \
+ FADS CONFIG_FADS \
X TQM823L CONFIG_TQM823L \
X TQM850L CONFIG_TQM850L \
X TQM855L CONFIG_TQM855L \
@@ -74,6 +77,7 @@
X TQM860 CONFIG_TQM860 \
X SPD823TS CONFIG_SPD823TS \
X IVMS8 CONFIG_IVMS8 \
+ IVML24 CONFIG_IVML24 \
X SM850 CONFIG_SM850 \
X MBX CONFIG_MBX \
X WinCept CONFIG_WINCEPT" RPX-Lite
@@ -95,12 +99,7 @@
X Synergy-Gemini CONFIG_GEMINI" CHRP/PowerMac/PReP
X fi
X
-if [ "$CONFIG_PPC64BRIDGE" != "y" ]; then
- bool 'Workarounds for PPC601 bugs' CONFIG_PPC601_SYNC_FIX
-fi
-
-if [ "$CONFIG_POWER3" = "n" -a "$CONFIG_POWER4" = "n" -a \
- "$CONFIG_6xx" = "n" ]; then
+if [ "$CONFIG_PPC_STD_MMU" != "y" ]; then
X define_bool CONFIG_ALL_PPC n
X fi
X
@@ -183,6 +182,10 @@
X else
X bool 'Generic /dev/rtc emulation' CONFIG_GEN_RTC
X fi
+fi
+
+if [ "$CONFIG_ALL_PPC" = "y" -a "$CONFIG_POWER3" = "n" ] ; then
+ bool 'Workarounds for PPC601 bugs' CONFIG_PPC601_SYNC_FIX
X fi
X
X if [ "$CONFIG_ALL_PPC" = "y" ]; then
diff -u --recursive --new-file v2.4.13/linux/arch/ppc/configs/IVMS8_defconfig linux/arch/ppc/configs/IVMS8_defconfig
--- v2.4.13/linux/arch/ppc/configs/IVMS8_defconfig Tue Oct 9 17:06:51 2001
+++ linux/arch/ppc/configs/IVMS8_defconfig Fri Nov 2 17:43:54 2001


@@ -27,10 +27,12 @@
X # CONFIG_POWER3 is not set
X # CONFIG_POWER4 is not set
X CONFIG_8xx=y
+# CONFIG_PPC_STD_MMU is not set
X CONFIG_SERIAL_CONSOLE=y
X # CONFIG_RPXLITE is not set
X # CONFIG_RPXCLASSIC is not set
X # CONFIG_BSEIP is not set

+# CONFIG_FADS is not set
X # CONFIG_TQM823L is not set
X # CONFIG_TQM850L is not set
X # CONFIG_TQM855L is not set
@@ -39,10 +41,10 @@

X # CONFIG_TQM860 is not set
X # CONFIG_SPD823TS is not set

X CONFIG_IVMS8=y


+# CONFIG_IVML24 is not set
X # CONFIG_SM850 is not set
X # CONFIG_MBX is not set
X # CONFIG_WINCEPT is not set
-# CONFIG_PPC601_SYNC_FIX is not set
X # CONFIG_ALL_PPC is not set
X # CONFIG_SMP is not set
X CONFIG_MATH_EMULATION=y

@@ -85,7 +87,6 @@


X #
X # CONFIG_PNP is not set
X # CONFIG_ISAPNP is not set

-# CONFIG_PNPBIOS is not set


X
X #
X # Block devices

@@ -138,6 +139,7 @@
X # CONFIG_IPV6 is not set
X # CONFIG_KHTTPD is not set
X # CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set


X
X #
X #

@@ -237,7 +239,6 @@


X # CONFIG_MACE is not set
X # CONFIG_BMAC is not set
X # CONFIG_GMAC is not set

-# CONFIG_OAKNET is not set


X # CONFIG_SUNLANCE is not set
X # CONFIG_SUNBMAC is not set
X # CONFIG_SUNQE is not set

@@ -372,7 +373,6 @@


X # CONFIG_DTLK is not set
X # CONFIG_R3964 is not set
X # CONFIG_APPLICOM is not set

-# CONFIG_SONYPI is not set


X
X #
X # Ftape, the floppy tape device driver

@@ -491,12 +491,108 @@


X CONFIG_8xx_COPYBACK=y
X # CONFIG_8xx_CPU6 is not set
X # CONFIG_UCODE_PATCH is not set
-CONFIG_BLK_DEV_MPC8xx_IDE=y

X
X #


X # USB support
X #
X # CONFIG_USB is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set

+
+#
+# USB Device Class drivers

SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 07'
echo 'File patch-2.4.14 is continued in part 08'
echo "08" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:39 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part16

#!/bin/sh -x
# this is part 16 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 16; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&
+ }
+ }

+ break;
+
+
+ case AML_TO_BCD_OP: /* To_bcd (Operand, Result) */
+
+ if (operand[0]->integer.value > ACPI_MAX_BCD_VALUE) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD overflow: %8.8X%8.8X\n",
+ HIDWORD(operand[0]->integer.value), LODWORD(operand[0]->integer.value)));
+ status = AE_AML_NUMERIC_OVERFLOW;


+ goto cleanup;
+ }
+

+ return_desc->integer.value = 0;
+ for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) {
+ /* Divide by nth factor of 10 */
+
+ temp32 = 0;
+ digit = operand[0]->integer.value;
+ for (j = 0; j < i; j++) {
+ acpi_ut_short_divide (&digit, 10, &digit, &temp32);
+ }
+
+ /* Create the BCD digit from the remainder above */
+
+ if (digit > 0) {
+ return_desc->integer.value += (temp32 << (i * 4));
+ }
+ }
+ break;
+
+
+ case AML_COND_REF_OF_OP: /* Cond_ref_of (Source_object, Result) */
+
+ /*
+ * This op is a little strange because the internal return value is
+ * different than the return value stored in the result descriptor
+ * (There are really two return values)
+ */
+ if ((acpi_namespace_node *) operand[0] == acpi_gbl_root_node) {
+ /*
+ * This means that the object does not exist in the namespace,
+ * return FALSE
+ */
+ return_desc->integer.value = 0;
+
+ /*
+ * Must delete the result descriptor since there is no reference
+ * being returned
+ */
+ acpi_ut_remove_reference (operand[1]);


+ goto cleanup;
+ }
+

+ /* Get the object reference and store it */
+
+ status = acpi_ex_get_object_reference (operand[0], &return_desc2, walk_state);
+ if (ACPI_FAILURE (status)) {


+ goto cleanup;
+ }
+

+ status = acpi_ex_store (return_desc2, operand[1], walk_state);
+
+ /* The object exists in the namespace, return TRUE */
+
+ return_desc->integer.value = ACPI_INTEGER_MAX;
+ goto cleanup;
+ break;
+
+
+ case AML_STORE_OP: /* Store (Source, Target) */
+
+ /*
+ * A store operand is typically a number, string, buffer or lvalue
+ * Be careful about deleting the source object,
+ * since the object itself may have been stored.
+ */
+ status = acpi_ex_store (operand[0], operand[1], walk_state);


+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }

+
+ /*
+ * Normally, we would remove a reference on the Operand[0] parameter;
+ * But since it is being used as the internal return object
+ * (meaning we would normally increment it), the two cancel out,
+ * and we simply don't do anything.
+ */
+ walk_state->result_obj = operand[0];
+ walk_state->operands[0] = NULL; /* Prevent deletion */
+ return_ACPI_STATUS (status);
+ break;
+
+
+ /*
+ * ACPI 2.0 Opcodes
+ */
+ case AML_COPY_OP: /* Copy (Source, Target) */
+
+ status = AE_NOT_IMPLEMENTED;
+ goto cleanup;
+ break;
+
+
+ case AML_TO_DECSTRING_OP: /* To_decimal_string (Data, Result) */
+
+ status = acpi_ex_convert_to_string (operand[0], &return_desc, 10, ACPI_UINT32_MAX, walk_state);
+ break;
+
+
+ case AML_TO_HEXSTRING_OP: /* To_hex_string (Data, Result) */
+
+ status = acpi_ex_convert_to_string (operand[0], &return_desc, 16, ACPI_UINT32_MAX, walk_state);
+ break;
+
+
+ case AML_TO_BUFFER_OP: /* To_buffer (Data, Result) */
+
+ status = acpi_ex_convert_to_buffer (operand[0], &return_desc, walk_state);
+ break;
+
+
+ case AML_TO_INTEGER_OP: /* To_integer (Data, Result) */
+
+ status = acpi_ex_convert_to_integer (operand[0], &return_desc, walk_state);
+ break;
+
+
+ /*
+ * These are two obsolete opcodes
+ */
+ case AML_SHIFT_LEFT_BIT_OP: /* Shift_left_bit (Source, Bit_num) */
+ case AML_SHIFT_RIGHT_BIT_OP: /* Shift_right_bit (Source, Bit_num) */
+
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s is obsolete and not implemented\n",
+ acpi_ps_get_opcode_name (walk_state->opcode)));
+ status = AE_SUPPORT;
+ goto cleanup;
+ break;
+
+
+ default: /* Unknown opcode */
+
+ REPORT_ERROR (("Acpi_ex_opcode_1A_1T_1R: Unknown opcode %X\n",
+ walk_state->opcode));
+ status = AE_AML_BAD_OPCODE;


+ goto cleanup;
+ }
+

+
+ /*
+ * Store the return value computed above into the target object
+ */
+ status = acpi_ex_store (return_desc, operand[1], walk_state);
+
+
+cleanup:
+
+ walk_state->result_obj = return_desc;
+
+ /* Delete return object on error */
+
+ if (ACPI_FAILURE (status)) {
+ acpi_ut_remove_reference (return_desc);
+ }
+


+ return_ACPI_STATUS (status);
+}
+
+

+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ex_opcode_1A_0T_1R
+ *
+ * PARAMETERS: Walk_state - Current state (contains AML opcode)


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Execute opcode with one argument, no target, and a return value


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_opcode_1A_0T_1R (
+ acpi_walk_state *walk_state)
+{
+ acpi_operand_object **operand = &walk_state->operands[0];
+ acpi_operand_object *temp_desc;
+ acpi_operand_object *return_desc = NULL;
+ acpi_status status = AE_OK;
+ u32 type;
+ acpi_integer value;
+
+
+ FUNCTION_TRACE_STR ("Ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
+
+
+ /* Get the operand and decode the opcode */
+
+ switch (walk_state->opcode) {
+
+ case AML_LNOT_OP: /* LNot (Operand) */
+
+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
+ if (!return_desc) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+ }
+
+ return_desc->integer.value = !operand[0]->integer.value;
+ break;
+
+
+ case AML_DECREMENT_OP: /* Decrement (Operand) */
+ case AML_INCREMENT_OP: /* Increment (Operand) */
+
+ /*
+ * Since we are expecting a Reference operand, it
+ * can be either a Node or an internal object.
+ */
+ return_desc = operand[0];
+ if (VALID_DESCRIPTOR_TYPE (operand[0], ACPI_DESC_TYPE_INTERNAL)) {
+ /* Internal reference object - prevent deletion */
+
+ acpi_ut_add_reference (return_desc);
+ }
+
+ /*
+ * Convert the Return_desc Reference to a Number
+ * (This removes a reference on the Return_desc object)
+ */
+ status = acpi_ex_resolve_operands (AML_LNOT_OP, &return_desc, walk_state);
+ if (ACPI_FAILURE (status)) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s: bad operand(s) %s\n",
+ acpi_ps_get_opcode_name (walk_state->opcode), acpi_format_exception(status)));
+
+ goto cleanup;
+ }
+
+ /*
+ * Return_desc is now guaranteed to be an Integer object
+ * Do the actual increment or decrement
+ */
+ if (AML_INCREMENT_OP == walk_state->opcode) {
+ return_desc->integer.value++;
+ }
+ else {
+ return_desc->integer.value--;
+ }
+
+ /* Store the result back in the original descriptor */
+
+ status = acpi_ex_store (return_desc, operand[0], walk_state);
+ break;
+
+
+ case AML_TYPE_OP: /* Object_type (Source_object) */
+
+ if (INTERNAL_TYPE_REFERENCE == operand[0]->common.type) {
+ /*
+ * Not a Name -- an indirect name pointer would have
+ * been converted to a direct name pointer in Resolve_operands
+ */
+ switch (operand[0]->reference.opcode) {
+ case AML_ZERO_OP:
+ case AML_ONE_OP:
+ case AML_ONES_OP:
+ case AML_REVISION_OP:
+
+ /* Constants are of type Integer */
+
+ type = ACPI_TYPE_INTEGER;
+ break;
+
+
+ case AML_DEBUG_OP:
+
+ /* Per 1.0b spec, Debug object is of type "Debug_object" */
+
+ type = ACPI_TYPE_DEBUG_OBJECT;
+ break;
+
+
+ case AML_INDEX_OP:
+
+ /* Get the type of this reference (index into another object) */
+
+ type = operand[0]->reference.target_type;
+ if (type == ACPI_TYPE_PACKAGE) {
+ /*
+ * The main object is a package, we want to get the type
+ * of the individual package element that is referenced by
+ * the index.
+ */
+ type = (*(operand[0]->reference.where))->common.type;
+ }
+
+ break;
+
+
+ case AML_LOCAL_OP:
+ case AML_ARG_OP:
+
+ type = acpi_ds_method_data_get_type (operand[0]->reference.opcode,
+ operand[0]->reference.offset, walk_state);
+ break;
+
+
+ default:
+
+ REPORT_ERROR (("Acpi_ex_opcode_1A_0T_1R/Type_op: Internal error - Unknown Reference subtype %X\n",
+ operand[0]->reference.opcode));
+ status = AE_AML_INTERNAL;
+ goto cleanup;
+ }


+ }
+
+ else {
+ /*

+ * It's not a Reference, so it must be a direct name pointer.
+ */
+ type = acpi_ns_get_type ((acpi_namespace_node *) operand[0]);
+
+ /* Convert internal types to external types */
+
+ switch (type) {
+ case INTERNAL_TYPE_REGION_FIELD:
+ case INTERNAL_TYPE_BANK_FIELD:
+ case INTERNAL_TYPE_INDEX_FIELD:
+
+ type = ACPI_TYPE_FIELD_UNIT;
+ }
+
+ }
+
+ /* Allocate a descriptor to hold the type. */
+
+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
+ if (!return_desc) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+ }
+
+ return_desc->integer.value = type;
+ break;
+
+
+ case AML_SIZE_OF_OP: /* Size_of (Source_object) */
+
+ temp_desc = operand[0];
+ if (VALID_DESCRIPTOR_TYPE (operand[0], ACPI_DESC_TYPE_NAMED)) {
+ temp_desc = acpi_ns_get_attached_object ((acpi_namespace_node *) operand[0]);
+ }
+
+ if (!temp_desc) {
+ value = 0;
+ }
+
+ else {
+ switch (temp_desc->common.type) {
+ case ACPI_TYPE_BUFFER:
+ value = temp_desc->buffer.length;
+ break;
+
+ case ACPI_TYPE_STRING:
+ value = temp_desc->string.length;
+ break;
+
+ case ACPI_TYPE_PACKAGE:
+ value = temp_desc->package.count;
+ break;
+
+ case INTERNAL_TYPE_REFERENCE:
+
+ /* TBD: this must be a reference to a buf/str/pkg?? */
+
+ value = 4;


+ break;
+
+ default:

+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Not Buf/Str/Pkg - found type %X\n",
+ temp_desc->common.type));
+ status = AE_AML_OPERAND_TYPE;


+ goto cleanup;
+ }
+ }

+
+ /*
+ * Now that we have the size of the object, create a result
+ * object to hold the value
+ */
+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
+ if (!return_desc) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+ }
+
+ return_desc->integer.value = value;
+ break;
+
+
+ case AML_REF_OF_OP: /* Ref_of (Source_object) */
+
+ status = acpi_ex_get_object_reference (operand[0], &return_desc, walk_state);
+ if (ACPI_FAILURE (status)) {
+ goto cleanup;
+ }
+ break;
+
+
+ case AML_DEREF_OF_OP: /* Deref_of (Obj_reference) */
+
+ /* Check for a method local or argument */
+
+ if (!VALID_DESCRIPTOR_TYPE (operand[0], ACPI_DESC_TYPE_NAMED)) {
+ /*
+ * Must resolve/dereference the local/arg reference first
+ */
+ switch (operand[0]->reference.opcode) {
+ /* Set Operand[0] to the value of the local/arg */
+
+ case AML_LOCAL_OP:
+ case AML_ARG_OP:
+
+ acpi_ds_method_data_get_value (operand[0]->reference.opcode,
+ operand[0]->reference.offset, walk_state, &temp_desc);
+
+ /*
+ * Delete our reference to the input object and
+ * point to the object just retrieved
+ */
+ acpi_ut_remove_reference (operand[0]);
+ operand[0] = temp_desc;


+ break;
+
+ default:
+

+ /* Index op - handled below */
+ break;
+ }
+ }
+
+
+ /* Operand[0] may have changed from the code above */
+
+ if (VALID_DESCRIPTOR_TYPE (operand[0], ACPI_DESC_TYPE_NAMED)) {
+ /* Get the actual object from the Node (This is the dereference) */
+
+ return_desc = ((acpi_namespace_node *) operand[0])->object;
+
+ /* Returning a pointer to the object, add another reference! */
+
+ acpi_ut_add_reference (return_desc);
+ }
+
+ else {
+ /*
+ * This must be a reference object produced by the Index
+ * ASL operation -- check internal opcode
+ */
+ if ((operand[0]->reference.opcode != AML_INDEX_OP) &&
+ (operand[0]->reference.opcode != AML_REF_OF_OP)) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode in ref(%p) - %X\n",
+ operand[0], operand[0]->reference.opcode));
+
+ status = AE_TYPE;


+ goto cleanup;
+ }
+
+

+ switch (operand[0]->reference.opcode) {
+ case AML_INDEX_OP:
+
+ /*
+ * Supported target types for the Index operator are
+ * 1) A Buffer
+ * 2) A Package
+ */
+ if (operand[0]->reference.target_type == ACPI_TYPE_BUFFER_FIELD) {
+ /*
+ * The target is a buffer, we must create a new object that
+ * contains one element of the buffer, the element pointed
+ * to by the index.
+ *
+ * NOTE: index into a buffer is NOT a pointer to a
+ * sub-buffer of the main buffer, it is only a pointer to a
+ * single element (byte) of the buffer!
+ */
+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
+ if (!return_desc) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+ }
+
+ temp_desc = operand[0]->reference.object;
+ return_desc->integer.value =
+ temp_desc->buffer.pointer[operand[0]->reference.offset];
+
+ /* TBD: [Investigate] (see below) Don't add an additional
+ * ref!
+ */
+ }
+
+ else if (operand[0]->reference.target_type == ACPI_TYPE_PACKAGE) {
+ /*
+ * The target is a package, we want to return the referenced
+ * element of the package. We must add another reference to
+ * this object, however.
+ */
+ return_desc = *(operand[0]->reference.where);
+ if (!return_desc) {
+ /*
+ * We can't return a NULL dereferenced value. This is
+ * an uninitialized package element and is thus a
+ * severe error.
+ */
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "NULL package element obj %p\n",
+ operand[0]));
+ status = AE_AML_UNINITIALIZED_ELEMENT;


+ goto cleanup;
+ }
+

+ acpi_ut_add_reference (return_desc);
+ }
+
+ else {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Target_type %X in obj %p\n",
+ operand[0]->reference.target_type, operand[0]));
+ status = AE_AML_OPERAND_TYPE;


+ goto cleanup;
+ }
+

+ break;
+
+
+ case AML_REF_OF_OP:
+
+ return_desc = operand[0]->reference.object;
+
+ /* Add another reference to the object! */
+
+ acpi_ut_add_reference (return_desc);


+ break;
+ }
+ }
+
+ break;
+
+

+ default:
+
+ REPORT_ERROR (("Acpi_ex_opcode_1A_0T_1R: Unknown opcode %X\n",
+ walk_state->opcode));
+ status = AE_AML_BAD_OPCODE;


+ goto cleanup;
+ }
+
+

+cleanup:
+
+ /* Delete return object on error */
+
+ if (ACPI_FAILURE (status)) {
+ acpi_ut_remove_reference (return_desc);
+ }
+
+ walk_state->result_obj = return_desc;
+ return_ACPI_STATUS (status);
+}
+
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exoparg2.c linux/drivers/acpi/executer/exoparg2.c
--- v2.4.13/linux/drivers/acpi/executer/exoparg2.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/acpi/executer/exoparg2.c Wed Oct 24 14:06:22 2001
@@ -0,0 +1,564 @@
+/******************************************************************************
+ *
+ * Module Name: exoparg2 - AML execution - opcodes with 2 arguments
+ * $Revision: 97 $
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000, 2001 R. Byron Moore
+ *


+ * This 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 "acpi.h"
+#include "acparser.h"
+#include "acnamesp.h"
+#include "acinterp.h"
+#include "acevents.h"
+#include "amlcode.h"
+#include "acdispat.h"
+
+
+#define _COMPONENT ACPI_EXECUTER
+ MODULE_NAME ("exoparg2")
+
+
+/*!
+ * Naming convention for AML interpreter execution routines.
+ *
+ * The routines that begin execution of AML opcodes are named with a common
+ * convention based upon the number of arguments, the number of target operands,
+ * and whether or not a value is returned:
+ *
+ * AcpiExOpcode_xA_yT_zR
+ *
+ * Where:
+ *
+ * xA - ARGUMENTS: The number of arguments (input operands) that are
+ * required for this opcode type (1 through 6 args).
+ * yT - TARGETS: The number of targets (output operands) that are required
+ * for this opcode type (0, 1, or 2 targets).
+ * zR - RETURN VALUE: Indicates whether this opcode type returns a value
+ * as the function return (0 or 1).
+ *
+ * The AcpiExOpcode* functions are called via the Dispatcher component with
+ * fully resolved operands.
+!*/


+
+
+/*******************************************************************************
+ *

+ * FUNCTION: Acpi_ex_opcode_2A_0T_0R
+ *
+ * PARAMETERS: Walk_state - Current walk state


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Execute opcode with two arguments, no target, and no return
+ * value.
+ *
+ * ALLOCATION: Deletes both operands


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_opcode_2A_0T_0R (
+ acpi_walk_state *walk_state)
+{
+ acpi_operand_object **operand = &walk_state->operands[0];
+ acpi_namespace_node *node;
+ acpi_status status = AE_OK;
+
+
+ FUNCTION_TRACE_STR ("Ex_opcode_2A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
+
+
+ /* Examine the opcode */
+
+ switch (walk_state->opcode) {
+
+ case AML_NOTIFY_OP: /* Notify (Notify_object, Notify_value) */
+
+ /* The first operand is a namespace node */
+
+ node = (acpi_namespace_node *) operand[0];
+
+ /* The node must refer to a device or thermal zone */
+
+ if (node && operand[1]) /* TBD: is this check necessary? */ {
+ switch (node->type) {
+ case ACPI_TYPE_DEVICE:
+ case ACPI_TYPE_THERMAL:
+
+ /*
+ * Dispatch the notify to the appropriate handler
+ * NOTE: the request is queued for execution after this method
+ * completes. The notify handlers are NOT invoked synchronously
+ * from this thread -- because handlers may in turn run other
+ * control methods.
+ */
+ status = acpi_ev_queue_notify_request (node,
+ (u32) operand[1]->integer.value);


+ break;
+
+ default:

+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unexpected notify object type %X\n",
+ node->type));
+
+ status = AE_AML_OPERAND_TYPE;


+ break;
+ }
+ }
+ break;
+
+ default:
+

+ REPORT_ERROR (("Acpi_ex_opcode_2A_0T_0R: Unknown opcode %X\n", walk_state->opcode));
+ status = AE_AML_BAD_OPCODE;
+ }
+


+ return_ACPI_STATUS (status);
+}
+
+

+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ex_opcode_2A_2T_1R
+ *
+ * PARAMETERS: Walk_state - Current walk state


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Execute a dyadic operator (2 operands) with 2 output targets
+ * and one implicit return value.


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_opcode_2A_2T_1R (
+ acpi_walk_state *walk_state)
+{
+ acpi_operand_object **operand = &walk_state->operands[0];
+ acpi_operand_object *return_desc1 = NULL;
+ acpi_operand_object *return_desc2 = NULL;


+ acpi_status status;
+
+

+ FUNCTION_TRACE_STR ("Ex_opcode_2A_2T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+
+
+ /*
+ * Execute the opcode
+ */
+ switch (walk_state->opcode) {
+ case AML_DIVIDE_OP: /* Divide (Dividend, Divisor, Remainder_result Quotient_result) */
+
+ return_desc1 = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
+ if (!return_desc1) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+ }
+
+ return_desc2 = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
+ if (!return_desc2) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+ }
+
+ /* Quotient to Return_desc1, remainder to Return_desc2 */
+
+ status = acpi_ut_divide (&operand[0]->integer.value, &operand[1]->integer.value,
+ &return_desc1->integer.value, &return_desc2->integer.value);


+ if (ACPI_FAILURE (status)) {
+ goto cleanup;
+ }

+ break;
+
+
+ default:
+
+ REPORT_ERROR (("Acpi_ex_opcode_2A_2T_1R: Unknown opcode %X\n",
+ walk_state->opcode));
+ status = AE_AML_BAD_OPCODE;


+ goto cleanup;
+ break;

+ }
+
+
+ /* Store the results to the target reference operands */
+
+ status = acpi_ex_store (return_desc2, operand[2], walk_state);
+ if (ACPI_FAILURE (status)) {


+ goto cleanup;
+ }
+

+ status = acpi_ex_store (return_desc1, operand[3], walk_state);
+ if (ACPI_FAILURE (status)) {
+ goto cleanup;
+ }
+
+ /* Return the remainder */
+
+ walk_state->result_obj = return_desc1;
+
+
+cleanup:
+ /*
+ * Since the remainder is not returned indirectly, remove a reference to
+ * it. Only the quotient is returned indirectly.
+ */
+ acpi_ut_remove_reference (return_desc2);
+
+ if (ACPI_FAILURE (status)) {
+ /* Delete the return object */
+
+ acpi_ut_remove_reference (return_desc1);
+ }
+


+ return_ACPI_STATUS (status);
+}
+
+

+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ex_opcode_2A_1T_1R
+ *
+ * PARAMETERS: Walk_state - Current walk state


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Execute opcode with two arguments, one target, and a return
+ * value.


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_opcode_2A_1T_1R (
+ acpi_walk_state *walk_state)
+{
+ acpi_operand_object **operand = &walk_state->operands[0];
+ acpi_operand_object *return_desc = NULL;
+ acpi_operand_object *temp_desc;
+ u32 index;
+ acpi_status status = AE_OK;
+
+
+ FUNCTION_TRACE_STR ("Ex_opcode_2A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+
+
+ /*
+ * Execute the opcode
+ */
+ if (walk_state->op_info->flags & AML_MATH) {
+ /* All simple math opcodes (add, etc.) */
+
+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
+ if (!return_desc) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+ }
+
+ return_desc->integer.value = acpi_ex_do_math_op (walk_state->opcode,
+ operand[0]->integer.value,
+ operand[1]->integer.value);
+ goto store_result_to_target;
+ }
+
+
+ switch (walk_state->opcode) {
+ case AML_MOD_OP: /* Mod (Dividend, Divisor, Remainder_result (ACPI 2.0) */
+
+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
+ if (!return_desc) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+ }
+
+ /* Return_desc will contain the remainder */
+
+ status = acpi_ut_divide (&operand[0]->integer.value, &operand[1]->integer.value,
+ NULL, &return_desc->integer.value);
+
+ break;
+
+
+ case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
+
+ /*
+ * Convert the second operand if necessary. The first operand
+ * determines the type of the second operand, (See the Data Types
+ * section of the ACPI specification.) Both object types are
+ * guaranteed to be either Integer/String/Buffer by the operand
+ * resolution mechanism above.
+ */
+ switch (operand[0]->common.type) {
+ case ACPI_TYPE_INTEGER:
+ status = acpi_ex_convert_to_integer (operand[1], &operand[1], walk_state);
+ break;
+
+ case ACPI_TYPE_STRING:
+ status = acpi_ex_convert_to_string (operand[1], &operand[1], 16, ACPI_UINT32_MAX, walk_state);
+ break;
+
+ case ACPI_TYPE_BUFFER:
+ status = acpi_ex_convert_to_buffer (operand[1], &operand[1], walk_state);


+ break;
+
+ default:

+ status = AE_AML_INTERNAL;
+ }
+


+ if (ACPI_FAILURE (status)) {
+ goto cleanup;
+ }

+
+ /*
+ * Both operands are now known to be the same object type
+ * (Both are Integer, String, or Buffer), and we can now perform the
+ * concatenation.
+ */
+ status = acpi_ex_do_concatenate (operand[0], operand[1], &return_desc, walk_state);
+ break;
+
+
+ case AML_TO_STRING_OP: /* To_string (Buffer, Length, Result) (ACPI 2.0) */
+
+ status = acpi_ex_convert_to_string (operand[0], &return_desc, 16,
+ (u32) operand[1]->integer.value, walk_state);
+ break;
+
+
+ case AML_CONCAT_RES_OP: /* Concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */
+
+ status = AE_NOT_IMPLEMENTED;
+ break;
+
+
+ case AML_INDEX_OP: /* Index (Source Index Result) */
+
+ /* Create the internal return object */
+
+ return_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE);
+ if (!return_desc) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+ }
+
+ index = (u32) operand[1]->integer.value;
+
+ /*
+ * At this point, the Source operand is either a Package or a Buffer
+ */
+ if (operand[0]->common.type == ACPI_TYPE_PACKAGE) {
+ /* Object to be indexed is a Package */
+
+ if (index >= operand[0]->package.count) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value beyond package end\n"));
+ status = AE_AML_PACKAGE_LIMIT;


+ goto cleanup;
+ }
+

+ if ((operand[2]->common.type == INTERNAL_TYPE_REFERENCE) &&
+ (operand[2]->reference.opcode == AML_ZERO_OP)) {
+ /*
+ * There is no actual result descriptor (the Zero_op Result
+ * descriptor is a placeholder), so just delete the placeholder and
+ * return a reference to the package element
+ */
+ acpi_ut_remove_reference (operand[2]);
+ }
+
+ else {
+ /*
+ * Each element of the package is an internal object. Get the one
+ * we are after.
+ */
+ temp_desc = operand[0]->package.elements [index];
+ return_desc->reference.opcode = AML_INDEX_OP;
+ return_desc->reference.target_type = temp_desc->common.type;
+ return_desc->reference.object = temp_desc;
+
+ status = acpi_ex_store (return_desc, operand[2], walk_state);
+ return_desc->reference.object = NULL;
+ }
+
+ /*
+ * The local return object must always be a reference to the package element,
+ * not the element itself.
+ */
+ return_desc->reference.opcode = AML_INDEX_OP;
+ return_desc->reference.target_type = ACPI_TYPE_PACKAGE;
+ return_desc->reference.where = &operand[0]->package.elements [index];
+ }
+
+ else {
+ /* Object to be indexed is a Buffer */
+
+ if (index >= operand[0]->buffer.length) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value beyond end of buffer\n"));
+ status = AE_AML_BUFFER_LIMIT;


+ goto cleanup;
+ }
+

+ return_desc->reference.opcode = AML_INDEX_OP;
+ return_desc->reference.target_type = ACPI_TYPE_BUFFER_FIELD;
+ return_desc->reference.object = operand[0];
+ return_desc->reference.offset = index;
+
+ status = acpi_ex_store (return_desc, operand[2], walk_state);
+ }
+
+ walk_state->result_obj = return_desc;
+ goto cleanup;
+ break;
+
+
+ default:
+
+ REPORT_ERROR (("Acpi_ex_opcode_2A_1T_1R: Unknown opcode %X\n",
+ walk_state->opcode));
+ status = AE_AML_BAD_OPCODE;


+ break;
+ }
+
+

+store_result_to_target:
+


+ if (ACPI_SUCCESS (status)) {
+ /*

+ * Store the result of the operation (which is now in Return_desc) into
+ * the Target descriptor.
+ */
+ status = acpi_ex_store (return_desc, operand[2], walk_state);
+ if (ACPI_FAILURE (status)) {


+ goto cleanup;
+ }
+

+ walk_state->result_obj = return_desc;
+ }
+
+
+cleanup:
+
+ /* Delete return object on error */
+
+ if (ACPI_FAILURE (status)) {
+ acpi_ut_remove_reference (return_desc);
+ }
+


+ return_ACPI_STATUS (status);
+}
+
+

+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ex_opcode_2A_0T_1R
+ *
+ * PARAMETERS: Walk_state - Current walk state


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Execute opcode with 2 arguments, no target, and a return value


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_opcode_2A_0T_1R (
+ acpi_walk_state *walk_state)
+{
+ acpi_operand_object **operand = &walk_state->operands[0];
+ acpi_operand_object *return_desc = NULL;
+ acpi_status status = AE_OK;
+ u8 logical_result = FALSE;
+
+
+ FUNCTION_TRACE_STR ("Ex_opcode_2A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+
+
+ /* Create the internal return object */
+
+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
+ if (!return_desc) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+ }
+
+ /*
+ * Execute the Opcode
+ */
+ if (walk_state->op_info->flags & AML_LOGICAL) /* Logical_op (Operand0, Operand1) */ {
+ logical_result = acpi_ex_do_logical_op (walk_state->opcode,
+ operand[0]->integer.value,
+ operand[1]->integer.value);
+ goto store_logical_result;
+ }
+
+
+ switch (walk_state->opcode) {
+ case AML_ACQUIRE_OP: /* Acquire (Mutex_object, Timeout) */
+
+ status = acpi_ex_acquire_mutex (operand[1], operand[0], walk_state);
+ if (status == AE_TIME) {
+ logical_result = TRUE; /* TRUE = Acquire timed out */


+ status = AE_OK;
+ }

+ break;
+
+
+ case AML_WAIT_OP: /* Wait (Event_object, Timeout) */
+
+ status = acpi_ex_system_wait_event (operand[1], operand[0]);
+ if (status == AE_TIME) {
+ logical_result = TRUE; /* TRUE, Wait timed out */


+ status = AE_OK;
+ }

+ break;
+
+
+ default:
+
+ REPORT_ERROR (("Acpi_ex_opcode_2A_0T_1R: Unknown opcode %X\n", walk_state->opcode));
+ status = AE_AML_BAD_OPCODE;
+ goto cleanup;


+ break;
+ }
+
+

+store_logical_result:
+ /*
+ * Set return value to according to Logical_result. logical TRUE (all ones)
+ * Default is FALSE (zero)
+ */
+ if (logical_result) {
+ return_desc->integer.value = ACPI_INTEGER_MAX;
+ }
+
+ walk_state->result_obj = return_desc;
+
+
+cleanup:
+
+ /* Delete return object on error */
+
+ if (ACPI_FAILURE (status)) {
+ acpi_ut_remove_reference (return_desc);
+ }
+
+ return_ACPI_STATUS (status);
+}
+
+
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exoparg3.c linux/drivers/acpi/executer/exoparg3.c
--- v2.4.13/linux/drivers/acpi/executer/exoparg3.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/acpi/executer/exoparg3.c Wed Oct 24 14:06:22 2001
@@ -0,0 +1,235 @@
+
+/******************************************************************************
+ *
+ * Module Name: exoparg3 - AML execution - opcodes with 3 arguments
+ * $Revision: 3 $
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000, 2001 R. Byron Moore
+ *


+ * This 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 "acpi.h"
+#include "acinterp.h"
+#include "acparser.h"
+#include "amlcode.h"
+
+
+#define _COMPONENT ACPI_EXECUTER
+ MODULE_NAME ("exoparg3")
+
+
+/*!
+ * Naming convention for AML interpreter execution routines.
+ *
+ * The routines that begin execution of AML opcodes are named with a common
+ * convention based upon the number of arguments, the number of target operands,
+ * and whether or not a value is returned:
+ *
+ * AcpiExOpcode_xA_yT_zR
+ *
+ * Where:
+ *
+ * xA - ARGUMENTS: The number of arguments (input operands) that are
+ * required for this opcode type (1 through 6 args).
+ * yT - TARGETS: The number of targets (output operands) that are required
+ * for this opcode type (0, 1, or 2 targets).
+ * zR - RETURN VALUE: Indicates whether this opcode type returns a value
+ * as the function return (0 or 1).
+ *
+ * The AcpiExOpcode* functions are called via the Dispatcher component with
+ * fully resolved operands.
+!*/


+
+
+/*******************************************************************************
+ *

+ * FUNCTION: Acpi_ex_opcode_3A_0T_0R
+ *
+ * PARAMETERS: Walk_state - Current walk state


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Execute Triadic operator (3 operands)


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_opcode_3A_0T_0R (
+ acpi_walk_state *walk_state)
+{
+ acpi_operand_object **operand = &walk_state->operands[0];
+ ACPI_SIGNAL_FATAL_INFO *fatal;
+ acpi_status status = AE_OK;
+
+
+ FUNCTION_TRACE_STR ("Ex_opcode_3A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
+
+
+ switch (walk_state->opcode) {
+
+ case AML_FATAL_OP: /* Fatal (Fatal_type Fatal_code Fatal_arg) */
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Fatal_op: Type %x Code %x Arg %x <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
+ (u32) operand[0]->integer.value, (u32) operand[1]->integer.value,
+ (u32) operand[2]->integer.value));
+
+
+ fatal = ACPI_MEM_ALLOCATE (sizeof (ACPI_SIGNAL_FATAL_INFO));
+ if (fatal) {
+ fatal->type = (u32) operand[0]->integer.value;
+ fatal->code = (u32) operand[1]->integer.value;
+ fatal->argument = (u32) operand[2]->integer.value;
+ }
+
+ /*
+ * Always signal the OS!
+ */
+ acpi_os_signal (ACPI_SIGNAL_FATAL, fatal);
+
+ /* Might return while OS is shutting down, just continue */
+
+ ACPI_MEM_FREE (fatal);
+ break;
+
+
+ default:
+
+ REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n",
+ walk_state->opcode));
+ status = AE_AML_BAD_OPCODE;
+ goto cleanup;


+ break;
+ }
+
+

+cleanup:
+


+ return_ACPI_STATUS (status);
+}
+
+

+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ex_opcode_3A_1T_1R
+ *
+ * PARAMETERS: Walk_state - Current walk state


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Execute Triadic operator (3 operands)


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_opcode_3A_1T_1R (
+ acpi_walk_state *walk_state)
+{
+ acpi_operand_object **operand = &walk_state->operands[0];
+ acpi_operand_object *return_desc = NULL;
+ char *buffer;
+ acpi_status status = AE_OK;
+ u32 index;
+ u32 length;
+
+
+ FUNCTION_TRACE_STR ("Ex_opcode_3A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+
+
+ switch (walk_state->opcode) {
+ case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */
+
+ /*
+ * Create the return object. The Source operand is guaranteed to be
+ * either a String or a Buffer, so just use its type.
+ */
+ return_desc = acpi_ut_create_internal_object (operand[0]->common.type);
+ if (!return_desc) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+ }
+
+ /* Get the Integer values from the objects */
+
+ index = (u32) operand[1]->integer.value;
+ length = (u32) operand[2]->integer.value;
+
+ /*
+ * If the index is beyond the length of the String/Buffer, or if the
+ * requested length is zero, return a zero-length String/Buffer
+ */
+ if ((index < operand[0]->string.length) &&
+ (length > 0)) {
+ /* Truncate request if larger than the actual String/Buffer */
+
+ if ((index + length) >
+ operand[0]->string.length) {
+ length = operand[0]->string.length - index;
+ }
+
+ /* Allocate a new buffer for the String/Buffer */
+
+ buffer = ACPI_MEM_CALLOCATE (length + 1);
+ if (!buffer) {


+ return (AE_NO_MEMORY);
+ }
+

+ /* Copy the portion requested */
+
+ MEMCPY (buffer, operand[0]->string.pointer + index,
+ length);
+
+ /* Set the length of the new String/Buffer */
+
+ return_desc->string.pointer = buffer;
+ return_desc->string.length = length;
+ }
+
+ break;
+
+
+ default:
+
+ REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n",
+ walk_state->opcode));
+ status = AE_AML_BAD_OPCODE;
+ goto cleanup;
+ break;
+ }
+
+ /* Store the result in the target */
+
+ status = acpi_ex_store (return_desc, operand[3], walk_state);
+
+cleanup:
+
+ /* Delete return object on error */
+
+ if (ACPI_FAILURE (status)) {
+ acpi_ut_remove_reference (return_desc);
+ }
+
+ /* Set the return object and exit */
+
+ walk_state->result_obj = return_desc;
+ return_ACPI_STATUS (status);
+}
+
+
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exoparg6.c linux/drivers/acpi/executer/exoparg6.c
--- v2.4.13/linux/drivers/acpi/executer/exoparg6.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/acpi/executer/exoparg6.c Wed Oct 24 14:06:22 2001
@@ -0,0 +1,276 @@
+
+/******************************************************************************
+ *
+ * Module Name: exoparg6 - AML execution - opcodes with 6 arguments
+ * $Revision: 4 $
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000, 2001 R. Byron Moore
+ *


+ * This 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 "acpi.h"
+#include "acinterp.h"
+#include "acparser.h"
+#include "amlcode.h"
+
+
+#define _COMPONENT ACPI_EXECUTER
+ MODULE_NAME ("exoparg6")
+
+
+/*!
+ * Naming convention for AML interpreter execution routines.
+ *
+ * The routines that begin execution of AML opcodes are named with a common
+ * convention based upon the number of arguments, the number of target operands,
+ * and whether or not a value is returned:
+ *
+ * AcpiExOpcode_xA_yT_zR
+ *
+ * Where:
+ *
+ * xA - ARGUMENTS: The number of arguments (input operands) that are
+ * required for this opcode type (1 through 6 args).
+ * yT - TARGETS: The number of targets (output operands) that are required
+ * for this opcode type (0, 1, or 2 targets).
+ * zR - RETURN VALUE: Indicates whether this opcode type returns a value
+ * as the function return (0 or 1).
+ *
+ * The AcpiExOpcode* functions are called via the Dispatcher component with
+ * fully resolved operands.
+!*/


+
+
+/*******************************************************************************
+ *

+ * FUNCTION: Acpi_ex_do_match
+ *
+ * PARAMETERS: Match_op - The AML match operand
+ * Package_value - Value from the target package
+ * Match_value - Value to be matched
+ *
+ * RETURN: TRUE if the match is successful, FALSE otherwise
+ *
+ * DESCRIPTION: Implements the low-level match for the ASL Match operator


+ *
+ ******************************************************************************/
+

+u8
+acpi_ex_do_match (
+ u32 match_op,
+ acpi_integer package_value,
+ acpi_integer match_value)
+{
+
+ switch (match_op) {
+ case MATCH_MTR: /* always true */
+
+ break;
+
+
+ case MATCH_MEQ: /* true if equal */
+
+ if (package_value != match_value) {
+ return (FALSE);
+ }
+ break;
+
+
+ case MATCH_MLE: /* true if less than or equal */
+
+ if (package_value > match_value) {
+ return (FALSE);
+ }
+ break;
+
+
+ case MATCH_MLT: /* true if less than */
+
+ if (package_value >= match_value) {
+ return (FALSE);
+ }
+ break;
+
+
+ case MATCH_MGE: /* true if greater than or equal */
+
+ if (package_value < match_value) {
+ return (FALSE);
+ }
+ break;
+
+
+ case MATCH_MGT: /* true if greater than */
+
+ if (package_value <= match_value) {
+ return (FALSE);
+ }
+ break;
+
+
+ default: /* undefined */
+
+ return (FALSE);
+ }
+
+


+ return TRUE;
+}
+

+
+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ex_opcode_6A_0T_1R
+ *
+ * PARAMETERS: Walk_state - Current walk state


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Execute opcode with 6 arguments, no target, and a return value


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_opcode_6A_0T_1R (
+ acpi_walk_state *walk_state)
+{
+ acpi_operand_object **operand = &walk_state->operands[0];
+ acpi_operand_object *return_desc = NULL;
+ acpi_status status = AE_OK;
+ u32 index;
+ acpi_operand_object *this_element;
+
+
+ FUNCTION_TRACE_STR ("Ex_opcode_6A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+
+
+ switch (walk_state->opcode) {
+ case AML_MATCH_OP:
+ /*
+ * Match (Search_package[0], Match_op1[1], Match_object1[2],
+ * Match_op2[3], Match_object2[4], Start_index[5])
+ */
+
+ /* Validate match comparison sub-opcodes */
+
+ if ((operand[1]->integer.value > MAX_MATCH_OPERATOR) ||
+ (operand[3]->integer.value > MAX_MATCH_OPERATOR)) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "operation encoding out of range\n"));
+ status = AE_AML_OPERAND_VALUE;


+ goto cleanup;
+ }
+

+ index = (u32) operand[5]->integer.value;
+ if (index >= (u32) operand[0]->package.count) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index beyond package end\n"));
+ status = AE_AML_PACKAGE_LIMIT;


+ goto cleanup;
+ }
+

+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
+ if (!return_desc) {


+ status = AE_NO_MEMORY;
+ goto cleanup;

+
+ }
+
+ /* Default return value if no match found */
+
+ return_desc->integer.value = ACPI_INTEGER_MAX;
+
+ /*
+ * Examine each element until a match is found. Within the loop,
+ * "continue" signifies that the current element does not match
+ * and the next should be examined.
+ * Upon finding a match, the loop will terminate via "break" at
+ * the bottom. If it terminates "normally", Match_value will be -1
+ * (its initial value) indicating that no match was found. When
+ * returned as a Number, this will produce the Ones value as specified.
+ */
+ for ( ; index < operand[0]->package.count; index++) {
+ this_element = operand[0]->package.elements[index];
+
+ /*
+ * Treat any NULL or non-numeric elements as non-matching.
+ * TBD [Unhandled] - if an element is a Name,
+ * should we examine its value?
+ */
+ if (!this_element ||
+ this_element->common.type != ACPI_TYPE_INTEGER) {
+ continue;
+ }
+
+
+ /*
+ * Within these switch statements:
+ * "break" (exit from the switch) signifies a match;
+ * "continue" (proceed to next iteration of enclosing
+ * "for" loop) signifies a non-match.
+ */
+ if (!acpi_ex_do_match ((u32) operand[1]->integer.value,
+ this_element->integer.value, operand[2]->integer.value)) {


+ continue;
+ }
+
+

+ if (!acpi_ex_do_match ((u32) operand[3]->integer.value,
+ this_element->integer.value, operand[4]->integer.value)) {
+ continue;
+ }
+
+ /* Match found: Index is the return value */
+
+ return_desc->integer.value = index;
+ break;
+ }
+
+ break;
+
+
+ case AML_LOAD_TABLE_OP:
+
+ status = AE_NOT_IMPLEMENTED;
+ goto cleanup;
+ break;
+
+
+ default:
+
+ REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n",
+ walk_state->opcode));
+ status = AE_AML_BAD_OPCODE;
+ goto cleanup;


+ break;
+ }
+
+

+ walk_state->result_obj = return_desc;
+
+
+cleanup:
+
+ /* Delete return object on error */
+
+ if (ACPI_FAILURE (status)) {
+ acpi_ut_remove_reference (return_desc);
+ }
+
+ return_ACPI_STATUS (status);
+}
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exprep.c linux/drivers/acpi/executer/exprep.c
--- v2.4.13/linux/drivers/acpi/executer/exprep.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exprep.c Wed Oct 24 14:06:22 2001
@@ -2,7 +2,7 @@
X /******************************************************************************
X *
X * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
- * $Revision: 95 $
+ * $Revision: 99 $


X *
X *****************************************************************************/
X

@@ -243,7 +243,7 @@


X
X /*******************************************************************************
X *

- * FUNCTION: Acpi_ex_prep_region_field_value
+ * FUNCTION: Acpi_ex_prep_field_value
X *
X * PARAMETERS: Node - Owning Node
X * Region_node - Region in which field is being defined
@@ -253,280 +253,128 @@
X *


X * RETURN: Status
X *

- * DESCRIPTION: Construct an acpi_operand_object of type Def_field and
+ * DESCRIPTION: Construct an acpi_operand_object of type Def_field and
X * connect it to the parent Node.


X *
X ******************************************************************************/
X

X acpi_status
-acpi_ex_prep_region_field_value (
- acpi_namespace_node *node,
- acpi_handle region_node,
- u8 field_flags,
- u32 field_bit_position,
- u32 field_bit_length)
+acpi_ex_prep_field_value (
+ ACPI_CREATE_FIELD_INFO *info)
X {
X acpi_operand_object *obj_desc;
X u32 type;


X acpi_status status;
X
X

- FUNCTION_TRACE ("Ex_prep_region_field_value");
+ FUNCTION_TRACE ("Ex_prep_field_value");
X
X

X /* Parameter validation */
X

- if (!region_node) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Region_node\n"));
- return_ACPI_STATUS (AE_AML_NO_OPERAND);
- }
+ if (info->field_type != INTERNAL_TYPE_INDEX_FIELD) {
+ if (!info->region_node) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Region_node\n"));
+ return_ACPI_STATUS (AE_AML_NO_OPERAND);
+ }
+
+ type = acpi_ns_get_type (info->region_node);
+ if (type != ACPI_TYPE_REGION) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X %s\n",
+ type, acpi_ut_get_type_name (type)));
X
- type = acpi_ns_get_type (region_node);
- if (type != ACPI_TYPE_REGION) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X %s\n",
- type, acpi_ut_get_type_name (type)));
- return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
+ return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
+ }
X }
X
- /* Allocate a new object */
+ /* Allocate a new region object */
X
- obj_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_REGION_FIELD);
+ obj_desc = acpi_ut_create_internal_object (info->field_type);
X if (!obj_desc) {
X return_ACPI_STATUS (AE_NO_MEMORY);
X }
X
-
- /* Obj_desc and Region valid */
-
- DUMP_OPERANDS ((acpi_operand_object **) &node, IMODE_EXECUTE,
- "Ex_prep_region_field_value", 1, "case Region_field");
- DUMP_OPERANDS ((acpi_operand_object **) &region_node, IMODE_EXECUTE,
- "Ex_prep_region_field_value", 1, "case Region_field");
-
X /* Initialize areas of the object that are common to all fields */
X
- status = acpi_ex_prep_common_field_object (obj_desc, field_flags,
- field_bit_position, field_bit_length);
+ status = acpi_ex_prep_common_field_object (obj_desc, info->field_flags,
+ info->field_bit_position, info->field_bit_length);
X if (ACPI_FAILURE (status)) {
+ acpi_ut_delete_object_desc (obj_desc);


X return_ACPI_STATUS (status);
X }
X

- /* Initialize areas of the object that are specific to this field type */
-
- obj_desc->field.region_obj = acpi_ns_get_attached_object (region_node);
-
- /* An additional reference for the container */
+ /* Initialize areas of the object that are specific to the field type */
X
- acpi_ut_add_reference (obj_desc->field.region_obj);
+ switch (info->field_type) {
+ case INTERNAL_TYPE_REGION_FIELD:
X
+ obj_desc->field.region_obj = acpi_ns_get_attached_object (info->region_node);
X
- /* Debug info */
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Bitoff=%X Off=%X Gran=%X Region %p\n",
- obj_desc->field.start_field_bit_offset, obj_desc->field.base_byte_offset,
- obj_desc->field.access_bit_width, obj_desc->field.region_obj));
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "set Named_obj %p (%4.4s) val = %p\n",
- node, &(node->name), obj_desc));
+ /* An additional reference for the container */
X
+ acpi_ut_add_reference (obj_desc->field.region_obj);
X
- /*
- * Store the constructed descriptor (Obj_desc) into the parent Node,
- * preserving the current type of that Named_obj.
- */
- status = acpi_ns_attach_object (node, obj_desc, (u8) acpi_ns_get_type (node));


- return_ACPI_STATUS (status);
-}
-

-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_ex_prep_bank_field_value
- *
- * PARAMETERS: Node - Owning Node
- * Region_node - Region in which field is being defined
- * Bank_register_node - Bank selection register node
- * Bank_val - Value to store in selection register
- * Field_flags - Access, Lock_rule, and Update_rule
- * Field_bit_position - Field start position
- * Field_bit_length - Field length in number of bits
- *
- * RETURN: Status
- *
- * DESCRIPTION: Construct an object of type Bank_field and attach it to the
- * parent Node.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ex_prep_bank_field_value (
- acpi_namespace_node *node,
- acpi_namespace_node *region_node,
- acpi_namespace_node *bank_register_node,
- u32 bank_val,
- u8 field_flags,
- u32 field_bit_position,
- u32 field_bit_length)
-{
- acpi_operand_object *obj_desc;
- u32 type;
- acpi_status status;
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Region_field: Bitoff=%X Off=%X Gran=%X Region %p\n",
+ obj_desc->field.start_field_bit_offset, obj_desc->field.base_byte_offset,
+ obj_desc->field.access_bit_width, obj_desc->field.region_obj));
+ break;
X
X
- FUNCTION_TRACE ("Ex_prep_bank_field_value");
+ case INTERNAL_TYPE_BANK_FIELD:
X
+ obj_desc->bank_field.value = info->bank_value;
+ obj_desc->bank_field.region_obj = acpi_ns_get_attached_object (info->region_node);
+ obj_desc->bank_field.bank_register_obj = acpi_ns_get_attached_object (info->register_node);
X
- /* Parameter validation */
+ /* An additional reference for the attached objects */
X
- if (!region_node) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Region_node\n"));
- return_ACPI_STATUS (AE_AML_NO_OPERAND);
- }
+ acpi_ut_add_reference (obj_desc->bank_field.region_obj);
+ acpi_ut_add_reference (obj_desc->bank_field.bank_register_obj);
X
- type = acpi_ns_get_type (region_node);
- if (type != ACPI_TYPE_REGION) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X %s\n",
- type, acpi_ut_get_type_name (type)));
- return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
- }
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Bank Field: Bit_off=%X Off=%X Gran=%X Region %p Bank_reg %p\n",
+ obj_desc->bank_field.start_field_bit_offset, obj_desc->bank_field.base_byte_offset,
+ obj_desc->field.access_bit_width, obj_desc->bank_field.region_obj,
+ obj_desc->bank_field.bank_register_obj));
+ break;
X
- /* Allocate a new object */
X
- obj_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_BANK_FIELD);
- if (!obj_desc) {
- return_ACPI_STATUS (AE_NO_MEMORY);
- }
+ case INTERNAL_TYPE_INDEX_FIELD:
X
- /* Obj_desc and Region valid */
+ obj_desc->index_field.index_obj = acpi_ns_get_attached_object (info->register_node);
+ obj_desc->index_field.data_obj = acpi_ns_get_attached_object (info->data_register_node);
+ obj_desc->index_field.value = (u32) (info->field_bit_position /
+ obj_desc->field.access_bit_width);
+
+ if (!obj_desc->index_field.data_obj || !obj_desc->index_field.index_obj) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Index Object\n"));
+ return_ACPI_STATUS (AE_AML_INTERNAL);
+ }
X
- DUMP_OPERANDS ((acpi_operand_object **) &node, IMODE_EXECUTE,
- "Ex_prep_bank_field_value", 1, "case Bank_field");
- DUMP_OPERANDS ((acpi_operand_object **) &region_node, IMODE_EXECUTE,
- "Ex_prep_bank_field_value", 1, "case Bank_field");
+ /* An additional reference for the attached objects */
X
- /* Initialize areas of the object that are common to all fields */
+ acpi_ut_add_reference (obj_desc->index_field.data_obj);
+ acpi_ut_add_reference (obj_desc->index_field.index_obj);
X
- status = acpi_ex_prep_common_field_object (obj_desc, field_flags,
- field_bit_position, field_bit_length);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);

+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Index_field: bitoff=%X off=%X gran=%X Index %p Data %p\n",
+ obj_desc->index_field.start_field_bit_offset, obj_desc->index_field.base_byte_offset,
+ obj_desc->field.access_bit_width, obj_desc->index_field.index_obj,
+ obj_desc->index_field.data_obj));
+ break;
X }
X
- /* Initialize areas of the object that are specific to this field type */
-
- obj_desc->bank_field.value = bank_val;
- obj_desc->bank_field.region_obj = acpi_ns_get_attached_object (region_node);
- obj_desc->bank_field.bank_register_obj = acpi_ns_get_attached_object (bank_register_node);
-
- /* An additional reference for the attached objects */
-
- acpi_ut_add_reference (obj_desc->bank_field.region_obj);
- acpi_ut_add_reference (obj_desc->bank_field.bank_register_obj);
-
- /* Debug info */
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Bit_off=%X Off=%X Gran=%X Region %p Bank_reg %p\n",
- obj_desc->bank_field.start_field_bit_offset, obj_desc->bank_field.base_byte_offset,
- obj_desc->field.access_bit_width, obj_desc->bank_field.region_obj,
- obj_desc->bank_field.bank_register_obj));
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Set Named_obj %p (%4.4s) val=%p\n",
- node, &(node->name), obj_desc));
-
-
X /*
X * Store the constructed descriptor (Obj_desc) into the parent Node,
X * preserving the current type of that Named_obj.
X */
- status = acpi_ns_attach_object (node, obj_desc, (u8) acpi_ns_get_type (node));


- return_ACPI_STATUS (status);
-}
-

-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_ex_prep_index_field_value
- *
- * PARAMETERS: Node - Owning Node
- * Index_reg - Index register
- * Data_reg - Data register
- * Field_flags - Access, Lock_rule, and Update_rule
- * Field_bit_position - Field start position
- * Field_bit_length - Field length in number of bits
- *
- * RETURN: Status
- *
- * DESCRIPTION: Construct an acpi_operand_object of type Index_field and
- * connect it to the parent Node.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ex_prep_index_field_value (
- acpi_namespace_node *node,
- acpi_namespace_node *index_reg,
- acpi_namespace_node *data_reg,
- u8 field_flags,
- u32 field_bit_position,
- u32 field_bit_length)
-{
- acpi_operand_object *obj_desc;


- acpi_status status;
-
-

- FUNCTION_TRACE ("Ex_prep_index_field_value");
-
-
- /* Parameter validation */
-
- if (!index_reg || !data_reg) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null handle\n"));
- return_ACPI_STATUS (AE_AML_NO_OPERAND);
- }
-
- /* Allocate a new object descriptor */
-
- obj_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_INDEX_FIELD);
- if (!obj_desc) {


- return_ACPI_STATUS (AE_NO_MEMORY);
- }
-

- /* Initialize areas of the object that are common to all fields */
-
- status = acpi_ex_prep_common_field_object (obj_desc, field_flags,
- field_bit_position, field_bit_length);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

- /* Initialize areas of the object that are specific to this field type */
-
- obj_desc->index_field.data_obj = acpi_ns_get_attached_object (data_reg);
- obj_desc->index_field.index_obj = acpi_ns_get_attached_object (index_reg);
- obj_desc->index_field.value = (u32) (field_bit_position /
- obj_desc->field.access_bit_width);
-
- /* An additional reference for the attached objects */
-
- acpi_ut_add_reference (obj_desc->index_field.data_obj);
- acpi_ut_add_reference (obj_desc->index_field.index_obj);
-
- /* Debug info */
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "bitoff=%X off=%X gran=%X Index %p Data %p\n",
- obj_desc->index_field.start_field_bit_offset, obj_desc->index_field.base_byte_offset,
- obj_desc->field.access_bit_width, obj_desc->index_field.index_obj,
- obj_desc->index_field.data_obj));
+ status = acpi_ns_attach_object (info->field_node, obj_desc,
+ (u8) acpi_ns_get_type (info->field_node));


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 16'
echo 'File patch-2.4.14 is continued in part 17'
echo "17" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:38 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part15

#!/bin/sh -x
# this is part 15 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 15; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X * evaluate them now and save the results.
@@ -84,7 +83,6 @@
X }
X }
X
-
X /*
X * Validate the request. The entire request from the byte offset for a
X * length of one field datum (access width) must fit within the region.
@@ -158,7 +156,6 @@
X
X *value = 0;
X
-
X /*
X * Buffer_fields - Read from a Buffer
X * Other Fields - Read from a Operation Region.
@@ -189,7 +186,6 @@


X return_ACPI_STATUS (status);
X }
X
-

X /*
X * The physical address of this field datum is:
X *
@@ -201,13 +197,12 @@
X address = rgn_desc->region.address + obj_desc->common_field.base_byte_offset +
X field_datum_byte_offset;
X
- ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Region %s(%X) width %X base:off %X:%X at %8.8lX%8.8lX\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Region %s(%X) width %X base:off %X:%X at %8.8X%8.8X\n",
X acpi_ut_get_region_name (rgn_desc->region.space_id),
X rgn_desc->region.space_id, obj_desc->common_field.access_bit_width,
X obj_desc->common_field.base_byte_offset, field_datum_byte_offset,
X HIDWORD(address), LODWORD(address)));
X
-
X /* Invoke the appropriate Address_space/Op_region handler */
X
X status = acpi_ev_address_space_dispatch (rgn_desc, ACPI_READ_ADR_SPACE,
@@ -235,7 +230,7 @@
X }
X
X
- ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Returned value=%08lX \n", *value));
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Returned value=%08X \n", *value));


X
X return_ACPI_STATUS (status);
X }

@@ -381,7 +376,6 @@
X byte_field_length, datum_count, obj_desc->common_field.access_bit_width,
X obj_desc->common_field.access_byte_width));
X
-
X /*
X * Clear the caller's buffer (the whole buffer length as given)
X * This is very important, especially in the cases where a byte is read,
@@ -485,7 +479,6 @@
X }
X }
X
-
X /*
X * Store the merged field datum in the caller's buffer, according to
X * the granularity of the field (size of each datum).
@@ -501,7 +494,6 @@
X datum_offset++;
X }
X
-


X return_ACPI_STATUS (AE_OK);
X }
X

@@ -576,7 +568,7 @@
X field_datum_byte_offset;
X
X ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Store %X in Region %s(%X) at %8.8lX%8.8lX width %X\n",
+ "Store %X in Region %s(%X) at %8.8X%8.8X width %X\n",
X value, acpi_ut_get_region_name (rgn_desc->region.space_id),
X rgn_desc->region.space_id, HIDWORD(address), LODWORD(address),
X obj_desc->common_field.access_bit_width));
@@ -612,7 +604,7 @@
X }
X
X
- ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value written=%08lX \n", value));
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value written=%08X \n", value));


X return_ACPI_STATUS (status);
X }
X

@@ -649,16 +641,13 @@
X
X merged_value = field_value;
X
-
X /* If the mask is all ones, we don't need to worry about the update rule */
X
X if (mask != ACPI_UINT32_MAX) {
X /* Decode the update rule */
X
X switch (obj_desc->common_field.update_rule) {
-
X case UPDATE_PRESERVE:
-
X /*
X * Check if update rule needs to be applied (not if mask is all
X * ones) The left shift drops the bits we want to ignore.
@@ -772,7 +761,6 @@
X byte_field_length, datum_count, obj_desc->common_field.access_bit_width,
X obj_desc->common_field.access_byte_width));
X
-
X /*
X * Break the request into up to three parts (similar to an I/O request):
X * 1) non-aligned part at start
@@ -868,31 +856,34 @@
X merged_datum = this_raw_datum;
X }
X
-
X /*
X * Special handling for the last datum if the field does NOT end on
X * a datum boundary. Update Rule must be applied to the bits outside
X * the field.
X */
- if ((datum_offset == datum_count) &&
- obj_desc->common_field.end_field_valid_bits) {
+ if (datum_offset == datum_count) {
X /*
- * Part3:
- * This is the last datum and the field does not end on a datum boundary.
- * Build the partial datum and write with the update rule.
+ * If there are dangling non-aligned bits, perform one more merged write
+ * Else - field is aligned at the end, no need for any more writes
X */
+ if (obj_desc->common_field.end_field_valid_bits) {
+ /*
+ * Part3:
+ * This is the last datum and the field does not end on a datum boundary.
+ * Build the partial datum and write with the update rule.
+ *
+ * Mask off the unused bits above (after) the end-of-field
+ */
+ mask = MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits);
+ merged_datum &= mask;
X
- /* Mask off the unused bits above (after) the end-of-field */
-
- mask = MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits);
- merged_datum &= mask;
-
- /* Write the last datum with the update rule */
+ /* Write the last datum with the update rule */
X
- status = acpi_ex_write_field_datum_with_update_rule (obj_desc, mask,
- merged_datum, field_datum_byte_offset);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);

+ status = acpi_ex_write_field_datum_with_update_rule (obj_desc, mask,
+ merged_datum, field_datum_byte_offset);


+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }

X }
X }
X
@@ -912,7 +903,6 @@
X */
X previous_raw_datum = this_raw_datum;
X }
-
X
X return_ACPI_STATUS (status);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exmisc.c linux/drivers/acpi/executer/exmisc.c
--- v2.4.13/linux/drivers/acpi/executer/exmisc.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exmisc.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
- * $Revision: 83 $
+ * $Revision: 92 $


X *
X *****************************************************************************/
X

@@ -38,424 +38,403 @@


X
X /*******************************************************************************
X *

- * FUNCTION: Acpi_ex_triadic
+ * FUNCTION: Acpi_ex_get_object_reference
X *
- * PARAMETERS: Opcode - The opcode to be executed
- * Walk_state - Current walk state
- * Return_desc - Where to store the return object
+ * PARAMETERS: Obj_desc - Create a reference to this object
+ * Return_desc - Where to store the reference


X *
X * RETURN: Status
X *

- * DESCRIPTION: Execute Triadic operator (3 operands)
- *
- * ALLOCATION: Deletes one operand descriptor -- other remains on stack
+ * DESCRIPTION: Obtain and return a "reference" to the target object
+ * Common code for the Ref_of_op and the Cond_ref_of_op.


X *
X ******************************************************************************/
X
X acpi_status

-acpi_ex_triadic (
- u16 opcode,
- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc)
+acpi_ex_get_object_reference (
+ acpi_operand_object *obj_desc,
+ acpi_operand_object **return_desc,
+ acpi_walk_state *walk_state)
X {
- acpi_operand_object **operand = &walk_state->operands[0];
- acpi_operand_object *ret_desc = NULL;
- acpi_operand_object *tmp_desc;
- ACPI_SIGNAL_FATAL_INFO *fatal;


X acpi_status status = AE_OK;

X
X
- FUNCTION_TRACE ("Ex_triadic");
-
-
-#define obj_desc1 operand[0]
-#define obj_desc2 operand[1]
-#define res_desc operand[2]
-
-
- switch (opcode) {
-
- case AML_FATAL_OP:
-
- /* Def_fatal := Fatal_op Fatal_type Fatal_code Fatal_arg */
+ FUNCTION_TRACE_PTR ("Ex_get_object_reference", obj_desc);
X
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Fatal_op: Type %x Code %x Arg %x <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
- (u32) obj_desc1->integer.value, (u32) obj_desc2->integer.value,
- (u32) res_desc->integer.value));
X
-
- fatal = ACPI_MEM_ALLOCATE (sizeof (ACPI_SIGNAL_FATAL_INFO));
- if (fatal) {
- fatal->type = (u32) obj_desc1->integer.value;
- fatal->code = (u32) obj_desc2->integer.value;
- fatal->argument = (u32) res_desc->integer.value;
+ if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_INTERNAL)) {
+ if (obj_desc->common.type != INTERNAL_TYPE_REFERENCE) {
+ *return_desc = NULL;


+ status = AE_TYPE;
+ goto cleanup;

X }
X
X /*
- * Signal the OS


+ * Not a Name -- an indirect name pointer would have

+ * been converted to a direct name pointer in Acpi_ex_resolve_operands
X */
- acpi_os_signal (ACPI_SIGNAL_FATAL, fatal);
-
- /* Might return while OS is shutting down */
-
- ACPI_MEM_FREE (fatal);
- break;
-
+ switch (obj_desc->reference.opcode) {


+ case AML_LOCAL_OP:
+ case AML_ARG_OP:

X
- case AML_MID_OP:
-
- /* Def_mid := Mid_op Source Index Length Result */
-
- /* Create the internal return object (string or buffer) */
-
- break;
-
-
- case AML_INDEX_OP:
-
- /* Def_index := Index_op Source Index Destination */
+ *return_desc = (void *) acpi_ds_method_data_get_node (obj_desc->reference.opcode,
+ obj_desc->reference.offset, walk_state);
+ break;
X
- /* Create the internal return object */
+ default:
X
- ret_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE);
- if (!ret_desc) {
- status = AE_NO_MEMORY;
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(Internal) Unknown Ref subtype %02x\n",
+ obj_desc->reference.opcode));
+ *return_desc = NULL;
+ status = AE_AML_INTERNAL;
X goto cleanup;
X }
X
- /*
- * At this point, the Obj_desc1 operand is either a Package or a Buffer
- */
- if (obj_desc1->common.type == ACPI_TYPE_PACKAGE) {
- /* Object to be indexed is a Package */
+ }
X
- if (obj_desc2->integer.value >= obj_desc1->package.count) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value beyond package end\n"));
- status = AE_AML_PACKAGE_LIMIT;


- goto cleanup;
- }
-

- if ((res_desc->common.type == INTERNAL_TYPE_REFERENCE) &&
- (res_desc->reference.opcode == AML_ZERO_OP)) {
- /*
- * There is no actual result descriptor (the Zero_op Result
- * descriptor is a placeholder), so just delete the placeholder and
- * return a reference to the package element
- */
- acpi_ut_remove_reference (res_desc);
- }


-
- else {
- /*

- * Each element of the package is an internal object. Get the one
- * we are after.
- */
- tmp_desc = obj_desc1->package.elements[obj_desc2->integer.value];
- ret_desc->reference.opcode = AML_INDEX_OP;
- ret_desc->reference.target_type = tmp_desc->common.type;
- ret_desc->reference.object = tmp_desc;
-
- status = acpi_ex_store (ret_desc, res_desc, walk_state);
- ret_desc->reference.object = NULL;
- }
+ else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) {
+ /* Must be a named object; Just return the Node */
X
- /*
- * The local return object must always be a reference to the package element,
- * not the element itself.
- */
- ret_desc->reference.opcode = AML_INDEX_OP;
- ret_desc->reference.target_type = ACPI_TYPE_PACKAGE;
- ret_desc->reference.where = &obj_desc1->package.elements[obj_desc2->integer.value];
- }
-
- else {
- /* Object to be indexed is a Buffer */
-
- if (obj_desc2->integer.value >= obj_desc1->buffer.length) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value beyond end of buffer\n"));
- status = AE_AML_BUFFER_LIMIT;


- goto cleanup;
- }
-

- ret_desc->reference.opcode = AML_INDEX_OP;
- ret_desc->reference.target_type = ACPI_TYPE_BUFFER_FIELD;
- ret_desc->reference.object = obj_desc1;
- ret_desc->reference.offset = (u32) obj_desc2->integer.value;
+ *return_desc = obj_desc;
+ }
X
- status = acpi_ex_store (ret_desc, res_desc, walk_state);
- }
- break;
+ else {
+ *return_desc = NULL;
+ status = AE_TYPE;
X }
X
X
X cleanup:
X
- /* Always delete operands */
-
- acpi_ut_remove_reference (obj_desc1);
- acpi_ut_remove_reference (obj_desc2);
-
- /* Delete return object on error */
-
- if (ACPI_FAILURE (status)) {
- acpi_ut_remove_reference (res_desc);
-
- if (ret_desc) {
- acpi_ut_remove_reference (ret_desc);
- ret_desc = NULL;
- }
- }
-
- /* Set the return object and exit */
-
- *return_desc = ret_desc;
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p Ref=%p\n", obj_desc, *return_desc));


X return_ACPI_STATUS (status);
X }
X

X
X /*******************************************************************************
X *

- * FUNCTION: Acpi_ex_hexadic
+ * FUNCTION: Acpi_ex_do_concatenate
X *
- * PARAMETERS: Opcode - The opcode to be executed
+ * PARAMETERS: *Obj_desc - Object to be converted. Must be an
+ * Integer, Buffer, or String
X * Walk_state - Current walk state
- * Return_desc - Where to store the return object


X *
X * RETURN: Status
X *

- * DESCRIPTION: Execute Match operator
+ * DESCRIPTION: Concatenate two objects OF THE SAME TYPE.


X *
X ******************************************************************************/
X
X acpi_status

-acpi_ex_hexadic (
- u16 opcode,
- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc)
+acpi_ex_do_concatenate (
+ acpi_operand_object *obj_desc,
+ acpi_operand_object *obj_desc2,
+ acpi_operand_object **actual_return_desc,
+ acpi_walk_state *walk_state)
X {
- acpi_operand_object **operand = &walk_state->operands[0];
- acpi_operand_object *ret_desc = NULL;
- acpi_status status = AE_OK;
- u32 index;
- u32 match_value = (u32) -1;
+ acpi_status status;
+ u32 i;
+ acpi_integer this_integer;
+ acpi_operand_object *return_desc;
+ NATIVE_CHAR *new_buf;
+ u32 integer_size = sizeof (acpi_integer);
X
X
- FUNCTION_TRACE ("Ex_hexadic");
+ FUNCTION_ENTRY ();
X
-#define pkg_desc operand[0]
-#define op1_desc operand[1]
-#define V1_desc operand[2]
-#define op2_desc operand[3]
-#define V2_desc operand[4]
-#define start_desc operand[5]
X
+ /*
+ * There are three cases to handle:
+ * 1) Two Integers concatenated to produce a buffer
+ * 2) Two Strings concatenated to produce a string
+ * 3) Two Buffers concatenated to produce a buffer
+ */
+ switch (obj_desc->common.type) {
+ case ACPI_TYPE_INTEGER:
X
- switch (opcode) {
+ /* Handle both ACPI 1.0 and ACPI 2.0 Integer widths */
X
- case AML_MATCH_OP:
+ if (walk_state->method_node->flags & ANOBJ_DATA_WIDTH_32) {
+ /*
+ * We are running a method that exists in a 32-bit ACPI table.
+ * Truncate the value to 32 bits by zeroing out the upper
+ * 32-bit field
+ */
+ integer_size = sizeof (u32);
+ }
X
- /* Validate match comparison sub-opcodes */
+ /* Result of two integers is a buffer */
X
- if ((op1_desc->integer.value > MAX_MATCH_OPERATOR) ||
- (op2_desc->integer.value > MAX_MATCH_OPERATOR)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "operation encoding out of range\n"));
- status = AE_AML_OPERAND_VALUE;
- goto cleanup;
+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER);
+ if (!return_desc) {
+ return (AE_NO_MEMORY);
X }
X
- index = (u32) start_desc->integer.value;
- if (index >= (u32) pkg_desc->package.count) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Start position value out of range\n"));
- status = AE_AML_PACKAGE_LIMIT;
+ /* Need enough space for two integers */
+
+ return_desc->buffer.length = integer_size * 2;
+ new_buf = ACPI_MEM_CALLOCATE (return_desc->buffer.length);
+ if (!new_buf) {
+ REPORT_ERROR
+ (("Ex_do_concatenate: Buffer allocation failure\n"));
+ status = AE_NO_MEMORY;


X goto cleanup;
X }
X

- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
- if (!ret_desc) {
+ return_desc->buffer.pointer = (u8 *) new_buf;
+
+ /* Convert the first integer */
+
+ this_integer = obj_desc->integer.value;
+ for (i = 0; i < integer_size; i++) {
+ new_buf[i] = (u8) this_integer;
+ this_integer >>= 8;
+ }
+
+ /* Convert the second integer */
+
+ this_integer = obj_desc2->integer.value;
+ for (; i < (integer_size * 2); i++) {
+ new_buf[i] = (u8) this_integer;
+ this_integer >>= 8;


+ }
+
+ break;
+
+

+ case ACPI_TYPE_STRING:
+
+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING);
+ if (!return_desc) {


+ return (AE_NO_MEMORY);
+ }
+

+ /* Operand0 is string */
+
+ new_buf = ACPI_MEM_ALLOCATE (obj_desc->string.length +
+ obj_desc2->string.length + 1);
+ if (!new_buf) {
+ REPORT_ERROR
+ (("Ex_do_concatenate: String allocation failure\n"));
X status = AE_NO_MEMORY;
X goto cleanup;
+ }
+
+ STRCPY (new_buf, obj_desc->string.pointer);
+ STRCPY (new_buf + obj_desc->string.length,
+ obj_desc2->string.pointer);
+
+ /* Point the return object to the new string */
+
+ return_desc->string.pointer = new_buf;
+ return_desc->string.length = obj_desc->string.length +=
+ obj_desc2->string.length;
+ break;
+
+
+ case ACPI_TYPE_BUFFER:
+
+ /* Operand0 is a buffer */
+
+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER);
+ if (!return_desc) {
+ return (AE_NO_MEMORY);
+ }
X
+ new_buf = ACPI_MEM_ALLOCATE (obj_desc->buffer.length +
+ obj_desc2->buffer.length);
+ if (!new_buf) {
+ REPORT_ERROR
+ (("Ex_do_concatenate: Buffer allocation failure\n"));


+ status = AE_NO_MEMORY;
+ goto cleanup;
X }
X

+ MEMCPY (new_buf, obj_desc->buffer.pointer,
+ obj_desc->buffer.length);
+ MEMCPY (new_buf + obj_desc->buffer.length, obj_desc2->buffer.pointer,
+ obj_desc2->buffer.length);
+
X /*
- * Examine each element until a match is found. Within the loop,
- * "continue" signifies that the current element does not match
- * and the next should be examined.
- * Upon finding a match, the loop will terminate via "break" at
- * the bottom. If it terminates "normally", Match_value will be -1
- * (its initial value) indicating that no match was found. When
- * returned as a Number, this will produce the Ones value as specified.
+ * Point the return object to the new buffer
X */
- for ( ; index < pkg_desc->package.count; ++index) {
- /*
- * Treat any NULL or non-numeric elements as non-matching.
- * TBD [Unhandled] - if an element is a Name,
- * should we examine its value?
- */
- if (!pkg_desc->package.elements[index] ||
- ACPI_TYPE_INTEGER != pkg_desc->package.elements[index]->common.type) {
- continue;
- }
X
- /*
- * Within these switch statements:
- * "break" (exit from the switch) signifies a match;
- * "continue" (proceed to next iteration of enclosing
- * "for" loop) signifies a non-match.
- */
- switch (op1_desc->integer.value) {
+ return_desc->buffer.pointer = (u8 *) new_buf;
+ return_desc->buffer.length = obj_desc->buffer.length +
+ obj_desc2->buffer.length;
+ break;
X
- case MATCH_MTR: /* always true */
X
- break;


+ default:
+ status = AE_AML_INTERNAL;

+ return_desc = NULL;
+ }
X
X
- case MATCH_MEQ: /* true if equal */
+ *actual_return_desc = return_desc;
+ return (AE_OK);
X
- if (pkg_desc->package.elements[index]->integer.value
- != V1_desc->integer.value) {
- continue;
- }
- break;
X
+cleanup:
X
- case MATCH_MLE: /* true if less than or equal */
+ acpi_ut_remove_reference (return_desc);
+ return (status);
+}
X
- if (pkg_desc->package.elements[index]->integer.value
- > V1_desc->integer.value) {
- continue;
- }
- break;
X
+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ex_do_math_op
+ *
+ * PARAMETERS: Opcode - AML opcode
+ * Operand0 - Integer operand #0
+ * Operand0 - Integer operand #1
+ *
+ * RETURN: Integer result of the operation
+ *
+ * DESCRIPTION: Execute a math AML opcode. The purpose of having all of the
+ * math functions here is to prevent a lot of pointer dereferencing
+ * to obtain the operands.


+ *
+ ******************************************************************************/
X

- case MATCH_MLT: /* true if less than */
+acpi_integer
+acpi_ex_do_math_op (
+ u16 opcode,
+ acpi_integer operand0,
+ acpi_integer operand1)
+{
X
- if (pkg_desc->package.elements[index]->integer.value
- >= V1_desc->integer.value) {
- continue;
- }
- break;
X
+ switch (opcode) {
+ case AML_ADD_OP: /* Add (Operand0, Operand1, Result) */
X
- case MATCH_MGE: /* true if greater than or equal */
+ return (operand0 + operand1);
X
- if (pkg_desc->package.elements[index]->integer.value
- < V1_desc->integer.value) {
- continue;
- }
- break;
X
+ case AML_BIT_AND_OP: /* And (Operand0, Operand1, Result) */
X
- case MATCH_MGT: /* true if greater than */
+ return (operand0 & operand1);
X
- if (pkg_desc->package.elements[index]->integer.value
- <= V1_desc->integer.value) {
- continue;
- }
- break;
X
+ case AML_BIT_NAND_OP: /* NAnd (Operand0, Operand1, Result) */
X
- default: /* undefined */
+ return (~(operand0 & operand1));
X
- continue;
- }
X
+ case AML_BIT_OR_OP: /* Or (Operand0, Operand1, Result) */
X
- switch(op2_desc->integer.value) {
+ return (operand0 | operand1);
X
- case MATCH_MTR:
X
- break;
+ case AML_BIT_NOR_OP: /* NOr (Operand0, Operand1, Result) */
X
+ return (~(operand0 | operand1));
X
- case MATCH_MEQ:
X
- if (pkg_desc->package.elements[index]->integer.value
- != V2_desc->integer.value) {
- continue;
- }
- break;
+ case AML_BIT_XOR_OP: /* XOr (Operand0, Operand1, Result) */
X
+ return (operand0 ^ operand1);
X
- case MATCH_MLE:
X
- if (pkg_desc->package.elements[index]->integer.value
- > V2_desc->integer.value) {
- continue;
- }
- break;
+ case AML_MULTIPLY_OP: /* Multiply (Operand0, Operand1, Result) */
X
+ return (operand0 * operand1);
X
- case MATCH_MLT:
X
- if (pkg_desc->package.elements[index]->integer.value
- >= V2_desc->integer.value) {
- continue;
- }
- break;
+ case AML_SHIFT_LEFT_OP: /* Shift_left (Operand, Shift_count, Result) */
X
+ return (operand0 << operand1);
X
- case MATCH_MGE:
X
- if (pkg_desc->package.elements[index]->integer.value
- < V2_desc->integer.value) {
- continue;
- }
- break;
+ case AML_SHIFT_RIGHT_OP: /* Shift_right (Operand, Shift_count, Result) */
X
+ return (operand0 >> operand1);
X
- case MATCH_MGT:
X
- if (pkg_desc->package.elements[index]->integer.value
- <= V2_desc->integer.value) {
- continue;
- }
- break;
+ case AML_SUBTRACT_OP: /* Subtract (Operand0, Operand1, Result) */
X
+ return (operand0 - operand1);


X
- default:
+ default:
X

- continue;
- }
+ return (0);
+ }
+}
X
- /* Match found: exit from loop */
X
- match_value = index;
- break;
+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ex_do_logical_op
+ *
+ * PARAMETERS: Opcode - AML opcode
+ * Operand0 - Integer operand #0
+ * Operand0 - Integer operand #1
+ *
+ * RETURN: TRUE/FALSE result of the operation
+ *
+ * DESCRIPTION: Execute a logical AML opcode. The purpose of having all of the
+ * functions here is to prevent a lot of pointer dereferencing
+ * to obtain the operands and to simplify the generation of the
+ * logical value.
+ *
+ * Note: cleanest machine code seems to be produced by the code
+ * below, rather than using statements of the form:
+ * Result = (Operand0 == Operand1);


+ *
+ ******************************************************************************/
+
+u8

+acpi_ex_do_logical_op (
+ u16 opcode,
+ acpi_integer operand0,
+ acpi_integer operand1)
+{
+
+
+ switch (opcode) {
+
+ case AML_LAND_OP: /* LAnd (Operand0, Operand1) */
+
+ if (operand0 && operand1) {
+ return (TRUE);
X }
+ break;
X
- /* Match_value is the return value */
X
- ret_desc->integer.value = match_value;
+ case AML_LEQUAL_OP: /* LEqual (Operand0, Operand1) */
+
+ if (operand0 == operand1) {
+ return (TRUE);
+ }


X break;
X
- }
X

+ case AML_LGREATER_OP: /* LGreater (Operand0, Operand1) */
X
-cleanup:
+ if (operand0 > operand1) {
+ return (TRUE);
+ }
+ break;
X
- /* Free the operands */
X
- acpi_ut_remove_reference (start_desc);
- acpi_ut_remove_reference (V2_desc);
- acpi_ut_remove_reference (op2_desc);
- acpi_ut_remove_reference (V1_desc);
- acpi_ut_remove_reference (op1_desc);
- acpi_ut_remove_reference (pkg_desc);
-
-
- /* Delete return object on error */
-
- if (ACPI_FAILURE (status) &&
- (ret_desc)) {
- acpi_ut_remove_reference (ret_desc);
- ret_desc = NULL;
- }
+ case AML_LLESS_OP: /* LLess (Operand0, Operand1) */
X
+ if (operand0 < operand1) {
+ return (TRUE);
+ }
+ break;
X
- /* Set the return object and exit */
X
- *return_desc = ret_desc;
- return_ACPI_STATUS (status);
+ case AML_LOR_OP: /* LOr (Operand0, Operand1) */
+
+ if (operand0 || operand1) {
+ return (TRUE);


+ }
+ break;
+ }
+

+ return (FALSE);
X }
+
+
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exmonad.c linux/drivers/acpi/executer/exmonad.c
--- v2.4.13/linux/drivers/acpi/executer/exmonad.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exmonad.c Wed Dec 31 16:00:00 1969
@@ -1,970 +0,0 @@
-
-/******************************************************************************
- *
- * Module Name: exmonad - ACPI AML execution for monadic (1 operand) operators
- * $Revision: 111 $
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000, 2001 R. Byron Moore
- *
- * This 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 "acpi.h"
-#include "acparser.h"
-#include "acdispat.h"
-#include "acinterp.h"
-#include "amlcode.h"
-#include "acnamesp.h"
-
-
-#define _COMPONENT ACPI_EXECUTER
- MODULE_NAME ("exmonad")


-
-
-/*******************************************************************************
- *

- * FUNCTION: Acpi_ex_get_object_reference
- *
- * PARAMETERS: Obj_desc - Create a reference to this object
- * Ret_desc - Where to store the reference


- *
- * RETURN: Status
- *

- * DESCRIPTION: Obtain and return a "reference" to the target object
- * Common code for the Ref_of_op and the Cond_ref_of_op.


- *
- ******************************************************************************/
-

-static acpi_status
-acpi_ex_get_object_reference (
- acpi_operand_object *obj_desc,
- acpi_operand_object **ret_desc,
- acpi_walk_state *walk_state)
-{
- acpi_status status = AE_OK;
-
-
- FUNCTION_TRACE_PTR ("Ex_get_object_reference", obj_desc);
-
-
- if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_INTERNAL)) {
- if (obj_desc->common.type != INTERNAL_TYPE_REFERENCE) {
- *ret_desc = NULL;
- status = AE_TYPE;


- goto cleanup;
- }
-
- /*

- * Not a Name -- an indirect name pointer would have
- * been converted to a direct name pointer in Acpi_ex_resolve_operands
- */
- switch (obj_desc->reference.opcode) {
- case AML_LOCAL_OP:
- case AML_ARG_OP:
-
- *ret_desc = (void *) acpi_ds_method_data_get_node (obj_desc->reference.opcode,
- obj_desc->reference.offset, walk_state);
- break;
-
- default:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(Internal) Unknown Ref subtype %02x\n",
- obj_desc->reference.opcode));
- *ret_desc = NULL;
- status = AE_AML_INTERNAL;


- goto cleanup;
- }
-
- }

-
- else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) {
- /* Must be a named object; Just return the Node */
-
- *ret_desc = obj_desc;
- }
-
- else {
- *ret_desc = NULL;
- status = AE_TYPE;
- }
-
-
-cleanup:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p Ref=%p\n", obj_desc, *ret_desc));


- return_ACPI_STATUS (status);
-}
-

-#define obj_desc operand[0]
-#define res_desc operand[1]


-
-
-/*******************************************************************************
- *

- * FUNCTION: Acpi_ex_monadic1
- *
- * PARAMETERS: Opcode - The opcode to be executed


- *
- * RETURN: Status
- *

- * DESCRIPTION: Execute Type 1 monadic operator with numeric operand on
- * object stack


- *
- ******************************************************************************/
-
-acpi_status

-acpi_ex_monadic1 (
- u16 opcode,
- acpi_walk_state *walk_state)
-{
- acpi_operand_object **operand = &walk_state->operands[0];


- acpi_status status;
-
-

- FUNCTION_TRACE_PTR ("Ex_monadic1", WALK_OPERANDS);
-
-
- /* Examine the opcode */
-
- switch (opcode) {
-
- /* Def_release := Release_op Mutex_object */
-
- case AML_RELEASE_OP:
-
- status = acpi_ex_release_mutex (obj_desc, walk_state);
- break;
-
-
- /* Def_reset := Reset_op Acpi_event_object */
-
- case AML_RESET_OP:
-
- status = acpi_ex_system_reset_event (obj_desc);
- break;
-
-
- /* Def_signal := Signal_op Acpi_event_object */
-
- case AML_SIGNAL_OP:
-
- status = acpi_ex_system_signal_event (obj_desc);
- break;
-
-
- /* Def_sleep := Sleep_op Msec_time */
-
- case AML_SLEEP_OP:
-
- acpi_ex_system_do_suspend ((u32) obj_desc->integer.value);
- break;
-
-
- /* Def_stall := Stall_op Usec_time */
-
- case AML_STALL_OP:
-
- acpi_ex_system_do_stall ((u32) obj_desc->integer.value);
- break;
-
-
- /* Unknown opcode */
-
- default:
-
- REPORT_ERROR (("Acpi_ex_monadic1: Unknown monadic opcode %X\n",
- opcode));
- status = AE_AML_BAD_OPCODE;
- break;
-
- } /* switch */
-
-
- /* Always delete the operand */
-
- acpi_ut_remove_reference (obj_desc);
-
- return_ACPI_STATUS (AE_OK);


-}
-
-
-/*******************************************************************************
- *

- * FUNCTION: Acpi_ex_monadic2_r
- *
- * PARAMETERS: Opcode - The opcode to be executed


- *
- * RETURN: Status
- *

- * DESCRIPTION: Execute Type 2 monadic operator with numeric operand and
- * result operand on operand stack


- *
- ******************************************************************************/
-
-acpi_status

-acpi_ex_monadic2_r (
- u16 opcode,
- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc)
-{
- acpi_operand_object **operand = &walk_state->operands[0];
- acpi_operand_object *ret_desc = NULL;
- acpi_operand_object *ret_desc2 = NULL;
- u32 res_val;
- acpi_status status = AE_OK;
- u32 i;
- u32 j;
- acpi_integer digit;
-
-
- FUNCTION_TRACE_PTR ("Ex_monadic2_r", WALK_OPERANDS);
-
-
- /* Create a return object of type NUMBER for most opcodes */
-
- switch (opcode) {
- case AML_BIT_NOT_OP:
- case AML_FIND_SET_LEFT_BIT_OP:
- case AML_FIND_SET_RIGHT_BIT_OP:
- case AML_FROM_BCD_OP:
- case AML_TO_BCD_OP:
- case AML_COND_REF_OF_OP:
-
- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
- if (!ret_desc) {
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-

- break;
- }
-
-
- switch (opcode) {
- /* Def_not := Not_op Operand Result */
-
- case AML_BIT_NOT_OP:
-
- ret_desc->integer.value = ~obj_desc->integer.value;
- break;
-
-
- /* Def_find_set_left_bit := Find_set_left_bit_op Operand Result */
-
- case AML_FIND_SET_LEFT_BIT_OP:
-
- ret_desc->integer.value = obj_desc->integer.value;
-
- /*
- * Acpi specification describes Integer type as a little
- * endian unsigned value, so this boundary condition is valid.
- */
- for (res_val = 0; ret_desc->integer.value && res_val < ACPI_INTEGER_BIT_SIZE; ++res_val) {
- ret_desc->integer.value >>= 1;
- }
-
- ret_desc->integer.value = res_val;
- break;
-
-
- /* Def_find_set_right_bit := Find_set_right_bit_op Operand Result */
-
- case AML_FIND_SET_RIGHT_BIT_OP:
-
- ret_desc->integer.value = obj_desc->integer.value;
-
- /*
- * Acpi specification describes Integer type as a little
- * endian unsigned value, so this boundary condition is valid.
- */
- for (res_val = 0; ret_desc->integer.value && res_val < ACPI_INTEGER_BIT_SIZE; ++res_val) {
- ret_desc->integer.value <<= 1;
- }
-
- /* Since returns must be 1-based, subtract from 33 (65) */
-
- ret_desc->integer.value = res_val == 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - res_val;
- break;
-
-
- /* Def_from_bDC := From_bCDOp BCDValue Result */
-
- case AML_FROM_BCD_OP:
-
- /*
- * The 64-bit ACPI integer can hold 16 4-bit BCD integers
- */
- ret_desc->integer.value = 0;
- for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) {
- /* Get one BCD digit */
-
- digit = (acpi_integer) ((obj_desc->integer.value >> (i * 4)) & 0xF);
-
- /* Check the range of the digit */
-
- if (digit > 9) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD digit too large: \n",
- digit));
- status = AE_AML_NUMERIC_OVERFLOW;


- goto cleanup;
- }
-

- if (digit > 0) {
- /* Sum into the result with the appropriate power of 10 */
-
- for (j = 0; j < i; j++) {
- digit *= 10;
- }
-
- ret_desc->integer.value += digit;
- }
- }
- break;
-
-
- /* Def_to_bDC := To_bCDOp Operand Result */
-
- case AML_TO_BCD_OP:
-
-
- if (obj_desc->integer.value > ACPI_MAX_BCD_VALUE) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD overflow: %d\n",
- obj_desc->integer.value));
- status = AE_AML_NUMERIC_OVERFLOW;


- goto cleanup;
- }
-

- ret_desc->integer.value = 0;
- for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) {
- /* Divide by nth factor of 10 */
-
- digit = obj_desc->integer.value;
- for (j = 0; j < i; j++) {
- digit = ACPI_DIVIDE (digit, 10);
- }
-
- /* Create the BCD digit */
-
- if (digit > 0) {
- ret_desc->integer.value += (ACPI_MODULO (digit, 10) << (i * 4));
- }
- }
- break;
-
-
- /* Def_cond_ref_of := Cond_ref_of_op Source_object Result */
-
- case AML_COND_REF_OF_OP:
-
- /*
- * This op is a little strange because the internal return value is
- * different than the return value stored in the result descriptor
- * (There are really two return values)
- */
- if ((acpi_namespace_node *) obj_desc == acpi_gbl_root_node) {
- /*
- * This means that the object does not exist in the namespace,
- * return FALSE
- */
- ret_desc->integer.value = 0;
-
- /*
- * Must delete the result descriptor since there is no reference
- * being returned
- */
- acpi_ut_remove_reference (res_desc);


- goto cleanup;
- }
-

- /* Get the object reference and store it */
-
- status = acpi_ex_get_object_reference (obj_desc, &ret_desc2, walk_state);
- if (ACPI_FAILURE (status)) {


- goto cleanup;
- }
-

- status = acpi_ex_store (ret_desc2, res_desc, walk_state);
-
- /* The object exists in the namespace, return TRUE */
-
- ret_desc->integer.value = ACPI_INTEGER_MAX;
- goto cleanup;
- break;
-
-
- case AML_STORE_OP:
-
- /*
- * A store operand is typically a number, string, buffer or lvalue
- * TBD: [Unhandled] What about a store to a package?
- */
-
- /*
- * Do the store, and be careful about deleting the source object,
- * since the object itself may have been stored.
- */
- status = acpi_ex_store (obj_desc, res_desc, walk_state);
- if (ACPI_FAILURE (status)) {
- /* On failure, just delete the Obj_desc */
-
- acpi_ut_remove_reference (obj_desc);


- return_ACPI_STATUS (status);
- }
-
- /*

- * Normally, we would remove a reference on the Obj_desc parameter;
- * But since it is being used as the internal return object
- * (meaning we would normally increment it), the two cancel out,
- * and we simply don't do anything.
- */
- *return_desc = obj_desc;
- return_ACPI_STATUS (status);
- break;
-
-
- case AML_DEBUG_OP:
-
- /* Reference, returning an Reference */
-
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Debug_op should never get here!\n"));
- return_ACPI_STATUS (AE_OK);
- break;
-
-
- /*
- * ACPI 2.0 Opcodes
- */
- case AML_TO_DECSTRING_OP:
- status = acpi_ex_convert_to_string (obj_desc, &ret_desc, 10, ACPI_UINT32_MAX, walk_state);
- break;
-
-
- case AML_TO_HEXSTRING_OP:
- status = acpi_ex_convert_to_string (obj_desc, &ret_desc, 16, ACPI_UINT32_MAX, walk_state);
- break;
-
- case AML_TO_BUFFER_OP:
- status = acpi_ex_convert_to_buffer (obj_desc, &ret_desc, walk_state);
- break;
-
- case AML_TO_INTEGER_OP:
- status = acpi_ex_convert_to_integer (obj_desc, &ret_desc, walk_state);
- break;
-
-
- /*
- * These are obsolete opcodes
- */
-
- /* Def_shift_left_bit := Shift_left_bit_op Source Bit_num */
- /* Def_shift_right_bit := Shift_right_bit_op Source Bit_num */
-
- case AML_SHIFT_LEFT_BIT_OP:
- case AML_SHIFT_RIGHT_BIT_OP:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s is unimplemented\n",
- acpi_ps_get_opcode_name (opcode)));
- status = AE_SUPPORT;
- goto cleanup;
- break;
-
-
- default:
-
- REPORT_ERROR (("Acpi_ex_monadic2_r: Unknown monadic opcode %X\n",
- opcode));
- status = AE_AML_BAD_OPCODE;


- goto cleanup;
- }
-
-

- status = acpi_ex_store (ret_desc, res_desc, walk_state);
-
-
-cleanup:
- /* Always delete the operand object */
-
- acpi_ut_remove_reference (obj_desc);
-
- /* Delete return object(s) on error */
-
- if (ACPI_FAILURE (status)) {
- acpi_ut_remove_reference (res_desc); /* Result descriptor */
- if (ret_desc) {
- acpi_ut_remove_reference (ret_desc);
- ret_desc = NULL;
- }
- }
-
- /* Set the return object and exit */
-
- *return_desc = ret_desc;


- return_ACPI_STATUS (status);
-}
-
-
-/*******************************************************************************
- *

- * FUNCTION: Acpi_ex_monadic2
- *
- * PARAMETERS: Opcode - The opcode to be executed


- *
- * RETURN: Status
- *

- * DESCRIPTION: Execute Type 2 monadic operator with numeric operand:
- * Deref_of_op, Ref_of_op, Size_of_op, Type_op, Increment_op,
- * Decrement_op, LNot_op,


- *
- ******************************************************************************/
-
-acpi_status

-acpi_ex_monadic2 (
- u16 opcode,
- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc)
-{
- acpi_operand_object **operand = &walk_state->operands[0];
- acpi_operand_object *tmp_desc;
- acpi_operand_object *ret_desc = NULL;
- acpi_status status = AE_OK;
- u32 type;
- acpi_integer value;
-
-
- FUNCTION_TRACE_PTR ("Ex_monadic2", WALK_OPERANDS);
-
-
- /* Get the operand and decode the opcode */
-
- switch (opcode) {
-
- /* Def_lNot := LNot_op Operand */
-
- case AML_LNOT_OP:
-
- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
- if (!ret_desc) {
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-

- ret_desc->integer.value = !obj_desc->integer.value;
- break;
-
-
- /* Def_decrement := Decrement_op Target */
- /* Def_increment := Increment_op Target */
-
- case AML_DECREMENT_OP:
- case AML_INCREMENT_OP:
-
- /*
- * Since we are expecting an Reference on the top of the stack, it
- * can be either an Node or an internal object.
- *
- * TBD: [Future] This may be the prototype code for all cases where
- * a Reference is expected!! 10/99
- */
- if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) {
- ret_desc = obj_desc;
- }


-
- else {
- /*

- * Duplicate the Reference in a new object so that we can resolve it
- * without destroying the original Reference object
- */
- ret_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE);
- if (!ret_desc) {
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-

- ret_desc->reference.opcode = obj_desc->reference.opcode;
- ret_desc->reference.offset = obj_desc->reference.offset;
- ret_desc->reference.object = obj_desc->reference.object;
- }
-
-
- /*
- * Convert the Ret_desc Reference to a Number
- * (This deletes the original Ret_desc)
- */
- status = acpi_ex_resolve_operands (AML_LNOT_OP, &ret_desc, walk_state);
- if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s: bad operand(s) %s\n",
- acpi_ps_get_opcode_name (opcode), acpi_format_exception(status)));
-


- goto cleanup;
- }
-

- /* Do the actual increment or decrement */
-
- if (AML_INCREMENT_OP == opcode) {
- ret_desc->integer.value++;
- }
- else {
- ret_desc->integer.value--;
- }
-
- /* Store the result back in the original descriptor */
-
- status = acpi_ex_store (ret_desc, obj_desc, walk_state);
-
- /* Objdesc was just deleted (because it is an Reference) */
-
- obj_desc = NULL;
-
- break;
-
-
- /* Def_object_type := Object_type_op Source_object */
-
- case AML_TYPE_OP:
-
- if (INTERNAL_TYPE_REFERENCE == obj_desc->common.type) {
- /*
- * Not a Name -- an indirect name pointer would have
- * been converted to a direct name pointer in Resolve_operands
- */
- switch (obj_desc->reference.opcode) {
- case AML_ZERO_OP:
- case AML_ONE_OP:
- case AML_ONES_OP:
- case AML_REVISION_OP:
-
- /* Constants are of type Number */
-
- type = ACPI_TYPE_INTEGER;
- break;
-
-
- case AML_DEBUG_OP:
-
- /* Per 1.0b spec, Debug object is of type Debug_object */
-
- type = ACPI_TYPE_DEBUG_OBJECT;
- break;
-
-
- case AML_INDEX_OP:
-
- /* Get the type of this reference (index into another object) */
-
- type = obj_desc->reference.target_type;
- if (type == ACPI_TYPE_PACKAGE) {
- /*
- * The main object is a package, we want to get the type
- * of the individual package element that is referenced by
- * the index.
- */
- type = (*(obj_desc->reference.where))->common.type;
- }
-
- break;
-
-
- case AML_LOCAL_OP:
- case AML_ARG_OP:
-
- type = acpi_ds_method_data_get_type (obj_desc->reference.opcode,
- obj_desc->reference.offset, walk_state);
- break;
-
-
- default:
-
- REPORT_ERROR (("Acpi_ex_monadic2/Type_op: Internal error - Unknown Reference subtype %X\n",
- obj_desc->reference.opcode));
- status = AE_AML_INTERNAL;


- goto cleanup;
- }
- }
-

- else {
- /*
- * It's not a Reference, so it must be a direct name pointer.
- */
- type = acpi_ns_get_type ((acpi_namespace_node *) obj_desc);
-
- /* Convert internal types to external types */
-
- switch (type) {
- case INTERNAL_TYPE_REGION_FIELD:
- case INTERNAL_TYPE_BANK_FIELD:
- case INTERNAL_TYPE_INDEX_FIELD:
-
- type = ACPI_TYPE_FIELD_UNIT;
- }
-
- }
-
- /* Allocate a descriptor to hold the type. */
-
- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
- if (!ret_desc) {
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-

- ret_desc->integer.value = type;
- break;
-
-
- /* Def_size_of := Size_of_op Source_object */
-
- case AML_SIZE_OF_OP:
-
- if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) {
- obj_desc = acpi_ns_get_attached_object ((acpi_namespace_node *) obj_desc);
- }
-
- if (!obj_desc) {
- value = 0;
- }
-
- else {
- switch (obj_desc->common.type) {
-
- case ACPI_TYPE_BUFFER:
-
- value = obj_desc->buffer.length;
- break;
-
-
- case ACPI_TYPE_STRING:
-
- value = obj_desc->string.length;
- break;
-
-
- case ACPI_TYPE_PACKAGE:
-
- value = obj_desc->package.count;
- break;
-
- case INTERNAL_TYPE_REFERENCE:
-
- value = 4;
- break;
-
- default:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Not Buf/Str/Pkg - found type %X\n",
- obj_desc->common.type));
- status = AE_AML_OPERAND_TYPE;


- goto cleanup;
- }
- }
-

- /*
- * Now that we have the size of the object, create a result
- * object to hold the value
- */
- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
- if (!ret_desc) {
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-

- ret_desc->integer.value = value;
- break;
-
-
- /* Def_ref_of := Ref_of_op Source_object */
-
- case AML_REF_OF_OP:
-
- status = acpi_ex_get_object_reference (obj_desc, &ret_desc, walk_state);
- if (ACPI_FAILURE (status)) {
- goto cleanup;
- }
- break;
-
-
- /* Def_deref_of := Deref_of_op Obj_reference */
-
- case AML_DEREF_OF_OP:
-
-
- /* Check for a method local or argument */
-
- if (!VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) {
- /*
- * Must resolve/dereference the local/arg reference first
- */
- switch (obj_desc->reference.opcode) {
- /* Set Obj_desc to the value of the local/arg */
-
- case AML_LOCAL_OP:
- case AML_ARG_OP:
-
- acpi_ds_method_data_get_value (obj_desc->reference.opcode,
- obj_desc->reference.offset, walk_state, &tmp_desc);
-
- /*
- * Delete our reference to the input object and
- * point to the object just retrieved
- */
- acpi_ut_remove_reference (obj_desc);
- obj_desc = tmp_desc;
- break;
-
- default:
-
- /* Index op - handled below */


- break;
- }
- }
-

-
- /* Obj_desc may have changed from the code above */
-
- if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) {
- /* Get the actual object from the Node (This is the dereference) */
-
- ret_desc = ((acpi_namespace_node *) obj_desc)->object;
-
- /* Returning a pointer to the object, add another reference! */
-
- acpi_ut_add_reference (ret_desc);
- }


-
- else {
- /*

- * This must be a reference object produced by the Index
- * ASL operation -- check internal opcode
- */
- if ((obj_desc->reference.opcode != AML_INDEX_OP) &&
- (obj_desc->reference.opcode != AML_REF_OF_OP)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode in ref(%p) - %X\n",
- obj_desc, obj_desc->reference.opcode));
-
- status = AE_TYPE;


- goto cleanup;
- }
-
-

- switch (obj_desc->reference.opcode) {
- case AML_INDEX_OP:
-
- /*
- * Supported target types for the Index operator are
- * 1) A Buffer
- * 2) A Package
- */
- if (obj_desc->reference.target_type == ACPI_TYPE_BUFFER_FIELD) {
- /*
- * The target is a buffer, we must create a new object that
- * contains one element of the buffer, the element pointed
- * to by the index.
- *
- * NOTE: index into a buffer is NOT a pointer to a
- * sub-buffer of the main buffer, it is only a pointer to a
- * single element (byte) of the buffer!
- */
- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
- if (!ret_desc) {
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-

- tmp_desc = obj_desc->reference.object;
- ret_desc->integer.value =
- tmp_desc->buffer.pointer[obj_desc->reference.offset];
-
- /* TBD: [Investigate] (see below) Don't add an additional
- * ref!
- */
- }
-
- else if (obj_desc->reference.target_type == ACPI_TYPE_PACKAGE) {
- /*
- * The target is a package, we want to return the referenced
- * element of the package. We must add another reference to
- * this object, however.
- */
- ret_desc = *(obj_desc->reference.where);
- if (!ret_desc) {
- /*
- * We can't return a NULL dereferenced value. This is
- * an uninitialized package element and is thus a
- * severe error.
- */
-
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "NULL package element obj %p\n",
- obj_desc));
- status = AE_AML_UNINITIALIZED_ELEMENT;


- goto cleanup;
- }
-

- acpi_ut_add_reference (ret_desc);
- }
-
- else {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Target_type %X in obj %p\n",
- obj_desc->reference.target_type, obj_desc));
- status = AE_AML_OPERAND_TYPE;


- goto cleanup;
- }
-

- break;
-
-
- case AML_REF_OF_OP:
-
- ret_desc = obj_desc->reference.object;
-
- /* Add another reference to the object! */
-
- acpi_ut_add_reference (ret_desc);


- break;
- }
- }
-
- break;
-
-

- default:
-
- REPORT_ERROR (("Acpi_ex_monadic2: Unknown monadic opcode %X\n",
- opcode));
- status = AE_AML_BAD_OPCODE;


- goto cleanup;
- }
-
-

-cleanup:
-
- if (obj_desc) {
- acpi_ut_remove_reference (obj_desc);
- }
-
- /* Delete return object on error */
-
- if (ACPI_FAILURE (status) &&
- (ret_desc)) {
- acpi_ut_remove_reference (ret_desc);
- ret_desc = NULL;
- }
-
- *return_desc = ret_desc;


- return_ACPI_STATUS (status);
-}
-

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exoparg1.c linux/drivers/acpi/executer/exoparg1.c
--- v2.4.13/linux/drivers/acpi/executer/exoparg1.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/acpi/executer/exoparg1.c Wed Oct 24 14:06:22 2001
@@ -0,0 +1,878 @@
+
+/******************************************************************************
+ *
+ * Module Name: exoparg1 - AML execution - opcodes with 1 argument
+ * $Revision: 120 $


+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000, 2001 R. Byron Moore
+ *
+ * This 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 "acpi.h"
+#include "acparser.h"

+#include "acdispat.h"
+#include "acinterp.h"
+#include "amlcode.h"
+#include "acnamesp.h"


+
+
+#define _COMPONENT ACPI_EXECUTER

+ MODULE_NAME ("exoparg1")

+ * FUNCTION: Acpi_ex_opcode_1A_0T_0R


+ *
+ * PARAMETERS: Walk_state - Current state (contains AML opcode)
+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Execute Type 1 monadic operator with numeric operand on
+ * object stack


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_opcode_1A_0T_0R (


+ acpi_walk_state *walk_state)
+{
+ acpi_operand_object **operand = &walk_state->operands[0];

+ acpi_status status = AE_OK;
+
+

+ FUNCTION_TRACE_STR ("Ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
+
+

+ /* Examine the opcode */
+
+ switch (walk_state->opcode) {

+ case AML_RELEASE_OP: /* Release (Mutex_object) */
+
+ status = acpi_ex_release_mutex (operand[0], walk_state);
+ break;
+
+
+ case AML_RESET_OP: /* Reset (Event_object) */
+
+ status = acpi_ex_system_reset_event (operand[0]);
+ break;
+
+
+ case AML_SIGNAL_OP: /* Signal (Event_object) */
+
+ status = acpi_ex_system_signal_event (operand[0]);
+ break;
+
+
+ case AML_SLEEP_OP: /* Sleep (Msec_time) */
+
+ acpi_ex_system_do_suspend ((u32) operand[0]->integer.value);
+ break;
+
+
+ case AML_STALL_OP: /* Stall (Usec_time) */
+
+ acpi_ex_system_do_stall ((u32) operand[0]->integer.value);
+ break;
+
+
+ case AML_UNLOAD_OP: /* Unload (Handle) */
+
+ status = acpi_ex_unload_table (operand[0]);


+ break;
+
+
+ default: /* Unknown opcode */
+

+ REPORT_ERROR (("Acpi_ex_opcode_1A_0T_0R: Unknown opcode %X\n",


+ walk_state->opcode));
+ status = AE_AML_BAD_OPCODE;
+ break;
+ }
+

+ return_ACPI_STATUS (status);
+}
+
+
+/*******************************************************************************
+ *

+ * FUNCTION: Acpi_ex_opcode_1A_1T_0R


+ *
+ * PARAMETERS: Walk_state - Current state (contains AML opcode)
+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Execute opcode with one argument, one target, and no
+ * return value.


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_opcode_1A_1T_0R (
+ acpi_walk_state *walk_state)
+{


+ acpi_status status = AE_OK;

+ acpi_operand_object **operand = &walk_state->operands[0];
+

+
+ FUNCTION_TRACE_STR ("Ex_opcode_1A_1T_0R", acpi_ps_get_opcode_name (walk_state->opcode));


+
+
+ switch (walk_state->opcode) {
+

+ case AML_LOAD_OP:
+
+ status = acpi_ex_load_op (operand[0], operand[1]);
+ break;
+


+ default: /* Unknown opcode */
+

+ REPORT_ERROR (("Acpi_ex_opcode_1A_1T_0R: Unknown opcode %X\n",


+ walk_state->opcode));
+ status = AE_AML_BAD_OPCODE;
+ goto cleanup;
+ }
+
+
+cleanup:
+

+ return_ACPI_STATUS (status);
+}
+
+
+/*******************************************************************************
+ *

+ * FUNCTION: Acpi_ex_opcode_1A_1T_1R


+ *
+ * PARAMETERS: Walk_state - Current state (contains AML opcode)
+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Execute opcode with one argument, one target, and a
+ * return value.


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_opcode_1A_1T_1R (
+ acpi_walk_state *walk_state)
+{


+ acpi_status status = AE_OK;

+ acpi_operand_object **operand = &walk_state->operands[0];
+ acpi_operand_object *return_desc = NULL;

+ acpi_operand_object *return_desc2 = NULL;
+ u32 temp32;
+ u32 i;
+ u32 j;
+ acpi_integer digit;
+
+
+ FUNCTION_TRACE_STR ("Ex_opcode_1A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+
+
+ /* Create a return object of type Integer for most opcodes */


+
+ switch (walk_state->opcode) {

+ case AML_BIT_NOT_OP:
+ case AML_FIND_SET_LEFT_BIT_OP:
+ case AML_FIND_SET_RIGHT_BIT_OP:
+ case AML_FROM_BCD_OP:
+ case AML_TO_BCD_OP:
+ case AML_COND_REF_OF_OP:


+
+ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
+ if (!return_desc) {
+ status = AE_NO_MEMORY;
+ goto cleanup;
+ }
+

+ break;
+ }
+
+

+ switch (walk_state->opcode) {
+

+ case AML_BIT_NOT_OP: /* Not (Operand, Result) */
+
+ return_desc->integer.value = ~operand[0]->integer.value;
+ break;
+
+
+ case AML_FIND_SET_LEFT_BIT_OP: /* Find_set_left_bit (Operand, Result) */
+
+
+ return_desc->integer.value = operand[0]->integer.value;
+
+ /*
+ * Acpi specification describes Integer type as a little
+ * endian unsigned value, so this boundary condition is valid.
+ */
+ for (temp32 = 0; return_desc->integer.value && temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) {
+ return_desc->integer.value >>= 1;
+ }
+
+ return_desc->integer.value = temp32;
+ break;
+
+
+ case AML_FIND_SET_RIGHT_BIT_OP: /* Find_set_right_bit (Operand, Result) */
+
+
+ return_desc->integer.value = operand[0]->integer.value;
+
+ /*
+ * The Acpi specification describes Integer type as a little
+ * endian unsigned value, so this boundary condition is valid.
+ */
+ for (temp32 = 0; return_desc->integer.value && temp32 < ACPI_INTEGER_BIT_SIZE; ++temp32) {
+ return_desc->integer.value <<= 1;
+ }
+
+ /* Since the bit position is one-based, subtract from 33 (65) */
+
+ return_desc->integer.value = temp32 == 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - temp32;
+ break;
+
+
+ case AML_FROM_BCD_OP: /* From_bcd (BCDValue, Result) */
+
+ /*
+ * The 64-bit ACPI integer can hold 16 4-bit BCD integers


+ */
+ return_desc->integer.value = 0;

+ for (i = 0; i < ACPI_MAX_BCD_DIGITS; i++) {

+ /* Get one BCD digit */
+
+ digit = (acpi_integer) ((operand[0]->integer.value >> (i * 4)) & 0xF);
+
+ /* Check the range of the digit */
+
+ if (digit > 9) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD digit too large: %d\n",
+ (u32) digit));


+ status = AE_AML_NUMERIC_OVERFLOW;
+ goto cleanup;
+ }
+

+ if (digit > 0) {
+ /* Sum into the result with the appropriate power of 10 */
+


+ for (j = 0; j < i; j++) {

+ digit *= 10;
+ }
+
+ return_desc->integer.value += digit;


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 15'
echo 'File patch-2.4.14 is continued in part 16'
echo "16" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:37 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part14

#!/bin/sh -x
# this is part 14 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 14; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

@@ -323,25 +318,22 @@
X

X obj_desc = acpi_ns_get_attached_object (node);

X if (!obj_desc) {
- /*
- * The object DNE.
- */
X status = AE_NOT_EXIST;


X goto unlock_and_exit;
X }
X
X /*

- * find the address handler the user requested
+ * find the address handler the user requested
X */
X handler_obj = obj_desc->device.addr_handler;
X last_obj_ptr = &obj_desc->device.addr_handler;


X while (handler_obj) {
X /*

- * We have a handler, see if user requested this one
+ * We have a handler, see if user requested this one
X */
- if(handler_obj->addr_handler.space_id == space_id) {
+ if (handler_obj->addr_handler.space_id == space_id) {
X /*
- * Got it, first dereference this in the Regions
+ * Got it, first dereference this in the Regions


X */
X ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,

X "Removing address handler %p(%p) for region %s on Device %p(%p)\n",
@@ -354,30 +346,30 @@
X
X while (region_obj) {
X /*
- * First disassociate the handler from the region.
+ * First disassociate the handler from the region.
X *
- * NOTE: this doesn't mean that the region goes away
- * The region is just inaccessible as indicated to
- * the _REG method
+ * NOTE: this doesn't mean that the region goes away
+ * The region is just inaccessible as indicated to
+ * the _REG method
X */
X acpi_ev_disassociate_region_from_handler(region_obj, TRUE);
X
X /*
- * Walk the list, since we took the first region and it
- * was removed from the list by the dissassociate call
- * we just get the first item on the list again
+ * Walk the list, since we took the first region and it
+ * was removed from the list by the dissassociate call
+ * we just get the first item on the list again
X */
X region_obj = handler_obj->addr_handler.region_list;


X
X }
X
X /*

- * Remove this Handler object from the list
+ * Remove this Handler object from the list
X */
X *last_obj_ptr = handler_obj->addr_handler.next;
X
X /*
- * Now we can delete the handler object
+ * Now we can delete the handler object
X */
X acpi_ut_remove_reference (handler_obj);
X acpi_ut_remove_reference (handler_obj);
@@ -386,7 +378,7 @@


X }
X
X /*
- * Move through the linked list of handlers
+ * Move through the linked list of handlers
X */

X last_obj_ptr = &handler_obj->addr_handler.next;


X handler_obj = handler_obj->addr_handler.next;

@@ -394,7 +386,7 @@
X
X
X /*
- * The handler does not exist
+ * The handler does not exist


X */
X ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,

X "Unable to remove address handler %p for %s(%X), Dev_node %p, obj %p\n",
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exconfig.c linux/drivers/acpi/executer/exconfig.c
--- v2.4.13/linux/drivers/acpi/executer/exconfig.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exconfig.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)


- * $Revision: 41 $

+ * $Revision: 44 $


X *
X *****************************************************************************/
X

@@ -51,10 +51,10 @@
X *
X ****************************************************************************/
X
-static acpi_status
-acpi_ex_load_table_op (
+acpi_status
+acpi_ex_load_op (
X acpi_operand_object *rgn_desc,
- acpi_operand_object **ddb_handle)
+ acpi_operand_object *ddb_handle)
X {
X acpi_status status;
X acpi_operand_object *table_desc = NULL;
@@ -65,7 +65,7 @@
X u32 i;
X
X
- FUNCTION_TRACE ("Ex_load_table");
+ FUNCTION_TRACE ("Ex_load_op");
X
X /* TBD: [Unhandled] Object can be either a field or an opregion */
X
@@ -117,7 +117,7 @@
X acpi_gbl_acpi_table_data[ACPI_TABLE_SSDT].sig_length))) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
X "Table has invalid signature [%4.4s], must be SSDT or PSDT\n",
- table_header.signature));
+ (char*)table_header.signature));
X status = AE_BAD_SIGNATURE;
X goto cleanup;
X }
@@ -165,7 +165,8 @@
X table_desc->reference.opcode = AML_LOAD_OP;
X table_desc->reference.object = table_info.installed_desc;
X
- *ddb_handle = table_desc;
+ /* TBD: store the tabledesc into the Ddb_handle target */
+ /* Ddb_handle = Table_desc; */


X
X return_ACPI_STATUS (status);
X

@@ -175,7 +176,6 @@
X ACPI_MEM_FREE (table_desc);
X ACPI_MEM_FREE (table_ptr);
X return_ACPI_STATUS (status);
-
X }
X
X
@@ -191,7 +191,7 @@
X *
X ****************************************************************************/
X
-static acpi_status
+acpi_status
X acpi_ex_unload_table (
X acpi_operand_object *ddb_handle)
X {
@@ -236,60 +236,6 @@
X /* Delete the table descriptor (Ddb_handle) */
X
X acpi_ut_remove_reference (table_desc);
-


- return_ACPI_STATUS (status);
-}
-

-
-/*****************************************************************************
- *
- * FUNCTION: Acpi_ex_reconfiguration


- *
- * PARAMETERS: Opcode - The opcode to be executed

- * Walk_state - Current state of the parse tree walk


- *
- * RETURN: Status
- *

- * DESCRIPTION: Reconfiguration opcodes such as LOAD and UNLOAD
- *
- ****************************************************************************/
-
-acpi_status
-acpi_ex_reconfiguration (
- u16 opcode,


- acpi_walk_state *walk_state)
-{
- acpi_operand_object **operand = &walk_state->operands[0];

- acpi_status status;
-
-

- FUNCTION_TRACE ("Ex_reconfiguration");
-
-#define ddb_handle operand[0]
-#define region_desc operand[1]


-
-
- switch (opcode) {
-

- case AML_LOAD_OP:
-
- status = acpi_ex_load_table_op (region_desc, &ddb_handle);
- break;
-
-
- case AML_UNLOAD_OP:
-
- status = acpi_ex_unload_table (ddb_handle);
- break;
-
-
- default:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "bad opcode=%X\n", opcode));


- status = AE_AML_BAD_OPCODE;
- break;
- }
-

X
X return_ACPI_STATUS (status);
X }

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exconvrt.c linux/drivers/acpi/executer/exconvrt.c
--- v2.4.13/linux/drivers/acpi/executer/exconvrt.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exconvrt.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: exconvrt - Object conversion routines
- * $Revision: 22 $
+ * $Revision: 24 $


X *
X *****************************************************************************/
X

@@ -230,7 +230,7 @@
X new_buf = ACPI_MEM_CALLOCATE (integer_size);
X if (!new_buf) {
X REPORT_ERROR
- (("Ex_dyadic2_r/Concat_op: Buffer allocation failure\n"));
+ (("Ex_convert_to_buffer: Buffer allocation failure\n"));
X acpi_ut_remove_reference (ret_desc);
X return (AE_NO_MEMORY);
X }
@@ -296,8 +296,9 @@
X u32 k = 0;
X u8 hex_digit;
X acpi_integer digit;
- u8 leading_zero = TRUE;
+ u32 remainder;
X u32 length = sizeof (acpi_integer);
+ u8 leading_zero = TRUE;
X
X
X FUNCTION_ENTRY ();
@@ -306,12 +307,13 @@
X switch (base) {
X case 10:
X
+ remainder = 0;
X for (i = ACPI_MAX_DECIMAL_DIGITS; i > 0 ; i--) {
X /* Divide by nth factor of 10 */
X
X digit = integer;
X for (j = 1; j < i; j++) {


- digit = ACPI_DIVIDE (digit, 10);

+ acpi_ut_short_divide (&digit, 10, &digit, &remainder);
X }
X
X /* Create the decimal digit */
@@ -321,7 +323,7 @@
X }
X
X if (!leading_zero) {
- string[k] = (u8) (ASCII_ZERO + ACPI_MODULO (digit, 10));
+ string[k] = (u8) (ASCII_ZERO + remainder);
X k++;
X }
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/excreate.c linux/drivers/acpi/executer/excreate.c
--- v2.4.13/linux/drivers/acpi/executer/excreate.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/excreate.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: excreate - Named object creation
- * $Revision: 66 $
+ * $Revision: 71 $


X *
X *****************************************************************************/
X

@@ -37,162 +37,6 @@
X MODULE_NAME ("excreate")
X
X
-/*******************************************************************************
- *
- * FUNCTION: Acpi_ex_create_buffer_field


- *
- * PARAMETERS: Opcode - The opcode to be executed

- * Operands - List of operands for the opcode


- *
- * RETURN: Status
- *

- * DESCRIPTION: Execute Create_field operators: Create_bit_field_op,
- * Create_byte_field_op, Create_word_field_op, Create_dWord_field_op,
- * Create_field_op (which define fields in buffers)
- *
- * ALLOCATION: Deletes Create_field_op's count operand descriptor
- *
- *
- * ACPI SPECIFICATION REFERENCES:
- * Def_create_bit_field := Create_bit_field_op Src_buf Bit_idx Name_string
- * Def_create_byte_field := Create_byte_field_op Src_buf Byte_idx Name_string
- * Def_create_dWord_field := Create_dWord_field_op Src_buf Byte_idx Name_string
- * Def_create_field := Create_field_op Src_buf Bit_idx Num_bits Name_string
- * Def_create_word_field := Create_word_field_op Src_buf Byte_idx Name_string
- * Bit_index := Term_arg=>Integer
- * Byte_index := Term_arg=>Integer
- * Num_bits := Term_arg=>Integer
- * Source_buff := Term_arg=>Buffer


- *
- ******************************************************************************/
-
-acpi_status

-acpi_ex_create_buffer_field (
- u8 *aml_ptr,
- u32 aml_length,
- acpi_namespace_node *node,
- acpi_walk_state *walk_state)
-{
- acpi_status status;
- acpi_operand_object *obj_desc;
- acpi_operand_object *tmp_desc;
-
-
- FUNCTION_TRACE ("Ex_create_buffer_field");
-
-
- /* Create the descriptor */
-
- obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER_FIELD);
- if (!obj_desc) {
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-
-

- /*
- * Allocate a method object for this field unit
- */
- obj_desc->buffer_field.extra = acpi_ut_create_internal_object (
- INTERNAL_TYPE_EXTRA);
- if (!obj_desc->buffer_field.extra) {
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-
- /*

- * Remember location in AML stream of the field unit
- * opcode and operands -- since the buffer and index
- * operands must be evaluated.
- */
- obj_desc->buffer_field.extra->extra.pcode = aml_ptr;
- obj_desc->buffer_field.extra->extra.pcode_length = aml_length;
- obj_desc->buffer_field.node = node;
-
-
- /*
- * This operation is supposed to cause the destination Name to refer
- * to the defined Buffer_field -- it must not store the constructed
- * Buffer_field object (or its current value) in some location that the
- * Name may already be pointing to. So, if the Name currently contains
- * a reference which would cause Acpi_ex_store() to perform an indirect
- * store rather than setting the value of the Name itself, clobber that
- * reference before calling Acpi_ex_store().
- */
-
- /* Type of Name's existing value */
-
- switch (acpi_ns_get_type (node)) {
-
- case ACPI_TYPE_BUFFER_FIELD:
- case INTERNAL_TYPE_ALIAS:


- case INTERNAL_TYPE_REGION_FIELD:
- case INTERNAL_TYPE_BANK_FIELD:
- case INTERNAL_TYPE_INDEX_FIELD:
-

- tmp_desc = acpi_ns_get_attached_object (node);
- if (tmp_desc) {
- /*
- * There is an existing object here; delete it and zero out the
- * object field within the Node
- */
- DUMP_PATHNAME (node,
- "Ex_create_buffer_field: Removing Current Reference",
- ACPI_LV_BFIELD, _COMPONENT);
-
- DUMP_ENTRY (node, ACPI_LV_BFIELD);
- DUMP_STACK_ENTRY (tmp_desc);
-
- acpi_ut_remove_reference (tmp_desc);
- acpi_ns_attach_object ((acpi_namespace_node *) node, NULL,
- ACPI_TYPE_ANY);
- }
-
- /* Set the type to ANY (or the store below will fail) */
-
- ((acpi_namespace_node *) node)->type = ACPI_TYPE_ANY;
-
- break;
-
-
- default:
-


- break;
- }
-
-

- /* Store constructed field descriptor in result location */
-
- status = acpi_ex_store (obj_desc, (acpi_operand_object *) node,
- walk_state);
-
- /*
- * If the field descriptor was not physically stored (or if a failure
- * above), we must delete it
- */
- if (obj_desc->common.reference_count <= 1) {


- acpi_ut_remove_reference (obj_desc);
- }
-
-

- return_ACPI_STATUS (AE_OK);
-
-

-cleanup:
-
- /* Delete region object and method subobject */
-
- if (obj_desc) {
- /* Remove deletes both objects! */
-
- acpi_ut_remove_reference (obj_desc);


- obj_desc = NULL;
- }
-

- return_ACPI_STATUS (status);
-}
-

-
X /*****************************************************************************
X *
X * FUNCTION: Acpi_ex_create_alias
@@ -211,7 +55,6 @@
X acpi_walk_state *walk_state)
X {
X acpi_namespace_node *source_node;
- acpi_namespace_node *alias_node;


X acpi_status status;
X
X

@@ -220,29 +63,19 @@
X
X /* Get the source/alias operands (both namespace nodes) */
X
- source_node = (acpi_namespace_node *) walk_state->operands[walk_state->num_operands -1];
- walk_state->num_operands--;
-
- /*
- * Don't pop it, it gets removed in the calling routine
- */
- alias_node = acpi_ds_obj_stack_get_value (0, walk_state);
+ source_node = (acpi_namespace_node *) walk_state->operands[1];
X
- /* Add an additional reference to the object */
X
- acpi_ut_add_reference (source_node->object);
+ /* Attach the original source object to the new Alias Node */
X
- /*
- * Attach the original source Node to the new Alias Node.
- */
- status = acpi_ns_attach_object (alias_node, source_node->object,
+ status = acpi_ns_attach_object ((acpi_namespace_node *) walk_state->operands[0],
+ source_node->object,
X source_node->type);
X
-
X /*
X * The new alias assumes the type of the source, but it points
- * to the same object. The reference count of the object has two
- * additional references to prevent deletion out from under either the
+ * to the same object. The reference count of the object has an
+ * additional reference to prevent deletion out from under either the
X * source or the alias Node
X */
X
@@ -256,7 +89,7 @@
X *
X * FUNCTION: Acpi_ex_create_event
X *
- * PARAMETERS: None


+ * PARAMETERS: Walk_state - Current state

X *
X * RETURN: Status
X *

@@ -288,23 +121,20 @@
X status = acpi_os_create_semaphore (ACPI_NO_UNIT_LIMIT, 1,
X &obj_desc->event.semaphore);
X if (ACPI_FAILURE (status)) {
- acpi_ut_remove_reference (obj_desc);


X goto cleanup;
X }
X

X /* Attach object to the Node */
X
- status = acpi_ns_attach_object (acpi_ds_obj_stack_get_value (0, walk_state),
+ status = acpi_ns_attach_object ((acpi_namespace_node *) walk_state->operands[0],
X obj_desc, (u8) ACPI_TYPE_EVENT);
- if (ACPI_FAILURE (status)) {
- acpi_os_delete_semaphore (obj_desc->event.semaphore);
- acpi_ut_remove_reference (obj_desc);


- goto cleanup;
- }
-

X
X cleanup:
-
+ /*
+ * Remove local reference to the object (on error, will cause deletion
+ * of both object and semaphore if present.)
+ */
+ acpi_ut_remove_reference (obj_desc);


X return_ACPI_STATUS (status);
X }
X

@@ -313,13 +143,14 @@
X *
X * FUNCTION: Acpi_ex_create_mutex
X *
- * PARAMETERS: Interpreter_mode - Current running mode (load1/Load2/Exec)
- * Operands - List of operands for the opcode


+ * PARAMETERS: Walk_state - Current state

X *
X * RETURN: Status
X *

X * DESCRIPTION: Create a new mutex object
X *
+ * Mutex (Name[0], Sync_level[1])
+ *
X ****************************************************************************/
X
X acpi_status
@@ -327,19 +158,13 @@
X acpi_walk_state *walk_state)


X {
X acpi_status status = AE_OK;

- acpi_operand_object *sync_desc;
X acpi_operand_object *obj_desc;
X
X
X FUNCTION_TRACE_PTR ("Ex_create_mutex", WALK_OPERANDS);
X
X
- /* Get the operand */
-
- sync_desc = walk_state->operands[walk_state->num_operands -1];
- walk_state->num_operands--;
-
- /* Attempt to allocate a new object */
+ /* Create the new mutex object */
X
X obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_MUTEX);
X if (!obj_desc) {
@@ -351,29 +176,23 @@
X
X status = acpi_os_create_semaphore (1, 1, &obj_desc->mutex.semaphore);
X if (ACPI_FAILURE (status)) {
- acpi_ut_remove_reference (obj_desc);


X goto cleanup;
X }
X

- obj_desc->mutex.sync_level = (u8) sync_desc->integer.value;
+ /* Init object and attach to NS node */
X
- /* Obj_desc was on the stack top, and the name is below it */
+ obj_desc->mutex.sync_level = (u8) walk_state->operands[1]->integer.value;
X
- status = acpi_ns_attach_object (acpi_ds_obj_stack_get_value (0, walk_state),
+ status = acpi_ns_attach_object ((acpi_namespace_node *) walk_state->operands[0],
X obj_desc, (u8) ACPI_TYPE_MUTEX);
- if (ACPI_FAILURE (status)) {
- acpi_os_delete_semaphore (obj_desc->mutex.semaphore);
- acpi_ut_remove_reference (obj_desc);
- goto cleanup;
- }
X
X
X cleanup:


-
- /* Always delete the operand */
-

- acpi_ut_remove_reference (sync_desc);
-
+ /*
+ * Remove local reference to the object (on error, will cause deletion
+ * of both object and semaphore if present.)
+ */
+ acpi_ut_remove_reference (obj_desc);


X return_ACPI_STATUS (status);
X }
X

@@ -382,10 +201,10 @@
X *
X * FUNCTION: Acpi_ex_create_region
X *
- * PARAMETERS: Aml_ptr - Pointer to the region declaration AML
+ * PARAMETERS: Aml_start - Pointer to the region declaration AML
X * Aml_length - Max length of the declaration AML
X * Operands - List of operands for the opcode
- * Interpreter_mode - Load1/Load2/Execute
+ * Walk_state - Current state


X *
X * RETURN: Status
X *

@@ -395,7 +214,7 @@
X
X acpi_status
X acpi_ex_create_region (
- u8 *aml_ptr,
+ u8 *aml_start,
X u32 aml_length,
X u8 region_space,
X acpi_walk_state *walk_state)
@@ -408,6 +227,18 @@
X FUNCTION_TRACE ("Ex_create_region");
X
X
+ /* Get the Node from the object stack */
+
+ node = (acpi_namespace_node *) walk_state->operands[0];
+
+ /*
+ * If the region object is already attached to this node,
+ * just return


+ */
+ if (node->object) {

+ return_ACPI_STATUS (AE_OK);
+ }
+

X /*
X * Space ID must be one of the predefined IDs, or in the user-defined
X * range
@@ -422,10 +253,6 @@
X acpi_ut_get_region_name (region_space), region_space));
X
X
- /* Get the Node from the object stack */
-
- node = (acpi_namespace_node *) acpi_ds_obj_stack_get_value (0, walk_state);
-
X /* Create the region descriptor */
X
X obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_REGION);
@@ -434,9 +261,8 @@


X goto cleanup;
X }
X

- /*
- * Allocate a method object for this region.
- */
+ /* Allocate a method object for this region */
+
X obj_desc->region.extra = acpi_ut_create_internal_object (
X INTERNAL_TYPE_EXTRA);
X if (!obj_desc->region.extra) {
@@ -448,23 +274,20 @@
X * Remember location in AML stream of address & length
X * operands since they need to be evaluated at run time.
X */
- obj_desc->region.extra->extra.pcode = aml_ptr;
- obj_desc->region.extra->extra.pcode_length = aml_length;
+ obj_desc->region.extra->extra.aml_start = aml_start;
+ obj_desc->region.extra->extra.aml_length = aml_length;
X
X /* Init the region from the operands */
X
- obj_desc->region.space_id = region_space;
- obj_desc->region.address = 0;
- obj_desc->region.length = 0;
-
+ obj_desc->region.space_id = region_space;
+ obj_desc->region.address = 0;
+ obj_desc->region.length = 0;
+ obj_desc->region.node = node;
X
X /* Install the new region object in the parent Node */
X
- obj_desc->region.node = node;
-
X status = acpi_ns_attach_object (node, obj_desc,
X (u8) ACPI_TYPE_REGION);
-


X if (ACPI_FAILURE (status)) {
X goto cleanup;
X }

@@ -474,7 +297,6 @@
X * Namespace is NOT locked at this point.
X */
X status = acpi_ev_initialize_region (obj_desc, FALSE);
-
X if (ACPI_FAILURE (status)) {
X /*
X * If AE_NOT_EXIST is returned, it is not fatal
@@ -488,17 +310,48 @@
X
X cleanup:
X
- if (ACPI_FAILURE (status)) {
- /* Delete region object and method subobject */


+ /* Remove local reference to the object */
X

- if (obj_desc) {
- /* Remove deletes both objects! */
+ acpi_ut_remove_reference (obj_desc);
X
- acpi_ut_remove_reference (obj_desc);
- obj_desc = NULL;
- }


+ return_ACPI_STATUS (status);
+}
+
+

+/*****************************************************************************
+ *
+ * FUNCTION: Acpi_ex_create_table_region


+ *
+ * PARAMETERS: Walk_state - Current state

+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Create a new Data_table_region object
+ *
+ ****************************************************************************/
+
+acpi_status
+acpi_ex_create_table_region (


+ acpi_walk_state *walk_state)
+{
+ acpi_status status = AE_OK;

+
+
+ FUNCTION_TRACE ("Ex_create_table_region");
+
+/*
+ acpi_operand_object *Obj_desc;
+ Obj_desc = Acpi_ut_create_internal_object (ACPI_TYPE_REGION);
+ if (!Obj_desc)
+ {
+ Status = AE_NO_MEMORY;
+ goto Cleanup;
X }
X
+
+Cleanup:
+*/
+


X return_ACPI_STATUS (status);
X }
X

@@ -515,68 +368,46 @@
X *
X * DESCRIPTION: Create a new processor object and populate the fields
X *
+ * Processor (Name[0], Cpu_iD[1], Pblock_addr[2], Pblock_length[3])
+ *
X ****************************************************************************/
X
X acpi_status
X acpi_ex_create_processor (
- acpi_parse_object *op,
- acpi_namespace_node *processor_node)
+ acpi_walk_state *walk_state)
X {
- acpi_status status;
- acpi_parse_object *arg;


+ acpi_operand_object **operand = &walk_state->operands[0];

X acpi_operand_object *obj_desc;
+ acpi_status status;
+
X
+ FUNCTION_TRACE_PTR ("Ex_create_processor", walk_state);
X
- FUNCTION_TRACE_PTR ("Ex_create_processor", op);
X
+ /* Create the processor object */
X
X obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_PROCESSOR);


X if (!obj_desc) {
X return_ACPI_STATUS (AE_NO_MEMORY);

X }
X
- /* Install the new processor object in the parent Node */
-
- status = acpi_ns_attach_object (processor_node, obj_desc,
- (u8) ACPI_TYPE_PROCESSOR);
- if (ACPI_FAILURE (status)) {
- acpi_ut_delete_object_desc (obj_desc);


- return_ACPI_STATUS (status);
- }
-

- /* Get first arg and verify existence */
-
- arg = op->value.arg;
- if (!arg) {


- return_ACPI_STATUS (AE_AML_NO_OPERAND);
- }
-

- /* First arg is the Processor ID */
-
- obj_desc->processor.proc_id = (u8) arg->value.integer;
-
- /* Get second arg and verify existence */
-
- arg = arg->next;
- if (!arg) {


- return_ACPI_STATUS (AE_AML_NO_OPERAND);
- }
-

- /* Second arg is the PBlock Address */
+ /*
+ * Initialize the processor object from the operands
+ */
+ obj_desc->processor.proc_id = (u8) operand[1]->integer.value;
+ obj_desc->processor.address = (ACPI_IO_ADDRESS) operand[2]->integer.value;
+ obj_desc->processor.length = (u8) operand[3]->integer.value;
X
- obj_desc->processor.address = (ACPI_IO_ADDRESS) arg->value.integer;
+ /* Install the processor object in the parent Node */
X
- /* Get third arg and verify existence */
+ status = acpi_ns_attach_object ((acpi_namespace_node *) operand[0],
+ obj_desc, (u8) ACPI_TYPE_PROCESSOR);


X
- arg = arg->next;

- if (!arg) {
- return_ACPI_STATUS (AE_AML_NO_OPERAND);
- }
X
- /* Third arg is the PBlock Length */


+ /* Remove local reference to the object */
X

- obj_desc->processor.length = (u8) arg->value.integer;
- return_ACPI_STATUS (AE_OK);
+ acpi_ut_remove_reference (obj_desc);
+ return_ACPI_STATUS (status);
X }
X
X
@@ -592,58 +423,44 @@
X *
X * DESCRIPTION: Create a new Power_resource object and populate the fields
X *
+ * Power_resource (Name[0], System_level[1], Resource_order[2])
+ *
X ****************************************************************************/
X
X acpi_status
X acpi_ex_create_power_resource (
- acpi_parse_object *op,
- acpi_namespace_node *power_node)
+ acpi_walk_state *walk_state)
X {
+ acpi_operand_object **operand = &walk_state->operands[0];
X acpi_status status;
- acpi_parse_object *arg;
X acpi_operand_object *obj_desc;
X
X
- FUNCTION_TRACE_PTR ("Ex_create_power_resource", op);
+ FUNCTION_TRACE_PTR ("Ex_create_power_resource", walk_state);
+
X
+ /* Create the power resource object */
X
X obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_POWER);


X if (!obj_desc) {
X return_ACPI_STATUS (AE_NO_MEMORY);

X }
X
- /* Install the new power resource object in the parent Node */
-
- status = acpi_ns_attach_object (power_node, obj_desc,
- (u8) ACPI_TYPE_POWER);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS(status);
- }
+ /* Initialize the power object from the operands */
X
+ obj_desc->power_resource.system_level = (u8) operand[1]->integer.value;
+ obj_desc->power_resource.resource_order = (u16) operand[2]->integer.value;
X
- /* Get first arg and verify existence */
+ /* Install the power resource object in the parent Node */


X
- arg = op->value.arg;

- if (!arg) {


- return_ACPI_STATUS (AE_AML_NO_OPERAND);
- }
-

- /* First arg is the System_level */
-
- obj_desc->power_resource.system_level = (u8) arg->value.integer;
-
- /* Get second arg and check existence */
-
- arg = arg->next;
- if (!arg) {
- return_ACPI_STATUS (AE_AML_NO_OPERAND);
- }
+ status = acpi_ns_attach_object ((acpi_namespace_node *) operand[0],
+ obj_desc, (u8) ACPI_TYPE_POWER);
X
- /* Second arg is the PBlock Address */
X
- obj_desc->power_resource.resource_order = (u16) arg->value.integer;


+ /* Remove local reference to the object */
X

- return_ACPI_STATUS (AE_OK);
+ acpi_ut_remove_reference (obj_desc);
+ return_ACPI_STATUS (status);
X }
X
X
@@ -651,7 +468,7 @@
X *
X * FUNCTION: Acpi_ex_create_method
X *
- * PARAMETERS: Aml_ptr - First byte of the method's AML
+ * PARAMETERS: Aml_start - First byte of the method's AML
X * Aml_length - AML byte count for this method
X * Method_flags - AML method flag byte
X * Method - Method Node
@@ -664,16 +481,17 @@
X
X acpi_status
X acpi_ex_create_method (
- u8 *aml_ptr,
+ u8 *aml_start,
X u32 aml_length,
- u32 method_flags,
- acpi_namespace_node *method)
+ acpi_walk_state *walk_state)
X {
+ acpi_operand_object **operand = &walk_state->operands[0];
X acpi_operand_object *obj_desc;
X acpi_status status;
+ u8 method_flags;
X
X
- FUNCTION_TRACE_PTR ("Ex_create_method", method);
+ FUNCTION_TRACE_PTR ("Ex_create_method", walk_state);
X
X
X /* Create a new method object */
@@ -683,18 +501,17 @@


X return_ACPI_STATUS (AE_NO_MEMORY);
X }
X

- /* Get the method's AML pointer/length from the Op */
+ /* Save the method's AML pointer and length */
X
- obj_desc->method.pcode = aml_ptr;
- obj_desc->method.pcode_length = aml_length;
+ obj_desc->method.aml_start = aml_start;
+ obj_desc->method.aml_length = aml_length;
X
- /*
- * First argument is the Method Flags (contains parameter count for the
- * method)
- */
- obj_desc->method.method_flags = (u8) method_flags;
- obj_desc->method.param_count = (u8) (method_flags &
- METHOD_FLAGS_ARG_COUNT);
+ /* disassemble the method flags */
+
+ method_flags = (u8) operand[1]->integer.value;
+
+ obj_desc->method.method_flags = method_flags;
+ obj_desc->method.param_count = (u8) (method_flags & METHOD_FLAGS_ARG_COUNT);
X
X /*
X * Get the concurrency count. If required, a semaphore will be
@@ -715,11 +532,16 @@
X
X /* Attach the new object to the method Node */
X
- status = acpi_ns_attach_object (method, obj_desc, (u8) ACPI_TYPE_METHOD);
- if (ACPI_FAILURE (status)) {
- acpi_ut_delete_object_desc (obj_desc);
- }
+ status = acpi_ns_attach_object ((acpi_namespace_node *) operand[0],
+ obj_desc, (u8) ACPI_TYPE_METHOD);
+
+ /* Remove local reference to the object */
+
+ acpi_ut_remove_reference (obj_desc);
+
+ /* Remove a reference to the operand */
X

+ acpi_ut_remove_reference (operand[1]);

X return_ACPI_STATUS (status);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exdump.c linux/drivers/acpi/executer/exdump.c
--- v2.4.13/linux/drivers/acpi/executer/exdump.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exdump.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: exdump - Interpreter debug output routines
- * $Revision: 123 $
+ * $Revision: 126 $


X *
X *****************************************************************************/
X

@@ -46,12 +46,12 @@
X * FUNCTION: Acpi_ex_show_hex_value
X *
X * PARAMETERS: Byte_count - Number of bytes to print (1, 2, or 4)
- * *Aml_ptr - Address in AML stream of bytes to print
+ * *Aml_start - Address in AML stream of bytes to print
X * Interpreter_mode - Current running mode (load1/Load2/Exec)
X * Lead_space - # of spaces to print ahead of value
X * 0 => none ahead but one behind
X *
- * DESCRIPTION: Print Byte_count byte(s) starting at Aml_ptr as a single
+ * DESCRIPTION: Print Byte_count byte(s) starting at Aml_start as a single
X * value, in hex. If Byte_count > 1 or the value printed is > 9, also
X * print in decimal.
X *
@@ -60,7 +60,7 @@
X void
X acpi_ex_show_hex_value (
X u32 byte_count,
- u8 *aml_ptr,
+ u8 *aml_start,
X u32 lead_space)
X {
X u32 value; /* Value retrieved from AML stream */
@@ -72,7 +72,7 @@
X FUNCTION_TRACE ("Ex_show_hex_value");
X
X
- if (!aml_ptr) {
+ if (!aml_start) {
X REPORT_ERROR (("Ex_show_hex_value: null pointer\n"));
X }


X
@@ -80,9 +80,9 @@

X * AML numbers are always stored little-endian,
X * even if the processor is big-endian.
X */
- for (current_aml_ptr = aml_ptr + byte_count,
+ for (current_aml_ptr = aml_start + byte_count,
X value = 0;
- current_aml_ptr > aml_ptr; ) {
+ current_aml_ptr > aml_start; ) {
X value = (value << 8) + (u32)* --current_aml_ptr;
X }
X
@@ -96,14 +96,12 @@
X length += 3 + acpi_ex_digits_needed (value, 10);
X }
X
- ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, ""));
-
X for (length = lead_space; length; --length ) {
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " "));
X }
X
X while (byte_count--) {
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "%02x", *aml_ptr++));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "%02x", *aml_start++));
X
X if (byte_count) {
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " "));
@@ -111,7 +109,7 @@
X }
X
X if (show_decimal_value) {
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " [%ld]", value));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " [%d]", value));
X }
X
X if (0 == lead_space) {
@@ -163,12 +161,6 @@


X return (AE_OK);
X }
X

- if (acpi_tb_system_table_pointer (entry_desc)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p is an AML pointer\n",
- entry_desc));
- return (AE_OK);
- }
-
X if (!VALID_DESCRIPTOR_TYPE (entry_desc, ACPI_DESC_TYPE_INTERNAL)) {
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p Is not a local object \n", entry_desc));
X DUMP_BUFFER (entry_desc, sizeof (acpi_operand_object));
@@ -236,8 +228,9 @@
X if (ACPI_TYPE_INTEGER == entry_desc->common.type) {
X /* Value is a Number */
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%ld]",
- entry_desc->integer.value));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]",
+ HIDWORD(entry_desc->integer.value),
+ LODWORD(entry_desc->integer.value)));
X }
X
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
@@ -253,8 +246,9 @@
X
X /* Value is a Number */
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%ld]",
- entry_desc->integer.value));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]",
+ HIDWORD(entry_desc->integer.value),
+ LODWORD(entry_desc->integer.value)));
X }
X
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
@@ -262,7 +256,7 @@
X
X
X case AML_INT_NAMEPATH_OP:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference.Node->Name %x\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference.Node->Name %X\n",
X entry_desc->reference.node->name));
X break;
X
@@ -297,8 +291,7 @@
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Buffer Contents: "));
X
X for (buf = entry_desc->buffer.pointer; length--; ++buf) {
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
- length ? " %02x" : " %02x", *buf));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " %02x", *buf));
X }
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,"\n"));
X }
@@ -371,8 +364,10 @@
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
X }
X else {
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " base %p Length %X\n",
- entry_desc->region.address, entry_desc->region.length));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " base %8.8X%8.8X Length %X\n",
+ HIDWORD(entry_desc->region.address),
+ LODWORD(entry_desc->region.address),
+ entry_desc->region.length));
X }
X break;
X
@@ -400,7 +395,7 @@
X case INTERNAL_TYPE_REGION_FIELD:
X
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
- "Region_field: bits=%X bitaccwidth=%X lock=%X update=%X at byte=%lX bit=%X of below:\n",
+ "Region_field: bits=%X bitaccwidth=%X lock=%X update=%X at byte=%X bit=%X of below:\n",
X entry_desc->field.bit_length, entry_desc->field.access_bit_width,
X entry_desc->field.lock_rule, entry_desc->field.update_rule,
X entry_desc->field.base_byte_offset, entry_desc->field.start_field_bit_offset));
@@ -417,7 +412,7 @@
X case ACPI_TYPE_BUFFER_FIELD:
X
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
- "Buffer_field: %X bits at byte %lX bit %X of \n",
+ "Buffer_field: %X bits at byte %X bit %X of \n",
X entry_desc->buffer_field.bit_length, entry_desc->buffer_field.base_byte_offset,
X entry_desc->buffer_field.start_field_bit_offset));
X
@@ -449,9 +444,9 @@
X case ACPI_TYPE_METHOD:
X
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
- "Method(%X) @ %p:%lX\n",
+ "Method(%X) @ %p:%X\n",
X entry_desc->method.param_count,
- entry_desc->method.pcode, entry_desc->method.pcode_length));
+ entry_desc->method.aml_start, entry_desc->method.aml_length));
X break;
X
X
@@ -608,7 +603,7 @@
X }
X
X
- acpi_os_printf ("%20s : %4.4s\n", "Name", &node->name);
+ acpi_os_printf ("%20s : %4.4s\n", "Name", (char*)&node->name);
X acpi_os_printf ("%20s : %s\n", "Type", acpi_ut_get_type_name (node->type));
X acpi_os_printf ("%20s : %X\n", "Flags", node->flags);
X acpi_os_printf ("%20s : %X\n", "Owner Id", node->owner_id);
@@ -730,8 +725,8 @@
X acpi_os_printf ("%20s : %X\n", "Param_count", obj_desc->method.param_count);
X acpi_os_printf ("%20s : %X\n", "Concurrency", obj_desc->method.concurrency);
X acpi_os_printf ("%20s : %p\n", "Semaphore", obj_desc->method.semaphore);
- acpi_os_printf ("%20s : %X\n", "Pcode_length", obj_desc->method.pcode_length);
- acpi_os_printf ("%20s : %X\n", "Pcode", obj_desc->method.pcode);
+ acpi_os_printf ("%20s : %X\n", "Aml_length", obj_desc->method.aml_length);
+ acpi_os_printf ("%20s : %X\n", "Aml_start", obj_desc->method.aml_start);
X break;
X
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exdyadic.c linux/drivers/acpi/executer/exdyadic.c
--- v2.4.13/linux/drivers/acpi/executer/exdyadic.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exdyadic.c Wed Dec 31 16:00:00 1969
@@ -1,874 +0,0 @@
-/******************************************************************************
- *
- * Module Name: exdyadic - ACPI AML execution for dyadic (2-operand) operators
- * $Revision: 88 $


- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000, 2001 R. Byron Moore

- *
- * This 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 "acpi.h"
-#include "acparser.h"

-#include "acnamesp.h"
-#include "acinterp.h"
-#include "acevents.h"
-#include "amlcode.h"
-#include "acdispat.h"


-
-
-#define _COMPONENT ACPI_EXECUTER

- MODULE_NAME ("exdyadic")


-
-
-/*******************************************************************************
- *

- * FUNCTION: Acpi_ex_do_concatenate
- *
- * PARAMETERS: *Obj_desc - Object to be converted. Must be an
- * Integer, Buffer, or String


- * Walk_state - Current walk state
- *

- * RETURN: Status
- *

- * DESCRIPTION: Concatenate two objects OF THE SAME TYPE.


- *
- ******************************************************************************/
-
-acpi_status

-acpi_ex_do_concatenate (
- acpi_operand_object *obj_desc,
- acpi_operand_object *obj_desc2,
- acpi_operand_object **actual_ret_desc,
- acpi_walk_state *walk_state)
-{
- acpi_status status;
- u32 i;
- acpi_integer this_integer;
- acpi_operand_object *ret_desc;
- NATIVE_CHAR *new_buf;
- u32 integer_size = sizeof (acpi_integer);
-
-
- FUNCTION_ENTRY ();
-
-
- /*
- * There are three cases to handle:
- * 1) Two Integers concatenated to produce a buffer
- * 2) Two Strings concatenated to produce a string
- * 3) Two Buffers concatenated to produce a buffer
- */
- switch (obj_desc->common.type) {
- case ACPI_TYPE_INTEGER:
-
- /* Handle both ACPI 1.0 and ACPI 2.0 Integer widths */
-
- if (walk_state->method_node->flags & ANOBJ_DATA_WIDTH_32) {
- /*
- * We are running a method that exists in a 32-bit ACPI table.
- * Truncate the value to 32 bits by zeroing out the upper
- * 32-bit field
- */
- integer_size = sizeof (u32);
- }
-
- /* Result of two integers is a buffer */
-
- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER);
- if (!ret_desc) {
- return (AE_NO_MEMORY);
- }
-
- /* Need enough space for two integers */
-
- ret_desc->buffer.length = integer_size * 2;
- new_buf = ACPI_MEM_CALLOCATE (ret_desc->buffer.length);
- if (!new_buf) {
- REPORT_ERROR
- (("Ex_do_concatenate: Buffer allocation failure\n"));
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-

- ret_desc->buffer.pointer = (u8 *) new_buf;
-
- /* Convert the first integer */
-
- this_integer = obj_desc->integer.value;
- for (i = 0; i < integer_size; i++) {
- new_buf[i] = (u8) this_integer;
- this_integer >>= 8;
- }
-
- /* Convert the second integer */
-
- this_integer = obj_desc2->integer.value;
- for (; i < (integer_size * 2); i++) {
- new_buf[i] = (u8) this_integer;
- this_integer >>= 8;
- }
-
- break;
-
-
- case ACPI_TYPE_STRING:
-
- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING);
- if (!ret_desc) {
- return (AE_NO_MEMORY);
- }
-
- /* Operand1 is string */
-
- new_buf = ACPI_MEM_ALLOCATE (obj_desc->string.length +
- obj_desc2->string.length + 1);
- if (!new_buf) {
- REPORT_ERROR
- (("Ex_do_concatenate: String allocation failure\n"));
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-

- STRCPY (new_buf, obj_desc->string.pointer);
- STRCPY (new_buf + obj_desc->string.length,
- obj_desc2->string.pointer);
-
- /* Point the return object to the new string */
-
- ret_desc->string.pointer = new_buf;
- ret_desc->string.length = obj_desc->string.length +=
- obj_desc2->string.length;
- break;
-
-
- case ACPI_TYPE_BUFFER:
-
- /* Operand1 is a buffer */
-
- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER);
- if (!ret_desc) {
- return (AE_NO_MEMORY);
- }
-
- new_buf = ACPI_MEM_ALLOCATE (obj_desc->buffer.length +
- obj_desc2->buffer.length);
- if (!new_buf) {
- REPORT_ERROR
- (("Ex_do_concatenate: Buffer allocation failure\n"));
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-

- MEMCPY (new_buf, obj_desc->buffer.pointer,
- obj_desc->buffer.length);
- MEMCPY (new_buf + obj_desc->buffer.length, obj_desc2->buffer.pointer,
- obj_desc2->buffer.length);
-
- /*
- * Point the return object to the new buffer
- */
-
- ret_desc->buffer.pointer = (u8 *) new_buf;
- ret_desc->buffer.length = obj_desc->buffer.length +
- obj_desc2->buffer.length;
- break;
-
- default:
- status = AE_AML_INTERNAL;


- ret_desc = NULL;
- }
-
-

- *actual_ret_desc = ret_desc;
- return (AE_OK);
-
-
-cleanup:
-
- acpi_ut_remove_reference (ret_desc);


- return (status);
-}
-

-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_ex_dyadic1


- *
- * PARAMETERS: Opcode - The opcode to be executed

- * Walk_state - Current walk state
- *

- * RETURN: Status
- *

- * DESCRIPTION: Execute Type 1 dyadic operator with numeric operands:
- * Notify_op
- *
- * ALLOCATION: Deletes both operands


- *
- ******************************************************************************/
-
-acpi_status

-acpi_ex_dyadic1 (
- u16 opcode,


- acpi_walk_state *walk_state)
-{
- acpi_operand_object **operand = &walk_state->operands[0];

- acpi_namespace_node *node;


- acpi_status status = AE_OK;
-
-

- FUNCTION_TRACE_PTR ("Ex_dyadic1", WALK_OPERANDS);


-
-
- /* Examine the opcode */
-
- switch (opcode) {
-

- /* Def_notify := Notify_op (0)Notify_object (1)Notify_value */
-
- case AML_NOTIFY_OP:
-
- /* The Obj_desc is actually an Node */
-
- node = (acpi_namespace_node *) operand[0];
- operand[0] = NULL;
-
- /* Object must be a device or thermal zone */
-
- if (node && operand[1]) {
- switch (node->type) {
- case ACPI_TYPE_DEVICE:
- case ACPI_TYPE_THERMAL:
-
- /*
- * Dispatch the notify to the appropriate handler
- * NOTE: the request is queued for execution after this method
- * completes. The notify handlers are NOT invoked synchronously
- * from this thread -- because handlers may in turn run other
- * control methods.
- */
- status = acpi_ev_queue_notify_request (node,
- (u32) operand[1]->integer.value);
- break;
-
- default:
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unexpected notify object type %X\n",
- operand[0]->common.type));
-
- status = AE_AML_OPERAND_TYPE;
- break;
- }
- }


- break;
-
- default:
-

- REPORT_ERROR (("Acpi_ex_dyadic1: Unknown dyadic opcode %X\n", opcode));


- status = AE_AML_BAD_OPCODE;
- }

-
-
- /* Always delete both operands */
-
- acpi_ut_remove_reference (operand[1]);
- acpi_ut_remove_reference (operand[0]);
-
-


- return_ACPI_STATUS (status);
-}
-

-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_ex_dyadic2_r


- *
- * PARAMETERS: Opcode - The opcode to be executed

- * Walk_state - Current walk state
- * Return_desc - Where to store the return object

- *
- * RETURN: Status
- *

- * DESCRIPTION: Execute Type 2 dyadic operator with numeric operands and
- * one or two result operands.


- *
- * ALLOCATION: Deletes one operand descriptor -- other remains on stack

- *
- ******************************************************************************/
-
-acpi_status

-acpi_ex_dyadic2_r (
- u16 opcode,


- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc)
-{
- acpi_operand_object **operand = &walk_state->operands[0];
- acpi_operand_object *ret_desc = NULL;
- acpi_operand_object *ret_desc2 = NULL;

- acpi_status status = AE_OK;
-
-

- FUNCTION_TRACE_U32 ("Ex_dyadic2_r", opcode);
-
-
- /* Create an internal return object if necessary */
-
- switch (opcode) {
- case AML_ADD_OP:
- case AML_BIT_AND_OP:
- case AML_BIT_NAND_OP:
- case AML_BIT_OR_OP:
- case AML_BIT_NOR_OP:
- case AML_BIT_XOR_OP:
- case AML_DIVIDE_OP:
- case AML_MOD_OP:
- case AML_MULTIPLY_OP:
- case AML_SHIFT_LEFT_OP:
- case AML_SHIFT_RIGHT_OP:
- case AML_SUBTRACT_OP:


-
- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
- if (!ret_desc) {
- status = AE_NO_MEMORY;

- goto cleanup;
- }
-

- break;
- }
-
-
- /*
- * Execute the opcode
- */
- switch (opcode) {
-
- /* Def_add := Add_op Operand1 Operand2 Result */
-
- case AML_ADD_OP:
-
- ret_desc->integer.value = operand[0]->integer.value +
- operand[1]->integer.value;
- break;
-
-
- /* Def_and := And_op Operand1 Operand2 Result */
-
- case AML_BIT_AND_OP:
-
- ret_desc->integer.value = operand[0]->integer.value &
- operand[1]->integer.value;
- break;
-
-
- /* Def_nAnd := NAnd_op Operand1 Operand2 Result */
-
- case AML_BIT_NAND_OP:
-
- ret_desc->integer.value = ~(operand[0]->integer.value &
- operand[1]->integer.value);
- break;
-
-
- /* Def_or := Or_op Operand1 Operand2 Result */
-
- case AML_BIT_OR_OP:
-
- ret_desc->integer.value = operand[0]->integer.value |
- operand[1]->integer.value;
- break;
-
-
- /* Def_nOr := NOr_op Operand1 Operand2 Result */
-
- case AML_BIT_NOR_OP:
-
- ret_desc->integer.value = ~(operand[0]->integer.value |
- operand[1]->integer.value);
- break;
-
-
- /* Def_xOr := XOr_op Operand1 Operand2 Result */
-
- case AML_BIT_XOR_OP:
-
- ret_desc->integer.value = operand[0]->integer.value ^
- operand[1]->integer.value;
- break;
-
-
- /* Def_divide := Divide_op Dividend Divisor Remainder Quotient */
-
- case AML_DIVIDE_OP:
-
- if (!operand[1]->integer.value) {
- REPORT_ERROR
- (("Divide_op: Divide by zero\n"));
-
- status = AE_AML_DIVIDE_BY_ZERO;


- goto cleanup;
- }
-

- ret_desc2 = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
- if (!ret_desc2) {
- status = AE_NO_MEMORY;


- goto cleanup;
- }
-

- /* Remainder (modulo) */
-
- ret_desc->integer.value = ACPI_MODULO (operand[0]->integer.value,
- operand[1]->integer.value);
-
- /* Result (what we used to call the quotient) */
-
- ret_desc2->integer.value = ACPI_DIVIDE (operand[0]->integer.value,
- operand[1]->integer.value);
- break;
-
-
- /* Def_mod := Mod_op Dividend Divisor Remainder */
-
- case AML_MOD_OP: /* ACPI 2.0 */
-
- if (!operand[1]->integer.value) {
- REPORT_ERROR
- (("Mod_op: Divide by zero\n"));
-
- status = AE_AML_DIVIDE_BY_ZERO;


- goto cleanup;
- }
-

- /* Remainder (modulo) */
-
- ret_desc->integer.value = ACPI_MODULO (operand[0]->integer.value,
- operand[1]->integer.value);
- break;
-
-
- /* Def_multiply := Multiply_op Operand1 Operand2 Result */
-
- case AML_MULTIPLY_OP:
-
- ret_desc->integer.value = operand[0]->integer.value *
- operand[1]->integer.value;
- break;
-
-
- /* Def_shift_left := Shift_left_op Operand Shift_count Result */
-
- case AML_SHIFT_LEFT_OP:
-
- ret_desc->integer.value = operand[0]->integer.value <<
- operand[1]->integer.value;
- break;
-
-
- /* Def_shift_right := Shift_right_op Operand Shift_count Result */
-
- case AML_SHIFT_RIGHT_OP:
-
- ret_desc->integer.value = operand[0]->integer.value >>
- operand[1]->integer.value;
- break;
-
-
- /* Def_subtract := Subtract_op Operand1 Operand2 Result */
-
- case AML_SUBTRACT_OP:
-
- ret_desc->integer.value = operand[0]->integer.value -
- operand[1]->integer.value;
- break;
-
-
- /* Def_concat := Concat_op Data1 Data2 Result */
-
- case AML_CONCAT_OP:
-
- /*
- * Convert the second operand if necessary. The first operand
- * determines the type of the second operand, (See the Data Types
- * section of the ACPI specification.) Both object types are
- * guaranteed to be either Integer/String/Buffer by the operand
- * resolution mechanism above.
- */
- switch (operand[0]->common.type) {
- case ACPI_TYPE_INTEGER:
- status = acpi_ex_convert_to_integer (operand[1], &operand[1], walk_state);
- break;
-
- case ACPI_TYPE_STRING:
- status = acpi_ex_convert_to_string (operand[1], &operand[1], 16, ACPI_UINT32_MAX, walk_state);
- break;
-
- case ACPI_TYPE_BUFFER:
- status = acpi_ex_convert_to_buffer (operand[1], &operand[1], walk_state);


- break;
-
- default:

- status = AE_AML_INTERNAL;
- }
-


- if (ACPI_FAILURE (status)) {
- goto cleanup;
- }
-
-

- /*
- * Both operands are now known to be the same object type
- * (Both are Integer, String, or Buffer), and we can now perform the
- * concatenation.
- */
- status = acpi_ex_do_concatenate (operand[0], operand[1], &ret_desc, walk_state);


- if (ACPI_FAILURE (status)) {
- goto cleanup;
- }

- break;
-
-
- /* Def_to_string := Buffer, Length, Result */
-
- case AML_TO_STRING_OP: /* ACPI 2.0 */
-
- status = acpi_ex_convert_to_string (operand[0], &ret_desc, 16,
- (u32) operand[1]->integer.value, walk_state);
- break;
-
-
- /* Def_concat_res := Buffer, Buffer, Result */
-
- case AML_CONCAT_RES_OP: /* ACPI 2.0 */
-
- status = AE_NOT_IMPLEMENTED;
- goto cleanup;
- break;
-
-
- default:
-
- REPORT_ERROR (("Acpi_ex_dyadic2_r: Unknown dyadic opcode %X\n",


- opcode));
- status = AE_AML_BAD_OPCODE;

- goto cleanup;
- }
-
-

- /*
- * Store the result of the operation (which is now in Operand[0]) into
- * the result descriptor, or the location pointed to by the result
- * descriptor (Operand[2]).
- */
- status = acpi_ex_store (ret_desc, operand[2], walk_state);


- if (ACPI_FAILURE (status)) {
- goto cleanup;
- }
-

- if (AML_DIVIDE_OP == opcode) {
- status = acpi_ex_store (ret_desc2, operand[3], walk_state);
-
- /*
- * Since the remainder is not returned, remove a reference to
- * the object we created earlier
- */
- acpi_ut_remove_reference (ret_desc);
- *return_desc = ret_desc2;
- }
-
- else {
- *return_desc = ret_desc;


- }
-
-
-cleanup:
-

- /* Always delete the operands */
-
- acpi_ut_remove_reference (operand[0]);
- acpi_ut_remove_reference (operand[1]);


-
-
- /* Delete return object on error */
-

- if (ACPI_FAILURE (status)) {
- /* On failure, delete the result ops */
-
- acpi_ut_remove_reference (operand[2]);
- acpi_ut_remove_reference (operand[3]);
-
- if (ret_desc) {
- /* And delete the internal return object */
-


- acpi_ut_remove_reference (ret_desc);
- ret_desc = NULL;
- }
- }
-
- /* Set the return object and exit */
-

- return_ACPI_STATUS (status);
-}
-

-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_ex_dyadic2_s


- *
- * PARAMETERS: Opcode - The opcode to be executed

- * Walk_state - Current walk state
- * Return_desc - Where to store the return object

- *
- * RETURN: Status
- *

- * DESCRIPTION: Execute Type 2 dyadic synchronization operator


- *
- * ALLOCATION: Deletes one operand descriptor -- other remains on stack

- *
- ******************************************************************************/
-
-acpi_status

-acpi_ex_dyadic2_s (
- u16 opcode,


- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc)
-{
- acpi_operand_object **operand = &walk_state->operands[0];
- acpi_operand_object *ret_desc = NULL;

- acpi_status status;
-
-

- FUNCTION_TRACE_PTR ("Ex_dyadic2_s", WALK_OPERANDS);
-
-


- /* Create the internal return object */

-
- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
- if (!ret_desc) {
- status = AE_NO_MEMORY;

- goto cleanup;
- }
-

- /* Default return value is FALSE, operation did not time out */
-
- ret_desc->integer.value = 0;


-
-
- /* Examine the opcode */
-
- switch (opcode) {
-

- /* Def_acquire := Acquire_op Mutex_object Timeout */
-
- case AML_ACQUIRE_OP:
-
- status = acpi_ex_acquire_mutex (operand[1], operand[0], walk_state);
- break;
-
-
- /* Def_wait := Wait_op Acpi_event_object Timeout */
-
- case AML_WAIT_OP:
-
- status = acpi_ex_system_wait_event (operand[1], operand[0]);
- break;
-
-
- default:
-
- REPORT_ERROR (("Acpi_ex_dyadic2_s: Unknown dyadic synchronization opcode %X\n", opcode));
- status = AE_AML_BAD_OPCODE;


- goto cleanup;
- }
-
-

- /*
- * Return a boolean indicating if operation timed out
- * (TRUE) or not (FALSE)
- */
- if (status == AE_TIME) {
- ret_desc->integer.value = ACPI_INTEGER_MAX; /* TRUE, op timed out */
- status = AE_OK;
- }
-
-
-cleanup:
-
- /* Delete params */
-
- acpi_ut_remove_reference (operand[1]);
- acpi_ut_remove_reference (operand[0]);


-
- /* Delete return object on error */
-
- if (ACPI_FAILURE (status) &&
- (ret_desc)) {
- acpi_ut_remove_reference (ret_desc);
- ret_desc = NULL;
- }
-
-

- /* Set the return object and exit */
-
- *return_desc = ret_desc;

- return_ACPI_STATUS (status);
-}
-

-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_ex_dyadic2


- *
- * PARAMETERS: Opcode - The opcode to be executed

- * Walk_state - Current walk state
- * Return_desc - Where to store the return object

- *
- * RETURN: Status
- *

- * DESCRIPTION: Execute Type 2 dyadic operator with numeric operands and
- * no result operands


- *
- * ALLOCATION: Deletes one operand descriptor -- other remains on stack

- * containing result value


- *
- ******************************************************************************/
-
-acpi_status

-acpi_ex_dyadic2 (
- u16 opcode,


- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc)
-{
- acpi_operand_object **operand = &walk_state->operands[0];
- acpi_operand_object *ret_desc = NULL;

- acpi_status status = AE_OK;

- u8 lboolean;
-
-
- FUNCTION_TRACE_PTR ("Ex_dyadic2", WALK_OPERANDS);
-
-


- /* Create the internal return object */

-
- ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
- if (!ret_desc) {
- status = AE_NO_MEMORY;

- goto cleanup;
- }
-
- /*

- * Execute the Opcode
- */
- lboolean = FALSE;
- switch (opcode) {
-
- /* Def_lAnd := LAnd_op Operand1 Operand2 */
-
- case AML_LAND_OP:
-
- lboolean = (u8) (operand[0]->integer.value &&
- operand[1]->integer.value);
- break;
-
-
- /* Def_lEqual := LEqual_op Operand1 Operand2 */
-
- case AML_LEQUAL_OP:
-
- lboolean = (u8) (operand[0]->integer.value ==
- operand[1]->integer.value);
- break;
-
-
- /* Def_lGreater := LGreater_op Operand1 Operand2 */
-
- case AML_LGREATER_OP:
-
- lboolean = (u8) (operand[0]->integer.value >
- operand[1]->integer.value);
- break;
-
-
- /* Def_lLess := LLess_op Operand1 Operand2 */
-
- case AML_LLESS_OP:
-
- lboolean = (u8) (operand[0]->integer.value <
- operand[1]->integer.value);
- break;
-
-
- /* Def_lOr := LOr_op Operand1 Operand2 */
-
- case AML_LOR_OP:
-
- lboolean = (u8) (operand[0]->integer.value ||
- operand[1]->integer.value);
- break;
-
-
- /* Def_copy := Source, Destination */
-
- case AML_COPY_OP: /* ACPI 2.0 */
-
- status = AE_NOT_IMPLEMENTED;
- goto cleanup;
- break;
-
-
- default:
-
- REPORT_ERROR (("Acpi_ex_dyadic2: Unknown dyadic opcode %X\n", opcode));


- status = AE_AML_BAD_OPCODE;
- goto cleanup;

- break;
- }
-
-

- /* Set return value to logical TRUE (all ones) or FALSE (zero) */
-
- if (lboolean) {


- ret_desc->integer.value = ACPI_INTEGER_MAX;
- }

- else {


- ret_desc->integer.value = 0;
- }
-

-
-cleanup:
-


- /* Always delete operands */
-

- acpi_ut_remove_reference (operand[0]);
- acpi_ut_remove_reference (operand[1]);


-
-
- /* Delete return object on error */
-
- if (ACPI_FAILURE (status) &&
- (ret_desc)) {
- acpi_ut_remove_reference (ret_desc);
- ret_desc = NULL;
- }
-
-

- /* Set the return object and exit */
-
- *return_desc = ret_desc;

- return_ACPI_STATUS (status);
-}
-

-
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exfldio.c linux/drivers/acpi/executer/exfldio.c
--- v2.4.13/linux/drivers/acpi/executer/exfldio.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exfldio.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: exfldio - Aml Field I/O
- * $Revision: 64 $
+ * $Revision: 66 $


X *
X *****************************************************************************/
X

@@ -71,7 +71,6 @@
X return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
X }
X
-
X /*
X * If the Region Address and Length have not been previously evaluated,


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 14'
echo 'File patch-2.4.14 is continued in part 15'
echo "15" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:49 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part26

#!/bin/sh -x
# this is part 26 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 26; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ DESCRIPTOR_AAL5_STREAM, m);
+ lvcc->tx.pptr = skb->data + m;
+ pad = lvcc->tx.pptr - skb->tail;


+ if (pad < 0)
+ pad = 0;

+ vcc_tx_memcpy(lvcc, skb->data, m - pad);
+ vcc_tx_memzero(lvcc, pad);
+ lvcc->tx.inprogleft = n - m;
+ lvcc->tx.inprogress = skb;
+ goto end;
+ }
+ vcc_tx_add_aal5_descriptor(lvcc, 0, n);
+ pad = n - skb->len - 8;
+ vcc_tx_memcpy(lvcc, skb->data, skb->len);
+ vcc_tx_memzero(lvcc, pad);
+ lanai_free_skb(lvcc->tx.atmvcc, skb);
+ vcc_tx_add_aal5trailer(lvcc, skb->len, 0, 0);
+ space -= n + 16;


+ atomic_inc(&lvcc->tx.atmvcc->stats->tx);
+ }

+ if (skb_queue_empty(&lvcc->tx.backlog))
+ vcc_unmark_backlogged(lanai, lvcc);
+ end:
+ lanai_endtx(lanai, lvcc);
+}
+
+/* Given an skb that we want to transmit either send it now or queue */
+static void vcc_tx_aal5(struct lanai_dev *lanai, struct lanai_vcc *lvcc,
+ struct sk_buff *skb)
+{
+ int space, n, pad;
+ if (vcc_is_backlogged(lvcc)) /* Already backlogged */
+ goto queue_it;
+ space = vcc_tx_space(lvcc, TXREADPTR_GET_PTR(cardvcc_read(lvcc,
+ vcc_txreadptr)));
+ if (space < 64) {
+ vcc_mark_backlogged(lanai, lvcc); /* No space */
+ goto queue_it;
+ }
+ if (space >= 16 + (n = aal5_size(skb->len))) {
+ /* We can send the whole thing now */
+ vcc_tx_add_aal5_descriptor(lvcc, 0, n);
+ pad = n - skb->len;
+ vcc_tx_memcpy(lvcc, skb->data, skb->len);


+ vcc_tx_memzero(lvcc, pad - 8);

+ vcc_tx_add_aal5trailer(lvcc, skb->len, 0, 0);
+ lanai_free_skb(lvcc->tx.atmvcc, skb);


+ atomic_inc(&lvcc->tx.atmvcc->stats->tx);

+ } else { /* Space for only part of skb */
+ int bytes = aal5_spacefor(space - 16); /* Bytes to send */
+ vcc_tx_add_aal5_descriptor(lvcc,
+ DESCRIPTOR_AAL5_STREAM, bytes);
+ pad = bytes - skb->len;


+ if (pad < 0)
+ pad = 0;

+ vcc_tx_memcpy(lvcc, skb->data, bytes - pad);
+ vcc_tx_memzero(lvcc, pad);
+ lvcc->tx.inprogress = skb;
+ lvcc->tx.inprogleft = n - bytes;
+ lvcc->tx.pptr = skb->data + bytes;
+ vcc_mark_backlogged(lanai, lvcc);
+ }
+ lanai_endtx(lanai, lvcc);
+ return;
+ queue_it:
+ skb_queue_tail(&lvcc->tx.backlog, skb);
+}
+
+static void vcc_tx_unqueue_aal0(struct lanai_dev *lanai,


+ struct lanai_vcc *lvcc, int endptr)
+{

+ printk(KERN_INFO DEV_LABEL
+ ": vcc_tx_unqueue_aal0: not implemented\n");
+}
+
+static void vcc_tx_aal0(struct lanai_dev *lanai, struct lanai_vcc *lvcc,
+ struct sk_buff *skb)
+{
+ printk(KERN_INFO DEV_LABEL ": vcc_tx_aal0: not implemented\n");
+ /* Remember to increment lvcc->tx.atmvcc->stats->tx */


+ lanai_free_skb(lvcc->tx.atmvcc, skb);
+}

+
+/* Try to undequeue 1 backlogged vcc */
+static void iter_dequeue(struct lanai_dev *lanai, vci_t vci)
+{
+ struct lanai_vcc *lvcc = lanai->vccs[vci];
+ int endptr;
+ if (lvcc == NULL || !vcc_is_backlogged(lvcc)) {
+ vci_bitfield_clear(&lanai->backlog_vccs, vci);
+ return;
+ }
+ endptr = TXREADPTR_GET_PTR(cardvcc_read(lvcc, vcc_txreadptr));
+ lvcc->tx.unqueue(lanai, lvcc, endptr);
+}
+
+/* Try a dequeue on all backlogged connections */
+static inline void vcc_tx_dequeue_all(struct lanai_dev *lanai)


+{
+ unsigned long flags;

+ spin_lock_irqsave(&lanai->txlock, flags);
+ vci_bitfield_iterate(lanai, &lanai->backlog_vccs, iter_dequeue);


+ spin_unlock_irqrestore(&lanai->txlock, flags);
+}

+
+/* -------------------- VCC RX BUFFER UTILITIES: */
+
+/* unlike the _tx_ cousins, this doesn't update ptr */
+static inline void vcc_rx_memcpy(unsigned char *dest,
+ const struct lanai_vcc *lvcc, int n)
+{
+ int m = ((const unsigned char *) lvcc->rx.buf.ptr) + n -
+ ((const unsigned char *) (lvcc->rx.buf.end));


+ if (m < 0)
+ m = 0;

+ memcpy(dest, lvcc->rx.buf.ptr, n - m);
+ memcpy(dest + n - m, lvcc->rx.buf.start, m);
+}
+
+/* Receive AAL5 data on a VCC with a particular endptr */
+static void vcc_rx_aal5(struct lanai_vcc *lvcc, int endptr)
+{
+ int size;
+ struct sk_buff *skb;
+ /*const*/ u32 *x, *end = &lvcc->rx.buf.start[endptr * 4];
+ int n = ((unsigned long) end) - ((unsigned long) lvcc->rx.buf.ptr);
+ if (n < 0)
+ n += lanai_buf_size(&lvcc->rx.buf);
+ APRINTK(n >= 0 && n < lanai_buf_size(&lvcc->rx.buf) && !(n & 15),
+ "vcc_rx_aal5: n out of range (%d/%d)\n",
+ n, lanai_buf_size(&lvcc->rx.buf));
+ /* Recover the second-to-last word to get true pdu length */
+ if ((x = &end[-2]) < lvcc->rx.buf.start)
+ x = &lvcc->rx.buf.end[-2];
+ size = be32_to_cpup(x) & 0xffff;
+ if (n != aal5_size(size)) { /* Make sure size matches padding */
+ printk(KERN_INFO DEV_LABEL "(itf %d): Got bad AAL5 length "
+ "on vci=%d - size=%d n=%d\n",
+ lvcc->rx.atmvcc->dev->number, lvcc->vci, size, n);
+ lvcc->stats.x.aal5.rx_badlen++;
+ goto out;
+ }
+ skb = atm_alloc_charge(lvcc->rx.atmvcc, size, GFP_ATOMIC);
+ if (skb == NULL) {
+ lvcc->stats.rx_nomem++;
+ goto out;
+ }
+ skb_put(skb, size);
+ ATM_SKB(skb)->vcc = lvcc->rx.atmvcc;
+ skb->stamp = xtime;
+ vcc_rx_memcpy(skb->data, lvcc, size);
+ lvcc->rx.atmvcc->push(lvcc->rx.atmvcc, skb);
+ atomic_inc(&lvcc->rx.atmvcc->stats->rx);
+ out:
+ lvcc->rx.buf.ptr = end;
+ cardvcc_write(lvcc, endptr, vcc_rxreadptr);
+}
+
+static void vcc_rx_aal0(struct lanai_dev *lanai)
+{
+ printk(KERN_INFO DEV_LABEL ": vcc_rx_aal0: not implemented\n");
+ /* Remember to get vcclist_read_lock while looking up VC */
+ /* Remember to increment lvcc->rx.atmvcc->stats->rx */
+}
+
+/* -------------------- MANAGING HOST-BASED VCC TABLE: */
+
+/* Decide whether to use vmalloc or get_free_page for VCC table */
+#if (NUM_VCI * BITS_PER_LONG) <= PAGE_SIZE
+#define VCCTABLE_GETFREEPAGE
+#else
+#include <linux/vmalloc.h>
+#endif
+
+static int __init vcc_table_allocate(struct lanai_dev *lanai)
+{
+#ifdef VCCTABLE_GETFREEPAGE
+ APRINTK((lanai->num_vci) * sizeof(struct lanai_vcc *) <= PAGE_SIZE,
+ "vcc table > PAGE_SIZE!");
+ lanai->vccs = (struct lanai_vcc **) get_free_page(GFP_KERNEL);
+ return (lanai->vccs == NULL) ? -ENOMEM : 0;
+#else
+ int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *);
+ lanai->vccs = (struct lanai_vcc **) vmalloc(bytes);
+ if (lanai->vccs == NULL)
+ return -ENOMEM;
+ memset(lanai->vccs, 0, bytes);
+ return 0;
+#endif
+}
+
+static inline void vcc_table_deallocate(const struct lanai_dev *lanai)
+{
+#ifdef VCCTABLE_GETFREEPAGE
+ free_page((unsigned long) lanai->vccs);
+#else
+ vfree(lanai->vccs);
+#endif
+}
+
+/* Allocate a fresh lanai_vcc, with the appropriate things cleared */
+static inline struct lanai_vcc *new_lanai_vcc(void)
+{
+ struct lanai_vcc *lvcc;
+ lvcc = (struct lanai_vcc *) kmalloc(sizeof(*lvcc), GFP_KERNEL);
+ if (lvcc != NULL) {
+ lvcc->vbase = 0;
+ lvcc->rx.atmvcc = lvcc->tx.atmvcc = NULL;
+ lvcc->nref = 0;
+ memset(&lvcc->stats, 0, sizeof lvcc->stats);
+ lvcc->rx.buf.start = lvcc->tx.buf.start = NULL;
+ skb_queue_head_init(&lvcc->tx.backlog);


+ lvcc->tx.inprogress = NULL;

+#ifdef DEBUG
+ lvcc->tx.unqueue = NULL;
+ lvcc->vci = -1;
+#endif
+ }
+ return lvcc;
+}
+
+static int lanai_get_sized_buffer(int number, struct lanai_buffer *buf,
+ int max_sdu, int multiplier, int min, const char *name)
+{
+ int size;
+ if (max_sdu < 1)
+ max_sdu = 1;
+ max_sdu = aal5_size(max_sdu);
+ size = (max_sdu + 16) * multiplier + 16;
+ lanai_buf_allocate(buf, size, min);
+ if (buf->order < 0)
+ return -ENOMEM;
+ if (lanai_buf_size(buf) < size)
+ printk(KERN_WARNING DEV_LABEL "(itf %d): wanted %d bytes "
+ "for %s buffer, got only %d\n", number, size, name,
+ lanai_buf_size(buf));
+ DPRINTK("Allocated %d byte %s buffer\n", lanai_buf_size(buf), name);


+ return 0;
+}
+

+/* Setup a RX buffer for a currently unbound AAL5 vci */
+static inline int lanai_setup_rx_vci_aal5(int number, struct lanai_vcc *lvcc,
+ const struct atm_qos *qos)
+{
+ return lanai_get_sized_buffer(number, &lvcc->rx.buf,
+ qos->rxtp.max_sdu, AAL5_RX_MULTIPLIER, qos->rxtp.max_sdu + 32,
+ "RX");
+}
+
+/* Setup a TX buffer for a currently unbound AAL5 vci */
+static int lanai_setup_tx_vci(int number, struct lanai_vcc *lvcc,
+ const struct atm_qos *qos)
+{
+ int max_sdu, multiplier;
+ if (qos->aal == ATM_AAL0) {
+ lvcc->tx.unqueue = vcc_tx_unqueue_aal0;
+ max_sdu = ATM_CELL_SIZE - 1;
+ multiplier = AAL0_TX_MULTIPLIER;
+ } else {
+ lvcc->tx.unqueue = vcc_tx_unqueue_aal5;
+ max_sdu = qos->txtp.max_sdu;
+ multiplier = AAL5_TX_MULTIPLIER;
+ }
+ return lanai_get_sized_buffer(number, &lvcc->tx.buf, max_sdu,
+ multiplier, 80, "TX");
+}
+
+static inline void host_vcc_bind(struct lanai_dev *lanai,
+ struct lanai_vcc *lvcc, vci_t vci)
+{
+ if (lvcc->vbase != 0)
+ return; /* We already were bound in the other direction */
+ DPRINTK("Binding vci %d\n", vci);
+#ifdef USE_POWERDOWN
+ if (lanai->nbound++ == 0) {
+ DPRINTK("Coming out of powerdown\n");
+ lanai->conf1 &= ~CONFIG1_POWERDOWN;
+ conf1_write(lanai);
+ conf2_write(lanai);
+ }
+#endif
+ lvcc->vbase = cardvcc_addr(lanai, vci);
+ lanai->vccs[lvcc->vci = vci] = lvcc;
+}
+
+static inline void host_vcc_unbind(struct lanai_dev *lanai,


+ struct lanai_vcc *lvcc)
+{

+ if (lvcc->vbase == 0)

+ return; /* This vcc was never bound */
+ DPRINTK("Unbinding vci %d\n", lvcc->vci);
+ lvcc->vbase = 0;
+ lanai->vccs[lvcc->vci] = NULL;
+#ifdef USE_POWERDOWN
+ if (--lanai->nbound == 0) {
+ DPRINTK("Going into powerdown\n");
+ lanai->conf1 |= CONFIG1_POWERDOWN;
+ conf1_write(lanai);
+ }
+#endif
+}
+
+/* -------------------- RESET CARD: */
+
+static void lanai_reset(struct lanai_dev *lanai)
+{
+ printk(KERN_CRIT DEV_LABEL "(itf %d): *NOT* reseting - not "
+ "implemented\n", lanai->number);
+ /* TODO */
+ /* The following is just a hack until we write the real
+ * resetter - at least ack whatever interrupt sent us
+ * here
+ */
+ reg_write(lanai, INT_ALL, IntAck_Reg);
+ lanai->stats.card_reset++;
+}
+
+/* -------------------- SERVICE LIST UTILITIES: */
+
+/*
+ * Allocate service buffer and tell card about it
+ */
+static int __init service_buffer_allocate(struct lanai_dev *lanai)
+{
+ lanai_buf_allocate(&lanai->service, SERVICE_ENTRIES * 4, 0);
+ if (lanai->service.order < 0)
+ return -ENOMEM;
+ DPRINTK("allocated service buffer at 0x%08lX, size %d(%d)\n",
+ (unsigned long) lanai->service.start,
+ lanai_buf_size(&lanai->service),
+ lanai_buf_size_cardorder(&lanai->service));
+ /* Clear ServWrite register to be safe */
+ reg_write(lanai, 0, ServWrite_Reg);
+ /* ServiceStuff register contains size and address of buffer */
+ reg_write(lanai,
+ SSTUFF_SET_SIZE(lanai_buf_size_cardorder(&lanai->service)) |
+ SSTUFF_SET_ADDR(lanai_buf_dmaaddr(&lanai->service)),
+ ServiceStuff_Reg);


+ return 0;
+}
+

+static inline void service_buffer_deallocate(struct lanai_dev *lanai)
+{
+ lanai_buf_deallocate(&lanai->service);
+}
+
+/* Bitfields in service list */
+#define SERVICE_TX (0x80000000) /* Was from transmission */
+#define SERVICE_TRASH (0x40000000) /* RXed PDU was trashed */
+#define SERVICE_CRCERR (0x20000000) /* RXed PDU had CRC error */
+#define SERVICE_CI (0x10000000) /* RXed PDU had CI set */
+#define SERVICE_CLP (0x08000000) /* RXed PDU had CLP set */
+#define SERVICE_STREAM (0x04000000) /* RX Stream mode */
+#define SERVICE_GET_VCI(x) (((x)>>16)&0x3FF)
+#define SERVICE_GET_END(x) ((x)&0x1FFF)
+
+/* Handle one thing from the service list - returns true if it marked a
+ * VCC ready for xmit
+ */
+static int handle_service(struct lanai_dev *lanai, u32 s)
+{
+ vci_t vci = SERVICE_GET_VCI(s);
+ struct lanai_vcc *lvcc;
+ vcclist_read_lock();
+ lvcc = lanai->vccs[vci];
+ if (lvcc == NULL) {
+ vcclist_read_unlock();
+ DPRINTK("(itf %d) got service entry 0x%X for nonexistent "
+ "vcc %d\n", lanai->number, s, vci);
+ if (s & SERVICE_TX)
+ lanai->stats.service_novcc_tx++;
+ else
+ lanai->stats.service_novcc_rx++;
+ return 0;
+ }
+ if (s & SERVICE_TX) { /* segmentation interrupt */
+ if (lvcc->tx.atmvcc == NULL) {
+ vcclist_read_unlock();
+ DPRINTK("(itf %d) got service entry 0x%X for non-TX "
+ "vcc %d\n", lanai->number, s, vci);
+ lanai->stats.service_notx++;
+ return 0;
+ }
+ vci_bitfield_set(&lanai->transmit_ready, vci);
+ lvcc->tx.endptr = SERVICE_GET_END(s);
+ vcclist_read_unlock();
+ return 1;
+ }
+ if (lvcc->rx.atmvcc == NULL) {
+ vcclist_read_unlock();
+ DPRINTK("(itf %d) got service entry 0x%X for non-RX "
+ "vcc %d\n", lanai->number, s, vci);
+ lanai->stats.service_norx++;
+ return 0;
+ }
+ if (lvcc->rx.atmvcc->qos.aal != ATM_AAL5) {
+ vcclist_read_unlock();
+ DPRINTK("(itf %d) got RX service entry 0x%X for non-AAL5 "
+ "vcc %d\n", lanai->number, s, vci);
+ lanai->stats.service_rxnotaal5++;
+ atomic_inc(&lvcc->rx.atmvcc->stats->rx_err);
+ return 0;
+ }
+ if ((s & (SERVICE_TRASH | SERVICE_STREAM | SERVICE_CRCERR)) == 0) {
+ vcc_rx_aal5(lvcc, SERVICE_GET_END(s));
+ vcclist_read_unlock();
+ return 0;
+ }
+ if (s & SERVICE_TRASH) {
+ int bytes;
+ vcclist_read_unlock();
+ DPRINTK("got trashed rx pdu on vci %d\n", vci);
+ atomic_inc(&lvcc->rx.atmvcc->stats->rx_err);
+ lvcc->stats.x.aal5.service_trash++;
+ bytes = (SERVICE_GET_END(s) * 16) -
+ (((unsigned long) lvcc->rx.buf.ptr) -
+ ((unsigned long) lvcc->rx.buf.start)) + 47;
+ if (bytes < 0)
+ bytes += lanai_buf_size(&lvcc->rx.buf);
+ lanai->stats.ovfl_trash += (bytes / 48);
+ return 0;
+ }
+ if (s & SERVICE_STREAM) {
+ vcclist_read_unlock();
+ atomic_inc(&lvcc->rx.atmvcc->stats->rx_err);
+ lvcc->stats.x.aal5.service_stream++;
+ printk(KERN_ERR DEV_LABEL "(itf %d): Got AAL5 stream "
+ "PDU on VCI %d!\n", lanai->number, vci);
+ lanai_reset(lanai);
+ return 0;
+ }
+ DPRINTK("got rx crc error on vci %d\n", vci);
+ atomic_inc(&lvcc->rx.atmvcc->stats->rx_err);
+ lvcc->stats.x.aal5.service_rxcrc++;
+ lvcc->rx.buf.ptr = &lvcc->rx.buf.start[SERVICE_GET_END(s) * 4];
+ cardvcc_write(lvcc, SERVICE_GET_END(s), vcc_rxreadptr);
+ vcclist_read_unlock();


+ return 0;
+}
+

+/* Try transmitting on all VCIs that we marked ready to serve */
+static void iter_transmit(struct lanai_dev *lanai, vci_t vci)
+{
+ struct lanai_vcc *lvcc = lanai->vccs[vci];
+ if (!vcc_is_backlogged(lvcc))
+ return;
+ lvcc->tx.unqueue(lanai, lvcc, lvcc->tx.endptr);
+}
+
+/* Run service queue -- called from interrupt context or with
+ * interrupts otherwise disabled and with the lanai->servicelock
+ * lock held
+ */
+static void run_service(struct lanai_dev *lanai)
+{
+ int ntx = 0;
+ u32 wreg = reg_read(lanai, ServWrite_Reg);
+ const u32 *end = lanai->service.start + wreg;
+ while (lanai->service.ptr != end) {
+ ntx += handle_service(lanai,
+ le32_to_cpup(lanai->service.ptr++));
+ if (lanai->service.ptr >= lanai->service.end)
+ lanai->service.ptr = lanai->service.start;
+ }
+ reg_write(lanai, wreg, ServRead_Reg);
+ if (ntx != 0) {
+ spin_lock(&lanai->txlock);
+ vcclist_read_lock();
+ vci_bitfield_iterate(lanai, &lanai->transmit_ready,
+ iter_transmit);
+ vci_bitfield_init(&lanai->transmit_ready);
+ vcclist_read_unlock();
+ spin_unlock(&lanai->txlock);
+ }
+}
+
+/* -------------------- GATHER STATISTICS: */
+
+static void get_statistics(struct lanai_dev *lanai)
+{
+ u32 statreg = reg_read(lanai, Statistics_Reg);
+ lanai->stats.atm_ovfl += STATS_GET_FIFO_OVFL(statreg);
+ lanai->stats.hec_err += STATS_GET_HEC_ERR(statreg);
+ lanai->stats.vci_trash += STATS_GET_BAD_VCI(statreg);
+ lanai->stats.ovfl_trash += STATS_GET_BUF_OVFL(statreg);
+}
+
+/* -------------------- POLLING TIMER: */
+
+static void lanai_timed_poll(unsigned long arg)
+{
+#ifndef DEBUG_RW
+ struct lanai_dev *lanai = (struct lanai_dev *) arg;
+ unsigned long flags;
+#ifdef USE_POWERDOWN
+ if (lanai->conf1 & CONFIG1_POWERDOWN)
+ return;
+#endif
+ spin_lock_irqsave(&lanai->servicelock, flags);
+ run_service(lanai);
+ spin_unlock_irqrestore(&lanai->servicelock, flags);
+ vcc_tx_dequeue_all(lanai);
+ get_statistics(lanai);
+ mod_timer(&lanai->timer, jiffies + LANAI_POLL_PERIOD);
+#endif /* DEBUG_RW */
+}
+
+static inline void lanai_timed_poll_start(struct lanai_dev *lanai)
+{
+ init_timer(&lanai->timer);
+ lanai->timer.expires = jiffies + LANAI_POLL_PERIOD;
+ lanai->timer.data = (unsigned long) lanai;
+ lanai->timer.function = lanai_timed_poll;
+ add_timer(&lanai->timer);
+}
+
+static inline void lanai_timed_poll_stop(struct lanai_dev *lanai)
+{
+ del_timer(&lanai->timer);
+}
+
+/* -------------------- INTERRUPT SERVICE: */
+
+static inline void lanai_int_1(struct lanai_dev *lanai, u32 reason)
+{
+ u32 ack = 0;
+ if (reason & INT_SERVICE) {
+ ack = INT_SERVICE;
+ spin_lock(&lanai->servicelock);
+ run_service(lanai);
+ spin_unlock(&lanai->servicelock);
+ }
+ if (reason & (INT_AAL0_STR | INT_AAL0)) {
+ ack |= reason & (INT_AAL0_STR | INT_AAL0);
+ vcc_rx_aal0(lanai);
+ }
+ if (reason & INT_STATS) {
+ reason &= ~INT_STATS; /* No need to ack */
+ get_statistics(lanai);
+ }
+ if (reason & INT_STATUS) {
+ ack |= reason & INT_STATUS;
+ lanai_check_status(lanai);
+ }
+ if (reason & INT_DMASHUT) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): driver error - DMA "
+ "shutdown, reason=0x%08X, address=0x%08X\n",
+ lanai->number, reason & INT_DMASHUT,
+ reg_read(lanai, DMA_Addr_Reg));
+ if (reason & INT_TABORTBM) {
+ lanai_reset(lanai);
+ return;
+ }
+ ack |= (reason & INT_DMASHUT);
+ printk(KERN_ERR DEV_LABEL "(itf %d): re-enabling DMA\n",
+ lanai->number);
+ conf1_write(lanai);
+ lanai->stats.dma_reenable++;
+ pcistatus_check(lanai, 0);
+ }
+ if (reason & INT_TABORTSENT) {
+ ack |= (reason & INT_TABORTSENT);
+ printk(KERN_ERR DEV_LABEL "(itf %d): sent PCI target abort\n",
+ lanai->number);
+ pcistatus_check(lanai, 0);
+ }
+ if (reason & INT_SEGSHUT) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): driver error - "
+ "segmentation shutdown, reason=0x%08X\n", lanai->number,
+ reason & INT_SEGSHUT);
+ lanai_reset(lanai);
+ return;
+ }
+ if (reason & (INT_PING | INT_WAKE)) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): driver error - "
+ "unexpected interrupt 0x%08X, resetting\n",
+ lanai->number, reason & (INT_PING | INT_WAKE));
+ lanai_reset(lanai);
+ return;
+ }
+#ifdef DEBUG
+ if (ack != reason) {
+ DPRINTK("unacked ints: 0x%08X\n", reason & ~ack);
+ ack = reason;
+ }
+#endif
+ if (ack != 0)
+ reg_write(lanai, ack, IntAck_Reg);
+}
+
+static void lanai_int(int irq, void *devid, struct pt_regs *regs)
+{
+ struct lanai_dev *lanai = (struct lanai_dev *) devid;
+ u32 reason;
+ (void) irq; (void) regs; /* unused variables */
+#ifdef USE_POWERDOWN
+ if (lanai->conf1 & CONFIG1_POWERDOWN) {
+ lanai->conf1 &= ~CONFIG1_POWERDOWN;
+ conf1_write(lanai);
+ printk(KERN_WARNING DEV_LABEL "(itf %d): Got interrupt "
+ "0x%08X while in POWERDOWN, powering up\n", lanai->conf1,
+ intr_pending(lanai));
+ conf2_write(lanai);
+ }
+#endif
+ while ((reason = intr_pending(lanai)) != 0)
+ lanai_int_1(lanai, reason);
+}
+
+/* TODO - it would be nice if we could use the "delayed interrupt" system
+ * to some advantage
+ */
+
+/* -------------------- CHECK BOARD ID/REV: */
+
+/*
+ * The board id and revision are stored both in the reset register and
+ * in the PCI configuration space - the documentation says to check
+ * each of them. If revp!=NULL we store the revision there
+ */
+static int check_board_id_and_rev(const char *name, u32 val, int *revp)
+{
+ DPRINTK("%s says board_id=%d, board_rev=%d\n", name,
+ RESET_GET_BOARD_ID(val), RESET_GET_BOARD_REV(val));
+ if (RESET_GET_BOARD_ID(val) != BOARD_ID_LANAI256) {
+ printk(KERN_ERR DEV_LABEL ": Found %s board-id %d -- not a "
+ "Lanai 25.6\n", name, RESET_GET_BOARD_ID(val));
+ return -ENODEV;
+ }
+ if (revp != NULL)
+ *revp = RESET_GET_BOARD_REV(val);


+ return 0;
+}
+

+/* -------------------- PCI INITIALIZATION/SHUTDOWN: */
+
+static inline int __init lanai_pci_start(struct lanai_dev *lanai)
+{
+ struct pci_dev *pci = lanai->pci;
+ int result;
+ u16 w;
+ /* Get the pci revision byte */
+ result = pci_read_config_byte(pci, PCI_REVISION_ID,
+ &lanai->pci_revision);


+ if (result != PCIBIOS_SUCCESSFUL) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): can't read "

+ "PCI_REVISION_ID: %d\n", lanai->number, result);
+ return -EINVAL;
+ }
+ result = pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &w);


+ if (result != PCIBIOS_SUCCESSFUL) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): can't read ""

+ PCI_SUBSYSTEM_ID: %d\n", lanai->number, result);
+ return -EINVAL;
+ }
+ if ((result = check_board_id_and_rev("PCI", w, NULL)) != 0)
+ return result;
+ /* Set latency timer to zero as per lanai docs */
+ result = pci_write_config_byte(pci, PCI_LATENCY_TIMER, 0);


+ if (result != PCIBIOS_SUCCESSFUL) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): can't write "

+ "PCI_LATENCY_TIMER: %d\n", lanai->number, result);
+ return -EINVAL;
+ }
+ result = pci_read_config_word(pci, PCI_COMMAND, &w);


+ if (result != PCIBIOS_SUCCESSFUL) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): can't read "

+ "PCI_COMMAND: %d\n", lanai->number, result);
+ return -EINVAL;
+ }
+ w |= (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_SERR |
+ PCI_COMMAND_PARITY);
+ result = pci_write_config_word(pci, PCI_COMMAND, w);


+ if (result != PCIBIOS_SUCCESSFUL) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): can't "

+ "write PCI_COMMAND: %d\n", lanai->number, result);
+ return -EINVAL;
+ }
+ pcistatus_check(lanai, 1);
+ pcistatus_check(lanai, 0);


+ return 0;
+}
+

+static void lanai_pci_stop(struct lanai_dev *lanai)
+{
+ struct pci_dev *pci = lanai->pci;
+ int result;
+ u16 pci_command;
+ result = pci_read_config_word(pci, PCI_COMMAND, &pci_command);


+ if (result != PCIBIOS_SUCCESSFUL) {
+ printk(KERN_ERR DEV_LABEL "(itf %d): can't "

+ "read PCI_COMMAND: %d\n", lanai->number, result);
+ return;
+ }
+ pci_command &= ~(PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
+ result = pci_write_config_word(pci, PCI_COMMAND, pci_command);


+ if (result != PCIBIOS_SUCCESSFUL)
+ printk(KERN_ERR DEV_LABEL "(itf %d): can't "

+ "write PCI_COMMAND: %d\n", lanai->number, result);
+}
+
+/* -------------------- VPI/VCI ALLOCATION: */
+
+/*
+ * We _can_ use VCI==0 for normal traffic, but only for UBR (or we'll
+ * get a CBRZERO interrupt), and we can use it only if noone is receiving
+ * AAL0 traffic (since they will use the same queue) - according to the
+ * docs we shouldn't even use it for AAL0 traffic
+ */
+static inline int vci0_is_ok(struct lanai_dev *lanai,
+ const struct atm_qos *qos)
+{
+ if (qos->txtp.traffic_class == ATM_CBR || qos->aal == ATM_AAL0)
+ return 0;
+ if (qos->rxtp.traffic_class != ATM_NONE) {
+ if (lanai->naal0 != 0)
+ return 0;
+ lanai->conf2 |= CONFIG2_VCI0_NORMAL;
+#ifdef USE_POWERDOWN
+ if ((lanai->conf1 & CONFIG1_POWERDOWN) == 0)
+#endif
+ conf2_write(lanai);


+ }
+ return 1;
+}
+

+/* return true if vci is currently unused, or if requested qos is
+ * compatible
+ */
+static int vci_is_ok(struct lanai_dev *lanai, vci_t vci,
+ const struct atm_vcc *atmvcc)
+{
+ const struct atm_qos *qos = &atmvcc->qos;
+ const struct lanai_vcc *lvcc = lanai->vccs[vci];
+ if (vci == 0 && !vci0_is_ok(lanai, qos))
+ return 0;
+ if (lvcc != NULL) {
+ if (qos->rxtp.traffic_class != ATM_NONE &&
+ lvcc->rx.atmvcc != NULL && lvcc->rx.atmvcc != atmvcc)
+ return 0;
+ if (qos->txtp.traffic_class != ATM_NONE &&
+ lvcc->tx.atmvcc != NULL && lvcc->tx.atmvcc != atmvcc)
+ return 0;
+ if (qos->txtp.traffic_class == ATM_CBR &&
+ lanai->cbrvcc != NULL && lanai->cbrvcc != atmvcc)
+ return 0;
+ }
+ if (qos->aal == ATM_AAL0 && lanai->naal0 == 0 &&
+ qos->rxtp.traffic_class != ATM_NONE) {
+ const struct lanai_vcc *vci0 = lanai->vccs[0];
+ if (vci0 != NULL && vci0->rx.atmvcc != NULL)
+ return 0;
+ lanai->conf2 &= ~CONFIG2_VCI0_NORMAL;
+#ifdef USE_POWERDOWN
+ if ((lanai->conf1 & CONFIG1_POWERDOWN) == 0)
+#endif
+ conf2_write(lanai);


+ }
+ return 1;
+}
+

+static int lanai_normalize_ci(struct lanai_dev *lanai,
+ const struct atm_vcc *atmvcc, short *vpip, vci_t *vcip)
+{
+ switch (*vpip) {
+ case ATM_VPI_ANY:
+ *vpip = 0;
+ /* FALLTHROUGH */
+ case 0:
+ break;
+ default:
+ return -EADDRINUSE;
+ }
+ switch (*vcip) {
+ case ATM_VCI_ANY:
+ for (*vcip = ATM_NOT_RSV_VCI; *vcip < lanai->num_vci;
+ (*vcip)++)
+ if (vci_is_ok(lanai, *vcip, atmvcc))
+ return 0;
+ return -EADDRINUSE;
+ default:
+ if (*vcip >= lanai->num_vci || *vcip < 0 ||
+ !vci_is_ok(lanai, *vcip, atmvcc))
+ return -EADDRINUSE;


+ }
+ return 0;
+}

+
+/* -------------------- MANAGE CBR: */
+
+/*
+ * CBR ICG is stored as a fixed-point number with 4 fractional bits.
+ * Note that storing a number greater than 2046.0 will result in
+ * incorrect shaping
+ */
+#define CBRICG_FRAC_BITS (4)
+#define CBRICG_MAX (2046 << CBRICG_FRAC_BITS)
+
+/*
+ * ICG is related to PCR with the formula PCR = MAXPCR / (ICG + 1)
+ * where MAXPCR is (according to the docs) 25600000/(54*8),
+ * which is equal to (3125<<9)/27.
+ *
+ * Solving for ICG, we get:
+ * ICG = MAXPCR/PCR - 1
+ * ICG = (3125<<9)/(27*PCR) - 1
+ * ICG = ((3125<<9) - (27*PCR)) / (27*PCR)
+ *
+ * The end result is supposed to be a fixed-point number with FRAC_BITS
+ * bits of a fractional part, so we keep everything in the numerator
+ * shifted by that much as we compute
+ *
+ */
+static int pcr_to_cbricg(/*const*/ struct atm_qos *qos)
+{
+ int rounddown = 0; /* 1 = Round PCR down, i.e. round ICG _up_ */
+ int x, icg, pcr = atm_pcr_goal(&qos->txtp);
+ if (pcr == 0) /* Use maximum bandwidth */
+ return 0;
+ if (pcr < 0) {
+ rounddown = 1;
+ pcr = -pcr;
+ }
+ x = pcr * 27;
+ icg = (3125 << (9 + CBRICG_FRAC_BITS)) - (x << CBRICG_FRAC_BITS);
+ if (rounddown)
+ icg += x - 1;
+ icg /= x;
+ if (icg > CBRICG_MAX)
+ icg = CBRICG_MAX;
+ DPRINTK("pcr_to_cbricg: pcr=%d rounddown=%c icg=%d\n",
+ pcr, rounddown ? 'Y' : 'N', icg);
+ return icg;
+}
+
+static inline void lanai_cbr_setup(struct lanai_dev *lanai)
+{
+ reg_write(lanai, pcr_to_cbricg(&lanai->cbrvcc->qos), CBR_ICG_Reg);
+ reg_write(lanai, lanai->cbrvcc->vci, CBR_PTR_Reg);
+ lanai->conf2 |= CONFIG2_CBR_ENABLE;
+ conf2_write(lanai);
+}
+
+static inline void lanai_cbr_shutdown(struct lanai_dev *lanai)
+{
+ lanai->conf2 &= ~CONFIG2_CBR_ENABLE;
+ conf2_write(lanai);
+}
+
+/* -------------------- OPERATIONS: */
+
+/* setup a newly detected device */
+static int __init lanai_dev_open(struct atm_dev *atmdev)
+{
+ struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
+ unsigned long raw_base;
+ int result;
+
+ DPRINTK("In lanai_dev_open()\n");
+ /* Basic device fields */
+ lanai->number = atmdev->number;
+ lanai->num_vci = NUM_VCI;
+ vci_bitfield_init(&lanai->backlog_vccs);
+ vci_bitfield_init(&lanai->transmit_ready);
+ lanai->naal0 = 0;
+#ifdef USE_POWERDOWN
+ lanai->nbound = 0;
+#endif
+ lanai->cbrvcc = NULL;
+ memset(&lanai->stats, 0, sizeof lanai->stats);
+ spin_lock_init(&lanai->txlock);
+ spin_lock_init(&lanai->servicelock);
+ atmdev->ci_range.vpi_bits = 0;
+ atmdev->ci_range.vci_bits = 0;
+ while (1 << atmdev->ci_range.vci_bits < lanai->num_vci)
+ atmdev->ci_range.vci_bits++;
+ atmdev->link_rate = ((25600000 / 8 - 8000) / 54);
+
+ /* 3.2: PCI initialization */
+ if ((result = lanai_pci_start(lanai)) != 0)
+ goto error;
+ raw_base = (bus_addr_t) lanai->pci->resource[0].start;
+ lanai->base = (bus_addr_t) ioremap(raw_base, LANAI_MAPPING_SIZE);
+ if (lanai->base == 0) {
+ printk(KERN_ERR DEV_LABEL ": couldn't remap I/O space\n");
+ goto error_pci;
+ }
+ /* 3.3: Reset lanai and PHY */
+ reset_board(lanai);
+ lanai->conf1 = reg_read(lanai, Config1_Reg);
+ lanai->conf1 &= ~(CONFIG1_GPOUT1 | CONFIG1_POWERDOWN |
+ CONFIG1_MASK_LEDMODE);
+ lanai->conf1 |= CONFIG1_SET_LEDMODE(LEDMODE_NOT_SOOL);
+ reg_write(lanai, lanai->conf1 | CONFIG1_GPOUT1, Config1_Reg);
+ udelay(1000);
+ conf1_write(lanai);
+
+ /*
+ * 3.4: Turn on endian mode for big-endian hardware
+ * We don't actually want to do this - the actual bit fields
+ * in the endian register are not documented anywhere.
+ * Instead we do the bit-flipping ourselves on big-endian
+ * hardware.
+ *
+ * 3.5: get the board ID/rev by reading the reset register
+ */
+ result = check_board_id_and_rev("register",
+ reg_read(lanai, Reset_Reg), &lanai->board_rev);
+ if (result != 0)
+ goto error_unmap;
+
+ /* 3.6: read EEPROM */
+ if ((result = eeprom_read(lanai)) != 0)
+ goto error_unmap;
+ if ((result = eeprom_validate(lanai)) != 0)
+ goto error_unmap;
+
+ /* 3.7: re-reset PHY, do loopback tests, setup PHY */
+ reg_write(lanai, lanai->conf1 | CONFIG1_GPOUT1, Config1_Reg);
+ udelay(1000);
+ conf1_write(lanai);
+ /* TODO - loopback tests */
+ lanai->conf1 |= (CONFIG1_GPOUT2 | CONFIG1_GPOUT3 | CONFIG1_DMA_ENABLE);
+ conf1_write(lanai);
+
+ /* 3.8/3.9: test and initialize card SRAM */
+ if ((result = sram_test_and_clear(lanai)) != 0)
+ goto error_unmap;
+
+ /* 3.10: initialize lanai registers */
+ lanai->conf1 |= CONFIG1_DMA_ENABLE;
+ conf1_write(lanai);
+ if ((result = service_buffer_allocate(lanai)) != 0)
+ goto error_unmap;
+ if ((result = vcc_table_allocate(lanai)) != 0)
+ goto error_service;
+ lanai->conf2 = (lanai->num_vci >= 512 ? CONFIG2_HOWMANY : 0) |
+ CONFIG2_HEC_DROP | /* ??? */ CONFIG2_PTI7_MODE;
+ conf2_write(lanai);
+ reg_write(lanai, TX_FIFO_DEPTH, TxDepth_Reg);
+ reg_write(lanai, 0, CBR_ICG_Reg); /* CBR defaults to no limit */
+ if ((result = request_irq(lanai->pci->irq, lanai_int, SA_SHIRQ,
+ "lanai", lanai)) != 0) {
+ printk(KERN_ERR DEV_LABEL ": can't allocate interrupt\n");
+ goto error_vcctable;
+ }
+ MOD_INC_USE_COUNT; /* At this point we can't fail */
+ intr_enable(lanai, INT_ALL & ~(INT_PING | INT_WAKE));
+ /* 3.11: initialize loop mode (i.e. turn looping off) */
+ lanai->conf1 = (lanai->conf1 & ~CONFIG1_MASK_LOOPMODE) |
+ CONFIG1_SET_LOOPMODE(LOOPMODE_NORMAL) |
+ CONFIG1_GPOUT2 | CONFIG1_GPOUT3;
+ conf1_write(lanai);
+ lanai->status = reg_read(lanai, Status_Reg);
+ /* We're now done initializing this card */
+#ifdef USE_POWERDOWN
+ lanai->conf1 |= CONFIG1_POWERDOWN;
+ conf1_write(lanai);
+#endif
+ memcpy(atmdev->esi, eeprom_mac(lanai), ESI_LEN);
+ lanai_timed_poll_start(lanai);
+ printk(KERN_NOTICE DEV_LABEL "(itf %d): rev.%d, base=0x%lx, irq=%d "
+ "(%02X-%02X-%02X-%02X-%02X-%02X)\n", lanai->number,
+ lanai->pci_revision, (long) lanai->base, lanai->pci->irq,
+ atmdev->esi[0], atmdev->esi[1], atmdev->esi[2],
+ atmdev->esi[3], atmdev->esi[4], atmdev->esi[5]);
+ printk(KERN_NOTICE DEV_LABEL "(itf %d): LANAI%s, serialno=%d(0x%X), "
+ "board_rev=%d\n", lanai->number,
+ lanai->type==lanai2 ? "2" : "HB", lanai->serialno,
+ lanai->serialno, lanai->board_rev);
+ return 0;
+
+ error_vcctable:
+ vcc_table_deallocate(lanai);
+ error_service:
+ service_buffer_deallocate(lanai);
+ error_unmap:
+ reset_board(lanai);
+#ifdef USE_POWERDOWN
+ lanai->conf1 = reg_read(lanai, Config1_Reg) | CONFIG1_POWERDOWN;
+ conf1_write(lanai);
+#endif
+ iounmap((void *) lanai->base);
+ error_pci:
+ lanai_pci_stop(lanai);
+ error:


+ return result;
+}
+

+/* called when device is being shutdown, and all vcc's are gone - higher
+ * levels will deallocate the atm device for us
+ */
+static void lanai_dev_close(struct atm_dev *atmdev)
+{
+ struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
+ printk(KERN_INFO DEV_LABEL "(itf %d): shutting down interface\n",
+ lanai->number);
+ lanai_timed_poll_stop(lanai);
+#ifdef USE_POWERDOWN
+ lanai->conf1 = reg_read(lanai, Config1_Reg) & ~CONFIG1_POWERDOWN;
+ conf1_write(lanai);
+#endif
+ intr_disable(lanai, INT_ALL);
+ free_irq(lanai->pci->irq, lanai);
+ reset_board(lanai);
+#ifdef USE_POWERDOWN
+ lanai->conf1 |= CONFIG1_POWERDOWN;
+ conf1_write(lanai);
+#endif
+ lanai_pci_stop(lanai);
+ vcc_table_deallocate(lanai);
+ service_buffer_deallocate(lanai);
+ iounmap((void *) lanai->base);
+ kfree(lanai);
+ MOD_DEC_USE_COUNT;
+}
+
+/* close a vcc */
+static void lanai_close(struct atm_vcc *atmvcc)
+{
+ struct lanai_vcc *lvcc = (struct lanai_vcc *) atmvcc->dev_data;
+ struct lanai_dev *lanai = (struct lanai_dev *) atmvcc->dev->dev_data;
+ if (lvcc == NULL)
+ return;
+ clear_bit(ATM_VF_READY, &atmvcc->flags);
+ clear_bit(ATM_VF_PARTIAL, &atmvcc->flags);
+ if (lvcc->rx.atmvcc == atmvcc) {
+ lanai_shutdown_rx_vci(lvcc);
+ if (atmvcc->qos.aal == ATM_AAL0) {
+ if (--lanai->naal0 <= 0)
+ aal0_buffer_free(lanai);
+ } else
+ lanai_buf_deallocate(&lvcc->rx.buf);
+ lvcc->rx.atmvcc = NULL;
+ }
+ if (lvcc->tx.atmvcc == atmvcc) {
+ if (atmvcc == lanai->cbrvcc) {
+ if (lvcc->vbase != 0)
+ lanai_cbr_shutdown(lanai);
+ lanai->cbrvcc = NULL;
+ }
+ lanai_shutdown_tx_vci(lanai, lvcc);
+ lanai_buf_deallocate(&lvcc->tx.buf);
+ lvcc->tx.atmvcc = NULL;
+ }
+ if (--lvcc->nref == 0) {
+ host_vcc_unbind(lanai, lvcc);
+ kfree(lvcc);
+ }
+ atmvcc->dev_data = NULL;
+ clear_bit(ATM_VF_ADDR, &atmvcc->flags);
+}
+
+/* open a vcc on the card to vpi/vci */
+static int lanai_open(struct atm_vcc *atmvcc, short vpi, int vci)
+{
+ struct lanai_dev *lanai;
+ struct lanai_vcc *lvcc;
+ int result = 0;
+ /* we don't support partial open - it's not really useful anyway */
+ if ((test_bit(ATM_VF_PARTIAL, &atmvcc->flags)) ||
+ (vpi == ATM_VPI_UNSPEC) || (vci == ATM_VCI_UNSPEC))
+ return -EINVAL;
+ lanai = (struct lanai_dev *) atmvcc->dev->dev_data;
+ if ((result = lanai_normalize_ci(lanai, atmvcc, &vpi, &vci)) != 0)
+ goto out;
+ atmvcc->vpi = vpi;
+ atmvcc->vci = vci;
+ set_bit(ATM_VF_ADDR, &atmvcc->flags);
+ lvcc = lanai->vccs[vci];
+ if (atmvcc->qos.aal != ATM_AAL0 && atmvcc->qos.aal != ATM_AAL5)
+ return -EINVAL;
+#if 0
+ DPRINTK(DEV_LABEL "(itf %d): open %d.%d flags=0x%X\n",
+ lanai->number, vpi, vci, (unsigned long) atmvcc->flags);
+#else
+ DPRINTK(DEV_LABEL "(itf %d): open %d.%d\n", lanai->number, vpi, vci);
+#endif
+ if (lvcc == NULL && (lvcc = new_lanai_vcc()) == NULL)
+ return -ENOMEM;
+ atmvcc->dev_data = lvcc;
+ lvcc->nref++;
+ if (atmvcc->qos.rxtp.traffic_class != ATM_NONE) {
+ APRINTK(lvcc->rx.atmvcc == NULL, "rx.atmvcc!=NULL, vci=%d\n",
+ vci);
+ if (atmvcc->qos.aal == ATM_AAL0) {
+ if (lanai->naal0 == 0)
+ result = aal0_buffer_allocate(lanai);
+ } else
+ result = lanai_setup_rx_vci_aal5(
+ lanai->number, lvcc, &atmvcc->qos);
+ if (result != 0)
+ goto out_free;
+ lvcc->rx.atmvcc = atmvcc;
+ lvcc->stats.rx_nomem = 0;
+ lvcc->stats.x.aal5.rx_badlen = 0;
+ lvcc->stats.x.aal5.service_trash = 0;
+ lvcc->stats.x.aal5.service_stream = 0;
+ lvcc->stats.x.aal5.service_rxcrc = 0;
+ if (atmvcc->qos.aal == ATM_AAL0)
+ lanai->naal0++;
+ }
+ if (atmvcc->qos.txtp.traffic_class != ATM_NONE) {
+ APRINTK(lvcc->tx.atmvcc == NULL, "tx.atmvcc!=NULL, vci=%d\n",
+ vci);
+ result = lanai_setup_tx_vci(lanai->number, lvcc, &atmvcc->qos);
+ if (result != 0)
+ goto out_free;
+ lvcc->tx.atmvcc = atmvcc;
+ if (atmvcc->qos.txtp.traffic_class == ATM_CBR) {
+ APRINTK(lanai->cbrvcc == NULL,
+ "cbrvcc!=NULL, vci=%d\n", vci);
+ lanai->cbrvcc = atmvcc;
+ }
+ }
+ host_vcc_bind(lanai, lvcc, vci);
+ if (atmvcc == lvcc->rx.atmvcc)
+ host_vcc_start_rx(lvcc);
+ if (atmvcc == lvcc->tx.atmvcc) {
+ host_vcc_start_tx(lvcc);
+ if (lanai->cbrvcc == atmvcc)
+ lanai_cbr_setup(lanai);
+ }
+ set_bit(ATM_VF_READY, &atmvcc->flags);
+ return 0;
+ out_free:
+ lanai_close(atmvcc);
+ out:


+ return result;
+}
+

+/* ioctl operations for card */
+/* NOTE: these are all DEBUGGING ONLY currently */
+static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void *arg)
+{
+ int result = 0;
+ struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
+ switch(cmd) {
+ case 2106275:
+ shutdown_atm_dev(atmdev);
+ return 0;
+ case 2200000: {
+ unsigned long flags;
+ spin_lock_irqsave(&lanai->servicelock, flags);
+ run_service(lanai);
+ spin_unlock_irqrestore(&lanai->servicelock, flags);
+ return 0; }
+ case 2200001:
+ vcc_tx_dequeue_all(lanai);
+ return 0;
+ case 2200002:
+ get_statistics(lanai);
+ return 0;
+ case 2200003: {
+ int i;
+ for (i = 0; i <= 0x5C ; i += 4) {
+ if (i==0x48) /* Write-only butt reg */
+ continue;
+ printk(KERN_CRIT DEV_LABEL " 0x%02X: "
+ "0x%08X\n", i,
+ (u32) readl(lanai->base + i));
+ barrier(); mb();
+ pcistatus_check(lanai, 0);
+ barrier(); mb();
+ }
+ return 0; }
+ case 2200004: {
+ u8 b;
+ u16 w;
+ u32 dw;
+ struct pci_dev *pci = lanai->pci;
+ (void) pci_read_config_word(pci, PCI_VENDOR_ID, &w);
+ DPRINTK("vendor = 0x%X\n", w);
+ (void) pci_read_config_word(pci, PCI_DEVICE_ID, &w);
+ DPRINTK("device = 0x%X\n", w);
+ (void) pci_read_config_word(pci, PCI_COMMAND, &w);
+ DPRINTK("command = 0x%X\n", w);
+ (void) pci_read_config_word(pci, PCI_STATUS, &w);
+ DPRINTK("status = 0x%X\n", w);
+ (void) pci_read_config_dword(pci,
+ PCI_CLASS_REVISION, &dw);
+ DPRINTK("class/revision = 0x%X\n", dw);
+ (void) pci_read_config_byte(pci,
+ PCI_CACHE_LINE_SIZE, &b);
+ DPRINTK("cache line size = 0x%X\n", b);
+ (void) pci_read_config_byte(pci, PCI_LATENCY_TIMER, &b);
+ DPRINTK("latency = %d (0x%X)\n", b, b);
+ (void) pci_read_config_byte(pci, PCI_HEADER_TYPE, &b);
+ DPRINTK("header type = 0x%X\n", b);
+ (void) pci_read_config_byte(pci, PCI_BIST, &b);
+ DPRINTK("bist = 0x%X\n", b);
+ /* skipping a few here */
+ (void) pci_read_config_byte(pci,
+ PCI_INTERRUPT_LINE, &b);
+ DPRINTK("pci_int_line = 0x%X\n", b);
+ (void) pci_read_config_byte(pci,
+ PCI_INTERRUPT_PIN, &b);
+ DPRINTK("pci_int_pin = 0x%X\n", b);
+ (void) pci_read_config_byte(pci, PCI_MIN_GNT, &b);
+ DPRINTK("min_gnt = 0x%X\n", b);
+ (void) pci_read_config_byte(pci, PCI_MAX_LAT, &b);
+ DPRINTK("max_lat = 0x%X\n", b); }
+ return 0;
+#ifdef USE_POWERDOWN
+ case 2200005:
+ DPRINTK("Coming out of powerdown\n");
+ lanai->conf1 &= ~CONFIG1_POWERDOWN;
+ conf1_write(lanai);
+ return 0;
+#endif
+ default:
+ result = -EINVAL;
+ }


+ return result;
+}
+

+static int lanai_send(struct atm_vcc *atmvcc, struct sk_buff *skb)
+{
+ struct lanai_vcc *lvcc = (struct lanai_vcc *) atmvcc->dev_data;
+ struct lanai_dev *lanai = (struct lanai_dev *) atmvcc->dev->dev_data;
+ unsigned long flags;
+ if (lvcc == NULL || lvcc->vbase == 0 || lvcc->tx.atmvcc != atmvcc)
+ goto einval;
+#ifdef DEBUG
+ if (skb == NULL) {
+ DPRINTK("lanai_send: skb==NULL for vci=%d\n", atmvcc->vci);
+ goto einval;
+ }
+ if (lanai == NULL) {
+ DPRINTK("lanai_send: lanai==NULL for vci=%d\n", atmvcc->vci);
+ goto einval;
+ }
+#endif
+ ATM_SKB(skb)->vcc = atmvcc;
+ switch (atmvcc->qos.aal) {
+ case ATM_AAL5:
+ spin_lock_irqsave(&lanai->txlock, flags);
+ vcc_tx_aal5(lanai, lvcc, skb);
+ spin_unlock_irqrestore(&lanai->txlock, flags);
+ return 0;
+ case ATM_AAL0:
+ if (skb->len != ATM_CELL_SIZE-1)
+ goto einval;
+ /* NOTE - this next line is technically invalid - we haven't unshared skb */
+ cpu_to_be32s((u32 *) skb->data);
+ spin_lock_irqsave(&lanai->txlock, flags);
+ vcc_tx_aal0(lanai, lvcc, skb);
+ spin_unlock_irqrestore(&lanai->txlock, flags);
+ return 0;
+ }
+ DPRINTK("lanai_send: bad aal=%d on vci=%d\n", atmvcc->qos.aal,
+ atmvcc->vci);
+ einval:
+ lanai_free_skb(atmvcc, skb);
+ return -EINVAL;
+}
+
+static int lanai_change_qos(struct atm_vcc *atmvcc,
+ /*const*/ struct atm_qos *qos, int flags)
+{
+ return -EBUSY; /* TODO: need to write this */
+}
+
+#ifndef CONFIG_PROC_FS
+#define lanai_proc_read NULL
+#else
+static int lanai_proc_read(struct atm_dev *atmdev, loff_t *pos, char *page)
+{
+ struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
+ loff_t left = *pos;
+ struct lanai_vcc *lvcc;
+ if (left-- == 0)
+ return sprintf(page, DEV_LABEL "(itf %d): chip=LANAI%s, "
+ "serial=%d, magic=0x%08X, num_vci=%d\n",
+ atmdev->number, lanai->type==lanai2 ? "2" : "HB",
+ lanai->serialno, lanai->magicno, lanai->num_vci);
+ if (left-- == 0)
+ return sprintf(page, "revision: board=%d, pci_if=%d\n",
+ lanai->board_rev, lanai->pci_revision);
+ if (left-- == 0)
+ return sprintf(page, "EEPROM ESI: "
+ "%02X:%02X:%02X:%02X:%02X:%02X\n",
+ lanai->eeprom[EEPROM_MAC + 0],
+ lanai->eeprom[EEPROM_MAC + 1],
+ lanai->eeprom[EEPROM_MAC + 2],
+ lanai->eeprom[EEPROM_MAC + 3],
+ lanai->eeprom[EEPROM_MAC + 4],
+ lanai->eeprom[EEPROM_MAC + 5]);
+ if (left-- == 0)
+ return sprintf(page, "status: SOOL=%d, LOCD=%d, LED=%d, "
+ "GPIN=%d\n", (lanai->status & STATUS_SOOL) ? 1 : 0,
+ (lanai->status & STATUS_LOCD) ? 1 : 0,
+ (lanai->status & STATUS_LED) ? 1 : 0,
+ (lanai->status & STATUS_GPIN) ? 1 : 0);
+ if (left-- == 0)
+ return sprintf(page, "global buffer sizes: service=%d, "
+ "aal0_rx=%d\n", lanai_buf_size(&lanai->service),
+ lanai->naal0 ? lanai_buf_size(&lanai->aal0buf) : 0);
+ if (left-- == 0) {
+ get_statistics(lanai);
+ return sprintf(page, "cells in error: overflow=%d, "
+ "closed_vci=%d, bad_HEC=%d, rx_fifo=%d\n",
+ lanai->stats.ovfl_trash, lanai->stats.vci_trash,
+ lanai->stats.hec_err, lanai->stats.atm_ovfl);
+ }
+ if (left-- == 0)
+ return sprintf(page, "PCI errors: parity_detect=%d, "
+ "master_abort=%d, master_target_abort=%d,\n",
+ lanai->stats.pcierr_parity_detect,
+ lanai->stats.pcierr_serr_set,
+ lanai->stats.pcierr_m_target_abort);
+ if (left-- == 0)
+ return sprintf(page, " slave_target_abort=%d, "
+ "master_parity=%d\n", lanai->stats.pcierr_s_target_abort,
+ lanai->stats.pcierr_master_parity);
+ if (left-- == 0)
+ return sprintf(page, "service list errors: no_vcc_rx=%d, "
+ "no_vcc_tx=%d,\n", lanai->stats.service_novcc_rx,
+ lanai->stats.service_novcc_tx);
+ if (left-- == 0)
+ return sprintf(page, " no_tx=%d, "
+ "no_rx=%d, bad_rx_aal=%d\n", lanai->stats.service_norx,
+ lanai->stats.service_notx,
+ lanai->stats.service_rxnotaal5);
+ if (left-- == 0)
+ return sprintf(page, "resets: dma=%d, card=%d\n",
+ lanai->stats.dma_reenable, lanai->stats.card_reset);
+ /* At this point, "left" should be the VCI we're looking for */
+ vcclist_read_lock();
+ for (; ; left++) {
+ if (left >= NUM_VCI) {
+ left = 0;
+ goto out;
+ }
+ if ((lvcc = lanai->vccs[left]) != NULL)
+ break;
+ (*pos)++;
+ }
+ /* Note that we re-use "left" here since we're done with it */
+ left = sprintf(page, "VCI %4d: nref=%d, rx_nomem=%d", (vci_t) left,
+ lvcc->nref, lvcc->stats.rx_nomem);
+ if (lvcc->rx.atmvcc != NULL) {
+ left += sprintf(&page[left], ",\n rx_AAL=%d",
+ lvcc->rx.atmvcc->qos.aal == ATM_AAL5 ? 5 : 0);


+ if (lvcc->rx.atmvcc->qos.aal == ATM_AAL5)

+ left += sprintf(&page[left], ", rx_buf_size=%d, "
+ "rx_bad_len=%d,\n rx_service_trash=%d, "
+ "rx_service_stream=%d, rx_bad_crc=%d",
+ lanai_buf_size(&lvcc->rx.buf),
+ lvcc->stats.x.aal5.rx_badlen,
+ lvcc->stats.x.aal5.service_trash,
+ lvcc->stats.x.aal5.service_stream,
+ lvcc->stats.x.aal5.service_rxcrc);
+ }
+ if (lvcc->tx.atmvcc != NULL)
+ left += sprintf(&page[left], ",\n tx_AAL=%d, "
+ "tx_buf_size=%d, tx_qos=%cBR, tx_backlogged=%c",
+ lvcc->tx.atmvcc->qos.aal == ATM_AAL5 ? 5 : 0,
+ lanai_buf_size(&lvcc->tx.buf),
+ lvcc->tx.atmvcc == lanai->cbrvcc ? 'C' : 'U',
+ vcc_is_backlogged(lvcc) ? 'Y' : 'N');
+ page[left++] = '\n';
+ page[left] = '\0';
+ out:
+ vcclist_read_unlock();
+ return left;
+}
+#endif /* CONFIG_PROC_FS */
+
+/* -------------------- HOOKS: */
+
+static const struct atmdev_ops ops = {
+ dev_close: lanai_dev_close,
+ open: lanai_open,
+ close: lanai_close,
+ ioctl: lanai_ioctl,
+ getsockopt: NULL,
+ setsockopt: NULL,
+ send: lanai_send,
+ sg_send: NULL, /* no scatter-gather on card */
+ send_oam: NULL, /* OAM support not in linux yet */
+ phy_put: NULL,
+ phy_get: NULL,
+ feedback: NULL,
+ change_qos: lanai_change_qos,
+ free_rx_skb: NULL,
+ proc_read: lanai_proc_read
+};
+
+/* detect one type of card LANAI2 or LANAIHB */
+static int __init lanai_detect_1(unsigned int vendor, unsigned int device)
+{
+ struct pci_dev *pci = NULL;
+ struct lanai_dev *lanai;
+ struct atm_dev *atmdev;
+ int count = 0, result;
+ while ((pci = pci_find_device(vendor, device, pci)) != NULL) {
+ lanai = (struct lanai_dev *)
+ kmalloc(sizeof *lanai, GFP_KERNEL);
+ if (lanai == NULL) {
+ printk(KERN_ERR DEV_LABEL ": couldn't allocate "
+ "dev_data structure!\n");
+ break;
+ }
+ atmdev = atm_dev_register(DEV_LABEL, &ops, -1, 0);
+ if (atmdev == NULL) {
+ printk(KERN_ERR DEV_LABEL ": couldn't register "
+ "atm device!\n");
+ kfree(lanai);
+ break;
+ }
+ atmdev->dev_data = lanai;
+ lanai->pci = pci;
+ lanai->type = (enum lanai_type) device;
+ if ((result = lanai_dev_open(atmdev)) != 0) {
+ DPRINTK("lanai_start() failed, err=%d\n", -result);
+ atm_dev_deregister(atmdev);
+ kfree(lanai);
+ continue;
+ }
+ count++;
+ }
+ return count;
+}
+
+#ifdef MODULE
+static
+#endif
+int __init lanai_detect(void)
+{
+ return lanai_detect_1(PCI_VENDOR_ID_EF, PCI_VENDOR_ID_EF_ATM_LANAI2) +
+ lanai_detect_1(PCI_VENDOR_ID_EF, PCI_VENDOR_ID_EF_ATM_LANAIHB);
+}
+
+#ifdef MODULE
+
+int init_module(void)
+{
+ if (lanai_detect() == 0) {
+ printk(KERN_ERR DEV_LABEL ": no adaptor found\n");
+ return -ENODEV;


+ }
+ return 0;
+}

+
+void cleanup_module(void)
+{
+ /* We'll only get called when all the interfaces are already
+ * gone, so there isn't much to do
+ */
+ DPRINTK("cleanup_module()\n");
+}
+
+MODULE_AUTHOR("Mitchell Blank Jr <mi...@sfgoth.com>");
+MODULE_DESCRIPTION("Efficient Networks Speedstream 3010 driver");
+MODULE_LICENSE("GPL");
+
+#endif /* MODULE */
diff -u --recursive --new-file v2.4.13/linux/drivers/atm/nicstar.h linux/drivers/atm/nicstar.h
--- v2.4.13/linux/drivers/atm/nicstar.h Fri Feb 16 16:02:35 2001
+++ linux/drivers/atm/nicstar.h Thu Oct 25 13:53:46 2001
@@ -625,7 +625,7 @@
X #define NS_CFG_LGBUFSIZE NS_CFG_LGBUFSIZE_2048
X #elif (NS_LGBUFSIZE == 4096)
X #define NS_CFG_LGBUFSIZE NS_CFG_LGBUFSIZE_4096
-#eliif (NS_LGBUFSIZE == 8192)
+#elif (NS_LGBUFSIZE == 8192)
X #define NS_CFG_LGBUFSIZE NS_CFG_LGBUFSIZE_8192
X #elif (NS_LGBUFSIZE == 16384)
X #define NS_CFG_LGBUFSIZE NS_CFG_LGBUFSIZE_16384
diff -u --recursive --new-file v2.4.13/linux/drivers/block/DAC960.c linux/drivers/block/DAC960.c
--- v2.4.13/linux/drivers/block/DAC960.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/DAC960.c Thu Oct 25 13:58:35 2001


@@ -82,7 +82,8 @@
X

X static BlockDeviceOperations_T
X DAC960_BlockDeviceOperations =
- { open: DAC960_Open,
+ { owner: THIS_MODULE,
+ open: DAC960_Open,
X release: DAC960_Release,
X ioctl: DAC960_IOCTL };
X
@@ -5378,7 +5379,6 @@
X Controller->ControllerUsageCount++;
X Controller->LogicalDriveUsageCount[LogicalDriveNumber]++;
X ModuleOnly:
- MOD_INC_USE_COUNT;


X return 0;
X }
X

@@ -5401,7 +5401,6 @@
X Controller->LogicalDriveUsageCount[LogicalDriveNumber]--;
X Controller->ControllerUsageCount--;
X ModuleOnly:


- MOD_DEC_USE_COUNT;
X return 0;

X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/block/acsi.c linux/drivers/block/acsi.c
--- v2.4.13/linux/drivers/block/acsi.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/acsi.c Thu Oct 25 13:58:35 2001
@@ -1196,7 +1196,6 @@
X acsi_prevent_removal(device, 1);
X }
X access_count[device]++;
- MOD_INC_USE_COUNT;
X
X if (filp && filp->f_mode) {
X check_disk_change( inode->i_rdev );
@@ -1221,7 +1220,6 @@
X int device = DEVICE_NR(MINOR(inode->i_rdev));
X if (--access_count[device] == 0 && acsi_info[device].removable)
X acsi_prevent_removal(device, 0);
- MOD_DEC_USE_COUNT;
X return( 0 );
X }
X
@@ -1657,6 +1655,7 @@
X #endif
X
X static struct block_device_operations acsi_fops = {
+ owner: THIS_MODULE,
X open: acsi_open,
X release: acsi_release,
X ioctl: acsi_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/block/amiflop.c linux/drivers/block/amiflop.c
--- v2.4.13/linux/drivers/block/amiflop.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/amiflop.c Thu Oct 25 13:58:34 2001
@@ -1738,6 +1738,7 @@
X }
X
X static struct block_device_operations floppy_fops = {
+ owner: THIS_MODULE,
X open: floppy_open,
X release: floppy_release,
X ioctl: fd_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/block/ataflop.c linux/drivers/block/ataflop.c
--- v2.4.13/linux/drivers/block/ataflop.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/ataflop.c Thu Oct 25 13:58:35 2001
@@ -1910,8 +1910,6 @@
X if (fd_ref[drive] == -1 || (fd_ref[drive] && filp->f_flags & O_EXCL))
X return -EBUSY;
X
- MOD_INC_USE_COUNT;
-
X if (filp->f_flags & O_EXCL)
X fd_ref[drive] = -1;
X else
@@ -1950,11 +1948,11 @@
X fd_ref[drive] = 0;
X }
X

- MOD_DEC_USE_COUNT;
X return 0;

X }
X
X static struct block_device_operations floppy_fops = {
+ owner: THIS_MODULE,
X open: floppy_open,
X release: floppy_release,
X ioctl: fd_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/block/cciss.c linux/drivers/block/cciss.c
--- v2.4.13/linux/drivers/block/cciss.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/cciss.c Fri Nov 2 17:45:42 2001
@@ -119,6 +119,7 @@
X #endif /* CONFIG_PROC_FS */
X
X static struct block_device_operations cciss_fops = {
+ owner: THIS_MODULE,
X open: cciss_open,
X release: cciss_release,
X ioctl: cciss_ioctl,


@@ -347,7 +348,6 @@
X

X hba[ctlr]->drv[dsk].usage_count++;
X hba[ctlr]->usage_count++;
- MOD_INC_USE_COUNT;
X return 0;
X }
X /*


@@ -366,7 +366,6 @@
X

X hba[ctlr]->drv[dsk].usage_count--;
X hba[ctlr]->usage_count--;


- MOD_DEC_USE_COUNT;
X return 0;
X }
X

@@ -1215,7 +1214,12 @@
X status=0;
X }
X }
- complete_buffers(cmd->bh, status);
+ complete_buffers(cmd->rq->bh, status);
+
+#ifdef CCISS_DEBUG
+ printk("Done with %p\n", cmd->rq);
+#endif /* CCISS_DEBUG */
+ end_that_request_last(cmd->rq);
X }
X
X
@@ -1270,7 +1274,7 @@
X {
X ctlr_info_t *h= q->queuedata;
X CommandList_struct *c;
- int log_unit, start_blk, seg, sect;
+ int log_unit, start_blk, seg;
X char *lastdataend;
X struct buffer_head *bh;
X struct list_head *queue_head = &q->queue_head;
@@ -1279,13 +1283,12 @@
X struct my_sg tmp_sg[MAXSGENTRIES];
X int i;
X
- // Loop till the queue is empty if or it is plugged
- while (1)
- {
- if (q->plugged || list_empty(queue_head)) {
- start_io(h);
- return;
- }
+ if (q->plugged)
+ goto startio;
+
+queue_next:
+ if (list_empty(queue_head))
+ goto startio;
X
X creq = blkdev_entry_next_request(queue_head);
X if (creq->nr_segments > MAXSGENTRIES)
@@ -1297,17 +1300,18 @@
X h->ctlr, creq->rq_dev, creq);
X blkdev_dequeue_request(creq);
X complete_buffers(creq->bh, 0);
- start_io(h);
- return;
+ end_that_request_last(creq);
+ goto startio;
X }
X
X if (( c = cmd_alloc(h, 1)) == NULL)
- {
- start_io(h);
- return;
- }
+ goto startio;
+
+ spin_unlock_irq(&io_request_lock);
+
X c->cmd_type = CMD_RWREQ;
- bh = c->bh = creq->bh;
+ bh = creq->bh;
+ c->rq = creq;
X
X /* fill in the request */
X log_unit = MINOR(creq->rq_dev) >> NWD_SHIFT;
@@ -1331,10 +1335,8 @@
X #endif /* CCISS_DEBUG */
X seg = 0;
X lastdataend = NULL;
- sect = 0;
X while(bh)
X {
- sect += bh->b_size/512;
X if (bh->b_data == lastdataend)
X { // tack it on to the last segment
X tmp_sg[seg-1].len +=bh->b_size;
@@ -1368,7 +1370,7 @@
X h->maxSG = seg;
X
X #ifdef CCISS_DEBUG
- printk(KERN_DEBUG "cciss: Submitting %d sectors in %d segments\n", sect, seg);
+ printk(KERN_DEBUG "cciss: Submitting %d sectors in %d segments\n", creq->nr_sectors, seg);
X #endif /* CCISS_DEBUG */
X
X c->Header.SGList = c->Header.SGTotal = seg;
@@ -1378,28 +1380,26 @@
X c->Request.CDB[4]= (start_blk >> 8) & 0xff;
X c->Request.CDB[5]= start_blk & 0xff;
X c->Request.CDB[6]= 0; // (sect >> 24) & 0xff; MSB
- c->Request.CDB[7]= (sect >> 8) & 0xff;
- c->Request.CDB[8]= sect & 0xff;
+ c->Request.CDB[7]= (creq->nr_sectors >> 8) & 0xff;
+ c->Request.CDB[8]= creq->nr_sectors & 0xff;
X c->Request.CDB[9] = c->Request.CDB[11] = c->Request.CDB[12] = 0;
X
-
+ spin_lock_irq(&io_request_lock);
+
X blkdev_dequeue_request(creq);
X
-
X /*
X * ehh, we can't really end the request here since it's not
X * even started yet. for now it shouldn't hurt though
X */
-#ifdef CCISS_DEBUG
- printk("Done with %p\n", creq);
-#endif /* CCISS_DEBUG */
- end_that_request_last(creq);
-
X addQ(&(h->reqQ),c);
X h->Qdepth++;
X if(h->Qdepth > h->maxQsinceinit)
X h->maxQsinceinit = h->Qdepth;
- } // while loop
+
+ goto queue_next;
+startio:
+ start_io(h);
X }
X
X static void do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
diff -u --recursive --new-file v2.4.13/linux/drivers/block/cciss_cmd.h linux/drivers/block/cciss_cmd.h
--- v2.4.13/linux/drivers/block/cciss_cmd.h Tue May 22 10:23:16 2001
+++ linux/drivers/block/cciss_cmd.h Fri Nov 2 17:45:42 2001
@@ -228,7 +228,7 @@
X int cmd_type;
X struct _CommandList_struct *prev;
X struct _CommandList_struct *next;
- struct buffer_head * bh;
+ struct request * rq;
X } CommandList_struct;
X
X //Configuration Table Structure
diff -u --recursive --new-file v2.4.13/linux/drivers/block/cpqarray.c linux/drivers/block/cpqarray.c
--- v2.4.13/linux/drivers/block/cpqarray.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/cpqarray.c Fri Nov 2 17:45:42 2001
@@ -188,6 +188,7 @@
X }
X
X static struct block_device_operations ida_fops = {
+ owner: THIS_MODULE,
X open: ida_open,
X release: ida_release,
X ioctl: ida_ioctl,
@@ -853,7 +854,6 @@
X
X hba[ctlr]->drv[dsk].usage_count++;
X hba[ctlr]->usage_count++;
- MOD_INC_USE_COUNT;


X return 0;
X }
X

@@ -869,7 +869,6 @@
X
X hba[ctlr]->drv[dsk].usage_count--;
X hba[ctlr]->usage_count--;


- MOD_DEC_USE_COUNT;
X return 0;
X }
X

@@ -912,21 +911,19 @@
X {
X ctlr_info_t *h = q->queuedata;
X cmdlist_t *c;
- int seg, sect;
X char *lastdataend;
X struct list_head * queue_head = &q->queue_head;
X struct buffer_head *bh;
X struct request *creq;
X struct my_sg tmp_sg[SG_MAX];
- int i;
+ int i, seg;
X
-// Loop till the queue is empty if or it is plugged
- while (1)
-{
- if (q->plugged || list_empty(queue_head)) {
- start_io(h);
- return;
- }
+ if (q->plugged)
+ goto startio;
+
+queue_next:
+ if (list_empty(queue_head))
+ goto startio;
X
X creq = blkdev_entry_next_request(queue_head);
X if (creq->nr_segments > SG_MAX)
@@ -938,15 +935,14 @@
X h->ctlr, creq->rq_dev, creq);
X blkdev_dequeue_request(creq);
X complete_buffers(creq->bh, 0);
- start_io(h);
- return;
+ end_that_request_last(creq);
+ goto startio;
X }
X
X if ((c = cmd_alloc(h,1)) == NULL)
- {
- start_io(h);
- return;
- }
+ goto startio;
+
+ spin_unlock_irq(&io_request_lock);
X
X bh = creq->bh;
X
@@ -956,7 +952,7 @@
X c->size += sizeof(rblk_t);
X
X c->req.hdr.blk = ida[(h->ctlr<<CTLR_SHIFT) + MINOR(creq->rq_dev)].start_sect + creq->sector;
- c->bh = bh;
+ c->rq = creq;
X DBGPX(
X if (bh == NULL)
X panic("bh == NULL?");
@@ -964,9 +960,7 @@
X printk("sector=%d, nr_sectors=%d\n", creq->sector, creq->nr_sectors);
X );
X seg = 0; lastdataend = NULL;
- sect = 0;
X while(bh) {
- sect += bh->b_size/512;
X if (bh->b_data == lastdataend) {
X tmp_sg[seg-1].size += bh->b_size;
X lastdataend += bh->b_size;
@@ -992,26 +986,12 @@
X }
X DBGPX( printk("Submitting %d sectors in %d segments\n", sect, seg); );
X c->req.hdr.sg_cnt = seg;
- c->req.hdr.blk_cnt = sect;
+ c->req.hdr.blk_cnt = creq->nr_sectors;
X
- /*
- * Since we control our own merging, we know that this request
- * is now fully setup and there's nothing left.
- */
- if (creq->nr_sectors != sect) {
- printk("ida: %ld != %d sectors\n", creq->nr_sectors, sect);
- BUG();
- }
+ spin_lock_irq(&io_request_lock);
X
X blkdev_dequeue_request(creq);
X
- /*
- * ehh, we can't really end the request here since it's not
- * even started yet. for now it shouldn't hurt though
- */
-DBGPX( printk("Done with %p\n", creq); );
- end_that_request_last(creq);
-
X c->req.hdr.cmd = (creq->cmd == READ) ? IDA_READ : IDA_WRITE;
X c->type = CMD_RWREQ;
X
@@ -1020,7 +1000,11 @@
X h->Qdepth++;
X if (h->Qdepth > h->maxQsinceinit)
X h->maxQsinceinit = h->Qdepth;
- } // while loop
+
+ goto queue_next;
+
+startio:
+ start_io(h);
X }
X
X /*
@@ -1097,7 +1081,13 @@
X cmd->req.sg[i].addr, cmd->req.sg[i].size,
X (cmd->req.hdr.cmd == IDA_READ) ? PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE);
X }
- complete_buffers(cmd->bh, ok);
+
+ complete_buffers(cmd->rq->bh, ok);
+
+ DBGPX(printk("Done with %p\n", cmd->rq););
+ end_that_request_last(cmd->rq);
+


+
X }
X
X /*

diff -u --recursive --new-file v2.4.13/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
--- v2.4.13/linux/drivers/block/floppy.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/floppy.c Thu Oct 25 13:58:34 2001
@@ -397,6 +397,7 @@
X static struct floppy_drive_params drive_params[N_DRIVE];
X static struct floppy_drive_struct drive_state[N_DRIVE];
X static struct floppy_write_errors write_errors[N_DRIVE];
+static struct timer_list motor_off_timer[N_DRIVE];
X static struct floppy_raw_cmd *raw_cmd, default_raw_cmd;
X
X /*
@@ -927,17 +928,6 @@
X set_dor(FDC(nr), mask, 0);
X }
X
-static struct timer_list motor_off_timer[N_DRIVE] = {
- { data: 0, function: motor_off_callback },
- { data: 1, function: motor_off_callback },
- { data: 2, function: motor_off_callback },
- { data: 3, function: motor_off_callback },
- { data: 4, function: motor_off_callback },
- { data: 5, function: motor_off_callback },
- { data: 6, function: motor_off_callback },
- { data: 7, function: motor_off_callback }
-};
-
X /* schedules motor off */
X static void floppy_off(unsigned int drive)
X {
@@ -3902,6 +3892,7 @@
X }
X
X static struct block_device_operations floppy_fops = {
+ owner: THIS_MODULE,
X open: floppy_open,
X release: floppy_release,
X ioctl: fd_ioctl,
@@ -4067,8 +4058,10 @@
X DPRINT("bad drive for set_cmos\n");


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 26'
echo 'File patch-2.4.14 is continued in part 27'
echo "27" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:50 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part27

#!/bin/sh -x
# this is part 27 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 27; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X return;
X }
+#if N_FDC > 1
X if (current_drive >= 4 && !FDC2)
X FDC2 = 0x370;
+#endif
X DP->cmos = ints[2];
X DPRINT("setting CMOS code to %d\n", ints[2]);
X }
@@ -4088,10 +4081,10 @@
X { "dma", 0, &FLOPPY_DMA, 2, 0 },
X
X { "daring", daring, 0, 1, 0},
-
+#if N_FDC > 1
X { "two_fdc", 0, &FDC2, 0x370, 0 },
X { "one_fdc", 0, &FDC2, 0, 0 },
-
+#endif
X { "thinkpad", floppy_set_flags, 0, 1, FD_INVERTED_DCL },
X { "broken_dcl", floppy_set_flags, 0, 1, FD_BROKEN_DCL },
X { "messages", floppy_set_flags, 0, 1, FTD_MSG },
@@ -4112,6 +4105,8 @@
X { "unexpected_interrupts", 0, &print_unex, 1, 0 },
X { "no_unexpected_interrupts", 0, &print_unex, 0, 0 },
X { "L40SX", 0, &print_unex, 0, 0 }
+
+ EXTRA_FLOPPY_PARAMS
X };
X
X static int __init floppy_setup(char *str)
@@ -4275,6 +4270,8 @@
X }
X
X for (drive = 0; drive < N_DRIVE; drive++) {
+ motor_off_timer[drive].data = drive;
+ motor_off_timer[drive].function = motor_off_callback;
X if (!(allowed_drive_mask & (1 << drive)))
X continue;
X if (fdc_state[FDC(drive)].version == FDC_NONE)
diff -u --recursive --new-file v2.4.13/linux/drivers/block/ida_cmd.h linux/drivers/block/ida_cmd.h
--- v2.4.13/linux/drivers/block/ida_cmd.h Sun Aug 12 13:27:59 2001
+++ linux/drivers/block/ida_cmd.h Fri Nov 2 17:45:42 2001
@@ -93,7 +93,7 @@
X int ctlr;
X struct cmdlist *prev;
X struct cmdlist *next;
- struct buffer_head *bh;
+ struct request *rq;
X int type;
X } cmdlist_t;
X
diff -u --recursive --new-file v2.4.13/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
--- v2.4.13/linux/drivers/block/ll_rw_blk.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/ll_rw_blk.c Mon Oct 29 12:11:17 2001
@@ -140,21 +140,23 @@
X return &blk_dev[MAJOR(dev)].request_queue;
X }
X
-static int __blk_cleanup_queue(struct list_head *head)
+static int __blk_cleanup_queue(struct request_list *list)
X {
+ struct list_head *head = &list->free;
X struct request *rq;
X int i = 0;
X
- if (list_empty(head))
- return 0;
-
- do {
+ while (!list_empty(head)) {
X rq = list_entry(head->next, struct request, queue);
X list_del(&rq->queue);
X kmem_cache_free(request_cachep, rq);
X i++;
- } while (!list_empty(head));
+ };
+
+ if (i != list->count)
+ printk("request list leak!\n");
X
+ list->count = 0;
X return i;
X }
X
@@ -176,10 +178,8 @@
X {
X int count = queue_nr_requests;
X
- count -= __blk_cleanup_queue(&q->request_freelist[READ]);
- count -= __blk_cleanup_queue(&q->request_freelist[WRITE]);
- count -= __blk_cleanup_queue(&q->pending_freelist[READ]);
- count -= __blk_cleanup_queue(&q->pending_freelist[WRITE]);
+ count -= __blk_cleanup_queue(&q->rq[READ]);
+ count -= __blk_cleanup_queue(&q->rq[WRITE]);
X
X if (count)
X printk("blk_cleanup_queue: leaked requests (%d)\n", count);
@@ -331,11 +331,10 @@
X struct request *rq;
X int i;
X
- INIT_LIST_HEAD(&q->request_freelist[READ]);
- INIT_LIST_HEAD(&q->request_freelist[WRITE]);
- INIT_LIST_HEAD(&q->pending_freelist[READ]);
- INIT_LIST_HEAD(&q->pending_freelist[WRITE]);
- q->pending_free[READ] = q->pending_free[WRITE] = 0;
+ INIT_LIST_HEAD(&q->rq[READ].free);
+ INIT_LIST_HEAD(&q->rq[WRITE].free);
+ q->rq[READ].count = 0;
+ q->rq[WRITE].count = 0;
X
X /*
X * Divide requests in half between read and write
@@ -349,7 +348,8 @@
X }
X memset(rq, 0, sizeof(struct request));
X rq->rq_status = RQ_INACTIVE;
- list_add(&rq->queue, &q->request_freelist[i & 1]);
+ list_add(&rq->queue, &q->rq[i&1].free);
+ q->rq[i&1].count++;
X }
X
X init_waitqueue_head(&q->wait_for_request);
@@ -423,10 +423,12 @@
X static inline struct request *get_request(request_queue_t *q, int rw)
X {
X struct request *rq = NULL;
+ struct request_list *rl = q->rq + rw;
X
- if (!list_empty(&q->request_freelist[rw])) {
- rq = blkdev_free_rq(&q->request_freelist[rw]);
+ if (!list_empty(&rl->free)) {
+ rq = blkdev_free_rq(&rl->free);
X list_del(&rq->queue);
+ rl->count--;
X rq->rq_status = RQ_ACTIVE;
X rq->special = NULL;
X rq->q = q;
@@ -443,17 +445,16 @@
X register struct request *rq;
X DECLARE_WAITQUEUE(wait, current);
X
- add_wait_queue_exclusive(&q->wait_for_request, &wait);
- for (;;) {
- __set_current_state(TASK_UNINTERRUPTIBLE);
+ generic_unplug_device(q);
+ add_wait_queue(&q->wait_for_request, &wait);
+ do {
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ if (q->rq[rw].count < batch_requests)
+ schedule();
X spin_lock_irq(&io_request_lock);
- rq = get_request(q, rw);
+ rq = get_request(q,rw);
X spin_unlock_irq(&io_request_lock);
- if (rq)
- break;
- generic_unplug_device(q);
- schedule();
- }
+ } while (rq == NULL);
X remove_wait_queue(&q->wait_for_request, &wait);
X current->state = TASK_RUNNING;
X return rq;
@@ -542,15 +543,6 @@
X list_add(&req->queue, insert_here);
X }
X
-inline void blk_refill_freelist(request_queue_t *q, int rw)
-{
- if (q->pending_free[rw]) {
- list_splice(&q->pending_freelist[rw], &q->request_freelist[rw]);
- INIT_LIST_HEAD(&q->pending_freelist[rw]);
- q->pending_free[rw] = 0;
- }
-}
-
X /*
X * Must be called with io_request_lock held and interrupts disabled
X */
@@ -564,19 +556,12 @@
X
X /*
X * Request may not have originated from ll_rw_blk. if not,
- * asumme it has free buffers and check waiters
+ * assume it has free buffers and check waiters
X */
X if (q) {
- /*
- * Add to pending free list and batch wakeups
- */
- list_add(&req->queue, &q->pending_freelist[rw]);
-
- if (++q->pending_free[rw] >= batch_requests) {
- int wake_up = q->pending_free[rw];
- blk_refill_freelist(q, rw);
- wake_up_nr(&q->wait_for_request, wake_up);
- }
+ list_add(&req->queue, &q->rq[rw].free);
+ if (++q->rq[rw].count >= batch_requests && waitqueue_active(&q->wait_for_request))
+ wake_up(&q->wait_for_request);
X }
X }
X
@@ -1135,7 +1120,7 @@
X /*
X * Batch frees according to queue length
X */
- batch_requests = queue_nr_requests >> 3;
+ batch_requests = queue_nr_requests/4;
X printk("block: %d slots per queue, batch=%d\n", queue_nr_requests, batch_requests);
X
X #ifdef CONFIG_AMIGA_Z2RAM
diff -u --recursive --new-file v2.4.13/linux/drivers/block/loop.c linux/drivers/block/loop.c
--- v2.4.13/linux/drivers/block/loop.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/loop.c Thu Oct 25 13:58:34 2001
@@ -941,6 +941,7 @@
X }
X
X static struct block_device_operations lo_fops = {
+ owner: THIS_MODULE,
X open: lo_open,
X release: lo_release,
X ioctl: lo_ioctl,
@@ -951,6 +952,7 @@
X */
X MODULE_PARM(max_loop, "i");
X MODULE_PARM_DESC(max_loop, "Maximum number of loop devices (1-255)");
+MODULE_LICENSE("GPL");
X
X int loop_register_transfer(struct loop_func_table *funcs)
X {
diff -u --recursive --new-file v2.4.13/linux/drivers/block/nbd.c linux/drivers/block/nbd.c
--- v2.4.13/linux/drivers/block/nbd.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/nbd.c Fri Oct 26 15:39:02 2001
@@ -82,7 +82,6 @@
X return -ENODEV;
X
X nbd_dev[dev].refcnt++;


- MOD_INC_USE_COUNT;
X return 0;
X }
X

@@ -467,12 +466,12 @@
X printk(KERN_ALERT "nbd_release: refcount(%d) <= 0\n", lo->refcnt);
X lo->refcnt--;
X /* N.B. Doesn't lo->file need an fput?? */


- MOD_DEC_USE_COUNT;
X return 0;
X }
X

X static struct block_device_operations nbd_fops =
X {
+ owner: THIS_MODULE,
X open: nbd_open,
X release: nbd_release,
X ioctl: nbd_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/block/paride/Config.in linux/drivers/block/paride/Config.in
--- v2.4.13/linux/drivers/block/paride/Config.in Fri Apr 6 10:42:55 2001
+++ linux/drivers/block/paride/Config.in Thu Oct 25 00:07:39 2001
@@ -27,6 +27,12 @@
X dep_tristate ' FIT TD-2000 protocol' CONFIG_PARIDE_FIT2 $CONFIG_PARIDE
X dep_tristate ' FIT TD-3000 protocol' CONFIG_PARIDE_FIT3 $CONFIG_PARIDE
X dep_tristate ' Shuttle EPAT/EPEZ protocol' CONFIG_PARIDE_EPAT $CONFIG_PARIDE
+if [ "$CONFIG_PARIDE_EPAT" != "n" ]; then
+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ bool ' Support c7/c8 chips (EXPERIMENTAL)' CONFIG_PARIDE_EPATC8 $CONFIG_PARIDE
+ fi
+fi
+
X dep_tristate ' Shuttle EPIA protocol' CONFIG_PARIDE_EPIA $CONFIG_PARIDE
X dep_tristate ' Freecom IQ ASIC-2 protocol' CONFIG_PARIDE_FRIQ $CONFIG_PARIDE
X dep_tristate ' FreeCom power protocol' CONFIG_PARIDE_FRPW $CONFIG_PARIDE
diff -u --recursive --new-file v2.4.13/linux/drivers/block/paride/epat.c linux/drivers/block/paride/epat.c
--- v2.4.13/linux/drivers/block/paride/epat.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/paride/epat.c Thu Oct 25 00:07:39 2001
@@ -12,10 +12,11 @@
X /* Changes:
X
X 1.01 GRG 1998.05.06 init_proto, release_proto
+ 1.02 Joshua b. Jore CPP(renamed), epat_connect, epat_disconnect
X
X */
X
-#define EPAT_VERSION "1.01"
+#define EPAT_VERSION "1.02"
X
X #include <linux/module.h>
X #include <linux/delay.h>
@@ -197,30 +198,50 @@
X #define WRi(r,v) epat_write_regr(pi,0,r,v)
X #define RRi(r) (epat_read_regr(pi,0,r))
X
-/* FIXME: the CCP stuff should be fixed to handle multiple EPATs on a chain */
+/* FIXME: the CPP stuff should be fixed to handle multiple EPATs on a chain */
X
-#define CCP(x) w2(4);w0(0x22);w0(0xaa);w0(0x55);w0(0);w0(0xff);\
+#define CPP(x) w2(4);w0(0x22);w0(0xaa);w0(0x55);w0(0);w0(0xff);\
X w0(0x87);w0(0x78);w0(x);w2(4);w2(5);w2(4);w0(0xff);
X
X static void epat_connect ( PIA *pi )
X
X { pi->saved_r0 = r0();
X pi->saved_r2 = r2();
- CCP(0); CCP(0xe0);
+
+#ifdef CONFIG_PARIDE_EPATC8
+ /* Initialize the chip */
+ CPP(0);CPP(0x40);CPP(0xe0);
+ w0(0);w2(1);w2(4);
+ WR(0x8,0x12);WR(0xc,0x14);WR(0x12,0x10);
+ WR(0xe,0xf);WR(0xf,4);
+ /* WR(0xe,0xa);WR(0xf,4); */
+ WR(0xe,0xd);WR(0xf,0);
+ /* CPP(0x30); */
+
+ /* Connect to the chip */
+ CPP(0xe0);
+ w0(0);w2(1);w2(4); /* Idle into SPP */
+ if (pi->mode >= 3) {
+ w0(0);w2(1);w2(4);w2(0xc);
+ /* Request EPP */
+ w0(0x40);w2(6);w2(7);w2(4);w2(0xc);w2(4);
+ }
+#else
+ CPP(0); CPP(0xe0);
X w0(0); w2(1); w2(4);
X if (pi->mode >= 3) {
X w0(0); w2(1); w2(4); w2(0xc);
X w0(0x40); w2(6); w2(7); w2(4); w2(0xc); w2(4);
X }
X WR(8,0x10); WR(0xc,0x14); WR(0xa,0x38); WR(0x12,0x10);
+#endif
X }
X
-static void epat_disconnect ( PIA *pi )
-
-{ CCP(0x30);
- w0(pi->saved_r0);
- w2(pi->saved_r2);
-}
+static void epat_disconnect (PIA *pi)
+{ CPP(0x30);
+ w0(pi->saved_r0);
+ w2(pi->saved_r2);
+}
X
X static int epat_test_proto( PIA *pi, char * scratch, int verbose )
X
@@ -282,6 +303,7 @@
X static void epat_init_proto( PIA *pi)
X
X { MOD_INC_USE_COUNT;
+ printk("epat_init_proto");
X }
X
X static void epat_release_proto( PIA *pi)
diff -u --recursive --new-file v2.4.13/linux/drivers/block/paride/pcd.c linux/drivers/block/paride/pcd.c
--- v2.4.13/linux/drivers/block/paride/pcd.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/paride/pcd.c Sat Oct 27 02:03:47 2001
@@ -265,6 +265,14 @@
X
X /* kernel glue structures */
X
+static struct block_device_operations pcd_bdops = {
+ owner: THIS_MODULE,
+ open: cdrom_open,
+ release: cdrom_release,
+ ioctl: cdrom_ioctl,
+ check_media_change: cdrom_media_changed,
+};
+
X static struct cdrom_device_ops pcd_dops = {
X pcd_open,
X pcd_release,
@@ -335,13 +343,17 @@
X /* get the atapi capabilities page */
X pcd_probe_capabilities();
X
- if (register_blkdev(MAJOR_NR,name,&cdrom_fops)) {
+ if (register_blkdev(MAJOR_NR,name,&pcd_bdops)) {
X printk("pcd: unable to get major number %d\n",MAJOR_NR);


X return -1;
X }
X

- for (unit=0;unit<PCD_UNITS;unit++)
- if (PCD.present) register_cdrom(&PCD.info);
+ for (unit=0;unit<PCD_UNITS;unit++) {
+ if (PCD.present) {
+ register_cdrom(&PCD.info);
+ devfs_plain_cdrom(&PCD.info, &pcd_bdops);
+ }
+ }
X
X blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
X read_ahead[MAJOR_NR] = 8; /* 8 sector (4kB) read ahead */
@@ -358,14 +370,12 @@
X
X if ((unit >= PCD_UNITS) || (!PCD.present)) return -ENODEV;
X
- MOD_INC_USE_COUNT;
-


X return 0;
X }
X

X static void pcd_release(struct cdrom_device_info *cdi)
X
-{ MOD_DEC_USE_COUNT;
+{
X }
X
X #ifdef MODULE
diff -u --recursive --new-file v2.4.13/linux/drivers/block/paride/pd.c linux/drivers/block/paride/pd.c
--- v2.4.13/linux/drivers/block/paride/pd.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/paride/pd.c Thu Oct 25 13:58:35 2001
@@ -354,6 +354,7 @@
X };
X
X static struct block_device_operations pd_fops = {
+ owner: THIS_MODULE,
X open: pd_open,
X release: pd_release,
X ioctl: pd_ioctl,
@@ -430,8 +431,6 @@
X
X if ((unit >= PD_UNITS) || (!PD.present)) return -ENODEV;
X
- MOD_INC_USE_COUNT;
-
X wait_event (pd_wait_open, pd_valid);
X
X PD.access++;
@@ -515,8 +514,6 @@
X
X if (!PD.access && PD.removable)
X pd_doorlock(unit,IDE_DOORUNLOCK);
-
- MOD_DEC_USE_COUNT;
X
X return 0;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/block/paride/pf.c linux/drivers/block/paride/pf.c
--- v2.4.13/linux/drivers/block/paride/pf.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/paride/pf.c Thu Oct 25 13:58:35 2001
@@ -312,6 +312,7 @@
X /* kernel glue structures */
X
X static struct block_device_operations pf_fops = {
+ owner: THIS_MODULE,
X open: pf_open,
X release: pf_release,
X ioctl: pf_ioctl,
@@ -427,19 +428,13 @@
X
X if ((unit >= PF_UNITS) || (!PF.present)) return -ENODEV;
X
- MOD_INC_USE_COUNT;
-
X pf_identify(unit);
X
- if (PF.media_status == PF_NM) {
- MOD_DEC_USE_COUNT;
+ if (PF.media_status == PF_NM)
X return -ENODEV;
- }
X
- if ((PF.media_status == PF_RO) && (file ->f_mode & 2)) {
- MOD_DEC_USE_COUNT;
+ if ((PF.media_status == PF_RO) && (file ->f_mode & 2))
X return -EROFS;
- }
X
X PF.access++;
X if (PF.removable) pf_lock(unit,1);
@@ -512,8 +507,6 @@
X
X if (!PF.access && PF.removable)
X pf_lock(unit,0);
-
- MOD_DEC_USE_COUNT;
X
X return 0;
X
diff -u --recursive --new-file v2.4.13/linux/drivers/block/ps2esdi.c linux/drivers/block/ps2esdi.c
--- v2.4.13/linux/drivers/block/ps2esdi.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/ps2esdi.c Thu Oct 25 13:58:34 2001
@@ -150,6 +150,7 @@
X
X static struct block_device_operations ps2esdi_fops =
X {
+ owner: THIS_MODULE,
X open: ps2esdi_open,
X release: ps2esdi_release,
X ioctl: ps2esdi_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/block/rd.c linux/drivers/block/rd.c
--- v2.4.13/linux/drivers/block/rd.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/rd.c Thu Oct 25 13:58:35 2001
@@ -203,17 +203,6 @@


X return 0;
X }
X

-/*
- * Writing: just make sure the page gets marked dirty, so that
- * the page stealer won't grab it.
- */
-static int ramdisk_writepage(struct page *page)
-{
- SetPageDirty(page);
- UnlockPage(page);
- return 0;
-}
-
X static int ramdisk_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to)
X {
X if (!Page_Uptodate(page)) {
@@ -233,7 +222,7 @@
X
X static struct address_space_operations ramdisk_aops = {
X readpage: ramdisk_readpage,
- writepage: ramdisk_writepage,
+ writepage: fail_writepage,
X prepare_write: ramdisk_prepare_write,
X commit_write: ramdisk_commit_write,
X };
@@ -463,20 +452,12 @@
X rd_bdev[unit]->bd_inode->i_mapping->a_ops = &ramdisk_aops;
X }
X
- MOD_INC_USE_COUNT;
-
- return 0;
-}
-
-static int rd_release(struct inode * inode, struct file * filp)
-{


- MOD_DEC_USE_COUNT;
X return 0;
X }
X

X static struct block_device_operations rd_bd_op = {
+ owner: THIS_MODULE,
X open: rd_open,
- release: rd_release,
X ioctl: rd_ioctl,
X };
X
diff -u --recursive --new-file v2.4.13/linux/drivers/block/xd.c linux/drivers/block/xd.c
--- v2.4.13/linux/drivers/block/xd.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/block/xd.c Thu Oct 25 13:58:35 2001
@@ -137,6 +137,7 @@
X };
X
X static struct block_device_operations xd_fops = {
+ owner: THIS_MODULE,
X open: xd_open,
X release: xd_release,
X ioctl: xd_ioctl,
@@ -264,8 +265,6 @@
X {
X int dev = DEVICE_NR(inode->i_rdev);
X
- MOD_INC_USE_COUNT;
-
X if (dev < xd_drives) {
X while (!xd_valid[dev])
X sleep_on(&xd_wait_open);
@@ -275,7 +274,6 @@
X return (0);
X }
X
- MOD_DEC_USE_COUNT;
X return -ENXIO;
X }
X
@@ -374,10 +372,8 @@
X static int xd_release (struct inode *inode, struct file *file)
X {
X int target = DEVICE_NR(inode->i_rdev);
- if (target < xd_drives) {
+ if (target < xd_drives)
X xd_access[target]--;
- MOD_DEC_USE_COUNT;
- }


X return 0;
X }
X

diff -u --recursive --new-file v2.4.13/linux/drivers/block/z2ram.c linux/drivers/block/z2ram.c
--- v2.4.13/linux/drivers/block/z2ram.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/block/z2ram.c Thu Oct 25 13:58:35 2001
@@ -168,8 +168,6 @@
X sizeof( z2ram_map[0] );
X int rc = -ENOMEM;
X
- MOD_INC_USE_COUNT;
-
X device = DEVICE_NR( inode->i_rdev );
X
X if ( current_device != -1 && current_device != device )
@@ -319,7 +317,6 @@
X err_out_kfree:
X kfree( z2ram_map );
X err_out:
- MOD_DEC_USE_COUNT;
X return rc;
X }
X
@@ -333,13 +330,12 @@
X * FIXME: unmap memory
X */
X
- MOD_DEC_USE_COUNT;
-


X return 0;
X }
X

X static struct block_device_operations z2_fops =
X {
+ owner: THIS_MODULE,
X open: z2_open,
X release: z2_release,
X };
diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/aztcd.c linux/drivers/cdrom/aztcd.c
--- v2.4.13/linux/drivers/cdrom/aztcd.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/cdrom/aztcd.c Thu Oct 25 13:58:35 2001
@@ -355,6 +355,7 @@
X int aztcd_init(void);
X
X static struct block_device_operations azt_fops = {
+ owner:THIS_MODULE,
X open:aztcd_open,
X release:aztcd_release,
X ioctl:aztcd_ioctl,
@@ -1658,8 +1659,6 @@
X if (aztPresent == 0)
X return -ENXIO; /* no hardware */
X
- MOD_INC_USE_COUNT;
-
X if (!azt_open_count && azt_state == AZT_S_IDLE) {
X azt_invalidate_buffers();
X
@@ -1691,7 +1690,6 @@
X return 0;
X
X err_out:
- MOD_DEC_USE_COUNT;
X return -EIO;
X }
X
@@ -1706,7 +1704,6 @@
X printk("inode: %p, inode->i_rdev: %x file: %p\n", inode,
X inode->i_rdev, file);
X #endif
- MOD_DEC_USE_COUNT;
X if (!--azt_open_count) {
X azt_invalidate_buffers();
X aztUnlockDoor();
diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/cdrom.c linux/drivers/cdrom/cdrom.c
--- v2.4.13/linux/drivers/cdrom/cdrom.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/cdrom/cdrom.c Wed Oct 24 14:04:02 2001
@@ -310,11 +310,6 @@
X #define CHECKAUDIO if ((ret=check_for_audio_disc(cdi, cdo))) return ret
X
X /* Not-exported routines. */
-static int cdrom_open(struct inode *ip, struct file *fp);
-static int cdrom_release(struct inode *ip, struct file *fp);
-static int cdrom_ioctl(struct inode *ip, struct file *fp,
- unsigned int cmd, unsigned long arg);
-static int cdrom_media_changed(kdev_t dev);
X static int open_for_data(struct cdrom_device_info * cdi);
X static int check_for_audio_disc(struct cdrom_device_info * cdi,
X struct cdrom_device_ops * cdo);
@@ -333,14 +328,6 @@
X static devfs_handle_t devfs_handle;
X static struct unique_numspace cdrom_numspace = UNIQUE_NUMBERSPACE_INITIALISER;
X
-struct block_device_operations cdrom_fops =
-{
- open: cdrom_open,
- release: cdrom_release,
- ioctl: cdrom_ioctl,
- check_media_change: cdrom_media_changed,
-};
-
X /* This macro makes sure we don't have to check on cdrom_device_ops
X * existence in the run-time routines below. Change_capability is a
X * hack to have the capability flags defined const, while we can still
@@ -354,7 +341,6 @@
X int major = MAJOR(cdi->dev);
X struct cdrom_device_ops *cdo = cdi->ops;
X int *change_capability = (int *)&cdo->capability; /* hack */
- char vname[16];
X
X cdinfo(CD_OPEN, "entering register_cdrom\n");
X
@@ -396,7 +382,6 @@
X if (!devfs_handle)
X devfs_handle = devfs_mk_dir (NULL, "cdroms", NULL);
X cdi->number = devfs_alloc_unique_number (&cdrom_numspace);
- sprintf (vname, "cdrom%d", cdi->number);
X if (cdi->de) {
X int pos;
X devfs_handle_t slave;
@@ -405,6 +390,8 @@
X pos = devfs_generate_path (cdi->de, rname + 3,
X sizeof rname - 3);
X if (pos >= 0) {
+ char vname[16];
+ sprintf (vname, "cdrom%d", cdi->number);
X strncpy (rname + pos, "../", 3);
X devfs_mk_symlink (devfs_handle, vname,
X DEVFS_FL_DEFAULT,
@@ -412,13 +399,6 @@
X devfs_auto_unregister (cdi->de, slave);
X }
X }
- else {
- cdi->de =
- devfs_register (devfs_handle, vname, DEVFS_FL_DEFAULT,
- MAJOR (cdi->dev), MINOR (cdi->dev),
- S_IFBLK | S_IRUGO | S_IWUGO,
- &cdrom_fops, NULL);
- }
X cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" registered\n", cdi->name);
X cdi->next = topCdromPtr;
X topCdromPtr = cdi;
@@ -475,7 +455,6 @@
X * is in their own interest: device control becomes a lot easier
X * this way.
X */
-static
X int cdrom_open(struct inode *ip, struct file *fp)
X {
X struct cdrom_device_info *cdi;
@@ -669,7 +648,6 @@
X
X
X /* Admittedly, the logic below could be performed in a nicer way. */
-static
X int cdrom_release(struct inode *ip, struct file *fp)
X {
X kdev_t dev = ip->i_rdev;
@@ -867,7 +845,7 @@
X return ret;
X }
X
-static int cdrom_media_changed(kdev_t dev)
+int cdrom_media_changed(kdev_t dev)
X {
X struct cdrom_device_info *cdi = cdrom_find_device(dev);
X /* This talks to the VFS, which doesn't like errors - just 1 or 0.
@@ -1480,7 +1458,7 @@
X * these days. ATAPI / SCSI specific code now mainly resides in
X * mmc_ioct().
X */
-static int cdrom_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
+int cdrom_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
X unsigned long arg)
X {
X kdev_t dev = ip->i_rdev;
@@ -2391,7 +2369,10 @@
X EXPORT_SYMBOL(cdrom_count_tracks);
X EXPORT_SYMBOL(register_cdrom);
X EXPORT_SYMBOL(unregister_cdrom);
-EXPORT_SYMBOL(cdrom_fops);
+EXPORT_SYMBOL(cdrom_open);
+EXPORT_SYMBOL(cdrom_release);
+EXPORT_SYMBOL(cdrom_ioctl);
+EXPORT_SYMBOL(cdrom_media_changed);
X EXPORT_SYMBOL(cdrom_number_of_slots);
X EXPORT_SYMBOL(cdrom_select_disc);
X EXPORT_SYMBOL(cdrom_mode_select);
diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/cdu31a.c linux/drivers/cdrom/cdu31a.c
--- v2.4.13/linux/drivers/cdrom/cdu31a.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/cdrom/cdu31a.c Thu Oct 25 13:58:35 2001
@@ -3112,17 +3112,13 @@
X unsigned int res_size;
X unsigned char params[2];
X
- MOD_INC_USE_COUNT;
X if (sony_usage == 0) {
- if (scd_spinup() != 0) {
- MOD_DEC_USE_COUNT;
+ if (scd_spinup() != 0)
X return -EIO;
- }
X sony_get_toc();
X if (!sony_toc_read) {
X do_sony_cd_cmd(SONY_SPIN_DOWN_CMD, NULL, 0,
X res_reg, &res_size);
- MOD_DEC_USE_COUNT;
X return -EIO;
X }
X
@@ -3183,9 +3179,17 @@
X sony_spun_up = 0;
X }
X sony_usage--;
- MOD_DEC_USE_COUNT;
X }
X
+struct block_device_operations scd_bdops =
+{
+ owner: THIS_MODULE,
+ open: cdrom_open,
+ release: cdrom_release,
+ ioctl: cdrom_ioctl,
+ check_media_change: cdrom_media_changed,
+};
+
X static struct cdrom_device_ops scd_dops = {
X open:scd_open,
X release:scd_release,
@@ -3383,7 +3387,7 @@
X
X request_region(cdu31a_port, 4, "cdu31a");
X
- if (devfs_register_blkdev(MAJOR_NR, "cdu31a", &cdrom_fops)) {
+ if (devfs_register_blkdev(MAJOR_NR, "cdu31a", &scd_bdops)) {
X printk("Unable to get major %d for CDU-31a\n",
X MAJOR_NR);
X goto errout2;
@@ -3465,6 +3469,7 @@
X if (register_cdrom(&scd_info)) {
X goto errout0;
X }
+ devfs_plain_cdrom(&scd_info, &scd_bdops);
X }
X
X
diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/cm206.c linux/drivers/cdrom/cm206.c
--- v2.4.13/linux/drivers/cdrom/cm206.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/cdrom/cm206.c Thu Oct 25 13:58:35 2001
@@ -765,11 +765,19 @@
X }
X }
X
+struct block_device_operations cm206_bdops =
+{
+ owner: THIS_MODULE,
+ open: cdrom_open,
+ release: cdrom_release,
+ ioctl: cdrom_ioctl,
+ check_media_change: cdrom_media_changed,
+};
+
X /* The new open. The real opening strategy is defined in cdrom.c. */
X
X static int cm206_open(struct cdrom_device_info *cdi, int purpose)
X {
- MOD_INC_USE_COUNT;
X if (!cd->openfiles) { /* reset only first time */
X cd->background = 0;
X reset_cm260();
@@ -792,7 +800,6 @@
X FIRST_TRACK = 0; /* No valid disc status */
X }
X --cd->openfiles;
- MOD_DEC_USE_COUNT;
X }
X
X /* Empty buffer empties $sectors$ sectors of the adapter card buffer,
@@ -1478,7 +1485,7 @@
X return -EIO;
X }
X printk(".\n");
- if (devfs_register_blkdev(MAJOR_NR, "cm206", &cdrom_fops) != 0) {
+ if (devfs_register_blkdev(MAJOR_NR, "cm206", &cm206_bdops) != 0) {
X printk(KERN_INFO "Cannot register for major %d!\n",
X MAJOR_NR);
X cleanup(3);
@@ -1491,6 +1498,7 @@
X cleanup(3);
X return -EIO;
X }
+ devfs_plain_cdrom(&cm206_info, &cm206_bdops);
X blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
X blksize_size[MAJOR_NR] = cm206_blocksizes;
X read_ahead[MAJOR_NR] = 16; /* reads ahead what? */
diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/gscd.c linux/drivers/cdrom/gscd.c
--- v2.4.13/linux/drivers/cdrom/gscd.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/cdrom/gscd.c Thu Oct 25 13:58:35 2001
@@ -164,6 +164,7 @@
X static struct timer_list gscd_timer;
X
X static struct block_device_operations gscd_fops = {
+ owner:THIS_MODULE,
X open:gscd_open,
X release:gscd_release,
X ioctl:gscd_ioctl,
@@ -381,13 +382,10 @@
X if (gscdPresent == 0)
X return -ENXIO; /* no hardware */
X
- MOD_INC_USE_COUNT;
-
X get_status();
X st = disk_state & (ST_NO_DISK | ST_DOOR_OPEN);
X if (st) {
X printk("GSCD: no disk or door open\n");
- MOD_DEC_USE_COUNT;
X return -ENXIO;
X }
X
@@ -412,7 +410,6 @@
X
X gscd_bn = -1;


X
- MOD_DEC_USE_COUNT;
X return 0;
X }
X

diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/mcd.c linux/drivers/cdrom/mcd.c
--- v2.4.13/linux/drivers/cdrom/mcd.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/cdrom/mcd.c Thu Oct 25 13:58:35 2001
@@ -189,6 +189,15 @@
X void *arg);
X int mcd_drive_status(struct cdrom_device_info *cdi, int slot_nr);
X
+struct block_device_operations mcd_bdops =
+{
+ owner: THIS_MODULE,
+ open: cdrom_open,
+ release: cdrom_release,
+ ioctl: cdrom_ioctl,
+ check_media_change: cdrom_media_changed,
+};
+
X static struct timer_list mcd_timer;
X
X static struct cdrom_device_ops mcd_dops = {
@@ -978,8 +987,6 @@
X if (mcdPresent == 0)
X return -ENXIO; /* no hardware */
X
- MOD_INC_USE_COUNT;
-
X if (mcd_open_count || mcd_state != MCD_S_IDLE)
X goto bump_count;
X
@@ -1002,7 +1009,6 @@
X return 0;
X
X err_out:
- MOD_DEC_USE_COUNT;
X return -EIO;


X }
X
@@ -1015,7 +1021,6 @@

X if (!--mcd_open_count) {
X mcd_invalidate_buffers();
X }
- MOD_DEC_USE_COUNT;
X }
X
X
@@ -1060,7 +1065,7 @@
X return -EIO;
X }
X
- if (devfs_register_blkdev(MAJOR_NR, "mcd", &cdrom_fops) != 0) {
+ if (devfs_register_blkdev(MAJOR_NR, "mcd", &mcd_bdops) != 0) {
X printk(KERN_ERR "mcd: Unable to get major %d for Mitsumi CD-ROM\n", MAJOR_NR);
X return -EIO;
X }
@@ -1152,6 +1157,7 @@
X cleanup(3);
X return -EIO;
X }
+ devfs_plain_cdrom(&mcd_info, &mcd_bdops);
X printk(msg);
X
X return 0;
diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/mcdx.c linux/drivers/cdrom/mcdx.c
--- v2.4.13/linux/drivers/cdrom/mcdx.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/cdrom/mcdx.c Thu Oct 25 13:58:35 2001
@@ -219,6 +219,15 @@
X int mcdx_init(void);
X void do_mcdx_request(request_queue_t * q);
X
+struct block_device_operations mcdx_bdops =
+{
+ owner: THIS_MODULE,
+ open: cdrom_open,
+ release: cdrom_release,
+ ioctl: cdrom_ioctl,
+ check_media_change: cdrom_media_changed,
+};
+
X
X /* Indirect exported functions. These functions are exported by their
X addresses, such as mcdx_open and mcdx_close in the
@@ -640,13 +649,10 @@
X /* Make the modules looking used ... (thanx bjorn).
X * But we shouldn't forget to decrement the module counter
X * on error return */
- MOD_INC_USE_COUNT;
X
X /* this is only done to test if the drive talks with us */
- if (-1 == mcdx_getstatus(stuffp, 1)) {
- MOD_DEC_USE_COUNT;
+ if (-1 == mcdx_getstatus(stuffp, 1))
X return -EIO;
- }
X
X if (stuffp->xxx) {
X
@@ -705,10 +711,8 @@
X }
X
X xtrace(OPENCLOSE, "open() init irq generation\n");
- if (-1 == mcdx_config(stuffp, 1)) {
- MOD_DEC_USE_COUNT;
+ if (-1 == mcdx_config(stuffp, 1))
X return -EIO;
- }
X #if FALLBACK
X /* Set the read speed */
X xwarn("AAA %x AAA\n", stuffp->readcmd);
@@ -745,7 +749,7 @@
X MODE2 :
X MODE1,
X 1))) {
- /* MOD_DEC_USE_COUNT, return -EIO; */
+ /* return -EIO; */
X stuffp->xa = 0;
X break;
X }
@@ -765,10 +769,8 @@
X /* xa disks will be read in raw mode, others not */
X if (-1 == mcdx_setdrivemode(stuffp,
X stuffp->xa ? RAW : COOKED,
- 1)) {
- MOD_DEC_USE_COUNT;
+ 1))
X return -EIO;
- }
X if (stuffp->audio) {
X xinfo("open() audio disk found\n");
X } else if (stuffp->lastsector >= 0) {
@@ -792,8 +794,6 @@
X stuffp = mcdx_stuffp[MINOR(cdi->dev)];
X
X --stuffp->users;
-
- MOD_DEC_USE_COUNT;
X }
X
X static int mcdx_media_changed(struct cdrom_device_info *cdi, int disc_nr)
@@ -1180,7 +1180,7 @@
X }
X
X xtrace(INIT, "init() register blkdev\n");
- if (devfs_register_blkdev(MAJOR_NR, "mcdx", &cdrom_fops) != 0) {
+ if (devfs_register_blkdev(MAJOR_NR, "mcdx", &mcdx_bdops) != 0) {
X xwarn("%s=0x%3p,%d: Init failed. Can't get major %d.\n",
X MCDX, stuffp->wreg_data, stuffp->irq, MAJOR_NR);
X kfree(stuffp);
@@ -1240,6 +1240,7 @@
X blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
X return 2;
X }
+ devfs_plain_cdrom(&mcdx_info, &mcdx_bdops);
X printk(msg);
X return 0;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/optcd.c linux/drivers/cdrom/optcd.c
--- v2.4.13/linux/drivers/cdrom/optcd.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/cdrom/optcd.c Thu Oct 25 13:58:35 2001
@@ -1871,8 +1871,6 @@
X {
X DEBUG((DEBUG_VFS, "starting opt_open"));
X
- MOD_INC_USE_COUNT;
-
X if (!open_count && state == S_IDLE) {
X int status;
X
@@ -1916,7 +1914,6 @@
X return 0;
X
X err_out:
- MOD_DEC_USE_COUNT;
X return -EIO;
X }
X
@@ -1944,7 +1941,6 @@
X del_timer(&delay_timer);
X del_timer(&req_timer);


X }
- MOD_DEC_USE_COUNT;
X return 0;
X }
X

@@ -2005,6 +2001,7 @@
X
X
X static struct block_device_operations opt_fops = {
+ owner: THIS_MODULE,
X open: opt_open,
X release: opt_release,
X ioctl: opt_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/sbpcd.c linux/drivers/cdrom/sbpcd.c
--- v2.4.13/linux/drivers/cdrom/sbpcd.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/cdrom/sbpcd.c Thu Oct 25 13:58:35 2001
@@ -5418,6 +5418,15 @@
X return (1);
X }
X /*==========================================================================*/
+
+static struct block_device_operations sbpcd_bdops =
+{
+ owner: THIS_MODULE,
+ open: cdrom_open,
+ release: cdrom_release,
+ ioctl: cdrom_ioctl,
+ check_media_change: cdrom_media_changed,
+};
X /*==========================================================================*/
X /*
X * Open the device special file. Check that a disk is in. Read TOC.


@@ -5428,7 +5437,6 @@
X

X i = MINOR(cdi->dev);
X
- MOD_INC_USE_COUNT;
X down(&ioctl_read_sem);
X switch_drive(i);
X
@@ -5495,7 +5503,6 @@
X }
X }
X up(&ioctl_read_sem);
- MOD_DEC_USE_COUNT;
X return ;
X }
X /*==========================================================================*/
@@ -5848,7 +5855,7 @@
X OUT(MIXER_data,0xCC); /* one nibble per channel, max. value: 0xFF */
X #endif /* SOUND_BASE */
X
- if (devfs_register_blkdev(MAJOR_NR, major_name, &cdrom_fops) != 0)
+ if (devfs_register_blkdev(MAJOR_NR, major_name, &sbpcd_bdops) != 0)
X {
X msg(DBG_INF, "Can't get MAJOR %d for Matsushita CDROM\n", MAJOR_NR);
X #ifdef MODULE
@@ -5923,7 +5930,7 @@
X sbpcd_infop->de =
X devfs_register (devfs_handle, nbuff, DEVFS_FL_DEFAULT,
X MAJOR_NR, j, S_IFBLK | S_IRUGO | S_IWUGO,
- &cdrom_fops, NULL);
+ &sbpcd_bdops, NULL);
X if (register_cdrom(sbpcd_infop))
X {
X printk(" sbpcd: Unable to register with Uniform CD-ROm driver\n");
diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/sjcd.c linux/drivers/cdrom/sjcd.c
--- v2.4.13/linux/drivers/cdrom/sjcd.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/cdrom/sjcd.c Thu Oct 25 13:58:35 2001
@@ -1551,8 +1551,6 @@
X if (fp->f_mode & 2)
X return (-EROFS);
X
- MOD_INC_USE_COUNT;
-
X if (sjcd_open_count == 0) {
X int s, sjcd_open_tries;
X /* We don't know that, do we? */
@@ -1618,7 +1616,6 @@
X return (0);
X
X err_out:
- MOD_DEC_USE_COUNT;
X return (-EIO);
X }
X
@@ -1632,9 +1629,6 @@
X #if defined( SJCD_TRACE )
X printk("SJCD: release\n");
X #endif
-#ifdef MODULE
- MOD_DEC_USE_COUNT;
-#endif
X if (--sjcd_open_count == 0) {
X sjcd_invalidate_buffers();
X s = sjcd_tray_unlock();
@@ -1662,6 +1656,7 @@
X * A list of file operations allowed for this cdrom.
X */
X static struct block_device_operations sjcd_fops = {
+ owner:THIS_MODULE,
X open:sjcd_open,
X release:sjcd_release,
X ioctl:sjcd_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/sonycd535.c linux/drivers/cdrom/sonycd535.c
--- v2.4.13/linux/drivers/cdrom/sonycd535.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/cdrom/sonycd535.c Thu Oct 25 13:58:35 2001
@@ -1399,13 +1399,11 @@
X if (check_drive_status() != 0)
X return -EIO;
X sony_inuse = 1;
- MOD_INC_USE_COUNT;
X
X if (spin_up_drive(status) != 0) {
X printk(CDU535_MESSAGE_NAME " error 0x%.2x (cdu_open, spin up)\n",
X status[0]);
X sony_inuse = 0;
- MOD_DEC_USE_COUNT;
X return -EIO;
X }
X sony_get_toc();
@@ -1413,7 +1411,6 @@
X cmd_buff[0] = SONY535_SPIN_DOWN;
X do_sony_cmd(cmd_buff, 1, status, NULL, 0, 0);
X sony_inuse = 0;
- MOD_DEC_USE_COUNT;
X return -EIO;
X }
X if (inode) {
@@ -1442,7 +1439,6 @@
X Byte status[2], cmd_no;
X
X sony_inuse = 0;
- MOD_DEC_USE_COUNT;
X
X if (0 < sony_usage) {
X sony_usage--;
@@ -1463,9 +1459,9 @@


X return 0;
X }
X

-
X static struct block_device_operations cdu_fops =
X {
+ owner: THIS_MODULE,
X open: cdu_open,
X release: cdu_release,
X ioctl: cdu_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/char/Config.in linux/drivers/char/Config.in
--- v2.4.13/linux/drivers/char/Config.in Tue Oct 23 22:48:50 2001
+++ linux/drivers/char/Config.in Thu Oct 25 14:01:51 2001
@@ -221,6 +221,8 @@
X source drivers/char/pcmcia/Config.in
X fi
X
-tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE
+if [ "$CONFIG_X86" = "y" ]; then
+ tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE
+fi
X
X endmenu
diff -u --recursive --new-file v2.4.13/linux/drivers/char/Makefile linux/drivers/char/Makefile
--- v2.4.13/linux/drivers/char/Makefile Tue Oct 23 22:48:50 2001
+++ linux/drivers/char/Makefile Fri Nov 2 17:46:47 2001
@@ -192,6 +192,7 @@
X obj-$(CONFIG_NVRAM) += nvram.o
X endif
X obj-$(CONFIG_TOSHIBA) += toshiba.o
+obj-$(CONFIG_I8K) += i8k.o
X obj-$(CONFIG_DS1620) += ds1620.o
X obj-$(CONFIG_INTEL_RNG) += i810_rng.o
X
diff -u --recursive --new-file v2.4.13/linux/drivers/char/README.computone linux/drivers/char/README.computone
--- v2.4.13/linux/drivers/char/README.computone Fri Feb 16 16:02:36 2001
+++ linux/drivers/char/README.computone Wed Oct 24 12:05:18 2001
@@ -1,227 +1,10 @@
-
X Computone Intelliport II/Plus Multiport Serial Driver
X -----------------------------------------------------
X
-Release Notes For Linux Kernel 2.2
-These notes have been tested on Linux kernels 2.0 and 2.2.
-
-Please refer to Documentation/computone.txt for information on the driver
-that is included with the kernel sources.
-
-
-Version: 1.2.9
-Date: 04/12/2000


-Fixes and Updates: Doug McNash

-Historical Author: Andrew Manison
-Kernel Integration: Mike Warfield <m...@wittsend.com>
-
-1. INTRODUCTION
-
-This driver supports the entire family of Intelliport II/Plus controllers
-with the exception of the MicroChannel controllers.
-
-This driver was developed on the v2.0.x Linux source tree and has been
-tested up to v2.2.14; it will probably not work with earlier v1.X kernels,
-and has not yet been tested on the v2.1.x tree. The most likely problems
-will be in patching the kernel sources to support the driver. For this
-reason there are 2 different patch files for 2.0.XX and 2.2.XX kernels.
-Make sure you use the right one!
-Note that a version (1.2.5) is included in the 2.2.12+ kernels so this
-will not be a new install but and upgrade.
-
-
-2. QUICK INSTALLATION
-
-Hardware - If you have an ISA card, find a free interrupt and io port.
- List those in use with `cat /proc/interrupts` and
- `cat /proc/ioports`. Set the card dip switches to that free
- address. You may need to configure your BIOS to reserve the
- irq for the ISA card. PCI and EISA parameters are set
- automagically and need only be set to nonzero values.
- Insert card into computer with the power off before or after
- driver installation.
-
-Software - New Installation
-
-Module installation:
-
-a) Obtain driver-kernel patch file
-b) Copy to the linux source tree root, Run ip2build (if not patch)
-c) Determine free irq/address to use if any (configure BIOS if need be)
-d) Run "make config" or "make menuconfig" or "make xconfig"
- Select (m) module for CONFIG_COMPUTONE under character
- devices. CONFIG_PCI and CONFIG_MODULES also may need to be set.
-e) Set address on ISA cards then:


- edit /usr/src/linux/drivers/char/ip2/ip2.h if needed

- or
- edit /etc/modules.conf if needed (module).
- or both to match this setting.
-f) Run "make dep"
-g) Run "make modules"
-h) Run "make modules_install"
-i) Run "/sbin/depmod -a"
-i) install driver using `modprobe ip2 <options>` (options listed below)
-j) run mkip2dev
-
-
-Kernel installation:
-
-a) Obtain driver-kernel patch file
-b) Copy to the linux source tree root, Run ip2build (if not patch)
-c) Determine free irq/address to use if any (configure BIOS if need be)
-d) Run "make config" or "make menuconfig" or "make xconfig"
- Select (y) kernel for CONFIG_COMPUTONE under character
- devices. CONFIG_PCI may need to be set if you have PCI bus.
-e) Set address on ISA cards then:
- edit /usr/src/linux/drivers/char/ip2/ip2.h
-f) Run "make dep"
-g) Run "make zImage" or whatever target you prefer.
-h) mv /usr/src/linux/arch/i386/boot/zImage to /boot.
-i) add new config for this kernel into /etc/lilo.conf, run "lilo"
-j) reboot using this kernel
-k) make and run ip2/mkip2dev
-
-Software - Upgrades
-
-a) Install new sources in proper location, usually /usr/src/linux/drivers/char
-b) Follow steps above to create new kernel or modules
-
-3. INSTALLATION
-
-Previously, the driver sources were packaged with a set of patch files
-to update the character drivers' makefile and configuration file, and other
-kernel source files. A build script (ip2build) was included which applies
-the patches if needed, and build any utilities needed.
-What you receive may be a single patch file in conventional kernel
-patch format build script. That form can also be applied by
-running patch -p1 < ThePatchFile. Otherwise the drivers source may be
-a tar file, then untar and run ip2build if a new installation.
-
-The driver can be installed as a module (recommended) or built into the
-kernel. This is selected as for other drivers through the `make config`
-command from the root of the Linux source tree. If the driver is built

-into the kernel you will need to edit the file ip2.h to match the boards

-you are installing. See that file for instructions. If the driver is
-installed as a module the configuration can also be specified on the
-modprobe command line as follows:
-
- modprobe ip2 irq=irq1,irq2,irq3,irq4 io=addr1,addr2,addr3,addr4
-
-where irqnum is one of the valid Intelliport II interrupts (3,4,5,7,10,11,
-12,15) and addr1-4 are the base addresses for up to four controllers. If

-the irqs are not specified the driver uses the default in ip2/ip2.h (which

-selects polled mode). The io addresses are set to io=1 for PCI cards,i
-io=2 for EISA cards or io=[some valid ISA address] for ISA cards. If no
-base addresses are specified the defaults in ip2.h are used. If you are
-autoloading the driver module with kerneld or kmod the base addresses and
-interrupt number must also be set in ip2/ip2.h and recompile or just insert
-an options line in /etc/modules.conf or both. The command line takes
-precidence over the options line which takes precidence over the defaults
-in ip2.h.
-
-command line sample:
-
- modprobe ip2 io=1,0x328 irq=1,10
-
-/etc/modules.conf sample:
-
- options ip2 io=1,0x328 irq=1,10
- alias char-major-71 ip2
- alias char-major-72 ip2
- alias char-major-73 ip2
-
-the equivelant ip2.h:
-


-static ip2config_t ip2config =
-{
- {1,10,0,0},
- {
- 0x0001, // Board 0, ttyF0 - ttyF63 /* PCI card */
- 0x0328, // Board 1, ttyF64 - ttyF127 /* ISA card */
- 0x0000, // Board 2, ttyF128 - ttyF191 /* empty */
- 0x0000 // Board 3, ttyF192 - ttyF255 /* empty */
- }
-};

-
-Specifying an invalid or in-use ISA irq will default the driver into
-running in polled mode for that card. If all irq entries are 0 then
-all cards will operate in polled mode. Note that the PCI will be
-assigned it's irq by the BIOS and may not match what you specify.
-It must be non-zero otherwise it will be polled.
-
-Tarball Install:
-
-The whole tarfile should be untarred in the /usr/src/linux/drivers/char/
-directory. Most files required for the driver are placed in the ip2
-subdirectory. Then execute the script (for a new install only)
-
- ip2build
-
-which will patch the files.
-
-Kernel Patch Install:
-
- cd to the Linux source root, run patch -p1 < ThePatchFile.
-
-Now return to the root directory of the Linux
-source tree and run make config or make menuconfig. You will be prompted
-for the Computone drivers, either as a module or part of the kernel.
-If you have a PCI card you many need to select PCI bios support (CONFIG_PCI)
-if not enabled already. Ditto for CONFIG_MODULES if you use modules.
-
-If you select the driver as part of the kernel run :
-
- make depend
- make bzImage(,zlilo or whatever you do to create a bootable kernel)
-
-If you selected a module run :
-
- make modules && make modules_install
-
-The utility ip2mkdev creates all the device nodes required by the driver.
-For a device to be created it must be configured in the driver and the
-board must be installed. Only devices corresponding to real IntelliPort II
-ports are created. With multiple boards and expansion boxes this will
-leave gaps in the sequence of device names. ip2mkdev uses Linux tty naming
-conventions: ttyF0 - ttyF255 for normal devices, and cuf0 - cuf255 for
-callout devices. Note that the callout devices are going away in the
-future and that is what the warning messages are trying to tell you.
-
-4. USING THE DRIVERS
-
-As noted above, the driver implements the ports in accordance with Linux
-conventions, and the devices should be interchangeable with the standard
-serial devices. (This is a key point for problem reporting: please make
-sure that what you are trying do works on the ttySx/cuax ports first; then
-tell us what went wrong with the ip2 ports!)
-
-Higher speeds can be obtained using the setserial utility which remaps
-38,400 bps (extb) to 57,600 bps, 115,200 bps, or a custom speed.
-Intelliport II installations using the PowerPort expansion module can
-use the custom speed setting to select the highest speeds: 153,600 bps,
-230,400 bps, 307,200 bps, 460,800bps and 921,600 bps. The base for
-custom baud rate configuration is fixed at 921,600 for cards/expantion
-modules with ST654's and 115200 for those with Cirrus CD1400's. This
-corresponds to the maximum bit rates those chips are capable.
-For example if the baud base is 921600 and the baud divisor is 18 then
-the custom rate is 921600/18 = 51200 bps. See the setserial man page for
-complete details. Of course, if stty accepts the higher rates now you can
-use that as well as the standard ioctls().
-
-5. NOTES
-
-This is a release version of the driver, but it is impossible to test it
-in all configurations of Linux. If there is any anomalous behaviour that
-does not match the standard serial port's behaviour please let us know.
-
-Some installations report that characters fail to echo immediatly at a
-terminal if the kernel/modules are compiled with the CONFIG_M386 and
-the card is run in polling mode on a pentium class machine. Compiling
-with a more appropriate processor flag or running on interrupt would be
-the fix as well as the wise thing to do.
+Release Notes For Linux Kernel 2.2 and higher
X
+This file is now deprecated and will be removed at some point.
X
+Please refer to the file Documentation/computone.txt instead.
X
-Author: do...@computone.com
-Testing: lar...@computone.com
-Support: sup...@computone.com
+Michael H. Warfield 08/12/2001
diff -u --recursive --new-file v2.4.13/linux/drivers/char/applicom.c linux/drivers/char/applicom.c
--- v2.4.13/linux/drivers/char/applicom.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/applicom.c Thu Oct 25 13:53:47 2001
@@ -72,6 +72,17 @@
X "PCI2000PFB"
X };
X
+static struct pci_device_id applicom_pci_tbl[] = {
+ { PCI_VENDOR_ID_APPLICOM, PCI_DEVICE_ID_APPLICOM_PCIGENERIC,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { PCI_VENDOR_ID_APPLICOM, PCI_DEVICE_ID_APPLICOM_PCI2000IBS_CAN,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { PCI_VENDOR_ID_APPLICOM, PCI_DEVICE_ID_APPLICOM_PCI2000PFB,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { 0 }
+};
+MODULE_DEVICE_TABLE(pci, applicom_pci_tbl);
+
X MODULE_AUTHOR("David Woodhouse & Applicom International");
X MODULE_DESCRIPTION("Driver for Applicom Profibus card");
X MODULE_LICENSE("GPL");
@@ -437,7 +448,7 @@
X }
X
X /* We may not have actually slept */
- current->state = TASK_RUNNING;
+ set_current_state(TASK_RUNNING);
X remove_wait_queue(&apbs[IndexCard].FlagSleepSend, &wait);
X
X writeb(1, apbs[IndexCard].RamIO + DATA_FROM_PC_READY);
diff -u --recursive --new-file v2.4.13/linux/drivers/char/drm/drmP.h linux/drivers/char/drm/drmP.h
--- v2.4.13/linux/drivers/char/drm/drmP.h Thu Oct 18 13:48:13 2001
+++ linux/drivers/char/drm/drmP.h Mon Nov 5 12:42:41 2001
@@ -781,30 +781,30 @@
X #if LINUX_VERSION_CODE < 0x020317
X extern unsigned long DRM(vm_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access);
+ int unused);
X extern unsigned long DRM(vm_shm_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access);
+ int unused);
X extern unsigned long DRM(vm_dma_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access);
+ int unused);
X extern unsigned long DRM(vm_sg_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access);
+ int unused);
X #else
X /* Return type changed in 2.3.23 */
X extern struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access);
+ int unused);
X extern struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access);
+ int unused);
X extern struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access);
+ int unused);
X extern struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access);
+ int unused);
X #endif
X extern void DRM(vm_open)(struct vm_area_struct *vma);
X extern void DRM(vm_close)(struct vm_area_struct *vma);
diff -u --recursive --new-file v2.4.13/linux/drivers/char/drm/drm_vm.h linux/drivers/char/drm/drm_vm.h
--- v2.4.13/linux/drivers/char/drm/drm_vm.h Tue Oct 23 22:48:50 2001
+++ linux/drivers/char/drm/drm_vm.h Mon Nov 5 12:42:41 2001
@@ -59,12 +59,12 @@
X #if LINUX_VERSION_CODE < 0x020317
X unsigned long DRM(vm_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access)
+ int unused)
X #else
X /* Return type changed in 2.3.23 */
X struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access)
+ int unused)
X #endif
X {
X #if __REALLY_HAVE_AGP
@@ -137,12 +137,12 @@
X #if LINUX_VERSION_CODE < 0x020317
X unsigned long DRM(vm_shm_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access)
+ int unused)
X #else
X /* Return type changed in 2.3.23 */
X struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access)
+ int unused)
X #endif
X {
X #if LINUX_VERSION_CODE >= 0x020300
@@ -273,12 +273,12 @@
X #if LINUX_VERSION_CODE < 0x020317
X unsigned long DRM(vm_dma_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access)
+ int unused)
X #else
X /* Return type changed in 2.3.23 */
X struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access)
+ int unused)
X #endif
X {
X drm_file_t *priv = vma->vm_file->private_data;
@@ -310,12 +310,12 @@
X #if LINUX_VERSION_CODE < 0x020317
X unsigned long DRM(vm_sg_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access)
+ int unused)
X #else
X /* Return type changed in 2.3.23 */
X struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
X unsigned long address,
- int write_access)
+ int unused)
X #endif
X {
X #if LINUX_VERSION_CODE >= 0x020300
diff -u --recursive --new-file v2.4.13/linux/drivers/char/eurotechwdt.c linux/drivers/char/eurotechwdt.c
--- v2.4.13/linux/drivers/char/eurotechwdt.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/eurotechwdt.c Thu Oct 25 13:53:47 2001
@@ -0,0 +1,480 @@
+/*
+ * Eurotech CPU-1220/1410 on board WDT driver for Linux 2.4.x
+ *
+ * (c) Copyright 2001 Ascensit <sup...@ascensit.com>
+ * (c) Copyright 2001 Rodolfo Giometti <giom...@ascensit.com>
+ *
+ * Based on wdt.c.
+ * Original copyright messages:
+ *
+ * (c) Copyright 1996-1997 Alan Cox <al...@redhat.com>, All Rights Reserved.
+ * http://www.redhat.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.
+ *
+ * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ * warranty for any of this software. This material is provided
+ * "AS-IS" and at no charge.
+ *
+ * (c) Copyright 1995 Alan Cox <al...@lxorguk.ukuu.org.uk>*
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/smp_lock.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/slab.h>
+#include <linux/ioport.h>
+#include <linux/fcntl.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/smp_lock.h>
+
+static int eurwdt_is_open;
+static int eurwdt_timeout;
+static spinlock_t eurwdt_lock;
+
+/*
+ * You must set these - there is no sane way to probe for this board.
+ * You can use wdt=x,y to set these now.
+ */
+
+static int io = 0x3f0;
+static int irq = 10;
+static char *ev = "int";
+
+#define WDT_TIMEOUT 60 /* 1 minute */
+
+
+/*
+ * Some symbolic names
+ */
+
+#define WDT_CTRL_REG 0x30
+#define WDT_OUTPIN_CFG 0xe2
+ #define WDT_EVENT_INT 0x00
+ #define WDT_EVENT_REBOOT 0x08
+#define WDT_UNIT_SEL 0xf1
+ #define WDT_UNIT_SECS 0x80
+#define WDT_TIMEOUT_VAL 0xf2
+#define WDT_TIMER_CFG 0xf3
+
+
+#ifndef MODULE
+
+/**
+ * eurwdt_setup:
+ * @str: command line string
+ *
+ * Setup options. The board isn't really probe-able so we have to
+ * get the user to tell us the configuration. Sane people build it
+ * modular but the others come here.
+ */
+
+static int __init eurwdt_setup(char *str)
+{
+ int ints[4];
+
+ str = get_options (str, ARRAY_SIZE(ints), ints);
+
+ if (ints[0] > 0) {
+ io = ints[1];
+ if (ints[0] > 1)
+ irq = ints[2];
+ }


+
+ return 1;
+}
+

+__setup("wdt=", eurwdt_setup);
+
+#endif /* !MODULE */
+
+MODULE_PARM(io, "i");
+MODULE_PARM_DESC(io, "Eurotech WDT io port (default=0x3f0)");
+MODULE_PARM(irq, "i");
+MODULE_PARM_DESC(irq, "Eurotech WDT irq (default=10)");
+MODULE_PARM(ev, "s");
+MODULE_PARM_DESC(ev, "Eurotech WDT event type (default is `reboot')");
+
+
+/*
+ * Programming support
+ */
+
+static inline void eurwdt_write_reg(u8 index, u8 data)
+{
+ outb(index, io);
+ outb(data, io+1);
+}
+
+static inline void eurwdt_lock_chip(void)
+{
+ outb(0xaa, io);
+}
+
+static inline void eurwdt_unlock_chip(void)
+{
+ outb(0x55, io);
+ eurwdt_write_reg(0x07, 0x08); /* set the logical device */
+}
+
+static inline void eurwdt_set_timeout(int timeout)
+{
+ eurwdt_write_reg(WDT_TIMEOUT_VAL, (u8) timeout);
+}
+
+static inline void eurwdt_disable_timer(void)
+{
+ eurwdt_set_timeout(0);
+}
+
+static void eurwdt_activate_timer(void)
+{
+ eurwdt_disable_timer();
+ eurwdt_write_reg(WDT_CTRL_REG, 0x01); /* activate the WDT */
+ eurwdt_write_reg(WDT_OUTPIN_CFG, !strcmp("int", ev) ?
+ WDT_EVENT_INT : WDT_EVENT_REBOOT);
+ /* Setting interrupt line */
+ if (irq == 2 || irq > 15 || irq < 0) {
+ printk(KERN_ERR ": invalid irq number\n");
+ irq = 0; /* if invalid we disable interrupt */
+ }
+ if (irq == 0)
+ printk(KERN_INFO ": interrupt disabled\n");
+ eurwdt_write_reg(WDT_TIMER_CFG, irq<<4);
+
+ eurwdt_write_reg(WDT_UNIT_SEL, WDT_UNIT_SECS); /* we use seconds */
+ eurwdt_set_timeout(0); /* the default timeout */
+}
+
+
+/*
+ * Kernel methods.
+ */
+
+void eurwdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+ printk(KERN_CRIT "timeout WDT timeout\n");
+
+#ifdef ONLY_TESTING
+ printk(KERN_CRIT "Would Reboot.\n");
+#else
+ printk(KERN_CRIT "Initiating system reboot.\n");
+ machine_restart(NULL);
+#endif
+}
+
+
+/**
+ * eurwdt_ping:
+ *
+ * Reload counter one with the watchdog timeout.
+ */
+
+static void eurwdt_ping(void)
+{
+ /* Write the watchdog default value */
+ eurwdt_set_timeout(eurwdt_timeout);
+}
+
+/**
+ * eurwdt_write:
+ * @file: file handle to the watchdog
+ * @buf: buffer to write (unused as data does not matter here
+ * @count: count of bytes
+ * @ppos: pointer to the position to write. No seeks allowed
+ *
+ * A write to a watchdog device is defined as a keepalive signal. Any
+ * write of data will do, as we we don't define content meaning.
+ */
+
+static ssize_t eurwdt_write(struct file *file, const char *buf, size_t count,
+loff_t *ppos)
+{
+ /* Can't seek (pwrite) on this device */
+ if (ppos != &file->f_pos)
+ return -ESPIPE;
+
+ if (count) {
+ eurwdt_ping(); /* the default timeout */


+ return 1;
+ }
+

+ return 0;
+}
+

+/**
+ * eurwdt_ioctl:
+ * @inode: inode of the device
+ * @file: file handle to the device
+ * @cmd: watchdog command
+ * @arg: argument pointer
+ *
+ * The watchdog API defines a common set of functions for all watchdogs
+ * according to their available features.
+ */
+
+static int eurwdt_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ static struct watchdog_info ident = {
+ options : WDIOF_CARDRESET,
+ firmware_version : 1,
+ identity : "WDT Eurotech CPU-1220/1410"
+ };
+
+ int time;
+
+ switch(cmd) {
+ default:
+ return -ENOTTY;
+
+ case WDIOC_GETSUPPORT:
+ return copy_to_user((struct watchdog_info *)arg, &ident,
+ sizeof(ident)) ? -EFAULT : 0;
+
+ case WDIOC_GETBOOTSTATUS:
+ return put_user(0, (int *) arg);
+
+ case WDIOC_KEEPALIVE:
+ eurwdt_ping();
+ return 0;
+
+ case WDIOC_SETTIMEOUT:
+ if (copy_from_user(&time, (int *) arg, sizeof(int)))
+ return -EFAULT;
+
+ /* Sanity check */
+ if (time < 0 || time > 255)
+ return -EINVAL;
+
+ eurwdt_timeout = time;
+ eurwdt_set_timeout(time);

+ return 0;
+ }
+}
+

+/**
+ * eurwdt_open:
+ * @inode: inode of device
+ * @file: file handle to device
+ *
+ * The misc device has been opened. The watchdog device is single
+ * open and on opening we load the counter.
+ */
+
+static int eurwdt_open(struct inode *inode, struct file *file)
+{
+ switch (MINOR(inode->i_rdev)) {
+ case WATCHDOG_MINOR:
+ spin_lock(&eurwdt_lock);
+ if (eurwdt_is_open) {
+ spin_unlock(&eurwdt_lock);
+ return -EBUSY;
+ }
+
+ eurwdt_is_open = 1;
+ eurwdt_timeout = WDT_TIMEOUT; /* initial timeout */
+
+ /* Activate the WDT */
+ eurwdt_activate_timer();
+
+ spin_unlock(&eurwdt_lock);
+
+ MOD_INC_USE_COUNT;


+
+ return 0;
+

+ case TEMP_MINOR:
+ return 0;
+
+ default:


+ return -ENODEV;
+ }
+}

+
+/**
+ * eurwdt_release:
+ * @inode: inode to board
+ * @file: file handle to board
+ *
+ * The watchdog has a configurable API. There is a religious dispute
+ * between people who want their watchdog to be able to shut down and


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 27'
echo 'File patch-2.4.14 is continued in part 28'
echo "28" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:40 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part17

#!/bin/sh -x
# this is part 17 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 17; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "set Named_obj %p (%4.4s) val = %p\n",


- node, &(node->name), obj_desc));

+ info->field_node, (char*)&(info->field_node->name), obj_desc));
X

+ /* Remove local reference to the object */

X
- /*
- * Store the constructed descriptor (Obj_desc) into the parent Node,
- * preserving the current type of that Named_obj.
- */
- status = acpi_ns_attach_object (node, obj_desc, (u8) acpi_ns_get_type (node));

+ acpi_ut_remove_reference (obj_desc);


X return_ACPI_STATUS (status);
X }
X

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exregion.c linux/drivers/acpi/executer/exregion.c
--- v2.4.13/linux/drivers/acpi/executer/exregion.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exregion.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Module Name: exregion - ACPI default Op_region (address space) handlers
- * $Revision: 58 $
+ * $Revision: 61 $


X *
X *****************************************************************************/
X

@@ -47,7 +47,7 @@
X * Value - Pointer to in or out value
X * Handler_context - Pointer to Handler's context
X * Region_context - Pointer to context specific to the
- * accessed region
+ * accessed region


X *
X * RETURN: Status
X *

@@ -143,7 +143,7 @@
X ((acpi_integer) address - (acpi_integer) mem_info->mapped_physical_address);
X
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "IO %d (%d width) Address=%8.8lX%8.8lX\n", function, bit_width,
+ "System_memory %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
X HIDWORD (address), LODWORD (address)));
X
X /* Perform the memory read or write */
@@ -207,7 +207,7 @@
X * Value - Pointer to in or out value
X * Handler_context - Pointer to Handler's context
X * Region_context - Pointer to context specific to the
- * accessed region
+ * accessed region


X *
X * RETURN: Status
X *

@@ -231,7 +231,7 @@
X

X
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "IO %d (%d width) Address=%8.8lX%8.8lX\n", function, bit_width,
+ "System_iO %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
X HIDWORD (address), LODWORD (address)));
X
X /* Decode the function parameter */
@@ -270,7 +270,7 @@
X * Value - Pointer to in or out value
X * Handler_context - Pointer to Handler's context
X * Region_context - Pointer to context specific to the
- * accessed region
+ * accessed region


X *
X * RETURN: Status
X *

@@ -311,7 +311,7 @@
X pci_register = (u16) address;
X
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "IO %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
+ "Pci_config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
X function, bit_width, pci_id->segment, pci_id->bus, pci_id->device,
X pci_id->function, pci_register));
X
@@ -335,6 +335,80 @@
X status = AE_BAD_PARAMETER;
X break;
X }


+
+ return_ACPI_STATUS (status);
+}
+
+
+/*******************************************************************************
+ *

+ * FUNCTION: Acpi_ex_cmos_space_handler
+ *
+ * PARAMETERS: Function - Read or Write operation
+ * Address - Where in the space to read or write
+ * Bit_width - Field width in bits (8, 16, or 32)
+ * Value - Pointer to in or out value
+ * Handler_context - Pointer to Handler's context
+ * Region_context - Pointer to context specific to the
+ * accessed region


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Handler for the CMOS address space (Op Region)


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_cmos_space_handler (
+ u32 function,
+ ACPI_PHYSICAL_ADDRESS address,
+ u32 bit_width,
+ u32 *value,
+ void *handler_context,
+ void *region_context)
+{


+ acpi_status status = AE_OK;
+
+

+ FUNCTION_TRACE ("Ex_cmos_space_handler");


+
+
+ return_ACPI_STATUS (status);
+}
+
+
+/*******************************************************************************
+ *

+ * FUNCTION: Acpi_ex_pci_bar_space_handler
+ *
+ * PARAMETERS: Function - Read or Write operation
+ * Address - Where in the space to read or write
+ * Bit_width - Field width in bits (8, 16, or 32)
+ * Value - Pointer to in or out value
+ * Handler_context - Pointer to Handler's context
+ * Region_context - Pointer to context specific to the
+ * accessed region


+ *
+ * RETURN: Status
+ *

+ * DESCRIPTION: Handler for the PCI Bar_target address space (Op Region)


+ *
+ ******************************************************************************/
+
+acpi_status

+acpi_ex_pci_bar_space_handler (
+ u32 function,
+ ACPI_PHYSICAL_ADDRESS address,
+ u32 bit_width,
+ u32 *value,
+ void *handler_context,
+ void *region_context)
+{


+ acpi_status status = AE_OK;
+
+

+ FUNCTION_TRACE ("Ex_pci_bar_space_handler");
+
X
X return_ACPI_STATUS (status);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exresnte.c linux/drivers/acpi/executer/exresnte.c
--- v2.4.13/linux/drivers/acpi/executer/exresnte.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exresnte.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Module Name: exresnte - AML Interpreter object resolution


- * $Revision: 41 $

+ * $Revision: 43 $


X *
X *****************************************************************************/
X

@@ -43,14 +43,15 @@
X *
X * FUNCTION: Acpi_ex_resolve_node_to_value
X *
- * PARAMETERS: Stack_ptr - Pointer to a location on a stack that contains
- * a pointer to a Node


- * Walk_state - Current state

+ * PARAMETERS: Object_ptr - Pointer to a location that contains
+ * a pointer to a NS node, and will recieve a
+ * pointer to the resolved object.
+ * Walk_state - Current state. Valid only if executing AML
+ * code. NULL if simply resolving an object


X *
X * RETURN: Status
X *

- * DESCRIPTION: Resolve a Namespace node (AKA a "direct name pointer") to
- * a valued object
+ * DESCRIPTION: Resolve a Namespace node to a valued object
X *
X * Note: for some of the data types, the pointer attached to the Node
X * can be either a pointer to an actual internal object or a pointer into the
@@ -66,12 +67,12 @@
X
X acpi_status
X acpi_ex_resolve_node_to_value (
- acpi_namespace_node **stack_ptr,
+ acpi_namespace_node **object_ptr,
X acpi_walk_state *walk_state)
X

X {
X acpi_status status = AE_OK;

- acpi_operand_object *val_desc;
+ acpi_operand_object *source_desc;
X acpi_operand_object *obj_desc = NULL;
X acpi_namespace_node *node;
X acpi_object_type8 entry_type;
@@ -85,12 +86,12 @@
X * The stack pointer points to a acpi_namespace_node (Node). Get the
X * object that is attached to the Node.
X */
- node = *stack_ptr;
- val_desc = acpi_ns_get_attached_object (node);
+ node = *object_ptr;
+ source_desc = acpi_ns_get_attached_object (node);
X entry_type = acpi_ns_get_type ((acpi_handle) node);
X
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p Val_desc=%p Type=%X\n",
- node, val_desc, entry_type));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p Source_desc=%p Type=%X\n",
+ node, source_desc, entry_type));
X
X
X /*
@@ -103,7 +104,7 @@
X return_ACPI_STATUS (AE_OK);
X }
X
- if (!val_desc) {
+ if (!source_desc) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object attached to node %p\n",
X node));
X return_ACPI_STATUS (AE_AML_NO_OPERAND);


@@ -117,60 +118,60 @@
X

X case ACPI_TYPE_PACKAGE:
X
- if (ACPI_TYPE_PACKAGE != val_desc->common.type) {
+ if (ACPI_TYPE_PACKAGE != source_desc->common.type) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a Package, type %s\n",
- acpi_ut_get_type_name (val_desc->common.type)));
+ acpi_ut_get_type_name (source_desc->common.type)));


X return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
X }
X

X /* Return an additional reference to the object */
X
- obj_desc = val_desc;
+ obj_desc = source_desc;
X acpi_ut_add_reference (obj_desc);
X break;
X
X
X case ACPI_TYPE_BUFFER:
X
- if (ACPI_TYPE_BUFFER != val_desc->common.type) {
+ if (ACPI_TYPE_BUFFER != source_desc->common.type) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a Buffer, type %s\n",
- acpi_ut_get_type_name (val_desc->common.type)));
+ acpi_ut_get_type_name (source_desc->common.type)));


X return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
X }
X

X /* Return an additional reference to the object */
X
- obj_desc = val_desc;
+ obj_desc = source_desc;
X acpi_ut_add_reference (obj_desc);
X break;
X
X
X case ACPI_TYPE_STRING:
X
- if (ACPI_TYPE_STRING != val_desc->common.type) {
+ if (ACPI_TYPE_STRING != source_desc->common.type) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a String, type %s\n",
- acpi_ut_get_type_name (val_desc->common.type)));
+ acpi_ut_get_type_name (source_desc->common.type)));


X return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
X }
X

X /* Return an additional reference to the object */
X
- obj_desc = val_desc;
+ obj_desc = source_desc;
X acpi_ut_add_reference (obj_desc);
X break;
X
X
X case ACPI_TYPE_INTEGER:
X
- if (ACPI_TYPE_INTEGER != val_desc->common.type) {
+ if (ACPI_TYPE_INTEGER != source_desc->common.type) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a Integer, type %s\n",
- acpi_ut_get_type_name (val_desc->common.type)));
+ acpi_ut_get_type_name (source_desc->common.type)));


X return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
X }
X

X /* Return an additional reference to the object */
X
- obj_desc = val_desc;
+ obj_desc = source_desc;
X acpi_ut_add_reference (obj_desc);
X break;
X
@@ -180,10 +181,10 @@
X case INTERNAL_TYPE_BANK_FIELD:
X case INTERNAL_TYPE_INDEX_FIELD:
X
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Node=%p Val_desc=%p Type=%X\n",
- node, val_desc, entry_type));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Node=%p Source_desc=%p Type=%X\n",
+ node, source_desc, entry_type));
X
- status = acpi_ex_read_data_from_field (val_desc, &obj_desc);
+ status = acpi_ex_read_data_from_field (source_desc, &obj_desc);
X break;
X
X
@@ -200,7 +201,7 @@
X
X /* Return an additional reference to the object */
X
- obj_desc = val_desc;
+ obj_desc = source_desc;
X acpi_ut_add_reference (obj_desc);
X break;
X
@@ -222,7 +223,7 @@
X */
X case INTERNAL_TYPE_REFERENCE:
X
- switch (val_desc->reference.opcode) {
+ switch (source_desc->reference.opcode) {
X
X case AML_ZERO_OP:
X
@@ -241,13 +242,13 @@
X
X case AML_REVISION_OP:
X
- temp_val = ACPI_CA_VERSION;
+ temp_val = ACPI_CA_SUPPORT_LEVEL;


X break;
X
X default:

X
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unsupported reference opcode %X\n",
- val_desc->reference.opcode));
+ source_desc->reference.opcode));
X
X return_ACPI_STATUS (AE_AML_BAD_OPCODE);
X }
@@ -261,9 +262,15 @@
X
X obj_desc->integer.value = temp_val;
X
- /* Truncate value if we are executing from a 32-bit ACPI table */
-
- acpi_ex_truncate_for32bit_table (obj_desc, walk_state);
+ /*
+ * Truncate value if we are executing from a 32-bit ACPI table
+ * AND actually executing AML code. If we are resolving
+ * an object in the namespace via an external call to the
+ * subsystem, we will have a null Walk_state
+ */
+ if (walk_state) {
+ acpi_ex_truncate_for32bit_table (obj_desc, walk_state);
+ }
X break;
X
X
@@ -281,7 +288,7 @@
X
X /* Put the object descriptor on the stack */
X
- *stack_ptr = (void *) obj_desc;
+ *object_ptr = (void *) obj_desc;


X return_ACPI_STATUS (status);
X }
X

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exresolv.c linux/drivers/acpi/executer/exresolv.c
--- v2.4.13/linux/drivers/acpi/executer/exresolv.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exresolv.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Module Name: exresolv - AML Interpreter object resolution
- * $Revision: 99 $
+ * $Revision: 101 $


X *
X *****************************************************************************/
X

@@ -131,12 +131,14 @@
X (result_desc->integer.value >> obj_desc->buffer_field.start_field_bit_offset) & mask;
X
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "** Read from buffer %p byte %ld bit %d width %d addr %p mask %08lx val %08lx\n",
+ "** Read from buffer %p byte %d bit %d width %d addr %p mask %08X val %8.8X%8.8X\n",
X obj_desc->buffer_field.buffer_obj->buffer.pointer,
X obj_desc->buffer_field.base_byte_offset,
X obj_desc->buffer_field.start_field_bit_offset,
X obj_desc->buffer_field.bit_length,
- location, mask, result_desc->integer.value));
+ location, mask,
+ HIDWORD(result_desc->integer.value),
+ LODWORD(result_desc->integer.value)));


X
X return_ACPI_STATUS (AE_OK);
X }

@@ -323,7 +325,7 @@
X break;
X
X case AML_REVISION_OP:
- obj_desc->integer.value = ACPI_CA_VERSION;
+ obj_desc->integer.value = ACPI_CA_SUPPORT_LEVEL;
X break;
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exresop.c linux/drivers/acpi/executer/exresop.c
--- v2.4.13/linux/drivers/acpi/executer/exresop.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exresop.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Module Name: exresop - AML Interpreter operand/object resolution
- * $Revision: 38 $
+ * $Revision: 41 $


X *
X *****************************************************************************/
X

@@ -120,7 +120,7 @@
X
X

X op_info = acpi_ps_get_opcode_info (opcode);
- if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) {
+ if (op_info->class == AML_CLASS_UNKNOWN) {

X return_ACPI_STATUS (AE_AML_BAD_OPCODE);
X }
X
@@ -146,7 +146,7 @@
X */
X while (GET_CURRENT_ARG_TYPE (arg_types)) {
X if (!stack_ptr || !*stack_ptr) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null stack entry at %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null stack entry at %p\n",
X stack_ptr));
X
X return_ACPI_STATUS (AE_AML_INTERNAL);
@@ -183,7 +183,7 @@
X * Decode the Reference
X */


X op_info = acpi_ps_get_opcode_info (opcode);
- if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) {
+ if (op_info->class == AML_CLASS_UNKNOWN) {

X return_ACPI_STATUS (AE_AML_BAD_OPCODE);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exstore.c linux/drivers/acpi/executer/exstore.c
--- v2.4.13/linux/drivers/acpi/executer/exstore.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exstore.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Module Name: exstore - AML Interpreter object store support
- * $Revision: 148 $
+ * $Revision: 150 $


X *
X *****************************************************************************/
X

@@ -42,15 +42,14 @@
X *
X * FUNCTION: Acpi_ex_store
X *
- * PARAMETERS: *Val_desc - Value to be stored
+ * PARAMETERS: *Source_desc - Value to be stored
X * *Dest_desc - Where to store it. Must be an NS node
X * or an acpi_operand_object of type
- * Reference; if the latter the descriptor
- * will be either reused or deleted.
+ * Reference;


X *
X * RETURN: Status
X *

- * DESCRIPTION: Store the value described by Val_desc into the location
+ * DESCRIPTION: Store the value described by Source_desc into the location
X * described by Dest_desc. Called by various interpreter
X * functions to store the result of an operation into
X * the destination operand.
@@ -59,7 +58,7 @@
X
X acpi_status
X acpi_ex_store (
- acpi_operand_object *val_desc,
+ acpi_operand_object *source_desc,
X acpi_operand_object *dest_desc,
X acpi_walk_state *walk_state)
X {
@@ -72,7 +71,7 @@
X
X /* Validate parameters */
X
- if (!val_desc || !dest_desc) {
+ if (!source_desc || !dest_desc) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null pointer\n"));
X return_ACPI_STATUS (AE_AML_NO_OPERAND);
X }
@@ -84,7 +83,7 @@
X * Dest is a namespace node,
X * Storing an object into a Name "container"
X */
- status = acpi_ex_store_object_to_node (val_desc,
+ status = acpi_ex_store_object_to_node (source_desc,
X (acpi_namespace_node *) dest_desc, walk_state);
X
X /* All done, that's it */
@@ -101,7 +100,7 @@
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
X "Destination is not a Reference_obj [%p]\n", dest_desc));
X
- DUMP_STACK_ENTRY (val_desc);
+ DUMP_STACK_ENTRY (source_desc);
X DUMP_STACK_ENTRY (dest_desc);
X DUMP_OPERANDS (&dest_desc, IMODE_EXECUTE, "Ex_store",
X 2, "Target is not a Reference_obj");


@@ -125,7 +124,7 @@
X

X /* Storing an object into a Name "container" */
X
- status = acpi_ex_store_object_to_node (val_desc, ref_desc->reference.object,
+ status = acpi_ex_store_object_to_node (source_desc, ref_desc->reference.object,
X walk_state);
X break;
X
@@ -134,7 +133,7 @@
X
X /* Storing to an Index (pointer into a packager or buffer) */
X
- status = acpi_ex_store_object_to_index (val_desc, ref_desc, walk_state);
+ status = acpi_ex_store_object_to_index (source_desc, ref_desc, walk_state);
X break;
X
X
@@ -144,7 +143,7 @@
X /* Store to a method local/arg */
X
X status = acpi_ds_store_object_to_local (ref_desc->reference.opcode,
- ref_desc->reference.offset, val_desc, walk_state);
+ ref_desc->reference.offset, source_desc, walk_state);
X break;
X
X
@@ -157,39 +156,39 @@
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Write to Debug Object: ****:\n\n"));
X
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %s: ",
- acpi_ut_get_type_name (val_desc->common.type)));
+ acpi_ut_get_type_name (source_desc->common.type)));
X
- switch (val_desc->common.type) {
+ switch (source_desc->common.type) {
X case ACPI_TYPE_INTEGER:
X
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%X (%d)\n",
- (u32) val_desc->integer.value, (u32) val_desc->integer.value));
+ (u32) source_desc->integer.value, (u32) source_desc->integer.value));
X break;
X
X
X case ACPI_TYPE_BUFFER:
X
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length 0x%X\n",
- (u32) val_desc->buffer.length));
+ (u32) source_desc->buffer.length));
X break;
X
X
X case ACPI_TYPE_STRING:
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%s\n", val_desc->string.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%s\n", source_desc->string.pointer));
X break;
X
X
X case ACPI_TYPE_PACKAGE:
X
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Elements - 0x%X\n",
- (u32) val_desc->package.elements));
+ (u32) source_desc->package.elements));
X break;
X
X
X default:
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "@0x%p\n", val_desc));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "@0x%p\n", source_desc));
X break;
X }
X
@@ -224,12 +223,6 @@
X } /* switch (Ref_desc->Reference.Opcode) */
X
X
- /* Always delete the reference descriptor object */
-
- if (ref_desc) {
- acpi_ut_remove_reference (ref_desc);
- }
-


X return_ACPI_STATUS (status);
X }
X

@@ -238,7 +231,7 @@
X *
X * FUNCTION: Acpi_ex_store_object_to_index
X *
- * PARAMETERS: *Val_desc - Value to be stored
+ * PARAMETERS: *Source_desc - Value to be stored
X * *Node - Named object to receive the value


X *
X * RETURN: Status

@@ -249,7 +242,7 @@
X
X acpi_status
X acpi_ex_store_object_to_index (
- acpi_operand_object *val_desc,
+ acpi_operand_object *source_desc,
X acpi_operand_object *dest_desc,
X acpi_walk_state *walk_state)
X {
@@ -278,7 +271,7 @@
X if (dest_desc->reference.target_type == ACPI_TYPE_PACKAGE) {
X /*
X * The object at *(Dest_desc->Reference.Where) is the
- * element within the package that is to be modified.
+ * element within the package that is to be modified.
X */
X obj_desc = *(dest_desc->reference.where);
X if (obj_desc) {
@@ -288,16 +281,12 @@
X *
X * TBD: [Investigate] Should both the src and dest be required
X * to be packages?
- * && (Val_desc->Common.Type == ACPI_TYPE_PACKAGE)
+ * && (Source_desc->Common.Type == ACPI_TYPE_PACKAGE)
X */
X if (obj_desc->common.type == ACPI_TYPE_PACKAGE) {
- /*
- * Take away the reference for being part of a package and
- * delete


- */
- acpi_ut_remove_reference (obj_desc);

- acpi_ut_remove_reference (obj_desc);
+ /* Take away the reference for being part of a package */
X
+ acpi_ut_remove_reference (obj_desc);
X obj_desc = NULL;
X }
X }
@@ -307,9 +296,9 @@
X * If the Obj_desc is NULL, it means that an uninitialized package
X * element has been used as a destination (this is OK), therefore,
X * we must create the destination element to match the type of the
- * source element NOTE: Val_desc can be of any type.
+ * source element NOTE: Source_desccan be of any type.
X */
- obj_desc = acpi_ut_create_internal_object (val_desc->common.type);
+ obj_desc = acpi_ut_create_internal_object (source_desc->common.type);


X if (!obj_desc) {
X return_ACPI_STATUS (AE_NO_MEMORY);
X }

@@ -318,29 +307,25 @@
X * If the source is a package, copy the source to the new dest
X */
X if (ACPI_TYPE_PACKAGE == obj_desc->common.type) {
- status = acpi_ut_copy_ipackage_to_ipackage (val_desc, obj_desc, walk_state);
+ status = acpi_ut_copy_ipackage_to_ipackage (source_desc, obj_desc, walk_state);
X if (ACPI_FAILURE (status)) {
X acpi_ut_remove_reference (obj_desc);


X return_ACPI_STATUS (status);
X }
X }

X
- /*
- * Install the new descriptor into the package and add a
- * reference to the newly created descriptor for now being
- * part of the parent package
- */
+ /* Install the new descriptor into the package */
+
X *(dest_desc->reference.where) = obj_desc;
- acpi_ut_add_reference (obj_desc);
X }
X
X if (ACPI_TYPE_PACKAGE != obj_desc->common.type) {
X /*
X * The destination element is not a package, so we need to
- * convert the contents of the source (Val_desc) and copy into
+ * convert the contents of the source (Source_desc) and copy into
X * the destination (Obj_desc)
X */
- status = acpi_ex_store_object_to_object (val_desc, obj_desc,
+ status = acpi_ex_store_object_to_object (source_desc, obj_desc,
X walk_state);


X if (ACPI_FAILURE (status)) {
X /*

@@ -380,7 +365,7 @@
X * The assignment of the individual elements will be slightly
X * different for each source type.
X */
- switch (val_desc->common.type) {
+ switch (source_desc->common.type) {
X case ACPI_TYPE_INTEGER:
X /*
X * Type is Integer, assign bytewise
@@ -389,7 +374,7 @@
X */
X length = sizeof (acpi_integer);
X for (i = length; i != 0; i--) {
- value = (u8)(val_desc->integer.value >> (MUL_8 (i - 1)));
+ value = (u8)(source_desc->integer.value >> (MUL_8 (i - 1)));
X obj_desc->buffer.pointer[dest_desc->reference.offset] = value;
X }
X break;
@@ -400,9 +385,9 @@
X * Type is Buffer, the Length is in the structure.
X * Just loop through the elements and assign each one in turn.
X */
- length = val_desc->buffer.length;
+ length = source_desc->buffer.length;
X for (i = 0; i < length; i++) {
- value = val_desc->buffer.pointer[i];
+ value = source_desc->buffer.pointer[i];
X obj_desc->buffer.pointer[dest_desc->reference.offset] = value;
X }
X break;
@@ -413,9 +398,9 @@
X * Type is String, the Length is in the structure.
X * Just loop through the elements and assign each one in turn.
X */
- length = val_desc->string.length;
+ length = source_desc->string.length;
X for (i = 0; i < length; i++) {
- value = val_desc->string.pointer[i];
+ value = source_desc->string.pointer[i];
X obj_desc->buffer.pointer[dest_desc->reference.offset] = value;
X }
X break;
@@ -427,7 +412,7 @@
X
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
X "Source must be Number/Buffer/String type, not %X\n",
- val_desc->common.type));
+ source_desc->common.type));
X status = AE_AML_OPERAND_TYPE;
X break;
X }
@@ -548,6 +533,7 @@
X * Source_desc reference count is incremented by Attach_object.
X */
X status = acpi_ns_attach_object (node, target_desc, target_type);
+
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
X "Store %s into %s via Convert/Attach\n",
X acpi_ut_get_type_name (target_desc->common.type),
@@ -564,7 +550,6 @@
X /* No conversions for all other types. Just attach the source object */
X
X status = acpi_ns_attach_object (node, source_desc, source_desc->common.type);
-
X break;
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exutils.c linux/drivers/acpi/executer/exutils.c
--- v2.4.13/linux/drivers/acpi/executer/exutils.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exutils.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Module Name: exutils - interpreter/scanner utilities
- * $Revision: 84 $
+ * $Revision: 85 $


X *
X *****************************************************************************/
X

@@ -265,16 +265,16 @@
X *
X * FUNCTION: Acpi_ex_digits_needed
X *
- * PARAMETERS: val - Value to be represented
- * base - Base of representation
+ * PARAMETERS: Value - Value to be represented
+ * Base - Base of representation
X *
- * RETURN: the number of digits needed to represent val in base
+ * RETURN: the number of digits needed to represent Value in Base


X *
X ******************************************************************************/
X

X u32
X acpi_ex_digits_needed (
- acpi_integer val,
+ acpi_integer value,
X u32 base)
X {
X u32 num_digits = 0;
@@ -289,9 +289,11 @@
X
X else {
X /*
- * acpi_integer is unsigned, which is why we don't worry about the '-'
+ * acpi_integer is unsigned, which is why we don't worry about a '-'
X */
- for (num_digits = 1; (val = ACPI_DIVIDE (val,base)); ++num_digits) { ; }
+ for (num_digits = 1;
+ (acpi_ut_short_divide (&value, base, &value, NULL));
+ ++num_digits) { ; }
X }
X
X return_VALUE (num_digits);
@@ -394,17 +396,18 @@
X {
X u32 count;
X u32 digits_needed;
+ u32 remainder;


X
X
X FUNCTION_ENTRY ();

X
X
X digits_needed = acpi_ex_digits_needed (value, 10);
- out_string[digits_needed] = '\0';
+ out_string[digits_needed] = 0;
X
X for (count = digits_needed; count > 0; count--) {
- out_string[count-1] = (NATIVE_CHAR) ('0' + (ACPI_MODULO (value, 10)));
- value = ACPI_DIVIDE (value, 10);
+ acpi_ut_short_divide (&value, 10, &value, &remainder);
+ out_string[count-1] = (NATIVE_CHAR) ('0' + remainder);
X }
X
X return (AE_OK);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/executer/exxface.c linux/drivers/acpi/executer/exxface.c
--- v2.4.13/linux/drivers/acpi/executer/exxface.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/executer/exxface.c Wed Dec 31 16:00:00 1969
@@ -1,102 +0,0 @@
-
-/******************************************************************************
- *
- * Module Name: exxface - External interpreter interfaces
- * $Revision: 29 $


- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000, 2001 R. Byron Moore
- *
- * This 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 "acpi.h"

-#include "acinterp.h"


-
-
-#define _COMPONENT ACPI_EXECUTER

- MODULE_NAME ("exxface")
-
-#if 0
-
-/*
- * DEFINE_AML_GLOBALS is tested in amlcode.h
- * to determine whether certain global names should be "defined" or only
- * "declared" in the current compilation. This enhances maintainability
- * by enabling a single header file to embody all knowledge of the names
- * in question.
- *
- * Exactly one module of any executable should #define DEFINE_GLOBALS
- * before #including the header files which use this convention. The
- * names in question will be defined and initialized in that module,
- * and declared as extern in all other modules which #include those
- * header files.
- */
-
-#define DEFINE_AML_GLOBALS
-#include "amlcode.h"
-#include "acparser.h"
-#include "acnamesp.h"


-
-
-/*******************************************************************************
- *

- * FUNCTION: Acpi_ex_execute_method
- *
- * PARAMETERS: Pcode - Pointer to the pcode stream
- * Pcode_length - Length of pcode that comprises the method
- * **Params - List of parameters to pass to method,
- * terminated by NULL. Params itself may be
- * NULL if no parameters are being passed.


- *
- * RETURN: Status
- *

- * DESCRIPTION: Execute a control method


- *
- ******************************************************************************/
-
-acpi_status

-acpi_ex_execute_method (
- acpi_namespace_node *method_node,
- acpi_operand_object **params,
- acpi_operand_object **return_obj_desc)
-{


- acpi_status status;
-
-

- FUNCTION_TRACE ("Ex_execute_method");
-
-
- /*
- * The point here is to lock the interpreter and call the low
- * level execute.
- */
- status = acpi_ex_enter_interpreter ();


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

- status = acpi_psx_execute (method_node, params, return_obj_desc);
-
- acpi_ex_exit_interpreter ();
-


- return_ACPI_STATUS (status);
-}
-
-

-#endif
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/hardware/hwacpi.c linux/drivers/acpi/hardware/hwacpi.c
--- v2.4.13/linux/drivers/acpi/hardware/hwacpi.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/hardware/hwacpi.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
- * $Revision: 45 $
+ * $Revision: 46 $


X *
X *****************************************************************************/
X

@@ -220,7 +220,7 @@
X
X /* Give the platform some time to react */
X
- acpi_os_stall (5000);
+ acpi_os_stall (20000);
X
X if (acpi_hw_get_mode () == mode) {
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n", mode));
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/hardware/hwgpe.c linux/drivers/acpi/hardware/hwgpe.c
--- v2.4.13/linux/drivers/acpi/hardware/hwgpe.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/hardware/hwgpe.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Module Name: hwgpe - Low level GPE enable/disable/clear functions
- * $Revision: 32 $
+ * $Revision: 35 $


X *
X *****************************************************************************/
X

@@ -77,6 +77,45 @@
X (in_byte | bit_mask), 8);
X }
X
+/******************************************************************************
+ *
+ * FUNCTION: Acpi_hw_enable_gpe_for_wakeup
+ *
+ * PARAMETERS: Gpe_number - The GPE
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Keep track of which GPEs the OS has requested not be
+ * disabled when going to sleep.


+ *
+ ******************************************************************************/
+

+void
+acpi_hw_enable_gpe_for_wakeup (
+ u32 gpe_number)
+{
+ u32 register_index;
+ u32 bit_mask;


+
+
+ FUNCTION_ENTRY ();

+
+
+ /*
+ * Translate GPE number to index into global registers array.
+ */
+ register_index = acpi_gbl_gpe_valid[gpe_number];
+
+ /*
+ * Figure out the bit offset for this GPE within the target register.
+ */
+ bit_mask = acpi_gbl_decode_to8bit [MOD_8 (gpe_number)];
+
+ /*
+ * Set the bit so we will not disable this when sleeping
+ */
+ acpi_gbl_gpe_registers[register_index].wake_enable |= bit_mask;
+}
X
X /******************************************************************************
X *
@@ -120,8 +159,49 @@
X acpi_os_read_port (acpi_gbl_gpe_registers[register_index].enable_addr, &in_byte, 8);
X acpi_os_write_port (acpi_gbl_gpe_registers[register_index].enable_addr,
X (in_byte & ~bit_mask), 8);
+
+ acpi_hw_disable_gpe_for_wakeup(gpe_number);
X }
X
+/******************************************************************************
+ *
+ * FUNCTION: Acpi_hw_disable_gpe_for_wakeup
+ *
+ * PARAMETERS: Gpe_number - The GPE
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Keep track of which GPEs the OS has requested not be
+ * disabled when going to sleep.


+ *
+ ******************************************************************************/
+

+void
+acpi_hw_disable_gpe_for_wakeup (
+ u32 gpe_number)
+{
+ u32 register_index;
+ u32 bit_mask;


+
+
+ FUNCTION_ENTRY ();

+
+
+ /*
+ * Translate GPE number to index into global registers array.
+ */
+ register_index = acpi_gbl_gpe_valid[gpe_number];
+
+ /*
+ * Figure out the bit offset for this GPE within the target register.
+ */
+ bit_mask = acpi_gbl_decode_to8bit [MOD_8 (gpe_number)];
+
+ /*
+ * Clear the bit so we will disable this when sleeping
+ */
+ acpi_gbl_gpe_registers[register_index].wake_enable &= ~bit_mask;
+}
X
X /******************************************************************************
X *
@@ -215,11 +295,88 @@
X }
X
X /*
+ * Enabled for wake?:
+ */
+ if (bit_mask & acpi_gbl_gpe_registers[register_index].wake_enable) {
+ (*event_status) |= ACPI_EVENT_FLAG_WAKE_ENABLED;
+ }
+
+ /*
X * Set?
X */
X in_byte = 0;
X acpi_os_read_port (acpi_gbl_gpe_registers[register_index].status_addr, &in_byte, 8);
X if (bit_mask & in_byte) {
X (*event_status) |= ACPI_EVENT_FLAG_SET;
+ }
+}
+
+/******************************************************************************
+ *
+ * FUNCTION: Acpi_hw_disable_non_wakeup_gpes
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Disable all non-wakeup GPEs
+ * Call with interrupts disabled. The interrupt handler also
+ * modifies Acpi_gbl_Gpe_registers[i].Enable, so it should not be
+ * given the chance to run until after non-wake GPEs are
+ * re-enabled.


+ *
+ ******************************************************************************/
+

+void
+acpi_hw_disable_non_wakeup_gpes (
+ void)
+{
+ u32 i;
+
+ FUNCTION_ENTRY ();
+
+ for (i = 0; i < acpi_gbl_gpe_register_count; i++) {
+ /*
+ * Read the enabled status of all GPEs. We
+ * will be using it to restore all the GPEs later.
+ */
+ acpi_os_read_port (acpi_gbl_gpe_registers[i].enable_addr,
+ &acpi_gbl_gpe_registers[i].enable, 8);
+
+ /*
+ * Disable all GPEs but wakeup GPEs.
+ */
+ acpi_os_write_port(acpi_gbl_gpe_registers[i].enable_addr,
+ acpi_gbl_gpe_registers[i].wake_enable, 8);
+ }
+}
+
+/******************************************************************************
+ *
+ * FUNCTION: Acpi_hw_enable_non_wakeup_gpes
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Enable all non-wakeup GPEs we previously enabled.


+ *
+ ******************************************************************************/
+

+void
+acpi_hw_enable_non_wakeup_gpes (
+ void)
+{
+ u32 i;
+
+ FUNCTION_ENTRY ();
+
+ for (i = 0; i < acpi_gbl_gpe_register_count; i++) {
+ /*
+ * We previously stored the enabled status of all GPEs.
+ * Blast them back in.
+ */
+ acpi_os_write_port(acpi_gbl_gpe_registers[i].enable_addr,
+ acpi_gbl_gpe_registers[i].enable, 8);
X }
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/hardware/hwregs.c linux/drivers/acpi/hardware/hwregs.c
--- v2.4.13/linux/drivers/acpi/hardware/hwregs.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/hardware/hwregs.c Wed Oct 24 14:06:22 2001
@@ -3,7 +3,7 @@
X *
X * Module Name: hwregs - Read/write access functions for the various ACPI
X * control and status registers.
- * $Revision: 109 $
+ * $Revision: 110 $


X *
X ******************************************************************************/
X

@@ -453,8 +453,9 @@
X
X register_value = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, PM2_CONTROL);
X
- ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %p\n",
- register_value, ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm2_cnt_blk.address)));
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %8.8X%8.8X\n",
+ register_value, HIDWORD(acpi_gbl_FADT->Xpm2_cnt_blk.address),
+ LODWORD(acpi_gbl_FADT->Xpm2_cnt_blk.address)));
X
X if (read_write == ACPI_WRITE) {
X register_value &= ~mask;
@@ -462,8 +463,10 @@
X value &= mask;
X register_value |= value;
X
- ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %p\n", register_value,
- acpi_gbl_FADT->Xpm2_cnt_blk.address));
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %8.8X%8.8X\n",
+ register_value,
+ HIDWORD(acpi_gbl_FADT->Xpm2_cnt_blk.address),
+ LODWORD(acpi_gbl_FADT->Xpm2_cnt_blk.address)));
X
X acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK,
X PM2_CONTROL, (u8) (register_value));
@@ -476,8 +479,10 @@
X mask = TMR_VAL_MASK;
X register_value = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK,
X PM_TIMER);
- ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM_TIMER: Read %X from %p\n",
- register_value, ACPI_GET_ADDRESS (acpi_gbl_FADT->Xpm_tmr_blk.address)));
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM_TIMER: Read %X from %8.8X%8.8X\n",
+ register_value,
+ HIDWORD(acpi_gbl_FADT->Xpm_tmr_blk.address),
+ LODWORD(acpi_gbl_FADT->Xpm_tmr_blk.address)));
X
X break;
X
@@ -732,13 +737,13 @@
X break;
X
X
- case PM1_a_CONTROL: /* 16-bit access */
+ case PM1A_CONTROL: /* 16-bit access */
X
X acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_cnt_blk, 0);
X break;
X
X
- case PM1_b_CONTROL: /* 16-bit access */
+ case PM1B_CONTROL: /* 16-bit access */
X
X acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_cnt_blk, 0);
X break;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/hardware/hwsleep.c linux/drivers/acpi/hardware/hwsleep.c
--- v2.4.13/linux/drivers/acpi/hardware/hwsleep.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/hardware/hwsleep.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
- * $Revision: 21 $
+ * $Revision: 22 $


X *
X *****************************************************************************/
X

@@ -137,8 +137,8 @@
X acpi_object arg;
X u8 type_a;
X u8 type_b;
- u16 PM1_acontrol;
- u16 PM1_bcontrol;
+ u16 PM1Acontrol;
+ u16 PM1Bcontrol;
X
X
X FUNCTION_TRACE ("Acpi_enter_sleep_state");
@@ -171,31 +171,31 @@
X
X disable ();
X
- /* TODO: disable all non-wake GPEs here */
+ acpi_hw_disable_non_wakeup_gpes();
X
- PM1_acontrol = (u16) acpi_hw_register_read (ACPI_MTX_LOCK, PM1_CONTROL);
+ PM1Acontrol = (u16) acpi_hw_register_read (ACPI_MTX_LOCK, PM1_CONTROL);
X
X ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Entering S%d\n", sleep_state));
X
X /* mask off SLP_EN and SLP_TYP fields */
X
- PM1_acontrol &= ~(SLP_TYPE_X_MASK | SLP_EN_MASK);
- PM1_bcontrol = PM1_acontrol;
+ PM1Acontrol &= ~(SLP_TYPE_X_MASK | SLP_EN_MASK);
+ PM1Bcontrol = PM1Acontrol;
X
X /* mask in SLP_TYP */
X
- PM1_acontrol |= (type_a << acpi_hw_get_bit_shift (SLP_TYPE_X_MASK));
- PM1_bcontrol |= (type_b << acpi_hw_get_bit_shift (SLP_TYPE_X_MASK));
+ PM1Acontrol |= (type_a << acpi_hw_get_bit_shift (SLP_TYPE_X_MASK));
+ PM1Bcontrol |= (type_b << acpi_hw_get_bit_shift (SLP_TYPE_X_MASK));
X
X /* write #1: fill in SLP_TYP data */
X
- acpi_hw_register_write (ACPI_MTX_LOCK, PM1_a_CONTROL, PM1_acontrol);
- acpi_hw_register_write (ACPI_MTX_LOCK, PM1_b_CONTROL, PM1_bcontrol);
+ acpi_hw_register_write (ACPI_MTX_LOCK, PM1A_CONTROL, PM1Acontrol);
+ acpi_hw_register_write (ACPI_MTX_LOCK, PM1B_CONTROL, PM1Bcontrol);
X
X /* mask in SLP_EN */
X
- PM1_acontrol |= (1 << acpi_hw_get_bit_shift (SLP_EN_MASK));
- PM1_bcontrol |= (1 << acpi_hw_get_bit_shift (SLP_EN_MASK));
+ PM1Acontrol |= (1 << acpi_hw_get_bit_shift (SLP_EN_MASK));
+ PM1Bcontrol |= (1 << acpi_hw_get_bit_shift (SLP_EN_MASK));
X
X /* flush caches */
X
@@ -203,8 +203,8 @@
X
X /* write #2: SLP_TYP + SLP_EN */
X
- acpi_hw_register_write (ACPI_MTX_LOCK, PM1_a_CONTROL, PM1_acontrol);
- acpi_hw_register_write (ACPI_MTX_LOCK, PM1_b_CONTROL, PM1_bcontrol);
+ acpi_hw_register_write (ACPI_MTX_LOCK, PM1A_CONTROL, PM1Acontrol);
+ acpi_hw_register_write (ACPI_MTX_LOCK, PM1B_CONTROL, PM1Bcontrol);
X
X /*
X * Wait a second, then try again. This is to get S4/5 to work on all machines.
@@ -223,6 +223,8 @@
X }
X while (!acpi_hw_register_bit_access (ACPI_READ, ACPI_MTX_LOCK, WAK_STS));
X
+ acpi_hw_enable_non_wakeup_gpes();
+
X enable ();
X
X return_ACPI_STATUS (AE_OK);
@@ -264,7 +266,7 @@
X
X /* _WAK returns stuff - do we want to look at it? */
X
- /* Re-enable GPEs */
+ acpi_hw_enable_non_wakeup_gpes();
X
X return_ACPI_STATUS (AE_OK);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/hardware/hwtimer.c linux/drivers/acpi/hardware/hwtimer.c
--- v2.4.13/linux/drivers/acpi/hardware/hwtimer.c Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/hardware/hwtimer.c Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Name: hwtimer.c - ACPI Power Management Timer Interface
- * $Revision: 12 $
+ * $Revision: 14 $


X *
X *****************************************************************************/
X

@@ -47,19 +47,9 @@
X acpi_get_timer_resolution (
X u32 *resolution)
X {


- acpi_status status;
-
-

X FUNCTION_TRACE ("Acpi_get_timer_resolution");


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);

- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X if (!resolution) {
X return_ACPI_STATUS (AE_BAD_PARAMETER);
X }
@@ -92,18 +82,8 @@
X acpi_get_timer (
X u32 *ticks)
X {


- acpi_status status;
-
-

X FUNCTION_TRACE ("Acpi_get_timer");


X
-
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);

- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }

X
X if (!ticks) {
X return_ACPI_STATUS (AE_BAD_PARAMETER);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acconfig.h linux/drivers/acpi/include/acconfig.h
--- v2.4.13/linux/drivers/acpi/include/acconfig.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acconfig.h Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /******************************************************************************
X *
X * Name: acconfig.h - Global configuration constants
- * $Revision: 69 $
+ * $Revision: 74 $


X *
X *****************************************************************************/
X

@@ -53,7 +53,11 @@
X
X /* Version string */
X
-#define ACPI_CA_VERSION 0x20010831
+#define ACPI_CA_VERSION 0x20011018
+
+/* Version of ACPI supported */
+
+#define ACPI_CA_SUPPORT_LEVEL 2
X
X
X /* Maximum objects in the various object caches */


@@ -78,7 +82,7 @@
X

X /* Max reference count (for debug only) */
X
-#define MAX_REFERENCE_COUNT 0x200
+#define MAX_REFERENCE_COUNT 0x400
X
X
X /* Size of cached memory mapping for system memory operation region */
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acdebug.h linux/drivers/acpi/include/acdebug.h
--- v2.4.13/linux/drivers/acpi/include/acdebug.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acdebug.h Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /******************************************************************************
X *
X * Name: acdebug.h - ACPI/AML debugger
- * $Revision: 47 $
+ * $Revision: 50 $


X *
X *****************************************************************************/
X

@@ -35,7 +35,7 @@
X
X extern int optind;
X extern NATIVE_CHAR *optarg;
-extern u8 *aml_ptr;
+extern u8 *aml_start;
X extern u32 aml_length;
X
X extern u8 acpi_gbl_db_opt_tables;
@@ -57,6 +57,7 @@
X extern u8 acpi_gbl_db_output_flags;
X extern u32 acpi_gbl_db_debug_level;
X extern u32 acpi_gbl_db_console_debug_level;
+extern acpi_table_header *acpi_gbl_db_table_ptr;
X
X /*
X * Statistic globals
@@ -119,11 +120,15 @@
X acpi_db_initialize (
X void);
X
+void
+acpi_db_terminate (
+ void);
+
X acpi_status
X acpi_db_single_step (
X acpi_walk_state *walk_state,


X acpi_parse_object *op,
- u8 op_type);

+ u32 op_type);
X
X
X /*
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acdispat.h linux/drivers/acpi/include/acdispat.h
--- v2.4.13/linux/drivers/acpi/include/acdispat.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acdispat.h Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /******************************************************************************
X *
X * Name: acdispat.h - dispatcher (parser to interpreter interface)
- * $Revision: 40 $
+ * $Revision: 45 $


X *
X *****************************************************************************/
X

@@ -86,25 +86,20 @@


X acpi_status
X acpi_ds_get_predicate_value (
X acpi_walk_state *walk_state,
- acpi_parse_object *op,

X u32 has_result_obj);
X
X acpi_status
X acpi_ds_exec_begin_op (
- u16 opcode,


- acpi_parse_object *op,
X acpi_walk_state *walk_state,
X acpi_parse_object **out_op);
X

X acpi_status
X acpi_ds_exec_end_op (

- acpi_walk_state *state,
- acpi_parse_object *op);
+ acpi_walk_state *state);
X
X
X /* dsfield - Parser/Interpreter interface for AML fields */
X
-
X acpi_status
X acpi_ds_create_field (
X acpi_parse_object *op,
@@ -123,44 +118,36 @@


X acpi_namespace_node *region_node,
X acpi_walk_state *walk_state);
X

+acpi_status
+acpi_ds_create_buffer_field (
+ acpi_parse_object *op,
+ acpi_walk_state *walk_state);
+
X
X /* dsload - Parser/Interpreter interface, namespace load callbacks */
X
X acpi_status
X acpi_ds_load1_begin_op (
- u16 opcode,


- acpi_parse_object *op,
X acpi_walk_state *walk_state,
X acpi_parse_object **out_op);
X

X acpi_status
X acpi_ds_load1_end_op (
- acpi_walk_state *walk_state,
- acpi_parse_object *op);

+ acpi_walk_state *walk_state);
X
X acpi_status
X acpi_ds_load2_begin_op (
- u16 opcode,


- acpi_parse_object *op,
X acpi_walk_state *walk_state,
X acpi_parse_object **out_op);
X

X acpi_status
X acpi_ds_load2_end_op (

- acpi_walk_state *state,
- acpi_parse_object *op);
+ acpi_walk_state *walk_state);
X
X acpi_status
-acpi_ds_load3_begin_op (
- u16 opcode,
- acpi_parse_object *op,
+acpi_ds_init_callbacks (
X acpi_walk_state *walk_state,
- acpi_parse_object **out_op);
-
-acpi_status
-acpi_ds_load3_end_op (
- acpi_walk_state *state,
- acpi_parse_object *op);
+ u32 pass_number);
X
X
X /* dsmthdat - method data (locals/args) */
@@ -374,7 +361,7 @@


X acpi_walk_state *walk_state);
X
X

-/* Acpi_dswstate - parser WALK_STATE management routines */
+/* dswstate - parser WALK_STATE management routines */
X
X acpi_walk_state *
X acpi_ds_create_walk_state (
@@ -384,6 +371,17 @@
X acpi_walk_list *walk_list);
X
X acpi_status


+acpi_ds_init_aml_walk (
+ acpi_walk_state *walk_state,
+ acpi_parse_object *op,
+ acpi_namespace_node *method_node,
+ u8 *aml_start,
+ u32 aml_length,
+ acpi_operand_object **params,
+ acpi_operand_object **return_obj_desc,
+ u32 pass_number);
+

+acpi_status
X acpi_ds_obj_stack_delete_all (
X acpi_walk_state *walk_state);
X
@@ -398,6 +396,11 @@
X
X acpi_walk_state *
X acpi_ds_pop_walk_state (
+ acpi_walk_list *walk_list);
+
+void
+acpi_ds_push_walk_state (
+ acpi_walk_state *walk_state,
X acpi_walk_list *walk_list);
X
X acpi_status
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acevents.h linux/drivers/acpi/include/acevents.h
--- v2.4.13/linux/drivers/acpi/include/acevents.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acevents.h Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /******************************************************************************
X *
X * Name: acevents.h - Event subcomponent prototypes and defines
- * $Revision: 65 $
+ * $Revision: 66 $


X *
X *****************************************************************************/
X

@@ -157,6 +157,20 @@
X
X acpi_status
X acpi_ev_pci_config_region_setup (


+ acpi_handle handle,
+ u32 function,
+ void *handler_context,
+ void **region_context);
+

+acpi_status
+acpi_ev_cmos_region_setup (
+ acpi_handle handle,
+ u32 function,
+ void *handler_context,
+ void **region_context);
+

+acpi_status
+acpi_ev_pci_bar_region_setup (
X acpi_handle handle,
X u32 function,
X void *handler_context,
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acglobal.h linux/drivers/acpi/include/acglobal.h
--- v2.4.13/linux/drivers/acpi/include/acglobal.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acglobal.h Wed Oct 24 14:06:22 2001
@@ -94,7 +94,7 @@
X * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
X * (The table maps local handles to the real OS handles)
X */
-ACPI_EXTERN ACPI_MUTEX_INFO acpi_gbl_acpi_mutex_info [NUM_MTX];
+ACPI_EXTERN acpi_mutex_info acpi_gbl_acpi_mutex_info [NUM_MTX];
X
X
X /*****************************************************************************


@@ -172,7 +172,7 @@
X

X /* Address Space handlers */
X
-ACPI_EXTERN ACPI_ADR_SPACE_INFO acpi_gbl_address_spaces[ACPI_NUM_ADDRESS_SPACES];
+ACPI_EXTERN acpi_adr_space_info acpi_gbl_address_spaces[ACPI_NUM_ADDRESS_SPACES];
X
X /* Control method single step flag */
X
@@ -194,10 +194,10 @@


X *
X ****************************************************************************/
X

-ACPI_EXTERN ACPI_FIXED_EVENT_INFO acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
+ACPI_EXTERN acpi_fixed_event_info acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
X ACPI_EXTERN acpi_handle acpi_gbl_gpe_obj_handle;
X ACPI_EXTERN u32 acpi_gbl_gpe_register_count;
-ACPI_EXTERN ACPI_GPE_REGISTERS *acpi_gbl_gpe_registers;
+ACPI_EXTERN acpi_gpe_registers *acpi_gbl_gpe_registers;
X ACPI_EXTERN acpi_gpe_level_info *acpi_gbl_gpe_info;
X
X /*
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/achware.h linux/drivers/acpi/include/achware.h
--- v2.4.13/linux/drivers/acpi/include/achware.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/achware.h Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /******************************************************************************
X *
X * Name: achware.h -- hardware specific interfaces


- * $Revision: 55 $

+ * $Revision: 56 $


X *
X *****************************************************************************/
X

@@ -105,20 +105,37 @@
X
X void
X acpi_hw_enable_gpe (
- u32 gpe_index);
+ u32 gpe_number);
+
+void
+acpi_hw_enable_gpe_for_wakeup (
+ u32 gpe_number);
X
X void
X acpi_hw_disable_gpe (
- u32 gpe_index);
+ u32 gpe_number);
+
+void
+acpi_hw_disable_gpe_for_wakeup (
+ u32 gpe_number);
X
X void
X acpi_hw_clear_gpe (
- u32 gpe_index);
+ u32 gpe_number);
X
X void
X acpi_hw_get_gpe_status (
X u32 gpe_number,
X acpi_event_status *event_status);
+
+void
+acpi_hw_disable_non_wakeup_gpes (
+ void);
+
+void
+acpi_hw_enable_non_wakeup_gpes (
+ void);
+
X
X /* Sleep Prototypes */
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acinterp.h linux/drivers/acpi/include/acinterp.h
--- v2.4.13/linux/drivers/acpi/include/acinterp.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acinterp.h Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /******************************************************************************
X *
X * Name: acinterp.h - Interpreter subcomponent prototypes and defines
- * $Revision: 106 $
+ * $Revision: 116 $


X *
X *****************************************************************************/
X

@@ -179,51 +179,75 @@
X */
X
X acpi_status
-acpi_ex_triadic (


- u16 opcode,
- acpi_walk_state *walk_state,

- acpi_operand_object **return_desc);
+acpi_ex_opcode_3A_0T_0R (
+ acpi_walk_state *walk_state);
X
X acpi_status
-acpi_ex_hexadic (


- u16 opcode,
- acpi_walk_state *walk_state,

- acpi_operand_object **return_desc);
+acpi_ex_opcode_3A_1T_1R (
+ acpi_walk_state *walk_state);
X
X acpi_status


-acpi_ex_create_buffer_field (
- u8 *aml_ptr,
- u32 aml_length,
- acpi_namespace_node *node,

+acpi_ex_opcode_6A_0T_1R (


X acpi_walk_state *walk_state);
X
X acpi_status

-acpi_ex_reconfiguration (
- u16 opcode,

+acpi_ex_get_object_reference (
+ acpi_operand_object *obj_desc,
+ acpi_operand_object **return_desc,

X acpi_walk_state *walk_state);
X
X acpi_status

+acpi_ex_do_concatenate (
+ acpi_operand_object *obj_desc,
+ acpi_operand_object *obj_desc2,
+ acpi_operand_object **actual_return_desc,

+ acpi_walk_state *walk_state);


+
+u8
+acpi_ex_do_logical_op (
+ u16 opcode,
+ acpi_integer operand0,
+ acpi_integer operand1);
+

+acpi_integer
+acpi_ex_do_math_op (
+ u16 opcode,
+ acpi_integer operand0,
+ acpi_integer operand1);
+

+acpi_status
+acpi_ex_load_op (
+ acpi_operand_object *rgn_desc,
+ acpi_operand_object *ddb_handle);
+
+acpi_status
+acpi_ex_unload_table (
+ acpi_operand_object *ddb_handle);
+
+acpi_status
X acpi_ex_create_mutex (


X acpi_walk_state *walk_state);
X
X acpi_status

X acpi_ex_create_processor (
- acpi_parse_object *op,
- acpi_namespace_node *processor_node);
+ acpi_walk_state *walk_state);
X

X acpi_status
X acpi_ex_create_power_resource (
- acpi_parse_object *op,
- acpi_namespace_node *power_node);

+ acpi_walk_state *walk_state);


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 17'
echo 'File patch-2.4.14 is continued in part 18'
echo "18" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:43 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part20

#!/bin/sh -x
# this is part 20 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 20; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X *
- * FUNCTION: Acpi_get_next_object
+ * FUNCTION: Acpi_ns_get_next_node
X *
- * PARAMETERS: Type - Type of object to be searched for
- * Parent - Parent object whose children we are
- * getting
- * Last_child - Previous child that was found.
+ * PARAMETERS: Type - Type of node to be searched for
+ * Parent_node - Parent node whose children we are
+ * getting
+ * Child_node - Previous child that was found.
X * The NEXT child will be returned
X *
X * RETURN: acpi_namespace_node - Pointer to the NEXT child or NULL if
- * none is found.
+ * none is found.
X *
- * DESCRIPTION: Return the next peer object within the namespace. If Handle
- * is valid, Scope is ignored. Otherwise, the first object
+ * DESCRIPTION: Return the next peer node within the namespace. If Handle
+ * is valid, Scope is ignored. Otherwise, the first node
X * within Scope is returned.
X *
- ****************************************************************************/
+ ******************************************************************************/
X
X acpi_namespace_node *
-acpi_ns_get_next_object (
+acpi_ns_get_next_node (
X acpi_object_type8 type,
X acpi_namespace_node *parent_node,
X acpi_namespace_node *child_node)
@@ -73,12 +73,11 @@
X }
X
X else {
- /* Start search at the NEXT object */
+ /* Start search at the NEXT node */
X
- next_node = acpi_ns_get_next_valid_object (child_node);
+ next_node = acpi_ns_get_next_valid_node (child_node);
X }
X
-
X /* If any type is OK, we are done */
X
X if (type == ACPI_TYPE_ANY) {
@@ -87,8 +86,7 @@
X return (next_node);
X }
X
-
- /* Must search for the object -- but within this scope only */
+ /* Must search for the node -- but within this scope only */
X
X while (next_node) {
X /* If type matches, we are done */
@@ -97,19 +95,18 @@
X return (next_node);
X }
X
- /* Otherwise, move on to the next object */
+ /* Otherwise, move on to the next node */
X
- next_node = acpi_ns_get_next_valid_object (next_node);
+ next_node = acpi_ns_get_next_valid_node (next_node);
X }
X
-
X /* Not found */
X
X return (NULL);
X }
X
X
-/******************************************************************************
+/*******************************************************************************
X *
X * FUNCTION: Acpi_ns_walk_namespace
X *
@@ -120,13 +117,13 @@
X * the callback routine
X * User_function - Called when an object of "Type" is found
X * Context - Passed to user function
- *
- * RETURNS Return value from the User_function if terminated early.
- * Otherwise, returns NULL.
+ * Return_value - from the User_function if terminated early.
+ * Otherwise, returns NULL.
+ * RETURNS: Status
X *
X * DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
- * starting (and ending) at the object specified by Start_handle.
- * The User_function is called whenever an object that matches
+ * starting (and ending) at the node specified by Start_handle.
+ * The User_function is called whenever a node that matches
X * the type parameter is found. If the user function returns
X * a non-zero value, the search is terminated immediately and this
X * value is returned to the caller.
@@ -145,7 +142,7 @@
X acpi_handle start_node,
X u32 max_depth,
X u8 unlock_before_callback,
- ACPI_WALK_CALLBACK user_function,
+ acpi_walk_callback user_function,
X void *context,
X void **return_value)
X {
@@ -165,32 +162,26 @@
X start_node = acpi_gbl_root_node;
X }
X
-
- /* Null child means "get first object" */
+ /* Null child means "get first node" */
X
X parent_node = start_node;
- child_node = 0;
+ child_node = 0;
X child_type = ACPI_TYPE_ANY;
X level = 1;
X
X /*
- * Traverse the tree of objects until we bubble back up to where we
+ * Traverse the tree of nodes until we bubble back up to where we
X * started. When Level is zero, the loop is done because we have
X * bubbled up to (and passed) the original parent handle (Start_entry)
X */
X while (level > 0) {
- /*
- * Get the next typed object in this scope. Null returned
- * if not found
- */
- status = AE_OK;
- child_node = acpi_ns_get_next_object (ACPI_TYPE_ANY,
- parent_node,
- child_node);
+ /* Get the next node in this scope. Null if not found */
X
+ status = AE_OK;
+ child_node = acpi_ns_get_next_node (ACPI_TYPE_ANY, parent_node, child_node);
X if (child_node) {
X /*
- * Found an object, Get the type if we are not
+ * Found node, Get the type if we are not
X * searching for ANY
X */
X if (type != ACPI_TYPE_ANY) {
@@ -199,7 +190,7 @@
X
X if (child_type == type) {
X /*
- * Found a matching object, invoke the user
+ * Found a matching node, invoke the user
X * callback function
X */
X if (unlock_before_callback) {
@@ -245,11 +236,10 @@
X * maximum depth has been reached.
X */
X if ((level < max_depth) && (status != AE_CTRL_DEPTH)) {
- if (acpi_ns_get_next_object (ACPI_TYPE_ANY,
- child_node, 0)) {
+ if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, 0)) {
X /*
X * There is at least one child of this
- * object, visit the object
+ * node, visit the onde
X */
X level++;
X parent_node = child_node;
@@ -260,9 +250,9 @@


X
X else {
X /*

- * No more children in this object (Acpi_ns_get_next_object
+ * No more children of this node (Acpi_ns_get_next_node
X * failed), go back upwards in the namespace tree to
- * the object's parent.
+ * the node's parent.
X */
X level--;
X child_node = parent_node;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nsxfname.c linux/drivers/acpi/namespace/nsxfname.c
--- v2.4.13/linux/drivers/acpi/namespace/nsxfname.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nsxfname.c Wed Oct 24 14:06:22 2001
@@ -2,7 +2,7 @@
X *
X * Module Name: nsxfname - Public interfaces to the ACPI subsystem
X * ACPI Namespace oriented interfaces


- * $Revision: 80 $

+ * $Revision: 82 $


X *
X *****************************************************************************/
X

@@ -70,13 +70,6 @@


X FUNCTION_ENTRY ();
X
X

- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {

- return (status);
- }
-
X /* Parameter Validation */
X
X if (!ret_handle || !pathname) {
@@ -88,7 +81,7 @@
X if (parent) {
X acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
X
- prefix_node = acpi_ns_convert_handle_to_entry (parent);
+ prefix_node = acpi_ns_map_handle_to_node (parent);
X if (!prefix_node) {
X acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
X return (AE_BAD_PARAMETER);
@@ -144,13 +137,6 @@
X acpi_namespace_node *node;


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {

- return (status);
- }
-
X /* Buffer pointer must be valid always */
X
X if (!ret_path_ptr || (name_type > ACPI_NAME_TYPE_MAX)) {
@@ -177,7 +163,7 @@
X * Validate handle and convert to an Node
X */
X acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
- node = acpi_ns_convert_handle_to_entry (handle);
+ node = acpi_ns_map_handle_to_node (handle);
X if (!node) {
X status = AE_BAD_PARAMETER;
X goto unlock_and_exit;
@@ -226,21 +212,14 @@
X acpi_handle handle,
X acpi_device_info *info)
X {
- ACPI_DEVICE_ID hid;
- ACPI_DEVICE_ID uid;
+ acpi_device_id hid;
+ acpi_device_id uid;
X acpi_status status;
X u32 device_status = 0;
X acpi_integer address = 0;
X acpi_namespace_node *node;


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {

- return (status);
- }
-


X /* Parameter validation */
X

X if (!handle || !info) {
@@ -249,7 +228,7 @@
X
X acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
X
- node = acpi_ns_convert_handle_to_entry (handle);
+ node = acpi_ns_map_handle_to_node (handle);
X if (!node) {
X acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
X return (AE_BAD_PARAMETER);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nsxfobj.c linux/drivers/acpi/namespace/nsxfobj.c
--- v2.4.13/linux/drivers/acpi/namespace/nsxfobj.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nsxfobj.c Wed Oct 24 14:06:22 2001
@@ -2,7 +2,7 @@
X *
X * Module Name: nsxfobj - Public interfaces to the ACPI subsystem
X * ACPI Object oriented interfaces
- * $Revision: 90 $
+ * $Revision: 95 $


X *
X ******************************************************************************/
X

@@ -41,12 +41,10 @@
X *
X * PARAMETERS: Handle - Object handle (optional)
X * *Pathname - Object pathname (optional)


- * **Params - List of parameters to pass to

- * method, terminated by NULL.
- * Params itself may be NULL
- * if no parameters are being
- * passed.
- * *Return_object - Where to put method's return value (if
+ * **External_params - List of parameters to pass to method,
+ * terminated by NULL. May be NULL
+ * if no parameters are being passed.
+ * *Return_buffer - Where to put method's return value (if
X * any). If NULL, no value is returned.


X *
X * RETURN: Status

@@ -61,12 +59,12 @@
X acpi_evaluate_object (
X acpi_handle handle,
X acpi_string pathname,
- acpi_object_list *param_objects,
+ acpi_object_list *external_params,
X acpi_buffer *return_buffer)
X {
X acpi_status status;
- acpi_operand_object **param_ptr = NULL;
- acpi_operand_object *return_obj = NULL;
+ acpi_operand_object **internal_params = NULL;
+ acpi_operand_object *internal_return_obj = NULL;
X u32 buffer_space_needed;
X u32 user_buffer_length;
X u32 i;
@@ -75,25 +73,18 @@
X FUNCTION_TRACE ("Acpi_evaluate_object");


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /*
X * If there are parameters to be passed to the object
X * (which must be a control method), the external objects
X * must be converted to internal objects
X */
- if (param_objects && param_objects->count) {
+ if (external_params && external_params->count) {
X /*
X * Allocate a new parameter block for the internal objects
X * Add 1 to count to allow for null terminated internal list
X */
- param_ptr = ACPI_MEM_CALLOCATE ((param_objects->count + 1) * sizeof (void *));
- if (!param_ptr) {
+ internal_params = ACPI_MEM_CALLOCATE ((external_params->count + 1) * sizeof (void *));
+ if (!internal_params) {


X return_ACPI_STATUS (AE_NO_MEMORY);
X }
X

@@ -102,16 +93,16 @@
X * Convert each external object in the list to an
X * internal object
X */
- for (i = 0; i < param_objects->count; i++) {
- status = acpi_ut_copy_eobject_to_iobject (&param_objects->pointer[i],
- &param_ptr[i]);
+ for (i = 0; i < external_params->count; i++) {
+ status = acpi_ut_copy_eobject_to_iobject (&external_params->pointer[i],
+ &internal_params[i]);
X
X if (ACPI_FAILURE (status)) {
- acpi_ut_delete_internal_object_list (param_ptr);
+ acpi_ut_delete_internal_object_list (internal_params);


X return_ACPI_STATUS (status);
X }
X }

- param_ptr[param_objects->count] = NULL;
+ internal_params[external_params->count] = NULL;
X }
X
X
@@ -126,7 +117,7 @@
X /*
X * The path is fully qualified, just evaluate by name
X */
- status = acpi_ns_evaluate_by_name (pathname, param_ptr, &return_obj);
+ status = acpi_ns_evaluate_by_name (pathname, internal_params, &internal_return_obj);
X }
X
X else if (!handle) {
@@ -157,15 +148,15 @@
X * The null pathname case means the handle is for
X * the actual object to be evaluated
X */
- status = acpi_ns_evaluate_by_handle (handle, param_ptr, &return_obj);
+ status = acpi_ns_evaluate_by_handle (handle, internal_params, &internal_return_obj);
X }


X
X else {
X /*

X * Both a Handle and a relative Pathname
X */
- status = acpi_ns_evaluate_relative (handle, pathname, param_ptr,
- &return_obj);
+ status = acpi_ns_evaluate_relative (handle, pathname, internal_params,
+ &internal_return_obj);
X }
X }
X
@@ -179,8 +170,8 @@
X user_buffer_length = return_buffer->length;
X return_buffer->length = 0;
X
- if (return_obj) {
- if (VALID_DESCRIPTOR_TYPE (return_obj, ACPI_DESC_TYPE_NAMED)) {
+ if (internal_return_obj) {
+ if (VALID_DESCRIPTOR_TYPE (internal_return_obj, ACPI_DESC_TYPE_NAMED)) {
X /*
X * If we got an Node as a return object,
X * this means the object we are evaluating
@@ -193,7 +184,7 @@
X * types at a later date if necessary.
X */
X status = AE_TYPE;
- return_obj = NULL; /* No need to delete an Node */
+ internal_return_obj = NULL; /* No need to delete an Node */
X }
X
X if (ACPI_SUCCESS (status)) {
@@ -201,7 +192,7 @@
X * Find out how large a buffer is needed
X * to contain the returned object
X */
- status = acpi_ut_get_object_size (return_obj,
+ status = acpi_ut_get_object_size (internal_return_obj,
X &buffer_space_needed);
X if (ACPI_SUCCESS (status)) {
X /*
@@ -226,7 +217,7 @@
X /*
X * We have enough space for the object, build it
X */
- status = acpi_ut_copy_iobject_to_eobject (return_obj,
+ status = acpi_ut_copy_iobject_to_eobject (internal_return_obj,
X return_buffer);
X return_buffer->length = buffer_space_needed;
X }
@@ -238,21 +229,21 @@
X
X /* Delete the return and parameter objects */
X
- if (return_obj) {
+ if (internal_return_obj) {
X /*
X * Delete the internal return object. (Or at least
X * decrement the reference count by one)
X */
- acpi_ut_remove_reference (return_obj);
+ acpi_ut_remove_reference (internal_return_obj);
X }
X
X /*
X * Free the input parameter list (if we created one),
X */
- if (param_ptr) {
+ if (internal_params) {
X /* Free the allocated parameter block */
X
- acpi_ut_delete_internal_object_list (param_ptr);
+ acpi_ut_delete_internal_object_list (internal_params);
X }
X
X return_ACPI_STATUS (status);
@@ -290,13 +281,6 @@
X acpi_namespace_node *child_node = NULL;


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {

- return (status);
- }
-


X /* Parameter validation */
X

X if (type > ACPI_TYPE_MAX) {
@@ -310,7 +294,7 @@
X if (!child) {
X /* Start search at the beginning of the specified scope */
X
- parent_node = acpi_ns_convert_handle_to_entry (parent);
+ parent_node = acpi_ns_map_handle_to_node (parent);
X if (!parent_node) {
X status = AE_BAD_PARAMETER;
X goto unlock_and_exit;
@@ -322,7 +306,7 @@
X else {
X /* Convert and validate the handle */
X
- child_node = acpi_ns_convert_handle_to_entry (child);
+ child_node = acpi_ns_map_handle_to_node (child);
X if (!child_node) {
X status = AE_BAD_PARAMETER;
X goto unlock_and_exit;


@@ -332,7 +316,7 @@
X

X /* Internal function does the real work */
X
- node = acpi_ns_get_next_object ((acpi_object_type8) type,
+ node = acpi_ns_get_next_node ((acpi_object_type8) type,
X parent_node, child_node);
X if (!node) {
X status = AE_NOT_FOUND;
@@ -370,15 +354,7 @@
X acpi_object_type *ret_type)
X {
X acpi_namespace_node *node;
- acpi_status status;
-


X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {

- return (status);
- }
X
X /* Parameter Validation */
X
@@ -399,7 +375,7 @@
X
X /* Convert and validate the handle */
X
- node = acpi_ns_convert_handle_to_entry (handle);
+ node = acpi_ns_map_handle_to_node (handle);
X if (!node) {
X acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
X return (AE_BAD_PARAMETER);
@@ -436,13 +412,6 @@


X acpi_status status = AE_OK;

X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {

- return (status);
- }
-
X if (!ret_handle) {
X return (AE_BAD_PARAMETER);
X }
@@ -458,7 +427,7 @@
X
X /* Convert and validate the handle */
X
- node = acpi_ns_convert_handle_to_entry (handle);
+ node = acpi_ns_map_handle_to_node (handle);
X if (!node) {
X status = AE_BAD_PARAMETER;
X goto unlock_and_exit;
@@ -519,7 +488,7 @@
X acpi_object_type type,
X acpi_handle start_object,
X u32 max_depth,
- ACPI_WALK_CALLBACK user_function,
+ acpi_walk_callback user_function,
X void *context,
X void **return_value)
X {
@@ -529,13 +498,6 @@
X FUNCTION_TRACE ("Acpi_walk_namespace");


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Parameter validation */
X

X if ((type > ACPI_TYPE_MAX) ||
@@ -551,11 +513,9 @@
X * must be allowed to make Acpi calls itself.
X */
X acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
- status = acpi_ns_walk_namespace ((acpi_object_type8) type,
- start_object, max_depth,
- NS_WALK_UNLOCK,
- user_function, context,
- return_value);
+ status = acpi_ns_walk_namespace ((acpi_object_type8) type, start_object,
+ max_depth, NS_WALK_UNLOCK, user_function, context,
+ return_value);
X
X acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
X
@@ -587,14 +547,14 @@
X acpi_status status;
X acpi_namespace_node *node;
X u32 flags;
- ACPI_DEVICE_ID device_id;
- ACPI_GET_DEVICES_INFO *info;
+ acpi_device_id device_id;
+ acpi_get_devices_info *info;
X
X
X info = context;
X
X acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);


- node = acpi_ns_convert_handle_to_entry (obj_handle);
+ node = acpi_ns_map_handle_to_node (obj_handle);

X acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
X
X if (!node) {
@@ -665,23 +625,16 @@
X acpi_status
X acpi_get_devices (
X NATIVE_CHAR *HID,
- ACPI_WALK_CALLBACK user_function,
+ acpi_walk_callback user_function,
X void *context,
X void **return_value)
X {
X acpi_status status;
- ACPI_GET_DEVICES_INFO info;
+ acpi_get_devices_info info;
X
X
X FUNCTION_TRACE ("Acpi_get_devices");


X
-
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
X

X /* Parameter validation */
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/os.c linux/drivers/acpi/os.c
--- v2.4.13/linux/drivers/acpi/os.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/os.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: os.c - Linux OSL functions


- * $Revision: 46 $

+ * $Revision: 49 $


X *
X *****************************************************************************/
X

@@ -40,7 +40,6 @@
X #include <linux/delay.h>
X #include <asm/io.h>


X #include <acpi.h>
-#include "driver.h"
X

X #ifdef CONFIG_ACPI_EFI
X #include <asm/efi.h>
@@ -191,14 +190,7 @@
X }
X
X if ((unsigned long) phys < virt_to_phys(high_memory)) {
- struct page *page;
X *virt = phys_to_virt((unsigned long) phys);
-
- /* Check for stamping */
- page = virt_to_page(*virt);
- if(page && !test_bit(PG_reserved, &page->flags))
- printk(KERN_WARNING "ACPI attempting to access kernel owned memory at %08lX.\n", (unsigned long)phys);
-
X return AE_OK;
X }
X
@@ -322,7 +314,7 @@
X acpi_status
X acpi_os_write_port(
X ACPI_IO_ADDRESS port,
- u32 value,
+ NATIVE_UINT value,
X u32 width)
X {
X switch (width)
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/ac_adapter/ac.c linux/drivers/acpi/ospm/ac_adapter/ac.c
--- v2.4.13/linux/drivers/acpi/ospm/ac_adapter/ac.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/ac_adapter/ac.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************

X *
X * Module Name: ac.c


- * $Revision: 22 $

+ * $Revision: 23 $


X *
X *****************************************************************************/
X

@@ -76,7 +76,7 @@
X * Print out basic adapter information.
X */
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| AC Adapter[%02x]:[%p] %s\n", ac_adapter->device_handle, ac_adapter->acpi_handle, buffer.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| AC Adapter[%02x]:[%p] %s\n", ac_adapter->device_handle, ac_adapter->acpi_handle, (char*)buffer.pointer));
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));
X
X acpi_os_free(buffer.pointer);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/ac_adapter/ac_osl.c linux/drivers/acpi/ospm/ac_adapter/ac_osl.c
--- v2.4.13/linux/drivers/acpi/ospm/ac_adapter/ac_osl.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/ac_adapter/ac_osl.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************

X *
X * Module Name: ac_osl.c
- * $Revision: 9 $
+ * $Revision: 10 $


X *
X *****************************************************************************/
X

@@ -35,7 +35,6 @@
X
X MODULE_AUTHOR("Andrew Grover");
X MODULE_DESCRIPTION("ACPI Component Architecture (CA) - AC Adapter Driver");
-MODULE_LICENSE("GPL");
X
X
X #define AC_PROC_ROOT "ac_adapter"
@@ -122,7 +121,7 @@
X return(AE_BAD_PARAMETER);
X }
X
- printk(KERN_INFO "AC Adapter: found\n");
+ printk(KERN_INFO "ACPI: AC Adapter found\n");
X
X proc_entry = proc_mkdir(ac_adapter->uid, ac_proc_root);
X if (!proc_entry) {
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/battery/bt.c linux/drivers/acpi/ospm/battery/bt.c
--- v2.4.13/linux/drivers/acpi/ospm/battery/bt.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/battery/bt.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************

X *
X * Module Name: bt.c
- * $Revision: 27 $
+ * $Revision: 29 $


X *
X *****************************************************************************/
X

@@ -76,7 +76,7 @@
X */
X
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Battery[%02x]:[%p] %s\n", battery->device_handle, battery->acpi_handle, buffer.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Battery[%02x]:[%p] %s\n", battery->device_handle, battery->acpi_handle, (char*)buffer.pointer));
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| uid[%s] is_present[%d] power_units[%s]\n", battery->uid, battery->is_present, battery->power_units));
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));
X
@@ -116,7 +116,7 @@
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
- MEMSET(&bif_buffer, 0, sizeof(acpi_buffer));
+ memset(&bif_buffer, 0, sizeof(acpi_buffer));
X
X /*
X * Evalute _BIF:
@@ -147,7 +147,7 @@
X package_format.length = sizeof("NNNNNNNNNSSSS");
X package_format.pointer = "NNNNNNNNNSSSS";
X
- MEMSET(&package_data, 0, sizeof(acpi_buffer));
+ memset(&package_data, 0, sizeof(acpi_buffer));
X
X status = bm_extract_package_data(package, &package_format,
X &package_data);
@@ -206,7 +206,7 @@
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
- MEMSET(&bst_buffer, 0, sizeof(acpi_buffer));
+ memset(&bst_buffer, 0, sizeof(acpi_buffer));
X
X /*
X * Evalute _BST:
@@ -237,7 +237,7 @@
X package_format.length = sizeof("NNNN");
X package_format.pointer = "NNNN";
X
- MEMSET(&package_data, 0, sizeof(acpi_buffer));
+ memset(&package_data, 0, sizeof(acpi_buffer));
X
X status = bm_extract_package_data(package, &package_format,
X &package_data);
@@ -495,8 +495,8 @@
X
X FUNCTION_TRACE("bt_initialize");
X
- MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID));
- MEMSET(&driver, 0, sizeof(BM_DRIVER));
+ memset(&criteria, 0, sizeof(BM_DEVICE_ID));
+ memset(&driver, 0, sizeof(BM_DRIVER));
X
X /*
X * Register driver for driver method battery devices.


@@ -533,8 +533,8 @@
X

X FUNCTION_TRACE("bt_terminate");
X
- MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID));
- MEMSET(&driver, 0, sizeof(BM_DRIVER));
+ memset(&criteria, 0, sizeof(BM_DEVICE_ID));
+ memset(&driver, 0, sizeof(BM_DRIVER));
X
X /*
X * Unregister driver for driver method battery devices.
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/battery/bt_osl.c linux/drivers/acpi/ospm/battery/bt_osl.c
--- v2.4.13/linux/drivers/acpi/ospm/battery/bt_osl.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/battery/bt_osl.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: bt_osl.c


- * $Revision: 22 $

+ * $Revision: 24 $


X *
X *****************************************************************************/
X

@@ -44,7 +44,6 @@
X
X MODULE_AUTHOR("Andrew Grover");
X MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Control Method Battery Driver");
-MODULE_LICENSE("GPL");
X
X
X #define BT_PROC_ROOT "battery"
@@ -107,7 +106,7 @@
X }
X else {
X p += sprintf(p, "Design Capacity: %d %sh\n",
- battery_info->design_capacity,
+ (u32)battery_info->design_capacity,
X battery->power_units);
X }
X
@@ -116,7 +115,7 @@
X }
X else {
X p += sprintf(p, "Last Full Capacity: %d %sh\n",
- battery_info->last_full_capacity,
+ (u32)battery_info->last_full_capacity,
X battery->power_units);
X }
X
@@ -135,20 +134,20 @@
X }
X else {
X p += sprintf(p, "Design Voltage: %d mV\n",
- battery_info->design_voltage);
+ (u32)battery_info->design_voltage);
X }
X
X p += sprintf(p, "Design Capacity Warning: %d %sh\n",
- battery_info->design_capacity_warning,
+ (u32)battery_info->design_capacity_warning,
X battery->power_units);
X p += sprintf(p, "Design Capacity Low: %d %sh\n",
- battery_info->design_capacity_low,
+ (u32)battery_info->design_capacity_low,
X battery->power_units);
X p += sprintf(p, "Capacity Granularity 1: %d %sh\n",
- battery_info->battery_capacity_granularity_1,
+ (u32)battery_info->battery_capacity_granularity_1,
X battery->power_units);
X p += sprintf(p, "Capacity Granularity 2: %d %sh\n",
- battery_info->battery_capacity_granularity_2,
+ (u32)battery_info->battery_capacity_granularity_2,
X battery->power_units);
X p += sprintf(p, "Model Number: %s\n",
X battery_info->model_number);
@@ -242,7 +241,7 @@
X }
X else {
X p += sprintf(p, "Present Rate: %d %s\n",
- battery_status->present_rate,
+ (u32)battery_status->present_rate,
X battery->power_units);
X }
X
@@ -251,7 +250,7 @@
X }
X else {
X p += sprintf(p, "Remaining Capacity: %d %sh\n",
- battery_status->remaining_capacity,
+ (u32)battery_status->remaining_capacity,
X battery->power_units);
X }
X
@@ -260,7 +259,7 @@
X }
X else {
X p += sprintf(p, "Battery Voltage: %d mV\n",
- battery_status->present_voltage);
+ (u32)battery_status->present_voltage);
X }
X
X end:
@@ -294,10 +293,10 @@
X }
X
X if (battery->is_present) {
- printk("Battery: socket found, battery present\n");
+ printk("ACPI: Battery socket found, battery present\n");
X }
X else {
- printk("Battery: socket found, battery absent\n");
+ printk("ACPI: Battery socket found, battery absent\n");
X }
X
X proc_entry = proc_mkdir(battery->uid, bt_proc_root);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/busmgr/bm.c linux/drivers/acpi/ospm/busmgr/bm.c
--- v2.4.13/linux/drivers/acpi/ospm/busmgr/bm.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/busmgr/bm.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: bm.c


- * $Revision: 47 $

+ * $Revision: 48 $


X *
X *****************************************************************************/
X

@@ -223,7 +223,7 @@
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+-------------------------------------------------------------------------------\n"));
X }
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| %s[%02x]:[%p] flags[%02x] hid[%s] %s\n", type_string, device->handle, device->acpi_handle, device->flags, (device->id.hid[0] ? device->id.hid : " "), buffer.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| %s[%02x]:[%p] flags[%02x] hid[%s] %s\n", type_string, device->handle, device->acpi_handle, device->flags, (device->id.hid[0] ? device->id.hid : " "), (char*)buffer.pointer));
X
X if (flags & BM_PRINT_IDENTIFICATION) {
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| identification: uid[%s] adr[%08x]\n", device->id.uid, device->id.adr));
@@ -919,7 +919,7 @@
X for (i=0; i<node_list.count; i++) {
X
X if (!node_list.nodes[i]) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) node entry [%02x] detected.\n", device_handle));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) node entry [%p] detected.\n", device_handle));
X status = AE_NULL_ENTRY;
X break;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/busmgr/bm_osl.c linux/drivers/acpi/ospm/busmgr/bm_osl.c
--- v2.4.13/linux/drivers/acpi/ospm/busmgr/bm_osl.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/busmgr/bm_osl.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************

X *
X * Module Name: bm_osl.c
- * $Revision: 16 $
+ * $Revision: 17 $


X *
X *****************************************************************************/
X

@@ -38,20 +38,6 @@
X
X MODULE_AUTHOR("Andrew Grover");
X MODULE_DESCRIPTION("ACPI Component Architecture (CA) - ACPI Bus Manager");
-MODULE_LICENSE("GPL");
-
-
-#ifdef ACPI_DEBUG
-
-static int dbg_layer = ACPI_COMPONENT_DEFAULT;
-MODULE_PARM(dbg_layer, "i");
-MODULE_PARM_DESC(dbg_layer, "Controls debug output (see acpi_dbg_layer).\n");
-
-static int dbg_level = DEBUG_DEFAULT;
-MODULE_PARM(dbg_level, "i");
-MODULE_PARM_DESC(dbg_level, "Controls debug output (see acpi_dbg_level).\n");
-
-#endif /*ACPI_DEBUG*/
X
X
X /*****************************************************************************
@@ -317,14 +303,6 @@
X if (ACPI_FAILURE(status))
X return -ENODEV;
X
-#ifdef ACPI_DEBUG
- save_dbg_layer = acpi_dbg_layer;
- acpi_dbg_layer = dbg_layer;
-
- save_dbg_level = acpi_dbg_level;
- acpi_dbg_level = dbg_level;
-#endif /*ACPI_DEBUG*/
-
X bm_proc_root = proc_mkdir(BM_PROC_ROOT, NULL);
X if (!bm_proc_root) {
X return(AE_ERROR);
@@ -361,11 +339,6 @@
X remove_proc_entry(BM_PROC_ROOT, NULL);
X bm_proc_root = NULL;
X }
-
-#ifdef ACPI_DEBUG
- acpi_dbg_layer = save_dbg_layer;
- acpi_dbg_level = save_dbg_level;
-#endif /*ACPI_DEBUG*/
X
X return;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/busmgr/bmpower.c linux/drivers/acpi/ospm/busmgr/bmpower.c
--- v2.4.13/linux/drivers/acpi/ospm/busmgr/bmpower.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/busmgr/bmpower.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /****************************************************************************

X *
X * Module Name: bmpower.c - Driver for ACPI Power Resource 'devices'
- * $Revision: 19 $
+ * $Revision: 20 $


X *
X ****************************************************************************/
X

@@ -95,7 +95,7 @@
X acpi_os_printf("Power Resource: found\n");
X
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Power_resource[%02x]:[%p] %s\n", pr->device_handle, pr->acpi_handle, buffer.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Power_resource[%02x]:[%p] %s\n", pr->device_handle, pr->acpi_handle, (char*)buffer.pointer));
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| system_level[S%d] resource_order[%d]\n", pr->system_level, pr->resource_order));
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| state[D%d] reference_count[%d]\n", pr->state, pr->reference_count));
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/busmgr/bmutils.c linux/drivers/acpi/ospm/busmgr/bmutils.c
--- v2.4.13/linux/drivers/acpi/ospm/busmgr/bmutils.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/busmgr/bmutils.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************

X *
X * Module Name: bmutils.c


- * $Revision: 38 $

+ * $Revision: 43 $
X *
X *****************************************************************************/
X

@@ -81,11 +81,11 @@
X }
X
X if (pathname) {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Evaluate object [%s.%s], %s\n", buffer.pointer, pathname,
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate object [%s.%s], %s\n", (char*)buffer.pointer, pathname,
X acpi_format_exception(status)));
X }
X else {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Evaluate object [%s], %s\n", buffer.pointer,
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate object [%s], %s\n", (char*)buffer.pointer,
X acpi_format_exception(status)));
X }
X
@@ -175,68 +175,70 @@


X *
X ****************************************************************************/
X

-/*
- * TBD: Don't assume numbers (in ASL) are 32-bit values!!!! (IA64)
- * TBD: Issue with 'assumed' types coming out of interpreter...
- * (e.g. toshiba _BIF)
- */
-
X acpi_status
X bm_extract_package_data (
X acpi_object *package,
- acpi_buffer *package_format,
+ acpi_buffer *format,
X acpi_buffer *buffer)
X {
- acpi_status status = AE_OK;
- u8 *head = NULL;
- u8 *tail = NULL;
- u8 **pointer = NULL;
X u32 tail_offset = 0;
- acpi_object *element = NULL;
X u32 size_required = 0;
- char* format = NULL;
+ char *format_string = NULL;
X u32 format_count = 0;
X u32 i = 0;
+ u8 *head = NULL;
+ u8 *tail = NULL;
X
X FUNCTION_TRACE("bm_extract_package_data");
X
- if (!package || (package->type != ACPI_TYPE_PACKAGE) ||
- (package->package.count == 0) || !package_format ||
- (package_format->length < 1) ||
- (!package_format->pointer) || !buffer) {
+ if (!package || (package->type != ACPI_TYPE_PACKAGE) || (package->package.count < 1)) {
+ ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'package' argument\n"));
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
- format_count = package_format->length - 1;
+ if (!format || !format->pointer || (format->length < 1)) {
+ ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'format' argument\n"));
+ return_ACPI_STATUS(AE_BAD_PARAMETER);
+ }
+
+ if (!buffer) {
+ ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'buffer' argument\n"));
+ return_ACPI_STATUS(AE_BAD_PARAMETER);
+ }
X
+ format_count = (format->length/sizeof(char)) - 1;
X if (format_count > package->package.count) {
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Format specifies more objects [%d] than exist in package [%d].", format_count, package->package.count));
+ ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Format specifies more objects [%d] than exist in package [%d].", format_count, package->package.count));
X return_ACPI_STATUS(AE_BAD_DATA);
X }
X
- format = (char*)package_format->pointer;
+ format_string = (char*)format->pointer;
X
X /*
X * Calculate size_required.
X */
X for (i=0; i<format_count; i++) {
- element = &(package->package.elements[i]);
+
+ acpi_object *element = &(package->package.elements[i]);
+
+ if (!element) {
+ return_ACPI_STATUS(AE_BAD_DATA);
+ }
X
X switch (element->type) {
X
X case ACPI_TYPE_INTEGER:
- switch (format[i]) {
+ switch (format_string[i]) {
X case 'N':
X size_required += sizeof(acpi_integer);
X tail_offset += sizeof(acpi_integer);
X break;
X case 'S':
- size_required += sizeof(u8*) +
- sizeof(acpi_integer) + 1;
- tail_offset += sizeof(acpi_integer);
+ size_required += sizeof(char*) + sizeof(acpi_integer) + sizeof(char);
+ tail_offset += sizeof(char*);
X break;
X default:
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Invalid package element [%d]: got number, expecing [%c].\n", i, format[i]));
+ ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid package element [%d]: got number, expecing [%c].\n", i, format_string[i]));
X return_ACPI_STATUS(AE_BAD_DATA);
X break;
X }
@@ -244,19 +246,17 @@
X
X case ACPI_TYPE_STRING:
X case ACPI_TYPE_BUFFER:
- switch (format[i]) {
+ switch (format_string[i]) {
X case 'S':
- size_required += sizeof(u8*) +
- element->string.length + 1;
- tail_offset += sizeof(u8*);
+ size_required += sizeof(char*) + (element->string.length * sizeof(char)) + sizeof(char);
+ tail_offset += sizeof(char*);
X break;
X case 'B':
- size_required += sizeof(u8*) +
- element->buffer.length;
+ size_required += sizeof(u8*) + (element->buffer.length * sizeof(u8));
X tail_offset += sizeof(u8*);
X break;
X default:
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Invalid package element [%d] got string/buffer, expecing [%c].\n", i, format[i]));
+ ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid package element [%d] got string/buffer, expecing [%c].\n", i, format_string[i]));
X return_ACPI_STATUS(AE_BAD_DATA);
X break;
X }
@@ -264,52 +264,52 @@
X
X case ACPI_TYPE_PACKAGE:
X default:
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found unsupported element at index=%d\n", i));
X /* TBD: handle nested packages... */
X return_ACPI_STATUS(AE_SUPPORT);


X break;
X }
X }
X

- if (size_required > buffer->length) {
+ /*
+ * Validate output buffer.
+ */
+ if (buffer->length < size_required) {
X buffer->length = size_required;
X return_ACPI_STATUS(AE_BUFFER_OVERFLOW);
X }
-
- buffer->length = size_required;
-
- if (!buffer->pointer) {
+ else if (buffer->length != size_required || !buffer->pointer) {
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
X head = buffer->pointer;
X tail = buffer->pointer + tail_offset;
X
- /*
- * Extract package data:
+ /*
+ * Extract package data.
X */
X for (i=0; i<format_count; i++) {
X
- element = &(package->package.elements[i]);
+ u8 **pointer = NULL;
+ acpi_object *element = &(package->package.elements[i]);
X
X switch (element->type) {
X
X case ACPI_TYPE_INTEGER:
- switch (format[i]) {
+ switch (format_string[i]) {
X case 'N':
- *((acpi_integer*)head) =
- element->integer.value;
+ *((acpi_integer*)head) = element->integer.value;
X head += sizeof(acpi_integer);
X break;
X case 'S':
X pointer = (u8**)head;
X *pointer = tail;
- *((acpi_integer*)tail) =
- element->integer.value;
+ *((acpi_integer*)tail) = element->integer.value;
X head += sizeof(acpi_integer*);
X tail += sizeof(acpi_integer);
X /* NULL terminate string */
- *tail = 0;
- tail++;
+ *tail = (char)0;
+ tail += sizeof(char);
X break;
X default:
X /* Should never get here */
@@ -319,25 +319,23 @@
X
X case ACPI_TYPE_STRING:
X case ACPI_TYPE_BUFFER:
- switch (format[i]) {
+ switch (format_string[i]) {
X case 'S':
X pointer = (u8**)head;
X *pointer = tail;
- memcpy(tail, element->string.pointer,
- element->string.length);
- head += sizeof(u8*);
- tail += element->string.length;
+ memcpy(tail, element->string.pointer, element->string.length);
+ head += sizeof(char*);
+ tail += element->string.length * sizeof(char);
X /* NULL terminate string */
- *tail = 0;
- tail++;
+ *tail = (char)0;
+ tail += sizeof(char);
X break;
X case 'B':
X pointer = (u8**)head;
X *pointer = tail;
- memcpy(tail, element->buffer.pointer,
- element->buffer.length);
+ memcpy(tail, element->buffer.pointer, element->buffer.length);
X head += sizeof(u8*);
- tail += element->buffer.length;
+ tail += element->buffer.length * sizeof(u8);
X break;
X default:
X /* Should never get here */
@@ -353,7 +351,7 @@
X }
X }
X
- return_ACPI_STATUS(status);
+ return_ACPI_STATUS(AE_OK);
X }
X
X
@@ -465,7 +463,7 @@
X */
X status = bm_evaluate_object(handle, pathname, NULL, &buffer);
X if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "failed to evaluate object (%s)\n",
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "failed to evaluate object (%s)\n",
X acpi_format_exception(status)));
X goto end;
X }
@@ -569,7 +567,7 @@
X
X if (!element || (element->type != ACPI_TYPE_STRING)) {
X status = AE_BAD_DATA;
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Invalid element in package (not a device reference).\n"));
+ ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid element in package (not a device reference).\n"));
X DEBUG_EVAL_ERROR (ACPI_LV_WARN, handle, pathname, status);
X break;
X }
@@ -582,7 +580,7 @@
X element->string.pointer, &reference_handle);
X if (ACPI_FAILURE(status)) {
X status = AE_BAD_DATA;
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to resolve device reference [%s].\n", element->string.pointer));
+ ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to resolve device reference [%s].\n", element->string.pointer));
X DEBUG_EVAL_ERROR (ACPI_LV_WARN, handle, pathname, status);
X break;
X }
@@ -594,12 +592,12 @@
X &(reference_list->handles[i]));
X if (ACPI_FAILURE(status)) {
X status = AE_BAD_DATA;
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to resolve device reference for [%p].\n", reference_handle));
+ ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to resolve device reference for [%p].\n", reference_handle));
X DEBUG_EVAL_ERROR (ACPI_LV_WARN, handle, pathname, status);
X break;
X }
X
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Resolved reference [%s]->[%p]->[%02x]\n", element->string.pointer, reference_handle, reference_list->handles[i]));
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resolved reference [%s]->[%p]->[%02x]\n", element->string.pointer, reference_handle, reference_list->handles[i]));
X
X (reference_list->count)++;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/button/bn.c linux/drivers/acpi/ospm/button/bn.c
--- v2.4.13/linux/drivers/acpi/ospm/button/bn.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/button/bn.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************

X *
X * Module Name: bn.c
- * $Revision: 25 $
+ * $Revision: 27 $


X *
X *****************************************************************************/
X

@@ -81,16 +81,16 @@
X
X case BN_TYPE_POWER_BUTTON:
X case BN_TYPE_POWER_BUTTON_FIXED:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Power_button[%02x]:[%p] %s\n", button->device_handle, button->acpi_handle, buffer.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Power_button[%02x]:[%p] %s\n", button->device_handle, button->acpi_handle, (char*)buffer.pointer));
X break;
X
X case BN_TYPE_SLEEP_BUTTON:
X case BN_TYPE_SLEEP_BUTTON_FIXED:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Sleep_button[%02x]:[%p] %s\n", button->device_handle, button->acpi_handle, buffer.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Sleep_button[%02x]:[%p] %s\n", button->device_handle, button->acpi_handle, (char*)buffer.pointer));
X break;
X
X case BN_TYPE_LID_SWITCH:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Lid_switch[%02x]:[%p] %s\n", button->device_handle, button->acpi_handle, buffer.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Lid_switch[%02x]:[%p] %s\n", button->device_handle, button->acpi_handle, (char*)buffer.pointer));
X break;
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/button/bn_osl.c linux/drivers/acpi/ospm/button/bn_osl.c
--- v2.4.13/linux/drivers/acpi/ospm/button/bn_osl.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/button/bn_osl.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: bn_osl.c
- * $Revision: 14 $
+ * $Revision: 16 $


X *
X *****************************************************************************/
X

@@ -35,7 +35,6 @@
X
X MODULE_AUTHOR("Andrew Grover");
X MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Button Driver");
-MODULE_LICENSE("GPL");
X
X
X #define BN_PROC_ROOT "button"
@@ -47,6 +46,15 @@
X static struct proc_dir_entry *bn_proc_root = NULL;
X
X
+#define BN_TYPE_UNKNOWN 0
+#define BN_TYPE_FIXED 1
+#define BN_TYPE_GENERIC 2
+
+static int bn_power_button = BN_TYPE_UNKNOWN;
+static int bn_sleep_button = BN_TYPE_UNKNOWN;
+static int bn_lid_switch = BN_TYPE_UNKNOWN;
+
+
X /****************************************************************************
X *
X * FUNCTION: bn_osl_add_device
@@ -65,24 +73,77 @@
X
X switch (button->type) {
X
- case BN_TYPE_POWER_BUTTON:
X case BN_TYPE_POWER_BUTTON_FIXED:
- printk(KERN_INFO "Power Button: found\n");
+ bn_power_button = BN_TYPE_FIXED;
+ printk(KERN_INFO "ACPI: Power Button (FF) found\n");
X if (!proc_mkdir(BN_PROC_POWER_BUTTON, bn_proc_root)) {
X status = AE_ERROR;
X }
X break;
X
- case BN_TYPE_SLEEP_BUTTON:
+ case BN_TYPE_POWER_BUTTON:
+ /*
+ * Avoid creating multiple /proc entries when (buggy) ACPI
+ * BIOS tables erroneously list both fixed- and generic-
+ * feature buttons. Note that fixed-feature buttons are
+ * always enumerated first (and there can only be one) so
+ * we only need to check here.
+ */
+ switch (bn_power_button) {
+ case BN_TYPE_GENERIC:
+ printk(KERN_WARNING "ACPI: Multiple generic-space power buttons detected, using first\n");
+ break;
+ case BN_TYPE_FIXED:
+ printk(KERN_WARNING "ACPI: Multiple power buttons detected, ignoring fixed-feature\n");
+ default:
+ printk(KERN_INFO "ACPI: Power Button (CM) found\n");
+ bn_power_button = BN_TYPE_GENERIC;
+ if (!proc_mkdir(BN_PROC_POWER_BUTTON, bn_proc_root)) {
+ status = AE_ERROR;
+ }
+ break;
+ }
+ break;
+
X case BN_TYPE_SLEEP_BUTTON_FIXED:
- printk(KERN_INFO "Sleep Button: found\n");
+ bn_sleep_button = BN_TYPE_FIXED;
+ printk(KERN_INFO "ACPI: Sleep Button (FF) found\n");
X if (!proc_mkdir(BN_PROC_SLEEP_BUTTON, bn_proc_root)) {
X status = AE_ERROR;
X }
X break;
X
+ case BN_TYPE_SLEEP_BUTTON:
+ /*
+ * Avoid creating multiple /proc entries when (buggy) ACPI
+ * BIOS tables erroneously list both fixed- and generic-
+ * feature buttons. Note that fixed-feature buttons are
+ * always enumerated first (and there can only be one) so
+ * we only need to check here.
+ */
+ switch (bn_sleep_button) {
+ case BN_TYPE_GENERIC:
+ printk(KERN_WARNING "ACPI: Multiple generic-space sleep buttons detected, using first\n");
+ break;
+ case BN_TYPE_FIXED:
+ printk(KERN_WARNING "ACPI: Multiple sleep buttons detected, ignoring fixed-feature\n");
+ default:
+ bn_sleep_button = BN_TYPE_GENERIC;
+ printk(KERN_INFO "ACPI: Sleep Button (CM) found\n");
+ if (!proc_mkdir(BN_PROC_SLEEP_BUTTON, bn_proc_root)) {
+ status = AE_ERROR;
+ }
+ break;
+ }
+ break;
+
X case BN_TYPE_LID_SWITCH:
- printk(KERN_INFO "Lid Switch: found\n");
+ if (bn_lid_switch) {
+ printk(KERN_WARNING "ACPI: Multiple generic-space lid switches detected, using first\n");
+ break;
+ }
+ bn_lid_switch = BN_TYPE_GENERIC;
+ printk(KERN_INFO "ACPI: Lid Switch (CM) found\n");
X if (!proc_mkdir(BN_PROC_LID_SWITCH, bn_proc_root)) {
X status = AE_ERROR;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/ec/ec_osl.c linux/drivers/acpi/ospm/ec/ec_osl.c
--- v2.4.13/linux/drivers/acpi/ospm/ec/ec_osl.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/ec/ec_osl.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************

X *
X * Module Name: ec_osl.c
- * $Revision: 10 $
+ * $Revision: 11 $


X *
X *****************************************************************************/
X

@@ -36,25 +36,6 @@
X
X MODULE_AUTHOR("Andrew Grover");
X MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Embedded Controller Driver");
-MODULE_LICENSE("GPL");
-
-#ifdef ACPI_DEBUG
-
-static int dbg_layer = ACPI_COMPONENT_DEFAULT;
-MODULE_PARM(dbg_layer, "i");
-MODULE_PARM_DESC(dbg_layer, "Controls debug output (see acpi_dbg_layer).\n");
-
-static int dbg_level = DEBUG_DEFAULT;
-MODULE_PARM(dbg_level, "i");
-MODULE_PARM_DESC(dbg_level, "Controls debug output (see acpi_dbg_level).\n");
-
-#endif /*ACPI_DEBUG*/
-
-
-#ifdef ACPI_DEBUG
-static u32 save_dbg_layer;
-static u32 save_dbg_level;
-#endif /*ACPI_DEBUG*/
X
X extern struct proc_dir_entry *bm_proc_root;
X
@@ -80,14 +61,6 @@
X if (!bm_proc_root)
X return -ENODEV;
X
-#ifdef ACPI_DEBUG
- save_dbg_layer = acpi_dbg_layer;
- acpi_dbg_layer = dbg_layer;
-
- save_dbg_level = acpi_dbg_level;
- acpi_dbg_level = dbg_level;
-#endif /*ACPI_DEBUG*/
-
X status = ec_initialize();
X
X return (ACPI_SUCCESS(status)) ? 0 : -ENODEV;
@@ -109,11 +82,6 @@
X ec_osl_cleanup(void)
X {
X ec_terminate();
-
-#ifdef ACPI_DEBUG
- acpi_dbg_layer = save_dbg_layer;
- acpi_dbg_level = save_dbg_level;
-#endif /*ACPI_DEBUG*/
X
X return;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/ec/ecmain.c linux/drivers/acpi/ospm/ec/ecmain.c
--- v2.4.13/linux/drivers/acpi/ospm/ec/ecmain.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/ec/ecmain.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************

X *
X * Module Name: ecmain.c
- * $Revision: 28 $
+ * $Revision: 29 $


X *
X *****************************************************************************/
X

@@ -79,7 +79,7 @@
X * Print out basic thermal zone information.
X */
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Embedded_controller[%02x]:[%p] %s\n", ec->device_handle, ec->acpi_handle, buffer.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Embedded_controller[%02x]:[%p] %s\n", ec->device_handle, ec->acpi_handle, (char*)buffer.pointer));
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| gpe_bit[%02x] status/command_port[%02x] data_port[%02x]\n", ec->gpe_bit, ec->status_port, ec->data_port));
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/ec/ecspace.c linux/drivers/acpi/ospm/ec/ecspace.c
--- v2.4.13/linux/drivers/acpi/ospm/ec/ecspace.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/ec/ecspace.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************

X *
X * Module Name: ecspace.c


- * $Revision: 22 $

+ * $Revision: 23 $


X *
X *****************************************************************************/
X

@@ -113,7 +113,7 @@
X break;
X
X default:
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Received request with invalid function [%p].\n", function));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Received request with invalid function [%X].\n", function));
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X break;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/include/bn.h linux/drivers/acpi/ospm/include/bn.h
--- v2.4.13/linux/drivers/acpi/ospm/include/bn.h Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/include/bn.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: bn.h
- * $Revision: 10 $
+ * $Revision: 12 $


X *
X *****************************************************************************/
X

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/include/bt.h linux/drivers/acpi/ospm/include/bt.h
--- v2.4.13/linux/drivers/acpi/ospm/include/bt.h Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/include/bt.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: bt.h
- * $Revision: 16 $
+ * $Revision: 18 $


X *
X *****************************************************************************/
X

@@ -66,15 +66,15 @@
X */
X typedef struct
X {
- u32 power_unit;
- u32 design_capacity;
- u32 last_full_capacity;
- u32 battery_technology;
- u32 design_voltage;
- u32 design_capacity_warning;
- u32 design_capacity_low;
- u32 battery_capacity_granularity_1;
- u32 battery_capacity_granularity_2;
+ acpi_integer power_unit;
+ acpi_integer design_capacity;
+ acpi_integer last_full_capacity;
+ acpi_integer battery_technology;
+ acpi_integer design_voltage;
+ acpi_integer design_capacity_warning;
+ acpi_integer design_capacity_low;
+ acpi_integer battery_capacity_granularity_1;
+ acpi_integer battery_capacity_granularity_2;
X acpi_string model_number;
X acpi_string serial_number;
X acpi_string battery_type;
@@ -89,10 +89,10 @@
X */
X typedef struct
X {
- u32 state;
- u32 present_rate;
- u32 remaining_capacity;
- u32 present_voltage;
+ acpi_integer state;
+ acpi_integer present_rate;
+ acpi_integer remaining_capacity;
+ acpi_integer present_voltage;
X
X } BT_BATTERY_STATUS;
X
@@ -137,7 +137,7 @@
X
X acpi_status
X bt_get_status (
- BT_CONTEXT *battery,
+ BT_CONTEXT *battery,
X BT_BATTERY_STATUS **battery_status);
X
X acpi_status
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/include/pr.h linux/drivers/acpi/ospm/include/pr.h
--- v2.4.13/linux/drivers/acpi/ospm/include/pr.h Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/include/pr.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: processor.h
- * $Revision: 9 $
+ * $Revision: 13 $


X *
X *****************************************************************************/
X

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/include/tz.h linux/drivers/acpi/ospm/include/tz.h
--- v2.4.13/linux/drivers/acpi/ospm/include/tz.h Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/include/tz.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************

X *
X * Module Name: tz.h


- * $Revision: 21 $

+ * $Revision: 24 $


X *
X *****************************************************************************/
X

@@ -116,68 +116,42 @@
X typedef u32 TZ_STATE;
X
X #define TZ_STATE_OK ((TZ_STATE) 0x00000000)
+#define TZ_STATE_HOT ((TZ_STATE) 0x10000000)
X #define TZ_STATE_ACTIVE ((TZ_STATE) 0x20000000)
X #define TZ_STATE_PASSIVE ((TZ_STATE) 0x40000000)
X #define TZ_STATE_CRITICAL ((TZ_STATE) 0x80000000)
X
-
-/*
- * TZ_THRESHOLD:
- * -------------
- * Information on an individual threshold.
- */
X typedef struct {
- TZ_THRESHOLD_TYPE type;
- u32 index;
X u32 temperature;
- TZ_COOLING_STATE cooling_state;
- BM_HANDLE_LIST cooling_devices;
-} TZ_THRESHOLD;
-
-
-/*
- * TZ_THRESHOLD_LIST:
- * ------------------
- * Container for the thresholds of a given thermal zone.
- * Note that thresholds are always ordered by increasing
- * temperature value to simplify use by thermal policy.
- */
-typedef struct {
- u32 count;
- TZ_THRESHOLD thresholds[TZ_MAX_THRESHOLDS];
-} TZ_THRESHOLD_LIST;
-
+} TZ_CRITICAL_THRESHOLD;
X
-/*
- * TZ_CRITICAL_POLICY:
- * -------------------
- */
X typedef struct {
- TZ_THRESHOLD *threshold;
-} TZ_CRITICAL_POLICY;
-
+ u8 is_valid;
+ u32 temperature;
+} TZ_HOT_THRESHOLD;
X
-/*
- * TZ_PASSIVE_POLICY:
- * ------------------
- */
X typedef struct {
+ u8 is_valid;
+ u32 temperature;
X u32 tc1;
X u32 tc2;
X u32 tsp;
- TZ_THRESHOLD *threshold;
-} TZ_PASSIVE_POLICY;
-
+ BM_HANDLE_LIST devices;
+} TZ_PASSIVE_THRESHOLD;
X
-/*
- * TZ_ACTIVE_POLICY:
- * -----------------
- */
X typedef struct {
- u32 threshold_count;
- TZ_THRESHOLD *threshold[TZ_MAX_ACTIVE_THRESHOLDS];
-} TZ_ACTIVE_POLICY;
+ u8 is_valid;
+ u32 temperature;
+ TZ_COOLING_STATE cooling_state;
+ BM_HANDLE_LIST devices;


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 20'
echo 'File patch-2.4.14 is continued in part 21'
echo "21" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:41 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part18

#!/bin/sh -x
# this is part 18 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 18; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&
X

X acpi_status
X acpi_ex_create_region (
- u8 *aml_ptr,
+ u8 *aml_start,
X u32 aml_length,
X u8 region_space,

X acpi_walk_state *walk_state);
X
X acpi_status

+acpi_ex_create_table_region (
+ acpi_walk_state *walk_state);
+

+acpi_status
X acpi_ex_create_event (
X acpi_walk_state *walk_state);
X
@@ -233,10 +257,9 @@
X
X acpi_status


X acpi_ex_create_method (
- u8 *aml_ptr,
+ u8 *aml_start,
X u32 aml_length,
- u32 method_flags,

- acpi_namespace_node *method);


+ acpi_walk_state *walk_state);
X
X

X /*
@@ -301,6 +324,9 @@
X u32 field_position,
X u32 field_length);
X
+acpi_status
+acpi_ex_prep_field_value (
+ ACPI_CREATE_FIELD_INFO *info);
X
X /*
X * amsystem - Interface to OS services
@@ -352,49 +378,40 @@


X */
X
X acpi_status

-acpi_ex_monadic1 (
- u16 opcode,

+acpi_ex_opcode_1A_0T_0R (


X acpi_walk_state *walk_state);
X
X acpi_status

-acpi_ex_monadic2 (


- u16 opcode,
- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc);

+acpi_ex_opcode_1A_0T_1R (


+ acpi_walk_state *walk_state);
X
X acpi_status

-acpi_ex_monadic2_r (


- u16 opcode,
- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc);

+acpi_ex_opcode_1A_1T_1R (
+ acpi_walk_state *walk_state);
X
+acpi_status
+acpi_ex_opcode_1A_1T_0R (
+ acpi_walk_state *walk_state);
X
X /*
X * amdyadic - ACPI AML (p-code) execution, dyadic operators


X */
X
X acpi_status

-acpi_ex_dyadic1 (
- u16 opcode,

+acpi_ex_opcode_2A_0T_0R (


X acpi_walk_state *walk_state);
X
X acpi_status

-acpi_ex_dyadic2 (


- u16 opcode,
- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc);

+acpi_ex_opcode_2A_0T_1R (


+ acpi_walk_state *walk_state);
X
X acpi_status

-acpi_ex_dyadic2_r (


- u16 opcode,
- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc);

+acpi_ex_opcode_2A_1T_1R (


+ acpi_walk_state *walk_state);
X
X acpi_status

-acpi_ex_dyadic2_s (


- u16 opcode,
- acpi_walk_state *walk_state,
- acpi_operand_object **return_desc);

+acpi_ex_opcode_2A_2T_1R (


+ acpi_walk_state *walk_state);
X
X

X /*
@@ -429,7 +446,7 @@


X void
X acpi_ex_show_hex_value (
X u32 byte_count,
- u8 *aml_ptr,
+ u8 *aml_start,
X u32 lead_space);
X
X

@@ -640,6 +657,24 @@
X
X acpi_status
X acpi_ex_pci_config_space_handler (


+ u32 function,
+ ACPI_PHYSICAL_ADDRESS address,
+ u32 bit_width,
+ u32 *value,
+ void *handler_context,
+ void *region_context);
+
+acpi_status
+acpi_ex_cmos_space_handler (
+ u32 function,
+ ACPI_PHYSICAL_ADDRESS address,
+ u32 bit_width,
+ u32 *value,
+ void *handler_context,
+ void *region_context);
+

+acpi_status
+acpi_ex_pci_bar_space_handler (
X u32 function,
X ACPI_PHYSICAL_ADDRESS address,
X u32 bit_width,
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/aclocal.h linux/drivers/acpi/include/aclocal.h
--- v2.4.13/linux/drivers/acpi/include/aclocal.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/aclocal.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Name: aclocal.h - Internal data types used across the ACPI subsystem
- * $Revision: 130 $
+ * $Revision: 138 $


X *
X *****************************************************************************/
X

@@ -29,7 +29,7 @@
X
X #define WAIT_FOREVER ((u32) -1)
X
-typedef void* ACPI_MUTEX;
+typedef void* acpi_mutex;
X typedef u32 ACPI_MUTEX_HANDLE;
X
X
@@ -40,7 +40,15 @@
X /* Object descriptor types */
X
X #define ACPI_CACHED_OBJECT 0x11 /* ORed in when object is cached */
-#define ACPI_DESC_TYPE_STATE 0x22
+#define ACPI_DESC_TYPE_STATE 0x20
+#define ACPI_DESC_TYPE_STATE_UPDATE 0x21
+#define ACPI_DESC_TYPE_STATE_PACKAGE 0x22
+#define ACPI_DESC_TYPE_STATE_CONTROL 0x23
+#define ACPI_DESC_TYPE_STATE_RPSCOPE 0x24
+#define ACPI_DESC_TYPE_STATE_PSCOPE 0x25
+#define ACPI_DESC_TYPE_STATE_WSCOPE 0x26
+#define ACPI_DESC_TYPE_STATE_RESULT 0x27
+#define ACPI_DESC_TYPE_STATE_NOTIFY 0x28
X #define ACPI_DESC_TYPE_WALK 0x44
X #define ACPI_DESC_TYPE_PARSER 0x66
X #define ACPI_DESC_TYPE_INTERNAL 0x88
@@ -112,11 +120,11 @@
X
X typedef struct acpi_mutex_info
X {
- ACPI_MUTEX mutex;
+ acpi_mutex mutex;
X u32 use_count;
X u32 owner_id;
X
-} ACPI_MUTEX_INFO;
+} acpi_mutex_info;
X
X /* This owner ID means that the mutex is not in use (unlocked) */
X
@@ -181,7 +189,7 @@
X u32 name; /* ACPI Name, always 4 chars per ACPI spec */
X
X
- void *object; /* Pointer to attached ACPI object (optional) */
+ union acpi_operand_obj *object; /* Pointer to attached ACPI object (optional) */
X struct acpi_node *child; /* first child */
X struct acpi_node *peer; /* Next peer*/
X u16 reference_count; /* Current count of references and children */
@@ -216,8 +224,8 @@
X struct acpi_table_desc *installed_desc;
X acpi_table_header *pointer;
X void *base_pointer;
- u8 *aml_pointer;
- UINT64 physical_address;
+ u8 *aml_start;
+ u64 physical_address;
X u32 aml_length;
X u32 length;
X u32 count;
@@ -235,13 +243,13 @@
X acpi_handle *list;
X u32 *count;
X
-} FIND_CONTEXT;
+} find_context;
X
X
X typedef struct
X {
X acpi_namespace_node *node;
-} NS_SEARCH_DATA;
+} ns_search_data;
X
X
X /*
@@ -274,7 +282,34 @@
X u32 num_carats;
X u8 fully_qualified;
X
-} ACPI_NAMESTRING_INFO;
+} acpi_namestring_info;
+
+
+/* Field creation info */
+
+typedef struct
+{
+ acpi_namespace_node *region_node;
+ acpi_namespace_node *field_node;
+ acpi_namespace_node *register_node;
+ acpi_namespace_node *data_register_node;
+ u32 bank_value;
+ u32 field_bit_position;
+ u32 field_bit_length;
+ u8 field_flags;
+ u8 field_type;
+
+} ACPI_CREATE_FIELD_INFO;
+
+/*
+ * Field flags: Bits 00 - 03 : Access_type (Any_acc, Byte_acc, etc.)
+ * 04 : Lock_rule (1 == Lock)
+ * 05 - 06 : Update_rule
+ */
+
+#define FIELD_ACCESS_TYPE_MASK 0x0F
+#define FIELD_LOCK_RULE_MASK 0x10
+#define FIELD_UPDATE_RULE_MASK 0x60
X
X
X /*****************************************************************************
@@ -308,23 +343,24 @@
X
X typedef struct
X {
- ACPI_ADR_SPACE_HANDLER handler;
+ acpi_adr_space_handler handler;
X void *context;
X
-} ACPI_ADR_SPACE_INFO;
+} acpi_adr_space_info;
X
X
X /* Values and addresses of the GPE registers (both banks) */
X
X typedef struct
X {
- u8 status; /* Current value of status reg */
- u8 enable; /* Current value of enable reg */
X u16 status_addr; /* Address of status reg */
X u16 enable_addr; /* Address of enable reg */
+ u8 status; /* Current value of status reg */
+ u8 enable; /* Current value of enable reg */
+ u8 wake_enable; /* Mask of bits to keep enabled when sleeping */
X u8 gpe_base; /* Base GPE number */
X
-} ACPI_GPE_REGISTERS;
+} acpi_gpe_registers;
X
X
X #define ACPI_GPE_LEVEL_TRIGGERED 1
@@ -338,7 +374,7 @@
X u8 type; /* Level or Edge */
X
X acpi_handle method_handle; /* Method handle for direct (fast) execution */
- ACPI_GPE_HANDLER handler; /* Address of handler, if any */
+ acpi_gpe_handler handler; /* Address of handler, if any */
X void *context; /* Context to be passed to handler */
X
X } acpi_gpe_level_info;
@@ -348,10 +384,10 @@
X
X typedef struct
X {
- ACPI_EVENT_HANDLER handler; /* Address of handler. */
+ acpi_event_handler handler; /* Address of handler. */
X void *context; /* Context to be passed to handler */
X
-} ACPI_FIXED_EVENT_INFO;
+} acpi_fixed_event_info;
X
X
X /* Information used during field processing */
@@ -362,7 +398,7 @@
X u8 field_flag;
X u32 pkg_length;
X
-} ACPI_FIELD_INFO;
+} acpi_field_info;
X
X
X /*****************************************************************************
@@ -397,7 +433,7 @@
X typedef struct acpi_common_state
X {
X ACPI_STATE_COMMON
-} ACPI_COMMON_STATE;
+} acpi_common_state;
X
X
X /*
@@ -408,7 +444,7 @@
X ACPI_STATE_COMMON
X union acpi_operand_obj *object;
X
-} ACPI_UPDATE_STATE;
+} acpi_update_state;
X
X
X /*
@@ -424,7 +460,7 @@
X u32 num_packages;
X u16 index;
X
-} ACPI_PKG_STATE;
+} acpi_pkg_state;
X
X
X /*
@@ -437,7 +473,7 @@
X struct acpi_parse_obj *predicate_op;
X u8 *aml_predicate_start; /* Start of if/while predicate */
X
-} ACPI_CONTROL_STATE;
+} acpi_control_state;
X
X
X /*
@@ -448,7 +484,7 @@
X ACPI_STATE_COMMON
X acpi_namespace_node *node;
X
-} ACPI_SCOPE_STATE;
+} acpi_scope_state;
X
X
X typedef struct acpi_pscope_state
@@ -460,7 +496,7 @@
X u32 arg_list; /* next argument to parse */
X u32 arg_count; /* Number of fixed arguments */
X
-} ACPI_PSCOPE_STATE;
+} acpi_pscope_state;
X
X
X /*
@@ -474,7 +510,17 @@
X u8 num_results;
X u8 last_insert;
X
-} ACPI_RESULT_VALUES;
+} acpi_result_values;
+
+
+typedef
+acpi_status (*acpi_parse_downwards) (
+ struct acpi_walk_state *walk_state,
+ struct acpi_parse_obj **out_op);
+
+typedef
+acpi_status (*acpi_parse_upwards) (
+ struct acpi_walk_state *walk_state);
X
X
X /*
@@ -487,36 +533,34 @@
X acpi_namespace_node *node;
X union acpi_operand_obj *handler_obj;
X
-} ACPI_NOTIFY_INFO;
+} acpi_notify_info;
X
X
X /* Generic state is union of structs above */
X
X typedef union acpi_gen_state
X {
- ACPI_COMMON_STATE common;
- ACPI_CONTROL_STATE control;
- ACPI_UPDATE_STATE update;
- ACPI_SCOPE_STATE scope;
- ACPI_PSCOPE_STATE parse_scope;
- ACPI_PKG_STATE pkg;
- ACPI_RESULT_VALUES results;
- ACPI_NOTIFY_INFO notify;
+ acpi_common_state common;
+ acpi_control_state control;
+ acpi_update_state update;
+ acpi_scope_state scope;
+ acpi_pscope_state parse_scope;
+ acpi_pkg_state pkg;
+ acpi_result_values results;
+ acpi_notify_info notify;
X
X } acpi_generic_state;
X
X
-typedef
-acpi_status (*acpi_parse_downwards) (
- u16 opcode,
- struct acpi_parse_obj *op,
- struct acpi_walk_state *walk_state,
- struct acpi_parse_obj **out_op);
+/*****************************************************************************
+ *
+ * Interpreter typedefs and structs
+ *
+ ****************************************************************************/
X
X typedef
-acpi_status (*acpi_parse_upwards) (
- struct acpi_walk_state *walk_state,
- struct acpi_parse_obj *op);
+acpi_status (*ACPI_EXECUTE_OP) (
+ struct acpi_walk_state *walk_state);
X
X
X /*****************************************************************************
@@ -525,35 +569,6 @@


X *
X ****************************************************************************/
X

-#define ACPI_OP_CLASS_MASK 0x1F
-#define ACPI_OP_ARGS_MASK 0x20
-#define ACPI_OP_TYPE_MASK 0xC0
-
-#define ACPI_OP_TYPE_OPCODE 0x00
-#define ACPI_OP_TYPE_ASCII 0x40
-#define ACPI_OP_TYPE_PREFIX 0x80
-#define ACPI_OP_TYPE_UNKNOWN 0xC0
-
-#define ACPI_GET_OP_CLASS(a) ((a)->flags & ACPI_OP_CLASS_MASK)
-#define ACPI_GET_OP_ARGS(a) ((a)->flags & ACPI_OP_ARGS_MASK)
-#define ACPI_GET_OP_TYPE(a) ((a)->flags & ACPI_OP_TYPE_MASK)
-
-/*
- * Flags byte: 0-4 (5 bits) = Opcode Class (0x001F
- * 5 (1 bit) = Has arguments flag
- * 6-7 (2 bits) = Reserved
- */
-#define AML_NO_ARGS 0
-#define AML_HAS_ARGS 0x0020
-#define AML_NSOBJECT 0x0100
-#define AML_NSOPCODE 0x0200
-#define AML_NSNODE 0x0400
-#define AML_NAMED 0x0800
-#define AML_DEFER 0x1000
-#define AML_FIELD 0x2000
-#define AML_CREATE 0x4000
-
-
X /*
X * AML opcode, name, and argument layout
X */
@@ -561,7 +576,9 @@
X {
X u32 parse_args; /* Grammar/Parse time arguments */
X u32 runtime_args; /* Interpret time arguments */
- u16 flags; /* Opcode type, Has_args flag */
+ u16 flags; /* Misc flags */
+ u8 class; /* Opcode class */
+ u8 type; /* Opcode type */
X
X #ifdef _OPCODE_NAMES
X NATIVE_CHAR *name; /* op name (debug only) */
@@ -583,7 +600,7 @@
X NATIVE_CHAR *name; /* NULL terminated string */
X struct acpi_parse_obj *arg; /* arguments and contained ops */
X
-} ACPI_PARSE_VALUE;
+} acpi_parse_value;
X
X
X #define ACPI_PARSE_COMMON \
@@ -597,7 +614,7 @@
X NATIVE_CHAR op_name[16]) /* op name (debug only) */\
X /* NON-DEBUG members below: */\
X acpi_namespace_node *node; /* for use by interpreter */\
- ACPI_PARSE_VALUE value; /* Value or args associated with the opcode */\
+ acpi_parse_value value; /* Value or args associated with the opcode */\
X
X
X /*
@@ -627,18 +644,22 @@
X * Parse state - one state per parser invocation and each control
X * method.
X */
-
X typedef struct acpi_parse_state
X {
+ u32 aml_size;
X u8 *aml_start; /* first AML byte */
X u8 *aml; /* next AML byte */
X u8 *aml_end; /* (last + 1) AML byte */
X u8 *pkg_start; /* current package begin */
X u8 *pkg_end; /* current package end */
- acpi_parse_object *start_op; /* root of parse tree */
+
+ struct acpi_parse_obj *start_op; /* root of parse tree */
X struct acpi_node *start_node;
- acpi_generic_state *scope; /* current scope */
- struct acpi_parse_state *next;
+ union acpi_gen_state *scope; /* current scope */
+
+
+ struct acpi_parse_obj *start_scope;
+
X
X } acpi_parse_state;
X
@@ -683,8 +704,8 @@
X #define PM1_STS 0x0100
X #define PM1_EN 0x0200
X #define PM1_CONTROL 0x0300
-#define PM1_a_CONTROL 0x0400
-#define PM1_b_CONTROL 0x0500
+#define PM1A_CONTROL 0x0400
+#define PM1B_CONTROL 0x0500
X #define PM2_CONTROL 0x0600
X #define PM_TIMER 0x0700
X #define PROCESSOR_BLOCK 0x0800
@@ -838,7 +859,7 @@
X {
X char buffer[ACPI_DEVICE_ID_LENGTH];
X
-} ACPI_DEVICE_ID;
+} acpi_device_id;
X
X
X /*****************************************************************************
@@ -879,7 +900,7 @@
X NATIVE_CHAR *proc_name;
X NATIVE_CHAR *module_name;
X
-} ACPI_DEBUG_PRINT_INFO;
+} acpi_debug_print_info;
X
X
X /* Entry for a memory allocation (debug only) */
@@ -903,14 +924,14 @@
X {
X ACPI_COMMON_DEBUG_MEM_HEADER
X
-} ACPI_DEBUG_MEM_HEADER;
+} acpi_debug_mem_header;
X
X typedef struct acpi_debug_mem_block
X {
X ACPI_COMMON_DEBUG_MEM_HEADER
- UINT64 user_space;
+ u64 user_space;
X
-} ACPI_DEBUG_MEM_BLOCK;
+} acpi_debug_mem_block;
X
X
X #define ACPI_MEM_LIST_GLOBAL 0
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acmacros.h linux/drivers/acpi/include/acmacros.h
--- v2.4.13/linux/drivers/acpi/include/acmacros.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acmacros.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Name: acmacros.h - C macros for the entire subsystem.
- * $Revision: 94 $
+ * $Revision: 97 $


X *
X *****************************************************************************/
X

@@ -104,7 +104,7 @@
X * Full 64-bit address/integer on both 32-bit and 64-bit platforms
X */
X #ifndef LODWORD
-#define LODWORD(l) ((u32)(UINT64)(l))
+#define LODWORD(l) ((u32)(u64)(l))
X #endif
X
X #ifndef HIDWORD
@@ -142,7 +142,7 @@
X #define MOVE_UNALIGNED16_TO_16(d,s) *(u16*)(d) = *(u16*)(s)
X #define MOVE_UNALIGNED32_TO_32(d,s) *(u32*)(d) = *(u32*)(s)
X #define MOVE_UNALIGNED16_TO_32(d,s) *(u32*)(d) = *(u16*)(s)
-#define MOVE_UNALIGNED64_TO_64(d,s) *(UINT64*)(d) = *(UINT64*)(s)
+#define MOVE_UNALIGNED64_TO_64(d,s) *(u64*)(d) = *(u64*)(s)
X
X #else
X /*
@@ -197,11 +197,6 @@
X #define MUL_16(a) _MUL(a,4)
X #define MOD_16(a) _MOD(a,16)
X
-/*
- * Divide and Modulo
- */
-#define ACPI_DIVIDE(n,d) ((n) / (d))
-#define ACPI_MODULO(n,d) ((n) % (d))
X
X /*
X * Rounding macros (Power of two boundaries only)
@@ -223,7 +218,7 @@
X #define ROUND_BITS_UP_TO_BYTES(a) DIV_8((a) + 7)
X #define ROUND_BITS_DOWN_TO_BYTES(a) DIV_8((a))
X
-#define ROUND_UP_TO_1_k(a) (((a) + 1023) >> 10)
+#define ROUND_UP_TO_1K(a) (((a) + 1023) >> 10)
X
X /* Generic (non-power-of-two) rounding */
X

@@ -243,9 +238,9 @@
X

X #ifndef _IA16
X
-#define ACPI_PCI_DEVICE_MASK (UINT64) 0x0000FFFF00000000
-#define ACPI_PCI_FUNCTION_MASK (UINT64) 0x00000000FFFF0000
-#define ACPI_PCI_REGISTER_MASK (UINT64) 0x000000000000FFFF
+#define ACPI_PCI_DEVICE_MASK (u64) 0x0000FFFF00000000
+#define ACPI_PCI_FUNCTION_MASK (u64) 0x00000000FFFF0000
+#define ACPI_PCI_REGISTER_MASK (u64) 0x000000000000FFFF
X
X #define ACPI_PCI_FUNCTION(a) (u16) ((((a) & ACPI_PCI_FUNCTION_MASK) >> 16))
X #define ACPI_PCI_DEVICE(a) (u16) ((((a) & ACPI_PCI_DEVICE_MASK) >> 32))
@@ -279,10 +274,6 @@
X
X #define IS_SINGLE_TABLE(x) (((x) & 0x01) == ACPI_TABLE_SINGLE ? 1 : 0)
X
-/* Check if ACPI has been initialized properly */
-
-#define ACPI_IS_INITIALIZATION_COMPLETE(s) {if (acpi_gbl_root_node) s = AE_OK; else s=AE_NO_NAMESPACE;}
-
X /*
X * Macro to check if a pointer is within an ACPI table.
X * Parameter (a) is the pointer to check. Parameter (b) must be defined
@@ -303,9 +294,9 @@
X * Macros for the master AML opcode table
X */
X #ifdef ACPI_DEBUG
-#define ACPI_OP(name,Pargs,Iargs,flags) {Pargs,Iargs,flags,name}
+#define ACPI_OP(name,Pargs,Iargs,class,type,flags) {Pargs,Iargs,flags,class,type,name}
X #else
-#define ACPI_OP(name,Pargs,Iargs,flags) {Pargs,Iargs,flags}
+#define ACPI_OP(name,Pargs,Iargs,class,type,flags) {Pargs,Iargs,flags,class,type}
X #endif
X
X #define ARG_TYPE_WIDTH 5
@@ -409,7 +400,7 @@
X * as a local string ("_Proc_name) so that it can be also used by the function exit macros below.
X */
X
-#define PROC_NAME(a) ACPI_DEBUG_PRINT_INFO _dbg; \
+#define PROC_NAME(a) acpi_debug_print_info _dbg; \
X _dbg.component_id = _COMPONENT; \
X _dbg.proc_name = a; \
X _dbg.module_name = _THIS_MODULE;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acnamesp.h linux/drivers/acpi/include/acnamesp.h
--- v2.4.13/linux/drivers/acpi/include/acnamesp.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acnamesp.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Name: acnamesp.h - Namespace subcomponent prototypes and defines
- * $Revision: 107 $


+ * $Revision: 110 $
X *

X *****************************************************************************/
X
@@ -98,18 +98,16 @@


X acpi_handle start_object,
X u32 max_depth,

X u8 unlock_before_callback,
- ACPI_WALK_CALLBACK user_function,
+ acpi_walk_callback user_function,
X void *context,
X void **return_value);
X

-


X acpi_namespace_node *
-acpi_ns_get_next_object (
+acpi_ns_get_next_node (
X acpi_object_type8 type,

X acpi_namespace_node *parent,
X acpi_namespace_node *child);
X
-
X acpi_status
X acpi_ns_delete_namespace_by_owner (
X u16 table_id);
@@ -224,6 +222,7 @@
X void
X acpi_ns_dump_objects (
X acpi_object_type8 type,
+ u8 display_type,
X u32 max_depth,
X u32 ownder_id,
X acpi_handle start_handle);
@@ -304,7 +303,6 @@
X acpi_namespace_node *obj_node,
X NATIVE_CHAR *search_for);
X
-
X acpi_status
X acpi_ns_get_node (
X NATIVE_CHAR *pathname,
@@ -382,11 +380,11 @@
X
X acpi_status
X acpi_ns_build_internal_name (
- ACPI_NAMESTRING_INFO *info);
+ acpi_namestring_info *info);
X
X acpi_status
X acpi_ns_get_internal_name_length (
- ACPI_NAMESTRING_INFO *info);
+ acpi_namestring_info *info);
X
X acpi_status
X acpi_ns_internalize_name (
@@ -401,7 +399,7 @@
X NATIVE_CHAR **converted_name);
X
X acpi_namespace_node *
-acpi_ns_convert_handle_to_entry (
+acpi_ns_map_handle_to_node (
X acpi_handle handle);
X
X acpi_handle
@@ -418,7 +416,7 @@
X
X
X acpi_namespace_node *
-acpi_ns_get_next_valid_object (
+acpi_ns_get_next_valid_node (
X acpi_namespace_node *node);
X
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acobject.h linux/drivers/acpi/include/acobject.h
--- v2.4.13/linux/drivers/acpi/include/acobject.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acobject.h Wed Oct 24 14:06:22 2001


@@ -2,7 +2,7 @@
X /******************************************************************************
X *

X * Name: acobject.h - Definition of acpi_operand_object (Internal object only)


- * $Revision: 90 $

+ * $Revision: 93 $


X *
X *****************************************************************************/
X

@@ -98,6 +98,13 @@
X #define AFIELD_SINGLE_DATUM 0x1
X
X
+/*
+ * Fields common to both Strings and Buffers
+ */
+#define ACPI_COMMON_BUFFER_INFO \


+ u32 length;
+
+

X /******************************************************************************
X *
X * Individual Object Descriptors
@@ -132,8 +139,7 @@
X typedef struct /* STRING - has length and pointer - Null terminated, ASCII characters only */
X {
X ACPI_OBJECT_COMMON_HEADER
-
- u32 length;
+ ACPI_COMMON_BUFFER_INFO
X NATIVE_CHAR *pointer; /* String value in AML stream or in allocated space */
X
X } ACPI_OBJECT_STRING;
@@ -142,9 +148,8 @@
X typedef struct /* BUFFER - has length and pointer - not null terminated */
X {
X ACPI_OBJECT_COMMON_HEADER
-
- u32 length;
- u8 *pointer; /* points to the buffer in allocated space */
+ ACPI_COMMON_BUFFER_INFO
+ u8 *pointer; /* Buffer value in AML stream or in allocated space */
X
X } ACPI_OBJECT_BUFFER;
X
@@ -154,7 +159,6 @@
X ACPI_OBJECT_COMMON_HEADER
X
X u32 count; /* # of elements in package */
-
X union acpi_operand_obj **elements; /* Array of pointers to Acpi_objects */
X union acpi_operand_obj **next_element; /* used only while initializing */
X
@@ -188,10 +192,10 @@
X u8 method_flags;
X u8 param_count;
X
- u32 pcode_length;
+ u32 aml_length;
X
X void *semaphore;
- u8 *pcode;
+ u8 *aml_start;
X
X u8 concurrency;
X u8 thread_count;
@@ -341,7 +345,7 @@
X ACPI_OBJECT_COMMON_HEADER
X
X acpi_namespace_node *node; /* Parent device */
- ACPI_NOTIFY_HANDLER handler;
+ acpi_notify_handler handler;
X void *context;
X
X } ACPI_OBJECT_NOTIFY_HANDLER;
@@ -358,11 +362,11 @@
X
X u8 space_id;
X u16 hflags;
- ACPI_ADR_SPACE_HANDLER handler;
+ acpi_adr_space_handler handler;
X
X acpi_namespace_node *node; /* Parent device */
X void *context;
- ACPI_ADR_SPACE_SETUP setup;
+ acpi_adr_space_setup setup;
X union acpi_operand_obj *region_list; /* regions using this handler */
X union acpi_operand_obj *next;
X
@@ -402,8 +406,8 @@
X ACPI_OBJECT_COMMON_HEADER
X u8 byte_fill1;
X u16 word_fill1;
- u32 pcode_length;
- u8 *pcode;
+ u32 aml_length;
+ u8 *aml_start;
X acpi_namespace_node *method_REG; /* _REG method for this region (if any) */
X void *region_context; /* Region-specific data */
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acparser.h linux/drivers/acpi/include/acparser.h
--- v2.4.13/linux/drivers/acpi/include/acparser.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acparser.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: acparser.h - AML Parser subcomponent prototypes and defines


- * $Revision: 51 $

+ * $Revision: 54 $


X *
X *****************************************************************************/
X

@@ -121,8 +121,6 @@
X
X acpi_status
X acpi_ps_find_object (


- u16 opcode,
- acpi_parse_object *op,
X acpi_walk_state *walk_state,
X acpi_parse_object **out_op);
X

@@ -136,15 +134,7 @@
X
X acpi_status
X acpi_ps_parse_aml (
- acpi_parse_object *start_scope,
- u8 *aml,
- u32 aml_size,
- u32 parse_flags,


- acpi_namespace_node *method_node,
- acpi_operand_object **params,

- acpi_operand_object **caller_return_desc,
- acpi_parse_downwards descending_callback,
- acpi_parse_upwards ascending_callback);


+ acpi_walk_state *walk_state);
X
X acpi_status

X acpi_ps_parse_table (
@@ -245,12 +235,6 @@
X
X
X /* psutils - parser utilities */
-
-
-acpi_parse_state *
-acpi_ps_create_state (
- u8 *aml,
- u32 aml_size);
X
X void
X acpi_ps_init_op (
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acpixf.h linux/drivers/acpi/include/acpixf.h
--- v2.4.13/linux/drivers/acpi/include/acpixf.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acpixf.h Wed Oct 24 14:06:22 2001
@@ -135,14 +135,14 @@


X acpi_object_type type,
X acpi_handle start_object,
X u32 max_depth,
- ACPI_WALK_CALLBACK user_function,
+ acpi_walk_callback user_function,
X void *context,

X void * *return_value);
X

X acpi_status
X acpi_get_devices (
X NATIVE_CHAR *HID,
- ACPI_WALK_CALLBACK user_function,
+ acpi_walk_callback user_function,
X void *context,
X void **return_value);
X

@@ -200,46 +200,46 @@


X acpi_status
X acpi_install_fixed_event_handler (

X u32 acpi_event,


- ACPI_EVENT_HANDLER handler,
+ acpi_event_handler handler,
X void *context);
X
X acpi_status

X acpi_remove_fixed_event_handler (
X u32 acpi_event,


- ACPI_EVENT_HANDLER handler);
+ acpi_event_handler handler);
X
X acpi_status

X acpi_install_notify_handler (
X acpi_handle device,
X u32 handler_type,
- ACPI_NOTIFY_HANDLER handler,
+ acpi_notify_handler handler,
X void *context);
X

X acpi_status


X acpi_remove_notify_handler (
X acpi_handle device,
X u32 handler_type,
- ACPI_NOTIFY_HANDLER handler);
+ acpi_notify_handler handler);
X

X acpi_status


X acpi_install_address_space_handler (
X acpi_handle device,
X ACPI_ADR_SPACE_TYPE space_id,
- ACPI_ADR_SPACE_HANDLER handler,
- ACPI_ADR_SPACE_SETUP setup,
+ acpi_adr_space_handler handler,
+ acpi_adr_space_setup setup,
X void *context);
X

X acpi_status


X acpi_remove_address_space_handler (
X acpi_handle device,
X ACPI_ADR_SPACE_TYPE space_id,
- ACPI_ADR_SPACE_HANDLER handler);
+ acpi_adr_space_handler handler);
X

X acpi_status
X acpi_install_gpe_handler (
X u32 gpe_number,


X u32 type,
- ACPI_GPE_HANDLER handler,
+ acpi_gpe_handler handler,
X void *context);
X
X acpi_status

@@ -253,17 +253,19 @@


X acpi_status
X acpi_remove_gpe_handler (
X u32 gpe_number,
- ACPI_GPE_HANDLER handler);
+ acpi_gpe_handler handler);
X
X acpi_status

X acpi_enable_event (
X u32 acpi_event,


- u32 type);
+ u32 type,
+ u32 flags);
X
X acpi_status

X acpi_disable_event (
X u32 acpi_event,


- u32 type);
+ u32 type,
+ u32 flags);
X
X acpi_status

X acpi_clear_event (
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acstruct.h linux/drivers/acpi/include/acstruct.h
--- v2.4.13/linux/drivers/acpi/include/acstruct.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acstruct.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Name: acstruct.h - Internal structs
- * $Revision: 5 $
+ * $Revision: 10 $


X *
X *****************************************************************************/
X

@@ -51,46 +51,50 @@
X u8 data_type; /* To differentiate various internal objs MUST BE FIRST!*/\
X acpi_owner_id owner_id; /* Owner of objects created during the walk */
X u8 last_predicate; /* Result of last predicate */
+ u8 current_result; /* */
X u8 next_op_info; /* Info about Next_op */
X u8 num_operands; /* Stack pointer for Operands[] array */
- u8 current_result; /* */
+ u8 return_used;
+ u8 walk_type;
+ u16 current_sync_level; /* Mutex Sync (nested acquire) level */
+ u16 opcode; /* Current AML opcode */
+ u32 arg_count; /* push for fixed or var args */
+ u32 aml_offset;
+ u32 arg_types;
+ u32 method_breakpoint; /* For single stepping */
+ u32 parse_flags;
+ u32 prev_arg_types;
X
- struct acpi_walk_state *next; /* Next Walk_state in list */
+
+ u8 *aml_last_while;
+ struct acpi_node arguments[MTH_NUM_ARGS]; /* Control method arguments */
+ union acpi_operand_obj **caller_return_desc;
+ acpi_generic_state *control_state; /* List of control states (nested IFs) */
+ struct acpi_node local_variables[MTH_NUM_LOCALS]; /* Control method locals */
+ struct acpi_node *method_call_node; /* Called method Node*/
+ acpi_parse_object *method_call_op; /* Method_call Op if running a method */
+ union acpi_operand_obj *method_desc; /* Method descriptor if running a method */
+ struct acpi_node *method_node; /* Method Node if running a method */
+ acpi_parse_object *op; /* Current parser op */
+ union acpi_operand_obj *operands[OBJ_NUM_OPERANDS+1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
+ const acpi_opcode_info *op_info; /* Info on current opcode */
X acpi_parse_object *origin; /* Start of walk [Obsolete] */
+ union acpi_operand_obj **params;
+ acpi_parse_state parser_state; /* Current state of parser */
+ union acpi_operand_obj *result_obj;
+ acpi_generic_state *results; /* Stack of accumulated results */
+ union acpi_operand_obj *return_desc; /* Return object, if any */
+ acpi_generic_state *scope_info; /* Stack of nested scopes */
X
X /* TBD: Obsolete with removal of WALK procedure ? */
X acpi_parse_object *prev_op; /* Last op that was processed */
X acpi_parse_object *next_op; /* next op to be processed */
X
X
- acpi_generic_state *results; /* Stack of accumulated results */
- acpi_generic_state *control_state; /* List of control states (nested IFs) */
- acpi_generic_state *scope_info; /* Stack of nested scopes */
- acpi_parse_state *parser_state; /* Current state of parser */
- u8 *aml_last_while;
- const acpi_opcode_info *op_info; /* Info on current opcode */
X acpi_parse_downwards descending_callback;
X acpi_parse_upwards ascending_callback;
-
- union acpi_operand_obj *return_desc; /* Return object, if any */
- union acpi_operand_obj *method_desc; /* Method descriptor if running a method */
- struct acpi_node *method_node; /* Method Node if running a method */
- acpi_parse_object *method_call_op; /* Method_call Op if running a method */
- struct acpi_node *method_call_node; /* Called method Node*/
- union acpi_operand_obj *operands[OBJ_NUM_OPERANDS]; /* Operands passed to the interpreter */
- struct acpi_node arguments[MTH_NUM_ARGS]; /* Control method arguments */
- struct acpi_node local_variables[MTH_NUM_LOCALS]; /* Control method locals */
X struct acpi_walk_list *walk_list;
- u32 parse_flags;
- u8 walk_type;
- u8 return_used;
- u16 opcode; /* Current AML opcode */
- u32 prev_arg_types;
- u16 current_sync_level; /* Mutex Sync (nested acquire) level */
-
- /* Debug support */
-
- u32 method_breakpoint;
+ struct acpi_walk_state *next; /* Next Walk_state in list */
X
X
X } acpi_walk_state;
@@ -121,7 +125,7 @@
X u16 object_count;
X acpi_table_desc *table_desc;
X
-} ACPI_INIT_WALK_INFO;
+} acpi_init_walk_info;
X
X
X /* Info used by TBD */
@@ -133,7 +137,7 @@
X u16 num_INI;
X acpi_table_desc *table_desc;
X
-} ACPI_DEVICE_WALK_INFO;
+} acpi_device_walk_info;
X
X
X /* TBD: [Restructure] Merge with struct above */
@@ -142,16 +146,54 @@
X {
X u32 debug_level;
X u32 owner_id;
+ u8 display_type;
+
+} acpi_walk_info;
+
+/* Display Types */
X
-} ACPI_WALK_INFO;
+#define ACPI_DISPLAY_SUMMARY 0
+#define ACPI_DISPLAY_OBJECTS 1
X
X typedef struct acpi_get_devices_info
X {
- ACPI_WALK_CALLBACK user_function;
+ acpi_walk_callback user_function;
X void *context;
X NATIVE_CHAR *hid;
X
-} ACPI_GET_DEVICES_INFO;
+} acpi_get_devices_info;
+
+
+typedef union acpi_aml_operands
+{
+ acpi_operand_object *operands[7];
+
+ struct
+ {
+ ACPI_OBJECT_INTEGER *type;
+ ACPI_OBJECT_INTEGER *code;
+ ACPI_OBJECT_INTEGER *argument;
+
+ } fatal;
+
+ struct
+ {
+ acpi_operand_object *source;
+ ACPI_OBJECT_INTEGER *index;
+ acpi_operand_object *target;
+
+ } index;
+
+ struct
+ {
+ acpi_operand_object *source;
+ ACPI_OBJECT_INTEGER *index;
+ ACPI_OBJECT_INTEGER *length;
+ acpi_operand_object *target;
+
+ } mid;
+
+} ACPI_AML_OPERANDS;
X
X
X #endif
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/actables.h linux/drivers/acpi/include/actables.h
--- v2.4.13/linux/drivers/acpi/include/actables.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/actables.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Name: actables.h - ACPI table management
- * $Revision: 31 $
+ * $Revision: 32 $


X *
X *****************************************************************************/
X

@@ -176,10 +176,6 @@
X /*
X * tbutils - common table utilities
X */
-
-u8
-acpi_tb_system_table_pointer (
- void *where);
X
X acpi_status
X acpi_tb_map_acpi_table (
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/actbl.h linux/drivers/acpi/include/actbl.h
--- v2.4.13/linux/drivers/acpi/include/actbl.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/actbl.h Wed Oct 24 14:06:22 2001
@@ -84,7 +84,7 @@
X u8 revision; /* Must be 0 for 1.0, 2 for 2.0 */
X u32 rsdt_physical_address; /* 32-bit physical address of RSDT */
X u32 length; /* XSDT Length in bytes including hdr */
- UINT64 xsdt_physical_address; /* 64-bit physical address of XSDT */
+ u64 xsdt_physical_address; /* 64-bit physical address of XSDT */
X u8 extended_checksum; /* Checksum of entire table */
X NATIVE_CHAR reserved [3]; /* reserved field must be 0 */
X
@@ -110,7 +110,7 @@
X typedef struct /* Common FACS for internal use */
X {
X u32 *global_lock;
- UINT64 *firmware_waking_vector;
+ u64 *firmware_waking_vector;
X u8 vector_width;
X
X } acpi_common_facs;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/actbl1.h linux/drivers/acpi/include/actbl1.h
--- v2.4.13/linux/drivers/acpi/include/actbl1.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/actbl1.h Wed Oct 24 14:06:22 2001
@@ -51,7 +51,7 @@
X u32 hardware_signature; /* hardware configuration signature */
X u32 firmware_waking_vector; /* ACPI OS waking vector */
X u32 global_lock; /* Global Lock */
- u32 S4_bios_f : 1; /* Indicates if S4_bIOS support is present */
+ u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */
X u32 reserved1 : 31; /* must be 0 */
X u8 resverved3 [40]; /* reserved - must be zero */
X
@@ -73,7 +73,7 @@
X u32 smi_cmd; /* Port address of SMI command port */
X u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */
X u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */
- u8 S4_bios_req; /* Value to write to SMI CMD to enter S4_bIOS state */
+ u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
X u8 reserved2; /* reserved - must be zero */
X u32 pm1a_evt_blk; /* Port address of Power Mgt 1a Acpi_event Reg Blk */
X u32 pm1b_evt_blk; /* Port address of Power Mgt 1b Acpi_event Reg Blk */
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/actbl2.h linux/drivers/acpi/include/actbl2.h
--- v2.4.13/linux/drivers/acpi/include/actbl2.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/actbl2.h Wed Oct 24 14:06:22 2001
@@ -65,7 +65,7 @@
X typedef struct
X {
X acpi_table_header header; /* Table header */
- UINT64 table_offset_entry [1]; /* Array of pointers to */
+ u64 table_offset_entry [1]; /* Array of pointers to */
X /* other tables' headers */
X } XSDT_DESCRIPTOR_REV2;


X
@@ -80,9 +80,9 @@

X u32 hardware_signature; /* hardware configuration signature */
X u32 firmware_waking_vector; /* 32bit physical address of the Firmware Waking Vector. */
X u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */
- u32 S4_bios_f : 1; /* Indicates if S4_bIOS support is present */
+ u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */
X u32 reserved1 : 31; /* must be 0 */
- UINT64 Xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */
+ u64 Xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */
X u8 version; /* Version of this table */
X u8 reserved3 [31]; /* reserved - must be zero */
X
@@ -98,7 +98,7 @@
X u8 register_bit_width; /* Size in bits of given register */
X u8 register_bit_offset; /* Bit offset within the register */
X u8 reserved; /* Must be 0 */
- UINT64 address; /* 64-bit address of struct or register */
+ u64 address; /* 64-bit address of struct or register */
X
X } acpi_generic_address;


X
@@ -117,7 +117,7 @@

X u32 smi_cmd; /* Port address of SMI command port */
X u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */
X u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */
- u8 S4_bios_req; /* Value to write to SMI CMD to enter S4_bIOS state */
+ u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
X u8 pstate_cnt; /* processor performance state control*/
X u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a Acpi_event Reg Blk */
X u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b Acpi_event Reg Blk */
@@ -139,8 +139,8 @@
X u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */
X u16 flush_size; /* number of flush strides that need to be read */
X u16 flush_stride; /* Processor's memory cache line width, in bytes */
- u8 duty_offset; /* Processor’s duty cycle index in processor's P_CNT reg*/
- u8 duty_width; /* Processor’s duty cycle value bit width in P_CNT register.*/
+ u8 duty_offset; /* Processor_’s duty cycle index in processor's P_CNT reg*/
+ u8 duty_width; /* Processor_’s duty cycle value bit width in P_CNT register.*/
X u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */
X u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */
X u8 century; /* index to century in RTC CMOS RAM */
@@ -166,8 +166,8 @@
X acpi_generic_address reset_register; /* Reset register address in GAS format */
X u8 reset_value; /* Value to write to the Reset_register port to reset the system. */
X u8 reserved7[3]; /* These three bytes must be zero */
- UINT64 Xfirmware_ctrl; /* 64-bit physical address of FACS */
- UINT64 Xdsdt; /* 64-bit physical address of DSDT */
+ u64 Xfirmware_ctrl; /* 64-bit physical address of FACS */
+ u64 Xdsdt; /* 64-bit physical address of DSDT */
X acpi_generic_address Xpm1a_evt_blk; /* Extended Power Mgt 1a Acpi_event Reg Blk address */
X acpi_generic_address Xpm1b_evt_blk; /* Extended Power Mgt 1b Acpi_event Reg Blk address */
X acpi_generic_address Xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/actbl71.h linux/drivers/acpi/include/actbl71.h
--- v2.4.13/linux/drivers/acpi/include/actbl71.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/actbl71.h Wed Oct 24 14:06:22 2001
@@ -41,7 +41,7 @@
X
X /* Only for clarity in declarations */
X
-typedef UINT64 IO_ADDRESS;
+typedef u64 IO_ADDRESS;
X
X
X #pragma pack(1)
@@ -51,7 +51,7 @@
X u8 checksum; /* to make sum of struct == 0 */
X NATIVE_CHAR oem_id [6]; /* OEM identification */
X u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */
- UINT64 rsdt_physical_address; /* 64-bit physical address of RSDT */
+ u64 rsdt_physical_address; /* 64-bit physical address of RSDT */
X } RSDP_DESCRIPTOR_REV071;
X
X
@@ -63,7 +63,7 @@
X {
X acpi_table_header header; /* Table header */
X u32 reserved_pad; /* IA64 alignment, must be 0 */
- UINT64 table_offset_entry [1]; /* Array of pointers to other */
+ u64 table_offset_entry [1]; /* Array of pointers to other */
X /* tables' headers */
X } RSDT_DESCRIPTOR_REV071;
X
@@ -78,9 +78,9 @@
X u32 length; /* length of structure, in bytes */
X u32 hardware_signature; /* hardware configuration signature */
X u32 reserved4; /* must be 0 */
- UINT64 firmware_waking_vector; /* ACPI OS waking vector */
- UINT64 global_lock; /* Global Lock */
- u32 S4_bios_f : 1; /* Indicates if S4_bIOS support is present */
+ u64 firmware_waking_vector; /* ACPI OS waking vector */
+ u64 global_lock; /* Global Lock */
+ u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */
X u32 reserved1 : 31; /* must be 0 */
X u8 reserved3 [28]; /* reserved - must be zero */
X
@@ -95,24 +95,24 @@
X {
X acpi_table_header header; /* table header */
X u32 reserved_pad; /* IA64 alignment, must be 0 */
- UINT64 firmware_ctrl; /* 64-bit Physical address of FACS */
- UINT64 dsdt; /* 64-bit Physical address of DSDT */
+ u64 firmware_ctrl; /* 64-bit Physical address of FACS */
+ u64 dsdt; /* 64-bit Physical address of DSDT */
X u8 model; /* System Interrupt Model */
X u8 address_space; /* Address Space Bitmask */
X u16 sci_int; /* System vector of SCI interrupt */
X u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */
X u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */
- u8 S4_bios_req; /* Value to write to SMI CMD to enter S4_bIOS state */
+ u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
X u8 reserved2; /* reserved - must be zero */
- UINT64 smi_cmd; /* Port address of SMI command port */
- UINT64 pm1a_evt_blk; /* Port address of Power Mgt 1a Acpi_event Reg Blk */
- UINT64 pm1b_evt_blk; /* Port address of Power Mgt 1b Acpi_event Reg Blk */
- UINT64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
- UINT64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
- UINT64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
- UINT64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
- UINT64 gpe0blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */
- UINT64 gpe1_blk; /* Port addr of General Purpose Acpi_event 1 Reg Blk */
+ u64 smi_cmd; /* Port address of SMI command port */
+ u64 pm1a_evt_blk; /* Port address of Power Mgt 1a Acpi_event Reg Blk */
+ u64 pm1b_evt_blk; /* Port address of Power Mgt 1b Acpi_event Reg Blk */
+ u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
+ u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
+ u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
+ u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
+ u64 gpe0blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */
+ u64 gpe1_blk; /* Port addr of General Purpose Acpi_event 1 Reg Blk */
X u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */
X u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */
X u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/actypes.h linux/drivers/acpi/include/actypes.h
--- v2.4.13/linux/drivers/acpi/include/actypes.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/actypes.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Name: actypes.h - Common data types for the entire ACPI subsystem
- * $Revision: 188 $
+ * $Revision: 193 $


X *
X *****************************************************************************/
X

@@ -68,9 +68,8 @@
X typedef UINT64 ACPI_IO_ADDRESS;
X typedef UINT64 ACPI_PHYSICAL_ADDRESS;
X
-#define ALIGNED_ADDRESS_BOUNDARY 0x00000008
-
-/* (No hardware alignment support in IA64) */
+#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */
+#define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */
X
X
X #elif _IA16
@@ -101,6 +100,7 @@
X
X #define ALIGNED_ADDRESS_BOUNDARY 0x00000002
X #define _HW_ALIGNMENT_SUPPORT
+#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
X
X /*
X * (16-bit only) internal integers must be 32-bits, so
@@ -196,11 +196,18 @@
X
X typedef struct
X {
- u32 lo;
- u32 hi;
+ u32 lo;
+ u32 hi;
X
X } uint64_struct;
X
+typedef union
+{
+ u64 full;
+ uint64_struct part;
+
+} uint64_overlay;
+
X
X /*
X * Acpi integer width. In ACPI version 1, integers are
@@ -220,17 +227,23 @@
X #define ACPI_MAX_BCD_DIGITS 8
X #define ACPI_MAX_DECIMAL_DIGITS 10
X
+#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */
+
+
X #else
X
X /* 64-bit integers */
X
-typedef UINT64 acpi_integer;
+typedef u64 acpi_integer;
X #define ACPI_INTEGER_MAX ACPI_UINT64_MAX
X #define ACPI_INTEGER_BIT_SIZE 64
X #define ACPI_MAX_BCD_VALUE 9999999999999999
X #define ACPI_MAX_BCD_DIGITS 16
X #define ACPI_MAX_DECIMAL_DIGITS 19
X
+#ifdef _IA64
+#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */
+#endif
X #endif
X
X
@@ -453,24 +466,36 @@
X #define ACPI_EVENT_EDGE_TRIGGERED (acpi_event_type) 2
X
X /*
+ * GPEs
+ */
+#define ACPI_EVENT_ENABLE 0x1
+#define ACPI_EVENT_WAKE_ENABLE 0x2
+
+#define ACPI_EVENT_DISABLE 0x1
+#define ACPI_EVENT_WAKE_DISABLE 0x2
+
+
+/*
X * Acpi_event Status:
X * -------------
X * The encoding of acpi_event_status is illustrated below.
X * Note that a set bit (1) indicates the property is TRUE
X * (e.g. if bit 0 is set then the event is enabled).
- * +---------------+-+-+
- * | Bits 31:2 |1|0|
- * +---------------+-+-+
- * | | |
- * | | +- Enabled?
- * | +--- Set?
+ * +-------------+-+-+-+
+ * | Bits 31:3 |2|1|0|
+ * +-------------+-+-+-+
+ * | | | |
+ * | | | +- Enabled?
+ * | | +--- Enabled for wake?
+ * | +----- Set?
X * +----------- <Reserved>
X */
X typedef u32 acpi_event_status;
X
X #define ACPI_EVENT_FLAG_DISABLED (acpi_event_status) 0x00
X #define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01
-#define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x02
+#define ACPI_EVENT_FLAG_WAKE_ENABLED (acpi_event_status) 0x02
+#define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04
X
X
X /* Notify types */
@@ -604,7 +629,7 @@


X {
X u32 count;
X

-} ACPI_TABLE_INFO;
+} acpi_table_info;
X
X
X /*
@@ -621,7 +646,7 @@
X u32 debug_level;
X u32 debug_layer;
X u32 num_table_types;
- ACPI_TABLE_INFO table_info [NUM_ACPI_TABLES];
+ acpi_table_info table_info [NUM_ACPI_TABLES];
X
X } acpi_system_info;
X
@@ -631,15 +656,15 @@
X */
X
X typedef
-u32 (*ACPI_EVENT_HANDLER) (
+u32 (*acpi_event_handler) (
X void *context);
X
X typedef
-void (*ACPI_GPE_HANDLER) (
+void (*acpi_gpe_handler) (
X void *context);
X
X typedef
-void (*ACPI_NOTIFY_HANDLER) (
+void (*acpi_notify_handler) (
X acpi_handle device,
X u32 value,
X void *context);
@@ -651,7 +676,7 @@
X #define ACPI_WRITE_ADR_SPACE 2
X
X typedef
-acpi_status (*ACPI_ADR_SPACE_HANDLER) (
+acpi_status (*acpi_adr_space_handler) (
X u32 function,
X ACPI_PHYSICAL_ADDRESS address,
X u32 bit_width,
@@ -659,11 +684,11 @@
X void *handler_context,
X void *region_context);
X
-#define ACPI_DEFAULT_HANDLER ((ACPI_ADR_SPACE_HANDLER) NULL)
+#define ACPI_DEFAULT_HANDLER ((acpi_adr_space_handler) NULL)
X
X
X typedef
-acpi_status (*ACPI_ADR_SPACE_SETUP) (
+acpi_status (*acpi_adr_space_setup) (
X acpi_handle region_handle,


X u32 function,
X void *handler_context,

@@ -673,7 +698,7 @@
X #define ACPI_REGION_DEACTIVATE 1
X
X typedef
-acpi_status (*ACPI_WALK_CALLBACK) (
+acpi_status (*acpi_walk_callback) (
X acpi_handle obj_handle,
X u32 nesting_level,
X void *context,
@@ -758,7 +783,7 @@
X
X /*
X * IO Attributes
- * The ISA IO ranges are: n000-n0FFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh.
+ * The ISA IO ranges are: n000-n0FFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh.
X * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cD0-n_fFFh.
X */
X #define NON_ISA_ONLY_RANGES (u8) 0x01
@@ -988,11 +1013,11 @@


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 18'
echo 'File patch-2.4.14 is continued in part 19'
echo "19" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:54 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part31

#!/bin/sh -x
# this is part 31 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 31; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ * handle RX events; transmit events go via the TX DMA handler.
+ *
+ * No matter what, we disable RX, process, and the restart RX.
+ */
+static void sa1100_irda_fir_irq(struct net_device *dev)
+{
+ struct sa1100_irda *si = dev->priv;
+
+ /*
+ * Stop RX DMA
+ */
+ sa1100_dma_stop(si->rxdma);
+
+ /*
+ * Framing error - we throw away the packet completely.
+ * Clearing RXE flushes the error conditions and data
+ * from the fifo.
+ */
+ if (Ser2HSSR0 & (HSSR0_FRE | HSSR0_RAB)) {
+ si->stats.rx_errors++;
+
+ if (Ser2HSSR0 & HSSR0_FRE)
+ si->stats.rx_frame_errors++;
+
+ /*
+ * Clear out the DMA...
+ */
+ Ser2HSCR0 = si->hscr0 | HSCR0_HSSP;
+
+ /*
+ * Clear selected status bits now, so we
+ * don't miss them next time around.
+ */
+ Ser2HSSR0 = HSSR0_FRE | HSSR0_RAB;
+ }
+
+ /*
+ * Deal with any receive errors. The any of the lowest
+ * 8 bytes in the FIFO may contain an error. We must read
+ * them one by one. The "error" could even be the end of
+ * packet!
+ */
+ if (Ser2HSSR0 & HSSR0_EIF)
+ sa1100_irda_fir_error(si, dev);
+
+ /*
+ * No matter what happens, we must restart reception.
+ */
+ sa1100_irda_rx_dma_start(si);
+}
+
+static void sa1100_irda_irq(int irq, void *dev_id, struct pt_regs *regs)
+{
+ struct net_device *dev = dev_id;
+ if (IS_FIR(((struct sa1100_irda *)dev->priv)))
+ sa1100_irda_fir_irq(dev);
+ else
+ sa1100_irda_hpsir_irq(dev);
+}
+
+/*
+ * TX DMA completion handler.
+ */
+static void sa1100_irda_txdma_irq(void *id, int len)
+{
+ struct net_device *dev = id;
+ struct sa1100_irda *si = dev->priv;
+ struct sk_buff *skb = si->txskb;
+
+ si->txskb = NULL;
+
+ /*
+ * Wait for the transmission to complete. Unfortunately,
+ * the hardware doesn't give us an interrupt to indicate
+ * "end of frame".
+ */
+ do
+ rmb();
+ while (!(Ser2HSSR0 & HSSR0_TUR) || Ser2HSSR1 & HSSR1_TBY);
+
+ /*
+ * Clear the transmit underrun bit.
+ */
+ Ser2HSSR0 = HSSR0_TUR;
+
+ /*
+ * Do we need to change speed? Note that we're lazy
+ * here - we don't free the old rxskb. We don't need
+ * to allocate a buffer either.
+ */
+ if (si->newspeed) {
+ sa1100_irda_set_speed(si, si->newspeed);
+ si->newspeed = 0;
+ }
+
+ /*
+ * Start reception. This disables the transmitter for
+ * us. This will be using the existing RX buffer.
+ */
+ sa1100_irda_rx_dma_start(si);
+
+ /*
+ * Account and free the packet.
+ */
+ if (skb) {
+ pci_unmap_single(NULL, si->txbuf_dma, len, PCI_DMA_TODEVICE);
+ si->stats.tx_packets ++;
+ si->stats.tx_bytes += len;
+ dev_kfree_skb_irq(skb);
+ }
+
+ /*
+ * Make sure that the TX queue is available for sending
+ * (for retries). TX has priority over RX at all times.
+ */
+ netif_wake_queue(dev);
+}
+
+/*
+ * Note that we will never build up a backlog of frames; the protocol is a
+ * half duplex protocol which basically means we transmit a frame, we
+ * receive a frame, we transmit the next frame etc.
+ */
+static int sa1100_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct sa1100_irda *si = dev->priv;
+ int speed = irda_get_next_speed(skb);
+
+ /*
+ * Does this packet contain a request to change the interface
+ * speed? If so, remember it until we complete the transmission
+ * of this frame.
+ */
+ if (speed != si->speed && speed != -1)
+ si->newspeed = speed;
+
+ /*
+ * If this is an empty frame, we can bypass a lot.
+ */
+ if (skb->len == 0) {
+ if (si->newspeed) {
+ si->newspeed = 0;
+ sa1100_irda_set_speed(si, speed);
+ }
+ dev_kfree_skb(skb);


+ return 0;
+ }
+

+ if (!IS_FIR(si)) {
+ si->tx_buff.data = si->tx_buff.head;
+ si->tx_buff.len = async_wrap_skb(skb, si->tx_buff.data,
+ si->tx_buff.truesize);
+
+ /*
+ * Set the transmit interrupt enable. This will fire
+ * off an interrupt immediately. Note that we disable
+ * the receiver so we won't get spurious characteres
+ * received.
+ */
+ Ser2UTCR3 = UTCR3_TIE | UTCR3_TXE;
+
+ dev_kfree_skb(skb);
+ } else {
+ int mtt = irda_get_mtt(skb);
+
+ /*
+ * We must not be transmitting...
+ */
+ if (si->txskb)
+ BUG();
+
+ netif_stop_queue(dev);
+
+ si->txskb = skb;
+ si->txbuf_dma = pci_map_single(NULL, skb->data,
+ skb->len, PCI_DMA_TODEVICE);
+
+ sa1100_dma_queue_buffer(si->txdma, dev, si->txbuf_dma,
+ skb->len);
+
+ /*
+ * If we have a mean turn-around time, impose the specified
+ * specified delay. We could shorten this by timing from
+ * the point we received the packet.
+ */
+ if (mtt)
+ udelay(mtt);
+
+ Ser2HSCR0 = si->hscr0 | HSCR0_HSSP | HSCR0_TXE;
+ }
+
+ dev->trans_start = jiffies;


+
+ return 0;
+}
+

+static int
+sa1100_irda_ioctl(struct net_device *dev, struct ifreq *ifreq, int cmd)
+{
+ struct if_irda_req *rq = (struct if_irda_req *)ifreq;
+ struct sa1100_irda *si = dev->priv;
+ int ret = -EOPNOTSUPP;
+
+ switch (cmd) {
+ case SIOCSBANDWIDTH:
+ if (capable(CAP_NET_ADMIN)) {
+ /*
+ * We are unable to set the speed if the
+ * device is not running.
+ */
+ if (si->open) {
+ ret = sa1100_irda_set_speed(si,
+ rq->ifr_baudrate);
+ } else {
+ printk("sa1100_irda_ioctl: SIOCSBANDWIDTH: !netif_running\n");
+ ret = 0;
+ }
+ }
+ break;
+
+ case SIOCSMEDIABUSY:
+ ret = -EPERM;
+ if (capable(CAP_NET_ADMIN)) {
+ irda_device_set_media_busy(dev, TRUE);
+ ret = 0;
+ }
+ break;
+
+ case SIOCGRECEIVING:
+ rq->ifr_receiving = IS_FIR(si) ? 0
+ : si->rx_buff.state != OUTSIDE_FRAME;


+ break;
+
+ default:

+ break;
+ }
+
+ return ret;
+}
+
+static struct net_device_stats *sa1100_irda_stats(struct net_device *dev)
+{
+ struct sa1100_irda *si = dev->priv;
+ return &si->stats;
+}
+
+static int sa1100_irda_start(struct net_device *dev)
+{
+ struct sa1100_irda *si = dev->priv;
+ int err;
+
+ MOD_INC_USE_COUNT;
+
+ si->speed = 9600;
+
+ err = request_irq(dev->irq, sa1100_irda_irq, 0, dev->name, dev);
+ if (err)
+ goto err_irq;
+
+ err = sa1100_request_dma(&si->rxdma, "IrDA receive", DMA_Ser2HSSPRd);
+ if (err)
+ goto err_rx_dma;
+
+ err = sa1100_request_dma(&si->txdma, "IrDA transmit", DMA_Ser2HSSPWr);
+ if (err)
+ goto err_tx_dma;
+
+ /*
+ * The interrupt must remain disabled for now.
+ */
+ disable_irq(dev->irq);
+
+ /*
+ * Setup the serial port for the specified speed.
+ */
+ err = sa1100_irda_startup(si);
+ if (err)
+ goto err_startup;
+
+ /*
+ * Open a new IrLAP layer instance.
+ */
+ si->irlap = irlap_open(dev, &si->qos, "sa1100");
+ err = -ENOMEM;
+ if (!si->irlap)
+ goto err_irlap;
+
+ sa1100_dma_set_callback(si->txdma, sa1100_irda_txdma_irq);
+
+ /*
+ * Now enable the interrupt and start the queue
+ */
+ si->open = 1;
+ sa1100_set_power(si, power_level); /* low power mode */
+ enable_irq(dev->irq);
+ netif_start_queue(dev);
+ return 0;
+
+err_irlap:
+ si->open = 0;
+ sa1100_irda_shutdown(si);
+err_startup:
+ sa1100_free_dma(si->txdma);
+err_tx_dma:
+ sa1100_free_dma(si->rxdma);
+err_rx_dma:
+ free_irq(dev->irq, dev);
+err_irq:
+ MOD_DEC_USE_COUNT;
+ return err;
+}
+
+static int sa1100_irda_stop(struct net_device *dev)
+{
+ struct sa1100_irda *si = dev->priv;
+
+ disable_irq(dev->irq);
+ sa1100_irda_shutdown(si);
+
+ /*
+ * If we have been doing DMA receive, make sure we
+ * tidy that up cleanly.
+ */
+ if (si->rxskb) {
+ pci_unmap_single(NULL, si->rxbuf_dma, HPSIR_MAX_RXLEN,
+ PCI_DMA_FROMDEVICE);
+ dev_kfree_skb(si->rxskb);
+ si->rxskb = NULL;
+ }
+
+ /* Stop IrLAP */
+ if (si->irlap) {
+ irlap_close(si->irlap);
+ si->irlap = NULL;
+ }
+
+ netif_stop_queue(dev);
+ si->open = 0;
+
+ /*
+ * Free resources
+ */
+ sa1100_free_dma(si->txdma);
+ sa1100_free_dma(si->rxdma);
+ free_irq(dev->irq, dev);
+
+ sa1100_set_power(si, 0);
+
+ MOD_DEC_USE_COUNT;


+
+ return 0;
+}
+

+static int sa1100_irda_init_iobuf(iobuff_t *io, int size)
+{
+ io->head = kmalloc(size, GFP_KERNEL | GFP_DMA);
+ if (io->head != NULL) {
+ io->truesize = size;
+ io->in_frame = FALSE;
+ io->state = OUTSIDE_FRAME;
+ io->data = io->head;
+ }
+ return io->head ? 0 : -ENOMEM;
+}
+
+static int sa1100_irda_net_init(struct net_device *dev)
+{
+ struct sa1100_irda *si = dev->priv;
+ unsigned int baudrate_mask;
+ int err = -ENOMEM;
+
+ si = kmalloc(sizeof(struct sa1100_irda), GFP_KERNEL);
+ if (!si)
+ goto out;
+
+ memset(si, 0, sizeof(*si));
+
+ /*
+ * Initialise the HP-SIR buffers
+ */
+ err = sa1100_irda_init_iobuf(&si->rx_buff, 14384);
+ if (err)
+ goto out;
+ err = sa1100_irda_init_iobuf(&si->tx_buff, 4000);
+ if (err)
+ goto out_free_rx;
+
+ dev->priv = si;
+ dev->hard_start_xmit = sa1100_irda_hard_xmit;
+ dev->open = sa1100_irda_start;
+ dev->stop = sa1100_irda_stop;
+ dev->do_ioctl = sa1100_irda_ioctl;
+ dev->get_stats = sa1100_irda_stats;
+
+ irda_device_setup(dev);
+ irda_init_max_qos_capabilies(&si->qos);
+
+ /*
+ * We support original IRDA up to 115k2. (we don't currently
+ * support 4Mbps). Min Turn Time set to 1ms or greater.
+ */
+ baudrate_mask = IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
+ baudrate_mask |= IR_4000000 << 8;
+ si->qos.baud_rate.bits &= baudrate_mask;
+ si->qos.min_turn_time.bits = 7;
+
+ irda_qos_bits_to_value(&si->qos);
+
+ si->utcr4 = UTCR4_HPSIR;
+ if (tx_lpm)
+ si->utcr4 |= UTCR4_Z1_6us;
+
+ /*
+ * Initially enable HP-SIR modulation, and ensure that the port
+ * is disabled.
+ */
+ Ser2UTCR3 = 0;
+ Ser2UTCR4 = si->utcr4;
+ Ser2HSCR0 = HSCR0_UART;
+
+#ifdef CONFIG_PM
+ /*
+ * Power-Management is optional.
+ */
+ si->pmdev = pm_register(PM_SYS_DEV, PM_SYS_IRDA, sa1100_irda_pmproc);
+ if (si->pmdev)
+ si->pmdev->data = dev;
+#endif


+
+ return 0;
+

+ kfree(si->tx_buff.head);
+out_free_rx:
+ kfree(si->rx_buff.head);
+out:
+ kfree(si);
+
+ return err;
+}
+
+/*
+ * Remove all traces of this driver module from the kernel, so we can't be
+ * called. Note that the device has already been stopped, so we don't have
+ * to worry about interrupts or dma.
+ */
+static void sa1100_irda_net_uninit(struct net_device *dev)
+{
+ struct sa1100_irda *si = dev->priv;
+
+ dev->hard_start_xmit = NULL;
+ dev->open = NULL;
+ dev->stop = NULL;
+ dev->do_ioctl = NULL;
+ dev->get_stats = NULL;
+ dev->priv = NULL;
+
+ pm_unregister(si->pmdev);
+
+ kfree(si->tx_buff.head);
+ kfree(si->rx_buff.head);
+ kfree(si);


+}
+
+#ifdef MODULE
+static
+#endif

+int __init sa1100_irda_init(void)
+{
+ struct net_device *dev;
+ int err;
+
+ /*
+ * Limit power level a sensible range.
+ */
+ if (power_level < 1)
+ power_level = 1;
+ if (power_level > 3)
+ power_level = 3;
+
+ err = request_mem_region(__PREG(Ser2UTCR0), 0x24, "IrDA") ? 0 : -EBUSY;
+ if (err)
+ goto err_mem_1;
+ err = request_mem_region(__PREG(Ser2HSCR0), 0x1c, "IrDA") ? 0 : -EBUSY;
+ if (err)
+ goto err_mem_2;
+ err = request_mem_region(__PREG(Ser2HSCR2), 0x04, "IrDA") ? 0 : -EBUSY;
+ if (err)
+ goto err_mem_3;
+
+ rtnl_lock();
+ dev = dev_alloc("irda%d", &err);
+ if (dev) {
+ dev->irq = IRQ_Ser2ICP;
+ dev->init = sa1100_irda_net_init;
+ dev->uninit = sa1100_irda_net_uninit;
+
+ err = register_netdevice(dev);
+
+ if (err)
+ kfree(dev);
+ else
+ netdev = dev;
+ }
+ rtnl_unlock();
+
+ if (err) {
+ release_mem_region(__PREG(Ser2HSCR2), 0x04);
+err_mem_3:
+ release_mem_region(__PREG(Ser2HSCR0), 0x1c);
+err_mem_2:
+ release_mem_region(__PREG(Ser2UTCR0), 0x24);
+ }
+err_mem_1:
+ return err;
+}
+
+static void __exit sa1100_irda_exit(void)
+{
+ struct net_device *dev = netdev;
+
+ netdev = NULL;
+ if (dev) {
+ rtnl_lock();
+ unregister_netdevice(dev);
+ rtnl_unlock();
+ }
+
+ release_mem_region(__PREG(Ser2HSCR2), 0x04);
+ release_mem_region(__PREG(Ser2HSCR0), 0x1c);
+ release_mem_region(__PREG(Ser2UTCR0), 0x24);
+
+ /*
+ * We now know that the netdevice is no longer in use, and all
+ * references to our driver have been removed. The only structure
+ * which may still be present is the netdevice, which will get
+ * cleaned up by net/core/dev.c
+ */
+}
+
+#ifdef MODULE
+module_init(sa1100_irda_init);
+module_exit(sa1100_irda_exit);
+#endif
+
+MODULE_AUTHOR("Russell King <r...@arm.linux.org.uk>");
+MODULE_DESCRIPTION("StrongARM SA1100 IrDA driver");
+MODULE_LICENSE("GPL");
+MODULE_PARM(power_level, "i");
+MODULE_PARM_DESC(power_level, "IrDA power level, 1 (low) to 3 (high)");
+MODULE_PARM(tx_lpm, "i");
+MODULE_PARM_DESC(tx_lpm, "Enable transmitter low power (1.6us) mode");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-file v2.4.13/linux/drivers/net/natsemi.c linux/drivers/net/natsemi.c
--- v2.4.13/linux/drivers/net/natsemi.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/net/natsemi.c Thu Oct 25 14:01:51 2001
@@ -85,6 +85,15 @@
X * use long for ee_addr (various)
X * print pointers properly (DaveM)
X * include asm/irq.h (?)
+
+ version 1.0.11:
+ * check and reset if PHY errors appear (Adrian Sun)
+ * WoL cleanup (Tim Hockin)
+ * Magic number cleanup (Tim Hockin)
+ * Don't reload EEPROM on every reset (Tim Hockin)
+ * Save and restore EEPROM state across reset (Tim Hockin)
+ * MDIO Cleanup (Tim Hockin)
+ * Reformat register offsets/bits (jgarzik)
X
X TODO:
X * big endian support with CFG:BEM instead of cpu_to_le32
@@ -93,9 +102,8 @@
X */
X
X #define DRV_NAME "natsemi"
-#define DRV_VERSION "1.07+LK1.0.10"
-#define DRV_RELDATE "Oct 09, 2001"
-
+#define DRV_VERSION "1.07+LK1.0.11"
+#define DRV_RELDATE "Oct 19, 2001"
X
X /* Updated to recommendations in pci-skeleton v2.03. */
X
@@ -106,7 +114,7 @@
X c-help-name: National Semiconductor DP8381x series PCI Ethernet support
X c-help-symbol: CONFIG_NATSEMI
X c-help: This driver is for the National Semiconductor DP8381x series,
-c-help: including the 83815 chip.
+c-help: including the 8381[56] chips.
X c-help: More specific information and updates are available from
X c-help: http://www.scyld.com/network/natsemi.html
X */
@@ -114,10 +122,12 @@
X /* The user-configurable values.
X These may be modified when a driver module is loaded.*/
X
-static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */
+static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */
+
X /* Maximum events (Rx packets, etc.) to handle at each interrupt. */
X static int max_interrupt_work = 20;
X static int mtu;
+
X /* Maximum number of multicast addresses to filter (vs. rx-all-multicast).
X This chip uses a 512 element hash table based on the Ethernet CRC. */
X static int multicast_filter_limit = 100;
@@ -143,16 +153,17 @@
X bonding and packet priority.
X There are no ill effects from too-large receive rings. */
X #define TX_RING_SIZE 16
-#define TX_QUEUE_LEN 10 /* Limit ring entries actually used, min 4. */
-#define RX_RING_SIZE 32
+#define TX_QUEUE_LEN 10 /* Limit ring entries actually used, min 4. */
+#define RX_RING_SIZE 64
X
X /* Operational parameters that usually are not changed. */
X /* Time in jiffies before concluding the transmitter is hung. */
X #define TX_TIMEOUT (2*HZ)
X
X #define NATSEMI_HW_TIMEOUT 400
+#define NATSEMI_TIMER_FREQ 3*HZ
X
-#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer.*/
+#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */
X
X #if !defined(__OPTIMIZE__)
X #warning You must compile this file with the correct options!
@@ -179,7 +190,7 @@
X #include <linux/delay.h>
X #include <linux/rtnetlink.h>
X #include <linux/mii.h>
-#include <asm/processor.h> /* Processor type for cache alignment. */
+#include <asm/processor.h> /* Processor type for cache alignment. */
X #include <asm/bitops.h>
X #include <asm/io.h>
X #include <asm/irq.h>
@@ -308,11 +319,11 @@
X const char *name;
X unsigned long flags;
X } natsemi_pci_info[] __devinitdata = {
- { "NatSemi DP83815", PCI_IOTYPE },
+ { "NatSemi DP8381[56]", PCI_IOTYPE },
X };
X
X static struct pci_device_id natsemi_pci_tbl[] __devinitdata = {
- { 0x100B, 0x0020, PCI_ANY_ID, PCI_ANY_ID, },
+ { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_83815, PCI_ANY_ID, PCI_ANY_ID, },
X { 0, },
X };
X MODULE_DEVICE_TABLE(pci, natsemi_pci_tbl);
@@ -323,88 +334,222 @@
X device.
X */
X enum register_offsets {
- ChipCmd=0x00, ChipConfig=0x04, EECtrl=0x08, PCIBusCfg=0x0C,
- IntrStatus=0x10, IntrMask=0x14, IntrEnable=0x18,
- TxRingPtr=0x20, TxConfig=0x24,
- RxRingPtr=0x30, RxConfig=0x34, ClkRun=0x3C,
- WOLCmd=0x40, PauseCmd=0x44, RxFilterAddr=0x48, RxFilterData=0x4C,
- BootRomAddr=0x50, BootRomData=0x54, SiliconRev=0x58, StatsCtrl=0x5C,
- StatsData=0x60, RxPktErrs=0x60, RxMissed=0x68, RxCRCErrs=0x64,
- BasicControl=0x80, BasicStatus=0x84,
- AnegAdv=0x90, AnegPeer = 0x94, PhyStatus=0xC0, MIntrCtrl=0xC4,
- MIntrStatus=0xC8, PhyCtrl=0xE4,
+ ChipCmd = 0x00,
+ ChipConfig = 0x04,
+ EECtrl = 0x08,
+ PCIBusCfg = 0x0C,
+ IntrStatus = 0x10,
+ IntrMask = 0x14,
+ IntrEnable = 0x18,
+ TxRingPtr = 0x20,
+ TxConfig = 0x24,
+ RxRingPtr = 0x30,
+ RxConfig = 0x34,
+ ClkRun = 0x3C,
+ WOLCmd = 0x40,
+ PauseCmd = 0x44,
+ RxFilterAddr = 0x48,
+ RxFilterData = 0x4C,
+ BootRomAddr = 0x50,
+ BootRomData = 0x54,
+ SiliconRev = 0x58,
+ StatsCtrl = 0x5C,
+ StatsData = 0x60,
+ RxPktErrs = 0x60,
+ RxMissed = 0x68,
+ RxCRCErrs = 0x64,
+ BasicControl = 0x80,
+ BasicStatus = 0x84,
+ AnegAdv = 0x90,
+ AnegPeer = 0x94,
+ PhyStatus = 0xC0,
+ MIntrCtrl = 0xC4,
+ MIntrStatus = 0xC8,
+ PhyCtrl = 0xE4,
X
X /* These are from the spec, around page 78... on a separate table.
X * The meaning of these registers depend on the value of PGSEL. */
- PGSEL=0xCC, PMDCSR=0xE4, TSTDAT=0xFC, DSPCFG=0xF4, SDCFG=0x8C
+ PGSEL = 0xCC,
+ PMDCSR = 0xE4,
+ TSTDAT = 0xFC,
+ DSPCFG = 0xF4,
+ SDCFG = 0xF8
X };
+/* the values for the 'magic' registers above (PGSEL=1) */
+#define PMDCSR_VAL 0x189C
+#define TSTDAT_VAL 0x0
+#define DSPCFG_VAL 0x5040
+#define SDCFG_VAL 0x008c
X
X /* misc PCI space registers */
-enum PCISpaceRegs {
- PCIPM=0x44,
+enum pci_register_offsets {
+ PCIPM = 0x44,
+};
+
+enum ChipCmd_bits {
+ ChipReset = 0x100,
+ RxReset = 0x20,
+ TxReset = 0x10,
+ RxOff = 0x08,
+ RxOn = 0x04,
+ TxOff = 0x02,
+ TxOn = 0x01,
+};
+
+enum ChipConfig_bits {
+ CfgPhyDis = 0x200,
+ CfgPhyRst = 0x400,
+ CfgAnegEnable = 0x2000,
+ CfgAneg100 = 0x4000,
+ CfgAnegFull = 0x8000,
+ CfgAnegDone = 0x8000000,
+ CfgFullDuplex = 0x20000000,
+ CfgSpeed100 = 0x40000000,
+ CfgLink = 0x80000000,
X };
X
-/* Bit in ChipCmd. */
-enum ChipCmdBits {
- ChipReset=0x100, RxReset=0x20, TxReset=0x10, RxOff=0x08, RxOn=0x04,
- TxOff=0x02, TxOn=0x01,
+enum EECtrl_bits {
+ EE_ShiftClk = 0x04,
+ EE_DataIn = 0x01,
+ EE_ChipSelect = 0x08,
+ EE_DataOut = 0x02,
X };
X
-enum PCIBusCfgBits {
- EepromReload=0x4,
+enum PCIBusCfg_bits {
+ EepromReload = 0x4,
X };
X
X /* Bits in the interrupt status/mask registers. */
-enum intr_status_bits {
- IntrRxDone=0x0001, IntrRxIntr=0x0002, IntrRxErr=0x0004, IntrRxEarly=0x0008,
- IntrRxIdle=0x0010, IntrRxOverrun=0x0020,
- IntrTxDone=0x0040, IntrTxIntr=0x0080, IntrTxErr=0x0100,
- IntrTxIdle=0x0200, IntrTxUnderrun=0x0400,
- StatsMax=0x0800, LinkChange=0x4000,
- WOLPkt=0x2000,
- RxResetDone=0x1000000, TxResetDone=0x2000000,
- IntrPCIErr=0x00f00000,
- IntrNormalSummary=0x025f, IntrAbnormalSummary=0xCD20,
+enum IntrStatus_bits {
+ IntrRxDone = 0x0001,
+ IntrRxIntr = 0x0002,
+ IntrRxErr = 0x0004,
+ IntrRxEarly = 0x0008,
+ IntrRxIdle = 0x0010,
+ IntrRxOverrun = 0x0020,
+ IntrTxDone = 0x0040,
+ IntrTxIntr = 0x0080,
+ IntrTxErr = 0x0100,
+ IntrTxIdle = 0x0200,
+ IntrTxUnderrun = 0x0400,
+ StatsMax = 0x0800,
+ SWInt = 0x1000,
+ WOLPkt = 0x2000,
+ LinkChange = 0x4000,
+ IntrHighBits = 0x8000,
+ RxStatusFIFOOver = 0x10000,
+ IntrPCIErr = 0xf00000,
+ RxResetDone = 0x1000000,
+ TxResetDone = 0x2000000,
+ IntrAbnormalSummary = 0xCD20,
X };
X
+/*
+ * Default Interrupts:
+ * Rx OK, Rx Packet Error, Rx Overrun,
+ * Tx OK, Tx Packet Error, Tx Underrun,
+ * MIB Service, Phy Interrupt, High Bits,
+ * Rx Status FIFO overrun,
+ * Received Target Abort, Received Master Abort,
+ * Signalled System Error, Received Parity Error
+ */
X #define DEFAULT_INTR 0x00f1cd65
X
-/* Bits in the RxMode register. */
-enum rx_mode_bits {
- AcceptErr=0x20, AcceptRunt=0x10,
- AcceptBroadcast=0xC0000000,
- AcceptMulticast=0x00200000, AcceptAllMulticast=0x20000000,
- AcceptAllPhys=0x10000000, AcceptMyPhys=0x08000000,
-};
-
-/* Bits in WOLCmd register. */
-enum wol_bits {
- WakePhy=0x1, WakeUnicast=0x2, WakeMulticast=0x4, WakeBroadcast=0x8,
- WakeArp=0x10, WakePMatch0=0x20, WakePMatch1=0x40, WakePMatch2=0x80,
- WakePMatch3=0x100, WakeMagic=0x200, WakeMagicSecure=0x400,
- SecureHack=0x100000, WokePhy=0x400000, WokeUnicast=0x800000,
- WokeMulticast=0x1000000, WokeBroadcast=0x2000000, WokeArp=0x4000000,
- WokePMatch0=0x8000000, WokePMatch1=0x10000000, WokePMatch2=0x20000000,
- WokePMatch3=0x40000000, WokeMagic=0x80000000, WakeOptsSummary=0x7ff
-};
-
-enum aneg_bits {
- Aneg10BaseT=0x20, Aneg10BaseTFull=0x40,
- Aneg100BaseT=0x80, Aneg100BaseTFull=0x100,
-};
-
-enum config_bits {
- CfgPhyDis=0x200, CfgPhyRst=0x400, CfgAnegEnable=0x2000,
- CfgAneg100=0x4000, CfgAnegFull=0x8000, CfgAnegDone=0x8000000,
- CfgFullDuplex=0x20000000,
- CfgSpeed100=0x40000000, CfgLink=0x80000000,
-};
-
-enum bmcr_bits {
- BMCRDuplex=0x100, BMCRAnegRestart=0x200, BMCRAnegEnable=0x1000,
- BMCRSpeed=0x2000, BMCRPhyReset=0x8000,
+enum TxConfig_bits {
+ TxDrthMask = 0x3f,
+ TxFlthMask = 0x3f00,
+ TxMxdmaMask = 0x700000,
+ TxMxdma_512 = 0x0,
+ TxMxdma_4 = 0x100000,
+ TxMxdma_8 = 0x200000,
+ TxMxdma_16 = 0x300000,
+ TxMxdma_32 = 0x400000,
+ TxMxdma_64 = 0x500000,
+ TxMxdma_128 = 0x600000,
+ TxMxdma_256 = 0x700000,
+ TxCollRetry = 0x800000,
+ TxAutoPad = 0x10000000,
+ TxMacLoop = 0x20000000,
+ TxHeartIgn = 0x40000000,
+ TxCarrierIgn = 0x80000000
+};
+
+enum RxConfig_bits {
+ RxDrthMask = 0x3e,
+ RxMxdmaMask = 0x700000,
+ RxMxdma_512 = 0x0,
+ RxMxdma_4 = 0x100000,
+ RxMxdma_8 = 0x200000,
+ RxMxdma_16 = 0x300000,
+ RxMxdma_32 = 0x400000,
+ RxMxdma_64 = 0x500000,
+ RxMxdma_128 = 0x600000,
+ RxMxdma_256 = 0x700000,
+ RxAcceptLong = 0x8000000,
+ RxAcceptTx = 0x10000000,
+ RxAcceptRunt = 0x40000000,
+ RxAcceptErr = 0x80000000
+};
+
+enum ClkRun_bits {
+ PMEEnable = 0x100,
+ PMEStatus = 0x8000,
+};
+
+enum WolCmd_bits {
+ WakePhy = 0x1,
+ WakeUnicast = 0x2,
+ WakeMulticast = 0x4,
+ WakeBroadcast = 0x8,
+ WakeArp = 0x10,
+ WakePMatch0 = 0x20,
+ WakePMatch1 = 0x40,
+ WakePMatch2 = 0x80,
+ WakePMatch3 = 0x100,
+ WakeMagic = 0x200,
+ WakeMagicSecure = 0x400,
+ SecureHack = 0x100000,
+ WokePhy = 0x400000,
+ WokeUnicast = 0x800000,
+ WokeMulticast = 0x1000000,
+ WokeBroadcast = 0x2000000,
+ WokeArp = 0x4000000,
+ WokePMatch0 = 0x8000000,
+ WokePMatch1 = 0x10000000,
+ WokePMatch2 = 0x20000000,
+ WokePMatch3 = 0x40000000,
+ WokeMagic = 0x80000000,
+ WakeOptsSummary = 0x7ff
X };
X
+enum RxFilterAddr_bits {
+ RFCRAddressMask = 0x3ff,
+ AcceptMulticast = 0x00200000,
+ AcceptMyPhys = 0x08000000,
+ AcceptAllPhys = 0x10000000,
+ AcceptAllMulticast = 0x20000000,
+ AcceptBroadcast = 0x40000000,
+ RxFilterEnable = 0x80000000
+};
+
+enum StatsCtrl_bits {
+ StatsWarn = 0x1,
+ StatsFreeze = 0x2,
+ StatsClear = 0x4,
+ StatsStrobe = 0x8,
+};
+
+enum MIntrCtrl_bits {
+ MICRIntEn = 0x2,
+};
+
+enum PhyCtrl_bits {
+ PhyAddrMask = 0xf,
+};
+
+#define SRR_REV_C 0x0302
+#define SRR_REV_D 0x0403
+
X /* The Rx and Tx buffer descriptors. */
X /* Note that using only 32 bit fields simplifies conversion to big-endian
X architectures. */
@@ -418,8 +563,19 @@
X /* Bits in network_desc.status */
X enum desc_status_bits {
X DescOwn=0x80000000, DescMore=0x40000000, DescIntr=0x20000000,
- DescNoCRC=0x10000000,
- DescPktOK=0x08000000, RxTooLong=0x00400000,
+ DescNoCRC=0x10000000, DescPktOK=0x08000000,
+ DescSizeMask=0xfff,
+
+ DescTxAbort=0x04000000, DescTxFIFO=0x02000000,
+ DescTxCarrier=0x01000000, DescTxDefer=0x00800000,
+ DescTxExcDefer=0x00400000, DescTxOOWCol=0x00200000,
+ DescTxExcColl=0x00100000, DescTxCollCount=0x000f0000,
+
+ DescRxAbort=0x04000000, DescRxOver=0x02000000,
+ DescRxDest=0x01800000, DescRxLong=0x00400000,
+ DescRxRunt=0x00200000, DescRxInvalid=0x00100000,
+ DescRxCRC=0x00080000, DescRxAlign=0x00040000,
+ DescRxLoop=0x00020000, DesRxColl=0x00010000,
X };
X
X struct netdev_private {
@@ -450,17 +606,21 @@
X u32 tx_config, rx_config;
X /* original contents of ClkRun register */
X u32 SavedClkRun;
+ /* silicon revision */
+ u32 srr;
X /* MII transceiver section. */
- u16 advertising; /* NWay media advertisement */
+ u16 advertising; /* NWay media advertisement */
X unsigned int iosize;
X spinlock_t lock;
X };
X
-static int eeprom_read(long ioaddr, int location);
-static int mdio_read(struct net_device *dev, int phy_id, int location);
+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);
X static void natsemi_reset(struct net_device *dev);
+static void natsemi_reload_eeprom(struct net_device *dev);
X static void natsemi_stop_rxtx(struct net_device *dev);
-static int netdev_open(struct net_device *dev);
+static int netdev_open(struct net_device *dev);
X static void check_link(struct net_device *dev);
X static void netdev_timer(unsigned long data);
X static void tx_timeout(struct net_device *dev);
@@ -469,7 +629,7 @@
X static void drain_ring(struct net_device *dev);
X static void free_ring(struct net_device *dev);
X static void init_registers(struct net_device *dev);
-static int start_tx(struct sk_buff *skb, struct net_device *dev);
+static int start_tx(struct sk_buff *skb, struct net_device *dev);
X static void intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
X static void netdev_error(struct net_device *dev, int intr_status);
X static void netdev_rx(struct net_device *dev);
@@ -486,7 +646,7 @@
X static int netdev_get_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd);
X static int netdev_set_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd);
X static void enable_wol_mode(struct net_device *dev, int enable_intr);
-static int netdev_close(struct net_device *dev);
+static int netdev_close(struct net_device *dev);
X
X
X static int __devinit natsemi_probe1 (struct pci_dev *pdev,
@@ -516,9 +676,9 @@
X * to be brought to D0 in this manner.
X */
X pci_read_config_dword(pdev, PCIPM, &tmp);
- if (tmp & (0x03|0x100)) {
+ if (tmp & PCI_PM_CTRL_STATE_MASK) {
X /* D0 state, disable PME assertion */
- u32 newtmp = tmp & ~(0x03|0x100);
+ u32 newtmp = tmp & ~PCI_PM_CTRL_STATE_MASK;
X pci_write_config_dword(pdev, PCIPM, newtmp);
X }
X
@@ -571,7 +731,9 @@
X spin_lock_init(&np->lock);
X
X /* Reset the chip to erase previous misconfiguration. */
+ natsemi_reload_eeprom(dev);
X natsemi_reset(dev);
+
X option = find_cnt < MAX_UNITS ? options[find_cnt] : 0;
X if (dev->mem_start)
X option = dev->mem_start;
@@ -616,20 +778,23 @@
X printk("%2.2x:", dev->dev_addr[i]);
X printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq);
X
- np->advertising = mdio_read(dev, 1, 4);
+ np->advertising = mdio_read(dev, 1, MII_ADVERTISE);
X if ((readl(ioaddr + ChipConfig) & 0xe000) != 0xe000) {
X u32 chip_config = readl(ioaddr + ChipConfig);
X printk(KERN_INFO "%s: Transceiver default autonegotiation %s "
X "10%s %s duplex.\n",
X dev->name,
- chip_config & 0x2000 ? "enabled, advertise" : "disabled, force",
- chip_config & 0x4000 ? "0" : "",
- chip_config & 0x8000 ? "full" : "half");
+ chip_config & CfgAnegEnable ? "enabled, advertise" : "disabled, force",
+ chip_config & CfgAneg100 ? "0" : "",
+ chip_config & CfgAnegFull ? "full" : "half");
X }
X printk(KERN_INFO "%s: Transceiver status 0x%4.4x advertising %4.4x.\n",
- dev->name, (int)readl(ioaddr + BasicStatus),
+ dev->name, (int)mdio_read(dev, 1, MII_BMSR),
X np->advertising);
X
+ /* save the silicon revision for later querying */
+ np->srr = readl(ioaddr + SiliconRev);
+


X return 0;
X }
X

@@ -646,9 +811,6 @@
X */
X #define eeprom_delay(ee_addr) readl(ee_addr)
X
-enum EEPROM_Ctrl_Bits {
- EE_ShiftClk=0x04, EE_DataIn=0x01, EE_ChipSelect=0x08, EE_DataOut=0x02,
-};
X #define EE_Write0 (EE_ChipSelect)
X #define EE_Write1 (EE_ChipSelect | EE_DataIn)
X
@@ -694,18 +856,67 @@
X The 83815 series has an internal transceiver, and we present the
X management registers as if they were MII connected. */
X
-static int mdio_read(struct net_device *dev, int phy_id, int location)
+static int mdio_read(struct net_device *dev, int phy_id, int reg)
X {
- if (phy_id == 1 && location < 32)
- return readl(dev->base_addr+BasicControl+(location<<2))&0xffff;
+ if (phy_id == 1 && reg < 32)
+ return readl(dev->base_addr+BasicControl+(reg<<2))&0xffff;
X else
X return 0xffff;
X }
X
+static void mdio_write(struct net_device *dev, int phy_id, int reg, u16 data)
+{
+ struct netdev_private *np = dev->priv;
+ if (phy_id == 1 && reg < 32) {
+ writew(data, dev->base_addr+BasicControl+(reg<<2));
+ switch (reg) {
+ case MII_ADVERTISE: np->advertising = data; break;
+ }
+ }
+}
+
+/* CFG bits [13:16] [18:23] */
+#define CFG_RESET_SAVE 0xfde000
+/* WCSR bits [0:4] [9:10] */
+#define WCSR_RESET_SAVE 0x61f
+/* RFCR bits [20] [22] [27:31] */
+#define RFCR_RESET_SAVE 0xf8500000;
+
X static void natsemi_reset(struct net_device *dev)
X {
X int i;
+ u32 cfg;
+ u32 wcsr;
+ u32 rfcr;
+ u16 pmatch[3];
+ u16 sopass[3];
+
+ /*
+ * Resetting the chip causes some registers to be lost.
+ * Natsemi suggests NOT reloading the EEPROM while live, so instead
+ * we save the state that would have been loaded from EEPROM
+ * on a normal power-up (see the spec EEPROM map). This assumes
+ * whoever calls this will follow up with init_registers() eventually.
+ */
X
+ /* CFG */
+ cfg = readl(dev->base_addr + ChipConfig) & CFG_RESET_SAVE;
+ /* WCSR */
+ wcsr = readl(dev->base_addr + WOLCmd) & WCSR_RESET_SAVE;
+ /* RFCR */
+ rfcr = readl(dev->base_addr + RxFilterAddr) & RFCR_RESET_SAVE;
+ /* PMATCH */
+ for (i = 0; i < 3; i++) {
+ writel(i*2, dev->base_addr + RxFilterAddr);
+ pmatch[i] = readw(dev->base_addr + RxFilterData);
+ }
+ /* SOPAS */
+ for (i = 0; i < 3; i++) {
+ writel(0xa+(i*2), dev->base_addr + RxFilterAddr);
+ sopass[i] = readw(dev->base_addr + RxFilterData);
+ }
+
+ /* now whack the chip */
X writel(ChipReset, dev->base_addr + ChipCmd);
X for (i=0;i<NATSEMI_HW_TIMEOUT;i++) {
X if (!(readl(dev->base_addr + ChipCmd) & ChipReset))
@@ -720,6 +931,32 @@
X dev->name, i*5);
X }
X
+ /* restore CFG */
+ cfg |= readl(dev->base_addr + ChipConfig) & ~CFG_RESET_SAVE;
+ writel(cfg, dev->base_addr + ChipConfig);
+ /* restore WCSR */
+ wcsr |= readl(dev->base_addr + WOLCmd) & ~WCSR_RESET_SAVE;
+ writel(wcsr, dev->base_addr + WOLCmd);
+ /* read RFCR */
+ rfcr |= readl(dev->base_addr + RxFilterAddr) & ~RFCR_RESET_SAVE;
+ /* restore PMATCH */
+ for (i = 0; i < 3; i++) {
+ writel(i*2, dev->base_addr + RxFilterAddr);
+ writew(pmatch[i], dev->base_addr + RxFilterData);
+ }
+ for (i = 0; i < 3; i++) {
+ writel(0xa+(i*2), dev->base_addr + RxFilterAddr);
+ writew(sopass[i], dev->base_addr + RxFilterData);
+ }
+ /* restore RFCR */
+ writel(rfcr, dev->base_addr + RxFilterAddr);
+
+}
+
+static void natsemi_reload_eeprom(struct net_device *dev)


+{
+ int i;
+

X writel(EepromReload, dev->base_addr + PCIBusCfg);
X for (i=0;i<NATSEMI_HW_TIMEOUT;i++) {
X if (!(readl(dev->base_addr + PCIBusCfg) & EepromReload))
@@ -788,9 +1025,9 @@
X
X /* Set the timer to check for link beat. */
X init_timer(&np->timer);
- np->timer.expires = jiffies + 3*HZ;
+ np->timer.expires = jiffies + NATSEMI_TIMER_FREQ;
X np->timer.data = (unsigned long)dev;
- np->timer.function = &netdev_timer; /* timer handler */
+ np->timer.function = &netdev_timer; /* timer handler */
X add_timer(&np->timer);
X
X return 0;
@@ -803,7 +1040,7 @@
X int duplex;
X int chipcfg = readl(ioaddr + ChipConfig);
X
- if(!(chipcfg & 0x80000000)) {
+ if(!(chipcfg & CfgLink)) {
X if (netif_carrier_ok(dev)) {
X if (debug)
X printk(KERN_INFO "%s: no link. Disabling watchdog.\n",
@@ -819,20 +1056,20 @@
X netif_carrier_on(dev);
X }
X
- duplex = np->full_duplex || (chipcfg & 0x20000000 ? 1 : 0);
+ duplex = np->full_duplex || (chipcfg & CfgFullDuplex ? 1 : 0);
X
X /* if duplex is set then bit 28 must be set, too */
- if (duplex ^ !!(np->rx_config & 0x10000000)) {
+ if (duplex ^ !!(np->rx_config & RxAcceptTx)) {
X if (debug)
X printk(KERN_INFO "%s: Setting %s-duplex based on negotiated link"
X " capability.\n", dev->name,
X duplex ? "full" : "half");
X if (duplex) {
- np->rx_config |= 0x10000000;
- np->tx_config |= 0xC0000000;
+ np->rx_config |= RxAcceptTx;
+ np->tx_config |= TxCarrierIgn | TxHeartIgn;
X } else {
- np->rx_config &= ~0x10000000;
- np->tx_config &= ~0xC0000000;
+ np->rx_config &= ~RxAcceptTx;
+ np->tx_config &= ~(TxCarrierIgn | TxHeartIgn);
X }
X writel(np->tx_config, ioaddr + TxConfig);
X writel(np->rx_config, ioaddr + RxConfig);
@@ -845,9 +1082,21 @@
X long ioaddr = dev->base_addr;
X int i;
X
+ /* save the silicon revision for later */
X if (debug > 4)
X printk(KERN_DEBUG "%s: found silicon revision %xh.\n",
- dev->name, readl(ioaddr + SiliconRev));
+ dev->name, np->srr);
+
+ for (i=0;i<NATSEMI_HW_TIMEOUT;i++) {
+ if (readl(dev->base_addr + ChipConfig) & CfgAnegDone)
+ break;
+ udelay(10);
+ }
+ if (i==NATSEMI_HW_TIMEOUT && debug) {
+ printk(KERN_INFO
+ "%s: autonegotiation did not complete in %d usec.\n",
+ dev->name, i*10);
+ }
X
X /* On page 78 of the spec, they recommend some settings for "optimum
X performance" to be done in sequence. These settings optimize some
@@ -856,26 +1105,26 @@
X Kennedy) recommends always setting them. If you don't, you get
X errors on some autonegotiations that make the device unusable.
X */
- writew(0x0001, ioaddr + PGSEL);
- writew(0x189C, ioaddr + PMDCSR);
- writew(0x0000, ioaddr + TSTDAT);
- writew(0x5040, ioaddr + DSPCFG);
- writew(0x008C, ioaddr + SDCFG);
- writew(0x0000, ioaddr + PGSEL);
+ 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);
X
X /* Enable PHY Specific event based interrupts. Link state change
X and Auto-Negotiation Completion are among the affected.
+ Read the intr status to clear it (needed for wake events).
X */
- writew(0x0002, ioaddr + MIntrCtrl);
+ readw(ioaddr + MIntrStatus);
+ writew(MICRIntEn, ioaddr + MIntrCtrl);
X
- writel(np->ring_dma, ioaddr + RxRingPtr);
- writel(np->ring_dma + RX_RING_SIZE * sizeof(struct netdev_desc), ioaddr + TxRingPtr);
+ /* clear any interrupts that are pending, such as wake events */
+ readl(ioaddr + IntrStatus);
X
- for (i = 0; i < ETH_ALEN; i += 2) {
- writel(i, ioaddr + RxFilterAddr);
- writew(dev->dev_addr[i] + (dev->dev_addr[i+1] << 8),
- ioaddr + RxFilterData);
- }
+ writel(np->ring_dma, ioaddr + RxRingPtr);
+ writel(np->ring_dma + RX_RING_SIZE * sizeof(struct netdev_desc),
+ ioaddr + TxRingPtr);
X
X /* Initialize other registers.
X * Configure the PCI bus bursts and FIFO thresholds.
@@ -891,12 +1140,13 @@
X * ECRETRY=1
X * ATP=1
X */
- np->tx_config = 0x10f01002;
+ np->tx_config = TxAutoPad | TxCollRetry | TxMxdma_256 | (0x1002);
+ writel(np->tx_config, ioaddr + TxConfig);
+
X /* DRTH 0x10: start copying to memory if 128 bytes are in the fifo
X * MXDMA 0: up to 256 byte bursts
X */
- np->rx_config = 0x700020;
- writel(np->tx_config, ioaddr + TxConfig);
+ np->rx_config = RxMxdma_256 | 0x20;
X writel(np->rx_config, ioaddr + RxConfig);
X
X /* Disable PME:
@@ -906,24 +1156,37 @@
X * With PME set the chip will scan incoming packets but
X * nothing will be written to memory. */
X np->SavedClkRun = readl(ioaddr + ClkRun);
- writel(np->SavedClkRun & ~0x100, ioaddr + ClkRun);
+ writel(np->SavedClkRun & ~PMEEnable, ioaddr + ClkRun);
+ if (np->SavedClkRun & PMEStatus) {
+ printk(KERN_NOTICE "%s: Wake-up event %8.8x\n",
+ dev->name, readl(ioaddr + WOLCmd));
+ }
X
X check_link(dev);
X __set_rx_mode(dev);
X
X /* Enable interrupts by setting the interrupt mask. */
- writel(DEFAULT_INTR, ioaddr + IntrMask);
+ writel(DEFAULT_INTR, ioaddr + IntrMask);
X writel(1, ioaddr + IntrEnable);
X
X writel(RxOn | TxOn, ioaddr + ChipCmd);
- writel(4, ioaddr + StatsCtrl); /* Clear Stats */
+ writel(StatsClear, ioaddr + StatsCtrl); /* Clear Stats */
X }
X
+/*
+ * The frequency on this has been increased because of a nasty little problem.
+ * It seems that a reference set for this chip went out with incorrect info,
+ * and there exist boards that aren't quite right. An unexpected voltage drop
+ * can cause the PHY to get itself in a weird state (basically reset..).
+ * NOTE: this only seems to affect revC chips.
+ */
X static void netdev_timer(unsigned long data)
X {
X struct net_device *dev = (struct net_device *)data;
X struct netdev_private *np = dev->priv;
- int next_tick = 60*HZ;
+ int next_tick = 5*HZ;
+ long ioaddr = dev->base_addr;
+ u16 dspcfg;
X
X if (debug > 3) {
X /* DO NOT read the IntrStatus register,
@@ -932,11 +1195,32 @@
X printk(KERN_DEBUG "%s: Media selection timer tick.\n",
X dev->name);
X }
- spin_lock_irq(&np->lock);
- check_link(dev);
- spin_unlock_irq(&np->lock);
- np->timer.expires = jiffies + next_tick;
- add_timer(&np->timer);
+
+ /* 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 != DSPCFG_VAL) {
+ if (!netif_queue_stopped(dev)) {
+ printk(KERN_INFO
+ "%s: possible phy reset: re-initializing\n",
+ dev->name);
+ disable_irq(dev->irq);
+ spin_lock_irq(&np->lock);
+ init_registers(dev);
+ spin_unlock_irq(&np->lock);
+ enable_irq(dev->irq);
+ } else {
+ /* hurry back */
+ next_tick = HZ;
+ }
+ } else {
+ /* init_registers() calls check_link() for the above case */
+ spin_lock_irq(&np->lock);
+ check_link(dev);
+ spin_unlock_irq(&np->lock);
+ }
+ mod_timer(&np->timer, jiffies + next_tick);
X }
X
X static void dump_ring(struct net_device *dev)
@@ -946,15 +1230,18 @@
X if (debug > 2) {
X int i;
X printk(KERN_DEBUG " Tx ring at %p:\n", np->tx_ring);
- for (i = 0; i < TX_RING_SIZE; i++)
+ for (i = 0; i < TX_RING_SIZE; i++) {
X printk(KERN_DEBUG " #%d desc. %8.8x %8.8x %8.8x.\n",
X i, np->tx_ring[i].next_desc,
- np->tx_ring[i].cmd_status, np->tx_ring[i].addr);
+ np->tx_ring[i].cmd_status,
+ np->tx_ring[i].addr);
+ }
X printk(KERN_DEBUG " Rx ring %p:\n", np->rx_ring);
X for (i = 0; i < RX_RING_SIZE; i++) {
X printk(KERN_DEBUG " #%d desc. %8.8x %8.8x %8.8x.\n",
X i, np->rx_ring[i].next_desc,
- np->rx_ring[i].cmd_status, np->rx_ring[i].addr);
+ np->rx_ring[i].cmd_status,
+ np->rx_ring[i].addr);
X }
X }
X }
@@ -964,12 +1251,12 @@
X struct netdev_private *np = dev->priv;
X long ioaddr = dev->base_addr;
X
-
X disable_irq(dev->irq);
X spin_lock_irq(&np->lock);
X if (netif_device_present(dev)) {
X printk(KERN_WARNING "%s: Transmit timed out, status %8.8x,"
- " resetting...\n", dev->name, readl(ioaddr + IntrStatus));
+ " resetting...\n",
+ dev->name, readl(ioaddr + IntrStatus));
X dump_ring(dev);
X
X natsemi_reset(dev);
@@ -977,8 +1264,9 @@
X init_ring(dev);
X init_registers(dev);
X } else {
- printk(KERN_WARNING "%s: tx_timeout while in suspended state?\n",
- dev->name);
+ printk(KERN_WARNING
+ "%s: tx_timeout while in suspended state?\n",
+ dev->name);
X }
X spin_unlock_irq(&np->lock);
X enable_irq(dev->irq);
@@ -1019,7 +1307,7 @@
X for (i = 0; i < RX_RING_SIZE; i++) {
X np->rx_ring[i].next_desc = cpu_to_le32(np->ring_dma
X +sizeof(struct netdev_desc)
- *((i+1)%RX_RING_SIZE));
+ *((i+1)%RX_RING_SIZE));
X np->rx_ring[i].cmd_status = cpu_to_le32(DescOwn);
X np->rx_skbuff[i] = NULL;
X }
@@ -1107,7 +1395,8 @@
X
X if (netif_device_present(dev)) {
X np->tx_ring[entry].cmd_status = cpu_to_le32(DescOwn | skb->len);
- /* StrongARM: Explicitly cache flush np->tx_ring and skb->data,skb->len. */
+ /* StrongARM: Explicitly cache flush np->tx_ring and
+ * skb->data,skb->len. */
X wmb();
X np->cur_tx++;
X if (np->cur_tx - np->dirty_tx >= TX_QUEUE_LEN - 1) {
@@ -1148,15 +1437,19 @@
X printk(KERN_DEBUG "%s: tx frame #%d finished with status %8.8xh.\n",
X dev->name, np->dirty_tx,
X le32_to_cpu(np->tx_ring[entry].cmd_status));
- if (np->tx_ring[entry].cmd_status & cpu_to_le32(0x08000000)) {
+ if (np->tx_ring[entry].cmd_status & cpu_to_le32(DescPktOK)) {
X np->stats.tx_packets++;
X np->stats.tx_bytes += np->tx_skbuff[entry]->len;
- } else { /* Various Tx errors */
+ } else { /* Various Tx errors */
X int tx_status = le32_to_cpu(np->tx_ring[entry].cmd_status);
- if (tx_status & 0x04010000) np->stats.tx_aborted_errors++;
- if (tx_status & 0x02000000) np->stats.tx_fifo_errors++;
- if (tx_status & 0x01000000) np->stats.tx_carrier_errors++;
- if (tx_status & 0x00200000) np->stats.tx_window_errors++;
+ if (tx_status & (DescTxAbort|DescTxExcColl))
+ np->stats.tx_aborted_errors++;
+ if (tx_status & DescTxFIFO)
+ np->stats.tx_fifo_errors++;
+ if (tx_status & DescTxCarrier)
+ np->stats.tx_carrier_errors++;
+ if (tx_status & DescTxOOWCol)
+ np->stats.tx_window_errors++;
X np->stats.tx_errors++;
X }
X pci_unmap_single(np->pci_dev,np->tx_dma[entry],
@@ -1219,7 +1512,7 @@
X }
X } while (1);
X
- if (debug > 3)
+ if (debug > 4)
X printk(KERN_DEBUG "%s: exiting interrupt.\n",
X dev->name);
X }
@@ -1240,7 +1533,7 @@
X entry, desc_status);
X if (--boguscnt < 0)
X break;
- if ((desc_status & (DescMore|DescPktOK|RxTooLong)) != DescPktOK) {
+ if ((desc_status & (DescMore|DescPktOK|DescRxLong)) != DescPktOK) {
X if (desc_status & DescMore) {
X printk(KERN_WARNING "%s: Oversized(?) Ethernet frame spanned "
X "multiple buffers, entry %#x status %x.\n",
@@ -1252,14 +1545,19 @@
X printk(KERN_DEBUG " netdev_rx() Rx error was %8.8x.\n",
X desc_status);
X np->stats.rx_errors++;
- if (desc_status & 0x06000000) np->stats.rx_over_errors++;
- if (desc_status & 0x00600000) np->stats.rx_length_errors++;
- if (desc_status & 0x00140000) np->stats.rx_frame_errors++;
- if (desc_status & 0x00080000) np->stats.rx_crc_errors++;
+ if (desc_status & (DescRxAbort|DescRxOver))
+ np->stats.rx_over_errors++;
+ if (desc_status & (DescRxLong|DescRxRunt))
+ np->stats.rx_length_errors++;
+ if (desc_status & (DescRxInvalid|DescRxAlign))
+ np->stats.rx_frame_errors++;
+ if (desc_status & DescRxCRC)
+ np->stats.rx_crc_errors++;
X }
X } else {
X struct sk_buff *skb;
- int pkt_len = (desc_status & 0x0fff) - 4; /* Omit CRC size. */
+ /* Omit CRC size. */
+ int pkt_len = (desc_status & DescSizeMask) - 4;
X /* Check if the packet is long enough to accept without copying
X to a minimally-sized skbuff. */
X if (pkt_len < rx_copybreak
@@ -1324,10 +1622,11 @@
X
X spin_lock(&np->lock);
X if (intr_status & LinkChange) {
- printk(KERN_NOTICE "%s: Link changed: Autonegotiation advertising"
- " %4.4x partner %4.4x.\n", dev->name,
- (int)readl(ioaddr + AnegAdv),
- (int)readl(ioaddr + AnegPeer));
+ printk(KERN_NOTICE
+ "%s: Link changed: Autonegotiation advertising"
+ " %4.4x partner %4.4x.\n", dev->name,
+ (int)mdio_read(dev, 1, MII_ADVERTISE),
+ (int)mdio_read(dev, 1, MII_LPA));
X /* read MII int status to clear the flag */
X readw(ioaddr + MIntrStatus);
X check_link(dev);
@@ -1336,7 +1635,7 @@
X __get_stats(dev);
X }
X if (intr_status & IntrTxUnderrun) {
- if ((np->tx_config & 0x3f) < 62)
+ if ((np->tx_config & TxDrthMask) < 62)
X np->tx_config += 2;
X if (debug > 2)
X printk(KERN_NOTICE "%s: increasing Tx theshold, new tx cfg %8.8xh.\n",
@@ -1348,12 +1647,15 @@
X printk(KERN_NOTICE "%s: Link wake-up event %8.8x\n",
X dev->name, wol_status);
X }
- if ((intr_status & ~(LinkChange|StatsMax|RxResetDone|TxResetDone|0xA7ff))
- && debug)
- printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n",
- dev->name, intr_status);
+ if (intr_status & RxStatusFIFOOver && debug) {
+ printk(KERN_NOTICE "%s: Rx status FIFO overrun\n", dev->name);
+ }
X /* Hmmmmm, it's not clear how to recover from PCI faults. */
X if (intr_status & IntrPCIErr) {
+ if (debug) {
+ printk(KERN_NOTICE "%s: PCI error %08x\n", dev->name,
+ intr_status & IntrPCIErr);
+ }
X np->stats.tx_fifo_errors++;
X np->stats.rx_fifo_errors++;
X }
@@ -1453,11 +1755,12 @@
X if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
X /* Unconditionally log net taps. */
X printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name);
- rx_mode = AcceptBroadcast | AcceptAllMulticast | AcceptAllPhys
- | AcceptMyPhys;
+ rx_mode = RxFilterEnable | AcceptBroadcast
+ | AcceptAllMulticast | AcceptAllPhys | AcceptMyPhys;
X } else if ((dev->mc_count > multicast_filter_limit)
X || (dev->flags & IFF_ALLMULTI)) {
- rx_mode = AcceptBroadcast | AcceptAllMulticast | AcceptMyPhys;
+ rx_mode = RxFilterEnable | AcceptBroadcast
+ | AcceptAllMulticast | AcceptMyPhys;
X } else {
X struct dev_mc_list *mclist;
X int i;
@@ -1467,10 +1770,12 @@
X set_bit_le(ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff,
X mc_filter);
X }
- rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
+ rx_mode = RxFilterEnable | AcceptBroadcast
+ | AcceptMulticast | AcceptMyPhys;
X for (i = 0; i < 64; i += 2) {
X writew(HASH_TABLE + i, ioaddr + RxFilterAddr);
- writew((mc_filter[i+1]<<8) + mc_filter[i], ioaddr + RxFilterData);
+ writew((mc_filter[i+1]<<8) + mc_filter[i],
+ ioaddr + RxFilterData);
X }
X }
X writel(rx_mode, ioaddr + RxFilterAddr);
@@ -1550,6 +1855,7 @@
X
X static int netdev_set_wol(struct net_device *dev, u32 newval)
X {
+ struct netdev_private *np = dev->priv;
X u32 data = readl(dev->base_addr + WOLCmd) & ~WakeOptsSummary;
X
X /* translate to bitmasks this chip understands */
@@ -1565,49 +1871,65 @@
X data |= WakeArp;
X if (newval & WAKE_MAGIC)
X data |= WakeMagic;
- if (newval & WAKE_MAGICSECURE)
- data |= WakeMagicSecure;
+ if (np->srr >= SRR_REV_D) {
+ if (newval & WAKE_MAGICSECURE) {
+ data |= WakeMagicSecure;
+ }
+ }
X
X writel(data, dev->base_addr + WOLCmd);
X
- /* should we burn these into the EEPROM? */


-
X return 0;
X }
X

X static int netdev_get_wol(struct net_device *dev, u32 *supported, u32 *cur)
X {
+ struct netdev_private *np = dev->priv;
X u32 regval = readl(dev->base_addr + WOLCmd);
X
X *supported = (WAKE_PHY | WAKE_UCAST | WAKE_MCAST | WAKE_BCAST
- | WAKE_ARP | WAKE_MAGIC | WAKE_MAGICSECURE);
+ | WAKE_ARP | WAKE_MAGIC);
+
+ if (np->srr >= SRR_REV_D) {
+ /* SOPASS works on revD and higher */
+ *supported |= WAKE_MAGICSECURE;
+ }
X *cur = 0;
+
X /* translate from chip bitmasks */
- if (regval & 0x1)
+ if (regval & WakePhy)
X *cur |= WAKE_PHY;
- if (regval & 0x2)
+ if (regval & WakeUnicast)
X *cur |= WAKE_UCAST;
- if (regval & 0x4)
+ if (regval & WakeMulticast)
X *cur |= WAKE_MCAST;
- if (regval & 0x8)
+ if (regval & WakeBroadcast)
X *cur |= WAKE_BCAST;
- if (regval & 0x10)
+ if (regval & WakeArp)
X *cur |= WAKE_ARP;
- if (regval & 0x200)
+ if (regval & WakeMagic)
X *cur |= WAKE_MAGIC;
- if (regval & 0x400)
+ if (regval & WakeMagicSecure) {
+ /* this can be on in revC, but it's broken */
X *cur |= WAKE_MAGICSECURE;
+ }


X
X return 0;
X }

X
X static int netdev_set_sopass(struct net_device *dev, u8 *newval)
X {
+ struct netdev_private *np = dev->priv;
X u16 *sval = (u16 *)newval;
- u32 addr = readl(dev->base_addr + RxFilterAddr) & ~0x3ff;
+ u32 addr;
+
+ if (np->srr < SRR_REV_D) {
+ return 0;
+ }
X
X /* enable writing to these registers by disabling the RX filter */
- addr &= ~0x80000000;
+ addr = readl(dev->base_addr + RxFilterAddr) & ~RFCRAddressMask;
+ addr &= ~RxFilterEnable;
X writel(addr, dev->base_addr + RxFilterAddr);
X
X /* write the three words to (undocumented) RFCR vals 0xa, 0xc, 0xe */
@@ -1621,19 +1943,25 @@
X writew(sval[2], dev->base_addr + RxFilterData);
X
X /* re-enable the RX filter */
- writel(addr | 0x80000000, dev->base_addr + RxFilterAddr);
-
- /* should we burn this into the EEPROM? */
+ writel(addr | RxFilterEnable, dev->base_addr + RxFilterAddr);


X
X return 0;
X }

X
X static int netdev_get_sopass(struct net_device *dev, u8 *data)
X {
+ struct netdev_private *np = dev->priv;
X u16 *sval = (u16 *)data;
- u32 addr = readl(dev->base_addr + RxFilterAddr) & ~0x3ff;
+ u32 addr;
+
+ if (np->srr < SRR_REV_D) {
+ sval[0] = sval[1] = sval[2] = 0;
+ return 0;
+ }
X
X /* read the three words from (undocumented) RFCR vals 0xa, 0xc, 0xe */
+ addr = readl(dev->base_addr + RxFilterAddr) & ~RFCRAddressMask;
+
X writel(addr | 0xa, dev->base_addr + RxFilterAddr);
X sval[0] = readw(dev->base_addr + RxFilterData);
X
@@ -1643,6 +1971,8 @@
X writel(addr | 0xe, dev->base_addr + RxFilterAddr);
X sval[2] = readw(dev->base_addr + RxFilterData);
X
+ writel(addr, dev->base_addr + RxFilterAddr);
+


X return 0;
X }
X

@@ -1662,17 +1992,17 @@
X ecmd->transceiver = XCVR_INTERNAL;
X
X /* this isn't fully supported at higher layers */
- ecmd->phy_address = readw(dev->base_addr + PhyCtrl) & 0xf;
+ ecmd->phy_address = readw(dev->base_addr + PhyCtrl) & PhyAddrMask;
X
- tmp = readl(dev->base_addr + AnegAdv);
X ecmd->advertising = ADVERTISED_TP;
- if (tmp & Aneg10BaseT)
+ tmp = mdio_read(dev, 1, MII_ADVERTISE);
+ if (tmp & ADVERTISE_10HALF)
X ecmd->advertising |= ADVERTISED_10baseT_Half;
- if (tmp & Aneg10BaseTFull)
+ if (tmp & ADVERTISE_10FULL)
X ecmd->advertising |= ADVERTISED_10baseT_Full;
- if (tmp & Aneg100BaseT)
+ if (tmp & ADVERTISE_100HALF)
X ecmd->advertising |= ADVERTISED_100baseT_Half;
- if (tmp & Aneg100BaseTFull)
+ if (tmp & ADVERTISE_100FULL)
X ecmd->advertising |= ADVERTISED_100baseT_Full;
X
X tmp = readl(dev->base_addr + ChipConfig);
@@ -1734,30 +2064,29 @@
X }
X writel(tmp, dev->base_addr + ChipConfig);
X /* turn on autonegotiation, and force a renegotiate */
- tmp = readl(dev->base_addr + BasicControl);
- tmp |= BMCRAnegEnable | BMCRAnegRestart;
- writel(tmp, dev->base_addr + BasicControl);
- np->advertising = mdio_read(dev, 1, 4);
+ tmp = mdio_read(dev, 1, MII_BMCR);
+ tmp |= (BMCR_ANENABLE | BMCR_ANRESTART);
+ mdio_write(dev, 1, MII_BMCR, tmp);
+ np->advertising = mdio_read(dev, 1, MII_ADVERTISE);
X } else {
X /* turn off auto negotiation, set speed and duplexity */
- tmp = readl(dev->base_addr + BasicControl);
- tmp &= ~(BMCRAnegEnable | BMCRSpeed | BMCRDuplex);
+ tmp = mdio_read(dev, 1, MII_BMCR);
+ tmp &= ~(BMCR_ANENABLE | BMCR_SPEED100 | BMCR_FULLDPLX);
X if (ecmd->speed == SPEED_100) {
- tmp |= BMCRSpeed;
+ tmp |= BMCR_SPEED100;
X }
X if (ecmd->duplex == DUPLEX_FULL) {
- tmp |= BMCRDuplex;
+ tmp |= BMCR_FULLDPLX;
X } else {
X np->full_duplex = 0;
X }
- writel(tmp, dev->base_addr + BasicControl);
+ mdio_write(dev, 1, MII_BMCR, tmp);


X }
X return 0;
X }

X
X static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
X {
- struct netdev_private *np = dev->priv;
X struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data;
X
X switch(cmd) {
@@ -1770,22 +2099,16 @@
X
X case SIOCGMIIREG: /* Read MII PHY register. */
X case SIOCDEVPRIVATE+1: /* for binary compat, remove in 2.5 */
- data->val_out = mdio_read(dev, data->phy_id & 0x1f, data->reg_num & 0x1f);
+ data->val_out = mdio_read(dev, data->phy_id & 0x1f,
+ data->reg_num & 0x1f);
X return 0;
X
X case SIOCSMIIREG: /* Write MII PHY register. */
X case SIOCDEVPRIVATE+2: /* for binary compat, remove in 2.5 */
X if (!capable(CAP_NET_ADMIN))
X return -EPERM;
- if (data->phy_id == 1) {
- u16 miireg = data->reg_num & 0x1f;
- u16 value = data->val_in;
- writew(value, dev->base_addr + BasicControl
- + (miireg << 2));
- switch (miireg) {
- case 4: np->advertising = value; break;
- }
- }
+ mdio_write(dev, data->phy_id & 0x1f, data->reg_num & 0x1f,
+ data->val_in);
X return 0;
X default:
X return -EOPNOTSUPP;
@@ -1795,16 +2118,24 @@
X static void enable_wol_mode(struct net_device *dev, int enable_intr)
X {
X long ioaddr = dev->base_addr;
+ struct netdev_private *np = dev->priv;
X
X if (debug > 1)
X printk(KERN_INFO "%s: remaining active for wake-on-lan\n",
X dev->name);
+
X /* For WOL we must restart the rx process in silent mode.
X * Write NULL to the RxRingPtr. Only possible if
X * rx process is stopped
X */
X writel(0, ioaddr + RxRingPtr);
X
+ /* read WoL status to clear */
+ readl(ioaddr + WOLCmd);
+
+ /* PME on, clear status */
+ writel(np->SavedClkRun | PMEEnable | PMEStatus, ioaddr + ClkRun);
+
X /* and restart the rx process */
X writel(RxOn, ioaddr + ChipCmd);
X
@@ -1822,9 +2153,10 @@
X struct netdev_private *np = dev->priv;
X
X netif_stop_queue(dev);
+ netif_carrier_off(dev);
X
X if (debug > 1) {
- printk(KERN_DEBUG "%s: Shutting down ethercard, status was %4.4x.\n",
+ printk(KERN_DEBUG "%s: Shutting down ethercard, status was %4.4x.\n",
X dev->name, (int)readl(ioaddr + ChipCmd));
X printk(KERN_DEBUG "%s: Queue pointers were Tx %d / %d, Rx %d / %d.\n",
X dev->name, np->cur_tx, np->dirty_tx, np->cur_rx, np->dirty_rx);
@@ -1835,9 +2167,13 @@
X disable_irq(dev->irq);
X spin_lock_irq(&np->lock);
X
+ /* Disable and clear interrupts */
X writel(0, ioaddr + IntrEnable);
- writel(0, ioaddr + IntrMask);
- writel(2, ioaddr + StatsCtrl); /* Freeze Stats */
+ readl(ioaddr + IntrMask);
+ readw(ioaddr + MIntrStatus);
+
+ /* Freeze Stats */
+ writel(StatsFreeze, ioaddr + StatsCtrl);
X
X /* Stop the chip's Tx and Rx processes. */
X natsemi_stop_rxtx(dev);
@@ -1865,20 +2201,15 @@
X
X {
X u32 wol = readl(ioaddr + WOLCmd) & WakeOptsSummary;
- u32 clkrun = np->SavedClkRun;
- /* Restore PME enable bit */
X if (wol) {
X /* restart the NIC in WOL mode.
X * The nic must be stopped for this.
X */
X enable_wol_mode(dev, 0);
- /* make sure to enable PME */
- clkrun |= 0x100;
+ } else {
+ /* Restore PME enable bit unmolested */
+ writel(np->SavedClkRun, ioaddr + ClkRun);
X }
- writel(clkrun, ioaddr + ClkRun);
-#if 0
- writel(0x0200, ioaddr + ChipConfig); /* Power down Xcvr. */
-#endif


X }
X return 0;
X }

@@ -1913,8 +2244,8 @@
X * * intr_handler: doesn't acquire the spinlock. suspend calls
X * disable_irq() to enforce synchronization.
X *
- * netif_device_detach must occur under spin_unlock_irq(), interrupts from a detached
- * device would cause an irq storm.
+ * netif_device_detach must occur under spin_unlock_irq(), interrupts from a
+ * detached device would cause an irq storm.
X */
X
X static int natsemi_suspend (struct pci_dev *pdev, u32 state)
@@ -1945,7 +2276,6 @@
X drain_ring(dev);
X {
X u32 wol = readl(ioaddr + WOLCmd) & WakeOptsSummary;
- u32 clkrun = np->SavedClkRun;
X /* Restore PME enable bit */
X if (wol) {
X /* restart the NIC in WOL mode.
@@ -1953,10 +2283,10 @@
X * FIXME: use the WOL interupt
X */
X enable_wol_mode(dev, 0);
- /* make sure to enable PME */
- clkrun |= 0x100;
+ } else {
+ /* Restore PME enable bit unmolested */
+ writel(np->SavedClkRun, ioaddr + ClkRun);
X }
- writel(clkrun, ioaddr + ClkRun);
X }
X } else {
X netif_device_detach(dev);
@@ -1985,8 +2315,7 @@
X netif_device_attach(dev);
X spin_unlock_irq(&np->lock);
X
- np->timer.expires = jiffies + 1*HZ;
- add_timer(&np->timer);
+ mod_timer(&np->timer, jiffies + 1*HZ);
X } else {
X netif_device_attach(dev);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/net/pcmcia/xircom_tulip_cb.c linux/drivers/net/pcmcia/xircom_tulip_cb.c
--- v2.4.13/linux/drivers/net/pcmcia/xircom_tulip_cb.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/net/pcmcia/xircom_tulip_cb.c Thu Oct 25 14:01:57 2001
@@ -101,7 +101,9 @@
X #include <linux/init.h>
X #include <linux/mii.h>
X #include <linux/ethtool.h>
-#include <asm/processor.h> /* Processor type for cache alignment. */
+
+#include <asm/io.h>
+#include <asm/processor.h> /* Processor type for cache alignment. */
X #include <asm/uaccess.h>
X
X
diff -u --recursive --new-file v2.4.13/linux/drivers/net/sunbmac.c linux/drivers/net/sunbmac.c
--- v2.4.13/linux/drivers/net/sunbmac.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/net/sunbmac.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: sunbmac.c,v 1.27 2001/04/23 03:57:48 davem Exp $
+/* $Id: sunbmac.c,v 1.28 2001/10/21 06:35:29 davem Exp $
X * sunbmac.c: Driver for Sparc BigMAC 100baseT ethernet adapters.
X *
X * Copyright (C) 1997, 1998, 1999 David S. Miller (da...@redhat.com)
diff -u --recursive --new-file v2.4.13/linux/drivers/net/sunlance.c linux/drivers/net/sunlance.c
--- v2.4.13/linux/drivers/net/sunlance.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/net/sunlance.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: sunlance.c,v 1.108 2001/04/19 22:32:41 davem Exp $
+/* $Id: sunlance.c,v 1.109 2001/10/21 06:35:29 davem Exp $
X * lance.c: Linux/Sparc/Lance driver
X *
X * Written 1995, 1996 by Miguel de Icaza
diff -u --recursive --new-file v2.4.13/linux/drivers/net/wireless/hermes.h linux/drivers/net/wireless/hermes.h
--- v2.4.13/linux/drivers/net/wireless/hermes.h Tue Oct 9 17:06:52 2001
+++ linux/drivers/net/wireless/hermes.h Thu Oct 25 14:01:57 2001
@@ -31,6 +31,7 @@
X
X #include <linux/delay.h>
X #include <linux/if_ether.h>
+#include <asm/byteorder.h>
X
X /*
X * Limits and constants
diff -u --recursive --new-file v2.4.13/linux/drivers/parport/ChangeLog linux/drivers/parport/ChangeLog
--- v2.4.13/linux/drivers/parport/ChangeLog Thu Oct 11 08:02:26 2001
+++ linux/drivers/parport/ChangeLog Fri Nov 2 17:13:53 2001
@@ -1,3 +1,35 @@
+2001-10-26 Tim Waugh <twa...@redhat.com>
+
+ * parport_pc.c (parport_irq_probe): When ECR programmable IRQ
+ support fails, generate interrupts using the FIFO even if we don't
+ want to use the FIFO for real data transfers.


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 31'
echo 'File patch-2.4.14 is continued in part 32'
echo "32" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:44 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part21

#!/bin/sh -x
# this is part 21 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 21; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+} TZ_ACTIVE_THRESHOLD;
X
+typedef struct {
+ TZ_CRITICAL_THRESHOLD critical;
+ TZ_HOT_THRESHOLD hot;
+ TZ_PASSIVE_THRESHOLD passive;
+ TZ_ACTIVE_THRESHOLD active[TZ_MAX_ACTIVE_THRESHOLDS];
+} TZ_THRESHOLDS;
X
X /*
X * TZ_POLICY:
@@ -188,11 +162,7 @@
X TZ_STATE state;
X TZ_COOLING_MODE cooling_mode;
X u32 polling_freq;
- TZ_THRESHOLD_LIST threshold_list;
- TZ_CRITICAL_POLICY critical;
- TZ_PASSIVE_POLICY passive;
- TZ_ACTIVE_POLICY active;
- /* TBD: Linux-specific */
+ TZ_THRESHOLDS thresholds;
X struct timer_list timer;
X } TZ_POLICY;
X
@@ -213,7 +183,7 @@
X * Function Prototypes
X *****************************************************************************/
X
-/* thermal_zone.c */
+/* tz.c */
X
X acpi_status
X tz_initialize (void);
@@ -234,46 +204,49 @@
X
X acpi_status
X tz_get_temperature (
- TZ_CONTEXT *thermal_zone,
- u32 *temperature);
+ TZ_CONTEXT *tz);
X
X acpi_status
X tz_get_thresholds (
- TZ_CONTEXT *thermal_zone,
- TZ_THRESHOLD_LIST *threshold_list);
+ TZ_CONTEXT *tz);
+
+acpi_status
+tz_set_cooling_preference (
+ TZ_CONTEXT *tz,
+ TZ_COOLING_MODE cooling_mode);
X
X void
X tz_print (
- TZ_CONTEXT *thermal_zone);
+ TZ_CONTEXT *tz);
X
X /* tzpolicy.c */
X
X acpi_status
X tz_policy_add_device (
- TZ_CONTEXT *thermal_zone);
+ TZ_CONTEXT *tz);
X
X acpi_status
X tz_policy_remove_device (
- TZ_CONTEXT *thermal_zone);
+ TZ_CONTEXT *tz);
X
X void
X tz_policy_check (
X void *context);
X
-/* Thermal Zone Driver OSL */
+/* tz_osl.c */
X
X acpi_status
X tz_osl_add_device (
- TZ_CONTEXT *thermal_zone);
+ TZ_CONTEXT *tz);
X
X acpi_status
X tz_osl_remove_device (
- TZ_CONTEXT *thermal_zone);
+ TZ_CONTEXT *tz);
X
X acpi_status
X tz_osl_generate_event (
X u32 event,
- TZ_CONTEXT *thermal_zone);
+ TZ_CONTEXT *tz);
X
X
X #endif /* __TZ_H__ */
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/processor/pr.c linux/drivers/acpi/ospm/processor/pr.c
--- v2.4.13/linux/drivers/acpi/ospm/processor/pr.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/processor/pr.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************
X *

X * Module Name: pr.c


- * $Revision: 32 $

+ * $Revision: 34 $


X *
X *****************************************************************************/
X

@@ -63,7 +63,7 @@
X #ifdef ACPI_DEBUG
X acpi_buffer buffer;
X
- PROC_NAME("pr_print");
+ FUNCTION_TRACE("pr_print");
X
X buffer.length = 256;
X buffer.pointer = acpi_os_callocate(buffer.length);
@@ -80,7 +80,7 @@
X * Print out basic processor information.


X */
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));

- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Processor[%02x]:[%p] uid[%02x] %s\n", processor->device_handle, processor->acpi_handle, processor->uid, buffer.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Processor[%02x]:[%p] uid[%02x] %s\n", processor->device_handle, processor->acpi_handle, processor->uid, (char*)buffer.pointer));
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| power: %cC0 %cC1 %cC2[%d] %cC3[%d]\n", (processor->power.state[0].is_valid?'+':'-'), (processor->power.state[1].is_valid?'+':'-'), (processor->power.state[2].is_valid?'+':'-'), processor->power.state[2].latency, (processor->power.state[3].is_valid?'+':'-'), processor->power.state[3].latency));
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| performance: states[%d]\n", processor->performance.state_count));


X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));

@@ -140,7 +140,7 @@
X * Processor Block:
X * ----------------
X */
- MEMSET(&acpi_object, 0, sizeof(acpi_object));
+ memset(&acpi_object, 0, sizeof(acpi_object));
X
X buffer.length = sizeof(acpi_object);
X buffer.pointer = &acpi_object;


@@ -261,8 +261,8 @@
X

X FUNCTION_TRACE("pr_initialize");


X
- MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID));
- MEMSET(&driver, 0, sizeof(BM_DRIVER));
+ memset(&criteria, 0, sizeof(BM_DEVICE_ID));
+ memset(&driver, 0, sizeof(BM_DRIVER));
X
X /*

X * Initialize power (Cx state) policy.
@@ -307,8 +307,8 @@
X
X FUNCTION_TRACE("pr_terminate");


X
- MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID));
- MEMSET(&driver, 0, sizeof(BM_DRIVER));
+ memset(&criteria, 0, sizeof(BM_DEVICE_ID));
+ memset(&driver, 0, sizeof(BM_DRIVER));
X
X /*

X * Terminate power (Cx state) policy.
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/processor/pr_osl.c linux/drivers/acpi/ospm/processor/pr_osl.c
--- v2.4.13/linux/drivers/acpi/ospm/processor/pr_osl.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/processor/pr_osl.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: pr_osl.c
- * $Revision: 18 $
+ * $Revision: 21 $


X *
X *****************************************************************************/
X

@@ -37,7 +37,6 @@


X
X MODULE_AUTHOR("Andrew Grover");

X MODULE_DESCRIPTION("ACPI Component Architecture (CA) - IA32 Processor Driver");


-MODULE_LICENSE("GPL");
X
X

X #define PR_PROC_ROOT "processor"
@@ -157,14 +156,10 @@
X printk(" C%d", i);
X }
X }
-
- if (processor->performance.state_count > 1) {
- printk(", throttling states: %d", processor->performance.state_count);
- }
-
- if (acpi_piix4_bmisx)
- printk(", PIIX workaround active");
-
+ if (processor->performance.state_count > 1)
+ printk(", %d throttling states", processor->performance.state_count);
+ if (acpi_piix4_bmisx && processor->power.state[3].is_valid)
+ printk(" (PIIX errata enabled)");
X printk("\n");
X
X sprintf(processor_uid, "%d", processor->uid);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/processor/prperf.c linux/drivers/acpi/ospm/processor/prperf.c
--- v2.4.13/linux/drivers/acpi/ospm/processor/prperf.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/processor/prperf.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************
X *

X * Module Name: prperf.c


- * $Revision: 19 $

+ * $Revision: 21 $


X *
X *****************************************************************************/
X

@@ -179,7 +179,8 @@
X return_ACPI_STATUS(AE_BAD_DATA);
X }
X
- if (processor->performance.state_count == 1) {
+ if ((state == processor->performance.active_state) ||
+ (processor->performance.state_count == 1)) {
X return_ACPI_STATUS(AE_OK);
X }
X
@@ -233,6 +234,8 @@
X acpi_os_write_port(processor->pblk.address, pblk_value, 32);
X }
X
+ processor->performance.active_state = state;
+
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Processor [%02x] set to performance state [%d%%].\n", processor->device_handle, processor->performance.state[state].performance));
X
X return_ACPI_STATUS(AE_OK);
@@ -279,14 +282,14 @@
X if (performance->active_state <
X (performance->state_count-1)) {
X status = pr_perf_set_state(processor,
- (performance->active_state-1));
+ (performance->active_state+1));
X }
X break;
X
X case PR_PERF_INC:
X if (performance->active_state > 0) {
X status = pr_perf_set_state(processor,
- (performance->active_state+1));
+ (performance->active_state-1));
X }
X break;
X
@@ -302,7 +305,7 @@
X }
X
X if (ACPI_SUCCESS(status)) {
- performance->thermal_limit = limit;
+ performance->thermal_limit = performance->active_state;
X }
X
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Processor [%02x] thermal performance limit set to [%d%%].\n", processor->device_handle, processor->performance.state[performance->active_state].performance));
@@ -403,8 +406,20 @@
X * Get Current State:
X * ------------------
X */
- status = pr_perf_get_state(processor,
- &(processor->performance.active_state));
+ status = pr_perf_get_state(processor, &(processor->performance.active_state));
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
+
+ /*
+ * Set to Maximum Performance:
+ * ---------------------------
+ * We'll let subsequent policy (e.g. thermal/power) decide to lower
+ * performance if it so chooses, but for now crank up the speed.
+ */
+ if (0 != processor->performance.active_state) {
+ status = pr_perf_set_state(processor, 0);
+ }
X
X return_ACPI_STATUS(status);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/processor/prpower.c linux/drivers/acpi/ospm/processor/prpower.c
--- v2.4.13/linux/drivers/acpi/ospm/processor/prpower.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/processor/prpower.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************
X *

X * Module Name: prpower.c
- * $Revision: 30 $
+ * $Revision: 32 $


X *
X *****************************************************************************/
X

@@ -41,7 +41,7 @@
X * Globals
X ****************************************************************************/
X
-extern fadt_descriptor_rev2 acpi_fadt;
+extern FADT_DESCRIPTOR acpi_fadt;
X static u32 last_idle_jiffies = 0;
X static PR_CONTEXT *processor_list[NR_CPUS];
X static void (*pr_pm_idle_save)(void) = NULL;
@@ -207,7 +207,10 @@
X case PR_C1:
X /* Invoke C1 */
X enable(); halt();
- /* no C1 time measurement, so just enter some number of times */
+ /*
+ * TBD: Can't get time duration while in C1, as resumes
+ * go to an ISR rather than here.
+ */
X time_elapsed = 0xFFFFFFFF;
X break;
X
@@ -217,8 +220,7 @@
X /* Invoke C2 */
X acpi_os_read_port(processor->power.p_lvl2, NULL, 8);
X /* Dummy op - must do something useless after P_LVL2 read */
- acpi_hw_register_bit_access(ACPI_READ, ACPI_MTX_DO_NOT_LOCK,
- BM_STS);
+ acpi_hw_register_bit_access(ACPI_READ, ACPI_MTX_DO_NOT_LOCK, BM_STS);
X /* Compute time elapsed */
X acpi_get_timer(&end_ticks);
X /* Re-enable interrupts */
@@ -228,15 +230,13 @@
X
X case PR_C3:
X /* Disable bus master arbitration */
- acpi_hw_register_bit_access(ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK,
- ARB_DIS, 1);
+ acpi_hw_register_bit_access(ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, ARB_DIS, 1);
X /* See how long we're asleep for */
X acpi_get_timer(&start_ticks);
X /* Invoke C3 */
X acpi_os_read_port(processor->power.p_lvl3, NULL, 8);
X /* Dummy op - must do something useless after P_LVL3 read */
- acpi_hw_register_bit_access(ACPI_READ, ACPI_MTX_DO_NOT_LOCK,
- BM_STS);
+ acpi_hw_register_bit_access(ACPI_READ, ACPI_MTX_DO_NOT_LOCK, BM_STS);
X /* Compute time elapsed */
X acpi_get_timer(&end_ticks);
X /* Enable bus master arbitration */
@@ -266,18 +266,14 @@
X c_state->promotion.count++;
X c_state->demotion.count = 0;
X
- if (c_state->promotion.count >=
- c_state->promotion.count_threshold) {
-
+ if (c_state->promotion.count >= c_state->promotion.count_threshold) {
X /*
X * Bus Mastering Activity, if active and used
X * by this state's promotion policy, prevents
X * promotions from occuring.
X */
- if (bm_control && !(processor->power.bm_activity &
- c_state->promotion.bm_threshold)) {
+ if (!bm_control || !(processor->power.bm_activity & c_state->promotion.bm_threshold))
X next_state = c_state->promotion.target_state;
- }
X }
X }
X
@@ -305,10 +301,8 @@
X * state's promotion policy, causes an immediate demotion
X * to occur.
X */
- if (bm_control && (processor->power.bm_activity &
- c_state->demotion.bm_threshold)) {
+ if (bm_control && (processor->power.bm_activity & c_state->demotion.bm_threshold))
X next_state = c_state->demotion.target_state;
- }
X }
X
X /*
@@ -627,7 +621,7 @@
X
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Max CPUs[%d], this CPU[%d].\n", NR_CPUS, smp_processor_id()));
X
- /* only use C3 if we can control busmastering */
+ /* Only use C3 if we can control bus mastering. */
X if (acpi_fadt.V1_pm2_cnt_blk && acpi_fadt.pm2_cnt_len)
X bm_control = 1;
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/system/sm.c linux/drivers/acpi/ospm/system/sm.c
--- v2.4.13/linux/drivers/acpi/ospm/system/sm.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/system/sm.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************
X *

X * Module Name: sm.c


- * $Revision: 19 $
+ * $Revision: 20 $
X *

X *****************************************************************************/
X
@@ -71,7 +71,7 @@
X * Print out basic system information.


X */
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));

- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| System[%02x]:[%p] %s\n", system->device_handle, system->acpi_handle, buffer.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| System[%02x]:[%p] %s\n", system->device_handle, system->acpi_handle, (char*)buffer.pointer));
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| states: %cS0 %cS1 %cS2 %cS3 %cS4 %cS5\n", (system->states[0]?'+':'-'), (system->states[1]?'+':'-'), (system->states[2]?'+':'-'), (system->states[3]?'+':'-'), (system->states[4]?'+':'-'), (system->states[5]?'+':'-')));


X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));
X

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/system/sm_osl.c linux/drivers/acpi/ospm/system/sm_osl.c
--- v2.4.13/linux/drivers/acpi/ospm/system/sm_osl.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/system/sm_osl.c Wed Oct 24 14:06:22 2001
@@ -42,7 +42,6 @@


X
X MODULE_AUTHOR("Andrew Grover");

X MODULE_DESCRIPTION("ACPI Component Architecture (CA) - ACPI System Driver");


-MODULE_LICENSE("GPL");
X
X

X #define SM_PROC_INFO "info"
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/thermal/tz.c linux/drivers/acpi/ospm/thermal/tz.c
--- v2.4.13/linux/drivers/acpi/ospm/thermal/tz.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/thermal/tz.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /*****************************************************************************
X *

X * Module Name: tz.c


- * $Revision: 40 $

+ * $Revision: 44 $


X *
X *****************************************************************************/
X

@@ -23,22 +23,24 @@
X * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
X */
X
-/*
- * TBD: 1. Finish /proc interface (threshold values, _SCP changes, etc.)
- * 2. Update policy for ACPI 2.0 compliance
- * 3. Check for all required methods prior to enabling a threshold
- * 4. Support for multiple processors in a zone (passive cooling devices)
- */
X
X #include <acpi.h>
X #include <bm.h>
X #include "tz.h"
X
+
X #define _COMPONENT ACPI_THERMAL
X MODULE_NAME ("tz")
X
X
X /****************************************************************************
+ * Globals
+ ****************************************************************************/
+
+extern int TZP;
+
+
+/****************************************************************************
X * Internal Functions
X ****************************************************************************/
X
@@ -46,73 +48,63 @@
X *
X * FUNCTION: tz_print


X *
- * PARAMETERS:

- *
- * RETURN:

- *
- * DESCRIPTION: Prints out information on a specific thermal zone.
- *
X ****************************************************************************/
X
X void
X tz_print (
- TZ_CONTEXT *thermal_zone)
+ TZ_CONTEXT *tz)
X {
X #ifdef ACPI_DEBUG
X acpi_buffer buffer;
X u32 i,j = 0;
- TZ_THRESHOLD *threshold = NULL;
+ TZ_THRESHOLDS *thresholds = NULL;
X
- PROC_NAME("tz_print");
+ FUNCTION_TRACE("tz_print");
X
- if (!thermal_zone) {
+ if (!tz)
X return;
- }
+
+ thresholds = &(tz->policy.thresholds);
X
X buffer.length = 256;
X buffer.pointer = acpi_os_callocate(buffer.length);
- if (!buffer.pointer) {
+ if (!buffer.pointer)
X return;
- }
X
X /*
X * Get the full pathname for this ACPI object.
X */
- acpi_get_name(thermal_zone->acpi_handle, ACPI_FULL_PATHNAME, &buffer);
+ acpi_get_name(tz->acpi_handle, ACPI_FULL_PATHNAME, &buffer);
X
X /*


X * Print out basic thermal zone information.
X */
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));

- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Thermal_zone[%02x]:[%p] %s\n", thermal_zone->device_handle, thermal_zone->acpi_handle, buffer.pointer));
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| temperature[%d] state[%08x]\n", thermal_zone->policy.temperature, thermal_zone->policy.state));
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| cooling_mode[%08x] polling_freq[%d]\n", thermal_zone->policy.cooling_mode, thermal_zone->policy.polling_freq));
-
- for (i=0; i<thermal_zone->policy.threshold_list.count; i++) {
-
- threshold = &(thermal_zone->policy.threshold_list.thresholds[i]);
-
- switch (threshold->type) {
- case TZ_THRESHOLD_CRITICAL:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| critical[%d]\n", threshold->temperature));
- break;
- case TZ_THRESHOLD_PASSIVE:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| passive[%d]: tc1[%d] tc2[%d] tsp[%d]\n", threshold->temperature, thermal_zone->policy.passive.tc1, thermal_zone->policy.passive.tc2, thermal_zone->policy.passive.tsp));
- break;
- case TZ_THRESHOLD_ACTIVE:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| active[%d]: index[%d]\n", threshold->temperature, threshold->index));
- break;
- default:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| unknown[%d]\n", threshold->temperature));
- break;
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Thermal_zone[%02x]:[%p] %s\n", tz->device_handle, tz->acpi_handle, (char*)buffer.pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| temperature[%d] state[%08x]\n", tz->policy.temperature, tz->policy.state));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| cooling_mode[%08x] polling_freq[%d]\n", tz->policy.cooling_mode, tz->policy.polling_freq));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| critical[%d]\n", thresholds->critical.temperature));
+ if (thresholds->hot.is_valid)
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| hot[%d]\n", thresholds->hot.temperature));
+ if (thresholds->passive.is_valid) {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| passive[%d]: tc1[%d] tc2[%d] tsp[%d]\n", thresholds->passive.temperature, thresholds->passive.tc1, thresholds->passive.tc2, thresholds->passive.tsp));
+ if (thresholds->passive.devices.count > 0) {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| devices"));
+ for (j=0; (j<thresholds->passive.devices.count && j<10); j++) {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "[%02x]", thresholds->passive.devices.handles[j]));
+ }
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
X }
-
- if (threshold->cooling_devices.count > 0) {
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| cooling_devices"));
- for (j=0; (j<threshold->cooling_devices.count && j<10); j++) {
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "[%02x]", threshold->cooling_devices.handles[j]));
+ }
+ for (i=0; i<TZ_MAX_ACTIVE_THRESHOLDS; i++) {
+ if (!thresholds->active[i].is_valid)
+ break;
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| active[%d]: index[%d]\n", thresholds->active[i].temperature, i));
+ if (thresholds->active[i].devices.count > 0) {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| devices"));
+ for (j=0; (j<thresholds->active[i].devices.count && j<10); j++) {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "[%02x]", thresholds->active[i].devices.handles[j]));
X }
-

X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n"));
X }
X }

@@ -130,32 +122,29 @@
X *
X * FUNCTION: tz_get_temperaturee


X *
- * PARAMETERS:

- *
- * RETURN:

- *
- * DESCRIPTION:

- *


X ****************************************************************************/
X
X acpi_status

X tz_get_temperature (
- TZ_CONTEXT *thermal_zone,
- u32 *temperature)
+ TZ_CONTEXT *tz)
X {


X acpi_status status = AE_OK;
X

X FUNCTION_TRACE("tz_get_temperature");
X
- if (!thermal_zone || !temperature) {
+ if (!tz) {
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
X /*
- * Evaluate the _TMP driver method to get the current temperature.
+ * Evaluate the _TMP method to get the current temperature.
X */
- status = bm_evaluate_simple_integer(thermal_zone->acpi_handle,
- "_TMP", temperature);
+ status = bm_evaluate_simple_integer(tz->acpi_handle, "_TMP", &(tz->policy.temperature));
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
+
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %d d_k\n", tz->policy.temperature));
X
X return_ACPI_STATUS(status);
X }
@@ -165,17 +154,11 @@
X *
X * FUNCTION: tz_set_cooling_preference


X *
- * PARAMETERS:

- *
- * RETURN:

- *
- * DESCRIPTION:

- *


X ****************************************************************************/
X
X acpi_status

X tz_set_cooling_preference (
- TZ_CONTEXT *thermal_zone,
+ TZ_CONTEXT *tz,
X TZ_COOLING_MODE cooling_mode)
X {


X acpi_status status = AE_OK;

@@ -184,8 +167,7 @@
X
X FUNCTION_TRACE("tz_set_cooling_preference");
X
- if (!thermal_zone || ((cooling_mode != TZ_COOLING_MODE_ACTIVE) &&
- (cooling_mode != TZ_COOLING_MODE_PASSIVE))) {
+ if (!tz || ((cooling_mode != TZ_COOLING_MODE_ACTIVE) && (cooling_mode != TZ_COOLING_MODE_PASSIVE))) {
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
@@ -193,204 +175,143 @@
X * Build the argument list, which simply consists of the current
X * cooling preference.
X */
- MEMSET(&arg_list, 0, sizeof(acpi_object));
+ memset(&arg_list, 0, sizeof(acpi_object));
X arg_list.count = 1;
X arg_list.pointer = &arg0;
X
- MEMSET(&arg0, 0, sizeof(acpi_object));
+ memset(&arg0, 0, sizeof(acpi_object));
X arg0.type = ACPI_TYPE_INTEGER;
X arg0.integer.value = cooling_mode;
X
X /*
X * Evaluate "_SCP" - setting the new cooling preference.
X */
- status = acpi_evaluate_object(thermal_zone->acpi_handle, "_SCP",
- &arg_list, NULL);
+ status = acpi_evaluate_object(tz->acpi_handle, "_SCP", &arg_list, NULL);
+ if (ACPI_FAILURE(status)) {
+ tz->policy.cooling_mode = -1;
+ return_ACPI_STATUS(status);
+ }
+
+ tz->policy.cooling_mode = cooling_mode;
X
X return_ACPI_STATUS(status);
X }
X
X
-/***************************************************************************
- *
- * FUNCTION: tz_get_single_threshold


- *
- * PARAMETERS:

- *
- * RETURN:

+/****************************************************************************


X *
- * DESCRIPTION:

+ * FUNCTION: tz_get_thresholds


X *
X ****************************************************************************/
X

X acpi_status
-tz_get_single_threshold (
- TZ_CONTEXT *thermal_zone,
- TZ_THRESHOLD *threshold)
+tz_get_thresholds (
+ TZ_CONTEXT *tz)


X {
- acpi_status status = AE_OK;

+ acpi_status status = AE_OK;

+ TZ_THRESHOLDS *thresholds = NULL;
+ u32 value = 0;
+ u32 i = 0;
X
- FUNCTION_TRACE("tz_get_single_threshold");
+ FUNCTION_TRACE("acpi_tz_get_thresholds");
X
- if (!thermal_zone || !threshold) {
+ if (!tz) {
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
- switch (threshold->type) {
+ thresholds = &(tz->policy.thresholds);
X
- /*
- * Critical Threshold:


- * -------------------
- */

- case TZ_THRESHOLD_CRITICAL:
- threshold->index = 0;
- threshold->cooling_devices.count = 0;
- status = bm_evaluate_simple_integer(
- thermal_zone->acpi_handle, "_CRT",
- &(threshold->temperature));
- break;
-
- /*
- * Passive Threshold:
- * ------------------
- * Evaluate _PSV to get the threshold temperature and _PSL to get
- * references to all passive cooling devices.
- */
- case TZ_THRESHOLD_PASSIVE:
- threshold->index = 0;
- threshold->cooling_devices.count = 0;
- status = bm_evaluate_simple_integer(
- thermal_zone->acpi_handle, "_PSV",
- &(threshold->temperature));
- if (ACPI_SUCCESS(status)) {
- status = bm_evaluate_reference_list(
- thermal_zone->acpi_handle, "_PSL",
- &(threshold->cooling_devices));
- }
+ /* Critical Shutdown (required) */
X
- break;
-
- /*
- * Active Thresholds:
- * ------------------
- * Evaluate _ACx to get all threshold temperatures, and _ALx to get
- * references to all passive cooling devices.
- */
- case TZ_THRESHOLD_ACTIVE:
- {
- char object_name[5] = {'_','A', 'C',
- ('0'+threshold->index),'\0'};
- status = bm_evaluate_simple_integer(
- thermal_zone->acpi_handle, object_name,
- &(threshold->temperature));
- if (ACPI_SUCCESS(status)) {
- object_name[2] = 'L';
- status = bm_evaluate_reference_list(
- thermal_zone->acpi_handle,
- object_name,
- &(threshold->cooling_devices));
- }
- }
- break;
+ status = bm_evaluate_simple_integer(tz->acpi_handle, "_CRT", &value);
+ if (ACPI_FAILURE(status)) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No critical threshold\n"));
+ return_ACPI_STATUS(status);
+ }
+ else {
+ thresholds->critical.temperature = value;
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found critical threshold [%d]\n", thresholds->critical.temperature));
X
- default:
- status = AE_SUPPORT;
- break;
X }
X
- return_ACPI_STATUS(status);
-}
+ /* Critical Sleep (optional) */
X
+ status = bm_evaluate_simple_integer(tz->acpi_handle, "_HOT", &value);
+ if (ACPI_FAILURE(status)) {
+ thresholds->hot.is_valid = 0;
+ thresholds->hot.temperature = 0;
+ }
+ else {
+ thresholds->hot.is_valid = 1;
+ thresholds->hot.temperature = value;
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found hot threshold [%d]\n", thresholds->hot.temperature));
+ }
X
-/****************************************************************************
- *
- * FUNCTION: tz_get_thresholds
- *
- * PARAMETERS: thermal_zone - Identifies the thermal zone to parse.
- * buffer - Output buffer.
- *
- * RETURN: acpi_status result code.
- *
- * DESCRIPTION: Builds a TZ_THRESHOLD_LIST structure containing information
- * on all thresholds for a given thermal zone.
- *
- * NOTES: The current design limits the number of cooling devices
- * per theshold to the value specified by BM_MAX_HANDLES.
- * This simplifies parsing of thresholds by allowing a maximum
- * threshold list size to be computed (and enforced) -- which
- * allows all thresholds to be parsed in a single pass (since
- * memory must be contiguous when returned in the acpi_buffer).
- *
- ****************************************************************************/
+ /* Passive: Processors (optional) */
X
-acpi_status
-tz_get_thresholds (
- TZ_CONTEXT *thermal_zone,
- TZ_THRESHOLD_LIST *threshold_list)
-{


- acpi_status status = AE_OK;

- TZ_THRESHOLD *threshold = NULL;
- u32 i = 0;
+ status = bm_evaluate_simple_integer(tz->acpi_handle, "_PSV", &value);
+ if (ACPI_FAILURE(status)) {
+ thresholds->passive.is_valid = 0;
+ thresholds->passive.temperature = 0;
+ }
+ else {
+ thresholds->passive.is_valid = 1;
+ thresholds->passive.temperature = value;
X
- FUNCTION_TRACE("tz_get_thresholds");
+ status = bm_evaluate_simple_integer(tz->acpi_handle, "_TC1", &value);
+ if (ACPI_FAILURE(status)) {
+ thresholds->passive.is_valid = 0;
+ }
+ thresholds->passive.tc1 = value;
X
- if (!thermal_zone || !threshold_list) {
- return_ACPI_STATUS(AE_BAD_PARAMETER);
- }
+ status = bm_evaluate_simple_integer(tz->acpi_handle, "_TC2", &value);
+ if (ACPI_FAILURE(status)) {
+ thresholds->passive.is_valid = 0;
+ }
+ thresholds->passive.tc2 = value;
X
- threshold_list->count = 0;
+ status = bm_evaluate_simple_integer(tz->acpi_handle, "_TSP", &value);
+ if (ACPI_FAILURE(status)) {
+ thresholds->passive.is_valid = 0;
+ }
+ thresholds->passive.tsp = value;
X
- /*
- * Critical threshold:
- * -------------------
- * Every thermal zone must have one!
- */
- threshold = &(threshold_list->thresholds[threshold_list->count]);
- threshold->type = TZ_THRESHOLD_CRITICAL;
+ status = bm_evaluate_reference_list(tz->acpi_handle, "_PSL", &(thresholds->passive.devices));
+ if (ACPI_FAILURE(status)) {
+ thresholds->passive.is_valid = 0;
+ }
X
- status = tz_get_single_threshold(thermal_zone, threshold);
- if (ACPI_SUCCESS(status)) {
- (threshold_list->count)++;
- }
- else {
- return_ACPI_STATUS(status);
+ if (thresholds->passive.is_valid) {
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found passive threshold [%d]\n", thresholds->passive.temperature));
+ }
+ else {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid passive threshold\n"));
+ }
X }
X
+ /* Active: Fans, etc. (optional) */
X
- /*
- * Passive threshold:


- * ------------------
- */

- threshold = &(threshold_list->thresholds[threshold_list->count]);
- threshold->type = TZ_THRESHOLD_PASSIVE;
+ for (i=0; i<TZ_MAX_ACTIVE_THRESHOLDS; i++) {
X
- status = tz_get_single_threshold(thermal_zone, threshold);
- if (ACPI_SUCCESS(status)) {
- (threshold_list->count)++;
- }
+ char name[5] = {'_','A','C',('0'+i),'\0'};
X
- /*
- * Active threshold:
- * -----------------
- * Note that active thresholds are sorted by index (e.g. _AC0,
- * _AC1, ...), and thus from highest (_AC0) to lowest (_AC9)
- * temperature.
- */
- for (i = 0; i < TZ_MAX_ACTIVE_THRESHOLDS; i++) {
+ status = bm_evaluate_simple_integer(tz->acpi_handle, name, &value);
+ if (ACPI_FAILURE(status)) {
+ thresholds->active[i].is_valid = 0;
+ thresholds->active[i].temperature = 0;
+ break;
+ }
X
- threshold = &(threshold_list->thresholds[threshold_list->count]);
- threshold->type = TZ_THRESHOLD_ACTIVE;
- threshold->index = i;
+ thresholds->active[i].temperature = value;
+ name[2] = 'L';
X
- status = tz_get_single_threshold(thermal_zone, threshold);
+ status = bm_evaluate_reference_list(tz->acpi_handle, name, &(thresholds->active[i].devices));
X if (ACPI_SUCCESS(status)) {
- (threshold_list->count)++;
+ thresholds->active[i].is_valid = 1;
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found active threshold [%d]:[%d]\n", i, thresholds->active[i].temperature));
X }
X else {
- threshold->type = TZ_THRESHOLD_UNKNOWN;
- threshold->index = 0;
- thermal_zone->policy.active.threshold_count = i;
- break;
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid active threshold [%d]\n", i));
X }
X }
X
@@ -402,12 +323,6 @@
X *
X * FUNCTION: tz_add_device
X *
- * PARAMETERS: <none>


- *
- * RETURN:

- *
- * DESCRIPTION:

- *


X ****************************************************************************/
X
X acpi_status

@@ -416,7 +331,7 @@
X void **context)
X {


X acpi_status status = AE_OK;

- TZ_CONTEXT *thermal_zone = NULL;
+ TZ_CONTEXT *tz = NULL;
X BM_DEVICE *device = NULL;
X acpi_handle tmp_handle = NULL;
X static u32 zone_count = 0;
@@ -441,50 +356,67 @@
X /*
X * Allocate a new Thermal Zone device.
X */
- thermal_zone = acpi_os_callocate(sizeof(TZ_CONTEXT));
- if (!thermal_zone) {
- return AE_NO_MEMORY;
+ tz = acpi_os_callocate(sizeof(TZ_CONTEXT));
+ if (!tz) {
+ return_ACPI_STATUS(AE_NO_MEMORY);
X }
X
- thermal_zone->device_handle = device->handle;
- thermal_zone->acpi_handle = device->acpi_handle;
+ tz->device_handle = device->handle;
+ tz->acpi_handle = device->acpi_handle;
X
X /* TBD: How to manage 'uid' when zones are Pn_p? */
- sprintf(thermal_zone->uid, "%d", zone_count++);
+ sprintf(tz->uid, "%d", zone_count++);
X
X /*
- * _TMP?
- * -----
+ * Temperature:
+ * ------------
+ * Make sure we can read the zone's current temperature (_TMP).
+ * If we can't, there's no use in doing any policy (abort).
X */
- status = acpi_get_handle(thermal_zone->acpi_handle, "_TMP",
- &tmp_handle);
- if (ACPI_FAILURE(status)) {
+ status = tz_get_temperature(tz);
+ if (ACPI_FAILURE(status))
X goto end;
- }
X
X /*
- * Initialize Policy:
+ * Polling Frequency:
X * ------------------
- * TBD: Move all thermal zone policy to user-mode daemon...
+ * If _TZP doesn't exist use the OS default polling frequency.
X */
- status = tz_policy_add_device(thermal_zone);
+ status = bm_evaluate_simple_integer(tz->acpi_handle, "_TZP", &(tz->policy.polling_freq));
X if (ACPI_FAILURE(status)) {
- goto end;
+ tz->policy.polling_freq = TZP;


X }
+ status = AE_OK;

X
- status = tz_osl_add_device(thermal_zone);
- if (ACPI_FAILURE(status)) {
+ /*
+ * Cooling Preference:
+ * -------------------
+ * Default to ACTIVE (noisy) cooling until policy decides otherwise.
+ * Note that _SCP is optional.
+ */
+ tz_set_cooling_preference(tz, TZ_COOLING_MODE_ACTIVE);
+
+ /*
+ * Start Policy:
+ * -------------
+ * Thermal policy is included in the kernel (this driver) because
+ * of the critical role it plays in avoiding nuclear meltdown. =O
+ */
+ status = tz_policy_add_device(tz);
+ if (ACPI_FAILURE(status))
X goto end;
- }
X
- *context = thermal_zone;
+ status = tz_osl_add_device(tz);
+ if (ACPI_FAILURE(status))
+ goto end;
X
- tz_print(thermal_zone);
+ *context = tz;
+
+ tz_print(tz);
X
X end:
- if (ACPI_FAILURE(status)) {
- acpi_os_free(thermal_zone);
- }
+ if (ACPI_FAILURE(status))
+ acpi_os_free(tz);
X
X return_ACPI_STATUS(status);
X }
@@ -494,12 +426,6 @@
X *
X * FUNCTION: tz_remove_device
X *
- * PARAMETERS: <none>


- *
- * RETURN:

- *
- * DESCRIPTION:

- *


X ****************************************************************************/
X
X acpi_status

@@ -507,7 +433,7 @@
X void **context)
X {


X acpi_status status = AE_OK;

- TZ_CONTEXT *thermal_zone = NULL;
+ TZ_CONTEXT *tz = NULL;
X
X FUNCTION_TRACE("tz_remove_device");
X
@@ -515,23 +441,23 @@
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
- thermal_zone = (TZ_CONTEXT*)(*context);
+ tz = (TZ_CONTEXT*)(*context);
X
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing thermal zone [%02x].\n", thermal_zone->device_handle));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing thermal zone [%02x].\n", tz->device_handle));
X
- status = tz_osl_remove_device(thermal_zone);
+ status = tz_osl_remove_device(tz);
X
X /*
X * Remove Policy:
X * --------------
X * TBD: Move all thermal zone policy to user-mode daemon...
X */
- status = tz_policy_remove_device(thermal_zone);
+ status = tz_policy_remove_device(tz);
X if (ACPI_FAILURE(status)) {
X return_ACPI_STATUS(status);
X }
X
- acpi_os_free(thermal_zone);
+ acpi_os_free(tz);
X
X return_ACPI_STATUS(status);
X }
@@ -545,12 +471,6 @@
X *
X * FUNCTION: tz_initialize
X *
- * PARAMETERS: <none>


- *
- * RETURN:

- *
- * DESCRIPTION:

- *


X ****************************************************************************/
X
X acpi_status

@@ -562,8 +482,8 @@
X

X FUNCTION_TRACE("tz_initialize");


X
- MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID));
- MEMSET(&driver, 0, sizeof(BM_DRIVER));
+ memset(&criteria, 0, sizeof(BM_DEVICE_ID));
+ memset(&driver, 0, sizeof(BM_DRIVER));
X
X /*

X * Register driver for thermal zone devices.
@@ -583,12 +503,6 @@
X *
X * FUNCTION: tz_terminate
X *
- * PARAMETERS: <none>


- *
- * RETURN:

- *
- * DESCRIPTION:

- *


X ****************************************************************************/
X
X acpi_status

@@ -600,8 +514,8 @@
X

X FUNCTION_TRACE("tz_terminate");


X
- MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID));
- MEMSET(&driver, 0, sizeof(BM_DRIVER));
+ memset(&criteria, 0, sizeof(BM_DEVICE_ID));
+ memset(&driver, 0, sizeof(BM_DRIVER));
X
X /*

X * Unregister driver for thermal zone devices.
@@ -621,13 +535,8 @@
X *
X * FUNCTION: tz_notify
X *
- * PARAMETERS: <none>


- *
- * RETURN:

- *
- * DESCRIPTION:

- *
X ****************************************************************************/
+
X acpi_status
X tz_notify (
X BM_NOTIFY notify_type,
@@ -635,7 +544,7 @@
X void **context)
X {


X acpi_status status = AE_OK;

- TZ_CONTEXT *thermal_zone = NULL;
+ TZ_CONTEXT *tz = NULL;
X
X FUNCTION_TRACE("tz_notify");
X
@@ -643,7 +552,7 @@
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
- thermal_zone = (TZ_CONTEXT*)*context;
+ tz = (TZ_CONTEXT*)*context;
X
X switch (notify_type) {
X
@@ -657,40 +566,29 @@
X
X case TZ_NOTIFY_TEMPERATURE_CHANGE:
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Temperature (_TMP) change event detected.\n"));
- /* -------------------------------------------- */
- /* TBD: Remove when policy moves to user-mode. */
X tz_policy_check(*context);
- /* -------------------------------------------- */
- status = tz_get_temperature(thermal_zone,
- &(thermal_zone->policy.temperature));
+ status = tz_get_temperature(tz);
X if (ACPI_SUCCESS(status)) {
- status = tz_osl_generate_event(notify_type,
- thermal_zone);
+ status = tz_osl_generate_event(notify_type, tz);
X }
X break;
X
X case TZ_NOTIFY_THRESHOLD_CHANGE:
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Threshold (_SCP) change event detected.\n"));
- /* -------------------------------------------- */
- /* TBD: Remove when policy moves to user-mode. */
- status = tz_policy_remove_device(thermal_zone);
+ status = tz_policy_remove_device(tz);
X if (ACPI_SUCCESS(status)) {
- status = tz_policy_add_device(thermal_zone);
+ status = tz_policy_add_device(tz);
X }
- /* -------------------------------------------- */
- status = tz_osl_generate_event(notify_type, thermal_zone);
+ status = tz_osl_generate_event(notify_type, tz);
X break;
X
X case TZ_NOTIFY_DEVICE_LISTS_CHANGE:
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Device lists (_ALx, _PSL, _TZD) change event detected.\n"));
- /* -------------------------------------------- */
- /* TBD: Remove when policy moves to user-mode. */
- status = tz_policy_remove_device(thermal_zone);
+ status = tz_policy_remove_device(tz);
X if (ACPI_SUCCESS(status)) {
- status = tz_policy_add_device(thermal_zone);
+ status = tz_policy_add_device(tz);
X }
- /* -------------------------------------------- */
- status = tz_osl_generate_event(notify_type, thermal_zone);
+ status = tz_osl_generate_event(notify_type, tz);


X break;
X
X default:

@@ -706,12 +604,6 @@
X *
X * FUNCTION: tz_request


X *
- * PARAMETERS:

- *
- * RETURN: Exception code.


- *
- * DESCRIPTION:

- *


X ****************************************************************************/
X
X acpi_status

@@ -720,7 +612,7 @@
X void *context)
X {


X acpi_status status = AE_OK;

- TZ_CONTEXT *thermal_zone = NULL;
+ TZ_CONTEXT *tz = NULL;
X
X FUNCTION_TRACE("tz_request");
X
@@ -731,7 +623,7 @@
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
- thermal_zone = (TZ_CONTEXT*)context;
+ tz = (TZ_CONTEXT*)context;
X
X /*
X * Handle request:
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/thermal/tz_osl.c linux/drivers/acpi/ospm/thermal/tz_osl.c
--- v2.4.13/linux/drivers/acpi/ospm/thermal/tz_osl.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/acpi/ospm/thermal/tz_osl.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: tz_osl.c


- * $Revision: 21 $

+ * $Revision: 25 $


X *
X *****************************************************************************/
X
@@ -35,7 +35,6 @@
X
X MODULE_AUTHOR("Andrew Grover");

X MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Thermal Zone Driver");
-MODULE_LICENSE("GPL");
X
X int TZP = 0;
X MODULE_PARM(TZP, "i");
@@ -65,17 +64,64 @@
X int *eof,
X void *context)
X {
- TZ_CONTEXT *thermal_zone = NULL;


+ acpi_status status = AE_OK;

+ char name[5];
+ acpi_buffer buffer = {sizeof(name), &name};
+ TZ_CONTEXT *tz = NULL;
+ TZ_THRESHOLDS *thresholds = NULL;
X char *p = page;


X int len = 0;

+ u32 i,j;
+ u32 t = 0;
X
- if (!context || (off != 0)) {
+ if (!context || (off != 0))
X goto end;
+
+ tz = (TZ_CONTEXT*)context;
+
+ thresholds = &(tz->policy.thresholds);
+
+ p += sprintf(p, "critical (S5): trip=%d\n", thresholds->critical.temperature);
+
+ if (thresholds->hot.is_valid)
+ p += sprintf(p, "critical (S4): trip=%d\n", thresholds->hot.temperature);
+
+ if (thresholds->passive.is_valid) {
+ p += sprintf(p, "passive: trip=%d tc1=%d tc2=%d tsp=%d devices=", thresholds->passive.temperature, thresholds->passive.tc1, thresholds->passive.tc2, thresholds->passive.tsp);
+ for (j=0; j<thresholds->passive.devices.count; j++)
+ p += sprintf(p, "%08x%c", thresholds->passive.devices.handles[j], (j==thresholds->passive.devices.count-1)?'\n':',');
X }
X
- thermal_zone = (TZ_CONTEXT*)context;
+ for (i=0; i<TZ_MAX_ACTIVE_THRESHOLDS; i++) {
+ if (!(thresholds->active[i].is_valid))
+ break;
+ p += sprintf(p, "active[%d]: trip=%d devices=", i, thresholds->active[i].temperature);
+ for (j=0; j<thresholds->active[i].devices.count; j++)
+ p += sprintf(p, "%08x%c", thresholds->active[i].devices.handles[j], (j==thresholds->passive.devices.count-1)?'\n':',');
+ }
X
- p += sprintf(p, "<TBD>\n");
+ p += sprintf(p, "cooling mode: ");
+ switch (tz->policy.cooling_mode) {
+ case TZ_COOLING_MODE_ACTIVE:
+ p += sprintf(p, "active (noisy)\n");
+ break;
+ case TZ_COOLING_MODE_PASSIVE:
+ p += sprintf(p, "passive (quiet)\n");
+ break;
+ default:
+ p += sprintf(p, "unknown\n");
+ break;
+ }
+
+ p += sprintf(p, "polling: ");
+ switch (tz->policy.polling_freq) {
+ case 0:
+ p += sprintf(p, "disabled\n");
+ break;
+ default:
+ p += sprintf(p, "%d dS\n", tz->policy.polling_freq);
+ break;
+ }
X
X end:
X len = (p - page);
@@ -85,7 +131,49 @@
X if (len>count) len = count;
X if (len<0) len = 0;
X
- return(len);
+ return len;
+}
+
+
+/****************************************************************************
+ *
+ * FUNCTION: tz_osl_proc_write_info


+ *
+ ****************************************************************************/
+

+static int tz_osl_proc_write_info (
+ struct file *file,
+ const char *buffer,
+ unsigned long count,
+ void *data)
+{
+ TZ_CONTEXT *tz = NULL;
+ u32 state = 0;
+ u32 size = 0;
+
+ if (!buffer || (count==0) || !data) {


+ goto end;
+ }
+

+ tz = (TZ_CONTEXT*)data;
+
+ size = strlen(buffer);
+ if (size < 4)
+ goto end;
+
+ /* Cooling preference: "scp=0" (active) or "scp=1" (passive) */
+ if (0 == strncmp(buffer, "scp=", 4)) {
+ tz_set_cooling_preference(tz, (buffer[4] - '0'));
+ }
+
+ /* Polling frequency: "tzp=X" (poll every X [0-9] seconds) */
+ else if (0 == strncmp(buffer, "tzp=", 4)) {
+ tz->policy.polling_freq = (buffer[4] - '0') * 10;
+ tz_policy_check(tz);
+ }
+
+end:
+ return count;
X }
X
X
@@ -104,7 +192,7 @@
X int *eof,
X void *context)
X {
- TZ_CONTEXT *thermal_zone = NULL;
+ TZ_CONTEXT *tz = NULL;
X char *p = page;


X int len = 0;

X
@@ -112,47 +200,27 @@
X goto end;
X }
X
- thermal_zone = (TZ_CONTEXT*)context;
+ tz = (TZ_CONTEXT*)context;
X
- p += sprintf(p, "Temperature: %d (1/10th degrees Kelvin)\n",
- thermal_zone->policy.temperature);
+ /* Temperature */
X
- p += sprintf(p, "State: ");
- if (thermal_zone->policy.state & TZ_STATE_ACTIVE) {
- p += sprintf(p, "active[%d] ", thermal_zone->policy.state & 0x07);
- }
- if (thermal_zone->policy.state & TZ_STATE_PASSIVE) {
- p += sprintf(p, "passive ");
- }
- if (thermal_zone->policy.state & TZ_STATE_CRITICAL) {
- p += sprintf(p, "critical ");
- }
- if (thermal_zone->policy.state == 0) {
- p += sprintf(p, "ok ");
- }
- p += sprintf(p, "\n");
+ tz_get_temperature(tz);
X
- p += sprintf(p, "Cooling Mode: ");
- switch (thermal_zone->policy.cooling_mode) {
- case TZ_COOLING_MODE_ACTIVE:
- p += sprintf(p, "active (noisy)\n");
- break;
- case TZ_COOLING_MODE_PASSIVE:
- p += sprintf(p, "passive (quiet)\n");
- break;
- default:
- p += sprintf(p, "unknown\n");
- break;
- }
+ p += sprintf(p, "temperature: %d dK\n", tz->policy.temperature);
X
- p += sprintf(p, "Polling Frequency: ");
- switch (thermal_zone->policy.polling_freq) {
- case 0:
- p += sprintf(p, "n/a\n");
- break;
- default:
- p += sprintf(p, "%d (1/10th seconds)\n", thermal_zone->policy.polling_freq);
- break;
+ p += sprintf(p, "state: ");
+ if (tz->policy.state == 0)
+ p += sprintf(p, "ok\n");
+ else if (tz->policy.state & TZ_STATE_CRITICAL)
+ p += sprintf(p, "critical\n");
+ else if (tz->policy.state & TZ_STATE_HOT)
+ p += sprintf(p, "hot\n");
+ else {
+ if (tz->policy.state & TZ_STATE_ACTIVE)
+ p += sprintf(p, "active[%d] ", tz->policy.state & 0x07);
+ if (tz->policy.state & TZ_STATE_PASSIVE)
+ p += sprintf(p, "passive ");
+ p += sprintf(p, "\n");
X }
X
X end:
@@ -175,30 +243,33 @@
X
X acpi_status
X tz_osl_add_device(
- TZ_CONTEXT *thermal_zone)
+ TZ_CONTEXT *tz)
X {
- struct proc_dir_entry *proc_entry = NULL, *proc;
+ struct proc_dir_entry *proc_entry = NULL;
+ struct proc_dir_entry *proc_child_entry = NULL;
X
- if (!thermal_zone) {
+ if (!tz) {
X return(AE_BAD_PARAMETER);
X }
X
- printk("Thermal Zone: found\n");
+ printk("ACPI: Thermal Zone found\n");
X
- proc_entry = proc_mkdir(thermal_zone->uid, tz_proc_root);
- if (!proc_entry)
+ proc_entry = proc_mkdir(tz->uid, tz_proc_root);
+ if (!proc_entry)
X return(AE_ERROR);
X
- proc = create_proc_read_entry(TZ_PROC_STATUS, S_IFREG | S_IRUGO,
- proc_entry, tz_osl_proc_read_status, (void*)thermal_zone);
- if (!proc)
+ proc_child_entry = create_proc_read_entry(TZ_PROC_STATUS, S_IFREG | S_IRUGO, proc_entry, tz_osl_proc_read_status, (void*)tz);
+ if (!proc_child_entry)
X return(AE_ERROR);
X
- proc = create_proc_read_entry(TZ_PROC_INFO, S_IFREG | S_IRUGO,
- proc_entry, tz_osl_proc_read_info, (void*)thermal_zone);
- if (!proc)
+ proc_child_entry = create_proc_entry(TZ_PROC_INFO, S_IFREG | 0644, proc_entry);
+ if (!proc_child_entry)
X return(AE_ERROR);
X
+ proc_child_entry->read_proc = tz_osl_proc_read_info;
+ proc_child_entry->write_proc = tz_osl_proc_write_info;
+ proc_child_entry->data = (void*)tz;
+
X return(AE_OK);
X }
X
@@ -211,21 +282,21 @@
X
X acpi_status
X tz_osl_remove_device (
- TZ_CONTEXT *thermal_zone)
+ TZ_CONTEXT *tz)
X {
X char proc_entry[64];
X
- if (!thermal_zone) {
+ if (!tz) {
X return(AE_BAD_PARAMETER);
X }
X
- sprintf(proc_entry, "%s/%s", thermal_zone->uid, TZ_PROC_INFO);
+ sprintf(proc_entry, "%s/%s", tz->uid, TZ_PROC_INFO);
X remove_proc_entry(proc_entry, tz_proc_root);
X
- sprintf(proc_entry, "%s/%s", thermal_zone->uid, TZ_PROC_STATUS);
+ sprintf(proc_entry, "%s/%s", tz->uid, TZ_PROC_STATUS);
X remove_proc_entry(proc_entry, tz_proc_root);
X
- sprintf(proc_entry, "%s", thermal_zone->uid);
+ sprintf(proc_entry, "%s", tz->uid);
X remove_proc_entry(proc_entry, tz_proc_root);
X
X return(AE_OK);
@@ -241,26 +312,26 @@
X acpi_status
X tz_osl_generate_event (
X u32 event,
- TZ_CONTEXT *thermal_zone)
+ TZ_CONTEXT *tz)
X {


X acpi_status status = AE_OK;
X

- if (!thermal_zone) {
+ if (!tz) {
X return(AE_BAD_PARAMETER);
X }
X
X switch (event) {
X
X case TZ_NOTIFY_TEMPERATURE_CHANGE:
- status = bm_osl_generate_event(thermal_zone->device_handle,
- TZ_PROC_ROOT, thermal_zone->uid, event,
- thermal_zone->policy.temperature);
+ status = bm_osl_generate_event(tz->device_handle,
+ TZ_PROC_ROOT, tz->uid, event,
+ tz->policy.temperature);
X break;
X
X case TZ_NOTIFY_THRESHOLD_CHANGE:
X case TZ_NOTIFY_DEVICE_LISTS_CHANGE:
- status = bm_osl_generate_event(thermal_zone->device_handle,
- TZ_PROC_ROOT, thermal_zone->uid, event, 0);
+ status = bm_osl_generate_event(tz->device_handle,
+ TZ_PROC_ROOT, tz->uid, event, 0);


X break;
X
X default:

@@ -276,12 +347,6 @@
X *
X * FUNCTION: tz_osl_init
X *
- * PARAMETERS: <none>
- *
- * RETURN: 0: Success
- *
- * DESCRIPTION: Module initialization.
- *
X ****************************************************************************/


X
X static int __init

@@ -312,12 +377,6 @@
X /****************************************************************************
X *
X * FUNCTION: tz_osl_cleanup
- *
- * PARAMETERS: <none>
- *
- * RETURN: <none>
- *
- * DESCRIPTION: Module cleanup.


X *
X ****************************************************************************/
X

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/ospm/thermal/tzpolicy.c linux/drivers/acpi/ospm/thermal/tzpolicy.c
--- v2.4.13/linux/drivers/acpi/ospm/thermal/tzpolicy.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/ospm/thermal/tzpolicy.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /****************************************************************************
X *

X * Module Name: tzpolicy.c -


- * $Revision: 28 $

+ * $Revision: 30 $


X *
X ****************************************************************************/
X

@@ -24,13 +24,10 @@
X */
X
X /*
- * TBD: 1. Move to user-space!
- * 2. Support ACPI 2.0 items (e.g. _TZD, _HOT).
- * 3. Support performance-limit control for non-processor devices
+ * TBD: 1. Support performance-limit control for non-processor devices
X * (those listed in _TZD, e.g. graphics).
X */
X
-/* TBD: Linux specific */
X #include <linux/proc_fs.h>
X #include <linux/sysctl.h>
X #include <linux/pm.h>
@@ -48,8 +45,6 @@
X * Globals
X ****************************************************************************/
X
-extern int TZP;
-
X void
X tz_policy_run (
X unsigned long data);
@@ -75,12 +70,10 @@
X
X status = bm_request(&request);
X
- if (ACPI_FAILURE(status)) {
+ if (ACPI_FAILURE(status))
X return status;


- }
- else {
+ else

X return request.status;
- }
X }
X
X
@@ -102,14 +95,44 @@
X {
X FUNCTION_TRACE("tz_policy_critical");
X
- if (!tz || !tz->policy.critical.threshold) {
+ if (!tz) {
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
- if (tz->policy.temperature >=
- tz->policy.critical.threshold->temperature) {
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Critical threshold reached - shutting down system.\n"));
- /* TBD: Need method for calling 'halt' - OSL function? */
+ if (tz->policy.temperature >= tz->policy.thresholds.critical.temperature) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Critical (S5) threshold reached.\n"));
+ /* TBD: Need method for shutting down system. */
+ }
+
+ return_ACPI_STATUS(AE_OK);
+}
+
+
+/****************************************************************************
+ *
+ * FUNCTION: tz_policy_hot


+ *
+ * PARAMETERS:

+ *
+ * RETURN:

+ *
+ * DESCRIPTION:

+ *
+ ****************************************************************************/
+
+acpi_status

+tz_policy_hot(
+ TZ_CONTEXT *tz)
+{
+ FUNCTION_TRACE("tz_policy_hot");
+
+ if (!tz || !tz->policy.thresholds.hot.is_valid) {
+ return_ACPI_STATUS(AE_BAD_PARAMETER);
+ }
+
+ if (tz->policy.temperature >= tz->policy.thresholds.hot.temperature) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Critical (S4) threshold reached.\n"));
+ /* TBD: Need method for invoking OS-level critical suspend. */
X }
X
X return_ACPI_STATUS(AE_OK);
@@ -132,20 +155,20 @@
X tz_policy_passive(
X TZ_CONTEXT *tz)
X {
- TZ_PASSIVE_POLICY *passive = NULL;
+ TZ_PASSIVE_THRESHOLD *passive = NULL;
X static u32 last_temperature = 0;
X s32 trend = 0;


X u32 i = 0;

X
X FUNCTION_TRACE("tz_policy_passive");
X
- if (!tz || !tz->policy.passive.threshold) {
+ if (!tz || !tz->policy.thresholds.passive.is_valid) {
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
- passive = &(tz->policy.passive);
+ passive = &(tz->policy.thresholds.passive);
X
- if (tz->policy.temperature >= passive->threshold->temperature) {
+ if (tz->policy.temperature >= passive->temperature) {
X /*
X * Thermal trend?
X * --------------
@@ -153,15 +176,8 @@
X * Specification), calculate the current thermal trend
X * (a.k.a. performance delta).
X */
- trend = passive->tc1 *
- (tz->policy.temperature - last_temperature) +
- passive->tc2 *
- (tz->policy.temperature - passive->threshold->temperature);
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "trend[%d] = TC1[%d]*(temp[%d]-last[%d]) + TC2[%d]*(temp[%d]-passive[%d])\n",
- trend, passive->tc1, tz->policy.temperature,
- last_temperature, passive->tc2, tz->policy.temperature,
- passive->threshold->temperature));
+ trend = passive->tc1 * (tz->policy.temperature - last_temperature) + passive->tc2 * (tz->policy.temperature - passive->temperature);
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "trend[%d] = TC1[%d]*(temp[%d]-last[%d]) + TC2[%d]*(temp[%d]-passive[%d])\n", trend, passive->tc1, tz->policy.temperature, last_temperature, passive->tc2, tz->policy.temperature, passive->temperature));
X
X last_temperature = tz->policy.temperature;
X
@@ -172,11 +188,8 @@
X * cooling devices (processors).
X */
X if (trend > 0) {
- for (i=0; i<passive->threshold->cooling_devices.count; i++) {
- set_performance_limit(
- passive->threshold->cooling_devices.handles[i],
- PR_PERF_DEC);
- }
+ for (i=0; i<passive->devices.count; i++)
+ set_performance_limit(passive->devices.handles[i], PR_PERF_DEC);
X }
X /*
X * Cooling Off?
@@ -185,11 +198,8 @@
X * cooling devices (processors).
X */
X else if (trend < 0) {
- for (i=0; i<passive->threshold->cooling_devices.count; i++) {
- set_performance_limit(
- passive->threshold->cooling_devices.handles[i],
- PR_PERF_INC);
- }
+ for (i=0; i<passive->devices.count; i++)
+ set_performance_limit(passive->devices.handles[i], PR_PERF_INC);
X }
X }
X
@@ -214,21 +224,20 @@
X TZ_CONTEXT *tz)
X {


X acpi_status status = AE_OK;

- TZ_THRESHOLD *active = NULL;
+ TZ_ACTIVE_THRESHOLD *active = NULL;
X u32 i,j = 0;
X
X FUNCTION_TRACE("tz_policy_active");
X
- if (!tz || !tz->policy.active.threshold) {
+ if (!tz || !tz->policy.thresholds.active[0].is_valid) {
X return_ACPI_STATUS(AE_BAD_PARAMETER);
X }
X
- for (i = 0; i < TZ_MAX_ACTIVE_THRESHOLDS; i++) {
+ for (i=0; i<TZ_MAX_ACTIVE_THRESHOLDS; i++) {
X
- active = tz->policy.active.threshold[i];
- if (!active) {
+ active = &(tz->policy.thresholds.active[i]);
+ if (!active || !active->is_valid)
X break;
- }
X
X /*
X * Above Threshold?
@@ -236,24 +245,17 @@
X * If not already enabled, turn ON all cooling devices
X * associated with this active threshold.
X */
- if ((tz->policy.temperature >= active->temperature) &&
- (active->cooling_state != TZ_COOLING_ENABLED)) {
-
- for (j = 0; j < active->cooling_devices.count; j++) {
-
- status = bm_set_device_power_state(
- active->cooling_devices.handles[j],
- ACPI_STATE_D0);
-
+ if ((tz->policy.temperature >= active->temperature) && (active->cooling_state != TZ_COOLING_ENABLED)) {
+ for (j = 0; j < active->devices.count; j++) {
+ status = bm_set_device_power_state(active->devices.handles[j], ACPI_STATE_D0);
X if (ACPI_SUCCESS(status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Cooling device [%02x] now ON.\n", active->cooling_devices.handles[j]));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Cooling device [%02x] now ON.\n", active->devices.handles[j]));
X }
X else {
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to turn ON cooling device [%02x].\n", active->cooling_devices.handles[j]));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Unable to turn ON cooling device [%02x].\n", active->devices.handles[j]));
X }
X }
-
- active->cooling_state = TZ_COOLING_ENABLED;
+ active->cooling_state = TZ_COOLING_ENABLED;
X }
X /*
X * Below Threshold?
@@ -265,21 +267,15 @@
X * during the first pass.
X */
X else if (active->cooling_state != TZ_COOLING_DISABLED) {
-
- for (j = 0; j < active->cooling_devices.count; j++) {
-
- status = bm_set_device_power_state(
- active->cooling_devices.handles[j],
- ACPI_STATE_D3);
-
+ for (j = 0; j < active->devices.count; j++) {
+ status = bm_set_device_power_state(active->devices.handles[j], ACPI_STATE_D3);
X if (ACPI_SUCCESS(status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Cooling device [%02x] now OFF.\n", active->cooling_devices.handles[j]));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Cooling device [%02x] now OFF.\n", active->devices.handles[j]));
X }
X else {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unable to turn OFF cooling device [%02x].\n", active->cooling_devices.handles[j]));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unable to turn OFF cooling device [%02x].\n", active->devices.handles[j]));
X }
X }
-
X active->cooling_state = TZ_COOLING_DISABLED;
X }
X }
@@ -308,6 +304,8 @@
X {


X acpi_status status = AE_OK;

X TZ_CONTEXT *tz = NULL;
+ TZ_POLICY *policy = NULL;
+ TZ_THRESHOLDS *thresholds = NULL;
X u32 previous_temperature = 0;
X u32 previous_state = 0;
X u32 active_index = 0;


@@ -322,6 +320,8 @@
X }

X
X tz = (TZ_CONTEXT*)context;
+ policy = &(tz->policy);
+ thresholds = &(tz->policy.thresholds);
X
X /*
X * Preserve Previous State:
@@ -334,7 +334,7 @@
X * Get Temperature:
X * ----------------
X */
- status = tz_get_temperature(tz, &(tz->policy.temperature));
+ status = tz_get_temperature(tz);
X if (ACPI_FAILURE(status)) {
X return_VOID;
X }
@@ -343,32 +343,30 @@
X * Calculate State:
X * ----------------
X */
- tz->policy.state = TZ_STATE_OK;
+ policy->state = TZ_STATE_OK;
X
X /* Critical? */
- if ((tz->policy.critical.threshold) &&
- (tz->policy.temperature >= tz->policy.critical.threshold->temperature)) {
- tz->policy.state |= TZ_STATE_CRITICAL;
- }
+ if (policy->temperature >= thresholds->critical.temperature)
+ policy->state |= TZ_STATE_CRITICAL;
+
+ /* Hot? */
+ if ((thresholds->hot.is_valid) && (policy->temperature >= thresholds->hot.temperature))
+ policy->state |= TZ_STATE_CRITICAL;
X
X /* Passive? */
- if ((tz->policy.passive.threshold) &&
- (tz->policy.temperature >= tz->policy.passive.threshold->temperature)) {


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 21'
echo 'File patch-2.4.14 is continued in part 22'
echo "22" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:42 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part19

#!/bin/sh -x
# this is part 19 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 19; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X u32 min_address_fixed;
X u32 max_address_fixed;
X acpi_resource_attribute attribute;
- UINT64 granularity;
- UINT64 min_address_range;
- UINT64 max_address_range;
- UINT64 address_translation_offset;
- UINT64 address_length;
+ u64 granularity;
+ u64 min_address_range;
+ u64 max_address_range;
+ u64 address_translation_offset;
+ u64 address_length;
X acpi_resource_source resource_source;
X
X } acpi_resource_address64;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/acutils.h linux/drivers/acpi/include/acutils.h
--- v2.4.13/linux/drivers/acpi/include/acutils.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/acutils.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
- * $Revision: 113 $
+ * $Revision: 117 $


X *
X *****************************************************************************/
X

@@ -270,47 +270,47 @@
X void
X acpi_ut_trace (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info);
+ acpi_debug_print_info *dbg_info);
X
X void
X acpi_ut_trace_ptr (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X void *pointer);
X
X void
X acpi_ut_trace_u32 (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X u32 integer);
X
X void
X acpi_ut_trace_str (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X NATIVE_CHAR *string);
X
X void
X acpi_ut_exit (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info);
+ acpi_debug_print_info *dbg_info);
X
X void
X acpi_ut_status_exit (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X acpi_status status);
X
X void
X acpi_ut_value_exit (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X acpi_integer value);
X
X void
X acpi_ut_ptr_exit (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X u8 *ptr);
X
X void
@@ -342,17 +342,17 @@
X acpi_ut_debug_print (
X u32 requested_debug_level,
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X char *format,
- ...);
+ ...) ACPI_PRINTF_LIKE_FUNC;
X
X void
X acpi_ut_debug_print_raw (
X u32 requested_debug_level,
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X char *format,
- ...);
+ ...) ACPI_PRINTF_LIKE_FUNC;
X
X
X /*
@@ -389,6 +389,7 @@
X #define METHOD_NAME__REG "_REG"
X #define METHOD_NAME__SEG "_SEG"
X #define METHOD_NAME__BBN "_BBN"
+#define METHOD_NAME__PRT "_PRT"
X
X
X acpi_status
@@ -400,7 +401,7 @@
X acpi_status
X acpi_ut_execute_HID (
X acpi_namespace_node *device_node,
- ACPI_DEVICE_ID *hid);
+ acpi_device_id *hid);
X
X acpi_status
X acpi_ut_execute_STA (
@@ -410,7 +411,7 @@
X acpi_status
X acpi_ut_execute_UID (
X acpi_namespace_node *device_node,
- ACPI_DEVICE_ID *uid);
+ acpi_device_id *uid);
X
X
X /*
@@ -562,9 +563,23 @@
X void);
X
X /*
- * Ututils
+ * utmisc
X */
X

+acpi_status
+acpi_ut_divide (
+ acpi_integer *in_dividend,
+ acpi_integer *in_divisor,
+ acpi_integer *out_quotient,
+ acpi_integer *out_remainder);
+

+acpi_status
+acpi_ut_short_divide (
+ acpi_integer *in_dividend,
+ u32 divisor,


+ acpi_integer *out_quotient,
+ u32 *out_remainder);
+

X u8
X acpi_ut_valid_acpi_name (
X u32 name);
@@ -638,7 +653,7 @@
X void);
X
X void
-acpi_ut_dump_current_allocations (
+acpi_ut_dump_allocations (
X u32 component,
X NATIVE_CHAR *module);
X #endif
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/amlcode.h linux/drivers/acpi/include/amlcode.h
--- v2.4.13/linux/drivers/acpi/include/amlcode.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/amlcode.h Wed Oct 24 14:06:22 2001
@@ -3,7 +3,7 @@
X * Name: amlcode.h - Definitions for AML, as included in "definition blocks"
X * Declarations and definitions contained herein are derived
X * directly from the ACPI specification.
- * $Revision: 53 $
+ * $Revision: 58 $


X *
X *****************************************************************************/
X

@@ -266,47 +266,96 @@
X #define OPGRP_FIELD 0x02
X #define OPGRP_BYTELIST 0x04
X
-#define OPTYPE_UNDEFINED 0
X
+/*
+ * Opcode information
+ */
X
-#define OPTYPE_LITERAL 1
-#define OPTYPE_CONSTANT 2
-#define OPTYPE_METHOD_ARGUMENT 3
-#define OPTYPE_LOCAL_VARIABLE 4
-#define OPTYPE_DATA_TERM 5
-
-/* Type 1 opcodes */
-
-#define OPTYPE_MONADIC1 6
-#define OPTYPE_DYADIC1 7
-
-/* Type 2 opcodes */
+/* Opcode flags */
X
-#define OPTYPE_MONADIC2 8
-#define OPTYPE_MONADIC2_r 9
-#define OPTYPE_DYADIC2 10
-#define OPTYPE_DYADIC2_r 11
-#define OPTYPE_DYADIC2_s 12
+#define AML_HAS_ARGS 0x0800
+#define AML_HAS_TARGET 0x0400
+#define AML_HAS_RETVAL 0x0200
+#define AML_NSOBJECT 0x0100
+#define AML_NSOPCODE 0x0080
+#define AML_NSNODE 0x0040
+#define AML_NAMED 0x0020
+#define AML_DEFER 0x0010
+#define AML_FIELD 0x0008
+#define AML_CREATE 0x0004
+#define AML_MATH 0x0002
+#define AML_LOGICAL 0x0001
+
+/* Convenient flag groupings */
+
+#define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */
+#define AML_FLAGS_EXEC_1A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Monadic2 */
+#define AML_FLAGS_EXEC_1A_1T_0R AML_HAS_ARGS | AML_HAS_TARGET
+#define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* Monadic2_r */
+#define AML_FLAGS_EXEC_2A_0T_0R AML_HAS_ARGS /* Dyadic1 */
+#define AML_FLAGS_EXEC_2A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Dyadic2 */
+#define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* Dyadic2_r */
+#define AML_FLAGS_EXEC_2A_2T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
+#define AML_FLAGS_EXEC_3A_0T_0R AML_HAS_ARGS
+#define AML_FLAGS_EXEC_3A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
+#define AML_FLAGS_EXEC_6A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL
X
-/* Multi-operand (>=3) opcodes */
X
-#define OPTYPE_TRIADIC 13
-#define OPTYPE_QUADRADIC 14
-#define OPTYPE_HEXADIC 15
+/*
+ * The opcode Type is used in a dispatch table, do not change
+ * without updating the table.
+ */
+#define AML_TYPE_EXEC_1A_0T_0R 0x00 /* Monadic1 */
+#define AML_TYPE_EXEC_1A_0T_1R 0x01 /* Monadic2 */
+#define AML_TYPE_EXEC_1A_1T_0R 0x02
+#define AML_TYPE_EXEC_1A_1T_1R 0x03 /* Monadic2_r */
+#define AML_TYPE_EXEC_2A_0T_0R 0x04 /* Dyadic1 */
+#define AML_TYPE_EXEC_2A_0T_1R 0x05 /* Dyadic2 */
+#define AML_TYPE_EXEC_2A_1T_1R 0x06 /* Dyadic2_r */
+#define AML_TYPE_EXEC_2A_2T_1R 0x07
+#define AML_TYPE_EXEC_3A_0T_0R 0x08
+#define AML_TYPE_EXEC_3A_1T_1R 0x09
+#define AML_TYPE_EXEC_6A_0T_1R 0x0A
+/* End of types used in dispatch table */
+
+#define AML_TYPE_LITERAL 0x0B
+#define AML_TYPE_CONSTANT 0x0C
+#define AML_TYPE_METHOD_ARGUMENT 0x0D
+#define AML_TYPE_LOCAL_VARIABLE 0x0E
+#define AML_TYPE_DATA_TERM 0x0F
X
X /* Generic for an op that returns a value */
X
-#define OPTYPE_METHOD_CALL 16
+#define AML_TYPE_METHOD_CALL 0x10
X
X /* Misc */
X
-#define OPTYPE_CREATE_FIELD 17
-#define OPTYPE_CONTROL 18
-#define OPTYPE_RECONFIGURATION 19
-#define OPTYPE_NAMED_OBJECT 20
-#define OPTYPE_RETURN 21
+#define AML_TYPE_CREATE_FIELD 0x11
+#define AML_TYPE_CONTROL 0x12
+#define AML_TYPE_NAMED_NO_OBJ 0x13
+#define AML_TYPE_NAMED_FIELD 0x14
+#define AML_TYPE_NAMED_SIMPLE 0x15
+#define AML_TYPE_NAMED_COMPLEX 0x16
+#define AML_TYPE_RETURN 0x17
+
+#define AML_TYPE_UNDEFINED 0x18
+#define AML_TYPE_BOGUS 0x19
+
X
-#define OPTYPE_BOGUS 22
+/*
+ * Opcode classes
+ */
+#define AML_CLASS_EXECUTE 0x00
+#define AML_CLASS_CREATE 0x01
+#define AML_CLASS_ARGUMENT 0x02
+#define AML_CLASS_NAMED_OBJECT 0x03
+#define AML_CLASS_CONTROL 0x04
+#define AML_CLASS_ASCII 0x05
+#define AML_CLASS_PREFIX 0x06
+#define AML_CLASS_INTERNAL 0x07
+#define AML_CLASS_RETURN_VALUE 0x08
+#define AML_CLASS_METHOD_CALL 0x09
+#define AML_CLASS_UNKNOWN 0x0A
X
X
X /* Predefined Operation Region Space_iDs */
@@ -406,18 +455,5 @@
X
X #define USER_REGION_BEGIN 0x80
X
-/*
- * AML tables
- */
-
-#ifdef DEFINE_AML_GLOBALS
-
-/* External declarations for the AML tables */
-
-extern u8 acpi_gbl_aml [NUM_OPCODES];
-extern u16 acpi_gbl_pfx [NUM_OPCODES];
-
-
-#endif /* DEFINE_AML_GLOBALS */
X
X #endif /* __AMLCODE_H__ */
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/platform/acenv.h linux/drivers/acpi/include/platform/acenv.h
--- v2.4.13/linux/drivers/acpi/include/platform/acenv.h Sun Sep 23 11:40:56 2001
+++ linux/drivers/acpi/include/platform/acenv.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Name: acenv.h - Generation environment specific items
- * $Revision: 76 $
+ * $Revision: 77 $


X *
X *****************************************************************************/
X

@@ -126,6 +126,12 @@
X /* Name of host operating system (returned by the _OS_ namespace object) */
X
X #define ACPI_OS_NAME "Intel ACPI/CA Core Subsystem"
+
+/* This macro is used to tag functions as "printf-like" because
+ * some compilers can catch printf format string problems. MSVC
+ * doesn't, so this is proprocessed away.
+ */
+#define ACPI_PRINTF_LIKE_FUNC
X
X #endif
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/platform/acgcc.h linux/drivers/acpi/include/platform/acgcc.h
--- v2.4.13/linux/drivers/acpi/include/platform/acgcc.h Tue Oct 23 22:48:50 2001
+++ linux/drivers/acpi/include/platform/acgcc.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Name: acgcc.h - GCC specific defines, etc.


- * $Revision: 9 $

+ * $Revision: 14 $


X *
X *****************************************************************************/
X

@@ -93,6 +93,7 @@
X
X
X #else /* DO IA32 */
+
X #define COMPILER_DEPENDENT_UINT64 unsigned long long
X #define ACPI_ASM_MACROS
X #define causeinterrupt(level)
@@ -100,7 +101,6 @@
X #define disable() __cli()
X #define enable() __sti()
X #define halt() __asm__ __volatile__ ("sti; hlt":::"memory")
-#define wbinvd() __asm__ __volatile__ ("wbinvd":::"memory")
X
X /*! [Begin] no source code translation
X *
@@ -139,8 +139,30 @@
X :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~3L):"dx"); \
X } while(0)
X
+
+/*
+ * Math helper asm macros
+ */
+#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
+ asm("divl %2;" \
+ :"=a"(q32), "=d"(r32) \
+ :"r"(d32), \
+ "0"(n_lo), "1"(n_hi))
+
+
+#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
+ asm("shrl $1,%2;" \
+ "rcrl $1,%3;" \
+ :"=r"(n_hi), "=r"(n_lo) \
+ :"0"(n_hi), "1"(n_lo))
+
X /*! [End] no source code translation !*/
X
X #endif /* IA 32 */
+
+/* This macro is used to tag functions as "printf-like" because
+ * some compilers (like GCC) can catch printf format string problems.
+ */
+#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 4, 5)))
X
X #endif /* __ACGCC_H__ */
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/include/platform/aclinux.h linux/drivers/acpi/include/platform/aclinux.h
--- v2.4.13/linux/drivers/acpi/include/platform/aclinux.h Tue Jul 3 17:08:19 2001
+++ linux/drivers/acpi/include/platform/aclinux.h Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Name: aclinux.h - OS specific defines, etc.
- * $Revision: 13 $
+ * $Revision: 14 $


X *
X *****************************************************************************/
X

@@ -57,15 +57,6 @@
X
X #undef DEBUGGER_THREADING
X #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
-
-#ifndef _IA64
-/* Linux ia32 can't do int64 well */
-#define ACPI_NO_INTEGER64_SUPPORT
-/* And the ia32 kernel doesn't include 64-bit divide support */
-#define ACPI_DIV64(dividend, divisor) do_div(dividend, divisor)
-#else
-#define ACPI_DIV64(dividend, divisor) ACPI_DIVIDE(dividend, divisor)
-#endif
X
X
X #endif /* __ACLINUX_H__ */
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nsaccess.c linux/drivers/acpi/namespace/nsaccess.c
--- v2.4.13/linux/drivers/acpi/namespace/nsaccess.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nsaccess.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: nsaccess - Top-level functions for accessing ACPI namespace
- * $Revision: 133 $
+ * $Revision: 135 $


X *
X ******************************************************************************/
X

@@ -185,6 +185,10 @@
X /* Store pointer to value descriptor in the Node */
X
X acpi_ns_attach_object (new_node, obj_desc, obj_desc->common.type);
+


+ /* Remove local reference to the object */

+
+ acpi_ut_remove_reference (obj_desc);
X }
X }
X
@@ -434,7 +438,7 @@
X ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
X
X for (i = 0; i < num_segments; i++) {
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "%4.4s/", &pathname[i * 4]));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "%4.4s/", (char*)&pathname[i * 4]));
X }
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "]\n"));
X #endif
@@ -474,8 +478,8 @@
X /* Name not found in ACPI namespace */
X
X ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
- "Name [%4.4s] not found in scope %X\n",
- &simple_name, current_node));
+ "Name [%4.4s] not found in scope %p\n",
+ (char*)&simple_name, current_node));


X }
X
X return_ACPI_STATUS (status);

@@ -507,7 +511,7 @@
X
X REPORT_WARNING (
X ("Ns_lookup: %4.4s, type %X, checking for type %X\n",
- &simple_name, this_node->type, type_to_check_for));
+ (char*)&simple_name, this_node->type, type_to_check_for));
X }
X
X /*
@@ -525,7 +529,7 @@
X * More segments or the type implies enclosed scope,
X * and the next scope has not been allocated.
X */
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Load mode=%X This_node=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Load mode=%X This_node=%p\n",
X interpreter_mode, this_node));
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nsalloc.c linux/drivers/acpi/namespace/nsalloc.c
--- v2.4.13/linux/drivers/acpi/namespace/nsalloc.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nsalloc.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: nsalloc - Namespace allocation and deletion utilities
- * $Revision: 56 $
+ * $Revision: 60 $


X *
X ******************************************************************************/
X

@@ -210,7 +210,7 @@
X * real definition is found later.
X */
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "[%4.4s] is a forward reference\n",


- &node->name));
+ (char*)&node->name));

X }
X
X /*
@@ -235,7 +235,7 @@
X }
X
X ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s added to %p at %p\n",
- &node->name, parent_node, node));
+ (char*)&node->name, parent_node, node));
X
X /*
X * Increment the reference count(s) of all parents up to
@@ -297,7 +297,7 @@
X /* Grandchildren should have all been deleted already */
X
X if (child_node->child) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Found a grandchild! P=%X C=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Found a grandchild! P=%p C=%p\n",
X parent_node, child_node));
X }
X
@@ -309,12 +309,9 @@
X child_node, acpi_gbl_current_node_count));
X
X /*
- * Detach an object if there is one
+ * Detach an object if there is one, then free the child node
X */
- if (child_node->object) {
- acpi_ns_detach_object (child_node);
- }
-
+ acpi_ns_detach_object (child_node);
X ACPI_MEM_FREE (child_node);
X
X /* And move on to the next child in the list */
@@ -349,9 +346,8 @@
X acpi_ns_delete_namespace_subtree (
X acpi_namespace_node *parent_node)
X {
- acpi_namespace_node *child_node;
- acpi_operand_object *obj_desc;
- u32 level;
+ acpi_namespace_node *child_node = NULL;
+ u32 level = 1;
X
X
X FUNCTION_TRACE ("Ns_delete_namespace_subtree");
@@ -361,39 +357,26 @@


X return_ACPI_STATUS (AE_OK);
X }
X
-

- child_node = 0;
- level = 1;
-
X /*
X * Traverse the tree of objects until we bubble back up
X * to where we started.


X */
X while (level > 0) {
- /*
- * Get the next typed object in this scope.

- * Null returned if not found
- */
- child_node = acpi_ns_get_next_object (ACPI_TYPE_ANY, parent_node,
+ /* Get the next node in this scope (NULL if none) */
+


+ child_node = acpi_ns_get_next_node (ACPI_TYPE_ANY, parent_node,

X child_node);
X if (child_node) {
- /*
- * Found an object - delete the object within
- * the Value field
- */
- obj_desc = acpi_ns_get_attached_object (child_node);
- if (obj_desc) {
- acpi_ns_detach_object (child_node);
- acpi_ut_remove_reference (obj_desc);
- }
+ /* Found a child node - detach any attached object */
X
+ acpi_ns_detach_object (child_node);
X
- /* Check if this object has any children */
+ /* Check if this node has any children */
X
- if (acpi_ns_get_next_object (ACPI_TYPE_ANY, child_node, 0)) {


+ if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, 0)) {
X /*

- * There is at least one child of this object,
- * visit the object
+ * There is at least one child of this node,
+ * visit the node


X */
X level++;
X parent_node = child_node;

@@ -403,8 +386,8 @@


X
X else {
X /*

- * No more children in this object.
- * We will move up to the grandparent.
+ * No more children of this parent node.
+ * Move up to the grandparent.


X */
X level--;
X

@@ -414,17 +397,16 @@
X */
X acpi_ns_delete_children (parent_node);
X
- /* New "last child" is this parent object */
+ /* New "last child" is this parent node */
X
X child_node = parent_node;
X
- /* Now we can move up the tree to the grandparent */
+ /* Move up the tree to the grandparent */
X
X parent_node = acpi_ns_get_parent_object (parent_node);
X }
X }
X
-


X return_ACPI_STATUS (AE_OK);
X }
X

@@ -433,13 +415,13 @@
X *
X * FUNCTION: Acpi_ns_remove_reference
X *
- * PARAMETERS: Node - Named object whose reference count is to be
+ * PARAMETERS: Node - Named node whose reference count is to be
X * decremented
X *
X * RETURN: None.
X *
X * DESCRIPTION: Remove a Node reference. Decrements the reference count
- * of all parent Nodes up to the root. Any object along
+ * of all parent Nodes up to the root. Any node along
X * the way that reaches zero references is freed.
X *
X ******************************************************************************/
@@ -455,19 +437,19 @@
X
X
X /*
- * Decrement the reference count(s) of this object and all
- * objects up to the root, Delete anything with zero remaining references.
+ * Decrement the reference count(s) of this node and all
+ * nodes up to the root, Delete anything with zero remaining references.
X */
X next_node = node;
X while (next_node) {
- /* Decrement the reference count on this object*/
+ /* Decrement the reference count on this node*/
X
X next_node->reference_count--;
X
- /* Delete the object if no more references */
+ /* Delete the node if no more references */
X
X if (!next_node->reference_count) {
- /* Delete all children and delete the object */
+ /* Delete all children and delete the node */
X
X acpi_ns_delete_children (next_node);
X acpi_ns_delete_node (next_node);
@@ -500,7 +482,6 @@
X {
X acpi_namespace_node *child_node;
X u32 level;
- acpi_operand_object *obj_desc;
X acpi_namespace_node *parent_node;
X
X
@@ -512,38 +493,28 @@
X level = 1;
X
X /*


- * Traverse the tree of objects until we bubble back up

+ * Traverse the tree of nodes until we bubble back up

X * to where we started.


X */
X while (level > 0) {
- /*
- * Get the next typed object in this scope.

- * Null returned if not found
- */
- child_node = acpi_ns_get_next_object (ACPI_TYPE_ANY, parent_node,
- child_node);
+ /* Get the next node in this scope (NULL if none) */
X

+ child_node = acpi_ns_get_next_node (ACPI_TYPE_ANY, parent_node,

+ child_node);
X if (child_node) {
X if (child_node->owner_id == owner_id) {
- /*
- * Found an object - delete the object within
- * the Value field
- */
- obj_desc = acpi_ns_get_attached_object (child_node);
- if (obj_desc) {
- acpi_ns_detach_object (child_node);
- acpi_ut_remove_reference (obj_desc);
- }
+ /* Found a child node - detach any attached object */
+
+ acpi_ns_detach_object (child_node);
X }
X
- /* Check if this object has any children */
+ /* Check if this node has any children */
X
- if (acpi_ns_get_next_object (ACPI_TYPE_ANY, child_node, 0)) {


+ if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, 0)) {
X /*

- * There is at least one child of this object,
- * visit the object
+ * There is at least one child of this node,
+ * visit the node
X */
-


X level++;
X parent_node = child_node;

X child_node = 0;
@@ -556,7 +527,8 @@


X
X else {
X /*

- * No more children in this object. Move up to grandparent.
+ * No more children of this parent node.
+ * Move up to the grandparent.


X */
X level--;
X

@@ -566,16 +538,15 @@
X }
X }
X
- /* New "last child" is this parent object */
+ /* New "last child" is this parent node */
X
X child_node = parent_node;
X
- /* Now we can move up the tree to the grandparent */
+ /* Move up the tree to the grandparent */
X
X parent_node = acpi_ns_get_parent_object (parent_node);
X }
X }
-
X
X return_ACPI_STATUS (AE_OK);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nsdump.c linux/drivers/acpi/namespace/nsdump.c
--- v2.4.13/linux/drivers/acpi/namespace/nsdump.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nsdump.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: nsdump - table dumping routines for debug


- * $Revision: 99 $

+ * $Revision: 105 $


X *
X *****************************************************************************/
X

@@ -28,6 +28,7 @@


X #include "acinterp.h"
X #include "acnamesp.h"

X #include "actables.h"
+#include "acparser.h"
X
X
X #define _COMPONENT ACPI_NAMESPACE
@@ -108,9 +109,8 @@


X void *context,
X void **return_value)
X {

- ACPI_WALK_INFO *info = (ACPI_WALK_INFO *) context;
+ acpi_walk_info *info = (acpi_walk_info *) context;
X acpi_namespace_node *this_node;
- u8 *value;


X acpi_operand_object *obj_desc = NULL;

X acpi_object_type8 obj_type;
X acpi_object_type8 type;
@@ -118,12 +118,13 @@
X u32 downstream_sibling_mask = 0;
X u32 level_tmp;
X u32 which_bit;


+ u32 i;
X
X

X PROC_NAME ("Ns_dump_one_object");
X
X
- this_node = acpi_ns_convert_handle_to_entry (obj_handle);
+ this_node = acpi_ns_map_handle_to_node (obj_handle);
X
X level_tmp = level;
X type = this_node->type;
@@ -204,56 +205,198 @@
X /*
X * Now we can print out the pertinent information
X */
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %4.4s %-9s ", &this_node->name, acpi_ut_get_type_name (type)));
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "%p S:%p O:%p", this_node, this_node->child, this_node->object));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %4.4s %-12s %p",
+ (char*)&this_node->name, acpi_ut_get_type_name (type), this_node));
X
+ obj_desc = this_node->object;
X
- if (!this_node->object) {
- /* No attached object, we are done */
+ switch (info->display_type) {
+ case ACPI_DISPLAY_SUMMARY:
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
- return (AE_OK);
- }
+ if (!obj_desc) {
+ /* No attached object, we are done */
X
- switch (type) {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));


+ return (AE_OK);
+ }
X

- case ACPI_TYPE_METHOD:
X
- /* Name is a Method and its AML offset/length are set */
+ switch (type) {
+ case ACPI_TYPE_PROCESSOR:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ID %d Addr %.4X Len %.4X\n",
+ obj_desc->processor.proc_id,
+ obj_desc->processor.address,
+ obj_desc->processor.length));
+ break;
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " M:%p-%X\n",
- ((acpi_operand_object *) this_node->object)->method.pcode,
- ((acpi_operand_object *) this_node->object)->method.pcode_length));
+ case ACPI_TYPE_DEVICE:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Notification object: %p", obj_desc));
+ break;
X
- break;
+ case ACPI_TYPE_METHOD:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Args %d Len %.4X Aml %p \n",
+ obj_desc->method.param_count,
+ obj_desc->method.aml_length,
+ obj_desc->method.aml_start));
+ break;
X
+ case ACPI_TYPE_INTEGER:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " = %8.8X%8.8X\n",
+ HIDWORD (obj_desc->integer.value),
+ LODWORD (obj_desc->integer.value)));
+ break;
X
- case ACPI_TYPE_INTEGER:
+ case ACPI_TYPE_PACKAGE:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Elements %.2X\n",
+ obj_desc->package.count));
+ break;
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " N:%X\n",
- ((acpi_operand_object *) this_node->object)->integer.value));
- break;
+ case ACPI_TYPE_BUFFER:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Len %.2X",
+ obj_desc->buffer.length));
X
+ /* Dump some of the buffer */
X
- case ACPI_TYPE_STRING:
+ if (obj_desc->buffer.length > 0) {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ="));
+ for (i = 0; (i < obj_desc->buffer.length && i < 12); i++) {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %.2X",
+ obj_desc->buffer.pointer[i]));
+ }
+ }
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
+ break;
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " S:%p-%X\n",
- ((acpi_operand_object *) this_node->object)->string.pointer,
- ((acpi_operand_object *) this_node->object)->string.length));
- break;
+ case ACPI_TYPE_STRING:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Len %.2X",
+ obj_desc->string.length));
X
+ if (obj_desc->string.length > 0) {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " = \"%.32s\"...",
+ obj_desc->string.pointer));
+ }
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
+ break;
X
- case ACPI_TYPE_BUFFER:
+ case ACPI_TYPE_REGION:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [%s]",
+ acpi_ut_get_region_name (obj_desc->region.space_id)));
+ if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Addr %8.8X%8.8X Len %.4X\n",
+ HIDWORD(obj_desc->region.address),
+ LODWORD(obj_desc->region.address),
+ obj_desc->region.length));
+ }
+ else {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [Address/Length not evaluated]\n"));
+ }
+ break;
+
+ case INTERNAL_TYPE_REFERENCE:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [%s]\n",
+ acpi_ps_get_opcode_name (obj_desc->reference.opcode)));
+ break;
+
+ case ACPI_TYPE_BUFFER_FIELD:
+
+ /* TBD: print Buffer name when we can easily get it */
+ break;
+
+ case INTERNAL_TYPE_REGION_FIELD:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]",
+ (char *) &obj_desc->common_field.region_obj->region.node->name));
+ break;
+
+ case INTERNAL_TYPE_BANK_FIELD:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]",
+ (char *) &obj_desc->common_field.region_obj->region.node->name));
+ break;
+
+ case INTERNAL_TYPE_INDEX_FIELD:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]",
+ (char *) &obj_desc->index_field.index_obj->common_field.region_obj->region.node->name));


+ break;
+
+ default:
+

+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Object %p\n", obj_desc));
+ break;
+ }
+
+ /* Common field handling */
+
+ switch (type) {
+ case ACPI_TYPE_BUFFER_FIELD:


+ case INTERNAL_TYPE_REGION_FIELD:
+ case INTERNAL_TYPE_BANK_FIELD:
+ case INTERNAL_TYPE_INDEX_FIELD:

+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Off %.2X Len %.2X Acc %.2d\n",
+ (obj_desc->common_field.base_byte_offset * 8) + obj_desc->common_field.start_field_bit_offset,
+ obj_desc->common_field.bit_length,
+ obj_desc->common_field.access_bit_width));
+ break;
+ }
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " B:%p-%X\n",
- ((acpi_operand_object *) this_node->object)->buffer.pointer,
- ((acpi_operand_object *) this_node->object)->buffer.length));
X break;
X
X
- default:
+ case ACPI_DISPLAY_OBJECTS:
+
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "%p O:%p",
+ this_node, obj_desc));
+
+ if (!obj_desc) {
+ /* No attached object, we are done */
+
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));


+ return (AE_OK);
+ }
+

+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(R%d)",
+ obj_desc->common.reference_count));


+
+ switch (type) {
+

+ case ACPI_TYPE_METHOD:
+
+ /* Name is a Method and its AML offset/length are set */
+
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " M:%p-%X\n",
+ obj_desc->method.aml_start,
+ obj_desc->method.aml_length));
+
+ break;
+
+
+ case ACPI_TYPE_INTEGER:
+
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " N:%X%X\n",
+ HIDWORD(obj_desc->integer.value),
+ LODWORD(obj_desc->integer.value)));
+ break;
+
+
+ case ACPI_TYPE_STRING:
+
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " S:%p-%X\n",
+ obj_desc->string.pointer,
+ obj_desc->string.length));
+ break;
+
+
+ case ACPI_TYPE_BUFFER:
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " B:%p-%X\n",
+ obj_desc->buffer.pointer,
+ obj_desc->buffer.length));
+ break;
+
+
+ default:
+
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
+ break;


+ }
X break;
X }
X

@@ -266,30 +409,24 @@
X
X /* If there is an attached object, display it */
X
- value = this_node->object;
+ obj_desc = this_node->object;
X
X /* Dump attached objects */
X
- while (value) {
+ while (obj_desc) {
X obj_type = INTERNAL_TYPE_INVALID;
X
X /* Decode the type of attached object and dump the contents */
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Attached Object %p: ", value));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Attached Object %p: ", obj_desc));
X
- if (acpi_tb_system_table_pointer (value)) {
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to AML Code)\n"));
- bytes_to_dump = 16;
- }
-
- else if (VALID_DESCRIPTOR_TYPE (value, ACPI_DESC_TYPE_NAMED)) {
+ if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) {
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to Node)\n"));
X bytes_to_dump = sizeof (acpi_namespace_node);
X }
X
X
- else if (VALID_DESCRIPTOR_TYPE (value, ACPI_DESC_TYPE_INTERNAL)) {
- obj_desc = (acpi_operand_object *) value;
+ else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_INTERNAL)) {
X obj_type = obj_desc->common.type;
X
X if (obj_type > INTERNAL_TYPE_MAX) {


@@ -298,23 +435,22 @@
X }

X
X else {
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %X [%s])\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %2.2X [%s])\n",
X obj_type, acpi_ut_get_type_name (obj_type)));
X bytes_to_dump = sizeof (acpi_operand_object);
X }
X }
X
X else {
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(String or Buffer - not descriptor)\n", value));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(String or Buffer - not descriptor)\n"));
X bytes_to_dump = 16;
X }
X
- DUMP_BUFFER (value, bytes_to_dump);
+ DUMP_BUFFER (obj_desc, bytes_to_dump);
X
X /* If value is NOT an internal object, we are done */
X
- if ((acpi_tb_system_table_pointer (value)) ||
- (VALID_DESCRIPTOR_TYPE (value, ACPI_DESC_TYPE_NAMED))) {
+ if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) {


X goto cleanup;
X }
X

@@ -323,35 +459,35 @@
X */
X switch (obj_type) {
X case ACPI_TYPE_STRING:
- value = (u8 *) obj_desc->string.pointer;
+ obj_desc = (acpi_operand_object *) obj_desc->string.pointer;
X break;
X
X case ACPI_TYPE_BUFFER:
- value = (u8 *) obj_desc->buffer.pointer;
+ obj_desc = (acpi_operand_object *) obj_desc->buffer.pointer;
X break;
X
X case ACPI_TYPE_BUFFER_FIELD:
- value = (u8 *) obj_desc->buffer_field.buffer_obj;
+ obj_desc = (acpi_operand_object *) obj_desc->buffer_field.buffer_obj;
X break;
X
X case ACPI_TYPE_PACKAGE:
- value = (u8 *) obj_desc->package.elements;
+ obj_desc = (acpi_operand_object *) obj_desc->package.elements;
X break;
X
X case ACPI_TYPE_METHOD:
- value = (u8 *) obj_desc->method.pcode;
+ obj_desc = (acpi_operand_object *) obj_desc->method.aml_start;
X break;
X
X case INTERNAL_TYPE_REGION_FIELD:
- value = (u8 *) obj_desc->field.region_obj;
+ obj_desc = (acpi_operand_object *) obj_desc->field.region_obj;
X break;
X
X case INTERNAL_TYPE_BANK_FIELD:
- value = (u8 *) obj_desc->bank_field.region_obj;
+ obj_desc = (acpi_operand_object *) obj_desc->bank_field.region_obj;
X break;
X
X case INTERNAL_TYPE_INDEX_FIELD:
- value = (u8 *) obj_desc->index_field.index_obj;
+ obj_desc = (acpi_operand_object *) obj_desc->index_field.index_obj;


X break;
X
X default:

@@ -386,11 +522,12 @@


X void
X acpi_ns_dump_objects (
X acpi_object_type8 type,
+ u8 display_type,
X u32 max_depth,

X u32 owner_id,
X acpi_handle start_handle)
X {
- ACPI_WALK_INFO info;
+ acpi_walk_info info;


X
X
X FUNCTION_ENTRY ();

@@ -398,6 +535,8 @@
X
X info.debug_level = ACPI_LV_TABLES;
X info.owner_id = owner_id;
+ info.display_type = display_type;
+
X
X acpi_ns_walk_namespace (type, start_handle, max_depth, NS_WALK_NO_UNLOCK, acpi_ns_dump_one_object,
X (void *) &info, NULL);
@@ -441,8 +580,8 @@
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " "));
X }
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %.8X, ADR: %.8X, Status: %x\n",
- info.hardware_id, info.address, info.current_status));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %s, ADR: %8.8X%8.8X, Status: %x\n",
+ info.hardware_id, HIDWORD(info.address), LODWORD(info.address), info.current_status));
X }
X
X return (status);
@@ -524,7 +663,8 @@
X }
X
X
- acpi_ns_dump_objects (ACPI_TYPE_ANY, max_depth, ACPI_UINT32_MAX, search_handle);
+ acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth,
+ ACPI_UINT32_MAX, search_handle);
X return_VOID;
X }
X
@@ -545,7 +685,7 @@
X acpi_handle handle,
X u32 debug_level)
X {
- ACPI_WALK_INFO info;
+ acpi_walk_info info;


X
X
X FUNCTION_ENTRY ();

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nseval.c linux/drivers/acpi/namespace/nseval.c
--- v2.4.13/linux/drivers/acpi/namespace/nseval.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nseval.c Wed Oct 24 14:06:22 2001
@@ -2,7 +2,7 @@
X *
X * Module Name: nseval - Object evaluation interfaces -- includes control
X * method lookup and execution.
- * $Revision: 97 $
+ * $Revision: 102 $


X *
X ******************************************************************************/
X

@@ -93,7 +93,7 @@


X
X acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
X

- prefix_node = acpi_ns_convert_handle_to_entry (handle);
+ prefix_node = acpi_ns_map_handle_to_node (handle);


X if (!prefix_node) {
X acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);

X status = AE_BAD_PARAMETER;
@@ -271,7 +271,7 @@


X
X acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
X
- node = acpi_ns_convert_handle_to_entry (handle);
+ node = acpi_ns_map_handle_to_node (handle);
X if (!node) {
X acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);

X return_ACPI_STATUS (AE_BAD_PARAMETER);
@@ -378,17 +378,18 @@
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No attached method object\n"));
X
X acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
- return_ACPI_STATUS (AE_ERROR);
+ return_ACPI_STATUS (AE_NULL_OBJECT);
X }
X
X
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Control method at Offset %x Length %lx]\n",
- obj_desc->method.pcode + 1, obj_desc->method.pcode_length - 1));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Control method at Offset %p Length %x]\n",
+ obj_desc->method.aml_start + 1, obj_desc->method.aml_length - 1));
X
X DUMP_PATHNAME (method_node, "Ns_execute_control_method: Executing",
X ACPI_LV_NAMES, _COMPONENT);
X
- ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %8XH\n", obj_desc->method.pcode + 1));
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %p\n",
+ obj_desc->method.aml_start + 1));
X
X
X /*
@@ -437,7 +438,7 @@


X {
X acpi_status status = AE_OK;

X acpi_operand_object *obj_desc;


- acpi_operand_object *val_desc;
+ acpi_operand_object *source_desc;

X
X
X FUNCTION_TRACE ("Ns_get_object_value");
@@ -460,8 +461,8 @@
X /*
X * Get the attached object
X */


- val_desc = acpi_ns_get_attached_object (node);

- if (!val_desc) {


+ source_desc = acpi_ns_get_attached_object (node);

+ if (!source_desc) {
X status = AE_NULL_OBJECT;
X goto unlock_and_exit;
X }
@@ -472,7 +473,7 @@
X * TBD: [Future] - need a low-level object copy that handles
X * the reference count automatically. (Don't want to copy it)
X */
- MEMCPY (obj_desc, val_desc, sizeof (acpi_operand_object));
+ MEMCPY (obj_desc, source_desc, sizeof (acpi_operand_object));
X obj_desc->common.reference_count = 1;
X acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nsinit.c linux/drivers/acpi/namespace/nsinit.c
--- v2.4.13/linux/drivers/acpi/namespace/nsinit.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nsinit.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: nsinit - namespace initialization


- * $Revision: 31 $

+ * $Revision: 33 $


X *
X *****************************************************************************/
X

@@ -51,7 +51,7 @@
X void)
X {
X acpi_status status;
- ACPI_INIT_WALK_INFO info;
+ acpi_init_walk_info info;
X
X
X FUNCTION_TRACE ("Ns_initialize_objects");
@@ -112,7 +112,7 @@
X void)
X {
X acpi_status status;
- ACPI_DEVICE_WALK_INFO info;
+ acpi_device_walk_info info;
X
X
X FUNCTION_TRACE ("Ns_initialize_devices");
@@ -170,7 +170,7 @@


X {
X acpi_object_type8 type;
X acpi_status status;
- ACPI_INIT_WALK_INFO *info = (ACPI_INIT_WALK_INFO *) context;
+ acpi_init_walk_info *info = (acpi_init_walk_info *) context;

X acpi_namespace_node *node = (acpi_namespace_node *) obj_handle;
X acpi_operand_object *obj_desc;


X
@@ -218,7 +218,7 @@

X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n"));
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
X "%s while getting region arguments [%4.4s]\n",
- acpi_format_exception (status), &node->name));
+ acpi_format_exception (status), (char*)&node->name));
X }
X
X if (!(acpi_dbg_level & ACPI_LV_INIT)) {
@@ -241,7 +241,7 @@
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n"));
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
X "%s while getting buffer field arguments [%4.4s]\n",
- acpi_format_exception (status), &node->name));
+ acpi_format_exception (status), (char*)&node->name));
X }
X if (!(acpi_dbg_level & ACPI_LV_INIT)) {
X ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
@@ -268,7 +268,7 @@
X *
X * FUNCTION: Acpi_ns_init_one_device
X *
- * PARAMETERS: ACPI_WALK_CALLBACK
+ * PARAMETERS: acpi_walk_callback
X *
X * RETURN: acpi_status
X *
@@ -288,7 +288,7 @@


X acpi_status status;
X acpi_namespace_node *node;
X u32 flags;

- ACPI_DEVICE_WALK_INFO *info = (ACPI_DEVICE_WALK_INFO *) context;
+ acpi_device_walk_info *info = (acpi_device_walk_info *) context;
X
X
X FUNCTION_TRACE ("Ns_init_one_device");


@@ -302,7 +302,7 @@
X

X acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
X

- node = acpi_ns_convert_handle_to_entry (obj_handle);
+ node = acpi_ns_map_handle_to_node (obj_handle);

X if (!node) {
X acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
X return (AE_BAD_PARAMETER);

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nsload.c linux/drivers/acpi/namespace/nsload.c
--- v2.4.13/linux/drivers/acpi/namespace/nsload.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nsload.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: nsload - namespace loading/expanding/contracting procedures


- * $Revision: 43 $

+ * $Revision: 47 $


X *
X *****************************************************************************/
X

@@ -109,35 +109,14 @@
X u32 pass_number,
X acpi_table_desc *table_desc)
X {
- acpi_parse_downwards descending_callback;
- acpi_parse_upwards ascending_callback;
X acpi_parse_object *parse_root;
X acpi_status status;
+ acpi_walk_state *walk_state;
X
X
X FUNCTION_TRACE ("Ns_one_complete_parse");
X
X
- switch (pass_number) {
- case 1:
- descending_callback = acpi_ds_load1_begin_op;
- ascending_callback = acpi_ds_load1_end_op;
- break;
-
- case 2:
- descending_callback = acpi_ds_load2_begin_op;
- ascending_callback = acpi_ds_load2_end_op;
- break;
-
- case 3:
- descending_callback = acpi_ds_exec_begin_op;
- ascending_callback = acpi_ds_exec_end_op;


- break;
-
- default:

- return (AE_BAD_PARAMETER);
- }
-
X /* Create and init a Root Node */
X
X parse_root = acpi_ps_alloc_op (AML_SCOPE_OP);
@@ -148,15 +127,26 @@
X ((acpi_parse2_object *) parse_root)->name = ACPI_ROOT_NAME;
X
X
- /* Pass 1: Parse everything except control method bodies */
+ /* Create and initialize a new walk state */
X
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %d parse\n", pass_number));


+ walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
+ NULL, NULL, NULL);
+ if (!walk_state) {

+ acpi_ps_free_op (parse_root);
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
X
- status = acpi_ps_parse_aml (parse_root, table_desc->aml_pointer,
- table_desc->aml_length,
- ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE,
- NULL, NULL, NULL, descending_callback,
- ascending_callback);
+ status = acpi_ds_init_aml_walk (walk_state, parse_root, NULL, table_desc->aml_start,
+ table_desc->aml_length, NULL, NULL, pass_number);
+ if (ACPI_FAILURE (status)) {
+ acpi_ds_delete_walk_state (walk_state);


+ return_ACPI_STATUS (status);
+ }
+

+ /* Parse the AML */
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %d parse\n", pass_number));


+ status = acpi_ps_parse_aml (walk_state);
X

X acpi_ps_delete_parse_tree (parse_root);
X return_ACPI_STATUS (status);
@@ -225,8 +215,8 @@
X *
X * FUNCTION: Acpi_ns_load_table
X *
- * PARAMETERS: *Pcode_addr - Address of pcode block
- * Pcode_length - Length of pcode block
+ * PARAMETERS: Table_desc - Descriptor for table to be loaded
+ * Node - Owning NS node


X *
X * RETURN: Status

X *
@@ -245,12 +235,12 @@
X FUNCTION_TRACE ("Ns_load_table");
X
X
- if (!table_desc->aml_pointer) {
+ if (!table_desc->aml_start) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null AML pointer\n"));
X return_ACPI_STATUS (AE_BAD_PARAMETER);
X }
X
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AML block at %p\n", table_desc->aml_pointer));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AML block at %p\n", table_desc->aml_start));
X
X
X if (!table_desc->aml_length) {
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nsnames.c linux/drivers/acpi/namespace/nsnames.c
--- v2.4.13/linux/drivers/acpi/namespace/nsnames.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nsnames.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: nsnames - Name manipulation and search
- * $Revision: 63 $
+ * $Revision: 64 $


X *
X ******************************************************************************/
X

@@ -203,7 +203,7 @@
X return_ACPI_STATUS (AE_NO_NAMESPACE);
X }
X
- node = acpi_ns_convert_handle_to_entry (target_handle);
+ node = acpi_ns_map_handle_to_node (target_handle);
X if (!node) {
X return_ACPI_STATUS (AE_BAD_PARAMETER);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nsobject.c linux/drivers/acpi/namespace/nsobject.c
--- v2.4.13/linux/drivers/acpi/namespace/nsobject.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nsobject.c Wed Oct 24 14:06:22 2001
@@ -2,7 +2,7 @@
X *
X * Module Name: nsobject - Utilities for objects attached to namespace
X * table entries


- * $Revision: 65 $

+ * $Revision: 67 $


X *
X ******************************************************************************/
X

@@ -63,7 +63,6 @@
X acpi_operand_object *previous_obj_desc;
X acpi_object_type8 obj_type = ACPI_TYPE_ANY;
X u8 flags;
- u16 opcode;
X
X
X FUNCTION_TRACE ("Ns_attach_object");
@@ -158,87 +157,6 @@
X obj_type = type;
X }
X
- /*
- * Type is TYPE_Any, we must try to determinte the
- * actual type of the object.
- * Check if value points into the AML code
- */
- else if (acpi_tb_system_table_pointer (object)) {
- /*
- * Object points into the AML stream.
- * Set a flag bit in the Node to indicate this
- */
- flags |= ANOBJ_AML_ATTACHMENT;
-
- /*
- * The next byte (perhaps the next two bytes)
- * will be the AML opcode
- */
- MOVE_UNALIGNED16_TO_16 (&opcode, object);
-
- /* Check for a recognized Opcode */
-
- switch ((u8) opcode) {
-
- case AML_OP_PREFIX:
-
- if (opcode != AML_REVISION_OP) {
- /*
- * Op_prefix is unrecognized unless part
- * of Revision_op
- */
- break;
- }
-
- /* case AML_REVISION_OP: fall through and set the type to Integer */
-
- case AML_ZERO_OP:
- case AML_ONES_OP:
- case AML_ONE_OP:
- case AML_BYTE_OP:
- case AML_WORD_OP:
- case AML_DWORD_OP:
- case AML_QWORD_OP:
-
- obj_type = ACPI_TYPE_INTEGER;
- break;
-
-
- case AML_STRING_OP:
-
- obj_type = ACPI_TYPE_STRING;
- break;
-
-
- case AML_BUFFER_OP:
-
- obj_type = ACPI_TYPE_BUFFER;
- break;
-
-
- case AML_MUTEX_OP:
-
- obj_type = ACPI_TYPE_MUTEX;
- break;
-
-
- case AML_PACKAGE_OP:
-
- obj_type = ACPI_TYPE_PACKAGE;


- break;
-
-
- default:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,

- "AML Opcode/Type [%x] not supported in attach\n",
- (u8) opcode));
-
- return_ACPI_STATUS (AE_TYPE);


- break;
- }
- }
-

X else {
X /*
X * Cannot figure out the type -- set to Def_any which
@@ -249,12 +167,7 @@
X "Ns_attach_object confused: setting bogus type for ",
X ACPI_LV_INFO, _COMPONENT);
X

- if (acpi_tb_system_table_pointer (object)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO,

- "AML-stream code %02x\n", *(u8 *) object));
- }
-
- else if (VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_NAMED)) {
+ if (VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_NAMED)) {
X DUMP_PATHNAME (object, "name ", ACPI_LV_INFO, _COMPONENT);
X }
X
@@ -270,7 +183,7 @@
X
X
X ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Installing %p into Node %p [%4.4s]\n",
- obj_desc, node, &node->name));
+ obj_desc, node, (char*)&node->name));
X
X
X /*
@@ -340,21 +253,12 @@
X
X node->object = NULL;
X
- /* Found a valid value */
-
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object=%p Value=%p Name %4.4s\n",
- node, obj_desc, &node->name));
+ node, obj_desc, (char*)&node->name));
X
- /*
- * Not every value is an object allocated via ACPI_MEM_CALLOCATE,
- * - must check
- */
- if (!acpi_tb_system_table_pointer (obj_desc)) {
- /* Attempt to delete the object (and all subobjects) */


-
- acpi_ut_remove_reference (obj_desc);
- }

+ /* Remove one reference on the object (and all subobjects) */
X
+ acpi_ut_remove_reference (obj_desc);
X return_VOID;
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nssearch.c linux/drivers/acpi/namespace/nssearch.c
--- v2.4.13/linux/drivers/acpi/namespace/nssearch.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nssearch.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: nssearch - Namespace search
- * $Revision: 74 $
+ * $Revision: 75 $


X *
X ******************************************************************************/
X

@@ -80,7 +80,7 @@
X scope_name = acpi_ns_get_table_pathname (node);
X if (scope_name) {
X ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s [%p] For %4.4s (type %X)\n",
- scope_name, node, &target_name, type));
+ scope_name, node, (char*)&target_name, type));
X
X ACPI_MEM_FREE (scope_name);
X }
@@ -124,7 +124,7 @@
X
X ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
X "Name %4.4s (actual type %X) found at %p\n",
- &target_name, next_node->type, next_node));
+ (char*)&target_name, next_node->type, next_node));
X
X *return_node = next_node;
X return_ACPI_STATUS (AE_OK);
@@ -150,7 +150,7 @@
X /* Searched entire table, not found */
X
X ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name %4.4s (type %X) not found at %p\n",
- &target_name, type, next_node));
+ (char*)&target_name, type, next_node));
X
X return_ACPI_STATUS (AE_NOT_FOUND);
X }
@@ -205,12 +205,12 @@
X (!parent_node)) {
X if (!parent_node) {
X ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] has no parent\n",
- &target_name));
+ (char*)&target_name));
X }
X
X if (acpi_ns_local (type)) {
X ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] type %X is local(no search)\n",
- &target_name, type));
+ (char*)&target_name, type));
X }
X
X return_ACPI_STATUS (AE_NOT_FOUND);
@@ -219,7 +219,7 @@
X
X /* Search the parent tree */
X
- ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching parent for %4.4s\n", &target_name));
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching parent for %4.4s\n", (char*)&target_name));
X
X /*
X * Search parents until found the target or we have backed up to
@@ -295,7 +295,7 @@


X /* Parameter validation */
X

X if (!node || !target_name || !return_node) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param- Table %p Name %p Return %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param- Table %p Name %X Return %p\n",
X node, target_name, return_node));
X
X REPORT_ERROR (("Ns_search_and_enter: bad (null) parameter\n"));
@@ -306,7 +306,7 @@
X /* Name must consist of printable characters */
X
X if (!acpi_ut_valid_acpi_name (target_name)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "*** Bad character in name: %08lx *** \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "*** Bad character in name: %08x *** \n",
X target_name));
X
X REPORT_ERROR (("Ns_search_and_enter: Bad character in ACPI Name\n"));


@@ -364,7 +364,7 @@
X */

X if (interpreter_mode == IMODE_EXECUTE) {
X ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s Not found in %p [Not adding]\n",
- &target_name, node));
+ (char*)&target_name, node));
X
X return_ACPI_STATUS (AE_NOT_FOUND);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nsutils.c linux/drivers/acpi/namespace/nsutils.c
--- v2.4.13/linux/drivers/acpi/namespace/nsutils.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nsutils.c Wed Oct 24 14:06:22 2001
@@ -2,7 +2,7 @@
X *
X * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
X * parents and siblings and Scope manipulation
- * $Revision: 89 $
+ * $Revision: 92 $


X *
X *****************************************************************************/
X

@@ -148,7 +148,7 @@
X
X acpi_status


X acpi_ns_get_internal_name_length (
- ACPI_NAMESTRING_INFO *info)
+ acpi_namestring_info *info)
X {

X NATIVE_CHAR *next_external_char;
X u32 i;
@@ -225,7 +225,7 @@


X
X acpi_status
X acpi_ns_build_internal_name (
- ACPI_NAMESTRING_INFO *info)
+ acpi_namestring_info *info)
X {

X u32 num_segments = info->num_segments;
X NATIVE_CHAR *internal_name = info->internal_name;
@@ -356,7 +356,7 @@
X NATIVE_CHAR **converted_name)
X {
X NATIVE_CHAR *internal_name;
- ACPI_NAMESTRING_INFO info;
+ acpi_namestring_info info;


X acpi_status status;
X
X

@@ -549,7 +549,7 @@
X
X /*******************************************************************************
X *
- * FUNCTION: Acpi_ns_convert_handle_to_entry
+ * FUNCTION: Acpi_ns_map_handle_to_node
X *
X * PARAMETERS: Handle - Handle to be converted to an Node
X *
@@ -560,7 +560,7 @@
X ******************************************************************************/


X
X acpi_namespace_node *
-acpi_ns_convert_handle_to_entry (
+acpi_ns_map_handle_to_node (
X acpi_handle handle)
X {
X

@@ -829,7 +829,7 @@
X parent_node = acpi_ns_get_parent_object (child_node);
X if (parent_node) {
X ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n",
- child_node, &child_node->name, parent_node, &parent_node->name));
+ child_node, (char*)&child_node->name, parent_node, (char*)&parent_node->name));
X
X if (parent_node->name) {
X return_VALUE (parent_node->name);
@@ -837,7 +837,7 @@
X }
X
X ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n",
- child_node, &child_node->name));
+ child_node, (char*)&child_node->name));
X }
X
X return_VALUE (ACPI_UNKNOWN_NAME);
@@ -925,21 +925,21 @@
X
X /*******************************************************************************
X *
- * FUNCTION: Acpi_ns_get_next_valid_object
+ * FUNCTION: Acpi_ns_get_next_valid_node
X *
X * PARAMETERS: Node - Current table entry
X *
- * RETURN: Next valid object in the table. NULL if no more valid
- * objects
+ * RETURN: Next valid Node in the linked node list. NULL if no more valid
+ * nodess
X *
- * DESCRIPTION: Find the next valid object within a name table.
+ * DESCRIPTION: Find the next valid node within a name table.
X * Useful for implementing NULL-end-of-list loops.
X *
X ******************************************************************************/


X
X
X acpi_namespace_node *
-acpi_ns_get_next_valid_object (
+acpi_ns_get_next_valid_node (
X acpi_namespace_node *node)
X {
X

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/namespace/nswalk.c linux/drivers/acpi/namespace/nswalk.c
--- v2.4.13/linux/drivers/acpi/namespace/nswalk.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/namespace/nswalk.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: nswalk - Functions for walking the ACPI namespace
- * $Revision: 24 $
+ * $Revision: 26 $


X *
X *****************************************************************************/
X

@@ -33,27 +33,27 @@
X MODULE_NAME ("nswalk")
X
X
-/****************************************************************************
+/*******************************************************************************


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 19'
echo 'File patch-2.4.14 is continued in part 20'
echo "20" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:55 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part32

#!/bin/sh -x
# this is part 32 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 32; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ (parport_pc_probe_port): Display the ECR address if we have an
+ ECR, not just if we will use the FIFO.
+
+2001-10-24 Dave Strauss <D.St...@motorola.com>
+
+ * parport_pc.c (parport_pc_compat_write_block_pio,
+ parport_pc_ecp_write_block_pio): Allow a few seconds for an ECP
+ transfer to finish up.
+
+2001-10-11 Tim Waugh <twa...@redhat.com>
+
+ * parport_pc (sio_ite_8872_probe): New function, submitted by Rich
+ Liu from ITE. Cleaned up, removed bogus phys_to_virt calls.
+
+2001-10-24 Tim Waugh <twa...@redhat.com>
+
+ * parport_pc.c: Support for AKS AladdinCARD. Patch from
+ Aladdin Knowledge Systems (Christian Groessler).
+
+2001-10-24 Tim Waugh <twa...@redhat.com>
+
+ * ieee1284_ops.c (parport_ieee1284_ecp_read_data): Try to minimise
+ turnaround time.
+
+ * ieee1284.c (parport_poll_peripheral): Try a couple of times
+ first without delaying.
+
X 2001-10-10 Tim Waugh <twa...@redhat.com>
X
X * parport_pc.c: Support for OX16PCI954 PCI card.
diff -u --recursive --new-file v2.4.13/linux/drivers/parport/ieee1284.c linux/drivers/parport/ieee1284.c
--- v2.4.13/linux/drivers/parport/ieee1284.c Sat May 19 18:07:04 2001
+++ linux/drivers/parport/ieee1284.c Thu Oct 25 00:07:39 2001
@@ -119,9 +119,10 @@
X int usec)
X {
X /* Zero return code is success, >0 is timeout. */
- int counter = usec / 5;
+ int count = usec / 5 + 2;
+ int i;
X unsigned char status;
- for (; counter > 0; counter--) {
+ for (i = 0; i < count; i++) {
X status = parport_read_status (port);
X if ((status & mask) == result)
X return 0;
@@ -129,7 +130,8 @@
X return -EINTR;
X if (current->need_resched)
X break;
- udelay (5);
+ if (i >= 2)
+ udelay (5);
X }
X
X return 1;
diff -u --recursive --new-file v2.4.13/linux/drivers/parport/ieee1284_ops.c linux/drivers/parport/ieee1284_ops.c
--- v2.4.13/linux/drivers/parport/ieee1284_ops.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/parport/ieee1284_ops.c Thu Oct 25 00:07:39 2001
@@ -500,6 +500,7 @@
X struct pardevice *dev = port->cad;
X unsigned char *buf = buffer;
X int rle_count = 0; /* shut gcc up */
+ unsigned char ctl;
X int rle = 0;
X ssize_t count = 0;
X
@@ -512,11 +513,10 @@
X port->ieee1284.phase = IEEE1284_PH_REV_DATA;
X
X /* Set HostAck low to start accepting data. */
- parport_frob_control (port,
- PARPORT_CONTROL_AUTOFD
- | PARPORT_CONTROL_STROBE
- | PARPORT_CONTROL_INIT,
- PARPORT_CONTROL_AUTOFD);
+ ctl = parport_read_control (port);
+ ctl &= ~(PARPORT_CONTROL_STROBE | PARPORT_CONTROL_INIT);
+ parport_write_control (port,
+ ctl | PARPORT_CONTROL_AUTOFD);
X while (count < len) {
X long expire = jiffies + dev->timeout;
X unsigned char byte;
@@ -592,7 +592,7 @@
X }
X
X /* Event 44: Set HostAck high, acknowledging handshake. */
- parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
+ parport_write_control (port, ctl);
X
X /* Event 45: The peripheral has 35ms to set nAck high. */
X if (parport_wait_peripheral (port, PARPORT_STATUS_ACK,
@@ -610,9 +610,8 @@
X }
X
X /* Event 46: Set HostAck low and accept the data. */
- parport_frob_control (port,
- PARPORT_CONTROL_AUTOFD,
- PARPORT_CONTROL_AUTOFD);
+ parport_write_control (port,
+ ctl | PARPORT_CONTROL_AUTOFD);
X
X /* If we just read a run-length count, fetch the data. */
X if (command)
diff -u --recursive --new-file v2.4.13/linux/drivers/parport/parport_pc.c linux/drivers/parport/parport_pc.c
--- v2.4.13/linux/drivers/parport/parport_pc.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/parport/parport_pc.c Fri Nov 2 17:13:53 2001
@@ -798,6 +798,8 @@
X {
X size_t written;
X int r;
+ long int expire;
+ const struct parport_pc_private *priv = port->physport->private_data;
X
X /* Special case: a timeout of zero means we cannot call schedule(). */
X if (!port->physport->cad->timeout)
@@ -819,9 +821,19 @@
X written = parport_pc_fifo_write_block_pio (port, buf, length);
X
X /* Finish up. */
- if (change_mode (port, ECR_PS2) == -EBUSY) {
- const struct parport_pc_private *priv =
- port->physport->private_data;
+ /* For some hardware we don't want to touch the mode until
+ * the FIFO is empty, so allow 4 seconds for each position
+ * in the fifo.
+ */
+ expire = jiffies + (priv->fifo_depth * HZ * 4);
+ do {
+ /* Wait for the FIFO to empty */
+ r = change_mode (port, ECR_PS2);
+ if (r != -EBUSY) {
+ break;
+ }
+ } while (time_before (jiffies, expire));
+ if (r == -EBUSY) {
X
X printk (KERN_DEBUG "%s: FIFO is stuck\n", port->name);
X
@@ -862,6 +874,8 @@
X {
X size_t written;
X int r;
+ long int expire;
+ const struct parport_pc_private *priv = port->physport->private_data;
X
X /* Special case: a timeout of zero means we cannot call schedule(). */
X if (!port->physport->cad->timeout)
@@ -904,9 +918,19 @@
X written = parport_pc_fifo_write_block_pio (port, buf, length);
X
X /* Finish up. */
- if (change_mode (port, ECR_PS2) == -EBUSY) {
- const struct parport_pc_private *priv =
- port->physport->private_data;
+ /* For some hardware we don't want to touch the mode until
+ * the FIFO is empty, so allow 4 seconds for each position
+ * in the fifo.
+ */
+ expire = jiffies + (priv->fifo_depth * (HZ * 4));
+ do {
+ /* Wait for the FIFO to empty */
+ r = change_mode (port, ECR_PS2);
+ if (r != -EBUSY) {
+ break;
+ }
+ } while (time_before (jiffies, expire));
+ if (r == -EBUSY) {
X
X printk (KERN_DEBUG "%s: FIFO is stuck\n", port->name);
X
@@ -2095,10 +2119,9 @@
X
X if (priv->ecr) {
X pb->irq = programmable_irq_support(pb);
- }
X
- if (pb->modes & PARPORT_MODE_ECP) {
- pb->irq = irq_probe_ECP(pb);
+ if (pb->irq == PARPORT_IRQ_NONE)
+ pb->irq = irq_probe_ECP(pb);
X }
X
X if ((pb->irq == PARPORT_IRQ_NONE) && priv->ecr &&
@@ -2231,7 +2254,7 @@
X p->private_data = priv;
X
X printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base);
- if (p->base_hi && (p->modes & PARPORT_MODE_ECP))
+ if (p->base_hi && priv->ecr)
X printk(" (0x%lx)", p->base_hi);
X p->irq = irq;
X p->dma = dma;
@@ -2382,6 +2405,105 @@
X }
X
X #ifdef CONFIG_PCI
+
+/* ITE support maintained by Rich Liu <ric...@poorman.org> */
+static int __devinit sio_ite_8872_probe (struct pci_dev *pdev, int autoirq,
+ int autodma)
+{
+ short inta_addr[6] = { 0x2A0, 0x2C0, 0x220, 0x240, 0x1E0 };
+ u32 ite8872set;
+ u32 ite8872_lpt, ite8872_lpthi;
+ u8 ite8872_irq, type;
+ int irq;
+ int i;
+
+ DPRINTK (KERN_DEBUG "sio_ite_8872_probe()\n");
+
+ // make sure which one chip
+ for(i = 0; i < 5; i++) {
+ if (check_region (inta_addr[i], 0x8) >= 0) {
+ int test;
+ pci_write_config_dword (pdev, 0x60,
+ 0xe7000000 | inta_addr[i]);
+ pci_write_config_dword (pdev, 0x78,
+ 0x00000000 | inta_addr[i]);
+ test = inb (inta_addr[i]);
+ if (test != 0xff) break;
+ }
+ }
+ if(i >= 5) {
+ printk (KERN_INFO "parport_pc: cannot find ITE8872 INTA\n");


+ return 0;
+ }
+

+ type = inb (inta_addr[i] + 0x18);
+ type &= 0x0f;
+
+ switch (type) {
+ case 0x2:
+ printk (KERN_INFO "parport_pc: ITE8871 found (1P)\n");
+ ite8872set = 0x64200000;
+ break;
+ case 0xa:
+ printk (KERN_INFO "parport_pc: ITE8875 found (1P)\n");
+ ite8872set = 0x64200000;
+ break;
+ case 0xe:
+ printk (KERN_INFO "parport_pc: ITE8872 found (2S1P)\n");
+ ite8872set = 0x64e00000;
+ break;
+ case 0x6:
+ printk (KERN_INFO "parport_pc: ITE8873 found (1S1P)\n");
+ ite8872set = 0x64a00000;
+ break;
+ case 0x8:
+ DPRINTK (KERN_DEBUG "parport_pc: ITE8874 found (2S)\n");
+ return 0;
+ default:
+ printk (KERN_INFO "parport_pc: unknown ITE887x\n");
+ printk (KERN_INFO "parport_pc: please mail 'lspci -nvv' "
+ "output to Rich...@ite.com.tw\n");


+ return 0;
+ }
+

+ pci_read_config_byte (pdev, 0x3c, &ite8872_irq);
+ pci_read_config_dword (pdev, 0x1c, &ite8872_lpt);
+ ite8872_lpt &= 0x0000ff00;
+ pci_read_config_dword (pdev, 0x20, &ite8872_lpthi);
+ ite8872_lpthi &= 0x0000ff00;
+ pci_write_config_dword (pdev, 0x6c, 0xe3000000 | ite8872_lpt);
+ pci_write_config_dword (pdev, 0x70, 0xe3000000 | ite8872_lpthi);
+ pci_write_config_dword (pdev, 0x80, (ite8872_lpthi<<16) | ite8872_lpt);
+ // SET SPP&EPP , Parallel Port NO DMA , Enable All Function
+ // SET Parallel IRQ
+ pci_write_config_dword (pdev, 0x9c,
+ ite8872set | (ite8872_irq * 0x11111));
+
+ DPRINTK (KERN_DEBUG "ITE887x: The IRQ is %d.\n", ite8872_irq);
+ DPRINTK (KERN_DEBUG "ITE887x: The PARALLEL I/O port is 0x%x.\n",
+ ite8872_lpt);
+ DPRINTK (KERN_DEBUG "ITE887x: The PARALLEL I/O porthi is 0x%x.\n",
+ ite8872_lpthi);
+
+ /* Let the user (or defaults) steer us away from interrupts */
+ irq = ite8872_irq;
+ if (autoirq != PARPORT_IRQ_AUTO)
+ irq = PARPORT_IRQ_NONE;
+
+ if (parport_pc_probe_port (ite8872_lpt, ite8872_lpthi,
+ irq, PARPORT_DMA_NONE, NULL)) {
+ printk (KERN_INFO
+ "parport_pc: ITE 8872 parallel port: io=0x%X",
+ ite8872_lpt);
+ if (irq != PARPORT_IRQ_NONE)
+ printk (", irq=%d", irq);
+ printk ("\n");
+ return 1;
+ }


+
+ return 0;
+}
+

X /* Via support maintained by Jeff Garzik <jga...@mandrakesoft.com> */
X static int __devinit sio_via_686a_probe (struct pci_dev *pdev, int autoirq,
X int autodma)
@@ -2492,6 +2614,7 @@
X
X enum parport_pc_sio_types {
X sio_via_686a = 0, /* Via VT82C686A motherboard Super I/O */
+ sio_ite_8872,
X last_sio
X };
X
@@ -2500,6 +2623,7 @@
X int (*probe) (struct pci_dev *pdev, int autoirq, int autodma);
X } parport_pc_superio_info[] __devinitdata = {
X { sio_via_686a_probe, },
+ { sio_ite_8872_probe, },
X };
X
X
@@ -2559,6 +2683,7 @@
X avlab_2p,
X oxsemi_954,
X oxsemi_840,
+ aks_0100,
X };
X
X
@@ -2632,11 +2757,14 @@
X * and 840 locks up if you write 1 to bit 2! */
X /* oxsemi_954 */ { 1, { { 0, -1 }, } },
X /* oxsemi_840 */ { 1, { { 0, -1 }, } },
+ /* aks_0100 */ { 1, { { 0, 1 }, } },
X };
X
X static struct pci_device_id parport_pc_pci_tbl[] __devinitdata = {
X /* Super-IO onboard chips */
X { 0x1106, 0x0686, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sio_via_686a },
+ { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, sio_ite_8872 },
X
X /* PCI cards */
X { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_550,
@@ -2725,6 +2853,8 @@
X PCI_ANY_ID, PCI_ANY_ID, 0, 0, oxsemi_954 },
X { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_12PCI840,
X 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 },
X { 0, } /* terminate list */
X };
X MODULE_DEVICE_TABLE(pci,parport_pc_pci_tbl);
diff -u --recursive --new-file v2.4.13/linux/drivers/pci/compat.c linux/drivers/pci/compat.c
--- v2.4.13/linux/drivers/pci/compat.c Mon Jan 24 11:04:36 2000
+++ linux/drivers/pci/compat.c Sun Nov 4 09:31:58 2001


@@ -3,7 +3,7 @@
X *

X * PCI Bus Services -- Function For Backward Compatibility
X *
- * Copyright 1998--2000 Martin Mares <m...@suse.cz>
+ * Copyright 1998--2000 Martin Mares <m...@ucw.cz>
X */
X
X #include <linux/types.h>
diff -u --recursive --new-file v2.4.13/linux/drivers/pci/gen-devlist.c linux/drivers/pci/gen-devlist.c
--- v2.4.13/linux/drivers/pci/gen-devlist.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/pci/gen-devlist.c Sun Nov 4 09:31:58 2001


@@ -1,7 +1,7 @@
X /*

X * Generate devlist.h and classlist.h from the PCI ID file.


X *
- * (c) 1999--2000 Martin Mares <m...@suse.cz>
+ * (c) 1999--2000 Martin Mares <m...@ucw.cz>
X */
X

X #include <stdio.h>
diff -u --recursive --new-file v2.4.13/linux/drivers/pci/pci.c linux/drivers/pci/pci.c
--- v2.4.13/linux/drivers/pci/pci.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/pci/pci.c Sun Nov 4 09:31:58 2001
@@ -6,7 +6,7 @@
X * Copyright 1993 -- 1997 Drew Eckhardt, Frederic Potter,
X * David Mosberger-Tang
X *
- * Copyright 1997 -- 2000 Martin Mares <m...@suse.cz>
+ * Copyright 1997 -- 2000 Martin Mares <m...@ucw.cz>


X */
X
X #include <linux/config.h>

diff -u --recursive --new-file v2.4.13/linux/drivers/pci/pci.ids linux/drivers/pci/pci.ids
--- v2.4.13/linux/drivers/pci/pci.ids Tue Oct 23 22:48:51 2001
+++ linux/drivers/pci/pci.ids Sun Nov 4 09:33:58 2001
@@ -1,10 +1,13 @@
X #
X # List of PCI ID's
X #
-# Maintained by Martin Mares <pci...@ucw.cz>
-# If you have any new entries, send them to the maintainer.
+# Maintained by Martin Mares <m...@ucw.cz> and other volunteers from the
+# Linux PCI ID's Project at http://pciids.sf.net/. New data are always
+# welcome (if they are accurate), we're eagerly expecting new entries,
+# so if you have anything to contribute, please visit the home page or
+# send a diff -u against the most recent pci.ids to pci...@ucw.cz.
X #
-# $Id: pci.ids,v 1.62 2000/06/28 10:56:36 mj Exp $
+# $Id: pci.ids,v 1.24 2001/10/28 21:55:26 mares Exp $
X #
X
X # Vendors, devices and subsystems. Please keep sorted.
@@ -45,6 +48,7 @@
X 8086 002a PCI Hotplug Controller A
X 8086 002b PCI Hotplug Controller B
X a0f8 USB Open Host Controller
+ a0fc Fibre Channel Host Controller
X ae10 Smart-2/P RAID Controller
X 0e11 4030 Smart-2/P Array Controller
X 0e11 4031 Smart-2SL Array Controller
@@ -70,6 +74,7 @@
X b02f NC1120 Ethernet NIC
X b030 Netelligent WS 5100
X b04a 10/100 TX PCI Intel WOL UTP Controller
+ b060 Smart Array 5300 Controller
X b0c6 NC3161 Fast Ethernet NIC
X b0c7 NC3160 Fast Ethernet NIC
X b0d7 NC3121 Fast Ethernet NIC
@@ -84,6 +89,7 @@
X b144 NC3123 Fast Ethernet NIC
X b163 NC3134 Fast Ethernet NIC
X b164 NC3135 Fast Ethernet Upgrade Module
+ b178 Smart Array 5i/532
X b1a4 NC7131 Gigabit Server Adapter
X f130 NetFlex-3/P ThunderLAN 1.0
X f150 NetFlex-3/P ThunderLAN 2.3
@@ -138,7 +144,7 @@
X 4554 210888ET [Mach64 ET]
X 4654 Mach64 VT
X 4742 3D Rage Pro AGP 1X/2X
- 1028 4082 Optiplex GX1 Onboard Display Adapter
+ 1028 4082 Optiplex GX1 Onboard Display Adapter
X 8086 4152 Rage 3D Pro AGP
X 4744 3D Rage Pro AGP 1X
X 4747 3D Rage Pro
@@ -179,6 +185,9 @@
X 4c52 Rage Mobility P/M
X 4c53 Rage Mobility L
X 4c54 264LT [Mach64 LT]
+ 4c57 Radeon Mobility M6 LW
+ 4c59 Radeon Mobility M6 LY
+ 4c5a Radeon Mobility M6 LZ
X 4d46 Rage Mobility M4 AGP
X 4d4c Rage Mobility M4 AGP
X 5041 Rage 128 PA
@@ -207,8 +216,15 @@
X 5056 Rage 128 PV
X 5057 Rage 128 PW
X 5058 Rage 128 PX
+ 5144 Radeon QD
+ 5145 Radeon QE
+ 5146 Radeon QF
+ 5147 Radeon QG
+ 5159 Radeon VE QY
+ 515a Radeon VE QZ
X 5245 Rage 128 RE
X 5246 Rage 128 RF
+ 5247 Rage 128 RG
X 524b Rage 128 RK
X 524c Rage 128 RL
X 5345 Rage 128 SE
@@ -218,9 +234,12 @@
X 534b Rage 128 SK
X 534c Rage 128 SL
X 534d Rage 128 SM
- 534e Rage 128 4x
+ 534e Rage 128 SN
X 5354 Mach 64 VT
X 1002 5654 Mach 64 reference
+ 5446 Rage 128 Pro TF
+ 544c Rage 128 Pro TL
+ 5452 Rage 128 Pro TR
X 5654 264VT [Mach64 VT]
X 1002 5654 Mach64VT Reference
X 5655 264VT3 [Mach64 VT3]
@@ -274,7 +293,8 @@
X 000f OHCI Compliant FireWire Controller
X 0011 National PCI System I/O
X 0012 USB Controller
- 0020 DP83815
+ 0020 DP83815 (MacPhyter) Ethernet Controller
+ 0022 DP83820 10/100/1000 Ethernet Controller
X d001 87410 IDE
X 100c Tseng Labs Inc
X 3202 ET4000/W32p rev A
@@ -348,6 +368,8 @@
X 0026 DECchip 21154
X 0045 DECchip 21553
X 0046 DECchip 21554
+ 103c 10c2 Hewlett-Packard NetRAID-4M
+ 9005 0365 Adaptec 5400S
X 9005 1364 Dell PowerEdge RAID Controller 2
X 9005 1365 Dell PowerEdge RAID Controller 2
X 1065 StrongARM DC21285
@@ -431,21 +453,21 @@
X 007c ATM Controller (14107c00)
X 007d 3780IDSP [MWave]
X 0090 GXT 3000P
- 1014 008E GXT-3000P
+ 1014 008e GXT-3000P
X 0095 20H2999 PCI Docking Bridge
X 0096 Chukar chipset SCSI controller
- 1014 0099 iSeries 2748 DASD IOA
- 1014 0098 iSeries 2763 DASD IOA
X 1014 0097 iSeries 2778 DASD IOA
+ 1014 0098 iSeries 2763 DASD IOA
+ 1014 0099 iSeries 2748 DASD IOA
X 00a5 ATM Controller (1410a500)
X 00a6 ATM 155MBPS MM Controller (1410a600)
X 00b7 256-bit Graphics Rasterizer [Fire GL1]
X 1902 00b8 Fire GL1
X 00be ATM 622MBPS Controller (1410be00)
X 0142 Yotta Video Compositor Input
- 1014 0143 Yotta Input Controller (ytin)
+ 1014 0143 Yotta Input Controller (ytin)
X 0144 Yotta Video Compositor Output
- 1014 0145 Yotta Output Controller (ytout)
+ 1014 0145 Yotta Output Controller (ytout)
X 0156 405GP PLB to PCI Bridge
X 01bd Netfinity ServeRAID controller
X 01be ServeRAID-4M
@@ -475,8 +497,8 @@
X c24a 90C
X 101e American Megatrends Inc.
X 1960 MegaRAID
- 1028 0471 PowerEdge RAID Controller 3/QC
- 1028 0493 PowerEdge RAID Controller 3/DC
+ 1028 0471 PowerEdge RAID Controller 3/QC
+ 1028 0493 PowerEdge RAID Controller 3/DC
X 9010 MegaRAID
X 9030 EIDE Controller
X 9031 EIDE Controller
@@ -504,8 +526,8 @@
X 2040 79c974
X 7006 AMD-751 [Irongate] System Controller
X 7007 AMD-751 [Irongate] AGP Bridge
- 700E AMD-760 [Irongate] System Controller
- 700F AMD-760 [Irongate] AGP Bridge
+ 700e AMD-760 [Irongate] System Controller
+ 700f AMD-760 [Irongate] AGP Bridge
X 7400 AMD-755 [Cobra] ISA
X 7401 AMD-755 [Cobra] IDE
X 7403 AMD-755 [Cobra] ACPI
@@ -564,6 +586,8 @@
X 9850 3DImage 9850
X 9880 Blade 3D PCI/AGP
X 1023 9880 Blade 3D
+ 9910 CyberBlade/XP
+ 9930 CyberBlade/XPm
X 1024 Zenith Data Systems
X 1025 Acer Incorporated [ALI]
X 1435 M1435
@@ -634,7 +658,7 @@
X 0000 HYDRA
X 0010 ASPEN
X 102b Matrox Graphics, Inc.
-#DJ: I've a suspicion that 0010 is a duplicate of 0d10.
+# DJ: I've a suspicion that 0010 is a duplicate of 0d10.
X 0010 MGA-I [Impression?]
X 0518 MGA-II [Athena]
X 0519 MGA 2064W [Millennium]
@@ -683,7 +707,22 @@
X 102b 0328 Millennium G400 16Mb SDRAM
X 102b 0338 Millennium G400 16Mb SDRAM
X 102b 0378 Millennium G400 32Mb SDRAM
+ 102b 0541 Millennium G450 Dual Head
+ 102b 0542 Millennium G450 Dual Head LX
X 102b 0641 Millennium G450 32Mb SDRAM
+ 102b 0642 Millennium G450 32Mb SDRAM Dual Head LX
+ 102b 07c0 Millennium G450 Dual Head LE
+ 102b 07c1 Millennium G450 SDR Dual Head
+ 102b 0d41 Millennium G450 Dual Head PCI
+ 102b 0d42 Millennium G450 Dual Head LX PCI
+ 102b 0e00 Marvel G450 eTV
+ 102b 0e01 Marvel G450 eTV
+ 102b 0e02 Marvel G450 eTV
+ 102b 0e03 Marvel G450 eTV
+ 102b 0f80 Millennium G450 Low Profile
+ 102b 0f81 Millennium G450 Low Profile
+ 102b 0f82 Millennium G450 Low Profile DVI
+ 102b 0f83 Millennium G450 Low Profile DVI
X 102b 19d8 Millennium G400 16Mb SGRAM
X 102b 19f8 Millennium G400 32Mb SGRAM
X 102b 2159 Millennium G400 Dual Head 16Mb
@@ -692,6 +731,7 @@
X 102b 2f58 Millennium G400
X 102b 2f78 Millennium G400
X 102b 3693 Marvel G400 AGP
+ 1705 0001 Millennium G450 32MB SGRAM
X b16f 0e11 Matrox MGA-G400 AGP
X 0d10 MGA Ultima/Impression
X 1000 MGA G100 [Productiva]
@@ -821,8 +861,8 @@
X 1039 6326 SiS6326 GUI Accelerator
X 1092 0a50 SpeedStar A50
X 1092 0a70 SpeedStar A70
- 1092 4910 SpeedStar A70
- 1092 4920 SpeedStar A70
+ 1092 4910 SpeedStar A70
+ 1092 4920 SpeedStar A70
X 1569 6326 SiS6326 GUI Accelerator
X 7001 7001
X 7007 OHCI Compliant FireWire Controller
@@ -948,7 +988,7 @@
X 3d3d 0100 Reference Permedia 2 3D
X 8000 PCILynx/PCILynx2 IEEE 1394 Link Layer Controller
X e4bf 1010 CF1-1-SNARE
- e4bf 1020 CF1-2-SNARE
+ e4bf 1020 CF1-2-SNARE
X 8009 OHCI Compliant FireWire Controller
X 8019 TSB12LV23 OHCI Compliant IEEE-1394 Controller
X 11bd 000a Studio DV500-1394
@@ -1015,8 +1055,7 @@
X 9462 USB Universal Host Controller [OHCI]
X 9463 Power Management Controller [Bridge]
X 1056 ICL
-# Motorola made a mistake and used 1507 instead of 1057 in some chips.
-# Please look at the 1507 entry as well when updating this.
+# Motorola made a mistake and used 1507 instead of 1057 in some chips. Please look at the 1507 entry as well when updating this.
X 1057 Motorola
X 0001 MPC105 [Eagle]
X 0002 MPC106 [Grackle]
@@ -1186,8 +1225,8 @@
X 1022 ISP1022
X 1080 QLA1080
X 1216 QLA12160
- 101e 8471 QLA12160 on AMI MegaRAID
- 101e 8493 QLA12160 on AMI MegaRAID
+ 101e 8471 QLA12160 on AMI MegaRAID
+ 101e 8493 QLA12160 on AMI MegaRAID
X 1240 QLA1240
X 1280 QLA1280
X 2020 ISP2020A
@@ -1283,6 +1322,7 @@
X 1092 Diamond Multimedia Systems
X 00a0 Speedstar Pro SE
X 00a8 Speedstar 64
+ 0550 Viper V550
X 08d4 Supra 2260 Modem
X 1092 Viper V330
X 6120 Maximum DVD
@@ -1386,7 +1426,7 @@
X 14f1 1522 Bt879a Video Capture PAL I
X 14f1 1622 Bt879a Video Capture PAL BG
X 14f1 1722 Bt879a Video Capture NTSC
- 1851 1850 FlyVideo'98 - Video
+ 1851 1850 FlyVideo'98 - Video
X 1851 1851 FlyVideo II
X 1852 1852 FlyVideo'98 - Video (with FM Tuner)
X 0370 Bt880 Video Capture
@@ -1559,8 +1599,6 @@
X 10b7 3590 TokenLink Velocity XL Adapter
X 4500 3c450 Cyclone/unknown
X 5055 3c555 Laptop Hurricane
- 6055 3c556 Laptop Hurricane
- 6056 3c556B Laptop Hurricane
X 5057 3c575 [Megahertz] 10/100 LAN CardBus
X 10b7 5a57 3C575 Megahertz 10/100 LAN Cardbus PC Card
X 5157 3c575 [Megahertz] 10/100 LAN CardBus
@@ -1574,6 +1612,8 @@
X 5970 3c597 EISA Fast Demon/Vortex
X 5b57 3c595 [Megahertz] 10/100 LAN CardBus
X 10b7 5b57 3C575 Megahertz 10/100 LAN Cardbus PC Card
+ 6055 3c556 Hurricane CardBus
+ 6056 3c556B Hurricane CardBus
X 6560 3CCFE656 Cyclone CardBus
X 6562 3CCFEM656 [id 6562] Cyclone CardBus
X 6564 3CCFEM656 [id 6564] Cyclone CardBus
@@ -1684,6 +1724,7 @@
X 5237 M5237 USB
X 5243 M5243
X 5247 M5247
+ 5451 M5451 PCI South Bridge Audio
X 7101 M7101 PMU
X 10b9 7101 ALI M7101 Power Management Controller
X 10ba Mitsubishi Electric Corp.
@@ -1730,6 +1771,7 @@
X 0006 NM2360 [MagicMedia 256ZX]
X 0016 NM2380 [MagicMedia 256XL+]
X 10c8 0016 MagicMedia 256XL+
+ 0025 [MagicMedia 256AV+]
X 0083 [MagicGraph 128ZV Plus]
X 8005 [MagicMedia 256AV Audio]
X 0e11 b0d1 MagicMedia 256AV Audio Device on Discovery
@@ -1754,6 +1796,7 @@
X 1300 ABP940-U / ABP960-U
X 10cd 1310 ASC1300 SCSI Adapter
X 2300 ABP940-UW
+ 2500 ABP940-U2W
X 10ce Radius
X 10cf Citicorp TTI
X 2001 mb86605
@@ -1791,15 +1834,15 @@
X 1048 0c18 Erazor II SGRAM
X 1092 0550 Viper V550
X 1092 0552 Viper V550
- 1092 4804 Viper V550
- 1092 4808 Viper V550
+ 1092 4804 Viper V550
+ 1092 4808 Viper V550
X 1092 4810 Viper V550
X 1092 4812 Viper V550
X 1092 4815 Viper V550
X 1092 4820 Viper V550 with TV out
X 1092 4822 Viper V550
- 1092 4904 Viper V550
- 1092 4914 Viper V550
+ 1092 4904 Viper V550
+ 1092 4914 Viper V550
X 1092 8225 Viper V550
X 10de 0020 Riva TNT
X 1102 1015 Graphics Blaster CT6710
@@ -1863,11 +1906,12 @@
X 0111 NV11 (GeForce2 MX DDR)
X 0112 GeForce2 Go
X 0113 NV11 (GeForce2 MXR)
- 0150 NV15 (Geforce2 Pro)
+ 0150 NV15 (GeForce2 Pro)
X 107d 2840 WinFast GeForce2 GTS with TV output
- 0151 NV15 DDR (Geforce2 GTS)
- 0152 NV15 Bladerunner (Geforce2 Ultra)
+ 0151 NV15 DDR (GeForce2 GTS)
+ 0152 NV15 Bladerunner (GeForce2 Ultra)
X 0153 NV15 GL (Quadro2 Pro)
+ 0200 NV20 (GeForce3)
X 0203 Quadro DCC
X 10df Emulex Corporation
X 10df Light Pulse Fibre Channel Adapter
@@ -1893,7 +1937,7 @@
X 10e5 Micro Industries Corporation
X 10e6 Gainbery Computer Products Inc.
X 10e7 Vadem
-10e8 Applied Micro Circuits Corporation
+10e8 Applied Micro Circuits Corp.
X 2011 Q-Motion Video Capture/Edit board
X 4750 S5930 [Matchmaker]
X 5920 S5920
@@ -1907,7 +1951,7 @@
X 80d9 PCI-9118
X 80da PCI-9812
X 811a PCI-IEEE1355-DS-DE Interface
- 8170 S5933 "Matchmaker" [PCI Chipset Development Tool]
+ 8170 S5933 [Matchmaker] (Chipset Development Tool)
X 10e9 Alps Electric Co., Ltd.
X 10ea Intergraphics Systems
X 1680 IGA-1680
@@ -1989,7 +2033,7 @@
X 0002 SB Live! EMU10k1
X 1102 0020 CT4850 SBLive! Value
X 1102 0021 CT4620 SBLive!
- 1102 002f SBLive! mainboard implementation
+ 1102 002f SBLive! mainboard implementation
X 1102 4001 E-mu APS
X 1102 8022 CT4780 SBLive! Value
X 1102 8023 CT4790 SoundBlaster PCI512
@@ -2002,6 +2046,7 @@
X 1102 8051 CT4850 SBLive! Value
X 7002 SB Live!
X 1102 0020 Gameport Joystick
+ 8938 ES1371
X 1103 Triones Technologies, Inc.
X 0003 HPT343
X 0004 HPT366 / HPT370
@@ -2066,16 +2111,16 @@
X 8231 VT8231 [PCI-to-ISA Bridge]
X 8235 VT8235 Power Management
X 8305 VT8363/8365 [KT133/KM133 AGP]
- 8391 VT8371 [KX133 AGP]
+ 8391 VT8371 [KX133 AGP]
X 8501 VT8501 [Apollo MVP4 AGP]
X 8596 VT82C596 [Apollo PRO AGP]
X 8597 VT82C597 [Apollo VP3 AGP]
X 8598 VT82C598/694x [Apollo MVP3/Pro133x AGP]
X 8601 VT8601 [Apollo ProMedia AGP]
X 8605 VT8605 [PM133 AGP]
+ 8691 VT82C691 [Apollo Pro]
X b091 VT8633 [Apollo Pro266 AGP]
X b099 VT8367 [KT266 AGP]
- 8691 VT82C691 [Apollo Pro]
X 1107 Stratus Computers
X 0576 VIA VT82C570MV [Apollo] (Wrong vendor ID!)
X 1108 Proteon, Inc.
@@ -2105,7 +2150,7 @@
X 6037 Firepower Powerized SMP I/O ASIC
X 6073 Firepower Powerized SMP I/O ASIC
X 1111 Santa Cruz Operation
-# DJ- Some people say that 0x1112 is Rockwell International ?
+# DJ: Some people say that 0x1112 is Rockwell International
X 1112 RNS - Div. of Meret Communications Inc
X 2200 FDDI Adapter
X 2300 Fast Ethernet Adapter
@@ -2115,6 +2160,7 @@
X 1211 SMC2-1211TX
X 103c 1207 EN-1207D Fast Ethernet Adapter
X 1113 1211 EN-1207D Fast Ethernet Adapter
+ 1216 EN-1216 Ethernet Adapter
X 1217 EN-1217 Ethernet Adapter
X 5105 10Mbps Network card
X 9211 EN-1207D Fast Ethernet Adapter
@@ -2164,10 +2210,22 @@
X 0119 GDT 6128RD/6528RD/6628RD
X 011a GDT 6538RD/6638RD
X 011b GDT 6558RD/6658RD
+ 0120 GDT 6117RP2/6517RP2
+ 0121 GDT 6127RP2/6527RP2
+ 0122 GDT 6537RP2
+ 0123 GDT 6557RP2
+ 0124 GDT 6111RP2/6511RP2
+ 0125 GDT 6121RP2/6521RP2
+ 0136 GDT 6113RS/6513RS
+ 0137 GDT 6123RS/6523RS
X 0138 GDT 6118RS/6518RS/6618RS
X 0139 GDT 6128RS/6528RS/6628RS
X 013a GDT 6538RS/6638RS
X 013b GDT 6558RS/6658RS
+ 013c GDT 6533RS/6633RS
+ 013d GDT 6543RS/6643RS
+ 013e GDT 6553RS/6653RS
+ 013f GDT 6563RS/6663RS
X 0166 GDT 7113RN/7513RN/7613RN
X 0167 GDT 7123RN/7523RN/7623RN
X 0168 GDT 7118RN/7518RN/7518RN
@@ -2178,10 +2236,19 @@
X 016d GDT 7543RN/7643RN
X 016e GDT 7553RN/7653RN
X 016f GDT 7563RN/7663RN
+ 01d6 GDT 4x13RZ
+ 01d7 GDT 4x23RZ
+ 01f6 GDT 8x13RZ
+ 01f7 GDT 8x23RZ
+ 01fc GDT 8x33RZ
+ 01fd GDT 8x43RZ
+ 01fe GDT 8x53RZ
+ 01ff GDT 8x63RZ
X 0210 GDT 6519RD/6619RD
X 0211 GDT 6529RD/6629RD
X 0260 GDT 7519RN/7619RN
X 0261 GDT 7529RN/7629RN
+ 0300 GDT Raid Controller
X 111a Efficient Networks, Inc
X 0000 155P-MF1 (FPGA)
X 0002 155P-MF1 (ASIC)
@@ -2189,13 +2256,13 @@
X 111a 0000 ENI-25p Miniport ATM Adapter
X 0005 SpeedStream (LANAI)
X 111a 0001 ENI-3010 ATM
- 111a 0101 ENI-3010 ATM
X 111a 0009 ENI-3060 ADSL (VPI=0)
+ 111a 0101 ENI-3010 ATM
X 111a 0109 ENI-3060CO ADSL (VPI=0)
X 111a 0809 ENI-3060 ADSL (VPI=0 or 8)
X 111a 0909 ENI-3060CO ADSL (VPI=0 or 8)
X 111a 0a09 ENI-3060 ADSL (VPI=<0..15>)
- 0007 SpeedStream ADSL
+ 0007 SpeedStream ADSL
X 111a 1001 ENI-3061 ADSL [ASIC]
X 111b Teledyne Electronic Systems
X 111c Tricord Systems Inc.
@@ -2273,7 +2340,7 @@
X 113c Cyclone Microsystems, Inc.
X 0000 PCI-9060 i960 Bridge
X 0001 PCI-SDK [PCI i960 Evaluation Platform]
- 0911 PCI-911 [PCI-based i960Jx Intelligent I/O Controller]
+ 0911 PCI-911 [i960Jx-based Intelligent I/O Controller]
X 0912 PCI-912 [i960CF-based Intelligent I/O Controller]
X 0913 PCI-913
X 0914 PCI-914 [I/O Controller w/ secondary PCI bus]
@@ -2464,9 +2531,8 @@
X 060f ToPIC97
X 0617 ToPIC95 PCI to Cardbus Bridge with ZV Support
X 0618 CPU to PCI and PCI to ISA bridge
+# Claimed to be Lucent DSP1645 [Mars], but that's apparently incorrect. Does anyone know the correct ID?
X 0701 FIR Port
-# This is apparently incorrect. Does anyone know the correct ID?
-# 0701 Lucent DSP1645 [Mars]
X 0d01 FIR Port Type-DO
X 1179 0001 FIR Port Type-DO
X 117a A-Trend Technology
@@ -2488,6 +2554,9 @@
X 1185 Dataworld International Ltd
X 1186 D-Link System Inc
X 0100 DC21041
+ 1002 Sundance Ethernet
+ 1300 RTL8139 Ethernet
+ 4000 DL2K Ethernet
X 1187 Advanced Technology Laboratories, Inc.
X 1188 Shima Seiki Manufacturing Ltd.
X 1189 Matsushita Electronics Co Ltd
@@ -2546,8 +2615,8 @@
X 119c Information Technology Inst.
X 119d Bug, Inc. Sapporo Japan
X 119e Fujitsu Microelectronics Ltd.
- 0001 FireStream 155
- 0003 FireStream 50
+ 0001 FireStream 155
+ 0003 FireStream 50
X 119f Bull HN Information Systems
X 11a0 Convex Computer Corporation
X 11a1 Hamamatsu Photonics K.K.
@@ -2603,8 +2672,8 @@
X 11c1 Lucent Microelectronics
X 0440 56k WinModem
X 0001 0440 LT WinModem 56k Data+Fax+Voice+Dsvd
- 1033 8015 LT WinModem 56k Data+Fax+Voice+Dsvd
- 1033 804f LT WinModem 56k Data+Fax+Voice+Dsvd
+ 1033 8015 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 1033 804f LT WinModem 56k Data+Fax+Voice+Dsvd
X 10cf 102c LB LT Modem V.90 56k
X 10cf 104a BIBLO LT Modem 56k
X 10cf 105f LB2 LT Modem V.90 56k
@@ -2614,8 +2683,8 @@
X 13e0 0040 LT WinModem 56k Data+Fax+Voice+Dsvd
X 13e0 0440 LT WinModem 56k Data+Fax+Voice+Dsvd
X 13e0 0441 LT WinModem 56k Data+Fax+Voice+Dsvd
- 13e0 f100 LT WinModem 56k Data+Fax+Voice+Dsvd
- 13e0 f101 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 13e0 f100 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 13e0 f101 LT WinModem 56k Data+Fax+Voice+Dsvd
X 144d 2101 LT56PV Modem
X 149f 0440 LT WinModem 56k Data+Fax+Voice+Dsvd
X 0441 56k WinModem
@@ -2623,15 +2692,15 @@
X 1092 0440 Supra 56i
X 1179 0001 Internal V.90 Modem
X 11c1 0440 LT WinModem 56k Data+Fax
- 11c1 0441 LT WinModem 56k Data+Fax
+ 11c1 0441 LT WinModem 56k Data+Fax
X 122d 4100 MDP7800-U Modem
- 13e0 0040 LT WinModem 56k Data+Fax
- 13e0 0100 LT WinModem 56k Data+Fax
- 13e0 0410 LT WinModem 56k Data+Fax
+ 13e0 0040 LT WinModem 56k Data+Fax
+ 13e0 0100 LT WinModem 56k Data+Fax
+ 13e0 0410 LT WinModem 56k Data+Fax
X 13e0 0420 TelePath Internet 56k WinModem
- 13e0 0443 LT WinModem 56k Data+Fax
+ 13e0 0443 LT WinModem 56k Data+Fax
X 1416 9804 CommWave 56k Modem
- 141d 0440 LT WinModem 56k Data+Fax
+ 141d 0440 LT WinModem 56k Data+Fax
X 144f 0441 Lucent 56k V.90 DF Modem
X 1468 0441 Presario 56k V.90 DF Modem
X 0442 56k WinModem
@@ -2973,12 +3042,16 @@
X 2120 VideoPlex CC
X 2130 VideoQuest
X 1256 Perceptive Solutions, Inc.
+ 4201 PCI-2220I
+ 4401 PCI-2240I
+ 5201 PCI-2000
X 1257 Vertex Networks, Inc.
X 1258 Gilbarco, Inc.
X 1259 Allied Telesyn International
X 2560 AT-2560 Fast Ethernet Adapter (i82557B)
X 125a ABB Power Systems
X 125b Asix Electronics Corporation
+ 1400 ALFA GFC2204
X 125c Aurora Technologies, Inc.
X 125d ESS Technology
X 0000 ES336H Fax Modem (Early Model)
@@ -3225,7 +3298,10 @@
X 1280 Photoscript Group Ltd.
X 1281 Yokogawa Electric Corporation
X 1282 Davicom Semiconductor, Inc.
+ 9009 Ethernet 100/10 MBit
+ 9100 Ethernet 100/10 MBit
X 9102 Ethernet 100/10 MBit
+ 9132 Ethernet 100/10 MBit
X 1283 Integrated Technology Express, Inc.
X 673a IT8330G
X 8330 IT8330G
@@ -3330,6 +3406,8 @@
X 12c1 GMM Research Corp
X 12c2 Mentec Limited
X 12c3 Holtek Microelectronics Inc
+ 0058 PCI NE2K Ethernet
+ 5598 PCI NE2K Ethernet
X 12c4 Connect Tech Inc
X 12c5 Picture Elements Incorporated
X 0081 PCIVST [Grayscale Thresholding Engine]
@@ -3509,7 +3587,9 @@
X 1313 Yaskawa Electric Co.
X 1316 Teradyne Inc
X 1317 Linksys
+ 0981 Fast Ethernet 10/100
X 0985 Network Everywhere Fast Ethernet 10/100 model NC100
+ 1985 Fast Ethernet 10/100
X 1318 Packet Engines Inc.
X 0911 PCI Ethernet Adapter
X 1319 Fortemedia, Inc
@@ -3669,6 +3749,8 @@
X 1384 Reality Simulation Systems Inc
X 1385 Netgear
X 620a GA620
+ 622a GA622
+ 630a GA630
X f311 FA311
X 1386 Video Domain Technologies
X 1387 Systran Corp
@@ -3685,6 +3767,11 @@
X 1391 Development Concepts Inc
X 1392 Medialight Inc
X 1393 Moxa Technologies Co Ltd
+ 1040 Smartio C104H/PCI
+ 1680 Smartio C168H/PCI
+ 2040 Intellio CP-204J
+ 2180 Intellio C218 Turbo PCI
+ 3200 Intellio C320 Turbo PCI
X 1394 Level One Communications
X 1395 Ambicom Inc
X 1396 Cipher Systems Inc
@@ -3736,6 +3823,7 @@
X 0010 SyncLink WAN Adapter
X 13c1 3ware Inc
X 1000 3ware ATA-RAID
+ 1001 3ware 7000-series ATA-RAID
X 13c2 Technotrend Systemtechnik GmbH
X 13c3 Janz Computer AG
X 13c4 Phase Metrics
@@ -3767,7 +3855,7 @@
X 13de ABB Robotics Products AB
X 13df E-Tech Inc
X 0001 PCI56RVP Modem
- 13df 0001 PCI56RVP Modem
+ 13df 0001 PCI56RVP Modem
X 13e0 GVC Corporation
X 13e1 Silicom Multimedia Systems Inc
X 13e2 Dynamics Research Corporation
@@ -3784,7 +3872,8 @@
X 13ed Raytheion E-Systems
X 13ee Hayes Microcomputer Products Inc
X 13ef Coppercom Inc
-13f0 Sundance technology Inc
+13f0 Sundance Technology Inc
+ 0201 Sundance Ethernet
X 13f1 Oce' - Technologies B.V.
X 13f2 Ford Microelectronics Inc
X 13f3 Mcdata Corporation
@@ -3808,6 +3897,7 @@
X 13fe Advantech Co. Ltd
X 13ff Silicon Spice Inc
X 1400 Artx Inc
+ 1401 9432 TX
X 1401 CR-Systems A/S
X 1402 Meilhaus Electronic GmbH
X 1403 Ascor Inc
@@ -3815,6 +3905,14 @@
X 1405 Excalibur Systems Inc
X 1406 Oce' Printing Systems GmbH
X 1407 Lava Computer mfg Inc
+ 0100 Lava Dual Serial
+ 0101 Lava Quatro A
+ 0102 Lava Quatro B
+ 0200 Lava Port Plus
+ 0201 Lava Quad A
+ 0202 Lava Quad B
+ 0500 Lava Single Serial
+ 0600 Lava Port 650
X 8000 Lava Parallel
X 8002 Lava Dual Parallel port A
X 8003 Lava Dual Parallel port B
@@ -4075,8 +4173,8 @@
X 14e4 0004 NetXtreme 1000BaseTX
X 14e4 1644 NetXtreme BCM5700 1000BaseTX
X 1645 NetXtreme BCM5701 Gigabit Ethernet
- 0e11 007d NC6770 1000BaseSX
X 0e11 007c NC7770 1000BaseTX
+ 0e11 007d NC6770 1000BaseSX
X 0e11 0085 NC7780 1000BaseTX
X 10b7 1004 3C996-SX 1000BaseSX
X 10b7 1006 3C996B-T 1000BaseTX
@@ -4088,6 +4186,7 @@
X 14e4 0007 NetXtreme BCM5701 1000BaseSX
X 14e4 0008 NetXtreme BCM5701 1000BaseTX
X 14e4 8008 NetXtreme BCM5701 1000BaseTX
+ 1647 NetXtreme BCM5701 Gigabit Ethernet
X 5820 BCM5820 Crypto Accelerator
X 14e5 Pixelfusion Ltd
X 14e6 SHINING Technology Inc
@@ -4103,29 +4202,24 @@
X 14f0 CANON RESEACH CENTRE FRANCE
X 14f1 Conexant
X 1033 HCF 56k Data/Fax Modem
- 1033 8077 NEC
- 122d 4027 Dell Zeus - MDP3880-W(B) Data Fax Modem # Aztech
- 122d 4030 Dell Mercury - MDP3880-U(B) Data Fax Modem # Aztech
- 122d 4034 Dell Thor - MDP3880-W(U) Data Fax Modem # Aztech
+ 122d 4027 Dell Zeus - MDP3880-W(B) Data Fax Modem
+ 122d 4030 Dell Mercury - MDP3880-U(B) Data Fax Modem
+ 122d 4034 Dell Thor - MDP3880-W(U) Data Fax Modem
X 13e0 020d Dell Copper
X 13e0 020e Dell Silver
- 13e0 0261 IBM # GVC
X 13e0 0290 Compaq Goldwing
- 13e0 02a0 IBM # GVC
- 13e0 02b0 IBM # GVC
X 13e0 02c0 Compaq Scooter
- 13e0 02d0 IBM # GVC
- 144f 1500 IBM P85-DF # Askey
- 144f 1501 IBM P85-DF # Askey
- 144f 150a IBM P85-DF # Askey
- 144f 150b IBM P85-DF Low Profile # Askey
- 144f 1510 IBM P85-DF Low Profile # Askey
+ 144f 1500 IBM P85-DF (1)
+ 144f 1501 IBM P85-DF (2)
+ 144f 150a IBM P85-DF (3)
+ 144f 150b IBM P85-DF Low Profile (1)
+ 144f 1510 IBM P85-DF Low Profile (2)
X 1034 HCF 56k Data/Fax/Voice Modem
X 1035 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
X 10cf 1098 Fujitsu P85-DFSV
X 1036 HCF 56k Data/Fax/Voice/Spkp Modem
- 122d 4029 MDP3880SP-W # Aztech
- 122d 4031 MDP3880SP-U # Aztech
+ 122d 4029 MDP3880SP-W
+ 122d 4031 MDP3880SP-U
X 13e0 0209 Dell Titanium
X 13e0 020a Dell Graphite
X 13e0 0260 Gateway Red Owl
@@ -4141,80 +4235,72 @@
X 1064 HCF 56k Data/Fax/Voice Modem
X 1065 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
X 1066 HCF 56k Data/Fax/Voice/Spkp Modem
- 122d 4033 Dell Athena - MDP3900V-U # Aztech
+ 122d 4033 Dell Athena - MDP3900V-U
X 1433 HCF 56k Data/Fax Modem
X 1434 HCF 56k Data/Fax/Voice Modem
X 1435 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
X 1436 HCF 56k Data/Fax Modem
X 1453 HCF 56k Data/Fax Modem
- 13e0 0240 IBM # GVC
- 13e0 0250 IBM # GVC
- 144f 1502 IBM P95-DF # Askey
- 144f 1503 IBM P95-DF # Askey
+ 144f 1502 IBM P95-DF (1)
+ 144f 1503 IBM P95-DF (2)
X 1454 HCF 56k Data/Fax/Voice Modem
X 1455 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
X 1456 HCF 56k Data/Fax/Voice/Spkp Modem
- 122d 4035 Dell Europa - MDP3900V-W # Aztech
- 122d 4302 MP3930V-W(C) MiniPCI # Aztech
+ 122d 4035 Dell Europa - MDP3900V-W
+ 122d 4302 Dell MP3930V-W(C) MiniPCI
X 1803 HCF 56k Modem
- 0e11 0023 623-LAN Grizzly # Compaq
- 0e11 0043 623-LAN Yogi # Compaq
+ 0e11 0023 623-LAN Grizzly
+ 0e11 0043 623-LAN Yogi
X 1815 HCF 56k Modem
- 0e11 0022 Grizzly # Compaq
- 0e11 0042 Yogi # Compaq
+ 0e11 0022 Grizzly
+ 0e11 0042 Yogi
X 2003 HSF 56k Data/Fax Modem
X 2004 HSF 56k Data/Fax/Voice Modem
X 2005 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
X 2006 HSF 56k Data/Fax/Voice/Spkp Modem
X 2013 HSF 56k Data/Fax Modem
- 0e11 b195 Bear # Compaq
- 0e11 b196 Seminole 1 # Compaq
- 0e11 b1be Seminole 2 # Compaq
- 1025 8013 Acer
- 1033 809d NEC
- 1033 80bc NEC
+ 0e11 b195 Bear
+ 0e11 b196 Seminole 1
+ 0e11 b1be Seminole 2
X 155d 6793 HP
X 155d 8850 E Machines
X 2014 HSF 56k Data/Fax/Voice Modem
X 2015 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
X 2016 HSF 56k Data/Fax/Voice/Spkp Modem
- 2043 HSF 56k Data/Fax Modem (Worldwide SmartDAA)
- 2044 HSF 56k Data/Fax/Voice Modem (Worldwide SmartDAA)
- 2045 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (Worldwide SmartDAA)
- 2046 HSF 56k Data/Fax/Voice/Spkp Modem (Worldwide SmartDAA)
+ 2043 HSF 56k Data/Fax Modem (WorldW SmartDAA)
+ 2044 HSF 56k Data/Fax/Voice Modem (WorldW SmartDAA)
+ 2045 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (WorldW SmartDAA)
+ 2046 HSF 56k Data/Fax/Voice/Spkp Modem (WorldW SmartDAA)
X 2063 HSF 56k Data/Fax Modem (SmartDAA)
X 2064 HSF 56k Data/Fax/Voice Modem (SmartDAA)
X 2065 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (SmartDAA)
X 2066 HSF 56k Data/Fax/Voice/Spkp Modem (SmartDAA)
X 2093 HSF 56k Modem
X 155d 2f07 Legend
- 2143 HSF 56k Data/Fax/Cell Modem (Mobile Worldwide SmartDAA)
- 2144 HSF 56k Data/Fax/Voice/Cell Modem (Mobile Worldwide SmartDAA)
- 2145 HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob WW SmartDAA)
- 2146 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mobile Worldwide SmartDAA)
- 2163 HSF 56k Data/Fax/Cell Modem (Mobile SmartDAA)
- 2164 HSF 56k Data/Fax/Voice/Cell Modem (Mobile SmartDAA)
- 2165 HSF 56k Data/Fax/Voice/Spkp (w/Handset)/Cell Modem (Mobile SmartDAA)
- 2166 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mobile SmartDAA)
- 2343 HSF 56k Data/Fax CardBus Modem (Mobile Worldwide SmartDAA)
- 2344 HSF 56k Data/Fax/Voice CardBus Modem (Mobile Worldwide SmartDAA)
- 2345 HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob WW SmartDAA)
- 2346 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mobile Worldwide SmartDAA)
- 2363 HSF 56k Data/Fax CardBus Modem (Mobile SmartDAA)
- 2364 HSF 56k Data/Fax/Voice CardBus Modem (Mobile SmartDAA)
+ 2143 HSF 56k Data/Fax/Cell Modem (Mob WorldW SmartDAA)
+ 2144 HSF 56k Data/Fax/Voice/Cell Modem (Mob WorldW SmartDAA)
+ 2145 HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob WorldW SmartDAA)
+ 2146 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob WorldW SmartDAA)
+ 2163 HSF 56k Data/Fax/Cell Modem (Mob SmartDAA)
+ 2164 HSF 56k Data/Fax/Voice/Cell Modem (Mob SmartDAA)
+ 2165 HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob SmartDAA)
+ 2166 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob SmartDAA)
+ 2343 HSF 56k Data/Fax CardBus Modem (Mob WorldW SmartDAA)
+ 2344 HSF 56k Data/Fax/Voice CardBus Modem (Mob WorldW SmartDAA)
+ 2345 HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob WorldW SmartDAA)
+ 2346 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob WorldW SmartDAA)
+ 2363 HSF 56k Data/Fax CardBus Modem (Mob SmartDAA)
+ 2364 HSF 56k Data/Fax/Voice CardBus Modem (Mob SmartDAA)
X 2365 HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob SmartDAA)
- 2366 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mobile SmartDAA)
- 2443 HSF 56k Data/Fax Modem (Mobile Worldwide SmartDAA)
- 104d 8075 Modem # Sony
- 104d 8083 Modem # Sony
- 104d 8097 Modem # Sony
- 2444 HSF 56k Data/Fax/Voice Modem (Mobile Worldwide SmartDAA)
- 2445 HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mobile WW SmartDAA)
- 2446 HSF 56k Data/Fax/Voice/Spkp Modem (Mobile Worldwide SmartDAA)
- 2463 HSF 56k Data/Fax Modem (Mobile SmartDAA)
- 2464 HSF 56k Data/Fax/Voice Modem (Mobile SmartDAA)
- 2465 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (Mobile SmartDAA)
- 2466 HSF 56k Data/Fax/Voice/Spkp Modem (Mobile SmartDAA)
+ 2366 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob SmartDAA)
+ 2443 HSF 56k Data/Fax Modem (Mob WorldW SmartDAA)
+ 2444 HSF 56k Data/Fax/Voice Modem (Mob WorldW SmartDAA)
+ 2445 HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob WorldW SmartDAA)
+ 2446 HSF 56k Data/Fax/Voice/Spkp Modem (Mob WorldW SmartDAA)
+ 2463 HSF 56k Data/Fax Modem (Mob SmartDAA)
+ 2464 HSF 56k Data/Fax/Voice Modem (Mob SmartDAA)
+ 2465 HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob SmartDAA)
+ 2466 HSF 56k Data/Fax/Voice/Spkp Modem (Mob SmartDAA)
X 2f00 HSF 56k HSFi Modem
X 13e0 8d84 IBM HSFi V.90
X 13e0 8d85 Compaq Stinger
@@ -4239,9 +4325,7 @@
X 1504 KAISER Electronics
X 1505 ITA INGENIEURBURO FUR TESTAUFGABEN GmbH
X 1506 CHAMELEON Systems Inc
-# 1507 HTEC Ltd
-# Commented out because there are no known HTEC chips and 1507 is already
-# used by mistake by Motorola (see vendor ID 1057)
+# Should be HTEC Ltd, but there are no known HTEC chips and 1507 is already used by mistake by Motorola (see vendor ID 1057).
X 1507 Motorola ?? / HTEC
X 0001 MPC105 [Eagle]
X 0002 MPC106 [Grackle]
@@ -4616,8 +4700,11 @@
X 4000 ALS4000 Audio Chipset
X 4005 4000 ALS4000 Audio Chipset
X 4033 Addtron Technology Co, Inc.
+ 1360 RTL8139 Ethernet
X 4143 Digital Equipment Corp
X 416c Aladdin Knowledge Systems
+ 0100 AladdinCARD
+ 0200 CPC
X 4444 Internext Compression Inc
X 4468 Bridgeport machines
X 4594 Cogetec Informatique Inc
@@ -4782,7 +4869,7 @@
X 8008 Quancom Electronic GmbH
X 0010 WDOG1 [PCI-Watchdog 1]
X 0011 PWDOG2 [PCI-Watchdog 2]
-8086 Intel Corporation
+8086 Intel Corp.
X 0007 82379AB
X 0039 21145
X 0122 82437FX
@@ -4792,6 +4879,7 @@
X 0486 82430ZX [Aries]
X 04a3 82434LX [Mercury/Neptune]
X 04d0 82437FX [Triton FX]
+ 0600 RAID Controller
X 0960 80960RP [i960 RP Microprocessor/Bridge]
X 0964 80960RP [i960 RP Microprocessor/Bridge]
X 1000 82542 Gigabit Ethernet Controller
@@ -4802,8 +4890,10 @@
X 1001 82543GC Gigabit Ethernet Controller
X 1004 82543GC Gigabit Ethernet Controller
X 1008 82544EI Gigabit Ethernet Controller
+ 1009 82544EI Gigabit Ethernet Controller
X 100c 82544GC Gigabit Ethernet Controller
X 100d 82544GC Gigabit Ethernet Controller
+ 1029 82559 Ethernet Controller
X 1030 82559 InBusiness 10/100
X 1031 82801CAM (ICH3) Chipset Ethernet Controller
X 1032 82801CAM (ICH3) Chipset Ethernet Controller
@@ -4814,7 +4904,7 @@
X 1037 82801CAM (ICH3) Chipset Ethernet Controller
X 1038 82801CAM (ICH3) Chipset Ethernet Controller
X 1130 82815 815 Chipset Host Bridge and Memory Controller Hub
- 1132 82815 CGC [Chipset Graphics Controller]
+ 1132 82815 CGC [Chipset Graphics Controller]
X 1161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller
X 1209 82559ER
X 1221 82092AA_0
@@ -4846,7 +4936,7 @@
X 103c 1200 Ethernet Pro 10/100TX
X 10c3 1100 SmartEther100 SC1100
X 1179 0002 PCI FastEther LAN on Docker
- 1259 2560 AT-2560 100
+ 1259 2560 AT-2560 100
X 1259 2561 AT-2560 100 FX Ethernet Adapter
X 1266 0001 NE10/100 Adapter
X 8086 0001 EtherExpress PRO/100B (TX)
@@ -4875,8 +4965,8 @@
X 122e 82371FB PIIX ISA [Triton I]
X 1230 82371FB PIIX IDE [Triton I]
X 1231 DSVD Modem
- 1234 430MX - 82371MX MPIIX [430MX PCIset - 82371MX Mobile PCI I/O IDE Xcelerator (MPIIX)]
- 1235 430MX - 82437MX MTSC [430MX PCIset - 82437MX Mobile System Controller (MTSC) and 82438MX Mobile Data Path (MTDP)]
+ 1234 430MX - 82371MX Mobile PCI I/O IDE Xcelerator (MPIIX)
+ 1235 430MX - 82437MX Mob. System Ctrlr (MTSC) & 82438MX Data Path (MTDP)
X 1237 440FX - 82441FX PMC [Natoma]
X 1239 82371FB
X 123b 82380PB
@@ -4891,10 +4981,13 @@
X 101e 0438 MegaRaid 438
X 101e 0466 MegaRaid 466
X 101e 0467 MegaRaid 467
+ 101e 09a0 PowerEdge Expandable RAID Controller 2/SC
X 1028 0467 PowerEdge Expandable RAID Controller 2/DC
X 1028 1111 PowerEdge Expandable RAID Controller 2/SC
+ 103c 03a2 MegaRaid
X 103c 10c6 MegaRaid 438
X 103c 10c7 MegaRaid T5
+ 103c 10cc MegaRaid
X 1111 1111 MegaRaid 466
X 113c 03a2 MegaRaid
X 1a21 82840 840 (Carmel) Chipset Host Bridge (Hub A)
@@ -4933,6 +5026,7 @@
X 244b 82820 820 (Camino 2) Chipset IDE U100
X 244c 82820 820 (Camino 2) Chipset ISA Bridge (ICH2-M)
X 244e 82820 820 (Camino 2) Chipset PCI
+ 2485 AC'97 Audio Controller
X 2500 82820 820 (Camino) Chipset Host Bridge (MCH)
X 1043 801c P3C-2000 system chipset
X 2501 82820 820 (Camino) Chipset Host Bridge (MCH)
@@ -4945,6 +5039,7 @@
X 2531 82850 860 (Wombat) Chipset Host Bridge (MCH)
X 2532 82850 850 (Tehama) Chipset AGP Bridge
X 2533 82860 860 (Wombat) Chipset AGP Bridge
+ 3092 Integrated RAID
X 5200 EtherExpress PRO/100 Intelligent Server
X 5201 EtherExpress PRO/100 Intelligent Server
X 8086 0001 EtherExpress PRO/100 Server Ethernet Adapter
@@ -5000,6 +5095,10 @@
X 84e2 460GX - 84460GX AGP Bridge (GXB)
X 84e3 460GX - 84460GX Memory Address Controller (MAC)
X 84e4 460GX - 84460GX Memory Data Controller (MDC)
+ 9621 Integrated RAID
+ 9622 Integrated RAID
+ 9641 Integrated RAID
+ 96a1 Integrated RAID
X ffff 450NX/GX [Orion] - 82453KX/GX Memory controller [BUG]
X 8800 Trigem Computer Inc.
X 2008 Video assistent component
@@ -5009,7 +5108,6 @@
X 8e2e KTI
X 3000 ET32P2
X 9004 Adaptec
-# FIXME: [dj] In one document I have, lot of these AIC's are actually AHA's
X 1078 AIC-7810
X 1160 AIC-1160 [Family Fibre Channel Adapter]
X 2178 AIC-7821
@@ -5064,8 +5162,9 @@
X 7278 AHA-3940 / AIC-7872
X 7378 AHA-3985 / AIC-7873
X 7478 AHA-2944 / AIC-7874
-# FIXME: [dj] Where did the 3rd number come from in 0x7578 & 0x7678 ?
+# DJ: Where did the 3rd number come from?
X 7578 AHA-3944 / AHA-3944W / 7875
+# DJ: Where did the 3rd number come from?
X 7678 AHA-4944W/UW / 7876
X 7778 AIC-787x
X 7810 AIC-7810
@@ -5311,7 +5410,7 @@
X 00 UHCI
X 10 OHCI
X 80 Unspecified
- Fe USB Device
+ fe USB Device
X 04 Fibre Channel
X 05 SMBus
X 06 InfiniBand
diff -u --recursive --new-file v2.4.13/linux/drivers/pci/proc.c linux/drivers/pci/proc.c
--- v2.4.13/linux/drivers/pci/proc.c Sat May 19 12:48:33 2001
+++ linux/drivers/pci/proc.c Sun Nov 4 09:31:58 2001


@@ -3,7 +3,7 @@
X *

X * Procfs interface for the PCI bus.
X *
- * Copyright (c) 1997--1999 Martin Mares <m...@suse.cz>
+ * Copyright (c) 1997--1999 Martin Mares <m...@ucw.cz>
X */
X
X #include <linux/types.h>
diff -u --recursive --new-file v2.4.13/linux/drivers/pci/quirks.c linux/drivers/pci/quirks.c
--- v2.4.13/linux/drivers/pci/quirks.c Sun Sep 23 11:40:59 2001
+++ linux/drivers/pci/quirks.c Sun Nov 4 09:31:58 2001
@@ -5,7 +5,7 @@
X * bugs. Devices present only on certain architectures (host
X * bridges et cetera) should be handled in arch-specific code.
X *
- * Copyright (c) 1999 Martin Mares <m...@suse.cz>
+ * Copyright (c) 1999 Martin Mares <m...@ucw.cz>
X *
X * The bridge optimization stuff has been removed. If you really
X * have a silly BIOS which is unable to set your host bridge right,
diff -u --recursive --new-file v2.4.13/linux/drivers/pcmcia/Config.in linux/drivers/pcmcia/Config.in
--- v2.4.13/linux/drivers/pcmcia/Config.in Fri Feb 16 16:02:36 2001
+++ linux/drivers/pcmcia/Config.in Thu Oct 25 13:53:48 2001
@@ -17,6 +17,7 @@
X if [ "$CONFIG_PCI" != "n" ]; then
X bool ' CardBus support' CONFIG_CARDBUS
X fi
+ bool ' i82092 compatible bridge support' CONFIG_I82092
X bool ' i82365 compatible bridge support' CONFIG_I82365
X bool ' Databook TCIC host bridge support' CONFIG_TCIC
X if [ "$CONFIG_HD64465" = "y" ]; then
diff -u --recursive --new-file v2.4.13/linux/drivers/pcmcia/Makefile linux/drivers/pcmcia/Makefile
--- v2.4.13/linux/drivers/pcmcia/Makefile Tue Oct 23 22:48:51 2001
+++ linux/drivers/pcmcia/Makefile Thu Oct 25 13:53:48 2001
@@ -29,6 +29,9 @@
X ifeq ($(CONFIG_I82365),y)
X obj-y += i82365.o
X endif
+ ifeq ($(CONFIG_I82092),y)
+ obj-y += i82092.o
+ endif
X ifeq ($(CONFIG_TCIC),y)
X obj-y += tcic.o
X endif
@@ -40,6 +43,9 @@
X obj-m := pcmcia_core.o ds.o
X ifeq ($(CONFIG_I82365),y)
X obj-m += i82365.o
+ endif
+ ifeq ($(CONFIG_I82092),y)
+ obj-m += i82092.o
X endif
X ifeq ($(CONFIG_TCIC),y)
X obj-m += tcic.o
diff -u --recursive --new-file v2.4.13/linux/drivers/pcmcia/ds.c linux/drivers/pcmcia/ds.c
--- v2.4.13/linux/drivers/pcmcia/ds.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/pcmcia/ds.c Thu Oct 25 13:53:47 2001
@@ -640,8 +640,8 @@
X if (signal_pending(current))
X return -EINTR;
X }
- put_user(get_queued_event(user), (int *)buf);
- return 4;
+
+ return put_user(get_queued_event(user), (int *)buf) ? -EFAULT : 4;
X } /* ds_read */
X
X /*====================================================================*/
diff -u --recursive --new-file v2.4.13/linux/drivers/pcmcia/i82092.c linux/drivers/pcmcia/i82092.c
--- v2.4.13/linux/drivers/pcmcia/i82092.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/pcmcia/i82092.c Thu Oct 25 13:53:48 2001
@@ -0,0 +1,909 @@
+/*
+ * Driver for Intel I82092AA PCI-PCMCIA bridge.
+ *
+ * (C) 2001 Red Hat, Inc.
+ *
+ * Author: Arjan Van De Ven <arj...@redhat.com>
+ * Loosly based on i82365.c from the pcmcia-cs package
+ *
+ * $Id: i82092aa.c,v 1.2 2001/10/23 14:43:34 arjanv Exp $
+ */
+
+#include <linux/kernel.h>
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+
+#include <pcmcia/cs_types.h>
+#include <pcmcia/ss.h>
+#include <pcmcia/cs.h>
+
+#include <asm/system.h>
+#include <asm/io.h>
+
+#include "i82092aa.h"
+#include "i82365.h"
+
+/* PCI core routines */
+static struct pci_device_id i82092aa_pci_ids[] = {
+ {
+ vendor:PCI_VENDOR_ID_INTEL,
+ device:PCI_DEVICE_ID_INTEL_82092AA_0,
+ subvendor:PCI_ANY_ID,
+ subdevice:PCI_ANY_ID,
+ class: 0, class_mask:0,
+
+ },
+ {}
+};
+
+static struct pci_driver i82092aa_pci_drv = {
+ name: "i82092aa",
+ id_table: i82092aa_pci_ids,
+ probe: i82092aa_pci_probe,
+ remove: i82092aa_pci_remove,
+ suspend: NULL,
+ resume: NULL
+};
+
+
+/* the pccard structure and its functions */
+static struct pccard_operations i82092aa_operations = {
+ init: i82092aa_init,
+ suspend: i82092aa_suspend,
+ register_callback: i82092aa_register_callback,
+ inquire_socket: i82092aa_inquire_socket,
+ get_status: i82092aa_get_status,
+ get_socket: i82092aa_get_socket,
+ set_socket: i82092aa_set_socket,
+ get_io_map: i82092aa_get_io_map,
+ set_io_map: i82092aa_set_io_map,
+ get_mem_map: i82092aa_get_mem_map,
+ set_mem_map: i82092aa_set_mem_map,
+ proc_setup: i82092aa_proc_setup,
+};
+
+/* The card can do upto 4 sockets, allocate a structure for each of them */
+
+struct socket_info {
+ int card_state; /* 0 = no socket,
+ 1 = empty socket,
+ 2 = card but not initialized,
+ 3 = operational card */
+ int io_base; /* base io address of the socket */
+ socket_cap_t cap;
+
+ unsigned int pending_events; /* Pending events on this interface */
+
+ void (*handler)(void *info, u_int events);
+ /* callback to the driver of the card */
+ void *info; /* to be passed to the handler */
+
+ struct pci_dev *dev; /* The PCI device for the socket */
+};
+
+#define MAX_SOCKETS 4
+static struct socket_info sockets[MAX_SOCKETS];
+static int socket_count; /* shortcut */
+
+
+static int __init i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+{
+ unsigned char configbyte;
+ int i;
+
+ enter("i82092aa_pci_probe");
+
+ if (pci_enable_device(dev))
+ return -EIO;
+
+ pci_read_config_byte(dev, 0x40, &configbyte); /* PCI Configuration Control */
+ switch(configbyte&6) {
+ case 0:
+ printk(KERN_INFO "i82092aa: configured as a 2 socket device.\n");
+ socket_count = 2;
+ break;
+ case 2:
+ printk(KERN_INFO "i82092aa: configured as a 1 socket device.\n");
+ socket_count = 1;
+ break;
+ case 4:
+ case 6:
+ printk(KERN_INFO "i82092aa: configured as a 4 socket device.\n");
+ socket_count = 4;


+ break;
+
+ default:

+ printk(KERN_ERR "i82092aa: Oops, you did something we didn't think of.\n");
+ return -EIO;
+ break;
+ }
+
+ for (i = 0;i<socket_count;i++) {
+ sockets[i].card_state = 1; /* 1 = present but empty */
+ sockets[i].io_base = (dev->resource[0].start & ~1);
+ if (sockets[i].io_base > 0)
+ request_region(sockets[i].io_base, 2, "i82092aa");
+
+
+ sockets[i].cap.features |= SS_CAP_PCCARD;
+ sockets[i].cap.map_size = 0x1000;
+ sockets[i].cap.irq_mask = 0;
+ sockets[i].cap.pci_irq = dev->irq;
+
+ if (card_present(i)) {
+ sockets[i].card_state = 3;
+ dprintk(KERN_DEBUG "i82092aa: slot %i is occupied\n",i);
+ } else {
+ dprintk(KERN_DEBUG "i82092aa: slot %i is vacant\n",i);
+ }
+ }
+
+ /* Now, specifiy that all interrupts are to be done as PCI interrupts */
+ configbyte = 0xFF; /* bitmask, one bit per event, 1 = PCI interrupt, 0 = ISA interrupt */
+ pci_write_config_byte(dev, 0x50, configbyte); /* PCI Interrupt Routing Register */
+
+
+ /* Register the interrupt handler */
+ dprintk(KERN_DEBUG "Requesting interrupt %i \n",dev->irq);
+ if (request_irq(dev->irq, i82092aa_interrupt, SA_SHIRQ, "i82092aa", i82092aa_interrupt)) {
+ printk(KERN_ERR "i82092aa: Failed to register IRQ %d, aborting\n", dev->irq);
+ return -EIO;
+ }
+
+
+ if (register_ss_entry(socket_count, &i82092aa_operations) != 0)
+ printk(KERN_NOTICE "i82092aa: register_ss_entry() failed\n");
+
+ leave("i82092aa_pci_probe");


+ return 0;
+}
+

+static void __exit i82092aa_pci_remove(struct pci_dev *dev)
+{
+ enter("i82092aa_pci_remove");
+
+ free_irq(dev->irq, i82092aa_interrupt);
+
+ leave("i82092aa_pci_remove");
+}
+
+static spinlock_t port_lock = SPIN_LOCK_UNLOCKED;
+
+/* basic value read/write functions */
+
+static unsigned char indirect_read(int socket, unsigned short reg)
+{
+ unsigned short int port;
+ unsigned char val;
+ unsigned long flags;
+ spin_lock_irqsave(&port_lock,flags);
+ reg += socket * 0x40;
+ port = sockets[socket].io_base;
+ outb(reg,port);
+ val = inb(port+1);
+ spin_unlock_irqrestore(&port_lock,flags);


+ return val;
+}
+

+static unsigned short indirect_read16(int socket, unsigned short reg)
+{
+ unsigned short int port;
+ unsigned short tmp;
+ unsigned long flags;
+ spin_lock_irqsave(&port_lock,flags);
+ reg = reg + socket * 0x40;
+ port = sockets[socket].io_base;
+ outb(reg,port);
+ tmp = inb(port+1);
+ reg++;
+ outb(reg,port);
+ tmp = tmp | (inb(port+1)<<8);
+ spin_unlock_irqrestore(&port_lock,flags);
+ return tmp;
+}
+
+static void indirect_write(int socket, unsigned short reg, unsigned char value)
+{
+ unsigned short int port;
+ unsigned long flags;
+ spin_lock_irqsave(&port_lock,flags);
+ reg = reg + socket * 0x40;
+ port = sockets[socket].io_base;
+ outb(reg,port);
+ outb(value,port+1);
+ spin_unlock_irqrestore(&port_lock,flags);
+}
+
+static void indirect_setbit(int socket, unsigned short reg, unsigned char mask)
+{
+ unsigned short int port;
+ unsigned char val;
+ unsigned long flags;
+ spin_lock_irqsave(&port_lock,flags);
+ reg = reg + socket * 0x40;
+ port = sockets[socket].io_base;
+ outb(reg,port);
+ val = inb(port+1);
+ val |= mask;
+ outb(reg,port);
+ outb(val,port+1);
+ spin_unlock_irqrestore(&port_lock,flags);
+}
+
+
+static void indirect_resetbit(int socket, unsigned short reg, unsigned char mask)
+{
+ unsigned short int port;
+ unsigned char val;
+ unsigned long flags;
+ spin_lock_irqsave(&port_lock,flags);
+ reg = reg + socket * 0x40;
+ port = sockets[socket].io_base;
+ outb(reg,port);
+ val = inb(port+1);
+ val &= ~mask;
+ outb(reg,port);
+ outb(val,port+1);
+ spin_unlock_irqrestore(&port_lock,flags);
+}
+
+static void indirect_write16(int socket, unsigned short reg, unsigned short value)
+{
+ unsigned short int port;
+ unsigned char val;
+ unsigned long flags;
+ spin_lock_irqsave(&port_lock,flags);
+ reg = reg + socket * 0x40;
+ port = sockets[socket].io_base;
+
+ outb(reg,port);
+ val = value & 255;
+ outb(val,port+1);
+
+ reg++;
+
+ outb(reg,port);
+ val = value>>8;
+ outb(val,port+1);
+ spin_unlock_irqrestore(&port_lock,flags);
+}
+
+/* simple helper functions */
+/* External clock time, in nanoseconds. 120 ns = 8.33 MHz */
+static int cycle_time = 120;
+
+static int to_cycles(int ns)
+{
+ if (cycle_time!=0)
+ return ns/cycle_time;
+ else


+ return 0;
+}
+

+static int to_ns(int cycles)
+{
+ return cycle_time*cycles;
+}
+
+
+/* Interrupt handler functionality */
+
+static void i82092aa_bh(void *dummy)
+{
+ unsigned int events;
+ int i;
+
+ for (i=0; i < socket_count; i++) {
+ events = xchg(&(sockets[i].pending_events),0);
+ printk("events = %x \n",events);
+ if (sockets[i].handler)
+ sockets[i].handler(sockets[i].info, events);
+ }
+}
+
+
+static struct tq_struct i82092aa_task = {
+ routine: i82092aa_bh
+};
+
+
+static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs)
+{
+ int i;
+ int loopcount = 0;
+
+ unsigned int events, active=0;
+
+/* enter("i82092aa_interrupt");*/
+
+ while (1) {
+ loopcount++;
+ if (loopcount>20) {
+ printk(KERN_ERR "i82092aa: infinite eventloop in interrupt \n");
+ break;


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 32'
echo 'File patch-2.4.14 is continued in part 33'
echo "33" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:46 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part23

#!/bin/sh -x
# this is part 23 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 23; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+/* 09 */ ACPI_OP ("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS),
+/* 0A */ ACPI_OP ("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS),
+/* 0B */ ACPI_OP ("Method", ARGP_METHOD_OP, ARGI_METHOD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
+/* 0C */ ACPI_OP ("Local0", ARGP_LOCAL0, ARGI_LOCAL0, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
+/* 0D */ ACPI_OP ("Local1", ARGP_LOCAL1, ARGI_LOCAL1, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
+/* 0E */ ACPI_OP ("Local2", ARGP_LOCAL2, ARGI_LOCAL2, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
+/* 0F */ ACPI_OP ("Local3", ARGP_LOCAL3, ARGI_LOCAL3, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
+/* 10 */ ACPI_OP ("Local4", ARGP_LOCAL4, ARGI_LOCAL4, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
+/* 11 */ ACPI_OP ("Local5", ARGP_LOCAL5, ARGI_LOCAL5, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
+/* 12 */ ACPI_OP ("Local6", ARGP_LOCAL6, ARGI_LOCAL6, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
+/* 13 */ ACPI_OP ("Local7", ARGP_LOCAL7, ARGI_LOCAL7, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
+/* 14 */ ACPI_OP ("Arg0", ARGP_ARG0, ARGI_ARG0, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
+/* 15 */ ACPI_OP ("Arg1", ARGP_ARG1, ARGI_ARG1, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
+/* 16 */ ACPI_OP ("Arg2", ARGP_ARG2, ARGI_ARG2, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
+/* 17 */ ACPI_OP ("Arg3", ARGP_ARG3, ARGI_ARG3, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
+/* 18 */ ACPI_OP ("Arg4", ARGP_ARG4, ARGI_ARG4, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
+/* 19 */ ACPI_OP ("Arg5", ARGP_ARG5, ARGI_ARG5, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
+/* 1_a */ ACPI_OP ("Arg6", ARGP_ARG6, ARGI_ARG6, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
+/* 1_b */ ACPI_OP ("Store", ARGP_STORE_OP, ARGI_STORE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 1_c */ ACPI_OP ("Ref_of", ARGP_REF_OF_OP, ARGI_REF_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
+/* 1_d */ ACPI_OP ("Add", ARGP_ADD_OP, ARGI_ADD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH),
+/* 1_e */ ACPI_OP ("Concatenate", ARGP_CONCAT_OP, ARGI_CONCAT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R),
+/* 1_f */ ACPI_OP ("Subtract", ARGP_SUBTRACT_OP, ARGI_SUBTRACT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH),
+/* 20 */ ACPI_OP ("Increment", ARGP_INCREMENT_OP, ARGI_INCREMENT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
+/* 21 */ ACPI_OP ("Decrement", ARGP_DECREMENT_OP, ARGI_DECREMENT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
+/* 22 */ ACPI_OP ("Multiply", ARGP_MULTIPLY_OP, ARGI_MULTIPLY_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH),
+/* 23 */ ACPI_OP ("Divide", ARGP_DIVIDE_OP, ARGI_DIVIDE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_2T_1R, AML_FLAGS_EXEC_2A_2T_1R),
+/* 24 */ ACPI_OP ("Shift_left", ARGP_SHIFT_LEFT_OP, ARGI_SHIFT_LEFT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH),
+/* 25 */ ACPI_OP ("Shift_right", ARGP_SHIFT_RIGHT_OP, ARGI_SHIFT_RIGHT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH),
+/* 26 */ ACPI_OP ("And", ARGP_BIT_AND_OP, ARGI_BIT_AND_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH),
+/* 27 */ ACPI_OP ("NAnd", ARGP_BIT_NAND_OP, ARGI_BIT_NAND_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH),
+/* 28 */ ACPI_OP ("Or", ARGP_BIT_OR_OP, ARGI_BIT_OR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH),
+/* 29 */ ACPI_OP ("NOr", ARGP_BIT_NOR_OP, ARGI_BIT_NOR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH),
+/* 2_a */ ACPI_OP ("XOr", ARGP_BIT_XOR_OP, ARGI_BIT_XOR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH),
+/* 2_b */ ACPI_OP ("Not", ARGP_BIT_NOT_OP, ARGI_BIT_NOT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 2_c */ ACPI_OP ("Find_set_left_bit", ARGP_FIND_SET_LEFT_BIT_OP, ARGI_FIND_SET_LEFT_BIT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 2_d */ ACPI_OP ("Find_set_right_bit", ARGP_FIND_SET_RIGHT_BIT_OP,ARGI_FIND_SET_RIGHT_BIT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 2_e */ ACPI_OP ("Deref_of", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
+/* 2_f */ ACPI_OP ("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_0R, AML_FLAGS_EXEC_2A_0T_0R),
+/* 30 */ ACPI_OP ("Size_of", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
+/* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R),
+/* 32 */ ACPI_OP ("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R),
+/* 33 */ ACPI_OP ("Create_dWord_field", ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
+/* 34 */ ACPI_OP ("Create_word_field", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
+/* 35 */ ACPI_OP ("Create_byte_field", ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
+/* 36 */ ACPI_OP ("Create_bit_field", ARGP_CREATE_BIT_FIELD_OP, ARGI_CREATE_BIT_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
+/* 37 */ ACPI_OP ("Object_type", ARGP_TYPE_OP, ARGI_TYPE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
+/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL),
+/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL),
+/* 3_a */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
+/* 3_b */ ACPI_OP ("LEqual", ARGP_LEQUAL_OP, ARGI_LEQUAL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL),
+/* 3_c */ ACPI_OP ("LGreater", ARGP_LGREATER_OP, ARGI_LGREATER_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL),
+/* 3_d */ ACPI_OP ("LLess", ARGP_LLESS_OP, ARGI_LLESS_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL),
+/* 3_e */ ACPI_OP ("If", ARGP_IF_OP, ARGI_IF_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
+/* 3_f */ ACPI_OP ("Else", ARGP_ELSE_OP, ARGI_ELSE_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
+/* 40 */ ACPI_OP ("While", ARGP_WHILE_OP, ARGI_WHILE_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
+/* 41 */ ACPI_OP ("Noop", ARGP_NOOP_OP, ARGI_NOOP_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
+/* 42 */ ACPI_OP ("Return", ARGP_RETURN_OP, ARGI_RETURN_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
+/* 43 */ ACPI_OP ("Break", ARGP_BREAK_OP, ARGI_BREAK_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
+/* 44 */ ACPI_OP ("Break_point", ARGP_BREAK_POINT_OP, ARGI_BREAK_POINT_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
+/* 45 */ ACPI_OP ("Ones", ARGP_ONES_OP, ARGI_ONES_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0),
X
X /* Prefixed opcodes (Two-byte opcodes with a prefix op) */
X
-/* 46 */ ACPI_OP ("Mutex", ARGP_MUTEX_OP, ARGI_MUTEX_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED),
-/* 47 */ ACPI_OP ("Event", ARGP_EVENT_OP, ARGI_EVENT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_NO_ARGS |AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED ),
-/* 48 */ ACPI_OP ("Cond_ref_of", ARGP_COND_REF_OF_OP, ARGI_COND_REF_OF_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 49 */ ACPI_OP ("Create_field", ARGP_CREATE_FIELD_OP, ARGI_CREATE_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CREATE_FIELD| AML_HAS_ARGS|AML_NSOBJECT|AML_NSNODE|AML_DEFER|AML_FIELD|AML_CREATE),
-/* 4_a */ ACPI_OP ("Load", ARGP_LOAD_OP, ARGI_LOAD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_RECONFIGURATION| AML_HAS_ARGS),
-/* 4_b */ ACPI_OP ("Stall", ARGP_STALL_OP, ARGI_STALL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC1| AML_HAS_ARGS),
-/* 4_c */ ACPI_OP ("Sleep", ARGP_SLEEP_OP, ARGI_SLEEP_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC1| AML_HAS_ARGS),
-/* 4_d */ ACPI_OP ("Acquire", ARGP_ACQUIRE_OP, ARGI_ACQUIRE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_s| AML_HAS_ARGS),
-/* 4_e */ ACPI_OP ("Signal", ARGP_SIGNAL_OP, ARGI_SIGNAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC1| AML_HAS_ARGS),
-/* 4_f */ ACPI_OP ("Wait", ARGP_WAIT_OP, ARGI_WAIT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_s| AML_HAS_ARGS),
-/* 50 */ ACPI_OP ("Reset", ARGP_RESET_OP, ARGI_RESET_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC1| AML_HAS_ARGS),
-/* 51 */ ACPI_OP ("Release", ARGP_RELEASE_OP, ARGI_RELEASE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC1| AML_HAS_ARGS),
-/* 52 */ ACPI_OP ("From_bCD", ARGP_FROM_BCD_OP, ARGI_FROM_BCD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 53 */ ACPI_OP ("To_bCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 54 */ ACPI_OP ("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_RECONFIGURATION| AML_HAS_ARGS),
-/* 55 */ ACPI_OP ("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONSTANT| AML_NO_ARGS ),
-/* 56 */ ACPI_OP ("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONSTANT| AML_NO_ARGS ),
-/* 57 */ ACPI_OP ("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_TRIADIC| AML_HAS_ARGS),
-/* 58 */ ACPI_OP ("Op_region", ARGP_REGION_OP, ARGI_REGION_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED|AML_DEFER),
-/* 59 */ ACPI_OP ("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_FIELD),
-/* 5_a */ ACPI_OP ("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED),
-/* 5_b */ ACPI_OP ("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED),
-/* 5_c */ ACPI_OP ("Power_resource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED),
-/* 5_d */ ACPI_OP ("Thermal_zone", ARGP_THERMAL_ZONE_OP, ARGI_THERMAL_ZONE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED),
-/* 5_e */ ACPI_OP ("Index_field", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_FIELD),
-/* 5_f */ ACPI_OP ("Bank_field", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_FIELD),
+/* 46 */ ACPI_OP ("Mutex", ARGP_MUTEX_OP, ARGI_MUTEX_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
+/* 47 */ ACPI_OP ("Event", ARGP_EVENT_OP, ARGI_EVENT_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ),
+/* 48 */ ACPI_OP ("Cond_ref_of", ARGP_COND_REF_OF_OP, ARGI_COND_REF_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 49 */ ACPI_OP ("Create_field", ARGP_CREATE_FIELD_OP, ARGI_CREATE_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_FIELD | AML_CREATE),
+/* 4_a */ ACPI_OP ("Load", ARGP_LOAD_OP, ARGI_LOAD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_0R, AML_FLAGS_EXEC_1A_1T_0R),
+/* 4_b */ ACPI_OP ("Stall", ARGP_STALL_OP, ARGI_STALL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
+/* 4_c */ ACPI_OP ("Sleep", ARGP_SLEEP_OP, ARGI_SLEEP_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
+/* 4_d */ ACPI_OP ("Acquire", ARGP_ACQUIRE_OP, ARGI_ACQUIRE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R),
+/* 4_e */ ACPI_OP ("Signal", ARGP_SIGNAL_OP, ARGI_SIGNAL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
+/* 4_f */ ACPI_OP ("Wait", ARGP_WAIT_OP, ARGI_WAIT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R),
+/* 50 */ ACPI_OP ("Reset", ARGP_RESET_OP, ARGI_RESET_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
+/* 51 */ ACPI_OP ("Release", ARGP_RELEASE_OP, ARGI_RELEASE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
+/* 52 */ ACPI_OP ("From_bCD", ARGP_FROM_BCD_OP, ARGI_FROM_BCD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 53 */ ACPI_OP ("To_bCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 54 */ ACPI_OP ("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
+/* 55 */ ACPI_OP ("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0),
+/* 56 */ ACPI_OP ("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0),
+/* 57 */ ACPI_OP ("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R),
+/* 58 */ ACPI_OP ("Op_region", ARGP_REGION_OP, ARGI_REGION_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
+/* 59 */ ACPI_OP ("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
+/* 5_a */ ACPI_OP ("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
+/* 5_b */ ACPI_OP ("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
+/* 5_c */ ACPI_OP ("Power_resource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
+/* 5_d */ ACPI_OP ("Thermal_zone", ARGP_THERMAL_ZONE_OP, ARGI_THERMAL_ZONE_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
+/* 5_e */ ACPI_OP ("Index_field", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
+/* 5_f */ ACPI_OP ("Bank_field", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
X
X /* Internal opcodes that map to invalid AML opcodes */
X
-/* 60 */ ACPI_OP ("LNot_equal", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_HAS_ARGS),
-/* 61 */ ACPI_OP ("LLess_equal", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_HAS_ARGS),
-/* 62 */ ACPI_OP ("LGreater_equal", ARGP_LGREATEREQUAL_OP, ARGI_LGREATEREQUAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_HAS_ARGS),
-/* 63 */ ACPI_OP ("[Name_path]", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS|AML_NSOBJECT|AML_NSNODE ),
-/* 64 */ ACPI_OP ("[Method_call]", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_CALL| AML_HAS_ARGS|AML_NSOBJECT|AML_NSNODE),
-/* 65 */ ACPI_OP ("[Byte_list]", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ),
-/* 66 */ ACPI_OP ("[Reserved_field]", ARGP_RESERVEDFIELD_OP, ARGI_RESERVEDFIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_NO_ARGS ),
-/* 67 */ ACPI_OP ("[Named_field]", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_NO_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED ),
-/* 68 */ ACPI_OP ("[Access_field]", ARGP_ACCESSFIELD_OP, ARGI_ACCESSFIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_NO_ARGS ),
-/* 69 */ ACPI_OP ("[Static_string", ARGP_STATICSTRING_OP, ARGI_STATICSTRING_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_NO_ARGS ),
-/* 6_a */ ACPI_OP ("[Return Value]", ARG_NONE, ARG_NONE, ACPI_OP_TYPE_OPCODE | OPTYPE_RETURN| AML_HAS_ARGS),
-/* 6_b */ ACPI_OP ("UNKNOWN_OP!", ARG_NONE, ARG_NONE, ACPI_OP_TYPE_UNKNOWN | OPTYPE_BOGUS| AML_HAS_ARGS),
-/* 6_c */ ACPI_OP ("ASCII_ONLY!", ARG_NONE, ARG_NONE, ACPI_OP_TYPE_ASCII | OPTYPE_BOGUS| AML_HAS_ARGS),
-/* 6_d */ ACPI_OP ("PREFIX_ONLY!", ARG_NONE, ARG_NONE, ACPI_OP_TYPE_PREFIX | OPTYPE_BOGUS| AML_HAS_ARGS),
-
-
-/* ACPI 2.0 (new) opcodes */
-
-/* 6_e */ ACPI_OP ("Qword_const", ARGP_QWORD_OP, ARGI_QWORD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ),
-/* 6_f */ ACPI_OP ("Var_package", ARGP_VAR_PACKAGE_OP, ARGI_VAR_PACKAGE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DATA_TERM| AML_HAS_ARGS|AML_DEFER),
-/* 70 */ ACPI_OP ("Concat_res", ARGP_CONCAT_RES_OP, ARGI_CONCAT_RES_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 71 */ ACPI_OP ("Mod", ARGP_MOD_OP, ARGI_MOD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 72 */ ACPI_OP ("Create_qWord_field", ARGP_CREATE_QWORD_FIELD_OP,ARGI_CREATE_QWORD_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CREATE_FIELD| AML_HAS_ARGS|AML_NSOBJECT|AML_NSNODE|AML_DEFER|AML_CREATE),
-/* 73 */ ACPI_OP ("To_buffer", ARGP_TO_BUFFER_OP, ARGI_TO_BUFFER_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 74 */ ACPI_OP ("To_decimal_string", ARGP_TO_DEC_STR_OP, ARGI_TO_DEC_STR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 75 */ ACPI_OP ("To_hex_string", ARGP_TO_HEX_STR_OP, ARGI_TO_HEX_STR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 76 */ ACPI_OP ("To_integer", ARGP_TO_INTEGER_OP, ARGI_TO_INTEGER_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 77 */ ACPI_OP ("To_string", ARGP_TO_STRING_OP, ARGI_TO_STRING_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 78 */ ACPI_OP ("Copy_object", ARGP_COPY_OP, ARGI_COPY_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 7_a */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_NO_ARGS ),
-/* 7_b */ ACPI_OP ("Load_table", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 7_c */ ACPI_OP ("Data_op_region", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
+/* 60 */ ACPI_OP ("LNot_equal", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS),
+/* 61 */ ACPI_OP ("LLess_equal", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS),
+/* 62 */ ACPI_OP ("LGreater_equal", ARGP_LGREATEREQUAL_OP, ARGI_LGREATEREQUAL_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS),
+/* 63 */ ACPI_OP ("[Name_path]", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_NSOBJECT | AML_NSNODE ),
+/* 64 */ ACPI_OP ("[Method_call]", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP, AML_CLASS_METHOD_CALL, AML_TYPE_METHOD_CALL, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE),
+/* 65 */ ACPI_OP ("[Byte_list]", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
+/* 66 */ ACPI_OP ("[Reserved_field]", ARGP_RESERVEDFIELD_OP, ARGI_RESERVEDFIELD_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
+/* 67 */ ACPI_OP ("[Named_field]", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ),
+/* 68 */ ACPI_OP ("[Access_field]", ARGP_ACCESSFIELD_OP, ARGI_ACCESSFIELD_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
+/* 69 */ ACPI_OP ("[Static_string", ARGP_STATICSTRING_OP, ARGI_STATICSTRING_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
+/* 6_a */ ACPI_OP ("[Return Value]", ARG_NONE, ARG_NONE, AML_CLASS_RETURN_VALUE, AML_TYPE_RETURN, AML_HAS_ARGS | AML_HAS_RETVAL),
+/* 6_b */ ACPI_OP ("UNKNOWN_OP!", ARG_NONE, ARG_NONE, AML_CLASS_UNKNOWN, AML_TYPE_BOGUS, AML_HAS_ARGS),
+/* 6_c */ ACPI_OP ("ASCII_ONLY!", ARG_NONE, ARG_NONE, AML_CLASS_ASCII, AML_TYPE_BOGUS, AML_HAS_ARGS),
+/* 6_d */ ACPI_OP ("PREFIX_ONLY!", ARG_NONE, ARG_NONE, AML_CLASS_PREFIX, AML_TYPE_BOGUS, AML_HAS_ARGS),
+
+
+/* ACPI 2.0 opcodes */
+
+/* 6_e */ ACPI_OP ("Qword_const", ARGP_QWORD_OP, ARGI_QWORD_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
+/* 6_f */ ACPI_OP ("Var_package", ARGP_VAR_PACKAGE_OP, ARGI_VAR_PACKAGE_OP, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS | AML_DEFER),
+/* 70 */ ACPI_OP ("Concat_res", ARGP_CONCAT_RES_OP, ARGI_CONCAT_RES_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R),
+/* 71 */ ACPI_OP ("Mod", ARGP_MOD_OP, ARGI_MOD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R),
+/* 72 */ ACPI_OP ("Create_qWord_field", ARGP_CREATE_QWORD_FIELD_OP,ARGI_CREATE_QWORD_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
+/* 73 */ ACPI_OP ("To_buffer", ARGP_TO_BUFFER_OP, ARGI_TO_BUFFER_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 74 */ ACPI_OP ("To_decimal_string", ARGP_TO_DEC_STR_OP, ARGI_TO_DEC_STR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 75 */ ACPI_OP ("To_hex_string", ARGP_TO_HEX_STR_OP, ARGI_TO_HEX_STR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 76 */ ACPI_OP ("To_integer", ARGP_TO_INTEGER_OP, ARGI_TO_INTEGER_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 77 */ ACPI_OP ("To_string", ARGP_TO_STRING_OP, ARGI_TO_STRING_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R),
+/* 78 */ ACPI_OP ("Copy_object", ARGP_COPY_OP, ARGI_COPY_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
+/* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R, AML_FLAGS_EXEC_3A_1T_1R),
+/* 7_a */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
+/* 7_b */ ACPI_OP ("Load_table", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R),
+/* 7_c */ ACPI_OP ("Data_op_region", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
X
X };
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/parser/psparse.c linux/drivers/acpi/parser/psparse.c
--- v2.4.13/linux/drivers/acpi/parser/psparse.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/parser/psparse.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /******************************************************************************
X *
X * Module Name: psparse - Parser top level AML parse routines
- * $Revision: 96 $
+ * $Revision: 104 $


X *
X *****************************************************************************/
X

@@ -122,10 +122,8 @@
X /* Extended opcode */
X
X opcode = (u16) ((opcode << 8) | GET8 (aml));
- aml++;
X }
X
- /* don't convert bare name to a namepath */
X
X return (opcode);
X }
@@ -133,45 +131,6 @@


X
X /*******************************************************************************
X *

- * FUNCTION: Acpi_ps_create_state
- *
- * PARAMETERS: Aml - Aml code pointer
- * Aml_size - Length of AML code
- *
- * RETURN: A new parser state object
- *
- * DESCRIPTION: Create and initialize a new parser state object
- *
- ******************************************************************************/


-
-acpi_parse_state *
-acpi_ps_create_state (
- u8 *aml,
- u32 aml_size)

-{
- acpi_parse_state *parser_state;
-
-
- FUNCTION_TRACE ("Ps_create_state");
-
-
- parser_state = ACPI_MEM_CALLOCATE (sizeof (acpi_parse_state));
- if (!parser_state) {
- return_PTR (NULL);
- }
-
- parser_state->aml = aml;
- parser_state->aml_end = aml + aml_size;
- parser_state->pkg_end = parser_state->aml_end;
- parser_state->aml_start = aml;
-
-
- return_PTR (parser_state);
-}


-
-
-/*******************************************************************************
- *

X * FUNCTION: Acpi_ps_find_object
X *
X * PARAMETERS: Opcode - Current opcode
@@ -192,29 +151,25 @@
X
X acpi_status


X acpi_ps_find_object (
- u16 opcode,
- acpi_parse_object *op,
X acpi_walk_state *walk_state,
X acpi_parse_object **out_op)

X {


X NATIVE_CHAR *path;
- const acpi_opcode_info *op_info;

X
X

X /* We are only interested in opcodes that have an associated name */
X
- op_info = acpi_ps_get_opcode_info (opcode);
- if (!(op_info->flags & AML_NAMED)) {
- *out_op = op;

+ if (!(walk_state->op_info->flags & AML_NAMED)) {

+ *out_op = walk_state->op;
X return (AE_OK);
X }
X
X /* Find the name in the parse tree */


X
- path = acpi_ps_get_next_namestring (walk_state->parser_state);
+ path = acpi_ps_get_next_namestring (&walk_state->parser_state);
X

- *out_op = acpi_ps_find (acpi_ps_get_parent_scope (walk_state->parser_state),
- path, opcode, 1);
+ *out_op = acpi_ps_find (acpi_ps_get_parent_scope (&walk_state->parser_state),
+ path, walk_state->opcode, 1);
X
X if (!(*out_op)) {
X return (AE_NOT_FOUND);
@@ -247,28 +202,17 @@
X #ifndef PARSER_ONLY
X acpi_parse_object *prev;
X acpi_parse_object *next;
- const acpi_opcode_info *op_info;
X const acpi_opcode_info *parent_info;
- u32 opcode_class;
X acpi_parse_object *replacement_op = NULL;
X
X
X FUNCTION_TRACE_PTR ("Ps_complete_this_op", op);
X

X
- op_info = acpi_ps_get_opcode_info (op->opcode);

- opcode_class = ACPI_GET_OP_CLASS (op_info);
-
-
X /* Delete this op and the subtree below it if asked to */
X
X if (((walk_state->parse_flags & ACPI_PARSE_TREE_MASK) == ACPI_PARSE_DELETE_TREE) &&
- (opcode_class != OPTYPE_CONSTANT) &&
- (opcode_class != OPTYPE_LITERAL) &&
- (opcode_class != OPTYPE_LOCAL_VARIABLE) &&
- (opcode_class != OPTYPE_METHOD_ARGUMENT) &&
- (opcode_class != OPTYPE_DATA_TERM) &&
- (op->opcode != AML_INT_NAMEPATH_OP)) {
+ (walk_state->op_info->class != AML_CLASS_ARGUMENT)) {
X /* Make sure that we only delete this subtree */
X
X if (op->parent) {
@@ -278,11 +222,12 @@
X */


X parent_info = acpi_ps_get_opcode_info (op->parent->opcode);

X
- switch (ACPI_GET_OP_CLASS (parent_info)) {


- case OPTYPE_CONTROL: /* IF, ELSE, WHILE only */

+ switch (parent_info->class) {


+ case AML_CLASS_CONTROL: /* IF, ELSE, WHILE only */

X break;
X

- case OPTYPE_NAMED_OBJECT: /* Scope, method, etc. */
+ case AML_CLASS_NAMED_OBJECT: /* Scope, method, etc. */
+ case AML_CLASS_CREATE:

X
X /*
X * These opcodes contain Term_arg operands. The current
@@ -385,7 +330,7 @@
X acpi_parse_object *op,
X acpi_status callback_status)
X {
- acpi_parse_state *parser_state = walk_state->parser_state;


+ acpi_parse_state *parser_state = &walk_state->parser_state;

X acpi_status status = AE_CTRL_PENDING;
X u8 *start;
X u32 package_length;
@@ -500,13 +445,7 @@


X {
X acpi_status status = AE_OK;

X acpi_parse_object *op = NULL; /* current op */
- const acpi_opcode_info *op_info;
X acpi_parse_object *arg = NULL;
- acpi_parse2_object *deferred_op;
- u32 arg_count; /* push for fixed or var args */
- u32 arg_types = 0;
- u32 aml_offset;
- u16 opcode;
X acpi_parse_object pre_op;
X acpi_parse_state *parser_state;
X u8 *aml_op_start;
@@ -515,7 +454,8 @@
X FUNCTION_TRACE_PTR ("Ps_parse_loop", walk_state);
X
X
- parser_state = walk_state->parser_state;
+ parser_state = &walk_state->parser_state;
+ walk_state->arg_types = 0;
X
X #ifndef PARSER_ONLY
X if (walk_state->walk_type & WALK_METHOD_RESTART) {
@@ -527,7 +467,7 @@
X * was just completed
X */
X if ((parser_state->scope->parse_scope.op) &&
- ((parser_state->scope->parse_scope.op->opcode == AML_IF_OP) ||
+ ((parser_state->scope->parse_scope.op->opcode == AML_IF_OP) ||
X (parser_state->scope->parse_scope.op->opcode == AML_WHILE_OP)) &&
X (walk_state->control_state) &&


X (walk_state->control_state->common.state ==

@@ -537,7 +477,8 @@
X * A predicate was just completed, get the value of the
X * predicate and branch based on that value
X */
- status = acpi_ds_get_predicate_value (walk_state, NULL, TRUE);
+ walk_state->op = NULL;
+ status = acpi_ds_get_predicate_value (walk_state, TRUE);
X if (ACPI_FAILURE (status) &&
X ((status & AE_CODE_MASK) != AE_CODE_CONTROL)) {
X if (status == AE_AML_NO_RETURN_VALUE) {
@@ -554,7 +495,7 @@
X status = acpi_ps_next_parse_state (walk_state, op, status);
X }
X
- acpi_ps_pop_scope (parser_state, &op, &arg_types, &arg_count);
+ acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count);
X ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p\n", op));
X }
X
@@ -562,7 +503,7 @@
X /* We were in the middle of an op */
X
X op = walk_state->prev_op;
- arg_types = walk_state->prev_arg_types;
+ walk_state->arg_types = walk_state->prev_arg_types;
X }
X }
X #endif
@@ -575,8 +516,8 @@
X /* Get the next opcode from the AML stream */
X
X aml_op_start = parser_state->aml;
- aml_offset = parser_state->aml - parser_state->aml_start;
- opcode = acpi_ps_peek_opcode (parser_state);
+ walk_state->aml_offset = parser_state->aml - parser_state->aml_start;
+ walk_state->opcode = acpi_ps_peek_opcode (parser_state);
X
X /*
X * First cut to determine what we have found:
@@ -584,33 +525,25 @@
X * 2) A name string
X * 3) An unknown/invalid opcode
X */
- op_info = acpi_ps_get_opcode_info (opcode);
- switch (ACPI_GET_OP_TYPE (op_info)) {
- case ACPI_OP_TYPE_OPCODE:
-
- /* Found opcode info, this is a normal opcode */
-
- parser_state->aml += acpi_ps_get_opcode_size (opcode);
- arg_types = op_info->parse_args;
- break;
-
- case ACPI_OP_TYPE_ASCII:
- case ACPI_OP_TYPE_PREFIX:
+ walk_state->op_info = acpi_ps_get_opcode_info (walk_state->opcode);
+ switch (walk_state->op_info->class) {
+ case AML_CLASS_ASCII:
+ case AML_CLASS_PREFIX:
X /*
X * Starts with a valid prefix or ASCII char, this is a name
X * string. Convert the bare name string to a namepath.
X */
- opcode = AML_INT_NAMEPATH_OP;
- arg_types = ARGP_NAMESTRING;
+ walk_state->opcode = AML_INT_NAMEPATH_OP;
+ walk_state->arg_types = ARGP_NAMESTRING;
X break;
X
- case ACPI_OP_TYPE_UNKNOWN:
+ case AML_CLASS_UNKNOWN:
X
X /* The opcode is unrecognized. Just skip unknown opcodes */
X
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Found unknown opcode %lX at AML offset %X, ignoring\n",
- opcode, aml_offset));
+ "Found unknown opcode %X at AML offset %X, ignoring\n",
+ walk_state->opcode, walk_state->aml_offset));
X
X DUMP_BUFFER (parser_state->aml, 128);
X
@@ -618,34 +551,54 @@
X
X parser_state->aml++;
X continue;
+
+ default:
+
+ /* Found opcode info, this is a normal opcode */
+
+ parser_state->aml += acpi_ps_get_opcode_size (walk_state->opcode);
+ walk_state->arg_types = walk_state->op_info->parse_args;


+ break;
+
X }
X

X
X /* Create Op structure and append to parent's argument list */
X
- if (op_info->flags & AML_NAMED) {
+ if (walk_state->op_info->flags & AML_NAMED) {
X pre_op.value.arg = NULL;
- pre_op.opcode = opcode;
+ pre_op.opcode = walk_state->opcode;
X
- while (GET_CURRENT_ARG_TYPE (arg_types) != ARGP_NAME) {
+ while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) != ARGP_NAME) {
X arg = acpi_ps_get_next_arg (parser_state,
- GET_CURRENT_ARG_TYPE (arg_types),
- &arg_count);
+ GET_CURRENT_ARG_TYPE (walk_state->arg_types),
+ &walk_state->arg_count);
X acpi_ps_append_arg (&pre_op, arg);
- INCREMENT_ARG_LIST (arg_types);
+ INCREMENT_ARG_LIST (walk_state->arg_types);
X }
X
X
X /* We know that this arg is a name, move to next arg */
X
- INCREMENT_ARG_LIST (arg_types);
+ INCREMENT_ARG_LIST (walk_state->arg_types);
X
X if (walk_state->descending_callback != NULL) {
X /*
X * Find the object. This will either insert the object into
X * the namespace or simply look it up
X */
- status = walk_state->descending_callback (opcode, NULL, walk_state, &op);
+ walk_state->op = NULL;
+
+ status = walk_state->descending_callback (walk_state, &op);
+
+ /* TBD: check status here? */
+
+ if (ACPI_FAILURE (status)) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "During name lookup/catalog, %s\n",
+ acpi_format_exception (status)));
+ goto close_this_op;
+ }
+
X if (op == NULL) {
X continue;
X }
@@ -665,8 +618,6 @@
X
X
X if (op->opcode == AML_REGION_OP) {
- deferred_op = (acpi_parse2_object *) op;
-
X /*
X * Defer final parsing of an Operation_region body,
X * because we don't have enough info in the first pass
@@ -679,8 +630,8 @@
X *
X * (Length is unknown until parse of the body complete)
X */
- deferred_op->data = aml_op_start;
- deferred_op->length = 0;
+ ((acpi_parse2_object * ) op)->data = aml_op_start;
+ ((acpi_parse2_object * ) op)->length = 0;
X }
X }
X
@@ -688,22 +639,20 @@
X else {
X /* Not a named opcode, just allocate Op and append to parent */
X
- op_info = acpi_ps_get_opcode_info (opcode);


- op = acpi_ps_alloc_op (opcode);

+ walk_state->op_info = acpi_ps_get_opcode_info (walk_state->opcode);


+ op = acpi_ps_alloc_op (walk_state->opcode);
X if (!op) {

X return_ACPI_STATUS (AE_NO_MEMORY);
X }
X

X
- if (op_info->flags & AML_CREATE) {
+ if (walk_state->op_info->flags & AML_CREATE) {
X /*
X * Backup to beginning of Create_xXXfield declaration
X * Body_length is unknown until we parse the body
X */
- deferred_op = (acpi_parse2_object *) op;
-
- deferred_op->data = aml_op_start;
- deferred_op->length = 0;
+ ((acpi_parse2_object * ) op)->data = aml_op_start;
+ ((acpi_parse2_object * ) op)->length = 0;
X }
X
X acpi_ps_append_arg (acpi_ps_get_parent_scope (parser_state), op);
@@ -713,7 +662,9 @@
X * Find the object. This will either insert the object into
X * the namespace or simply look it up
X */
- status = walk_state->descending_callback (opcode, op, walk_state, &op);


+ walk_state->op = op;
+

+ status = walk_state->descending_callback (walk_state, &op);
X status = acpi_ps_next_parse_state (walk_state, op, status);
X if (status == AE_CTRL_PENDING) {
X status = AE_OK;
@@ -726,11 +677,11 @@
X }
X }
X
- op->aml_offset = aml_offset;
+ op->aml_offset = walk_state->aml_offset;
X
- if (op_info) {
+ if (walk_state->op_info) {
X ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
- "Op=%p Opcode=%4.4lX Aml %p Oft=%5.5lX\n",
+ "Op=%p Opcode=%4.4X Aml %p Oft=%5.5X\n",
X op, op->opcode, parser_state->aml, op->aml_offset));
X }
X }
@@ -738,10 +689,10 @@
X
X /* Start Arg_count at zero because we don't know if there are any args yet */
X
- arg_count = 0;
+ walk_state->arg_count = 0;
X
X
- if (arg_types) /* Are there any arguments that must be processed? */ {
+ if (walk_state->arg_types) /* Are there any arguments that must be processed? */ {
X /* get arguments */
X
X switch (op->opcode) {
@@ -754,13 +705,13 @@
X /* fill in constant or string argument directly */
X
X acpi_ps_get_next_simple_arg (parser_state,
- GET_CURRENT_ARG_TYPE (arg_types), op);
+ GET_CURRENT_ARG_TYPE (walk_state->arg_types), op);
X break;
X
X case AML_INT_NAMEPATH_OP: /* AML_NAMESTRING_ARG */
X
- acpi_ps_get_next_namepath (parser_state, op, &arg_count, 1);
- arg_types = 0;
+ acpi_ps_get_next_namepath (parser_state, op, &walk_state->arg_count, 1);
+ walk_state->arg_types = 0;
X break;
X
X
@@ -768,32 +719,30 @@
X
X /* Op is not a constant or string, append each argument */
X
- while (GET_CURRENT_ARG_TYPE (arg_types) && !arg_count) {
- aml_offset = parser_state->aml - parser_state->aml_start;
+ while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) && !walk_state->arg_count) {
+ walk_state->aml_offset = parser_state->aml - parser_state->aml_start;
X arg = acpi_ps_get_next_arg (parser_state,
- GET_CURRENT_ARG_TYPE (arg_types),
- &arg_count);
+ GET_CURRENT_ARG_TYPE (walk_state->arg_types),
+ &walk_state->arg_count);
X if (arg) {
- arg->aml_offset = aml_offset;
+ arg->aml_offset = walk_state->aml_offset;
X acpi_ps_append_arg (op, arg);
X }
X
- INCREMENT_ARG_LIST (arg_types);
+ INCREMENT_ARG_LIST (walk_state->arg_types);
X }
X
X
X /* For a method, save the length and address of the body */
X
X if (op->opcode == AML_METHOD_OP) {
- deferred_op = (acpi_parse2_object *) op;
-
X /*
X * Skip parsing of control method or opregion body,
X * because we don't have enough info in the first pass
X * to parse them correctly.
X */
- deferred_op->data = parser_state->aml;
- deferred_op->length = (u32) (parser_state->pkg_end -
+ ((acpi_parse2_object * ) op)->data = parser_state->aml;
+ ((acpi_parse2_object * ) op)->length = (u32) (parser_state->pkg_end -
X parser_state->aml);
X
X /*
@@ -802,7 +751,7 @@
X * package (We don't know where the end is).
X */
X parser_state->aml = parser_state->pkg_end;
- arg_count = 0;
+ walk_state->arg_count = 0;
X }
X
X break;
@@ -813,18 +762,16 @@
X /*
X * Zero Arg_count means that all arguments for this op have been processed
X */
- if (!arg_count) {
+ if (!walk_state->arg_count) {
X /* completed Op, prepare for next */


X
- op_info = acpi_ps_get_opcode_info (op->opcode);

- if (op_info->flags & AML_NAMED) {
+ walk_state->op_info = acpi_ps_get_opcode_info (op->opcode);
+ if (walk_state->op_info->flags & AML_NAMED) {
X if (acpi_gbl_depth) {
X acpi_gbl_depth--;
X }
X
X if (op->opcode == AML_REGION_OP) {
- deferred_op = (acpi_parse2_object *) op;
-
X /*
X * Skip parsing of control method or opregion body,
X * because we don't have enough info in the first pass
@@ -833,27 +780,29 @@
X * Completed parsing an Op_region declaration, we now
X * know the length.
X */
- deferred_op->length = (u32) (parser_state->aml -
- deferred_op->data);
+ ((acpi_parse2_object * ) op)->length = (u32) (parser_state->aml -
+ ((acpi_parse2_object * ) op)->data);
X }
X }
X
- if (op_info->flags & AML_CREATE) {
+ if (walk_state->op_info->flags & AML_CREATE) {
X /*
X * Backup to beginning of Create_xXXfield declaration (1 for
X * Opcode)
X *
X * Body_length is unknown until we parse the body
X */
- deferred_op = (acpi_parse2_object *) op;
- deferred_op->length = (u32) (parser_state->aml -
- deferred_op->data);
+ ((acpi_parse2_object * ) op)->length = (u32) (parser_state->aml -
+ ((acpi_parse2_object * ) op)->data);
X }
X
X /* This op complete, notify the dispatcher */
X
X if (walk_state->ascending_callback != NULL) {
- status = walk_state->ascending_callback (walk_state, op);


+ walk_state->op = op;

+ walk_state->opcode = op->opcode;
+
+ status = walk_state->ascending_callback (walk_state);
X status = acpi_ps_next_parse_state (walk_state, op, status);
X if (status == AE_CTRL_PENDING) {
X status = AE_OK;
@@ -887,16 +836,20 @@
X * We are about to transfer to a called method.
X */
X walk_state->prev_op = op;
- walk_state->prev_arg_types = arg_types;
+ walk_state->prev_arg_types = walk_state->arg_types;
X return_ACPI_STATUS (status);
X break;
X
X
X case AE_CTRL_END:
X
- acpi_ps_pop_scope (parser_state, &op, &arg_types, &arg_count);
+ acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count);
+


+ walk_state->op = op;
+ walk_state->op_info = acpi_ps_get_opcode_info (op->opcode);
+ walk_state->opcode = op->opcode;
X

- status = walk_state->ascending_callback (walk_state, op);
+ status = walk_state->ascending_callback (walk_state);
X status = acpi_ps_next_parse_state (walk_state, op, status);
X
X acpi_ps_complete_this_op (walk_state, op);
@@ -915,7 +868,7 @@
X acpi_ps_complete_this_op (walk_state, op);
X }
X
- acpi_ps_pop_scope (parser_state, &op, &arg_types, &arg_count);
+ acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count);
X } while (op);
X
X return_ACPI_STATUS (status);
@@ -925,10 +878,10 @@
X default: /* All other non-AE_OK status */
X
X if (op == NULL) {
- acpi_ps_pop_scope (parser_state, &op, &arg_types, &arg_count);
+ acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count);
X }
X walk_state->prev_op = op;
- walk_state->prev_arg_types = arg_types;
+ walk_state->prev_arg_types = walk_state->arg_types;
X
X /*
X * TEMP:
@@ -941,7 +894,7 @@
X /* This scope complete? */
X
X if (acpi_ps_has_completed_scope (parser_state)) {
- acpi_ps_pop_scope (parser_state, &op, &arg_types, &arg_count);
+ acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count);
X ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p\n", op));
X }
X
@@ -957,7 +910,7 @@
X else {
X /* complex argument, push Op and prepare for argument */
X
- acpi_ps_push_scope (parser_state, op, arg_types, arg_count);
+ acpi_ps_push_scope (parser_state, op, walk_state->arg_types, walk_state->arg_count);
X op = NULL;
X }
X
@@ -967,14 +920,18 @@
X /*
X * Complete the last Op (if not completed), and clear the scope stack.
X * It is easily possible to end an AML "package" with an unbounded number
- * of open scopes (such as when several AML blocks are closed with
+ * of open scopes (such as when several ASL blocks are closed with
X * sequential closing braces). We want to terminate each one cleanly.
X */
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Package complete at Op %p\n", op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "AML package complete at Op %p\n", op));
X do {
X if (op) {
X if (walk_state->ascending_callback != NULL) {
- status = walk_state->ascending_callback (walk_state, op);


+ walk_state->op = op;
+ walk_state->op_info = acpi_ps_get_opcode_info (op->opcode);
+ walk_state->opcode = op->opcode;

+
+ status = walk_state->ascending_callback (walk_state);
X status = acpi_ps_next_parse_state (walk_state, op, status);
X if (status == AE_CTRL_PENDING) {
X status = AE_OK;
@@ -990,7 +947,7 @@
X acpi_ps_complete_this_op (walk_state, op);
X }
X
- acpi_ps_pop_scope (parser_state, &op, &arg_types, &arg_count);
+ acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count);
X
X } while (op);
X
@@ -1006,7 +963,7 @@
X acpi_ps_complete_this_op (walk_state, op);
X }
X
- acpi_ps_pop_scope (parser_state, &op, &arg_types, &arg_count);
+ acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types, &walk_state->arg_count);
X
X } while (op);
X
@@ -1032,101 +989,34 @@
X
X acpi_status


X acpi_ps_parse_aml (
- acpi_parse_object *start_scope,
- u8 *aml,
- u32 aml_size,
- u32 parse_flags,
- acpi_namespace_node *method_node,
- acpi_operand_object **params,
- acpi_operand_object **caller_return_desc,
- acpi_parse_downwards descending_callback,
- acpi_parse_upwards ascending_callback)
+ acpi_walk_state *walk_state)

X {
X acpi_status status;
- acpi_parse_state *parser_state;
- acpi_walk_state *walk_state;
X acpi_walk_list walk_list;
X acpi_walk_list *prev_walk_list = acpi_gbl_current_walk_list;
- acpi_operand_object *return_desc;
- acpi_operand_object *mth_desc = NULL;
+ acpi_walk_state *previous_walk_state;
X
X
X FUNCTION_TRACE ("Ps_parse_aml");
X
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Entered with Scope=%p Aml=%p size=%lX\n",
- start_scope, aml, aml_size));
-
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Entered with Walk_state=%p Aml=%p size=%X\n",
+ walk_state, walk_state->parser_state.aml, walk_state->parser_state.aml_size));


X
- /* Create and initialize a new parser state */
-

- parser_state = acpi_ps_create_state (aml, aml_size);
- if (!parser_state) {


- return_ACPI_STATUS (AE_NO_MEMORY);
- }
-

- acpi_ps_init_scope (parser_state, start_scope);
-
- if (method_node) {
- mth_desc = acpi_ns_get_attached_object (method_node);
- }
X
X /* Create and initialize a new walk list */
X
- walk_list.walk_state = NULL;
+ walk_list.walk_state = NULL;
X walk_list.acquired_mutex_list.prev = NULL;
X walk_list.acquired_mutex_list.next = NULL;
X
- walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, parser_state->start_op,
- mth_desc, &walk_list);
- if (!walk_state) {


- status = AE_NO_MEMORY;
- goto cleanup;
- }

+ walk_state->walk_list = &walk_list;
+ acpi_ds_push_walk_state (walk_state, &walk_list);
X
- walk_state->method_node = method_node;
- walk_state->parser_state = parser_state;
- walk_state->parse_flags = parse_flags;
- walk_state->descending_callback = descending_callback;
- walk_state->ascending_callback = ascending_callback;
X
X /* TBD: [Restructure] TEMP until we pass Walk_state to the interpreter
X */
X acpi_gbl_current_walk_list = &walk_list;
X
-
- if (method_node) {


- parser_state->start_node = method_node;

- walk_state->walk_type = WALK_METHOD;
-
- /* Push start scope on scope stack and make it current */
-
- status = acpi_ds_scope_stack_push (method_node, ACPI_TYPE_METHOD, walk_state);


- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

- /* Init arguments if this is a control method */
- /* TBD: [Restructure] add walkstate as a param */
-
- acpi_ds_method_data_init_args (params, MTH_NUM_ARGS, walk_state);
- }
-
- else {
- /* Setup the current scope */
-
- parser_state->start_node = parser_state->start_op->node;
- if (parser_state->start_node) {
- /* Push start scope on scope stack and make it current */
-
- status = acpi_ds_scope_stack_push (parser_state->start_node,
- parser_state->start_node->type, walk_state);
- if (ACPI_FAILURE (status)) {


- goto cleanup;
- }
-
- }
- }

-
X /*
X * Execute the walk loop as long as there is a valid Walk State. This
X * handles nested control method invocations without recursion.
@@ -1136,6 +1026,10 @@
X status = AE_OK;
X while (walk_state) {
X if (ACPI_SUCCESS (status)) {
+ /*
+ * The Parse_loop executes AML until the method terminates
+ * or calls another method.
+ */
X status = acpi_ps_parse_loop (walk_state);
X }
X
@@ -1165,13 +1059,6 @@
X
X walk_state = acpi_ds_pop_walk_state (&walk_list);
X
- /* Extract return value before we delete Walk_state */
-
- return_desc = walk_state->return_desc;
-
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Return_value=%p, State=%p\n",
- walk_state->return_desc, walk_state));
-
X /* Reset the current scope to the beginning of scope stack */
X
X acpi_ds_scope_stack_clear (walk_state);
@@ -1186,38 +1073,44 @@
X
X /* Delete this walk state and all linked control states */
X
- acpi_ps_cleanup_scope (walk_state->parser_state);
- ACPI_MEM_FREE (walk_state->parser_state);
- acpi_ds_delete_walk_state (walk_state);
+ acpi_ps_cleanup_scope (&walk_state->parser_state);
+
+ previous_walk_state = walk_state;
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Return_value=%p, State=%p\n",
+ walk_state->return_desc, walk_state));
X
X /* Check if we have restarted a preempted walk */
X
X walk_state = acpi_ds_get_current_walk_state (&walk_list);
- if (walk_state &&
- ACPI_SUCCESS (status)) {
- /* There is another walk state, restart it */
+ if (walk_state) {
+ if (ACPI_SUCCESS (status)) {
+ /* There is another walk state, restart it */
X
- /*
- * If the method returned value is not used by the parent,
- * The object is deleted
- */
- acpi_ds_restart_control_method (walk_state, return_desc);
- walk_state->walk_type |= WALK_METHOD_RESTART;
+ /*
+ * If the method returned value is not used by the parent,
+ * The object is deleted
+ */
+ acpi_ds_restart_control_method (walk_state, previous_walk_state->return_desc);
+ walk_state->walk_type |= WALK_METHOD_RESTART;
+ }
X }
X
X /*
X * Just completed a 1st-level method, save the final internal return
X * value (if any)
X */
- else if (caller_return_desc) {
- *caller_return_desc = return_desc; /* NULL if no return value */
+ else if (previous_walk_state->caller_return_desc) {
+ *(previous_walk_state->caller_return_desc) = previous_walk_state->return_desc; /* NULL if no return value */
X }
X
- else if (return_desc) {
+ else if (previous_walk_state->return_desc) {
X /* Caller doesn't want it, must delete it */
X
- acpi_ut_remove_reference (return_desc);
+ acpi_ut_remove_reference (previous_walk_state->return_desc);
X }
+
+ acpi_ds_delete_walk_state (previous_walk_state);
X }
X
X
@@ -1225,20 +1118,6 @@
X
X acpi_ex_release_all_mutexes ((acpi_operand_object *) &walk_list.acquired_mutex_list);
X acpi_gbl_current_walk_list = prev_walk_list;


- return_ACPI_STATUS (status);
-
-

-cleanup:
-
- /* Cleanup */
-
- acpi_ds_delete_walk_state (walk_state);
- acpi_ps_cleanup_scope (parser_state);
- ACPI_MEM_FREE (parser_state);
-
- acpi_ex_release_all_mutexes ((acpi_operand_object *)&walk_list.acquired_mutex_list);
- acpi_gbl_current_walk_list = prev_walk_list;
-
X return_ACPI_STATUS (status);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/parser/psscope.c linux/drivers/acpi/parser/psscope.c


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 23'
echo 'File patch-2.4.14 is continued in part 24'
echo "24" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:56 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part33

#!/bin/sh -x
# this is part 33 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 33; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&
+ }

+
+ active = 0;


+
+ for (i=0;i<socket_count;i++) {

+ int csc;
+ if (sockets[i].card_state==0) /* Inactive socket, should not happen */
+ continue;
+
+ csc = indirect_read(i,I365_CSC); /* card status change register */
+
+ if ((csc==0) || /* no events on this socket */
+ (sockets[i].handler==NULL)) /* no way to handle events */
+ continue;
+ events = 0;
+
+ if (csc & I365_CSC_DETECT) {
+ events |= SS_DETECT;
+ printk("Card detected in socket %i!\n",i);
+ }
+
+ if (indirect_read(i,I365_INTCTL) & I365_PC_IOCARD) {
+ /* For IO/CARDS, bit 0 means "read the card" */
+ events |= (csc & I365_CSC_STSCHG) ? SS_STSCHG : 0;
+ } else {
+ /* Check for battery/ready events */
+ events |= (csc & I365_CSC_BVD1) ? SS_BATDEAD : 0;
+ events |= (csc & I365_CSC_BVD2) ? SS_BATWARN : 0;
+ events |= (csc & I365_CSC_READY) ? SS_READY : 0;
+ }
+
+ if (events) {
+ sockets[i].pending_events |= events;
+ schedule_task(&i82092aa_task);
+ }
+ active |= events;
+ }
+
+ if (active==0) /* no more events to handle */


+ break;
+
+ }
+

+/* leave("i82092aa_interrupt");*/
+}
+
+
+
+/* socket functions */
+
+static int card_present(int socketno)
+{
+ unsigned int val;
+ enter("card_present");
+
+ if ((socketno<0) || (socketno > MAX_SOCKETS))
+ return 0;
+ if (sockets[socketno].io_base == 0)


+ return 0;
+
+

+ val = indirect_read(socketno, 1); /* Interface status register */
+ if ((val&12)==12) {
+ leave("card_present 1");


+ return 1;
+ }
+

+ leave("card_present 0");


+ return 0;
+}
+

+static void set_bridge_state(int sock)
+{
+ enter("set_bridge_state");
+ indirect_write(sock, I365_GBLCTL,0x00);
+ indirect_write(sock, I365_GENCTL,0x00);
+
+ indirect_setbit(sock, I365_INTCTL,0x08);
+ leave("set_bridge_state");
+}
+
+
+
+
+
+
+static int i82092aa_init(unsigned int s)
+{
+ int i;
+ pccard_io_map io = { 0, 0, 0, 0, 1 };
+ pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 };
+
+ enter("i82092aa_init");
+
+ mem.sys_stop = 0x0fff;
+ i82092aa_set_socket(s, &dead_socket);
+ for (i = 0; i < 2; i++) {
+ io.map = i;
+ i82092aa_set_io_map(s, &io);
+ }
+ for (i = 0; i < 5; i++) {
+ mem.map = i;
+ i82092aa_set_mem_map(s, &mem);
+ }
+
+ leave("i82092aa_init");


+ return 0;
+}
+

+static int i82092aa_suspend(unsigned int sock)
+{
+ int retval;
+ enter("i82092aa_suspend");
+ retval = i82092aa_set_socket(sock, &dead_socket);
+ leave("i82092aa_suspend");


+ return retval;
+}
+

+static int i82092aa_register_callback(unsigned int sock, void (*handler)(void *, unsigned int), void * info)
+{
+ enter("i82092aa_register_callback");
+ sockets[sock].handler = handler;
+ sockets[sock].info = info;
+ if (handler == NULL) {
+ MOD_DEC_USE_COUNT;
+ } else {
+ MOD_INC_USE_COUNT;
+ }
+ leave("i82092aa_register_callback");
+ return 0;
+} /* i82092aa_register_callback */
+
+static int i82092aa_inquire_socket(unsigned int sock, socket_cap_t *cap)
+{
+ enter("i82092aa_inquire_socket");
+ *cap = sockets[sock].cap;
+ leave("i82092aa_inquire_socket");
+ return 0;
+} /* i82092aa_inquire_socket */
+
+
+static int i82092aa_get_status(unsigned int sock, u_int *value)
+{
+ unsigned int status;
+
+ enter("i82092aa_get_status");
+
+ status = indirect_read(sock,I365_STATUS); /* Interface Status Register */
+ *value = 0;
+
+ if ((status & I365_CS_DETECT) == I365_CS_DETECT) {
+ *value |= SS_DETECT;
+ }
+
+ /* IO cards have a different meaning of bits 0,1 */
+ /* Also notice the inverse-logic on the bits */
+ if (indirect_read(sock, I365_INTCTL) & I365_PC_IOCARD) {
+ /* IO card */
+ if (!(status & I365_CS_STSCHG))
+ *value |= SS_STSCHG;
+ } else { /* non I/O card */
+ if (!(status & I365_CS_BVD1))
+ *value |= SS_BATDEAD;
+ if (!(status & I365_CS_BVD2))
+ *value |= SS_BATWARN;
+
+ }
+
+ if (status & I365_CS_WRPROT)
+ (*value) |= SS_WRPROT; /* card is write protected */
+
+ if (status & I365_CS_READY)
+ (*value) |= SS_READY; /* card is not busy */
+
+ if (status & I365_CS_POWERON)
+ (*value) |= SS_POWERON; /* power is applied to the card */
+
+
+ leave("i82092aa_get_status");


+ return 0;
+}
+
+

+static int i82092aa_get_socket(unsigned int sock, socket_state_t *state)
+{
+ unsigned char reg,vcc,vpp;
+
+ enter("i82092aa_get_socket");
+ state->flags = 0;
+ state->Vcc = 0;
+ state->Vpp = 0;
+ state->io_irq = 0;
+ state->csc_mask = 0;
+
+ /* First the power status of the socket */
+ reg = indirect_read(sock,I365_POWER); /* PCTRL - Power Control Register */
+
+ if (reg & I365_PWR_AUTO)
+ state->flags |= SS_PWR_AUTO; /* Automatic Power Switch */
+
+ if (reg & I365_PWR_OUT)
+ state->flags |= SS_OUTPUT_ENA; /* Output signals are enabled */
+
+ vcc = reg & I365_VCC_MASK; vpp = reg & I365_VPP1_MASK;
+
+ if (reg & I365_VCC_5V) { /* Can still be 3.3V, in this case the Vcc value will be overwritten later */
+ state->Vcc = 50;
+
+ if (vpp == I365_VPP1_5V)
+ state->Vpp = 50;
+ if (vpp == I365_VPP1_12V)
+ state->Vpp = 120;
+
+ }
+
+ if ((reg & I365_VCC_3V)==I365_VCC_3V)
+ state->Vcc = 33;
+
+
+ /* Now the IO card, RESET flags and IO interrupt */
+
+ reg = indirect_read(sock, I365_INTCTL); /* IGENC, Interrupt and General Control */
+
+ if ((reg & I365_PC_RESET)==0)
+ state->flags |= SS_RESET;
+ if (reg & I365_PC_IOCARD)
+ state->flags |= SS_IOCARD; /* This is an IO card */
+
+ /* Set the IRQ number */
+ if (sockets[sock].dev!=NULL)
+ state->io_irq = sockets[sock].dev->irq;
+
+ /* Card status change */
+ reg = indirect_read(sock, I365_CSCINT); /* CSCICR, Card Status Change Interrupt Configuration */
+
+ if (reg & I365_CSC_DETECT)
+ state->csc_mask |= SS_DETECT; /* Card detect is enabled */
+
+ if (state->flags & SS_IOCARD) {/* IO Cards behave different */
+ if (reg & I365_CSC_STSCHG)
+ state->csc_mask |= SS_STSCHG;
+ } else {
+ if (reg & I365_CSC_BVD1)
+ state->csc_mask |= SS_BATDEAD;
+ if (reg & I365_CSC_BVD2)
+ state->csc_mask |= SS_BATWARN;
+ if (reg & I365_CSC_READY)
+ state->csc_mask |= SS_READY;
+ }
+
+ leave("i82092aa_get_socket");


+ return 0;
+}
+

+static int i82092aa_set_socket(unsigned int sock, socket_state_t *state)
+{
+ unsigned char reg;
+
+ enter("i82092aa_set_socket");
+
+ /* First, set the global controller options */
+
+ set_bridge_state(sock);
+
+ /* Values for the IGENC register */
+
+ reg = 0;
+ if (!(state->flags & SS_RESET)) /* The reset bit has "inverse" logic */
+ reg = reg | I365_PC_RESET;
+ if (state->flags & SS_IOCARD)
+ reg = reg | I365_PC_IOCARD;
+
+ indirect_write(sock,I365_INTCTL,reg); /* IGENC, Interrupt and General Control Register */
+
+ /* Power registers */
+
+ reg = I365_PWR_NORESET; /* default: disable resetdrv on resume */
+
+ if (state->flags & SS_PWR_AUTO) {
+ printk("Auto power\n");
+ reg |= I365_PWR_AUTO; /* automatic power mngmnt */
+ }
+ if (state->flags & SS_OUTPUT_ENA) {
+ printk("Power Enabled \n");
+ reg |= I365_PWR_OUT; /* enable power */
+ }
+
+ switch (state->Vcc) {


+ case 0:
+ break;

+ case 50:
+ printk("setting voltage to Vcc to 5V on socket %i\n",sock);
+ reg |= I365_VCC_5V;
+ break;
+ default:
+ printk("i82092aa: i82092aa_set_socket called with invalid VCC power value: %i ", state->Vcc);
+ leave("i82092aa_set_socket");


+ return -EINVAL;
+ }
+

+
+ switch (state->Vpp) {
+ case 0:
+ printk("not setting Vpp on socket %i\n",sock);
+ break;
+ case 50:
+ printk("setting Vpp to 5.0 for socket %i\n",sock);
+ reg |= I365_VPP1_5V | I365_VPP2_5V;
+ break;
+ case 120:
+ printk("setting Vpp to 12.0\n");
+ reg |= I365_VPP1_12V | I365_VPP2_12V;
+ break;
+ default:
+ printk("i82092aa: i82092aa_set_socket called with invalid VPP power value: %i ", state->Vcc);
+ leave("i82092aa_set_socket");


+ return -EINVAL;
+ }
+

+ if (reg != indirect_read(sock,I365_POWER)) /* only write if changed */
+ indirect_write(sock,I365_POWER,reg);
+
+ /* Enable specific interrupt events */
+
+ reg = 0x00;
+ if (state->csc_mask & SS_DETECT) {
+ reg |= I365_CSC_DETECT;
+ }
+ if (state->flags & SS_IOCARD) {
+ if (state->csc_mask & SS_STSCHG)
+ reg |= I365_CSC_STSCHG;
+ } else {
+ if (state->csc_mask & SS_BATDEAD)
+ reg |= I365_CSC_BVD1;
+ if (state->csc_mask & SS_BATWARN)
+ reg |= I365_CSC_BVD2;
+ if (state->csc_mask & SS_READY)
+ reg |= I365_CSC_READY;
+
+ }
+
+ /* now write the value and clear the (probably bogus) pending stuff by doing a dummy read*/
+
+ indirect_write(sock,I365_CSCINT,reg);
+ (void)indirect_read(sock,I365_CSC);
+
+ leave("i82092aa_set_socket");


+ return 0;
+}
+

+static int i82092aa_get_io_map(unsigned int sock, struct pccard_io_map *io)
+{
+ unsigned char map, ioctl, addr;
+
+ enter("i82092aa_get_io_map");
+ map = io->map;
+ if (map > 1) {
+ leave("i82092aa_get_io_map with -EINVAL");


+ return -EINVAL;
+ }
+

+ /* FIXME: How does this fit in with the PCI resource (re)allocation */
+ io->start = indirect_read16(sock, I365_IO(map)+I365_W_START);
+ io->stop = indirect_read16(sock, I365_IO(map)+I365_W_START);
+
+ ioctl = indirect_read(sock,I365_IOCTL); /* IOCREG: I/O Control Register */
+ addr = indirect_read(sock,I365_ADDRWIN); /* */
+
+ io->speed = to_ns(ioctl & I365_IOCTL_WAIT(map)) ? 1 : 0; /* check this out later */
+ io->flags = 0;
+
+ if (addr & I365_IOCTL_16BIT(map))
+ io->flags |= MAP_AUTOSZ;
+
+ leave("i82092aa_get_io_map");


+ return 0;
+}
+

+static int i82092aa_set_io_map(unsigned sock, struct pccard_io_map *io)
+{
+ unsigned char map, ioctl;
+
+ enter("i82092aa_set_io_map");
+
+ map = io->map;
+
+ /* Check error conditions */
+ if (map > 1) {
+ leave("i82092aa_set_io_map with invalid map");
+ return -EINVAL;
+ }
+ if ((io->start > 0xffff) || (io->stop > 0xffff) || (io->stop < io->start)){
+ leave("i82092aa_set_io_map with invalid io");


+ return -EINVAL;
+ }
+

+ /* Turn off the window before changing anything */
+ if (indirect_read(sock, I365_ADDRWIN) & I365_ENA_IO(map))
+ indirect_resetbit(sock, I365_ADDRWIN, I365_ENA_IO(map));
+
+/* printk("set_io_map: Setting range to %x - %x \n",io->start,io->stop); */
+
+ /* write the new values */
+ indirect_write16(sock,I365_IO(map)+I365_W_START,io->start);
+ indirect_write16(sock,I365_IO(map)+I365_W_STOP,io->stop);
+
+ ioctl = indirect_read(sock,I365_IOCTL) & ~I365_IOCTL_MASK(map);
+
+ if (io->flags & (MAP_16BIT|MAP_AUTOSZ))
+ ioctl |= I365_IOCTL_16BIT(map);
+
+ indirect_write(sock,I365_IOCTL,ioctl);
+
+ /* Turn the window back on if needed */
+ if (io->flags & MAP_ACTIVE)
+ indirect_setbit(sock,I365_ADDRWIN,I365_ENA_IO(map));
+
+ leave("i82092aa_set_io_map");

+ return 0;
+}
+

+static int i82092aa_get_mem_map(unsigned sock, struct pccard_mem_map *mem)
+{
+ unsigned short base, i;
+ unsigned char map, addr;
+
+ enter("i82092aa_get_mem_map");
+
+ mem->flags = 0;
+ mem->speed = 0;
+ map = mem->map;
+ if (map > 4) {
+ leave("i82092aa_get_mem_map: -EINVAL");


+ return -EINVAL;
+ }
+

+ addr = indirect_read(sock, I365_ADDRWIN);
+
+ if (addr & I365_ENA_MEM(map))
+ mem->flags |= MAP_ACTIVE; /* yes this mapping is active */
+
+ base = I365_MEM(map);
+
+ /* Find the start address - this register also has mapping info */
+
+ i = indirect_read16(sock,base+I365_W_START);
+ if (i & I365_MEM_16BIT)
+ mem->flags |= MAP_16BIT;
+ if (i & I365_MEM_0WS)
+ mem->flags |= MAP_0WS;
+
+ mem->sys_start = ((unsigned long)(i & 0x0fff) << 12);
+
+ /* Find the end address - this register also has speed info */
+ i = indirect_read16(sock,base+I365_W_STOP);
+ if (i & I365_MEM_WS0)
+ mem->speed = 1;
+ if (i & I365_MEM_WS1)
+ mem->speed += 2;
+ mem->speed = to_ns(mem->speed);
+ mem->sys_stop = ( (unsigned long)(i & 0x0fff) << 12) + 0x0fff;
+
+ /* Find the card start address, also some more MAP attributes */
+
+ i = indirect_read16(sock, base+I365_W_OFF);
+ if (i & I365_MEM_WRPROT)
+ mem->flags |= MAP_WRPROT;
+ if (i & I365_MEM_REG)
+ mem->flags |= MAP_ATTRIB;
+ mem->card_start = ( (unsigned long)(i & 0x3fff)<12) + mem->sys_start;
+ mem->card_start &= 0x3ffffff;
+
+ printk("Card %i is from %x to %x \n",sock,mem->sys_start,mem->sys_stop);
+
+ leave("i82092aa_get_mem_map");


+ return 0;
+
+}
+

+static int i82092aa_set_mem_map(unsigned sock, struct pccard_mem_map *mem)
+{
+ unsigned short base, i;
+ unsigned char map;
+
+ enter("i82092aa_set_mem_map");
+
+ map = mem->map;
+ if (map > 4) {
+ leave("i82092aa_set_mem_map: invalid map");
+ return -EINVAL;
+ }
+
+
+ if ( (mem->card_start > 0x3ffffff) || (mem->sys_start > mem->sys_stop) ||
+ (mem->speed > 1000) ) {
+ leave("i82092aa_set_mem_map: invalid address / speed");
+ printk("invalid mem map for socket %i : %x to %x with a start of %x \n",sock,mem->sys_start, mem->sys_stop, mem->card_start);


+ return -EINVAL;
+ }
+

+ /* Turn off the window before changing anything */
+ if (indirect_read(sock, I365_ADDRWIN) & I365_ENA_MEM(map))
+ indirect_resetbit(sock, I365_ADDRWIN, I365_ENA_MEM(map));
+
+
+/* printk("set_mem_map: Setting map %i range to %x - %x on socket %i, speed is %i, active = %i \n",map, mem->sys_start,mem->sys_stop,sock,mem->speed,mem->flags & MAP_ACTIVE); */
+
+ /* write the start address */
+ base = I365_MEM(map);
+ i = (mem->sys_start >> 12) & 0x0fff;
+ if (mem->flags & MAP_16BIT)
+ i |= I365_MEM_16BIT;
+ if (mem->flags & MAP_0WS)
+ i |= I365_MEM_0WS;
+ indirect_write16(sock,base+I365_W_START,i);
+
+ /* write the stop address */
+
+ i= (mem->sys_stop >> 12) & 0x0fff;
+ switch (to_cycles(mem->speed)) {


+ case 0:
+ break;

+ case 1:
+ i |= I365_MEM_WS0;


+ break;
+ case 2:

+ i |= I365_MEM_WS1;
+ break;
+ default:
+ i |= I365_MEM_WS1 | I365_MEM_WS0;
+ break;
+ }
+
+ indirect_write16(sock,base+I365_W_STOP,i);
+
+ /* card start */
+
+ i = ((mem->card_start - mem->sys_start) >> 12) & 0x3fff;
+ if (mem->flags & MAP_WRPROT)
+ i |= I365_MEM_WRPROT;
+ if (mem->flags & MAP_ATTRIB) {
+/* printk("requesting attribute memory for socket %i\n",sock);*/
+ i |= I365_MEM_REG;
+ } else {
+/* printk("requesting normal memory for socket %i\n",sock);*/
+ }
+ indirect_write16(sock,base+I365_W_OFF,i);
+
+ /* Enable the window if necessary */
+ if (mem->flags & MAP_ACTIVE)
+ indirect_setbit(sock, I365_ADDRWIN, I365_ENA_MEM(map));
+
+ leave("i82092aa_set_mem_map");


+ return 0;
+}
+

+static void i82092aa_proc_setup(unsigned int sock, struct proc_dir_entry *base)
+{
+
+}
+/* Module stuff */
+
+static int i82092aa_module_init(void)
+{
+ enter("i82092aa_module_init");
+ pci_register_driver(&i82092aa_pci_drv);
+ leave("i82092aa_module_init");


+ return 0;
+}
+

+static void i82092aa_module_exit(void)
+{
+ int i;
+ enter("i82092aa_module_exit");
+ pci_unregister_driver(&i82092aa_pci_drv);
+ unregister_ss_entry(&i82092aa_operations);
+ if (sockets[0].io_base>0)
+ release_region(sockets[0].io_base, 2);
+ leave("i82092aa_module_exit");
+}
+
+module_init(i82092aa_module_init);
+module_exit(i82092aa_module_exit);
+
diff -u --recursive --new-file v2.4.13/linux/drivers/pcmcia/i82092aa.h linux/drivers/pcmcia/i82092aa.h
--- v2.4.13/linux/drivers/pcmcia/i82092aa.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/pcmcia/i82092aa.h Sun Nov 4 09:58:59 2001
@@ -0,0 +1,43 @@
+#ifndef _INCLUDE_GUARD_i82092aa_H_
+#define _INCLUDE_GUARD_i82092aa_H_
+
+/* $Id: i82092aa.h,v 1.1.1.1 2001/09/19 14:53:15 dwmw2 Exp $ */
+
+/* Debuging defines */
+#ifdef NOTRACE
+#define enter(x) printk("Enter: %s, %s line %i\n",x,__FILE__,__LINE__)
+#define leave(x) printk("Leave: %s, %s line %i\n",x,__FILE__,__LINE__)
+#define dprintk(fmt, args...) printk(fmt , ## args)
+#else
+#define enter(x) do {} while (0)
+#define leave(x) do {} while (0)
+#define dprintk(fmt, args...) do {} while (0)
+#endif
+
+
+
+/* prototypes */
+
+static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *id);
+static void i82092aa_pci_remove(struct pci_dev *dev);
+static int card_present(int socketno);


+static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs);
+
+

+
+
+static int i82092aa_get_status(unsigned int sock, u_int *value);
+static int i82092aa_get_socket(unsigned int sock, socket_state_t *state);
+static int i82092aa_set_socket(unsigned int sock, socket_state_t *state);
+static int i82092aa_get_io_map(unsigned int sock, struct pccard_io_map *io);
+static int i82092aa_set_io_map(unsigned int sock, struct pccard_io_map *io);
+static int i82092aa_get_mem_map(unsigned int sock, struct pccard_mem_map *mem);
+static int i82092aa_set_mem_map(unsigned int sock, struct pccard_mem_map *mem);
+static int i82092aa_init(unsigned int s);
+static int i82092aa_suspend(unsigned int sock);
+static int i82092aa_register_callback(unsigned int sock, void (*handler)(void *, unsigned int), void * info);
+static int i82092aa_inquire_socket(unsigned int sock, socket_cap_t *cap);
+static void i82092aa_proc_setup(unsigned int sock, struct proc_dir_entry *base);
+
+#endif
+
diff -u --recursive --new-file v2.4.13/linux/drivers/pcmcia/sa1100_assabet.c linux/drivers/pcmcia/sa1100_assabet.c
--- v2.4.13/linux/drivers/pcmcia/sa1100_assabet.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/pcmcia/sa1100_assabet.c Thu Oct 25 13:53:48 2001
@@ -10,29 +10,29 @@


X #include <asm/hardware.h>
X #include <asm/irq.h>

X #include <asm/arch/pcmcia.h>
-
+#include <asm/arch/assabet.h>
X
X static int assabet_pcmcia_init(struct pcmcia_init *init){
X int irq, res;
X
X /* Enable CF bus: */
- BCR_clear(BCR_CF_BUS_OFF);
+ ASSABET_BCR_clear(ASSABET_BCR_CF_BUS_OFF);
X
X /* All those are inputs */
- GPDR &= ~(GPIO_CF_CD | GPIO_CF_BVD2 | GPIO_CF_BVD1 | GPIO_CF_IRQ);
+ GPDR &= ~(ASSABET_GPIO_CF_CD | ASSABET_GPIO_CF_BVD2 | ASSABET_GPIO_CF_BVD1 | ASSABET_GPIO_CF_IRQ);
X
X /* Set transition detect */
- set_GPIO_IRQ_edge( GPIO_CF_CD|GPIO_CF_BVD2|GPIO_CF_BVD1, GPIO_BOTH_EDGES );
- set_GPIO_IRQ_edge( GPIO_CF_IRQ, GPIO_FALLING_EDGE );
+ set_GPIO_IRQ_edge( ASSABET_GPIO_CF_CD|ASSABET_GPIO_CF_BVD2|ASSABET_GPIO_CF_BVD1, GPIO_BOTH_EDGES );
+ set_GPIO_IRQ_edge( ASSABET_GPIO_CF_IRQ, GPIO_FALLING_EDGE );
X
X /* Register interrupts */
- irq = IRQ_GPIO_CF_CD;
+ irq = ASSABET_IRQ_GPIO_CF_CD;
X res = request_irq( irq, init->handler, SA_INTERRUPT, "CF_CD", NULL );
X if( res < 0 ) goto irq_err;
- irq = IRQ_GPIO_CF_BVD2;
+ irq = ASSABET_IRQ_GPIO_CF_BVD2;
X res = request_irq( irq, init->handler, SA_INTERRUPT, "CF_BVD2", NULL );
X if( res < 0 ) goto irq_err;
- irq = IRQ_GPIO_CF_BVD1;
+ irq = ASSABET_IRQ_GPIO_CF_BVD1;
X res = request_irq( irq, init->handler, SA_INTERRUPT, "CF_BVD1", NULL );
X if( res < 0 ) goto irq_err;
X
@@ -47,12 +47,12 @@
X static int assabet_pcmcia_shutdown(void)
X {
X /* disable IRQs */
- free_irq( IRQ_GPIO_CF_CD, NULL );
- free_irq( IRQ_GPIO_CF_BVD2, NULL );
- free_irq( IRQ_GPIO_CF_BVD1, NULL );
+ free_irq( ASSABET_IRQ_GPIO_CF_CD, NULL );
+ free_irq( ASSABET_IRQ_GPIO_CF_BVD2, NULL );
+ free_irq( ASSABET_IRQ_GPIO_CF_BVD1, NULL );
X
X /* Disable CF bus: */
- BCR_set(BCR_CF_BUS_OFF);
+ ASSABET_BCR_set(ASSABET_BCR_CF_BUS_OFF);


X
X return 0;
X }

@@ -68,13 +68,13 @@
X
X levels=GPLR;
X
- state_array->state[1].detect=((levels & GPIO_CF_CD)==0)?1:0;
+ state_array->state[1].detect=((levels & ASSABET_GPIO_CF_CD)==0)?1:0;
X
- state_array->state[1].ready=(levels & GPIO_CF_IRQ)?1:0;
+ state_array->state[1].ready=(levels & ASSABET_GPIO_CF_IRQ)?1:0;
X
- state_array->state[1].bvd1=(levels & GPIO_CF_BVD1)?1:0;
+ state_array->state[1].bvd1=(levels & ASSABET_GPIO_CF_BVD1)?1:0;
X
- state_array->state[1].bvd2=(levels & GPIO_CF_BVD2)?1:0;
+ state_array->state[1].bvd2=(levels & ASSABET_GPIO_CF_BVD2)?1:0;
X
X state_array->state[1].wrprot=0; /* Not available on Assabet. */
X
@@ -90,7 +90,7 @@
X if(info->sock>1) return -1;
X
X if(info->sock==1)
- info->irq=IRQ_GPIO_CF_IRQ;
+ info->irq=ASSABET_IRQ_GPIO_CF_IRQ;


X
X return 0;
X }

@@ -110,7 +110,7 @@
X
X switch(configure->vcc){
X case 0:
- value &= ~BCR_CF_PWR;
+ value &= ~ASSABET_BCR_CF_PWR;
X break;
X
X case 50:
@@ -118,7 +118,7 @@
X __FUNCTION__);
X
X case 33: /* Can only apply 3.3V to the CF slot. */
- value |= BCR_CF_PWR;
+ value |= ASSABET_BCR_CF_PWR;


X break;
X
X default:

@@ -128,11 +128,11 @@


X return -1;
X }
X

- value = (configure->reset) ? (value | BCR_CF_RST) : (value & ~BCR_CF_RST);
+ value = (configure->reset) ? (value | ASSABET_BCR_CF_RST) : (value & ~ASSABET_BCR_CF_RST);
X
X /* Silently ignore Vpp, output enable, speaker enable. */
X
- BCR = BCR_value = value;
+ ASSABET_BCR = BCR_value = value;
X
X restore_flags(flags);
X
diff -u --recursive --new-file v2.4.13/linux/drivers/pcmcia/sa1100_cerf.c linux/drivers/pcmcia/sa1100_cerf.c
--- v2.4.13/linux/drivers/pcmcia/sa1100_cerf.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/pcmcia/sa1100_cerf.c Thu Oct 25 13:53:48 2001
@@ -16,17 +16,12 @@
X static int cerf_pcmcia_init(struct pcmcia_init *init){
X int irq, res;
X
- /* Enable CF bus: */
-// BCR_clear(BCR_CF_BUS_OFF);
-
- /* All those are inputs */
X GPDR &= ~(GPIO_CF_CD | GPIO_CF_BVD2 | GPIO_CF_BVD1 | GPIO_CF_IRQ);
+ GPDR |= (GPIO_CF_RESET);
X
- /* Set transition detect */
X set_GPIO_IRQ_edge( GPIO_CF_CD|GPIO_CF_BVD2|GPIO_CF_BVD1, GPIO_BOTH_EDGES );
X set_GPIO_IRQ_edge( GPIO_CF_IRQ, GPIO_FALLING_EDGE );
X
- /* Register interrupts */
X irq = IRQ_GPIO_CF_CD;
X res = request_irq( irq, init->handler, SA_INTERRUPT, "CF_CD", NULL );
X if( res < 0 ) goto irq_err;
@@ -37,7 +32,6 @@
X res = request_irq( irq, init->handler, SA_INTERRUPT, "CF_BVD1", NULL );
X if( res < 0 ) goto irq_err;
X
- /* There's only one slot, but it's "Slot 1": */
X return 2;
X
X irq_err:
@@ -47,13 +41,9 @@
X
X static int cerf_pcmcia_shutdown(void)
X {
- /* disable IRQs */
X free_irq( IRQ_GPIO_CF_CD, NULL );
X free_irq( IRQ_GPIO_CF_BVD2, NULL );
X free_irq( IRQ_GPIO_CF_BVD1, NULL );
-
- /* Disable CF bus: */
-// BCR_set(BCR_CF_BUS_OFF);


X
X return 0;
X }

@@ -61,6 +51,11 @@
X static int cerf_pcmcia_socket_state(struct pcmcia_state_array
X *state_array){
X unsigned long levels;
+#ifdef CONFIG_SA1100_CERF_CPLD


+ int i = 0;

+#else
+ int i = 1;
+#endif
X
X if(state_array->size<2) return -1;
X
@@ -69,19 +64,19 @@
X
X levels=GPLR;
X
- state_array->state[1].detect=((levels & GPIO_CF_CD)==0)?1:0;
+ state_array->state[i].detect=((levels & GPIO_CF_CD)==0)?1:0;
X
- state_array->state[1].ready=(levels & GPIO_CF_IRQ)?1:0;
+ state_array->state[i].ready=(levels & GPIO_CF_IRQ)?1:0;
X
- state_array->state[1].bvd1=(levels & GPIO_CF_BVD1)?1:0;
+ state_array->state[i].bvd1=(levels & GPIO_CF_BVD1)?1:0;
X
- state_array->state[1].bvd2=(levels & GPIO_CF_BVD2)?1:0;
+ state_array->state[i].bvd2=(levels & GPIO_CF_BVD2)?1:0;
X
- state_array->state[1].wrprot=0; /* Not available on Assabet. */
+ state_array->state[i].wrprot=0;
X
- state_array->state[1].vs_3v=1; /* Can only apply 3.3V on Assabet. */
+ state_array->state[i].vs_3v=1;
X
- state_array->state[1].vs_Xv=0;
+ state_array->state[i].vs_Xv=0;
X
X return 1;
X }
@@ -90,7 +85,11 @@
X
X if(info->sock>1) return -1;
X
+#ifdef CONFIG_SA1100_CERF_CPLD
+ if(info->sock==0)
+#else
X if(info->sock==1)
+#endif
X info->irq=IRQ_GPIO_CF_IRQ;
X
X return 0;
@@ -99,28 +98,31 @@
X static int cerf_pcmcia_configure_socket(const struct pcmcia_configure
X *configure)
X {
- unsigned long value, flags;


+ unsigned long flags;
X

- if(configure->sock>1) return -1;
+ if(configure->sock>1)
+ return -1;
X
- if(configure->sock==0) return 0;
+#ifdef CONFIG_SA1100_CERF_CPLD
+ if(configure->sock==1)
+#else
+ if(configure->sock==0)
+#endif
+ return 0;
X
X save_flags_cli(flags);
X
-// value = BCR_value;
-
X switch(configure->vcc){
X case 0:
-// value &= ~BCR_CF_PWR;
X break;
X
X case 50:
- printk(KERN_WARNING "%s(): CS asked for 5V, applying 3.3V...\n",
- __FUNCTION__);
-
- case 33: /* Can only apply 3.3V to the CF slot. */
-// value |= BCR_CF_PWR;
- break;
+ case 33:
+#ifdef CONFIG_SA1100_CERF_CPLD
+ GPDR |= GPIO_PWR_SHUTDOWN;
+ GPCR |= GPIO_PWR_SHUTDOWN;
+#endif
+ break;
X
X default:
X printk(KERN_ERR "%s(): unrecognized Vcc %u\n", __FUNCTION__,
@@ -129,11 +131,20 @@
X return -1;
X }
X
-// value = (configure->reset) ? (value | BCR_CF_RST) : (value & ~BCR_CF_RST);
-
- /* Silently ignore Vpp, output enable, speaker enable. */
-
-// BCR = BCR_value = value;
+ if(configure->reset)
+ {
+#ifdef CONFIG_SA1100_CERF_CPLD
+ GPDR |= GPIO_CF_RESET;
+ GPSR |= GPIO_CF_RESET;
+#endif
+ }
+ else
+ {
+#ifdef CONFIG_SA1100_CERF_CPLD
+ GPDR |= GPIO_CF_RESET;
+ GPCR |= GPIO_CF_RESET;
+#endif
+ }
X
X restore_flags(flags);
X
diff -u --recursive --new-file v2.4.13/linux/drivers/pcmcia/sa1100_generic.c linux/drivers/pcmcia/sa1100_generic.c
--- v2.4.13/linux/drivers/pcmcia/sa1100_generic.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/pcmcia/sa1100_generic.c Thu Oct 25 13:53:48 2001
@@ -54,6 +54,7 @@


X #include <asm/io.h>
X #include <asm/irq.h>

X #include <asm/system.h>
+#include <asm/arch/assabet.h>
X
X #include "sa1100.h"
X
@@ -375,11 +376,26 @@
X *
X * Returns: 0
X */
-static int sa1100_pcmcia_suspend(unsigned int sock){
+static int sa1100_pcmcia_suspend(unsigned int sock)
+{
+ struct pcmcia_configure conf;
+ int ret;
X
X DEBUG(2, "%s(): suspending socket %u\n", __FUNCTION__, sock);
X
- return 0;
+ conf.sock = sock;
+ conf.vcc = 0;
+ conf.vpp = 0;
+ conf.output = 0;
+ conf.speaker = 0;
+ conf.reset = 1;
+
+ ret = pcmcia_low_level->configure_socket(&conf);
+
+ if (ret == 0)
+ sa1100_pcmcia_socket[sock].cs_state = dead_socket;
+
+ return ret;
X }
X
X
diff -u --recursive --new-file v2.4.13/linux/drivers/pcmcia/sa1100_neponset.c linux/drivers/pcmcia/sa1100_neponset.c
--- v2.4.13/linux/drivers/pcmcia/sa1100_neponset.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/pcmcia/sa1100_neponset.c Thu Oct 25 13:53:48 2001
@@ -11,6 +11,7 @@


X #include <asm/hardware.h>
X #include <asm/irq.h>

X #include <asm/arch/pcmcia.h>
+#include <asm/arch/assabet.h>
X
X static int neponset_pcmcia_init(struct pcmcia_init *init){
X int return_val=0;
diff -u --recursive --new-file v2.4.13/linux/drivers/pcmcia/sa1100_simpad.c linux/drivers/pcmcia/sa1100_simpad.c
--- v2.4.13/linux/drivers/pcmcia/sa1100_simpad.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/pcmcia/sa1100_simpad.c Thu Oct 25 13:53:48 2001


@@ -1,5 +1,5 @@
X /*

- * drivers/pcmcia/sa1100_pangolin.c
+ * drivers/pcmcia/sa1100_simpad.c
X *
X * PCMCIA implementation routines for simpad
X *
@@ -10,16 +10,23 @@


X #include <asm/hardware.h>
X #include <asm/irq.h>

X #include <asm/arch/pcmcia.h>
+
+extern long get_cs3_shadow(void);


+extern void set_cs3_bit(int value);
+extern void clear_cs3_bit(int value);

+
X
X static int simpad_pcmcia_init(struct pcmcia_init *init){
X int irq, res;
X
X /* set GPIO_CF_CD & GPIO_CF_IRQ as inputs */
X GPDR &= ~(GPIO_CF_CD|GPIO_CF_IRQ);
- //init_simpad_cs3();
- printk("\nCS3:%x\n",cs3_shadow);
- PCMCIA_setbit(PCMCIA_RESET);
- PCMCIA_clearbit(PCMCIA_BUFF_DIS);
+
+ set_cs3_bit(PCMCIA_RESET);
+ clear_cs3_bit(PCMCIA_BUFF_DIS);
+ clear_cs3_bit(PCMCIA_RESET);
+
+ clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1);
X
X /* Set transition detect */
X set_GPIO_IRQ_edge( GPIO_CF_CD, GPIO_BOTH_EDGES );
@@ -42,11 +49,12 @@
X {
X /* disable IRQs */
X free_irq( IRQ_GPIO_CF_CD, NULL );
-
+
X /* Disable CF bus: */
-
- PCMCIA_setbit(PCMCIA_BUFF_DIS);
- PCMCIA_clearbit(PCMCIA_RESET);
+
+ //set_cs3_bit(PCMCIA_BUFF_DIS);
+ clear_cs3_bit(PCMCIA_RESET);

+
X return 0;
X }
X

@@ -54,10 +62,11 @@
X *state_array)
X {
X unsigned long levels;
+ unsigned long *cs3reg = CS3_BASE;
X
X if(state_array->size<2) return -1;
X
- memset(state_array->state, 0,
+ memset(state_array->state, 0,
X (state_array->size)*sizeof(struct pcmcia_state));
X
X levels=GPLR;
@@ -72,10 +81,15 @@
X
X state_array->state[1].wrprot=0; /* Not available on Simpad. */
X
- state_array->state[1].vs_3v=1; /* Can only apply 3.3V on Simpad. */
-
- state_array->state[1].vs_Xv=0;
-
+
+ if((*cs3reg & 0x0c) == 0x0c) {
+ state_array->state[1].vs_3v=0;
+ state_array->state[1].vs_Xv=0;
+ } else
+ {
+ state_array->state[1].vs_3v=1;
+ state_array->state[1].vs_Xv=0;
+ }


X return 1;
X }
X

@@ -100,21 +114,27 @@
X
X save_flags_cli(flags);
X
- /* Murphy: BUS_ON different from POWER ? */
+ /* Murphy: see table of MIC2562a-1 */
X
X switch(configure->vcc){
X case 0:
- PCMCIA_setbit(PCMCIA_BUFF_DIS);
+ clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1);
+ break;
+
+ case 33:
+ clear_cs3_bit(VCC_3V_EN|EN0);
+ set_cs3_bit(VCC_5V_EN|EN1);
X break;
X
- case 33:
X case 50:
- PCMCIA_setbit(PCMCIA_BUFF_DIS);
+ clear_cs3_bit(VCC_5V_EN|EN1);
+ set_cs3_bit(VCC_3V_EN|EN0);


X break;
X
X default:

X printk(KERN_ERR "%s(): unrecognized Vcc %u\n", __FUNCTION__,
X configure->vcc);
+ clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1);
X restore_flags(flags);
X return -1;
X }
@@ -126,7 +146,7 @@


X return 0;
X }
X

-struct pcmcia_low_level simpad_pcmcia_ops = {
+struct pcmcia_low_level simpad_pcmcia_ops = {
X simpad_pcmcia_init,
X simpad_pcmcia_shutdown,
X simpad_pcmcia_socket_state,
diff -u --recursive --new-file v2.4.13/linux/drivers/pcmcia/sa1100_stork.c linux/drivers/pcmcia/sa1100_stork.c
--- v2.4.13/linux/drivers/pcmcia/sa1100_stork.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/pcmcia/sa1100_stork.c Thu Oct 25 13:53:48 2001
@@ -161,7 +161,7 @@
X */
X switch (configure->vcc) {
X case 0:
- storkClearLatchA(STORK_PCMCIA_PULL_UPS_POWER_ON);
+/* storkClearLatchA(STORK_PCMCIA_PULL_UPS_POWER_ON); */
X storkClearLatchA(POWER);
X break;
X
diff -u --recursive --new-file v2.4.13/linux/drivers/pnp/Config.in linux/drivers/pnp/Config.in
--- v2.4.13/linux/drivers/pnp/Config.in Sun Aug 12 13:27:59 2001
+++ linux/drivers/pnp/Config.in Thu Oct 25 14:01:51 2001
@@ -8,8 +8,4 @@
X
X dep_tristate ' ISA Plug and Play support' CONFIG_ISAPNP $CONFIG_PNP
X
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- dep_bool ' PNPBIOS support (EXPERIMENTAL)' CONFIG_PNPBIOS $CONFIG_PNP
-fi
-
X endmenu
diff -u --recursive --new-file v2.4.13/linux/drivers/pnp/quirks.c linux/drivers/pnp/quirks.c
--- v2.4.13/linux/drivers/pnp/quirks.c Fri Dec 29 14:07:22 2000
+++ linux/drivers/pnp/quirks.c Sun Nov 4 09:31:58 2001
@@ -8,7 +8,7 @@
X *
X * Heavily based on PCI quirks handling which is


X *
- * Copyright (c) 1999 Martin Mares <m...@suse.cz>
+ * Copyright (c) 1999 Martin Mares <m...@ucw.cz>

X */
X
X #include <linux/types.h>

diff -u --recursive --new-file v2.4.13/linux/drivers/s390/block/dasd.c linux/drivers/s390/block/dasd.c
--- v2.4.13/linux/drivers/s390/block/dasd.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/s390/block/dasd.c Thu Oct 25 13:58:35 2001
@@ -2563,7 +2563,6 @@
X unsigned long flags;
X dasd_device_t *device;
X
- MOD_INC_USE_COUNT;
X if ((!inp) || !(inp->i_rdev)) {
X rc = -EINVAL;
X goto fail;
@@ -2595,13 +2594,10 @@
X if (atomic_inc_return (&device->open_count) == 1 ) {
X if ( device->discipline->owner )
X __MOD_INC_USE_COUNT(device->discipline->owner);
- } else {
- MOD_DEC_USE_COUNT;
X }
X unlock:
X spin_unlock_irqrestore(&discipline_lock,flags);
X fail:
- if (rc) MOD_DEC_USE_COUNT;


X return rc;
X }
X

@@ -2637,13 +2633,11 @@
X rc = -ENODEV;
X goto out;
X }
- // fsync_dev (inp->i_rdev); /* sync the device */
X count = atomic_dec_return (&device->open_count);
X if ( count == 0) {
X invalidate_buffers (inp->i_rdev);
X if ( device->discipline->owner )
X __MOD_DEC_USE_COUNT(device->discipline->owner);
- MOD_DEC_USE_COUNT;
X } else if ( count == -1 ) { /* paranoia only */
X atomic_set (&device->open_count,0);
X printk (KERN_WARNING PRINTK_HEADER
@@ -2656,6 +2650,7 @@
X static struct
X block_device_operations dasd_device_operations =
X {
+ owner:THIS_MODULE,
X open:dasd_open,
X release:dasd_release,
X ioctl:dasd_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/s390/block/xpram.c linux/drivers/s390/block/xpram.c
--- v2.4.13/linux/drivers/s390/block/xpram.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/s390/block/xpram.c Thu Oct 25 13:58:35 2001
@@ -608,7 +608,6 @@
X dev->size,dev->device_name, atomic_read(&(dev->usage)));
X
X atomic_inc(&(dev->usage));
- MOD_INC_USE_COUNT;
X return 0; /* success */
X }
X
@@ -627,7 +626,6 @@
X /* but flush it right now */
X /* Everything is already flushed by caller -- AV */
X }
- MOD_DEC_USE_COUNT;
X return(0);
X }
X
@@ -740,6 +738,7 @@
X #if (XPRAM_VERSION == 24)
X struct block_device_operations xpram_devops =
X {
+ owner: THIS_MODULE,
X ioctl: xpram_ioctl,
X open: xpram_open,
X release: xpram_release,
diff -u --recursive --new-file v2.4.13/linux/drivers/s390/char/tapeblock.c linux/drivers/s390/char/tapeblock.c
--- v2.4.13/linux/drivers/s390/char/tapeblock.c Sun Aug 12 13:28:00 2001
+++ linux/drivers/s390/char/tapeblock.c Thu Oct 25 13:58:35 2001
@@ -40,6 +40,7 @@
X #else
X static struct file_operations tapeblock_fops = {
X #endif
+ owner : THIS_MODULE,
X open : tapeblock_open, /* open */
X release : tapeblock_release, /* release */
X };
@@ -184,9 +185,6 @@
X ti->cqr=NULL;
X s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags);
X
-#ifdef MODULE
- MOD_INC_USE_COUNT;
-#endif /* MODULE */
X return 0;
X }


X
@@ -221,9 +219,6 @@

X s390irq_spin_lock_irqsave (ti->devinfo.irq, lockflags);
X tapestate_set (ti, TS_UNUSED);
X s390irq_spin_unlock_irqrestore (ti->devinfo.irq, lockflags);
-#ifdef MODULE
- MOD_DEC_USE_COUNT;
-#endif /* MODULE */
X invalidate_buffers(inode->i_rdev);
X return 0;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/sbus/char/aurora.c linux/drivers/sbus/char/aurora.c
--- v2.4.13/linux/drivers/sbus/char/aurora.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/sbus/char/aurora.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: aurora.c,v 1.17 2001/10/13 08:27:50 davem Exp $
+/* $Id: aurora.c,v 1.18 2001/10/26 17:59:31 davem Exp $
X * linux/drivers/sbus/char/aurora.c -- Aurora multiport driver
X *
X * Copyright (c) 1999 by Oliver Aldulea (oli at bv dot ro)
@@ -2454,7 +2454,7 @@
X
X #ifdef AURORA_DEBUG
X printk("cleanup_module: aurora_release_drivers\n");
-#endif;
+#endif
X
X aurora_release_drivers();
X for (i = 0; i < AURORA_NBOARD; i++)
diff -u --recursive --new-file v2.4.13/linux/drivers/sbus/char/jsflash.c linux/drivers/sbus/char/jsflash.c
--- v2.4.13/linux/drivers/sbus/char/jsflash.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/sbus/char/jsflash.c Thu Oct 25 13:58:35 2001
@@ -501,7 +501,6 @@
X jdp = &jsf0.dv[dev];
X jdp->refcnt++;
X
- MOD_INC_USE_COUNT;


X return 0;
X }
X

@@ -531,7 +530,6 @@
X --jdp->refcnt;
X }
X /* N.B. Doesn't lo->file need an fput?? */
- MOD_DEC_USE_COUNT;


X return 0;
X }
X

@@ -549,6 +547,7 @@
X static struct miscdevice jsf_dev = { JSF_MINOR, "jsflash", &jsf_fops };
X
X static struct block_device_operations jsfd_fops = {
+ owner: THIS_MODULE,
X open: jsfd_open,
X release: jsfd_release,
X ioctl: jsfd_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/sbus/char/zs.c linux/drivers/sbus/char/zs.c
--- v2.4.13/linux/drivers/sbus/char/zs.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/sbus/char/zs.c Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: zs.c,v 1.67 2001/10/13 08:27:50 davem Exp $
+/* $Id: zs.c,v 1.68 2001/10/25 18:48:03 davem Exp $
X * zs.c: Zilog serial port driver for the Sparc.
X *


X * Copyright (C) 1995 David S. Miller (da...@caip.rutgers.edu)

@@ -1933,7 +1933,7 @@
X
X static void show_serial_version(void)
X {
- char *revision = "$Revision: 1.67 $";
+ char *revision = "$Revision: 1.68 $";
X char *version, *p;
X
X version = strchr(revision, ' ');
@@ -2058,16 +2058,7 @@
X if (mapped_addr != 0) {
X return (struct sun_zslayout *) mapped_addr;
X } else {
- pgd_t *pgd = pgd_offset_k((unsigned long)vaddr[0]);
- pmd_t *pmd = pmd_offset(pgd, (unsigned long)vaddr[0]);
- pte_t *pte = pte_offset(pmd, (unsigned long)vaddr[0]);
- unsigned long base = pte_val(*pte) & _PAGE_PADDR;
-
- /* Translate PROM's mapping we captured at boot
- * time into physical address.
- */
- base += ((unsigned long)vaddr[0] & ~PAGE_MASK);
- return (struct sun_zslayout *) base;
+ return (struct sun_zslayout *) prom_virt_to_phys((unsigned long)vaddr[0], 0);
X }
X }
X #else /* !(__sparc_v9__) */
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/53c7,8xx.c linux/drivers/scsi/53c7,8xx.c
--- v2.4.13/linux/drivers/scsi/53c7,8xx.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/scsi/53c7,8xx.c Thu Oct 25 13:53:48 2001
@@ -1867,8 +1867,10 @@
X */
X
X timeout = jiffies + 5 * HZ / 10;
- while ((hostdata->test_completed == -1) && jiffies < timeout)
+ while ((hostdata->test_completed == -1) && jiffies < timeout) {


X barrier();
+ cpu_relax();
+ }
X

X failed = 1;
X if (hostdata->test_completed == -1)
@@ -1951,8 +1953,10 @@
X restore_flags(flags);
X
X timeout = jiffies + 5 * HZ; /* arbitrary */
- while ((hostdata->test_completed == -1) && jiffies < timeout)
+ while ((hostdata->test_completed == -1) && jiffies < timeout) {


X barrier();
+ cpu_relax();
+ }

X NCR53c7x0_write32 (DSA_REG, 0);
X
X if (hostdata->test_completed == 2) {
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/53c7xx.c linux/drivers/scsi/53c7xx.c
--- v2.4.13/linux/drivers/scsi/53c7xx.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/scsi/53c7xx.c Thu Oct 25 13:53:48 2001
@@ -6119,6 +6119,3 @@
X return 1;
X }
X #endif /* def MODULE */
-
-static Scsi_Host_Template driver_template = NCR53c7xx;
-#include "scsi_module.c"
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/53c7xx.h linux/drivers/scsi/53c7xx.h
--- v2.4.13/linux/drivers/scsi/53c7xx.h Mon Sep 18 14:09:49 2000
+++ linux/drivers/scsi/53c7xx.h Thu Oct 25 13:53:48 2001
@@ -51,33 +51,6 @@
X
X #ifndef NCR53c710_H
X #define NCR53c710_H
-#include <linux/version.h>
-
-/*
- * Prevent name space pollution in hosts.c, and only provide the
- * define we need to get the NCR53c7x0 driver into the host template
- * array.
- */
-
-#include <scsi/scsicam.h>
-
-extern int NCR53c7xx_abort(Scsi_Cmnd *);
-extern int NCR53c7xx_detect(Scsi_Host_Template *tpnt);
-extern int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int NCR53c7xx_reset(Scsi_Cmnd *, unsigned int);
-#ifdef MODULE
-extern int NCR53c7xx_release(struct Scsi_Host *);
-#else
-#define NCR53c7xx_release NULL
-#endif
-
-#define NCR53c7xx {NULL, NULL, NULL, NULL, \
- "NCR53c{7,8}xx (rel 17)", NCR53c7xx_detect,\
- NULL, /* info */ NULL, /* command, deprecated */ NULL, \
- NCR53c7xx_queue_command, NCR53c7xx_abort, NCR53c7xx_reset, \
- NULL /* slave attach */, scsicam_bios_param, /* can queue */ 24, \
- /* id */ 7, 127 /* old SG_ALL */, /* cmd per lun */ 3, \
- /* present */ 0, /* unchecked isa dma */ 0, DISABLE_CLUSTERING}
X
X #ifndef HOSTS_C
X
@@ -1503,6 +1476,13 @@
X /* These could be more efficient, given that we are always memory mapped,
X * but they don't give the same problems as the write macros, so leave
X * them. */
+#ifdef __mc68000__
+#define NCR53c7x0_read8(address) \
+ ((unsigned int)raw_inb((u32)NCR53c7x0_address_memory + ((u32)(address)^3)) )
+
+#define NCR53c7x0_read16(address) \
+ ((unsigned int)raw_inw((u32)NCR53c7x0_address_memory + ((u32)(address)^2)))
+#else
X #define NCR53c7x0_read8(address) \
X (NCR53c7x0_memory_mapped ? \
X (unsigned int)readb((u32)NCR53c7x0_address_memory + ((u32)(address)^3)) : \
@@ -1512,6 +1492,7 @@
X (NCR53c7x0_memory_mapped ? \
X (unsigned int)readw((u32)NCR53c7x0_address_memory + ((u32)(address)^2)) : \
X inw(NCR53c7x0_address_io + (address)))
+#endif /* mc68000 */
X #else
X #define NCR53c7x0_read8(address) \
X (NCR53c7x0_memory_mapped ? \
@@ -1523,10 +1504,16 @@
X (unsigned int)readw((u32)NCR53c7x0_address_memory + (u32)(address)) : \
X inw(NCR53c7x0_address_io + (address)))
X #endif
+
+#ifdef __mc68000__
+#define NCR53c7x0_read32(address) \
+ ((unsigned int) raw_inl((u32)NCR53c7x0_address_memory + (u32)(address)))
+#else
X #define NCR53c7x0_read32(address) \
X (NCR53c7x0_memory_mapped ? \
X (unsigned int) readl((u32)NCR53c7x0_address_memory + (u32)(address)) : \
X inl(NCR53c7x0_address_io + (address)))
+#endif /* mc68000*/
X
X #ifdef BIG_ENDIAN
X /* If we are big-endian, then we are not Intel, so probably don't have
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/a2091.c linux/drivers/scsi/a2091.c
--- v2.4.13/linux/drivers/scsi/a2091.c Mon Nov 27 17:57:34 2000
+++ linux/drivers/scsi/a2091.c Thu Oct 25 13:53:48 2001
@@ -190,6 +190,7 @@
X struct Scsi_Host *instance;
X unsigned long address;
X struct zorro_dev *z = NULL;
+ wd33c93_regs regs;
X
X if (!MACH_IS_AMIGA || called)
X return 0;
@@ -215,8 +216,9 @@
X instance->irq = IRQ_AMIGA_PORTS;
X instance->unique_id = z->slotaddr;
X DMA(instance)->DAWR = DAWR_A2091;
- wd33c93_init(instance, (wd33c93_regs *)&(DMA(instance)->SASR),
- dma_setup, dma_stop, WD33C93_FS_8_10);
+ regs.SASR = &(DMA(instance)->SASR);
+ regs.SCMD = &(DMA(instance)->SCMD);
+ wd33c93_init(instance, regs, dma_setup, dma_stop, WD33C93_FS_8_10);
X if (num_a2091++ == 0) {
X first_instance = instance;
X a2091_template = instance->hostt;
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/a3000.c linux/drivers/scsi/a3000.c
--- v2.4.13/linux/drivers/scsi/a3000.c Mon Nov 27 17:57:34 2000
+++ linux/drivers/scsi/a3000.c Thu Oct 25 13:53:48 2001
@@ -171,35 +171,41 @@
X
X int __init a3000_detect(Scsi_Host_Template *tpnt)
X {
- static unsigned char called = 0;
-
- if (called)
- return 0;
+ wd33c93_regs regs;
X
X if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(A3000_SCSI))
X return 0;
X if (!request_mem_region(0xDD0000, 256, "wd33c93"))
- return -EBUSY;
+ return 0;
X
X tpnt->proc_name = "A3000";
X tpnt->proc_info = &wd33c93_proc_info;
X
X a3000_host = scsi_register (tpnt, sizeof(struct WD33C93_hostdata));
- if (a3000_host == NULL) {
- release_mem_region(0xDD0000, 256);
- return 0;
- }
+ if (a3000_host == NULL)
+ goto fail_register;
+
X a3000_host->base = ZTWO_VADDR(0xDD0000);
X a3000_host->irq = IRQ_AMIGA_PORTS;
X DMA(a3000_host)->DAWR = DAWR_A3000;
- wd33c93_init(a3000_host, (wd33c93_regs *)&(DMA(a3000_host)->SASR),
- dma_setup, dma_stop, WD33C93_FS_12_15);
- request_irq(IRQ_AMIGA_PORTS, a3000_intr, SA_SHIRQ, "A3000 SCSI",
- a3000_intr);
+ regs.SASR = &(DMA(a3000_host)->SASR);
+ regs.SCMD = &(DMA(a3000_host)->SCMD);
+ wd33c93_init(a3000_host, regs, dma_setup, dma_stop, WD33C93_FS_12_15);
+ if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, SA_SHIRQ, "A3000 SCSI",
+ a3000_intr))
+ goto fail_irq;
X DMA(a3000_host)->CNTR = CNTR_PDMD | CNTR_INTEN;
- called = 1;
X
X return 1;
+
+fail_irq:
+#ifdef MODULE
+ wd33c93_release();
+#endif /* MODULE */
+ scsi_unregister(a3000_host);
+fail_register:
+ release_mem_region(0xDD0000, 256);
+ return 0;
X }
X
X #define HOSTS_C
@@ -208,13 +214,13 @@
X
X #include "scsi_module.c"
X
-int a3000_release(struct Scsi_Host *instance)
+int __exit a3000_release(struct Scsi_Host *instance)
X {
X #ifdef MODULE
X wd33c93_release();
+#endif /* MODULE*/
X DMA(instance)->CNTR = 0;
X release_mem_region(0xDD0000, 256);
X free_irq(IRQ_AMIGA_PORTS, a3000_intr);
-#endif
X return 1;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7770.c linux/drivers/scsi/aic7xxx/aic7770.c
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7770.c Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7770.c Thu Oct 25 13:53:48 2001
@@ -9,27 +9,35 @@
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
- * notice immediately at the beginning of the file, without modification,
- * this list of conditions, and the following disclaimer.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *
X * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL").
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
X *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * 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.
+ * 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 DAMAGES.
X *
- * $Id: //depot/src/aic7xxx/aic7770.c#12 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7770.c#14 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aic7770.c,v 1.1 2000/09/16 20:02:27 gibbs Exp $
X */
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7770_linux.c linux/drivers/scsi/aic7xxx/aic7770_linux.c
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7770_linux.c Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7770_linux.c Thu Oct 25 13:53:48 2001


@@ -1,7 +1,7 @@
X /*

X * Linux driver attachment glue for aic7770 based controllers.
X *
- * Copyright (c) 2000 Adaptec Inc.
+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
@@ -10,25 +10,33 @@
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,
X * without modification.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *
X * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL").
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
X *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * 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.
+ * 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 DAMAGES.
X *
- * $Id: //depot/src/linux/drivers/scsi/aic7xxx/aic7770_linux.c#7 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7770_linux.c#9 $
X */
X
X #include "aic7xxx_osm.h"
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx.c linux/drivers/scsi/aic7xxx/aic7xxx.c
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx.c Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx.c Thu Oct 25 13:53:48 2001
@@ -2,6 +2,7 @@
X * Core routines and tables shareable across OS platforms.
X *
X * Copyright (c) 1994-2001 Justin T. Gibbs.
+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
@@ -10,25 +11,33 @@
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,
X * without modification.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *
X * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL").
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
X *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * 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.
+ * 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 DAMAGES.
X *
- * $Id: //depot/src/aic7xxx/aic7xxx.c#44 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#50 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.61 2000/11/13 03:35:43 gibbs Exp $
X */
@@ -129,6 +138,7 @@
X #include "aic7xxx_seq.h"
X
X /**************************** Function Declarations ***************************/
+static void ahc_force_renegotiation(struct ahc_softc *ahc);
X static struct ahc_tmode_tstate*
X ahc_alloc_tstate(struct ahc_softc *ahc,
X u_int scsi_id, char channel);
@@ -203,9 +213,6 @@
X static void ahc_add_curscb_to_free_list(struct ahc_softc *ahc);
X static u_int ahc_rem_wscb(struct ahc_softc *ahc,
X u_int scbpos, u_int prev);
-static int ahc_abort_scbs(struct ahc_softc *ahc, int target,
- char channel, int lun, u_int tag,
- role_t role, uint32_t status);
X static void ahc_reset_current_bus(struct ahc_softc *ahc);
X #ifdef AHC_DUMP_SEQ
X static void ahc_dumpseq(struct ahc_softc *ahc);
@@ -240,6 +247,7 @@
X ahc_outb(ahc, SCSISIGO, 0); /* De-assert BSY */
X ahc_outb(ahc, MSG_OUT, MSG_NOOP); /* No message to send */
X ahc_outb(ahc, SXFRCTL1, ahc_inb(ahc, SXFRCTL1) & ~BITBUCKET);
+ ahc_outb(ahc, LASTPHASE, P_BUSFREE);
X
X /*
X * Ensure that the sequencer's idea of TQINPOS
@@ -705,19 +713,20 @@
X MSG_TYPE_INITIATOR_MSGIN;
X ahc->msgin_index = 0;
X }
- } else {
+ }
+#if AHC_TARGET_MODE
+ else {
X if (bus_phase == P_MESGOUT) {
X ahc->msg_type =
X MSG_TYPE_TARGET_MSGOUT;
X ahc->msgin_index = 0;
X }
-#if AHC_TARGET_MODE
X else
X ahc_setup_target_msgin(ahc,
X &devinfo,
X scb);
-#endif
X }
+#endif
X }
X
X ahc_handle_message_phase(ahc);
@@ -1063,10 +1072,16 @@
X else
X ahc_outb(ahc, MSG_OUT, mesg_out);
X }
+ /*
+ * Force a renegotiation with this target just in
+ * case we are out of sync for some external reason
+ * unknown (or unreported) by the target.
+ */
+ ahc_force_renegotiation(ahc);
X ahc_outb(ahc, CLRINT, CLRSCSIINT);
X ahc_unpause(ahc);
X } else if ((status & SELTO) != 0) {
- u_int scbptr;
+ u_int scbptr;
X
X /* Stop the selection */
X ahc_outb(ahc, SCSISEQ, 0);
@@ -1102,6 +1117,16 @@
X ahc_freeze_devq(ahc, scb);
X }
X ahc_outb(ahc, CLRINT, CLRSCSIINT);
+ /*
+ * Force a renegotiation with this target just in
+ * case the cable was pulled and will later be
+ * re-attached. The target may forget its negotiation
+ * settings with us should it attempt to reselect
+ * during the interruption. The target will not issue
+ * a unit attention in this case, so we must always
+ * renegotiate.
+ */
+ ahc_force_renegotiation(ahc);
X ahc_restart(ahc);
X } else if ((status & BUSFREE) != 0
X && (ahc_inb(ahc, SIMODE1) & ENBUSFREE) != 0) {
@@ -1167,7 +1192,6 @@
X printerror = 0;
X } else if (ahc_sent_msg(ahc, AHCMSG_1B,
X MSG_BUS_DEV_RESET, TRUE)) {
- struct ahc_devinfo devinfo;
X #ifdef __FreeBSD__
X /*
X * Don't mark the user's request for this BDR
@@ -1277,6 +1301,27 @@
X }
X }
X
+/*
+ * Force renegotiation to occur the next time we initiate
+ * a command to the current device.
+ */
+static void
+ahc_force_renegotiation(struct ahc_softc *ahc)
+{
+ struct ahc_devinfo devinfo;
+ struct ahc_initiator_tinfo *targ_info;
+ struct ahc_tmode_tstate *tstate;
+
+ ahc_fetch_devinfo(ahc, &devinfo);
+ targ_info = ahc_fetch_transinfo(ahc,
+ devinfo.channel,
+ devinfo.our_scsiid,
+ devinfo.target,
+ &tstate);
+ ahc_update_neg_request(ahc, &devinfo, tstate,
+ targ_info, /*force*/TRUE);
+}
+
X #define AHC_MAX_STEPS 2000
X void
X ahc_clear_critical_section(struct ahc_softc *ahc)
@@ -1382,21 +1427,9 @@
X hscb->scsiid,
X hscb->lun,
X hscb->cdb_len);
- printf("Shared Data: %#02x %#02x %#02x %#02x\n",
- hscb->shared_data.cdb[0],
- hscb->shared_data.cdb[1],
- hscb->shared_data.cdb[2],
- hscb->shared_data.cdb[3]);
- printf(" %#02x %#02x %#02x %#02x\n",
- hscb->shared_data.cdb[4],
- hscb->shared_data.cdb[5],
- hscb->shared_data.cdb[6],


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 33'
echo 'File patch-2.4.14 is continued in part 34'
echo "34" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:57 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part34

#!/bin/sh -x
# this is part 34 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 34; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

- hscb->shared_data.cdb[7]);


- printf(" %#02x %#02x %#02x %#02x\n",

- hscb->shared_data.cdb[8],
- hscb->shared_data.cdb[9],
- hscb->shared_data.cdb[10],
- hscb->shared_data.cdb[11]);
+ printf("Shared Data: ");
+ for (i = 0; i < sizeof(hscb->shared_data.cdb); i++)
+ printf("%#02x", hscb->shared_data.cdb[i]);
X printf(" dataptr:%#x datacnt:%#x sgptr:%#x tag:%#x\n",
X ahc_le32toh(hscb->dataptr),
X ahc_le32toh(hscb->datacnt),


@@ -2296,7 +2329,7 @@
X }

X
X /*
- * Build a wide negotiateion message in our message
+ * Build a wide negotiation message in our message
X * buffer based on the input parameters.


X */
X static void

@@ -2358,6 +2391,8 @@
X ahc_outb(ahc, CLRSINT1, CLRATNO);
X }
X ahc_outb(ahc, MSG_OUT, MSG_NOOP);
+ ahc_outb(ahc, SEQ_FLAGS2,
+ ahc_inb(ahc, SEQ_FLAGS2) & ~TARGET_MSG_PENDING);
X }
X
X /*
@@ -2994,6 +3029,7 @@
X }
X break;
X }
+#ifdef AHC_TARGET_MODE
X case MSG_BUS_DEV_RESET:
X ahc_handle_devreset(ahc, devinfo,
X CAM_BDR_SENT,
@@ -3005,18 +3041,20 @@
X case MSG_ABORT_TAG:
X case MSG_ABORT:
X case MSG_CLEAR_QUEUE:
-#ifdef AHC_TARGET_MODE
+ {
+ int tag;
+
X /* Target mode messages */
X if (devinfo->role != ROLE_TARGET) {
X reject = TRUE;
X break;
X }
+ tag = SCB_LIST_NULL;
+ if (ahc->msgin_buf[0] == MSG_ABORT_TAG)
+ tag = ahc_inb(ahc, INITIATOR_TAG);
X ahc_abort_scbs(ahc, devinfo->target, devinfo->channel,
- devinfo->lun,
- ahc->msgin_buf[0] == MSG_ABORT_TAG
- ? SCB_LIST_NULL
- : ahc_inb(ahc, INITIATOR_TAG),
- ROLE_TARGET, CAM_REQ_ABORTED);
+ devinfo->lun, tag, ROLE_TARGET,
+ CAM_REQ_ABORTED);
X
X tstate = ahc->enabled_targets[devinfo->our_scsiid];
X if (tstate != NULL) {
@@ -3027,12 +3065,14 @@
X ahc_queue_lstate_event(ahc, lstate,
X devinfo->our_scsiid,
X ahc->msgin_buf[0],
- /*arg*/0);
+ /*arg*/tag);
X ahc_send_lstate_events(ahc, lstate);
X }
X }
- done = MSGLOOP_MSGCOMPLETE;
+ ahc_restart(ahc);
+ done = MSGLOOP_TERMINATED;
X break;
+ }
X #endif
X case MSG_TERM_IO_PROC:
X default:
@@ -3501,8 +3541,10 @@
X {
X
X /* The IRQMS bit is only valid on VL and EISA chips */
- if ((ahc->chip & AHC_PCI) != 0)
- ahc->unpause &= ~IRQMS;
+ if ((ahc->chip & AHC_PCI) == 0)
+ ahc->unpause = ahc_inb(ahc, HCNTRL) & IRQMS;
+ else
+ ahc->unpause = 0;
X ahc->pause = ahc->unpause | PAUSE;
X /* XXX The shared scb data stuff should be deprecated */
X if (ahc->scb_data == NULL) {
@@ -3842,11 +3884,11 @@
X
X /* Allocate SCB resources */
X scb_data->scbarray =
- (struct scb *)malloc(sizeof(struct scb) * AHC_SCB_MAX,
+ (struct scb *)malloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC,
X M_DEVBUF, M_NOWAIT);
X if (scb_data->scbarray == NULL)
X return (ENOMEM);
- memset(scb_data->scbarray, 0, sizeof(struct scb) * AHC_SCB_MAX);
+ memset(scb_data->scbarray, 0, sizeof(struct scb) * AHC_SCB_MAX_ALLOC);
X
X /* Determine the number of hardware SCBs and initialize them */
X
@@ -3881,7 +3923,7 @@
X /*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
X /*highaddr*/BUS_SPACE_MAXADDR,
X /*filter*/NULL, /*filterarg*/NULL,
- AHC_SCB_MAX * sizeof(struct hardware_scb),
+ AHC_SCB_MAX_ALLOC * sizeof(struct hardware_scb),
X /*nsegments*/1,
X /*maxsegsz*/BUS_SPACE_MAXSIZE_32BIT,
X /*flags*/0, &scb_data->hscb_dmat) != 0) {
@@ -3902,7 +3944,7 @@
X /* And permanently map them */
X ahc_dmamap_load(ahc, scb_data->hscb_dmat, scb_data->hscb_dmamap,
X scb_data->hscbs,
- AHC_SCB_MAX * sizeof(struct hardware_scb),
+ AHC_SCB_MAX_ALLOC * sizeof(struct hardware_scb),
X ahc_dmamap_cb, &scb_data->hscb_busaddr, /*flags*/0);
X
X scb_data->init_level++;
@@ -3913,7 +3955,7 @@
X /*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
X /*highaddr*/BUS_SPACE_MAXADDR,
X /*filter*/NULL, /*filterarg*/NULL,
- AHC_SCB_MAX * sizeof(struct scsi_sense_data),
+ AHC_SCB_MAX_ALLOC * sizeof(struct scsi_sense_data),
X /*nsegments*/1,
X /*maxsegsz*/BUS_SPACE_MAXSIZE_32BIT,
X /*flags*/0, &scb_data->sense_dmat) != 0) {
@@ -3934,7 +3976,7 @@
X /* And permanently map them */
X ahc_dmamap_load(ahc, scb_data->sense_dmat, scb_data->sense_dmamap,
X scb_data->sense,
- AHC_SCB_MAX * sizeof(struct scsi_sense_data),
+ AHC_SCB_MAX_ALLOC * sizeof(struct scsi_sense_data),
X ahc_dmamap_cb, &scb_data->sense_busaddr, /*flags*/0);
X
X scb_data->init_level++;
@@ -3954,7 +3996,8 @@
X scb_data->init_level++;
X
X /* Perform initial CCB allocation */
- memset(scb_data->hscbs, 0, AHC_SCB_MAX * sizeof(struct hardware_scb));
+ memset(scb_data->hscbs, 0,
+ AHC_SCB_MAX_ALLOC * sizeof(struct hardware_scb));
X ahc_alloc_scbs(ahc);
X
X if (scb_data->numscbs == 0) {
@@ -4046,7 +4089,7 @@
X int i;
X
X scb_data = ahc->scb_data;
- if (scb_data->numscbs >= AHC_SCB_MAX)
+ if (scb_data->numscbs >= AHC_SCB_MAX_ALLOC)
X /* Can't allocate any more */
X return;
X
@@ -4075,7 +4118,8 @@
X physaddr = sg_map->sg_physaddr;
X
X newcount = (PAGE_SIZE / (AHC_NSEG * sizeof(struct ahc_dma_seg)));
- for (i = 0; scb_data->numscbs < AHC_SCB_MAX && i < newcount; i++) {
+ newcount = MIN(newcount, (AHC_SCB_MAX_ALLOC - scb_data->numscbs));
+ for (i = 0; i < newcount; i++) {
X struct scb_platform_data *pdata;
X #ifndef __linux__
X int error;
@@ -4147,7 +4191,7 @@
X
X if ((ahc->flags & AHC_PAGESCBS) != 0)
X sprintf(buf, "%d/%d SCBs",
- ahc->scb_data->maxhscbs, AHC_SCB_MAX);
+ ahc->scb_data->maxhscbs, AHC_MAX_QUEUE);
X else
X sprintf(buf, "%d SCBs", ahc->scb_data->maxhscbs);
X }
@@ -4313,7 +4357,7 @@
X ahc_outb(ahc, SEQ_FLAGS, 0);
X ahc_outb(ahc, SEQ_FLAGS2, 0);
X
- if (ahc->scb_data->maxhscbs < AHC_SCB_MAX) {
+ if (ahc->scb_data->maxhscbs < AHC_SCB_MAX_ALLOC) {
X ahc->flags |= AHC_PAGESCBS;
X } else {
X ahc->flags &= ~AHC_PAGESCBS;
@@ -5517,24 +5561,40 @@
X maxlun = lun + 1;
X }
X
- for (;i < maxtarget; i++) {
- for (j = minlun;j < maxlun; j++)
- ahc_unbusy_tcl(ahc, BUILD_TCL(i << 4, j));
- }
+ if (role != ROLE_TARGET) {
+ for (;i < maxtarget; i++) {
+ for (j = minlun;j < maxlun; j++) {
+ u_int scbid;
+ u_int tcl;
X
- /*
- * Go through the disconnected list and remove any entries we
- * have queued for completion, 0'ing their control byte too.
- * We save the active SCB and restore it ourselves, so there
- * is no reason for this search to restore it too.
- */
- ahc_search_disc_list(ahc, target, channel, lun, tag,
- /*stop_on_first*/FALSE, /*remove*/TRUE,
- /*save_state*/FALSE);
+ tcl = BUILD_TCL(i << 4, j);
+ scbid = ahc_index_busy_tcl(ahc, tcl);
+ scbp = ahc_lookup_scb(ahc, scbid);
+ if (scbp == NULL
+ || ahc_match_scb(ahc, scbp, target, channel,
+ lun, tag, role) == 0)
+ continue;
+ ahc_unbusy_tcl(ahc, BUILD_TCL(i << 4, j));


+ }
+ }
+
+ /*

+ * Go through the disconnected list and remove any entries we
+ * have queued for completion, 0'ing their control byte too.
+ * We save the active SCB and restore it ourselves, so there
+ * is no reason for this search to restore it too.
+ */
+ ahc_search_disc_list(ahc, target, channel, lun, tag,
+ /*stop_on_first*/FALSE, /*remove*/TRUE,
+ /*save_state*/FALSE);
+ }
X
X /*
X * Go through the hardware SCB array looking for commands that
- * were active but not on any list.
+ * were active but not on any list. In some cases, these remnants
+ * might not still have mappings in the scbindex array (e.g. unexpected
+ * bus free with the same scb queued for an abort). Don't hold this
+ * against them.
X */
X for (i = 0; i < ahc->scb_data->maxhscbs; i++) {
X u_int scbid;
@@ -5542,8 +5602,9 @@
X ahc_outb(ahc, SCBPTR, i);
X scbid = ahc_inb(ahc, SCB_TAG);
X scbp = ahc_lookup_scb(ahc, scbid);
- if (scbp != NULL
- && ahc_match_scb(ahc, scbp, target, channel, lun, tag, role))
+ if ((scbp == NULL && scbid != SCB_LIST_NULL)
+ || (scbp != NULL
+ && ahc_match_scb(ahc, scbp, target, channel, lun, tag, role)))
X ahc_add_curscb_to_free_list(ahc);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx.h linux/drivers/scsi/aic7xxx/aic7xxx.h
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx.h Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx.h Thu Oct 25 13:53:49 2001
@@ -2,6 +2,7 @@
X * Core definitions and data structures shareable across OS platforms.


X *
X * Copyright (c) 1994-2001 Justin T. Gibbs.
+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
@@ -10,25 +11,33 @@
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,
X * without modification.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *
X * Alternatively, this software may be distributed under the terms of the

- * GNU Public License ("GPL").

- * $Id: //depot/src/aic7xxx/aic7xxx.h#29 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.h#34 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.h,v 1.30 2000/11/10 20:13:40 gibbs Exp $
X */
@@ -147,6 +156,13 @@
X #define AHC_MAX_QUEUE 253
X
X /*
+ * The maximum amount of SCB storage we allocate in host memory. This
+ * number should reflect the 1 additional SCB we require to handle our
+ * qinfifo mechanism.
+ */
+#define AHC_SCB_MAX_ALLOC (AHC_MAX_QUEUE+1)
+
+/*
X * Ring Buffer of incoming target commands.
X * We allocate 256 to simplify the logic in the sequencer
X * by using the natural wrap point of an 8bit counter.
@@ -373,10 +389,12 @@
X * Target mode version of the shared data SCB segment.
X */
X struct target_data {
- uint8_t target_phases; /* Bitmap of phases to execute */
- uint8_t data_phase; /* Data-In or Data-Out */
- uint8_t scsi_status; /* SCSI status to give to initiator */
- uint8_t initiator_tag; /* Initiator's transaction tag */
+ uint32_t residual_datacnt; /* Residual in the current S/G seg */
+ uint32_t residual_sg_ptr; /* The next S/G for this transfer */
+ uint8_t scsi_status; /* SCSI status to give to initiator */
+ uint8_t target_phases; /* Bitmap of phases to execute */
+ uint8_t data_phase; /* Data-In or Data-Out */
+ uint8_t initiator_tag; /* Initiator's transaction tag */
X };
X
X struct hardware_scb {
@@ -387,10 +405,10 @@
X * of the cdb payload as seen by the chip and a DMA
X * is used to pull it in.
X */
- uint8_t cdb[12];
- uint32_t cdb_ptr;
- struct status_pkt status;
- struct target_data tdata;
+ uint8_t cdb[12];
+ uint32_t cdb_ptr;
+ struct status_pkt status;
+ struct target_data tdata;
X } shared_data;
X /*
X * A word about residuals.
@@ -544,7 +562,15 @@
X * Pool of SCBs ready to be assigned
X * commands to execute.
X */
- struct scb *scbindex[AHC_SCB_MAX + 1];/* Mapping from tag to SCB */
+ struct scb *scbindex[256]; /*
+ * Mapping from tag to SCB.
+ * As tag identifiers are an
+ * 8bit value, we provide space
+ * for all possible tag values.
+ * Any lookups to entries at or
+ * above AHC_SCB_MAX_ALLOC will
+ * always fail.
+ */
X struct hardware_scb *hscbs; /* Array of hardware SCBs */
X struct scb *scbarray; /* Array of kernel SCBs */
X struct scsi_sense_data *sense; /* Per SCB sense data */
@@ -1127,6 +1153,9 @@
X void ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb);
X int ahc_reset_channel(struct ahc_softc *ahc, char channel,
X int initiate_reset);
+int ahc_abort_scbs(struct ahc_softc *ahc, int target,
+ char channel, int lun, u_int tag,
+ role_t role, uint32_t status);
X void ahc_restart(struct ahc_softc *ahc);
X void ahc_calc_residual(struct scb *scb);
X /*************************** Utility Functions ********************************/
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx.reg linux/drivers/scsi/aic7xxx/aic7xxx.reg
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx.reg Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx.reg Thu Oct 25 13:53:49 2001
@@ -1,7 +1,8 @@
X /*
X * Aic7xxx register and scratch ram definitions.
X *
- * Copyright (c) 1994-2001 Justin Gibbs.
+ * Copyright (c) 1994-2001 Justin T. Gibbs.


+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without

@@ -10,27 +11,35 @@


X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,
X * without modification.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *
X * Alternatively, this software may be distributed under the terms of the

- * GNU Public License ("GPL").

X * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.reg,v 1.31 2000/11/10 20:13:40 gibbs Exp $
X */
-VERSION = "$Id: //depot/src/aic7xxx/aic7xxx.reg#19 $"
+VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#24 $"
X
X /*
X * This file is processed by the aic7xxx_asm utility for use in assembling
@@ -328,6 +337,7 @@
X access_mode RO
X mask SCSICNT 0xf0
X mask OFFCNT 0x0f
+ mask U2OFFCNT 0x7f
X }
X
X /*
@@ -1004,7 +1014,6 @@
X size 4
X alias SCB_RESIDUAL_DATACNT
X alias SCB_CDB_STORE
- alias SCB_TARGET_INFO
X }
X SCB_RESIDUAL_SGPTR {
X size 4
@@ -1012,8 +1021,14 @@
X SCB_SCSI_STATUS {
X size 1
X }
- SCB_CDB_STORE_PAD {
- size 3
+ SCB_TARGET_PHASES {
+ size 1
+ }
+ SCB_TARGET_DATA_DIR {
+ size 1
+ }
+ SCB_TARGET_ITAG {
+ size 1
X }
X SCB_DATAPTR {
X size 4
@@ -1464,7 +1479,8 @@
X
X SEQ_FLAGS2 {
X size 1
- bit SCB_DMA 0x01
+ bit SCB_DMA 0x01
+ bit TARGET_MSG_PENDING 0x02
X }
X /*
X * These are reserved registers in the card's scratch ram. Some of
@@ -1529,10 +1545,6 @@
X
X const STATUS_BUSY 0x08
X const STATUS_QUEUE_FULL 0x28
-const SCB_TARGET_PHASES 0
-const SCB_TARGET_DATA_DIR 1
-const SCB_TARGET_STATUS 2
-const SCB_INITIATOR_TAG 3
X const TARGET_DATA_IN 1
X
X /*
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx.seq linux/drivers/scsi/aic7xxx/aic7xxx.seq
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx.seq Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx.seq Thu Oct 25 13:53:49 2001
@@ -1,7 +1,8 @@
X /*
X * Adaptec 274x/284x/294x device driver firmware for Linux and FreeBSD.
X *
- * Copyright (c) 1994-2001 Justin Gibbs.
+ * Copyright (c) 1994-2001 Justin T. Gibbs.


+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without

@@ -10,28 +11,36 @@


X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,
X * without modification.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *
X * Alternatively, this software may be distributed under the terms of the

- * GNU Public License ("GPL").

X * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.seq,v 1.106 2000/11/12 05:19:46 gibbs Exp $
X */
X
-VERSION = "$Id: //depot/src/aic7xxx/aic7xxx.seq#33 $"
+VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#37 $"
X
X #include "aic7xxx.reg"
X #include "scsi_message.h"
@@ -242,6 +251,7 @@
X } else {
X mov DFDAT, DINDEX;
X }
+ and SAVED_LUN, MSG_IDENTIFY_LUNMASK, DINDEX;
X
X /* Remember for disconnection decision */
X test DINDEX, MSG_IDENTIFY_DISCFLAG jnz . + 2;
@@ -257,9 +267,10 @@
X * < MSG_IGN_WIDE_RESIDUE.
X */
X add A, -MSG_SIMPLE_Q_TAG, DINDEX;
- jnc ident_messages_done;
+ jnc ident_messages_done_msg_pending;
X add A, -MSG_IGN_WIDE_RESIDUE, DINDEX;
- jc ident_messages_done;
+ jc ident_messages_done_msg_pending;
+
X /* Store for host */
X if ((ahc->features & AHC_CMD_CHAN) != 0) {
X mov CCSCBRAM, DINDEX;
@@ -285,9 +296,23 @@
X }
X mov INITIATOR_TAG, DINDEX;
X or SEQ_FLAGS, TARGET_CMD_IS_TAGGED;
- test SCSISIGI, ATNI jz . + 2;
- /* Initiator still wants to give us messages */
- call target_inb;
+
+ident_messages_done:
+ /* Terminate the ident list */
+ if ((ahc->features & AHC_CMD_CHAN) != 0) {
+ mvi CCSCBRAM, SCB_LIST_NULL;
+ } else {
+ mvi DFDAT, SCB_LIST_NULL;
+ }
+ or SEQ_FLAGS, TARG_CMD_PENDING|IDENTIFY_SEEN;
+ test SEQ_FLAGS2, TARGET_MSG_PENDING
+ jnz target_mesgout_pending;
+ test SCSISIGI, ATNI jnz target_mesgout_continue;
+ jmp target_ITloop;
+
+
+ident_messages_done_msg_pending:
+ or SEQ_FLAGS2, TARGET_MSG_PENDING;
X jmp ident_messages_done;
X
X /*
@@ -299,31 +324,6 @@
X cmp RETURN_1, EXIT_MSG_LOOP je target_ITloop;
X test SSTAT0, SPIORDY jz .;
X jmp host_target_message_loop;
-
-ident_messages_done:
- /* If ring buffer is full, return busy or queue full */
- if ((ahc->features & AHC_HS_MAILBOX) != 0) {
- and A, HOST_TQINPOS, HS_MAILBOX;
- } else {
- mov A, KERNEL_TQINPOS;
- }
- cmp TQINPOS, A jne tqinfifo_has_space;
- mvi P_STATUS|BSYO call change_phase;
- test SEQ_FLAGS, TARGET_CMD_IS_TAGGED jz . + 3;
- mvi STATUS_QUEUE_FULL call target_outb;
- jmp target_busfree_wait;
- mvi STATUS_BUSY call target_outb;
- jmp target_busfree_wait;
-tqinfifo_has_space:
- /* Terminate the ident list */
- if ((ahc->features & AHC_CMD_CHAN) != 0) {
- mvi CCSCBRAM, SCB_LIST_NULL;
- } else {
- mvi DFDAT, SCB_LIST_NULL;
- }
- or SEQ_FLAGS, TARG_CMD_PENDING|IDENTIFY_SEEN;
- test SCSISIGI, ATNI jnz target_mesgout_pending;
- jmp target_ITloop;
X }
X
X if ((ahc->flags & AHC_INITIATORROLE) != 0) {
@@ -464,13 +464,13 @@
X */
X test SCB_CONTROL, TAG_ENB jz . + 3;
X mvi MSG_SIMPLE_Q_TAG call target_outb;
- mov SCB_TARGET_INFO[SCB_INITIATOR_TAG] call target_outb;
+ mov SCB_TARGET_ITAG call target_outb;
X target_synccmd:
X /*
X * Now determine what phases the host wants us
X * to go through.
X */
- mov SEQ_FLAGS, SCB_TARGET_INFO[SCB_TARGET_PHASES];
+ mov SEQ_FLAGS, SCB_TARGET_PHASES;
X
X test SCB_CONTROL, MK_MESSAGE jz target_ITloop;
X mvi P_MESGIN|BSYO call change_phase;
@@ -528,6 +528,24 @@
X jmp poll_for_work;
X
X target_cmdphase:
+ /*
+ * The target has dropped ATN (doesn't want to abort or BDR)
+ * and we believe this selection to be valid. If the ring
+ * buffer for new commands is full, return busy or queue full.
+ */
+ if ((ahc->features & AHC_HS_MAILBOX) != 0) {
+ and A, HOST_TQINPOS, HS_MAILBOX;
+ } else {
+ mov A, KERNEL_TQINPOS;
+ }
+ cmp TQINPOS, A jne tqinfifo_has_space;
+ mvi P_STATUS|BSYO call change_phase;
+ test SEQ_FLAGS, TARGET_CMD_IS_TAGGED jz . + 3;
+ mvi STATUS_QUEUE_FULL call target_outb;
+ jmp target_busfree_wait;
+ mvi STATUS_BUSY call target_outb;
+ jmp target_busfree_wait;
+tqinfifo_has_space:
X mvi P_COMMAND|BSYO call change_phase;
X call target_inb;
X mov A, DINDEX;
@@ -576,15 +594,14 @@
X * data direction of the DMA. Toggle it for
X * target transfers.
X */
- xor LASTPHASE, IOI, SCB_TARGET_INFO[SCB_TARGET_DATA_DIR];
- or SCB_TARGET_INFO[SCB_TARGET_DATA_DIR], BSYO
- call change_phase;
+ xor LASTPHASE, IOI, SCB_TARGET_DATA_DIR;
+ or SCB_TARGET_DATA_DIR, BSYO call change_phase;
X jmp p_data;
X
X target_sphase:
X mvi P_STATUS|BSYO call change_phase;
X mvi LASTPHASE, P_STATUS;
- mov SCB_TARGET_INFO[SCB_TARGET_STATUS] call target_outb;
+ mov SCB_SCSI_STATUS call target_outb;
X /* XXX Watch for ATN or parity errors??? */
X mvi SCSISIGO, P_MESGIN|BSYO;
X /* MSG_CMDCMPLT is 0, but we can't do an immediate of 0 */
@@ -1318,10 +1335,19 @@
X and SEQ_FLAGS, ~DPHASE_PENDING;
X /*
X * For data-in phases, wait for any pending acks from the
- * initiator before changing phase.
+ * initiator before changing phase. We only need to
+ * send Ignore Wide Residue messages for data-in phases.
X */
X test DFCNTRL, DIRECTION jz target_ITloop;
X test SSTAT1, REQINIT jnz .;
+ test DATA_COUNT_ODD, 0x1 jz target_ITloop;
+ test SCSIRATE, WIDEXFER jz target_ITloop;
+ /*
+ * Issue an Ignore Wide Residue Message.
+ */
+ mvi P_MESGIN|BSYO call change_phase;
+ mvi MSG_IGN_WIDE_RESIDUE call target_outb;
+ mvi 1 call target_outb;
X jmp target_ITloop;
X } else {
X jmp ITloop;
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_93cx6.c linux/drivers/scsi/aic7xxx/aic7xxx_93cx6.c
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_93cx6.c Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_93cx6.c Thu Oct 25 13:53:49 2001
@@ -28,7 +28,7 @@
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X *
- * $Id: //depot/src/aic7xxx/aic7xxx_93cx6.c#8 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_93cx6.c#10 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_93cx6.c,v 1.9 2000/11/10 20:13:41 gibbs Exp $
X */
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_93cx6.h linux/drivers/scsi/aic7xxx/aic7xxx_93cx6.h
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_93cx6.h Sun Mar 4 14:30:18 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_93cx6.h Thu Oct 25 13:53:49 2001
@@ -12,25 +12,33 @@


X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,
X * without modification.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *
X * Alternatively, this software may be distributed under the terms of the

- * GNU Public License ("GPL").

- * $Id: //depot/src/aic7xxx/aic7xxx_93cx6.h#5 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_93cx6.h#7 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_93cx6.h,v 1.8 2000/11/10 20:13:41 gibbs Exp $
X */
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_inline.h linux/drivers/scsi/aic7xxx/aic7xxx_inline.h
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_inline.h Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_inline.h Thu Oct 25 13:53:49 2001
@@ -2,6 +2,7 @@
X * Inline routines shareable across OS platforms.


X *
X * Copyright (c) 1994-2001 Justin T. Gibbs.
+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
@@ -10,25 +11,33 @@
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,
X * without modification.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *
X * Alternatively, this software may be distributed under the terms of the

- * GNU Public License ("GPL").

- * $Id: //depot/src/aic7xxx/aic7xxx_inline.h#27 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_inline.h#31 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_inline.h,v 1.8 2000/11/12 05:19:46 gibbs Exp $
X */
@@ -482,7 +491,6 @@
X ahc_intr(struct ahc_softc *ahc)
X {
X u_int intstat;
- u_int queuestat;
X
X /*
X * Instead of directly reading the interrupt status register,
@@ -491,15 +499,10 @@
X * most cases.
X */
X if ((ahc->flags & (AHC_ALL_INTERRUPTS|AHC_EDGE_INTERRUPT)) == 0
- && (queuestat = ahc_check_cmdcmpltqueues(ahc)) != 0)
+ && (ahc_check_cmdcmpltqueues(ahc) != 0))
X intstat = CMDCMPLT;
X else {
X intstat = ahc_inb(ahc, INTSTAT);
- queuestat = AHC_RUN_QOUTFIFO;
-#ifdef AHC_TARGET_MODE
- if ((ahc->flags & AHC_TARGETROLE) != 0)
- queuestat |= AHC_RUN_TQINFIFO;
-#endif
X }
X
X if (intstat & CMDCMPLT) {
@@ -515,11 +518,11 @@
X */
X ahc_flush_device_writes(ahc);
X #ifdef AHC_TARGET_MODE
- if ((queuestat & AHC_RUN_QOUTFIFO) != 0)
+ if ((ahc->flags & AHC_INITIATORROLE) != 0)
X #endif
X ahc_run_qoutfifo(ahc);
X #ifdef AHC_TARGET_MODE
- if ((queuestat & AHC_RUN_TQINFIFO) != 0)
+ if ((ahc->flags & AHC_TARGETROLE) != 0)
X ahc_run_tqinfifo(ahc, /*paused*/FALSE);
X #endif
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_linux.c linux/drivers/scsi/aic7xxx/aic7xxx_linux.c
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_linux.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_linux.c Thu Oct 25 13:53:49 2001


@@ -1,7 +1,7 @@
X /*

X * Adaptec AIC7xxx device driver for Linux.
X *
- * $Id: //depot/src/linux/drivers/scsi/aic7xxx/aic7xxx_linux.c#72 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_linux.c#79 $
X *
X * Copyright (c) 1994 John Aycock
X * The University of Calgary Department of Computer Science.
@@ -38,8 +38,8 @@
X * SCB paging, and other rework of the code.
X *
X * --------------------------------------------------------------------------
- * Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999, 2000 Justin T. Gibbs.


- * Copyright (c) 2000 Adaptec Inc.

+ * Copyright (c) 1994-2000 Justin T. Gibbs.


+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without

@@ -48,23 +48,31 @@

X *---------------------------------------------------------------------------
X *
@@ -79,8 +87,6 @@
X *
X * Form: aic7xxx=extended
X * aic7xxx=no_reset
- * aic7xxx=ultra
- * aic7xxx=irq_trigger:[0,1] # 0 edge, 1 level
X * aic7xxx=verbose
X *
X * Daniel M. Eischen, deis...@iworks.InterWorks.org, 1/23/97
@@ -113,15 +119,6 @@
X *
X */
X
-/*
- * The next three defines are user configurable. These should be the only
- * defines a user might need to get in here and change. There are other
- * defines buried deeper in the code, but those really shouldn't need touched
- * under normal conditions.
- */
-
-#include <linux/module.h>
-
X #include "aic7xxx_osm.h"
X #include "aic7xxx_inline.h"
X
@@ -324,83 +321,6 @@
X static uint32_t aic7xxx_extended = 0;
X
X /*
- * The IRQ trigger method used on EISA controllers. Does not effect PCI cards.
- * -1 = Use detected settings.
- * 0 = Force Edge triggered mode.
- * 1 = Force Level triggered mode.
- */
-static int aic7xxx_irq_trigger = -1;
-
-/*
- * This variable is used to override the termination settings on a controller.
- * This should not be used under normal conditions. However, in the case
- * that a controller does not have a readable SEEPROM (so that we can't
- * read the SEEPROM settings directly) and that a controller has a buggered
- * version of the cable detection logic, this can be used to force the
- * correct termination. It is preferable to use the manual termination
- * settings in the BIOS if possible, but some motherboard controllers store
- * those settings in a format we can't read. In other cases, auto term
- * should also work, but the chipset was put together with no auto term
- * logic (common on motherboard controllers). In those cases, we have
- * 32 bits here to work with. That's good for 8 controllers/channels. The
- * bits are organized as 4 bits per channel, with scsi0 getting the lowest
- * 4 bits in the int. A 1 in a bit position indicates the termination setting
- * that corresponds to that bit should be enabled, a 0 is disabled.
- * It looks something like this:
- *
- * 0x0f = 1111-Single Ended Low Byte Termination on/off
- * ||\-Single Ended High Byte Termination on/off
- * |\-LVD Low Byte Termination on/off
- * \-LVD High Byte Termination on/off
- *
- * For non-Ultra2 controllers, the upper 2 bits are not important. So, to
- * enable both high byte and low byte termination on scsi0, I would need to
- * make sure that the override_term variable was set to 0x03 (bits 0011).
- * To make sure that all termination is enabled on an Ultra2 controller at
- * scsi2 and only high byte termination on scsi1 and high and low byte
- * termination on scsi0, I would set override_term=0xf23 (bits 1111 0010 0011)
- *
- * For the most part, users should never have to use this, that's why I
- * left it fairly cryptic instead of easy to understand. If you need it,
- * most likely someone will be telling you what your's needs to be set to.
- */
-static int aic7xxx_override_term = -1;
-
-/*
- * Certain motherboard chipset controllers tend to screw
- * up the polarity of the term enable output pin. Use this variable
- * to force the correct polarity for your system. This is a bitfield variable
- * similar to the previous one, but this one has one bit per channel instead
- * of four.
- * 0 = Force the setting to active low.
- * 1 = Force setting to active high.
- * Most Adaptec cards are active high, several motherboards are active low.
- * To force a 2940 card at SCSI 0 to active high and a motherboard 7895
- * controller at scsi1 and scsi2 to active low, and a 2910 card at scsi3
- * to active high, you would need to set stpwlev=0x9 (bits 1001).
- *
- * People shouldn't need to use this, but if you are experiencing lots of
- * SCSI timeout problems, this may help. There is one sure way to test what
- * this option needs to be. Using a boot floppy to boot the system, configure
- * your system to enable all SCSI termination (in the Adaptec SCSI BIOS) and
- * if needed then also pass a value to override_term to make sure that the
- * driver is enabling SCSI termination, then set this variable to either 0
- * or 1. When the driver boots, make sure there are *NO* SCSI cables
- * connected to your controller. If it finds and inits the controller
- * without problem, then the setting you passed to stpwlev was correct. If
- * the driver goes into a reset loop and hangs the system, then you need the
- * other setting for this variable. If neither setting lets the machine
- * boot then you have definite termination problems that may not be fixable.
- */
-static int aic7xxx_stpwlev = -1;
-
-/*
- * Set this to non-0 in order to force the driver to panic the kernel
- * and print out debugging info on a SCSI abort or reset cycle.
- */
-static int aic7xxx_panic_on_abort = 0;
-
-/*
X * PCI bus parity checking of the Adaptec controllers. This is somewhat
X * dubious at best. To my knowledge, this option has never actually
X * solved a PCI parity problem, but on certain machines with broken PCI
@@ -418,15 +338,6 @@
X static int aic7xxx_pci_parity = 0;
X
X /*
- * Set this to a non-0 value to make us dump out the 32 bit instruction
- * registers on the card after completing the sequencer download. This
- * allows the actual sequencer download to be verified. It is possible
- * to use this option and still boot up and run your system. This is
- * only intended for debugging purposes.
- */
-static int aic7xxx_dump_sequencer = 0;
-
-/*
X * Certain newer motherboards have put new PCI based devices into the
X * IO spaces that used to typically be occupied by VLB or EISA cards.
X * This overlap can cause these newer motherboards to lock up when scanned
@@ -458,13 +369,20 @@
X static int aic7xxx_seltime = 0x00;
X
X /*
- * So that insmod can find the variable and make it point to something
+ * Certain devices do not perform any aging on commands. Should the
+ * device be saturated by commands in one portion of the disk, it is
+ * possible for transactions on far away sectors to never be serviced.
+ * To handle these devices, we can periodically send an ordered tag to
+ * force all outstanding transactions to be serviced prior to a new
+ * transaction.
+ */
+int aic7xxx_periodic_otag;
+
+/*
+ * Module information and settable options.
X */
X #ifdef MODULE
X static char *aic7xxx = NULL;
-
-MODULE_PARM(aic7xxx, "s");
-
X /*
X * Just in case someone uses commas to separate items on the insmod
X * command line, we define a dummy buffer here to avoid having insmod
@@ -472,6 +390,32 @@
X */
X static char dummy_buffer[60] = "Please don't trounce on me insmod!!\n";
X
+MODULE_AUTHOR("Maintainer: Justin T. Gibbs <gi...@scsiguy.com>");
+MODULE_DESCRIPTION("Adaptec Aic77XX/78XX SCSI Host Bus Adapter driver");
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,10)
+MODULE_LICENSE("Dual BSD/GPL");
+#endif
+MODULE_PARM(aic7xxx, "s");
+MODULE_PARM_DESC(aic7xxx, "period delimited, options string.
+ verbose Enable verbose/diagnostic logging
+ no_probe Disable EISA/VLB controller probing
+ no_reset Supress initial bus resets
+ extended Enable extended geometry on all controllers
+ periodic_otag Send an ordered tagged transaction periodically
+ to prevent tag starvation. This may be
+ required by some older disk drives/RAID arrays.
+ reverse_scan Sort PCI devices highest Bus/Slot to lowest
+ tag_info:<tag_str> Set per-target tag depth
+ seltime:<int> Selection Timeout(0/256ms,1/128ms,2/64ms,3/32ms)
+
+ Sample /etc/modules.conf line:
+ Enable verbose logging
+ Disable EISA/VLB probing
+ Set tag depth on Controller 2/Target 2 to 10 tags
+ Shorten the selection timeout to 128ms from its default of 256
+
+ options aic7xxx='\"verbose.no_probe.tag_info:{{}.{}.{..10}}.seltime:1\"'
+");
X #endif
X
X static void ahc_linux_handle_scsi_status(struct ahc_softc *,
@@ -661,11 +605,17 @@
X sg = (struct scatterlist *)cmd->request_buffer;
X pci_unmap_sg(ahc->dev_softc, sg, cmd->use_sg,
X scsi_to_pci_dma_dir(cmd->sc_data_direction));
- } else if (cmd->request_bufflen != 0)
+ } else if (cmd->request_bufflen != 0) {
+ u_int32_t high_addr;
+
+ high_addr = ahc_le32toh(scb->sg_list[0].len)
+ & AHC_SG_HIGH_ADDR_MASK;
X pci_unmap_single(ahc->dev_softc,
- ahc_le32toh(scb->sg_list[0].addr),
+ ahc_le32toh(scb->sg_list[0].addr)
+ | (((dma_addr_t)high_addr) << 8),
X cmd->request_bufflen,
X scsi_to_pci_dma_dir(cmd->sc_data_direction));
+ }
X }
X
X static __inline int
@@ -722,8 +672,10 @@
X {
X struct ahc_softc *ahc;
X
- TAILQ_FOREACH(ahc, &ahc_tailq, links) {
- ahc_shutdown(ahc);
+ if (event == SYS_DOWN || event == SYS_HALT) {
+ TAILQ_FOREACH(ahc, &ahc_tailq, links) {
+ ahc_shutdown(ahc);
+ }
X }
X return (NOTIFY_OK);
X }
@@ -786,22 +738,24 @@
X * address). For this reason, we have to reset
X * our dma mask when doing allocations.
X */
+ if(ahc->dev_softc)
X #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,3)
- pci_set_dma_mask(ahc->dev_softc, 0xFFFFFFFF);
+ pci_set_dma_mask(ahc->dev_softc, 0xFFFFFFFF);
X #else
- ahc->dev_softc->dma_mask = 0xFFFFFFFF;
+ ahc->dev_softc->dma_mask = 0xFFFFFFFF;
X #endif
X *vaddr = pci_alloc_consistent(ahc->dev_softc,
X dmat->maxsize, &map->bus_addr);
+ if (ahc->dev_softc)
X #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,3)
- pci_set_dma_mask(ahc->dev_softc, ahc->platform_data->hw_dma_mask);
+ pci_set_dma_mask(ahc->dev_softc, ahc->platform_data->hw_dma_mask);
X #else
- ahc->dev_softc->dma_mask = ahc->platform_data->hw_dma_mask;
+ ahc->dev_softc->dma_mask = ahc->platform_data->hw_dma_mask;
X #endif
X #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) */
X /*
X * At least in 2.2.14, malloc is a slab allocator so all
- * allocations are aligned. We assume, for these kernel versions
+ * allocations are aligned. We assume for these kernel versions
X * that all allocations will be bellow 4Gig, physically contiguous,
X * and accessable via DMA by the controller.
X */
@@ -906,12 +860,20 @@
X {
X char primary_channel;
X
- value = ahc_get_pci_bus(lahc->dev_softc)
- - ahc_get_pci_bus(rahc->dev_softc);
+ if (aic7xxx_reverse_scan != 0)
+ value = ahc_get_pci_bus(rahc->dev_softc)
+ - ahc_get_pci_bus(lahc->dev_softc);
+ else
+ value = ahc_get_pci_bus(lahc->dev_softc)
+ - ahc_get_pci_bus(rahc->dev_softc);
X if (value != 0)
X break;
- value = ahc_get_pci_slot(lahc->dev_softc)
- - ahc_get_pci_slot(rahc->dev_softc);
+ if (aic7xxx_reverse_scan != 0)
+ value = ahc_get_pci_slot(rahc->dev_softc)
+ - ahc_get_pci_slot(lahc->dev_softc);
+ else
+ value = ahc_get_pci_slot(lahc->dev_softc)
+ - ahc_get_pci_slot(rahc->dev_softc);
X if (value != 0)
X break;
X /*
@@ -1028,7 +990,7 @@
X /*
X * Handle Linux boot parameters. This routine allows for assigning a value
X * to a parameter with a ':' between the parameter and the value.
- * ie. aic7xxx=unpause:0x0A,extended
+ * ie. aic7xxx=stpwlev:1,extended
X */
X int
X aic7xxx_setup(char *s)
@@ -1043,15 +1005,11 @@
X } options[] = {
X { "extended", &aic7xxx_extended },
X { "no_reset", &aic7xxx_no_reset },
- { "irq_trigger", &aic7xxx_irq_trigger },
X { "verbose", &aic7xxx_verbose },
X { "reverse_scan", &aic7xxx_reverse_scan },
- { "override_term", &aic7xxx_override_term },
- { "stpwlev", &aic7xxx_stpwlev },
X { "no_probe", &aic7xxx_no_probe },
- { "panic_on_abort", &aic7xxx_panic_on_abort },
+ { "periodic_otag", &aic7xxx_periodic_otag },
X { "pci_parity", &aic7xxx_pci_parity },
- { "dump_sequencer", &aic7xxx_dump_sequencer },
X { "seltime", &aic7xxx_seltime },
X { "tag_info", NULL }
X };
@@ -1133,7 +1091,8 @@
X ahc_linux_pci_probe(template);
X #endif
X
- aic7770_linux_probe(template);
+ if (aic7xxx_no_probe == 0)
+ aic7770_linux_probe(template);
X
X /*
X * Register with the SCSI layer all
@@ -1174,8 +1133,8 @@
X host->this_id = ahc->our_id;
X host->irq = ahc->platform_data->irq;
X host->max_id = (ahc->features & AHC_WIDE) ? 16 : 8;
- host->max_channel = (ahc->features & AHC_TWIN) ? 1 : 0;
X host->max_lun = AHC_NUM_LUNS;
+ host->max_channel = (ahc->features & AHC_TWIN) ? 1 : 0;
X ahc_set_unit(ahc, ahc_linux_next_unit());
X sprintf(buf, "scsi%d", host->host_no);
X new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT);
@@ -1387,7 +1346,7 @@
X dev->qfrozen++;
X }
X
- dev->flags &= ~(AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED);
+ dev->flags &= ~(AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED|AHC_DEV_PERIODIC_OTAG);
X if (now_queuing) {
X
X if (!was_queuing) {
@@ -1399,9 +1358,11 @@
X dev->maxtags = AHC_MAX_QUEUE;
X dev->openings = dev->maxtags - dev->active;
X }
- if (alg == AHC_QUEUE_TAGGED)
+ if (alg == AHC_QUEUE_TAGGED) {
X dev->flags |= AHC_DEV_Q_TAGGED;
- else
+ if (aic7xxx_periodic_otag != 0)
+ dev->flags |= AHC_DEV_PERIODIC_OTAG;
+ } else
X dev->flags |= AHC_DEV_Q_BASIC;
X } else {
X /* We can only have one opening */
@@ -1548,8 +1509,8 @@
X if (tags != 0) {
X device->queue_depth = tags;
X ahc_set_tags(ahc, &devinfo, AHC_QUEUE_TAGGED);
- printf("scsi%d:%d:%d:%d: Tagged Queuing enabled. Depth %d\n",
- ahc->platform_data->host->host_no, device->channel,
+ printf("scsi%d:%c:%d:%d: Tagged Queuing enabled. Depth %d\n",
+ ahc->platform_data->host->host_no, device->channel + 'A',
X device->id, device->lun, tags);
X } else {
X /*
@@ -1770,7 +1731,8 @@
X dev->openings--;
X dev->active++;
X dev->commands_issued++;
- dev->commands_since_idle_or_otag++;
+ if ((dev->flags & AHC_DEV_PERIODIC_OTAG) != 0)
+ dev->commands_since_idle_or_otag++;
X
X /*
X * We only allow one untagged transaction
@@ -2324,10 +2286,10 @@
X * are not large enough for us to pull the spi3 bits.
X * In this case, we assume that a device that tells us
X * they can provide inquiry data that spans the SPI3
- * bits can handle a PPR request. If the inquiry
- * request has sufficient buffer space to cover these
- * bits, we check them to see if any ppr options are
- * available.
+ * bits and says its SCSI3 can handle a PPR request.
+ * If the inquiry request has sufficient buffer space to
+ * cover these bits, we check them to see if any ppr options
+ * are available.
X */
X if ((sid->additional_length + 4) >= minlen) {
X if (transferred_len >= minlen
@@ -2336,6 +2298,8 @@
X
X if (targ_info->curr.protocol_version > SCSI_REV_2)
X targ_info->curr.transport_version = 3;
+ else
+ ppr_options = 0;
X } else {
X ppr_options = 0;
X }
@@ -2536,8 +2500,7 @@
X ahc->flags &= ~AHC_ALL_INTERRUPTS;
X paused = TRUE;
X
- if (bootverbose)
- ahc_dump_card_state(ahc);
+ ahc_dump_card_state(ahc);
X
X if ((pending_scb->flags & SCB_ACTIVE) == 0) {
X printf("%s:%d:%d:%d: Command already completed\n",
@@ -2597,7 +2560,7 @@
X * Actually re-queue this SCB in an attempt
X * to select the device before it reconnects.
X * In either case (selection or reselection),
- * we will now issue a the approprate message
+ * we will now issue the approprate message
X * to the timed-out device.
X *
X * Set the MK_MESSAGE control bit indicating
@@ -2672,7 +2635,7 @@
X if (paused)
X ahc_unpause(ahc);
X if (wait) {
- struct timer_list timer;
+ struct timer_list timer;
X int ret;
X
X ahc_unlock(ahc, &s);


@@ -2711,7 +2674,7 @@
X

X error = ahc_linux_queue_recovery_cmd(cmd, SCB_ABORT);
X if (error != 0)
- printf("aic7xxx_abort returns %d\n", error);
+ printf("aic7xxx_abort returns 0x%x\n", error);
X return (error);
X }
X
@@ -2725,7 +2688,7 @@
X
X error = ahc_linux_queue_recovery_cmd(cmd, SCB_DEVICE_RESET);
X if (error != 0)
- printf("aic7xxx_dev_reset returns %d\n", error);
+ printf("aic7xxx_dev_reset returns 0x%x\n", error);
X return (error);
X }
X
@@ -2792,7 +2755,9 @@
X sectors = 32;
X cylinders = disk->capacity / (heads * sectors);
X
- if (disk->device->channel == 0)
+ if (aic7xxx_extended != 0)
+ extended = 1;
+ else if (disk->device->channel == 0)
X extended = (ahc->flags & AHC_EXTENDED_TRANS_A) != 0;
X else
X extended = (ahc->flags & AHC_EXTENDED_TRANS_B) != 0;
@@ -2868,8 +2833,6 @@
X }
X }
X }
-
-MODULE_LICENSE("Dual BSD/GPL");
X
X #if defined(MODULE) || LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X static Scsi_Host_Template driver_template = AIC7XXX;
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_linux_host.h linux/drivers/scsi/aic7xxx/aic7xxx_linux_host.h
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_linux_host.h Fri May 4 15:16:28 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_linux_host.h Thu Oct 25 13:53:49 2001


@@ -1,7 +1,7 @@
X /*

X * Adaptec AIC7xxx device driver host template for Linux.


X *
- * Copyright (c) 2000 Adaptec Inc.
+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
@@ -10,25 +10,33 @@
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,
X * without modification.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *
X * Alternatively, this software may be distributed under the terms of the

- * GNU Public License ("GPL").

- * $Id: //depot/src/linux/drivers/scsi/aic7xxx/aic7xxx_linux_host.h#3 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_linux_host.h#5 $
X */
X
X #ifndef _AIC7XXX_LINUX_HOST_H_
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_linux_pci.c linux/drivers/scsi/aic7xxx/aic7xxx_linux_pci.c


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 34'
echo 'File patch-2.4.14 is continued in part 35'
echo "35" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:45 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part22

#!/bin/sh -x
# this is part 22 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 22; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

- tz->policy.state |= TZ_STATE_PASSIVE;
- }
+ if ((thresholds->passive.is_valid) && (policy->temperature >= thresholds->passive.temperature))
+ policy->state |= TZ_STATE_PASSIVE;
X
X /* Active? */
- if (tz->policy.active.threshold[0]) {
- for (i=0; i<tz->policy.active.threshold_count; i++) {
- if ((tz->policy.active.threshold[i]) &&
- (tz->policy.temperature >= tz->policy.active.threshold[i]->temperature)) {
- tz->policy.state |= TZ_STATE_ACTIVE;
- if (tz->policy.active.threshold[i]->index > active_index) {
- active_index = tz->policy.active.threshold[i]->index;
- }
+ if (thresholds->active[0].is_valid) {


+ for (i=0; i<TZ_MAX_ACTIVE_THRESHOLDS; i++) {

+ if ((thresholds->active[i].is_valid) && (policy->temperature >= thresholds->active[i].temperature)) {
+ policy->state |= TZ_STATE_ACTIVE;
+ if (i > active_index)
+ active_index = i;
X }
X }
- tz->policy.state |= active_index;
+ policy->state |= active_index;
X }
X
X /*
@@ -379,17 +377,14 @@
X * out of' a policy state (e.g. to allow fans to be turned off);
X * thus we must preserve the previous state.
X */
- if (tz->policy.state & TZ_STATE_CRITICAL) {
+ if (policy->state & TZ_STATE_CRITICAL)
X tz_policy_critical(tz);
- }
- if ((tz->policy.state & TZ_STATE_PASSIVE) ||
- (previous_state & TZ_STATE_PASSIVE)) {
+ if (policy->state & TZ_STATE_HOT)
+ tz_policy_hot(tz);
+ if ((policy->state & TZ_STATE_PASSIVE) || (previous_state & TZ_STATE_PASSIVE))
X tz_policy_passive(tz);
- }
- if ((tz->policy.state & TZ_STATE_ACTIVE) ||
- (previous_state & TZ_STATE_ACTIVE)) {
+ if ((policy->state & TZ_STATE_ACTIVE) || (previous_state & TZ_STATE_ACTIVE))
X tz_policy_active(tz);
- }
X
X /*
X * Calculate Sleep Time:
@@ -400,42 +395,33 @@
X * a thermal event occurs -- e.g. never poll). Note that _TSP
X * and _TZD values are given in 1/10th seconds.
X */
- if (tz->policy.state & TZ_STATE_PASSIVE) {
- sleep_time = tz->policy.passive.tsp * 100;
- }
- else if (tz->policy.polling_freq > 0) {
- sleep_time = tz->policy.polling_freq * 100;
- }
- else {
+ if (policy->state & TZ_STATE_PASSIVE)
+ sleep_time = thresholds->passive.tsp * 100;
+ else if (policy->polling_freq > 0)
+ sleep_time = policy->polling_freq * 100;
+ else
X sleep_time = WAIT_FOREVER;
- }
X
-#ifdef ACPI_DEBUG
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Thermal_zone[%02x]: temperature[%d] state[%08x]\n", tz->device_handle, tz->policy.temperature, tz->policy.state));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Thermal_zone[%02x]: temperature[%d] state[%08x]\n", tz->device_handle, policy->temperature, policy->state));
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Scheduling next poll in [%d]ms.\n", sleep_time));
-#endif /*ACPI_DEBUG*/
X
X /*
X * Schedule Next Poll:
X * -------------------
X */
X if (sleep_time < WAIT_FOREVER) {
- if (timer_pending(&(tz->policy.timer))) {
- mod_timer(&(tz->policy.timer),
- (HZ*sleep_time)/1000);
- }
+ if (timer_pending(&(policy->timer)))
+ mod_timer(&(policy->timer), (HZ*sleep_time)/1000);
X else {
- tz->policy.timer.data = (u32)tz;
- tz->policy.timer.function = tz_policy_run;
- tz->policy.timer.expires =
- jiffies + (HZ*sleep_time)/1000;
- add_timer(&(tz->policy.timer));
+ policy->timer.data = (u32)tz;
+ policy->timer.function = tz_policy_run;
+ policy->timer.expires = jiffies + (HZ*sleep_time)/1000;
+ add_timer(&(policy->timer));
X }
X }
X else {
- if (timer_pending(&(tz->policy.timer))) {
- del_timer(&(tz->policy.timer));
- }
+ if (timer_pending(&(policy->timer)))
+ del_timer(&(policy->timer));
X }
X
X return_VOID;
@@ -454,6 +440,7 @@


X *
X ****************************************************************************/
X

+


X void
X tz_policy_run (
X unsigned long data)

@@ -472,8 +459,7 @@
X * -----------------------------
X * Note that all Linux kernel timers run at interrupt-level (ack!).
X */
- status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE,
- tz_policy_check, (void*)data);
+ status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE, tz_policy_check, (void*)data);
X if (ACPI_FAILURE(status)) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Error invoking thermal policy.\n"));
X }
@@ -499,7 +485,7 @@


X TZ_CONTEXT *tz)
X {
X acpi_status status = AE_OK;

- TZ_THRESHOLD *threshold = NULL;
+ TZ_THRESHOLDS *thresholds = NULL;

X u32 i,j = 0;
X

X FUNCTION_TRACE("tz_policy_add_device");
@@ -511,36 +497,10 @@
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Adding policy for thermal zone [%02x].\n", tz->device_handle));
X
X /*
- * Temperature:
- * ------------
- * Make sure we can read the zone's current temperature (_TMP).
- * If we can't, there's no use in doing any policy (abort).
- */


- status = tz_get_temperature(tz, &(tz->policy.temperature));

- if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
- }
-
- /*
- * Polling Frequency:
- * ------------------
- * If a _TZP object doesn't exist, use the OS default polling
- * frequency.
- */
- status = bm_evaluate_simple_integer(tz->acpi_handle, "_TZP",
- &(tz->policy.polling_freq));
- if (ACPI_FAILURE(status)) {
- tz->policy.polling_freq = TZP;
- }


- status = AE_OK;
-

- /*
X * Get Thresholds:
X * ---------------
- * Get all of the zone's thresholds, parse, and organize for
- * later use.
X */
- status = tz_get_thresholds(tz, &(tz->policy.threshold_list));
+ status = tz_get_thresholds(tz);


X if (ACPI_FAILURE(status)) {
X return_ACPI_STATUS(status);
X }

@@ -549,70 +509,17 @@
X * Initialize Policies:
X * --------------------
X */
- for (i = 0; i < tz->policy.threshold_list.count; i++) {
-
- threshold = &(tz->policy.threshold_list.thresholds[i]);


-
- switch (threshold->type) {
-

- case TZ_THRESHOLD_CRITICAL:
- tz->policy.critical.threshold = threshold;
- break;
-
- case TZ_THRESHOLD_PASSIVE:
-
- /*
- * Set thermal performance limit on all processors
- * to max.
- */
- for (j=0; j<threshold->cooling_devices.count; j++) {
- set_performance_limit(
- threshold->cooling_devices.handles[j],
- PR_PERF_MAX);
- }
-
- /*
- * Get passive cooling constants.
- */
- status = bm_evaluate_simple_integer(tz->acpi_handle,
- "_TC1", &(tz->policy.passive.tc1));
- if (ACPI_FAILURE(status)) {
- break;
- }
-
- status = bm_evaluate_simple_integer(tz->acpi_handle,
- "_TC2", &(tz->policy.passive.tc2));
- if (ACPI_FAILURE(status)) {
- break;
- }
-
- status = bm_evaluate_simple_integer(tz->acpi_handle,
- "_TSP", &(tz->policy.passive.tsp));
- if (ACPI_FAILURE(status)) {
- break;
- }
-
- tz->policy.passive.threshold = threshold;
-
- tz_policy_passive(tz);
-
- break;
-
- case TZ_THRESHOLD_ACTIVE:
- tz->policy.active.threshold[threshold->index] = threshold;
- tz_policy_active(tz);


- break;
- }
- }
-

- if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
+ if (tz->policy.thresholds.passive.is_valid) {
+ for (i=0; i<tz->policy.thresholds.passive.devices.count; i++)
+ set_performance_limit(tz->policy.thresholds.passive.devices.handles[i], PR_PERF_MAX);
+ tz_policy_passive(tz);
X }
+ if (tz->policy.thresholds.active[0].is_valid)
+ tz_policy_active(tz);
X
X /*
X * Initialize Policy Timer:
X * ------------------------
- * TBD: Linux-specific - remove when policy moves to user-space.
X */
X init_timer(&(tz->policy.timer));
X
@@ -623,7 +530,7 @@
X */
X tz_policy_check(tz);


X
- return_ACPI_STATUS(status);
+ return_ACPI_STATUS(AE_OK);
X }
X
X

@@ -656,19 +563,15 @@
X /*
X * Delete the thermal zone policy timer entry, if exists.
X */
- if (timer_pending(&(tz->policy.timer))) {
+ if (timer_pending(&(tz->policy.timer)))
X del_timer(&(tz->policy.timer));
- }
X
X /*
X * Reset thermal performance limit on all processors back to max.
X */
- if (tz->policy.passive.threshold) {
- for (i=0; i<tz->policy.passive.threshold->cooling_devices.count; i++) {
- set_performance_limit(
- tz->policy.passive.threshold->cooling_devices.handles[i],
- PR_PERF_MAX);
- }
+ if (tz->policy.thresholds.passive.is_valid) {
+ for (i=0; i<tz->policy.thresholds.passive.devices.count; i++)
+ set_performance_limit(tz->policy.thresholds.passive.devices.handles[i], PR_PERF_MAX);
X }
X
X return_ACPI_STATUS(AE_OK);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/parser/psargs.c linux/drivers/acpi/parser/psargs.c
--- v2.4.13/linux/drivers/acpi/parser/psargs.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/parser/psargs.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: psargs - Parse AML opcode arguments


- * $Revision: 51 $

+ * $Revision: 52 $


X *
X *****************************************************************************/
X

@@ -391,11 +391,11 @@
X name_op->node = method_node;
X acpi_ps_append_arg (arg, name_op);
X
- if (!(acpi_operand_object *) method_node->object) {
+ if (!method_node->object) {
X return_VOID;
X }
X
- *arg_count = ((acpi_operand_object *) method_node->object)->method.param_count;
+ *arg_count = (method_node->object)->method.param_count;
X }
X
X return_VOID;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/parser/psopcode.c linux/drivers/acpi/parser/psopcode.c
--- v2.4.13/linux/drivers/acpi/parser/psopcode.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/parser/psopcode.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

- * Module Name: psopcode - Parser opcode information table
- * $Revision: 41 $
+ * Module Name: psopcode - Parser/Interpreter opcode information table
+ * $Revision: 49 $


X *
X *****************************************************************************/
X

@@ -67,28 +67,11 @@
X * into a 32-bit number and stored in the master opcode table at the end of this file.
X */
X
-#define ARGP_ZERO_OP ARG_NONE
-#define ARGP_ONE_OP ARG_NONE
+
+#define ARGP_ACCESSFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
+#define ARGP_ACQUIRE_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_WORDDATA)
+#define ARGP_ADD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
X #define ARGP_ALIAS_OP ARGP_LIST2 (ARGP_NAMESTRING, ARGP_NAME)
-#define ARGP_NAME_OP ARGP_LIST2 (ARGP_NAME, ARGP_DATAOBJ)
-#define ARGP_BYTE_OP ARGP_LIST1 (ARGP_BYTEDATA)
-#define ARGP_WORD_OP ARGP_LIST1 (ARGP_WORDDATA)
-#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA)
-#define ARGP_STRING_OP ARGP_LIST1 (ARGP_CHARLIST)
-#define ARGP_QWORD_OP ARGP_LIST1 (ARGP_QWORDDATA)
-#define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST)
-#define ARGP_BUFFER_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_BYTELIST)
-#define ARGP_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_BYTEDATA, ARGP_DATAOBJLIST)
-#define ARGP_VAR_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_BYTEDATA, ARGP_DATAOBJLIST)
-#define ARGP_METHOD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMLIST)
-#define ARGP_LOCAL0 ARG_NONE
-#define ARGP_LOCAL1 ARG_NONE
-#define ARGP_LOCAL2 ARG_NONE
-#define ARGP_LOCAL3 ARG_NONE
-#define ARGP_LOCAL4 ARG_NONE
-#define ARGP_LOCAL5 ARG_NONE
-#define ARGP_LOCAL6 ARG_NONE
-#define ARGP_LOCAL7 ARG_NONE
X #define ARGP_ARG0 ARG_NONE
X #define ARGP_ARG1 ARG_NONE
X #define ARGP_ARG2 ARG_NONE
@@ -96,98 +79,116 @@
X #define ARGP_ARG4 ARG_NONE
X #define ARGP_ARG5 ARG_NONE
X #define ARGP_ARG6 ARG_NONE
-#define ARGP_STORE_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SUPERNAME)
-#define ARGP_REF_OF_OP ARGP_LIST1 (ARGP_SUPERNAME)
-#define ARGP_ADD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_SUBTRACT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_INCREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME)
-#define ARGP_DECREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME)
-#define ARGP_MULTIPLY_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_DIVIDE_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET, ARGP_TARGET)
-#define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_BANK_FIELD_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_NAMESTRING,ARGP_TERMARG, ARGP_BYTEDATA, ARGP_FIELDLIST)
X #define ARGP_BIT_AND_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
X #define ARGP_BIT_NAND_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_BIT_OR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
X #define ARGP_BIT_NOR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_BIT_XOR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
X #define ARGP_BIT_NOT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_FIND_SET_RIGHT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_DEREF_OF_OP ARGP_LIST1 (ARGP_TERMARG)
+#define ARGP_BIT_OR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_BIT_XOR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_BREAK_OP ARG_NONE
+#define ARGP_BREAK_POINT_OP ARG_NONE
+#define ARGP_BUFFER_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_BYTELIST)
+#define ARGP_BYTE_OP ARGP_LIST1 (ARGP_BYTEDATA)
+#define ARGP_BYTELIST_OP ARGP_LIST1 (ARGP_NAMESTRING)
+#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
X #define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_MOD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_NOTIFY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
-#define ARGP_SIZE_OF_OP ARGP_LIST1 (ARGP_SUPERNAME)
-#define ARGP_INDEX_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_MATCH_OP ARGP_LIST6 (ARGP_TERMARG, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG)
-#define ARGP_CREATE_DWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
-#define ARGP_CREATE_WORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
-#define ARGP_CREATE_BYTE_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
+#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME)
+#define ARGP_CONTINUE_OP ARG_NONE
+#define ARGP_COPY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SIMPLENAME)
X #define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
-#define ARGP_TYPE_OP ARGP_LIST1 (ARGP_SUPERNAME)
+#define ARGP_CREATE_BYTE_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
+#define ARGP_CREATE_DWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
+#define ARGP_CREATE_FIELD_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
X #define ARGP_CREATE_QWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
+#define ARGP_CREATE_WORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
+#define ARGP_DATA_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG)
+#define ARGP_DEBUG_OP ARG_NONE
+#define ARGP_DECREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME)
+#define ARGP_DEREF_OF_OP ARGP_LIST1 (ARGP_TERMARG)
+#define ARGP_DEVICE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST)
+#define ARGP_DIVIDE_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET, ARGP_TARGET)
+#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA)
+#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST)
+#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME)
+#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG)
+#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST)
+#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_FIND_SET_RIGHT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_FROM_BCD_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_IF_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_TERMLIST)
+#define ARGP_INCREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME)
+#define ARGP_INDEX_FIELD_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_NAMESTRING,ARGP_BYTEDATA, ARGP_FIELDLIST)
+#define ARGP_INDEX_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
X #define ARGP_LAND_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
-#define ARGP_LOR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
-#define ARGP_LNOT_OP ARGP_LIST1 (ARGP_TERMARG)
X #define ARGP_LEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
X #define ARGP_LGREATER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
+#define ARGP_LGREATEREQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
X #define ARGP_LLESS_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
-#define ARGP_TO_BUFFER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_TO_DEC_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_TO_HEX_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_TO_INTEGER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_TO_STRING_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_COPY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SIMPLENAME)
+#define ARGP_LLESSEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
+#define ARGP_LNOT_OP ARGP_LIST1 (ARGP_TERMARG)
+#define ARGP_LNOTEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
+#define ARGP_LOAD_OP ARGP_LIST2 (ARGP_NAMESTRING, ARGP_SUPERNAME)
+#define ARGP_LOAD_TABLE_OP ARGP_LIST6 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG)
+#define ARGP_LOCAL0 ARG_NONE
+#define ARGP_LOCAL1 ARG_NONE
+#define ARGP_LOCAL2 ARG_NONE
+#define ARGP_LOCAL3 ARG_NONE
+#define ARGP_LOCAL4 ARG_NONE
+#define ARGP_LOCAL5 ARG_NONE
+#define ARGP_LOCAL6 ARG_NONE
+#define ARGP_LOCAL7 ARG_NONE
+#define ARGP_LOR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
+#define ARGP_MATCH_OP ARGP_LIST6 (ARGP_TERMARG, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG)
+#define ARGP_METHOD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMLIST)
+#define ARGP_METHODCALL_OP ARGP_LIST1 (ARGP_NAMESTRING)
X #define ARGP_MID_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_CONTINUE_OP ARG_NONE
-#define ARGP_IF_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_TERMLIST)
-#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST)
-#define ARGP_WHILE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_TERMLIST)
+#define ARGP_MOD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_MULTIPLY_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_MUTEX_OP ARGP_LIST2 (ARGP_NAME, ARGP_BYTEDATA)
+#define ARGP_NAME_OP ARGP_LIST2 (ARGP_NAME, ARGP_DATAOBJ)
+#define ARGP_NAMEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
+#define ARGP_NAMEPATH_OP ARGP_LIST1 (ARGP_NAMESTRING)
X #define ARGP_NOOP_OP ARG_NONE
-#define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG)
-#define ARGP_BREAK_OP ARG_NONE
-#define ARGP_BREAK_POINT_OP ARG_NONE
+#define ARGP_NOTIFY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
+#define ARGP_ONE_OP ARG_NONE
X #define ARGP_ONES_OP ARG_NONE
-#define ARGP_MUTEX_OP ARGP_LIST2 (ARGP_NAME, ARGP_BYTEDATA)
-#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME)
-#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME)
-#define ARGP_CREATE_FIELD_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
-#define ARGP_LOAD_TABLE_OP ARGP_LIST6 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG)
-#define ARGP_LOAD_OP ARGP_LIST2 (ARGP_NAMESTRING, ARGP_SUPERNAME)
-#define ARGP_STALL_OP ARGP_LIST1 (ARGP_TERMARG)
-#define ARGP_SLEEP_OP ARGP_LIST1 (ARGP_TERMARG)
-#define ARGP_ACQUIRE_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_WORDDATA)
-#define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME)
-#define ARGP_WAIT_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
-#define ARGP_RESET_OP ARGP_LIST1 (ARGP_SUPERNAME)
-#define ARGP_RELEASE_OP ARGP_LIST1 (ARGP_SUPERNAME)
-#define ARGP_FROM_BCD_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_TO_BCD_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
-#define ARGP_UNLOAD_OP ARGP_LIST1 (ARGP_SUPERNAME)
-#define ARGP_REVISION_OP ARG_NONE
-#define ARGP_DEBUG_OP ARG_NONE
-#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG)
-#define ARGP_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG)
-#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST)
-#define ARGP_DEVICE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST)
-#define ARGP_PROCESSOR_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_BYTEDATA, ARGP_OBJLIST)
+#define ARGP_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_BYTEDATA, ARGP_DATAOBJLIST)
X #define ARGP_POWER_RES_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_WORDDATA, ARGP_OBJLIST)
-#define ARGP_THERMAL_ZONE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST)
-#define ARGP_INDEX_FIELD_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_NAMESTRING,ARGP_BYTEDATA, ARGP_FIELDLIST)
-#define ARGP_BANK_FIELD_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_NAMESTRING,ARGP_TERMARG, ARGP_BYTEDATA, ARGP_FIELDLIST)
-#define ARGP_DATA_REGION_OP ARGP_LIST4 (ARGP_NAMESTRING, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG)
-#define ARGP_LNOTEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
-#define ARGP_LLESSEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
-#define ARGP_LGREATEREQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
-#define ARGP_NAMEPATH_OP ARGP_LIST1 (ARGP_NAMESTRING)
-#define ARGP_METHODCALL_OP ARGP_LIST1 (ARGP_NAMESTRING)
-#define ARGP_BYTELIST_OP ARGP_LIST1 (ARGP_NAMESTRING)
+#define ARGP_PROCESSOR_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_BYTEDATA, ARGP_OBJLIST)
+#define ARGP_QWORD_OP ARGP_LIST1 (ARGP_QWORDDATA)
+#define ARGP_REF_OF_OP ARGP_LIST1 (ARGP_SUPERNAME)
+#define ARGP_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG)
+#define ARGP_RELEASE_OP ARGP_LIST1 (ARGP_SUPERNAME)
X #define ARGP_RESERVEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
-#define ARGP_NAMEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
-#define ARGP_ACCESSFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
+#define ARGP_RESET_OP ARGP_LIST1 (ARGP_SUPERNAME)
+#define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG)
+#define ARGP_REVISION_OP ARG_NONE
+#define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST)
+#define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME)
+#define ARGP_SIZE_OF_OP ARGP_LIST1 (ARGP_SUPERNAME)
+#define ARGP_SLEEP_OP ARGP_LIST1 (ARGP_TERMARG)
+#define ARGP_STALL_OP ARGP_LIST1 (ARGP_TERMARG)
X #define ARGP_STATICSTRING_OP ARGP_LIST1 (ARGP_NAMESTRING)
+#define ARGP_STORE_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SUPERNAME)
+#define ARGP_STRING_OP ARGP_LIST1 (ARGP_CHARLIST)
+#define ARGP_SUBTRACT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_THERMAL_ZONE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST)
+#define ARGP_TO_BCD_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_TO_BUFFER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_TO_DEC_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_TO_HEX_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_TO_INTEGER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_TO_STRING_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
+#define ARGP_TYPE_OP ARGP_LIST1 (ARGP_SUPERNAME)
+#define ARGP_UNLOAD_OP ARGP_LIST1 (ARGP_SUPERNAME)
+#define ARGP_VAR_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_BYTEDATA, ARGP_DATAOBJLIST)
+#define ARGP_WAIT_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
+#define ARGP_WHILE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_TERMLIST)
+#define ARGP_WORD_OP ARGP_LIST1 (ARGP_WORDDATA)
+#define ARGP_ZERO_OP ARG_NONE
X
X
X /*
@@ -197,28 +198,11 @@
X * (Used by Prep_operands procedure and the ASL Compiler)
X */
X
-#define ARGI_ZERO_OP ARG_NONE
-#define ARGI_ONE_OP ARG_NONE
+
+#define ARGI_ACCESSFIELD_OP ARGI_INVALID_OPCODE
+#define ARGI_ACQUIRE_OP ARGI_LIST2 (ARGI_MUTEX, ARGI_INTEGER)
+#define ARGI_ADD_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
X #define ARGI_ALIAS_OP ARGI_INVALID_OPCODE
-#define ARGI_NAME_OP ARGI_INVALID_OPCODE
-#define ARGI_BYTE_OP ARGI_INVALID_OPCODE
-#define ARGI_WORD_OP ARGI_INVALID_OPCODE
-#define ARGI_DWORD_OP ARGI_INVALID_OPCODE
-#define ARGI_STRING_OP ARGI_INVALID_OPCODE
-#define ARGI_QWORD_OP ARGI_INVALID_OPCODE
-#define ARGI_SCOPE_OP ARGI_INVALID_OPCODE
-#define ARGI_BUFFER_OP ARGI_INVALID_OPCODE
-#define ARGI_PACKAGE_OP ARGI_INVALID_OPCODE
-#define ARGI_VAR_PACKAGE_OP ARGI_INVALID_OPCODE
-#define ARGI_METHOD_OP ARGI_INVALID_OPCODE
-#define ARGI_LOCAL0 ARG_NONE
-#define ARGI_LOCAL1 ARG_NONE
-#define ARGI_LOCAL2 ARG_NONE
-#define ARGI_LOCAL3 ARG_NONE
-#define ARGI_LOCAL4 ARG_NONE
-#define ARGI_LOCAL5 ARG_NONE
-#define ARGI_LOCAL6 ARG_NONE
-#define ARGI_LOCAL7 ARG_NONE
X #define ARGI_ARG0 ARG_NONE
X #define ARGI_ARG1 ARG_NONE
X #define ARGI_ARG2 ARG_NONE
@@ -226,98 +210,116 @@
X #define ARGI_ARG4 ARG_NONE
X #define ARGI_ARG5 ARG_NONE
X #define ARGI_ARG6 ARG_NONE
-#define ARGI_STORE_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_TARGETREF)
-#define ARGI_REF_OF_OP ARGI_LIST1 (ARGI_OBJECT_REF)
-#define ARGI_ADD_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF)
-#define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF)
-#define ARGI_DECREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF)
-#define ARGI_MULTIPLY_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_DIVIDE_OP ARGI_LIST4 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF, ARGI_TARGETREF)
-#define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_BANK_FIELD_OP ARGI_INVALID_OPCODE
X #define ARGI_BIT_AND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
X #define ARGI_BIT_NAND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_BIT_OR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
X #define ARGI_BIT_NOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_BIT_XOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
X #define ARGI_BIT_NOT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_DEREF_OF_OP ARGI_LIST1 (ARGI_REFERENCE)
+#define ARGI_BIT_OR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_BIT_XOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_BREAK_OP ARG_NONE
+#define ARGI_BREAK_POINT_OP ARG_NONE
+#define ARGI_BUFFER_OP ARGI_INVALID_OPCODE
+#define ARGI_BYTE_OP ARGI_INVALID_OPCODE
+#define ARGI_BYTELIST_OP ARGI_INVALID_OPCODE
+#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF)
X #define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF)
-#define ARGI_MOD_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_NOTIFY_OP ARGI_LIST2 (ARGI_DEVICE_REF, ARGI_INTEGER)
-#define ARGI_SIZE_OF_OP ARGI_LIST1 (ARGI_DATAOBJECT)
-#define ARGI_INDEX_OP ARGI_LIST3 (ARGI_COMPLEXOBJ, ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_MATCH_OP ARGI_LIST6 (ARGI_PACKAGE, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
-#define ARGI_CREATE_DWORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
-#define ARGI_CREATE_WORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
-#define ARGI_CREATE_BYTE_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
+#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF)
+#define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE
+#define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET)
X #define ARGI_CREATE_BIT_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
-#define ARGI_TYPE_OP ARGI_LIST1 (ARGI_ANYTYPE)
+#define ARGI_CREATE_BYTE_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
+#define ARGI_CREATE_DWORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
+#define ARGI_CREATE_FIELD_OP ARGI_LIST4 (ARGI_BUFFER, ARGI_INTEGER, ARGI_INTEGER, ARGI_REFERENCE)
X #define ARGI_CREATE_QWORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
+#define ARGI_CREATE_WORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
+#define ARGI_DATA_REGION_OP ARGI_LIST3 (ARGI_STRING, ARGI_STRING, ARGI_STRING)
+#define ARGI_DEBUG_OP ARG_NONE
+#define ARGI_DECREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF)
+#define ARGI_DEREF_OF_OP ARGI_LIST1 (ARGI_REFERENCE)
+#define ARGI_DEVICE_OP ARGI_INVALID_OPCODE
+#define ARGI_DIVIDE_OP ARGI_LIST4 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF, ARGI_TARGETREF)
+#define ARGI_DWORD_OP ARGI_INVALID_OPCODE
+#define ARGI_ELSE_OP ARGI_INVALID_OPCODE
+#define ARGI_EVENT_OP ARGI_INVALID_OPCODE
+#define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
+#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
+#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_IF_OP ARGI_INVALID_OPCODE
+#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF)
+#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE
+#define ARGI_INDEX_OP ARGI_LIST3 (ARGI_COMPLEXOBJ, ARGI_INTEGER, ARGI_TARGETREF)
X #define ARGI_LAND_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
-#define ARGI_LOR_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
-#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER)
X #define ARGI_LEQUAL_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
X #define ARGI_LGREATER_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
+#define ARGI_LGREATEREQUAL_OP ARGI_INVALID_OPCODE
X #define ARGI_LLESS_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
-#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
-#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
-#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
-#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
-#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_FIXED_TARGET)
-#define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET)
+#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE
+#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER)
+#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE
+#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION, ARGI_TARGETREF)
+#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_TARGETREF)
+#define ARGI_LOCAL0 ARG_NONE
+#define ARGI_LOCAL1 ARG_NONE
+#define ARGI_LOCAL2 ARG_NONE
+#define ARGI_LOCAL3 ARG_NONE
+#define ARGI_LOCAL4 ARG_NONE
+#define ARGI_LOCAL5 ARG_NONE
+#define ARGI_LOCAL6 ARG_NONE
+#define ARGI_LOCAL7 ARG_NONE
+#define ARGI_LOR_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
+#define ARGI_MATCH_OP ARGI_LIST6 (ARGI_PACKAGE, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
+#define ARGI_METHOD_OP ARGI_INVALID_OPCODE
+#define ARGI_METHODCALL_OP ARGI_INVALID_OPCODE
X #define ARGI_MID_OP ARGI_LIST4 (ARGI_BUFFERSTRING,ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE
-#define ARGI_IF_OP ARGI_INVALID_OPCODE
-#define ARGI_ELSE_OP ARGI_INVALID_OPCODE
-#define ARGI_WHILE_OP ARGI_INVALID_OPCODE
+#define ARGI_MOD_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_MULTIPLY_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_MUTEX_OP ARGI_INVALID_OPCODE
+#define ARGI_NAME_OP ARGI_INVALID_OPCODE
+#define ARGI_NAMEDFIELD_OP ARGI_INVALID_OPCODE
+#define ARGI_NAMEPATH_OP ARGI_INVALID_OPCODE
X #define ARGI_NOOP_OP ARG_NONE
-#define ARGI_RETURN_OP ARGI_INVALID_OPCODE
-#define ARGI_BREAK_OP ARG_NONE
-#define ARGI_BREAK_POINT_OP ARG_NONE
+#define ARGI_NOTIFY_OP ARGI_LIST2 (ARGI_DEVICE_REF, ARGI_INTEGER)
+#define ARGI_ONE_OP ARG_NONE
X #define ARGI_ONES_OP ARG_NONE
-#define ARGI_MUTEX_OP ARGI_INVALID_OPCODE
-#define ARGI_EVENT_OP ARGI_INVALID_OPCODE
-#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF)
-#define ARGI_CREATE_FIELD_OP ARGI_LIST4 (ARGI_BUFFER, ARGI_INTEGER, ARGI_INTEGER, ARGI_REFERENCE)
-#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_TARGETREF)
-#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION, ARGI_TARGETREF)
-#define ARGI_STALL_OP ARGI_LIST1 (ARGI_INTEGER)
-#define ARGI_SLEEP_OP ARGI_LIST1 (ARGI_INTEGER)
-#define ARGI_ACQUIRE_OP ARGI_LIST2 (ARGI_MUTEX, ARGI_INTEGER)
-#define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT)
-#define ARGI_WAIT_OP ARGI_LIST2 (ARGI_EVENT, ARGI_INTEGER)
-#define ARGI_RESET_OP ARGI_LIST1 (ARGI_EVENT)
-#define ARGI_RELEASE_OP ARGI_LIST1 (ARGI_MUTEX)
-#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
-#define ARGI_UNLOAD_OP ARGI_LIST1 (ARGI_DDBHANDLE)
-#define ARGI_REVISION_OP ARG_NONE
-#define ARGI_DEBUG_OP ARG_NONE
-#define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
-#define ARGI_REGION_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
-#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
-#define ARGI_DEVICE_OP ARGI_INVALID_OPCODE
-#define ARGI_PROCESSOR_OP ARGI_INVALID_OPCODE
+#define ARGI_PACKAGE_OP ARGI_INVALID_OPCODE
X #define ARGI_POWER_RES_OP ARGI_INVALID_OPCODE
-#define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE
-#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE
-#define ARGI_BANK_FIELD_OP ARGI_INVALID_OPCODE
-#define ARGI_DATA_REGION_OP ARGI_LIST3 (ARGI_STRING, ARGI_STRING, ARGI_STRING)
-#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE
-#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE
-#define ARGI_LGREATEREQUAL_OP ARGI_INVALID_OPCODE
-#define ARGI_NAMEPATH_OP ARGI_INVALID_OPCODE
-#define ARGI_METHODCALL_OP ARGI_INVALID_OPCODE
-#define ARGI_BYTELIST_OP ARGI_INVALID_OPCODE
+#define ARGI_PROCESSOR_OP ARGI_INVALID_OPCODE
+#define ARGI_QWORD_OP ARGI_INVALID_OPCODE
+#define ARGI_REF_OF_OP ARGI_LIST1 (ARGI_OBJECT_REF)
+#define ARGI_REGION_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
+#define ARGI_RELEASE_OP ARGI_LIST1 (ARGI_MUTEX)
X #define ARGI_RESERVEDFIELD_OP ARGI_INVALID_OPCODE
-#define ARGI_NAMEDFIELD_OP ARGI_INVALID_OPCODE
-#define ARGI_ACCESSFIELD_OP ARGI_INVALID_OPCODE
+#define ARGI_RESET_OP ARGI_LIST1 (ARGI_EVENT)
+#define ARGI_RETURN_OP ARGI_INVALID_OPCODE
+#define ARGI_REVISION_OP ARG_NONE
+#define ARGI_SCOPE_OP ARGI_INVALID_OPCODE
+#define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT)
+#define ARGI_SIZE_OF_OP ARGI_LIST1 (ARGI_DATAOBJECT)
+#define ARGI_SLEEP_OP ARGI_LIST1 (ARGI_INTEGER)
+#define ARGI_STALL_OP ARGI_LIST1 (ARGI_INTEGER)
X #define ARGI_STATICSTRING_OP ARGI_INVALID_OPCODE
+#define ARGI_STORE_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_TARGETREF)
+#define ARGI_STRING_OP ARGI_INVALID_OPCODE
+#define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE
+#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
+#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_FIXED_TARGET)
+#define ARGI_TYPE_OP ARGI_LIST1 (ARGI_ANYTYPE)
+#define ARGI_UNLOAD_OP ARGI_LIST1 (ARGI_DDBHANDLE)
+#define ARGI_VAR_PACKAGE_OP ARGI_INVALID_OPCODE
+#define ARGI_WAIT_OP ARGI_LIST2 (ARGI_EVENT, ARGI_INTEGER)
+#define ARGI_WHILE_OP ARGI_INVALID_OPCODE
+#define ARGI_WORD_OP ARGI_INVALID_OPCODE
+#define ARGI_ZERO_OP ARG_NONE
X
X
X /*
@@ -447,143 +449,143 @@
X
X static const acpi_opcode_info aml_op_info[] =
X {
-/* Index Name Parser Args Interpreter Args Flags */
+/* Index Name Parser Args Interpreter Args Class Type Flags */
X
-/* 00 */ ACPI_OP ("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONSTANT| AML_NO_ARGS ),
-/* 01 */ ACPI_OP ("One", ARGP_ONE_OP, ARGI_ONE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONSTANT| AML_NO_ARGS ),
-/* 02 */ ACPI_OP ("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED),
-/* 03 */ ACPI_OP ("Name", ARGP_NAME_OP, ARGI_NAME_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED),
-/* 04 */ ACPI_OP ("Byte_const", ARGP_BYTE_OP, ARGI_BYTE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ),
-/* 05 */ ACPI_OP ("Word_const", ARGP_WORD_OP, ARGI_WORD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ),
-/* 06 */ ACPI_OP ("Dword_const", ARGP_DWORD_OP, ARGI_DWORD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ),
-/* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ),
-/* 08 */ ACPI_OP ("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED),
-/* 09 */ ACPI_OP ("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DATA_TERM| AML_HAS_ARGS),
-/* 0A */ ACPI_OP ("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DATA_TERM| AML_HAS_ARGS),
-/* 0B */ ACPI_OP ("Method", ARGP_METHOD_OP, ARGI_METHOD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED|AML_DEFER),
-/* 0C */ ACPI_OP ("Local0", ARGP_LOCAL0, ARGI_LOCAL0, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ),
-/* 0D */ ACPI_OP ("Local1", ARGP_LOCAL1, ARGI_LOCAL1, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ),
-/* 0E */ ACPI_OP ("Local2", ARGP_LOCAL2, ARGI_LOCAL2, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ),
-/* 0F */ ACPI_OP ("Local3", ARGP_LOCAL3, ARGI_LOCAL3, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ),
-/* 10 */ ACPI_OP ("Local4", ARGP_LOCAL4, ARGI_LOCAL4, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ),
-/* 11 */ ACPI_OP ("Local5", ARGP_LOCAL5, ARGI_LOCAL5, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ),
-/* 12 */ ACPI_OP ("Local6", ARGP_LOCAL6, ARGI_LOCAL6, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ),
-/* 13 */ ACPI_OP ("Local7", ARGP_LOCAL7, ARGI_LOCAL7, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ),
-/* 14 */ ACPI_OP ("Arg0", ARGP_ARG0, ARGI_ARG0, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ),
-/* 15 */ ACPI_OP ("Arg1", ARGP_ARG1, ARGI_ARG1, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ),
-/* 16 */ ACPI_OP ("Arg2", ARGP_ARG2, ARGI_ARG2, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ),
-/* 17 */ ACPI_OP ("Arg3", ARGP_ARG3, ARGI_ARG3, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ),
-/* 18 */ ACPI_OP ("Arg4", ARGP_ARG4, ARGI_ARG4, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ),
-/* 19 */ ACPI_OP ("Arg5", ARGP_ARG5, ARGI_ARG5, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ),
-/* 1_a */ ACPI_OP ("Arg6", ARGP_ARG6, ARGI_ARG6, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ),
-/* 1_b */ ACPI_OP ("Store", ARGP_STORE_OP, ARGI_STORE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 1_c */ ACPI_OP ("Ref_of", ARGP_REF_OF_OP, ARGI_REF_OF_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS),
-/* 1_d */ ACPI_OP ("Add", ARGP_ADD_OP, ARGI_ADD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 1_e */ ACPI_OP ("Concatenate", ARGP_CONCAT_OP, ARGI_CONCAT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 1_f */ ACPI_OP ("Subtract", ARGP_SUBTRACT_OP, ARGI_SUBTRACT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 20 */ ACPI_OP ("Increment", ARGP_INCREMENT_OP, ARGI_INCREMENT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS),
-/* 21 */ ACPI_OP ("Decrement", ARGP_DECREMENT_OP, ARGI_DECREMENT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS),
-/* 22 */ ACPI_OP ("Multiply", ARGP_MULTIPLY_OP, ARGI_MULTIPLY_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 23 */ ACPI_OP ("Divide", ARGP_DIVIDE_OP, ARGI_DIVIDE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 24 */ ACPI_OP ("Shift_left", ARGP_SHIFT_LEFT_OP, ARGI_SHIFT_LEFT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 25 */ ACPI_OP ("Shift_right", ARGP_SHIFT_RIGHT_OP, ARGI_SHIFT_RIGHT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 26 */ ACPI_OP ("And", ARGP_BIT_AND_OP, ARGI_BIT_AND_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 27 */ ACPI_OP ("NAnd", ARGP_BIT_NAND_OP, ARGI_BIT_NAND_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 28 */ ACPI_OP ("Or", ARGP_BIT_OR_OP, ARGI_BIT_OR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 29 */ ACPI_OP ("NOr", ARGP_BIT_NOR_OP, ARGI_BIT_NOR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 2_a */ ACPI_OP ("XOr", ARGP_BIT_XOR_OP, ARGI_BIT_XOR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2_r| AML_HAS_ARGS),
-/* 2_b */ ACPI_OP ("Not", ARGP_BIT_NOT_OP, ARGI_BIT_NOT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 2_c */ ACPI_OP ("Find_set_left_bit", ARGP_FIND_SET_LEFT_BIT_OP, ARGI_FIND_SET_LEFT_BIT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 2_d */ ACPI_OP ("Find_set_right_bit", ARGP_FIND_SET_RIGHT_BIT_OP,ARGI_FIND_SET_RIGHT_BIT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2_r| AML_HAS_ARGS),
-/* 2_e */ ACPI_OP ("Deref_of", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS),
-/* 2_f */ ACPI_OP ("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC1| AML_HAS_ARGS),
-/* 30 */ ACPI_OP ("Size_of", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS),
-/* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_TRIADIC| AML_HAS_ARGS),
-/* 32 */ ACPI_OP ("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_HEXADIC| AML_HAS_ARGS),
-/* 33 */ ACPI_OP ("Create_dWord_field", ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CREATE_FIELD| AML_HAS_ARGS|AML_NSOBJECT|AML_NSNODE|AML_DEFER|AML_CREATE),
-/* 34 */ ACPI_OP ("Create_word_field", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CREATE_FIELD| AML_HAS_ARGS|AML_NSOBJECT|AML_NSNODE|AML_DEFER|AML_CREATE),
-/* 35 */ ACPI_OP ("Create_byte_field", ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CREATE_FIELD| AML_HAS_ARGS|AML_NSOBJECT|AML_NSNODE|AML_DEFER|AML_CREATE),
-/* 36 */ ACPI_OP ("Create_bit_field", ARGP_CREATE_BIT_FIELD_OP, ARGI_CREATE_BIT_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CREATE_FIELD| AML_HAS_ARGS|AML_NSOBJECT|AML_NSNODE|AML_DEFER|AML_CREATE),
-/* 37 */ ACPI_OP ("Object_type", ARGP_TYPE_OP, ARGI_TYPE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS),
-/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2| AML_HAS_ARGS),
-/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2| AML_HAS_ARGS),
-/* 3_a */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS),
-/* 3_b */ ACPI_OP ("LEqual", ARGP_LEQUAL_OP, ARGI_LEQUAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2| AML_HAS_ARGS),
-/* 3_c */ ACPI_OP ("LGreater", ARGP_LGREATER_OP, ARGI_LGREATER_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2| AML_HAS_ARGS),
-/* 3_d */ ACPI_OP ("LLess", ARGP_LLESS_OP, ARGI_LLESS_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2| AML_HAS_ARGS),
-/* 3_e */ ACPI_OP ("If", ARGP_IF_OP, ARGI_IF_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_HAS_ARGS),
-/* 3_f */ ACPI_OP ("Else", ARGP_ELSE_OP, ARGI_ELSE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_HAS_ARGS),
-/* 40 */ ACPI_OP ("While", ARGP_WHILE_OP, ARGI_WHILE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_HAS_ARGS),
-/* 41 */ ACPI_OP ("Noop", ARGP_NOOP_OP, ARGI_NOOP_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_NO_ARGS ),
-/* 42 */ ACPI_OP ("Return", ARGP_RETURN_OP, ARGI_RETURN_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_HAS_ARGS),
-/* 43 */ ACPI_OP ("Break", ARGP_BREAK_OP, ARGI_BREAK_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_NO_ARGS ),
-/* 44 */ ACPI_OP ("Break_point", ARGP_BREAK_POINT_OP, ARGI_BREAK_POINT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_NO_ARGS ),
-/* 45 */ ACPI_OP ("Ones", ARGP_ONES_OP, ARGI_ONES_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONSTANT| AML_NO_ARGS ),
+/* 00 */ ACPI_OP ("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0),
+/* 01 */ ACPI_OP ("One", ARGP_ONE_OP, ARGI_ONE_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0),
+/* 02 */ ACPI_OP ("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
+/* 03 */ ACPI_OP ("Name", ARGP_NAME_OP, ARGI_NAME_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
+/* 04 */ ACPI_OP ("Byte_const", ARGP_BYTE_OP, ARGI_BYTE_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
+/* 05 */ ACPI_OP ("Word_const", ARGP_WORD_OP, ARGI_WORD_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
+/* 06 */ ACPI_OP ("Dword_const", ARGP_DWORD_OP, ARGI_DWORD_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
+/* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
+/* 08 */ ACPI_OP ("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 22'
echo 'File patch-2.4.14 is continued in part 23'
echo "23" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:00 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part37

#!/bin/sh -x
# this is part 37 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 37; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ vPtr = fcMemManager( cpqfcHBAdata->PciDev,
+ &cpqfcHBAdata->dynamic_mem[0],
+ 0,0, (ULONG)ulPtr, NULL ); // 'free' mem
X fcChip->SFQ = 0L; // null invalid ptr
X if( !vPtr )
X {
@@ -1803,8 +1848,8 @@
X fcChip->IMQ->consumerIndex = 0;
X
X ulPtr = (unsigned long)fcChip->IMQ;
- vPtr = fcMemManager( &cpqfcHBAdata->dynamic_mem[0],
- 0,0, (ULONG)ulPtr ); // 'free' mem
+ vPtr = fcMemManager( cpqfcHBAdata->PciDev, &cpqfcHBAdata->dynamic_mem[0],
+ 0,0, (ULONG)ulPtr, NULL ); // 'free' mem
X fcChip->IMQ = 0L; // null invalid ptr
X if( !vPtr )
X {
@@ -1816,8 +1861,8 @@
X if( fcChip->ERQ ) // release memory blocks used by the queues
X {
X ulPtr = (unsigned long)fcChip->ERQ;
- vPtr = fcMemManager( &cpqfcHBAdata->dynamic_mem[0],
- 0,0, (ULONG)ulPtr ); // 'free' mem
+ vPtr = fcMemManager( cpqfcHBAdata->PciDev, &cpqfcHBAdata->dynamic_mem[0],
+ 0,0, (ULONG)ulPtr, NULL ); // 'free' mem
X fcChip->ERQ = 0L; // null invalid ptr
X if( !vPtr )
X {
@@ -1826,19 +1871,8 @@
X }
X }
X
- // free up the primary EXCHANGES struct
- if( fcChip->Exchanges != NULL)
- {
-// printk("kfree() on Exchanges @%p\n", fcChip->Exchanges);
- kfree( fcChip->Exchanges);
- }
-
- // free up Link Q
- if( cpqfcHBAdata->fcLQ != NULL )
- {
-// printk("kfree() on LinkQ @%p\n", fcChip->fcLQ);
- kfree( cpqfcHBAdata->fcLQ);
- }
+ // free up the primary EXCHANGES struct and Link Q
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
X
X LEAVE("DestroyTachLiteQues");
X
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/cpqfcTSinit.c linux/drivers/scsi/cpqfcTSinit.c
--- v2.4.13/linux/drivers/scsi/cpqfcTSinit.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/scsi/cpqfcTSinit.c Thu Oct 25 13:53:50 2001
@@ -67,7 +67,7 @@
X
X /* Embedded module documentation macros - see module.h */
X MODULE_AUTHOR("Compaq Computer Corporation");
-MODULE_DESCRIPTION("Driver for Compaq 64-bit/66Mhz PCI Fibre Channel HBA");
+MODULE_DESCRIPTION("Driver for Compaq 64-bit/66Mhz PCI Fibre Channel HBA v. 2.1.1");
X MODULE_LICENSE("GPL");
X
X int cpqfcTS_TargetDeviceReset( Scsi_Device *ScsiDev, unsigned int reset_flags);
@@ -304,6 +304,13 @@
X while( (PciDev =
X pci_find_device( PCIids[i].vendor_id, PCIids[i].device_id, PciDev) ))
X {
+
+ if (pci_set_dma_mask(PciDev, CPQFCTS_DMA_MASK) != 0) {
+ printk(KERN_WARNING
+ "cpqfc: HBA cannot support required DMA mask, skipping.\n");
+ continue;
+ }
+
X // NOTE: (kernel 2.2.12-32) limits allocation to 128k bytes...
X printk(" scsi_register allocating %d bytes for FC HBA\n",
X (ULONG)sizeof(CPQFCHBA));
@@ -415,8 +422,10 @@
X
X
X // now initialize our hardware...
-
- cpqfcHBAdata->fcChip.InitializeTachyon( cpqfcHBAdata, 1,1);
+ if (cpqfcHBAdata->fcChip.InitializeTachyon( cpqfcHBAdata, 1,1)) {
+ printk(KERN_WARNING "cpqfc: initialization of HBA hardware failed.\n");
+ // FIXME: might want to do something better than nothing here.
+ }
X
X cpqfcHBAdata->fcStatsTime = jiffies; // (for FC Statistics delta)
X
@@ -660,7 +669,7 @@
X
X
X
- case SCSI_IOCTL_FC_TARGET_ADDRESS:
+ case CPQFC_IOCTL_FC_TARGET_ADDRESS:
X result =
X verify_area(VERIFY_WRITE, arg, sizeof(Scsi_FCTargAddress));
X if (result)
@@ -678,7 +687,7 @@
X break;
X
X
- case SCSI_IOCTL_FC_TDR:
+ case CPQFC_IOCTL_FC_TDR:
X
X result = cpqfcTS_TargetDeviceReset( ScsiDev, 0);
X
@@ -880,7 +889,6 @@
X cpqfcTSDecodeGBICtype( &cpqfcHBA->fcChip, &buf[0]);
X cpqfcTSGetLPSM( &cpqfcHBA->fcChip, &buf[ strlen(buf)]);
X copy_info(&info, "%s\n", buf);
-
X
X #define DISPLAY_WWN_INFO
X #ifdef DISPLAY_WWN_INFO
@@ -905,6 +913,9 @@
X }
X }
X #endif
+
+
+
X
X
X // Unfortunately, the proc_info buffer isn't big enough
@@ -1191,6 +1202,9 @@
X
X // The file "hosts.h" says not to call scsi_done from
X // 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
+// for LUNs we know don't exist, so this code might be simplified...)
X
X static void QueBadTargetCmnd( CPQFCHBA *cpqfcHBAdata, Scsi_Cmnd *Cmnd)
X {
@@ -1675,8 +1689,15 @@
X printk(" cpqfcTS adapter PCI master address crossed 45-bit boundary\n");
X if( IntPending & 0x2 )
X printk(" cpqfcTS adapter DMA error detected\n");
- if( IntPending & 0x1 )
+ if( IntPending & 0x1 ) {
+ UCHAR IntStat;
X printk(" cpqfcTS adapter PCI error detected\n");
+ IntStat = readb( cpqfcHBA->fcChip.Registers.INTSTAT.address);
+ if (IntStat & 0x4) printk("(INT)\n");
+ if (IntStat & 0x8)
+ printk("CRS: PCI master address crossed 46 bit bouandary\n");
+ if (IntStat & 0x10) printk("MRE: external memory parity error.\n");
+ }
X }
X }
X spin_unlock_irqrestore( &io_request_lock, flags);
@@ -1859,8 +1880,9 @@
X // we need about 8 allocations per HBA. Figuring at most 10 HBAs per server
X // size the dynamic_mem array at 80.
X
-void* fcMemManager( ALIGNED_MEM *dynamic_mem, ULONG n_alloc, ULONG ab,
- ULONG u32_AlignedAddress)
+void* fcMemManager( struct pci_dev *pdev, ALIGNED_MEM *dynamic_mem,
+ ULONG n_alloc, ULONG ab, ULONG u32_AlignedAddress,
+ dma_addr_t *dma_handle)
X {
X USHORT allocBoundary=1; // compiler specific - worst case 1
X // best case - replace malloc() call
@@ -1882,38 +1904,51 @@
X if( dynamic_mem[i].AlignedAddress == u32_AlignedAddress )
X {
X alloc_address = dynamic_mem[i].BaseAllocated; // 'success' status
- kfree( dynamic_mem[i].BaseAllocated); // return pages to kernel
+ pci_free_consistent(pdev,dynamic_mem[i].size,
+ alloc_address,
+ dynamic_mem[i].dma_handle);
X dynamic_mem[i].BaseAllocated = 0; // clear for next use
X dynamic_mem[i].AlignedAddress = 0;
+ dynamic_mem[i].size = 0;
X break; // quit for loop; done
X }
X }
X }
X else if( n_alloc ) // want new memory?
X {
+ dma_addr_t handle;
X t_alloc = n_alloc + (ab - allocBoundary); // pad bytes for alignment
-// printk("kmalloc() for Tach alignment: %ld bytes\n", t_alloc);
+// printk("pci_alloc_consistent() for Tach alignment: %ld bytes\n", t_alloc);
X
+// (would like to) allow thread block to free pages
X alloc_address = // total bytes (NumberOfBytes)
- kmalloc( t_alloc, GFP_KERNEL); // allow thread block to free pages
-
+ pci_alloc_consistent(pdev, t_alloc, &handle);
X
X // now mask off least sig. bits of address
X if( alloc_address ) // (only if non-NULL)
X {
X // find place to store ptr, so we
X // can free it later...
+
+ mask = (LONG)(ab - 1); // mask all low-order bits
+ mask = ~mask; // invert bits
X for( i=0; i<DYNAMIC_ALLOCATIONS; i++) // look for free slot
X {
X if( dynamic_mem[i].BaseAllocated == 0) // take 1st available
X {
X dynamic_mem[i].BaseAllocated = alloc_address;// address from O/S
+ dynamic_mem[i].dma_handle = handle;
+ if (dma_handle != NULL)
+ {
+// printk("handle = %p, ab=%d, boundary = %d, mask=0x%08x\n",
+// handle, ab, allocBoundary, mask);
+ *dma_handle = (dma_addr_t)
+ ((((ULONG)handle) + (ab - allocBoundary)) & mask);
+ }
+ dynamic_mem[i].size = t_alloc;
X break;
X }
X }
- mask = (LONG)(ab - 1); // mask all low-order bits
- mask = ~mask; // invert bits
-
X ulAddress = (unsigned long)alloc_address;
X
X ulAddress += (ab - allocBoundary); // add the alignment bytes-
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/cpqfcTSioctl.h linux/drivers/scsi/cpqfcTSioctl.h
--- v2.4.13/linux/drivers/scsi/cpqfcTSioctl.h Tue Sep 19 08:01:34 2000
+++ linux/drivers/scsi/cpqfcTSioctl.h Thu Oct 25 13:53:50 2001
@@ -66,9 +66,6 @@
X char rw_flag; /* Read CDB or Write CDB */
X } cpqfc_passthru_t;
X

-
-
-
X /*

X ** Defines for the IOCTLS.
X */
@@ -81,4 +78,17 @@
X
X #define CPQFCTS_SCSI_PASSTHRU _IOWR( CCPQFCTS_IOC_MAGIC,11, VENDOR_IOCTL_REQ)
X
+/* We would rather have equivalent generic, low-level driver agnostic
+ioctls that do what CPQFC_IOCTL_FC_TARGET_ADDRESS and
+CPQFC_IOCTL_FC_TDR 0x5388 do, but currently, we do not have them,
+consequently applications would have to know they are talking to cpqfc. */
+
+/* Used to get Fibre Channel WWN and port_id from device */
+// #define CPQFC_IOCTL_FC_TARGET_ADDRESS 0x5387
+#define CPQFC_IOCTL_FC_TARGET_ADDRESS \
+ _IOR( CCPQFCTS_IOC_MAGIC, 13, Scsi_FCTargAddress)
+
+/* Used to invoke Target Defice Reset for Fibre Channel */
+// #define CPQFC_IOCTL_FC_TDR 0x5388
+#define CPQFC_IOCTL_FC_TDR _IO( CCPQFCTS_IOC_MAGIC, 15)
X
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/cpqfcTSstructs.h linux/drivers/scsi/cpqfcTSstructs.h
--- v2.4.13/linux/drivers/scsi/cpqfcTSstructs.h Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/cpqfcTSstructs.h Thu Oct 25 13:53:50 2001
@@ -28,10 +28,12 @@
X #define DbgDelay(secs) { int wait_time; printk( " DbgDelay %ds ", secs); \
X for( wait_time=jiffies + (secs*HZ); \
X wait_time > jiffies ;) ; }
+
X #define CPQFCTS_DRIVER_VER(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
+// don't forget to also change MODULE_DESCRIPTION in cpqfcTSinit.c
X #define VER_MAJOR 2
-#define VER_MINOR 0
-#define VER_SUBMINOR 5
+#define VER_MINOR 1
+#define VER_SUBMINOR 1
X
X // Macros for kernel (esp. SMP) tracing using a PCI analyzer
X // (e.g. x86).
@@ -413,11 +415,23 @@
X // struct is sized for largest expected cmnd (LOGIN)
X } TachLiteERQ;
X
+// for now, just 32 bit DMA, eventually 40something, with code changes
+#define CPQFCTS_DMA_MASK ((unsigned long) (0x00000000FFFFFFFF))
+
+#define TL_MAX_SG_ELEM_LEN 0x7ffff // Max buffer length a single S/G entry
+ // may represent (a hardware limitation). The
+ // only reason to ever change this is if you
+ // want to exercise very-hard-to-reach code in
+ // cpqfcTSworker.c:build_SEST_sglist().
+
+#define TL_DANGER_SGPAGES 7 // arbitrary high water mark for # of S/G pages
+ // we must exceed to elicit a warning indicative
+ // of EXTREMELY large data transfers or
+ // EXTREME memory fragmentation.
+ // (means we just used up 2048 S/G elements,
+ // Never seen this is real life, only in
+ // testing with tricked up driver.)
X
-#define TL_MAX_SGPAGES 4 // arbitrary limit to # of TL Ext. S/G pages
- // stores array of allocated page blocks used
- // in extended S/G lists. Affects amount of static
- // memory consumed by driver.
X #define TL_EXT_SG_PAGE_COUNT 256 // Number of Extended Scatter/Gather a/l PAIRS
X // Tachyon register (IOBaseU 0x68)
X // power-of-2 value ONLY! 4 min, 256 max
@@ -435,6 +449,8 @@
X ULONG RSP_Len;
X ULONG RSP_Addr;
X ULONG Buff_Off;
+#define USES_EXTENDED_SGLIST(this_sest, x_ID) \
+ (!((this_sest)->u[ x_ID ].IWE.Buff_Off & 0x80000000))
X ULONG Link;
X ULONG RX_ID;
X ULONG Data_Len;
@@ -514,12 +530,14 @@
X ULONG GAddr3;
X } TachLiteTRE;
X
-typedef struct
+typedef struct ext_sg_page_ptr_t *PSGPAGES;
+typedef struct ext_sg_page_ptr_t
X {
- void *PoolPage[TL_MAX_SGPAGES];
-} SGPAGES, *PSGPAGES; // linked list of S/G pairs, by Exchange
-
-
+ unsigned char page[TL_EXT_SG_PAGE_BYTELEN * 2]; // 2x for alignment
+ dma_addr_t busaddr; // need the bus addresses and
+ unsigned int maplen; // lengths for later pci unmapping.
+ PSGPAGES next;
+} SGPAGES; // linked list of S/G pairs, by Exchange
X
X typedef struct // SCSI Exchange State Table
X {


@@ -533,7 +551,7 @@
X

X TachFCHDR DataHDR[TACH_SEST_LEN]; // for SEST FCP_DATA frame hdr (no pl)
X TachFCHDR_RSP RspHDR[TACH_SEST_LEN]; // space for SEST FCP_RSP frame
- SGPAGES sgPages[TACH_SEST_LEN]; // array of Pool-allocations
+ PSGPAGES sgPages[TACH_SEST_LEN]; // head of linked list of Pool-allocations
X ULONG length; // Length register
X ULONG base; // copy of base ptr for debug
X } TachSEST;
@@ -642,6 +660,8 @@
X {
X void *BaseAllocated; // address as allocated from O/S;
X unsigned long AlignedAddress; // aligned address (used by Tachyon DMA)
+ dma_addr_t dma_handle;
+ size_t size;
X } ALIGNED_MEM;
X
X
@@ -785,6 +805,8 @@
X TachLiteSFQ *SFQ; // Single Frame Queue
X TachSEST *SEST; // SCSI Exchange State Table
X
+ dma_addr_t exch_dma_handle;
+
X // these function pointers are for "generic" functions, which are
X // replaced with Host Bus Adapter types at
X // runtime.
@@ -834,8 +856,9 @@
X // define misc functions
X int cpqfcTSGetLPSM( PTACHYON fcChip, char cErrorString[]);
X int cpqfcTSDecodeGBICtype( PTACHYON fcChip, char cErrorString[]);
-void* fcMemManager( ALIGNED_MEM *dyn_mem_pair, ULONG n_alloc, ULONG ab,
- ULONG ulAlignedAddress);
+void* fcMemManager( struct pci_dev *pdev,
+ ALIGNED_MEM *dyn_mem_pair, ULONG n_alloc, ULONG ab,
+ ULONG ulAlignedAddress, dma_addr_t *dma_handle);
X
X void BigEndianSwap( UCHAR *source, UCHAR *dest, USHORT cnt);
X
@@ -903,6 +926,7 @@
X ALIGNED_MEM dynamic_mem[DYNAMIC_ALLOCATIONS];
X
X struct pci_dev *PciDev;
+ dma_addr_t fcLQ_dma_handle;
X
X Scsi_Cmnd *LinkDnCmnd[CPQFCTS_REQ_QUEUE_LEN]; // collects Cmnds during LDn
X // (for Acceptable targets)
@@ -964,6 +988,7 @@
X LONG ExchangeID );
X
X void cpqfcTSCompleteExchange(
+ struct pci_dev *pcidev,
X PTACHYON fcChip,
X ULONG exchange_ID);
X
@@ -993,9 +1018,10 @@
X void fcSestReset(
X CPQFCHBA *);
X
-
-
-
+void cpqfc_pci_unmap(struct pci_dev *pcidev,
+ Scsi_Cmnd *cmd,
+ PTACHYON fcChip,
+ ULONG x_ID);
X
X extern const UCHAR valid_al_pa[];
X extern const int number_of_al_pa;
@@ -1376,6 +1402,12 @@
X
X ULONG s_id;
X } ADISC_PAYLOAD;
+
+struct ext_sg_entry_t {
+ __u32 len:18; /* buffer length, bits 0-17 */
+ __u32 uba:13; /* upper bus address bits 18-31 */
+ __u32 lba; /* lower bus address bits 0-31 */
+};
X
X // J. McCarty's LINK.H
X //
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/cpqfcTSworker.c linux/drivers/scsi/cpqfcTSworker.c
--- v2.4.13/linux/drivers/scsi/cpqfcTSworker.c Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/cpqfcTSworker.c Thu Oct 25 13:53:50 2001
@@ -703,8 +703,7 @@
X {
X // printk(" *Terminating x_ID %Xh on %Xh* ",
X // x_ID, Exchanges->fcExchange[x_ID].status);
- cpqfcTSCompleteExchange( fcChip, x_ID);
-
+ cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev, fcChip, x_ID);
X
X }
X } // end of ABTS case
@@ -2061,7 +2060,7 @@
X Done:
X // Regardless of whether the Reply is valid or not, the
X // the exchange is done - complete
- cpqfcTSCompleteExchange( fcChip, (fchs->ox_rx_id >>16)); // complete
+ cpqfcTSCompleteExchange(cpqfcHBAdata->PciDev, fcChip, (fchs->ox_rx_id >>16));
X
X Quit:
X return;


@@ -2146,7 +2145,7 @@
X

X // Regardless of whether the Reply is valid or not, the
X // the exchange is done - complete
- cpqfcTSCompleteExchange( fcChip, (fchs->ox_rx_id >>16)); // complete
+ cpqfcTSCompleteExchange(cpqfcHBAdata->PciDev, fcChip, (fchs->ox_rx_id >>16));
X
X Quit:
X return;
@@ -2328,7 +2327,7 @@
X !(fcChip->SEST->u[ ExchangeID].IWE.Hdr_Len
X & 0x80000000))
X {
- cpqfcTSCompleteExchange( fcChip, ExchangeID);
+ cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev, fcChip, ExchangeID);
X }
X else
X {
@@ -2370,7 +2369,7 @@
X ((Exchanges->fcExchange[ ExchangeID].fchs.d_id & 0xFFFFFF) ==
X (fchs->s_id & 0xFFFFFF)) )
X {
- cpqfcTSCompleteExchange( fcChip, ExchangeID );
+ cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev, fcChip, ExchangeID );
X }
X }
X }
@@ -2409,7 +2408,7 @@
X // already completed the exchange...
X
X // printk("complete x_ID %Xh on ABTS RJT\n", ExchangeID);
- cpqfcTSCompleteExchange( fcChip, ExchangeID );
+ cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev, fcChip, ExchangeID );
X }
X }
X } // end of ABTS check
@@ -2672,7 +2671,7 @@
X printk("completing x_ID %X on status %Xh\n",
X ExchangeID, Exchanges->fcExchange[ExchangeID].status);
X #endif
- cpqfcTSCompleteExchange( fcChip, ExchangeID);
+ cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev, fcChip, ExchangeID);
X }
X }
X else // Xchange setup failed...
@@ -2915,6 +2914,22 @@
X Done:
X }
X
+static void
+call_scsi_done(Scsi_Cmnd *Cmnd)
+{
+ // We have to reinitialize sent_command here, so the scsi-mid
+ // layer won't re-use the scsi command leaving it set incorrectly.
+ // (incorrectly for our purposes...it's normally unused.)
+
+ if (Cmnd->SCp.sent_command != 0) { // was it a passthru?
+ Cmnd->SCp.sent_command = 0;
+ Cmnd->result &= 0xff00ffff;
+ Cmnd->result |= (DID_PASSTHROUGH << 16); // prevents retry
+ }
+ if (Cmnd->scsi_done != NULL)
+ (*Cmnd->scsi_done)(Cmnd);
+}
+
X // After successfully getting a "Process Login" (PRLI) from an
X // FC port, we want to Discover the LUNs so that we know the
X // addressing type (e.g., FCP-SCSI Volume Set Address, Peripheral
@@ -3035,8 +3050,7 @@
X Cmnd->result = (DID_SOFT_ERROR << 16); // ask for retry
X // printk(" BoardLockCmnd[%d] %p Complete, chnl/target/lun %d/%d/%d\n",
X // i,Cmnd, Cmnd->channel, Cmnd->target, Cmnd->lun);
- if( Cmnd->scsi_done != NULL)
- (*Cmnd->scsi_done)(Cmnd);
+ call_scsi_done(Cmnd);
X }
X }
X }
@@ -3083,7 +3097,9 @@
X
X // Complete the "bad target" commands (normally only used during
X // initialization, since we aren't supposed to call "scsi_done"
- // inside the queuecommand() function).
+ // inside the queuecommand() function). (this is overly contorted,
+ // scsi_done can be safely called from queuecommand for
+ // this bad target case. May want to simplify this later)
X
X for( i=0; i< CPQFCTS_MAX_TARGET_ID; i++)
X {
@@ -3092,8 +3108,7 @@
X Scsi_Cmnd *Cmnd = cpqfcHBAdata->BadTargetCmnd[i];
X cpqfcHBAdata->BadTargetCmnd[i] = NULL;
X Cmnd->result = (DID_BAD_TARGET << 16);
- if( Cmnd->scsi_done != NULL)
- (*Cmnd->scsi_done)(Cmnd);
+ call_scsi_done(Cmnd);
X }
X else
X break;
@@ -3153,7 +3168,7 @@
X
X if( i >= TACH_SEST_LEN ) // Link Service Exchange
X {
- cpqfcTSCompleteExchange( fcChip, i); // Don't "abort" LinkService
+ cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev, fcChip, i); // Don't "abort" LinkService
X }
X
X else // SEST Exchange TO -- may post ABTS to Worker Thread Que
@@ -3511,11 +3526,14 @@
X (Cmnd->channel == pLoggedInPort->ScsiNexus.channel) )
X {
X Cmnd->result = (DID_SOFT_ERROR <<16); // force retry
- if( Cmnd->scsi_done != NULL)
- (*Cmnd->scsi_done)(Cmnd);
- else
+ if( Cmnd->scsi_done == NULL)
+ {
X printk("LinkDnCmnd scsi_done ptr null, port_id %Xh\n",
X pLoggedInPort->port_id);
+ Cmnd->SCp.sent_command = 0;
+ }
+ else
+ call_scsi_done(Cmnd);
X *SCptr = NULL; // free this slot for next use
X }
X }
@@ -4035,10 +4053,11 @@
X static LONG FindFreeExchange( PTACHYON fcChip, ULONG type );
X
X static ULONG build_SEST_sgList(
+ struct pci_dev *pcidev,
X ULONG *SESTalPairStart,
X Scsi_Cmnd *Cmnd,
X ULONG *sgPairs,
- PSGPAGES sgPages // link list of TL Ext. S/G pages from O/S Pool
+ PSGPAGES *sgPages_head // link list of TL Ext. S/G pages from O/S Pool
X );
X
X static int build_FCP_payload( Scsi_Cmnd *Cmnd,
@@ -4202,7 +4221,6 @@
X // assign tmp ptr (shorthand)
X CMDfchs = &Exchanges->fcExchange[ *fcExchangeIndex].fchs;
X
-
X if( Cmnd != NULL ) // (necessary for ABTS cases)
X {
X Exchanges->fcExchange[ *fcExchangeIndex].Cmnd = Cmnd; // Linux Scsi
@@ -4575,21 +4593,26 @@
X
X
X pIWE->Hdr_Len |= fl; // add xmit FC frame len for data phase
- pIWE->Hdr_Addr = virt_to_bus( dataHDR );
+ pIWE->Hdr_Addr = fcChip->SEST->base +
+ ((unsigned long)&fcChip->SEST->DataHDR[*fcExchangeIndex] -
+ (unsigned long)fcChip->SEST);
+
X pIWE->RSP_Len = sizeof(TachFCHDR_RSP) ; // hdr+data (recv'd RSP frame)
X pIWE->RSP_Len |= (InFCHS->s_id << 8); // MS 24 bits Remote_ID
X
X memset( &fcChip->SEST->RspHDR[ *fcExchangeIndex].pl, 0,
X sizeof( FCP_STATUS_RESPONSE) ); // clear out previous status
-
- pIWE->RSP_Addr = virt_to_bus(
- &fcChip->SEST->RspHDR[ *fcExchangeIndex ]);
+
+ pIWE->RSP_Addr = fcChip->SEST->base +
+ ((unsigned long)&fcChip->SEST->RspHDR[*fcExchangeIndex] -
+ (unsigned long)fcChip->SEST);
X
X // Do we need local or extended gather list?
X // depends on size - we can handle 3 len/addr pairs
X // locally.
X
X fcp_dl = build_SEST_sgList(
+ cpqfcHBAdata->PciDev,
X &pIWE->GLen1,
X Cmnd, // S/G list
X &sgPairs, // return # of pairs in S/G list (from "Data" descriptor)
@@ -4690,16 +4713,16 @@
X pIRE->RSP_Len = sizeof(TachFCHDR_RSP) ; // hdr+data (recv'd RSP frame)
X pIRE->RSP_Len |= (InFCHS->s_id << 8); // MS 24 bits Remote_ID
X
-
- pIRE->RSP_Addr = virt_to_bus(
- &fcChip->SEST->RspHDR[ *fcExchangeIndex ]);
-
+ pIRE->RSP_Addr = fcChip->SEST->base +
+ ((unsigned long)&fcChip->SEST->RspHDR[*fcExchangeIndex] -
+ (unsigned long)fcChip->SEST);
X
X // Do we need local or extended gather list?
X // depends on size - we can handle 3 len/addr pairs
X // locally.
X
X fcp_dl = build_SEST_sgList(
+ cpqfcHBAdata->PciDev,
X &pIRE->SLen1,
X Cmnd, // SCSI command Data desc. with S/G list
X &sgPairs, // return # of pairs in S/G list (from "Data" descriptor)
@@ -4806,6 +4829,7 @@
X // locally.
X
X fcp_dl = build_SEST_sgList(
+ cpqfcHBAdata->PciDev,
X &pTWE->SLen1,
X Cmnd, // S/G list
X &sgPairs, // return # of pairs in S/G list (from "Data" descriptor)
@@ -4900,17 +4924,24 @@
X
X // VALid entry:Dir outbound:enable CM:enal INT:
X pTRE->Hdr_Len = 0x86010020L; // data frame Len always 32 bytes
- pTRE->Hdr_Addr = virt_to_bus( dataHDR );
+ pTRE->Hdr_Addr = // bus address of dataHDR;
+ fcChip->SEST->base +
+ ((unsigned long)&fcChip->SEST->DataHDR[ *fcExchangeIndex ] -
+ (unsigned long)fcChip->SEST);
+
X pTRE->RSP_Len = 64L; // hdr+data (TL assisted RSP frame)
X pTRE->RSP_Len |= (InFCHS->s_id << 8); // MS 24 bits Remote_ID
- pTRE->RSP_Addr = virt_to_bus( rspHDR );
-
+ pTRE->RSP_Addr = // bus address of rspHDR
+ fcChip->SEST->base +
+ ((unsigned long)&fcChip->SEST->RspHDR[ *fcExchangeIndex ] -
+ (unsigned long)fcChip->SEST);
X
X // Do we need local or extended gather list?
X // depends on size - we can handle 3 len/addr pairs
X // locally.
X
X fcp_dl = build_SEST_sgList(
+ cpqfcHBAdata->PciDev,
X &pTRE->GLen1,
X Cmnd, // S/G list
X &sgPairs, // return # of pairs in S/G list (from "Data" descriptor)
@@ -5001,8 +5032,10 @@
X
X // len & flags according to command type above
X pIRB->Req_A_SFS_Len = SfsLen; // includes IRB flags & len
- pIRB->Req_A_SFS_Addr = virt_to_bus(CMDfchs); // TL needs physical addr
- // of frame to send
+ pIRB->Req_A_SFS_Addr = // TL needs physical addr of frame to send
+ fcChip->exch_dma_handle + (unsigned long)CMDfchs -
+ (unsigned long)Exchanges;
+
X pIRB->Req_A_SFS_D_ID = CMDfchs->d_id << 8; // Dest_ID must be consistent!
X
X // Exchange is complete except for "fix-up" fields to be set
@@ -5017,7 +5050,7 @@
X printk( "FC Error: SEST build Pool Allocation failed\n");
X #endif
X // return resources...
- cpqfcTSCompleteExchange( fcChip, *fcExchangeIndex); // SEST build failed
+ cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev, fcChip, *fcExchangeIndex); // SEST build failed
X }
X }
X else // no Exchanges available
@@ -5059,7 +5092,61 @@
X }
X
X
+static dma_addr_t
+cpqfc_pci_map_sg_page(
+ struct pci_dev *pcidev,
+ ULONG *hw_paddr, // where to put phys addr for HW use
+ void *sgp_vaddr, // the virtual address of the sg page
+ dma_addr_t *umap_paddr, // where to put phys addr for unmap
+ unsigned int *maplen, // where to store sg entry length
+ int PairCount) // number of sg pairs used in the page.
+{
+ unsigned long aligned_addr = (unsigned long) sgp_vaddr;
+
+ *maplen = PairCount * 8;
+ aligned_addr += TL_EXT_SG_PAGE_BYTELEN;
+ aligned_addr &= ~(TL_EXT_SG_PAGE_BYTELEN -1);
+
+ *umap_paddr = pci_map_single(pcidev, (void *) aligned_addr,
+ *maplen, PCI_DMA_TODEVICE);
+ *hw_paddr = (ULONG) *umap_paddr;
+
+# if BITS_PER_LONG > 32
+ if( *umap_paddr >>32 ) {
+ printk("cqpfcTS:Tach SG DMA addr %p>32 bits\n",
+ (void*)umap_paddr);
+ return 0;
+ }
+# endif
+ return *umap_paddr;
+}
+
+static void
+cpqfc_undo_SEST_mappings(struct pci_dev *pcidev,
+ unsigned long contigaddr, int len, int dir,
+ struct scatterlist *sgl, int use_sg,
+ PSGPAGES *sgPages_head,
+ int allocated_pages)
+{
+ PSGPAGES i, next;
+
+ if (contigaddr != (unsigned long) NULL)
+ pci_unmap_single(pcidev, contigaddr, len, dir);
+
+ if (sgl != NULL)
+ pci_unmap_sg(pcidev, sgl, use_sg, dir);
X
+ for (i=*sgPages_head; i != NULL ;i = next)
+ {
+ pci_unmap_single(pcidev, i->busaddr, i->maplen,
+ scsi_to_pci_dma_dir(PCI_DMA_TODEVICE));
+ i->busaddr = (dma_addr_t) NULL;
+ i->maplen = 0L;
+ next = i->next;
+ kfree(i);
+ }
+ *sgPages_head = NULL;
+}
X
X // This routine builds scatter/gather lists into SEST entries
X // INPUTS:
@@ -5077,263 +5164,380 @@
X
X //#define DBG_SEST_SGLIST 1 // for printing out S/G pairs with Ext. pages
X
+static int ap_hi_water = TL_DANGER_SGPAGES;
+
X static ULONG build_SEST_sgList(
+ struct pci_dev *pcidev,
X ULONG *SESTalPairStart, // the 3 len/address buffers in SEST
X Scsi_Cmnd *Cmnd,
X ULONG *sgPairs,
- PSGPAGES sgPages) // link list of TL Ext. S/G pages from O/S Pool
+ PSGPAGES *sgPages_head) // link list of TL Ext. S/G pages from O/S Pool
X
X {
X ULONG i, AllocatedPages=0; // Tach Ext. S/G page allocations
X ULONG* alPair = SESTalPairStart;
- ULONG alignedPageAddress; // TL hardware alignment requirement
+ ULONG* ext_sg_page_phys_addr_place = NULL;
X int PairCount;
- unsigned long ulBuff;
+ unsigned long ulBuff, contigaddr;
X ULONG total_data_len=0; // (in bytes)
X ULONG bytes_to_go = Cmnd->request_bufflen; // total xfer (S/G sum)
X ULONG thisMappingLen;
- struct scatterlist *sgl; // S/G list (Linux format)
-
+ struct scatterlist *sgl = NULL; // S/G list (Linux format)
+ int sg_count, totalsgs;
+ dma_addr_t busaddr;
+ unsigned long thislen, offset;
+ PSGPAGES *sgpage = sgPages_head;
+ PSGPAGES prev_page = NULL;
X
+# define WE_HAVE_SG_LIST (sgl != (unsigned long) NULL)
+ contigaddr = (unsigned long) NULL;
X
X if( !Cmnd->use_sg ) // no S/G list?
X {
- *sgPairs = 1; // use "local" S/G pair in SEST entry
- // (for now, ignore address bits above #31)
- *alPair++ = bytes_to_go & 0x7ffff; // bits 18-0, length
- ulBuff = virt_to_bus( Cmnd->request_buffer);
-#if BITS_PER_LONG > 32
- if( ulBuff >>32 )
- {
- printk("FATAL! Tachyon DMA address %p exceeds 32 bits\n", (void*)ulBuff );
- return 0;
- }
-#endif
- *alPair = (ULONG)ulBuff;
- return bytes_to_go;
- }
+ if (bytes_to_go <= TL_MAX_SG_ELEM_LEN)
+ {
+ *sgPairs = 1; // use "local" S/G pair in SEST entry
+ // (for now, ignore address bits above #31)
X
+ *alPair++ = bytes_to_go; // bits 18-0, length
X
- // [TBD - update for Linux to support > 32 bits addressing]
- // since the format for local & extended S/G lists is different,
- // check if S/G pairs exceeds 3.
- *sgPairs = Cmnd->use_sg;
- sgl = (struct scatterlist*)Cmnd->request_buffer;
-
- if( *sgPairs <= 3 ) // need "local" SEST list
+ if (bytes_to_go != 0) {
+ contigaddr = ulBuff = pci_map_single(pcidev,
+ Cmnd->request_buffer,
+ Cmnd->request_bufflen,
+ scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
+ // printk("ms %p ", ulBuff);
+ }
+ else {
+ // No data transfer, (e.g.: Test Unit Ready)
+ // printk("btg=0 ");
+ *sgPairs = 0;
+ memset(alPair, 0, sizeof(*alPair));


+ return 0;
+ }
+

+# if BITS_PER_LONG > 32
+ if( ulBuff >>32 ) {
+ printk("FATAL! Tachyon DMA address %p "
+ "exceeds 32 bits\n", (void*)ulBuff );
+ return 0;
+ }
+# endif
+ *alPair = (ULONG)ulBuff;
+ return bytes_to_go;
+ }
+ else // We have a single large (too big) contiguous buffer.
+ { // We will have to break it up. We'll use the scatter
+ // gather code way below, but use contigaddr instead
+ // of sg_dma_addr(). (this is a very rare case).
+
+ unsigned long btg;
+ contigaddr = pci_map_single(pcidev, Cmnd->request_buffer,
+ Cmnd->request_bufflen,
+ scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
+
+ // printk("contigaddr = %p, len = %d\n",
+ // (void *) contigaddr, bytes_to_go);
+ totalsgs = 0;
+ for (btg = bytes_to_go; btg > 0; ) {
+ btg -= ( btg > TL_MAX_SG_ELEM_LEN ?
+ TL_MAX_SG_ELEM_LEN : btg );
+ totalsgs++;
+ }
+ sgl = NULL;
+ *sgPairs = totalsgs;
+ }
+ }
+ else // we do have a scatter gather list
+ {
+ // [TBD - update for Linux to support > 32 bits addressing]
+ // since the format for local & extended S/G lists is different,
+ // check if S/G pairs exceeds 3.
+ // *sgPairs = Cmnd->use_sg; Nope, that's wrong.
+
+ sgl = (struct scatterlist*)Cmnd->request_buffer;
+ sg_count = pci_map_sg(pcidev, sgl, Cmnd->use_sg,
+ scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
+ // printk("sgl = %p, sg_count = %d\n", (void *) sgl, sg_count);
+ if( sg_count <= 3 ) {
+
+ // we need to be careful here that no individual mapping
+ // is too large, and if any is, that breaking it up
+ // doesn't push us over 3 sgs, or, if it does, that we
+ // handle that case. Tachyon can take 0x7FFFF bits for length,
+ // but sg structure uses "unsigned int", on the face of it,
+ // up to 0xFFFFFFFF or even more.
+
+ int i;
+ unsigned long thislen;
+
+ totalsgs = 0;
+ for (i=0;i<sg_count;i++) {
+ thislen = sg_dma_len(&sgl[i]);
+ while (thislen >= TL_MAX_SG_ELEM_LEN) {
+ totalsgs++;
+ thislen -= TL_MAX_SG_ELEM_LEN;
+ }
+ if (thislen > 0) totalsgs++;
+ }
+ *sgPairs = totalsgs;
+ } else totalsgs = 999; // as a first estimate, definitely >3,
+
+ // if (totalsgs != sg_count)
+ // printk("totalsgs = %d, sgcount=%d\n",totalsgs,sg_count);
+ }
+
+ // printk("totalsgs = %d, sgcount=%d\n", totalsgs, sg_count);
+ if( totalsgs <= 3 ) // can (must) use "local" SEST list
X {
X while( bytes_to_go)
X {
- thisMappingLen = sgl->length; // we want them ALL on every pass
- bytes_to_go = bytes_to_go - thisMappingLen;
+ offset = 0L;
X
- // we have L/A pair; L = thisMappingLen, A = physicalAddress
- // load into SEST...
- total_data_len += thisMappingLen & 0x7ffff; // mask in valid bits
- // per SEST format
- *alPair = thisMappingLen & 0x7ffff; // bits 18-0, length
-// physicalAddress.HighPart <= 19; // shift to bit 19
-
- // pick up bits 44-32 of upper 64-bit address
- // and load into 31-19 LBAU (upper addr) of SEST entry
-// *alPair++ |=(ULONG)((physicalAddress.HighPart & 0xFFF8));
- // on Tachlite TS's local S/G, we can handle 13 extra address bits
- // i.e., bits 31-19 are actually bits 44-32 of physicalAddress
-
- alPair++;
-
- ulBuff = virt_to_bus( sgl->address);
-#if BITS_PER_LONG > 32
- if( ulBuff >>32 )
- {
- printk("cqpfcTS: Tach DMA address %p > 32 bits\n", (void*)ulBuff );
- return 0;
- }
-#endif
- *alPair++ = (ULONG)ulBuff; // lower 32 bits (31-0)
+ if ( WE_HAVE_SG_LIST )
+ thisMappingLen = sg_dma_len(sgl);
+ else // or contiguous buffer?
+ thisMappingLen = bytes_to_go;
X
- ++sgl; // next S/G pair
-#ifdef DBG_SEST_SGLIST
- printk(" thisLen %d ", thisMappingLen);
- printk(" remain %d\n", bytes_to_go);
-#endif
+ while (thisMappingLen > 0)
+ {
+ thislen = thisMappingLen > TL_MAX_SG_ELEM_LEN ?
+ TL_MAX_SG_ELEM_LEN : thisMappingLen;
+ bytes_to_go = bytes_to_go - thislen;
X
- }
- }
+ // we have L/A pair; L = thislen, A = physicalAddress
+ // load into SEST...
+
+ total_data_len += thislen;
+ *alPair = thislen; // bits 18-0, length
+
+ alPair++;
X
+ if ( WE_HAVE_SG_LIST )
+ ulBuff = sg_dma_address(sgl) + offset;
+ else
+ ulBuff = contigaddr + offset;
X
+ offset += thislen;
X
+# if BITS_PER_LONG > 32
+ if( ulBuff >>32 ) {
+ printk("cqpfcTS: 2Tach DMA address %p > 32 bits\n",
+ (void*)ulBuff );
+ printk("%s = %p, offset = %ld\n",
+ WE_HAVE_SG_LIST ? "ulBuff" : "contigaddr",
+ WE_HAVE_SG_LIST ? (void *) ulBuff : (void *) contigaddr,
+ offset);
+ return 0;
+ }
+# endif
+ *alPair++ = (ULONG)ulBuff; // lower 32 bits (31-0)
+ thisMappingLen -= thislen;
+ }
+
+ if ( WE_HAVE_SG_LIST ) ++sgl; // next S/G pair
+ else if (bytes_to_go != 0) printk("BTG not zero!\n");
+
+# ifdef DBG_SEST_SGLIST
+ printk("L=%d ", thisMappingLen);
+ printk("btg=%d ", bytes_to_go);
+# endif
X
+ }
+ // printk("i:%d\n", *sgPairs);
+ }
X else // more than 3 pairs requires Extended S/G page (Pool Allocation)
X {
X // clear out SEST DWORDs (local S/G addr) C-F (A-B set in following logic)
-
-
-
X for( i=2; i<6; i++)
X alPair[i] = 0;
X
X PairCount = TL_EXT_SG_PAGE_COUNT; // forces initial page allocation
-
+ totalsgs = 0;
X while( bytes_to_go )
X {
-
-
- // Per SEST format, we can support 524287 byte lenghts per
+ // Per SEST format, we can support 524287 byte lengths per
X // S/G pair. Typical user buffers are 4k, and very rarely
X // exceed 12k due to fragmentation of physical memory pages.
X // However, on certain O/S system (not "user") buffers (on platforms
- // with huge memories like 256Meg), it's possible to exceed this
- // length in a single S/G address/len mapping.
- //
- // Check for Tachyon length boundary
- //
- if( sgl->length > 0x7ffff )
- {
- // never ask for more than we can handle
- thisMappingLen = sgl->length & 0x7ffff;
- }
+ // with huge memories), it's possible to exceed this
+ // length in a single S/G address/len mapping, so we have to handle
+ // that.
+
+ offset = 0L;
+ if ( WE_HAVE_SG_LIST )
+ thisMappingLen = sg_dma_len(sgl);
X else
- thisMappingLen = sgl->length;
-
+ thisMappingLen = bytes_to_go;
X
-
- // should we load into "this" extended S/G page, or allocate
- // new page?
-
- if( PairCount >= TL_EXT_SG_PAGE_COUNT )
+ while (thisMappingLen > 0)
X {
- // have we exceeded the max possible extended pages?
- if( AllocatedPages >= TL_MAX_SGPAGES)
- {
- printk("Error: aborted loop on %d Ext. S/G page allocations\n",
- AllocatedPages);
-
- total_data_len = 0; // failure!! Ext. S/G is All-or-none affair
- break; // failed
- }
-
- // Allocate the TL Extended S/G list page from O/S pool. We have
- // to allocated twice what we want to ensure required TL alignment
- // (Tachlite TL/TS User Man. Rev 6.0, p 168)
- // We store the original allocated PVOID so we can free later
-
- sgPages->PoolPage[ AllocatedPages] =
- kmalloc( TL_EXT_SG_PAGE_BYTELEN*2,GFP_ATOMIC); // double for alignment
-
-
- if( !sgPages->PoolPage[ AllocatedPages] ) // Allocation failed?
- {
-
- printk("Error: Allocation failed @ %d S/G page allocations\n",
- AllocatedPages);
-
- total_data_len = 0; // failure!! Ext. S/G is All-or-none affair
- break; // give up
- }
- // clear out memory we just allocated
- memset( sgPages->PoolPage[AllocatedPages], 0,
- TL_EXT_SG_PAGE_BYTELEN*2);
-
+ thislen = thisMappingLen > TL_MAX_SG_ELEM_LEN ?
+ TL_MAX_SG_ELEM_LEN : thisMappingLen;
+ // printk("%d/%d/%d\n", thislen, thisMappingLen, bytes_to_go);
X
- // align the memory - TL requires sizeof() Ext. S/G page alignment.
- // We doubled the actual required size so we could mask off LSBs
- // to get desired offset
-
- ulBuff = virt_to_bus( sgPages->PoolPage[AllocatedPages]);
-
-#if BITS_PER_LONG > 32
- if( ulBuff >>32 )
- {
- printk("cqpfcTS: Tach ext. S/G DMA address %p > 32 bits\n",
- (void*)ulBuff );
- return 0;
- }
-#endif
-
- ulBuff += TL_EXT_SG_PAGE_BYTELEN; // ensures we pass align. boundary
- ulBuff &= (0xFFFFFFFF - (TL_EXT_SG_PAGE_BYTELEN -1) );// mask off LSBs
-
- alignedPageAddress = (ULONG)ulBuff;
-#ifdef DBG_SEST_SGLIST
- printk("new PoolPage: %p, alignedPageAddress %lXh\n",
- sgPages->PoolPage[AllocatedPages], ulBuff);
-#endif
-
+ // should we load into "this" extended S/G page, or allocate
+ // new page?
X
- // set pointer, in SEST if first Ext. S/G page, or in last pair
- // of linked Ext. S/G pages...
- // (Only 32-bit PVOIDs, so just load lower 32 bits)
- // NOTE: the Len field must be '0' if this is the first Ext. S/G
- // pointer in SEST, and not 0 otherwise.
- if( alPair == SESTalPairStart) // initial Ext. S/G list?
- *alPair = 0;
- else // not the SEST entry... Len must be non-0, so
- // arbitrarily set it to number bytes remaining
- *alPair = ( bytes_to_go & 0x7ffff);
-
-#ifdef DBG_SEST_SGLIST
- printk("PairCount %d @%p even %Xh, ",
- PairCount, alPair, *alPair);
-#endif
- alPair++; // next DWORD
+ if( PairCount >= TL_EXT_SG_PAGE_COUNT )
+ {
+ // Now, we have to map the previous page, (triggering buffer bounce)
+ // The first time thru the loop, there won't be a previous page.
+ if (prev_page != NULL) // is there a prev page?
+ {
+ // this code is normally kind of hard to trigger,
+ // you have to use up more than 256 scatter gather
+ // elements to get here. Cranking down TL_MAX_SG_ELEM_LEN
+ // to an absurdly low value (128 bytes or so) to artificially
+ // break i/o's into a zillion pieces is how I tested it.
+ busaddr = cpqfc_pci_map_sg_page(pcidev,
+ ext_sg_page_phys_addr_place,
+ prev_page->page,
+ &prev_page->busaddr,
+ &prev_page->maplen,
+ PairCount);
+ }
+ // Allocate the TL Extended S/G list page. We have
+ // to allocate twice what we want to ensure required TL alignment
+ // (Tachlite TL/TS User Man. Rev 6.0, p 168)
+ // We store the original allocated PVOID so we can free later
+ *sgpage = kmalloc( sizeof(SGPAGES), GFP_ATOMIC);
+ if ( ! *sgpage )
+ {
+ printk("cpqfc: Allocation failed @ %d S/G page allocations\n",
+ AllocatedPages);
+ total_data_len = 0; // failure!! Ext. S/G is All-or-none affair
+
+ // unmap the previous mappings, if any.
+
+ cpqfc_undo_SEST_mappings(pcidev, contigaddr,
+ Cmnd->request_bufflen,
+ scsi_to_pci_dma_dir(Cmnd->sc_data_direction),
+ sgl, Cmnd->use_sg, sgPages_head, AllocatedPages+1);
+
+ // FIXME: testing shows that if we get here,
+ // it's bad news. (this has been this way for a long
+ // time though, AFAIK. Not that that excuses it.)
X
- *alPair = alignedPageAddress; // TL needs 32-bit physical
-#ifdef DBG_SEST_SGLIST
- printk("odd %Xh\n", *alPair);
-#endif
-
- // now reset the pointer to the ACTUAL (Extended) S/G page
- // which will accept the Len/ PhysicalAddress pairs
- alPair = bus_to_virt(alignedPageAddress);
-
- AllocatedPages++;
- PairCount = 1; // starting new Ext. S/G page
- } // end of new TL Ext. S/G page allocation
+ return 0; // give up (and probably hang the system)
+ }
+ // clear out memory we just allocated
+ memset( (*sgpage)->page,0,TL_EXT_SG_PAGE_BYTELEN*2);
+ (*sgpage)->next = NULL;
+ (*sgpage)->busaddr = (dma_addr_t) NULL;
+ (*sgpage)->maplen = 0L;
+
+ // align the memory - TL requires sizeof() Ext. S/G page alignment.
+ // We doubled the actual required size so we could mask off LSBs
+ // to get desired offset
+
+ ulBuff = (unsigned long) (*sgpage)->page;
+ ulBuff += TL_EXT_SG_PAGE_BYTELEN;
+ ulBuff &= ~(TL_EXT_SG_PAGE_BYTELEN -1);
+
+ // set pointer, in SEST if first Ext. S/G page, or in last pair
+ // of linked Ext. S/G pages... (Only 32-bit PVOIDs, so just
+ // load lower 32 bits)
+ // NOTE: the Len field must be '0' if this is the first Ext. S/G
+ // pointer in SEST, and not 0 otherwise (we know thislen != 0).
+
+ *alPair = (alPair != SESTalPairStart) ? thislen : 0;
+
+# ifdef DBG_SEST_SGLIST
+ printk("PairCount %d @%p even %Xh, ",
+ PairCount, alPair, *alPair);
+# endif
+
+ // Save the place where we need to store the physical
+ // address of this scatter gather page which we get when we map it
+ // (and mapping we can do only after we fill it in.)
+ alPair++; // next DWORD, will contain phys addr of the ext page
+ ext_sg_page_phys_addr_place = alPair;
+
+ // Now, set alPair = the virtual addr of the (Extended) S/G page
+ // which will accept the Len/ PhysicalAddress pairs
+ alPair = (ULONG *) ulBuff;
X
-
- *alPair = thisMappingLen; // bits 18-0, length (range check above)
-
-
-// physicalAddress.HighPart <= 19; // shift to bit 19
-
- // pick up bits 44-32 of upper 64-bit address
- // and load into 31-19 LBAU (upper addr) of SEST entry
-// *alPair |=(ULONG)((physicalAddress.HighPart & 0xFFF8));
+ AllocatedPages++;
+ if (AllocatedPages >= ap_hi_water)
+ {
+ // This message should rarely, if ever, come out.
+ // Previously (cpqfc version <= 2.0.5) the driver would
+ // just puke if more than 4 SG pages were used, and nobody
+ // ever complained about that. This only comes out if
+ // more than 8 pages are used.
+
+ printk(KERN_WARNING
+ "cpqfc: Possible danger. %d scatter gather pages used.\n"
+ "cpqfc: detected seemingly extreme memory "
+ "fragmentation or huge data transfers.\n",
+ AllocatedPages);
+ ap_hi_water = AllocatedPages+1;
+ }
+
+ PairCount = 1; // starting new Ext. S/G page
+ prev_page = (*sgpage); // remember this page, for next time thru
+ sgpage = &((*sgpage)->next);
+ } // end of new TL Ext. S/G page allocation
X
+ *alPair = thislen; // bits 18-0, length (range check above)
X
-#ifdef DBG_SEST_SGLIST
- printk("PairCount %d @%p, even %Xh, ",
- PairCount, alPair, *alPair);
-#endif
+# ifdef DBG_SEST_SGLIST
+ printk("PairCount %d @%p, even %Xh, ", PairCount, alPair, *alPair);
+# endif
X
- alPair++; // next DWORD
- // on Tachlite TS's local S/G, we can handle 13 extra address bits
- // i.e., bits 31-19 are actually bits 44-32 of physicalAddress
+ alPair++; // next DWORD, physical address
X
+ if ( WE_HAVE_SG_LIST )
+ ulBuff = sg_dma_address(sgl) + offset;
+ else
+ ulBuff = contigaddr + offset;
+ offset += thislen;
X
- ulBuff = virt_to_bus( sgl->address);
-#if BITS_PER_LONG > 32
- if( ulBuff >>32 )
- {
- printk("cqpfcTS: Tach DMA address %p > 32 bits\n", (void*)ulBuff );
- return 0;
- }
-#endif
- *alPair = (ULONG)ulBuff; // lower 32 bits (31-0)
+# if BITS_PER_LONG > 32
+ if( ulBuff >>32 )
+ {
+ printk("cqpfcTS: 1Tach DMA address %p > 32 bits\n", (void*)ulBuff );
+ printk("%s = %p, offset = %ld\n",
+ WE_HAVE_SG_LIST ? "ulBuff" : "contigaddr",
+ WE_HAVE_SG_LIST ? (void *) ulBuff : (void *) contigaddr,
+ offset);
+ return 0;
+ }
+# endif
X
+ *alPair = (ULONG) ulBuff; // lower 32 bits (31-0)
X
-#ifdef DBG_SEST_SGLIST
- printk("odd %Xh\n", *alPair);
-#endif
- alPair++; // next DWORD
+# ifdef DBG_SEST_SGLIST
+ printk("odd %Xh\n", *alPair);
+# endif
+ alPair++; // next DWORD, next address/length pair
X
+ PairCount++; // next Length/Address pair
X
- PairCount++; // next Length/Address pair
- bytes_to_go -= thisMappingLen;
- total_data_len += thisMappingLen;
- sgl++; // next S/G pair
- }
+ // if (PairCount > pc_hi_water)
+ // {
+ // printk("pc hi = %d ", PairCount);
+ // pc_hi_water = PairCount;
+ // }
+ bytes_to_go -= thislen;
+ total_data_len += thislen;
+ thisMappingLen -= thislen;
+ totalsgs++;
+ } // while (thisMappingLen > 0)
+ if ( WE_HAVE_SG_LIST ) sgl++; // next S/G pair
+ } // while (bytes_to_go)
+
+ // printk("Totalsgs=%d\n", totalsgs);
+ *sgPairs = totalsgs;
+
+ // PCI map (and bounce) the last (and usually only) extended SG page
+ busaddr = cpqfc_pci_map_sg_page(pcidev,
+ ext_sg_page_phys_addr_place,
+ prev_page->page,
+ &prev_page->busaddr,
+ &prev_page->maplen,
+ PairCount);
X }
X return total_data_len;
X }
@@ -5584,7 +5788,7 @@
X if( CompleteExchange || // flag from Reply frames
X pExchange->status ) // typically, can get FRAME_TO
X {
- cpqfcTSCompleteExchange( fcChip, ExchangeID);
+ cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev, fcChip, ExchangeID);
X }
X }
X
@@ -5594,7 +5798,7 @@
X
X if( CompleteExchange ) // by Type of exchange (e.g. end-of-xchng)
X {
- cpqfcTSCompleteExchange( fcChip, ExchangeID);
+ cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev, fcChip, ExchangeID);
X }
X
X else
@@ -5738,9 +5942,46 @@


X return i;
X }
X

+static void
+cpqfc_pci_unmap_extended_sg(struct pci_dev *pcidev,
+ PTACHYON fcChip,
+ ULONG x_ID)
+{
+ // Unmaps the memory regions used to hold the scatter gather lists
X
+ PSGPAGES i;
X
+ // Were there any such regions needing unmapping?
+ if (! USES_EXTENDED_SGLIST(fcChip->SEST, x_ID))
+ return; // No such regions, we're outta here.
+
+ // for each extended scatter gather region needing unmapping...
+ for (i=fcChip->SEST->sgPages[x_ID] ; i != NULL ; i = i->next)
+ pci_unmap_single(pcidev, i->busaddr, i->maplen,
+ scsi_to_pci_dma_dir(PCI_DMA_TODEVICE));
+}
X
+// Called also from cpqfcTScontrol.o, so can't be static
+void
+cpqfc_pci_unmap(struct pci_dev *pcidev,
+ Scsi_Cmnd *cmd,
+ PTACHYON fcChip,
+ ULONG x_ID)
+{
+ // Undo the DMA mappings
+ if (cmd->use_sg) { // Used scatter gather list for data buffer?
+ cpqfc_pci_unmap_extended_sg(pcidev, fcChip, x_ID);
+ pci_unmap_sg(pcidev, cmd->buffer, cmd->use_sg,
+ scsi_to_pci_dma_dir(cmd->sc_data_direction));
+ // printk("umsg %d\n", cmd->use_sg);
+ }
+ else if (cmd->request_bufflen) {
+ // printk("ums %p ", fcChip->SEST->u[ x_ID ].IWE.GAddr1);
+ pci_unmap_single(pcidev, fcChip->SEST->u[ x_ID ].IWE.GAddr1,
+ cmd->request_bufflen,
+ scsi_to_pci_dma_dir(cmd->sc_data_direction));
+ }
+}
X
X // We call this routine to free an Exchange for any reason:
X // completed successfully, completed with error, aborted, etc.
@@ -5751,10 +5992,12 @@
X //scompleteexchange
X
X void cpqfcTSCompleteExchange(
+ struct pci_dev *pcidev,
X PTACHYON fcChip,
X ULONG x_ID)
X {
X FC_EXCHANGES *Exchanges = fcChip->Exchanges;
+ int already_unmapped = 0;
X
X if( x_ID < TACH_SEST_LEN ) // SEST-based (or LinkServ for FCP exchange)
X {
@@ -5883,9 +6126,38 @@
X // case for. Need code maintenance! Return "ERROR"
X else
X {
- printk("DEFAULT result %Xh, x_ID %Xh, Cmnd %p\n",
+ unsigned int stat = Exchanges->fcExchange[ x_ID ].status;
+ printk("DEFAULT result %Xh, x_ID %Xh, Cmnd %p",
X Exchanges->fcExchange[ x_ID ].status, x_ID,
X Exchanges->fcExchange[ x_ID ].Cmnd);
+
+ if (stat & INVALID_ARGS) printk(" INVALID_ARGS ");
+ if (stat & LNKDWN_OSLS) printk(" LNKDWN_OSLS ");
+ if (stat & LNKDWN_LASER) printk(" LNKDWN_LASER ");
+ if (stat & OUTQUE_FULL) printk(" OUTQUE_FULL ");
+ if (stat & DRIVERQ_FULL) printk(" DRIVERQ_FULL ");
+ if (stat & SEST_FULL) printk(" SEST_FULL ");
+ if (stat & BAD_ALPA) printk(" BAD_ALPA ");
+ if (stat & OVERFLOW) printk(" OVERFLOW ");
+ if (stat & COUNT_ERROR) printk(" COUNT_ERROR ");
+ if (stat & LINKFAIL_RX) printk(" LINKFAIL_RX ");
+ if (stat & ABORTSEQ_NOTIFY) printk(" ABORTSEQ_NOTIFY ");
+ if (stat & LINKFAIL_TX) printk(" LINKFAIL_TX ");
+ if (stat & HOSTPROG_ERR) printk(" HOSTPROG_ERR ");
+ if (stat & FRAME_TO) printk(" FRAME_TO ");
+ if (stat & INV_ENTRY) printk(" INV_ENTRY ");
+ if (stat & SESTPROG_ERR) printk(" SESTPROG_ERR ");
+ if (stat & OUTBOUND_TIMEOUT) printk(" OUTBOUND_TIMEOUT ");
+ if (stat & INITIATOR_ABORT) printk(" INITIATOR_ABORT ");
+ if (stat & MEMPOOL_FAIL) printk(" MEMPOOL_FAIL ");
+ if (stat & FC2_TIMEOUT) printk(" FC2_TIMEOUT ");
+ if (stat & TARGET_ABORT) printk(" TARGET_ABORT ");
+ if (stat & EXCHANGE_QUEUED) printk(" EXCHANGE_QUEUED ");
+ if (stat & PORTID_CHANGED) printk(" PORTID_CHANGED ");
+ if (stat & DEVICE_REMOVED) printk(" DEVICE_REMOVED ");
+ if (stat & SFQ_FRAME) printk(" SFQ_FRAME ");
+ printk("\n");
+
X Exchanges->fcExchange[ x_ID ].Cmnd->result = (DID_ERROR <<16);
X }
X }
@@ -5896,6 +6168,10 @@
X cpqfcTSCheckandSnoopFCP( fcChip, x_ID); // (will set ->result)
X }
X
+ cpqfc_pci_unmap(pcidev, Exchanges->fcExchange[x_ID].Cmnd,
+ fcChip, x_ID); // undo DMA mappings.
+ already_unmapped = 1;
+
X // OK, we've set the Scsi "->result" field, so proceed with calling
X // Linux Scsi "done" (if not NULL), and free any kernel memory we
X // may have allocated for the exchange.
@@ -5910,17 +6186,17 @@
X if( Exchanges->fcExchange[ x_ID ].Cmnd->result != (DID_ABORT<<16) )
X {
X PCI_TRACE(0xAC)
- (*Exchanges->fcExchange[ x_ID ].Cmnd->scsi_done)
- (Exchanges->fcExchange[ x_ID ].Cmnd);
+ call_scsi_done(Exchanges->fcExchange[ x_ID ].Cmnd);


X }
X else
X {
-

+ Exchanges->fcExchange[ x_ID ].Cmnd->SCp.sent_command = 0;
X // printk(" not calling scsi_done on x_ID %Xh, Cmnd %p\n",
X // x_ID, Exchanges->fcExchange[ x_ID ].Cmnd);
X }
X }
X else{
+ Exchanges->fcExchange[ x_ID ].Cmnd->SCp.sent_command = 0;
X printk(" x_ID %Xh, type %Xh, Cdb0 %Xh\n", x_ID,
X Exchanges->fcExchange[ x_ID ].type,
X Exchanges->fcExchange[ x_ID ].Cmnd->cmnd[0]);
@@ -5930,22 +6206,23 @@
X
X // Now, clean up non-Scsi_Cmnd items...
X CleanUpSestResources:
-
+
+ if (!already_unmapped)
+ cpqfc_pci_unmap(pcidev, Exchanges->fcExchange[x_ID].Cmnd,
+ fcChip, x_ID); // undo DMA mappings.
+
X // Was an Extended Scatter/Gather page allocated? We know
X // this by checking DWORD 4, bit 31 ("LOC") of SEST entry
X if( !(fcChip->SEST->u[ x_ID ].IWE.Buff_Off & 0x80000000))
X {
- int i = 0;
+ PSGPAGES p, next;
X
X // extended S/G list was used -- Free the allocated ext. S/G pages
-
- while( fcChip->SEST->sgPages[x_ID].PoolPage[i] &&
- (i < TL_MAX_SGPAGES) )
- {
- kfree( fcChip->SEST->sgPages[x_ID].PoolPage[i]);
- fcChip->SEST->sgPages[x_ID].PoolPage[i] = NULL;
- i++;
+ for (p = fcChip->SEST->sgPages[x_ID]; p != NULL; p = next) {
+ next = p->next;
+ kfree(p);
X }
+ fcChip->SEST->sgPages[x_ID] = NULL;
X }
X
X Exchanges->fcExchange[ x_ID ].Cmnd = NULL;
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/cyberstorm.c linux/drivers/scsi/cyberstorm.c
--- v2.4.13/linux/drivers/scsi/cyberstorm.c Fri Mar 2 18:38:38 2001
+++ linux/drivers/scsi/cyberstorm.c Thu Oct 25 13:53:50 2001
@@ -60,7 +60,7 @@
X * the hardware register!
X */
X
-volatile unsigned char cmd_buffer[16];
+static volatile unsigned char cmd_buffer[16];
X /* This is where all commands are put
X * before they are transferred to the ESP chip
X * via PIO.
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/cyberstormII.c linux/drivers/scsi/cyberstormII.c
--- v2.4.13/linux/drivers/scsi/cyberstormII.c Fri Mar 2 18:38:38 2001
+++ linux/drivers/scsi/cyberstormII.c Thu Oct 25 13:53:50 2001
@@ -50,7 +50,7 @@
X static int dma_ports_p(struct NCR_ESP *esp);
X static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write);
X
-volatile unsigned char cmd_buffer[16];
+static volatile unsigned char cmd_buffer[16];
X /* This is where all commands are put
X * before they are transferred to the ESP chip
X * via PIO.
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/dtc.h linux/drivers/scsi/dtc.h
--- v2.4.13/linux/drivers/scsi/dtc.h Mon Sep 18 14:12:01 2000
+++ linux/drivers/scsi/dtc.h Thu Oct 25 13:53:51 2001
@@ -80,29 +80,29 @@
X #define DTC_address(reg) (base + DTC_5380_OFFSET + reg)
X
X #define dbNCR5380_read(reg) \
- (rval=readb(DTC_address(reg)), \
+ (rval=isa_readb(DTC_address(reg)), \
X (((unsigned char) printk("DTC : read register %d at addr %08x is: %02x\n"\
X , (reg), (int)DTC_address(reg), rval)), rval ) )
X
X #define dbNCR5380_write(reg, value) do { \
X printk("DTC : write %02x to register %d at address %08x\n", \
X (value), (reg), (int)DTC_address(reg)); \
- writeb(value, DTC_address(reg));} while(0)
+ isa_writeb(value, DTC_address(reg));} while(0)
X
X
X #if !(DTCDEBUG & DTCDEBUG_TRANSFER)
-#define NCR5380_read(reg) (readb(DTC_address(reg)))
-#define NCR5380_write(reg, value) (writeb(value, DTC_address(reg)))
+#define NCR5380_read(reg) (isa_readb(DTC_address(reg)))
+#define NCR5380_write(reg, value) (isa_writeb(value, DTC_address(reg)))
X #else
-#define NCR5380_read(reg) (readb(DTC_address(reg)))
+#define NCR5380_read(reg) (isa_readb(DTC_address(reg)))
X #define xNCR5380_read(reg) \
X (((unsigned char) printk("DTC : read register %d at address %08x\n"\
- , (reg), DTC_address(reg))), readb(DTC_address(reg)))
+ , (reg), DTC_address(reg))), isa_readb(DTC_address(reg)))
X
X #define NCR5380_write(reg, value) do { \
X printk("DTC : write %02x to register %d at address %08x\n", \
X (value), (reg), (int)DTC_address(reg)); \
- writeb(value, DTC_address(reg));} while(0)
+ isa_writeb(value, DTC_address(reg));} while(0)
X #endif
X
X #define NCR5380_intr dtc_intr
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/fastlane.c linux/drivers/scsi/fastlane.c
--- v2.4.13/linux/drivers/scsi/fastlane.c Wed Apr 11 19:02:37 2001
+++ linux/drivers/scsi/fastlane.c Thu Oct 25 13:53:51 2001


@@ -41,7 +41,7 @@
X

X #include <linux/zorro.h>
X #include <asm/irq.h>
-#include <asm/io.h>
+
X #include <asm/amigaints.h>
X #include <asm/amigahw.h>
X
@@ -74,7 +74,7 @@
X * the hardware register!
X */
X
-volatile unsigned char cmd_buffer[16];
+static volatile unsigned char cmd_buffer[16];
X /* This is where all commands are put
X * before they are transferred to the ESP chip
X * via PIO.
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/gdth.c linux/drivers/scsi/gdth.c
--- v2.4.13/linux/drivers/scsi/gdth.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/scsi/gdth.c Thu Oct 25 13:53:51 2001
@@ -4574,7 +4574,7 @@
X Scsi_Device sdev;
X #endif
X char cmnd[MAX_COMMAND_SIZE];
- memset(cmnd, 0xff, 12);
+ memset(cmnd, 0xff, MAX_COMMAND_SIZE);
X
X TRACE2(("gdth_flush() hanum %d\n",hanum));
X ha = HADATA(gdth_ctr_tab[hanum]);
@@ -4652,7 +4652,7 @@
X
X #ifndef __alpha__
X /* controller reset */
- memset(cmnd, 0xff, 12);
+ memset(cmnd, 0xff, MAX_COMMAND_SIZE);
X #if LINUX_VERSION_CODE >= 0x020322
X sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
X scp = scsi_allocate_device(sdev, 1, FALSE);
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/gvp11.c linux/drivers/scsi/gvp11.c
--- v2.4.13/linux/drivers/scsi/gvp11.c Mon Nov 27 17:57:34 2000
+++ linux/drivers/scsi/gvp11.c Thu Oct 25 13:53:51 2001
@@ -186,6 +186,7 @@
X unsigned int epc;


X struct zorro_dev *z = NULL;

X unsigned int default_dma_xfer_mask;
+ wd33c93_regs regs;
X #ifdef CHECK_WD33C93
X volatile unsigned char *sasr_3393, *scmd_3393;
X unsigned char save_sasr;
@@ -329,12 +330,11 @@
X /*
X * Check for 14MHz SCSI clock
X */
- if (epc & GVP_SCSICLKMASK)


- wd33c93_init(instance, (wd33c93_regs *)&(DMA(instance)->SASR),
- dma_setup, dma_stop, WD33C93_FS_8_10);

SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 37'
echo 'File patch-2.4.14 is continued in part 38'
echo "38" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:52 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part29

#!/bin/sh -x
# this is part 29 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 29; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ goto err_release_region;
X } else {
- printk ( KERN_INFO "fv=%d.%d.%d lv=%d.%d.%d\n",
+ printk ( KERN_INFO "IP2: fv=%d.%d.%d lv=%d.%d.%d\n",
X pB->i2ePom.e.porVersion,
X pB->i2ePom.e.porRevision,
X pB->i2ePom.e.porSubRev, pB->i2eLVersion,
@@ -992,24 +1023,24 @@
X switch ( pB->i2ePom.e.porID & ~POR_ID_RESERVED ) {
X
X default:
- printk( KERN_ERR "IP2: Unknown board type, ID = %x",
+ printk( KERN_ERR "IP2: Unknown board type, ID = %x\n",
X pB->i2ePom.e.porID );
X nports = 0;
- goto ex_exit;
+ goto err_release_region;
X break;
X
X case POR_ID_II_4: /* IntelliPort-II, ISA-4 (4xRJ45) */
- printk ( KERN_INFO "ISA-4" );
+ printk ( KERN_INFO "IP2: ISA-4\n" );
X nports = 4;
X break;
X
X case POR_ID_II_8: /* IntelliPort-II, 8-port using standard brick. */
- printk ( KERN_INFO "ISA-8 std" );
+ printk ( KERN_INFO "IP2: ISA-8 std\n" );
X nports = 8;
X break;
X
X case POR_ID_II_8R: /* IntelliPort-II, 8-port using RJ11's (no CTS) */
- printk ( KERN_INFO "ISA-8 RJ11" );
+ printk ( KERN_INFO "IP2: ISA-8 RJ11\n" );
X nports = 8;
X break;
X
@@ -1030,8 +1061,14 @@
X }
X DevTableMem[boardnum] = pCh =
X kmalloc( sizeof(i2ChanStr) * nports, GFP_KERNEL );
+ if ( !pCh ) {
+ printk ( KERN_ERR "IP2: (i2_init_channel:) Out of memory.\n");
+ goto err_release_region;
+ }
X if ( !i2InitChannels( pB, nports, pCh ) ) {
- printk(KERN_ERR "i2InitChannels failed: %d\n",pB->i2eError);
+ printk(KERN_ERR "IP2: i2InitChannels failed: %d\n",pB->i2eError);
+ kfree ( pCh );
+ goto err_release_region;
X }
X pB->i2eChannelPtr = &DevTable[portnum];
X pB->i2eChannelCnt = ABS_MOST_PORTS;
@@ -1045,17 +1082,24 @@
X }
X }
X }
- printk(KERN_INFO "IP2: EX box=%d ports=%d %d bit",
+ printk(KERN_INFO "IP2: EX box=%d ports=%d %d bit\n",
X nboxes, nports, pB->i2eDataWidth16 ? 16 : 8 );
X }
X goto ex_exit;
- break;
X }
X DevTableMem[boardnum] = pCh =
X kmalloc ( sizeof (i2ChanStr) * nports, GFP_KERNEL );
+ if ( !pCh ) {
+ printk ( KERN_ERR "IP2: (i2_init_channel:) Out of memory.\n");
+ goto err_release_region;
+ }
X pB->i2eChannelPtr = pCh;
X pB->i2eChannelCnt = nports;
- i2InitChannels ( pB, pB->i2eChannelCnt, pCh );
+ if ( !i2InitChannels( pB, nports, pCh ) ) {
+ printk(KERN_ERR "IP2: i2InitChannels failed: %d\n",pB->i2eError);
+ kfree ( pCh );
+ goto err_release_region;
+ }
X pB->i2eChannelPtr = &DevTable[IP2_PORTS_PER_BOARD * boardnum];
X
X for( i = 0; i < pB->i2eChannelCnt; ++i ) {
@@ -1064,7 +1108,16 @@
X pCh++;
X }
X ex_exit:
- printk ( KERN_INFO "\n" );
+ pB->tqueue_interrupt.routine = (void(*)(void*)) ip2_interrupt_bh;
+ pB->tqueue_interrupt.data = pB;
+ return;
+
+err_release_region:
+ release_region(ip2config.addr[boardnum], 8);
+err_initialize:
+ kfree ( pB );
+ i2BoardPtrTable[boardnum] = NULL;
+ return;
X }
X
X /******************************************************************************/
@@ -1262,16 +1315,34 @@
X }
X
X
-#ifdef USE_IQI
-static struct tq_struct
-senior_service =
-{ // it's the death that worse than fate
- NULL,
- 0,
- (void(*)(void*)) service_all_boards,
- NULL, //later - board address XXX
-};
-#endif
+/******************************************************************************/
+/* Function: ip2_interrupt_bh(pB) */
+/* Parameters: pB - pointer to the board structure */
+/* Returns: Nothing */
+/* */
+/* Description: */
+/* Service the board in a bottom half interrupt handler and then */
+/* reenable the board's interrupts if it has an IRQ number */
+/* */
+/******************************************************************************/
+static void
+ip2_interrupt_bh(i2eBordStrPtr pB)
+{
+// pB better well be set or we have a problem! We can only get
+// here from the IMMEDIATE queue. Here, we process the boards.
+// Checking pB doesn't cost much and it saves us from the sanity checkers.
+
+ bh_counter++;
+
+ if ( pB ) {
+ i2ServiceBoard( pB );
+ if( pB->i2eUsingIrq ) {
+// Re-enable his interrupts
+ iiEnableMailIrq(pB);
+ }
+ }
+}
+
X
X /******************************************************************************/
X /* Function: ip2_interrupt(int irq, void *dev_id, struct pt_regs * regs) */
@@ -1282,6 +1353,14 @@
X /* */
X /* Description: */
X /* */
+/* Our task here is simply to identify each board which needs servicing. */
+/* If we are queuing then, queue it to be serviced, and disable its irq */
+/* mask otherwise process the board directly. */
+/* */
+/* We could queue by IRQ but that just complicates things on both ends */
+/* with very little gain in performance (how many instructions does */
+/* it take to iterate on the immediate queue). */
+/* */
X /* */
X /******************************************************************************/
X static void
@@ -1290,31 +1369,41 @@
X int i;
X i2eBordStrPtr pB;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, irq );
-#endif
-
-#ifdef USE_IQI
-
- queue_task(&senior_service, &tq_immediate);
- mark_bh(IMMEDIATE_BH);
X
-#else
X /* Service just the boards on the list using this irq */
X for( i = 0; i < i2nBoards; ++i ) {
X pB = i2BoardPtrTable[i];
+
+// Only process those boards which match our IRQ.
+// IRQ = 0 for polled boards, we won't poll "IRQ" boards
+
X if ( pB && (pB->i2eUsingIrq == irq) ) {
+#ifdef USE_IQI
+
+ if (NO_MAIL_HERE != ( pB->i2eStartMail = iiGetMail(pB))) {
+// Disable his interrupt (will be enabled when serviced)
+// This is mostly to protect from reentrancy.
+ iiDisableMailIrq(pB);
+
+// Park the board on the immediate queue for processing.
+ queue_task(&pB->tqueue_interrupt, &tq_immediate);
+
+// Make sure the immediate queue is flagged to fire.
+ mark_bh(IMMEDIATE_BH);
+ }
+#else
+// We are using immediate servicing here. This sucks and can
+// cause all sorts of havoc with ppp and others. The failsafe
+// check on iiSendPendingMail could also throw a hairball.
X i2ServiceBoard( pB );
+#endif /* USE_IQI */
X }
X }
X
-#endif /* USE_IQI */
-
X ++irq_counter;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
-#endif
X }
X
X /******************************************************************************/
@@ -1330,31 +1419,20 @@
X static void
X ip2_poll(unsigned long arg)
X {
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_INTR, 100, 0 );
-#endif
- TimerOn = 0; // it's the truth but not checked in service
-
- bh_counter++;
X
-#ifdef USE_IQI
-
- queue_task(&senior_service, &tq_immediate);
- mark_bh(IMMEDIATE_BH);
+ TimerOn = 0; // it's the truth but not checked in service
X
-#else
- // Just polled boards, service_all might be better
+ // Just polled boards, IRQ = 0 will hit all non-interrupt boards.
+ // It will NOT poll boards handled by hard interrupts.
+ // The issue of queued BH interrups is handled in ip2_interrupt().
X ip2_interrupt(0, NULL, NULL);
X
-#endif /* USE_IQI */
-
X PollTimer.expires = POLL_TIMEOUT;
X add_timer( &PollTimer );
X TimerOn = 1;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
-#endif
X }
X
X static inline void
@@ -1362,9 +1440,8 @@
X {


X unsigned long flags;
X

-#ifdef IP2DEBUG_TRACE
X ip2trace(CHANN, ITRC_INPUT, 21, 0 );
-#endif
+
X // Data input
X if ( pCh->pTTY != NULL ) {
X READ_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags)
@@ -1374,9 +1451,8 @@
X } else
X READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags)
X } else {
-#ifdef IP2DEBUG_TRACE
X ip2trace(CHANN, ITRC_INPUT, 22, 0 );
-#endif
+
X i2InputFlush( pCh );
X }
X }
@@ -1401,9 +1477,7 @@
X
X status = i2GetStatus( pCh, (I2_BRK|I2_PAR|I2_FRA|I2_OVR) );
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_STATUS, 21, 1, status );
-#endif
X
X if (pCh->pTTY && (status & (I2_BRK|I2_PAR|I2_FRA|I2_OVR)) ) {
X if ( (status & I2_BRK) ) {


@@ -1463,9 +1537,7 @@
X }

X }
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_STATUS, 26, 0 );
-#endif
X }
X
X /******************************************************************************/
@@ -1515,13 +1587,12 @@
X static int
X ip2_open( PTTY tty, struct file *pFile )
X {
+ wait_queue_t wait;
X int rc = 0;
X int do_clocal = 0;
X i2ChanStrPtr pCh = DevTable[MINOR(tty->device)];
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (MINOR(tty->device), ITRC_OPEN, ITRC_ENTER, 0 );
-#endif
X
X if ( pCh == NULL ) {
X return -ENODEV;
@@ -1548,14 +1619,23 @@
X * 1. If the port is in the middle of closing wait for the completion
X * and then return the appropriate error.
X */
+ init_waitqueue_entry(&wait, current);
+ add_wait_queue(&pCh->close_wait, &wait);
+ set_current_state( TASK_INTERRUPTIBLE );
+
X if ( tty_hung_up_p(pFile) || ( pCh->flags & ASYNC_CLOSING )) {
X if ( pCh->flags & ASYNC_CLOSING ) {
- interruptible_sleep_on( &pCh->close_wait);
+ schedule();
X }
X if ( tty_hung_up_p(pFile) ) {
+ set_current_state( TASK_RUNNING );
+ remove_wait_queue(&pCh->close_wait, &wait);
X return( pCh->flags & ASYNC_HUP_NOTIFY ) ? -EAGAIN : -ERESTARTSYS;
X }
X }
+ set_current_state( TASK_RUNNING );
+ remove_wait_queue(&pCh->close_wait, &wait);
+
X /*
X * 2. If this is a callout device, make sure the normal port is not in
X * use, and that someone else doesn't have the callout device locked.
@@ -1608,13 +1688,20 @@
X #endif
X
X ++pCh->wopen;
+
+ init_waitqueue_entry(&wait, current);
+ add_wait_queue(&pCh->open_wait, &wait);
+
X for(;;) {
X if ( !(pCh->flags & ASYNC_CALLOUT_ACTIVE)) {
X i2QueueCommands(PTYPE_INLINE, pCh, 100, 2, CMD_DTRUP, CMD_RTSUP);
X pCh->dataSetOut |= (I2_DTR | I2_RTS);
+ set_current_state( TASK_INTERRUPTIBLE );
X serviceOutgoingFifo( pCh->pMyBord );
X }
X if ( tty_hung_up_p(pFile) ) {
+ set_current_state( TASK_RUNNING );
+ remove_wait_queue(&pCh->open_wait, &wait);
X return ( pCh->flags & ASYNC_HUP_NOTIFY ) ? -EBUSY : -ERESTARTSYS;
X }
X if ( !(pCh->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -1631,21 +1718,22 @@
X (pCh->flags & ASYNC_CLOSING)?"True":"False");
X printk(KERN_DEBUG "OpenBlock: waiting for CD or signal\n");
X #endif
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_OPEN, 3, 2, (pCh->flags & ASYNC_CALLOUT_ACTIVE),
- (pCh->flags & ASYNC_CLOSING) );
-#endif
+ (pCh->flags & ASYNC_CLOSING) );
X /* check for signal */
X if (signal_pending(current)) {
X rc = (( pCh->flags & ASYNC_HUP_NOTIFY ) ? -EAGAIN : -ERESTARTSYS);
X break;
X }
- interruptible_sleep_on(&pCh->open_wait);
+ schedule();
X }
+ set_current_state( TASK_RUNNING );
+ remove_wait_queue(&pCh->open_wait, &wait);
+
X --pCh->wopen; //why count?
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_OPEN, 4, 0 );
-#endif
+
X if (rc != 0 ) {
X return rc;
X }
@@ -1682,9 +1770,8 @@
X #endif
X serviceOutgoingFifo( pCh->pMyBord );
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_OPEN, ITRC_RETURN, 0 );
-#endif


+
X return 0;
X }
X

@@ -1707,9 +1794,7 @@
X return;
X }
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_CLOSE, ITRC_ENTER, 0 );
-#endif
X
X #ifdef IP2DEBUG_OPEN
X printk(KERN_DEBUG "IP2:close ttyF%02X:\n",MINOR(tty->device));
@@ -1718,16 +1803,15 @@
X if ( tty_hung_up_p ( pFile ) ) {
X MOD_DEC_USE_COUNT;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_CLOSE, 2, 1, 2 );
-#endif
+
X return;
X }
X if ( tty->count > 1 ) { /* not the last close */
X MOD_DEC_USE_COUNT;
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_CLOSE, 2, 1, 3 );
-#endif
+
X return;
X }
X pCh->flags |= ASYNC_CLOSING; // last close actually
@@ -1794,9 +1878,8 @@
X
X MOD_DEC_USE_COUNT;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_CLOSE, ITRC_RETURN, 1, 1 );
-#endif
+
X return;
X }
X
@@ -1814,9 +1897,11 @@
X {
X i2ChanStrPtr pCh = tty->driver_data;
X
-#ifdef IP2DEBUG_TRACE
+ if( !pCh ) {
+ return;
+ }
+
X ip2trace (CHANN, ITRC_HANGUP, ITRC_ENTER, 0 );
-#endif
X
X ip2_flush_buffer(tty);
X
@@ -1824,7 +1909,7 @@
X
X i2QueueCommands(PTYPE_BYPASS, pCh, 0, 1, CMD_DCD_NREP);
X i2QueueCommands(PTYPE_INLINE, pCh, 0, 2, CMD_CTSFL_DSAB, CMD_RTSFL_DSAB);
- if ( !tty || (tty->termios->c_cflag & HUPCL) ) {
+ if ( (tty->termios->c_cflag & HUPCL) ) {
X i2QueueCommands(PTYPE_BYPASS, pCh, 0, 2, CMD_RTSDN, CMD_DTRDN);
X pCh->dataSetOut &= ~(I2_DTR | I2_RTS);
X i2QueueCommands( PTYPE_INLINE, pCh, 100, 1, CMD_PAUSE(25));
@@ -1839,9 +1924,7 @@
X pCh->pTTY = NULL;
X wake_up_interruptible ( &pCh->open_wait );
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_HANGUP, ITRC_RETURN, 0 );
-#endif
X }
X
X /******************************************************************************/
@@ -1869,9 +1952,7 @@
X int bytesSent = 0;


X unsigned long flags;
X

-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_WRITE, ITRC_ENTER, 2, count, -1 );
-#endif
+ ip2trace (CHANN, ITRC_WRITE, ITRC_ENTER, 2, count, -1 );
X
X /* Flush out any buffered data left over from ip2_putchar() calls. */
X ip2_flush_chars( tty );
@@ -1881,9 +1962,8 @@
X bytesSent = i2Output( pCh, pData, count, user );
X WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags);
X
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent );
-#endif
+ ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent );
+
X return bytesSent > 0 ? bytesSent : 0;
X }
X
@@ -1903,9 +1983,7 @@
X i2ChanStrPtr pCh = tty->driver_data;


X unsigned long flags;
X

-#ifdef IP2DEBUG_TRACE
X // ip2trace (CHANN, ITRC_PUTC, ITRC_ENTER, 1, ch );
-#endif
X
X WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags);
X pCh->Pbuf[pCh->Pbuf_stuff++] = ch;
@@ -1915,9 +1993,7 @@
X } else
X WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags);
X
-#ifdef IP2DEBUG_TRACE
X // ip2trace (CHANN, ITRC_PUTC, ITRC_RETURN, 1, ch );
-#endif
X }
X
X /******************************************************************************/
@@ -1937,9 +2013,9 @@
X
X WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags);
X if ( pCh->Pbuf_stuff ) {
-#ifdef IP2DEBUG_TRACE
-// ip2trace (CHANN, ITRC_PUTC, 10, 1, strip );
-#endif
+
+// ip2trace (CHANN, ITRC_PUTC, 10, 1, strip );
+
X //
X // We may need to restart i2Output if it does not fullfill this request
X //
@@ -1971,9 +2047,7 @@
X bytesFree = i2OutputFree( pCh ) - pCh->Pbuf_stuff;
X READ_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags);
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_WRITE, 11, 1, bytesFree );
-#endif
X
X return ((bytesFree > 0) ? bytesFree : 0);
X }
@@ -1993,9 +2067,9 @@
X i2ChanStrPtr pCh = tty->driver_data;
X int rc;
X unsigned long flags;
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_WRITE, 12, 1, pCh->Obuf_char_count + pCh->Pbuf_stuff );
-#endif
+
X #ifdef IP2DEBUG_WRITE
X printk (KERN_DEBUG "IP2: chars in buffer = %d (%d,%d)\n",
X pCh->Obuf_char_count + pCh->Pbuf_stuff,
@@ -2025,9 +2099,8 @@
X i2ChanStrPtr pCh = tty->driver_data;


X unsigned long flags;
X

-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_FLUSH, ITRC_ENTER, 0 );
-#endif
+
X #ifdef IP2DEBUG_WRITE
X printk (KERN_DEBUG "IP2: flush buffer\n" );
X #endif
@@ -2036,9 +2109,9 @@
X WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags);
X i2FlushOutput( pCh );
X ip2_owake(tty);
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_FLUSH, ITRC_RETURN, 0 );
-#endif
+
X }
X
X /******************************************************************************/
@@ -2173,6 +2246,7 @@
X static int
X ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
X {
+ wait_queue_t wait;
X i2ChanStrPtr pCh = DevTable[MINOR(tty->device)];
X struct async_icount cprev, cnow; /* kernel counter temps */
X struct serial_icounter_struct *p_cuser; /* user space */
@@ -2183,9 +2257,7 @@


X return -ENODEV;
X }
X

-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_IOCTL, ITRC_ENTER, 2, cmd, arg );
-#endif
X
X #ifdef IP2DEBUG_IOCTL
X printk(KERN_DEBUG "IP2: ioctl cmd (%x), arg (%lx)\n", cmd, arg );
@@ -2193,18 +2265,18 @@
X
X switch(cmd) {
X case TIOCGSERIAL:
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_IOCTL, 2, 1, rc );
-#endif
+
X rc = get_serial_info(pCh, (struct serial_struct *) arg);
X if (rc)
X return rc;
X break;
X
X case TIOCSSERIAL:
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_IOCTL, 3, 1, rc );
-#endif
+
X rc = set_serial_info(pCh, (struct serial_struct *) arg);
X if (rc)
X return rc;


@@ -2240,9 +2312,9 @@
X

X case TCSBRK: /* SVID version: non-zero arg --> no break */
X rc = tty_check_change(tty);
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_IOCTL, 4, 1, rc );
-#endif
+
X if (!rc) {
X ip2_wait_until_sent(tty,0);
X if (!arg) {
@@ -2254,9 +2326,9 @@
X
X case TCSBRKP: /* support for POSIX tcsendbreak() */
X rc = tty_check_change(tty);
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_IOCTL, 5, 1, rc );
-#endif
+
X if (!rc) {
X ip2_wait_until_sent(tty,0);
X i2QueueCommands(PTYPE_INLINE, pCh, 100, 1,
@@ -2266,18 +2338,18 @@
X break;
X
X case TIOCGSOFTCAR:
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_IOCTL, 6, 1, rc );
-#endif
+
X PUT_USER(rc,C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
X if (rc)
X return rc;
X break;
X
X case TIOCSSOFTCAR:
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_IOCTL, 7, 1, rc );
-#endif
+
X GET_USER(rc,arg,(unsigned long *) arg);
X if (rc)
X return rc;
@@ -2287,23 +2359,38 @@
X break;
X
X case TIOCMGET:
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_IOCTL, 8, 1, rc );
-#endif
+
X /*
X FIXME - the following code is causing a NULL pointer dereference in
X 2.3.51 in an interrupt handler. It's suppose to prompt the board
X to return the DSS signal status immediately. Why doesn't it do
X the same thing in 2.2.14?
X */
-/*
+
+/* This thing is still busted in the 1.2.12 driver on 2.4.x
+ and even hoses the serial console so the oops can be trapped.
+ /\/\|=mhw=|\/\/ */
+
+#ifdef ENABLE_DSSNOW
X i2QueueCommands(PTYPE_BYPASS, pCh, 100, 1, CMD_DSS_NOW);
+
+ init_waitqueue_entry(&wait, current);
+ add_wait_queue(&pCh->dss_now_wait, &wait);
+ set_current_state( TASK_INTERRUPTIBLE );
+
X serviceOutgoingFifo( pCh->pMyBord );
- interruptible_sleep_on(&pCh->dss_now_wait);
+
+ schedule();
+
+ set_current_state( TASK_RUNNING );
+ remove_wait_queue(&pCh->dss_now_wait, &wait);
+


X if (signal_pending(current)) {
X return -EINTR;
X }

-*/
+#endif
X PUT_USER(rc,
X ((pCh->dataSetOut & I2_RTS) ? TIOCM_RTS : 0)
X | ((pCh->dataSetOut & I2_DTR) ? TIOCM_DTR : 0)
@@ -2317,9 +2404,8 @@
X case TIOCMBIS:
X case TIOCMBIC:
X case TIOCMSET:
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_IOCTL, 9, 0 );
-#endif
+
X rc = set_modem_info(pCh, cmd, (unsigned int *) arg);
X break;
X
@@ -2334,15 +2420,18 @@
X restore_flags(flags);
X i2QueueCommands(PTYPE_BYPASS, pCh, 100, 4,
X CMD_DCD_REP, CMD_CTS_REP, CMD_DSR_REP, CMD_RI_REP);
+ init_waitqueue_entry(&wait, current);
+ add_wait_queue(&pCh->delta_msr_wait, &wait);
+ set_current_state( TASK_INTERRUPTIBLE );
+
X serviceOutgoingFifo( pCh->pMyBord );
X for(;;) {
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_IOCTL, 10, 0 );
-#endif
- interruptible_sleep_on(&pCh->delta_msr_wait);
-#ifdef IP2DEBUG_TRACE
+
+ schedule();
+
X ip2trace (CHANN, ITRC_IOCTL, 11, 0 );
-#endif
+
X /* see if a signal did it */
X if (signal_pending(current)) {
X rc = -ERESTARTSYS;
@@ -2365,6 +2454,9 @@
X }
X cprev = cnow;
X }
+ set_current_state( TASK_RUNNING );
+ remove_wait_queue(&pCh->delta_msr_wait, &wait);
+
X i2QueueCommands(PTYPE_BYPASS, pCh, 100, 3,
X CMD_CTS_NREP, CMD_DSR_NREP, CMD_RI_NREP);
X if ( ! (pCh->flags & ASYNC_CHECK_CD)) {
@@ -2383,9 +2475,8 @@
X * serial driver.
X */
X case TIOCGICOUNT:
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_IOCTL, 11, 1, rc );
-#endif
+
X save_flags(flags);cli();
X cnow = pCh->icount;
X restore_flags(flags);
@@ -2416,15 +2507,14 @@
X case TIOCSERSETMULTI:
X
X default:
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_IOCTL, 12, 0 );
-#endif
+
X rc = -ENOIOCTLCMD;
X break;
X }
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_IOCTL, ITRC_RETURN, 0 );
-#endif
+


X return rc;
X }
X

@@ -2635,9 +2725,9 @@
X #ifdef IP2DEBUG_IOCTL
X printk (KERN_DEBUG "IP2: set line discipline\n" );
X #endif
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (((i2ChanStrPtr)tty->driver_data)->port_index, ITRC_IOCTL, 16, 0 );
-#endif
+
X }
X
X /******************************************************************************/
@@ -3093,12 +3183,16 @@
X break;
X
X default:
- pCh = DevTable[cmd];
- if ( pCh )
- {
- COPY_TO_USER(rc, (char*)arg, (char*)pCh, sizeof(i2ChanStr) );
+ if (cmd < IP2_MAX_PORTS) {
+ pCh = DevTable[cmd];
+ if ( pCh )
+ {
+ COPY_TO_USER(rc, (char*)arg, (char*)pCh, sizeof(i2ChanStr) );
+ } else {
+ rc = -ENODEV;
+ }
X } else {
- rc = cmd < 64 ? -ENODEV : -EINVAL;
+ rc = -EINVAL;
X }
X }
X break;
@@ -3411,10 +3505,10 @@
X /* */
X /* */
X /******************************************************************************/
+#ifdef IP2DEBUG_TRACE
X void
X ip2trace (unsigned short pn, unsigned char cat, unsigned char label, unsigned long codes, ...)
X {
-#ifdef IP2DEBUG_TRACE
X long flags;
X unsigned long *pCode = &codes;
X union ip2breadcrumb bc;


@@ -3454,8 +3548,8 @@
X

X tracebuf[tracestuff++] = *++pCode;
X }


-#endif
X }
+#endif
X
X

X MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.13/linux/drivers/char/istallion.c linux/drivers/char/istallion.c
--- v2.4.13/linux/drivers/char/istallion.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/char/istallion.c Thu Oct 25 13:53:47 2001
@@ -431,6 +431,12 @@
X #endif
X #endif
X
+static struct pci_device_id istallion_pci_tbl[] = {
+ { PCI_VENDOR_ID_STALLION, PCI_DEVICE_ID_ECRA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { 0 }
+};
+MODULE_DEVICE_TABLE(pci, istallion_pci_tbl);
+
X /*****************************************************************************/
X
X /*
@@ -1529,9 +1535,9 @@
X printk("stli_delay(len=%d)\n", len);
X #endif
X if (len > 0) {
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
X schedule_timeout(len);


- current->state = TASK_RUNNING;
+ set_current_state(TASK_RUNNING);
X }

X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/char/joystick/analog.c linux/drivers/char/joystick/analog.c
--- v2.4.13/linux/drivers/char/joystick/analog.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/char/joystick/analog.c Thu Oct 25 14:01:51 2001
@@ -146,7 +146,7 @@
X #define DELTA(x,y) ((y)-(x))
X #define TIME_NAME "TSC"
X #elif __alpha__
-#define GET_TIME(x) get_cycles(x)
+#define GET_TIME(x) ((x) = get_cycles())
X #define DELTA(x,y) ((y)-(x))
X #define TIME_NAME "PCC"
X #else
diff -u --recursive --new-file v2.4.13/linux/drivers/char/lp.c linux/drivers/char/lp.c
--- v2.4.13/linux/drivers/char/lp.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/lp.c Thu Oct 25 00:07:39 2001
@@ -153,6 +153,10 @@
X
X #undef LP_DEBUG
X
+/* Bits used to manage claiming the parport device */
+#define LP_PREEMPT_REQUEST 1
+#define LP_PARPORT_CLAIMED 2
+
X /* --- low-level port access ----------------------------------- */
X
X #define r_dtr(x) (parport_read_data(lp_table[(x)].dev->port))
@@ -160,15 +164,55 @@
X #define w_ctr(x,y) do { parport_write_control(lp_table[(x)].dev->port, (y)); } while (0)
X #define w_dtr(x,y) do { parport_write_data(lp_table[(x)].dev->port, (y)); } while (0)
X
+/* Claim the parport or block trying unless we've already claimed it */
+static void lp_claim_parport_or_block(struct lp_struct *this_lp)
+{
+ if (!test_and_set_bit(LP_PARPORT_CLAIMED, &this_lp->bits)) {
+ parport_claim_or_block (this_lp->dev);
+ }
+}
+
+/* Claim the parport or block trying unless we've already claimed it */
+static void lp_release_parport(struct lp_struct *this_lp)
+{
+ if (test_and_clear_bit(LP_PARPORT_CLAIMED, &this_lp->bits)) {
+ parport_release (this_lp->dev);


+ }
+}
+
+
+

+static int lp_preempt(void *handle)
+{
+ struct lp_struct *this_lp = (struct lp_struct *)handle;
+ set_bit(LP_PREEMPT_REQUEST, &this_lp->bits);
+ return (1);
+}
+
+
+/*
+ * Try to negotiate to a new mode; if unsuccessful negotiate to
+ * compatibility mode. Return the mode we ended up in.
+ */
+static int lp_negotiate(struct parport * port, int mode)
+{
+ if (parport_negotiate (port, mode) != 0) {
+ mode = IEEE1284_MODE_COMPAT;
+ parport_negotiate (port, mode);
+ }
+
+ return (mode);
+}
+
X static int lp_reset(int minor)
X {
X int retval;
- parport_claim_or_block (lp_table[minor].dev);
+ lp_claim_parport_or_block (&lp_table[minor]);
X w_ctr(minor, LP_PSELECP);
X udelay (LP_DELAY);
X w_ctr(minor, LP_PSELECP | LP_PINITP);
X retval = r_str(minor);
- parport_release (lp_table[minor].dev);
+ lp_release_parport (&lp_table[minor]);
X return retval;
X }
X
@@ -180,10 +224,10 @@
X return;
X
X polling = lp_table[minor].dev->port->irq == PARPORT_IRQ_NONE;
- if (polling) parport_release (lp_table[minor].dev);
+ if (polling) lp_release_parport (&lp_table[minor]);
X interruptible_sleep_on_timeout (&lp_table[minor].waitq,
X LP_TIMEOUT_POLLED);
- if (polling) parport_claim_or_block (lp_table[minor].dev);
+ if (polling) lp_claim_parport_or_block (&lp_table[minor]);
X else parport_yield_blocking (lp_table[minor].dev);
X }
X
@@ -229,6 +273,12 @@
X static int lp_wait_ready(int minor)
X {
X int error = 0;
+
+ /* If we're not in compatibility mode, we're ready now! */
+ if (lp_table[minor].current_mode != IEEE1284_MODE_COMPAT) {


+ return (0);
+ }
+

X do {
X error = lp_check_status (minor);
X if (error && (LP_F(minor) & LP_ABORT))
@@ -270,10 +320,10 @@
X
X /* Claim Parport or sleep until it becomes available
X */
- parport_claim_or_block (lp_table[minor].dev);
-
- /* Go to compatibility mode. */
- parport_negotiate (port, IEEE1284_MODE_COMPAT);
+ lp_claim_parport_or_block (&lp_table[minor]);
+ /* Go to the proper mode. */
+ lp_table[minor].current_mode = lp_negotiate (port,
+ lp_table[minor].best_mode);
X
X parport_set_timeout (lp_table[minor].dev,
X lp_table[minor].timeout);
@@ -298,7 +348,13 @@
X
X if (copy_size > 0) {
X /* incomplete write -> check error ! */
- int error = lp_wait_ready (minor);
+ int error;
+
+ parport_negotiate (lp_table[minor].dev->port,
+ IEEE1284_MODE_COMPAT);
+ lp_table[minor].current_mode = IEEE1284_MODE_COMPAT;
+
+ error = lp_wait_ready (minor);
X
X if (error) {
X if (retv == 0)
@@ -307,6 +363,10 @@
X }
X
X parport_yield_blocking (lp_table[minor].dev);
+ lp_table[minor].current_mode
+ = lp_negotiate (port,
+ lp_table[minor].best_mode);
+
X } else if (current->need_resched)
X schedule ();


X
@@ -323,7 +383,14 @@
X }

X } while (count > 0);
X
- parport_release (lp_table[minor].dev);
+ if (test_and_clear_bit(LP_PREEMPT_REQUEST,
+ &lp_table[minor].bits)) {
+ printk(KERN_INFO "lp%d releasing parport\n", minor);
+ parport_negotiate (lp_table[minor].dev->port,
+ IEEE1284_MODE_COMPAT);
+ lp_table[minor].current_mode = IEEE1284_MODE_COMPAT;
+ lp_release_parport (&lp_table[minor]);
+ }
X
X up (&lp_table[minor].port_mutex);
X
@@ -347,9 +414,9 @@
X if (down_interruptible (&lp_table[minor].port_mutex))
X return -EINTR;
X
- parport_claim_or_block (lp_table[minor].dev);
+ lp_claim_parport_or_block (&lp_table[minor]);
X retval = parport_read (port, kbuf, count);
- parport_release (lp_table[minor].dev);
+ lp_release_parport (&lp_table[minor]);
X
X if (retval > 0 && copy_to_user (buf, kbuf, retval))
X retval = -EFAULT;
@@ -379,9 +446,9 @@
X should most likely only ever be used by the tunelp application. */
X if ((LP_F(minor) & LP_ABORTOPEN) && !(file->f_flags & O_NONBLOCK)) {
X int status;
- parport_claim_or_block (lp_table[minor].dev);
+ lp_claim_parport_or_block (&lp_table[minor]);
X status = r_str(minor);
- parport_release (lp_table[minor].dev);
+ lp_release_parport (&lp_table[minor]);
X if (status & LP_POUTPA) {
X printk(KERN_INFO "lp%d out of paper\n", minor);
X LP_F(minor) &= ~LP_BUSY;
@@ -401,6 +468,21 @@
X LP_F(minor) &= ~LP_BUSY;
X return -ENOMEM;
X }
+ /* Determine if the peripheral supports ECP mode */
+ lp_claim_parport_or_block (&lp_table[minor]);
+ if ( (lp_table[minor].dev->port->modes & PARPORT_MODE_ECP) &&
+ !parport_negotiate (lp_table[minor].dev->port,
+ IEEE1284_MODE_ECP)) {
+ printk (KERN_INFO "lp%d: ECP mode\n", minor);
+ lp_table[minor].best_mode = IEEE1284_MODE_ECP;
+ } else {
+ printk (KERN_INFO "lp%d: compatibility mode\n", minor);
+ lp_table[minor].best_mode = IEEE1284_MODE_COMPAT;
+ }
+ /* Leave peripheral in compatibility mode */
+ parport_negotiate (lp_table[minor].dev->port, IEEE1284_MODE_COMPAT);
+ lp_release_parport (&lp_table[minor]);
+ lp_table[minor].current_mode = IEEE1284_MODE_COMPAT;


X return 0;
X }
X

@@ -408,6 +490,10 @@
X {
X unsigned int minor = MINOR(inode->i_rdev);
X
+ lp_claim_parport_or_block (&lp_table[minor]);
+ parport_negotiate (lp_table[minor].dev->port, IEEE1284_MODE_COMPAT);
+ lp_table[minor].current_mode = IEEE1284_MODE_COMPAT;
+ lp_release_parport (&lp_table[minor]);
X lock_kernel();
X kfree(lp_table[minor].lp_buffer);
X lp_table[minor].lp_buffer = NULL;
@@ -470,9 +556,9 @@
X return -EFAULT;
X break;
X case LPGETSTATUS:
- parport_claim_or_block (lp_table[minor].dev);
+ lp_claim_parport_or_block (&lp_table[minor]);
X status = r_str(minor);
- parport_release (lp_table[minor].dev);
+ lp_release_parport (&lp_table[minor]);
X
X if (copy_to_user((int *) arg, &status, sizeof(int)))
X return -EFAULT;
@@ -657,7 +743,7 @@
X char name[8];
X
X lp_table[nr].dev = parport_register_device(port, "lp",
- NULL, NULL, NULL, 0,
+ lp_preempt, NULL, NULL, 0,
X (void *) &lp_table[nr]);
X if (lp_table[nr].dev == NULL)
X return 1;
diff -u --recursive --new-file v2.4.13/linux/drivers/char/misc.c linux/drivers/char/misc.c
--- v2.4.13/linux/drivers/char/misc.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/misc.c Fri Nov 2 17:46:47 2001
@@ -75,6 +75,7 @@
X extern int ds1286_init(void);
X extern int pmu_device_init(void);
X extern int tosh_init(void);
+extern int i8k_init(void);
X
X static int misc_read_proc(char *buf, char **start, off_t offset,
X int len, int *eof, void *private)
@@ -275,6 +276,9 @@
X #endif
X #ifdef CONFIG_TOSHIBA
X tosh_init();
+#endif
+#ifdef CONFIG_I8K
+ i8k_init();
X #endif
X if (devfs_register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
X printk("unable to get major %d for misc devices\n",
diff -u --recursive --new-file v2.4.13/linux/drivers/char/moxa.c linux/drivers/char/moxa.c
--- v2.4.13/linux/drivers/char/moxa.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/moxa.c Thu Oct 25 13:53:47 2001
@@ -105,18 +105,16 @@
X "CP-204J series",
X };
X
-typedef struct {
- unsigned short vendor_id;
- unsigned short device_id;
- unsigned short board_type;
-} moxa_pciinfo;
-
-static moxa_pciinfo moxa_pcibrds[] =
-{
- {PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C218, MOXA_BOARD_C218_PCI},
- {PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C320, MOXA_BOARD_C320_PCI},
- {PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_CP204J, MOXA_BOARD_CP204J},
+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 },
+ { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C320, PCI_ANY_ID, PCI_ANY_ID,
+ 0, 0, MOXA_BOARD_C320_PCI },
+ { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_CP204J, PCI_ANY_ID, PCI_ANY_ID,
+ 0, 0, MOXA_BOARD_CP204J },
+ { 0 }
X };
+MODULE_DEVICE_TABLE(pci, moxa_pcibrds);
X
X typedef struct _moxa_isa_board_conf {
X int boardType;
@@ -487,10 +485,10 @@
X #ifdef CONFIG_PCI
X {
X struct pci_dev *p = NULL;
- n = sizeof(moxa_pcibrds) / sizeof(moxa_pciinfo);
+ n = (sizeof(moxa_pcibrds) / sizeof(moxa_pcibrds[0])) - 1;
X i = 0;
X while (i < n) {
- while((p = pci_find_device(moxa_pcibrds[i].vendor_id, moxa_pcibrds[i].device_id, p))!=NULL)
+ while ((p = pci_find_device(moxa_pcibrds[i].vendor, moxa_pcibrds[i].device, p))!=NULL)
X {
X if (pci_enable_device(p))
X continue;
@@ -498,7 +496,7 @@
X if (verbose)
X printk("More than %d MOXA Intellio family boards found. Board is ignored.", MAX_BOARDS);
X } else {
- moxa_get_PCI_conf(p, moxa_pcibrds[i].board_type,
+ moxa_get_PCI_conf(p, moxa_pcibrds[i].driver_data,
X &moxa_boards[numBoards]);
X numBoards++;
X }
@@ -686,7 +684,7 @@
X ch->tty = 0;
X if (ch->blocked_open) {
X if (ch->close_delay) {
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
X schedule_timeout(ch->close_delay);
X }
X wake_up_interruptible(&ch->open_wait);
@@ -1140,7 +1138,7 @@
X restore_flags(flags);
X ch->blocked_open++;
X while (1) {
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
X if (tty_hung_up_p(filp) ||
X !(ch->asyncflags & ASYNC_INITIALIZED)) {
X #ifdef SERIAL_DO_RESTART
@@ -1164,7 +1162,7 @@
X }
X schedule();
X }


- current->state = TASK_RUNNING;
+ set_current_state(TASK_RUNNING);

X remove_wait_queue(&ch->open_wait, &wait);
X if (!tty_hung_up_p(filp))
X ch->count++;
diff -u --recursive --new-file v2.4.13/linux/drivers/char/mxser.c linux/drivers/char/mxser.c
--- v2.4.13/linux/drivers/char/mxser.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/mxser.c Thu Oct 25 13:53:47 2001
@@ -159,17 +159,14 @@
X #define MOXA_GET_CUMAJOR (MOXA + 64)
X #define MOXA_GETMSTATUS (MOXA + 65)
X
-typedef struct {
- unsigned short vendor_id;
- unsigned short device_id;
- unsigned short board_type;
-} mxser_pciinfo;
-
-static mxser_pciinfo mxser_pcibrds[] =
-{
- {PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C168, MXSER_BOARD_C168_PCI},
- {PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C104, MXSER_BOARD_C104_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 },
+ { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C104, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ MXSER_BOARD_C104_PCI },
+ { 0 }
X };
+MODULE_DEVICE_TABLE(pci, mxser_pcibrds);
X
X static int ioaddr[MXSER_BOARDS];
X static int ttymajor = MXSERMAJOR;


@@ -614,22 +611,22 @@
X {

X struct pci_dev *pdev = NULL;
X
- n = sizeof(mxser_pcibrds) / sizeof(mxser_pciinfo);
+ n = (sizeof(mxser_pcibrds) / sizeof(mxser_pcibrds[0])) - 1;
X index = 0;
X for (b = 0; b < n; b++) {
- pdev = pci_find_device(mxser_pcibrds[b].vendor_id,
- mxser_pcibrds[b].device_id, pdev);
+ pdev = pci_find_device(mxser_pcibrds[b].vendor,
+ mxser_pcibrds[b].device, pdev);
X if (!pdev || pci_enable_device(pdev))
X continue;
X hwconf.pdev = pdev;
X printk("Found MOXA %s board(BusNo=%d,DevNo=%d)\n",
- mxser_brdname[mxser_pcibrds[b].board_type],
+ mxser_brdname[mxser_pcibrds[b].driver_data],
X pdev->bus->number, PCI_SLOT(pdev->devfn));
X if (m >= MXSER_BOARDS) {
X printk("Too many Smartio family boards found (maximum %d),board not configured\n", MXSER_BOARDS);
X } else {
X retval = mxser_get_PCI_conf(pdev,
- mxser_pcibrds[b].board_type, &hwconf);
+ mxser_pcibrds[b].driver_data, &hwconf);
X if (retval < 0) {
X if (retval == MXSER_ERR_IRQ)
X printk("Invalid interrupt number,board not configured\n");
@@ -848,7 +845,7 @@
X */
X timeout = jiffies + HZ;
X while (!(inb(info->base + UART_LSR) & UART_LSR_TEMT)) {
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
X schedule_timeout(5);
X if (jiffies > timeout)
X break;
@@ -864,7 +861,7 @@
X info->tty = 0;
X if (info->blocked_open) {
X if (info->close_delay) {
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
X schedule_timeout(info->close_delay);
X }
X wake_up_interruptible(&info->open_wait);
@@ -1622,7 +1619,7 @@
X outb(inb(info->base + UART_MCR) | UART_MCR_DTR | UART_MCR_RTS,
X info->base + UART_MCR);
X restore_flags(flags);
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
X if (tty_hung_up_p(filp) || !(info->flags & ASYNC_INITIALIZED)) {
X #ifdef SERIAL_DO_RESTART
X if (info->flags & ASYNC_HUP_NOTIFY)
@@ -1644,7 +1641,7 @@
X }
X schedule();
X }


- current->state = TASK_RUNNING;
+ set_current_state(TASK_RUNNING);

X remove_wait_queue(&info->open_wait, &wait);
X if (!tty_hung_up_p(filp))
X info->count++;
@@ -2227,7 +2224,7 @@
X unsigned long flags;
X if (!info->base)
X return;
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
X save_flags(flags);
X cli();
X outb(inb(info->base + UART_LCR) | UART_LCR_SBC, info->base + UART_LCR);
diff -u --recursive --new-file v2.4.13/linux/drivers/char/random.c linux/drivers/char/random.c
--- v2.4.13/linux/drivers/char/random.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/char/random.c Tue Oct 30 15:08:12 2001
@@ -569,7 +569,7 @@
X __u32 w;
X
X while (nwords--) {
- w = rotate_left(r->input_rotate, *in);
+ w = rotate_left(r->input_rotate, *in++);
X i = r->add_ptr = (r->add_ptr - 1) & wordmask;
X /*
X * Normally, we add 7 bits of rotation to the pool.
@@ -1245,15 +1245,16 @@
X
X if (r->entropy_count < nbytes * 8 &&
X r->entropy_count < r->poolinfo.POOLBITS) {
- int nwords = min(r->poolinfo.poolwords - r->entropy_count/32,
- sizeof(tmp) / 4);
+ int nwords = min_t(int,
+ r->poolinfo.poolwords - r->entropy_count/32,
+ sizeof(tmp) / 4);
X
X DEBUG_ENT("xfer %d from primary to %s (have %d, need %d)\n",
X nwords * 32,
X r == sec_random_state ? "secondary" : "unknown",
X r->entropy_count, nbytes * 8);
X
- extract_entropy(random_state, tmp, nwords, 0);
+ extract_entropy(random_state, tmp, nwords * 4, 0);
X add_entropy_words(r, tmp, nwords);
X credit_entropy_store(r, nwords * 32);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/char/rio/rio_linux.c linux/drivers/char/rio/rio_linux.c
--- v2.4.13/linux/drivers/char/rio/rio_linux.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/rio/rio_linux.c Thu Oct 25 13:53:47 2001
@@ -63,6 +63,9 @@
X #include <linux/compatmac.h>
X #include <linux/generic_serial.h>
X
+#if BITS_PER_LONG != 32
+# error FIXME: this driver only works on 32-bit platforms
+#endif
X
X #include "linux_compat.h"
X #include "typdef.h"
diff -u --recursive --new-file v2.4.13/linux/drivers/char/serial.c linux/drivers/char/serial.c
--- v2.4.13/linux/drivers/char/serial.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/serial.c Sun Nov 4 17:35:36 2001
@@ -4457,7 +4457,7 @@
X else if (serial_pci_guess_board(dev, &tmp) == 0) {
X printk(KERN_INFO "Redundant entry in serial pci_table. "
X "Please send the output of\n"
- "lspci -vv, this message (%d,%d,%d,%d)\n"
+ "lspci -vv, this message (%04x,%04x,%04x,%04x)\n"
X "and the manufacturer and name of "
X "serial board or modem board\n"
X "to serial-...@lists.sourceforge.net.\n",
diff -u --recursive --new-file v2.4.13/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- v2.4.13/linux/drivers/char/tty_io.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/tty_io.c Fri Nov 2 17:26:17 2001
@@ -2329,9 +2329,6 @@
X #ifdef CONFIG_SERIAL_TX3912
X tx3912_rs_init();
X #endif
-#ifdef CONFIG_COMPUTONE
- ip2_init();
-#endif
X #ifdef CONFIG_ROCKETPORT
X rp_init();
X #endif
diff -u --recursive --new-file v2.4.13/linux/drivers/char/vt.c linux/drivers/char/vt.c
--- v2.4.13/linux/drivers/char/vt.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/vt.c Fri Oct 26 13:33:47 2001
@@ -1184,6 +1184,24 @@
X switch_screen(new_console);
X
X /*
+ * This can't appear below a successful kill_proc(). If it did,
+ * then the *blank_screen operation could occur while X, having
+ * received acqsig, is waking up on another processor. This
+ * condition can lead to overlapping accesses to the VGA range
+ * and the framebuffer (causing system lockups).
+ *
+ * To account for this we duplicate this code below only if the
+ * controlling process is gone and we've called reset_vc.
+ */
+ if (old_vc_mode != vt_cons[new_console]->vc_mode)
+ {
+ if (vt_cons[new_console]->vc_mode == KD_TEXT)
+ unblank_screen();
+ else
+ do_blank_screen(1);
+ }
+
+ /*
X * If this new console is under process control, send it a signal
X * telling it that it has acquired. Also check if it has died and
X * clean up (similar to logic employed in change_console())
@@ -1209,19 +1227,15 @@
X * to account for and tracking tty count may be undesirable.
X */
X reset_vc(new_console);
- }
- }
X
- /*
- * We do this here because the controlling process above may have
- * gone, and so there is now a new vc_mode
- */
- if (old_vc_mode != vt_cons[new_console]->vc_mode)
- {
- if (vt_cons[new_console]->vc_mode == KD_TEXT)
- unblank_screen();
- else
- do_blank_screen(1);
+ if (old_vc_mode != vt_cons[new_console]->vc_mode)
+ {
+ if (vt_cons[new_console]->vc_mode == KD_TEXT)
+ unblank_screen();
+ else
+ do_blank_screen(1);
+ }
+ }
X }
X
X /*
diff -u --recursive --new-file v2.4.13/linux/drivers/ide/ataraid.c linux/drivers/ide/ataraid.c
--- v2.4.13/linux/drivers/ide/ataraid.c Tue Oct 9 17:06:51 2001
+++ linux/drivers/ide/ataraid.c Thu Oct 25 13:58:35 2001
@@ -51,6 +51,7 @@
X static int ataraid_readahead[256];
X
X static struct block_device_operations ataraid_fops = {
+ owner: THIS_MODULE,
X open: ataraid_open,
X release: ataraid_release,
X ioctl: ataraid_ioctl,
@@ -208,11 +209,9 @@
X int ataraid_get_device(struct raid_device_operations *fops)
X {
X int bit;
- MOD_INC_USE_COUNT;
X down(&ataraid_sem);
X if (ataraiduse==~0U) {
X up(&ataraid_sem);
- MOD_DEC_USE_COUNT;
X return -ENODEV;
X }
X bit=ffz(ataraiduse);
@@ -232,7 +231,6 @@
X ataraiduse &= ~(1<<device);
X ataraid_ops[device] = NULL;
X up(&ataraid_sem);
- MOD_DEC_USE_COUNT;
X }
X
X void ataraid_register_disk(int device,long size)
diff -u --recursive --new-file v2.4.13/linux/drivers/ide/buddha.c linux/drivers/ide/buddha.c
--- v2.4.13/linux/drivers/ide/buddha.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/ide/buddha.c Thu Oct 25 13:53:47 2001
@@ -1,9 +1,11 @@
X /*
- * linux/drivers/ide/buddha.c -- Amiga Buddha and Catweasel IDE Driver
+ * linux/drivers/ide/buddha.c -- Amiga Buddha, Catweasel and X-Surf IDE Driver
X *
X * Copyright (C) 1997 by Geert Uytterhoeven
X *
- * This driver was written by based on the specifications in README.buddha.
+ * This driver was written by based on the specifications in README.buddha and
+ * the X-Surf info from Inside_XSurf.txt available at
+ * http://www.jschoenfeld.com
X *
X * This file is subject to the terms and conditions of the GNU General Public
X * License. See the file COPYING in the main directory of this archive for
@@ -28,12 +30,12 @@
X
X
X /*
- * The Buddha has 2 IDE interfaces, the Catweasel has 3
+ * The Buddha has 2 IDE interfaces, the Catweasel has 3, X-Surf has 2
X */
X
X #define BUDDHA_NUM_HWIFS 2
X #define CATWEASEL_NUM_HWIFS 3
-
+#define XSURF_NUM_HWIFS 2
X
X /*
X * Bases of the IDE interfaces (relative to the board address)
@@ -43,10 +45,17 @@
X #define BUDDHA_BASE2 0xa00
X #define BUDDHA_BASE3 0xc00
X
+#define XSURF_BASE1 0xb000 /* 2.5" Interface */
+#define XSURF_BASE2 0xd000 /* 3.5" Interface */
+
X static u_int buddha_bases[CATWEASEL_NUM_HWIFS] __initdata = {
X BUDDHA_BASE1, BUDDHA_BASE2, BUDDHA_BASE3
X };
X
+static const u_int xsurf_bases[XSURF_NUM_HWIFS] __initdata = {
+ XSURF_BASE1, XSURF_BASE2
+};
+
X
X /*
X * Offsets from one of the above bases
@@ -61,12 +70,17 @@
X #define BUDDHA_SELECT 0x1a /* 101dhhhh , d=drive, hhhh=head */
X #define BUDDHA_STATUS 0x1e /* see status-bits */
X #define BUDDHA_CONTROL 0x11a
+#define XSURF_CONTROL -1 /* X-Surf has no CS1* (Control/AltStat) */
X
X static int buddha_offsets[IDE_NR_PORTS] __initdata = {
X BUDDHA_DATA, BUDDHA_ERROR, BUDDHA_NSECTOR, BUDDHA_SECTOR, BUDDHA_LCYL,
- BUDDHA_HCYL, BUDDHA_SELECT, BUDDHA_STATUS, BUDDHA_CONTROL
+ BUDDHA_HCYL, BUDDHA_SELECT, BUDDHA_STATUS, BUDDHA_CONTROL, -1
X };
X
+static int xsurf_offsets[IDE_NR_PORTS] __initdata = {
+ BUDDHA_DATA, BUDDHA_ERROR, BUDDHA_NSECTOR, BUDDHA_SECTOR, BUDDHA_LCYL,
+ BUDDHA_HCYL, BUDDHA_SELECT, BUDDHA_STATUS, XSURF_CONTROL, -1
+};
X
X /*
X * Other registers
@@ -76,10 +90,17 @@
X #define BUDDHA_IRQ2 0xf40 /* interrupt */
X #define BUDDHA_IRQ3 0xf80
X
+#define XSURF_IRQ1 0x7e
+#define XSURF_IRQ2 0x7e
+
X static int buddha_irqports[CATWEASEL_NUM_HWIFS] __initdata = {
X BUDDHA_IRQ1, BUDDHA_IRQ2, BUDDHA_IRQ3
X };
X
+static const int xsurf_irqports[XSURF_NUM_HWIFS] __initdata = {
+ XSURF_IRQ1, XSURF_IRQ2
+};
+
X #define BUDDHA_IRQ_MR 0xfc0 /* master interrupt enable */
X
X
@@ -87,8 +108,8 @@
X * Board information
X */
X
-static u_long buddha_board;
-static int buddha_num_hwifs = -1;
+enum BuddhaType_Enum {BOARD_BUDDHA, BOARD_CATWEASEL, BOARD_XSURF};
+typedef enum BuddhaType_Enum BuddhaType;
X
X
X /*
@@ -99,64 +120,100 @@
X {
X unsigned char ch;
X
- ch = inb(hwif->io_ports[IDE_IRQ_OFFSET]);
+ ch = z_readb(hwif->io_ports[IDE_IRQ_OFFSET]);
X if (!(ch & 0x80))
- return 0;
+ return 0;


X return 1;
X }
X

-
- /*
- * Any Buddha or Catweasel boards present?
- */
-
-static int __init find_buddha(void)
+static int xsurf_ack_intr(ide_hwif_t *hwif)
X {
- struct zorro_dev *z = NULL;
+ unsigned char ch;
X
- buddha_num_hwifs = 0;
- while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
- unsigned long board;
- if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA)
- buddha_num_hwifs = BUDDHA_NUM_HWIFS;
- else if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL)
- buddha_num_hwifs = CATWEASEL_NUM_HWIFS;
- else
- continue;
- board = z->resource.start;
- if (!request_mem_region(board+BUDDHA_BASE1, 0x800, "IDE"))
- continue;
- buddha_board = ZTWO_VADDR(board);
- /* write to BUDDHA_IRQ_MR to enable the board IRQ */
- *(char *)(buddha_board+BUDDHA_IRQ_MR) = 0;
- break;
- }
- return buddha_num_hwifs;
+ ch = z_readb(hwif->io_ports[IDE_IRQ_OFFSET]);
+ /* X-Surf needs a 0 written to IRQ register to ensure ISA bit A11 stays at 0 */
+ z_writeb(0, hwif->io_ports[IDE_IRQ_OFFSET]);
+ if (!(ch & 0x80))
+ return 0;
+ return 1;
X }
X
-
X /*
X * Probe for a Buddha or Catweasel IDE interface
- * We support only _one_ of them, no multiple boards!
X */
X
X void __init buddha_init(void)
X {
- hw_regs_t hw;
- int i, index;
-
- if (buddha_num_hwifs < 0 && !find_buddha())
- return;
+ hw_regs_t hw;
+ int i, index;
X
- for (i = 0; i < buddha_num_hwifs; i++) {
- ide_setup_ports(&hw, (ide_ioreg_t)(buddha_board+buddha_bases[i]),
- buddha_offsets, 0,
- (ide_ioreg_t)(buddha_board+buddha_irqports[i]),
- buddha_ack_intr, IRQ_AMIGA_PORTS);
- index = ide_register_hw(&hw, NULL);
- if (index != -1)
- printk("ide%d: %s IDE interface\n", index,
- buddha_num_hwifs == BUDDHA_NUM_HWIFS ? "Buddha" :
- "Catweasel");
- }
+ struct zorro_dev *z = NULL;
+ u_long buddha_board = 0;
+ BuddhaType type;
+ int buddha_num_hwifs;
+
+ while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
+ unsigned long board;
+ if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) {
+ buddha_num_hwifs = BUDDHA_NUM_HWIFS;
+ type=BOARD_BUDDHA;
+ } else if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL) {
+ buddha_num_hwifs = CATWEASEL_NUM_HWIFS;
+ type=BOARD_CATWEASEL;
+ } else if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF) {
+ buddha_num_hwifs = XSURF_NUM_HWIFS;
+ type=BOARD_XSURF;
+ } else
+ continue;
+
+ board = z->resource.start;
+
+ if(type != BOARD_XSURF) {
+ if (!request_mem_region(board+BUDDHA_BASE1, 0x800, "IDE"))
+ continue;
+ } else {
+ if (!request_mem_region(board+XSURF_BASE1, 0x1000, "IDE"))
+ continue;
+ if (!request_mem_region(board+XSURF_BASE2, 0x1000, "IDE"))
+ continue;
+ if (!request_mem_region(board+XSURF_IRQ1, 0x8, "IDE"))
+ continue;
+ }
+ buddha_board = ZTWO_VADDR(board);
+
+ /* write to BUDDHA_IRQ_MR to enable the board IRQ */
+ /* X-Surf doesn't have this. IRQs are always on */
+ if(type != BOARD_XSURF) *(char *)(buddha_board+BUDDHA_IRQ_MR) = 0;
+
+ for(i=0;i<buddha_num_hwifs;i++) {
+ if(type != BOARD_XSURF) {
+ ide_setup_ports(&hw, (ide_ioreg_t)(buddha_board+buddha_bases[i]),
+ buddha_offsets, 0,
+ (ide_ioreg_t)(buddha_board+buddha_irqports[i]),
+ buddha_ack_intr, IRQ_AMIGA_PORTS);
+ } else {
+ ide_setup_ports(&hw, (ide_ioreg_t)(buddha_board+xsurf_bases[i]),
+ xsurf_offsets, 0,
+ (ide_ioreg_t)(buddha_board+xsurf_irqports[i]),
+ xsurf_ack_intr, IRQ_AMIGA_PORTS);
+ }
+
+ index = ide_register_hw(&hw, NULL);
+ if (index != -1) {
+ printk("ide%d: ", index);
+ switch(type) {
+ case BOARD_BUDDHA:
+ printk("Buddha");
+ break;
+ case BOARD_CATWEASEL:
+ printk("Catweasel");
+ break;
+ case BOARD_XSURF:
+ printk("X-Surf");
+ break;
+ }
+ printk(" IDE interface\n");
+ }
+ }
+ }
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/ide/falconide.c linux/drivers/ide/falconide.c
--- v2.4.13/linux/drivers/ide/falconide.c Thu Apr 13 22:54:26 2000
+++ linux/drivers/ide/falconide.c Thu Oct 25 13:53:47 2001
@@ -7,7 +7,7 @@
X * License. See the file COPYING in the main directory of this archive for
X * more details.
X */
-
+#include <linux/config.h>
X #include <linux/types.h>
X #include <linux/mm.h>
X #include <linux/interrupt.h>
@@ -16,6 +16,7 @@
X #include <linux/ide.h>
X #include <linux/init.h>
X
+#include <asm/setup.h>
X #include <asm/atarihw.h>
X #include <asm/atariints.h>
X #include <asm/atari_stdma.h>
@@ -41,7 +42,7 @@
X #define ATA_HD_STATUS 0x1d /* see status-bits */
X #define ATA_HD_CONTROL 0x39
X
-static int __init falconide_offsets[IDE_NR_PORTS] = {
+static int falconide_offsets[IDE_NR_PORTS] __initdata = {
X ATA_HD_DATA, ATA_HD_ERROR, ATA_HD_NSECTOR, ATA_HD_SECTOR, ATA_HD_LCYL,
X ATA_HD_HCYL, ATA_HD_SELECT, ATA_HD_STATUS, ATA_HD_CONTROL, -1
X };
diff -u --recursive --new-file v2.4.13/linux/drivers/ide/icside.c linux/drivers/ide/icside.c
--- v2.4.13/linux/drivers/ide/icside.c Fri Feb 9 11:30:23 2001
+++ linux/drivers/ide/icside.c Thu Oct 25 13:53:47 2001
@@ -318,6 +318,117 @@
X return icside_config_if(drive, speed);
X }
X
+/*
+ * dma_intr() is the handler for disk read/write DMA interrupts
+ */
+static ide_startstop_t icside_dmaintr(ide_drive_t *drive)
+{
+ int i;
+ byte stat, dma_stat;
+
+ dma_stat = HWIF(drive)->dmaproc(ide_dma_end, drive);
+ stat = GET_STAT(); /* get drive status */
+ if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) {
+ if (!dma_stat) {
+ struct request *rq = HWGROUP(drive)->rq;
+ rq = HWGROUP(drive)->rq;
+ for (i = rq->nr_sectors; i > 0;) {
+ i -= rq->current_nr_sectors;
+ ide_end_request(1, HWGROUP(drive));
+ }
+ return ide_stopped;
+ }
+ printk("%s: dma_intr: bad DMA status (dma_stat=%x)\n",
+ drive->name, dma_stat);
+ }
+ return ide_error(drive, "dma_intr", stat);
+}
+
+/*
+ * The following is a sick duplication from ide-dma.c ;(
+ *
+ * This should be defined in one place only.
+ */
+struct drive_list_entry {
+ char * id_model;
+ char * id_firmware;
+};
+
+static struct drive_list_entry drive_whitelist [] = {
+ { "Micropolis 2112A", "ALL" },
+ { "CONNER CTMA 4000", "ALL" },
+ { "CONNER CTT8000-A", "ALL" },
+ { "ST34342A", "ALL" },
+ { NULL, 0 }
+};
+
+static struct drive_list_entry drive_blacklist [] = {
+ { "WDC AC11000H", "ALL" },
+ { "WDC AC22100H", "ALL" },
+ { "WDC AC32500H", "ALL" },
+ { "WDC AC33100H", "ALL" },
+ { "WDC AC31600H", "ALL" },
+ { "WDC AC32100H", "24.09P07" },
+ { "WDC AC23200L", "21.10N21" },
+ { "Compaq CRD-8241B", "ALL" },
+ { "CRD-8400B", "ALL" },
+ { "CRD-8480B", "ALL" },
+ { "CRD-8480C", "ALL" },
+ { "CRD-8482B", "ALL" },
+ { "CRD-84", "ALL" },
+ { "SanDisk SDP3B", "ALL" },
+ { "SanDisk SDP3B-64", "ALL" },
+ { "SANYO CD-ROM CRD", "ALL" },
+ { "HITACHI CDR-8", "ALL" },
+ { "HITACHI CDR-8335", "ALL" },
+ { "HITACHI CDR-8435", "ALL" },
+ { "Toshiba CD-ROM XM-6202B", "ALL" },
+ { "CD-532E-A", "ALL" },
+ { "E-IDE CD-ROM CR-840", "ALL" },
+ { "CD-ROM Drive/F5A", "ALL" },
+ { "RICOH CD-R/RW MP7083A", "ALL" },
+ { "WPI CDD-820", "ALL" },
+ { "SAMSUNG CD-ROM SC-148C", "ALL" },
+ { "SAMSUNG CD-ROM SC-148F", "ALL" },
+ { "SAMSUNG CD-ROM SC", "ALL" },
+ { "SanDisk SDP3B-64", "ALL" },
+ { "SAMSUNG CD-ROM SN-124", "ALL" },
+ { "PLEXTOR CD-R PX-W8432T", "ALL" },
+ { "ATAPI CD-ROM DRIVE 40X MAXIMUM", "ALL" },
+ { "_NEC DV5800A", "ALL" },
+ { NULL, 0 }
+};
+
+static int in_drive_list(struct hd_driveid *id, struct drive_list_entry * drive_table)
+{
+ for ( ; drive_table->id_model ; drive_table++)
+ if ((!strcmp(drive_table->id_model, id->model)) &&
+ ((!strstr(drive_table->id_firmware, id->fw_rev)) ||
+ (!strcmp(drive_table->id_firmware, "ALL"))))
+ return 1;


+ return 0;
+}
+

+/*
+ * For both Blacklisted and Whitelisted drives.
+ * This is setup to be called as an extern for future support
+ * to other special driver code.
+ */
+static int check_drive_lists(ide_drive_t *drive, int good_bad)
+{
+ struct hd_driveid *id = drive->id;
+
+ if (good_bad) {
+ return in_drive_list(id, drive_whitelist);
+ } else {
+ int blacklist = in_drive_list(id, drive_blacklist);
+ if (blacklist)
+ printk("%s: Disabling DMA for %s\n", drive->name, id->model);
+ return(blacklist);
+ }


+ return 0;
+}
+

X static int
X icside_dma_check(ide_drive_t *drive)
X {
@@ -333,7 +444,7 @@
X /*
X * Consult the list of known "bad" drives
X */
- if (ide_dmaproc(ide_dma_bad_drive, drive)) {
+ if (check_drive_lists(drive, 0)) {
X func = ide_dma_off;
X goto out;
X }
@@ -358,7 +469,7 @@
X /*
X * Consult the list of known "good" drives
X */
- if (ide_dmaproc(ide_dma_good_drive, drive)) {
+ if (check_drive_lists(drive, 1)) {
X if (id->eide_dma_time > 150)
X goto out;
X xfer_mode = XFER_MW_DMA_1;
@@ -372,12 +483,28 @@


X }
X
X static int

+icside_dma_verbose(ide_drive_t *drive)
+{
+ printk(", DMA");


+ return 1;
+}
+

+static int
X icside_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
X {
X ide_hwif_t *hwif = HWIF(drive);
X int count, reading = 0;
X
X switch (func) {
+ case ide_dma_off:
+ printk("%s: DMA disabled\n", drive->name);
+ /*FALLTHROUGH*/
+
+ case ide_dma_off_quietly:
+ case ide_dma_on:
+ drive->using_dma = (func == ide_dma_on);
+ return 0;
+
X case ide_dma_check:
X return icside_dma_check(drive);
X
@@ -407,7 +534,7 @@
X if (drive->media != ide_disk)
X return 0;
X
- ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL);
+ ide_set_handler(drive, &icside_dmaintr, WAIT_CMD, NULL);
X OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA,
X IDE_COMMAND_REG);
X
@@ -424,9 +551,19 @@
X case ide_dma_test_irq:
X return inb((unsigned long)hwif->hw.priv) & 1;
X
+ case ide_dma_bad_drive:
+ case ide_dma_good_drive:
+ return check_drive_lists(drive, (func == ide_dma_good_drive));
+
+ case ide_dma_verbose:
+ return icside_dma_verbose(drive);
+
+ case ide_dma_timeout:
X default:
- return ide_dmaproc(func, drive);
+ printk("icside_dmaproc: unsupported %s func: %d\n",
+ ide_dmafunc_verbose(func), func);
X }
+ return 1;


X }
X
X static int

@@ -464,13 +601,13 @@
X
X for (index = 0; index < MAX_HWIFS; ++index) {
X hwif = &ide_hwifs[index];
- if (hwif->hw.io_ports[IDE_DATA_OFFSET] == (ide_ioreg_t)dataport)
+ if (hwif->io_ports[IDE_DATA_OFFSET] == (ide_ioreg_t)dataport)
X goto found;
X }
X
X for (index = 0; index < MAX_HWIFS; ++index) {
X hwif = &ide_hwifs[index];
- if (!hwif->hw.io_ports[IDE_DATA_OFFSET])
+ if (!hwif->io_ports[IDE_DATA_OFFSET])
X goto found;
X }
X
@@ -493,10 +630,13 @@
X
X for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
X hwif->hw.io_ports[i] = (ide_ioreg_t)port;
+ hwif->io_ports[i] = (ide_ioreg_t)port;
X port += 1 << info->stepping;
X }
X hwif->hw.io_ports[IDE_CONTROL_OFFSET] = base + info->ctrloffset;
+ hwif->io_ports[IDE_CONTROL_OFFSET] = base + info->ctrloffset;
X hwif->hw.irq = irq;
+ hwif->irq = irq;
X hwif->hw.dma = NO_DMA;
X hwif->noprobe = 0;
X hwif->chipset = ide_acorn;
@@ -579,9 +719,8 @@
X icside_setup_dma(mate, autodma);
X }
X }
-#endif
-
X no_dma:
+#endif
X return hwif || mate ? 0 : -1;
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/ide/ide-cd.c linux/drivers/ide/ide-cd.c
--- v2.4.13/linux/drivers/ide/ide-cd.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/ide/ide-cd.c Wed Oct 24 23:53:51 2001
@@ -2863,7 +2863,7 @@
X struct inode *inode, struct file *file,
X unsigned int cmd, unsigned long arg)
X {
- return cdrom_fops.ioctl (inode, file, cmd, arg);
+ return cdrom_ioctl (inode, file, cmd, arg);
X }
X
X static


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 29'
echo 'File patch-2.4.14 is continued in part 30'
echo "30" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:01 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part38

#!/bin/sh -x
# this is part 38 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 38; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

- else


- wd33c93_init(instance, (wd33c93_regs *)&(DMA(instance)->SASR),

- dma_setup, dma_stop, WD33C93_FS_12_15);


+ regs.SASR = &(DMA(instance)->SASR);
+ regs.SCMD = &(DMA(instance)->SCMD);
+ wd33c93_init(instance, regs, dma_setup, dma_stop,

+ (epc & GVP_SCSICLKMASK) ? WD33C93_FS_8_10
+ : WD33C93_FS_12_15);
X
X if (num_gvp11++ == 0) {
X first_instance = instance;
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/jazz_esp.c linux/drivers/scsi/jazz_esp.c
--- v2.4.13/linux/drivers/scsi/jazz_esp.c Fri Feb 9 11:30:23 2001
+++ linux/drivers/scsi/jazz_esp.c Thu Oct 25 13:53:51 2001
@@ -46,7 +46,7 @@
X static void dma_led_on(struct NCR_ESP *);
X

X
-volatile unsigned char cmd_buffer[16];
+static volatile unsigned char cmd_buffer[16];
X /* This is where all commands are put

X * before they are trasfered to the ESP chip
X * via PIO.
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/mac_esp.c linux/drivers/scsi/mac_esp.c
--- v2.4.13/linux/drivers/scsi/mac_esp.c Fri Mar 2 18:38:38 2001
+++ linux/drivers/scsi/mac_esp.c Thu Oct 25 13:53:51 2001
@@ -65,7 +65,7 @@
X static int esp_dafb_dma_irq_p(struct NCR_ESP * espdev);
X static int esp_iosb_dma_irq_p(struct NCR_ESP * espdev);


X
-volatile unsigned char cmd_buffer[16];
+static volatile unsigned char cmd_buffer[16];
X /* This is where all commands are put
X * before they are transferred to the ESP chip
X * via PIO.

diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/mca_53c9x.c linux/drivers/scsi/mca_53c9x.c
--- v2.4.13/linux/drivers/scsi/mca_53c9x.c Fri Feb 9 11:30:23 2001
+++ linux/drivers/scsi/mca_53c9x.c Thu Oct 25 13:53:51 2001
@@ -68,7 +68,7 @@
X * 53c9x via PIO.


X */
X
-volatile unsigned char cmd_buffer[16];
+static volatile unsigned char cmd_buffer[16];
X

X /*
X * We keep the structure that is used to access the registers on the 53c9x
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/megaraid.c linux/drivers/scsi/megaraid.c
--- v2.4.13/linux/drivers/scsi/megaraid.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/scsi/megaraid.c Thu Oct 25 13:53:51 2001
@@ -9,9 +9,9 @@
X * as published by the Free Software Foundation; either version
X * 2 of the License, or (at your option) any later version.
X *
- * Version : v1.17a (July 13, 2001)
+ * Version : v1.18 (Oct 11, 2001)
X *
- * Description: Linux device driver for AMI MegaRAID controller
+ * Description: Linux device driver for LSI Logic MegaRAID controller
X *
X * Supported controllers: MegaRAID 418, 428, 438, 466, 762, 467, 471, 490
X * 493.
@@ -427,12 +427,39 @@
X * our current formula working to calculate logical drive number, return
X * failure for LUN > 7
X *
+ *
+ * Version 1.17b
+ * Mon Jul 30 19:24:02 EDT 2001 - AM
+ *
+ * Added support for random deletion of logical drives
+ *
+ * Version 1.17c
+ * Tue Sep 25 09:37:49 EDT 2001 - Atul Mukker <at...@lsil.com>
+ *
+ * With single and dual channel controllers, some virtaul channels are
+ * displayed negative.
+ *
X * Version 1.17a-ac
X * Mon Aug 6 14:59:29 BST 2001 - "Michael Johnson" <joh...@home.com>
X *
X * Make the HP print formatting and check for buggy firmware runtime not
X * ifdef dependant.
X *
+ *
+ * Version 1.17d
+ * Thu Oct 11 10:48:45 EDT 2001 - Atul Mukker <at...@lsil.com>
+ *
+ * Driver 1.17c oops when loaded without controller.
+ *
+ * Special case for "use_sg == 1" removed while building the scatter gather
+ * list.
+ *
+ * Version 1.18
+ * Thu Oct 11 15:02:53 EDT 2001 - Atul Mukker <at...@lsil.com>
+ *
+ * References to AMI have been changed to LSI Logic.
+ *
+ *
X * BUGS:
X * Some older 2.1 kernels (eg. 2.1.90) have a bug in pci.c that
X * fails to detect the controller as a pci device on the system.
@@ -550,16 +577,15 @@
X * queue task is a simple api without irq forms
X */
X
-MODULE_AUTHOR ("American Megatrends Inc.");
-MODULE_DESCRIPTION ("AMI MegaRAID driver");
-MODULE_LICENSE("GPL");
-
+MODULE_AUTHOR ("LSI Logic Corporation");
+MODULE_DESCRIPTION ("LSI Logic MegaRAID driver");
+MODULE_LICENSE ("GPL");
X
X #define DRIVER_LOCK_T
X #define DRIVER_LOCK_INIT(p)
X #define DRIVER_LOCK(p)
X #define DRIVER_UNLOCK(p)
-#define IO_LOCK_T unsigned long io_flags = 0;
+#define IO_LOCK_T unsigned long io_flags = 0
X #define IO_LOCK spin_lock_irqsave(&io_request_lock,io_flags);
X #define IO_UNLOCK spin_unlock_irqrestore(&io_request_lock,io_flags);
X
@@ -578,14 +604,14 @@
X */
X
X static char kernel_version[] = UTS_RELEASE;
-MODULE_AUTHOR ("American Megatrends Inc.");
-MODULE_DESCRIPTION ("AMI MegaRAID driver");
+MODULE_AUTHOR ("LSI Logic Corporation");
+MODULE_DESCRIPTION ("LSI Logic MegaRAID driver");
X
X #define DRIVER_LOCK_T
X #define DRIVER_LOCK_INIT(p)
X #define DRIVER_LOCK(p)
X #define DRIVER_UNLOCK(p)
-#define IO_LOCK_T unsigned long io_flags = 0;
+#define IO_LOCK_T unsigned long io_flags = 0
X #define IO_LOCK spin_lock_irqsave(&io_request_lock,io_flags);
X #define IO_UNLOCK spin_unlock_irqrestore(&io_request_lock,io_flags);
X
@@ -746,7 +772,7 @@
X static struct mcontroller mcontroller[MAX_CONTROLLERS];
X
X /* The current driver version */
-static u32 driver_ver = 117;
+static u32 driver_ver = 114;
X
X /* major number used by the device for character interface */
X static int major;
@@ -1050,7 +1076,11 @@
X panic(KERN_ERR "megaraid:Problem...!\n");
X }
X
+ islogical = ( (SCpnt->channel >= megaCfg->productInfo.SCSIChanPresent) &&
+ (SCpnt->channel <= megaCfg->host->max_channel) );
+#if 0
X islogical = (SCpnt->channel == megaCfg->host->max_channel);
+#endif
X
X #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X /* Special Case to handle PassThrough->XferAddrress > 4GB */
@@ -1174,7 +1204,8 @@
X mega_ext_passthru *epthru;
X long seg;
X char islogical;
- char lun = SCpnt->lun;
+ int lun = SCpnt->lun;
+ int max_lun;
X
X if ((SCpnt->cmnd[0] == MEGADEVIOC))
X return megadev_doioctl (megaCfg, SCpnt);
@@ -1191,8 +1222,12 @@
X }
X #endif
X
+ islogical = ( (SCpnt->channel >= megaCfg->productInfo.SCSIChanPresent) &&
+ (SCpnt->channel <= megaCfg->host->max_channel) );
+#if 0
X islogical = (IS_RAID_CH(SCpnt->channel) && /* virtual ch is raid - AM */
X (SCpnt->channel == megaCfg->host->max_channel));
+#endif
X
X if ( ! megaCfg->support_ext_cdb ) {
X if (!islogical && lun != 0) {
@@ -1208,21 +1243,28 @@
X return NULL;
X }
X
- /*
- * Return error for LUN > 7. The way we calculate logical drive number
- * requires it to be so.
- */
- if( lun > 7 ) {
- SCpnt->result = (DID_BAD_TARGET << 16);
- callDone (SCpnt);
- return NULL;
- }
-
X if (islogical) {
X
- lun = (SCpnt->target * 8) + lun;
+ /* have just LUN 0 for each target on virtual channels */
+ if( SCpnt->lun != 0 ) {
+ SCpnt->result = (DID_BAD_TARGET << 16);
+ callDone (SCpnt);
+ return NULL;
+ }
+
+ lun = mega_get_lun(megaCfg, SCpnt);
X
- if(lun >= megaCfg->numldrv ) {
+ max_lun = (megaCfg->flag & BOARD_40LD) ?
+ FC_MAX_LOGICAL_DRIVES : MAX_LOGICAL_DRIVES;
+
+ /*
+ * max_lun increases by 0x80 if some logical drive was deleted.
+ */
+ if(megaCfg->read_ldidmap) {
+ max_lun += 0x80;
+ }
+
+ if( lun > max_lun ) {
X SCpnt->result = (DID_BAD_TARGET << 16);
X callDone (SCpnt);
X return NULL;
@@ -1241,6 +1283,13 @@
X }
X }
X }
+ } else {
+ if ( lun > 7) {
+ /* Do not support lun >7 for physically accessed devices */
+ SCpnt->result = (DID_BAD_TARGET << 16);
+ callDone (SCpnt);
+ return NULL;
+ }
X }
X /*-----------------------------------------------------
X *
@@ -1503,6 +1552,44 @@
X return NULL;
X }
X
+static int
+mega_get_lun(mega_host_config *this_hba, Scsi_Cmnd *sc)
+{
+ int tgt;
+ int lun;
+ int virt_chan;
+
+ tgt = sc->target;
+
+ if ( tgt > 7 ) tgt--; /* we do not get inquires for tgt 7 */
+
+ virt_chan = sc->channel - this_hba->productInfo.SCSIChanPresent;
+ lun = (virt_chan * 15) + tgt;
+
+ /*
+ * 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( this_hba->support_random_del && this_hba->read_ldidmap ) {
+ switch(sc->cmnd[0]) {
+ case READ_6: /* fall through */
+ case WRITE_6: /* fall through */
+ case READ_10: /* fall through */
+ case WRITE_10:
+ lun += 0x80;
+ }
+ }
+
+ return lun;
+}
+
+
X static mega_passthru *
X mega_prepare_passthru(mega_host_config *megacfg, mega_scb *scb, Scsi_Cmnd *sc)
X {
@@ -1969,7 +2056,7 @@
X *--------------------------------------------------------------------*/
X static void megaraid_isr (int irq, void *devp, struct pt_regs *regs)
X {
- IO_LOCK_T
+ IO_LOCK_T;
X mega_host_config * megaCfg;
X u_char byte, idx, sIdx, tmpBox[MAILBOX_SIZE];
X u32 dword = 0;


@@ -2367,7 +2454,7 @@
X }

X
X sgList = (struct scatterlist *) scb->SCpnt->request_buffer;
-
+#if 0
X if (scb->SCpnt->use_sg == 1) {
X
X #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
@@ -2395,7 +2482,7 @@
X

X return 0;
X }
-

+#endif
X /* Copy Scatter-Gather list info into controller structure */
X #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X sgcnt = pci_map_sg (megaCfg->dev,
@@ -2640,7 +2727,7 @@
X mboxData[2] = NC_SUBOP_PRODUCT_INFO; /* i.e. 0x0E */
X
X if ((retval = megaIssueCmd (megaCfg, mboxData, NULL, 0)) != 0)
- printk ("ami:Product_info cmd failed with error: %d\n",
+ printk ("megaraid: Product_info cmd failed with error: %d\n",
X retval);
X
X pci_unmap_single (megaCfg->dev,
@@ -2649,12 +2736,21 @@
X PCI_DMA_FROMDEVICE);
X }
X
- megaCfg->host->max_channel = megaCfg->productInfo.SCSIChanPresent;
+ /*
+ * kernel scans the channels from 0 to <= max_channel
+ */
+ megaCfg->host->max_channel =
+ megaCfg->productInfo.SCSIChanPresent + NVIRT_CHAN -1;
+
X megaCfg->host->max_id = 16; /* max targets per channel */
X /*(megaCfg->flag & BOARD_40LD)?FC_MAX_TARGETS_PER_CHANNEL:MAX_TARGET+1; */
+#if 0
X megaCfg->host->max_lun = /* max lun */
- (megaCfg->
- flag & BOARD_40LD) ? FC_MAX_LOGICAL_DRIVES : MAX_LOGICAL_DRIVES;
+ (megaCfg->flag & BOARD_40LD) ?
+ FC_MAX_LOGICAL_DRIVES : MAX_LOGICAL_DRIVES;
+#endif
+ megaCfg->host->max_lun = 7; /* Upto 7 luns for non disk devices */
+
X megaCfg->host->cmd_per_lun = MAX_CMD_PER_LUN;
X
X megaCfg->numldrv = enquiry3Pnt->numLDrv;
@@ -2670,27 +2766,27 @@
X }
X #endif
X
- /* use HP firmware and bios version encoding */
-if (megaCfg->productInfo.subSystemVendorID == HP_SUBSYS_ID) {
- sprintf (megaCfg->fwVer, "%c%d%d.%d%d",
- megaCfg->productInfo.FwVer[2],
- megaCfg->productInfo.FwVer[1] >> 8,
- megaCfg->productInfo.FwVer[1] & 0x0f,
- megaCfg->productInfo.FwVer[2] >> 8,
- megaCfg->productInfo.FwVer[2] & 0x0f);
- sprintf (megaCfg->biosVer, "%c%d%d.%d%d",
- megaCfg->productInfo.BiosVer[2],
- megaCfg->productInfo.BiosVer[1] >> 8,
- megaCfg->productInfo.BiosVer[1] & 0x0f,
- megaCfg->productInfo.BiosVer[2] >> 8,
- megaCfg->productInfo.BiosVer[2] & 0x0f);
-} else {
- memcpy (megaCfg->fwVer, (char *) megaCfg->productInfo.FwVer, 4);
- megaCfg->fwVer[4] = 0;
+ /* use HP firmware and bios version encoding */
+ if (megaCfg->productInfo.subSystemVendorID == HP_SUBSYS_ID) {
+ sprintf (megaCfg->fwVer, "%c%d%d.%d%d",
+ megaCfg->productInfo.FwVer[2],
+ megaCfg->productInfo.FwVer[1] >> 8,
+ megaCfg->productInfo.FwVer[1] & 0x0f,
+ megaCfg->productInfo.FwVer[0] >> 8,
+ megaCfg->productInfo.FwVer[0] & 0x0f);
+ sprintf (megaCfg->biosVer, "%c%d%d.%d%d",
+ megaCfg->productInfo.BiosVer[2],
+ megaCfg->productInfo.BiosVer[1] >> 8,
+ megaCfg->productInfo.BiosVer[1] & 0x0f,
+ megaCfg->productInfo.BiosVer[0] >> 8,
+ megaCfg->productInfo.BiosVer[0] & 0x0f);
+ } else {
+ memcpy (megaCfg->fwVer, (char *) megaCfg->productInfo.FwVer, 4);
+ megaCfg->fwVer[4] = 0;
X
- memcpy (megaCfg->biosVer, (char *) megaCfg->productInfo.BiosVer, 4);
- megaCfg->biosVer[4] = 0;
-}
+ memcpy (megaCfg->biosVer, (char *) megaCfg->productInfo.BiosVer, 4);
+ megaCfg->biosVer[4] = 0;
+ }
X megaCfg->support_ext_cdb = mega_support_ext_cdb(megaCfg);
X
X printk (KERN_NOTICE "megaraid: [%s:%s] detected %d logical drives" M_RD_CRLFSTR,
@@ -2737,7 +2833,7 @@
X u32 magic64;
X #endif
X
- int i;
+ int i;
X
X #ifdef __LP64__
X u64 megaBase;
@@ -2859,7 +2955,6 @@
X if (!host)
X goto err_unmap;
X
-#if 0
X /*
X * Comment the following initialization if you know 'max_sectors' is
X * not defined for this kernel.
@@ -2867,7 +2962,6 @@
X * greatly increases the IO performance - AM
X */
X host->max_sectors = 1024;
-#endif
X
X scsi_set_pci_device(host, pdev);
X megaCfg = (mega_host_config *) host->hostdata;
@@ -2894,6 +2988,9 @@
X megaCfg->lock_pend = SPIN_LOCK_UNLOCKED;
X megaCfg->lock_scsicmd = SPIN_LOCK_UNLOCKED;
X megaCfg->flag = flag;
+ megaCfg->int_qh = NULL;
+ megaCfg->int_qt = NULL;
+ megaCfg->int_qlen = 0;
X
X #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X megaCfg->dev = pdev;
@@ -2999,7 +3096,7 @@
X * Find out which channel is raid and which is scsi
X */
X mega_enum_raid_scsi(megaCfg);
- for( i = 0; i < megaCfg->host->max_channel; i++ ) {
+ for( i = 0; i < megaCfg->productInfo.SCSIChanPresent; i++ ) {
X if(IS_RAID_CH(i))
X printk(KERN_NOTICE"megaraid: channel[%d] is raid.\n", i+1);
X else
@@ -3014,6 +3111,12 @@
X
X mega_hbas[numCtlrs].hostdata_addr = megaCfg;
X
+ /*
+ * Do we support random deletion and addition of logical drives
+ */
+ megaCfg->read_ldidmap = 0; /* set it after first logdrv delete cmd */
+ megaCfg->support_random_del = mega_support_random_del(megaCfg);
+
X /* Initialize SCBs */
X if (mega_init_scb (megaCfg)) {
X pci_free_consistent (megaCfg->dev,
@@ -3100,7 +3203,7 @@
X skip_id = (skip_id > 15) ? -1 : skip_id;
X }
X
- printk (KERN_NOTICE "megaraid: " MEGARAID_VERSION M_RD_CRLFSTR);
+ printk (KERN_NOTICE "megaraid: " MEGARAID_VERSION);
X
X memset (mega_hbas, 0, sizeof (mega_hbas));
X
@@ -3267,6 +3370,7 @@
X {
X mega_mailbox *mboxp;
X unsigned char mbox[16];
+ int i;
X
X #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X dma_addr_t dma_handle;
@@ -3299,8 +3403,10 @@
X if( megaIssueCmd(megacfg, mbox, NULL, 0) == 0 ) {
X mega_ch_class = *((char *)megacfg->mega_buffer);
X
- /* logical drives channel is RAID */
- mega_ch_class |= (0x01 << megacfg->host->max_channel);
+ for( i = 0; i < NVIRT_CHAN; i++ ) {
+ /* logical drives channel is RAID */
+ mega_ch_class |= (0x01 << (megacfg->productInfo.SCSIChanPresent+i));
+ }
X }
X else {
X mega_ch_class = 0xFF;
@@ -3572,7 +3678,7 @@
X megaCfg = (mega_host_config *) pSHost->hostdata;
X
X sprintf (buffer,
- "AMI MegaRAID %s %d commands %d targs %d chans %d luns",
+ "LSI Logic MegaRAID %s %d commands %d targs %d chans %d luns",
X megaCfg->fwVer, megaCfg->productInfo.MaxConcCmds,
X megaCfg->host->max_id, megaCfg->host->max_channel,
X megaCfg->host->max_lun);
@@ -3604,14 +3710,15 @@
X DRIVER_LOCK (megaCfg);
X
X if (!(megaCfg->flag & (1L << SCpnt->channel))) {
- if (SCpnt->channel < SCpnt->host->max_channel)
+ if (SCpnt->channel < megaCfg->productInfo.SCSIChanPresent)
X printk ( KERN_NOTICE
- "scsi%d: scanning channel %c for devices.\n",
- megaCfg->host->host_no, SCpnt->channel + '1');
+ "scsi%d: scanning channel %d for devices.\n",
+ megaCfg->host->host_no, SCpnt->channel);
X else
X printk ( KERN_NOTICE
- "scsi%d: scanning virtual channel for logical drives.\n",
- megaCfg->host->host_no);
+ "scsi%d: scanning virtual channel %d for logical drives.\n",
+ megaCfg->host->host_no,
+ SCpnt->channel-megaCfg->productInfo.SCSIChanPresent+1);
X
X megaCfg->flag |= (1L << SCpnt->channel);
X }
@@ -3657,21 +3764,38 @@
X megaCfg->flag |= IN_QUEUE;
X /* Allocate and build a SCB request */
X if ((pScb = mega_build_cmd (megaCfg, SCpnt)) != NULL) {
- /*build SCpnt for M_RD_IOCTL_CMD_NEW cmd in mega_ioctl() */
- /* Add SCB to the head of the pending queue */
- /* Add SCB to the head of the pending queue */
- if (megaCfg->qPendingH == NULL) {
- megaCfg->qPendingH = megaCfg->qPendingT = pScb;
- } else {
- megaCfg->qPendingT->next = pScb;
- megaCfg->qPendingT = pScb;
- }
- megaCfg->qPendingT->next = NULL;
- megaCfg->qPcnt++;
X
- if (mega_runpendq (megaCfg) == -1) {
- DRIVER_UNLOCK (megaCfg);
- return 0;
+ /*
+ * Check if the HBA is in quiescent state, e.g., during a delete
+ * logical drive opertion. If it is, queue the commands in the
+ * internal queue until the delete operation is complete.
+ */
+ if( ! megaCfg->quiescent ) {
+ /* Add SCB to the head of the pending queue */
+ if (megaCfg->qPendingH == NULL) {
+ megaCfg->qPendingH = megaCfg->qPendingT = pScb;
+ } else {
+ megaCfg->qPendingT->next = pScb;
+ megaCfg->qPendingT = pScb;
+ }
+ megaCfg->qPendingT->next = NULL;
+ megaCfg->qPcnt++;
+
+ if (mega_runpendq (megaCfg) == -1) {
+ DRIVER_UNLOCK (megaCfg);


+ return 0;
+ }
+ }

+ else {
+ /* Add SCB to the internal queue */
+ if (megaCfg->int_qh == NULL) {
+ megaCfg->int_qh = megaCfg->int_qt = pScb;
+ } else {
+ megaCfg->int_qt->next = pScb;
+ megaCfg->int_qt = pScb;
+ }
+ megaCfg->int_qt->next = NULL;
+ megaCfg->int_qlen++;
X }
X
X if (pScb->SCpnt->cmnd[0] == M_RD_IOCTL_CMD_NEW) {
@@ -4184,6 +4308,7 @@
X return -1;
X
X if( *(unsigned short *)(bh->b_data + 510) == 0xAA55 ) {
+
X for( largest_cyl = -1, p = (struct partition *)(0x1BE + bh->b_data),
X i = 0; i < 4; ++i, ++p) {
X
@@ -4197,6 +4322,7 @@
X }
X }
X }
+
X if (largest) {
X heads = largest->end_head + 1;
X sectors = largest->end_sector & 0x3f;
@@ -4519,6 +4645,14 @@
X break;
X
X case M_RD_IOCTL_CMD_NEW:
+
+ /*
+ * Deletion of logical drives is only handled in 0x80 commands
+ */
+ if( ioc.mbox[0] == FC_DEL_LOGDRV && ioc.mbox[2] == OP_DEL_LOGDRV ) {


+ return -EINVAL;
+ }
+

X /* which adapter? */
X adapno = ioc.ui.fcs.adapno;
X
@@ -4686,6 +4820,28 @@
X }
X if(shpnt == NULL) return -ENODEV;
X
+ /*
+ * ioctls for deleting logical drives is a special case, so check
+ * for it first
+ */
+ if( ioc.mbox[0] == FC_DEL_LOGDRV && ioc.mbox[2] == OP_DEL_LOGDRV ) {
+
+ if( !megacfg->support_random_del ) {
+ printk("megaraid: logdrv delete on non supporting f/w.\n");


+ return -EINVAL;
+ }
+

+ uioc = (struct uioctl_t *)arg;
+
+ ret = mega_del_logdrv(megacfg, ioc.mbox[3]);
+
+ put_user(1, &uioc->mbox[16]); /* numstatus */
+ put_user(ret, &uioc->mbox[17]); /* status */
+
+ /* if deletion failed, let the user know by failing ioctl */


+ return ret;
+ }
+

X #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X scsicmd = (Scsi_Cmnd *)kmalloc(sizeof(Scsi_Cmnd), GFP_KERNEL|GFP_DMA);
X #else
@@ -4760,8 +4916,7 @@
X put_user (scsicmd->result, &uioc->pthru.scsistatus);
X } else {
X put_user (1, &uioc->mbox[16]); /* numstatus */
- /* status */
- put_user (scsicmd->result, &uioc->mbox[17]);
+ put_user (scsicmd->result, &uioc->mbox[17]); /* status */
X }
X
X if (kvaddr) {
@@ -4918,6 +5073,139 @@
X return !ret;
X }
X
+
+/*
+ * Find out if this controller supports random deletion and addition of
+ * logical drives
+ */
+static int
+mega_support_random_del(mega_host_config *this_hba)
+{
+ mega_mailbox *mboxpnt;
+ unsigned char mbox[16];
+ int ret;
+
+ mboxpnt = (mega_mailbox *)mbox;
+
+ memset(mbox, 0, sizeof(mbox));
+
+ /*
+ * issue command
+ */
+ mbox[0] = FC_DEL_LOGDRV;
+ mbox[2] = OP_SUP_DEL_LOGDRV;
+
+ ret = megaIssueCmd(this_hba, mbox, NULL, 0);
+
+ return !ret;
+}
+
+static int
+mega_del_logdrv(mega_host_config *this_hba, int logdrv)
+{
+ int rval;
+ IO_LOCK_T;
+ DECLARE_WAIT_QUEUE_HEAD(wq);
+ mega_scb *scbp;
+
+ /*
+ * Stop sending commands to the controller, queue them internally.
+ * When deletion is complete, ISR will flush the queue.
+ */
+ IO_LOCK;
+ this_hba->quiescent = 1;
+ IO_UNLOCK;
+
+ while( this_hba->qPcnt ) {
+ sleep_on_timeout( &wq, 1*HZ ); /* sleep for 1s */
+ }
+ rval = mega_do_del_logdrv(this_hba, logdrv);
+
+ IO_LOCK;
+ /*
+ * Attach the internal queue to the pending queue
+ */
+ if( this_hba->qPendingH == NULL ) {
+ /*
+ * If pending queue head is null, make internal queue as
+ * pending queue
+ */
+ this_hba->qPendingH = this_hba->int_qh;
+ this_hba->qPendingT = this_hba->int_qt;
+ this_hba->qPcnt = this_hba->int_qlen;


+ }
+ else {
+ /*

+ * Append pending queue to internal queue
+ */
+ if( this_hba->int_qt ) {
+ this_hba->int_qt->next = this_hba->qPendingH;
+
+ this_hba->qPendingH = this_hba->int_qh;
+ this_hba->qPcnt += this_hba->int_qlen;
+ }
+ }
+
+ this_hba->int_qh = this_hba->int_qt = NULL;
+ this_hba->int_qlen = 0;
+
+ /*
+ * If delete operation was successful, add 0x80 to the logical drive
+ * ids for commands in the pending queue.
+ */
+ if( this_hba->read_ldidmap) {
+ for( scbp = this_hba->qPendingH; scbp; scbp = scbp->next ) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ if( scbp->pthru->logdrv < 0x80 )
+ scbp->pthru->logdrv += 0x80;
+#else
+ if( scbp->pthru.logdrv < 0x80 )
+ scbp->pthru.logdrv += 0x80;
+#endif
+ }
+ }
+ this_hba->quiescent = 0;
+
+ IO_UNLOCK;
+
+ return rval;


+}
+
+
+static int

+mega_do_del_logdrv(mega_host_config *this_hba, int logdrv)
+{
+ mega_mailbox *mboxpnt;
+ unsigned char mbox[16];
+ int rval;
+
+ mboxpnt = (mega_mailbox *)mbox;
+
+ memset(mbox, 0, sizeof(mbox));
+
+ mbox[0] = FC_DEL_LOGDRV;
+ mbox[2] = OP_DEL_LOGDRV;
+ mbox[3] = logdrv;
+
+ rval = megaIssueCmd(this_hba, mbox, NULL, 0);
+
+ /* log this event */
+ if( rval != 0 ) {
+ printk("megaraid: Attempt to delete logical drive %d failed.",
+ logdrv);
+ return rval;
+ }
+
+ printk("megaraid: logical drive %d deleted.\n", logdrv);
+
+ /*
+ * After deleting first logical drive, the logical drives must be
+ * addressed by adding 0x80 to the logical drive id.
+ */
+ this_hba->read_ldidmap = 1;
+
+ return rval;
+}
X
X #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
X void *
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/megaraid.h linux/drivers/scsi/megaraid.h
--- v2.4.13/linux/drivers/scsi/megaraid.h Sun Aug 12 13:28:00 2001
+++ linux/drivers/scsi/megaraid.h Thu Oct 25 13:53:51 2001
@@ -5,11 +5,14 @@
X #include <linux/version.h>
X #endif
X
+/*
+ * For state flag. Do not use LSB(8 bits) which are
+ * reserved for storing info about channels.
+ */
X #define IN_ISR 0x80000000L
X #define IN_ABORT 0x40000000L
X #define IN_RESET 0x20000000L
X #define IN_QUEUE 0x10000000L
-
X #define BOARD_QUARTZ 0x08000000L
X #define BOARD_40LD 0x04000000L
X #define BOARD_64BIT 0x02000000L
@@ -27,7 +30,7 @@
X #define M_RD_IOCTL_CMD_NEW 0x81
X #define M_RD_DRIVER_IOCTL_INTERFACE 0x82
X
-#define MEGARAID_VERSION "v1.17a (Release Date: Fri Jul 13 18:44:01 EDT 2001)"
+#define MEGARAID_VERSION "v1.18 (Release Date: Thu Oct 11 15:02:53 EDT 2001\n)"
X
X #define MEGARAID_IOCTL_VERSION 114
X
@@ -767,6 +770,17 @@
X int support_ext_cdb;
X int boot_ldrv_enabled;
X int boot_ldrv;
+
+ int support_random_del; /* Do we support random deletion of logdrvs */
+ int read_ldidmap; /* set after logical drive deltion. The logical
+ drive number must be read from the map */
+ int quiescent; /* a stage reached when delete logical drive needs to
+ be done. Stop sending requests to the hba till
+ delete operation is completed */
+
+ mega_scb *int_qh; /* commands are queued in the internal queue */
+ mega_scb *int_qt; /* while the hba is quiescent */
+ int int_qlen;
X } mega_host_config;
X
X typedef struct _driver_info {
@@ -911,6 +925,16 @@
X };
X #pragma pack()
X
+#define NVIRT_CHAN 4 /* # of virtual channels to represent 60 logical
+ drives */
+
+/*
+ * Command for random deletion of logical drives
+ */
+#define FC_DEL_LOGDRV 0xA4 /* f/w command */
+#define OP_SUP_DEL_LOGDRV 0x2A /* is feature supported */
+#define OP_GET_LDID_MAP 0x18 /* get logdrv id and logdrv number map */
+#define OP_DEL_LOGDRV 0x1C /* delete logical drive */
X
X /*================================================================
X *
@@ -975,6 +999,10 @@
X static void mega_enum_raid_scsi(mega_host_config *);
X static int mega_partsize(Disk *, kdev_t, int *);
X static void mega_get_boot_ldrv(mega_host_config *);
+static int mega_get_lun(mega_host_config *, Scsi_Cmnd *);
+static int mega_support_random_del(mega_host_config *);
+static int mega_del_logdrv(mega_host_config *, int);
+static int mega_do_del_logdrv(mega_host_config *, int);
X
X #endif
X
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/mvme147.c linux/drivers/scsi/mvme147.c
--- v2.4.13/linux/drivers/scsi/mvme147.c Mon Nov 27 17:57:34 2000
+++ linux/drivers/scsi/mvme147.c Thu Oct 25 13:53:51 2001
@@ -65,6 +65,7 @@
X int mvme147_detect(Scsi_Host_Template *tpnt)
X {
X static unsigned char called = 0;
+ wd33c93_regs regs;
X
X if (!MACH_IS_MVME147 || called)
X return 0;
@@ -74,13 +75,19 @@


X tpnt->proc_info = &wd33c93_proc_info;
X

X mvme147_host = scsi_register (tpnt, sizeof(struct WD33C93_hostdata));
+ if (!mvme147_host)
+ goto err_out;
+
X mvme147_host->base = 0xfffe4000;
X mvme147_host->irq = MVME147_IRQ_SCSI_PORT;
- wd33c93_init(mvme147_host, (wd33c93_regs *)0xfffe4000,
- dma_setup, dma_stop, WD33C93_FS_8_10);
-
- request_irq(MVME147_IRQ_SCSI_PORT, mvme147_intr, 0, "MVME147 SCSI PORT", mvme147_intr);
- request_irq(MVME147_IRQ_SCSI_DMA, mvme147_intr, 0, "MVME147 SCSI DMA", mvme147_intr);
+ regs.SASR = (volatile unsigned char *)0xfffe4000;
+ regs.SCMD = (volatile unsigned char *)0xfffe4001;
+ wd33c93_init(mvme147_host, regs, dma_setup, dma_stop, WD33C93_FS_8_10);
+
+ if (request_irq(MVME147_IRQ_SCSI_PORT, mvme147_intr, 0, "MVME147 SCSI PORT", mvme147_intr))
+ goto err_unregister;
+ if (request_irq(MVME147_IRQ_SCSI_DMA, mvme147_intr, 0, "MVME147 SCSI DMA", mvme147_intr))
+ goto err_free_irq;
X #if 0 /* Disabled; causes problems booting */
X m147_pcc->scsi_interrupt = 0x10; /* Assert SCSI bus reset */
X udelay(100);
@@ -94,6 +101,14 @@
X m147_pcc->dma_intr = 0x89; /* Ack and enable ints */


X
X return 1;
+

+ err_free_irq:
+ free_irq(MVME147_IRQ_SCSI_PORT, mvme147_intr);
+ err_unregister:
+ wd33c93_release();
+ scsi_unregister(mvme147_host);
+ err_out:


+ return 0;
X }
X
X #define HOSTS_C

diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/mvme16x.c linux/drivers/scsi/mvme16x.c
--- v2.4.13/linux/drivers/scsi/mvme16x.c Sun Feb 13 11:21:42 2000
+++ linux/drivers/scsi/mvme16x.c Thu Oct 25 13:53:51 2001
@@ -52,3 +52,6 @@
X called = 1;
X return 1;
X }
+
+static Scsi_Host_Template driver_template = MVME16x_SCSI;
+#include "scsi_module.c"
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/oktagon_esp.c linux/drivers/scsi/oktagon_esp.c
--- v2.4.13/linux/drivers/scsi/oktagon_esp.c Fri Feb 9 11:30:23 2001
+++ linux/drivers/scsi/oktagon_esp.c Thu Oct 25 13:53:51 2001
@@ -27,7 +27,7 @@
X #include <asm/system.h>
X #include <asm/ptrace.h>
X #include <asm/pgtable.h>
-#include <asm/io.h>
+
X
X #include "scsi.h"
X #include "hosts.h"
@@ -106,7 +106,7 @@
X static struct NCR_ESP *current_esp;
X

X
-volatile unsigned char cmd_buffer[16];
+static volatile unsigned char cmd_buffer[16];
X /* This is where all commands are put

X * before they are trasfered to the ESP chip
X * via PIO.
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/osst.c linux/drivers/scsi/osst.c
--- v2.4.13/linux/drivers/scsi/osst.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/scsi/osst.c Sun Nov 4 09:31:57 2001
@@ -4935,6 +4935,7 @@
X tb->sg[0].address =
X (unsigned char *)__get_free_pages(priority, order);
X if (tb->sg[0].address != NULL) {
+ tb->sg[0].page = NULL;
X tb->sg[0].length = b_size;
X break;
X }
@@ -4970,6 +4971,7 @@
X tb = NULL;
X break;
X }
+ tb->sg[segs].page = NULL;
X tb->sg[segs].length = b_size;
X got += b_size;
X segs++;
@@ -5043,6 +5045,7 @@
X normalize_buffer(STbuffer);
X return FALSE;
X }
+ STbuffer->sg[segs].page = NULL;
X STbuffer->sg[segs].length = b_size;
X STbuffer->sg_segs += 1;
X got += b_size;
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/qlogicfas.c linux/drivers/scsi/qlogicfas.c
--- v2.4.13/linux/drivers/scsi/qlogicfas.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/scsi/qlogicfas.c Thu Oct 25 13:53:51 2001
@@ -271,8 +271,10 @@
X int i,k;
X k = 0;
X i = jiffies + WATCHDOG;
- while ( i > jiffies && !qabort && !((k = inb(qbase + 4)) & 0xe0))
+ while ( i > jiffies && !qabort && !((k = inb(qbase + 4)) & 0xe0)) {


X barrier();
+ cpu_relax();
+ }

X if (i <= jiffies)
X return (DID_TIME_OUT);
X if (qabort)
@@ -431,6 +433,7 @@
X i = inb(qbase + 5); /* should be bus service */
X while (!qabort && ((i & 0x20) != 0x20)) {
X barrier();
+ cpu_relax();
X i |= inb(qbase + 5);
X }
X rtrc(0)
@@ -513,8 +516,10 @@
X
X cmd->scsi_done = done;
X /* wait for the last command's interrupt to finish */
- while (qlcmd != NULL)
+ while (qlcmd != NULL) {


X barrier();
+ cpu_relax();
+ }

X ql_icmd(cmd);
X return 0;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/qlogicfc.c linux/drivers/scsi/qlogicfc.c
--- v2.4.13/linux/drivers/scsi/qlogicfc.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/scsi/qlogicfc.c Thu Oct 25 13:53:51 2001
@@ -803,9 +803,10 @@
X outw(HCCR_CLEAR_RISC_INTR, host->io_port + HOST_HCCR);
X isp2x00_enable_irqs(host);
X /* wait for the loop to come up */
- for (wait_time = jiffies + 10 * HZ; wait_time > jiffies && hostdata->adapter_state == AS_LOOP_DOWN;)
+ for (wait_time = jiffies + 10 * HZ; wait_time > jiffies && hostdata->adapter_state == AS_LOOP_DOWN;) {
X barrier();
-
+ cpu_relax();
+ }
X if (hostdata->adapter_state == AS_LOOP_DOWN) {
X printk("qlogicfc%d : link is not up\n", hostdata->host_id);
X }
@@ -819,8 +820,10 @@
X some time before recognizing it is attached to a fabric */
X
X #if ISP2x00_FABRIC
- for (wait_time = jiffies + 5 * HZ; wait_time > jiffies;)
+ for (wait_time = jiffies + 5 * HZ; wait_time > jiffies;) {


X barrier();
+ cpu_relax();
+ }

X #endif
X
X LEAVE("isp2x00_detect");
@@ -1840,8 +1843,10 @@
X outw(HCCR_BIOS_DISABLE, host->io_port + HOST_HCCR);
X
X loop_count = DEFAULT_LOOP_COUNT;
- while (--loop_count && inw(host->io_port + HOST_HCCR) == RISC_BUSY)
+ while (--loop_count && inw(host->io_port + HOST_HCCR) == RISC_BUSY) {


X barrier();
+ cpu_relax();
+ }

X if (!loop_count)
X printk("qlogicfc%d : reset_hardware loop timeout\n", hostdata->host_id);
X
@@ -2118,8 +2123,10 @@
X return 1;
X
X loop_count = DEFAULT_LOOP_COUNT;
- while (--loop_count && inw(host->io_port + HOST_HCCR) & 0x0080)
+ while (--loop_count && inw(host->io_port + HOST_HCCR) & 0x0080) {


X barrier();
+ cpu_relax();
+ }

X if (!loop_count) {
X printk("qlogicfc%d : mbox_command loop timeout #1\n", hostdata->host_id);
X param[0] = 0x4006;
@@ -2153,8 +2160,9 @@
X
X while (1) {
X loop_count = DEFAULT_LOOP_COUNT;
- while (--loop_count && !(inw(host->io_port + PCI_INTER_STS) & 0x08)) {
+ while (--loop_count && !(inw(host->io_port + PCI_INTER_STS) & 0x08)) {

X barrier();
+ cpu_relax();
X }

X
X if (!loop_count) {
@@ -2172,6 +2180,7 @@
X loop_count = DEFAULT_LOOP_COUNT;
X while (--loop_count && inw(host->io_port + MBOX0) == 0x04) {


X barrier();
+ cpu_relax();
X }

X if (!loop_count)
X printk("qlogicfc%d : mbox_command loop timeout #3\n", hostdata->host_id);
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/qlogicisp.c linux/drivers/scsi/qlogicisp.c
--- v2.4.13/linux/drivers/scsi/qlogicisp.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/scsi/qlogicisp.c Thu Oct 25 13:53:51 2001
@@ -1279,8 +1279,10 @@
X isp_outw(HCCR_BIOS_DISABLE, host, HOST_HCCR);
X
X loop_count = DEFAULT_LOOP_COUNT;
- while (--loop_count && isp_inw(host, HOST_HCCR) == RISC_BUSY)
+ while (--loop_count && isp_inw(host, HOST_HCCR) == RISC_BUSY) {


X barrier();
+ cpu_relax();
+ }

X if (!loop_count)
X printk("qlogicisp: reset_hardware loop timeout\n");
X
@@ -1904,8 +1906,10 @@
X return 1;
X
X loop_count = DEFAULT_LOOP_COUNT;
- while (--loop_count && isp_inw(host, HOST_HCCR) & 0x0080)
+ while (--loop_count && isp_inw(host, HOST_HCCR) & 0x0080) {


X barrier();
+ cpu_relax();
+ }

X if (!loop_count)
X printk("qlogicisp: mbox_command loop timeout #1\n");
X
@@ -1925,14 +1929,18 @@
X isp_outw(HCCR_SET_HOST_INTR, host, HOST_HCCR);
X
X loop_count = DEFAULT_LOOP_COUNT;
- while (--loop_count && !(isp_inw(host, PCI_INTF_STS) & 0x04))
+ while (--loop_count && !(isp_inw(host, PCI_INTF_STS) & 0x04)) {


X barrier();
+ cpu_relax();
+ }

X if (!loop_count)
X printk("qlogicisp: mbox_command loop timeout #2\n");
X
X loop_count = DEFAULT_LOOP_COUNT;
- while (--loop_count && isp_inw(host, MBOX0) == 0x04)
+ while (--loop_count && isp_inw(host, MBOX0) == 0x04) {


X barrier();
+ cpu_relax();
+ }

X if (!loop_count)
X printk("qlogicisp: mbox_command loop timeout #3\n");
X
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/qlogicpti.c linux/drivers/scsi/qlogicpti.c
--- v2.4.13/linux/drivers/scsi/qlogicpti.c Wed Jul 25 17:10:23 2001
+++ linux/drivers/scsi/qlogicpti.c Tue Oct 30 15:08:11 2001
@@ -35,7 +35,6 @@
X #include <asm/ptrace.h>
X #include <asm/pgtable.h>
X #include <asm/oplib.h>
-#include <asm/vaddrs.h>


X #include <asm/io.h>
X #include <asm/irq.h>
X

@@ -184,8 +183,10 @@
X
X /* Wait for host IRQ bit to clear. */
X loop_count = DEFAULT_LOOP_COUNT;
- while (--loop_count && (sbus_readw(qpti->qregs + HCCTRL) & HCCTRL_HIRQ))
+ while (--loop_count && (sbus_readw(qpti->qregs + HCCTRL) & HCCTRL_HIRQ)) {


X barrier();
+ cpu_relax();
+ }

X if (!loop_count)
X printk(KERN_EMERG "qlogicpti: mbox_command loop timeout #1\n");
X
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/scsi_merge.c linux/drivers/scsi/scsi_merge.c
--- v2.4.13/linux/drivers/scsi/scsi_merge.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/scsi/scsi_merge.c Thu Oct 25 14:05:31 2001
@@ -943,6 +943,7 @@
X }
X count++;
X sgpnt[count - 1].address = bh->b_data;
+ sgpnt[count - 1].page = NULL;
X sgpnt[count - 1].length += bh->b_size;
X if (!dma_host) {
X SCpnt->request_bufflen += bh->b_size;
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/sd.c linux/drivers/scsi/sd.c
--- v2.4.13/linux/drivers/scsi/sd.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/scsi/sd.c Thu Oct 25 13:58:35 2001
@@ -555,6 +555,7 @@
X
X static struct block_device_operations sd_fops =
X {
+ owner: THIS_MODULE,
X open: sd_open,
X release: sd_release,
X ioctl: sd_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/sg.c linux/drivers/scsi/sg.c
--- v2.4.13/linux/drivers/scsi/sg.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/scsi/sg.c Sun Nov 4 09:31:57 2001
@@ -1544,6 +1544,7 @@
X num = (rem_sz > (PAGE_SIZE - offset)) ? (PAGE_SIZE - offset) :
X rem_sz;
X sclp->address = page_address(kp->maplist[k]) + offset;
+ sclp->page = NULL;
X sclp->length = num;
X mem_src_arr[k] = SG_USER_MEM;
X rem_sz -= num;
@@ -1630,6 +1631,7 @@
X break;
X }
X sclp->address = p;
+ sclp->page = NULL;
X sclp->length = ret_sz;
X mem_src_arr[k] = mem_src;
X
@@ -1787,6 +1789,7 @@
X k, sclp->address, sclp->length, mem_src));
X sg_free(sclp->address, sclp->length, mem_src);
X sclp->address = NULL;
+ sclp->page = NULL;
X sclp->length = 0;
X }
X sg_free(schp->buffer, schp->sglist_len, schp->buffer_mem_src);
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
--- v2.4.13/linux/drivers/scsi/sr.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/scsi/sr.c Thu Oct 25 13:58:35 2001
@@ -484,6 +484,15 @@


X return 1;
X }
X

+struct block_device_operations sr_bdops =


+{
+ owner: THIS_MODULE,
+ open: cdrom_open,
+ release: cdrom_release,
+ ioctl: cdrom_ioctl,
+ check_media_change: cdrom_media_changed,

+};
+
X static int sr_open(struct cdrom_device_info *cdi, int purpose)
X {
X check_disk_change(cdi->dev);
@@ -778,7 +787,7 @@
X return 0;
X
X if (!sr_registered) {
- if (devfs_register_blkdev(MAJOR_NR, "sr", &cdrom_fops)) {
+ if (devfs_register_blkdev(MAJOR_NR, "sr", &sr_bdops)) {
X printk("Unable to get major %d for SCSI-CD\n", MAJOR_NR);
X return 1;
X }
@@ -875,7 +884,7 @@
X devfs_register (scsi_CDs[i].device->de, "cd",
X DEVFS_FL_DEFAULT, MAJOR_NR, i,
X S_IFBLK | S_IRUGO | S_IWUGO,
- &cdrom_fops, NULL);
+ &sr_bdops, NULL);
X register_cdrom(&scsi_CDs[i].cdi);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/st.c linux/drivers/scsi/st.c
--- v2.4.13/linux/drivers/scsi/st.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/scsi/st.c Tue Oct 30 15:08:12 2001
@@ -3233,6 +3233,7 @@
X break;
X }
X }
+ tb->sg[0].page = NULL;
X if (tb->sg[segs].address == NULL) {
X kfree(tb);
X tb = NULL;
@@ -3264,6 +3265,7 @@
X tb = NULL;
X break;
X }
+ tb->sg[segs].page = NULL;
X tb->sg[segs].length = b_size;
X got += b_size;
X segs++;
@@ -3337,6 +3339,7 @@
X normalize_buffer(STbuffer);
X return FALSE;
X }
+ STbuffer->sg[segs].page = NULL;
X STbuffer->sg[segs].length = b_size;
X STbuffer->sg_segs += 1;
X got += b_size;
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/sun3_NCR5380.c linux/drivers/scsi/sun3_NCR5380.c
--- v2.4.13/linux/drivers/scsi/sun3_NCR5380.c Fri Dec 29 14:07:22 2000
+++ linux/drivers/scsi/sun3_NCR5380.c Thu Oct 25 13:53:51 2001
@@ -647,10 +647,10 @@
X
X static volatile int main_running = 0;
X static struct tq_struct NCR5380_tqueue = {
- NULL, /* next */
- 0, /* sync */
- (void (*)(void*))NCR5380_main, /* routine, must have (void *) arg... */
- NULL /* data */
+// NULL, /* next */
+ sync: 0, /* sync */
+ routine: (void (*)(void*))NCR5380_main, /* routine, must have (void *) arg... */
+ data: NULL /* data */
X };
X
X static __inline__ void queue_main(void)
@@ -1217,7 +1217,7 @@
X HOSTNO, NCR5380_read(BUS_AND_STATUS_REG),
X NCR5380_read(STATUS_REG));
X
- if((sun3scsi_dma_finish())) {
+ if((sun3scsi_dma_finish(hostdata->connected->request.cmd))) {
X printk("scsi%d: overrun in UDC counter -- not prepared to deal with this!\n", HOSTNO);
X printk("please e-mail sa...@oh.verio.com with a description of how this\n");
X printk("error was produced.\n");
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/sun3_scsi.c linux/drivers/scsi/sun3_scsi.c
--- v2.4.13/linux/drivers/scsi/sun3_scsi.c Fri Mar 2 18:38:39 2001
+++ linux/drivers/scsi/sun3_scsi.c Thu Oct 25 13:53:51 2001
@@ -68,6 +68,9 @@
X
X #include <asm/sun3ints.h>
X #include <asm/dvma.h>
+#include <asm/idprom.h>
+#include <asm/machines.h>
+
X /* dma on! */
X #define REAL_DMA
X
@@ -113,7 +116,7 @@
X #define AFTER_RESET_DELAY (HZ/2)
X
X /* ms to wait after hitting dma regs */
-#define SUN3_DMA_DELAY 5
+#define SUN3_DMA_DELAY 10
X
X /* dvma buffer to allocate -- 32k should hopefully be more than sufficient */
X #define SUN3_DVMA_BUFSIZE 0xe000
@@ -125,9 +128,10 @@
X static volatile struct sun3_dma_regs *dregs;
X static unsigned char *dmabuf = NULL; /* dma memory buffer */
X static struct sun3_udc_regs *udc_regs = NULL;
-static void *sun3_dma_orig_addr = NULL;
+static unsigned char *sun3_dma_orig_addr = NULL;
X static unsigned long sun3_dma_orig_count = 0;
X static int sun3_dma_active = 0;
+static unsigned long last_residual = 0;
X
X /*
X * NCR 5380 register access functions
@@ -189,6 +193,16 @@
X static int called = 0;


X struct Scsi_Host *instance;
X

+ /* check that this machine has an onboard 5380 */
+ switch(idprom->id_machtype) {
+ case SM_SUN3|SM_3_50:
+ case SM_SUN3|SM_3_60:


+ break;
+
+ default:

+ return 0;
+ }
+

X if(called)
X return 0;
X
@@ -233,17 +247,17 @@
X sun3_scsi_regp = (unsigned char *)ioaddr;
X dregs = (struct sun3_dma_regs *)(((unsigned char *)ioaddr) + 8);
X
- if((dmabuf = sun3_dvma_malloc(SUN3_DVMA_BUFSIZE)) == NULL) {
+ if((udc_regs = dvma_malloc(sizeof(struct sun3_udc_regs)))
+ == NULL) {
X printk("SUN3 Scsi couldn't allocate DVMA memory!\n");


X return 0;
X }
-

- if((udc_regs = sun3_dvma_malloc(sizeof(struct sun3_udc_regs)))
- == NULL) {
+#ifdef OLDDMA
+ if((dmabuf = dvma_malloc_align(SUN3_DVMA_BUFSIZE, 0x10000)) == NULL) {
X printk("SUN3 Scsi couldn't allocate DVMA memory!\n");


X return 0;
X }
-

+#endif
X #ifdef SUPPORT_TAGS
X if (setup_use_tagged_queuing < 0)
X setup_use_tagged_queuing = DEFAULT_USE_TAGGED_QUEUING;
@@ -403,13 +417,21 @@
X /* sun3scsi_dma_setup() -- initialize the dma controller for a read/write */
X static unsigned long sun3scsi_dma_setup(void *data, unsigned long count, int write_flag)
X {
+#ifdef OLDDMA
X if(write_flag)
X memcpy(dmabuf, data, count);
X else {
X sun3_dma_orig_addr = data;
X sun3_dma_orig_count = count;
X }
+#else
+ void *addr;
X
+// addr = sun3_dvma_page((unsigned long)data, (unsigned long)dmabuf);
+ addr = (void *)dvma_map((unsigned long) data, count);
+ sun3_dma_orig_addr = addr;
+ sun3_dma_orig_count = count;
+#endif
X dregs->fifo_count = 0;
X sun3_udc_write(UDC_RESET, UDC_CSR);
X
@@ -441,8 +463,13 @@
X }
X
X /* setup udc */
- udc_regs->addr_hi = ((sun3_dvma_vtop(dmabuf) & 0xff0000) >> 8);
- udc_regs->addr_lo = (sun3_dvma_vtop(dmabuf) & 0xffff);
+#ifdef OLDDMA
+ udc_regs->addr_hi = ((dvma_vtob(dmabuf) & 0xff0000) >> 8);
+ udc_regs->addr_lo = (dvma_vtob(dmabuf) & 0xffff);
+#else
+ udc_regs->addr_hi = (((unsigned long)(addr) & 0xff0000) >> 8);
+ udc_regs->addr_lo = ((unsigned long)(addr) & 0xffff);
+#endif
X udc_regs->count = count/2; /* count in words */
X udc_regs->mode_hi = UDC_MODE_HIWORD;
X if(write_flag) {
@@ -456,10 +483,10 @@
X }
X
X /* announce location of regs block */
- sun3_udc_write(((sun3_dvma_vtop(udc_regs) & 0xff0000) >> 8),
+ sun3_udc_write(((dvma_vtob(udc_regs) & 0xff0000) >> 8),
X UDC_CHN_HI);
X
- sun3_udc_write((sun3_dvma_vtop(udc_regs) & 0xffff), UDC_CHN_LO);
+ sun3_udc_write((dvma_vtob(udc_regs) & 0xffff), UDC_CHN_LO);
X
X /* set dma master on */
X sun3_udc_write(0xd, UDC_MODE);
@@ -471,7 +498,7 @@
X
X }
X
-static inline unsigned long sun3scsi_dma_residual(struct Scsi_Host *instance)
+static inline unsigned long sun3scsi_dma_count(struct Scsi_Host *instance)
X {
X unsigned short resid;
X
@@ -484,6 +511,11 @@
X return (unsigned long) resid;
X }
X
+static inline unsigned long sun3scsi_dma_residual(struct Scsi_Host *instance)
+{
+ return last_residual;
+}
+
X static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted, Scsi_Cmnd *cmd,
X int write_flag)
X {
@@ -494,15 +526,33 @@
X }
X
X /* clean up after our dma is done */
-static int sun3scsi_dma_finish(void)
+static int sun3scsi_dma_finish(int write_flag)
X {
X unsigned short count;
+ unsigned short fifo;
X int ret = 0;
X
- count = sun3scsi_dma_residual(default_instance);
-
X sun3_dma_active = 0;
X
+ // check to empty the fifo on a read
+ if(!write_flag) {
+ int tmo = 200000; /* 2 sec */
+
+ while(1) {
+ if(dregs->csr & CSR_FIFO_EMPTY)
+ break;
+
+ if(--tmo <= 0)
+ return 1;
+
+ udelay(10);
+ }
+ }
+
+
+ count = sun3scsi_dma_count(default_instance);
+#ifdef OLDDMA
+
X /* if we've finished a read, copy out the data we read */
X if(sun3_dma_orig_addr) {
X /* check for residual bytes after dma end */
@@ -518,9 +568,29 @@
X sun3_dma_orig_addr = NULL;
X
X }
-
+#else
+
+ fifo = dregs->fifo_count;
+ last_residual = fifo;
+
+ /* empty bytes from the fifo which didn't make it */
+ if((!write_flag) && (count - fifo) == 2) {
+ unsigned short data;
+ unsigned char *vaddr;
+
+ data = dregs->fifo_data;
+ vaddr = (unsigned char *)dvma_btov(sun3_dma_orig_addr);
+
+ vaddr += (sun3_dma_orig_count - fifo);
+
+ vaddr[-2] = (data & 0xff00) >> 8;
+ vaddr[-1] = (data & 0xff);
+ }
+
+ dvma_unmap(sun3_dma_orig_addr);
+#endif
X sun3_udc_write(UDC_RESET, UDC_CSR);
-
+ dregs->fifo_count = 0;
X dregs->csr &= ~CSR_SEND;
X
X /* reset fifo */
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/sun3x_esp.c linux/drivers/scsi/sun3x_esp.c
--- v2.4.13/linux/drivers/scsi/sun3x_esp.c Tue Mar 6 19:44:37 2001
+++ linux/drivers/scsi/sun3x_esp.c Thu Oct 25 13:53:51 2001
@@ -21,6 +21,7 @@
X #include "sun3x_esp.h"
X #include <asm/sun3x.h>
X #include <asm/dvma.h>
+#include <asm/irq.h>
X
X extern struct NCR_ESP *espchain;
X
@@ -28,6 +29,7 @@
X static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
X static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
X static void dma_drain(struct NCR_ESP *esp);
+static void dma_invalidate(struct NCR_ESP *esp);
X static void dma_dump_state(struct NCR_ESP *esp);
X static void dma_init_read(struct NCR_ESP *esp, __u32 vaddress, int length);
X static void dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length);
@@ -44,7 +46,7 @@
X static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp);
X static void dma_advance_sg (Scsi_Cmnd *sp);


X
-volatile unsigned char cmd_buffer[16];
+static volatile unsigned char cmd_buffer[16];
X /* This is where all commands are put

X * before they are trasfered to the ESP chip
X * via PIO.
@@ -78,9 +80,10 @@
X
X /* Optional functions */
X esp->dma_barrier = &dma_barrier;
+ esp->dma_invalidate = &dma_invalidate;
X esp->dma_drain = &dma_drain;
- esp->dma_irq_entry = &dma_ints_off;
- esp->dma_irq_exit = &dma_ints_on;
+ esp->dma_irq_entry = 0;
+ esp->dma_irq_exit = 0;
X esp->dma_led_on = 0;
X esp->dma_led_off = 0;
X esp->dma_poll = &dma_poll;
@@ -98,9 +101,14 @@
X esp->eregs = (struct ESP_regs *)(SUN3X_ESP_BASE);
X esp->dregs = (void *)SUN3X_ESP_DMA;
X
- esp->esp_command = (volatile unsigned char *)cmd_buffer;
- esp->esp_command_dvma = dvma_alloc(virt_to_phys(cmd_buffer),
- sizeof (cmd_buffer));
+#if 0
+ esp->esp_command = (volatile unsigned char *)cmd_buffer;
+ esp->esp_command_dvma = dvma_map((unsigned long)cmd_buffer,
+ sizeof (cmd_buffer));
+#else
+ esp->esp_command = (volatile unsigned char *)dvma_malloc(DVMA_PAGE_SIZE);
+ esp->esp_command_dvma = dvma_vtob((unsigned long)esp->esp_command);
+#endif
X
X esp->irq = 2;
X if (request_irq(esp->irq, esp_intr, SA_INTERRUPT,
@@ -114,20 +122,57 @@
X
X esp_initialize(esp);
X
+ /* for reasons beyond my knowledge (and which should likely be fixed)
+ sync mode doesn't work on a 3/80 at 5mhz. but it does at 4. */
+ esp->sync_defp = 0x3f;
+
X printk("ESP: Total of %d ESP hosts found, %d actually in use.\n", nesps,
X esps_in_use);
X esps_running = esps_in_use;
X return esps_in_use;
X }
X
+static void dma_do_drain(struct NCR_ESP *esp)
+{
+ struct sparc_dma_registers *dregs =
+ (struct sparc_dma_registers *) esp->dregs;
+
+ int count = 500000;
+
+ while((dregs->cond_reg & DMA_PEND_READ) && (--count > 0))
+ udelay(1);
+
+ if(!count) {
+ printk("%s:%d timeout CSR %08lx\n", __FILE__, __LINE__, dregs->cond_reg);
+ }
+
+ dregs->cond_reg |= DMA_FIFO_STDRAIN;
+
+ count = 500000;
+
+ while((dregs->cond_reg & DMA_FIFO_ISDRAIN) && (--count > 0))
+ udelay(1);
+
+ if(!count) {
+ printk("%s:%d timeout CSR %08lx\n", __FILE__, __LINE__, dregs->cond_reg);
+ }
+
+}
+
X static void dma_barrier(struct NCR_ESP *esp)
X {
- struct sparc_dma_registers *dregs =
- (struct sparc_dma_registers *) esp->dregs;
-
- while(dregs->cond_reg & DMA_PEND_READ)
- udelay(1);
- dregs->cond_reg &= ~(DMA_ENABLE);
+ struct sparc_dma_registers *dregs =
+ (struct sparc_dma_registers *) esp->dregs;
+ int count = 500000;
+
+ while((dregs->cond_reg & DMA_PEND_READ) && (--count > 0))
+ udelay(1);
+
+ if(!count) {
+ printk("%s:%d timeout CSR %08lx\n", __FILE__, __LINE__, dregs->cond_reg);
+ }
+
+ dregs->cond_reg &= ~(DMA_ENABLE);
X }
X
X /* This uses various DMA csr fields and the fifo flags count value to
@@ -145,27 +190,44 @@
X
X static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp)
X {
- __u32 base, end, sz;
-
- base = ((__u32)sp->SCp.ptr);
- base &= (0x1000000 - 1);
- end = (base + sp->SCp.this_residual);
- if(end > 0x1000000)
- end = 0x1000000;
- sz = (end - base);
- return sz;
+ return sp->SCp.this_residual;
X }
X
X static void dma_drain(struct NCR_ESP *esp)
X {
X struct sparc_dma_registers *dregs =
X (struct sparc_dma_registers *) esp->dregs;
+ int count = 500000;
X
X if(dregs->cond_reg & DMA_FIFO_ISDRAIN) {
X dregs->cond_reg |= DMA_FIFO_STDRAIN;
- while(dregs->cond_reg & DMA_FIFO_ISDRAIN)
+ while((dregs->cond_reg & DMA_FIFO_ISDRAIN) && (--count > 0))
X udelay(1);
+ if(!count) {
+ printk("%s:%d timeout CSR %08lx\n", __FILE__, __LINE__, dregs->cond_reg);


+ }
+
+ }
+}
+

+static void dma_invalidate(struct NCR_ESP *esp)
+{
+ struct sparc_dma_registers *dregs =
+ (struct sparc_dma_registers *) esp->dregs;
+
+ __u32 tmp;
+ int count = 500000;
+
+ while(((tmp = dregs->cond_reg) & DMA_PEND_READ) && (--count > 0))
+ udelay(1);
+
+ if(!count) {
+ printk("%s:%d timeout CSR %08lx\n", __FILE__, __LINE__, dregs->cond_reg);
X }
+
+ dregs->cond_reg = tmp | DMA_FIFO_INV;
+ dregs->cond_reg &= ~DMA_FIFO_INV;
+
X }
X
X static void dma_dump_state(struct NCR_ESP *esp)
@@ -173,7 +235,7 @@
X struct sparc_dma_registers *dregs =
X (struct sparc_dma_registers *) esp->dregs;
X
- ESPLOG(("esp%d: dma -- cond_reg<%08lx> addr<%p>\n",
+ ESPLOG(("esp%d: dma -- cond_reg<%08lx> addr<%08lx>\n",
X esp->esp_id, dregs->cond_reg, dregs->st_addr));
X }
X
@@ -182,8 +244,8 @@
X struct sparc_dma_registers *dregs =
X (struct sparc_dma_registers *) esp->dregs;
X
- dregs->cond_reg |= (DMA_ST_WRITE | DMA_ENABLE);
X dregs->st_addr = vaddress;
+ dregs->cond_reg |= (DMA_ST_WRITE | DMA_ENABLE);
X }
X
X static void dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length)
@@ -192,8 +254,9 @@
X (struct sparc_dma_registers *) esp->dregs;
X
X /* Set up the DMA counters */
- dregs->cond_reg = ((dregs->cond_reg & ~(DMA_ST_WRITE)) | DMA_ENABLE);
+
X dregs->st_addr = vaddress;
+ dregs->cond_reg = ((dregs->cond_reg & ~(DMA_ST_WRITE)) | DMA_ENABLE);
X }
X
X static void dma_ints_off(struct NCR_ESP *esp)
@@ -213,11 +276,21 @@
X
X static void dma_poll(struct NCR_ESP *esp, unsigned char *vaddr)
X {
- dma_drain(esp);
+ int count = 50;
+ dma_do_drain(esp);
X
X /* Wait till the first bits settle. */
- while(vaddr[0] == 0xff)
+ while((*(volatile unsigned char *)vaddr == 0xff) && (--count > 0))
X udelay(1);
+
+ if(!count) {
+// printk("%s:%d timeout expire (data %02x)\n", __FILE__, __LINE__,
+// esp_read(esp->eregs->esp_fdata));
+ //mach_halt();
+ vaddr[0] = esp_read(esp->eregs->esp_fdata);
+ vaddr[1] = esp_read(esp->eregs->esp_fdata);
+ }
+
X }
X

X static int dma_ports_p(struct NCR_ESP *esp)

@@ -244,10 +317,17 @@
X (struct sparc_dma_registers *) esp->dregs;
X unsigned long nreg = dregs->cond_reg;
X
+// printk("dma_setup %c addr %08x cnt %08x\n",
+// write ? 'W' : 'R', addr, count);
+
+ dma_do_drain(esp);
+
X if(write)
X nreg |= DMA_ST_WRITE;
- else
+ else {
X nreg &= ~(DMA_ST_WRITE);
+ }
+
X nreg |= DMA_ENABLE;
X dregs->cond_reg = nreg;
X dregs->st_addr = addr;
@@ -255,7 +335,7 @@
X
X static void dma_mmu_get_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp)
X {
- sp->SCp.have_data_in = dvma_alloc(virt_to_phys(sp->SCp.buffer),
+ sp->SCp.have_data_in = dvma_map((unsigned long)sp->SCp.buffer,
X sp->SCp.this_residual);
X sp->SCp.ptr = (char *)((unsigned long)sp->SCp.have_data_in);
X }
@@ -266,7 +346,7 @@
X struct mmu_sglist *sg = (struct mmu_sglist *) sp->SCp.buffer;
X
X while (sz >= 0) {
- sg[sz].dvma_addr = dvma_alloc(virt_to_phys(sg[sz].addr), sg[sz].len);
+ sg[sz].dvma_addr = dvma_map((unsigned long)sg[sz].addr, sg[sz].len);
X sz--;
X }
X sp->SCp.ptr=(char *)((unsigned long)sp->SCp.buffer->dvma_address);
@@ -274,7 +354,7 @@
X
X static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp)
X {
- dvma_free(sp->SCp.have_data_in, sp->request_bufflen);
+ dvma_unmap(sp->SCp.have_data_in);
X }
X
X static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp)
@@ -283,7 +363,7 @@
X struct mmu_sglist *sg = (struct mmu_sglist *)sp->buffer;
X
X while(sz >= 0) {
- dvma_free(sg[sz].dvma_addr,sg[sz].len);
+ dvma_unmap(sg[sz].dvma_addr);
X sz--;
X }
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/u14-34f.c linux/drivers/scsi/u14-34f.c
--- v2.4.13/linux/drivers/scsi/u14-34f.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/scsi/u14-34f.c Thu Oct 25 13:53:51 2001
@@ -334,6 +334,7 @@
X * the driver sets host->wish_block = TRUE for all ISA boards.
X */
X
+#include <linux/module.h>
X #include <linux/version.h>
X
X #ifndef LinuxVersionCode


@@ -342,9 +343,6 @@
X

X #define MAX_INT_PARAM 10
X
-#if defined(MODULE)
-#include <linux/module.h>
-
X MODULE_PARM(boot_options, "s");
X MODULE_PARM(io_port, "1-" __MODULE_STRING(MAX_INT_PARAM) "i");
X MODULE_PARM(linked_comm, "i");
@@ -353,8 +351,6 @@
X MODULE_PARM(max_queue_depth, "i");
X MODULE_PARM(ext_tran, "i");
X MODULE_AUTHOR("Dario Ballabio");
-
-#endif
X
X #include <linux/string.h>
X #include <linux/sched.h>
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/wd33c93.c linux/drivers/scsi/wd33c93.c
--- v2.4.13/linux/drivers/scsi/wd33c93.c Tue Dec 5 12:43:48 2000
+++ linux/drivers/scsi/wd33c93.c Thu Oct 25 13:53:51 2001


@@ -175,71 +175,72 @@
X
X

X
-static inline uchar read_wd33c93(wd33c93_regs *regp,uchar reg_num)
+static inline uchar read_wd33c93(const wd33c93_regs regs, uchar reg_num)
X {
- regp->SASR = reg_num;
+ *regs.SASR = reg_num;
X mb();
- return(regp->SCMD);
+ return(*regs.SCMD);
X }
X
X
-#define READ_AUX_STAT() (regp->SASR)
+#define READ_AUX_STAT() (*regs.SASR)
X
X
-static inline void write_wd33c93(wd33c93_regs *regp,uchar reg_num, uchar value)
+static inline void write_wd33c93(const wd33c93_regs regs, uchar reg_num,
+ uchar value)
X {
- regp->SASR = reg_num;
+ *regs.SASR = reg_num;
X mb();
- regp->SCMD = value;
+ *regs.SCMD = value;
X mb();
X }
X
X
-static inline void write_wd33c93_cmd(wd33c93_regs *regp, uchar cmd)
+static inline void write_wd33c93_cmd(const wd33c93_regs regs, uchar cmd)
X {
- regp->SASR = WD_COMMAND;
+ *regs.SASR = WD_COMMAND;
X mb();
- regp->SCMD = cmd;
+ *regs.SCMD = cmd;
X mb();
X }
X
X
-static inline uchar read_1_byte(wd33c93_regs *regp)
+static inline uchar read_1_byte(const wd33c93_regs regs)
X {
X uchar asr;
X uchar x = 0;
X
- write_wd33c93(regp, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED);
- write_wd33c93_cmd(regp, WD_CMD_TRANS_INFO|0x80);
+ write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED);
+ write_wd33c93_cmd(regs, WD_CMD_TRANS_INFO|0x80);
X do {
X asr = READ_AUX_STAT();
X if (asr & ASR_DBR)
- x = read_wd33c93(regp, WD_DATA);
+ x = read_wd33c93(regs, WD_DATA);
X } while (!(asr & ASR_INT));
X return x;
X }
X
X
-static void write_wd33c93_count(wd33c93_regs *regp,unsigned long value)
+static void write_wd33c93_count(const wd33c93_regs regs, unsigned long value)
X {
- regp->SASR = WD_TRANSFER_COUNT_MSB;
+ *regs.SASR = WD_TRANSFER_COUNT_MSB;
X mb();
- regp->SCMD = value >> 16;
- regp->SCMD = value >> 8;
- regp->SCMD = value;
+ *regs.SCMD = value >> 16;
+ *regs.SCMD = value >> 8;
+ *regs.SCMD = value;
X mb();
X }
X
X
-static unsigned long read_wd33c93_count(wd33c93_regs *regp)
+static unsigned long read_wd33c93_count(const wd33c93_regs regs)
X {
X unsigned long value;
X
- regp->SASR = WD_TRANSFER_COUNT_MSB;
+ *regs.SASR = WD_TRANSFER_COUNT_MSB;
X mb();
- value = regp->SCMD << 16;
- value |= regp->SCMD << 8;
- value |= regp->SCMD;
+ value = *regs.SCMD << 16;
+ value |= *regs.SCMD << 8;
+ value |= *regs.SCMD;
X mb();
X return value;
X }
@@ -423,14 +424,11 @@
X */
X static void wd33c93_execute (struct Scsi_Host *instance)
X {
-struct WD33C93_hostdata *hostdata;
-wd33c93_regs *regp;
+struct WD33C93_hostdata *hostdata = (struct WD33C93_hostdata *)instance->hostdata;
+const wd33c93_regs regs = hostdata->regs;
X Scsi_Cmnd *cmd, *prev;
X int i;
X
- hostdata = (struct WD33C93_hostdata *)instance->hostdata;
- regp = hostdata->regp;
-
X DB(DB_EXECUTE,printk("EX("))
X
X if (hostdata->selecting || hostdata->connected) {
@@ -479,9 +477,9 @@
X */
X
X if (is_dir_out(cmd))
- write_wd33c93(regp, WD_DESTINATION_ID, cmd->target);
+ write_wd33c93(regs, WD_DESTINATION_ID, cmd->target);
X else
- write_wd33c93(regp, WD_DESTINATION_ID, cmd->target | DSTID_DPD);
+ write_wd33c93(regs, WD_DESTINATION_ID, cmd->target | DSTID_DPD);
X
X /* Now we need to figure out whether or not this command is a good
X * candidate for disconnect/reselect. We guess to the best of our
@@ -537,10 +535,10 @@
X
X no:
X
- write_wd33c93(regp, WD_SOURCE_ID, ((cmd->SCp.phase)?SRCID_ER:0));
+ write_wd33c93(regs, WD_SOURCE_ID, ((cmd->SCp.phase)?SRCID_ER:0));
X
- write_wd33c93(regp, WD_TARGET_LUN, cmd->lun);
- write_wd33c93(regp,WD_SYNCHRONOUS_TRANSFER,hostdata->sync_xfer[cmd->target]);
+ write_wd33c93(regs, WD_TARGET_LUN, cmd->lun);
+ write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER,hostdata->sync_xfer[cmd->target]);
X hostdata->busy[cmd->target] |= (1 << cmd->lun);
X
X if ((hostdata->level2 == L2_NONE) ||
@@ -571,8 +569,8 @@
X if (hostdata->sync_stat[cmd->target] == SS_UNSET)
X hostdata->sync_stat[cmd->target] = SS_FIRST;


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 38'
echo 'File patch-2.4.14 is continued in part 39'
echo "39" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:02 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part39

#!/bin/sh -x
# this is part 39 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 39; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X hostdata->state = S_SELECTING;
- write_wd33c93_count(regp,0); /* guarantee a DATA_PHASE interrupt */
- write_wd33c93_cmd(regp, WD_CMD_SEL_ATN);
+ write_wd33c93_count(regs, 0); /* guarantee a DATA_PHASE interrupt */
+ write_wd33c93_cmd(regs, WD_CMD_SEL_ATN);
X }
X
X else {
@@ -586,15 +584,15 @@
X */
X
X hostdata->connected = cmd;
- write_wd33c93(regp, WD_COMMAND_PHASE, 0);
+ write_wd33c93(regs, WD_COMMAND_PHASE, 0);
X
X /* copy command_descriptor_block into WD chip
X * (take advantage of auto-incrementing)
X */
X
- regp->SASR = WD_CDB_1;
+ *regs.SASR = WD_CDB_1;
X for (i=0; i<cmd->cmd_len; i++)
- regp->SCMD = cmd->cmnd[i];
+ *regs.SCMD = cmd->cmnd[i];
X
X /* The wd33c93 only knows about Group 0, 1, and 5 commands when
X * it's doing a 'select-and-transfer'. To be safe, we write the
@@ -602,7 +600,7 @@
X * way there won't be problems with vendor-unique, audio, etc.
X */
X
- write_wd33c93(regp, WD_OWN_ID, cmd->cmd_len);
+ write_wd33c93(regs, WD_OWN_ID, cmd->cmd_len);
X
X /* When doing a non-disconnect command with DMA, we can save
X * ourselves a DATA phase interrupt later by setting everything
@@ -612,18 +610,18 @@
X if ((cmd->SCp.phase == 0) && (hostdata->no_dma == 0)) {
X if (hostdata->dma_setup(cmd,
X (is_dir_out(cmd))?DATA_OUT_DIR:DATA_IN_DIR))
- write_wd33c93_count(regp,0); /* guarantee a DATA_PHASE interrupt */
+ write_wd33c93_count(regs, 0); /* guarantee a DATA_PHASE interrupt */
X else {
- write_wd33c93_count(regp, cmd->SCp.this_residual);
- write_wd33c93(regp,WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_DMA);
+ write_wd33c93_count(regs, cmd->SCp.this_residual);
+ write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_DMA);
X hostdata->dma = D_DMA_RUNNING;
X }
X }
X else
- write_wd33c93_count(regp,0); /* guarantee a DATA_PHASE interrupt */
+ write_wd33c93_count(regs, 0); /* guarantee a DATA_PHASE interrupt */
X
X hostdata->state = S_RUNNING_LEVEL2;
- write_wd33c93_cmd(regp, WD_CMD_SEL_ATN_XFER);
+ write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER);
X }
X
X /*
@@ -638,28 +636,28 @@
X
X
X
-static void transfer_pio(wd33c93_regs *regp, uchar *buf, int cnt,
- int data_in_dir, struct WD33C93_hostdata *hostdata)
+static void transfer_pio(const wd33c93_regs regs, uchar *buf, int cnt,
+ int data_in_dir, struct WD33C93_hostdata *hostdata)


X {
X uchar asr;
X

X DB(DB_TRANSFER,printk("(%p,%d,%s:",buf,cnt,data_in_dir?"in":"out"))


X
- write_wd33c93(regp, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED);

- write_wd33c93_count(regp,cnt);
- write_wd33c93_cmd(regp, WD_CMD_TRANS_INFO);


+ write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED);

+ write_wd33c93_count(regs, cnt);
+ write_wd33c93_cmd(regs, WD_CMD_TRANS_INFO);
X if (data_in_dir) {


X do {
X asr = READ_AUX_STAT();
X if (asr & ASR_DBR)

- *buf++ = read_wd33c93(regp, WD_DATA);
+ *buf++ = read_wd33c93(regs, WD_DATA);


X } while (!(asr & ASR_INT));
X }

X else {


X do {
X asr = READ_AUX_STAT();
X if (asr & ASR_DBR)

- write_wd33c93(regp, WD_DATA, *buf++);
+ write_wd33c93(regs, WD_DATA, *buf++);


X } while (!(asr & ASR_INT));
X }

X
@@ -674,7 +672,8 @@
X
X
X
-static void transfer_bytes(wd33c93_regs *regp, Scsi_Cmnd *cmd, int data_in_dir)
+static void transfer_bytes(const wd33c93_regs regs, Scsi_Cmnd *cmd,
+ int data_in_dir)
X {
X struct WD33C93_hostdata *hostdata;
X unsigned long length;
@@ -696,7 +695,7 @@
X cmd->SCp.ptr = cmd->SCp.buffer->address;
X }
X

- write_wd33c93(regp,WD_SYNCHRONOUS_TRANSFER,hostdata->sync_xfer[cmd->target]);

+ write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER,hostdata->sync_xfer[cmd->target]);
X

X /* 'hostdata->no_dma' is TRUE if we don't even want to try DMA.
X * Update 'this_residual' and 'ptr' after 'transfer_pio()' returns.
@@ -714,10 +713,10 @@
X #ifdef PROC_STATISTICS
X hostdata->pio_cnt++;
X #endif
- transfer_pio(regp, (uchar *)cmd->SCp.ptr, cmd->SCp.this_residual,
+ transfer_pio(regs, (uchar *)cmd->SCp.ptr, cmd->SCp.this_residual,
X data_in_dir, hostdata);
X length = cmd->SCp.this_residual;
- cmd->SCp.this_residual = read_wd33c93_count(regp);
+ cmd->SCp.this_residual = read_wd33c93_count(regs);
X cmd->SCp.ptr += (length - cmd->SCp.this_residual);
X }
X
@@ -734,17 +733,17 @@
X #ifdef PROC_STATISTICS
X hostdata->dma_cnt++;
X #endif
- write_wd33c93(regp, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_DMA);
- write_wd33c93_count(regp,cmd->SCp.this_residual);
+ write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_DMA);
+ write_wd33c93_count(regs, cmd->SCp.this_residual);
X
X if ((hostdata->level2 >= L2_DATA) ||
X (hostdata->level2 == L2_BASIC && cmd->SCp.phase == 0)) {
- write_wd33c93(regp, WD_COMMAND_PHASE, 0x45);
- write_wd33c93_cmd(regp, WD_CMD_SEL_ATN_XFER);
+ write_wd33c93(regs, WD_COMMAND_PHASE, 0x45);
+ write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER);
X hostdata->state = S_RUNNING_LEVEL2;
X }
X else
- write_wd33c93_cmd(regp, WD_CMD_TRANS_INFO);
+ write_wd33c93_cmd(regs, WD_CMD_TRANS_INFO);
X
X hostdata->dma = D_DMA_RUNNING;
X }
@@ -754,15 +753,12 @@
X
X void wd33c93_intr (struct Scsi_Host *instance)
X {
-struct WD33C93_hostdata *hostdata;


+struct WD33C93_hostdata *hostdata = (struct WD33C93_hostdata *)instance->hostdata;
+const wd33c93_regs regs = hostdata->regs;

X Scsi_Cmnd *patch, *cmd;
-wd33c93_regs *regp;
X uchar asr, sr, phs, id, lun, *ucp, msg;
X unsigned long length, flags;


X
- hostdata = (struct WD33C93_hostdata *)instance->hostdata;
- regp = hostdata->regp;
-

X asr = READ_AUX_STAT();
X if (!(asr & ASR_INT) || (asr & ASR_BSY))
X return;
@@ -774,8 +770,8 @@
X #endif
X
X cmd = (Scsi_Cmnd *)hostdata->connected; /* assume we're connected */
- sr = read_wd33c93(regp, WD_SCSI_STATUS); /* clear the interrupt */
- phs = read_wd33c93(regp, WD_COMMAND_PHASE);
+ sr = read_wd33c93(regs, WD_SCSI_STATUS); /* clear the interrupt */
+ phs = read_wd33c93(regs, WD_COMMAND_PHASE);
X
X DB(DB_INTR,printk("{%02x:%02x-",asr,sr))
X
@@ -799,7 +795,7 @@
X hostdata->dma_stop(cmd->host, cmd, 1);
X hostdata->dma = D_DMA_OFF;
X length = cmd->SCp.this_residual;
- cmd->SCp.this_residual = read_wd33c93_count(regp);
+ cmd->SCp.this_residual = read_wd33c93_count(regs);
X cmd->SCp.ptr += (length - cmd->SCp.this_residual);
X DB(DB_TRANSFER,printk("%p/%d]",cmd->SCp.ptr,cmd->SCp.this_residual))
X }
@@ -894,7 +890,7 @@
X case CSR_UNEXP |PHS_DATA_IN:
X case CSR_SRV_REQ |PHS_DATA_IN:
X DB(DB_INTR,printk("IN-%d.%d",cmd->SCp.this_residual,cmd->SCp.buffers_residual))
- transfer_bytes(regp, cmd, DATA_IN_DIR);
+ transfer_bytes(regs, cmd, DATA_IN_DIR);
X if (hostdata->state != S_RUNNING_LEVEL2)
X hostdata->state = S_CONNECTED;
X break;
@@ -904,7 +900,7 @@
X case CSR_UNEXP |PHS_DATA_OUT:
X case CSR_SRV_REQ |PHS_DATA_OUT:
X DB(DB_INTR,printk("OUT-%d.%d",cmd->SCp.this_residual,cmd->SCp.buffers_residual))
- transfer_bytes(regp, cmd, DATA_OUT_DIR);
+ transfer_bytes(regs, cmd, DATA_OUT_DIR);
X if (hostdata->state != S_RUNNING_LEVEL2)
X hostdata->state = S_CONNECTED;
X break;
@@ -916,7 +912,7 @@
X case CSR_UNEXP |PHS_COMMAND:
X case CSR_SRV_REQ |PHS_COMMAND:
X DB(DB_INTR,printk("CMND-%02x,%ld",cmd->cmnd[0],cmd->pid))
- transfer_pio(regp, cmd->cmnd, cmd->cmd_len, DATA_OUT_DIR, hostdata);
+ transfer_pio(regs, cmd->cmnd, cmd->cmd_len, DATA_OUT_DIR, hostdata);
X hostdata->state = S_CONNECTED;
X break;
X
@@ -926,13 +922,13 @@
X case CSR_SRV_REQ |PHS_STATUS:
X DB(DB_INTR,printk("STATUS="))
X
- cmd->SCp.Status = read_1_byte(regp);
+ cmd->SCp.Status = read_1_byte(regs);
X DB(DB_INTR,printk("%02x",cmd->SCp.Status))
X if (hostdata->level2 >= L2_BASIC) {
- sr = read_wd33c93(regp, WD_SCSI_STATUS); /* clear interrupt */
+ sr = read_wd33c93(regs, WD_SCSI_STATUS); /* clear interrupt */
X hostdata->state = S_RUNNING_LEVEL2;
- write_wd33c93(regp, WD_COMMAND_PHASE, 0x50);
- write_wd33c93_cmd(regp, WD_CMD_SEL_ATN_XFER);
+ write_wd33c93(regs, WD_COMMAND_PHASE, 0x50);
+ write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER);
X }
X else {
X hostdata->state = S_CONNECTED;
@@ -945,8 +941,8 @@
X case CSR_SRV_REQ |PHS_MESS_IN:
X DB(DB_INTR,printk("MSG_IN="))
X
- msg = read_1_byte(regp);
- sr = read_wd33c93(regp, WD_SCSI_STATUS); /* clear interrupt */
+ msg = read_1_byte(regs);
+ sr = read_wd33c93(regs, WD_SCSI_STATUS); /* clear interrupt */
X
X hostdata->incoming_msg[hostdata->incoming_ptr] = msg;
X if (hostdata->incoming_msg[0] == EXTENDED_MESSAGE)
@@ -959,25 +955,25 @@
X
X case COMMAND_COMPLETE:
X DB(DB_INTR,printk("CCMP-%ld",cmd->pid))
- write_wd33c93_cmd(regp,WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X hostdata->state = S_PRE_CMP_DISC;
X break;
X
X case SAVE_POINTERS:
X DB(DB_INTR,printk("SDP"))
- write_wd33c93_cmd(regp,WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X hostdata->state = S_CONNECTED;
X break;
X
X case RESTORE_POINTERS:
X DB(DB_INTR,printk("RDP"))
X if (hostdata->level2 >= L2_BASIC) {
- write_wd33c93(regp, WD_COMMAND_PHASE, 0x45);
- write_wd33c93_cmd(regp, WD_CMD_SEL_ATN_XFER);
+ write_wd33c93(regs, WD_COMMAND_PHASE, 0x45);
+ write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER);
X hostdata->state = S_RUNNING_LEVEL2;
X }
X else {
- write_wd33c93_cmd(regp, WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X hostdata->state = S_CONNECTED;
X }
X break;
@@ -985,7 +981,7 @@
X case DISCONNECT:
X DB(DB_INTR,printk("DIS"))
X cmd->device->disconnect = 1;
- write_wd33c93_cmd(regp,WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X hostdata->state = S_PRE_TMP_DISC;
X break;
X
@@ -996,7 +992,7 @@
X #endif
X if (hostdata->sync_stat[cmd->target] == SS_WAITING)
X hostdata->sync_stat[cmd->target] = SS_SET;
- write_wd33c93_cmd(regp,WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X hostdata->state = S_CONNECTED;
X break;
X
@@ -1027,7 +1023,7 @@
X * specifically ask for sync transfers, we won't do any.
X */
X
- write_wd33c93_cmd(regp,WD_CMD_ASSERT_ATN); /* want MESS_OUT */
+ write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */
X hostdata->outgoing_msg[0] = EXTENDED_MESSAGE;
X hostdata->outgoing_msg[1] = 3;
X hostdata->outgoing_msg[2] = EXTENDED_SDTR;
@@ -1044,26 +1040,26 @@
X printk("sync_xfer=%02x",hostdata->sync_xfer[cmd->target]);
X #endif
X hostdata->sync_stat[cmd->target] = SS_SET;
- write_wd33c93_cmd(regp,WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X hostdata->state = S_CONNECTED;
X break;
X case EXTENDED_WDTR:
- write_wd33c93_cmd(regp,WD_CMD_ASSERT_ATN); /* want MESS_OUT */
+ write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */
X printk("sending WDTR ");
X hostdata->outgoing_msg[0] = EXTENDED_MESSAGE;
X hostdata->outgoing_msg[1] = 2;
X hostdata->outgoing_msg[2] = EXTENDED_WDTR;
X hostdata->outgoing_msg[3] = 0; /* 8 bit transfer width */
X hostdata->outgoing_len = 4;
- write_wd33c93_cmd(regp,WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X hostdata->state = S_CONNECTED;
X break;
X default:
- write_wd33c93_cmd(regp,WD_CMD_ASSERT_ATN); /* want MESS_OUT */
+ write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */
X printk("Rejecting Unknown Extended Message(%02x). ",ucp[2]);
X hostdata->outgoing_msg[0] = MESSAGE_REJECT;
X hostdata->outgoing_len = 1;
- write_wd33c93_cmd(regp,WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X hostdata->state = S_CONNECTED;
X break;
X }
@@ -1074,17 +1070,17 @@
X
X else {
X hostdata->incoming_ptr++;
- write_wd33c93_cmd(regp,WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X hostdata->state = S_CONNECTED;
X }


X break;
X
X default:

X printk("Rejecting Unknown Message(%02x) ",msg);
- write_wd33c93_cmd(regp,WD_CMD_ASSERT_ATN); /* want MESS_OUT */
+ write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */
X hostdata->outgoing_msg[0] = MESSAGE_REJECT;
X hostdata->outgoing_len = 1;
- write_wd33c93_cmd(regp,WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X hostdata->state = S_CONNECTED;
X }
X restore_flags(flags);
@@ -1099,11 +1095,11 @@
X * have been turned off for the command that just completed.
X */
X
- write_wd33c93(regp,WD_SOURCE_ID, SRCID_ER);
+ write_wd33c93(regs, WD_SOURCE_ID, SRCID_ER);
X if (phs == 0x60) {
X DB(DB_INTR,printk("SX-DONE-%ld",cmd->pid))
X cmd->SCp.Message = COMMAND_COMPLETE;
- lun = read_wd33c93(regp, WD_TARGET_LUN);
+ lun = read_wd33c93(regs, WD_TARGET_LUN);
X DB(DB_INTR,printk(":%d.%d",cmd->SCp.Status,lun))
X hostdata->connected = NULL;
X hostdata->busy[cmd->target] &= ~(1 << cmd->lun);
@@ -1133,8 +1129,8 @@
X case CSR_SDP:
X DB(DB_INTR,printk("SDP"))
X hostdata->state = S_RUNNING_LEVEL2;
- write_wd33c93(regp, WD_COMMAND_PHASE, 0x41);
- write_wd33c93_cmd(regp, WD_CMD_SEL_ATN_XFER);
+ write_wd33c93(regs, WD_COMMAND_PHASE, 0x41);
+ write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER);
X break;
X
X
@@ -1160,7 +1156,7 @@
X hostdata->outgoing_len = 1;
X hostdata->outgoing_msg[0] = NOP;
X }
- transfer_pio(regp, hostdata->outgoing_msg, hostdata->outgoing_len,
+ transfer_pio(regs, hostdata->outgoing_msg, hostdata->outgoing_len,
X DATA_OUT_DIR, hostdata);
X DB(DB_INTR,printk("%02x",hostdata->outgoing_msg[0]))
X hostdata->outgoing_len = 0;
@@ -1182,7 +1178,7 @@
X * have been turned off for the command that just completed.
X */
X
- write_wd33c93(regp,WD_SOURCE_ID, SRCID_ER);
+ write_wd33c93(regs, WD_SOURCE_ID, SRCID_ER);
X if (cmd == NULL) {
X printk(" - Already disconnected! ");
X hostdata->state = S_UNCONNECTED;
@@ -1213,7 +1209,7 @@
X * have been turned off for the command that just completed.
X */
X
- write_wd33c93(regp,WD_SOURCE_ID, SRCID_ER);
+ write_wd33c93(regs, WD_SOURCE_ID, SRCID_ER);
X DB(DB_INTR,printk("DISC-%ld",cmd->pid))
X if (cmd == NULL) {
X printk(" - Already disconnected! ");
@@ -1298,7 +1294,7 @@
X
X /* OK - find out which device reselected us. */
X
- id = read_wd33c93(regp, WD_SOURCE_ID);
+ id = read_wd33c93(regs, WD_SOURCE_ID);
X id &= SRCID_MASK;
X
X /* and extract the lun from the ID message. (Note that we don't
@@ -1307,9 +1303,9 @@
X */
X
X if (sr == CSR_RESEL_AM) {
- lun = read_wd33c93(regp, WD_DATA);
+ lun = read_wd33c93(regs, WD_DATA);
X if (hostdata->level2 < L2_RESELECT)
- write_wd33c93_cmd(regp,WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X lun &= 7;
X }
X else {
@@ -1325,12 +1321,12 @@
X }
X else {
X /* Verify this is a change to MSG_IN and read the message */
- sr = read_wd33c93(regp, WD_SCSI_STATUS);
+ sr = read_wd33c93(regs, WD_SCSI_STATUS);
X if (sr == (CSR_ABORT | PHS_MESS_IN) ||
X sr == (CSR_UNEXP | PHS_MESS_IN) ||
X sr == (CSR_SRV_REQ | PHS_MESS_IN)) {
X /* Got MSG_IN, grab target LUN */
- lun = read_1_byte(regp);
+ lun = read_1_byte(regs);
X /* Now we expect a 'paused with ACK asserted' int.. */
X asr = READ_AUX_STAT();
X if (!(asr & ASR_INT)) {
@@ -1340,12 +1336,12 @@
X printk("wd33c93: No int after LUN on RESEL (%02x)\n",
X asr);
X }
- sr = read_wd33c93(regp, WD_SCSI_STATUS);
+ sr = read_wd33c93(regs, WD_SCSI_STATUS);
X if (sr != CSR_MSGIN)
X printk("wd33c93: Not paused with ACK on RESEL (%02x)\n",
X sr);
X lun &= 7;
- write_wd33c93_cmd(regp,WD_CMD_NEGATE_ACK);
+ write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
X }
X else {
X printk("wd33c93: Not MSG_IN on reselect (%02x)\n", sr);
@@ -1386,13 +1382,13 @@


X */
X
X if (is_dir_out(cmd))
- write_wd33c93(regp, WD_DESTINATION_ID, cmd->target);
+ write_wd33c93(regs, WD_DESTINATION_ID, cmd->target);
X else
- write_wd33c93(regp, WD_DESTINATION_ID, cmd->target | DSTID_DPD);
+ write_wd33c93(regs, WD_DESTINATION_ID, cmd->target | DSTID_DPD);

X if (hostdata->level2 >= L2_RESELECT) {
- write_wd33c93_count(regp, 0); /* we want a DATA_PHASE interrupt */
- write_wd33c93(regp, WD_COMMAND_PHASE, 0x45);
- write_wd33c93_cmd(regp, WD_CMD_SEL_ATN_XFER);
+ write_wd33c93_count(regs, 0); /* we want a DATA_PHASE interrupt */
+ write_wd33c93(regs, WD_COMMAND_PHASE, 0x45);
+ write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER);
X hostdata->state = S_RUNNING_LEVEL2;
X }
X else
@@ -1413,36 +1409,33 @@
X
X static void reset_wd33c93(struct Scsi_Host *instance)


X {
-struct WD33C93_hostdata *hostdata;
-wd33c93_regs *regp;
+struct WD33C93_hostdata *hostdata = (struct WD33C93_hostdata *)instance->hostdata;
+const wd33c93_regs regs = hostdata->regs;

X uchar sr;


X
- hostdata = (struct WD33C93_hostdata *)instance->hostdata;
- regp = hostdata->regp;
-

- write_wd33c93(regp, WD_OWN_ID, OWNID_EAF | OWNID_RAF |
+ write_wd33c93(regs, WD_OWN_ID, OWNID_EAF | OWNID_RAF |
X instance->this_id | hostdata->clock_freq);


- write_wd33c93(regp, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED);

- write_wd33c93(regp, WD_SYNCHRONOUS_TRANSFER,


+ write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED);

+ write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER,
X calc_sync_xfer(hostdata->default_sx_per/4,DEFAULT_SX_OFF));
- write_wd33c93(regp, WD_COMMAND, WD_CMD_RESET);
+ write_wd33c93(regs, WD_COMMAND, WD_CMD_RESET);
X #ifdef CONFIG_MVME147_SCSI
X udelay(25); /* The old wd33c93 on MVME147 needs this, at least */
X #endif
X
X while (!(READ_AUX_STAT() & ASR_INT))
X ;
- sr = read_wd33c93(regp, WD_SCSI_STATUS);
+ sr = read_wd33c93(regs, WD_SCSI_STATUS);
X
- hostdata->microcode = read_wd33c93(regp, WD_CDB_1);
+ hostdata->microcode = read_wd33c93(regs, WD_CDB_1);
X if (sr == 0x00)
X hostdata->chip = C_WD33C93;
X else if (sr == 0x01) {
- write_wd33c93(regp, WD_QUEUE_TAG, 0xa5); /* any random number */
- sr = read_wd33c93(regp, WD_QUEUE_TAG);
+ write_wd33c93(regs, WD_QUEUE_TAG, 0xa5); /* any random number */
+ sr = read_wd33c93(regs, WD_QUEUE_TAG);
X if (sr == 0xa5) {
X hostdata->chip = C_WD33C93B;
- write_wd33c93(regp, WD_QUEUE_TAG, 0);
+ write_wd33c93(regs, WD_QUEUE_TAG, 0);
X }
X else
X hostdata->chip = C_WD33C93A;
@@ -1450,8 +1443,8 @@
X else
X hostdata->chip = C_UNKNOWN_CHIP;
X
- write_wd33c93(regp, WD_TIMEOUT_PERIOD, TIMEOUT_PERIOD_VALUE);


- write_wd33c93(regp, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED);

+ write_wd33c93(regs, WD_TIMEOUT_PERIOD, TIMEOUT_PERIOD_VALUE);


+ write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED);

X }
X
X
@@ -1495,14 +1488,14 @@
X {
X struct Scsi_Host *instance;
X struct WD33C93_hostdata *hostdata;
-wd33c93_regs *regp;
+wd33c93_regs regs;
X Scsi_Cmnd *tmp, *prev;
X
X disable_irq(cmd->host->irq);
X
X instance = cmd->host;
X hostdata = (struct WD33C93_hostdata *)instance->hostdata;


- regp = hostdata->regp;

+ regs = hostdata->regs;
X
X /*
X * Case 1 : If the command hasn't been issued yet, we simply remove it
@@ -1554,8 +1547,8 @@
X }
X
X printk("sending wd33c93 ABORT command - ");


- write_wd33c93(regp, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED);

- write_wd33c93_cmd(regp, WD_CMD_ABORT);


+ write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED);

+ write_wd33c93_cmd(regs, WD_CMD_ABORT);
X
X /* Now we have to attempt to flush out the FIFO... */
X
@@ -1564,11 +1557,11 @@


X do {
X asr = READ_AUX_STAT();
X if (asr & ASR_DBR)

- read_wd33c93(regp, WD_DATA);
+ read_wd33c93(regs, WD_DATA);
X } while (!(asr & ASR_INT) && timeout-- > 0);
- sr = read_wd33c93(regp, WD_SCSI_STATUS);
+ sr = read_wd33c93(regs, WD_SCSI_STATUS);
X printk("asr=%02x, sr=%02x, %ld bytes un-transferred (timeout=%ld) - ",
- asr, sr, read_wd33c93_count(regp), timeout);
+ asr, sr, read_wd33c93_count(regs), timeout);
X
X /*
X * Abort command processed.
@@ -1577,13 +1570,13 @@
X */
X
X printk("sending wd33c93 DISCONNECT command - ");
- write_wd33c93_cmd(regp, WD_CMD_DISCONNECT);
+ write_wd33c93_cmd(regs, WD_CMD_DISCONNECT);
X
X timeout = 1000000;
X asr = READ_AUX_STAT();
X while ((asr & ASR_CIP) && timeout-- > 0)
X asr = READ_AUX_STAT();
- sr = read_wd33c93(regp, WD_SCSI_STATUS);
+ sr = read_wd33c93(regs, WD_SCSI_STATUS);
X printk("asr=%02x, sr=%02x.",asr,sr);
X
X hostdata->busy[cmd->target] &= ~(1 << cmd->lun);


@@ -1733,8 +1726,8 @@
X
X

X
-void wd33c93_init (struct Scsi_Host *instance, wd33c93_regs *regs,
- dma_setup_t setup, dma_stop_t stop, int clock_freq)
+void wd33c93_init(struct Scsi_Host *instance, const wd33c93_regs regs,
+ dma_setup_t setup, dma_stop_t stop, int clock_freq)
X {
X struct WD33C93_hostdata *hostdata;
X int i;
@@ -1747,7 +1740,7 @@
X
X hostdata = (struct WD33C93_hostdata *)instance->hostdata;
X
- hostdata->regp = regs;
+ hostdata->regs = regs;
X hostdata->clock_freq = clock_freq;
X hostdata->dma_setup = setup;
X hostdata->dma_stop = stop;
@@ -2036,8 +2029,8 @@
X #ifdef MODULE
X int init_module(void) { return 0; }
X void cleanup_module(void) {}
+#endif
X void wd33c93_release(void)
X {
-MOD_DEC_USE_COUNT;
+ MOD_DEC_USE_COUNT;
X }
-#endif
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/wd33c93.h linux/drivers/scsi/wd33c93.h
--- v2.4.13/linux/drivers/scsi/wd33c93.h Mon Nov 27 17:57:34 2000
+++ linux/drivers/scsi/wd33c93.h Thu Oct 25 13:53:51 2001
@@ -189,14 +189,8 @@
X
X /* This is what the 3393 chip looks like to us */
X typedef struct {
- volatile unsigned char SASR;
-#if !defined(CONFIG_MVME147_SCSI)
- char pad;
-#endif
-#ifdef CONFIG_SGI_IP22
- char pad2,pad3;
-#endif
- volatile unsigned char SCMD;
+ volatile unsigned char *SASR;
+ volatile unsigned char *SCMD;
X } wd33c93_regs;
X
X

@@ -225,7 +219,7 @@
X

X struct WD33C93_hostdata {
X struct Scsi_Host *next;
- wd33c93_regs *regp;
+ wd33c93_regs regs;
X uchar clock_freq;
X uchar chip; /* what kind of wd33c93? */
X uchar microcode; /* microcode rev */
@@ -336,7 +330,7 @@
X #define PR_STOP 1<<7
X
X
-void wd33c93_init (struct Scsi_Host *instance, wd33c93_regs *regs,
+void wd33c93_init (struct Scsi_Host *instance, const wd33c93_regs regs,
X dma_setup_t setup, dma_stop_t stop, int clock_freq);
X int wd33c93_abort (Scsi_Cmnd *cmd);
X int wd33c93_queuecommand (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *));
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/dmasound/dmasound_atari.c linux/drivers/sound/dmasound/dmasound_atari.c
--- v2.4.13/linux/drivers/sound/dmasound/dmasound_atari.c Sun Sep 23 11:40:59 2001
+++ linux/drivers/sound/dmasound/dmasound_atari.c Thu Oct 25 13:53:52 2001
@@ -1559,3 +1559,4 @@
X
X module_init(dmasound_atari_init);
X module_exit(dmasound_atari_cleanup);
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/dmasound/dmasound_awacs.c linux/drivers/sound/dmasound/dmasound_awacs.c
--- v2.4.13/linux/drivers/sound/dmasound/dmasound_awacs.c Sun Sep 23 11:40:59 2001
+++ linux/drivers/sound/dmasound/dmasound_awacs.c Thu Oct 25 13:53:52 2001


@@ -2180,3 +2180,4 @@
X

X module_init(dmasound_awacs_init);
X module_exit(dmasound_awacs_cleanup);
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/dmasound/dmasound_core.c linux/drivers/sound/dmasound/dmasound_core.c
--- v2.4.13/linux/drivers/sound/dmasound/dmasound_core.c Mon Aug 27 12:41:45 2001
+++ linux/drivers/sound/dmasound/dmasound_core.c Thu Oct 25 13:53:52 2001
@@ -135,6 +135,7 @@
X MODULE_PARM(writeBufSize, "i");
X MODULE_PARM(numReadBufs, "i");
X MODULE_PARM(readBufSize, "i");
+MODULE_LICENSE("GPL");
X
X #ifdef MODULE
X static int sq_unit = -1;
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/dmasound/dmasound_paula.c linux/drivers/sound/dmasound/dmasound_paula.c
--- v2.4.13/linux/drivers/sound/dmasound/dmasound_paula.c Sun Sep 23 11:40:59 2001
+++ linux/drivers/sound/dmasound/dmasound_paula.c Thu Oct 25 13:53:52 2001
@@ -720,3 +720,4 @@
X
X module_init(dmasound_paula_init);
X module_exit(dmasound_paula_cleanup);
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/dmasound/dmasound_q40.c linux/drivers/sound/dmasound/dmasound_q40.c
--- v2.4.13/linux/drivers/sound/dmasound/dmasound_q40.c Sun Sep 23 11:40:59 2001
+++ linux/drivers/sound/dmasound/dmasound_q40.c Thu Oct 25 13:53:52 2001
@@ -585,3 +585,4 @@
X
X module_init(dmasound_q40_init);
X module_exit(dmasound_q40_cleanup);
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/emu10k1/hwaccess.h linux/drivers/sound/emu10k1/hwaccess.h
--- v2.4.13/linux/drivers/sound/emu10k1/hwaccess.h Tue Oct 9 17:06:52 2001
+++ linux/drivers/sound/emu10k1/hwaccess.h Thu Oct 25 14:01:57 2001
@@ -37,6 +37,9 @@
X #include <linux/soundcard.h>
X #include <linux/ac97_codec.h>
X #include <linux/pci.h>
+#include <linux/slab.h>
+#include <linux/sched.h>
+#include <asm/io.h>
X
X #include "efxmgr.h"
X #include "passthrough.h"
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/i810_audio.c linux/drivers/sound/i810_audio.c
--- v2.4.13/linux/drivers/sound/i810_audio.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/sound/i810_audio.c Thu Oct 25 13:53:52 2001
@@ -247,6 +247,12 @@
X
X MODULE_DEVICE_TABLE (pci, i810_pci_tbl);
X
+#ifdef CONFIG_PM
+#define PM_SUSPENDED(card) (card->pm_suspended)
+#else
+#define PM_SUSPENDED(card) (0)
+#endif
+
X /* "software" or virtual channel, an instance of opened /dev/dsp */
X struct i810_state {
X unsigned int magic;
@@ -262,6 +268,9 @@
X /* virtual channel number */
X int virt;
X
+#ifdef CONFIG_PM
+ unsigned int pm_saved_dac_rate,pm_saved_adc_rate;
+#endif
X struct dmabuf {
X /* wave sample stuff */
X unsigned int rate;
@@ -322,7 +331,11 @@
X /* PCI device stuff */
X struct pci_dev * pci_dev;
X u16 pci_id;
-
+#ifdef CONFIG_PM
+ u16 pm_suspended;
+ u32 pm_save_state[64/sizeof(u32)];
+ int pm_saved_mixer_settings[SOUND_MIXER_NRDEVICES][NR_AC97];
+#endif
X /* soundcore stuff */
X int dev_audio;
X
@@ -451,7 +464,7 @@
X
X if(!(state->card->ac97_features & 4)) {
X #ifdef DEBUG
- printk(KERN_WARNING "i810_audio: S/PDIF transmitter not avalible.\n");
+ printk(KERN_WARNING "i810_audio: S/PDIF transmitter not available.\n");
X #endif
X state->card->ac97_status &= ~SPDIF_ON;
X } else {
@@ -572,6 +585,10 @@
X if(!(state->card->ac97_features&0x0001))
X {
X dmabuf->rate = clocking;
+#ifdef DEBUG
+ printk("Asked for %d Hz, but ac97_features says we only do %dHz. Sorry!\n",
+ rate,clocking);
+#endif
X return clocking;
X }
X
@@ -594,11 +611,11 @@
X
X if(new_rate != rate) {
X dmabuf->rate = (new_rate * 48000)/clocking;
- rate = new_rate;
X }
X #ifdef DEBUG
- printk("i810_audio: called i810_set_dac_rate : rate = %d/%d\n", dmabuf->rate, rate);
+ printk("i810_audio: called i810_set_dac_rate : asked for %d, got %d\n", rate, dmabuf->rate);
X #endif
+ rate = new_rate;
X return dmabuf->rate;
X }
X
@@ -1066,7 +1083,7 @@
X for (;;) {
X /* It seems that we have to set the current state to TASK_INTERRUPTIBLE
X every time to make the process really go to sleep */


- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
X

X spin_lock_irqsave(&state->card->lock, flags);
X i810_update_ptr(state);


@@ -1085,7 +1102,7 @@
X

X if (nonblock) {
X remove_wait_queue(&dmabuf->wait, &wait);


- current->state = TASK_RUNNING;
+ set_current_state(TASK_RUNNING);

X return -EBUSY;
X }
X
@@ -1099,7 +1116,7 @@
X stop_dac(state);
X synchronize_irq();
X remove_wait_queue(&dmabuf->wait, &wait);


- current->state = TASK_RUNNING;
+ set_current_state(TASK_RUNNING);

X if (signal_pending(current))
X return -ERESTARTSYS;
X
@@ -1201,16 +1218,20 @@
X spin_unlock(&card->lock);
X }
X
-/* in this loop, dmabuf.count signifies the amount of data that is waiting to be copied to
- the user's buffer. it is filled by the dma machine and drained by this loop. */
+/* in this loop, dmabuf.count signifies the amount of data that is
+ waiting to be copied to the user's buffer. It is filled by the dma
+ machine and drained by this loop. */
+
X static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
X {
X struct i810_state *state = (struct i810_state *)file->private_data;
+ struct i810_card *card=state ? state->card : 0;
X struct dmabuf *dmabuf = &state->dmabuf;
X ssize_t ret;
X unsigned long flags;
X unsigned int swptr;
X int cnt;
+ DECLARE_WAITQUEUE(waita, current);
X
X #ifdef DEBUG2
X printk("i810_audio: i810_read called, count = %d\n", count);
@@ -1224,7 +1245,7 @@
X return -ENODEV;
X if (!dmabuf->read_channel) {
X dmabuf->ready = 0;
- dmabuf->read_channel = state->card->alloc_rec_pcm_channel(state->card);
+ dmabuf->read_channel = card->alloc_rec_pcm_channel(card);
X if (!dmabuf->read_channel) {
X return -EBUSY;
X }
@@ -1236,8 +1257,19 @@
X dmabuf->trigger &= ~PCM_ENABLE_OUTPUT;
X ret = 0;
X
+ add_wait_queue(&dmabuf->wait, &waita);
X while (count > 0) {
- spin_lock_irqsave(&state->card->lock, flags);
+ spin_lock_irqsave(&card->lock, flags);
+ if (PM_SUSPENDED(card)) {
+ spin_unlock_irqrestore(&card->lock, flags);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule();
+ if (signal_pending(current)) {
+ if (!ret) ret = -EAGAIN;
+ break;
+ }
+ continue;
+ }
X swptr = dmabuf->swptr;
X if (dmabuf->count > dmabuf->dmasize) {
X dmabuf->count = dmabuf->dmasize;
@@ -1246,7 +1278,7 @@
X // this is to make the copy_to_user simpler below
X if(cnt > (dmabuf->dmasize - swptr))
X cnt = dmabuf->dmasize - swptr;
- spin_unlock_irqrestore(&state->card->lock, flags);
+ spin_unlock_irqrestore(&card->lock, flags);
X
X if (cnt > count)
X cnt = count;
@@ -1290,15 +1322,20 @@
X
X if (copy_to_user(buffer, dmabuf->rawbuf + swptr, cnt)) {
X if (!ret) ret = -EFAULT;
- return ret;
+ goto done;
X }
X
X swptr = (swptr + cnt) % dmabuf->dmasize;
X
- spin_lock_irqsave(&state->card->lock, flags);
+ spin_lock_irqsave(&card->lock, flags);
+
+ if (PM_SUSPENDED(card)) {
+ spin_unlock_irqrestore(&card->lock, flags);
+ continue;
+ }
X dmabuf->swptr = swptr;
X dmabuf->count -= cnt;
- spin_unlock_irqrestore(&state->card->lock, flags);
+ spin_unlock_irqrestore(&card->lock, flags);
X
X count -= cnt;
X buffer += cnt;
@@ -1307,6 +1344,10 @@
X i810_update_lvi(state,1);
X if(!(dmabuf->enable & ADC_RUNNING))
X start_adc(state);
+ done:
+ set_current_state(TASK_RUNNING);
+ remove_wait_queue(&dmabuf->wait, &waita);
+


X return ret;
X }
X

@@ -1315,11 +1356,13 @@
X static ssize_t i810_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
X {
X struct i810_state *state = (struct i810_state *)file->private_data;
+ struct i810_card *card=state ? state->card : 0;
X struct dmabuf *dmabuf = &state->dmabuf;
X ssize_t ret;
X unsigned long flags;
X unsigned int swptr = 0;
X int cnt, x;
+ DECLARE_WAITQUEUE(waita, current);
X
X #ifdef DEBUG2
X printk("i810_audio: i810_write called, count = %d\n", count);
@@ -1333,7 +1376,7 @@
X return -ENODEV;
X if (!dmabuf->write_channel) {
X dmabuf->ready = 0;
- dmabuf->write_channel = state->card->alloc_pcm_channel(state->card);
+ dmabuf->write_channel = card->alloc_pcm_channel(card);
X if(!dmabuf->write_channel)
X return -EBUSY;
X }
@@ -1344,8 +1387,20 @@
X dmabuf->trigger &= ~PCM_ENABLE_INPUT;
X ret = 0;
X
+ add_wait_queue(&dmabuf->wait, &waita);
X while (count > 0) {
X spin_lock_irqsave(&state->card->lock, flags);
+ if (PM_SUSPENDED(card)) {
+ spin_unlock_irqrestore(&card->lock, flags);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule();
+ if (signal_pending(current)) {
+ if (!ret) ret = -EAGAIN;
+ break;
+ }
+ continue;
+ }
+
X swptr = dmabuf->swptr;
X if (dmabuf->count < 0) {
X dmabuf->count = 0;
@@ -1376,7 +1431,7 @@
X i810_update_lvi(state,0);
X if (file->f_flags & O_NONBLOCK) {
X if (!ret) ret = -EAGAIN;
- return ret;
+ goto ret;
X }
X /* Not strictly correct but works */
X tmo = (dmabuf->dmasize * HZ) / (dmabuf->rate * 4);
@@ -1400,25 +1455,30 @@
X }
X if (signal_pending(current)) {
X if (!ret) ret = -ERESTARTSYS;
- return ret;
+ goto ret;
X }
X continue;
X }
X if (copy_from_user(dmabuf->rawbuf+swptr,buffer,cnt)) {
X if (!ret) ret = -EFAULT;
- return ret;
+ goto ret;
X }
X
X swptr = (swptr + cnt) % dmabuf->dmasize;
X
X spin_lock_irqsave(&state->card->lock, flags);
+ if (PM_SUSPENDED(card)) {
+ spin_unlock_irqrestore(&card->lock, flags);
+ continue;
+ }
+
X dmabuf->swptr = swptr;
X dmabuf->count += cnt;
- spin_unlock_irqrestore(&state->card->lock, flags);
X
X count -= cnt;
X buffer += cnt;
X ret += cnt;
+ spin_unlock_irqrestore(&state->card->lock, flags);
X }
X if (swptr % dmabuf->fragsize) {
X x = dmabuf->fragsize - (swptr % dmabuf->fragsize);
@@ -1427,6 +1487,9 @@
X i810_update_lvi(state,0);
X if (!dmabuf->enable && dmabuf->count >= dmabuf->userfragsize)
X start_dac(state);
+ ret:
+ set_current_state(TASK_RUNNING);
+ remove_wait_queue(&dmabuf->wait, &waita);
X
X return ret;
X }
@@ -2310,18 +2373,52 @@
X open: i810_open_mixdev,
X };
X
-/* AC97 codec initialisation. */
-static int __init i810_ac97_init(struct i810_card *card)
+/* AC97 codec initialisation. These small functions exist so we don't
+ duplicate code between module init and apm resume */
+
+static inline int i810_ac97_exists(struct i810_card *card,int ac97_number)
X {
- int num_ac97 = 0;
- int total_channels = 0;
- struct ac97_codec *codec;
- u16 eid;
- int i=0;
- u32 reg;
+ u32 reg = inl(card->iobase + GLOB_STA);
+ return (reg & (0x100 << ac97_number));
+}
X
- reg = inl(card->iobase + GLOB_CNT);
+static inline int i810_ac97_enable_variable_rate(struct ac97_codec *codec)
+{
+ i810_ac97_set(codec, AC97_EXTENDED_STATUS, 9);
+ i810_ac97_set(codec,AC97_EXTENDED_STATUS,
+ i810_ac97_get(codec, AC97_EXTENDED_STATUS)|0xE800);
X
+ return (i810_ac97_get(codec, AC97_EXTENDED_STATUS)&1);
+}
+
+
+static int i810_ac97_probe_and_powerup(struct i810_card *card,struct ac97_codec *codec)
+{
+ /* Returns 0 on failure */
+ int i;
+
+ if (ac97_probe_codec(codec) == 0) return 0;
+
+ /* power it all up */
+ i810_ac97_set(codec, AC97_POWER_CONTROL,
+ i810_ac97_get(codec, AC97_POWER_CONTROL) & ~0x7f00);
+ /* wait for analog ready */
+ for (i=10;
+ i && ((i810_ac97_get(codec, AC97_POWER_CONTROL) & 0xf) != 0xf);
+ i--)
+ {
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ schedule_timeout(HZ/20);
+ }
+ return i;
+}
+
+/* if I knew what this did, I'd give it a better name */
+static int i810_ac97_random_init_stuff(struct i810_card *card)
+{
+ u32 reg = inl(card->iobase + GLOB_CNT);
+ int i;
+
X if((reg&2)==0) /* Cold required */
X reg|=2;
X else
@@ -2330,13 +2427,13 @@
X reg&=~8; /* ACLink on */
X outl(reg , card->iobase + GLOB_CNT);
X
- while(i<10)
+ for(i=0;i<10;i++)
X {
X if((inl(card->iobase+GLOB_CNT)&4)==0)
X break;
- current->state = TASK_UNINTERRUPTIBLE;
+
+ set_current_state(TASK_UNINTERRUPTIBLE);
X schedule_timeout(HZ/20);
- i++;
X }
X if(i==10)
X {
@@ -2344,8 +2441,22 @@


X return 0;
X }
X

- current->state = TASK_UNINTERRUPTIBLE;
- schedule_timeout(HZ/5);
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ schedule_timeout(HZ/2);
+ reg = inl(card->iobase + GLOB_STA);
+ inw(card->ac97base);


+ return 1;
+}
+

+static int __init i810_ac97_init(struct i810_card *card)
+{
+ int num_ac97 = 0;
+ int total_channels = 0;
+ struct ac97_codec *codec;
+ u16 eid;
+ u32 reg;
+
+ if(!i810_ac97_random_init_stuff(card)) return 0;
X
X /* Number of channels supported */
X /* What about the codec? Just because the ICH supports */
@@ -2371,10 +2482,10 @@
X /* check the ready status before probing. So we chk */
X /* What do we do if it's not ready? Wait and try */
X /* again, or abort? */
- reg = inl(card->iobase + GLOB_STA);
- if (!(reg & (0x100 << num_ac97))) {
+ if (!i810_ac97_exists(card,num_ac97)) {
X if(num_ac97 == 0)
X printk(KERN_ERR "i810_audio: Primary codec not ready.\n");
+ card->ac97_codec[num_ac97] = 0;
X break; /* I think this works, if not ready stop */
X }
X
@@ -2390,24 +2501,13 @@
X codec->codec_read = i810_ac97_get;
X codec->codec_write = i810_ac97_set;
X
- if (ac97_probe_codec(codec) == 0)
- break;
-
- /* power up everything, modify this when implementing power saving */
- i810_ac97_set(codec, AC97_POWER_CONTROL,
- i810_ac97_get(codec, AC97_POWER_CONTROL) & ~0x7f00);
- /* wait for analog ready */
- for (i=10;
- i && ((i810_ac97_get(codec, AC97_POWER_CONTROL) & 0xf) != 0xf);
- i--)
- {
- current->state = TASK_UNINTERRUPTIBLE;
- schedule_timeout(HZ/20);
+ if(!i810_ac97_probe_and_powerup(card,codec)) {
+ printk("i810_audio: timed out waiting for codec %d analog ready", num_ac97);
+ break; /* it didn't work */
X }
-
X /* Store state information about S/PDIF transmitter */
X card->ac97_status = 0;
-
+
X /* Don't attempt to get eid until powerup is complete */
X eid = i810_ac97_get(codec, AC97_EXTENDED_ID);
X
@@ -2427,16 +2527,10 @@
X printk(KERN_WARNING "i810_audio: only 48Khz playback available.\n");
X else
X {
- /* Enable variable rate mode */
- i810_ac97_set(codec, AC97_EXTENDED_STATUS, 9);
- i810_ac97_set(codec,AC97_EXTENDED_STATUS,
- i810_ac97_get(codec, AC97_EXTENDED_STATUS)|0xE800);
-
- if(!(i810_ac97_get(codec, AC97_EXTENDED_STATUS)&1))
- {
+ if(!i810_ac97_enable_variable_rate(codec)) {
X printk(KERN_WARNING "i810_audio: Codec refused to allow VRA, using 48Khz only.\n");
X card->ac97_features&=~1;
- }
+ }
X }
X
X /* Determine how many channels the codec(s) support */
@@ -2609,6 +2703,9 @@
X card->irq = pci_dev->irq;
X card->next = devs;
X card->magic = I810_CARD_MAGIC;
+#ifdef CONFIG_PM
+ card->pm_suspended=0;
+#endif
X spin_lock_init(&card->lock);
X devs = card;
X
@@ -2697,6 +2794,131 @@
X kfree(card);
X }
X
+#ifdef CONFIG_PM
+static int i810_pm_suspend(struct pci_dev *dev, u32 pm_state)
+{
+ struct i810_card *card = dev->driver_data;
+ struct i810_state *state;
+ unsigned long flags;
+ struct dmabuf *dmabuf;
+ int i,num_ac97;
+#ifdef DEBUG
+ printk("i810_audio: i810_pm_suspend called\n");
+#endif
+ if(!card) return 0;
+ spin_lock_irqsave(&card->lock, flags);
+ card->pm_suspended=1;
+ for(i=0;i<NR_HW_CH;i++) {
+ state = card->states[i];
+ if(!state) continue;
+ /* this happens only if there are open files */
+ dmabuf = &state->dmabuf;
+ if(dmabuf->enable & DAC_RUNNING ||
+ (dmabuf->count && (dmabuf->trigger & PCM_ENABLE_OUTPUT))) {
+ state->pm_saved_dac_rate=dmabuf->rate;
+ stop_dac(state);
+ } else {
+ state->pm_saved_dac_rate=0;
+ }
+ if(dmabuf->enable & ADC_RUNNING) {
+ state->pm_saved_adc_rate=dmabuf->rate;
+ stop_adc(state);
+ } else {
+ state->pm_saved_adc_rate=0;
+ }
+ dmabuf->ready = 0;
+ dmabuf->swptr = dmabuf->hwptr = 0;
+ dmabuf->count = dmabuf->total_bytes = 0;
+ }
+
+ spin_unlock_irqrestore(&card->lock, flags);
+
+ /* save mixer settings */
+ for (num_ac97 = 0; num_ac97 < NR_AC97; num_ac97++) {
+ struct ac97_codec *codec = card->ac97_codec[num_ac97];
+ if(!codec) continue;
+ for(i=0;i< SOUND_MIXER_NRDEVICES ;i++) {
+ if((supported_mixer(codec,i)) &&
+ (codec->read_mixer)) {
+ card->pm_saved_mixer_settings[i][num_ac97]=
+ codec->read_mixer(codec,i);
+ }
+ }
+ }
+ pci_save_state(dev,card->pm_save_state); /* XXX do we need this? */
+ pci_disable_device(dev); /* disable busmastering */
+ pci_set_power_state(dev,3); /* Zzz. */
+


+ return 0;
+}
+
+

+static int i810_pm_resume(struct pci_dev *dev)
+{
+ int num_ac97,i=0;
+ struct i810_card *card=(struct i810_card *)dev->driver_data;
+ pci_enable_device(dev);
+ pci_restore_state (dev,card->pm_save_state);
+
+ /* observation of a toshiba portege 3440ct suggests that the
+ hardware has to be more or less completely reinitialized from
+ scratch after an apm suspend. Works For Me. -dan */
+
+ i810_ac97_random_init_stuff(card);
+
+ for (num_ac97 = 0; num_ac97 < NR_AC97; num_ac97++) {
+ struct ac97_codec *codec = card->ac97_codec[num_ac97];
+ /* check they haven't stolen the hardware while we were
+ away */
+ if(!i810_ac97_exists(card,num_ac97)) {
+ if(num_ac97) continue;
+ else BUG();
+ }
+ if(!i810_ac97_probe_and_powerup(card,codec)) BUG();
+
+ if((card->ac97_features&0x0001)) {
+ /* at probe time we found we could do variable
+ rates, but APM suspend has made it forget
+ its magical powers */
+ if(!i810_ac97_enable_variable_rate(codec)) BUG();
+ }
+ /* we lost our mixer settings, so restore them */
+ for(i=0;i< SOUND_MIXER_NRDEVICES ;i++) {
+ if(supported_mixer(codec,i)){
+ int val=card->
+ pm_saved_mixer_settings[i][num_ac97];
+ codec->mixer_state[i]=val;
+ codec->write_mixer(codec,i,
+ (val & 0xff) ,
+ ((val >> 8) & 0xff) );
+ }
+ }
+ }
+
+ /* we need to restore the sample rate from whatever it was */
+ for(i=0;i<NR_HW_CH;i++) {
+ struct i810_state * state=card->states[i];
+ if(state) {
+ if(state->pm_saved_adc_rate)
+ i810_set_adc_rate(state,state->pm_saved_adc_rate);
+ if(state->pm_saved_dac_rate)
+ i810_set_dac_rate(state,state->pm_saved_dac_rate);
+ }
+ }
+
+
+ card->pm_suspended = 0;
+
+ /* any processes that were reading/writing during the suspend
+ probably ended up here */
+ for(i=0;i<NR_HW_CH;i++) {
+ struct i810_state *state = card->states[i];
+ if(state) wake_up(&state->dmabuf.wait);
+ }


+
+ return 0;
+}

+#endif /* CONFIG_PM */
X
X MODULE_AUTHOR("");
X MODULE_DESCRIPTION("Intel 810 audio support");
@@ -2713,6 +2935,10 @@
X id_table: i810_pci_tbl,
X probe: i810_probe,
X remove: i810_remove,
+#ifdef CONFIG_PM
+ suspend: i810_pm_suspend,
+ resume: i810_pm_resume,
+#endif /* CONFIG_PM */
X };
X
X
@@ -2753,3 +2979,9 @@
X
X module_init(i810_init_module);
X module_exit(i810_cleanup_module);
+
+/*
+Local Variables:
+c-basic-offset: 8
+End:
+*/
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/ite8172.c linux/drivers/sound/ite8172.c
--- v2.4.13/linux/drivers/sound/ite8172.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/sound/ite8172.c Thu Oct 25 13:53:52 2001
@@ -1721,6 +1721,7 @@
X
X MODULE_AUTHOR("Monta Vista Software, ste...@mvista.com");
X MODULE_DESCRIPTION("IT8172 AudioPCI97 Driver");
+MODULE_LICENSE("GPL");
X
X /* --------------------------------------------------------------------- */
X
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/nec_vrc5477.c linux/drivers/sound/nec_vrc5477.c
--- v2.4.13/linux/drivers/sound/nec_vrc5477.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/sound/nec_vrc5477.c Thu Oct 25 13:53:52 2001
@@ -1774,6 +1774,7 @@
X
X MODULE_AUTHOR("Monta Vista Software, js...@mvista.com or js...@junsun.net");
X MODULE_DESCRIPTION("NEC Vrc5477 audio (AC97) Driver");
+MODULE_LICENSE("GPL");
X
X /* --------------------------------------------------------------------- */
X extern void jsun_scan_pci_bus(void);
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/rme96xx.c linux/drivers/sound/rme96xx.c
--- v2.4.13/linux/drivers/sound/rme96xx.c Tue Oct 9 17:06:52 2001
+++ linux/drivers/sound/rme96xx.c Thu Oct 25 13:53:52 2001
@@ -38,6 +38,8 @@
X #include <linux/soundcard.h>
X #include <linux/pci.h>
X #include <linux/smp_lock.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
X #include <asm/dma.h>
X #include <linux/init.h>
X #include <linux/poll.h>
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/sb_ess.c linux/drivers/sound/sb_ess.c
--- v2.4.13/linux/drivers/sound/sb_ess.c Fri Feb 16 16:02:37 2001
+++ linux/drivers/sound/sb_ess.c Thu Oct 25 13:53:52 2001
@@ -352,7 +352,8 @@
X *speedp = speed1;
X retval = 1;
X } else {
- *divp = div2;
+ /* *divp = div2; */
+ *divp = 0x80 | div2;
X *speedp = speed2;
X retval = 2;
X }
@@ -376,10 +377,19 @@
X /*
X * The 0x80 is important for the first audio channel
X */
- div = 0x80 | ess_calc_div (795500, 128, speedp, &diff);
+ if (devc->submodel == SUBMDL_ES1888) {
+ div = 0x80 | ess_calc_div (795500, 256, speedp, &diff);
+ } else {
+ div = 0x80 | ess_calc_div (795500, 128, speedp, &diff);
+ }
X } else if(devc->caps & SB_CAP_ES18XX_RATE) {
- ess_calc_best_speed(ES18XX_CLOCK1, 128, ES18XX_CLOCK2, 256,
+ if (devc->submodel == SUBMDL_ES1888) {
+ ess_calc_best_speed(397700, 128, 795500, 256,
X &div, speedp);
+ } else {
+ ess_calc_best_speed(ES18XX_CLOCK1, 128, ES18XX_CLOCK2, 256,
+ &div, speedp);
+ }
X } else {
X if (*speedp > 22000) {
X div = 0x80 | ess_calc_div (ES1688_CLOCK1, 256, speedp, &diff);
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/trident.c linux/drivers/sound/trident.c
--- v2.4.13/linux/drivers/sound/trident.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/sound/trident.c Thu Oct 25 13:53:52 2001
@@ -4104,7 +4104,7 @@
X if ((hwrpb->sys_type) == 201) {
X printk(KERN_INFO "trident: Running on Alpha system type Nautilus\n");
X ac97_data = ali_ac97_get(card, 0, AC97_POWER_CONTROL);
- ali_ac97_set(card, 0, AC97_POWER_CONTROL, ac97_data |
+ ali_ac97_set(card, 0, AC97_POWER_CONTROL, ac97_data | ALI_EAPD_POWER_DOWN);
X }
X }
X #endif
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/waveartist.c linux/drivers/sound/waveartist.c
--- v2.4.13/linux/drivers/sound/waveartist.c Fri Apr 13 20:26:07 2001
+++ linux/drivers/sound/waveartist.c Thu Oct 25 13:53:52 2001
@@ -39,26 +39,22 @@


X #include <linux/sched.h>
X #include <linux/interrupt.h>

X #include <linux/delay.h>
-#include <linux/smp.h>
X #include <linux/spinlock.h>
+#include <linux/bitops.h>
X
-#include <asm/hardware.h>
-#include <asm/mach-types.h>
X #include <asm/system.h>
X
X #include "sound_config.h"
X #include "waveartist.h"
X
-#ifndef _ISA_DMA
-#define _ISA_DMA(x) (x)
-#endif
-#ifndef _ISA_IRQ
-#define _ISA_IRQ(x) (x)
+#ifdef CONFIG_ARM
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
X #endif
X
-#define POSSIBLE_RECORDING_DEVICES (SOUND_MASK_LINE |\
- SOUND_MASK_MIC |\
- SOUND_MASK_LINE1)
+#ifndef NO_DMA
+#define NO_DMA 255
+#endif
X
X #define SUPPORTED_MIXER_DEVICES (SOUND_MASK_SYNTH |\
X SOUND_MASK_PCM |\
@@ -75,15 +71,15 @@
X 0x0000, /* Treble */
X 0x2323, /* Synth (FM) */
X 0x4b4b, /* PCM */
- 0x0000, /* PC Speaker */
+ 0x6464, /* PC Speaker */
X 0x0000, /* Ext Line */
X 0x0000, /* Mic */
X 0x0000, /* CD */
- 0x0000, /* Recording monitor */
+ 0x6464, /* Recording monitor */
X 0x0000, /* SB PCM (ALT PCM) */
X 0x0000, /* Recording level */
- 0x0000, /* Input gain */
- 0x0000, /* Output gain */
+ 0x6464, /* Input gain */
+ 0x6464, /* Output gain */
X 0x0000, /* Line1 (Aux1) */
X 0x0000, /* Line2 (Aux2) */
X 0x0000, /* Line3 (Aux3) */
@@ -91,7 +87,7 @@
X 0x0000, /* Digital2 */
X 0x0000, /* Digital3 */
X 0x0000, /* Phone In */
- 0x0000, /* Phone Out */
+ 0x6464, /* Phone Out */
X 0x0000, /* Video */
X 0x0000, /* Radio */
X 0x0000 /* Monitor */
@@ -110,10 +106,10 @@
X int dev_no;
X
X /* Mixer parameters */
+ const struct waveartist_mixer_info *mix;
+
X unsigned short *levels; /* cache of volume settings */
X int recmask; /* currently enabled recording device! */
- int supported_devices; /* SUPPORTED_MIXER_DEVICES */
- int rec_devices; /* POSSIBLE_RECORDING_DEVICES */
X
X #ifdef CONFIG_ARCH_NETWINDER
X signed int slider_vol; /* hardware slider volume */
@@ -126,6 +122,21 @@
X #endif
X } wavnc_info;
X
+/*
+ * This is the implementation specific mixer information.
+ */
+struct waveartist_mixer_info {
+ unsigned int supported_devs; /* Supported devices */
+ unsigned int recording_devs; /* Recordable devies */
+ unsigned int stereo_devs; /* Stereo devices */
+
+ unsigned int (*select_input)(wavnc_info *, unsigned int,
+ unsigned char *, unsigned char *);
+ int (*decode_mixer)(wavnc_info *, int,
+ unsigned char, unsigned char);
+ int (*get_mixer)(wavnc_info *, int);
+};
+
X typedef struct wavnc_port_info {
X int open_mode;
X int speed;
@@ -137,14 +148,14 @@
X static wavnc_info adev_info[MAX_AUDIO_DEV];
X static spinlock_t waveartist_lock = SPIN_LOCK_UNLOCKED;
X
-#ifndef machine_is_netwinder
+#ifndef CONFIG_ARCH_NETWINDER
X #define machine_is_netwinder() 0
-#endif
-
+#else
X static struct timer_list vnc_timer;
-static void vnc_configure_mixer(wavnc_info *devc);
+static void vnc_configure_mixer(wavnc_info *devc, unsigned int input_mask);
X static int vnc_private_ioctl(int dev, unsigned int cmd, caddr_t arg);
X static void vnc_slider_tick(unsigned long data);
+#endif


X
X static inline void

X waveartist_set_ctlr(struct address_info *hw, unsigned char clear, unsigned char set)
@@ -176,7 +187,7 @@
X unsigned int timeout = timeout_ms * 10 * HZ / 100;
X
X do {


- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);

X timeout = schedule_timeout(timeout);
X } while (timeout);
X
@@ -804,21 +815,21 @@
X }
X
X static struct audio_driver waveartist_audio_driver = {
- owner: THIS_MODULE,
- open: waveartist_open,
- close: waveartist_close,
- output_block: waveartist_output_block,
- start_input: waveartist_start_input,
- ioctl: waveartist_ioctl,
+ owner: THIS_MODULE,
+ open: waveartist_open,
+ close: waveartist_close,
+ output_block: waveartist_output_block,
+ start_input: waveartist_start_input,
+ ioctl: waveartist_ioctl,
X prepare_for_input: waveartist_prepare_for_input,
X prepare_for_output: waveartist_prepare_for_output,
- halt_io: waveartist_halt,
- halt_input: waveartist_halt_input,
- halt_output: waveartist_halt_output,
- trigger: waveartist_trigger,
- set_speed: waveartist_set_speed,
- set_bits: waveartist_set_bits,
- set_channels: waveartist_set_channels
+ halt_io: waveartist_halt,
+ halt_input: waveartist_halt_input,
+ halt_output: waveartist_halt_output,
+ trigger: waveartist_trigger,
+ set_speed: waveartist_set_speed,
+ set_bits: waveartist_set_bits,
+ set_channels: waveartist_set_channels
X };
X
X
@@ -864,220 +875,338 @@
X /* -------------------------------------------------------------------------
X * Mixer stuff
X */
+struct mix_ent {
+ unsigned char reg_l;
+ unsigned char reg_r;
+ unsigned char shift;
+ unsigned char max;
+};
+
+static const struct mix_ent mix_devs[SOUND_MIXER_NRDEVICES] = {
+ { 2, 6, 1, 7 }, /* SOUND_MIXER_VOLUME */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_BASS */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_TREBLE */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_SYNTH */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_PCM */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_SPEAKER */
+ { 0, 4, 6, 31 }, /* SOUND_MIXER_LINE */
+ { 2, 6, 4, 3 }, /* SOUND_MIXER_MIC */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_CD */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_IMIX */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_ALTPCM */
+#if 0
+ { 3, 7, 0, 10 }, /* SOUND_MIXER_RECLEV */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_IGAIN */
+#else
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_RECLEV */
+ { 3, 7, 0, 7 }, /* SOUND_MIXER_IGAIN */
+#endif
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_OGAIN */
+ { 0, 4, 1, 31 }, /* SOUND_MIXER_LINE1 */
+ { 1, 5, 6, 31 }, /* SOUND_MIXER_LINE2 */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_LINE3 */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_DIGITAL1 */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_DIGITAL2 */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_DIGITAL3 */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_PHONEIN */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_PHONEOUT */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_VIDEO */
+ { 0, 0, 0, 0 }, /* SOUND_MIXER_RADIO */
+ { 0, 0, 0, 0 } /* SOUND_MIXER_MONITOR */


+};
+
X static void

X waveartist_mixer_update(wavnc_info *devc, int whichDev)
X {
- unsigned int mask, reg_l, reg_r;
X unsigned int lev_left, lev_right;
- unsigned int vals[3];
X
X lev_left = devc->levels[whichDev] & 0xff;
X lev_right = devc->levels[whichDev] >> 8;
X
+ if (lev_left > 100)
+ lev_left = 100;
+ if (lev_right > 100)
+ lev_right = 100;
+
X #define SCALE(lev,max) ((lev) * (max) / 100)
X
X if (machine_is_netwinder() && whichDev == SOUND_MIXER_PHONEOUT)
X whichDev = SOUND_MIXER_VOLUME;
X
- switch(whichDev) {
- case SOUND_MIXER_VOLUME:
- mask = 0x000e;
- reg_l = 0x200;
- reg_r = 0x600;
- lev_left = SCALE(lev_left, 7) << 1;
- lev_right = SCALE(lev_right, 7) << 1;
- break;
+ if (mix_devs[whichDev].reg_l || mix_devs[whichDev].reg_r) {
+ const struct mix_ent *mix = mix_devs + whichDev;
+ unsigned int mask, left, right;
+
+ mask = mix->max << mix->shift;
+ lev_left = SCALE(lev_left, mix->max) << mix->shift;
+ lev_right = SCALE(lev_right, mix->max) << mix->shift;
+
+ /* read left setting */
+ left = waveartist_cmd1_r(devc, WACMD_GET_LEVEL |
+ mix->reg_l << 8);
+
+ /* read right setting */
+ right = waveartist_cmd1_r(devc, WACMD_GET_LEVEL |
+ mix->reg_r << 8);
+
+ left = (left & ~mask) | (lev_left & mask);
+ right = (right & ~mask) | (lev_right & mask);
+
+ /* write left,right back */
+ waveartist_cmd3(devc, WACMD_SET_MIXER, left, right);
+ } else {
+ switch(whichDev) {
+ case SOUND_MIXER_PCM:
+ waveartist_cmd3(devc, WACMD_SET_LEVEL,
+ SCALE(lev_left, 32767),
+ SCALE(lev_right, 32767));
+ break;
X
- case SOUND_MIXER_LINE:
- if ((devc->recmask & SOUND_MASK_LINE) == 0)
- return;
- mask = 0x07c0;
- reg_l = 0x000;
- reg_r = 0x400;
- lev_left = SCALE(lev_left, 31) << 6;
- lev_right = SCALE(lev_right, 31) << 6;
- break;
+ case SOUND_MIXER_SYNTH:
+ waveartist_cmd3(devc, 0x0100 | WACMD_SET_LEVEL,
+ SCALE(lev_left, 32767),
+ SCALE(lev_right, 32767));


+ break;
+ }
+ }
+}

X
- case SOUND_MIXER_MIC:


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 39'
echo 'File patch-2.4.14 is continued in part 40'
echo "40" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:51 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part28

#!/bin/sh -x
# this is part 28 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 28; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ * those who want to be sure if the watchdog manager dies the machine
+ * reboots. In the former case we disable the counters, in the latter
+ * case you have to open it again very soon.
+ */
+
+static int eurwdt_release(struct inode *inode, struct file *file)
+{
+ if (MINOR(inode->i_rdev) == WATCHDOG_MINOR) {
+#ifndef CONFIG_WATCHDOG_NOWAYOUT
+ eurwdt_disable_timer();
+#endif
+ eurwdt_is_open = 0;
+
+ MOD_DEC_USE_COUNT;


+ }
+
+ return 0;
+}
+
+/**

+ * eurwdt_notify_sys:
+ * @this: our notifier block
+ * @code: the event being reported
+ * @unused: unused
+ *
+ * Our notifier is called on system shutdowns. We want to turn the card
+ * off at reboot otherwise the machine will reboot again during memory
+ * test or worse yet during the following fsck. This would suck, in fact
+ * trust me - if it happens it does suck.
+ */
+
+static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code,
+ void *unused)
+{
+ if (code == SYS_DOWN || code == SYS_HALT) {
+ /* Turn the card off */
+ eurwdt_disable_timer();
+ }
+
+ return NOTIFY_DONE;
+}
+
+/*
+ * Kernel Interfaces
+ */
+
+
+static struct file_operations eurwdt_fops = {
+ owner: THIS_MODULE,
+ llseek: no_llseek,
+ write: eurwdt_write,
+ ioctl: eurwdt_ioctl,
+ open: eurwdt_open,
+ release: eurwdt_release,
+};
+
+static struct miscdevice eurwdt_miscdev =
+{
+ WATCHDOG_MINOR,
+ "watchdog",
+ &eurwdt_fops
+};
+
+/*
+ * The WDT card needs to learn about soft shutdowns in order to
+ * turn the timebomb registers off.
+ */
+
+static struct notifier_block eurwdt_notifier =
+{
+ eurwdt_notify_sys,
+ NULL,
+ 0
+};
+
+/**
+ * cleanup_module:
+ *
+ * Unload the watchdog. You cannot do this with any file handles open.
+ * If your watchdog is set to continue ticking on close and you unload
+ * it, well it keeps ticking. We won't get the interrupt but the board
+ * will not touch PC memory so all is fine. You just have to load a new
+ * module in 60 seconds or reboot.
+ */
+
+static void __exit eurwdt_exit(void)
+{
+ eurwdt_lock_chip();
+
+ misc_deregister(&eurwdt_miscdev);
+
+ unregister_reboot_notifier(&eurwdt_notifier);
+ release_region(io, 2);
+ free_irq(irq, NULL);
+}
+
+/**
+ * eurwdt_init:
+ *
+ * Set up the WDT watchdog board. After grabbing the resources
+ * we require we need also to unlock the device.
+ * The open() function will actually kick the board off.
+ */
+
+static int __init eurwdt_init(void)
+{
+ int ret;
+
+ ret = misc_register(&eurwdt_miscdev);
+ if (ret) {
+ printk(KERN_ERR "eurwdt: can't misc_register on minor=%d\n",
+ WATCHDOG_MINOR);


+ goto out;
+ }
+

+ ret = request_irq(irq, eurwdt_interrupt, SA_INTERRUPT, "eurwdt", NULL);
+ if(ret) {
+ printk(KERN_ERR "eurwdt: IRQ %d is not free.\n", irq);
+ goto outmisc;
+ }
+
+ if (!request_region(io, 2, "eurwdt")) {
+ printk(KERN_ERR "eurwdt: IO %X is not free.\n", io);
+ ret = -EBUSY;
+ goto outirq;
+ }
+
+ ret = register_reboot_notifier(&eurwdt_notifier);
+ if (ret) {
+ printk(KERN_ERR "eurwdt: can't register reboot notifier (err=%d)\n", ret);
+ goto outreg;
+ }
+
+ eurwdt_unlock_chip();
+
+ ret = 0;
+ printk(KERN_INFO "Eurotech WDT driver 0.01 at %X (Interrupt %d)"
+ " - timeout event: %s\n",
+ io, irq, (!strcmp("int", ev) ? "int" : "reboot"));
+
+ spin_lock_init(&eurwdt_lock);
+
+ out:
+ return ret;
+
+ outreg:
+ release_region(io, 2);
+
+ outirq:
+ free_irq(irq, NULL);
+
+ outmisc:
+ misc_deregister(&eurwdt_miscdev);


+ goto out;
+}
+

+module_init(eurwdt_init);
+module_exit(eurwdt_exit);
+
+MODULE_AUTHOR("Rodolfo Giometti");
+MODULE_DESCRIPTION("Driver for Eurotech CPU-1220/1410 on board watchdog");
+MODULE_LICENSE("GPL");
+EXPORT_NO_SYMBOLS;
diff -u --recursive --new-file v2.4.13/linux/drivers/char/i8k.c linux/drivers/char/i8k.c
--- v2.4.13/linux/drivers/char/i8k.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/i8k.c Fri Nov 2 17:46:47 2001
@@ -0,0 +1,556 @@
+/*
+ * i8k.c -- Linux driver for accessing the SMM BIOS on Dell I8000 laptops
+ *
+ * Copyright (C) 2001 Massimo Dal Zotto <d...@debian.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, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+


+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/types.h>

+#include <linux/init.h>
+#include <linux/proc_fs.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+
+#include <linux/i8k.h>
+
+#define I8K_VERSION "1.1 02/11/2001"
+#define I8K_BIOS_SIGNATURE "Dell System Inspiron 8000"
+#define I8K_BIOS_SIGNATURE_ADDR 0x000ec000
+#define I8K_BIOS_VERSION_OFFSET 32
+
+#define I8K_SMM_FN_STATUS 0x0025
+#define I8K_SMM_POWER_STATUS 0x0069
+#define I8K_SMM_SET_FAN 0x01a3
+#define I8K_SMM_GET_FAN 0x00a3
+#define I8K_SMM_GET_SPEED 0x02a3
+#define I8K_SMM_GET_TEMP 0x10a3
+#define I8K_SMM_BIOS_VERSION 0x00a6
+
+#define I8K_FAN_MULT 30
+#define I8K_MAX_TEMP 127
+
+#define I8K_FN_NONE 0x08
+#define I8K_FN_UP 0x09
+#define I8K_FN_DOWN 0x0a
+#define I8K_FN_MUTE 0x0c
+
+#define I8K_POWER_AC 0x05
+#define I8K_POWER_BATTERY 0x01
+
+#define I8K_TEMPERATURE_BUG 1
+
+static char bios_version[4] = "?";
+static char bios_machine_id[16] = "?";
+
+int force = 0;
+
+MODULE_AUTHOR("Massimo Dal Zotto (d...@debian.org)");
+MODULE_DESCRIPTION("Driver for accessing the SMM BIOS on Dell I8000 laptops");
+MODULE_LICENSE("GPL");
+MODULE_PARM(force, "i");
+MODULE_PARM_DESC(force, "Force loading without checking for an Inspiron 8000");
+
+static ssize_t i8k_read(struct file *, char *, size_t, loff_t *);
+static int i8k_ioctl(struct inode *, struct file *, unsigned int,
+ unsigned long);
+
+static struct file_operations i8k_fops = {
+ read: i8k_read,
+ ioctl: i8k_ioctl,
+};
+
+typedef struct {
+ unsigned int eax;
+ unsigned int ebx __attribute__ ((packed));
+ unsigned int ecx __attribute__ ((packed));
+ unsigned int edx __attribute__ ((packed));
+ unsigned int esi __attribute__ ((packed));
+ unsigned int edi __attribute__ ((packed));
+} SMMRegisters;
+
+/*
+ * Call the System Management Mode BIOS.
+ */
+static int i8k_smm(SMMRegisters *regs)
+{
+ int rc;
+
+ asm("pushl %%eax\n\t" \
+ "movl 0(%%eax),%%edx\n\t" \
+ "push %%edx\n\t" \
+ "movl 4(%%eax),%%ebx\n\t" \
+ "movl 8(%%eax),%%ecx\n\t" \
+ "movl 12(%%eax),%%edx\n\t" \
+ "movl 16(%%eax),%%esi\n\t" \
+ "movl 20(%%eax),%%edi\n\t" \
+ "popl %%eax\n\t" \
+ "out %%al,$0xb2\n\t" \
+ "out %%al,$0x84\n\t" \
+ "xchgl %%eax,(%%esp)\n\t"
+ "movl %%ebx,4(%%eax)\n\t" \
+ "movl %%ecx,8(%%eax)\n\t" \
+ "movl %%edx,12(%%eax)\n\t" \
+ "movl %%esi,16(%%eax)\n\t" \
+ "movl %%edi,20(%%eax)\n\t" \
+ "popl %%edx\n\t" \
+ "movl %%edx,0(%%eax)\n\t" \
+ "lahf\n\t" \
+ "shrl $8,%%eax\n\t" \
+ "andl $1,%%eax\n" \
+ : "=a" (rc)
+ : "a" (regs)
+ : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
+
+ if ((rc != 0) || ((regs->eax & 0xffff) == 0xffff)) {


+ return -EINVAL;
+ }
+

+ return 0;
+}
+
+/*

+ * Read the bios version. Return the version as an integer corresponding
+ * to the ascii value, for example "A17" is returned as 0x00413137.
+ */
+static int i8k_get_bios_version(void)
+{
+ SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
+ int rc;
+
+ regs.eax = I8K_SMM_BIOS_VERSION;
+ if ((rc=i8k_smm(&regs)) < 0) {
+ return rc;
+ }
+
+ return regs.eax;
+}
+
+/*
+ * Read the machine id. Not yet implemented.
+ */
+static int i8k_get_machine_id(unsigned char *buff)
+{


+ return -EINVAL;
+}
+

+/*
+ * Read the Fn key status.
+ */
+static int i8k_get_fn_status(void)
+{
+ SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
+ int rc;
+
+ regs.eax = I8K_SMM_FN_STATUS;
+ if ((rc=i8k_smm(&regs)) < 0) {
+ return rc;
+ }
+
+ switch ((regs.eax & 0xff00) >> 8) {
+ case I8K_FN_UP:
+ return I8K_VOL_UP;
+ case I8K_FN_DOWN:
+ return I8K_VOL_DOWN;
+ case I8K_FN_MUTE:
+ return I8K_VOL_MUTE;
+ default:


+ return 0;
+ }
+}
+
+/*

+ * Read the power status.
+ */
+static int i8k_get_power_status(void)
+{
+ SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
+ int rc;
+
+ regs.eax = I8K_SMM_POWER_STATUS;
+ if ((rc=i8k_smm(&regs)) < 0) {
+ return rc;
+ }
+
+ switch (regs.eax & 0xff) {
+ case I8K_POWER_AC:
+ return I8K_AC;
+ default:
+ return I8K_BATTERY;
+ }
+}
+
+/*
+ * Read the fan status.
+ */
+static int i8k_get_fan_status(int fan)
+{
+ SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
+ int rc;
+
+ regs.eax = I8K_SMM_GET_FAN;
+ regs.ebx = fan & 0xff;
+ if ((rc=i8k_smm(&regs)) < 0) {
+ return rc;
+ }
+
+ return (regs.eax & 0xff);
+}
+
+/*
+ * Read the fan speed in RPM.
+ */
+static int i8k_get_fan_speed(int fan)
+{
+ SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
+ int rc;
+
+ regs.eax = I8K_SMM_GET_SPEED;
+ regs.ebx = fan & 0xff;
+ if ((rc=i8k_smm(&regs)) < 0) {
+ return rc;
+ }
+
+ return (regs.eax & 0xffff) * I8K_FAN_MULT;
+}
+
+/*
+ * Set the fan speed (off, low, high). Returns the new fan status.
+ */
+static int i8k_set_fan(int fan, int speed)
+{
+ SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
+ int rc;
+
+ speed = (speed < 0) ? 0 : ((speed > I8K_FAN_MAX) ? I8K_FAN_MAX : speed);
+
+ regs.eax = I8K_SMM_SET_FAN;
+ regs.ebx = (fan & 0xff) | (speed << 8);
+ if ((rc=i8k_smm(&regs)) < 0) {
+ return rc;
+ }
+
+ return (i8k_get_fan_status(fan));
+}
+
+/*
+ * Read the cpu temperature.
+ */
+static int i8k_get_cpu_temp(void)
+{
+ SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
+ int rc;
+ int temp;
+
+#ifdef I8K_TEMPERATURE_BUG
+ static int prev = 0;
+#endif
+
+ regs.eax = I8K_SMM_GET_TEMP;
+ if ((rc=i8k_smm(&regs)) < 0) {
+ return rc;
+ }
+ temp = regs.eax & 0xff;
+
+#ifdef I8K_TEMPERATURE_BUG
+ /*
+ * Sometimes the temperature sensor returns 0x99, which is out of range.
+ * In this case we return (once) the previous cached value. For example:
+ # 1003655137 00000058 00005a4b
+ # 1003655138 00000099 00003a80 <--- 0x99 = 153 degrees
+ # 1003655139 00000054 00005c52
+ */
+ if (temp > I8K_MAX_TEMP) {
+ temp = prev;
+ prev = I8K_MAX_TEMP;
+ } else {
+ prev = temp;
+ }
+#endif
+
+ return temp;
+}
+
+static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
+ unsigned long arg)
+{
+ int val;
+ int speed;
+ unsigned char buff[16];
+
+ if (!arg) {


+ return -EINVAL;
+ }
+

+ switch (cmd) {
+ case I8K_BIOS_VERSION:
+ val = i8k_get_bios_version();
+ break;
+
+ case I8K_MACHINE_ID:
+ memset(buff, 0, 16);
+ val = i8k_get_machine_id(buff);
+ break;
+
+ case I8K_FN_STATUS:
+ val = i8k_get_fn_status();
+ break;
+
+ case I8K_POWER_STATUS:
+ val = i8k_get_power_status();
+ break;
+
+ case I8K_GET_TEMP:
+ val = i8k_get_cpu_temp();
+ break;
+
+ case I8K_GET_SPEED:
+ if (copy_from_user(&val, (int *)arg, sizeof(int))) {
+ return -EFAULT;
+ }
+ val = i8k_get_fan_speed(val);
+ break;
+
+ case I8K_GET_FAN:
+ if (copy_from_user(&val, (int *)arg, sizeof(int))) {
+ return -EFAULT;
+ }
+ val = i8k_get_fan_status(val);
+ break;
+
+ case I8K_SET_FAN:
+ if (copy_from_user(&val, (int *)arg, sizeof(int))) {
+ return -EFAULT;
+ }
+ if (copy_from_user(&speed, (int *)arg+1, sizeof(int))) {
+ return -EFAULT;
+ }
+ val = i8k_set_fan(val, speed);
+ break;
+
+ default:


+ return -EINVAL;
+ }
+

+ if (val < 0) {


+ return val;
+ }
+

+ switch (cmd) {
+ case I8K_BIOS_VERSION:
+ if (copy_to_user((int *)arg, &val, 4)) {
+ return -EFAULT;
+ }
+ break;
+ case I8K_MACHINE_ID:
+ if (copy_to_user((int *)arg, buff, 16)) {
+ return -EFAULT;
+ }
+ break;
+ default:
+ if (copy_to_user((int *)arg, &val, sizeof(int))) {
+ return -EFAULT;
+ }
+ break;


+ }
+
+ return 0;
+}
+
+/*

+ * Print the information for /proc/i8k.
+ */
+static int i8k_get_info(char *buffer, char **start, off_t fpos, int length)
+{
+ int n, fn_key, cpu_temp, ac_power;
+ int left_fan, right_fan, left_speed, right_speed;
+
+ cpu_temp = i8k_get_cpu_temp();
+ left_fan = i8k_get_fan_status(I8K_FAN_LEFT);
+ right_fan = i8k_get_fan_status(I8K_FAN_RIGHT);
+ left_speed = i8k_get_fan_speed(I8K_FAN_LEFT);
+ right_speed = i8k_get_fan_speed(I8K_FAN_RIGHT);
+ ac_power = i8k_get_power_status();
+ fn_key = i8k_get_fn_status();
+
+ /*
+ * Info:
+ *
+ * 1) Format version (this will change if format changes)
+ * 2) BIOS version
+ * 3) BIOS machine ID
+ * 4) Cpu temperature
+ * 5) Left fan status
+ * 6) Right fan status
+ * 7) Left fan speed
+ * 8) Right fan speed
+ * 9) AC power
+ * 10) Fn Key status
+ */
+ n = sprintf(buffer, "%s %s %s %d %d %d %d %d %d %d\n",
+ I8K_PROC_FMT,
+ bios_version,
+ bios_machine_id,
+ cpu_temp,
+ left_fan,
+ right_fan,
+ left_speed,
+ right_speed,
+ ac_power,
+ fn_key);
+
+ return n;
+}
+
+static ssize_t i8k_read(struct file *f, char *buffer, size_t len, loff_t *fpos)
+{
+ int n;
+ char info[128];
+
+ n = i8k_get_info(info, NULL, 0, 128);
+ if (n <= 0) {
+ return n;
+ }
+
+ if (*fpos >= n) {


+ return 0;
+ }
+

+ if ((*fpos + len) >= n) {
+ len = n - *fpos;
+ }
+
+ if (copy_to_user(buffer, info, len) != 0) {


+ return -EFAULT;
+ }
+

+ *fpos += len;
+ return len;
+}
+
+/*
+ * Probe for the presence of an Inspiron I8000.
+ */
+static int i8k_probe(void)
+{
+ unsigned char *buff, *p;
+ unsigned char bios_vers[4];
+ int version;
+
+ /*
+ * Until Dell tell us how to reliably check for an Inspiron system
+ * look for a signature at a fixed location in the BIOS memory.
+ * Ugly but safe.
+ */
+ if (!force) {
+ buff = ioremap(I8K_BIOS_SIGNATURE_ADDR, I8K_BIOS_VERSION_OFFSET+4);
+ if (buff == NULL) {
+ printk("i8k: ioremap failed\n");
+ return -ENODEV;
+ }
+ if (strncmp(buff,I8K_BIOS_SIGNATURE,sizeof(I8K_BIOS_SIGNATURE)) != 0) {
+ printk("i8k: Inspiron 8000 BIOS signature not found\n");
+ iounmap(buff);
+ return -ENODEV;
+ }
+ strncpy(bios_vers, buff+I8K_BIOS_VERSION_OFFSET, 3);
+ bios_vers[3] = '\0';
+ iounmap(buff);
+ }
+ if (force >= 2) {
+ buff = ioremap(0x000c0000, 0x00100000-0x000c0000);
+ if (buff == NULL) {
+ printk("i8k: ioremap failed\n");
+ return -ENODEV;
+ }
+ for (p=buff; (p-buff)<(0x00100000-0x000c0000); p+=16) {
+ if (strncmp(p,I8K_BIOS_SIGNATURE,sizeof(I8K_BIOS_SIGNATURE))==0) {
+ printk("i8k: Inspiron 8000 BIOS signature found at %08x\n",
+ 0x000c0000+(p-buff));
+ break;
+ }
+ }
+ iounmap(buff);
+ }
+
+ /*
+ * Next try to get the BIOS version with an SMM call. If this
+ * fails SMM can't be reliably used on this system.
+ */
+ version = i8k_get_bios_version();
+ if (version <= 0) {
+ printk("i8k: unable to get BIOS version\n");
+ return -ENODEV;
+ }
+ bios_version[0] = (version >> 16) & 0xff;
+ bios_version[1] = (version >> 8) & 0xff;
+ bios_version[2] = (version) & 0xff;
+ bios_version[3] = '\0';
+
+ /*
+ * Finally check if the two versions match.
+ */
+ if (!force) {
+ if (strncmp(bios_version,bios_vers,sizeof(bios_version)) != 0) {
+ printk("i8k: BIOS version mismatch: %s != %s\n",
+ bios_version, bios_vers);


+ return -ENODEV;
+ }
+ }
+

+ return 0;
+}
+

+#ifdef MODULE
+static
+#endif
+int __init i8k_init(void)
+{
+ struct proc_dir_entry *proc_i8k;
+
+ /* Are we running on an Inspiron 8000 laptop? */
+ if (i8k_probe() != 0) {


+ return -ENODEV;
+ }
+

+ /* Register the proc entry */
+ proc_i8k = create_proc_info_entry("i8k", 0, NULL, i8k_get_info);
+ if (!proc_i8k) {
+ return -ENOENT;
+ }
+ proc_i8k->proc_fops = &i8k_fops;
+ SET_MODULE_OWNER(proc_i8k);
+
+ printk(KERN_INFO
+ "Inspiron 8000 SMM driver v%s Massimo Dal Zotto (d...@debian.org)\n",
+ I8K_VERSION);


+
+ return 0;
+}
+

+#ifdef MODULE
+int init_module(void)
+{
+ return i8k_init();


+}
+
+void cleanup_module(void)
+{

+ /* Remove the proc entry */
+ remove_proc_entry("i8k", NULL);
+
+ printk(KERN_INFO "i8k: module unloaded\n");
+}
+#endif
+
+/* end of file */
diff -u --recursive --new-file v2.4.13/linux/drivers/char/ip2/i2cmd.c linux/drivers/char/ip2/i2cmd.c
--- v2.4.13/linux/drivers/char/ip2/i2cmd.c Wed Jul 25 17:10:19 2001
+++ linux/drivers/char/ip2/i2cmd.c Wed Oct 24 12:05:18 2001
@@ -139,7 +139,7 @@
X //static UCHAR ct86[]={ 2, BTH, 0x56,0 }; // RCV_ENABLE
X static UCHAR ct87[] = { 1, BYP, 0x57 }; // HW_TEST
X //static UCHAR ct88[]={ 3, BTH, 0x58,0,0 }; // RCV_THRESHOLD
-//static UCHAR ct89[]={ 1, BYP, 0x59 }; // DSS_NOW
+static UCHAR ct89[]={ 1, BYP, 0x59 }; // DSS_NOW
X //static UCHAR ct90[]={ 3, BYP, 0x5A,0,0 }; // Set SILO
X //static UCHAR ct91[]={ 2, BYP, 0x5B,0 }; // timed break
X
diff -u --recursive --new-file v2.4.13/linux/drivers/char/ip2/i2ellis.c linux/drivers/char/ip2/i2ellis.c
--- v2.4.13/linux/drivers/char/ip2/i2ellis.c Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ip2/i2ellis.c Wed Oct 24 12:05:18 2001
@@ -552,6 +552,9 @@
X
X pB->i2eStartMail = iiGetMail(pB);
X
+ // Throw it away and clear the mailbox structure element
+ pB->i2eStartMail = NO_MAIL_HERE;
+
X // Everything is ok now, return with good status/
X
X pB->i2eValid = I2E_MAGIC;
@@ -592,14 +595,27 @@
X static void
X ii2DelayTimer(unsigned int mseconds)
X {
+ wait_queue_t wait;


+
+ init_waitqueue_entry(&wait, current);
+

X init_timer ( pDelayTimer );
X
+ add_wait_queue(&pDelayWait, &wait);
+


+ set_current_state( TASK_INTERRUPTIBLE );
+

X pDelayTimer->expires = jiffies + ( mseconds + 9 ) / 10;
X pDelayTimer->function = ii2DelayWakeup;
X pDelayTimer->data = 0;
X
X add_timer ( pDelayTimer );
- interruptible_sleep_on ( &pDelayWait );


+
+ schedule();
+
+ set_current_state( TASK_RUNNING );

+ remove_wait_queue(&pDelayWait, &wait);
+
X del_timer ( pDelayTimer );
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/char/ip2/i2ellis.h linux/drivers/char/ip2/i2ellis.h
--- v2.4.13/linux/drivers/char/ip2/i2ellis.h Wed Jul 5 11:00:22 2000
+++ linux/drivers/char/ip2/i2ellis.h Wed Oct 24 12:05:18 2001
@@ -400,6 +400,12 @@
X rwlock_t read_fifo_spinlock;
X rwlock_t write_fifo_spinlock;
X
+// For queuing interupt bottom half handlers. /\/\|=mhw=|\/\/
+ struct tq_struct tqueue_interrupt;
+
+ struct timer_list SendPendingTimer; // Used by iiSendPending
+ unsigned int SendPendingRetry;
+
X #ifdef CONFIG_DEVFS_FS
X /* Device handles into devfs */
X devfs_handle_t devfs_ipl_handle;
diff -u --recursive --new-file v2.4.13/linux/drivers/char/ip2/i2lib.c linux/drivers/char/ip2/i2lib.c
--- v2.4.13/linux/drivers/char/ip2/i2lib.c Wed Jul 5 11:00:22 2000
+++ linux/drivers/char/ip2/i2lib.c Fri Nov 2 17:26:17 2001
@@ -174,6 +174,25 @@
X pB->i2eWaitingForEmptyFifo |=
X (pB->i2eOutMailWaiting & MB_OUT_STUFFED);
X pB->i2eOutMailWaiting = 0;
+ pB->SendPendingRetry = 0;
+ } else {
+/* The only time we hit this area is when "iiTrySendMail" has
+ failed. That only occurs when the outbound mailbox is
+ still busy with the last message. We take a short breather
+ to let the board catch up with itself and then try again.
+ 16 Retries is the limit - then we got a borked board.


+ /\/\|=mhw=|\/\/ */
+

+ if( ++pB->SendPendingRetry < 16 ) {
+
+ init_timer( &(pB->SendPendingTimer) );
+ pB->SendPendingTimer.expires = jiffies + 1;
+ pB->SendPendingTimer.function = (void*)(unsigned long)iiSendPendingMail;
+ pB->SendPendingTimer.data = (unsigned long)pB;
+ add_timer( &(pB->SendPendingTimer) );
+ } else {
+ printk( KERN_ERR "IP2: iiSendPendingMail unable to queue outbound mail\n" );
+ }
X }
X }
X }
@@ -225,6 +244,8 @@
X pB->i2Dbuf_strip = pB->i2Dbuf_stuff = 0;
X pB->i2Bbuf_strip = pB->i2Bbuf_stuff = 0;
X
+ pB->SendPendingRetry = 0;
+
X memset ( pCh, 0, sizeof (i2ChanStr) * nChannels );
X
X for (index = stuffIndex = 0, ppCh = (i2ChanStrPtr *)(pB->i2Fbuf);
@@ -311,15 +332,15 @@
X pCh->ClosingDelay = 5*HZ/10;
X pCh->ClosingWaitTime = 30*HZ;
X
-#ifdef USE_IQ
X // Initialize task queue objects
X pCh->tqueue_input.routine = (void(*)(void*)) do_input;
X pCh->tqueue_input.data = pCh;
X pCh->tqueue_status.routine = (void(*)(void*)) do_status;
X pCh->tqueue_status.data = pCh;
-#endif
X
+#ifdef IP2DEBUG_TRACE
X pCh->trace = ip2trace;
+#endif
X
X ++pCh;
X --nChannels;
@@ -535,9 +556,9 @@
X if ( !i2Validate ( pCh ) ) {
X return -1;
X }
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_QUEUE, ITRC_ENTER, 0 );
-#endif
+
X pB = pCh->pMyBord;
X
X // Board must also exist, and THE INTERRUPT COMMAND ALREADY SENT
@@ -615,9 +636,9 @@
X if (--bufroom < 0) {
X bufroom += maxBuff;
X }
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_QUEUE, 2, 1, bufroom );
-#endif
+
X // Check for overflow
X if (totalsize <= bufroom) {
X // Normal Expected path - We still hold LOCK


@@ -625,9 +646,8 @@
X }
X }

X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_QUEUE, 3, 1, totalsize );
-#endif
+
X // Prepare to wait for buffers to empty
X WRITE_UNLOCK_IRQRESTORE(lock_var_p,flags);
X serviceOutgoingFifo(pB); // Dump what we got
@@ -649,9 +669,8 @@
X return 0; // Wake up! Time to die!!!
X }
X
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_QUEUE, 4, 0 );
-#endif
+ ip2trace (CHANN, ITRC_QUEUE, 4, 0 );
+
X } // end of for(;;)
X
X // At this point we have room and the lock - stick them in.
@@ -673,9 +692,9 @@
X // pCs->cmd[0].
X if (pCs == CMD_BMARK_REQ) {
X pCh->bookMarks++;
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_DRAIN, 30, 1, pCh->bookMarks );
-#endif
+
X }
X cnt = pCs->length;
X
@@ -683,9 +702,9 @@
X // if the last command had to be at the end of a block, we end
X // the existing block here and start a new one.
X if ((blocksize + cnt > maxBlock) || lastended) {
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_QUEUE, 5, 0 );
-#endif
+
X PTYPE_OF(pInsert) = type;
X CHANNEL_OF(pInsert) = channel;
X // count here does not include the header
@@ -747,9 +766,9 @@
X i2QueueNeeds(pB, pCh, NEED_BYPASS);


X break;
X }
-#ifdef IP2DEBUG_TRACE
+

X ip2trace (CHANN, ITRC_QUEUE, ITRC_RETURN, 1, nCommands );
-#endif
+
X return nCommands; // Good status: number of commands sent
X }
X
@@ -772,9 +791,7 @@
X unsigned short status;


X i2eBordStrPtr pB;
X
-#ifdef IP2DEBUG_TRACE

X ip2trace (CHANN, ITRC_STATUS, ITRC_ENTER, 2, pCh->dataSetIn, resetBits );
-#endif
X
X // Make sure the channel exists, otherwise do nothing */
X if ( !i2Validate ( pCh ) )
@@ -792,9 +809,7 @@
X pCh->dataSetIn &= ~(I2_DDCD | I2_DCTS | I2_DDSR | I2_DRI);
X }
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_STATUS, ITRC_RETURN, 1, pCh->dataSetIn );
-#endif
X
X return status;
X }
@@ -819,9 +834,7 @@
X int count;
X unsigned long flags = 0;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_INPUT, ITRC_ENTER, 0);
-#endif
X
X // Ensure channel structure seems real
X if ( !i2Validate( pCh ) ) {
@@ -887,9 +900,8 @@
X
X i2Input_exit:
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_INPUT, ITRC_RETURN, 1, count);
-#endif
+
X return count;
X }
X
@@ -913,9 +925,7 @@
X if ( !i2Validate ( pCh ) )
X return -1;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_INPUT, 10, 0);
-#endif
X
X WRITE_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags);
X count = pCh->Ibuf_stuff - pCh->Ibuf_strip;
@@ -943,9 +953,9 @@
X } else {
X WRITE_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags);
X }
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_INPUT, 19, 1, count);
-#endif
+
X return count;
X }
X
@@ -1015,9 +1025,7 @@
X
X int bailout = 10;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_OUTPUT, ITRC_ENTER, 2, count, user );
-#endif
X
X // Ensure channel structure seems real
X if ( !i2Validate ( pCh ) )
@@ -1064,9 +1072,8 @@
X // Small WINDOW here with no LOCK but I can't call Flush with LOCK
X // We would be flushing (or ending flush) anyway
X
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 10, 1, amountToMove );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 10, 1, amountToMove );
+
X if ( !(pCh->flush_flags && i2RetryFlushOutput(pCh) )
X && amountToMove > 0 )
X {
@@ -1104,9 +1111,7 @@
X
X WRITE_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags);
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_OUTPUT, 13, 1, stuffIndex );
-#endif
X
X } else {
X
@@ -1114,25 +1119,23 @@
X // becuz we need to stuff a flush
X // or amount to move is <= 0
X
-#ifdef IP2DEBUG_TRACE
X ip2trace(CHANN, ITRC_OUTPUT, 14, 3,
- amountToMove, pB->i2eFifoRemains, pB->i2eWaitingForEmptyFifo );
-#endif
+ amountToMove, pB->i2eFifoRemains,
+ pB->i2eWaitingForEmptyFifo );
+
X // Put this channel back on queue
X // this ultimatly gets more data or wakes write output
X i2QueueNeeds(pB, pCh, NEED_INLINE);
X
X if ( pB->i2eWaitingForEmptyFifo ) {
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_OUTPUT, 16, 0 );
-#endif
+
X // or schedule
X if (!in_interrupt()) {
X
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 61, 0 );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 61, 0 );
+
X current->state = TASK_INTERRUPTIBLE;
X schedule_timeout(2);
X if (signal_pending(current)) {


@@ -1140,9 +1143,9 @@
X }

X continue;
X } else {
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 62, 0 );
-#endif
+
+ ip2trace (CHANN, ITRC_OUTPUT, 62, 0 );
+
X // let interrupt in = WAS restore_flags()
X // We hold no lock nor is irq off anymore???
X
@@ -1152,31 +1155,31 @@
X }
X else if ( pB->i2eFifoRemains < 32 && !pB->i2eTxMailEmpty ( pB ) )
X {
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 19, 2, pB->i2eFifoRemains,
- pB->i2eTxMailEmpty );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 19, 2,
+ pB->i2eFifoRemains,
+ pB->i2eTxMailEmpty );
+
X break; // from while(count)
X } else if ( pCh->channelNeeds & NEED_CREDIT ) {
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_OUTPUT, 22, 0 );
-#endif
+
X break; // from while(count)
X } else if ( --bailout) {
X
X // Try to throw more things (maybe not us) in the fifo if we're
X // not already waiting for it.
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_OUTPUT, 20, 0 );
-#endif
+
X serviceOutgoingFifo(pB);
X //break; CONTINUE;
X } else {
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 21, 3, pB->i2eFifoRemains,
- pB->i2eOutMailWaiting, pB->i2eWaitingForEmptyFifo );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 21, 3,
+ pB->i2eFifoRemains,
+ pB->i2eOutMailWaiting,
+ pB->i2eWaitingForEmptyFifo );
+
X break; // from while(count)
X }
X }
@@ -1187,14 +1190,13 @@
X // We drop through either when the count expires, or when there is some
X // count left, but there was a non-blocking write.
X if (countOriginal > count) {
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_OUTPUT, 17, 2, countOriginal, count );
-#endif
+
X serviceOutgoingFifo( pB );
X }
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_OUTPUT, ITRC_RETURN, 2, countOriginal, count );
-#endif
X
X return countOriginal - count;
X }
@@ -1213,23 +1215,20 @@
X i2FlushOutput(i2ChanStrPtr pCh)
X {
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_FLUSH, 1, 1, pCh->flush_flags );
-#endif
X
X if (pCh->flush_flags)
X return;
X
X if ( 1 != i2QueueCommands(PTYPE_BYPASS, pCh, 0, 1, CMD_STARTFL) ) {
X pCh->flush_flags = STARTFL_FLAG; // Failed - flag for later
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_FLUSH, 2, 0 );
-#endif
+
X } else if ( 1 != i2QueueCommands(PTYPE_INLINE, pCh, 0, 1, CMD_STOPFL) ) {
X pCh->flush_flags = STOPFL_FLAG; // Failed - flag for later
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_FLUSH, 3, 0 );
-#endif
X }
X }
X
@@ -1238,9 +1237,7 @@
X {
X int old_flags = pCh->flush_flags;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_FLUSH, 14, 1, old_flags );
-#endif
X
X pCh->flush_flags = 0; // Clear flag so we can avoid recursion
X // and queue the commands
@@ -1251,23 +1248,21 @@
X } else {
X old_flags = STARTFL_FLAG; //Failure - Flag for retry later
X }
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_FLUSH, 15, 1, old_flags );
-#endif
+
X }
X if ( old_flags & STOPFL_FLAG ) {
X if ( 1 == i2QueueCommands(PTYPE_INLINE, pCh, 0, 1, CMD_STOPFL) > 0 ) {
X old_flags = 0; // Success - clear flags
X }
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_FLUSH, 16, 1, old_flags );
-#endif
X }
- pCh->flush_flags = old_flags;
+ pCh->flush_flags = old_flags;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_FLUSH, 17, 1, old_flags );
-#endif
+
X return old_flags;
X }
X
@@ -1284,9 +1279,8 @@
X static void
X i2DrainWakeup(i2ChanStrPtr pCh)
X {
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_DRAIN, 10, 1, pCh->BookmarkTimer.expires );
-#endif
+
X pCh->BookmarkTimer.expires = 0;
X wake_up_interruptible( &pCh->pBookmarkWait );
X }
@@ -1294,11 +1288,11 @@
X static void
X i2DrainOutput(i2ChanStrPtr pCh, int timeout)
X {
+ wait_queue_t wait;


X i2eBordStrPtr pB;
X
-#ifdef IP2DEBUG_TRACE

X ip2trace (CHANN, ITRC_DRAIN, ITRC_ENTER, 1, pCh->BookmarkTimer.expires);
-#endif
+
X pB = pCh->pMyBord;
X // If the board has gone fatal, return bad,
X // and also hit the trap routine if it exists.
@@ -1315,31 +1309,35 @@
X pCh->BookmarkTimer.function = (void*)(unsigned long)i2DrainWakeup;
X pCh->BookmarkTimer.data = (unsigned long)pCh;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_DRAIN, 1, 1, pCh->BookmarkTimer.expires );
-#endif
X
X add_timer( &(pCh->BookmarkTimer) );
X }
X
X i2QueueCommands( PTYPE_INLINE, pCh, -1, 1, CMD_BMARK_REQ );
+
+ init_waitqueue_entry(&wait, current);
+ add_wait_queue(&(pCh->pBookmarkWait), &wait);


+ set_current_state( TASK_INTERRUPTIBLE );
+

X serviceOutgoingFifo( pB );
X
- interruptible_sleep_on( &(pCh->pBookmarkWait) );
+ schedule(); // Now we take our interruptible sleep on
+
+ // Clean up the queue
+ set_current_state( TASK_RUNNING );
+ remove_wait_queue(&(pCh->pBookmarkWait), &wait);
X
X // if expires == 0 then timer poped, then do not need to del_timer
X if ((timeout > 0) && pCh->BookmarkTimer.expires &&
X (pCh->BookmarkTimer.expires > jiffies)) {
X del_timer( &(pCh->BookmarkTimer) );
X pCh->BookmarkTimer.expires = 0;
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_DRAIN, 3, 1, pCh->BookmarkTimer.expires );
-#endif
X
X }
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_DRAIN, ITRC_RETURN, 1, pCh->BookmarkTimer.expires );
-#endif
X return;
X }
X
@@ -1384,17 +1382,17 @@
X
X pCh = tp->driver_data;
X
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_SICMD, 10, 2, tp->flags, (1 << TTY_DO_WRITE_WAKEUP) );
-#endif
+ ip2trace (CHANN, ITRC_SICMD, 10, 2, tp->flags,
+ (1 << TTY_DO_WRITE_WAKEUP) );
+
X wake_up_interruptible ( &tp->write_wait );
X if ( ( tp->flags & (1 << TTY_DO_WRITE_WAKEUP) )
X && tp->ldisc.write_wakeup )
X {
X (tp->ldisc.write_wakeup) ( tp );
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_SICMD, 11, 0 );
-#endif
+
X }
X }
X
@@ -1480,14 +1478,11 @@
X unsigned char dss_change;
X unsigned long bflags,cflags;
X
-#ifdef IP2DEBUG_TRACE
- //ip2trace (ITRC_NO_PORT, ITRC_SFIFO, ITRC_ENTER, 0 );
-#endif
+// ip2trace (ITRC_NO_PORT, ITRC_SFIFO, ITRC_ENTER, 0 );
X
X while (HAS_INPUT(pB)) {
-#ifdef IP2DEBUG_TRACE
- //ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 2, 0 );
-#endif
+// ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 2, 0 );
+
X // Process packet from fifo a one atomic unit
X WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock,bflags);
X
@@ -1500,9 +1495,8 @@
X case PTYPE_DATA:
X pB->got_input = 1;
X
-#ifdef IP2DEBUG_TRACE
- //ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 3, 0 );
-#endif
+// ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 3, 0 );
+
X channel = CHANNEL_OF(pB->i2eLeadoffWord); /* Store channel */
X count = iiReadWord(pB); /* Count is in the next word */
X
@@ -1602,9 +1596,7 @@
X break; // From switch: ready for next packet
X
X case PTYPE_STATUS:
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 4, 0 );
-#endif
X
X count = CMD_COUNT_OF(pB->i2eLeadoffWord);
X
@@ -1617,9 +1609,9 @@
X
X while (pc < pcLimit) {
X channel = *pc++;
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (channel, ITRC_SFIFO, 7, 2, channel, *pc );
-#endif
+
X /* check for valid channel */
X if (channel < pB->i2eChannelCnt
X &&
@@ -1652,41 +1644,32 @@
X break;
X
X case STAT_DCD_UP:
-#ifdef IP2DEBUG_TRACE
X ip2trace (channel, ITRC_MODEM, 1, 1, pCh->dataSetIn );
-#endif
+
X if ( !(pCh->dataSetIn & I2_DCD) )
X {
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_MODEM, 2, 0 );
-#endif
X pCh->dataSetIn |= I2_DDCD;
X pCh->icount.dcd++;
X dss_change = 1;
X }
X pCh->dataSetIn |= I2_DCD;
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (channel, ITRC_MODEM, 3, 1, pCh->dataSetIn );
-#endif
X break;
X
X case STAT_DCD_DN:
-#ifdef IP2DEBUG_TRACE
X ip2trace (channel, ITRC_MODEM, 4, 1, pCh->dataSetIn );
-#endif
X if ( pCh->dataSetIn & I2_DCD )
X {
-#ifdef IP2DEBUG_TRACE
X ip2trace (channel, ITRC_MODEM, 5, 0 );
-#endif
X pCh->dataSetIn |= I2_DDCD;
X pCh->icount.dcd++;
X dss_change = 1;
X }
X pCh->dataSetIn &= ~I2_DCD;
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (channel, ITRC_MODEM, 6, 1, pCh->dataSetIn );
-#endif
X break;
X
X case STAT_DSR_UP:
@@ -1742,9 +1725,8 @@
X if (pCh->bookMarks <= 0 ) {
X pCh->bookMarks = 0;
X wake_up_interruptible( &pCh->pBookmarkWait );
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (channel, ITRC_DRAIN, 20, 1, pCh->BookmarkTimer.expires );
-#endif
X }
X break;
X
@@ -1754,22 +1736,21 @@
X pCh->outfl.room =
X ((flowStatPtr)pc)->room -
X (pCh->outfl.asof - ((flowStatPtr)pc)->asof);
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (channel, ITRC_STFLW, 1, 1, pCh->outfl.room );
-#endif
+
X if (pCh->channelNeeds & NEED_CREDIT)
X {
-#ifdef IP2DEBUG_TRACE
- ip2trace (channel, ITRC_STFLW, 2, 1, pCh->channelNeeds);
-#endif
+ ip2trace (channel, ITRC_STFLW, 2, 1, pCh->channelNeeds);
+
X pCh->channelNeeds &= ~NEED_CREDIT;
X i2QueueNeeds(pB, pCh, NEED_INLINE);
X if ( pCh->pTTY )
X ip2_owake(pCh->pTTY);
X }
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (channel, ITRC_STFLW, 3, 1, pCh->channelNeeds);
-#endif
+
X pc += sizeof(flowStat);
X break;
X
@@ -1865,16 +1846,15 @@
X break;
X
X default: // Neither packet? should be impossible
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 5, 1,
X PTYPE_OF(pB->i2eLeadoffWord) );
-#endif
+
X break;
X } // End of switch on type of packets
X } //while(board HAS_INPUT)
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (ITRC_NO_PORT, ITRC_SFIFO, ITRC_RETURN, 0 );
-#endif
+
X // Send acknowledgement to the board even if there was no data!
X pB->i2eOutMailWaiting |= MB_IN_STRIPPED;
X return;
@@ -1992,9 +1972,8 @@
X i2ChanStrPtr pCh;
X unsigned short paddedSize = ROUNDUP(sizeof(flowIn));
X
-#ifdef IP2DEBUG_TRACE
-ip2trace (ITRC_NO_PORT, ITRC_SFLOW, ITRC_ENTER, 2, pB->i2eFifoRemains, paddedSize );
-#endif
+ ip2trace (ITRC_NO_PORT, ITRC_SFLOW, ITRC_ENTER, 2,
+ pB->i2eFifoRemains, paddedSize );
X
X // Continue processing so long as there are entries, or there is room in the
X // fifo. Each entry represents a channel with something to do.
@@ -2006,14 +1985,12 @@
X break;
X }
X #ifdef DEBUG_FIFO
-WriteDBGBuf("FLOW",(unsigned char *) &(pCh->infl), paddedSize);
+ WriteDBGBuf("FLOW",(unsigned char *) &(pCh->infl), paddedSize);
X #endif /* DEBUG_FIFO */
X
X } // Either clogged or finished all the work
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_SFLOW, ITRC_RETURN, 0 );
-#endif
X }
X
X //******************************************************************************
@@ -2041,10 +2018,8 @@
X int bailout = 1000;
X int bailout2;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_SICMD, ITRC_ENTER, 3, pB->i2eFifoRemains,
X pB->i2Dbuf_strip, pB->i2Dbuf_stuff );
-#endif
X
X // Continue processing so long as there are entries, or there is room in the
X // fifo. Each entry represents a channel with something to do.
@@ -2054,9 +2029,8 @@
X WRITE_LOCK_IRQSAVE(&pCh->Obuf_spinlock,flags);
X stripIndex = pCh->Obuf_strip;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_SICMD, 3, 2, stripIndex, pCh->Obuf_stuff );
-#endif
+
X // as long as there are packets for this channel...
X bailout2 = 1000;
X while ( --bailout2 && stripIndex != pCh->Obuf_stuff) {
@@ -2075,16 +2049,15 @@
X flowsize = CREDIT_USAGE(flowsize);
X paddedSize = ROUNDUP(packetSize);
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (CHANN, ITRC_SICMD, 4, 2, pB->i2eFifoRemains, paddedSize );
-#endif
+
X // If we don't have enough credits from the board to send the data,
X // flag the channel that we are waiting for flow control credit, and
X // break out. This will clean up this channel and remove us from the
X // queue of hot things to do.
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_SICMD, 5, 2, pCh->outfl.room, flowsize );
-#endif
+
X if (pCh->outfl.room <= flowsize) {
X // Do Not have the credits to send this packet.
X i2QueueNeeds(pB, pCh, NEED_CREDIT);
@@ -2112,15 +2085,15 @@
X }
X pRemove += packetSize;
X stripIndex += packetSize;
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_SICMD, 6, 2, stripIndex, pCh->Obuf_strip);
-#endif
+
X if (stripIndex >= OBUF_SIZE) {
X stripIndex = 0;
X pRemove = pCh->Obuf;
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_SICMD, 7, 1, stripIndex );
-#endif
+
X }
X } /* while */
X if ( !bailout2 ) {
@@ -2132,23 +2105,20 @@
X WRITE_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags);
X if ( notClogged )
X {
-#ifdef IP2DEBUG_TRACE
+
X ip2trace (CHANN, ITRC_SICMD, 8, 0 );
-#endif
+
X if ( pCh->pTTY ) {
X ip2_owake(pCh->pTTY);
X }
X }
X } // Either clogged or finished all the work
-#ifdef IP2DEBUG_TRACE
+
X if ( !bailout ) {
X ip2trace (ITRC_NO_PORT, ITRC_ERROR, 4, 0 );
X }
-#endif
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_SICMD, ITRC_RETURN, 1,pB->i2Dbuf_strip);
-#endif
X }
X
X //******************************************************************************
@@ -2212,11 +2182,13 @@


X unsigned long flags;
X

X
- inmail = iiGetMail(pB);
+ /* This should be atomic because of the way we are called... */
+ if (NO_MAIL_HERE == ( inmail = pB->i2eStartMail ) ) {
+ inmail = iiGetMail(pB);
+ }
+ pB->i2eStartMail = NO_MAIL_HERE;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_INTR, 2, 1, inmail );
-#endif
X
X if (inmail != NO_MAIL_HERE) {
X // If the board has gone fatal, nothing to do but hit a bit that will
@@ -2238,16 +2210,14 @@
X pB->i2eFifoRemains = pB->i2eFifoSize;
X pB->i2eWaitingForEmptyFifo = 0;
X WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags);
-#ifdef IP2DEBUG_TRACE
- ip2trace (ITRC_NO_PORT, ITRC_INTR, 30, 1, pB->i2eFifoRemains );
-#endif
+
+ ip2trace (ITRC_NO_PORT, ITRC_INTR, 30, 1, pB->i2eFifoRemains );
+
X }
X serviceOutgoingFifo(pB);
X }
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_INTR, 8, 0 );
-#endif
X
X exit_i2ServiceBoard:
X
diff -u --recursive --new-file v2.4.13/linux/drivers/char/ip2/i2lib.h linux/drivers/char/ip2/i2lib.h
--- v2.4.13/linux/drivers/char/ip2/i2lib.h Fri Feb 16 16:02:35 2001
+++ linux/drivers/char/ip2/i2lib.h Fri Nov 2 17:26:17 2001
@@ -341,6 +341,12 @@
X static int i2ServiceBoard(i2eBordStrPtr);
X static void i2DrainOutput(i2ChanStrPtr, int);
X
+#ifdef IP2DEBUG_TRACE
+void ip2trace(unsigned short,unsigned char,unsigned char,unsigned long,...);
+#else
+#define ip2trace(a,b,c,d...) do {} while (0)
+#endif
+
X // Argument to i2QueueCommands
X //
X #define C_IN_LINE 1
diff -u --recursive --new-file v2.4.13/linux/drivers/char/ip2/ip2.h linux/drivers/char/ip2/ip2.h
--- v2.4.13/linux/drivers/char/ip2/ip2.h Sat Nov 6 10:38:40 1999
+++ linux/drivers/char/ip2/ip2.h Wed Oct 24 12:05:18 2001
@@ -94,10 +94,20 @@
X * /etc/modules.conf and load with modprobe, kerneld or kmod, the kernel
X * module loader
X */
+
+ /* This structure is NOW always initialized when the driver is initialized.
+ * Compiled in defaults MUST be added to the io and irq arrays in
+ * ip2.c. Those values are configurable from insmod parameters in the
+ * case of modules or from command line parameters (ip2=io,irq) when
+ * compiled in.
+ */
+
X static ip2config_t ip2config =
X {
X {0,0,0,0}, // irqs
X { // Addresses
+ /* Do NOT set compile time defaults HERE! Use the arrays in
+ ip2.c! These WILL be overwritten! =mhw= */
X 0x0000, // Board 0, ttyF0 - ttyF63
X 0x0000, // Board 1, ttyF64 - ttyF127
X 0x0000, // Board 2, ttyF128 - ttyF191
diff -u --recursive --new-file v2.4.13/linux/drivers/char/ip2.c linux/drivers/char/ip2.c
--- v2.4.13/linux/drivers/char/ip2.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/char/ip2.c Wed Oct 24 12:05:18 2001
@@ -27,10 +27,15 @@
X int
X ip2_loadmain(int *, int *, unsigned char *, int ); // ref into ip2main.c
X
-#ifdef MODULE
+/* Note: Add compiled in defaults to these arrays, not to the structure
+ in ip2/ip2.h any longer. That structure WILL get overridden
+ by these values, or command line values, or insmod values!!! =mhw=
+*/
+static int io[IP2_MAX_BOARDS]= { 0, 0, 0, 0 };
+static int irq[IP2_MAX_BOARDS] = { -1, -1, -1, -1 };
+static int poll_only = 0;
X
-static int io[IP2_MAX_BOARDS]= { 0,};
-static int irq[IP2_MAX_BOARDS] = { 0,};
+#ifdef MODULE
X
X # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
X MODULE_AUTHOR("Doug McNash");
@@ -39,6 +44,8 @@
X MODULE_PARM_DESC(irq,"Interrupts for IntelliPort Cards");
X MODULE_PARM(io,"1-"__MODULE_STRING(IP2_MAX_BOARDS) "i");
X MODULE_PARM_DESC(io,"I/O ports for IntelliPort Cards");
+ MODULE_PARM(poll_only,"1i");
+ MODULE_PARM_DESC(poll_only,"Do not use card interrupts");
X # endif /* LINUX_VERSION */
X
X
@@ -50,6 +57,11 @@
X
X MOD_INC_USE_COUNT; // hold till done
X
+ if( poll_only ) {
+ /* Hard lock the interrupts to zero */
+ irq[0] = irq[1] = irq[2] = irq[3] = 0;
+ }
+
X rc = ip2_loadmain(io,irq,(unsigned char *)fip_firm,sizeof(fip_firm));
X // The call to lock and load main, create dep
X
@@ -61,7 +73,7 @@
X int
X ip2_init(void)
X {
- // call to this is int tty_io.c so we need this
+ // call to this is in tty_io.c so we need this


X return 0;
X }
X

@@ -79,9 +91,61 @@
X # define NULL ((void *) 0)
X #endif
X
+/******************************************************************************
+ * ip2_setup:
+ * str: kernel command line string
+ *
+ * Can't autoprobe the boards so user must specify configuration on
+ * kernel command line. Sane people build it modular but the others
+ * come here.
+ *
+ * Alternating pairs of io,irq for up to 4 boards.
+ * ip2=io0,irq0,io1,irq1,io2,irq2,io3,irq3
+ *
+ * io=0 => No board
+ * io=1 => PCI
+ * io=2 => EISA
+ * else => ISA I/O address
+ *
+ * irq=0 or invalid for ISA will revert to polling mode
+ *
+ * Any value = -1, do not overwrite compiled in value.
+ *
+ ******************************************************************************/
+static int __init ip2_setup(char *str)
+{
+ int ints[10]; /* 4 boards, 2 parameters + 2 */
+ int i, j;


+
+ str = get_options (str, ARRAY_SIZE(ints), ints);
+

+ for( i = 0, j = 1; i < 4; i++ ) {
+ if( j > ints[0] ) {
+ break;
+ }
+ if( ints[j] >= 0 ) {
+ io[i] = ints[j];
+ }
+ j++;
+ if( j > ints[0] ) {
+ break;
+ }
+ if( ints[j] >= 0 ) {
+ irq[i] = ints[j];
+ }
+ j++;


+ }
+ return 1;
+}
+

X int
X ip2_init(void) {
- return ip2_loadmain(NULL,NULL,(unsigned char *)fip_firm,sizeof(fip_firm));
+ return ip2_loadmain(io,irq,(unsigned char *)fip_firm,sizeof(fip_firm));
X }
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13))
+__setup("ip2=", ip2_setup);
+__initcall(ip2_init);
+#endif
X
X #endif /* !MODULE */
diff -u --recursive --new-file v2.4.13/linux/drivers/char/ip2main.c linux/drivers/char/ip2main.c
--- v2.4.13/linux/drivers/char/ip2main.c Tue Oct 23 22:48:50 2001
+++ linux/drivers/char/ip2main.c Fri Nov 2 17:26:17 2001
@@ -12,8 +12,42 @@
X *******************************************************************************/
X // ToDo:
X //
+// Fix the immediate DSS_NOW problem.
+// Work over the channel stats return logic in ip2_ipl_ioctl so they
+// make sense for all 256 possible channels and so the user space
+// utilities will compile and work properly.
+//
X // Done:
X //
+// 1.2.14 /\/\|=mhw=|\/\/
+// Added bounds checking to ip2_ipl_ioctl to avoid potential terroristic acts.
+// Changed the definition of ip2trace to be more consistant with kernel style
+// Thanks to Andreas Dilger <adi...@turbolabs.com> for these updates
+//
+// 1.2.13 /\/\|=mhw=|\/\/
+// DEVFS: Renamed ttf/{n} to tts/F{n} and cuf/{n} to cua/F{n} to conform
+// to agreed devfs serial device naming convention.
+//
+// 1.2.12 /\/\|=mhw=|\/\/
+// Cleaned up some remove queue cut and paste errors
+//
+// 1.2.11 /\/\|=mhw=|\/\/
+// Clean up potential NULL pointer dereferences
+// Clean up devfs registration
+// Add kernel command line parsing for io and irq
+// Compile defaults for io and irq are now set in ip2.c not ip2/ip2.h!
+// Reworked poll_only hack for explicit parameter setting
+// You must now EXPLICITLY set poll_only = 1 or set all irqs to 0
+// Merged ip2_loadmain and old_ip2_init
+// Converted all instances of interruptible_sleep_on into queue calls
+// Most of these had no race conditions but better to clean up now
+//
+// 1.2.10 /\/\|=mhw=|\/\/
+// Fixed the bottom half interrupt handler and enabled USE_IQI
+// to split the interrupt handler into a formal top-half / bottom-half
+// Fixed timing window on high speed processors that queued messages to
+// the outbound mail fifo faster than the board could handle.
+//
X // 1.2.9
X // Four box EX was barfing on >128k kmalloc, made structure smaller by
X // reducing output buffer size


@@ -193,13 +227,13 @@
X

X /* String constants to identify ourselves */
X static char *pcName = "Computone IntelliPort Plus multiport driver";
-static char *pcVersion = "1.2.9";
+static char *pcVersion = "1.2.14";
X
X /* String constants for port names */
X static char *pcDriver_name = "ip2";
X #ifdef CONFIG_DEVFS_FS
-static char *pcTty = "ttf/%d";
-static char *pcCallout = "cuf/%d";
+static char *pcTty = "tts/F%d";
+static char *pcCallout = "cua/F%d";
X #else
X static char *pcTty = "ttyF";
X static char *pcCallout = "cuf";
@@ -225,8 +259,6 @@
X void cleanup_module(void);
X #endif
X
-int old_ip2_init(void);
-
X /* Private (static) functions */
X static int ip2_open(PTTY, struct file *);
X static void ip2_close(PTTY, struct file *);
@@ -246,6 +278,7 @@
X static void ip2_hangup(PTTY);
X
X static void set_irq(int, int);
+static void ip2_interrupt_bh(i2eBordStrPtr pB);
X static void ip2_interrupt(int irq, void *dev_id, struct pt_regs * regs);
X static void ip2_poll(unsigned long arg);
X static inline void service_all_boards(void);
@@ -268,7 +301,6 @@
X static int ip2_ipl_ioctl(struct inode *, struct file *, UINT, ULONG);
X static int ip2_ipl_open(struct inode *, struct file *);
X
-void ip2trace(unsigned short,unsigned char,unsigned char,unsigned long,...);
X static int DumpTraceBuffer(char *, int);
X static int DumpFifoBuffer( char *, int);
X
@@ -310,11 +342,11 @@
X open: ip2_ipl_open,
X };
X
-static long irq_counter;
-static long bh_counter;
+static unsigned long irq_counter = 0;
+static unsigned long bh_counter = 0;
X
X // Use immediate queue to service interrupts
-//#define USE_IQI // PCI&2.2 needs work
+#define USE_IQI
X //#define USE_IQ // PCI&2.2 needs work
X
X /* The timer_list entry for our poll routine. If interrupt operation is not
@@ -364,7 +396,7 @@
X # endif /* LINUX_VERSION */
X #endif /* MODULE */
X
-static int poll_only;
+static int poll_only = 0;
X
X static int Eisa_irq;
X static int Eisa_slot;
@@ -373,32 +405,6 @@
X static char rirqs[IP2_MAX_BOARDS];
X static int Valid_Irqs[] = { 3, 4, 5, 7, 10, 11, 12, 15, 0};
X
-/******************************************************************************/
-/* Initialisation Section */
-/******************************************************************************/
-int
-ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
-{
- int i;
- /* process command line arguments to modprobe or insmod i.e. iop & irqp */
- /* otherwise ip2config is initialized by what's in ip2/ip2.h */
- /* command line trumps initialization in ip2.h */
- /* first two args are null if builtin to kernel */
- if ((irqp != NULL) || (iop != NULL)) {
- for ( i = 0; i < IP2_MAX_BOARDS; ++i ) {
- if (irqp && irqp[i]) {
- ip2config.irq[i] = irqp[i];
- }
- if (iop && iop[i]) {
- ip2config.addr[i] = iop[i];
- }
- }
- }
- Fip_firmware = firmware;
- Fip_firmware_size = firmsize;
- return old_ip2_init();
-}
-
X // Some functions to keep track of what irq's we have


X
X static int __init

@@ -461,7 +467,6 @@
X #ifdef IP2DEBUG_INIT
X printk (KERN_DEBUG "Loading module ...\n" );
X #endif
- //was return old_ip2_init();
X return 0;
X }
X #endif /* MODULE */
@@ -559,8 +564,9 @@
X #endif /* MODULE */
X
X /******************************************************************************/
-/* Function: old_ip2_init() */
+/* Function: ip2_loadmain() */
X /* Parameters: irq, io from command line of insmod et. al. */
+/* pointer to fip firmware and firmware size for boards */
X /* Returns: Success (0) */
X /* */
X /* Description: */
@@ -575,7 +581,7 @@
X #define IP2_SA_FLAGS 0
X
X int __init
-old_ip2_init(void)
+ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
X {
X #ifdef CONFIG_DEVFS_FS
X static devfs_handle_t devfs_handle;
@@ -588,9 +594,40 @@
X i2eBordStrPtr pB = NULL;
X int rc = -1;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_INIT, ITRC_ENTER, 0 );
-#endif
+
+ /* process command line arguments to modprobe or
+ insmod i.e. iop & irqp */
+ /* irqp and iop should ALWAYS be specified now... But we check
+ them individually just to be sure, anyways... */
+ for ( i = 0; i < IP2_MAX_BOARDS; ++i ) {
+ if (iop) {
+ ip2config.addr[i] = iop[i];
+ if (irqp) {
+ if( irqp[i] >= 0 ) {
+ ip2config.irq[i] = irqp[i];
+ } else {
+ ip2config.irq[i] = 0;
+ }
+ // This is a little bit of a hack. If poll_only=1 on command
+ // line back in ip2.c OR all IRQs on all specified boards are
+ // explicitly set to 0, then drop to poll only mode and override
+ // PCI or EISA interrupts. This superceeds the old hack of
+ // triggering if all interrupts were zero (like da default).
+ // Still a hack but less prone to random acts of terrorism.
+ //
+ // What we really should do, now that the IRQ default is set
+ // to -1, is to use 0 as a hard coded, do not probe.
+ //
+ // /\/\|=mhw=|\/\/
+ poll_only |= irqp[i];
+ }
+ }
+ }
+ poll_only = !poll_only;
+
+ Fip_firmware = firmware;
+ Fip_firmware_size = firmsize;
X
X /* Announce our presence */
X printk( KERN_INFO "%s version %s\n", pcName, pcVersion );
@@ -604,12 +641,6 @@
X }
X loaded++;
X
- /* if all irq config is zero we shall poll_only */
- for ( i = 0; i < IP2_MAX_BOARDS; ++i ) {
- poll_only |= ip2config.irq[i];
- }
- poll_only = !poll_only;
-
X /* Initialise the iiEllis subsystem. */
X iiEllisInit();
X
@@ -672,10 +703,13 @@
X pcibios_read_config_byte(pci_bus, pci_devfn,
X PCI_INTERRUPT_LINE, &pci_irq);
X
- if (!is_valid_irq(pci_irq)) {
- printk( KERN_ERR "IP2: Bad PCI BIOS IRQ(%d)\n",pci_irq);
- pci_irq = 0;
- }
+// If the PCI BIOS assigned it, lets try and use it. If we
+// can't acquire it or it screws up, deal with it then.
+
+// if (!is_valid_irq(pci_irq)) {
+// printk( KERN_ERR "IP2: Bad PCI BIOS IRQ(%d)\n",pci_irq);
+// pci_irq = 0;
+// }
X ip2config.irq[i] = pci_irq;
X } else { // ann error
X ip2config.addr[i] = 0;
@@ -706,10 +740,13 @@
X status =
X pci_read_config_byte(pci_dev_i, PCI_INTERRUPT_LINE, &pci_irq);
X
- if (!is_valid_irq(pci_irq)) {
- printk( KERN_ERR "IP2: Bad PCI BIOS IRQ(%d)\n",pci_irq);
- pci_irq = 0;
- }
+// If the PCI BIOS assigned it, lets try and use it. If we
+// can't acquire it or it screws up, deal with it then.
+
+// if (!is_valid_irq(pci_irq)) {
+// printk( KERN_ERR "IP2: Bad PCI BIOS IRQ(%d)\n",pci_irq);
+// pci_irq = 0;
+// }
X ip2config.irq[i] = pci_irq;
X } else { // ann error
X ip2config.addr[i] = 0;
@@ -761,9 +798,7 @@


X }
X }
X
-#ifdef IP2DEBUG_TRACE

X ip2trace (ITRC_NO_PORT, ITRC_INIT, 2, 0 );
-#endif
X
X /* Zero out the normal tty device structure. */
X memset ( &ip2_tty_driver, 0, sizeof ip2_tty_driver );
@@ -822,9 +857,7 @@
X ip2_callout_driver.major = IP2_CALLOUT_MAJOR;
X ip2_callout_driver.subtype = SERIAL_TYPE_CALLOUT;
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_INIT, 3, 0 );
-#endif
X
X /* Register the tty devices. */
X if ( ( err = tty_register_driver ( &ip2_tty_driver ) ) ) {
@@ -847,9 +880,7 @@
X printk(KERN_ERR "IP2: failed to register read_procmem\n");
X } else {
X
-#ifdef IP2DEBUG_TRACE
X ip2trace (ITRC_NO_PORT, ITRC_INIT, 4, 0 );
-#endif
X /* Register the interrupt handler or poll handler, depending upon the
X * specified interrupt.
X */
@@ -868,41 +899,45 @@
X }
X
X #ifdef CONFIG_DEVFS_FS
- sprintf( name, "ipl%d", i );
- i2BoardPtrTable[i]->devfs_ipl_handle =
- devfs_register (devfs_handle, name,
- DEVFS_FL_DEFAULT,
- IP2_IPL_MAJOR, 4 * i,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
- &ip2_ipl, NULL);
-
- sprintf( name, "stat%d", i );
- i2BoardPtrTable[i]->devfs_stat_handle =
- devfs_register (devfs_handle, name,
- DEVFS_FL_DEFAULT,
- IP2_IPL_MAJOR, 4 * i + 1,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
- &ip2_ipl, NULL);
+ if ( NULL != ( pB = i2BoardPtrTable[i] ) ) {
+ sprintf( name, "ipl%d", i );
+ pB->devfs_ipl_handle =
+ devfs_register (devfs_handle, name,
+ DEVFS_FL_DEFAULT,
+ IP2_IPL_MAJOR, 4 * i,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
+ &ip2_ipl, NULL);
+
+ sprintf( name, "stat%d", i );
+ pB->devfs_stat_handle =
+ devfs_register (devfs_handle, name,
+ DEVFS_FL_DEFAULT,
+ IP2_IPL_MAJOR, 4 * i + 1,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
+ &ip2_ipl, NULL);
X
- for ( box = 0; box < ABS_MAX_BOXES; ++box )
- {
- for ( j = 0; j < ABS_BIGGEST_BOX; ++j )
+ for ( box = 0; box < ABS_MAX_BOXES; ++box )
X {
- if ( pB->i2eChannelMap[box] & (1 << j) )
- {
- tty_register_devfs(&ip2_tty_driver,
- 0, j + ABS_BIGGEST_BOX *
- (box+i*ABS_MAX_BOXES));
- tty_register_devfs(&ip2_callout_driver,
- 0, j + ABS_BIGGEST_BOX *
- (box+i*ABS_MAX_BOXES));
- }
+ for ( j = 0; j < ABS_BIGGEST_BOX; ++j )
+ {
+ if ( pB->i2eChannelMap[box] & (1 << j) )
+ {
+ tty_register_devfs(&ip2_tty_driver,
+ 0, j + ABS_BIGGEST_BOX *
+ (box+i*ABS_MAX_BOXES));
+ tty_register_devfs(&ip2_callout_driver,
+ 0, j + ABS_BIGGEST_BOX *
+ (box+i*ABS_MAX_BOXES));
+ }
+ }
X }
X }
X #endif
X
X if (poll_only) {
- ip2config.irq[i] = CIR_POLL;
+// Poll only forces driver to only use polling and
+// to ignore the probed PCI or EISA interrupts.
+ ip2config.irq[i] = CIR_POLL;
X }
X if ( ip2config.irq[i] == CIR_POLL ) {
X retry:
@@ -935,9 +970,7 @@


X }
X }
X }
-#ifdef IP2DEBUG_TRACE

X ip2trace (ITRC_NO_PORT, ITRC_INIT, ITRC_RETURN, 0 );
-#endif


X
X return 0;
X }

@@ -963,26 +996,24 @@
X if ( !iiInitialize ( pB ) ) {
X printk ( KERN_ERR "IP2: Failed to initialize board at 0x%x, error %d\n",
X pB->i2eBase, pB->i2eError );
- kfree ( pB );
- i2BoardPtrTable[boardnum] = NULL;
- return;
+ goto err_initialize;
X }
- printk(KERN_INFO "Board %d: addr=0x%x irq=%d ", boardnum + 1,
+ printk(KERN_INFO "IP2: Board %d: addr=0x%x irq=%d\n", boardnum + 1,
X ip2config.addr[boardnum], ip2config.irq[boardnum] );
X
X if (0 != ( rc = check_region( ip2config.addr[boardnum], 8))) {
- i2BoardPtrTable[boardnum] = NULL;
- printk(KERN_ERR "bad addr=0x%x rc = %d\n",
+ printk(KERN_ERR "IP2: bad addr=0x%x rc = %d\n",
X ip2config.addr[boardnum], rc );
- return;
+ goto err_initialize;
X }
X request_region( ip2config.addr[boardnum], 8, pcName );
X
X if ( iiDownloadAll ( pB, (loadHdrStrPtr)Fip_firmware, 1, Fip_firmware_size )
X != II_DOWN_GOOD ) {
- printk ( KERN_ERR "IP2:failed to download loadware " );
+ printk ( KERN_ERR "IP2: failed to download loadware\n" );


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 28'
echo 'File patch-2.4.14 is continued in part 29'
echo "29" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:59 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part36

#!/bin/sh -x
# this is part 36 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 36; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X 0x00, 0x6c, 0xda, 0x18,
@@ -772,63 +778,63 @@
X 0x00, 0x6c, 0xda, 0x24,
X 0x01, 0x65, 0xc8, 0x30,
X 0xe0, 0x6a, 0xcc, 0x00,
- 0x44, 0x6a, 0xe8, 0x5d,
+ 0x44, 0x6a, 0xf4, 0x5d,
X 0x01, 0x90, 0xe2, 0x31,
- 0x04, 0x3b, 0x0c, 0x7e,
+ 0x04, 0x3b, 0x18, 0x7e,
X 0x30, 0x6a, 0xd0, 0x01,
X 0x20, 0x6a, 0xd0, 0x01,
X 0x1d, 0x6a, 0xdc, 0x01,
- 0xdc, 0xee, 0x08, 0x66,
- 0x00, 0x65, 0x24, 0x46,
+ 0xdc, 0xee, 0x14, 0x66,
+ 0x00, 0x65, 0x30, 0x46,
X 0x20, 0x6a, 0xd0, 0x01,
X 0x01, 0x6a, 0xdc, 0x01,
X 0x20, 0xa0, 0xd8, 0x31,
X 0x09, 0xee, 0xdc, 0x01,
- 0x80, 0xee, 0x14, 0x7e,
+ 0x80, 0xee, 0x20, 0x7e,
X 0x11, 0x6a, 0xdc, 0x01,
- 0x50, 0xee, 0x18, 0x66,
+ 0x50, 0xee, 0x24, 0x66,
X 0x20, 0x6a, 0xd0, 0x01,
X 0x09, 0x6a, 0xdc, 0x01,
- 0x88, 0xee, 0x1e, 0x66,
+ 0x88, 0xee, 0x2a, 0x66,
X 0x19, 0x6a, 0xdc, 0x01,
- 0xd8, 0xee, 0x22, 0x66,
+ 0xd8, 0xee, 0x2e, 0x66,
X 0xff, 0x6a, 0xdc, 0x09,
- 0x18, 0xee, 0x26, 0x6e,
+ 0x18, 0xee, 0x32, 0x6e,
X 0xff, 0x6a, 0xd4, 0x0c,
X 0x88, 0x6a, 0xcc, 0x00,
- 0x44, 0x6a, 0xe8, 0x5d,
- 0x20, 0x6a, 0xc6, 0x5d,
+ 0x44, 0x6a, 0xf4, 0x5d,
+ 0x20, 0x6a, 0xd2, 0x5d,
X 0x01, 0x3b, 0x26, 0x31,
- 0x04, 0x3b, 0x40, 0x6e,
+ 0x04, 0x3b, 0x4c, 0x6e,
X 0xa0, 0x6a, 0xca, 0x00,
X 0x20, 0x65, 0xc8, 0x18,
- 0x00, 0x65, 0x7e, 0x5e,
- 0x00, 0x65, 0x38, 0x66,
+ 0x00, 0x65, 0x8a, 0x5e,
+ 0x00, 0x65, 0x44, 0x66,
X 0x0a, 0x93, 0x26, 0x01,
- 0x00, 0x65, 0x8e, 0x46,
+ 0x00, 0x65, 0x9a, 0x46,
X 0xa0, 0x6a, 0xcc, 0x00,
X 0xff, 0x6a, 0xc8, 0x08,
- 0x20, 0x94, 0x44, 0x6e,
- 0x10, 0x94, 0x46, 0x6e,
- 0x08, 0x94, 0x60, 0x6e,
- 0x08, 0x94, 0x60, 0x6e,
- 0x08, 0x94, 0x60, 0x6e,
+ 0x20, 0x94, 0x50, 0x6e,
+ 0x10, 0x94, 0x52, 0x6e,
+ 0x08, 0x94, 0x6c, 0x6e,
+ 0x08, 0x94, 0x6c, 0x6e,
+ 0x08, 0x94, 0x6c, 0x6e,
X 0xff, 0x8c, 0xc8, 0x10,
X 0xc1, 0x64, 0xc8, 0x18,
X 0xf8, 0x64, 0xc8, 0x08,
X 0x01, 0x99, 0xda, 0x30,
- 0x00, 0x66, 0x54, 0x66,
- 0xc0, 0x66, 0x90, 0x76,
+ 0x00, 0x66, 0x60, 0x66,
+ 0xc0, 0x66, 0x9c, 0x76,
X 0x60, 0x66, 0xc8, 0x18,
X 0x3d, 0x64, 0xc8, 0x28,
- 0x00, 0x65, 0x44, 0x46,
+ 0x00, 0x65, 0x50, 0x46,
X 0xf7, 0x93, 0x26, 0x09,
- 0x08, 0x93, 0x62, 0x6e,
+ 0x08, 0x93, 0x6e, 0x6e,
X 0x00, 0x62, 0xc4, 0x18,
- 0x00, 0x65, 0x8e, 0x5e,
- 0x00, 0x65, 0x6e, 0x5e,
- 0x00, 0x65, 0x6e, 0x5e,
- 0x00, 0x65, 0x6e, 0x5e,
+ 0x00, 0x65, 0x9a, 0x5e,
+ 0x00, 0x65, 0x7a, 0x5e,
+ 0x00, 0x65, 0x7a, 0x5e,
+ 0x00, 0x65, 0x7a, 0x5e,
X 0x01, 0x99, 0xda, 0x30,
X 0x01, 0x99, 0xda, 0x30,
X 0x01, 0x99, 0xda, 0x30,
@@ -845,11 +851,11 @@
X 0x01, 0x6c, 0x32, 0x31,
X 0x01, 0x6c, 0x32, 0x31,
X 0x01, 0x6c, 0x32, 0x35,
- 0x08, 0x94, 0x8e, 0x7e,
+ 0x08, 0x94, 0x9a, 0x7e,
X 0xf7, 0x93, 0x26, 0x09,
- 0x08, 0x93, 0x92, 0x6e,
+ 0x08, 0x93, 0x9e, 0x6e,
X 0xff, 0x6a, 0xd4, 0x0c,
- 0x04, 0xb8, 0xba, 0x6e,
+ 0x04, 0xb8, 0xc6, 0x6e,
X 0x01, 0x42, 0x7e, 0x31,
X 0xff, 0x6a, 0x76, 0x01,
X 0x01, 0x90, 0x84, 0x34,
@@ -857,14 +863,14 @@
X 0x01, 0x85, 0x0a, 0x01,
X 0x7f, 0x65, 0x10, 0x09,
X 0xfe, 0x85, 0x0a, 0x0d,
- 0xff, 0x42, 0xb6, 0x66,
- 0xff, 0x41, 0xae, 0x66,
- 0xd1, 0x6a, 0xbe, 0x5e,
+ 0xff, 0x42, 0xc2, 0x66,
+ 0xff, 0x41, 0xba, 0x66,
+ 0xd1, 0x6a, 0xca, 0x5e,
X 0xff, 0x6a, 0xca, 0x04,
X 0x01, 0x41, 0x20, 0x31,
X 0x01, 0xbf, 0x82, 0x30,
X 0x01, 0x6a, 0x76, 0x00,
- 0x00, 0xbb, 0xf8, 0x45,
+ 0x00, 0xbb, 0x04, 0x46,
X 0x01, 0x42, 0x20, 0x31,
X 0x01, 0xbf, 0x84, 0x34,
X 0x01, 0x41, 0x7e, 0x31,
@@ -967,7 +973,7 @@
X static int
X ahc_patch12_func(struct ahc_softc *ahc)
X {
- return ((ahc->features & AHC_ULTRA) != 0);
+ return ((ahc->features & AHC_HS_MAILBOX) != 0);
X }
X
X static int ahc_patch11_func(struct ahc_softc *ahc);
@@ -975,7 +981,7 @@
X static int
X ahc_patch11_func(struct ahc_softc *ahc)
X {
- return ((ahc->features & AHC_HS_MAILBOX) != 0);
+ return ((ahc->features & AHC_ULTRA) != 0);
X }
X
X static int ahc_patch10_func(struct ahc_softc *ahc);
@@ -1084,7 +1090,7 @@
X { ahc_patch3_func, 27, 1, 2 },
X { ahc_patch0_func, 28, 1, 1 },
X { ahc_patch6_func, 34, 1, 1 },
- { ahc_patch7_func, 37, 62, 21 },
+ { ahc_patch7_func, 37, 54, 19 },
X { ahc_patch8_func, 37, 1, 1 },
X { ahc_patch9_func, 42, 3, 2 },
X { ahc_patch0_func, 45, 3, 1 },
@@ -1097,185 +1103,185 @@
X { ahc_patch0_func, 56, 1, 1 },
X { ahc_patch9_func, 60, 1, 2 },
X { ahc_patch0_func, 61, 1, 1 },
- { ahc_patch9_func, 70, 1, 2 },
- { ahc_patch0_func, 71, 1, 1 },
- { ahc_patch9_func, 74, 1, 2 },
- { ahc_patch0_func, 75, 1, 1 },
- { ahc_patch11_func, 85, 1, 2 },
- { ahc_patch0_func, 86, 1, 1 },
- { ahc_patch9_func, 94, 1, 2 },
- { ahc_patch0_func, 95, 1, 1 },
- { ahc_patch8_func, 99, 9, 4 },
- { ahc_patch1_func, 101, 1, 2 },
- { ahc_patch0_func, 102, 1, 1 },
- { ahc_patch2_func, 104, 2, 1 },
- { ahc_patch2_func, 113, 4, 1 },
- { ahc_patch1_func, 117, 1, 2 },
- { ahc_patch0_func, 118, 2, 3 },
- { ahc_patch2_func, 118, 1, 2 },
- { ahc_patch0_func, 119, 1, 1 },
- { ahc_patch7_func, 120, 4, 2 },
- { ahc_patch0_func, 124, 1, 1 },
- { ahc_patch12_func, 126, 2, 1 },
- { ahc_patch1_func, 128, 1, 2 },
- { ahc_patch0_func, 129, 1, 1 },
- { ahc_patch7_func, 130, 4, 1 },
- { ahc_patch7_func, 141, 80, 9 },
- { ahc_patch4_func, 159, 1, 1 },
- { ahc_patch1_func, 172, 1, 1 },
- { ahc_patch9_func, 180, 1, 2 },
- { ahc_patch0_func, 181, 1, 1 },
- { ahc_patch9_func, 190, 1, 2 },
- { ahc_patch0_func, 191, 1, 1 },
- { ahc_patch9_func, 207, 6, 2 },
- { ahc_patch0_func, 213, 6, 1 },
- { ahc_patch8_func, 221, 18, 2 },
- { ahc_patch1_func, 234, 1, 1 },
- { ahc_patch1_func, 241, 1, 2 },
- { ahc_patch0_func, 242, 2, 2 },
- { ahc_patch12_func, 243, 1, 1 },
- { ahc_patch9_func, 251, 31, 3 },
- { ahc_patch1_func, 267, 14, 2 },
- { ahc_patch13_func, 272, 1, 1 },
- { ahc_patch14_func, 282, 14, 1 },
- { ahc_patch1_func, 298, 1, 2 },
- { ahc_patch0_func, 299, 1, 1 },
- { ahc_patch9_func, 302, 1, 1 },
- { ahc_patch13_func, 307, 1, 1 },
- { ahc_patch9_func, 308, 2, 2 },
- { ahc_patch0_func, 310, 4, 1 },
- { ahc_patch14_func, 314, 1, 1 },
- { ahc_patch15_func, 317, 2, 3 },
- { ahc_patch9_func, 317, 1, 2 },
- { ahc_patch0_func, 318, 1, 1 },
- { ahc_patch6_func, 323, 1, 2 },
- { ahc_patch0_func, 324, 1, 1 },
- { ahc_patch1_func, 328, 50, 11 },
- { ahc_patch6_func, 337, 2, 4 },
- { ahc_patch7_func, 337, 1, 1 },
- { ahc_patch8_func, 338, 1, 1 },
- { ahc_patch0_func, 339, 1, 1 },
- { ahc_patch16_func, 340, 1, 1 },
- { ahc_patch6_func, 359, 6, 3 },
- { ahc_patch16_func, 359, 5, 1 },
- { ahc_patch0_func, 365, 5, 1 },
- { ahc_patch13_func, 373, 5, 1 },
- { ahc_patch0_func, 378, 54, 17 },
- { ahc_patch14_func, 378, 1, 1 },
- { ahc_patch7_func, 380, 2, 2 },
- { ahc_patch17_func, 381, 1, 1 },
- { ahc_patch9_func, 384, 1, 1 },
- { ahc_patch18_func, 391, 1, 1 },
- { ahc_patch14_func, 396, 9, 3 },
- { ahc_patch9_func, 397, 3, 2 },
- { ahc_patch0_func, 400, 3, 1 },
- { ahc_patch9_func, 408, 6, 2 },
- { ahc_patch0_func, 414, 9, 2 },
- { ahc_patch13_func, 414, 1, 1 },
- { ahc_patch13_func, 423, 2, 1 },
- { ahc_patch14_func, 425, 1, 1 },
- { ahc_patch9_func, 427, 1, 2 },
- { ahc_patch0_func, 428, 1, 1 },
- { ahc_patch7_func, 431, 1, 1 },
+ { ahc_patch9_func, 71, 1, 2 },
+ { ahc_patch0_func, 72, 1, 1 },
+ { ahc_patch9_func, 75, 1, 2 },
+ { ahc_patch0_func, 76, 1, 1 },
+ { ahc_patch9_func, 79, 1, 2 },
+ { ahc_patch0_func, 80, 1, 1 },
+ { ahc_patch8_func, 91, 9, 4 },
+ { ahc_patch1_func, 93, 1, 2 },
+ { ahc_patch0_func, 94, 1, 1 },
+ { ahc_patch2_func, 96, 2, 1 },
+ { ahc_patch2_func, 105, 4, 1 },
+ { ahc_patch1_func, 109, 1, 2 },
+ { ahc_patch0_func, 110, 2, 3 },
+ { ahc_patch2_func, 110, 1, 2 },
+ { ahc_patch0_func, 111, 1, 1 },
+ { ahc_patch7_func, 112, 4, 2 },
+ { ahc_patch0_func, 116, 1, 1 },
+ { ahc_patch11_func, 118, 2, 1 },
+ { ahc_patch1_func, 120, 1, 2 },
+ { ahc_patch0_func, 121, 1, 1 },
+ { ahc_patch7_func, 122, 4, 1 },
+ { ahc_patch7_func, 133, 89, 11 },
+ { ahc_patch4_func, 151, 1, 1 },
+ { ahc_patch1_func, 164, 1, 1 },
+ { ahc_patch12_func, 169, 1, 2 },
+ { ahc_patch0_func, 170, 1, 1 },
+ { ahc_patch9_func, 181, 1, 2 },
+ { ahc_patch0_func, 182, 1, 1 },
+ { ahc_patch9_func, 191, 1, 2 },
+ { ahc_patch0_func, 192, 1, 1 },
+ { ahc_patch9_func, 208, 6, 2 },
+ { ahc_patch0_func, 214, 6, 1 },
+ { ahc_patch8_func, 222, 18, 2 },
+ { ahc_patch1_func, 235, 1, 1 },
+ { ahc_patch1_func, 242, 1, 2 },
+ { ahc_patch0_func, 243, 2, 2 },
+ { ahc_patch11_func, 244, 1, 1 },
+ { ahc_patch9_func, 252, 31, 3 },
+ { ahc_patch1_func, 268, 14, 2 },
+ { ahc_patch13_func, 273, 1, 1 },
+ { ahc_patch14_func, 283, 14, 1 },
+ { ahc_patch1_func, 299, 1, 2 },
+ { ahc_patch0_func, 300, 1, 1 },
+ { ahc_patch9_func, 303, 1, 1 },
+ { ahc_patch13_func, 308, 1, 1 },
+ { ahc_patch9_func, 309, 2, 2 },
+ { ahc_patch0_func, 311, 4, 1 },
+ { ahc_patch14_func, 315, 1, 1 },
+ { ahc_patch15_func, 318, 2, 3 },
+ { ahc_patch9_func, 318, 1, 2 },
+ { ahc_patch0_func, 319, 1, 1 },
+ { ahc_patch6_func, 324, 1, 2 },
+ { ahc_patch0_func, 325, 1, 1 },
+ { ahc_patch1_func, 329, 50, 11 },
+ { ahc_patch6_func, 338, 2, 4 },
+ { ahc_patch7_func, 338, 1, 1 },
+ { ahc_patch8_func, 339, 1, 1 },
+ { ahc_patch0_func, 340, 1, 1 },
+ { ahc_patch16_func, 341, 1, 1 },
+ { ahc_patch6_func, 360, 6, 3 },
+ { ahc_patch16_func, 360, 5, 1 },
+ { ahc_patch0_func, 366, 5, 1 },
+ { ahc_patch13_func, 374, 5, 1 },
+ { ahc_patch0_func, 379, 54, 17 },
+ { ahc_patch14_func, 379, 1, 1 },
+ { ahc_patch7_func, 381, 2, 2 },
+ { ahc_patch17_func, 382, 1, 1 },
+ { ahc_patch9_func, 385, 1, 1 },
+ { ahc_patch18_func, 392, 1, 1 },
+ { ahc_patch14_func, 397, 9, 3 },
+ { ahc_patch9_func, 398, 3, 2 },
+ { ahc_patch0_func, 401, 3, 1 },
+ { ahc_patch9_func, 409, 6, 2 },
+ { ahc_patch0_func, 415, 9, 2 },
+ { ahc_patch13_func, 415, 1, 1 },
+ { ahc_patch13_func, 424, 2, 1 },
+ { ahc_patch14_func, 426, 1, 1 },
+ { ahc_patch9_func, 428, 1, 2 },
+ { ahc_patch0_func, 429, 1, 1 },
X { ahc_patch7_func, 432, 1, 1 },
- { ahc_patch8_func, 433, 3, 3 },
- { ahc_patch6_func, 434, 1, 2 },
- { ahc_patch0_func, 435, 1, 1 },
- { ahc_patch9_func, 436, 1, 1 },
- { ahc_patch15_func, 437, 1, 2 },
- { ahc_patch13_func, 437, 1, 1 },
- { ahc_patch14_func, 439, 9, 4 },
- { ahc_patch9_func, 439, 1, 1 },
- { ahc_patch9_func, 446, 2, 1 },
- { ahc_patch0_func, 448, 4, 3 },
- { ahc_patch9_func, 448, 1, 2 },
- { ahc_patch0_func, 449, 3, 1 },
- { ahc_patch1_func, 453, 2, 1 },
- { ahc_patch7_func, 455, 5, 2 },
- { ahc_patch0_func, 460, 1, 1 },
- { ahc_patch8_func, 461, 109, 23 },
- { ahc_patch1_func, 463, 3, 2 },
- { ahc_patch0_func, 466, 5, 3 },
- { ahc_patch9_func, 466, 2, 2 },
- { ahc_patch0_func, 468, 3, 1 },
- { ahc_patch1_func, 473, 2, 2 },
- { ahc_patch0_func, 475, 6, 3 },
- { ahc_patch9_func, 475, 2, 2 },
- { ahc_patch0_func, 477, 3, 1 },
- { ahc_patch1_func, 483, 2, 2 },
- { ahc_patch0_func, 485, 9, 7 },
- { ahc_patch9_func, 485, 5, 6 },
- { ahc_patch19_func, 485, 1, 2 },
- { ahc_patch0_func, 486, 1, 1 },
- { ahc_patch19_func, 488, 1, 2 },
- { ahc_patch0_func, 489, 1, 1 },
- { ahc_patch0_func, 490, 4, 1 },
- { ahc_patch6_func, 494, 3, 2 },
- { ahc_patch0_func, 497, 1, 1 },
- { ahc_patch1_func, 500, 1, 1 },
- { ahc_patch6_func, 506, 1, 2 },
- { ahc_patch0_func, 507, 1, 1 },
- { ahc_patch20_func, 544, 7, 1 },
- { ahc_patch3_func, 572, 1, 2 },
- { ahc_patch0_func, 573, 1, 1 },
- { ahc_patch21_func, 576, 1, 1 },
- { ahc_patch8_func, 578, 104, 33 },
- { ahc_patch4_func, 579, 1, 1 },
- { ahc_patch1_func, 585, 2, 2 },
- { ahc_patch0_func, 587, 1, 1 },
- { ahc_patch1_func, 590, 1, 2 },
- { ahc_patch0_func, 591, 1, 1 },
- { ahc_patch9_func, 592, 3, 3 },
- { ahc_patch15_func, 593, 1, 1 },
- { ahc_patch0_func, 595, 4, 1 },
- { ahc_patch19_func, 603, 2, 2 },
- { ahc_patch0_func, 605, 1, 1 },
- { ahc_patch19_func, 609, 10, 3 },
- { ahc_patch5_func, 611, 8, 1 },
- { ahc_patch0_func, 619, 9, 2 },
- { ahc_patch5_func, 620, 8, 1 },
- { ahc_patch4_func, 630, 1, 2 },
- { ahc_patch0_func, 631, 1, 1 },
- { ahc_patch19_func, 632, 1, 2 },
- { ahc_patch0_func, 633, 3, 2 },
- { ahc_patch4_func, 635, 1, 1 },
- { ahc_patch5_func, 636, 1, 1 },
- { ahc_patch5_func, 639, 1, 1 },
- { ahc_patch5_func, 641, 1, 1 },
- { ahc_patch4_func, 643, 2, 2 },
- { ahc_patch0_func, 645, 2, 1 },
+ { ahc_patch7_func, 433, 1, 1 },
+ { ahc_patch8_func, 434, 3, 3 },
+ { ahc_patch6_func, 435, 1, 2 },
+ { ahc_patch0_func, 436, 1, 1 },
+ { ahc_patch9_func, 437, 1, 1 },
+ { ahc_patch15_func, 438, 1, 2 },
+ { ahc_patch13_func, 438, 1, 1 },
+ { ahc_patch14_func, 440, 9, 4 },
+ { ahc_patch9_func, 440, 1, 1 },
+ { ahc_patch9_func, 447, 2, 1 },
+ { ahc_patch0_func, 449, 4, 3 },
+ { ahc_patch9_func, 449, 1, 2 },
+ { ahc_patch0_func, 450, 3, 1 },
+ { ahc_patch1_func, 454, 2, 1 },
+ { ahc_patch7_func, 456, 10, 2 },
+ { ahc_patch0_func, 466, 1, 1 },
+ { ahc_patch8_func, 467, 109, 23 },
+ { ahc_patch1_func, 469, 3, 2 },
+ { ahc_patch0_func, 472, 5, 3 },
+ { ahc_patch9_func, 472, 2, 2 },
+ { ahc_patch0_func, 474, 3, 1 },
+ { ahc_patch1_func, 479, 2, 2 },
+ { ahc_patch0_func, 481, 6, 3 },
+ { ahc_patch9_func, 481, 2, 2 },
+ { ahc_patch0_func, 483, 3, 1 },
+ { ahc_patch1_func, 489, 2, 2 },
+ { ahc_patch0_func, 491, 9, 7 },
+ { ahc_patch9_func, 491, 5, 6 },
+ { ahc_patch19_func, 491, 1, 2 },
+ { ahc_patch0_func, 492, 1, 1 },
+ { ahc_patch19_func, 494, 1, 2 },
+ { ahc_patch0_func, 495, 1, 1 },
+ { ahc_patch0_func, 496, 4, 1 },
+ { ahc_patch6_func, 500, 3, 2 },
+ { ahc_patch0_func, 503, 1, 1 },
+ { ahc_patch1_func, 506, 1, 1 },
+ { ahc_patch6_func, 512, 1, 2 },
+ { ahc_patch0_func, 513, 1, 1 },
+ { ahc_patch20_func, 550, 7, 1 },
+ { ahc_patch3_func, 578, 1, 2 },
+ { ahc_patch0_func, 579, 1, 1 },
+ { ahc_patch21_func, 582, 1, 1 },
+ { ahc_patch8_func, 584, 104, 33 },
+ { ahc_patch4_func, 585, 1, 1 },
+ { ahc_patch1_func, 591, 2, 2 },
+ { ahc_patch0_func, 593, 1, 1 },
+ { ahc_patch1_func, 596, 1, 2 },
+ { ahc_patch0_func, 597, 1, 1 },
+ { ahc_patch9_func, 598, 3, 3 },
+ { ahc_patch15_func, 599, 1, 1 },
+ { ahc_patch0_func, 601, 4, 1 },
+ { ahc_patch19_func, 609, 2, 2 },
+ { ahc_patch0_func, 611, 1, 1 },
+ { ahc_patch19_func, 615, 10, 3 },
+ { ahc_patch5_func, 617, 8, 1 },
+ { ahc_patch0_func, 625, 9, 2 },
+ { ahc_patch5_func, 626, 8, 1 },
+ { ahc_patch4_func, 636, 1, 2 },
+ { ahc_patch0_func, 637, 1, 1 },
+ { ahc_patch19_func, 638, 1, 2 },
+ { ahc_patch0_func, 639, 3, 2 },
+ { ahc_patch4_func, 641, 1, 1 },
+ { ahc_patch5_func, 642, 1, 1 },
+ { ahc_patch5_func, 645, 1, 1 },
X { ahc_patch5_func, 647, 1, 1 },
- { ahc_patch5_func, 650, 1, 1 },
+ { ahc_patch4_func, 649, 2, 2 },
+ { ahc_patch0_func, 651, 2, 1 },
X { ahc_patch5_func, 653, 1, 1 },
- { ahc_patch19_func, 657, 1, 1 },
- { ahc_patch19_func, 660, 1, 1 },
- { ahc_patch4_func, 666, 1, 1 },
- { ahc_patch6_func, 669, 1, 2 },
- { ahc_patch0_func, 670, 1, 1 },
- { ahc_patch7_func, 682, 16, 1 },
- { ahc_patch4_func, 698, 20, 1 },
- { ahc_patch9_func, 719, 4, 2 },
- { ahc_patch0_func, 723, 4, 1 },
- { ahc_patch9_func, 727, 4, 2 },
- { ahc_patch0_func, 731, 3, 1 },
- { ahc_patch6_func, 737, 1, 1 },
- { ahc_patch22_func, 739, 14, 1 },
- { ahc_patch7_func, 753, 3, 1 },
- { ahc_patch9_func, 765, 24, 8 },
- { ahc_patch19_func, 769, 1, 2 },
- { ahc_patch0_func, 770, 1, 1 },
- { ahc_patch15_func, 775, 4, 2 },
- { ahc_patch0_func, 779, 7, 3 },
- { ahc_patch23_func, 779, 5, 2 },
- { ahc_patch0_func, 784, 2, 1 },
- { ahc_patch0_func, 789, 42, 3 },
- { ahc_patch18_func, 801, 18, 2 },
- { ahc_patch0_func, 819, 1, 1 },
- { ahc_patch4_func, 843, 1, 1 },
- { ahc_patch4_func, 844, 3, 2 },
- { ahc_patch0_func, 847, 1, 1 },
- { ahc_patch13_func, 848, 3, 1 },
- { ahc_patch4_func, 851, 12, 1 }
+ { ahc_patch5_func, 656, 1, 1 },
+ { ahc_patch5_func, 659, 1, 1 },
+ { ahc_patch19_func, 663, 1, 1 },
+ { ahc_patch19_func, 666, 1, 1 },
+ { ahc_patch4_func, 672, 1, 1 },
+ { ahc_patch6_func, 675, 1, 2 },
+ { ahc_patch0_func, 676, 1, 1 },
+ { ahc_patch7_func, 688, 16, 1 },
+ { ahc_patch4_func, 704, 20, 1 },
+ { ahc_patch9_func, 725, 4, 2 },
+ { ahc_patch0_func, 729, 4, 1 },
+ { ahc_patch9_func, 733, 4, 2 },
+ { ahc_patch0_func, 737, 3, 1 },
+ { ahc_patch6_func, 743, 1, 1 },
+ { ahc_patch22_func, 745, 14, 1 },
+ { ahc_patch7_func, 759, 3, 1 },
+ { ahc_patch9_func, 771, 24, 8 },
+ { ahc_patch19_func, 775, 1, 2 },
+ { ahc_patch0_func, 776, 1, 1 },
+ { ahc_patch15_func, 781, 4, 2 },
+ { ahc_patch0_func, 785, 7, 3 },
+ { ahc_patch23_func, 785, 5, 2 },
+ { ahc_patch0_func, 790, 2, 1 },
+ { ahc_patch0_func, 795, 42, 3 },
+ { ahc_patch18_func, 807, 18, 2 },
+ { ahc_patch0_func, 825, 1, 1 },
+ { ahc_patch4_func, 849, 1, 1 },
+ { ahc_patch4_func, 850, 3, 2 },
+ { ahc_patch0_func, 853, 1, 1 },
+ { ahc_patch13_func, 854, 3, 1 },
+ { ahc_patch4_func, 857, 12, 1 }
X };
X struct cs {
X u_int16_t begin;
@@ -1283,11 +1289,11 @@
X } critical_sections[] = {
X { 11, 18 },
X { 21, 30 },
- { 698, 714 },
- { 844, 847 },
- { 851, 857 },
- { 859, 861 },
- { 861, 863 }
+ { 704, 720 },
+ { 850, 853 },
+ { 857, 863 },
+ { 865, 867 },
+ { 867, 869 }
X };
X const int num_critical_sections = sizeof(critical_sections)
X / sizeof(*critical_sections);
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/Makefile linux/drivers/scsi/aic7xxx/aicasm/Makefile
--- v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/Makefile Fri May 4 15:16:28 2001
+++ linux/drivers/scsi/aic7xxx/aicasm/Makefile Thu Oct 25 13:53:49 2001
@@ -1,8 +1,9 @@
X PROG= aicasm
X
+.SUFFIXES= .l .y .c
+
X CSRCS= aicasm.c aicasm_symbol.c
X GENSRCS= aicasm_gram.c aicasm_scan.c
-DEPHDRS= aicdb.h
X GENHDRS= y.tab.h aicdb.h
X
X SRCS= ${GENSRCS} ${CSRCS}
@@ -25,9 +26,7 @@
X LFLAGS= -d
X endif
X
-.SUFFIXES= .l .y .c
-
-$(PROG): $(SRCS) $(DEPHDRS)
+$(PROG): $(SRCS) $(GENHDRS)
X $(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(PROG)
X
X aicdb.h:
@@ -45,3 +44,9 @@
X
X clean:
X rm -f $(CLEANFILES) $(PROG)
+
+y.tab.h aicasm_gram.c: aicasm_gram.y
+ $(YACC) $(YFLAGS) aicasm_gram.y
+ mv y.tab.c aicasm_gram.c
+
+aicasm_scan.c: y.tab.h
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm.c linux/drivers/scsi/aic7xxx/aicasm/aicasm.c
--- v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm.c Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aicasm/aicasm.c Thu Oct 25 13:53:49 2001
@@ -1,7 +1,8 @@
X /*
X * Aic7xxx SCSI host adapter firmware asssembler
X *
- * Copyright (c) 1997, 1998, 2000 Justin T. Gibbs.
+ * Copyright (c) 1997, 1998, 2000, 2001 Justin T. Gibbs.
+ * Copyright (c) 2001 Adaptec Inc.


X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without

@@ -9,26 +10,34 @@
X * are met:


X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,

- * without modification, immediately at the beginning of the file.


- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.

+ * without modification.


+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *

X * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL").

- * $Id: //depot/src/aic7xxx/aicasm/aicasm.c#8 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.c#11 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm.c,v 1.29 2000/10/05 04:25:42 gibbs Exp $
X */
@@ -42,6 +51,12 @@
X #include <string.h>
X #include <sysexits.h>
X #include <unistd.h>
+
+#if linux
+#include <endian.h>
+#else
+#include <machine/endian.h>
+#endif
X
X #include "aicasm.h"
X #include "aicasm_symbol.h"
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm.h linux/drivers/scsi/aic7xxx/aicasm/aicasm.h
--- v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm.h Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aicasm/aicasm.h Thu Oct 25 13:53:49 2001
@@ -2,6 +2,7 @@
X * Assembler for the sequencer program downloaded to Aic7xxx SCSI host adapters
X *
X * Copyright (c) 1997 Justin T. Gibbs.
+ * Copyright (c) 2001 Adaptec Inc.

- * $Id: //depot/src/aic7xxx/aicasm/aicasm.h#5 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.h#7 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm.h,v 1.11 2000/09/22 22:19:54 gibbs Exp $
X */
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y linux/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
--- v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y Thu Oct 25 13:53:49 2001
@@ -3,6 +3,7 @@
X * Parser for the Aic7xxx SCSI Host adapter sequencer assembler.
X *
X * Copyright (c) 1997, 1998, 2000 Justin T. Gibbs.
+ * Copyright (c) 2001 Adaptec Inc.


X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without

@@ -11,25 +12,33 @@


X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,

- * $Id: //depot/src/aic7xxx/aicasm/aicasm_gram.y#7 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#9 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm_gram.y,v 1.12 2000/10/31 18:44:32 gibbs Exp $
X */
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm_insformat.h linux/drivers/scsi/aic7xxx/aicasm/aicasm_insformat.h
--- v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm_insformat.h Sun Mar 4 14:30:18 2001
+++ linux/drivers/scsi/aic7xxx/aicasm/aicasm_insformat.h Thu Oct 25 13:53:49 2001
@@ -11,34 +11,36 @@


X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,

- * $Id: //depot/src/aic7xxx/aicasm/aicasm_insformat.h#4 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_insformat.h#7 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm_insformat.h,v 1.3 2000/09/22 22:19:54 gibbs Exp $
X */
-
-#if linux
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#endif
X
X struct ins_format1 {
X #if BYTE_ORDER == LITTLE_ENDIAN
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l linux/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
--- v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l Thu Oct 25 13:53:49 2001
@@ -2,7 +2,8 @@
X /*
X * Lexical Analyzer for the Aic7xxx SCSI Host adapter sequencer assembler.
X *
- * Copyright (c) 1997, 1998 Justin T. Gibbs.
+ * Copyright (c) 1997, 1998, 2000 Justin T. Gibbs.
+ * Copyright (c) 2001 Adaptec Inc.


X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without

@@ -11,25 +12,33 @@


X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,

- * $Id: //depot/src/aic7xxx/aicasm/aicasm_scan.l#5 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_scan.l#7 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm_scan.l,v 1.13 2000/09/22 22:19:54 gibbs Exp $
X */
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
--- v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c Thu Oct 25 13:53:49 2001


@@ -10,25 +10,33 @@
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,

X * without modification.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *

X * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL").

- * $Id: //depot/src/aic7xxx/aicasm/aicasm_symbol.c#7 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.c#9 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm_symbol.c,v 1.11 2000/09/22 22:19:54 gibbs Exp $
X */
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h
--- v2.4.13/linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h Sun Mar 4 14:30:18 2001
+++ linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h Thu Oct 25 13:53:49 2001


@@ -10,25 +10,33 @@
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,

- * $Id: //depot/src/aic7xxx/aicasm/aicasm_symbol.h#4 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.h#6 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm_symbol.h,v 1.11 2000/09/22 22:19:55 gibbs Exp $
X */
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/cam.h linux/drivers/scsi/aic7xxx/cam.h
--- v2.4.13/linux/drivers/scsi/aic7xxx/cam.h Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/cam.h Thu Oct 25 13:53:49 2001
@@ -15,7 +15,7 @@
X * derived from this software without specific prior written permission.


X *
X * Alternatively, this software may be distributed under the terms of the
- * GNU Public License ("GPL").

+ * GNU General Public License ("GPL").
X *
X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -29,7 +29,7 @@


X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X *

- * $Id: //depot/src/linux/drivers/scsi/aic7xxx/cam.h#10 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/cam.h#11 $
X */
X
X #ifndef _AIC7XXX_CAM_H
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/amiga7xx.c linux/drivers/scsi/amiga7xx.c
--- v2.4.13/linux/drivers/scsi/amiga7xx.c Fri Dec 29 14:07:22 2000
+++ linux/drivers/scsi/amiga7xx.c Thu Oct 25 13:53:49 2001
@@ -20,7 +20,7 @@
X #include <asm/pgtable.h>
X #include <asm/amigaints.h>
X #include <asm/amigahw.h>
-#include <asm/io.h>
+
X #include <asm/irq.h>
X
X #include "scsi.h"
@@ -133,3 +133,6 @@
X called = 1;
X return num;
X }
+
+static Scsi_Host_Template driver_template = AMIGA7XX_SCSI;
+#include "scsi_module.c"
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/blz1230.c linux/drivers/scsi/blz1230.c
--- v2.4.13/linux/drivers/scsi/blz1230.c Tue Mar 6 19:44:37 2001
+++ linux/drivers/scsi/blz1230.c Thu Oct 25 13:53:49 2001
@@ -51,7 +51,7 @@


X static int dma_ports_p(struct NCR_ESP *esp);
X static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write);

X
-volatile unsigned char cmd_buffer[16];
+static volatile unsigned char cmd_buffer[16];
X /* This is where all commands are put
X * before they are transferred to the ESP chip
X * via PIO.

@@ -64,6 +64,7 @@
X struct zorro_dev *z = NULL;
X unsigned long address;
X struct ESP_regs *eregs;
+ unsigned long board;
X
X #if MKIV
X #define REAL_BLZ1230_ID ZORRO_PROD_PHASE5_BLIZZARD_1230_IV_1260
@@ -76,7 +77,7 @@
X #endif
X
X if ((z = zorro_find_device(REAL_BLZ1230_ID, z))) {
- unsigned long board = z->resource.start;


+ board = z->resource.start;

X if (request_mem_region(board+REAL_BLZ1230_ESP_ADDR,
X sizeof(struct ESP_regs), "NCR53C9x")) {
X /* Do some magic to figure out if the blizzard is
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/blz2060.c linux/drivers/scsi/blz2060.c
--- v2.4.13/linux/drivers/scsi/blz2060.c Fri Mar 2 18:38:38 2001
+++ linux/drivers/scsi/blz2060.c Thu Oct 25 13:53:49 2001
@@ -51,7 +51,7 @@


X static int dma_ports_p(struct NCR_ESP *esp);
X static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write);

X
-volatile unsigned char cmd_buffer[16];
+static volatile unsigned char cmd_buffer[16];
X /* This is where all commands are put
X * before they are transferred to the ESP chip
X * via PIO.

diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/bvme6000.c linux/drivers/scsi/bvme6000.c
--- v2.4.13/linux/drivers/scsi/bvme6000.c Thu Nov 11 16:57:30 1999
+++ linux/drivers/scsi/bvme6000.c Thu Oct 25 13:53:49 2001
@@ -50,3 +50,6 @@


X called = 1;
X return 1;
X }
+

+static Scsi_Host_Template driver_template = BVME6000_SCSI;
+#include "scsi_module.c"
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/constants.c linux/drivers/scsi/constants.c
--- v2.4.13/linux/drivers/scsi/constants.c Tue Jul 3 17:08:20 2001
+++ linux/drivers/scsi/constants.c Thu Oct 25 13:53:50 2001
@@ -74,6 +74,18 @@
X };
X
X
+/* The following are 16 byte commands in group 4 */
+static const char *group_4_commands[] = {
+/* 80-84 */ unknown, unknown, unknown, unknown, unknown,
+/* 85-89 */ "Memory Export In (16)", unknown, unknown, unknown,
+ "Memory Export Out (16)",
+/* 8a-8f */ unknown, unknown, unknown, unknown, unknown, unknown,
+/* 90-94 */ unknown, unknown, unknown, unknown, unknown,
+/* 95-99 */ unknown, unknown, unknown, unknown, unknown,
+/* 9a-9f */ unknown, unknown, unknown, unknown, unknown, unknown,
+};
+
+
X /* The following are 12 byte commands in group 5 */
X static const char *group_5_commands[] = {
X /* a0-a5 */ unknown, unknown, unknown, unknown, unknown,
@@ -97,7 +109,7 @@
X
X static const char **commands[] = {
X group_0_commands, group_1_commands, group_2_commands,
- (const char **) RESERVED_GROUP, (const char **) RESERVED_GROUP,
+ (const char **) RESERVED_GROUP, group_4_commands,
X group_5_commands, (const char **) VENDOR_GROUP,
X (const char **) VENDOR_GROUP
X };
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/cpqfc.Readme linux/drivers/scsi/cpqfc.Readme
--- v2.4.13/linux/drivers/scsi/cpqfc.Readme Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/cpqfc.Readme Thu Oct 25 13:53:50 2001
@@ -7,6 +7,21 @@
X SEST size 512 Exchanges (simultaneous I/Os) limited by module kmalloc()
X max of 128k bytes contiguous.
X
+Ver 2.1.1 Oct 18, 2001
+ * reinitialize Cmnd->SCp.sent_command (used to identify commands as
+ passthrus) on calling scsi_done, since the scsi mid layer does not
+ use (or reinitialize) this field to prevent subsequent comands from
+ having it set incorrectly.
+
+Ver 2.1.0 Aug 27, 2001
+ * Revise driver to use new kernel 2.4.x PCI DMA API, instead of
+ virt_to_bus(). (enables driver to work w/ ia64 systems with >2Gb RAM.)
+ Rework main scatter-gather code to handle cases where SG element
+ lengths are larger than 0x7FFFF bytes and use as many scatter
+ gather pages as necessary. (Steve Cameron)
+ * Makefile changes to bring cpqfc into line w/ rest of SCSI drivers
+ (thanks to Keith Owens)
+
X Ver 2.0.5 Aug 06, 2001
X * Reject non-existent luns in the driver rather than letting the
X hardware do it. (some HW behaves differently than others in this area.)
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/cpqfcTScontrol.c linux/drivers/scsi/cpqfcTScontrol.c
--- v2.4.13/linux/drivers/scsi/cpqfcTScontrol.c Sun Aug 12 13:28:00 2001
+++ linux/drivers/scsi/cpqfcTScontrol.c Thu Oct 25 13:53:50 2001
@@ -55,6 +55,21 @@
X static void CpqTsGetSFQEntry(TACHYON * fcChip,
X USHORT pi, ULONG * buffr, BOOLEAN UpdateChip);
X
+static void
+cpqfc_free_dma_consistent(CPQFCHBA *cpqfcHBAdata)
+{


+ // free up the primary EXCHANGES struct and Link Q

+ PTACHYON fcChip = &cpqfcHBAdata->fcChip;
+
+ if (fcChip->Exchanges != NULL)
+ pci_free_consistent(cpqfcHBAdata->PciDev, sizeof(FC_EXCHANGES),
+ fcChip->Exchanges, fcChip->exch_dma_handle);
+ fcChip->Exchanges = NULL;
+ if (cpqfcHBAdata->fcLQ != NULL)
+ pci_free_consistent(cpqfcHBAdata->PciDev, sizeof(FC_LINK_QUE),
+ cpqfcHBAdata->fcLQ, cpqfcHBAdata->fcLQ_dma_handle);
+ cpqfcHBAdata->fcLQ = NULL;
+}
X
X // Note special requirements for Q alignment! (TL/TS UG pg. 190)
X // We place critical index pointers at end of QUE elements to assist
@@ -68,7 +83,8 @@
X
X int iStatus=0;
X unsigned long ulAddr;
-
+ dma_addr_t ERQdma, IMQdma, SPQdma, SESTdma;
+ int i;
X
X // NOTE! fcMemManager() will return system virtual addresses.
X // System (kernel) virtual addresses, though non-paged, still
@@ -78,15 +94,18 @@
X
X
X // Allocate primary EXCHANGES array...
+ fcChip->Exchanges = NULL;
+ cpqfcHBAdata->fcLQ = NULL;
X
X printk("Allocating %u for %u Exchanges ",
X (ULONG)sizeof(FC_EXCHANGES), TACH_MAX_XID);
- fcChip->Exchanges = kmalloc( sizeof( FC_EXCHANGES), GFP_KERNEL );
+ fcChip->Exchanges = pci_alloc_consistent(cpqfcHBAdata->PciDev,
+ sizeof(FC_EXCHANGES), &fcChip->exch_dma_handle);
X printk("@ %p\n", fcChip->Exchanges);
X
X if( fcChip->Exchanges == NULL ) // fatal error!!
X {
- printk("kmalloc failure on Exchanges: fatal error\n");
+ printk("pci_alloc_consistent failure on Exchanges: fatal error\n");
X return -1;
X }
X // zero out the entire EXCHANGE space
@@ -94,25 +113,24 @@
X
X
X printk("Allocating %u for LinkQ ", (ULONG)sizeof(FC_LINK_QUE));
- cpqfcHBAdata->fcLQ = kmalloc( sizeof( FC_LINK_QUE), GFP_KERNEL );
+ cpqfcHBAdata->fcLQ = pci_alloc_consistent(cpqfcHBAdata->PciDev,
+ sizeof( FC_LINK_QUE), &cpqfcHBAdata->fcLQ_dma_handle);
X printk("@ %p (%u elements)\n", cpqfcHBAdata->fcLQ, FC_LINKQ_DEPTH);
X memset( cpqfcHBAdata->fcLQ, 0, sizeof( FC_LINK_QUE));
X
X if( cpqfcHBAdata->fcLQ == NULL ) // fatal error!!
X {
- printk("kmalloc failure on fc Link Que: fatal error\n");
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
+ printk("pci_alloc_consistent() failure on fc Link Que: fatal error\n");
X return -1;
X }
X // zero out the entire EXCHANGE space
X memset( cpqfcHBAdata->fcLQ, 0, sizeof( FC_LINK_QUE));
-
-
-
X
X // Verify that basic Tach I/O registers are not NULL
-
X if( !fcChip->Registers.ReMapMemBase )
X {
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
X printk("HBA base address NULL: fatal error\n");
X return -1;
X }


@@ -125,18 +143,21 @@
X

X // Allocate Tach's Exchange Request Queue (each ERQ entry 32 bytes)
X
- fcChip->ERQ = fcMemManager( &cpqfcHBAdata->dynamic_mem[0],
- sizeof( TachLiteERQ ), 32*(ERQ_LEN), 0L );
+ fcChip->ERQ = fcMemManager( cpqfcHBAdata->PciDev,

+ &cpqfcHBAdata->dynamic_mem[0],

+ sizeof( TachLiteERQ ), 32*(ERQ_LEN), 0L, &ERQdma);
X if( !fcChip->ERQ )
X {
- printk("kmalloc/alignment failure on ERQ: fatal error\n");
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
+ printk("pci_alloc_consistent/alignment failure on ERQ: fatal error\n");
X return -1;
X }
X fcChip->ERQ->length = ERQ_LEN-1;
- ulAddr = virt_to_bus( fcChip->ERQ);
+ ulAddr = (ULONG) ERQdma;
X #if BITS_PER_LONG > 32
X if( (ulAddr >> 32) )
X {
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
X printk(" FATAL! ERQ ptr %p exceeds Tachyon's 32-bit register size\n",
X (void*)ulAddr);
X return -1; // failed
@@ -147,19 +168,22 @@
X
X // Allocate Tach's Inbound Message Queue (32 bytes per entry)
X
- fcChip->IMQ = fcMemManager( &cpqfcHBAdata->dynamic_mem[0],
- sizeof( TachyonIMQ ), 32*(IMQ_LEN), 0L );
+ fcChip->IMQ = fcMemManager( cpqfcHBAdata->PciDev,

+ &cpqfcHBAdata->dynamic_mem[0],

+ sizeof( TachyonIMQ ), 32*(IMQ_LEN), 0L, &IMQdma );
X if( !fcChip->IMQ )
X {
- printk("kmalloc/alignment failure on IMQ: fatal error\n");
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
+ printk("pci_alloc_consistent/alignment failure on IMQ: fatal error\n");
X return -1;
X }
X fcChip->IMQ->length = IMQ_LEN-1;
X
- ulAddr = virt_to_bus( fcChip->IMQ);
+ ulAddr = IMQdma;
X #if BITS_PER_LONG > 32
X if( (ulAddr >> 32) )
X {
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
X printk(" FATAL! IMQ ptr %p exceeds Tachyon's 32-bit register size\n",
X (void*)ulAddr);
X return -1; // failed
@@ -169,20 +193,23 @@
X
X
X // Allocate Tach's Single Frame Queue (64 bytes per entry)
- fcChip->SFQ = fcMemManager( &cpqfcHBAdata->dynamic_mem[0],
- sizeof( TachLiteSFQ ), 64*(SFQ_LEN),0L );
+ fcChip->SFQ = fcMemManager( cpqfcHBAdata->PciDev,

+ &cpqfcHBAdata->dynamic_mem[0],

+ sizeof( TachLiteSFQ ), 64*(SFQ_LEN),0L, &SPQdma );
X if( !fcChip->SFQ )
X {
- printk("kmalloc/alignment failure on SFQ: fatal error\n");
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
+ printk("pci_alloc_consistent/alignment failure on SFQ: fatal error\n");
X return -1;
X }
X fcChip->SFQ->length = SFQ_LEN-1; // i.e. Que length [# entries -
X // min. 32; max. 4096 (0xffff)]
X
- ulAddr = virt_to_bus( fcChip->SFQ);
+ ulAddr = SPQdma;
X #if BITS_PER_LONG > 32
X if( (ulAddr >> 32) )
X {
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
X printk(" FATAL! SFQ ptr %p exceeds Tachyon's 32-bit register size\n",
X (void*)ulAddr);
X return -1; // failed
@@ -197,22 +224,28 @@
X // be on physical page (e.g. 4k) boundary.
X printk("Allocating %u for TachSEST for %u Exchanges\n",
X (ULONG)sizeof(TachSEST), TACH_SEST_LEN);
- fcChip->SEST = fcMemManager( &cpqfcHBAdata->dynamic_mem[0],
- sizeof(TachSEST), 4, 0L );
+ fcChip->SEST = fcMemManager( cpqfcHBAdata->PciDev,


+ &cpqfcHBAdata->dynamic_mem[0],

+ sizeof(TachSEST), 4, 0L, &SESTdma );
X // sizeof(TachSEST), 64*TACH_SEST_LEN, 0L );
X if( !fcChip->SEST )
X {
- printk("kmalloc/alignment failure on SEST: fatal error\n");
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
+ printk("pci_alloc_consistent/alignment failure on SEST: fatal error\n");
X return -1;
X }
X
+ for( i=0; i < TACH_SEST_LEN; i++) // for each exchange
+ fcChip->SEST->sgPages[i] = NULL;
+
X fcChip->SEST->length = TACH_SEST_LEN; // e.g. DON'T subtract one
X // (TL/TS UG, pg 153)
X
- ulAddr = virt_to_bus( fcChip->SEST);
+ ulAddr = SESTdma;
X #if BITS_PER_LONG > 32
X if( (ulAddr >> 32) )
X {
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
X printk(" FATAL! SFQ ptr %p exceeds Tachyon's 32-bit register size\n",
X (void*)ulAddr);
X return -1; // failed
@@ -241,7 +274,8 @@
X // NOTE! write consumer index last, since the write
X // causes Tachyon to process the other registers
X
- ulAddr = virt_to_bus( &fcChip->ERQ->consumerIndex);
+ ulAddr = ((unsigned long)&fcChip->ERQ->consumerIndex -
+ (unsigned long)fcChip->ERQ) + (unsigned long) ERQdma;
X
X // NOTE! Tachyon DMAs to the ERQ consumer Index host
X // address; must be correctly aligned
@@ -269,10 +303,13 @@
X // NOTE: TachLite DMAs to the producerIndex host address
X // must be correctly aligned with address bits 1-0 cleared
X // Writing the BASE register clears the PI register, so write it last
- ulAddr = virt_to_bus( &fcChip->IMQ->producerIndex);
+ ulAddr = ((unsigned long)&fcChip->IMQ->producerIndex -
+ (unsigned long)fcChip->IMQ) + (unsigned long) IMQdma;
+
X #if BITS_PER_LONG > 32
X if( (ulAddr >> 32) )
X {
+ cpqfc_free_dma_consistent(cpqfcHBAdata);
X printk(" FATAL! IMQ ptr %p exceeds Tachyon's 32-bit register size\n",
X (void*)ulAddr);
X return -1; // failed
@@ -1225,7 +1262,7 @@
X #endif
X
X Exchanges->fcExchange[i].status |= INITIATOR_ABORT;
- cpqfcTSCompleteExchange( fcChip, i); // abort on LDn
+ cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev, fcChip, i); // abort on LDn
X }
X }
X
@@ -1505,7 +1542,7 @@
X if( RPCset ) // SEST transaction Response frame rec'd
X {
X // complete the command in our driver...
- cpqfcTSCompleteExchange( fcChip, x_ID);
+ cpqfcTSCompleteExchange( cpqfcHBAdata->PciDev,fcChip, x_ID);
X
X } // end "RPCset"
X
@@ -1709,16 +1746,15 @@
X case 3: // allocate mem, set Tachyon Que registers
X iStatus = CpqTsCreateTachLiteQues( cpqfcHBAdata, opcode2);
X
+ if( iStatus )
+ break;
+
X // now that the Queues exist, Tach can DMA to them, so
X // we can begin processing INTs
X // INTEN register - enable INT (TachLite interrupt)
X writeb( 0x1F, fcChip->Registers.ReMapMemBase + IINTEN);
X
-
- if( iStatus )
- break;
-
-
+ // Fall through
X case 4: // Config Fame Manager, Init Loop Command, laser on
X
X // L_PORT or loopback
@@ -1750,9 +1786,11 @@
X {
X CPQFCHBA *cpqfcHBAdata = (CPQFCHBA*)pHBA;
X PTACHYON fcChip = &cpqfcHBAdata->fcChip;
- USHORT i, j, iStatus=0;
+ USHORT i, iStatus=0;
X void* vPtr; // mem Align manager sets this to the freed address on success
X unsigned long ulPtr; // for 64-bit pointer cast (e.g. Alpa machine)
+ FC_EXCHANGES *Exchanges = fcChip->Exchanges;
+ PSGPAGES j, next;
X
X ENTER("DestroyTachLiteQues");
X
@@ -1760,19 +1798,25 @@
X {
X // search out and free Pool for Extended S/G list pages
X
- for( i=0, j=0; i < TACH_SEST_LEN; i++, j=0) // for each exchange
+ for( i=0; i < TACH_SEST_LEN; i++) // for each exchange
X {
- // It's possible that extended S/G pages were allocated and
+ // It's possible that extended S/G pages were allocated, mapped, and
X // not cleared due to error conditions or O/S driver termination.
X // Make sure they're all gone.
- while( fcChip->SEST->sgPages[i].PoolPage[j] &&
- (j < TL_MAX_SGPAGES))
- kfree( fcChip->SEST->sgPages[i].PoolPage[j++]);
-
+ if (Exchanges->fcExchange[i].Cmnd != NULL)
+ cpqfc_pci_unmap(cpqfcHBAdata->PciDev, Exchanges->fcExchange[i].Cmnd,
+ fcChip, i); // undo DMA mappings.
+
+ for (j=fcChip->SEST->sgPages[i] ; j != NULL ; j = next) {
+ next = j->next;
+ kfree(j);
+ }
+ fcChip->SEST->sgPages[i] = NULL;
X }
X ulPtr = (unsigned long)fcChip->SEST;


- vPtr = fcMemManager( &cpqfcHBAdata->dynamic_mem[0],
- 0,0, (ULONG)ulPtr ); // 'free' mem
+ vPtr = fcMemManager( cpqfcHBAdata->PciDev,

+ &cpqfcHBAdata->dynamic_mem[0],
+ 0,0, (ULONG)ulPtr, NULL ); // 'free' mem

X fcChip->SEST = 0L; // null invalid ptr


X if( !vPtr )
X {

@@ -1785,8 +1829,9 @@
X {
X
X ulPtr = (unsigned long)fcChip->SFQ;


- vPtr = fcMemManager( &cpqfcHBAdata->dynamic_mem[0],
- 0,0, (ULONG)ulPtr ); // 'free' mem

SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 36'
echo 'File patch-2.4.14 is continued in part 37'
echo "37" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:04 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part41

#!/bin/sh -x
# this is part 41 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 41; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ char *radeon_sig[] = {
+ "RG6",
+ "RADEON"
+ };
+
+ for(segstart=0x000c0000; segstart<0x000f0000; segstart+=0x00001000) {
+
X stage = 1;
-
+
X rom_base = (char *)ioremap(segstart, 0x1000);
-
+
X if ((*rom_base == 0x55) && (((*(rom_base + 1)) & 0xff) == 0xaa))
X stage = 2;
X
-
- if (stage != 2) {
+
+ if (stage != 2) {
X iounmap(rom_base);
X continue;
X }
-
+
X rom = rom_base;
-
+
X for (i = 0; (i < 128 - strlen(aty_rom_sig)) && (stage != 3); i++) {
X if (aty_rom_sig[0] == *rom)
X if (strncmp(aty_rom_sig, rom,
X strlen(aty_rom_sig)) == 0)
X stage = 3;
X rom++;
- }
+ }
X if (stage != 3) {
X iounmap(rom_base);
- continue;
+ continue;
X }
X rom = rom_base;
-
+
X for (i = 0; (i < 512) && (stage != 4); i++) {
- if (radeon_sig[0] == *rom)
- if (strncmp(radeon_sig, rom,
- strlen(radeon_sig)) == 0)
- stage = 4;
+ for(j = 0;j < sizeof(radeon_sig)/sizeof(char *);j++) {
+ if (radeon_sig[j][0] == *rom)
+ if (strncmp(radeon_sig[j], rom,
+ strlen(radeon_sig[j])) == 0) {
+ stage = 4;
+ break;
+ }
+ }
X rom++;
- }
+ }
X if (stage != 4) {
X iounmap(rom_base);
X continue;
- }
+ }
X
X return rom_base;
X }
-#endif
+#endif

X return NULL;
X }
X

X
X
+
X static void radeon_get_pllinfo(struct radeonfb_info *rinfo, char *bios_seg)
X {
X void *bios_header;
@@ -878,17 +1048,198 @@
X rinfo->pll.ref_div = (u32)pll.PCLK_ref_divider;
X rinfo->pll.ppll_min = pll.PCLK_min_freq;
X rinfo->pll.ppll_max = pll.PCLK_max_freq;
+
+ printk("radeonfb: ref_clk=%d, ref_div=%d, xclk=%d from BIOS\n",
+ rinfo->pll.ref_clk, rinfo->pll.ref_div, rinfo->pll.xclk);
X } else {
+#if defined(__powerpc__)
+ if (radeon_read_OF(rinfo)) {
+ unsigned int tmp, Nx, M, ref_div, xclk;
+
+ tmp = INPLL(M_SPLL_REF_FB_DIV);
+ ref_div = INPLL(PPLL_REF_DIV) & 0x3ff;
+
+ Nx = (tmp & 0xff00) >> 8;
+ M = (tmp & 0xff);
+ xclk = ((((2 * Nx * rinfo->pll.ref_clk) + (M)) /
+ (2 * M)));
+
+ rinfo->pll.xclk = xclk;
+ rinfo->pll.ref_div = ref_div;
+ rinfo->pll.ppll_min = 12000;
+ rinfo->pll.ppll_max = 35000;
+
+ printk("radeonfb: ref_clk=%d, ref_div=%d, xclk=%d from OF\n",
+ rinfo->pll.ref_clk, rinfo->pll.ref_div, rinfo->pll.xclk);
+
+ return;
+ }
+#endif
X /* no BIOS or BIOS not found, use defaults */
+ switch (rinfo->chipset) {
+ case PCI_DEVICE_ID_RADEON_QW:
+ rinfo->pll.ppll_max = 35000;
+ rinfo->pll.ppll_min = 12000;
+ rinfo->pll.xclk = 23000;
+ rinfo->pll.ref_div = 12;
+ rinfo->pll.ref_clk = 2700;
+ break;
+ case PCI_DEVICE_ID_RADEON_QL:
+ rinfo->pll.ppll_max = 35000;
+ rinfo->pll.ppll_min = 12000;
+ rinfo->pll.xclk = 27500;
+ rinfo->pll.ref_div = 12;
+ rinfo->pll.ref_clk = 2700;
+ break;
+ case PCI_DEVICE_ID_RADEON_QD:
+ case PCI_DEVICE_ID_RADEON_QE:
+ case PCI_DEVICE_ID_RADEON_QF:
+ case PCI_DEVICE_ID_RADEON_QG:
+ default:
+ rinfo->pll.ppll_max = 35000;
+ rinfo->pll.ppll_min = 12000;
+ rinfo->pll.xclk = 16600;
+ rinfo->pll.ref_div = 67;
+ rinfo->pll.ref_clk = 2700;
+ break;
+ }
+
+ printk("radeonfb: ref_clk=%d, ref_div=%d, xclk=%d defaults\n",
+ rinfo->pll.ref_clk, rinfo->pll.ref_div, rinfo->pll.xclk);
+ }
+}
X
- rinfo->pll.ppll_max = 35000;
- rinfo->pll.ppll_min = 12000;
- rinfo->pll.xclk = 16600;
- rinfo->pll.ref_div = 67;
- rinfo->pll.ref_clk = 2700;
+
+static void radeon_get_moninfo (struct radeonfb_info *rinfo)
+{
+ unsigned int tmp;
+
+ tmp = INREG(RADEON_BIOS_4_SCRATCH);
+
+ if (rinfo->hasCRTC2) {
+ /* primary DVI port */
+ if (tmp & 0x08)
+ rinfo->dviDisp_type = MT_DFP;
+ else if (tmp & 0x4)
+ rinfo->dviDisp_type = MT_LCD;
+ else if (tmp & 0x200)
+ rinfo->dviDisp_type = MT_CRT;
+ else if (tmp & 0x10)
+ rinfo->dviDisp_type = MT_CTV;
+ else if (tmp & 0x20)
+ rinfo->dviDisp_type = MT_STV;
+
+ /* secondary CRT port */
+ if (tmp & 0x2)
+ rinfo->crtDisp_type = MT_CRT;
+ else if (tmp & 0x800)
+ rinfo->crtDisp_type = MT_DFP;
+ else if (tmp & 0x400)
+ rinfo->crtDisp_type = MT_LCD;
+ else if (tmp & 0x1000)
+ rinfo->crtDisp_type = MT_CTV;
+ else if (tmp & 0x2000)
+ rinfo->crtDisp_type = MT_STV;
+ } else {
+ rinfo->dviDisp_type = MT_NONE;
+
+ tmp = INREG(FP_GEN_CNTL);
+
+ if (tmp & FP_EN_TMDS)
+ rinfo->crtDisp_type = MT_DFP;
+ else
+ rinfo->crtDisp_type = MT_CRT;
+ }
+}
+
+
+static int radeon_get_dfpinfo (struct radeonfb_info *rinfo)
+{
+ unsigned int tmp;
+ unsigned short a, b;
+
+ if (panel_yres) {
+ rinfo->panel_yres = panel_yres;
+ } else {
+ tmp = INREG(FP_VERT_STRETCH);
+ tmp &= 0x00fff000;
+ rinfo->panel_yres = (unsigned short)(tmp >> 0x0c) + 1;
+ }
+
+ switch (rinfo->panel_yres) {
+ case 480:
+ rinfo->panel_xres = 640;
+ break;
+ case 600:
+ rinfo->panel_xres = 800;
+ break;
+ case 786:
+ rinfo->panel_xres = 1024;
+ break;
+ case 1024:
+ rinfo->panel_xres = 1280;
+ break;
+ case 1050:
+ rinfo->panel_xres = 1400;
+ break;
+ case 1200:
+ rinfo->panel_xres = 1600;
+ break;
+ default:
+ printk("radeonfb: Failed to detect DFP panel size\n");
+ return 0;
X }
+
+ printk("radeonfb: detected DFP panel size: %dx%d\n",
+ rinfo->panel_xres, rinfo->panel_yres);
+
+ tmp = INREG(FP_CRTC_H_TOTAL_DISP);
+ a = (tmp & FP_CRTC_H_TOTAL_MASK) + 4;
+ b = (tmp & 0x01ff0000) >> FP_CRTC_H_DISP_SHIFT;
+ rinfo->hblank = (a - b + 1) * 8;
+
+ tmp = INREG(FP_H_SYNC_STRT_WID);
+ rinfo->hOver_plus = (unsigned short) ((tmp & FP_H_SYNC_STRT_CHAR_MASK) >>
+ FP_H_SYNC_STRT_CHAR_SHIFT) - b - 1;
+ rinfo->hOver_plus *= 8;
+ rinfo->hSync_width = (unsigned short) ((tmp & FP_H_SYNC_WID_MASK) >>
+ FP_H_SYNC_WID_SHIFT);
+ rinfo->hSync_width *= 8;
+ tmp = INREG(FP_CRTC_V_TOTAL_DISP);
+ a = (tmp & FP_CRTC_V_TOTAL_MASK) + 1;
+ b = (tmp & FP_CRTC_V_DISP_MASK) >> FP_CRTC_V_DISP_SHIFT;
+ rinfo->vblank = a - b /* + 24 */ ;
+
+ tmp = INREG(FP_V_SYNC_STRT_WID);
+ rinfo->vOver_plus = (unsigned short) (tmp & FP_V_SYNC_STRT_MASK)
+ - b + 1;
+ rinfo->vSync_width = (unsigned short) ((tmp & FP_V_SYNC_WID_MASK) >>
+ FP_V_SYNC_WID_SHIFT);
+


+ return 1;
X }
X

+
+#if defined(__powerpc__)
+static int radeon_read_OF (struct radeonfb_info *rinfo)
+{
+ struct device_node *dp;
+ unsigned int *xtal;
+
+ dp = pci_device_to_OF_node(rinfo->pdev);
+
+ xtal = (unsigned int *) get_property(dp, "ATY,RefCLK", 0);
+
+ rinfo->pll.ref_clk = *xtal / 10;
+
+ if (*xtal)
+ return 1;
+ else


+ return 0;
+}
+#endif

+
+
X static void radeon_engine_init (struct radeonfb_info *rinfo)
X {
X u32 temp;
@@ -982,7 +1333,7 @@
X disp->var = radeonfb_default_var;
X info->disp = disp;
X
- radeon_set_dispsw (rinfo);
+ radeon_set_dispsw (rinfo, disp);
X
X if (noaccel)
X disp->scrollmode = SCROLL_YREDRAW;
@@ -1020,57 +1371,145 @@
X
X
X
-static void radeon_set_dispsw (struct radeonfb_info *rinfo)
-{
- struct display *disp = &rinfo->disp;
- int accel;
+static void radeon_set_dispsw (struct radeonfb_info *rinfo, struct display *disp)
X
- accel = disp->var.accel_flags & FB_ACCELF_TEXT;
-
+{
+ int accel;
+
+ accel = disp->var.accel_flags & FB_ACCELF_TEXT;
+
X disp->dispsw_data = NULL;
-
- disp->screen_base = (char*)rinfo->fb_base;
+
+ disp->screen_base = (char*)rinfo->fb_base;
X disp->type = FB_TYPE_PACKED_PIXELS;
X disp->type_aux = 0;
X disp->ypanstep = 1;
X disp->ywrapstep = 0;
X disp->can_soft_blank = 1;
- disp->inverse = 0;
+ disp->inverse = 0;
X
- rinfo->depth = disp->var.bits_per_pixel;
+ rinfo->depth = disp->var.bits_per_pixel;
X switch (disp->var.bits_per_pixel) {
X #ifdef FBCON_HAS_CFB8
X case 8:
- disp->dispsw = accel ? &fbcon_radeon8 : &fbcon_cfb8;
- disp->visual = FB_VISUAL_PSEUDOCOLOR;
- disp->line_length = disp->var.xres_virtual;
+ disp->dispsw = &fbcon_cfb8;
+ disp->visual = FB_VISUAL_PSEUDOCOLOR;
+ disp->line_length = disp->var.xres_virtual;
X break;
-#endif
+#endif
X #ifdef FBCON_HAS_CFB16
X case 16:
X disp->dispsw = &fbcon_cfb16;
X disp->dispsw_data = &rinfo->con_cmap.cfb16;
- disp->visual = FB_VISUAL_DIRECTCOLOR;
- disp->line_length = disp->var.xres_virtual * 2;
+ disp->visual = FB_VISUAL_DIRECTCOLOR;
+ disp->line_length = disp->var.xres_virtual * 2;
+ break;
+#endif
+#ifdef FBCON_HAS_CFB32
+ case 24:
+ disp->dispsw = &fbcon_cfb24;
+ disp->dispsw_data = &rinfo->con_cmap.cfb24;
+ disp->visual = FB_VISUAL_DIRECTCOLOR;
+ disp->line_length = disp->var.xres_virtual * 4;
X break;
X #endif
X #ifdef FBCON_HAS_CFB32
X case 32:
X disp->dispsw = &fbcon_cfb32;
X disp->dispsw_data = &rinfo->con_cmap.cfb32;
- disp->visual = FB_VISUAL_DIRECTCOLOR;
- disp->line_length = disp->var.xres_virtual * 4;
- break;
+ disp->visual = FB_VISUAL_DIRECTCOLOR;
+ disp->line_length = disp->var.xres_virtual * 4;
+ break;
X #endif
X default:
X printk ("radeonfb: setting fbcon_dummy renderer\n");
X disp->dispsw = &fbcon_dummy;
X }
-
+
X return;
X }
+
+
+
+static void do_install_cmap(int con, struct fb_info *info)
+{
+ struct radeonfb_info *rinfo = (struct radeonfb_info *) info;
+
+ if (con != rinfo->currcon)
+ return;
+
+ if (fb_display[con].cmap.len)
+ fb_set_cmap(&fb_display[con].cmap, 1, radeon_setcolreg, info);
+ else {
+ int size = fb_display[con].var.bits_per_pixel == 8 ? 256 : 32;
+ fb_set_cmap(fb_default_cmap(size), 1, radeon_setcolreg, info);


+ }
+}
+
X
X

+static int radeonfb_do_maximize(struct radeonfb_info *rinfo,
+ struct fb_var_screeninfo *var,
+ struct fb_var_screeninfo *v,
+ int nom, int den)
+{
+ static struct {
+ int xres, yres;
+ } modes[] = {
+ {1600, 1280},
+ {1280, 1024},
+ {1024, 768},
+ {800, 600},
+ {640, 480},
+ {-1, -1}
+ };
+ int i;
+
+ /* use highest possible virtual resolution */
+ if (v->xres_virtual == -1 && v->yres_virtual == -1) {
+ printk("radeonfb: using max availabe virtual resolution\n");
+ for (i=0; modes[i].xres != -1; i++) {
+ if (modes[i].xres * nom / den * modes[i].yres <
+ rinfo->video_ram / 2)
+ break;
+ }
+ if (modes[i].xres == -1) {
+ printk("radeonfb: could not find virtual resolution that fits into video memory!\n");
+ return -EINVAL;
+ }
+ v->xres_virtual = modes[i].xres;
+ v->yres_virtual = modes[i].yres;
+
+ printk("radeonfb: virtual resolution set to max of %dx%d\n",
+ v->xres_virtual, v->yres_virtual);
+ } else if (v->xres_virtual == -1) {
+ v->xres_virtual = (rinfo->video_ram * den /
+ (nom * v->yres_virtual * 2)) & ~15;
+ } else if (v->yres_virtual == -1) {
+ v->xres_virtual = (v->xres_virtual + 15) & ~15;
+ v->yres_virtual = rinfo->video_ram * den /
+ (nom * v->xres_virtual *2);
+ } else {
+ if (v->xres_virtual * nom / den * v->yres_virtual >
+ rinfo->video_ram) {


+ return -EINVAL;
+ }
+ }
+

+ if (v->xres_virtual * nom / den >= 8192) {
+ v->xres_virtual = 8192 * den / nom - 16;
+ }
+
+ if (v->xres_virtual < v->xres)
+ return -EINVAL;
+
+ if (v->yres_virtual < v->yres)
+ return -EINVAL;
+

+ return 0;
+}
+
+

X
X /*
X * fb ops
@@ -1130,54 +1569,40 @@
X struct radeonfb_info *rinfo = (struct radeonfb_info *) info;
X struct display *disp;
X struct fb_var_screeninfo v;
- int nom, den, i, accel;
+ int nom, den, accel;
X unsigned chgvar = 0;
- static struct {
- int xres, yres;
- } modes[] = {
- {
- 1600, 1280}, {
- 1280, 1024}, {
- 1024, 768}, {
- 800, 600}, {
- 640, 480}, {
- -1, -1}
- };
-
+
X disp = (con < 0) ? rinfo->info.disp : &fb_display[con];
X
- accel = var->accel_flags & FB_ACCELF_TEXT;
-
+ accel = var->accel_flags & FB_ACCELF_TEXT;
+
X if (con >= 0) {
X chgvar = ((disp->var.xres != var->xres) ||
X (disp->var.yres != var->yres) ||
X (disp->var.xres_virtual != var->xres_virtual) ||
X (disp->var.yres_virtual != var->yres_virtual) ||
+ (disp->var.bits_per_pixel != var->bits_per_pixel) ||
X memcmp (&disp->var.red, &var->red, sizeof (var->red)) ||
X memcmp (&disp->var.green, &var->green, sizeof (var->green)) ||
X memcmp (&disp->var.blue, &var->blue, sizeof (var->blue)));
X }
-
+
X memcpy (&v, var, sizeof (v));
-
+
X switch (v.bits_per_pixel) {
X #ifdef FBCON_HAS_CFB8
X case 8:
- v.bits_per_pixel = 8;
- disp->dispsw = accel ? &fbcon_radeon8 : &fbcon_cfb8;
X nom = den = 1;
X disp->line_length = v.xres_virtual;
- disp->visual = FB_VISUAL_PSEUDOCOLOR;
+ disp->visual = FB_VISUAL_PSEUDOCOLOR;
X v.red.offset = v.green.offset = v.blue.offset = 0;
X v.red.length = v.green.length = v.blue.length = 8;
+ v.transp.offset = v.transp.length = 0;
X break;
X #endif
-
+
X #ifdef FBCON_HAS_CFB16
X case 16:
- v.bits_per_pixel = 16;
- disp->dispsw = &fbcon_cfb16;
- disp->dispsw_data = &rinfo->con_cmap.cfb16;
X nom = 2;
X den = 1;
X disp->line_length = v.xres_virtual * 2;
@@ -1185,25 +1610,38 @@
X v.red.offset = 11;
X v.green.offset = 5;
X v.blue.offset = 0;
- v.red.length = 5;
- v.green.length = 6;
- v.blue.length = 5;
+ v.red.length = 5;
+ v.green.length = 6;
+ v.blue.length = 5;
+ v.transp.offset = v.transp.length = 0;
+ break;
+#endif
+
+#ifdef FBCON_HAS_CFB24
+ case 24:
+ nom = 4;
+ den = 1;
+ disp->line_length = v.xres_virtual * 3;
+ disp->visual = FB_VISUAL_DIRECTCOLOR;
+ v.red.offset = 16;
+ v.green.offset = 8;
+ v.blue.offset = 0;
+ v.red.length = v.blue.length = v.green.length = 8;
+ v.transp.offset = v.transp.length = 0;
X break;
X #endif
-
-#ifdef FBCON_HAS_CFB32
+#ifdef FBCON_HAS_CFB32
X case 32:
- v.bits_per_pixel = 32;
- disp->dispsw = &fbcon_cfb32;
- disp->dispsw_data = rinfo->con_cmap.cfb32;
X nom = 4;
X den = 1;
X disp->line_length = v.xres_virtual * 4;
- disp->visual = FB_VISUAL_DIRECTCOLOR;
+ disp->visual = FB_VISUAL_DIRECTCOLOR;
X v.red.offset = 16;
X v.green.offset = 8;
- v.blue.offset = 0;
+ v.blue.offset = 0;
X v.red.length = v.blue.length = v.green.length = 8;
+ v.transp.offset = 24;
+ v.transp.length = 8;
X break;
X #endif
X default:
@@ -1212,40 +1650,20 @@
X return -EINVAL;
X }
X
- if (v.xres * nom / den * v.yres > (rinfo->video_ram)) {
- printk ("radeonfb: mode %dx%dx%d rejected, not enough video ram\n",
- var->xres, var->yres, var->bits_per_pixel);
- return -EINVAL;
- }
-
- if (v.xres_virtual == -1 && v.yres_virtual == -1) {
- printk ("radeonfb: using maximum available virtual resolution\n");
- for (i = 0; modes[i].xres != -1; i++) {
- if (modes[i].xres * nom / den * modes[i].yres < (rinfo->video_ram/2))
- break;
- }
- if (modes[i].xres == -1) {
- printk ("radeonfb: could not find a virtual res\n");
- return -EINVAL;
- }
- v.xres_virtual = modes[i].xres;
- v.yres_virtual = modes[i].yres;
+ if (radeonfb_do_maximize(rinfo, var, &v, nom, den) < 0)
+ return -EINVAL;
X
- printk ("radeonfb: virtual resolution set to maximum of %dx%d\n",
- v.xres_virtual, v.yres_virtual);
- }
-
X if (v.xoffset < 0)
X v.xoffset = 0;
X if (v.yoffset < 0)
X v.yoffset = 0;
-
+
X if (v.xoffset > v.xres_virtual - v.xres)
X v.xoffset = v.xres_virtual - v.xres - 1;
X
X if (v.yoffset > v.yres_virtual - v.yres)
X v.yoffset = v.yres_virtual - v.yres - 1;
-
+
X v.red.msb_right = v.green.msb_right = v.blue.msb_right =
X v.transp.offset = v.transp.length =
X v.transp.msb_right = 0;
@@ -1256,18 +1674,27 @@
X case FB_ACTIVATE_NXTOPEN:
X case FB_ACTIVATE_NOW:
X break;
- default:
+ default:
X return -EINVAL;
X }
-
- disp->type = FB_TYPE_PACKED_PIXELS;
-
+
X memcpy (&disp->var, &v, sizeof (v));
+
+ if (chgvar) {
+ radeon_set_dispsw(rinfo, disp);
X
- radeon_load_video_mode (rinfo, &v);
-
- if (chgvar && info && info->changevar)
- info->changevar (con);
+ if (noaccel)
+ disp->scrollmode = SCROLL_YREDRAW;
+ else
+ disp->scrollmode = 0;
+
+ if (info && info->changevar)
+ info->changevar(con);
+ }
+
+ radeon_load_video_mode (rinfo, &v);
+
+ do_install_cmap(con, info);


X
X return 0;
X }

@@ -1327,42 +1754,23 @@
X struct fb_info *info)
X {
X struct radeonfb_info *rinfo = (struct radeonfb_info *) info;
- struct display *disp;
- unsigned int base;
-
- disp = (con < 0) ? rinfo->info.disp : &fb_display[con];
-
- if (var->xoffset > (var->xres_virtual - var->xres))
- return -EINVAL;
- if (var->yoffset > (var->yres_virtual - var->yres))
+ u32 offset, xoffset, yoffset;
+
+ xoffset = (var->xoffset + 7) & ~7;
+ yoffset = var->yoffset;
+
+ if ((xoffset + var->xres > var->xres_virtual) || (yoffset+var->yres >
+ var->yres_virtual))
X return -EINVAL;
-
- if (var->vmode & FB_VMODE_YWRAP) {
- if (var->yoffset < 0 ||
- var->yoffset >= disp->var.yres_virtual ||
- var->xoffset )
- return -EINVAL;
- } else {
- if (var->xoffset + disp->var.xres > disp->var.xres_virtual ||
- var->yoffset + disp->var.yres > disp->var.yres_virtual)
- return -EINVAL;
- }
-
- base = var->yoffset * disp->line_length + var->xoffset;
-
- disp->var.xoffset = var->xoffset;
- disp->var.yoffset = var->yoffset;
-
- if (var->vmode & FB_VMODE_YWRAP)
- disp->var.vmode |= FB_VMODE_YWRAP;
- else
- disp->var.vmode &= ~FB_VMODE_YWRAP;
+
+ offset = ((yoffset * var->xres + xoffset) * var->bits_per_pixel) >> 6;
+
+ OUTREG(CRTC_OFFSET, offset);


X
X return 0;
X }

X
X
-
X static int radeonfb_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
X unsigned long arg, int con, struct fb_info *info)
X {
@@ -1370,37 +1778,44 @@
X }
X
X
-
X static int radeonfb_switch (int con, struct fb_info *info)
X {
X struct radeonfb_info *rinfo = (struct radeonfb_info *) info;
X struct display *disp;
X struct fb_cmap *cmap;
- int switchcon = 0;
+ int switchcon = 0;
X
X disp = (con < 0) ? rinfo->info.disp : &fb_display[con];
-
+
X if (rinfo->currcon >= 0) {
X cmap = &(rinfo->currcon_display->cmap);
X if (cmap->len)
X fb_get_cmap (cmap, 1, radeon_getcolreg, info);
- }
+ }
+
+ if ((disp->var.xres != rinfo->xres) ||
+ (disp->var.yres != rinfo->yres) ||
+ (disp->var.pixclock != rinfo->pixclock) ||
+ (disp->var.bits_per_pixel != rinfo->depth))
+ switchcon = 1;
+
+ if (switchcon) {
+ rinfo->currcon = con;
+ rinfo->currcon_display = disp;
+ disp->var.activate = FB_ACTIVATE_NOW;
+
+ radeonfb_set_var (&disp->var, con, info);
+ radeon_set_dispsw (rinfo, disp);
+ do_install_cmap(con, info);
+ }
X
- if ((disp->var.xres != rinfo->xres) ||
- (disp->var.yres != rinfo->yres) ||
- (disp->var.pixclock != rinfo->pixclock) ||
- (disp->var.bits_per_pixel != rinfo->depth))
- switchcon = 1;
-
- if (switchcon) {
- rinfo->currcon = con;
- rinfo->currcon_display = disp;
- disp->var.activate = FB_ACTIVATE_NOW;
+ /* XXX absurd hack for X to restore console */
+ {
+ OUTREGP(CRTC_EXT_CNTL, rinfo->hack_crtc_ext_cntl,
+ CRTC_HSYNC_DIS | CRTC_VSYNC_DIS | CRTC_DISPLAY_DIS);
+ OUTREG(CRTC_V_SYNC_STRT_WID, rinfo->hack_crtc_v_sync_strt_wid);
+ }
X
- radeonfb_set_var (&disp->var, con, info);
- radeon_set_dispsw (rinfo);
- }
-

X return 0;
X }
X

@@ -1419,25 +1834,28 @@
X static void radeonfb_blank (int blank, struct fb_info *info)
X {
X struct radeonfb_info *rinfo = (struct radeonfb_info *) info;
- u8 mode = 0;
-
- switch (blank) {
- case 0:
- /* unblank */
- mode = 0;
- break;
- case 1:
- /* blank */
- mode = ((INREG8(CRTC_EXT_CNTL + 1) & 3) | 4);
- break;
- case 2:
- case 3:
- case 4:
- mode = blank | 4;
- break;
- }
-
- OUTREG8(CRTC_EXT_CNTL + 1, mode);
+ u32 val = INREG(CRTC_EXT_CNTL);
+
+ /* reset it */
+ val &= ~(CRTC_DISPLAY_DIS | CRTC_HSYNC_DIS |
+ CRTC_VSYNC_DIS);
+
+ switch (blank) {
+ case VESA_NO_BLANKING:
+ break;
+ case VESA_VSYNC_SUSPEND:
+ val |= (CRTC_DISPLAY_DIS | CRTC_VSYNC_DIS);
+ break;
+ case VESA_HSYNC_SUSPEND:
+ val |= (CRTC_DISPLAY_DIS | CRTC_HSYNC_DIS);
+ break;
+ case VESA_POWERDOWN:
+ val |= (CRTC_DISPLAY_DIS | CRTC_VSYNC_DIS |
+ CRTC_HSYNC_DIS);
+ break;
+ }
+
+ OUTREG(CRTC_EXT_CNTL, val);
X }
X
X
@@ -1450,9 +1868,6 @@
X case 8:
X rc = 256;
X break;
- case 16:
- rc = 64;
- break;
X default:
X rc = 32;
X break;
@@ -1486,7 +1901,7 @@
X unsigned blue, unsigned transp, struct fb_info *info)
X {
X struct radeonfb_info *rinfo = (struct radeonfb_info *) info;
- u32 pindex, col;
+ u32 pindex;
X
X if (regno > 255)
X return 1;
@@ -1498,50 +1913,50 @@
X rinfo->palette[regno].green = green;
X rinfo->palette[regno].blue = blue;
X
- /* init gamma for hicolor */
- if ((rinfo->depth > 8) && (regno == 0)) {
- int i;
- u32 tmp;
-
- for (i=0; i<255; i++) {
- OUTREG(PALETTE_INDEX, i);
- tmp = (i << 16) | (i << 8) | i;
- radeon_fifo_wait(32);
- OUTREG(PALETTE_DATA, tmp);
- }
- }
+ /* init gamma for hicolor */
+ if ((rinfo->depth > 8) && (regno == 0)) {
+ int i;
+
+ for (i=0; i<255; i++) {
+ OUTREG(PALETTE_INDEX, i);
+ OUTREG(PALETTE_DATA, (i << 16) | (i << 8) | i);
+ }
+ }
+
+ /* default */
+ pindex = regno;
+
+ /* XXX actually bpp, fixme */
+ if (rinfo->depth == 16)
+ pindex = regno * 8;
+
+ if (rinfo->depth == 16) {
+ OUTREG(PALETTE_INDEX, pindex/2);
+ OUTREG(PALETTE_DATA, (rinfo->palette[regno/2].red << 16) |
+ (green << 8) | (rinfo->palette[regno/2].blue));
+ green = rinfo->palette[regno/2].green;
+ }
+
+ if ((rinfo->depth == 8) || (regno < 32)) {
+ OUTREG(PALETTE_INDEX, pindex);
+ OUTREG(PALETTE_DATA, (red << 16) | (green << 8) | blue);
+ }
X
- /* default */
- pindex = regno;
- col = (red << 16) | (green << 8) | blue;
-
- if (rinfo->depth == 16) {
- pindex = regno << 3;
-
- if ((rinfo->depth == 16) && (regno >= 32)) {
- pindex -= 252;
-
- col = (rinfo->palette[regno >> 1].red << 16) |
- (green << 8) |
- (rinfo->palette[regno >> 1].blue);
- } else {
- col = (red << 16) | (green << 8) | blue;
- }
- }
-
- OUTREG8(PALETTE_INDEX, pindex);
- radeon_fifo_wait(32);
- OUTREG(PALETTE_DATA, col);
X
X #if defined(FBCON_HAS_CFB16) || defined(FBCON_HAS_CFB32)
X if (regno < 32) {
X switch (rinfo->depth) {
X #ifdef FBCON_HAS_CFB16
X case 16:
- rinfo->con_cmap.cfb16[regno] = (regno << 10) | (regno << 5) |
+ rinfo->con_cmap.cfb16[regno] = (regno << 11) | (regno << 5) |
X regno;
X break;
X #endif
+#ifdef FBCON_HAS_CFB24
+ case 24:
+ rinfo->con_cmap.cfb24[regno] = (regno << 16) | (regno << 8) | regno;
+ break;
+#endif
X #ifdef FBCON_HAS_CFB32
X case 32: {
X u32 i;
@@ -1562,6 +1977,7 @@
X static void radeon_save_state (struct radeonfb_info *rinfo,
X struct radeon_regs *save)
X {
+ /* CRTC regs */
X save->crtc_gen_cntl = INREG(CRTC_GEN_CNTL);
X save->crtc_ext_cntl = INREG(CRTC_EXT_CNTL);
X save->dac_cntl = INREG(DAC_CNTL);
@@ -1570,6 +1986,21 @@
X save->crtc_v_total_disp = INREG(CRTC_V_TOTAL_DISP);
X save->crtc_v_sync_strt_wid = INREG(CRTC_V_SYNC_STRT_WID);
X save->crtc_pitch = INREG(CRTC_PITCH);
+#if defined(__BIG_ENDIAN)
+ save->surface_cntl = INREG(SURFACE_CNTL);
+#endif
+
+ /* FP regs */
+ save->fp_crtc_h_total_disp = INREG(FP_CRTC_H_TOTAL_DISP);
+ save->fp_crtc_v_total_disp = INREG(FP_CRTC_V_TOTAL_DISP);
+ save->fp_gen_cntl = INREG(FP_GEN_CNTL);
+ save->fp_h_sync_strt_wid = INREG(FP_H_SYNC_STRT_WID);
+ save->fp_horz_stretch = INREG(FP_HORZ_STRETCH);
+ save->fp_v_sync_strt_wid = INREG(FP_V_SYNC_STRT_WID);
+ save->fp_vert_stretch = INREG(FP_VERT_STRETCH);
+ save->lvds_gen_cntl = INREG(LVDS_GEN_CNTL);
+ save->lvds_pll_cntl = INREG(LVDS_PLL_CNTL);
+ save->tmds_crc = INREG(TMDS_CRC);
X }
X
X
@@ -1581,6 +2012,7 @@
X int hTotal, vTotal, hSyncStart, hSyncEnd,
X hSyncPol, vSyncStart, vSyncEnd, vSyncPol, cSync;
X u8 hsync_adj_tab[] = {0, 0x12, 9, 9, 6, 5};
+ u8 hsync_fudge_fp[] = {2, 2, 0, 0, 5, 5};
X u32 dotClock = 1000000000 / mode->pixclock,
X sync, h_sync_pol, v_sync_pol;
X int freq = dotClock / 10; /* x 100 */
@@ -1588,6 +2020,7 @@
X int useable_precision, roff, ron;
X int min_bits, format = 0;
X int hsync_start, hsync_fudge, bytpp, hsync_wid, vsync_wid;
+ int primary_mon = PRIMARY_MONITOR(rinfo);
X
X rinfo->xres = mode->xres;
X rinfo->yres = mode->yres;
@@ -1601,6 +2034,21 @@
X vSyncEnd = vSyncStart + mode->vsync_len;
X vTotal = vSyncEnd + mode->upper_margin;
X
+ if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD)) {
+ if (rinfo->panel_xres < mode->xres)
+ rinfo->xres = mode->xres = rinfo->panel_xres;
+ if (rinfo->panel_yres < mode->yres)
+ rinfo->yres = mode->yres = rinfo->panel_yres;
+
+ hTotal = mode->xres + rinfo->hblank + mode->left_margin;
+ hSyncStart = mode->xres + rinfo->hOver_plus + mode->right_margin;
+ hSyncEnd = hSyncStart + rinfo->hOver_plus + mode->hsync_len;
+
+ vTotal = mode->yres + rinfo->vblank + mode->upper_margin;
+ vSyncStart = mode->yres + rinfo->vOver_plus + mode->lower_margin;
+ vSyncEnd = vSyncStart + rinfo->vSync_width + mode->vsync_len;
+ }
+
X sync = mode->sync;
X h_sync_pol = sync & FB_SYNC_HOR_HIGH_ACT ? 0 : 1;
X v_sync_pol = sync & FB_SYNC_VERT_HIGH_ACT ? 0 : 1;
@@ -1646,15 +2094,26 @@
X break;
X }
X
- hsync_fudge = hsync_adj_tab[format-1];
+ if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD))
+ hsync_fudge = hsync_fudge_fp[format-1];
+ else
+ hsync_fudge = hsync_adj_tab[format-1];
+
X hsync_start = hSyncStart - 8 + hsync_fudge;
X
X newmode.crtc_gen_cntl = CRTC_EXT_DISP_EN | CRTC_EN |
X (format << 8);
X
- newmode.crtc_ext_cntl = VGA_ATI_LINEAR | XCRT_CNT_EN;
+ if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD)) {
+ newmode.crtc_ext_cntl = VGA_ATI_LINEAR | XCRT_CNT_EN;
+ newmode.crtc_gen_cntl &= ~(CRTC_DBL_SCAN_EN |
+ CRTC_INTERLACE_EN);
+ } else {
+ newmode.crtc_ext_cntl = VGA_ATI_LINEAR | XCRT_CNT_EN |
+ CRTC_CRT_ON;
+ }
X
- newmode.dac_cntl = INREG(DAC_CNTL) | DAC_MASK_ALL | DAC_VGA_ADR_EN |
+ newmode.dac_cntl = /* INREG(DAC_CNTL) | */ DAC_MASK_ALL | DAC_VGA_ADR_EN |
X DAC_8BIT_EN;
X
X newmode.crtc_h_total_disp = ((((hTotal / 8) - 1) & 0xffff) |
@@ -1670,6 +2129,20 @@
X (vsync_wid << 16) | (v_sync_pol << 23));
X
X newmode.crtc_pitch = (mode->xres >> 3);
+ newmode.crtc_pitch |= (newmode.crtc_pitch << 16);
+
+#if defined(__BIG_ENDIAN)
+ newmode.surface_cntl = SURF_TRANSLATION_DIS;
+ switch (mode->bits_per_pixel) {
+ case 16:
+ newmode.surface_cntl |= NONSURF_AP0_SWP_16BPP;
+ break;
+ case 24:
+ case 32:
+ newmode.surface_cntl |= NONSURF_AP0_SWP_32BPP;
+ break;
+ }
+#endif
X
X rinfo->pitch = ((mode->xres * ((mode->bits_per_pixel + 1) / 8) + 0x3f)
X & ~(0x3f)) / 64;
@@ -1684,6 +2157,9 @@
X
X rinfo->bpp = mode->bits_per_pixel;
X
+ rinfo->hack_crtc_ext_cntl = newmode.crtc_ext_cntl;
+ rinfo->hack_crtc_v_sync_strt_wid = newmode.crtc_v_sync_strt_wid;
+
X if (freq > rinfo->pll.ppll_max)
X freq = rinfo->pll.ppll_max;
X if (freq*12 < rinfo->pll.ppll_min)
@@ -1755,6 +2231,90 @@
X (rinfo->ram.rloop << 20));
X newmode.dda_on_off = (ron << 16) | roff;
X
+ if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD)) {
+ int hRatio, vRatio;
+
+ if ((rinfo->panel_xres == 0) || (rinfo->panel_yres == 0)) {
+ hRatio = vRatio = 1;
+ } else {
+ if (mode->xres > rinfo->panel_xres)
+ mode->xres = rinfo->panel_xres;
+ if (mode->yres > rinfo->panel_yres)
+ mode->yres = rinfo->panel_yres;
+
+ hRatio = mode->xres / rinfo->panel_xres;
+ vRatio = mode->yres / rinfo->panel_yres;
+ }
+
+ if (hRatio == 1) {
+ newmode.fp_horz_stretch =
+ rinfo->init_state.fp_horz_stretch;
+ newmode.fp_horz_stretch &= ~(HORZ_STRETCH_BLEND |
+ HORZ_STRETCH_ENABLE);
+ } else {
+ newmode.fp_horz_stretch =
+ ((((unsigned long)(hRatio * HORZ_STRETCH_RATIO_MAX +
+ (int)0.5)) & HORZ_STRETCH_RATIO_MASK)) |
+ (rinfo->init_state.fp_horz_stretch &
+ (HORZ_PANEL_SIZE | HORZ_FP_LOOP_STRETCH |
+ HORZ_AUTO_RATIO_INC));
+ newmode.fp_horz_stretch |= (HORZ_STRETCH_BLEND |
+ HORZ_STRETCH_ENABLE);
+ }
+ newmode.fp_horz_stretch &= ~HORZ_AUTO_RATIO;
+
+ if (vRatio == 1) {
+ newmode.fp_vert_stretch =
+ rinfo->init_state.fp_vert_stretch;
+ newmode.fp_vert_stretch &= ~(VERT_STRETCH_BLEND |
+ VERT_STRETCH_ENABLE);
+ } else {
+ newmode.fp_vert_stretch =
+ ((((unsigned long)(vRatio * VERT_STRETCH_RATIO_MAX +
+ (int)0.5)) & VERT_STRETCH_RATIO_MASK)) |
+ (rinfo->init_state.fp_vert_stretch &
+ (VERT_PANEL_SIZE | VERT_STRETCH_RESERVED));
+ newmode.fp_vert_stretch |= (VERT_STRETCH_BLEND |
+ VERT_STRETCH_ENABLE);
+ }
+ newmode.fp_vert_stretch &= ~VERT_AUTO_RATIO_EN;
+
+ newmode.fp_gen_cntl = (rinfo->init_state.fp_gen_cntl & (u32)
+ ~(FP_SEL_CRTC2 |
+ FP_RMX_HVSYNC_CONTROL_EN |
+ FP_DFP_SYNC_SEL |
+ FP_CRT_SYNC_SEL |
+ FP_CRTC_LOCK_8DOT |
+ FP_USE_SHADOW_EN |
+ FP_CRTC_USE_SHADOW_VEND |
+ FP_CRT_SYNC_ALT));
+ newmode.fp_gen_cntl |= (FP_CRTC_DONT_SHADOW_VPAR |
+ FP_CRTC_DONT_SHADOW_HEND);
+
+ newmode.lvds_gen_cntl = rinfo->init_state.lvds_gen_cntl;
+ newmode.lvds_pll_cntl = rinfo->init_state.lvds_pll_cntl;
+ newmode.tmds_crc = rinfo->init_state.tmds_crc;
+
+ newmode.crtc_ext_cntl &= ~CRTC_CRT_ON;
+
+ if (primary_mon == MT_LCD) {
+ newmode.lvds_gen_cntl |= (LVDS_ON | LVDS_BLON);
+ newmode.fp_gen_cntl &= ~(FP_FPON | FP_TMDS_EN);
+ } else {
+ /* DFP */
+ newmode.fp_gen_cntl |= (FP_FPON | FP_TMDS_EN);
+ }
+
+ newmode.fp_crtc_h_total_disp =
+ rinfo->init_state.fp_crtc_h_total_disp;
+ newmode.fp_crtc_v_total_disp =
+ rinfo->init_state.fp_crtc_v_total_disp;
+ newmode.fp_h_sync_strt_wid =
+ rinfo->init_state.fp_h_sync_strt_wid;
+ newmode.fp_v_sync_strt_wid =
+ rinfo->init_state.fp_v_sync_strt_wid;
+ }
+
X /* do it! */
X radeon_write_mode (rinfo, &newmode);
X
@@ -1762,11 +2322,11 @@
X }
X
X
-
X static void radeon_write_mode (struct radeonfb_info *rinfo,
X struct radeon_regs *mode)
X {
X int i;
+ int primary_mon = PRIMARY_MONITOR(rinfo);
X
X /* blank screen */
X OUTREG8(CRTC_EXT_CNTL + 1, 4);
@@ -1785,6 +2345,20 @@
X OUTREG(CRTC_OFFSET, 0);
X OUTREG(CRTC_OFFSET_CNTL, 0);
X OUTREG(CRTC_PITCH, mode->crtc_pitch);
+#if 1
+ printk("CRTC_H_TOTAL_DISP = 0x%x, H_SYNC = 0x%x\n",
+ mode->crtc_h_total_disp, mode->crtc_h_sync_strt_wid);
+ printk("CRTC_V_TOTAL_DISP = 0x%x, V_SYNC = 0x%x\n",
+ mode->crtc_v_total_disp, mode->crtc_v_sync_strt_wid);
+ printk("PPLL_DIV_3 = 0x%x, PPLL_REF_DIV = 0x%x\n",
+ mode->ppll_div_3, mode->ppll_ref_div);
+ printk("DDA_CONFIG = 0x%x, DDA_ON_OFF = 0x%x\n",
+ mode->dda_config, mode->dda_on_off);
+#endif
+
+#if defined(__BIG_ENDIAN)
+ OUTREG(SURFACE_CNTL, mode->surface_cntl);
+#endif
X
X while ((INREG(CLOCK_CNTL_INDEX) & PPLL_DIV_SEL_MASK) !=
X PPLL_DIV_SEL_MASK) {
@@ -1815,6 +2389,36 @@
X OUTREG(DDA_CONFIG, mode->dda_config);
X OUTREG(DDA_ON_OFF, mode->dda_on_off);
X
+ if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD)) {
+ 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);
+ OUTREG(FP_V_SYNC_STRT_WID, mode->fp_v_sync_strt_wid);
+ OUTREG(TMDS_CRC, mode->tmds_crc);
+ OUTREG(FP_HORZ_STRETCH, mode->fp_horz_stretch);
+ OUTREG(FP_VERT_STRETCH, mode->fp_vert_stretch);
+ OUTREG(FP_GEN_CNTL, mode->fp_gen_cntl);
+
+ if (primary_mon == MT_LCD) {
+ unsigned int tmp = INREG(LVDS_GEN_CNTL);
+
+ if ((tmp & (LVDS_ON | LVDS_BLON)) ==
+ (mode->lvds_gen_cntl & (LVDS_ON | LVDS_BLON)))
+ OUTREG(LVDS_GEN_CNTL, mode->lvds_gen_cntl);
+ } else {
+ /* DVI */
+ if (mode->lvds_gen_cntl & (LVDS_ON | LVDS_BLON)) {
+ udelay(1000);
+ OUTREG(LVDS_GEN_CNTL, mode->lvds_gen_cntl);
+ } else {
+ OUTREG(LVDS_GEN_CNTL, mode->lvds_gen_cntl |
+ LVDS_BLON);
+ udelay(1000);
+ OUTREG(LVDS_GEN_CNTL, mode->lvds_gen_cntl);
+ }
+ }
+ }
+
X /* unblank screen */
X OUTREG8(CRTC_EXT_CNTL + 1, 0);
X
@@ -1902,7 +2506,7 @@
X static struct display_switch fbcon_radeon8 = {
X setup: fbcon_cfb8_setup,
X bmove: fbcon_radeon_bmove,
- clear: fbcon_cfb8_clear,
+ clear: fbcon_radeon_clear,
X putc: fbcon_cfb8_putc,
X putcs: fbcon_cfb8_putcs,
X revc: fbcon_cfb8_revc,
diff -u --recursive --new-file v2.4.13/linux/drivers/video/sa1100fb.c linux/drivers/video/sa1100fb.c
--- v2.4.13/linux/drivers/video/sa1100fb.c Tue Oct 23 22:48:53 2001
+++ linux/drivers/video/sa1100fb.c Thu Oct 25 13:53:52 2001
@@ -29,6 +29,17 @@
X * - We don't limit the CPU clock rate nor the mode selection
X * according to the available SDRAM bandwidth.
X *
+ * Other notes:
+ * - Linear grayscale palettes and the kernel.
+ * Such code does not belong in the kernel. The kernel frame buffer
+ * drivers do not expect a linear colourmap, but a colourmap based on
+ * the VT100 standard mapping.
+ *
+ * If your _userspace_ requires a linear colourmap, then the setup of
+ * such a colourmap belongs _in userspace_, not in the kernel. Code
+ * to set the colourmap correctly from user space has been sent to
+ * David Neuer. It's around 8 lines of C code, plus another 4 to
+ * detect if we are using grayscale.
X *
X * Code Status:
X * 1999/04/01:
@@ -130,6 +141,12 @@
X *
X * 2001/07/27: <r...@arm.linux.org.uk>
X * - Halve YRES on dual scan LCDs.
+ *
+ * 2001/08/22: <r...@arm.linux.org.uk>
+ * - Add b/w iPAQ pixclock value.
+ *
+ * 2001/10/12: <r...@arm.linux.org.uk>
+ * - Add patch 681/1 and clean up stork definitions.
X */
X
X #include <linux/config.h>
@@ -151,6 +168,7 @@
X #include <asm/irq.h>
X #include <asm/mach-types.h>
X #include <asm/uaccess.h>
+#include <asm/arch/assabet.h>
X
X #include <video/fbcon.h>
X #include <video/fbcon-mfb.h>
@@ -191,7 +209,7 @@
X /*
X * These machines are good machines!
X */
- if (machine_is_assabet() || machine_is_bitsy())
+ if (machine_is_assabet() || machine_is_h3600())
X return;
X
X /*
@@ -272,59 +290,6 @@
X LCCR3_PixRsEdg + LCCR3_VrtSnchH +
X LCCR3_HorSnchH + LCCR3_ACBsCntOff + LCCR3_ACBsDiv(2);
X }
-#ifdef CONFIG_SA1100_CERF
- if (machine_is_cerf()) {
- DPRINTK("Configuring Cerf LCD\n");
-#if defined (CONFIG_CERF_LCD_72_A)
- shadow.lccr0 =
- LCCR0_LEN + LCCR0_Color + LCCR0_Dual +
- LCCR0_LDM + LCCR0_BAM + LCCR0_ERM + LCCR0_Pas +
- LCCR0_LtlEnd + LCCR0_DMADel(0);
- shadow.lccr1 =
- LCCR1_DisWdth(var->xres) + LCCR1_HorSnchWdth(5) +
- LCCR1_BegLnDel(61) + LCCR1_EndLnDel(9);
- shadow.lccr2 =
- LCCR2_DisHght(var->yres / 2) + LCCR2_VrtSnchWdth(1) +
- LCCR2_BegFrmDel(3) + LCCR2_EndFrmDel(0);
- shadow.lccr3 =
- LCCR3_OutEnH + LCCR3_PixRsEdg + LCCR3_VrtSnchH +
- LCCR3_HorSnchH + LCCR3_ACBsCntOff +
- LCCR3_ACBsDiv(2) + LCCR3_PixClkDiv(38);
-#elif defined (CONFIG_CERF_LCD_57_A)
- shadow.lccr0 =
- LCCR0_LEN + LCCR0_Color + LCCR0_Sngl +
- LCCR0_LDM + LCCR0_BAM + LCCR0_ERM + LCCR0_Pas +
- LCCR0_LtlEnd + LCCR0_DMADel(0);
- shadow.lccr1 =
- LCCR1_DisWdth(var->xres) + LCCR1_HorSnchWdth(5) +
- LCCR1_BegLnDel(61) + LCCR1_EndLnDel(9);
- shadow.lccr2 =
- LCCR2_DisHght(var->yres) + LCCR2_VrtSnchWdth(1) +
- LCCR2_BegFrmDel(3) + LCCR2_EndFrmDel(0);
- shadow.lccr3 =
- LCCR3_OutEnH + LCCR3_PixRsEdg + LCCR3_VrtSnchH +
- LCCR3_HorSnchH + LCCR3_ACBsCntOff +
- LCCR3_ACBsDiv(2) + LCCR3_PixClkDiv(38);
-#elif defined (CONFIG_CERF_LCD_38_A)
- shadow.lccr0 =
- LCCR0_LEN + LCCR0_Color + LCCR0_Sngl +
- LCCR0_LDM + LCCR0_BAM + LCCR0_ERM + LCCR0_Pas +
- LCCR0_LtlEnd + LCCR0_DMADel(0);
- shadow.lccr1 =
- LCCR1_DisWdth(var->xres) + LCCR1_HorSnchWdth(5) +
- LCCR1_BegLnDel(61) + LCCR1_EndLnDel(9);
- shadow.lccr2 =
- LCCR2_DisHght(var->yres) + LCCR2_VrtSnchWdth(1) +
- LCCR2_BegFrmDel(3) + LCCR2_EndFrmDel(0);
- shadow.lccr3 =
- LCCR3_OutEnH + LCCR3_PixRsEdg + LCCR3_VrtSnchH +
- LCCR3_HorSnchH + LCCR3_ACBsCntOff +
- LCCR3_ACBsDiv(2) + LCCR3_PixClkDiv(38);
-#else
-#error "Must have a CerfBoard LCD form factor selected"
-#endif
- }
-#endif
X if (machine_is_lart()) {
X DPRINTK("Configuring LART LCD\n");
X #if defined LART_GREY_LCD
@@ -487,8 +452,27 @@
X };
X
X #ifdef CONFIG_SA1100_ASSABET
-static struct sa1100fb_mach_info assabet_info __initdata = {
-#ifdef ASSABET_PAL_VIDEO
+#ifndef ASSABET_PAL_VIDEO
+/*
+ * The assabet uses a sharp LQ039Q2DS54 LCD module. It is actually
+ * takes an RGB666 signal, but we provide it with an RGB565 signal
+ * instead (def_rgb_16).
+ */
+static struct sa1100fb_mach_info lq039q2ds54_info __initdata = {
+ pixclock: 171521, bpp: 16,
+ xres: 320, yres: 240,
+
+ hsync_len: 5, vsync_len: 1,
+ left_margin: 61, upper_margin: 3,
+ right_margin: 9, lower_margin: 0,
+
+ sync: FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+
+ lccr0: LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
+ lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
+};
+#else
+static struct sa1100fb_mach_info pal_info __initdata = {
X pixclock: 67797, bpp: 16,
X xres: 640, yres: 512,
X
@@ -500,26 +484,14 @@
X
X lccr0: LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
X lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512),
-#else
- pixclock: 171521, bpp: 16,
- xres: 320, yres: 240,
-
- hsync_len: 5, vsync_len: 1,
- left_margin: 61, upper_margin: 3,
- right_margin: 9, lower_margin: 0,
-
- sync: FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-
- lccr0: LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
- lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
-#endif
X };
X #endif
+#endif
X
-#ifdef CONFIG_SA1100_BITSY
-static struct sa1100fb_mach_info bitsy_info __initdata = {
+#ifdef CONFIG_SA1100_H3600
+static struct sa1100fb_mach_info h3600_info __initdata = {
X #ifdef CONFIG_IPAQ_H3100
- pixclock: 0, bpp: 4,
+ pixclock: 407766, bpp: 4,
X xres: 320, yres: 240,
X
X hsync_len: 26, vsync_len: 41,
@@ -532,14 +504,8 @@
X
X lccr0: LCCR0_Mono | LCCR0_4PixMono | LCCR0_Sngl | LCCR0_Pas,
X lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
-#error FIXME
- /*
- * Sorry, this should have read:
- * FIXME: please get rid of the PCD and PixClkDiv definitions
- * in favour of pixclock. --rmk
- */
X #else
- pixclock: 5722222, bpp: 16,
+ pixclock: 174757, bpp: 16,
X xres: 320, yres: 240,
X
X hsync_len: 3, vsync_len: 3,
@@ -553,7 +519,7 @@
X #endif
X };
X
-static struct sa1100fb_rgb bitsy_rgb_16 = {
+static struct sa1100fb_rgb h3600_rgb_16 = {
X red: { offset: 12, length: 4, },
X green: { offset: 7, length: 4, },
X blue: { offset: 1, length: 4, },
@@ -580,21 +546,29 @@
X
X #ifdef CONFIG_SA1100_CERF
X static struct sa1100fb_mach_info cerf_info __initdata = {
- pixclock: 171521, bpp: 8,
X #if defined(CONFIG_CERF_LCD_72_A)
+ pixclock: 171521, bpp: 8,
X xres: 640, yres: 480,
X lccr0: LCCR0_Color | LCCR0_Dual | LCCR0_Pas,
X lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2) |
X LCCR3_PixClkDiv(38),
X #elif defined(CONFIG_CERF_LCD_57_A)
+ pixclock: 171521, bpp: 8,
X xres: 320, yres: 240,
X lccr0: LCCR0_Color | LCCR0_Sngl | LCCR0_Pas,
X lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2) |
X LCCR3_PixClkDiv(38),
X #elif defined(CONFIG_CERF_LCD_38_A)
+ pixclock: 171521, bpp: 8,
X xres: 240, yres: 320,
X lccr0: LCCR0_Color | LCCR0_Sngl | LCCR0_Pas,
- lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2) |
+ lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(56) |
+ LCCR3_PixClkDiv(38),
+#elif defined(CONFIG_CERF_LCD_38_B)
+ pixclock: 171521, bpp: 4,
+ xres: 320, yres: 240,
+ lccr0: LCCR0_Mono | LCCR0_4PixMono | LCCR0_Sngl | LCCR0_Pas,
+ lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(56) |
X LCCR3_PixClkDiv(38),
X #else
X #error "Must have a CerfBoard LCD form factor selected"
@@ -607,6 +581,15 @@
X sync: FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
X
X };
+
+#if 0
+static struct sa1100fb_rgb cerf_rgb_16 = {
+ red: { offset: 8, length: 4, },
+ green: { offset: 4, length: 4, },
+ blue: { offset: 0, length: 4, },
+ transp: { offset: 0, length: 0, },
+};
+#endif
X #endif
X
X #ifdef CONFIG_SA1100_FREEBIRD


@@ -635,7 +618,7 @@
X

X #ifdef CONFIG_SA1100_GRAPHICSCLIENT
X static struct sa1100fb_mach_info graphicsclient_info __initdata = {
- pixclock: 0, bpp: 8,
+ pixclock: 53500, bpp: 8,
X xres: 640, yres: 480,
X
X hsync_len: 9, vsync_len: 9,
@@ -645,8 +628,7 @@
X sync: 0,
X
X lccr0: LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
- lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2) |
- LCCR3_PixClkDiv(10),
+ lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
X };
X #endif
X
@@ -774,6 +756,61 @@
X };
X #endif
X
+#ifdef CONFIG_SA1100_STORK
+#if STORK_TFT /* ie the NEC TFT */
+/*
+ * pixclock is ps per clock. say 72Hz, 800x600 clocks => (1/72)/(800*600)
+ * = 28935 and a bit
+ * NB likely to be increased to ease bus timings wrt pcmcia interface
+ */
+static struct sa1100fb_mach_info stork_tft_info __initdata = {
+ pixclock: 28935, bpp: 16,
+ xres: 640, yres: 480,
+
+ hsync_len: 64, vsync_len: 2,
+ left_margin: 48, upper_margin: 12,
+ right_margin: 48, lower_margin: 31,
+
+ sync: 0,
+
+ lccr0: LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
+ lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg,
+};
+
+static struct sa1100fb_rgb stork_tft_rgb_16 = {
+ red: { offset: 11, length: 5, },
+ green: { offset: 5, length: 6, },
+ blue: { offset: 0, length: 5, },
+ transp: { offset: 0, length: 0, },
+};
+
+#else /* Kyocera DSTN */
+
+static struct sa1100fb_mach_info stork_dstn_info __initdata = {
+ pixclock: 0, bpp: 16,
+ xres: 640, yres: 480,
+
+ hsync_len: 2, vsync_len: 2,
+ left_margin: 2, upper_margin: 0,
+ right_margin: 2, lower_margin: 0,
+
+ sync: FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT ,
+
+ lccr0: LCCR0_Color | LCCR0_Dual | LCCR0_Pas,
+#error Fixme
+ lccr3: 0xff00 |
+ 0x18 /* ought to be 0x14 but DMA isn't up to that as yet */
+};
+
+static struct sa1100fb_rgb stork_dstn_rgb_16 = {
+ red: { offset: 8, length: 4, },
+ green: { offset: 4, length: 4, },
+ blue: { offset: 0, length: 4, },
+ transp: { offset: 0, length: 0, },
+};
+#endif
+#endif
+
X #ifdef CONFIG_SA1100_XP860
X static struct sa1100fb_mach_info xp860_info __initdata = {
X pixclock: 0, bpp: 8,
@@ -790,6 +827,8 @@


X };
X #endif
X
+

+
X static struct sa1100fb_mach_info * __init
X sa1100fb_get_machine_info(struct sa1100fb_info *fbi)
X {
@@ -798,18 +837,22 @@
X /*
X * R G B T
X * default {11,5}, { 5,6}, { 0,5}, { 0,0}
- * bitsy {12,4}, { 7,4}, { 1,4}, { 0,0}
+ * h3600 {12,4}, { 7,4}, { 1,4}, { 0,0}
X * freebird { 8,4}, { 4,4}, { 0,4}, {12,4}
X */
X #ifdef CONFIG_SA1100_ASSABET
X if (machine_is_assabet()) {
- inf = &assabet_info;
+#ifndef ASSABET_PAL_VIDEO
+ inf = &lq039q2ds54_info;
+#else
+ inf = &pal_info;
+#endif
X }
X #endif
-#ifdef CONFIG_SA1100_BITSY
- if (machine_is_bitsy()) {
- inf = &bitsy_info;
- fbi->rgb[RGB_16] = &bitsy_rgb_16;
+#ifdef CONFIG_SA1100_H3600
+ if (machine_is_h3600()) {
+ inf = &h3600_info;
+ fbi->rgb[RGB_16] = &h3600_rgb_16;
X }
X #endif
X #ifdef CONFIG_SA1100_BRUTUS
@@ -869,6 +912,17 @@
X inf = &xp860_info;
X }
X #endif
+#ifdef CONFIG_SA1100_STORK
+ if (machine_is_stork()) {
+#if STORK_TFT
+ inf = &stork_tft_info;
+ fbi->rgb[RGB_16] = &stork_tft_rgb_16;
+#else
+ inf = &stork_dstn_info;
+ fbi->rgb[RGB_16] = &stork_dstn_rgb_16;
+#endif
+ }
+#endif
X return inf;
X }
X
@@ -1097,9 +1151,11 @@
X break;
X }
X
- printk(KERN_DEBUG "dma period = %d ps, clock = %d kHz",
+#ifdef CONFIG_CPU_FREQ
+ printk(KERN_DEBUG "dma period = %d ps, clock = %d kHz\n",
X sa1100fb_display_dma_period(var),
X cpufreq_get(smp_processor_id()));
+#endif


X
X return ret;
X }

@@ -1107,23 +1163,22 @@
X static inline void sa1100fb_set_truecolor(u_int is_true_color)
X {
X DPRINTK("true_color = %d\n", is_true_color);
-#ifdef CONFIG_SA1100_ASSABET
+
X if (machine_is_assabet()) {
X #if 1
X // phase 4 or newer Assabet's
X if (is_true_color)
- BCR_set(BCR_LCD_12RGB);
+ ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
X else
- BCR_clear(BCR_LCD_12RGB);
+ ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
X #else
X // older Assabet's
X if (is_true_color)
- BCR_clear(BCR_LCD_12RGB);
+ ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
X else
- BCR_set(BCR_LCD_12RGB);
+ ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
X #endif
X }
-#endif


X }
X
X static void

@@ -1528,7 +1583,7 @@
X /*
X * sa1100fb_activate_var():
X * Configures LCD Controller based on entries in var parameter. Settings are
- * only written to the controller if changes were made.
+ * only written to the controller if changes were made.
X */
X static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_info *fbi)
X {
@@ -1631,7 +1686,7 @@
X */
X if ((LCCR0 != fbi->reg_lccr0) || (LCCR1 != fbi->reg_lccr1) ||
X (LCCR2 != fbi->reg_lccr2) || (LCCR3 != fbi->reg_lccr3) ||
- (DBAR1 != (Address) fbi->dbar1) || (DBAR2 != (Address) fbi->dbar2))
+ (DBAR1 != fbi->dbar1) || (DBAR2 != fbi->dbar2))
X sa1100fb_schedule_task(fbi, C_REENABLE);
X
X return 0;
@@ -1678,9 +1733,6 @@
X if (machine_is_omnimeter())
X LEDBacklightOn();
X #endif
-#ifdef CONFIG_SA1100_BITSY
- /* what rmk said --dneuer */
-#endif
X }
X
X /*
@@ -1703,18 +1755,15 @@
X if (machine_is_omnimeter())
X LEDBacklightOff();
X #endif
-#ifdef CONFIG_SA1100_BITSY
- /* what rmk said --dneuer */
-#endif
X }
X
X static void sa1100fb_power_up_lcd(struct sa1100fb_info *fbi)
X {
X DPRINTK("LCD power on\n");
X
-#if defined(CONFIG_SA1100_ASSABET) && !defined(ASSABET_PAL_VIDEO)
+#ifndef ASSABET_PAL_VIDEO
X if (machine_is_assabet())
- BCR_set(BCR_LCD_ON);
+ ASSABET_BCR_set(ASSABET_BCR_LCD_ON);
X #endif
X #ifdef CONFIG_SA1100_HUW_WEBPANEL
X if (machine_is_huw_webpanel())
@@ -1724,35 +1773,47 @@
X if (machine_is_omnimeter())
X LCDPowerOn();
X #endif
-#ifdef CONFIG_SA1100_BITSY
- if (machine_is_bitsy()) {
- set_bitsy_egpio(EGPIO_BITSY_LCD_ON |
- EGPIO_BITSY_LCD_PCI |
- EGPIO_BITSY_LCD_5V_ON |
- EGPIO_BITSY_LVDD_ON);
+#ifdef CONFIG_SA1100_H3600
+ if (machine_is_h3600()) {
+ set_h3600_egpio(EGPIO_H3600_LCD_ON |
+ EGPIO_H3600_LCD_PCI |
+ EGPIO_H3600_LCD_5V_ON |
+ EGPIO_H3600_LVDD_ON);
X }
X #endif
+#ifdef CONFIG_SA1100_STORK
+ if (machine_is_stork()) {
+ storkSetLCDCPLD(0, 1);
+ storkSetLatchA(STORK_LCD_BACKLIGHT_INVERTER_ON);
+ }
+#endif
X }
X
X static void sa1100fb_power_down_lcd(struct sa1100fb_info *fbi)
X {
X DPRINTK("LCD power off\n");
X
-#if defined(CONFIG_SA1100_ASSABET) && !defined(ASSABET_PAL_VIDEO)
+#ifndef ASSABET_PAL_VIDEO
X if (machine_is_assabet())
- BCR_clear(BCR_LCD_ON);
+ ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
X #endif
X #ifdef CONFIG_SA1100_HUW_WEBPANEL
X // dont forget to set the control lines to zero (?)
X if (machine_is_huw_webpanel())
X BCR_set(BCR_TFT_NPWR);
X #endif
-#ifdef CONFIG_SA1100_BITSY
- if (machine_is_bitsy()) {
- clr_bitsy_egpio(EGPIO_BITSY_LCD_ON |
- EGPIO_BITSY_LCD_PCI |
- EGPIO_BITSY_LCD_5V_ON |
- EGPIO_BITSY_LVDD_ON);
+#ifdef CONFIG_SA1100_H3600
+ if (machine_is_h3600()) {
+ clr_h3600_egpio(EGPIO_H3600_LCD_ON |
+ EGPIO_H3600_LCD_PCI |
+ EGPIO_H3600_LCD_5V_ON |
+ EGPIO_H3600_LVDD_ON);
+ }
+#endif
+#ifdef CONFIG_SA1100_STORK
+ if (machine_is_stork()) {
+ storkSetLCDCPLD(0, 0);
+ storkClearLatchA(STORK_LCD_BACKLIGHT_INVERTER_ON);
X }
X #endif
X }
@@ -1791,12 +1852,21 @@
X GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8;
X }
X #endif
-#ifdef CONFIG_SA1100_CERF
-#error Please contact <r...@arm.linux.org.uk> about this
X if (machine_is_cerf()) {
X /* GPIO15 is used as a bypass for 3.8" displays */
X mask |= GPIO_GPIO15;
-
+#ifdef CONFIG_SA1100_CERF
+#warning Read Me Now!
+#endif
+#if 0 /* if this causes you problems, mail <r...@arm.linux.org.uk> please. */
+ /*
+ * This was enabled for the 72_A version only, which is a _color_
+ * _dual_ LCD. Now look at the generic test above, and calculate
+ * the mask value for a colour dual display...
+ *
+ * I therefore conclude that the code below is redundant, and will
+ * be killed at the start of November 2001.
+ */
X /* FIXME: why is this? The Cerf's display doesn't seem
X * to be dual scan or active. I just leave it here,
X * but in my opinion this is definitively wrong.
@@ -1812,8 +1882,8 @@
X /* color {dual/single} passive */
X mask |= GPIO_LDD15 | GPIO_LDD14 | GPIO_LDD13 | GPIO_LDD12 |
X GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8;
- }
X #endif
+ }
X
X if (mask) {
X GPDR |= mask;
@@ -1836,8 +1906,8 @@
X LCCR2 = fbi->reg_lccr2;
X LCCR1 = fbi->reg_lccr1;
X LCCR0 = fbi->reg_lccr0 & ~LCCR0_LEN;
- DBAR1 = (Address) fbi->dbar1;
- DBAR2 = (Address) fbi->dbar2;
+ DBAR1 = fbi->dbar1;
+ DBAR2 = fbi->dbar2;
X LCCR0 |= LCCR0_LEN;
X
X #ifdef CONFIG_SA1100_GRAPHICSCLIENT
@@ -2032,7 +2102,7 @@
X /*
X * Ok, calculate its DMA period
X */
- period = sa1100fb_display_dma_period(get_con_var(fbi, i));
+ period = sa1100fb_display_dma_period(get_con_var(&fbi->fb, i));
X if (period < min_period)
X min_period = period;
X }
@@ -2236,13 +2306,13 @@
X ret = request_irq(IRQ_LCD, sa1100fb_handle_irq, SA_INTERRUPT,
X fbi->fb.fix.id, fbi);
X if (ret) {
- printk(KERN_ERR "sa1100fb: failed in request_irq: %d\n", ret);
+ printk(KERN_ERR "sa1100fb: request_irq failed: %d\n", ret);
X goto failed;
X }
X
-#if defined(CONFIG_SA1100_ASSABET) && defined(ASSABET_PAL_VIDEO)
+#ifdef ASSABET_PAL_VIDEO
X if (machine_is_assabet())
- BCR_clear(BCR_LCD_ON);
+ ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
X #endif
X
X #ifdef CONFIG_SA1100_FREEBIRD
@@ -2332,4 +2402,5 @@


X return 0;
X }
X

+MODULE_DESCRIPTION("StrongARM-1100/1110 framebuffer driver");
X MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.13/linux/drivers/video/sa1100fb.h linux/drivers/video/sa1100fb.h
--- v2.4.13/linux/drivers/video/sa1100fb.h Mon Aug 27 12:41:46 2001
+++ linux/drivers/video/sa1100fb.h Thu Oct 25 13:53:52 2001


@@ -51,10 +51,10 @@
X

X /* Shadows for LCD controller registers */
X struct sa1100fb_lcd_reg {
- Word lccr0;
- Word lccr1;
- Word lccr2;
- Word lccr3;
+ unsigned long lccr0;
+ unsigned long lccr1;
+ unsigned long lccr2;
+ unsigned long lccr3;
X };
X
X #define RGB_8 (0)
diff -u --recursive --new-file v2.4.13/linux/drivers/video/sis/sis_main.c linux/drivers/video/sis/sis_main.c
--- v2.4.13/linux/drivers/video/sis/sis_main.c Tue Oct 23 22:48:53 2001
+++ linux/drivers/video/sis/sis_main.c Thu Oct 25 13:53:52 2001
@@ -31,7 +31,6 @@
X #include <linux/fs.h>
X
X #include <asm/io.h>
-#include <asm/mtrr.h>


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 41'
echo 'File patch-2.4.14 is continued in part 42'
echo "42" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:53 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part30

#!/bin/sh -x
# this is part 30 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 30; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

@@ -2875,7 +2875,7 @@
X MOD_INC_USE_COUNT;
X if (info->buffer == NULL)
X info->buffer = (char *) kmalloc(SECTOR_BUFFER_SIZE, GFP_KERNEL);
- if ((info->buffer == NULL) || (rc = cdrom_fops.open(ip, fp))) {
+ if ((info->buffer == NULL) || (rc = cdrom_open(ip, fp))) {
X drive->usage--;
X MOD_DEC_USE_COUNT;
X }
@@ -2886,14 +2886,14 @@
X void ide_cdrom_release (struct inode *inode, struct file *file,
X ide_drive_t *drive)
X {
- cdrom_fops.release (inode, file);
+ cdrom_release (inode, file);
X MOD_DEC_USE_COUNT;
X }
X
X static
X int ide_cdrom_check_media_change (ide_drive_t *drive)
X {
- return cdrom_fops.check_media_change(MKDEV (HWIF (drive)->major,
+ return cdrom_media_changed(MKDEV (HWIF (drive)->major,
X (drive->select.b.unit) << PARTN_BITS));
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/ide/ide-pci.c linux/drivers/ide/ide-pci.c
--- v2.4.13/linux/drivers/ide/ide-pci.c Tue Oct 9 17:06:51 2001
+++ linux/drivers/ide/ide-pci.c Thu Oct 25 13:53:47 2001
@@ -37,6 +37,7 @@
X #define DEVID_PIIX4NX ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX})
X #define DEVID_PIIX4U3 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_9})
X #define DEVID_PIIX4U4 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_8})
+#define DEVID_PIIX4U5 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10})
X #define DEVID_VIA_IDE ((ide_pci_devid_t){PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561})
X #define DEVID_MR_IDE ((ide_pci_devid_t){PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1})
X #define DEVID_VP_IDE ((ide_pci_devid_t){PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1})
@@ -385,6 +386,7 @@
X {DEVID_PIIX4NX, "PIIX4", PCI_PIIX, NULL, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 },
X {DEVID_PIIX4U3, "PIIX4", PCI_PIIX, ATA66_PIIX, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 },
X {DEVID_PIIX4U4, "PIIX4", PCI_PIIX, ATA66_PIIX, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 },
+ {DEVID_PIIX4U5, "PIIX4", PCI_PIIX, ATA66_PIIX, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 },
X {DEVID_VIA_IDE, "VIA_IDE", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 },
X {DEVID_MR_IDE, "VP_IDE", PCI_VIA82CXXX, ATA66_VIA82CXXX,INIT_VIA82CXXX, DMA_VIA82CXXX, {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, ON_BOARD, 0 },
X {DEVID_VP_IDE, "VP_IDE", PCI_VIA82CXXX, ATA66_VIA82CXXX,INIT_VIA82CXXX, DMA_VIA82CXXX, {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, ON_BOARD, 0 },
diff -u --recursive --new-file v2.4.13/linux/drivers/ide/ide.c linux/drivers/ide/ide.c
--- v2.4.13/linux/drivers/ide/ide.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/ide/ide.c Thu Oct 25 13:58:35 2001
@@ -1950,11 +1950,9 @@
X static int ide_open (struct inode * inode, struct file * filp)
X {
X ide_drive_t *drive;
- int rc;
X
X if ((drive = get_info_ptr(inode->i_rdev)) == NULL)
X return -ENXIO;
- MOD_INC_USE_COUNT;
X if (drive->driver == NULL)
X ide_driver_module();
X #ifdef CONFIG_KMOD
@@ -1972,14 +1970,10 @@
X while (drive->busy)
X sleep_on(&drive->wqueue);
X drive->usage++;
- if (drive->driver != NULL) {
- if ((rc = DRIVER(drive)->open(inode, filp, drive)))
- MOD_DEC_USE_COUNT;
- return rc;
- }
+ if (drive->driver != NULL)
+ return DRIVER(drive)->open(inode, filp, drive);
X printk ("%s: driver not present\n", drive->name);
X drive->usage--;


- MOD_DEC_USE_COUNT;
X return -ENXIO;
X }
X

@@ -1995,7 +1989,6 @@
X drive->usage--;
X if (drive->driver != NULL)
X DRIVER(drive)->release(inode, file, drive);
- MOD_DEC_USE_COUNT;


X }
X return 0;
X }

@@ -3643,6 +3636,7 @@
X }
X
X struct block_device_operations ide_fops[] = {{
+ owner: THIS_MODULE,
X open: ide_open,
X release: ide_release,
X ioctl: ide_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/ide/pdc202xx.c linux/drivers/ide/pdc202xx.c
--- v2.4.13/linux/drivers/ide/pdc202xx.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/ide/pdc202xx.c Thu Oct 25 13:53:47 2001
@@ -563,7 +563,7 @@
X
X if (((ultra_66) || (ultra_100)) && (EP & c_mask)) {
X #ifdef DEBUG
- printk("ULTRA66: %s channel of Ultra 66 requires an 80-pin cable for Ultra66 operation.\n", hwif->channel ? "Secondary", "Primary");
+ printk("ULTRA66: %s channel of Ultra 66 requires an 80-pin cable for Ultra66 operation.\n", hwif->channel ? "Secondary" : "Primary");
X printk(" Switching to Ultra33 mode.\n");
X #endif /* DEBUG */
X /* Primary : zero out second bit */
diff -u --recursive --new-file v2.4.13/linux/drivers/ide/piix.c linux/drivers/ide/piix.c
--- v2.4.13/linux/drivers/ide/piix.c Mon Aug 27 12:41:41 2001
+++ linux/drivers/ide/piix.c Thu Oct 25 13:53:47 2001
@@ -91,6 +91,7 @@
X switch(bmide_dev->device) {
X case PCI_DEVICE_ID_INTEL_82801BA_8:
X case PCI_DEVICE_ID_INTEL_82801BA_9:
+ case PCI_DEVICE_ID_INTEL_82801CA_10:
X p += sprintf(p, "\n Intel PIIX4 Ultra 100 Chipset.\n");
X break;
X case PCI_DEVICE_ID_INTEL_82372FB_1:


@@ -364,7 +365,8 @@
X

X byte udma_66 = eighty_ninty_three(drive);
X int ultra100 = ((dev->device == PCI_DEVICE_ID_INTEL_82801BA_8) ||
- (dev->device == PCI_DEVICE_ID_INTEL_82801BA_9)) ? 1 : 0;
+ (dev->device == PCI_DEVICE_ID_INTEL_82801BA_9) ||
+ (dev->device == PCI_DEVICE_ID_INTEL_82801CA_10)) ? 1 : 0;
X int ultra66 = ((ultra100) ||
X (dev->device == PCI_DEVICE_ID_INTEL_82801AA_1) ||
X (dev->device == PCI_DEVICE_ID_INTEL_82372FB_1)) ? 1 : 0;
diff -u --recursive --new-file v2.4.13/linux/drivers/ide/q40ide.c linux/drivers/ide/q40ide.c
--- v2.4.13/linux/drivers/ide/q40ide.c Tue Dec 5 12:43:47 2000
+++ linux/drivers/ide/q40ide.c Thu Oct 25 13:53:47 2001
@@ -41,8 +41,11 @@


X * Offsets from one of the above bases

X */
X
+
+/* HD_DATA was redefined in asm-m68k/ide.h */
X #undef HD_DATA
X #define HD_DATA 0x1f0
+
X
X #define PCIDE_REG(x) ((q40ide_ioreg_t)(HD_##x-PCIDE_BASE1))
X
diff -u --recursive --new-file v2.4.13/linux/drivers/isdn/hisax/md5sums.asc linux/drivers/isdn/hisax/md5sums.asc
--- v2.4.13/linux/drivers/isdn/hisax/md5sums.asc Sun Aug 12 13:27:59 2001
+++ linux/drivers/isdn/hisax/md5sums.asc Wed Oct 24 15:34:51 2001
@@ -6,17 +6,17 @@
X # in the moment.
X # Read ../../../Documentation/isdn/HiSax.cert for more informations.
X #
-6f9433a8b696076562562d090e3c420f isac.c
-13c3eed869f5139f44c563e3a8fea1f5 isdnl1.c
-addcff863b0ff1e366c0f2ae9fa6e81e isdnl2.c
-7076deb94a363945c21ea27aca4a720a isdnl3.c
-51c603829b6cc4f8421f744ad657ceff tei.c
-669050ab5079f02887ed0239d86e5474 callc.c
-ecacd146b8f8881ef9349935dab3df4a cert.c
-fadeb3b85bb23bc1ac48470c0848d6fa l3dss1.c
-cf7dec9fac6283716904d26b99188476 l3_1tr6.c
-2f75c8765e1be13d114d5f4433cf364b elsa.c
-b4cf8a4dceed9ea6dcba65a85b4eecc7 diva.c
-dee3f8f40c6fe78a4b57729804b7e6cd sedlbauer.c
-0d79fe6dfc5bfaa4826970c41a6d273d hfc_pci.c
+d08b59f56fb9ed1fbd17713342c75081 isac.c
+e81e6e96f307e55f8b9777aca2b356d9 isdnl1.c
+cfd2527d9fb01885484cba74bfc67121 isdnl2.c
+8c6829f11459f9d044b5768803fb646d isdnl3.c
+d40f88dff4191d2660240749cbdcb688 tei.c
+3bd3bd05ee4cb25ffe046200b569a83a callc.c
+d518f52402ebc3f1be84e09af375313c cert.c
+c425de1f8be86e84006de63c9bb3cc5f l3dss1.c
+4c411e29d4103ba60e9af4e3e1234a99 l3_1tr6.c
+68c6cc2784f208e3247a5a555918d014 elsa.c
+8d63a85d7222cf7b40e663e543191d8f diva.c
+8c8cb4ce621fb84d8e337a696e75b0df sedlbauer.c
+ebe5613d535748409407568435b2be97 hfc_pci.c
X # end of md5sums
diff -u --recursive --new-file v2.4.13/linux/drivers/isdn/hisax/niccy.c linux/drivers/isdn/hisax/niccy.c
--- v2.4.13/linux/drivers/isdn/hisax/niccy.c Tue Oct 9 17:06:51 2001
+++ linux/drivers/isdn/hisax/niccy.c Wed Oct 24 15:34:51 2001
@@ -1,4 +1,4 @@
-/* $Id: niccy.c,v 1.15.6.5 2001/09/23 22:24:50 kai Exp $
+/* $Id: niccy.c,v 1.15.6.6 2001/10/20 22:08:24 kai Exp $
X *
X * low level stuff for Dr. Neuhaus NICCY PnP and NICCY PCI and
X * compatible (SAGEM cybermodem)
@@ -24,7 +24,7 @@
X #include <linux/pci.h>
X
X extern const char *CardType[];
-const char *niccy_revision = "$Revision: 1.15.6.5 $";
+const char *niccy_revision = "$Revision: 1.15.6.6 $";
X
X #define byteout(addr,val) outb(val,addr)
X #define bytein(addr) inb(addr)
@@ -197,7 +197,7 @@
X val = inl(cs->hw.niccy.cfg_reg + PCI_IRQ_CTRL_REG);
X val &= PCI_IRQ_DISABLE;
X outl(val, cs->hw.niccy.cfg_reg + PCI_IRQ_CTRL_REG);
- release_region(cs->hw.niccy.cfg_reg, 0x80);
+ release_region(cs->hw.niccy.cfg_reg, 0x40);
X release_region(cs->hw.niccy.isac, 4);
X } else {
X release_region(cs->hw.niccy.isac, 2);
@@ -324,16 +324,16 @@
X return (0);
X } else
X request_region(cs->hw.niccy.isac, 4, "niccy");
- if (check_region(cs->hw.niccy.cfg_reg, 0x80)) {
+ if (check_region(cs->hw.niccy.cfg_reg, 0x40)) {
X printk(KERN_WARNING
X "HiSax: %s pci port %x-%x already in use\n",
X CardType[card->typ],
X cs->hw.niccy.cfg_reg,
- cs->hw.niccy.cfg_reg + 0x80);
+ cs->hw.niccy.cfg_reg + 0x40);
X release_region(cs->hw.niccy.isac, 4);
X return (0);
X } else {
- request_region(cs->hw.niccy.cfg_reg, 0x80, "niccy pci");
+ request_region(cs->hw.niccy.cfg_reg, 0x40, "niccy pci");
X }
X #else
X printk(KERN_WARNING "Niccy: io0 0 and NO_PCI_BIOS\n");
diff -u --recursive --new-file v2.4.13/linux/drivers/isdn/hisax/st5481_d.c linux/drivers/isdn/hisax/st5481_d.c
--- v2.4.13/linux/drivers/isdn/hisax/st5481_d.c Tue Oct 9 17:06:51 2001
+++ linux/drivers/isdn/hisax/st5481_d.c Wed Oct 24 15:34:51 2001
@@ -174,7 +174,6 @@
X
X va_start(args, fmt);
X vsprintf(buf, fmt, args);
- printk("buf %s\n", buf);
X DBG(8, "%s", buf);
X va_end(args);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/isdn/hisax/st5481_usb.c linux/drivers/isdn/hisax/st5481_usb.c
--- v2.4.13/linux/drivers/isdn/hisax/st5481_usb.c Tue Oct 9 17:06:51 2001
+++ linux/drivers/isdn/hisax/st5481_usb.c Wed Oct 24 15:34:51 2001


@@ -427,8 +427,8 @@
X

X // Fill the isochronous URB
X fill_isoc_urb(urb[j], dev, pipe, buf,
- num_packets, packet_size, complete,
- context);
+ num_packets, packet_size, complete,
+ context);
X }
X return 0;
X
diff -u --recursive --new-file v2.4.13/linux/drivers/isdn/isdn_ppp.c linux/drivers/isdn/isdn_ppp.c
--- v2.4.13/linux/drivers/isdn/isdn_ppp.c Tue Oct 9 17:06:51 2001
+++ linux/drivers/isdn/isdn_ppp.c Wed Oct 24 15:34:51 2001
@@ -2453,10 +2453,15 @@
X /* if we RECEIVE an ackowledge we enable the decompressor */
X if(is->debug & 0x10)
X printk(KERN_DEBUG "Enable decompression here!\n");
- if(proto == PPP_CCP)
+ if(proto == PPP_CCP) {
+ if (!mis->decompressor)
+ break;
X mis->compflags |= SC_DECOMP_ON;
- else
+ } else {
+ if (!is->decompressor)
+ break;
X is->compflags |= SC_LINK_DECOMP_ON;
+ }
X break;
X
X case CCP_RESETACK:
@@ -2620,10 +2625,15 @@
X /* if we SEND an ackowledge we can/must enable the compressor */
X if(is->debug & 0x10)
X printk(KERN_DEBUG "Enable compression here!\n");
- if(proto == PPP_CCP)
+ if(proto == PPP_CCP) {
+ if (!is->compressor)
+ break;
X is->compflags |= SC_COMP_ON;
- else
+ } else {
+ if (!is->compressor)
+ break;
X is->compflags |= SC_LINK_COMP_ON;
+ }
X break;
X case CCP_RESETACK:
X /* If we send a ACK we should reset our compressor */
diff -u --recursive --new-file v2.4.13/linux/drivers/md/lvm.c linux/drivers/md/lvm.c
--- v2.4.13/linux/drivers/md/lvm.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/md/lvm.c Thu Oct 25 13:58:35 2001
@@ -357,6 +357,7 @@
X
X static struct file_operations lvm_chr_fops =
X {
+ owner: THIS_MODULE,
X open: lvm_chr_open,
X release: lvm_chr_close,
X ioctl: lvm_chr_ioctl,
@@ -366,6 +367,7 @@
X /* block device operations structure needed for 2.3.38? and above */
X static struct block_device_operations lvm_blk_dops =
X {
+ owner: THIS_MODULE,
X open: lvm_blk_open,
X release: lvm_blk_close,
X ioctl: lvm_blk_ioctl,
@@ -544,8 +546,6 @@
X
X lvm_chr_open_count++;
X
- MOD_INC_USE_COUNT;
-
X return 0;
X } /* lvm_chr_open() */
X
@@ -786,8 +786,6 @@
X wake_up_interruptible(&lvm_wait);
X }
X
- MOD_DEC_USE_COUNT;
-
X return 0;
X } /* lvm_chr_close() */
X
@@ -840,8 +838,6 @@
X if (lv_ptr->lv_open == 0) vg_ptr->lv_open++;
X lv_ptr->lv_open++;
X
- MOD_INC_USE_COUNT;
-
X #ifdef DEBUG_LVM_BLK_OPEN
X printk(KERN_DEBUG
X "%s -- lvm_blk_open MINOR: %d VG#: %d LV#: %d size: %d\n",
@@ -1042,8 +1038,6 @@
X
X if (lv_ptr->lv_open == 1) vg_ptr->lv_open--;
X lv_ptr->lv_open--;
-
- MOD_DEC_USE_COUNT;
X
X return 0;
X } /* lvm_blk_close() */
diff -u --recursive --new-file v2.4.13/linux/drivers/md/md.c linux/drivers/md/md.c
--- v2.4.13/linux/drivers/md/md.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/md/md.c Thu Oct 25 13:58:34 2001
@@ -2895,6 +2895,7 @@
X
X static struct block_device_operations md_fops=
X {
+ owner: THIS_MODULE,
X open: md_open,
X release: md_release,
X ioctl: md_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/media/video/cpia.c linux/drivers/media/video/cpia.c
--- v2.4.13/linux/drivers/media/video/cpia.c Tue Oct 9 17:06:51 2001
+++ linux/drivers/media/video/cpia.c Thu Oct 25 13:53:47 2001
@@ -56,8 +56,9 @@
X
X #ifdef MODULE
X MODULE_PARM(video_nr,"i");
-MODULE_AUTHOR("Scott J. Bertin <sbe...@mindspring.com> & Peter Pregler <Peter_...@email.com> & Johannes Erdfelt <joha...@erdfelt.com>");
+MODULE_AUTHOR("Scott J. Bertin <sbe...@mindspring.com> & Peter Pregler <Peter_...@email.com> & Johannes Erdfelt <jerd...@valinux.com>");
X MODULE_DESCRIPTION("V4L-driver for Vision CPiA based cameras");
+MODULE_LICENSE("GPL");
X MODULE_SUPPORTED_DEVICE("video");
X #endif
X
@@ -2869,7 +2870,7 @@
X
X /* set video size */
X video_size = match_videosize(vm.width, vm.height);
- if (cam->video_size < 0) {
+ if (video_size < 0) {
X retval = -EINVAL;
X break;
X }
@@ -3253,41 +3254,7 @@
X }
X }
X
-/****************************************************************************
- *
- * Module routines
- *
- ***************************************************************************/
-
-#ifdef MODULE
-int init_module(void)
-{
- printk(KERN_INFO "%s v%d.%d.%d\n", ABOUT,
- CPIA_MAJ_VER, CPIA_MIN_VER, CPIA_PATCH_VER);
-#ifdef CONFIG_PROC_FS
- proc_cpia_create();
-#endif
-#ifdef CONFIG_KMOD
-#ifdef CONFIG_VIDEO_CPIA_PP_MODULE
- request_module("cpia_pp");
-#endif
-#ifdef CONFIG_VIDEO_CPIA_USB_MODULE
- request_module("cpia_usb");
-#endif
-#endif
-return 0;
-}
-
-void cleanup_module(void)
-{
-#ifdef CONFIG_PROC_FS
- proc_cpia_destroy();
-#endif
-}
-
-#else
-
-int cpia_init(struct video_init *unused)
+static int __init cpia_init(void)
X {
X printk(KERN_INFO "%s v%d.%d.%d\n", ABOUT,
X CPIA_MAJ_VER, CPIA_MIN_VER, CPIA_PATCH_VER);
@@ -3313,9 +3280,17 @@


X return 0;
X }
X

+static void __exit cpia_exit(void)
+{
+#ifdef CONFIG_PROC_FS
+ proc_cpia_destroy();
+#endif
+}
+
+module_init(cpia_init);
+module_exit(cpia_exit);
+
X /* Exported symbols for modules. */
X
X EXPORT_SYMBOL(cpia_register_camera);
X EXPORT_SYMBOL(cpia_unregister_camera);
-
-#endif
diff -u --recursive --new-file v2.4.13/linux/drivers/media/video/cpia.h linux/drivers/media/video/cpia.h
--- v2.4.13/linux/drivers/media/video/cpia.h Fri Mar 2 11:12:10 2001
+++ linux/drivers/media/video/cpia.h Thu Oct 25 13:53:47 2001
@@ -416,6 +416,26 @@
X } while (0)
X
X
+static inline void cpia_add_to_list(struct cam_data* l, struct cam_data* drv)
+{
+ drv->next = l;
+ drv->previous = &l;
+ l = drv;
+}
+
+
+static inline void cpia_remove_from_list(struct cam_data* drv)
+{
+ if (drv->previous != NULL) {
+ if (drv->next != NULL)
+ drv->next->previous = drv->previous;
+ *(drv->previous) = drv->next;
+ drv->previous = NULL;
+ drv->next = NULL;
+ }
+}
+
+
X #endif /* __KERNEL__ */
X
X #endif /* cpia_h */
diff -u --recursive --new-file v2.4.13/linux/drivers/media/video/cpia_pp.c linux/drivers/media/video/cpia_pp.c
--- v2.4.13/linux/drivers/media/video/cpia_pp.c Fri Mar 2 11:12:10 2001
+++ linux/drivers/media/video/cpia_pp.c Thu Oct 25 13:53:47 2001
@@ -123,6 +123,8 @@
X
X MODULE_AUTHOR("B. Huisman <bhu...@cs.utwente.nl> & Peter Pregler <Peter_...@email.com>");
X MODULE_DESCRIPTION("Parallel port driver for Vision CPiA based cameras");
+MODULE_LICENSE("GPL");
+
X MODULE_PARM(parport, "1-" __MODULE_STRING(PARPORT_MAX) "s");
X MODULE_PARM_DESC(parport, "'auto' or a list of parallel port numbers. Just like lp.");
X #else
@@ -158,6 +160,7 @@
X };
X
X static struct cam_data *cam_list;
+static spinlock_t cam_list_lock_pp;
X
X #ifdef _CPIA_DEBUG_
X #define DEB_PORT(port) { \
@@ -582,7 +585,9 @@
X kfree(cam);
X return -ENXIO;
X }
- ADD_TO_LIST(cam_list, cpia);
+ spin_lock( &cam_list_lock_pp );
+ cpia_add_to_list(cam_list, cpia);
+ spin_unlock( &cam_list_lock_pp );


X
X return 0;
X }

@@ -591,11 +596,12 @@
X {
X struct cam_data *cpia;
X
+ spin_lock( &cam_list_lock_pp );
X for(cpia = cam_list; cpia != NULL; cpia = cpia->next) {
X struct pp_cam_entry *cam = cpia->lowlevel_data;
X if (cam && cam->port->number == port->number) {
- REMOVE_FROM_LIST(cpia);
-
+ cpia_remove_from_list(cpia);
+ spin_unlock( &cam_list_lock_pp );
X cpia_unregister_camera(cpia);
X
X if(cam->open_count > 0) {
@@ -660,6 +666,9 @@
X LOG ("unable to register with parport\n");


X return -EIO;
X }
+

+ cam_list = NULL;
+ spin_lock_init( &cam_list_lock_pp );
X
X return 0;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/media/video/cpia_usb.c linux/drivers/media/video/cpia_usb.c
--- v2.4.13/linux/drivers/media/video/cpia_usb.c Tue Oct 9 17:06:51 2001
+++ linux/drivers/media/video/cpia_usb.c Thu Oct 25 13:53:47 2001
@@ -104,6 +104,7 @@
X };
X
X static struct cam_data *cam_list;
+static spinlock_t cam_list_lock_usb;
X
X static void cpia_usb_complete(struct urb *urb)
X {
@@ -536,7 +537,9 @@
X goto fail_all;
X }
X
- ADD_TO_LIST(cam_list, cam);
+ spin_lock( &cam_list_lock_usb );
+ cpia_add_to_list(cam_list, cam);
+ spin_unlock( &cam_list_lock_usb );
X
X return cam;
X
@@ -563,6 +566,8 @@
X };
X
X MODULE_DEVICE_TABLE (usb, cpia_id_table);
+MODULE_LICENSE("GPL");
+
X
X static struct usb_driver cpia_driver = {
X name: "cpia",
@@ -579,8 +584,10 @@
X struct cam_data *cam = (struct cam_data *) ptr;
X struct usb_cpia *ucpia = (struct usb_cpia *) cam->lowlevel_data;
X
- REMOVE_FROM_LIST(cam);
-
+ spin_lock( &cam_list_lock_usb );
+ cpia_remove_from_list(cam);
+ spin_unlock( &cam_list_lock_usb );
+
X /* Don't even try to reset the altsetting if we're disconnected */
X cpia_usb_free_resources(ucpia, 0);
X
@@ -620,7 +627,7 @@
X static int __init usb_cpia_init(void)
X {
X cam_list = NULL;
-
+ spin_lock_init(&cam_list_lock_usb);
X return usb_register(&cpia_driver);
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/media/video/meye.c linux/drivers/media/video/meye.c
--- v2.4.13/linux/drivers/media/video/meye.c Tue Oct 9 17:06:51 2001
+++ linux/drivers/media/video/meye.c Thu Oct 25 13:53:47 2001
@@ -35,6 +35,7 @@
X #include <linux/delay.h>
X #include <linux/wrapper.h>
X #include <linux/interrupt.h>
+#include <linux/vmalloc.h>
X
X #include "meye.h"
X #include "linux/meye.h"
@@ -1482,6 +1483,7 @@
X MODULE_DESCRIPTION("video4linux driver for the MotionEye camera");
X MODULE_LICENSE("GPL");
X
+EXPORT_NO_SYMBOLS;
X
X MODULE_PARM(gbuffers,"i");
X MODULE_PARM_DESC(gbuffers,"number of capture buffers, default is 2 (32 max)");
diff -u --recursive --new-file v2.4.13/linux/drivers/media/video/planb.c linux/drivers/media/video/planb.c
--- v2.4.13/linux/drivers/media/video/planb.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/media/video/planb.c Thu Oct 25 13:53:47 2001
@@ -64,7 +64,7 @@
X
X #if 0
X #define IDEBUG(x...) printk(KERN_DEBUG ## x) /* Debug interrupt part */
-#endif
+#else
X #define IDEBUG(x...) /* Don't debug interrupt part */
X #endif
X
diff -u --recursive --new-file v2.4.13/linux/drivers/message/i2o/i2o_block.c linux/drivers/message/i2o/i2o_block.c
--- v2.4.13/linux/drivers/message/i2o/i2o_block.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/message/i2o/i2o_block.c Thu Oct 25 13:58:35 2001
@@ -1247,7 +1247,6 @@
X
X DEBUG("Unclaim\n");
X }
- MOD_DEC_USE_COUNT;


X return 0;
X }
X

@@ -1306,7 +1305,6 @@
X i2o_post_wait(dev->controller, msg, 20, 2);
X DEBUG("Ready.\n");
X }
- MOD_INC_USE_COUNT;


X return 0;
X }
X

@@ -1371,34 +1369,34 @@
X
X for(i=unit;i<=unit+15;i++)
X {
- if(d->controller->type == I2O_TYPE_PCI && d->controller->bus.pci.queue_buggy)
+ i2ob_max_sectors[i] = 256;
+ i2ob_dev[i].max_segments = (d->controller->status_block->inbound_frame_size - 8)/2;
+
+ if(d->controller->type == I2O_TYPE_PCI && d->controller->bus.pci.queue_buggy == 2)
+ i2ob_dev[i].depth = 32;
+
+ if(d->controller->type == I2O_TYPE_PCI && d->controller->bus.pci.queue_buggy == 1)
X {
X i2ob_max_sectors[i] = 32;
X i2ob_dev[i].max_segments = 8;
X i2ob_dev[i].depth = 4;
X }
- else if(d->controller->type == I2O_TYPE_PCI && d->controller->bus.pci.short_req)
+
+ if(d->controller->type == I2O_TYPE_PCI && d->controller->bus.pci.short_req)
X {
X i2ob_max_sectors[i] = 8;
X i2ob_dev[i].max_segments = 8;
X }
- else
- {
- /* MAX_SECTORS was used but 255 is a dumb number for
- striped RAID */
- i2ob_max_sectors[i]=256;
- i2ob_dev[i].max_segments = (d->controller->status_block->inbound_frame_size - 8)/2;
- }
X }
X
- printk(KERN_INFO "Max segments set to %d\n",
- i2ob_dev[unit].max_segments);
- printk(KERN_INFO "Byte limit is %d.\n", limit);
X
- i2ob_query_device(dev, 0x0000, 0, &type, 1);
-
X sprintf(d->dev_name, "%s%c", i2ob_gendisk.major_name, 'a' + (unit>>4));
X
+ printk(KERN_INFO "%s: Max segments %d, queue depth %d, byte limit %d.\n",
+ d->dev_name, i2ob_dev[unit].max_segments, i2ob_dev[unit].depth, limit);
+
+ i2ob_query_device(dev, 0x0000, 0, &type, 1);
+
X printk(KERN_INFO "%s: ", d->dev_name);
X switch(type)
X {
@@ -1417,7 +1415,7 @@
X printk(KERN_INFO " Not loaded.\n");
X return 1;
X }
- printk("- %dMb, %d byte sectors",
+ printk(": %dMB, %d byte sectors",
X (int)(size>>20), blocksize);
X if(status&(1<<0))
X {
@@ -1838,6 +1836,7 @@
X
X static struct block_device_operations i2ob_fops =
X {
+ owner: THIS_MODULE,
X open: i2ob_open,
X release: i2ob_release,
X ioctl: i2ob_ioctl,
diff -u --recursive --new-file v2.4.13/linux/drivers/message/i2o/i2o_pci.c linux/drivers/message/i2o/i2o_pci.c
--- v2.4.13/linux/drivers/message/i2o/i2o_pci.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/message/i2o/i2o_pci.c Thu Oct 25 13:53:47 2001
@@ -192,6 +192,8 @@
X if(dev->subsystem_vendor == PCI_VENDOR_ID_PROMISE)
X {
X c->bus.pci.queue_buggy=1;
+ if (dev->subsystem_device == 0x0000) /* SX6000 ???? */
+ c->bus.pci.queue_buggy=2;
X printk(KERN_INFO "I2O: Promise workarounds activated.\n");
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/message/i2o/i2o_proc.c linux/drivers/message/i2o/i2o_proc.c
--- v2.4.13/linux/drivers/message/i2o/i2o_proc.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/message/i2o/i2o_proc.c Thu Oct 25 13:53:47 2001
@@ -955,13 +955,14 @@
X i2o_driver_result_table *result;
X i2o_driver_store_table *dst;
X
- spin_lock(&i2o_proc_lock);
X
X len = 0;
X
X result = kmalloc(sizeof(i2o_driver_result_table), GFP_KERNEL);
X if(result == NULL)
X return -ENOMEM;
+
+ spin_lock(&i2o_proc_lock);
X
X token = i2o_query_table(I2O_PARAMS_TABLE_GET,
X c, ADAPTER_TID, 0x0005, -1, NULL, 0,
diff -u --recursive --new-file v2.4.13/linux/drivers/mtd/chips/cfi_cmdset_0002.c linux/drivers/mtd/chips/cfi_cmdset_0002.c
--- v2.4.13/linux/drivers/mtd/chips/cfi_cmdset_0002.c Tue Oct 9 17:06:51 2001
+++ linux/drivers/mtd/chips/cfi_cmdset_0002.c Thu Oct 25 00:07:09 2001
@@ -8,7 +8,7 @@
X *
X * This code is GPL
X *
- * $Id: cfi_cmdset_0002.c,v 1.51 2001/10/02 15:05:12 dwmw2 Exp $
+ * $Id: cfi_cmdset_0002.c,v 1.52 2001/10/24 09:37:30 dwmw2 Exp $
X *
X */
X
@@ -66,7 +66,7 @@
X major = cfi_read_query(map, base + (adr+3)*ofs_factor);
X minor = cfi_read_query(map, base + (adr+4)*ofs_factor);
X
- printk(" Amd/Fujitsu Extended Query Table v%c.%c at 0x%4.4X\n",
+ printk(KERN_NOTICE " Amd/Fujitsu Extended Query Table v%c.%c at 0x%4.4X\n",
X major, minor, adr);
X cfi_send_gen_cmd(0xf0, 0x55, base, map, cfi, cfi->device_type, NULL);
X
@@ -148,10 +148,10 @@
X unsigned long devsize = (1<<cfi->cfiq->DevSize) * cfi->interleave;
X
X mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
- printk("number of %s chips: %d\n", (cfi->cfi_mode)?"JEDEC":"CFI",cfi->numchips);
+ printk(KERN_NOTICE "number of %s chips: %d\n", (cfi->cfi_mode)?"CFI":"JEDEC",cfi->numchips);
X
X if (!mtd) {
- printk("Failed to allocate memory for MTD device\n");
+ printk(KERN_WARNING "Failed to allocate memory for MTD device\n");
X kfree(cfi->cmdset_priv);
X return NULL;
X }
@@ -172,7 +172,7 @@
X mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips;
X mtd->eraseregions = kmalloc(sizeof(struct mtd_erase_region_info) * mtd->numeraseregions, GFP_KERNEL);
X if (!mtd->eraseregions) {
- printk("Failed to allocate memory for MTD erase region info\n");
+ printk(KERN_WARNING "Failed to allocate memory for MTD erase region info\n");
X kfree(cfi->cmdset_priv);
X return NULL;
X }
@@ -194,11 +194,12 @@
X }
X if (offset != devsize) {
X /* Argh */
- printk("Sum of regions (%lx) != total size of set of interleaved chips (%lx)\n", offset, devsize);
+ printk(KERN_WARNING "Sum of regions (%lx) != total size of set of interleaved chips (%lx)\n", offset, devsize);
X kfree(mtd->eraseregions);
X kfree(cfi->cmdset_priv);
X return NULL;
X }
+#if 0
X // debug
X for (i=0; i<mtd->numeraseregions;i++){
X printk("%d: offset=0x%x,size=0x%x,blocks=%d\n",
@@ -206,6 +207,7 @@
X mtd->eraseregions[i].erasesize,
X mtd->eraseregions[i].numblocks);
X }
+#endif
X }
X
X switch (CFIDEV_BUSWIDTH)
@@ -224,7 +226,7 @@


X break;
X
X default:

- printk("Unsupported buswidth\n");
+ printk(KERN_WARNING "Unsupported buswidth\n");
X kfree(mtd);
X kfree(cfi->cmdset_priv);
X return NULL;
@@ -249,7 +251,9 @@
X cfi_spin_lock(chip->mutex);
X
X if (chip->state != FL_READY){
- printk("Waiting for chip to read, status = %d\n", chip->state);
+#if 0
+ printk(KERN_DEBUG "Waiting for chip to read, status = %d\n", chip->state);
+#endif
X set_current_state(TASK_UNINTERRUPTIBLE);
X add_wait_queue(&chip->wq, &wait);
X
@@ -332,7 +336,9 @@
X cfi_spin_lock(chip->mutex);
X
X if (chip->state != FL_READY){
- printk("Waiting for chip to write, status = %d\n", chip->state);
+#if 0
+ printk(KERN_DEBUG "Waiting for chip to write, status = %d\n", chip->state);
+#endif
X set_current_state(TASK_UNINTERRUPTIBLE);
X add_wait_queue(&chip->wq, &wait);
X
@@ -340,8 +346,8 @@
X
X schedule();
X remove_wait_queue(&chip->wq, &wait);
- printk("Wake up to write:\n");
X #if 0
+ printk(KERN_DEBUG "Wake up to write:\n");
X if(signal_pending(current))
X return -EINTR;
X #endif
@@ -386,7 +392,7 @@
X }
X
X if (Last[(Count - 1) % 4] != datum){
- printk("Last[%ld] is %x, datum is %x\n",(Count - 1) % 4,Last[(Count - 1) % 4],datum);
+ printk(KERN_WARNING "Last[%ld] is %x, datum is %x\n",(Count - 1) % 4,Last[(Count - 1) % 4],datum);
X cfi_send_gen_cmd(0xF0, 0, chip->start, map, cfi, cfi->device_type, NULL);
X DISABLE_VPP(map);
X ret = -EIO;
@@ -600,7 +606,7 @@
X add_wait_queue(&chip->wq, &wait);
X
X cfi_spin_unlock(chip->mutex);
- printk("erase suspended. Sleeping\n");
+ printk(KERN_DEBUG "erase suspended. Sleeping\n");
X
X schedule();
X remove_wait_queue(&chip->wq, &wait);
@@ -617,7 +623,7 @@
X if (time_after(jiffies, timeo)) {
X chip->state = FL_READY;
X cfi_spin_unlock(chip->mutex);
- printk("waiting for erase to complete timed out.");
+ printk(KERN_WARNING "waiting for erase to complete timed out.");
X DISABLE_VPP(map);
X return -EIO;
X }


@@ -627,7 +633,7 @@
X

X z++;
X if ( 0 && !(z % 100 ))
- printk("chip not ready yet after erase. looping\n");
+ printk(KERN_WARNING "chip not ready yet after erase. looping\n");
X
X cfi_udelay(1);
X
@@ -914,7 +920,7 @@
X wake_up(&chip->wq);
X }
X else
- printk("Argh. Chip not in PM_SUSPENDED state upon resume()\n");
+ printk(KERN_ERR "Argh. Chip not in PM_SUSPENDED state upon resume()\n");
X
X cfi_spin_unlock(chip->mutex);
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/mtd/ftl.c linux/drivers/mtd/ftl.c
--- v2.4.13/linux/drivers/mtd/ftl.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/mtd/ftl.c Thu Oct 25 13:58:35 2001
@@ -235,6 +235,7 @@
X };
X #else
X static struct block_device_operations ftl_blk_fops = {
+ owner: THIS_MODULE,
X open: ftl_open,
X release: ftl_close,
X ioctl: ftl_ioctl,
@@ -894,16 +895,11 @@
X if (ftl_gendisk.part[minor].nr_sects == 0)
X return -ENXIO;
X
- MOD_INC_USE_COUNT;
-
- if (!get_mtd_device(partition->mtd, -1)) {
- MOD_DEC_USE_COUNT;
+ if (!get_mtd_device(partition->mtd, -1))
X return /* -E'SBUGGEREDOFF */ -ENXIO;
- }
-
+
X if ((file->f_mode & 2) && !(partition->mtd->flags & MTD_CLEAR_BITS) ) {
X put_mtd_device(partition->mtd);
- MOD_DEC_USE_COUNT;
X return -EROFS;
X }
X
@@ -939,7 +935,6 @@
X atomic_dec(&part->open);
X
X put_mtd_device(part->mtd);
- MOD_DEC_USE_COUNT;
X release_return(0);
X } /* ftl_close */
X
diff -u --recursive --new-file v2.4.13/linux/drivers/mtd/mtdblock.c linux/drivers/mtd/mtdblock.c
--- v2.4.13/linux/drivers/mtd/mtdblock.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/mtd/mtdblock.c Thu Oct 25 13:58:35 2001
@@ -295,8 +295,6 @@


X return -ENODEV;
X }
X

- MOD_INC_USE_COUNT;
-
X spin_lock(&mtdblks_lock);
X
X /* If it's already open, no need to piss about. */
@@ -316,7 +314,6 @@
X mtdblk = kmalloc(sizeof(struct mtdblk_dev), GFP_KERNEL);
X if (!mtdblk) {
X put_mtd_device(mtd);
- MOD_DEC_USE_COUNT;
X return -ENOMEM;
X }
X memset(mtdblk, 0, sizeof(*mtdblk));
@@ -332,7 +329,6 @@
X if (!mtdblk->cache_data) {
X put_mtd_device(mtdblk->mtd);
X kfree(mtdblk);
- MOD_DEC_USE_COUNT;
X return -ENOMEM;
X }
X }
@@ -400,7 +396,6 @@
X
X DEBUG(MTD_DEBUG_LEVEL1, "ok\n");
X
- MOD_DEC_USE_COUNT;
X release_return(0);
X }
X
@@ -574,6 +569,7 @@
X #else
X static struct block_device_operations mtd_fops =
X {
+ owner: THIS_MODULE,
X open: mtdblock_open,
X release: mtdblock_release,
X ioctl: mtdblock_ioctl
diff -u --recursive --new-file v2.4.13/linux/drivers/mtd/mtdblock_ro.c linux/drivers/mtd/mtdblock_ro.c
--- v2.4.13/linux/drivers/mtd/mtdblock_ro.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/mtd/mtdblock_ro.c Thu Oct 25 13:58:35 2001
@@ -62,8 +62,6 @@


X return -EINVAL;
X }
X

- MOD_INC_USE_COUNT;
-
X mtd_sizes[dev] = mtd->size>>9;
X
X DEBUG(1, "ok\n");
@@ -88,7 +86,6 @@
X
X if (!mtd) {
X printk(KERN_WARNING "MTD device is absent on mtd_release!\n");
- MOD_DEC_USE_COUNT;
X release_return(-ENODEV);
X }
X
@@ -99,7 +96,6 @@
X
X DEBUG(1, "ok\n");
X
- MOD_DEC_USE_COUNT;
X release_return(0);
X }
X
@@ -244,6 +240,7 @@
X #else
X static struct block_device_operations mtd_fops =
X {
+ owner: THIS_MODULE,
X open: mtdblock_open,
X release: mtdblock_release,
X ioctl: mtdblock_ioctl
diff -u --recursive --new-file v2.4.13/linux/drivers/mtd/nftlcore.c linux/drivers/mtd/nftlcore.c
--- v2.4.13/linux/drivers/mtd/nftlcore.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/mtd/nftlcore.c Thu Oct 25 13:58:35 2001
@@ -984,11 +984,8 @@
X #endif /* !CONFIG_NFTL_RW */
X
X thisNFTL->usecount++;
- MOD_INC_USE_COUNT;
- if (!get_mtd_device(thisNFTL->mtd, -1)) {
- MOD_DEC_USE_COUNT;
+ if (!get_mtd_device(thisNFTL->mtd, -1))
X return /* -E'SBUGGEREDOFF */ -ENXIO;
- }


X
X return 0;
X }

@@ -1006,7 +1003,6 @@
X if (thisNFTL->mtd->sync)
X thisNFTL->mtd->sync(thisNFTL->mtd);
X thisNFTL->usecount--;
- MOD_DEC_USE_COUNT;
X
X put_mtd_device(thisNFTL->mtd);
X
@@ -1024,6 +1020,7 @@
X #else
X static struct block_device_operations nftl_fops =
X {
+ owner: THIS_MODULE,
X open: nftl_open,
X release: nftl_release,
X ioctl: nftl_ioctl
diff -u --recursive --new-file v2.4.13/linux/drivers/net/8139cp.c linux/drivers/net/8139cp.c
--- v2.4.13/linux/drivers/net/8139cp.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/net/8139cp.c Thu Oct 25 14:01:51 2001
@@ -17,23 +17,24 @@
X
X See the file COPYING in this distribution for more information.
X
- TODO:
+ TODO, in rough priority order:
X * dev->tx_timeout
+ * LinkChg interrupt
+ * ETHTOOL_[GS]SET
+ * Support forcing media type with a module parameter,
+ like dl2k.c/sundance.c
+ * Implement PCI suspend/resume
X * Constants (module parms?) for Rx work limit
X * support 64-bit PCI DMA
- * ETHTOOL_[GS]SET, ETHTOOL_GREGS, ETHTOOL_[GS]WOL,
- ETHTOOL_[GS]MSGLVL, ETHTOOL_NWAY_RST
X * Complete reset on PciErr
- * LinkChg and LenChg interrupts
X * Consider Rx interrupt mitigation using TimerIntr
- * Implement 8139C+ statistics dump
- * Support forcing media type with a module parameter,
- like dl2k.c/sundance.c
+ * Implement 8139C+ statistics dump; maybe not...
+ h/w stats can be reset only by software reset
X * Rx checksumming
X * Tx checksumming
+ * ETHTOOL_GREGS, ETHTOOL_[GS]WOL,
+ ETHTOOL_[GS]MSGLVL, ETHTOOL_NWAY_RST
X * Jumbo frames / dev->change_mtu
- * Tx abort stops Tx DMA?
- * Investigate IntrStatus bit 10 purpose and use
X * Investigate using skb->priority with h/w VLAN priority
X * Investigate using High Priority Tx Queue with skb->priority
X * Adjust Rx FIFO threshold and Max Rx DMA burst on Rx FIFO error
diff -u --recursive --new-file v2.4.13/linux/drivers/net/acenic.c linux/drivers/net/acenic.c
--- v2.4.13/linux/drivers/net/acenic.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/net/acenic.c Wed Oct 24 14:02:56 2001
@@ -1051,7 +1051,8 @@
X struct ace_private *ap;
X struct ace_regs *regs;
X struct ace_info *info = NULL;
- unsigned long tmp_ptr, myjif;
+ u64 tmp_ptr;
+ unsigned long myjif;
X u32 tig_ver, mac1, mac2, tmp, pci_state;
X int board_idx, ecode = 0;
X short i;
diff -u --recursive --new-file v2.4.13/linux/drivers/net/arcnet/arc-rimi.c linux/drivers/net/arcnet/arc-rimi.c
--- v2.4.13/linux/drivers/net/arcnet/arc-rimi.c Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/arcnet/arc-rimi.c Sun Nov 4 09:31:58 2001
@@ -2,7 +2,7 @@
X * Linux ARCnet driver - "RIM I" (entirely mem-mapped) cards
X *
X * Written 1994-1999 by Avery Pennarun.
- * Written 1999-2000 by Martin Mares <m...@suse.cz>.
+ * Written 1999-2000 by Martin Mares <m...@ucw.cz>.
X * Derived from skeleton.c by Donald Becker.
X *
X * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
diff -u --recursive --new-file v2.4.13/linux/drivers/net/arcnet/arcnet.c linux/drivers/net/arcnet/arcnet.c
--- v2.4.13/linux/drivers/net/arcnet/arcnet.c Wed Apr 18 14:40:06 2001
+++ linux/drivers/net/arcnet/arcnet.c Sun Nov 4 09:31:58 2001
@@ -3,7 +3,7 @@
X *
X * Written 1997 by David Woodhouse.
X * Written 1994-1999 by Avery Pennarun.
- * Written 1999-2000 by Martin Mares <m...@suse.cz>.
+ * Written 1999-2000 by Martin Mares <m...@ucw.cz>.
X * Derived from skeleton.c by Donald Becker.
X *
X * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
diff -u --recursive --new-file v2.4.13/linux/drivers/net/arcnet/com20020-isa.c linux/drivers/net/arcnet/com20020-isa.c
--- v2.4.13/linux/drivers/net/arcnet/com20020-isa.c Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/arcnet/com20020-isa.c Sun Nov 4 09:31:58 2001
@@ -3,7 +3,7 @@
X *
X * Written 1997 by David Woodhouse.
X * Written 1994-1999 by Avery Pennarun.
- * Written 1999-2000 by Martin Mares <m...@suse.cz>.
+ * Written 1999-2000 by Martin Mares <m...@ucw.cz>.
X * Derived from skeleton.c by Donald Becker.
X *
X * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
diff -u --recursive --new-file v2.4.13/linux/drivers/net/arcnet/com20020-pci.c linux/drivers/net/arcnet/com20020-pci.c
--- v2.4.13/linux/drivers/net/arcnet/com20020-pci.c Wed Apr 18 14:40:05 2001
+++ linux/drivers/net/arcnet/com20020-pci.c Sun Nov 4 09:31:58 2001
@@ -3,7 +3,7 @@
X *
X * Written 1994-1999 by Avery Pennarun,
X * based on an ISA version by David Woodhouse.
- * Written 1999-2000 by Martin Mares <m...@suse.cz>.
+ * Written 1999-2000 by Martin Mares <m...@ucw.cz>.
X * Derived from skeleton.c by Donald Becker.
X *
X * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
diff -u --recursive --new-file v2.4.13/linux/drivers/net/arcnet/com20020.c linux/drivers/net/arcnet/com20020.c
--- v2.4.13/linux/drivers/net/arcnet/com20020.c Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/arcnet/com20020.c Sun Nov 4 09:31:58 2001
@@ -3,7 +3,7 @@
X *
X * Written 1997 by David Woodhouse.
X * Written 1994-1999 by Avery Pennarun.
- * Written 1999 by Martin Mares <m...@suse.cz>.
+ * Written 1999 by Martin Mares <m...@ucw.cz>.
X * Derived from skeleton.c by Donald Becker.
X *
X * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
diff -u --recursive --new-file v2.4.13/linux/drivers/net/arcnet/com90io.c linux/drivers/net/arcnet/com90io.c
--- v2.4.13/linux/drivers/net/arcnet/com90io.c Wed Apr 18 14:40:05 2001
+++ linux/drivers/net/arcnet/com90io.c Sun Nov 4 09:31:58 2001
@@ -3,7 +3,7 @@
X *
X * Written 1997 by David Woodhouse.
X * Written 1994-1999 by Avery Pennarun.
- * Written 1999-2000 by Martin Mares <m...@suse.cz>.
+ * Written 1999-2000 by Martin Mares <m...@ucw.cz>.
X * Derived from skeleton.c by Donald Becker.
X *
X * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
diff -u --recursive --new-file v2.4.13/linux/drivers/net/arcnet/com90xx.c linux/drivers/net/arcnet/com90xx.c
--- v2.4.13/linux/drivers/net/arcnet/com90xx.c Wed Apr 18 14:40:05 2001
+++ linux/drivers/net/arcnet/com90xx.c Sun Nov 4 09:31:58 2001
@@ -2,7 +2,7 @@
X * Linux ARCnet driver - COM90xx chipset (memory-mapped buffers)
X *
X * Written 1994-1999 by Avery Pennarun.
- * Written 1999 by Martin Mares <m...@suse.cz>.
+ * Written 1999 by Martin Mares <m...@ucw.cz>.
X * Derived from skeleton.c by Donald Becker.
X *
X * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
diff -u --recursive --new-file v2.4.13/linux/drivers/net/hamradio/scc.c linux/drivers/net/hamradio/scc.c
--- v2.4.13/linux/drivers/net/hamradio/scc.c Tue Oct 23 22:48:51 2001
+++ linux/drivers/net/hamradio/scc.c Thu Oct 25 13:58:15 2001
@@ -1,3 +1,5 @@
+#define RCS_ID "$Id: scc.c,v 1.75 1998/11/04 15:15:01 jreuter Exp jreuter $"
+
X #define VERSION "3.0"
X
X /*
@@ -16,7 +18,7 @@
X
X ********************************************************************
X
- Copyright (c) 1993, 2001 Joerg Reuter DL1BKE
+ Copyright (c) 1993, 2000 Joerg Reuter DL1BKE
X
X portions (c) 1993 Guido ten Dolle PE1NNZ


X
@@ -104,10 +106,6 @@

X 2000-02-13 Fixed for new network driver interface changes, still
X does TX timeouts itself since it uses its own queue
X scheme.
- 2001-10-05 Set skb to NULL on Rx_OVR in scc_spint() (tnx everybody
- who insisted that the skb gets in fact re-used by the
- following code otherwise. I think we have another Z8530
- bug here...)
X
X Thanks to all who contributed to this driver with ideas and bug
X reports!
@@ -585,7 +583,6 @@
X if (skb != NULL)
X dev_kfree_skb_irq(skb);
X scc->rx_buff = skb = NULL;
- skb = NULL; /* avoid skb being reused */
X }
X
X if(status & END_FR && skb != NULL) /* end of frame */
diff -u --recursive --new-file v2.4.13/linux/drivers/net/irda/Config.in linux/drivers/net/irda/Config.in
--- v2.4.13/linux/drivers/net/irda/Config.in Mon Aug 27 12:41:42 2001
+++ linux/drivers/net/irda/Config.in Thu Oct 25 13:53:47 2001
@@ -14,6 +14,9 @@
X dep_tristate ' Greenwich GIrBIL dongle' CONFIG_GIRBIL_DONGLE $CONFIG_IRDA
X dep_tristate ' Parallax LiteLink dongle' CONFIG_LITELINK_DONGLE $CONFIG_IRDA
X dep_tristate ' Old Belkin dongle' CONFIG_OLD_BELKIN_DONGLE $CONFIG_IRDA
+ if [ "$CONFIG_ARCH_EP7211" = "y" ]; then
+ dep_tristate ' EP7211 I/R support' CONFIG_EP7211_IR $CONFIG_IRDA
+ fi
X fi
X
X comment 'FIR device drivers'
@@ -25,6 +28,9 @@
X dep_tristate 'SMC IrCC (Experimental)' CONFIG_SMC_IRCC_FIR $CONFIG_IRDA
X dep_tristate 'ALi M5123 FIR (Experimental)' CONFIG_ALI_FIR $CONFIG_IRDA
X dep_tristate 'VLSI 82C147 SIR/MIR/FIR (Experimental)' CONFIG_VLSI_FIR $CONFIG_IRDA
+fi
+if [ "$CONFIG_ARCH_SA1100" = "y" ]; then
+ dep_tristate 'SA1100 Internal IR' CONFIG_SA1100_FIR $CONFIG_IRDA
X fi
X
X endmenu
diff -u --recursive --new-file v2.4.13/linux/drivers/net/irda/Makefile linux/drivers/net/irda/Makefile
--- v2.4.13/linux/drivers/net/irda/Makefile Mon Aug 27 12:41:42 2001
+++ linux/drivers/net/irda/Makefile Thu Oct 25 13:53:47 2001
@@ -1,3 +1,4 @@
+# File: drivers/irda/Makefile
X #
X # Makefile for the Linux IrDA infrared port device drivers.
X #
@@ -15,6 +16,7 @@
X obj-$(CONFIG_USB_IRDA) += irda-usb.o
X obj-$(CONFIG_NSC_FIR) += nsc-ircc.o
X obj-$(CONFIG_WINBOND_FIR) += w83977af_ir.o
+obj-$(CONFIG_SA1100_FIR) += sa1100_ir.o
X obj-$(CONFIG_TOSHIBA_FIR) += toshoboe.o
X obj-$(CONFIG_SMC_IRCC_FIR) += smc-ircc.o irport.o
X obj-$(CONFIG_ALI_FIR) += ali-ircc.o
@@ -25,5 +27,6 @@
X obj-$(CONFIG_GIRBIL_DONGLE) += girbil.o
X obj-$(CONFIG_LITELINK_DONGLE) += litelink.o
X obj-$(CONFIG_OLD_BELKIN_DONGLE) += old_belkin.o
+obj-$(CONFIG_EP7211_IR) += ep7211_ir.o
X
X include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.13/linux/drivers/net/irda/ep7211_ir.c linux/drivers/net/irda/ep7211_ir.c
--- v2.4.13/linux/drivers/net/irda/ep7211_ir.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/net/irda/ep7211_ir.c Thu Oct 25 13:53:47 2001
@@ -0,0 +1,129 @@
+/*
+ * IR port driver for the Cirrus Logic EP7211 processor.
+ *
+ * Copyright 2001, Blue Mug Inc. All rights reserved.


+ */
+
+#include <linux/module.h>

+#include <linux/delay.h>
+#include <linux/tty.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+
+#include <net/irda/irda.h>
+#include <net/irda/irmod.h>
+#include <net/irda/irda_device.h>
+
+#include <asm/io.h>
+#include <asm/hardware.h>
+
+#define MIN_DELAY 25 /* 15 us, but wait a little more to be sure */
+#define MAX_DELAY 10000 /* 1 ms */
+
+static void ep7211_ir_open(dongle_t *self, struct qos_info *qos);
+static void ep7211_ir_close(dongle_t *self);
+static int ep7211_ir_change_speed(struct irda_task *task);
+static int ep7211_ir_reset(struct irda_task *task);
+
+static struct dongle_reg dongle = {
+ Q_NULL,
+ IRDA_EP7211_IR,
+ ep7211_ir_open,
+ ep7211_ir_close,
+ ep7211_ir_reset,
+ ep7211_ir_change_speed,
+};
+
+static void ep7211_ir_open(dongle_t *self, struct qos_info *qos)
+{
+ unsigned int syscon1, flags;
+
+ save_flags(flags); cli();
+
+ /* Turn on the SIR encoder. */
+ syscon1 = clps_readl(SYSCON1);
+ syscon1 |= SYSCON1_SIREN;
+ clps_writel(syscon1, SYSCON1);
+
+ /* XXX: We should disable modem status interrupts on the first
+ UART (interrupt #14). */
+
+ restore_flags(flags);


+
+ MOD_INC_USE_COUNT;
+}
+

+static void ep7211_ir_close(dongle_t *self)
+{
+ unsigned int syscon1, flags;
+
+ save_flags(flags); cli();
+
+ /* Turn off the SIR encoder. */
+ syscon1 = clps_readl(SYSCON1);
+ syscon1 &= ~SYSCON1_SIREN;
+ clps_writel(syscon1, SYSCON1);
+
+ /* XXX: If we've disabled the modem status interrupts, we should
+ reset them back to their original state. */
+
+ restore_flags(flags);
+
+ MOD_DEC_USE_COUNT;
+}
+
+/*
+ * Function ep7211_ir_change_speed (task)
+ *
+ * Change speed of the EP7211 I/R port. We don't really have to do anything
+ * for the EP7211 as long as the rate is being changed at the serial port
+ * level.
+ */
+static int ep7211_ir_change_speed(struct irda_task *task)
+{
+ irda_task_next_state(task, IRDA_TASK_DONE);


+ return 0;
+}
+
+/*

+ * Function ep7211_ir_reset (task)
+ *
+ * Reset the EP7211 I/R. We don't really have to do anything.
+ *
+ */
+static int ep7211_ir_reset(struct irda_task *task)
+{
+ irda_task_next_state(task, IRDA_TASK_DONE);


+ return 0;
+}
+
+/*

+ * Function ep7211_ir_init(void)
+ *
+ * Initialize EP7211 I/R module
+ *
+ */
+int __init ep7211_ir_init(void)
+{
+ return irda_device_register_dongle(&dongle);
+}
+
+/*
+ * Function ep7211_ir_cleanup(void)
+ *
+ * Cleanup EP7211 I/R module
+ *
+ */
+static void __exit ep7211_ir_cleanup(void)
+{
+ irda_device_unregister_dongle(&dongle);
+}
+
+MODULE_AUTHOR("Jon McClintock <jo...@bluemug.com>");
+MODULE_DESCRIPTION("EP7211 I/R driver");
+MODULE_LICENSE("GPL");
+
+#ifdef MODULE
+module_init(ep7211_ir_init);
+#endif /* MODULE */
+module_exit(ep7211_ir_cleanup);
diff -u --recursive --new-file v2.4.13/linux/drivers/net/irda/sa1100_ir.c linux/drivers/net/irda/sa1100_ir.c
--- v2.4.13/linux/drivers/net/irda/sa1100_ir.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/net/irda/sa1100_ir.c Thu Oct 25 13:53:47 2001
@@ -0,0 +1,1163 @@
+/*
+ * linux/drivers/net/irda/sa1100_ir.c
+ *
+ * Copyright (C) 2000-2001 Russell King
+ *


+ * 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.
+ *
+ * Infra-red driver for the StrongARM SA1100 embedded microprocessor
+ *
+ * Note that we don't have to worry about the SA1111's DMA bugs in here,
+ * so we use the straight forward pci_map_* functions with a null pointer.
+ * IMHO we should really be using our own machine specific set.
+ */
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/netdevice.h>
+#include <linux/slab.h>
+#include <linux/rtnetlink.h>
+#include <linux/interrupt.h>
+#include <linux/delay.h>
+#include <linux/pci.h>
+#include <linux/pm.h>
+
+#include <net/irda/irda.h>
+#include <net/irda/irmod.h>
+#include <net/irda/wrapper.h>
+#include <net/irda/irda_device.h>
+
+#include <asm/irq.h>
+#include <asm/dma.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+
+#include <asm/arch/assabet.h>
+
+#ifndef CONFIG_SA1100_H3600
+#define clr_h3600_egpio(x) do { } while (0)
+#define set_h3600_egpio(x) do { } while (0)
+#endif
+
+#ifndef GPIO_IRDA_FIR
+#define GPIO_IRDA_FIR (0)
+#endif
+
+#ifndef GPIO_IRDA_POWER
+#define GPIO_IRDA_POWER (0)
+#endif
+
+static int power_level = 3;
+static int tx_lpm = 0;
+
+/*
+ * Our netdevice. There is only ever one of these.
+ */
+static struct net_device *netdev;
+
+struct sa1100_irda {
+ unsigned char hscr0;
+ unsigned char utcr4;
+ unsigned char power;
+ unsigned char open;
+
+ int speed;
+ int newspeed;
+
+ struct sk_buff *txskb;
+ struct sk_buff *rxskb;
+ dma_addr_t txbuf_dma;
+ dma_addr_t rxbuf_dma;
+ int txdma;
+ int rxdma;
+
+ struct net_device_stats stats;
+ struct irlap_cb *irlap;
+ struct pm_dev *pmdev;
+ struct qos_info qos;
+
+ iobuff_t tx_buff;
+ iobuff_t rx_buff;
+};
+
+#define IS_FIR(si) ((si)->speed >= 4000000)
+
+#define HPSIR_MAX_RXLEN 2047
+
+/*
+ * Allocate and map the receive buffer, unless it is already allocated.
+ */
+static int sa1100_irda_rx_alloc(struct sa1100_irda *si)
+{
+ if (si->rxskb)
+ return 0;
+
+ si->rxskb = alloc_skb(HPSIR_MAX_RXLEN + 1, GFP_ATOMIC);
+
+ if (!si->rxskb) {
+ printk(KERN_ERR "sa1100_ir: out of memory for RX SKB\n");
+ return -ENOMEM;
+ }
+
+ /*
+ * Align any IP headers that may be contained
+ * within the frame.
+ */
+ skb_reserve(si->rxskb, 1);
+
+ si->rxbuf_dma = pci_map_single(NULL, si->rxskb->data,
+ HPSIR_MAX_RXLEN,
+ PCI_DMA_FROMDEVICE);


+ return 0;
+}
+
+/*

+ * We want to get here as soon as possible, and get the receiver setup.
+ * We use the existing buffer.
+ */
+static void sa1100_irda_rx_dma_start(struct sa1100_irda *si)
+{
+ if (!si->rxskb) {
+ printk(KERN_ERR "sa1100_ir: rx buffer went missing\n");
+ return;
+ }
+
+ /*
+ * First empty receive FIFO


+ */
+ Ser2HSCR0 = si->hscr0 | HSCR0_HSSP;

+
+ /*
+ * Enable the DMA, receiver and recieve interrupt.
+ */
+ sa1100_dma_flush_all(si->rxdma);
+ sa1100_dma_queue_buffer(si->rxdma, NULL, si->rxbuf_dma, HPSIR_MAX_RXLEN);
+ Ser2HSCR0 = si->hscr0 | HSCR0_HSSP | HSCR0_RXE;
+}
+
+/*
+ * Set the IrDA communications speed.
+ */
+static int sa1100_irda_set_speed(struct sa1100_irda *si, int speed)
+{
+ unsigned long flags;
+ int brd, ret = -EINVAL;
+
+ switch (speed) {
+ case 9600: case 19200: case 38400:
+ case 57600: case 115200:
+ brd = 3686400 / (16 * speed) - 1;
+
+ /*
+ * Stop the receive DMA.
+ */
+ if (IS_FIR(si))
+ sa1100_dma_stop(si->rxdma);
+
+ local_irq_save(flags);
+
+ Ser2UTCR3 = 0;
+ Ser2HSCR0 = HSCR0_UART;
+
+ Ser2UTCR1 = brd >> 8;
+ Ser2UTCR2 = brd;
+
+ /*
+ * Clear status register
+ */
+ Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID;
+ Ser2UTCR3 = UTCR3_RIE | UTCR3_RXE | UTCR3_TXE;
+
+ if (machine_is_assabet())
+ ASSABET_BCR_clear(ASSABET_BCR_IRDA_FSEL);
+ if (machine_is_h3600())
+ clr_h3600_egpio(EGPIO_H3600_IR_FSEL);
+ if (machine_is_yopy())
+ PPSR &= ~GPIO_IRDA_FIR;
+
+ si->speed = speed;
+
+ local_irq_restore(flags);
+ ret = 0;
+ break;
+
+ case 4000000:
+ save_flags(flags);
+ cli();
+
+ si->hscr0 = 0;
+
+ Ser2HSSR0 = 0xff;


+ Ser2HSCR0 = si->hscr0 | HSCR0_HSSP;

+ Ser2UTCR3 = 0;
+
+ si->speed = speed;
+
+ if (machine_is_assabet())
+ ASSABET_BCR_set(ASSABET_BCR_IRDA_FSEL);
+ if (machine_is_h3600())
+ set_h3600_egpio(EGPIO_H3600_IR_FSEL);
+ if (machine_is_yopy())
+ PPSR |= GPIO_IRDA_FIR;
+
+ sa1100_irda_rx_alloc(si);
+ sa1100_irda_rx_dma_start(si);
+
+ restore_flags(flags);
+
+ break;
+
+ default:
+ break;
+ }
+
+ return ret;
+}
+
+/*
+ * This sets the IRDA power level on the Assabet.


+ */
+static inline int

+sa1100_irda_set_power_assabet(struct sa1100_irda *si, unsigned int state)
+{
+ static unsigned int bcr_state[4] = {
+ ASSABET_BCR_IRDA_MD0,
+ ASSABET_BCR_IRDA_MD1|ASSABET_BCR_IRDA_MD0,
+ ASSABET_BCR_IRDA_MD1,
+ 0
+ };
+
+ if (state < 4) {
+ state = bcr_state[state];
+ ASSABET_BCR_clear(state ^ (ASSABET_BCR_IRDA_MD1|
+ ASSABET_BCR_IRDA_MD0));
+ ASSABET_BCR_set(state);


+ }
+ return 0;
+}
+

+/*
+ * This turns the IRDA power on or off on the Compaq H3600


+ */
+static inline int

+sa1100_irda_set_power_h3600(struct sa1100_irda *si, unsigned int state)
+{
+ if (state)
+ set_h3600_egpio(EGPIO_H3600_IR_ON);
+ else
+ clr_h3600_egpio(EGPIO_H3600_IR_ON);


+ return 0;
+}
+
+/*

+ * This turns the IRDA power on or off on the Yopy


+ */
+static inline int

+sa1100_irda_set_power_yopy(struct sa1100_irda *si, unsigned int state)
+{
+ if (state)
+ PPSR &= ~GPIO_IRDA_POWER;
+ else
+ PPSR |= GPIO_IRDA_POWER;


+ return 0;
+}
+
+/*

+ * Control the power state of the IrDA transmitter.
+ * State:
+ * 0 - off
+ * 1 - short range, lowest power
+ * 2 - medium range, medium power
+ * 3 - maximum range, high power
+ *
+ * Currently, only assabet is known to support this.
+ */
+static int
+__sa1100_irda_set_power(struct sa1100_irda *si, unsigned int state)
+{
+ int ret = 0;
+
+ if (machine_is_assabet())
+ ret = sa1100_irda_set_power_assabet(si, state);
+ if (machine_is_h3600())
+ ret = sa1100_irda_set_power_h3600(si, state);
+ if (machine_is_yopy())
+ ret = sa1100_irda_set_power_yopy(si, state);
+


+ return ret;
+}
+

+static inline int
+sa1100_set_power(struct sa1100_irda *si, unsigned int state)


+{
+ int ret;
+

+ ret = __sa1100_irda_set_power(si, state);


+ if (ret == 0)

+ si->power = state;
+


+ return ret;
+}
+

+static int sa1100_irda_startup(struct sa1100_irda *si)


+{
+ int ret;
+

+ /*
+ * Ensure that the ports for this device are setup correctly.
+ */
+ if (machine_is_yopy()) {
+ PPDR |= GPIO_IRDA_POWER | GPIO_IRDA_FIR;
+ PPSR |= GPIO_IRDA_POWER | GPIO_IRDA_FIR;
+ PSDR |= GPIO_IRDA_POWER | GPIO_IRDA_FIR;
+ }
+
+ /*
+ * Configure PPC for IRDA - we want to drive TXD2 low.
+ * We also want to drive this pin low during sleep.
+ */
+ PPSR &= ~PPC_TXD2;
+ PSDR &= ~PPC_TXD2;
+ PPDR |= PPC_TXD2;
+
+ /*
+ * Enable HP-SIR modulation, and ensure that the port is disabled.
+ */
+ Ser2UTCR3 = 0;
+ Ser2HSCR0 = HSCR0_UART;


+ Ser2UTCR4 = si->utcr4;

+ Ser2UTCR0 = UTCR0_8BitData;
+ Ser2HSCR2 = HSCR2_TrDataH | HSCR2_RcDataL;
+
+ /*
+ * Clear status register
+ */
+ Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID;
+
+ ret = sa1100_irda_set_speed(si, si->speed = 9600);
+ if (ret)
+ return ret;


+
+ return 0;
+}
+

+static void sa1100_irda_shutdown(struct sa1100_irda *si)
+{
+ /*
+ * Stop all DMA activity.


+ */
+ sa1100_dma_stop(si->rxdma);

+ sa1100_dma_stop(si->txdma);
+
+ /* Disable the port. */
+ Ser2UTCR3 = 0;
+ Ser2HSCR0 = 0;
+}
+
+#ifdef CONFIG_PM
+/*
+ * Suspend the IrDA interface.
+ */
+static int sa1100_irda_suspend(struct net_device *dev, int state)


+{
+ struct sa1100_irda *si = dev->priv;
+

+ if (si && si->open) {
+ /*
+ * Stop the transmit queue
+ */
+ netif_device_detach(dev);


+ disable_irq(dev->irq);
+ sa1100_irda_shutdown(si);

+ __sa1100_irda_set_power(si, 0);
+ }


+
+ return 0;
+}
+

+/*
+ * Resume the IrDA interface.
+ */
+static int sa1100_irda_resume(struct net_device *dev)


+{
+ struct sa1100_irda *si = dev->priv;
+

+ if (si && si->open) {
+ /*
+ * If we missed a speed change, initialise at the new speed
+ * directly. It is debatable whether this is actually
+ * required, but in the interests of continuing from where
+ * we left off it is desireable. The converse argument is
+ * that we should re-negotiate at 9600 baud again.


+ */
+ if (si->newspeed) {

+ si->speed = si->newspeed;
+ si->newspeed = 0;
+ }
+
+ sa1100_irda_startup(si);
+ __sa1100_irda_set_power(si, si->power);
+ enable_irq(dev->irq);
+
+ /*
+ * This automatically wakes up the queue
+ */
+ netif_device_attach(dev);
+ }


+
+ return 0;
+}
+

+static int sa1100_irda_pmproc(struct pm_dev *dev, pm_request_t rqst, void *data)


+{
+ int ret;
+

+ if (!dev->data)
+ return -EINVAL;
+
+ switch (rqst) {
+ case PM_SUSPEND:
+ ret = sa1100_irda_suspend((struct net_device *)dev->data,
+ (int)data);
+ break;
+
+ case PM_RESUME:
+ ret = sa1100_irda_resume((struct net_device *)dev->data);


+ break;
+
+ default:

+ ret = -EINVAL;
+ break;
+ }
+
+ return ret;
+}
+#endif
+
+/*
+ * HP-SIR format interrupt service routines.
+ */
+static void sa1100_irda_hpsir_irq(struct net_device *dev)


+{
+ struct sa1100_irda *si = dev->priv;

+ int status;
+
+ status = Ser2UTSR0;
+
+ /*
+ * Deal with any receive errors first. The bytes in error may be
+ * the only bytes in the receive FIFO, so we do this first.
+ */
+ while (status & UTSR0_EIF) {
+ int stat, data;
+
+ stat = Ser2UTSR1;
+ data = Ser2UTDR;
+
+ if (stat & (UTSR1_FRE | UTSR1_ROR)) {
+ si->stats.rx_errors++;
+ if (stat & UTSR1_FRE)
+ si->stats.rx_frame_errors++;
+ if (stat & UTSR1_ROR)
+ si->stats.rx_fifo_errors++;
+ } else
+ async_unwrap_char(dev, &si->stats, &si->rx_buff, data);
+
+ status = Ser2UTSR0;
+ }
+
+ /*
+ * We must clear certain bits.
+ */
+ Ser2UTSR0 = status & (UTSR0_RID | UTSR0_RBB | UTSR0_REB);
+
+ if (status & UTSR0_RFS) {
+ /*
+ * There are at least 4 bytes in the FIFO. Read 3 bytes
+ * and leave the rest to the block below.
+ */
+ async_unwrap_char(dev, &si->stats, &si->rx_buff, Ser2UTDR);
+ async_unwrap_char(dev, &si->stats, &si->rx_buff, Ser2UTDR);
+ async_unwrap_char(dev, &si->stats, &si->rx_buff, Ser2UTDR);
+ }
+
+ if (status & (UTSR0_RFS | UTSR0_RID)) {
+ /*
+ * Fifo contains more than 1 character.
+ */
+ do {
+ async_unwrap_char(dev, &si->stats, &si->rx_buff,
+ Ser2UTDR);
+ } while (Ser2UTSR1 & UTSR1_RNE);
+
+ dev->last_rx = jiffies;
+ }
+
+ if (status & UTSR0_TFS && si->tx_buff.len) {
+ /*
+ * Transmitter FIFO is not full
+ */
+ do {
+ Ser2UTDR = *si->tx_buff.data++;
+ si->tx_buff.len -= 1;
+ } while (Ser2UTSR1 & UTSR1_TNF && si->tx_buff.len);
+
+ if (si->tx_buff.len == 0) {
+ si->stats.tx_packets++;
+ si->stats.tx_bytes += si->tx_buff.data -
+ si->tx_buff.head;
+
+ /*
+ * We need to ensure that the transmitter has
+ * finished.


+ */
+ do
+ rmb();

+ while (Ser2UTSR1 & UTSR1_TBY);
+
+ /*
+ * Ok, we've finished transmitting. Now enable
+ * the receiver. Sometimes we get a receive IRQ
+ * immediately after a transmit...
+ */
+ Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID;
+ Ser2UTCR3 = UTCR3_RIE | UTCR3_RXE | UTCR3_TXE;
+


+ if (si->newspeed) {
+ sa1100_irda_set_speed(si, si->newspeed);

+ si->newspeed = 0;
+ }
+
+ /* I'm hungry! */
+ netif_wake_queue(dev);
+ }
+ }
+}
+
+static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev)
+{
+ struct sk_buff *skb = si->rxskb;
+ dma_addr_t dma_addr;
+ unsigned int len, stat, data;
+
+ if (!skb) {
+ printk(KERN_ERR "sa1100_ir: SKB is NULL!\n");
+ return;
+ }
+
+ /*
+ * Get the current data position.
+ */
+ sa1100_dma_get_current(si->rxdma, NULL, &dma_addr);
+ len = dma_addr - si->rxbuf_dma;
+ pci_unmap_single(NULL, si->rxbuf_dma, len, PCI_DMA_FROMDEVICE);
+
+ do {
+ /*
+ * Read Status, and then Data.
+ */
+ stat = Ser2HSSR1;
+ rmb();
+ data = Ser2HSDR;
+
+ if (stat & (HSSR1_CRE | HSSR1_ROR)) {
+ si->stats.rx_errors++;
+ if (stat & HSSR1_CRE)
+ si->stats.rx_crc_errors++;
+ if (stat & HSSR1_ROR)
+ si->stats.rx_frame_errors++;
+ } else
+ skb->data[len++] = data;
+
+ /*
+ * If we hit the end of frame, there's
+ * no point in continuing.
+ */
+ if (stat & HSSR1_EOF)
+ break;
+ } while (Ser2HSSR0 & HSSR0_EIF);
+
+ if (stat & HSSR1_EOF) {


+ si->rxskb = NULL;
+

+ skb_put(skb, len);
+ skb->dev = dev;
+ skb->mac.raw = skb->data;
+ skb->protocol = htons(ETH_P_IRDA);
+ si->stats.rx_packets++;
+ si->stats.rx_bytes += len;
+
+ /*
+ * Before we pass the buffer up, allocate a new one.
+ */
+ sa1100_irda_rx_alloc(si);
+
+ netif_rx(skb);
+ } else {
+ /*
+ * Remap the buffer.
+ */
+ si->rxbuf_dma = pci_map_single(NULL, si->rxskb->data,
+ HPSIR_MAX_RXLEN,
+ PCI_DMA_FROMDEVICE);
+ }
+}
+
+/*
+ * FIR format interrupt service routine. We only have to


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 30'
echo 'File patch-2.4.14 is continued in part 31'
echo "31" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:47 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part24

#!/bin/sh -x
# this is part 24 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 24; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

--- v2.4.13/linux/drivers/acpi/parser/psscope.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/parser/psscope.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: psscope - Parser scope stack management routines
- * $Revision: 29 $
+ * $Revision: 30 $


X *
X *****************************************************************************/
X

@@ -103,6 +103,7 @@


X return_ACPI_STATUS (AE_NO_MEMORY);
X }
X

+ scope->common.data_type = ACPI_DESC_TYPE_STATE_RPSCOPE;
X scope->parse_scope.op = root_op;
X scope->parse_scope.arg_count = ACPI_VAR_ARGS;
X scope->parse_scope.arg_end = parser_state->aml_end;
@@ -149,6 +150,7 @@
X }
X
X
+ scope->common.data_type = ACPI_DESC_TYPE_STATE_PSCOPE;
X scope->parse_scope.op = op;
X scope->parse_scope.arg_list = remaining_args;
X scope->parse_scope.arg_count = arg_count;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/parser/pstree.c linux/drivers/acpi/parser/pstree.c
--- v2.4.13/linux/drivers/acpi/parser/pstree.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/parser/pstree.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: pstree - Parser op tree manipulation/traversal/search


- * $Revision: 32 $

+ * $Revision: 35 $


X *
X *****************************************************************************/
X

@@ -60,7 +60,7 @@
X /* Get the info structure for this opcode */
X
X op_info = acpi_ps_get_opcode_info (op->opcode);


- if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) {
+ if (op_info->class == AML_CLASS_UNKNOWN) {

X /* Invalid opcode or ASCII character */
X
X return (NULL);
@@ -68,7 +68,7 @@
X
X /* Check if this opcode requires argument sub-objects */
X
- if (!(ACPI_GET_OP_ARGS (op_info))) {
+ if (!(op_info->flags & AML_HAS_ARGS)) {
X /* Has no linked argument objects */
X
X return (NULL);
@@ -118,15 +118,16 @@
X /* Get the info structure for this opcode */
X
X op_info = acpi_ps_get_opcode_info (op->opcode);


- if (ACPI_GET_OP_TYPE (op_info) != ACPI_OP_TYPE_OPCODE) {
+ if (op_info->class == AML_CLASS_UNKNOWN) {

X /* Invalid opcode */
X
+ REPORT_ERROR (("Ps_append_arg: Invalid AML Opcode: 0x%2.2X\n", op->opcode));
X return;
X }
X
X /* Check if this opcode requires argument sub-objects */
X
- if (!(ACPI_GET_OP_ARGS (op_info))) {
+ if (!(op_info->flags & AML_HAS_ARGS)) {
X /* Has no linked argument objects */
X
X return;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/parser/psutils.c linux/drivers/acpi/parser/psutils.c
--- v2.4.13/linux/drivers/acpi/parser/psutils.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/parser/psutils.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: psutils - Parser miscellaneous utilities (Parser only)


- * $Revision: 43 $

+ * $Revision: 44 $


X *
X *****************************************************************************/
X

@@ -34,8 +34,8 @@
X
X #define PARSEOP_GENERIC 0x01
X #define PARSEOP_NAMED 0x02
-#define PARSEOP_DEFERRED 0x03
-#define PARSEOP_BYTELIST 0x04
+#define PARSEOP_DEFERRED 0x04
+#define PARSEOP_BYTELIST 0x08
X #define PARSEOP_IN_CACHE 0x80
X
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/parser/pswalk.c linux/drivers/acpi/parser/pswalk.c
--- v2.4.13/linux/drivers/acpi/parser/pswalk.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/parser/pswalk.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: pswalk - Parser routines to walk parsed op tree(s)


- * $Revision: 56 $

+ * $Revision: 58 $


X *
X *****************************************************************************/
X

@@ -88,7 +88,11 @@
X next = op->next;
X parent = op->parent;
X
- status = ascending_callback (walk_state, op);


+ walk_state->op = op;
+ walk_state->op_info = acpi_ps_get_opcode_info (op->opcode);
+ walk_state->opcode = op->opcode;
+

+ status = ascending_callback (walk_state);
X
X /*
X * If we are back to the starting point, the walk is complete.
@@ -144,7 +148,11 @@
X grand_parent = parent->parent;
X next = parent->next;
X
- status = ascending_callback (walk_state, parent);
+ walk_state->op = parent;
+ walk_state->op_info = acpi_ps_get_opcode_info (parent->opcode);
+ walk_state->opcode = parent->opcode;
+
+ status = ascending_callback (walk_state);
X
X /*
X * If we are back to the starting point, the walk is complete.
@@ -206,11 +214,10 @@
X
X static acpi_status
X acpi_ps_delete_completed_op (


- acpi_walk_state *state,
- acpi_parse_object *op)

+ acpi_walk_state *walk_state)
X {
X

- acpi_ps_free_op (op);
+ acpi_ps_free_op (walk_state->op);


X return (AE_OK);
X }
X

@@ -253,7 +260,6 @@
X return_VOID;
X }
X
- walk_state->parser_state = NULL;
X walk_state->parse_flags = 0;
X walk_state->descending_callback = NULL;
X walk_state->ascending_callback = NULL;
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/parser/psxface.c linux/drivers/acpi/parser/psxface.c
--- v2.4.13/linux/drivers/acpi/parser/psxface.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/parser/psxface.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: psxface - Parser external interfaces
- * $Revision: 47 $
+ * $Revision: 52 $


X *
X *****************************************************************************/
X

@@ -64,6 +64,7 @@
X acpi_operand_object *obj_desc;
X u32 i;
X acpi_parse_object *op;
+ acpi_walk_state *walk_state;
X
X
X FUNCTION_TRACE ("Psx_execute");
@@ -98,11 +99,11 @@
X }
X
X /*
- * Perform the first pass parse of the method to enter any
+ * 1) Perform the first pass parse of the method to enter any
X * named objects that it creates into the namespace


X */
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO,

- "**** Begin Method Execution **** Entry=%p obj=%p\n",
+ "**** Begin Method Parse **** Entry=%p obj=%p\n",
X method_node, obj_desc));
X

X /* Create and init a Root Node */

@@ -112,13 +113,34 @@


X return_ACPI_STATUS (AE_NO_MEMORY);
X }
X

- status = acpi_ps_parse_aml (op, obj_desc->method.pcode,
- obj_desc->method.pcode_length,
- ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE,
- method_node, params, return_obj_desc,
- acpi_ds_load1_begin_op, acpi_ds_load1_end_op);
+ /* Create and initialize a new walk state */
+


+ walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
+ NULL, NULL, NULL);
+ if (!walk_state) {

+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ status = acpi_ds_init_aml_walk (walk_state, op, method_node, obj_desc->method.aml_start,
+ obj_desc->method.aml_length, NULL, NULL, 1);
+ if (ACPI_FAILURE (status)) {
+ /* TBD: delete walk state */


+ return_ACPI_STATUS (status);
+ }
+
+ /* Parse the AML */
+

+ status = acpi_ps_parse_aml (walk_state);

X acpi_ps_delete_parse_tree (op);
X
+
+ /*
+ * 2) Execute the method. Performs second pass parse simultaneously
+ */
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "**** Begin Method Execution **** Entry=%p obj=%p\n",
+ method_node, obj_desc));
+
X /* Create and init a Root Node */
X
X op = acpi_ps_alloc_op (AML_SCOPE_OP);
@@ -126,20 +148,30 @@


X return_ACPI_STATUS (AE_NO_MEMORY);
X }
X

-
X /* Init new op with the method name and pointer back to the NS node */
X
X acpi_ps_set_name (op, method_node->name);
X op->node = method_node;
X
+ /* Create and initialize a new walk state */
+


+ walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
+ NULL, NULL, NULL);
+ if (!walk_state) {

+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ status = acpi_ds_init_aml_walk (walk_state, op, method_node, obj_desc->method.aml_start,
+ obj_desc->method.aml_length, params, return_obj_desc, 3);
+ if (ACPI_FAILURE (status)) {
+ /* TBD: delete walk state */


+ return_ACPI_STATUS (status);
+ }
+

X /*
X * The walk of the parse tree is where we actually execute the method
X */
- status = acpi_ps_parse_aml (op, obj_desc->method.pcode,
- obj_desc->method.pcode_length,
- ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE,
- method_node, params, return_obj_desc,
- acpi_ds_exec_begin_op, acpi_ds_exec_end_op);


+ status = acpi_ps_parse_aml (walk_state);

X acpi_ps_delete_parse_tree (op);
X
X if (params) {
@@ -151,12 +183,18 @@
X }
X
X
+ if (ACPI_FAILURE (status)) {
+ DUMP_PATHNAME (method_node, "Ps_execute: method failed -",
+ ACPI_LV_ERROR, _COMPONENT);


+ }
+
+
X /*

X * If the method has returned an object, signal this to the caller with
X * a control exception code
X */
X if (*return_obj_desc) {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Method returned Obj_desc=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Method returned Obj_desc=%p\n",
X *return_obj_desc));
X DUMP_STACK_ENTRY (*return_obj_desc);
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/resources/rsutils.c linux/drivers/acpi/resources/rsutils.c
--- v2.4.13/linux/drivers/acpi/resources/rsutils.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/resources/rsutils.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: rsutils - Utilities for the resource manager


- * $Revision: 22 $

+ * $Revision: 23 $


X *
X ******************************************************************************/
X

@@ -384,7 +384,6 @@
X */
X cleanup:
X
- ACPI_MEM_FREE (byte_stream);


X return_ACPI_STATUS (status);
X }
X

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/resources/rsxface.c linux/drivers/acpi/resources/rsxface.c
--- v2.4.13/linux/drivers/acpi/resources/rsxface.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/resources/rsxface.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: rsxface - Public interfaces to the resource manager


- * $Revision: 14 $

+ * $Revision: 15 $


X *
X ******************************************************************************/
X

@@ -67,13 +67,6 @@
X FUNCTION_TRACE ("Acpi_get_irq_routing_table ");


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);

- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /*
X * Must have a valid handle and buffer, So we have to have a handle
X * and a return buffer structure, and if there is a non-zero buffer length
@@ -126,13 +119,6 @@
X FUNCTION_TRACE ("Acpi_get_current_resources");


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);

- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /*
X * Must have a valid handle and buffer, So we have to have a handle
X * and a return buffer structure, and if there is a non-zero buffer length
@@ -182,13 +168,6 @@
X FUNCTION_TRACE ("Acpi_get_possible_resources");


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);

- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /*
X * Must have a valid handle and buffer, So we have to have a handle
X * and a return buffer structure, and if there is a non-zero buffer length
@@ -234,13 +213,6 @@
X
X FUNCTION_TRACE ("Acpi_set_current_resources");


X
-
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);

- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }

X
X /*
X * Must have a valid handle and buffer
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/tables/tbconvrt.c linux/drivers/acpi/tables/tbconvrt.c
--- v2.4.13/linux/drivers/acpi/tables/tbconvrt.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/tables/tbconvrt.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: tbconvrt - ACPI Table conversion utilities


- * $Revision: 27 $

+ * $Revision: 28 $


X *
X *****************************************************************************/
X

@@ -66,7 +66,7 @@
X else
X #endif
X {
- pointer_size = sizeof (UINT64);
+ pointer_size = sizeof (u64);
X }
X
X /*
@@ -109,7 +109,7 @@
X
X /* Compute size of the converted XSDT */
X
- table_size = (*number_of_tables * sizeof (UINT64)) + sizeof (acpi_table_header);
+ table_size = (*number_of_tables * sizeof (u64)) + sizeof (acpi_table_header);
X
X
X /* Allocate an XSDT */
@@ -239,7 +239,7 @@
X FADT2->sci_int = FADT71->sci_int;
X FADT2->acpi_enable = FADT71->acpi_enable;
X FADT2->acpi_disable = FADT71->acpi_disable;
- FADT2->S4_bios_req = FADT71->S4_bios_req;
+ FADT2->S4bios_req = FADT71->S4bios_req;
X FADT2->plvl2_lat = FADT71->plvl2_lat;
X FADT2->plvl3_lat = FADT71->plvl3_lat;
X FADT2->day_alrm = FADT71->day_alrm;
@@ -476,7 +476,7 @@
X /* Dump the entire FADT */
X
X ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
- "Hex dump of common internal FADT, size %ld (%lX)\n",
+ "Hex dump of common internal FADT, size %d (%X)\n",
X acpi_gbl_FADT->header.length, acpi_gbl_FADT->header.length));
X DUMP_BUFFER ((u8 *) (acpi_gbl_FADT), acpi_gbl_FADT->header.length);


X
@@ -540,7 +540,7 @@

X FACS1 = (facs_descriptor_rev1 *) acpi_gbl_FACS;
X
X common_facs->global_lock = &(FACS1->global_lock);
- common_facs->firmware_waking_vector = (UINT64 *) &FACS1->firmware_waking_vector;
+ common_facs->firmware_waking_vector = (u64 *) &FACS1->firmware_waking_vector;
X common_facs->vector_width = 32;
X
X #endif
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/tables/tbget.c linux/drivers/acpi/tables/tbget.c
--- v2.4.13/linux/drivers/acpi/tables/tbget.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/tables/tbget.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: tbget - ACPI Table get* routines


- * $Revision: 55 $

+ * $Revision: 56 $


X *
X *****************************************************************************/
X

@@ -617,7 +617,7 @@
X * Get the RSDT from the RSDP


X */
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO,

- "RSDP located at %p, RSDT physical=%8.8lX%8.8lX \n",
+ "RSDP located at %p, RSDT physical=%8.8X%8.8X \n",
X acpi_gbl_RSDP, HIDWORD(acpi_gbl_RSDP->rsdt_physical_address),
X LODWORD(acpi_gbl_RSDP->rsdt_physical_address)));
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/tables/tbinstal.c linux/drivers/acpi/tables/tbinstal.c
--- v2.4.13/linux/drivers/acpi/tables/tbinstal.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/tables/tbinstal.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: tbinstal - ACPI table installation and removal
- * $Revision: 42 $
+ * $Revision: 45 $


X *
X *****************************************************************************/
X

@@ -142,7 +142,7 @@
X status = acpi_gbl_acpi_table_data[i].status;
X
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Found %4.4s\n",
- acpi_gbl_acpi_table_data[i].signature));
+ (char*)acpi_gbl_acpi_table_data[i].signature));
X break;
X }
X }
@@ -266,7 +266,7 @@
X table_desc->base_pointer = table_info->base_pointer;
X table_desc->length = table_info->length;
X table_desc->allocation = table_info->allocation;
- table_desc->aml_pointer = (u8 *) (table_desc->pointer + 1),
+ table_desc->aml_start = (u8 *) (table_desc->pointer + 1),
X table_desc->aml_length = (u32) (table_desc->length -
X (u32) sizeof (acpi_table_header));
X table_desc->table_id = acpi_ut_allocate_owner_id (OWNER_TYPE_TABLE);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/tables/tbutils.c linux/drivers/acpi/tables/tbutils.c
--- v2.4.13/linux/drivers/acpi/tables/tbutils.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/tables/tbutils.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: tbutils - Table manipulation utilities


- * $Revision: 40 $

+ * $Revision: 42 $


X *
X *****************************************************************************/
X

@@ -196,10 +196,10 @@
X MOVE_UNALIGNED32_TO_32 (&signature, &table_header->signature);
X if (!acpi_ut_valid_acpi_name (signature)) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Table signature at %p [%X] has invalid characters\n",
+ "Table signature at %p [%p] has invalid characters\n",
X table_header, &signature));
X
- REPORT_WARNING (("Invalid table signature %4.4s found\n", &signature));
+ REPORT_WARNING (("Invalid table signature %4.4s found\n", (char*)&signature));
X DUMP_BUFFER (table_header, sizeof (acpi_table_header));
X return (AE_BAD_SIGNATURE);


X }
@@ -210,7 +210,7 @@

X if (table_header->length < sizeof (acpi_table_header)) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
X "Invalid length in table header %p name %4.4s\n",
- table_header, &signature));
+ table_header, (char*)&signature));
X
X REPORT_WARNING (("Invalid table header length found\n"));
X DUMP_BUFFER (table_header, sizeof (acpi_table_header));


@@ -334,7 +334,7 @@
X

X if (checksum) {
X REPORT_WARNING (("Invalid checksum (%X) in table %4.4s\n",
- checksum, &table_header->signature));
+ checksum, (char*)&table_header->signature));
X
X status = AE_BAD_CHECKSUM;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/tables/tbxface.c linux/drivers/acpi/tables/tbxface.c
--- v2.4.13/linux/drivers/acpi/tables/tbxface.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/tables/tbxface.c Wed Oct 24 14:06:22 2001
@@ -2,7 +2,7 @@
X *
X * Module Name: tbxface - Public interfaces to the ACPI subsystem
X * ACPI table oriented interfaces


- * $Revision: 43 $

+ * $Revision: 45 $


X *
X *****************************************************************************/
X

@@ -59,14 +59,6 @@
X FUNCTION_TRACE ("Acpi_load_tables");


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);

- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-
-

X /* Get the RSDP */
X
X status = acpi_os_get_root_pointer (ACPI_LOGICAL_ADDRESSING,
@@ -154,13 +146,6 @@
X FUNCTION_TRACE ("Acpi_load_table");


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);

- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X if (!table_ptr) {
X return_ACPI_STATUS (AE_BAD_PARAMETER);
X }
@@ -213,19 +198,11 @@
X acpi_table_type table_type)
X {
X acpi_table_desc *list_head;
- acpi_status status;
X
X
X FUNCTION_TRACE ("Acpi_unload_table");


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);

- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X /* Parameter validation */
X

X if (table_type > ACPI_TABLE_MAX) {
@@ -289,13 +266,6 @@
X FUNCTION_TRACE ("Acpi_get_table_header");


X
X
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);

- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-

X if ((instance == 0) ||
X (table_type == ACPI_TABLE_RSDP) ||
X (!out_table_header)) {
@@ -371,13 +341,6 @@
X
X FUNCTION_TRACE ("Acpi_get_table");


X
-
- /* Ensure that ACPI has been initialized */
-
- ACPI_IS_INITIALIZATION_COMPLETE (status);

- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }

X
X /*
X * If we have a buffer, we must have a length too
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/tables/tbxfroot.c linux/drivers/acpi/tables/tbxfroot.c
--- v2.4.13/linux/drivers/acpi/tables/tbxfroot.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/tables/tbxfroot.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: tbxfroot - Find the root ACPI table (RSDT)
- * $Revision: 49 $
+ * $Revision: 52 $


X *
X *****************************************************************************/
X

@@ -152,7 +152,7 @@
X {
X u8 *table_ptr;
X u8 *mem_rover;
- UINT64 phys_addr;
+ u64 phys_addr;


X acpi_status status = AE_OK;
X

X
@@ -277,10 +277,10 @@
X acpi_table_header **table_pointer)
X {
X ACPI_PHYSICAL_ADDRESS physical_address;
- acpi_table_header *rsdt_ptr;
+ acpi_table_header *rsdt_ptr = NULL;
X acpi_table_header *table_ptr;
X acpi_status status;
- u32 rsdt_size;
+ u32 rsdt_size = 0;
X u32 table_size;
X u32 table_count;
X u32 i;
@@ -304,18 +304,49 @@


X return_ACPI_STATUS (AE_BAD_PARAMETER);
X }
X

- /* Get the RSDP */
+ if (!acpi_gbl_RSDP) {
+ /* Get the RSDP */
X
- status = acpi_os_get_root_pointer (flags, &physical_address);
- if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "RSDP not found\n"));
- return_ACPI_STATUS (AE_NO_ACPI_TABLES);
+ status = acpi_os_get_root_pointer (flags, &physical_address);
+ if (ACPI_FAILURE (status)) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "RSDP not found\n"));
+ return_ACPI_STATUS (AE_NO_ACPI_TABLES);
+ }
+
+ /* Map and validate the RSDP */
+
+ if ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING) {
+ status = acpi_os_map_memory (physical_address, sizeof (RSDP_DESCRIPTOR),
+ (void **) &acpi_gbl_RSDP);
+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }
+ }
+ else {
+ acpi_gbl_RSDP = (void *) (NATIVE_UINT) physical_address;
+ }
+
+ /*
+ * The signature and checksum must both be correct
+ */
+ if (STRNCMP ((NATIVE_CHAR *) acpi_gbl_RSDP, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) {
+ /* Nope, BAD Signature */
+
+ status = AE_BAD_SIGNATURE;


+ goto cleanup;
+ }
+

+ if (acpi_tb_checksum (acpi_gbl_RSDP, RSDP_CHECKSUM_LENGTH) != 0) {
+ /* Nope, BAD Checksum */
+
+ status = AE_BAD_CHECKSUM;
+ goto cleanup;
+ }
X }
X
- acpi_gbl_RSDP = (RSDP_DESCRIPTOR *) (ACPI_TBLPTR) physical_address;
X
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "RSDP located at %p, RSDT physical=%8.8lX%8.8lX \n",
+ "RSDP located at %p, RSDT physical=%8.8X%8.8X \n",
X acpi_gbl_RSDP, HIDWORD(acpi_gbl_RSDP->rsdt_physical_address),
X LODWORD(acpi_gbl_RSDP->rsdt_physical_address)));
X
@@ -377,7 +408,8 @@
X
X /* Delete table mapping if using virtual addressing */
X
- if (table_size) {
+ if ((table_size) &&
+ ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING)) {
X acpi_os_unmap_memory (table_ptr, table_size);
X }
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/utilities/utalloc.c linux/drivers/acpi/utilities/utalloc.c
--- v2.4.13/linux/drivers/acpi/utilities/utalloc.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/utilities/utalloc.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: utalloc - local cache and memory allocation routines
- * $Revision: 100 $
+ * $Revision: 106 $


X *
X *****************************************************************************/
X

@@ -75,6 +75,7 @@
X /* Mark the object as cached */
X
X MEMSET (object, 0xCA, cache_info->object_size);
+ ((acpi_operand_object *) object)->common.data_type = ACPI_CACHED_OBJECT;
X
X /* Put the object at the head of the cache list */
X
@@ -200,14 +201,14 @@
X * Each memory allocation is tracked via a doubly linked list. Each
X * element contains the caller's component, module name, function name, and
X * line number. Acpi_ut_allocate and Acpi_ut_callocate call
- * Acpi_ut_add_element_to_alloc_list to add an element to the list; deletion
+ * Acpi_ut_track_allocation to add an element to the list; deletion
X * occurs in the body of Acpi_ut_free.
X */
X

X
X /*******************************************************************************
X *

- * FUNCTION: Acpi_ut_search_alloc_list
+ * FUNCTION: Acpi_ut_find_allocation
X *
X * PARAMETERS: Address - Address of allocated memory
X *
@@ -217,12 +218,12 @@


X *
X ******************************************************************************/
X

-ACPI_DEBUG_MEM_BLOCK *
-acpi_ut_search_alloc_list (
+acpi_debug_mem_block *
+acpi_ut_find_allocation (
X u32 list_id,
X void *address)
X {
- ACPI_DEBUG_MEM_BLOCK *element;
+ acpi_debug_mem_block *element;


X
X
X FUNCTION_ENTRY ();

@@ -250,7 +251,7 @@


X
X /*******************************************************************************
X *

- * FUNCTION: Acpi_ut_add_element_to_alloc_list
+ * FUNCTION: Acpi_ut_track_allocation
X *
X * PARAMETERS: Address - Address of allocated memory
X * Size - Size of the allocation
@@ -266,9 +267,9 @@
X ******************************************************************************/
X
X acpi_status
-acpi_ut_add_element_to_alloc_list (
+acpi_ut_track_allocation (
X u32 list_id,
- ACPI_DEBUG_MEM_BLOCK *address,
+ acpi_debug_mem_block *address,
X u32 size,
X u8 alloc_type,
X u32 component,
@@ -276,11 +277,11 @@
X u32 line)
X {
X ACPI_MEMORY_LIST *mem_list;
- ACPI_DEBUG_MEM_BLOCK *element;
+ acpi_debug_mem_block *element;


X acpi_status status = AE_OK;
X

X
- FUNCTION_TRACE_PTR ("Ut_add_element_to_alloc_list", address);
+ FUNCTION_TRACE_PTR ("Ut_track_allocation", address);
X
X
X if (list_id > ACPI_MEM_LIST_MAX) {
@@ -295,9 +296,9 @@
X * This will catch several kinds of problems.
X */
X
- element = acpi_ut_search_alloc_list (list_id, address);
+ element = acpi_ut_find_allocation (list_id, address);
X if (element) {
- REPORT_ERROR (("Ut_add_element_to_alloc_list: Address already present in list! (%p)\n",
+ REPORT_ERROR (("Ut_track_allocation: Address already present in list! (%p)\n",
X address));
X
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Element %p Address %p\n", element, address));
@@ -317,7 +318,7 @@
X /* Insert at list head */
X
X if (mem_list->list_head) {
- ((ACPI_DEBUG_MEM_BLOCK *)(mem_list->list_head))->previous = address;
+ ((acpi_debug_mem_block *)(mem_list->list_head))->previous = address;
X }
X
X address->next = mem_list->list_head;
@@ -334,7 +335,7 @@


X
X /*******************************************************************************
X *

- * FUNCTION: Acpi_ut_delete_element_from_alloc_list
+ * FUNCTION: Acpi_ut_remove_allocation
X *
X * PARAMETERS: Address - Address of allocated memory
X * Component - Component type of caller
@@ -348,9 +349,9 @@
X ******************************************************************************/
X
X acpi_status
-acpi_ut_delete_element_from_alloc_list (
+acpi_ut_remove_allocation (
X u32 list_id,
- ACPI_DEBUG_MEM_BLOCK *address,
+ acpi_debug_mem_block *address,
X u32 component,
X NATIVE_CHAR *module,
X u32 line)
@@ -358,7 +359,7 @@
X ACPI_MEMORY_LIST *mem_list;
X
X
- FUNCTION_TRACE ("Ut_delete_element_from_alloc_list");
+ FUNCTION_TRACE ("Ut_remove_allocation");
X
X
X if (list_id > ACPI_MEM_LIST_MAX) {
@@ -370,7 +371,7 @@
X /* No allocations! */
X
X _REPORT_ERROR (module, line, component,
- ("Ut_delete_element_from_alloc_list: Empty allocation list, nothing to free!\n"));
+ ("Ut_remove_allocation: Empty allocation list, nothing to free!\n"));


X
X return_ACPI_STATUS (AE_OK);
X }

@@ -429,34 +430,34 @@
X ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
X ("%30s: %4d (%3d Kb)\n", "Current allocations",
X Mem_list->Current_count,
- ROUND_UP_TO_1_k (Mem_list->Current_size)));
+ ROUND_UP_TO_1K (Mem_list->Current_size)));
X
X ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
X ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
X Mem_list->Max_concurrent_count,
- ROUND_UP_TO_1_k (Mem_list->Max_concurrent_size)));
+ ROUND_UP_TO_1K (Mem_list->Max_concurrent_size)));
X
X
X ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
X ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
X Running_object_count,
- ROUND_UP_TO_1_k (Running_object_size)));
+ ROUND_UP_TO_1K (Running_object_size)));
X
X ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
X ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
X Running_alloc_count,
- ROUND_UP_TO_1_k (Running_alloc_size)));
+ ROUND_UP_TO_1K (Running_alloc_size)));
X
X
X ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
X ("%30s: %4d (%3d Kb)\n", "Current Nodes",
X Acpi_gbl_Current_node_count,
- ROUND_UP_TO_1_k (Acpi_gbl_Current_node_size)));
+ ROUND_UP_TO_1K (Acpi_gbl_Current_node_size)));
X
X ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
X ("%30s: %4d (%3d Kb)\n", "Max Nodes",
X Acpi_gbl_Max_concurrent_node_count,
- ROUND_UP_TO_1_k ((Acpi_gbl_Max_concurrent_node_count * sizeof (acpi_namespace_node)))));
+ ROUND_UP_TO_1K ((Acpi_gbl_Max_concurrent_node_count * sizeof (acpi_namespace_node)))));
X */
X return_VOID;
X }
@@ -464,7 +465,7 @@


X
X /*******************************************************************************
X *

- * FUNCTION: Acpi_ut_dump_current_allocations
+ * FUNCTION: Acpi_ut_dump_allocations
X *
X * PARAMETERS: Component - Component(s) to dump info for.
X * Module - Module to dump info for. NULL means all.
@@ -476,20 +477,20 @@
X ******************************************************************************/
X

X void
-acpi_ut_dump_current_allocations (
+acpi_ut_dump_allocations (
X u32 component,
X NATIVE_CHAR *module)

X {
- ACPI_DEBUG_MEM_BLOCK *element;
+ acpi_debug_mem_block *element;


X u32 i;
X
X

- FUNCTION_TRACE ("Ut_dump_current_allocations");
+ FUNCTION_TRACE ("Ut_dump_allocations");
X
X
X element = acpi_gbl_memory_lists[0].list_head;
X if (element == NULL) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ ACPI_DEBUG_PRINT ((ACPI_DB_OK,
X "No outstanding allocations.\n"));
X return_VOID;
X }
@@ -500,46 +501,89 @@
X */
X acpi_ut_acquire_mutex (ACPI_MTX_MEMORY);
X
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ ACPI_DEBUG_PRINT ((ACPI_DB_OK,
X "Outstanding allocations:\n"));
X
X for (i = 1; ; i++) /* Just a counter */ {
X if ((element->component & component) &&
X ((module == NULL) || (0 == STRCMP (module, element->module)))) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
- "%p Len %04lX %9.9s-%ld",
- &element->user_space, element->size, element->module,
- element->line));
-
- /* Most of the elements will be internal objects. */
-
- switch (((acpi_operand_object *)
- (&element->user_space))->common.data_type) {
- case ACPI_DESC_TYPE_INTERNAL:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS,
- " Obj_type %s",
- acpi_ut_get_type_name (((acpi_operand_object *)(&element->user_space))->common.type)));
- break;
-
- case ACPI_DESC_TYPE_PARSER:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS,
- " Parse_obj Opcode %04X",
- ((acpi_parse_object *)(&element->user_space))->opcode));
- break;
-
- case ACPI_DESC_TYPE_NAMED:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS,
- " Node %4.4s",
- &((acpi_namespace_node *)(&element->user_space))->name));
- break;
-
- case ACPI_DESC_TYPE_STATE:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS,
- " State_obj"));
- break;
- }
+ if (((acpi_operand_object *)(&element->user_space))->common.type != ACPI_CACHED_OBJECT) {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ "%p Len %04X %9.9s-%d",
+ &element->user_space, element->size, element->module,
+ element->line));
+
+ /* Most of the elements will be internal objects. */
+
+ switch (((acpi_operand_object *)
+ (&element->user_space))->common.data_type) {
+ case ACPI_DESC_TYPE_INTERNAL:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " Obj_type %12.12s R%d",
+ acpi_ut_get_type_name (((acpi_operand_object *)(&element->user_space))->common.type),
+ ((acpi_operand_object *)(&element->user_space))->common.reference_count));
+ break;
+
+ case ACPI_DESC_TYPE_PARSER:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " Parse_obj Opcode %04X",
+ ((acpi_parse_object *)(&element->user_space))->opcode));
+ break;
+
+ case ACPI_DESC_TYPE_NAMED:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " Node %4.4s",
+ (char*)&((acpi_namespace_node *)(&element->user_space))->name));
+ break;
+
+ case ACPI_DESC_TYPE_STATE:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " Untyped State_obj"));
+ break;
+
+ case ACPI_DESC_TYPE_STATE_UPDATE:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " UPDATE State_obj"));
+ break;
+
+ case ACPI_DESC_TYPE_STATE_PACKAGE:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " PACKAGE State_obj"));
+ break;
+
+ case ACPI_DESC_TYPE_STATE_CONTROL:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " CONTROL State_obj"));
+ break;
+
+ case ACPI_DESC_TYPE_STATE_RPSCOPE:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " ROOT-PARSE-SCOPE State_obj"));
+ break;
+
+ case ACPI_DESC_TYPE_STATE_PSCOPE:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " PARSE-SCOPE State_obj"));
+ break;
+
+ case ACPI_DESC_TYPE_STATE_WSCOPE:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " WALK-SCOPE State_obj"));
+ break;
+
+ case ACPI_DESC_TYPE_STATE_RESULT:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " RESULT State_obj"));
+ break;
+
+ case ACPI_DESC_TYPE_STATE_NOTIFY:
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
+ " NOTIFY State_obj"));
+ break;
+ }
X
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS, "\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "\n"));
+ }
X }
X
X if (element->next == NULL) {
@@ -551,7 +595,7 @@
X
X acpi_ut_release_mutex (ACPI_MTX_MEMORY);
X
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ ACPI_DEBUG_PRINT ((ACPI_DB_OK,
X "Total number of unfreed allocations = %d(%X)\n", i,i));
X
X
@@ -582,7 +626,7 @@
X NATIVE_CHAR *module,
X u32 line)
X {
- ACPI_DEBUG_MEM_BLOCK *address;
+ acpi_debug_mem_block *address;


X acpi_status status;
X
X

@@ -597,7 +641,7 @@
X size = 1;
X }
X
- address = acpi_os_allocate (size + sizeof (ACPI_DEBUG_MEM_BLOCK));
+ address = acpi_os_allocate (size + sizeof (acpi_debug_mem_block));
X if (!address) {
X /* Report allocation error */
X
@@ -607,7 +651,7 @@
X return_PTR (NULL);
X }
X
- status = acpi_ut_add_element_to_alloc_list (ACPI_MEM_LIST_GLOBAL, address, size,
+ status = acpi_ut_track_allocation (ACPI_MEM_LIST_GLOBAL, address, size,
X MEM_MALLOC, component, module, line);
X if (ACPI_FAILURE (status)) {
X acpi_os_free (address);
@@ -645,7 +689,7 @@
X NATIVE_CHAR *module,
X u32 line)
X {
- ACPI_DEBUG_MEM_BLOCK *address;
+ acpi_debug_mem_block *address;


X acpi_status status;
X
X

@@ -661,7 +705,7 @@
X }
X
X
- address = acpi_os_callocate (size + sizeof (ACPI_DEBUG_MEM_BLOCK));
+ address = acpi_os_callocate (size + sizeof (acpi_debug_mem_block));
X if (!address) {
X /* Report allocation error */
X
@@ -670,7 +714,7 @@
X return_PTR (NULL);
X }
X
- status = acpi_ut_add_element_to_alloc_list (ACPI_MEM_LIST_GLOBAL, address, size,
+ status = acpi_ut_track_allocation (ACPI_MEM_LIST_GLOBAL, address, size,
X MEM_CALLOC, component, module, line);
X if (ACPI_FAILURE (status)) {
X acpi_os_free (address);
@@ -707,7 +751,7 @@
X NATIVE_CHAR *module,
X u32 line)
X {
- ACPI_DEBUG_MEM_BLOCK *debug_block;
+ acpi_debug_mem_block *debug_block;
X
X
X FUNCTION_TRACE_PTR ("Ut_free", address);
@@ -720,13 +764,13 @@
X return_VOID;
X }
X
- debug_block = (ACPI_DEBUG_MEM_BLOCK *)
- (((char *) address) - sizeof (ACPI_DEBUG_MEM_HEADER));
+ debug_block = (acpi_debug_mem_block *)
+ (((char *) address) - sizeof (acpi_debug_mem_header));
X
X acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].total_freed++;
X acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].current_total_size -= debug_block->size;
X
- acpi_ut_delete_element_from_alloc_list (ACPI_MEM_LIST_GLOBAL, debug_block,
+ acpi_ut_remove_allocation (ACPI_MEM_LIST_GLOBAL, debug_block,
X component, module, line);
X acpi_os_free (debug_block);
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/utilities/utcopy.c linux/drivers/acpi/utilities/utcopy.c
--- v2.4.13/linux/drivers/acpi/utilities/utcopy.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/utilities/utcopy.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: utcopy - Internal to external object translation utilities
- * $Revision: 82 $
+ * $Revision: 83 $


X *
X *****************************************************************************/
X

@@ -135,7 +135,7 @@
X

X case AML_REVISION_OP:
X external_object->type = ACPI_TYPE_INTEGER;
- external_object->integer.value = ACPI_CA_VERSION;
+ external_object->integer.value = ACPI_CA_SUPPORT_LEVEL;


X break;
X
X case AML_INT_NAMEPATH_OP:

diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/utilities/utdebug.c linux/drivers/acpi/utilities/utdebug.c
--- v2.4.13/linux/drivers/acpi/utilities/utdebug.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/utilities/utdebug.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: utdebug - Debug print routines
- * $Revision: 87 $
+ * $Revision: 90 $


X *
X *****************************************************************************/
X

@@ -87,10 +87,6 @@
X
X if (acpi_gbl_nesting_level > acpi_gbl_deepest_nesting) {
X acpi_gbl_deepest_nesting = acpi_gbl_nesting_level;
-
- if (acpi_gbl_deepest_nesting == 34) {
- acpi_os_printf ("hit deepest nesting\n");
- }
X }
X }
X
@@ -119,7 +115,7 @@


X acpi_ut_debug_print (
X u32 requested_debug_level,
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X char *format,

X ...)
X {
@@ -192,7 +188,7 @@


X acpi_ut_debug_print_raw (
X u32 requested_debug_level,
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X char *format,

X ...)
X {
@@ -230,7 +226,7 @@


X void
X acpi_ut_trace (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info)
+ acpi_debug_print_info *dbg_info)
X {
X

X acpi_gbl_nesting_level++;
@@ -262,7 +258,7 @@


X void
X acpi_ut_trace_ptr (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X void *pointer)
X {

X acpi_gbl_nesting_level++;
@@ -294,7 +290,7 @@


X void
X acpi_ut_trace_str (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X NATIVE_CHAR *string)
X {
X

@@ -327,7 +323,7 @@


X void
X acpi_ut_trace_u32 (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X u32 integer)
X {
X

@@ -359,7 +355,7 @@


X void
X acpi_ut_exit (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info)
+ acpi_debug_print_info *dbg_info)
X {
X

X acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
@@ -390,7 +386,7 @@


X void
X acpi_ut_status_exit (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X acpi_status status)
X {
X

@@ -430,12 +426,12 @@


X void
X acpi_ut_value_exit (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X acpi_integer value)
X {
X

X acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
- "%s %08X\n", acpi_gbl_fn_exit_str, value);
+ "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str, HIDWORD(value), LODWORD(value));
X
X acpi_gbl_nesting_level--;
X }
@@ -462,7 +458,7 @@


X void
X acpi_ut_ptr_exit (
X u32 line_number,
- ACPI_DEBUG_PRINT_INFO *dbg_info,
+ acpi_debug_print_info *dbg_info,
X u8 *ptr)

X {
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/utilities/utdelete.c linux/drivers/acpi/utilities/utdelete.c
--- v2.4.13/linux/drivers/acpi/utilities/utdelete.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/utilities/utdelete.c Wed Oct 24 14:06:22 2001
@@ -1,7 +1,7 @@
X /*******************************************************************************
X *
X * Module Name: utdelete - object deletion and reference count utilities


- * $Revision: 76 $

+ * $Revision: 81 $


X *
X ******************************************************************************/
X

@@ -183,14 +183,10 @@
X * Delete any allocated memory found above
X */
X if (obj_pointer) {
- if (!acpi_tb_system_table_pointer (obj_pointer)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting Obj Ptr %p \n", obj_pointer));
-
- ACPI_MEM_FREE (obj_pointer);
- }
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting Obj Ptr %p \n", obj_pointer));
+ ACPI_MEM_FREE (obj_pointer);
X }
X
-
X /* Only delete the object if it was dynamically allocated */
X
X if (object->common.flags & AOPOBJ_STATIC_ALLOCATION) {
@@ -346,8 +342,8 @@
X */
X if (count > MAX_REFERENCE_COUNT) {
X
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "**** AE_ERROR **** Invalid Reference Count (%X) in object %p\n\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN,
+ "**** Warning **** Large Reference Count (%X) in object %p\n\n",
X count, object));
X }
X
@@ -408,11 +404,6 @@


X return_ACPI_STATUS (AE_OK);
X }
X

- if (acpi_tb_system_table_pointer (object)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Object %p is Pcode Ptr\n", object));


- return_ACPI_STATUS (AE_OK);
- }
-

X
X state = acpi_ut_create_update_state (object, action);
X
@@ -529,24 +520,9 @@
X
X
X case ACPI_TYPE_REGION:


-
- /* TBD: [Investigate]

- Acpi_ut_update_ref_count (Object->Region.Addr_handler, Action);
- */
-/*
- Status =
- Acpi_ut_create_update_state_and_push (Object->Region.Addr_handler,
- Action, &State_list);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-*/
- break;
-
-
X case INTERNAL_TYPE_REFERENCE:
X
+ /* No subobjects */
X break;
X }
X
@@ -625,6 +601,15 @@
X
X FUNCTION_TRACE_PTR ("Ut_remove_reference", object);
X
+ /*
+ * Allow a NULL pointer to be passed in, just ignore it. This saves
+ * each caller from having to check. Also, ignore NS nodes.
+ *
+ */
+ if (!object ||
+ (VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_NAMED))) {
+ return_VOID;
+ }
X
X /*
X * Ensure that we have a valid object
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/utilities/uteval.c linux/drivers/acpi/utilities/uteval.c
--- v2.4.13/linux/drivers/acpi/utilities/uteval.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/utilities/uteval.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: uteval - Object evaluation


- * $Revision: 30 $

+ * $Revision: 31 $


X *
X *****************************************************************************/
X

@@ -69,11 +69,11 @@
X if (ACPI_FAILURE (status)) {
X if (status == AE_NOT_FOUND) {
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s on %4.4s was not found\n",
- object_name, &device_node->name));
+ object_name, (char*)&device_node->name));
X }
X else {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s on %4.4s failed with status %s\n",
- object_name, &device_node->name,
+ object_name, (char*)&device_node->name,
X acpi_format_exception (status)));
X }
X
@@ -132,7 +132,7 @@


X acpi_status
X acpi_ut_execute_HID (
X acpi_namespace_node *device_node,
- ACPI_DEVICE_ID *hid)
+ acpi_device_id *hid)
X {

X acpi_operand_object *obj_desc;
X acpi_status status;

@@ -148,12 +148,12 @@
X if (ACPI_FAILURE (status)) {
X if (status == AE_NOT_FOUND) {
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_HID on %4.4s was not found\n",
- &device_node->name));
+ (char*)&device_node->name));
X }
X
X else {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_HID on %4.4s failed %s\n",
- &device_node->name, acpi_format_exception (status)));
+ (char*)&device_node->name, acpi_format_exception (status)));
X }
X
X return_ACPI_STATUS (status);
@@ -220,7 +220,7 @@


X acpi_status
X acpi_ut_execute_UID (
X acpi_namespace_node *device_node,
- ACPI_DEVICE_ID *uid)
+ acpi_device_id *uid)
X {

X acpi_operand_object *obj_desc;
X acpi_status status;

@@ -236,13 +236,13 @@
X if (ACPI_FAILURE (status)) {
X if (status == AE_NOT_FOUND) {
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_UID on %4.4s was not found\n",
- &device_node->name));
+ (char*)&device_node->name));
X }
X
X else {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
X "_UID on %4.4s failed %s\n",
- &device_node->name, acpi_format_exception (status)));
+ (char*)&device_node->name, acpi_format_exception (status)));


X }
X
X return (status);

@@ -325,7 +325,7 @@
X if (AE_NOT_FOUND == status) {
X ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
X "_STA on %4.4s was not found, assuming present.\n",
- &device_node->name));
+ (char*)&device_node->name));
X
X *flags = 0x0F;
X status = AE_OK;
@@ -333,7 +333,7 @@
X
X else if (ACPI_FAILURE (status)) {
X ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_STA on %4.4s failed %s\n",
- &device_node->name,
+ (char*)&device_node->name,
X acpi_format_exception (status)));
X }
X
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/utilities/utglobal.c linux/drivers/acpi/utilities/utglobal.c
--- v2.4.13/linux/drivers/acpi/utilities/utglobal.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/utilities/utglobal.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: utglobal - Global variables for the ACPI subsystem
- * $Revision: 131 $
+ * $Revision: 133 $


X *
X *****************************************************************************/
X

@@ -147,7 +147,7 @@
X
X const NATIVE_CHAR *acpi_gbl_db_sleep_states[ACPI_NUM_SLEEP_STATES] = {
X "\\_S0_","\\_S1_","\\_S2_","\\_S3_",
- "\\_S4_","\\_S5_","\\_S4_b"};
+ "\\_S4_","\\_S5_","\\_S4B"};
X
X
X /******************************************************************************
@@ -331,7 +331,7 @@
X */
X
X static const NATIVE_CHAR acpi_gbl_bad_type[] = "UNDEFINED";
-#define TYPE_NAME_LENGTH 9 /* Maximum length of each string */
+#define TYPE_NAME_LENGTH 12 /* Maximum length of each string */
X
X static const NATIVE_CHAR *acpi_gbl_ns_type_names[] = /* printable names of ACPI types */
X {
@@ -349,21 +349,21 @@
X /* 11 */ "Power",
X /* 12 */ "Processor",
X /* 13 */ "Thermal",
- /* 14 */ "Buff_field",
+ /* 14 */ "Buffer_field",
X /* 15 */ "Ddb_handle",
- /* 16 */ "Debug_obj",
- /* 17 */ "Regn_field",
+ /* 16 */ "Debug_object",
+ /* 17 */ "Region_field",
X /* 18 */ "Bank_field",
- /* 19 */ "Indx_field",
+ /* 19 */ "Index_field",
X /* 20 */ "Reference",
X /* 21 */ "Alias",
X /* 22 */ "Notify",
- /* 23 */ "Addr_hndlr",
- /* 24 */ "Rsrc_desc",
- /* 25 */ "Rsrc_field",
- /* 26 */ "Rgn_fld_dfn",
- /* 27 */ "Bnk_fld_dfn",
- /* 28 */ "Idx_fld_dfn",
+ /* 23 */ "Addr_handler",
+ /* 24 */ "Resource_desc",
+ /* 25 */ "Resource_fld",
+ /* 26 */ "Region_fld_dfn",
+ /* 27 */ "Bank_fld_dfn",
+ /* 28 */ "Index_fld_dfn",
X /* 29 */ "If",
X /* 30 */ "Else",
X /* 31 */ "While",
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/utilities/utinit.c linux/drivers/acpi/utilities/utinit.c
--- v2.4.13/linux/drivers/acpi/utilities/utinit.c Sun Sep 23 11:40:57 2001
+++ linux/drivers/acpi/utilities/utinit.c Wed Oct 24 14:06:22 2001


@@ -1,7 +1,7 @@
X /******************************************************************************
X *

X * Module Name: utinit - Common ACPI subsystem initialization
- * $Revision: 101 $
+ * $Revision: 102 $


X *
X *****************************************************************************/
X

@@ -245,7 +245,7 @@
X /* Debug only - display leftover memory allocation, if any */
X
X #ifdef ACPI_DBG_TRACK_ALLOCATIONS
- acpi_ut_dump_current_allocations (ACPI_UINT32_MAX, NULL);
+ acpi_ut_dump_allocations (ACPI_UINT32_MAX, NULL);
X #endif
X
X return_ACPI_STATUS (AE_OK);
diff -u --recursive --new-file v2.4.13/linux/drivers/acpi/utilities/utmath.c linux/drivers/acpi/utilities/utmath.c
--- v2.4.13/linux/drivers/acpi/utilities/utmath.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/acpi/utilities/utmath.c Wed Oct 24 14:06:22 2001
@@ -0,0 +1,314 @@
+/*******************************************************************************
+ *
+ * Module Name: utmath - Integer math support routines
+ * $Revision: 7 $


+ *
+ ******************************************************************************/
+

+/*
+ * Copyright (C) 2000, 2001 R. Byron Moore


+ *
+ * This 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 "acpi.h"
+

+
+#define _COMPONENT ACPI_UTILITIES
+ MODULE_NAME ("utmath")
+
+/*
+ * Support for double-precision integer divide. This code is included here
+ * in order to support kernel environments where the double-precision math
+ * library is not available.
+ */
+
+#ifndef ACPI_USE_NATIVE_DIVIDE
+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ut_short_divide
+ *
+ * PARAMETERS: In_dividend - Pointer to the dividend
+ * Divisor - 32-bit divisor
+ * Out_quotient - Pointer to where the quotient is returned
+ * Out_remainder - Pointer to where the remainder is returned
+ *
+ * RETURN: Status (Checks for divide-by-zero)
+ *
+ * DESCRIPTION: Perform a short (maximum 64 bits divided by 32 bits)
+ * divide and modulo. The result is a 64-bit quotient and a
+ * 32-bit remainder.
+ *
+ ******************************************************************************/


+
+acpi_status
+acpi_ut_short_divide (
+ acpi_integer *in_dividend,
+ u32 divisor,
+ acpi_integer *out_quotient,
+ u32 *out_remainder)

+{
+ uint64_overlay dividend;
+ uint64_overlay quotient;
+ u32 remainder32;
+
+
+ FUNCTION_TRACE ("Ut_short_divide");
+
+ dividend.full = *in_dividend;
+
+ /* Always check for a zero divisor */
+
+ if (divisor == 0) {
+ REPORT_ERROR (("Acpi_ut_short_divide: Divide by zero\n"));
+ return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
+ }
+
+ /*
+ * The quotient is 64 bits, the remainder is always 32 bits,
+ * and is generated by the second divide.
+ */
+ ACPI_DIV_64_BY_32 (0, dividend.part.hi, divisor,
+ quotient.part.hi, remainder32);
+ ACPI_DIV_64_BY_32 (remainder32, dividend.part.lo, divisor,
+ quotient.part.lo, remainder32);
+
+ /* Return only what was requested */
+
+ if (out_quotient) {
+ *out_quotient = quotient.full;
+ }
+ if (out_remainder) {
+ *out_remainder = remainder32;
+ }
+


+ return_ACPI_STATUS (AE_OK);
+}
+

+
+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ut_divide
+ *
+ * PARAMETERS: In_dividend - Pointer to the dividend
+ * In_divisor - Pointer to the divisor
+ * Out_quotient - Pointer to where the quotient is returned
+ * Out_remainder - Pointer to where the remainder is returned
+ *
+ * RETURN: Status (Checks for divide-by-zero)
+ *
+ * DESCRIPTION: Perform a divide and modulo.


+ *
+ ******************************************************************************/
+

+acpi_status
+acpi_ut_divide (
+ acpi_integer *in_dividend,
+ acpi_integer *in_divisor,
+ acpi_integer *out_quotient,
+ acpi_integer *out_remainder)

+{
+ uint64_overlay dividend;
+ uint64_overlay divisor;
+ uint64_overlay quotient;
+ uint64_overlay remainder;
+ uint64_overlay normalized_dividend;
+ uint64_overlay normalized_divisor;
+ u32 partial1;
+ uint64_overlay partial2;
+ uint64_overlay partial3;
+
+
+ FUNCTION_TRACE ("Ut_divide");
+
+
+ /* Always check for a zero divisor */
+
+ if (*in_divisor == 0) {
+ REPORT_ERROR (("Acpi_ut_divide: Divide by zero\n"));
+ return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
+ }
+
+ divisor.full = *in_divisor;
+ dividend.full = *in_dividend;
+ if (divisor.part.hi == 0) {
+ /*
+ * 1) Simplest case is where the divisor is 32 bits, we can
+ * just do two divides
+ */
+ remainder.part.hi = 0;
+
+ /*
+ * The quotient is 64 bits, the remainder is always 32 bits,
+ * and is generated by the second divide.
+ */
+ ACPI_DIV_64_BY_32 (0, dividend.part.hi, divisor.part.lo,
+ quotient.part.hi, partial1);
+ ACPI_DIV_64_BY_32 (partial1, dividend.part.lo, divisor.part.lo,
+ quotient.part.lo, remainder.part.lo);
+ }
+
+ else {
+ /*
+ * 2) The general case where the divisor is a full 64 bits
+ * is more difficult
+ */
+ quotient.part.hi = 0;
+ normalized_dividend = dividend;
+ normalized_divisor = divisor;
+
+ /* Normalize the operands (shift until the divisor is < 32 bits) */
+
+ do {
+ ACPI_SHIFT_RIGHT_64 (normalized_divisor.part.hi,
+ normalized_divisor.part.lo);
+ ACPI_SHIFT_RIGHT_64 (normalized_dividend.part.hi,
+ normalized_dividend.part.lo);
+
+ } while (normalized_divisor.part.hi != 0);
+
+ /* Partial divide */
+
+ ACPI_DIV_64_BY_32 (normalized_dividend.part.hi,
+ normalized_dividend.part.lo,
+ normalized_divisor.part.lo,
+ quotient.part.lo, partial1);
+
+ /*
+ * The quotient is always 32 bits, and simply requires adjustment.
+ * The 64-bit remainder must be generated.
+ */
+ partial1 = quotient.part.lo * divisor.part.hi;
+ partial2.full = (acpi_integer) quotient.part.lo * divisor.part.lo;
+ partial3.full = partial2.part.hi + partial1;
+
+ remainder.part.hi = partial3.part.lo;
+ remainder.part.lo = partial2.part.lo;
+
+ if (partial3.part.hi == 0) {
+ if (partial3.part.lo >= dividend.part.hi) {
+ if (partial3.part.lo == dividend.part.hi) {
+ if (partial2.part.lo > dividend.part.lo) {
+ quotient.part.lo--;
+ remainder.full -= divisor.full;
+ }
+ }
+ else {
+ quotient.part.lo--;
+ remainder.full -= divisor.full;
+ }
+ }
+
+ remainder.full = remainder.full - dividend.full;
+ remainder.part.hi = -((s32) remainder.part.hi);
+ remainder.part.lo = -((s32) remainder.part.lo);
+
+ if (remainder.part.lo) {
+ remainder.part.hi--;
+ }
+ }
+ }
+
+ /* Return only what was requested */
+
+ if (out_quotient) {
+ *out_quotient = quotient.full;
+ }
+ if (out_remainder) {
+ *out_remainder = remainder.full;
+ }
+


+ return_ACPI_STATUS (AE_OK);
+}
+

+#else
+
+/*******************************************************************************
+ *
+ * FUNCTION: Acpi_ut_short_divide, Acpi_ut_divide
+ *
+ * DESCRIPTION: Native versions of the Ut_divide functions. Use these if either
+ * 1) The target is a 64-bit platform and therefore 64-bit
+ * integer math is supported directly by the machine.
+ * 2) The target is a 32-bit or 16-bit platform, and the
+ * double-precision integer math library is available to
+ * perform the divide.
+ *
+ ******************************************************************************/


+
+acpi_status
+acpi_ut_short_divide (
+ acpi_integer *in_dividend,
+ u32 divisor,

SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 24'
echo 'File patch-2.4.14 is continued in part 25'
echo "25" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:05 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part42

#!/bin/sh -x
# this is part 42 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 42; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X
X #include <video/fbcon.h>
X #include <video/fbcon-cfb8.h>
diff -u --recursive --new-file v2.4.13/linux/drivers/zorro/gen-devlist.c linux/drivers/zorro/gen-devlist.c
--- v2.4.13/linux/drivers/zorro/gen-devlist.c Mon Oct 16 12:51:16 2000
+++ linux/drivers/zorro/gen-devlist.c Sun Nov 4 09:31:58 2001
@@ -5,7 +5,7 @@
X *
X * Based on the PCI version:


X *
- * (c) 1999--2000 Martin Mares <m...@suse.cz>
+ * (c) 1999--2000 Martin Mares <m...@ucw.cz>

X */
X
X #include <stdio.h>
diff -u --recursive --new-file v2.4.13/linux/fs/Config.in linux/fs/Config.in
--- v2.4.13/linux/fs/Config.in Tue Oct 9 17:06:53 2001
+++ linux/fs/Config.in Mon Nov 5 13:40:59 2001
@@ -41,6 +41,7 @@
X
X tristate 'ISO 9660 CDROM file system support' CONFIG_ISO9660_FS
X dep_mbool ' Microsoft Joliet CDROM extensions' CONFIG_JOLIET $CONFIG_ISO9660_FS
+dep_mbool ' Transparent decompression extension' CONFIG_ZISOFS $CONFIG_ISO9660_FS
X
X tristate 'Minix fs support' CONFIG_MINIX_FS
X
@@ -126,6 +127,24 @@
X # for fs/nls/Config.in
X define_bool CONFIG_NCPFS_NLS n
X define_bool CONFIG_SMB_FS n
+fi
+
+#
+# Do we need the compression support?
+#
+if [ "$CONFIG_ZISOFS" = "y" ]; then
+ define_tristate CONFIG_ZISOFS_FS $CONFIG_ISO9660_FS
+else
+ define_tristate CONFIG_ZISOFS_FS n
+fi
+if [ "$CONFIG_CRAMFS" = "y" -o "$CONFIG_ZISOFS_FS" = "y" ]; then
+ define_tristate CONFIG_ZLIB_FS_INFLATE y
+else
+ if [ "$CONFIG_CRAMFS" = "m" -o "$CONFIG_ZISOFS_FS" = "m" ]; then
+ define_tristate CONFIG_ZLIB_FS_INFLATE m
+ else
+ define_tristate CONFIG_ZLIB_FS_INFLATE n


+ fi
X fi
X

X mainmenu_option next_comment
diff -u --recursive --new-file v2.4.13/linux/fs/Makefile linux/fs/Makefile
--- v2.4.13/linux/fs/Makefile Tue Oct 9 17:06:53 2001
+++ linux/fs/Makefile Mon Nov 5 13:40:59 2001


@@ -27,6 +27,7 @@
X

X # Do not add any filesystems before this line
X subdir-$(CONFIG_EXT2_FS) += ext2
+subdir-$(CONFIG_ZLIB_FS_INFLATE) += inflate_fs
X subdir-$(CONFIG_CRAMFS) += cramfs
X subdir-$(CONFIG_RAMFS) += ramfs
X subdir-$(CONFIG_CODA_FS) += coda
diff -u --recursive --new-file v2.4.13/linux/fs/adfs/map.c linux/fs/adfs/map.c
--- v2.4.13/linux/fs/adfs/map.c Mon Sep 18 15:14:06 2000
+++ linux/fs/adfs/map.c Thu Oct 25 13:53:53 2001
@@ -20,6 +20,18 @@
X */
X static rwlock_t adfs_map_lock;
X
+#define GET_FRAG_ID(_map,_start,_idmask) \
+ ({ \
+ unsigned long _v2, _frag; \
+ unsigned int _tmp; \
+ _tmp = _start >> 5; \
+ _frag = le32_to_cpu(_map[_tmp]); \
+ _v2 = le32_to_cpu(_map[_tmp + 1]); \
+ _tmp = start & 31; \
+ _frag = (_frag >> _tmp) | (_v2 << (32 - _tmp)); \
+ _frag & _idmask; \
+ })
+
X /*
X * return the map bit offset of the fragment frag_id in
X * the zone dm.
@@ -40,25 +52,7 @@
X do {
X unsigned long frag;
X
- /*
- * get fragment id
- */
- {
- unsigned long v2;
- unsigned int tmp;
-
- tmp = start >> 5;
-
- frag = le32_to_cpu(map[tmp]);
- v2 = le32_to_cpu(map[tmp + 1]);
-
- tmp = start & 31;
-
- frag = (frag >> tmp) | (v2 << (32 - tmp));
-
- frag &= idmask;
- }
-
+ frag = GET_FRAG_ID(map, start, idmask);
X mapptr = start + idlen;
X
X /*
@@ -117,21 +111,7 @@
X /*
X * get fragment id
X */
- {
- unsigned long v2;
- unsigned int tmp;
-
- tmp = start >> 5;
-
- frag = le32_to_cpu(map[tmp]);
- v2 = le32_to_cpu(map[tmp + 1]);
-
- tmp = start & 31;
-
- frag = (frag >> tmp) | (v2 << (32 - tmp));
-
- frag &= idmask;
- }
+ frag = GET_FRAG_ID(map, start, idmask);
X
X /*
X * If the freelink is null, then no free fragments
@@ -146,22 +126,7 @@
X /*
X * get fragment id
X */
- {
- unsigned long v2;
- unsigned int tmp;
-
- tmp = start >> 5;
-
- frag = le32_to_cpu(map[tmp]);
- v2 = le32_to_cpu(map[tmp + 1]);
-
- tmp = start & 31;
-
- frag = (frag >> tmp) | (v2 << (32 - tmp));
-
- frag &= idmask;
- }
-
+ frag = GET_FRAG_ID(map, start, idmask);
X mapptr = start + idlen;
X
X /*
diff -u --recursive --new-file v2.4.13/linux/fs/adfs/super.c linux/fs/adfs/super.c
--- v2.4.13/linux/fs/adfs/super.c Tue Apr 17 23:16:38 2001
+++ linux/fs/adfs/super.c Thu Oct 25 13:53:53 2001
@@ -39,7 +39,7 @@
X va_end(args);
X
X printk(KERN_CRIT "ADFS-fs error (device %s)%s%s: %s\n",
- kdevname(sb->s_dev), function ? ": " : "",
+ bdevname(sb->s_dev), function ? ": " : "",
X function ? function : "", error_buf);
X }
X
@@ -330,7 +330,7 @@
X if (adfs_checkbblk(b_data)) {
X if (!silent)
X printk("VFS: Can't find an adfs filesystem on dev "
- "%s.\n", kdevname(dev));
+ "%s.\n", bdevname(dev));
X goto error_free_bh;
X }
X
@@ -342,7 +342,7 @@
X if (adfs_checkdiscrecord(dr)) {
X if (!silent)
X printk("VPS: Can't find an adfs filesystem on dev "
- "%s.\n", kdevname(dev));
+ "%s.\n", bdevname(dev));
X goto error_free_bh;
X }
X
@@ -370,7 +370,7 @@
X if (sb->s_blocksize != bh->b_size) {
X if (!silent)
X printk(KERN_ERR "VFS: Unsupported blocksize on dev "
- "%s.\n", kdevname(dev));
+ "%s.\n", bdevname(dev));
X goto error_free_bh;
X }
X
diff -u --recursive --new-file v2.4.13/linux/fs/binfmt_aout.c linux/fs/binfmt_aout.c
--- v2.4.13/linux/fs/binfmt_aout.c Tue Oct 9 17:06:53 2001
+++ linux/fs/binfmt_aout.c Fri Nov 2 17:39:20 2001
@@ -285,13 +285,15 @@
X return retval;
X
X /* OK, This is the point of no return */
-#if !defined(__sparc__)
- set_personality(PER_LINUX);
-#else
+#if defined(__alpha__)
+ SET_AOUT_PERSONALITY(bprm, ex);
+#elif defined(__sparc__)
X set_personality(PER_SUNOS);
X #if !defined(__sparc_v9__)
X memcpy(&current->thread.core_exec, &ex, sizeof(struct exec));
X #endif
+#else
+ set_personality(PER_LINUX);
X #endif
X
X current->mm->end_code = ex.a_text +
diff -u --recursive --new-file v2.4.13/linux/fs/block_dev.c linux/fs/block_dev.c
--- v2.4.13/linux/fs/block_dev.c Tue Oct 23 22:48:53 2001
+++ linux/fs/block_dev.c Thu Oct 25 13:58:35 2001
@@ -537,14 +537,20 @@
X bdev->bd_op = get_blkfops(MAJOR(dev));
X if (bdev->bd_op) {
X ret = 0;
+ if (bdev->bd_op->owner)
+ __MOD_INC_USE_COUNT(bdev->bd_op->owner);
X if (bdev->bd_op->open)
X ret = bdev->bd_op->open(inode, file);
X if (!ret) {
X bdev->bd_openers++;
X bdev->bd_inode->i_size = blkdev_size(dev);
X bdev->bd_inode->i_blkbits = blksize_bits(block_size(dev));
- } else if (!bdev->bd_openers)
- bdev->bd_op = NULL;
+ } else {
+ if (bdev->bd_op->owner)
+ __MOD_DEC_USE_COUNT(bdev->bd_op->owner);
+ if (!bdev->bd_openers)
+ bdev->bd_op = NULL;
+ }
X }
X unlock_kernel();
X up(&bdev->bd_sem);
@@ -605,6 +611,8 @@
X kill_bdev(bdev);
X if (bdev->bd_op->release)
X ret = bdev->bd_op->release(bd_inode, NULL);
+ if (bdev->bd_op->owner)
+ __MOD_DEC_USE_COUNT(bdev->bd_op->owner);
X if (!bdev->bd_openers)
X bdev->bd_op = NULL;
X unlock_kernel();
diff -u --recursive --new-file v2.4.13/linux/fs/buffer.c linux/fs/buffer.c
--- v2.4.13/linux/fs/buffer.c Tue Oct 23 22:48:53 2001
+++ linux/fs/buffer.c Mon Oct 29 12:11:17 2001
@@ -705,8 +705,12 @@
X
X static void free_more_memory(void)
X {
+ zone_t * zone = contig_page_data.node_zonelists[GFP_NOFS & GFP_ZONEMASK].zones[0];
+
X balance_dirty();
X wakeup_bdflush();
+ try_to_free_pages(zone, GFP_NOFS, 0);
+ run_task_queue(&tq_disk);
X current->policy |= SCHED_YIELD;
X __set_current_state(TASK_RUNNING);
X schedule();
@@ -765,12 +769,6 @@
X */
X if (!PageError(page))
X SetPageUptodate(page);
-
- /*
- * Run the hooks that have to be done when a page I/O has completed.
- */
- if (PageTestandClearDecrAfter(page))
- atomic_dec(&nr_async_pages);
X
X UnlockPage(page);
X
diff -u --recursive --new-file v2.4.13/linux/fs/char_dev.c linux/fs/char_dev.c
--- v2.4.13/linux/fs/char_dev.c Tue May 22 09:35:42 2001
+++ linux/fs/char_dev.c Fri Nov 2 11:48:21 2001
@@ -104,8 +104,7 @@
X
X void cdput(struct char_device *cdev)
X {
- if (atomic_dec_and_test(&cdev->count)) {
- spin_lock(&cdev_lock);
+ if (atomic_dec_and_lock(&cdev->count, &cdev_lock)) {
X list_del(&cdev->hash);
X spin_unlock(&cdev_lock);
X destroy_cdev(cdev);
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/Makefile linux/fs/cramfs/Makefile
--- v2.4.13/linux/fs/cramfs/Makefile Fri Dec 29 14:07:23 2000
+++ linux/fs/cramfs/Makefile Thu Oct 25 13:53:53 2001
@@ -4,11 +4,10 @@
X
X O_TARGET := cramfs.o
X
-obj-y := inode.o uncompress.o inflate/zlib.o
+obj-y := inode.o uncompress.o
X
X obj-m := $(O_TARGET)
X
-include $(TOPDIR)/Rules.make
+CFLAGS_uncompress.o := -I $(TOPDIR)/fs/inflate_fs
X
-inflate/zlib.o:
- make -C inflate
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/Makefile linux/fs/cramfs/inflate/Makefile
--- v2.4.13/linux/fs/cramfs/inflate/Makefile Fri Dec 29 14:07:23 2000
+++ linux/fs/cramfs/inflate/Makefile Wed Dec 31 16:00:00 1969
@@ -1,34 +0,0 @@
-#
-# inflate/Makefile
-#
-#
-# NOTE NOTE NOTE!
-#
-# This code is basically a bastardized version of the zlib
-# library uncompression. It avoids dynamic allocations at
-# all cost, and is cut down in other ways too, to make it
-# simpler and more specialized. If you want to get the real
-# thing, don't look here.
-#
-# The simplifications mean that this version of the library
-# (unlike the real lib) is completely single-threaded, and
-# you cannot do multiple uncompressions at a time. You can
-# ONLY use it to uncompress a single block, with both the
-# source and the destination completely in memory. In SMP
-# environments, the uncompression has to be protected by
-# some lock to guarantee single-threaded access to the static
-# data structures used for inflation.
-#
-# You have been warned.
-#
-# (The upsides of the simplification is that you can't get in
-# any nasty situations wrt memory management, and that the
-# uncompression can be done without blocking on allocation).
-#
-
-O_TARGET := zlib.o
-
-obj-y := adler32.o infblock.o infcodes.o inffast.o inflate.o \
- inftrees.o infutil.o uncompr.o
-
-include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/adler32.c linux/fs/cramfs/inflate/adler32.c
--- v2.4.13/linux/fs/cramfs/inflate/adler32.c Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/adler32.c Wed Dec 31 16:00:00 1969
@@ -1,48 +0,0 @@
-/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#include "zlib.h"
-
-#define BASE 65521L /* largest prime smaller than 65536 */
-#define NMAX 5552
-/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
-
-#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
-#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
-#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
-#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
-#define DO16(buf) DO8(buf,0); DO8(buf,8);
-
-/* ========================================================================= */
-uLong ZEXPORT cramfs_adler32(adler, buf, len)
- uLong adler;
- const Bytef *buf;
- uInt len;
-{
- unsigned long s1 = adler & 0xffff;
- unsigned long s2 = (adler >> 16) & 0xffff;
- int k;
-
- if (buf == Z_NULL) return 1L;
-
- while (len > 0) {
- k = len < NMAX ? len : NMAX;
- len -= k;
- while (k >= 16) {
- DO16(buf);
- buf += 16;
- k -= 16;
- }
- if (k != 0) do {
- s1 += *buf++;
- s2 += s1;
- } while (--k);
- s1 %= BASE;
- s2 %= BASE;
- }
- return (s2 << 16) | s1;
-}
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/infblock.c linux/fs/cramfs/inflate/infblock.c
--- v2.4.13/linux/fs/cramfs/inflate/infblock.c Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/infblock.c Wed Dec 31 16:00:00 1969
@@ -1,360 +0,0 @@
-/* infblock.c -- interpret and process block types to last block
- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "infblock.h"
-#include "inftrees.h"
-#include "infcodes.h"
-#include "infutil.h"
-
-struct inflate_codes_state {int dummy;}; /* for buggy compilers */
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-/* Table for deflate from PKZIP's appnote.txt. */
-local const uInt border[] = { /* Order of the bit length code lengths */
- 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
-
-/*
- Notes beyond the 1.93a appnote.txt:
-
- 1. Distance pointers never point before the beginning of the output
- stream.
- 2. Distance pointers can point back across blocks, up to 32k away.
- 3. There is an implied maximum of 7 bits for the bit length table and
- 15 bits for the actual data.
- 4. If only one code exists, then it is encoded using one bit. (Zero
- would be more efficient, but perhaps a little confusing.) If two
- codes exist, they are coded using one bit each (0 and 1).
- 5. There is no way of sending zero distance codes--a dummy must be
- sent if there are none. (History: a pre 2.0 version of PKZIP would
- store blocks with no distance codes, but this was discovered to be
- too harsh a criterion.) Valid only for 1.93a. 2.04c does allow
- zero distance codes, which is sent as one code of zero bits in
- length.
- 6. There are up to 286 literal/length codes. Code 256 represents the
- end-of-block. Note however that the static length tree defines
- 288 codes just to fill out the Huffman codes. Codes 286 and 287
- cannot be used though, since there is no length base or extra bits
- defined for them. Similarily, there are up to 30 distance codes.
- However, static trees define 32 codes (all 5 bits) to fill out the
- Huffman codes, but the last two had better not show up in the data.
- 7. Unzip can check dynamic Huffman blocks for complete code sets.
- The exception is that a single code would not be complete (see #4).
- 8. The five bits following the block type is really the number of
- literal codes sent minus 257.
- 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
- (1+6+6). Therefore, to output three times the length, you output
- three codes (1+1+1), whereas to output four times the same length,
- you only need two codes (1+3). Hmm.
- 10. In the tree reconstruction algorithm, Code = Code + Increment
- only if BitLength(i) is not zero. (Pretty obvious.)
- 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
- 12. Note: length code 284 can represent 227-258, but length code 285
- really is 258. The last length deserves its own, short code
- since it gets used a lot in very redundant files. The length
- 258 is special since 258 - 3 (the min match length) is 255.
- 13. The literal/length and distance code bit lengths are read as a
- single stream of lengths. It is possible (and advantageous) for
- a repeat code (16, 17, or 18) to go across the boundary between
- the two sets of lengths.
- */
-
-
-void cramfs_inflate_blocks_reset(s, z, c)
-inflate_blocks_statef *s;
-z_streamp z;
-uLongf *c;
-{
- if (c != Z_NULL)
- *c = s->check;
- if (s->mode == CODES)
- cramfs_inflate_codes_free(s->sub.decode.codes, z);
- s->mode = TYPE;
- s->bitk = 0;
- s->bitb = 0;
- s->read = s->write = s->window;
- if (s->checkfn != Z_NULL)
- z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
-}
-
-
-inflate_blocks_statef *cramfs_inflate_blocks_new(z, c, w)
-z_streamp z;
-check_func c;
-uInt w;
-{
- inflate_blocks_statef *s;
- static struct inflate_blocks_state working_blocks_state;
- static inflate_huft working_hufts[MANY];
- static unsigned char working_window[1 << MAX_WBITS];
-
- s = &working_blocks_state;
- s->hufts = working_hufts;
- s->window = working_window;
- s->end = s->window + w;
- s->checkfn = c;
- s->mode = TYPE;
- cramfs_inflate_blocks_reset(s, z, Z_NULL);
- return s;
-}
-
-
-int cramfs_inflate_blocks(s, z, r)
-inflate_blocks_statef *s;
-z_streamp z;
-int r;
-{
- uInt t; /* temporary storage */
- uLong b; /* bit buffer */
- uInt k; /* bits in bit buffer */
- Bytef *p; /* input data pointer */
- uInt n; /* bytes available there */
- Bytef *q; /* output window write pointer */
- uInt m; /* bytes to end of window or read pointer */
-
- /* copy input/output information to locals (UPDATE macro restores) */
- LOAD
-
- /* process input based on current state */
- while (1) switch (s->mode)
- {
- case TYPE:
- NEEDBITS(3)
- t = (uInt)b & 7;
- s->last = t & 1;
- switch (t >> 1)
- {
- case 0: /* stored */
- DUMPBITS(3)
- t = k & 7; /* go to byte boundary */
- DUMPBITS(t)
- s->mode = LENS; /* get length of stored block */
- break;
- case 1: /* fixed */
- {
- uInt bl, bd;
- inflate_huft *tl, *td;
-
- cramfs_inflate_trees_fixed(&bl, &bd, &tl, &td, z);
- s->sub.decode.codes = cramfs_inflate_codes_new(bl, bd, tl, td, z);
- if (s->sub.decode.codes == Z_NULL)
- {
- r = Z_MEM_ERROR;
- LEAVE
- }
- }
- DUMPBITS(3)
- s->mode = CODES;
- break;
- case 2: /* dynamic */
- DUMPBITS(3)
- s->mode = TABLE;
- break;
- case 3: /* illegal */
- DUMPBITS(3)
- s->mode = BAD;
- z->msg = (char*)"invalid block type";
- r = Z_DATA_ERROR;
- LEAVE
- }
- break;
- case LENS:
- NEEDBITS(32)
- if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
- {
- s->mode = BAD;
- z->msg = (char*)"invalid stored block lengths";
- r = Z_DATA_ERROR;
- LEAVE
- }
- s->sub.left = (uInt)b & 0xffff;
- b = k = 0; /* dump bits */
- s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);
- break;
- case STORED:
- if (n == 0)
- LEAVE
- NEEDOUT
- t = s->sub.left;
- if (t > n) t = n;
- if (t > m) t = m;
- memcpy(q, p, t);
- p += t; n -= t;
- q += t; m -= t;
- if ((s->sub.left -= t) != 0)
- break;
- s->mode = s->last ? DRY : TYPE;
- break;
- case TABLE:
- NEEDBITS(14)
- s->sub.trees.table = t = (uInt)b & 0x3fff;
-#ifndef PKZIP_BUG_WORKAROUND
- if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
- {
- s->mode = BAD;
- z->msg = (char*)"too many length or distance symbols";
- r = Z_DATA_ERROR;
- LEAVE
- }
-#endif
- {
- static unsigned int working_blens [258 + 0x1f + 0x1f];
- s->sub.trees.blens = working_blens;
- }
- DUMPBITS(14)
- s->sub.trees.index = 0;
- s->mode = BTREE;
- case BTREE:
- while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
- {
- NEEDBITS(3)
- s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
- DUMPBITS(3)
- }
- while (s->sub.trees.index < 19)
- s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
- s->sub.trees.bb = 7;
- t = cramfs_inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
- &s->sub.trees.tb, s->hufts, z);
- if (t != Z_OK)
- {
- r = t;
- if (r == Z_DATA_ERROR)
- s->mode = BAD;
- LEAVE
- }
- s->sub.trees.index = 0;
- s->mode = DTREE;
- case DTREE:
- while (t = s->sub.trees.table,
- s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
- {
- inflate_huft *h;
- uInt i, j, c;
-
- t = s->sub.trees.bb;
- NEEDBITS(t)
- h = s->sub.trees.tb + ((uInt)b & cramfs_inflate_mask[t]);
- t = h->bits;
- c = h->base;
- if (c < 16)
- {
- DUMPBITS(t)
- s->sub.trees.blens[s->sub.trees.index++] = c;
- }
- else /* c == 16..18 */
- {
- i = c == 18 ? 7 : c - 14;
- j = c == 18 ? 11 : 3;
- NEEDBITS(t + i)
- DUMPBITS(t)
- j += (uInt)b & cramfs_inflate_mask[i];
- DUMPBITS(i)
- i = s->sub.trees.index;
- t = s->sub.trees.table;
- if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
- (c == 16 && i < 1))
- {
- s->mode = BAD;
- z->msg = (char*)"invalid bit length repeat";
- r = Z_DATA_ERROR;
- LEAVE
- }
- c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
- do {
- s->sub.trees.blens[i++] = c;
- } while (--j);
- s->sub.trees.index = i;
- }
- }
- s->sub.trees.tb = Z_NULL;
- {
- uInt bl, bd;
- inflate_huft *tl, *td;
- inflate_codes_statef *c;
-
- bl = 9; /* must be <= 9 for lookahead assumptions */
- bd = 6; /* must be <= 9 for lookahead assumptions */
- t = s->sub.trees.table;
- t = cramfs_inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
- s->sub.trees.blens, &bl, &bd, &tl, &td,
- s->hufts, z);
- if (t != Z_OK)
- {
- if (t == (uInt)Z_DATA_ERROR)
- s->mode = BAD;
- r = t;
- LEAVE
- }
- if ((c = cramfs_inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
- {
- r = Z_MEM_ERROR;
- LEAVE
- }
- s->sub.decode.codes = c;
- }
- s->mode = CODES;
- case CODES:
- UPDATE
- if ((r = cramfs_inflate_codes(s, z, r)) != Z_STREAM_END)
- return cramfs_inflate_flush(s, z, r);
- r = Z_OK;
- cramfs_inflate_codes_free(s->sub.decode.codes, z);
- LOAD
- if (!s->last)
- {
- s->mode = TYPE;
- break;
- }
- s->mode = DRY;
- case DRY:
- FLUSH
- if (s->read != s->write)
- LEAVE
- s->mode = DONE;
- case DONE:
- r = Z_STREAM_END;
- LEAVE
- case BAD:
- r = Z_DATA_ERROR;
- LEAVE
- default:
- r = Z_STREAM_ERROR;
- LEAVE
- }
-}
-
-
-int cramfs_inflate_blocks_free(s, z)
-inflate_blocks_statef *s;
-z_streamp z;
-{
- cramfs_inflate_blocks_reset(s, z, Z_NULL);
- return Z_OK;
-}
-
-
-void cramfs_inflate_set_dictionary(s, d, n)
-inflate_blocks_statef *s;
-const Bytef *d;
-uInt n;
-{
- memcpy(s->window, d, n);
- s->read = s->write = s->window + n;
-}
-
-
-/* Returns true if inflate is currently at the end of a block generated
- * by Z_SYNC_FLUSH or Z_FULL_FLUSH.
- * IN assertion: s != Z_NULL
- */
-int inflate_blocks_sync_point(s)
-inflate_blocks_statef *s;
-{
- return s->mode == LENS;
-}
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/infblock.h linux/fs/cramfs/inflate/infblock.h
--- v2.4.13/linux/fs/cramfs/inflate/infblock.h Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/infblock.h Wed Dec 31 16:00:00 1969
@@ -1,39 +0,0 @@
-/* infblock.h -- header to use infblock.c
- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-struct inflate_blocks_state;
-typedef struct inflate_blocks_state FAR inflate_blocks_statef;
-
-extern inflate_blocks_statef * cramfs_inflate_blocks_new OF((
- z_streamp z,
- check_func c, /* check function */
- uInt w)); /* window size */
-
-extern int cramfs_inflate_blocks OF((
- inflate_blocks_statef *,
- z_streamp ,
- int)); /* initial return code */
-
-extern void cramfs_inflate_blocks_reset OF((
- inflate_blocks_statef *,
- z_streamp ,
- uLongf *)); /* check value on output */
-
-extern int cramfs_inflate_blocks_free OF((
- inflate_blocks_statef *,
- z_streamp));
-
-extern void cramfs_inflate_set_dictionary OF((
- inflate_blocks_statef *s,
- const Bytef *d, /* dictionary */
- uInt n)); /* dictionary length */
-
-extern int inflate_blocks_sync_point OF((
- inflate_blocks_statef *s));
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/infcodes.c linux/fs/cramfs/inflate/infcodes.c
--- v2.4.13/linux/fs/cramfs/inflate/infcodes.c Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/infcodes.c Wed Dec 31 16:00:00 1969
@@ -1,247 +0,0 @@
-/* infcodes.c -- process literals and length/distance pairs
- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "infblock.h"
-#include "infcodes.h"
-#include "infutil.h"
-#include "inffast.h"
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
- START, /* x: set up for LEN */
- LEN, /* i: get length/literal/eob next */
- LENEXT, /* i: getting length extra (have base) */
- DIST, /* i: get distance next */
- DISTEXT, /* i: getting distance extra */
- COPY, /* o: copying bytes in window, waiting for space */
- LIT, /* o: got literal, waiting for output space */
- WASH, /* o: got eob, possibly still output waiting */
- END, /* x: got eob and all data flushed */
- BADCODE} /* x: got error */
-inflate_codes_mode;
-
-/* inflate codes private state */
-struct inflate_codes_state {
-
- /* mode */
- inflate_codes_mode mode; /* current inflate_codes mode */
-
- /* mode dependent information */
- uInt len;
- union {
- struct {
- inflate_huft *tree; /* pointer into tree */
- uInt need; /* bits needed */
- } code; /* if LEN or DIST, where in tree */
- uInt lit; /* if LIT, literal */
- struct {
- uInt get; /* bits to get for extra */
- uInt dist; /* distance back to copy from */
- } copy; /* if EXT or COPY, where and how much */
- } sub; /* submode */
-
- /* mode independent information */
- Byte lbits; /* ltree bits decoded per branch */
- Byte dbits; /* dtree bits decoder per branch */
- inflate_huft *ltree; /* literal/length/eob tree */
- inflate_huft *dtree; /* distance tree */
-
-};
-
-
-inflate_codes_statef *cramfs_inflate_codes_new(bl, bd, tl, td, z)
-uInt bl, bd;
-inflate_huft *tl;
-inflate_huft *td; /* need separate declaration for Borland C++ */
-z_streamp z;
-{
- inflate_codes_statef *c;
- static inflate_codes_statef memory_allocation;
-
- c = &memory_allocation;
- {
- c->mode = START;
- c->lbits = (Byte)bl;
- c->dbits = (Byte)bd;
- c->ltree = tl;
- c->dtree = td;
- }
- return c;
-}
-
-
-int cramfs_inflate_codes(s, z, r)
-inflate_blocks_statef *s;
-z_streamp z;
-int r;
-{
- uInt j; /* temporary storage */
- inflate_huft *t; /* temporary pointer */
- uInt e; /* extra bits or operation */
- uLong b; /* bit buffer */
- uInt k; /* bits in bit buffer */
- Bytef *p; /* input data pointer */
- uInt n; /* bytes available there */
- Bytef *q; /* output window write pointer */
- uInt m; /* bytes to end of window or read pointer */
- Bytef *f; /* pointer to copy strings from */
- inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
-
- /* copy input/output information to locals (UPDATE macro restores) */
- LOAD
-
- /* process input and output based on current state */
- while (1) switch (c->mode)
- { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
- case START: /* x: set up for LEN */
-#ifndef SLOW
- if (m >= 258 && n >= 10)
- {
- UPDATE
- r = cramfs_inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
- LOAD
- if (r != Z_OK)
- {
- c->mode = r == Z_STREAM_END ? WASH : BADCODE;
- break;
- }
- }
-#endif /* !SLOW */
- c->sub.code.need = c->lbits;
- c->sub.code.tree = c->ltree;
- c->mode = LEN;
- case LEN: /* i: get length/literal/eob next */
- j = c->sub.code.need;
- NEEDBITS(j)
- t = c->sub.code.tree + ((uInt)b & cramfs_inflate_mask[j]);
- DUMPBITS(t->bits)
- e = (uInt)(t->exop);
- if (e == 0) /* literal */
- {
- c->sub.lit = t->base;
- c->mode = LIT;
- break;
- }
- if (e & 16) /* length */
- {
- c->sub.copy.get = e & 15;
- c->len = t->base;
- c->mode = LENEXT;
- break;
- }
- if ((e & 64) == 0) /* next table */
- {
- c->sub.code.need = e;
- c->sub.code.tree = t + t->base;
- break;
- }
- if (e & 32) /* end of block */
- {
- c->mode = WASH;
- break;
- }
- c->mode = BADCODE; /* invalid code */
- z->msg = (char*)"invalid literal/length code";
- r = Z_DATA_ERROR;
- LEAVE
- case LENEXT: /* i: getting length extra (have base) */
- j = c->sub.copy.get;
- NEEDBITS(j)
- c->len += (uInt)b & cramfs_inflate_mask[j];
- DUMPBITS(j)
- c->sub.code.need = c->dbits;
- c->sub.code.tree = c->dtree;
- c->mode = DIST;
- case DIST: /* i: get distance next */
- j = c->sub.code.need;
- NEEDBITS(j)
- t = c->sub.code.tree + ((uInt)b & cramfs_inflate_mask[j]);
- DUMPBITS(t->bits)
- e = (uInt)(t->exop);
- if (e & 16) /* distance */
- {
- c->sub.copy.get = e & 15;
- c->sub.copy.dist = t->base;
- c->mode = DISTEXT;
- break;
- }
- if ((e & 64) == 0) /* next table */
- {
- c->sub.code.need = e;
- c->sub.code.tree = t + t->base;
- break;
- }
- c->mode = BADCODE; /* invalid code */
- z->msg = (char*)"invalid distance code";
- r = Z_DATA_ERROR;
- LEAVE
- case DISTEXT: /* i: getting distance extra */
- j = c->sub.copy.get;
- NEEDBITS(j)
- c->sub.copy.dist += (uInt)b & cramfs_inflate_mask[j];
- DUMPBITS(j)
- c->mode = COPY;
- case COPY: /* o: copying bytes in window, waiting for space */
-#ifndef __TURBOC__ /* Turbo C bug for following expression */
- f = (uInt)(q - s->window) < c->sub.copy.dist ?
- s->end - (c->sub.copy.dist - (q - s->window)) :
- q - c->sub.copy.dist;
-#else
- f = q - c->sub.copy.dist;
- if ((uInt)(q - s->window) < c->sub.copy.dist)
- f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));
-#endif
- while (c->len)
- {
- NEEDOUT
- OUTBYTE(*f++)
- if (f == s->end)
- f = s->window;
- c->len--;
- }
- c->mode = START;
- break;
- case LIT: /* o: got literal, waiting for output space */
- NEEDOUT
- OUTBYTE(c->sub.lit)
- c->mode = START;
- break;
- case WASH: /* o: got eob, possibly more output */
- if (k > 7) /* return unused byte, if any */
- {
- k -= 8;
- n++;
- p--; /* can always return one */
- }
- FLUSH
- if (s->read != s->write)
- LEAVE
- c->mode = END;
- case END:
- r = Z_STREAM_END;
- LEAVE
- case BADCODE: /* x: got error */
- r = Z_DATA_ERROR;
- LEAVE
- default:
- r = Z_STREAM_ERROR;
- LEAVE
- }
-#ifdef NEED_DUMMY_RETURN
- return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
-#endif
-}
-
-
-void cramfs_inflate_codes_free(c, z)
-inflate_codes_statef *c;
-z_streamp z;
-{
-}
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/infcodes.h linux/fs/cramfs/inflate/infcodes.h
--- v2.4.13/linux/fs/cramfs/inflate/infcodes.h Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/infcodes.h Wed Dec 31 16:00:00 1969
@@ -1,27 +0,0 @@
-/* infcodes.h -- header to use infcodes.c
- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-struct inflate_codes_state;
-typedef struct inflate_codes_state FAR inflate_codes_statef;
-
-extern inflate_codes_statef *cramfs_inflate_codes_new OF((
- uInt, uInt,
- inflate_huft *, inflate_huft *,
- z_streamp ));
-
-extern int cramfs_inflate_codes OF((
- inflate_blocks_statef *,
- z_streamp ,
- int));
-
-extern void cramfs_inflate_codes_free OF((
- inflate_codes_statef *,
- z_streamp ));
-
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/inffast.c linux/fs/cramfs/inflate/inffast.c
--- v2.4.13/linux/fs/cramfs/inflate/inffast.c Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/inffast.c Wed Dec 31 16:00:00 1969
@@ -1,161 +0,0 @@
-/* inffast.c -- process literals and length/distance pairs fast
- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "infblock.h"
-#include "infcodes.h"
-#include "infutil.h"
-#include "inffast.h"
-
-struct inflate_codes_state {int dummy;}; /* for buggy compilers */
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-/* macros for bit input with no checking and for returning unused bytes */
-#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
-#define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;}
-
-/* Called with number of bytes left to write in window at least 258
- (the maximum string length) and number of input bytes available
- at least ten. The ten bytes are six bytes for the longest length/
- distance pair plus four bytes for overloading the bit buffer. */
-
-int cramfs_inflate_fast(bl, bd, tl, td, s, z)
-uInt bl, bd;
-inflate_huft *tl;
-inflate_huft *td; /* need separate declaration for Borland C++ */
-inflate_blocks_statef *s;
-z_streamp z;
-{
- inflate_huft *t; /* temporary pointer */
- uInt e; /* extra bits or operation */
- uLong b; /* bit buffer */
- uInt k; /* bits in bit buffer */
- Bytef *p; /* input data pointer */
- uInt n; /* bytes available there */
- Bytef *q; /* output window write pointer */
- uInt m; /* bytes to end of window or read pointer */
- uInt ml; /* mask for literal/length tree */
- uInt md; /* mask for distance tree */
- uInt c; /* bytes to copy */
- uInt d; /* distance back to copy from */
- Bytef *r; /* copy source pointer */
-
- /* load input, output, bit values */
- LOAD
-
- /* initialize masks */
- ml = cramfs_inflate_mask[bl];
- md = cramfs_inflate_mask[bd];
-
- /* do until not enough input or output space for fast loop */
- do { /* assume called with m >= 258 && n >= 10 */
- /* get literal/length code */
- GRABBITS(20) /* max bits for literal/length code */
- if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)
- {
- DUMPBITS(t->bits)
- *q++ = (Byte)t->base;
- m--;
- continue;
- }
- do {
- DUMPBITS(t->bits)
- if (e & 16)
- {
- /* get extra bits for length */
- e &= 15;
- c = t->base + ((uInt)b & cramfs_inflate_mask[e]);
- DUMPBITS(e)
-
- /* decode distance base of block to copy */
- GRABBITS(15); /* max bits for distance code */
- e = (t = td + ((uInt)b & md))->exop;
- do {
- DUMPBITS(t->bits)
- if (e & 16)
- {
- /* get extra bits to add to distance base */
- e &= 15;
- GRABBITS(e) /* get extra bits (up to 13) */
- d = t->base + ((uInt)b & cramfs_inflate_mask[e]);
- DUMPBITS(e)
-
- /* do the copy */
- m -= c;
- if ((uInt)(q - s->window) >= d) /* offset before dest */
- { /* just copy */
- r = q - d;
- *q++ = *r++; c--; /* minimum count is three, */
- *q++ = *r++; c--; /* so unroll loop a little */
- }
- else /* else offset after destination */
- {
- e = d - (uInt)(q - s->window); /* bytes from offset to end */
- r = s->end - e; /* pointer to offset */
- if (c > e) /* if source crosses, */
- {
- c -= e; /* copy to end of window */
- do {
- *q++ = *r++;
- } while (--e);
- r = s->window; /* copy rest from start of window */
- }
- }
- do { /* copy all or what's left */
- *q++ = *r++;
- } while (--c);
- break;
- }
- else if ((e & 64) == 0)
- {
- t += t->base;
- e = (t += ((uInt)b & cramfs_inflate_mask[e]))->exop;
- }
- else
- {
- z->msg = (char*)"invalid distance code";
- UNGRAB
- UPDATE
- return Z_DATA_ERROR;
- }
- } while (1);
- break;
- }
- if ((e & 64) == 0)
- {
- t += t->base;
- if ((e = (t += ((uInt)b & cramfs_inflate_mask[e]))->exop) == 0)
- {
- DUMPBITS(t->bits)
- *q++ = (Byte)t->base;
- m--;
- break;
- }
- }
- else if (e & 32)
- {
- UNGRAB
- UPDATE
- return Z_STREAM_END;
- }
- else
- {
- z->msg = (char*)"invalid literal/length code";
- UNGRAB
- UPDATE
- return Z_DATA_ERROR;
- }
- } while (1);
- } while (m >= 258 && n >= 10);
-
- /* not enough input or output--restore pointers and return */
- UNGRAB
- UPDATE
- return Z_OK;
-}
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/inffast.h linux/fs/cramfs/inflate/inffast.h
--- v2.4.13/linux/fs/cramfs/inflate/inffast.h Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/inffast.h Wed Dec 31 16:00:00 1969
@@ -1,17 +0,0 @@
-/* inffast.h -- header to use inffast.c
- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-extern int cramfs_inflate_fast OF((
- uInt,
- uInt,
- inflate_huft *,
- inflate_huft *,
- inflate_blocks_statef *,
- z_streamp ));
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/inffixed.h linux/fs/cramfs/inflate/inffixed.h
--- v2.4.13/linux/fs/cramfs/inflate/inffixed.h Tue Nov 2 11:29:32 1999
+++ linux/fs/cramfs/inflate/inffixed.h Wed Dec 31 16:00:00 1969
@@ -1,151 +0,0 @@
-/* inffixed.h -- table for decoding fixed codes
- * Generated automatically by the maketree.c program
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-local uInt fixed_bl = 9;
-local uInt fixed_bd = 5;
-local inflate_huft fixed_tl[] = {
- {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
- {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
- {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
- {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},
- {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},
- {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},
- {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},
- {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},
- {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
- {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},
- {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},
- {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},
- {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},
- {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},
- {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},
- {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},
- {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
- {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},
- {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},
- {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},
- {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},
- {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},
- {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},
- {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},
- {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},
- {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},
- {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},
- {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},
- {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},
- {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},
- {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},
- {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
- {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},
- {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},
- {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},
- {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},
- {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},
- {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},
- {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},
- {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
- {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},
- {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},
- {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},
- {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},
- {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},
- {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},
- {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},
- {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
- {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},
- {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},
- {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},
- {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},
- {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},
- {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},
- {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},
- {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},
- {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},
- {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},
- {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},
- {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},
- {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},
- {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},
- {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
- {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},
- {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},
- {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},
- {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},
- {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},
- {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},
- {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},
- {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
- {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},
- {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},
- {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},
- {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},
- {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},
- {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},
- {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},
- {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
- {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},
- {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},
- {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},
- {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},
- {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},
- {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},
- {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},
- {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},
- {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},
- {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},
- {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},
- {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},
- {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},
- {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},
- {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
- {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},
- {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},
- {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},
- {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},
- {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},
- {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},
- {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},
- {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
- {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},
- {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},
- {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},
- {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},
- {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},
- {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},
- {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},
- {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
- {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},
- {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},
- {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},
- {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},
- {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},
- {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},
- {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},
- {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},
- {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},
- {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},
- {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},
- {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},
- {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
- {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
- };
-local inflate_huft fixed_td[] = {
- {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
- {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
- {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
- {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
- {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
- {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
- {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
- {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
- };
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/inflate.c linux/fs/cramfs/inflate/inflate.c
--- v2.4.13/linux/fs/cramfs/inflate/inflate.c Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/inflate.c Wed Dec 31 16:00:00 1969
@@ -1,330 +0,0 @@
-/* inflate.c -- zlib interface to inflate modules
- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "infblock.h"
-
-struct inflate_blocks_state {int dummy;}; /* for buggy compilers */
-
-typedef enum {
- METHOD, /* waiting for method byte */
- FLAG, /* waiting for flag byte */
- DICT4, /* four dictionary check bytes to go */
- DICT3, /* three dictionary check bytes to go */
- DICT2, /* two dictionary check bytes to go */
- DICT1, /* one dictionary check byte to go */
- DICT0, /* waiting for inflateSetDictionary */
- BLOCKS, /* decompressing blocks */
- CHECK4, /* four check bytes to go */
- CHECK3, /* three check bytes to go */
- CHECK2, /* two check bytes to go */
- CHECK1, /* one check byte to go */
- DONE, /* finished check, done */
- BAD} /* got an error--stay here */
-inflate_mode;
-
-/* inflate private state */
-struct internal_state {
-
- /* mode */
- inflate_mode mode; /* current inflate mode */
-
- /* mode dependent information */
- union {
- uInt method; /* if FLAGS, method byte */
- struct {
- uLong was; /* computed check value */
- uLong need; /* stream check value */
- } check; /* if CHECK, check values to compare */
- uInt marker; /* if BAD, inflateSync's marker bytes count */
- } sub; /* submode */
-
- /* mode independent information */
- int nowrap; /* flag for no wrapper */
- uInt wbits; /* log2(window size) (8..15, defaults to 15) */
- inflate_blocks_statef
- *blocks; /* current inflate_blocks state */
-
-};
-
-
-int ZEXPORT cramfs_inflateReset(z)
-z_streamp z;
-{
- if (z == Z_NULL || z->state == Z_NULL)
- return Z_STREAM_ERROR;
- z->total_in = z->total_out = 0;
- z->msg = Z_NULL;
- z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
- cramfs_inflate_blocks_reset(z->state->blocks, z, Z_NULL);
- return Z_OK;
-}
-
-
-int ZEXPORT cramfs_inflateEnd(z)
-z_streamp z;
-{
- if (z == Z_NULL || z->state == Z_NULL)
- return Z_STREAM_ERROR;
- if (z->state->blocks != Z_NULL)
- cramfs_inflate_blocks_free(z->state->blocks, z);
- z->state = Z_NULL;
- return Z_OK;
-}
-
-
-int ZEXPORT cramfs_inflateInit2_(z, w, version, stream_size)
-z_streamp z;
-int w;
-const char *version;
-int stream_size;
-{
- static struct internal_state internal_state;
-
- if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
- stream_size != sizeof(z_stream))
- return Z_VERSION_ERROR;
-
- /* initialize state */
- if (z == Z_NULL)
- return Z_STREAM_ERROR;
- z->msg = Z_NULL;
- z->state = &internal_state;
- z->state->blocks = Z_NULL;
-
- /* handle undocumented nowrap option (no zlib header or check) */
- z->state->nowrap = 0;
- if (w < 0)
- {
- w = - w;
- z->state->nowrap = 1;
- }
-
- /* set window size */
- if (w < 8 || w > 15)
- {
- cramfs_inflateEnd(z);
- return Z_STREAM_ERROR;
- }
- z->state->wbits = (uInt)w;
-
- /* create inflate_blocks state */
- if ((z->state->blocks =
- cramfs_inflate_blocks_new(z, z->state->nowrap ? Z_NULL : cramfs_adler32, (uInt)1 << w))
- == Z_NULL)
- {
- cramfs_inflateEnd(z);
- return Z_MEM_ERROR;
- }
-
- /* reset state */
- cramfs_inflateReset(z);
- return Z_OK;
-}
-
-
-int ZEXPORT cramfs_inflateInit_(z, version, stream_size)
-z_streamp z;
-const char *version;
-int stream_size;
-{
- return cramfs_inflateInit2_(z, DEF_WBITS, version, stream_size);
-}
-
-
-#define NEEDBYTE {if(z->avail_in==0)return r;r=f;}
-#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
-
-int ZEXPORT cramfs_inflate(z, f)
-z_streamp z;
-int f;
-{
- int r;
- uInt b;
-
- if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)
- return Z_STREAM_ERROR;
- f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
- r = Z_BUF_ERROR;
- while (1) switch (z->state->mode)
- {
- case METHOD:
- NEEDBYTE
- if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED)
- {
- z->state->mode = BAD;
- z->msg = (char*)"unknown compression method";
- z->state->sub.marker = 5; /* can't try inflateSync */
- break;
- }
- if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
- {
- z->state->mode = BAD;
- z->msg = (char*)"invalid window size";
- z->state->sub.marker = 5; /* can't try inflateSync */
- break;
- }
- z->state->mode = FLAG;
- case FLAG:
- NEEDBYTE
- b = NEXTBYTE;
- if (((z->state->sub.method << 8) + b) % 31)
- {
- z->state->mode = BAD;
- z->msg = (char*)"incorrect header check";
- z->state->sub.marker = 5; /* can't try inflateSync */
- break;
- }
- if (!(b & PRESET_DICT))
- {
- z->state->mode = BLOCKS;
- break;
- }
- z->state->mode = DICT4;
- case DICT4:
- NEEDBYTE
- z->state->sub.check.need = (uLong)NEXTBYTE << 24;
- z->state->mode = DICT3;
- case DICT3:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE << 16;
- z->state->mode = DICT2;
- case DICT2:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE << 8;
- z->state->mode = DICT1;
- case DICT1:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE;
- z->adler = z->state->sub.check.need;
- z->state->mode = DICT0;
- return Z_NEED_DICT;
- case DICT0:
- z->state->mode = BAD;
- z->msg = (char*)"need dictionary";
- z->state->sub.marker = 0; /* can try inflateSync */
- return Z_STREAM_ERROR;
- case BLOCKS:
- r = cramfs_inflate_blocks(z->state->blocks, z, r);
- if (r == Z_DATA_ERROR)
- {
- z->state->mode = BAD;
- z->state->sub.marker = 0; /* can try inflateSync */
- break;
- }
- if (r == Z_OK)
- r = f;
- if (r != Z_STREAM_END)
- return r;
- r = f;
- cramfs_inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
- if (z->state->nowrap)
- {
- z->state->mode = DONE;
- break;
- }
- z->state->mode = CHECK4;
- case CHECK4:
- NEEDBYTE
- z->state->sub.check.need = (uLong)NEXTBYTE << 24;
- z->state->mode = CHECK3;
- case CHECK3:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE << 16;
- z->state->mode = CHECK2;
- case CHECK2:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE << 8;
- z->state->mode = CHECK1;
- case CHECK1:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE;
-
- if (z->state->sub.check.was != z->state->sub.check.need)
- {
- z->state->mode = BAD;
- z->msg = (char*)"incorrect data check";
- z->state->sub.marker = 5; /* can't try inflateSync */
- break;
- }
- z->state->mode = DONE;
- case DONE:
- return Z_STREAM_END;
- case BAD:
- return Z_DATA_ERROR;
- default:
- return Z_STREAM_ERROR;
- }
-#ifdef NEED_DUMMY_RETURN
- return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
-#endif
-}
-
-
-int ZEXPORT cramfs_inflateSync(z)
-z_streamp z;
-{
- uInt n; /* number of bytes to look at */
- Bytef *p; /* pointer to bytes */
- uInt m; /* number of marker bytes found in a row */
- uLong r, w; /* temporaries to save total_in and total_out */
-
- /* set up */
- if (z == Z_NULL || z->state == Z_NULL)
- return Z_STREAM_ERROR;
- if (z->state->mode != BAD)
- {
- z->state->mode = BAD;
- z->state->sub.marker = 0;
- }
- if ((n = z->avail_in) == 0)
- return Z_BUF_ERROR;
- p = z->next_in;
- m = z->state->sub.marker;
-
- /* search */
- while (n && m < 4)
- {
- static const Byte mark[4] = {0, 0, 0xff, 0xff};
- if (*p == mark[m])
- m++;
- else if (*p)
- m = 0;
- else
- m = 4 - m;
- p++, n--;
- }
-
- /* restore */
- z->total_in += p - z->next_in;
- z->next_in = p;
- z->avail_in = n;
- z->state->sub.marker = m;
-
- /* return no joy or set up to restart on a new block */
- if (m != 4)
- return Z_DATA_ERROR;
- r = z->total_in; w = z->total_out;
- cramfs_inflateReset(z);
- z->total_in = r; z->total_out = w;
- z->state->mode = BLOCKS;
- return Z_OK;
-}
-
-
-/* Returns true if inflate is currently at the end of a block generated
- * by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
- * implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 42'
echo 'File patch-2.4.14 is continued in part 43'
echo "43" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 3:59:58 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part35

#!/bin/sh -x
# this is part 35 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 35; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_linux_pci.c Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_linux_pci.c Thu Oct 25 13:53:49 2001


@@ -1,7 +1,7 @@
X /*

X * Linux driver attachment glue for PCI based controllers.
X *
- * Copyright (c) 2000, 2001 Adaptec Inc.


+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
@@ -10,25 +10,33 @@
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,
X * without modification.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
X *
X * Alternatively, this software may be distributed under the terms of the

- * $Id: //depot/src/linux/drivers/scsi/aic7xxx/aic7xxx_linux_pci.c#23 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_linux_pci.c#27 $
X */
X
X #include "aic7xxx_osm.h"
@@ -41,6 +49,11 @@
X
X static int ahc_linux_pci_dev_probe(struct pci_dev *pdev,
X const struct pci_device_id *ent);
+static int ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc,
+ u_long *base);
+static int ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc,
+ u_long *bus_addr,
+ uint8_t **maddr);
X #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X static void ahc_linux_pci_dev_remove(struct pci_dev *pdev);
X
@@ -56,6 +69,7 @@
X },
X { 0 }
X };
+MODULE_DEVICE_TABLE(pci, ahc_linux_pci_id_table);
X
X struct pci_driver aic7xxx_pci_driver = {
X name: "aic7xxx",
@@ -88,12 +102,28 @@
X static int
X ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
X {
- char buf[80];
- struct ahc_softc *ahc;
- ahc_dev_softc_t pci;
- struct ahc_pci_identity *entry;
- char *name;
- int error;
+ char buf[80];
+ struct ahc_softc *ahc;
+ ahc_dev_softc_t pci;
+ struct ahc_pci_identity *entry;
+ char *name;
+ int error;
+
+ /*
+ * Some BIOSen report the same device multiple times.
+ */
+ TAILQ_FOREACH(ahc, &ahc_tailq, links) {
+ struct pci_dev *probed_pdev;
+
+ probed_pdev = ahc->dev_softc;
+ if (probed_pdev->bus->number == pdev->bus->number
+ && probed_pdev->devfn == pdev->devfn)
+ break;
+ }
+ if (ahc != NULL) {
+ /* Skip duplicate. */
+ return (-ENODEV);
+ }
X
X pci = pdev;
X entry = ahc_find_pci_device(pci);
@@ -129,14 +159,13 @@
X && pci_set_dma_mask(pdev, 0x7FFFFFFFFFULL) == 0) {
X #else
X && ahc_linux_get_memsize() > 0x80000000) {
+
X ahc->dev_softc->dma_mask =
- (bus_addr_t)(0x7FFFFFFFFFULL
- & ((1ULL << (sizeof(bus_addr_t) * 8))-1));
+ (bus_addr_t)(0x7FFFFFFFFFULL & (bus_addr_t)~0);
X #endif
X ahc->flags |= AHC_39BIT_ADDRESSING;
X ahc->platform_data->hw_dma_mask =
- (bus_addr_t)(0x7FFFFFFFFFULL
- & ((1ULL << (sizeof(bus_addr_t) * 8))-1));
+ (bus_addr_t)(0x7FFFFFFFFFULL & (bus_addr_t)~0);
X }
X #endif
X ahc->dev_softc = pci;
@@ -172,28 +201,10 @@
X pdev = NULL;
X class = PCI_CLASS_STORAGE_SCSI << 8;
X while ((pdev = pci_find_class(class, pdev)) != NULL) {
- struct ahc_softc *ahc;
X ahc_dev_softc_t pci;
X int error;
X
X pci = pdev;
-
- /*
- * Some BIOSen report the same device multiple times.
- */
- TAILQ_FOREACH(ahc, &ahc_tailq, links) {
- struct pci_dev *probed_pdev;
-
- probed_pdev = ahc->dev_softc;
- if (probed_pdev->bus->number == pdev->bus->number
- && probed_pdev->devfn == pdev->devfn)
- break;
- }
- if (ahc != NULL) {
- /* Skip duplicate. */
- continue;
- }
-
X error = ahc_linux_pci_dev_probe(pdev, /*pci_devid*/NULL);
X if (error == 0)
X found++;
@@ -202,22 +213,40 @@
X #endif
X }
X
-int
-ahc_pci_map_registers(struct ahc_softc *ahc)
+static int
+ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, u_long *base)
X {
- uint32_t command;
- u_long base;
-#ifdef MMAPIO
- u_long start;
- u_long base_page;
- u_long base_offset;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+ *base = pci_resource_start(ahc->dev_softc, 0);
+#else
+ *base = ahc_pci_read_config(ahc->dev_softc, PCIR_MAPS, 4);
+ *base &= PCI_BASE_ADDRESS_IO_MASK;
X #endif
- uint8_t *maddr;
+ if (base == 0)
+ return (ENOMEM);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
+ if (check_region(*base, 256) != 0)
+ return (ENOMEM);
+ else
+ request_region(*base, 256, "aic7xxx");
+#else
+ if (request_region(*base, 256, "aic7xxx") == 0)
+ return (ENOMEM);
+#endif
+ return (0);
+}
X
- command = ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, 4);
- base = 0;
- maddr = NULL;
-#ifdef MMAPIO
+static int
+ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc,
+ u_long *bus_addr,
+ uint8_t **maddr)
+{
+ u_long start;
+ u_long base_page;
+ u_long base_offset;
+ int error;
+
+ error = 0;
X #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
X start = pci_resource_start(ahc->dev_softc, 1);
X base_page = start & PAGE_MASK;
@@ -229,43 +258,70 @@
X base_offset -= base_page;
X #endif
X if (start != 0) {
- ahc->platform_data->mem_busaddr = start;
+ *bus_addr = start;


X #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)

- if (request_mem_region(start, 0x1000, "aic7xxx") == 0) {
- printf("aic7xxx: PCI%d:%d:%d MEM region 0x%lx "
- "in use. Cannot map device.\n",
+ if (request_mem_region(start, 0x1000, "aic7xxx") == 0)
+ error = ENOMEM;
+#endif
+ if (error == 0) {
+ *maddr = ioremap_nocache(base_page, base_offset + 256);
+ if (*maddr == NULL)
+ error = ENOMEM;
+ else
+ *maddr += base_offset;
+ }
+ } else
+ error = ENOMEM;
+ return (error);
+}
+
+int
+ahc_pci_map_registers(struct ahc_softc *ahc)
+{
+ uint32_t command;
+ u_long base;
+ uint8_t *maddr;
+ int error;
+ int io_error;
+
+ /*
+ * We always reserve both our register spaces to avoid
+ * other devices claiming them.
+ */
+ command = ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, 4);
+ command &= ~(PCIM_CMD_PORTEN|PCIM_CMD_MEMEN);
+ base = 0;
+ maddr = NULL;
+#ifdef MMAPIO
+ error = ahc_linux_pci_reserve_mem_region(ahc, &base, &maddr);
+ if (error == 0) {
+ ahc->platform_data->mem_busaddr = base;
+ ahc->tag = BUS_SPACE_MEMIO;
+ ahc->bsh.maddr = maddr;
+ ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND,
+ command | PCIM_CMD_MEMEN, 4);
+
+ /*
+ * Do a quick test to see if memory mapped
+ * I/O is functioning correctly.
+ */
+ if (ahc_inb(ahc, HCNTRL) == 0xFF) {
+
+ printf("aic7xxx: PCI Device %d:%d:%d "
+ "failed memory mapped test\n",
X ahc_get_pci_bus(ahc->dev_softc),
X ahc_get_pci_slot(ahc->dev_softc),
- ahc_get_pci_function(ahc->dev_softc),
- start);
+ ahc_get_pci_function(ahc->dev_softc));
+ maddr = NULL;
X } else
-#endif
- maddr = ioremap_nocache(base_page, base_offset + 256);
- if (maddr != NULL) {
- ahc->tag = BUS_SPACE_MEMIO;
- ahc->bsh.maddr = maddr + base_offset;
X command |= PCIM_CMD_MEMEN;
- ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND,
- command, 4);
-
- /*
- * Do a quick test to see if memory mapped
- * I/O is functioning correctly.
- */
- if (ahc_inb(ahc, HCNTRL) == 0xFF) {
- printf("aic7xxx: PCI Device %d:%d:%d "
- "failed memory mapped test\n",
- ahc_get_pci_bus(ahc->dev_softc),
- ahc_get_pci_slot(ahc->dev_softc),
- ahc_get_pci_function(ahc->dev_softc));
- iounmap((void *)base_page);
- maddr = NULL;
- } else {
- command &= ~PCIM_CMD_PORTEN;
- ahc_pci_write_config(ahc->dev_softc,
- PCIR_COMMAND, command, 4);
- }
- }
+ } else {
+ printf("aic7xxx: PCI%d:%d:%d MEM region 0x%lx "
+ "unavailable. Cannot map device.\n",
+ ahc_get_pci_bus(ahc->dev_softc),
+ ahc_get_pci_slot(ahc->dev_softc),
+ ahc_get_pci_function(ahc->dev_softc),
+ base);
X }
X #endif
X
@@ -274,46 +330,25 @@
X * complain about our ioport conflicting with
X * another device if we are going to use it.
X */
+ io_error = ahc_linux_pci_reserve_io_region(ahc, &base);
X if (maddr == NULL) {
- ahc->tag = BUS_SPACE_PIO;
- command &= ~(PCIM_CMD_MEMEN|PCIM_CMD_PORTEN);
- ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, command, 4);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
- base = pci_resource_start(ahc->dev_softc, 0);
-#else
- base = ahc_pci_read_config(ahc->dev_softc, PCIR_MAPS, 4);
- base &= PCI_BASE_ADDRESS_IO_MASK;
-#endif
- if (base == 0) {
- printf("aic7xxx: PCI%d:%d:%d No mapping available. "
- "Cannot map device.\n",
- ahc_get_pci_bus(ahc->dev_softc),
- ahc_get_pci_slot(ahc->dev_softc),
- ahc_get_pci_function(ahc->dev_softc));
- return (ENXIO);
- }
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
- if (check_region(base, 256) != 0) {
-#else
- if (request_region(base, 256, "aic7xxx") == 0) {
-#endif
+ error = io_error;
+ if (error != 0) {
X printf("aic7xxx: PCI%d:%d:%d IO region 0x%lx[0..255] "
- "in use. Cannot map device.\n",
+ "unavailable. Cannot map device.\n",
X ahc_get_pci_bus(ahc->dev_softc),
X ahc_get_pci_slot(ahc->dev_softc),
X ahc_get_pci_function(ahc->dev_softc),
X base);
X base = 0;
- return (EBUSY);
+ } else {
+ ahc->tag = BUS_SPACE_PIO;
+ ahc->bsh.ioport = base;
+ command |= PCIM_CMD_PORTEN;
X }
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
- request_region(base, 256, "aic7xxx");
-#endif
- ahc->bsh.ioport = base;
- command |= PCIM_CMD_PORTEN;
- ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, command, 4);
X }
- return (0);
+ ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, command, 4);
+ return (error);
X }
X
X int
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h linux/drivers/scsi/aic7xxx/aic7xxx_osm.h
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h Sun Sep 23 11:40:59 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_osm.h Thu Oct 25 13:53:49 2001
@@ -18,9 +18,9 @@
X * along with this program; see the file COPYING. If not, write to
X * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
X *
- * $Id: //depot/src/linux/drivers/scsi/aic7xxx/aic7xxx_linux.h#65 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_linux.h#72 $
X *
- * Copyright (c) 2000, 2001 Adaptec Inc.


+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without

@@ -29,25 +29,33 @@

- * $Id: //depot/src/linux/drivers/scsi/aic7xxx/aic7xxx_linux.h#65 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_linux.h#72 $
X *
X */
X #ifndef _AIC7XXX_LINUX_H_
@@ -61,6 +69,8 @@
X #include <linux/slab.h>
X #include <linux/pci.h>
X #include <linux/version.h>
+#include <linux/module.h>
+#include <asm/byteorder.h>
X
X #ifndef KERNEL_VERSION
X #define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z))
@@ -103,6 +113,23 @@
X #define ahc_le32toh(x) le32_to_cpu(x)
X #define ahc_le64toh(x) le64_to_cpu(x)
X
+#ifndef LITTLE_ENDIAN
+#define LITTLE_ENDIAN 1234
+#endif
+
+#ifndef BIG_ENDIAN
+#define BIG_ENDIAN 4321
+#endif
+
+#ifndef BYTE_ORDER
+#if defined(__BIG_ENDIAN)
+#define BYTE_ORDER BIG_ENDIAN
+#endif
+#if defined(__LITTLE_ENDIAN)
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+#endif /* BYTE_ORDER */
+
X /************************* Configuration Data *********************************/
X extern int aic7xxx_no_probe;
X extern int aic7xxx_detect_complete;
@@ -376,7 +403,7 @@
X #include <linux/smp.h>
X #endif
X
-#define AIC7XXX_DRIVER_VERSION "6.2.1"
+#define AIC7XXX_DRIVER_VERSION "6.2.4"
X
X /**************************** Front End Queues ********************************/
X /*
@@ -422,7 +449,8 @@
X AHC_DEV_TIMER_ACTIVE = 0x04, /* Our timer is active */
X AHC_DEV_ON_RUN_LIST = 0x08, /* Queued to be run later */
X AHC_DEV_Q_BASIC = 0x10, /* Allow basic device queuing */
- AHC_DEV_Q_TAGGED = 0x20 /* Allow full SCSI2 command queueing */
+ AHC_DEV_Q_TAGGED = 0x20, /* Allow full SCSI2 command queueing */
+ AHC_DEV_PERIODIC_OTAG = 0x40 /* Send OTAG to prevent starvation */
X } ahc_dev_flags;
X
X struct ahc_linux_target;
@@ -491,10 +519,14 @@
X /*
X * How many transactions have been queued
X * without the device going idle. We use
- * this statistic to
+ * this statistic to determine when to issue
+ * an ordered tag to prevent transaction
+ * starvation. This statistic is only updated
+ * if the AHC_DEV_PERIODIC_OTAG flag is set
+ * on this device.
X */
X u_int commands_since_idle_or_otag;
-#define AHC_OTAG_THRESH 250
+#define AHC_OTAG_THRESH 500
X
X int lun;
X struct ahc_linux_target *target;
@@ -580,7 +612,7 @@
X
X
X /***************************** Low Level I/O **********************************/
-#if defined(__powerpc__) || defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
+#if defined(__powerpc__) || defined(__i386__) || defined(__ia64__)
X #define MMAPIO
X #endif
X
@@ -594,19 +626,19 @@
X static __inline uint8_t
X ahc_inb(struct ahc_softc * ahc, long port)
X {
-#ifdef MMAPIO
X uint8_t x;
+#ifdef MMAPIO
X
X if (ahc->tag == BUS_SPACE_MEMIO) {
X x = readb(ahc->bsh.maddr + port);
X } else {
X x = inb(ahc->bsh.ioport + port);
X }
- mb();
- return (x);
X #else
- return (inb(ahc->bsh.ioport + port));
+ x = inb(ahc->bsh.ioport + port);
X #endif
+ mb();
+ return (x);
X }
X
X static __inline void
@@ -618,10 +650,10 @@
X } else {
X outb(val, ahc->bsh.ioport + port);
X }
- mb();
X #else
X outb(val, ahc->bsh.ioport + port);
X #endif
+ mb();
X }
X
X static __inline void
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_pci.c linux/drivers/scsi/aic7xxx/aic7xxx_pci.c
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_pci.c Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_pci.c Thu Oct 25 13:53:49 2001
@@ -3,7 +3,8 @@
X * 3940, 2940, aic7895, aic7890, aic7880,
X * aic7870, aic7860 and aic7850 SCSI controllers
X *
- * Copyright (c) 1995-2000 Justin T. Gibbs


+ * Copyright (c) 1994-2001 Justin T. Gibbs.
+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without

@@ -11,26 +12,34 @@
X * are met:


X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions, and the following disclaimer,

- * without modification, immediately at the beginning of the file.

- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.

+ * without modification.

- * $Id: //depot/src/aic7xxx/aic7xxx_pci.c#28 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#32 $
X *
X * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_pci.c,v 1.6 2000/11/10 20:13:41 gibbs Exp $
X */
@@ -137,7 +146,7 @@
X #define DEVID_9005_TYPE(id) ((id) & 0xF)
X #define DEVID_9005_TYPE_HBA 0x0 /* Standard Card */
X #define DEVID_9005_TYPE_AAA 0x3 /* RAID Card */
-#define DEVID_9005_TYPE_SISL 0x5 /* Low Cost Card */
+#define DEVID_9005_TYPE_SISL 0x5 /* Container ROMB */
X #define DEVID_9005_TYPE_MB 0xF /* On Motherboard */
X
X #define DEVID_9005_MAXRATE(id) (((id) & 0x30) >> 4)
@@ -645,6 +654,8 @@
X #define CACHESIZE 0x0000003ful /* only 5 bits */
X #define LATTIME 0x0000ff00ul
X
+static int ahc_9005_subdevinfo_valid(uint16_t vendor, uint16_t device,
+ uint16_t subvendor, uint16_t subdevice);
X static int ahc_ext_scbram_present(struct ahc_softc *ahc);
X static void ahc_scbram_config(struct ahc_softc *ahc, int enable,
X int pcheck, int fast, int large);
@@ -674,6 +685,40 @@
X static void write_brdctl(struct ahc_softc *ahc, uint8_t value);
X static uint8_t read_brdctl(struct ahc_softc *ahc);
X
+static int
+ahc_9005_subdevinfo_valid(uint16_t device, uint16_t vendor,
+ uint16_t subdevice, uint16_t subvendor)
+{
+ int result;
+
+ /* Default to invalid. */
+ result = 0;
+ if (vendor == 0x9005
+ && subvendor == 0x9005
+ && subdevice != device
+ && SUBID_9005_TYPE_KNOWN(subdevice) != 0) {
+
+ switch (SUBID_9005_TYPE(subdevice)) {
+ case SUBID_9005_TYPE_MB:
+ break;
+ case SUBID_9005_TYPE_CARD:
+ case SUBID_9005_TYPE_LCCARD:
+ /*
+ * Currently only trust Adaptec cards to
+ * get the sub device info correct.
+ */
+ if (DEVID_9005_TYPE(device) == DEVID_9005_TYPE_HBA)
+ result = 1;
+ break;
+ case SUBID_9005_TYPE_RAID:
+ break;


+ default:
+ break;
+ }
+ }

+ return (result);
+}
+
X struct ahc_pci_identity *
X ahc_find_pci_device(ahc_dev_softc_t pci)
X {
@@ -702,9 +747,7 @@
X * ID as valid.
X */
X if (ahc_get_pci_function(pci) > 0
- && subvendor == 0x9005
- && subdevice != device
- && SUBID_9005_TYPE_KNOWN(subdevice) != 0
+ && ahc_9005_subdevinfo_valid(vendor, device, subvendor, subdevice)
X && SUBID_9005_MFUNCENB(subdevice) == 0)
X return (NULL);
X
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_proc.c linux/drivers/scsi/aic7xxx/aic7xxx_proc.c
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_proc.c Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_proc.c Thu Oct 25 13:53:49 2001
@@ -1,5 +1,5 @@
X /*
- * Copyright (c) 2000, 2001 Adaptec Inc.


+ * Copyright (c) 2000-2001 Adaptec Inc.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without

@@ -8,28 +8,36 @@

X * String handling code courtesy of Gerard Roudier's <grou...@club-internet.fr>
X * sym driver.
X *
- * $Id: //depot/src/linux/drivers/scsi/aic7xxx/aic7xxx_proc.c#11 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_proc.c#13 $
X */


X #include "aic7xxx_osm.h"
X #include "aic7xxx_inline.h"

diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_reg.h linux/drivers/scsi/aic7xxx/aic7xxx_reg.h
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_reg.h Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_reg.h Thu Oct 25 13:53:49 2001
@@ -2,8 +2,8 @@
X * DO NOT EDIT - This file is automatically generated
X * from the following source files:
X *
- * $Id: //depot/src/aic7xxx/aic7xxx.seq#33 $
- * $Id: //depot/src/aic7xxx/aic7xxx.reg#19 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#37 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#24 $
X */
X
X #define SCSISEQ 0x00
@@ -127,6 +127,7 @@
X
X #define SSTAT3 0x0e
X #define SCSICNT 0xf0
+#define U2OFFCNT 0x7f
X #define OFFCNT 0x0f
X
X #define SCSIID_ULTRA2 0x0f
@@ -331,6 +332,7 @@
X #define INITIATOR_TAG 0x56
X
X #define SEQ_FLAGS2 0x57
+#define TARGET_MSG_PENDING 0x02
X #define SCB_DMA 0x01
X
X #define SCSICONF 0x5a
@@ -541,13 +543,16 @@
X #define SCB_CDB_PTR 0xa0
X #define SCB_RESIDUAL_DATACNT 0xa0
X #define SCB_CDB_STORE 0xa0
-#define SCB_TARGET_INFO 0xa0
X
X #define SCB_RESIDUAL_SGPTR 0xa4
X
X #define SCB_SCSI_STATUS 0xa8
X
-#define SCB_CDB_STORE_PAD 0xa9
+#define SCB_TARGET_PHASES 0xa9
+
+#define SCB_TARGET_DATA_DIR 0xaa
+
+#define SCB_TARGET_ITAG 0xab
X
X #define SCB_DATAPTR 0xac
X
@@ -677,9 +682,6 @@
X #define SG_CACHE_PRE 0xfc
X
X
-#define SCB_INITIATOR_TAG 0x03
-#define SCB_TARGET_DATA_DIR 0x01
-#define SCB_TARGET_PHASES 0x00
X #define MAX_OFFSET_ULTRA2 0x7f
X #define MAX_OFFSET_16BIT 0x08
X #define BUS_8_BIT 0x00
@@ -692,7 +694,6 @@
X #define TID_SHIFT 0x04
X #define SCB_DOWNLOAD_SIZE_64 0x30
X #define HOST_MAILBOX_SHIFT 0x04
-#define SCB_TARGET_STATUS 0x02
X #define CMD_GROUP_CODE_SHIFT 0x05
X #define CCSGRAM_MAXSEGS 0x10
X #define SCB_LIST_NULL 0xff
diff -u --recursive --new-file v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_seq.h linux/drivers/scsi/aic7xxx/aic7xxx_seq.h
--- v2.4.13/linux/drivers/scsi/aic7xxx/aic7xxx_seq.h Mon Aug 27 12:41:44 2001
+++ linux/drivers/scsi/aic7xxx/aic7xxx_seq.h Thu Oct 25 13:53:49 2001
@@ -2,13 +2,13 @@
X * DO NOT EDIT - This file is automatically generated
X * from the following source files:
X *
- * $Id: //depot/src/aic7xxx/aic7xxx.seq#33 $
- * $Id: //depot/src/aic7xxx/aic7xxx.reg#19 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#37 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#24 $
X */
X static uint8_t seqprog[] = {
X 0xb2, 0x00, 0x00, 0x08,
X 0xf7, 0x11, 0x22, 0x08,
- 0x00, 0x65, 0xde, 0x59,
+ 0x00, 0x65, 0xe0, 0x59,
X 0xf7, 0x01, 0x02, 0x08,
X 0xff, 0x6a, 0x24, 0x08,
X 0x40, 0x00, 0x40, 0x68,
@@ -21,15 +21,15 @@
X 0x01, 0x4d, 0xc8, 0x30,
X 0x00, 0x4c, 0x12, 0x70,
X 0x01, 0x39, 0xa2, 0x30,
- 0x00, 0x6a, 0xa6, 0x5e,
+ 0x00, 0x6a, 0xb2, 0x5e,
X 0x01, 0x51, 0x20, 0x31,
X 0x01, 0x57, 0xae, 0x00,
X 0x0d, 0x6a, 0x76, 0x00,
- 0x00, 0x51, 0xf8, 0x5d,
+ 0x00, 0x51, 0x04, 0x5e,
X 0x01, 0x51, 0xc8, 0x30,
- 0x00, 0x39, 0xd8, 0x60,
+ 0x00, 0x39, 0xc8, 0x60,
X 0x00, 0xbb, 0x30, 0x70,
- 0xc1, 0x6a, 0xbe, 0x5e,
+ 0xc1, 0x6a, 0xca, 0x5e,
X 0x01, 0xbf, 0x72, 0x30,
X 0x01, 0x40, 0x7e, 0x31,
X 0x01, 0x90, 0x80, 0x30,
@@ -37,22 +37,22 @@
X 0x01, 0x4d, 0x9a, 0x18,
X 0xfe, 0x57, 0xae, 0x08,
X 0x01, 0x40, 0x20, 0x31,
- 0x00, 0x65, 0xdc, 0x58,
+ 0x00, 0x65, 0xcc, 0x58,
X 0x60, 0x0b, 0x40, 0x78,
X 0x08, 0x6a, 0x18, 0x00,
X 0x08, 0x11, 0x22, 0x00,
X 0x60, 0x0b, 0x00, 0x78,
- 0x40, 0x0b, 0x0c, 0x69,
- 0x80, 0x0b, 0xc6, 0x78,
+ 0x40, 0x0b, 0xfc, 0x68,
+ 0x80, 0x0b, 0xb6, 0x78,
X 0x20, 0x6a, 0x16, 0x00,
X 0xa4, 0x6a, 0x06, 0x00,
X 0x08, 0x3c, 0x78, 0x00,
X 0x01, 0x50, 0xc8, 0x30,


X 0xe0, 0x6a, 0xcc, 0x00,

- 0x48, 0x6a, 0xe2, 0x5d,
+ 0x48, 0x6a, 0xee, 0x5d,


X 0x01, 0x6a, 0xdc, 0x01,

X 0x88, 0x6a, 0xcc, 0x00,

- 0x48, 0x6a, 0xe2, 0x5d,
+ 0x48, 0x6a, 0xee, 0x5d,
X 0x01, 0x6a, 0x26, 0x01,
X 0xf0, 0x19, 0x7a, 0x08,
X 0x0f, 0x18, 0xc8, 0x08,
@@ -63,81 +63,73 @@
X 0x80, 0x3d, 0x7a, 0x00,
X 0x01, 0x3d, 0xd8, 0x31,
X 0x01, 0x3d, 0x32, 0x31,
- 0x10, 0x03, 0x56, 0x79,
- 0x00, 0x65, 0x04, 0x59,
- 0x80, 0x66, 0xa2, 0x78,
+ 0x10, 0x03, 0x46, 0x79,
+ 0x00, 0x65, 0xf4, 0x58,
+ 0x80, 0x66, 0xae, 0x78,
X 0x01, 0x66, 0xd8, 0x31,
X 0x01, 0x66, 0x32, 0x31,
- 0x40, 0x66, 0x80, 0x68,
+ 0x3f, 0x66, 0x7c, 0x08,
+ 0x40, 0x66, 0x82, 0x68,
X 0x01, 0x3c, 0x78, 0x00,
- 0x10, 0x03, 0xaa, 0x78,
- 0x00, 0x65, 0x04, 0x59,
+ 0x10, 0x03, 0x9e, 0x78,
+ 0x00, 0x65, 0xf4, 0x58,
X 0xe0, 0x66, 0xc8, 0x18,
X 0x00, 0x65, 0xaa, 0x50,
X 0xdd, 0x66, 0xc8, 0x18,
X 0x00, 0x65, 0xaa, 0x48,
X 0x01, 0x66, 0xd8, 0x31,
X 0x01, 0x66, 0x32, 0x31,
- 0x10, 0x03, 0x56, 0x79,
- 0x00, 0x65, 0x04, 0x59,
+ 0x10, 0x03, 0x46, 0x79,
+ 0x00, 0x65, 0xf4, 0x58,
X 0x01, 0x66, 0xd8, 0x31,
X 0x01, 0x66, 0x32, 0x31,
X 0x01, 0x66, 0xac, 0x30,
X 0x40, 0x3c, 0x78, 0x00,
- 0x10, 0x03, 0xa0, 0x78,
- 0x00, 0x65, 0x04, 0x59,
- 0x00, 0x65, 0xaa, 0x40,
- 0x61, 0x6a, 0xbe, 0x5e,
- 0x08, 0x51, 0x2e, 0x71,
- 0x02, 0x0b, 0xa6, 0x78,
- 0x00, 0x65, 0xa2, 0x40,
- 0x80, 0x86, 0xc8, 0x08,
- 0x01, 0x4f, 0xc8, 0x30,
- 0x00, 0x50, 0xbc, 0x60,
- 0xc4, 0x6a, 0x54, 0x5d,
- 0x40, 0x3c, 0xb8, 0x78,
- 0x28, 0x6a, 0x6a, 0x5d,
- 0x00, 0x65, 0x54, 0x41,
- 0x08, 0x6a, 0x6a, 0x5d,
- 0x00, 0x65, 0x54, 0x41,
X 0xff, 0x6a, 0xd8, 0x01,
X 0xff, 0x6a, 0x32, 0x01,
X 0x90, 0x3c, 0x78, 0x00,
- 0x10, 0x03, 0x4a, 0x69,
- 0x00, 0x65, 0x2e, 0x41,
+ 0x02, 0x57, 0x3a, 0x69,
+ 0x10, 0x03, 0x38, 0x69,
+ 0x00, 0x65, 0x1e, 0x41,
+ 0x02, 0x57, 0xae, 0x00,
+ 0x00, 0x65, 0x9e, 0x40,
+ 0x61, 0x6a, 0xca, 0x5e,
+ 0x08, 0x51, 0x1e, 0x71,
+ 0x02, 0x0b, 0xb2, 0x78,
+ 0x00, 0x65, 0xae, 0x40,
X 0x1a, 0x01, 0x02, 0x00,
X 0xf0, 0x19, 0x7a, 0x08,
X 0x0f, 0x0f, 0xc8, 0x08,
X 0x0f, 0x05, 0xc8, 0x08,
X 0x00, 0x3d, 0x7a, 0x00,
- 0x08, 0x1f, 0xd4, 0x78,
+ 0x08, 0x1f, 0xc4, 0x78,
X 0x80, 0x3d, 0x7a, 0x00,
X 0x20, 0x6a, 0x16, 0x00,
- 0x00, 0x65, 0xbe, 0x41,
- 0x00, 0x65, 0x98, 0x5e,
+ 0x00, 0x65, 0xc0, 0x41,
+ 0x00, 0x65, 0xa4, 0x5e,
X 0x00, 0x65, 0x12, 0x40,
- 0x20, 0x11, 0xe2, 0x68,
+ 0x20, 0x11, 0xd2, 0x68,
X 0x20, 0x6a, 0x18, 0x00,
X 0x20, 0x11, 0x22, 0x00,
X 0xf7, 0x1f, 0xca, 0x08,
- 0x80, 0xb9, 0xe8, 0x78,
+ 0x80, 0xb9, 0xd8, 0x78,
X 0x08, 0x65, 0xca, 0x00,
X 0x01, 0x65, 0x3e, 0x30,
X 0x01, 0xb9, 0x1e, 0x30,
X 0x7f, 0xb9, 0x0a, 0x08,
X 0x01, 0xb9, 0x0a, 0x30,
X 0x01, 0x54, 0xca, 0x30,
- 0x80, 0xb8, 0xf6, 0x78,
+ 0x80, 0xb8, 0xe6, 0x78,
X 0x80, 0x65, 0xca, 0x00,
X 0x01, 0x65, 0x00, 0x34,
X 0x01, 0x54, 0x00, 0x34,
X 0x1a, 0x01, 0x02, 0x00,
- 0x08, 0xb8, 0x00, 0x79,
+ 0x08, 0xb8, 0xf0, 0x78,
X 0x20, 0x01, 0x02, 0x00,
X 0x02, 0xbd, 0x08, 0x34,
X 0x01, 0xbd, 0x08, 0x34,
X 0x08, 0x01, 0x02, 0x00,
- 0x02, 0x0b, 0x06, 0x79,
+ 0x02, 0x0b, 0xf6, 0x78,
X 0xf7, 0x01, 0x02, 0x08,
X 0x01, 0x06, 0xcc, 0x34,
X 0xb2, 0x00, 0x00, 0x08,
@@ -146,105 +138,114 @@
X 0x01, 0xbf, 0x80, 0x30,
X 0x01, 0xb9, 0x7a, 0x30,
X 0x01, 0xba, 0x7c, 0x30,
- 0x00, 0x65, 0xfa, 0x58,
- 0x80, 0x0b, 0xba, 0x79,
- 0xe4, 0x6a, 0x54, 0x5d,
- 0x80, 0xba, 0x6a, 0x5d,
- 0x20, 0xb8, 0x26, 0x79,
- 0x20, 0x6a, 0x6a, 0x5d,
- 0x00, 0xa3, 0x6a, 0x5d,
- 0x01, 0xa0, 0x78, 0x30,
- 0x10, 0xb8, 0x2e, 0x79,
- 0xe4, 0x6a, 0x54, 0x5d,
- 0x00, 0x65, 0xa2, 0x40,
- 0x10, 0x03, 0x46, 0x69,
- 0x08, 0x3c, 0x62, 0x69,
- 0x04, 0x3c, 0x88, 0x69,
- 0x02, 0x3c, 0x8e, 0x69,
- 0x01, 0x3c, 0x4c, 0x79,
+ 0x00, 0x65, 0xea, 0x58,
+ 0x80, 0x0b, 0xbc, 0x79,
+ 0xe4, 0x6a, 0x60, 0x5d,
+ 0x80, 0xba, 0x76, 0x5d,
+ 0x20, 0xb8, 0x16, 0x79,
+ 0x20, 0x6a, 0x76, 0x5d,
+ 0x00, 0xab, 0x76, 0x5d,
+ 0x01, 0xa9, 0x78, 0x30,
+ 0x10, 0xb8, 0x1e, 0x79,
+ 0xe4, 0x6a, 0x60, 0x5d,
+ 0x00, 0x65, 0xae, 0x40,
+ 0x10, 0x03, 0x36, 0x69,
+ 0x08, 0x3c, 0x52, 0x69,
+ 0x04, 0x3c, 0x8a, 0x69,
+ 0x02, 0x3c, 0x90, 0x69,
+ 0x01, 0x3c, 0x3c, 0x79,
X 0x01, 0x6a, 0xa2, 0x30,
- 0x00, 0x65, 0x9a, 0x59,
- 0x04, 0x51, 0x3c, 0x61,
- 0x00, 0x6a, 0xa6, 0x5e,
+ 0x00, 0x65, 0x9c, 0x59,
+ 0x04, 0x51, 0x2c, 0x61,
+ 0x00, 0x6a, 0xb2, 0x5e,
X 0x0d, 0x6a, 0x76, 0x00,
- 0x00, 0xbb, 0xf8, 0x5d,
- 0x00, 0x65, 0x26, 0x41,
+ 0x00, 0xbb, 0x04, 0x5e,
+ 0x00, 0x65, 0x16, 0x41,
X 0xa4, 0x6a, 0x06, 0x00,
- 0x00, 0x65, 0x04, 0x59,
- 0x00, 0x65, 0xa2, 0x40,
- 0xe4, 0x6a, 0x54, 0x5d,
- 0x20, 0x3c, 0x52, 0x79,
- 0x02, 0x6a, 0x6a, 0x5d,
- 0x04, 0x6a, 0x6a, 0x5d,
- 0x01, 0x03, 0x54, 0x69,
+ 0x00, 0x65, 0xf4, 0x58,
+ 0x00, 0x65, 0xae, 0x40,
+ 0xe4, 0x6a, 0x60, 0x5d,
+ 0x20, 0x3c, 0x42, 0x79,
+ 0x02, 0x6a, 0x76, 0x5d,
+ 0x04, 0x6a, 0x76, 0x5d,
+ 0x01, 0x03, 0x44, 0x69,
X 0xf7, 0x11, 0x22, 0x08,
X 0xff, 0x6a, 0x24, 0x08,
X 0xff, 0x6a, 0x06, 0x08,
X 0x01, 0x6a, 0x7e, 0x00,
- 0x00, 0x65, 0x9a, 0x59,
+ 0x00, 0x65, 0x9c, 0x59,
X 0x00, 0x65, 0x04, 0x40,
- 0x84, 0x6a, 0x54, 0x5d,
- 0x00, 0x65, 0x04, 0x59,
+ 0x80, 0x86, 0xc8, 0x08,
+ 0x01, 0x4f, 0xc8, 0x30,
+ 0x00, 0x50, 0x64, 0x61,
+ 0xc4, 0x6a, 0x60, 0x5d,
+ 0x40, 0x3c, 0x60, 0x79,
+ 0x28, 0x6a, 0x76, 0x5d,
+ 0x00, 0x65, 0x44, 0x41,
+ 0x08, 0x6a, 0x76, 0x5d,
+ 0x00, 0x65, 0x44, 0x41,
+ 0x84, 0x6a, 0x60, 0x5d,
+ 0x00, 0x65, 0xf4, 0x58,
X 0x01, 0x66, 0xc8, 0x30,
X 0x01, 0x64, 0xd8, 0x31,
X 0x01, 0x64, 0x32, 0x31,
X 0x5b, 0x64, 0xc8, 0x28,
X 0x30, 0x64, 0xca, 0x18,
X 0x01, 0x6c, 0xc8, 0x30,
- 0xff, 0x64, 0x84, 0x79,
+ 0xff, 0x64, 0x86, 0x79,
X 0x08, 0x01, 0x02, 0x00,
- 0x02, 0x0b, 0x76, 0x79,
- 0x01, 0x64, 0x7c, 0x61,
+ 0x02, 0x0b, 0x78, 0x79,
+ 0x01, 0x64, 0x7e, 0x61,
X 0xf7, 0x01, 0x02, 0x08,
X 0x01, 0x06, 0xd8, 0x31,
X 0x01, 0x06, 0x32, 0x31,
X 0xff, 0x64, 0xc8, 0x18,
- 0xff, 0x64, 0x76, 0x69,
+ 0xff, 0x64, 0x78, 0x69,
X 0xf7, 0x3c, 0x78, 0x08,
- 0x00, 0x65, 0x2e, 0x41,
- 0x40, 0xa1, 0x7e, 0x10,
- 0x04, 0xa1, 0x54, 0x5d,
- 0x00, 0x65, 0x50, 0x42,
- 0xc4, 0x6a, 0x54, 0x5d,
+ 0x00, 0x65, 0x1e, 0x41,
+ 0x40, 0xaa, 0x7e, 0x10,
+ 0x04, 0xaa, 0x60, 0x5d,
+ 0x00, 0x65, 0x52, 0x42,
+ 0xc4, 0x6a, 0x60, 0x5d,
X 0xc0, 0x6a, 0x7e, 0x00,
- 0x00, 0xa2, 0x6a, 0x5d,
+ 0x00, 0xa8, 0x76, 0x5d,
X 0xe4, 0x6a, 0x06, 0x00,
- 0x00, 0x6a, 0x6a, 0x5d,
- 0x00, 0x65, 0x54, 0x41,
- 0x10, 0x3c, 0x9e, 0x69,
- 0x00, 0xbb, 0x74, 0x44,
+ 0x00, 0x6a, 0x76, 0x5d,
+ 0x00, 0x65, 0x44, 0x41,
+ 0x10, 0x3c, 0xa0, 0x69,
+ 0x00, 0xbb, 0x80, 0x44,
X 0x18, 0x6a, 0xda, 0x01,
X 0x01, 0x69, 0xd8, 0x31,
X 0x1c, 0x6a, 0xd0, 0x01,


X 0x09, 0xee, 0xdc, 0x01,

- 0x80, 0xee, 0xa6, 0x79,
+ 0x80, 0xee, 0xa8, 0x79,


X 0xff, 0x6a, 0xdc, 0x09,

X 0x01, 0x93, 0x26, 0x01,
X 0x03, 0x6a, 0x2a, 0x01,
X 0x01, 0x69, 0x32, 0x31,
- 0x1c, 0x6a, 0xc6, 0x5d,
+ 0x1c, 0x6a, 0xd2, 0x5d,


X 0x0a, 0x93, 0x26, 0x01,

- 0x00, 0x65, 0x8e, 0x5e,


+ 0x00, 0x65, 0x9a, 0x5e,

X 0x01, 0x50, 0xa0, 0x18,
X 0x02, 0x6a, 0x22, 0x05,
X 0x80, 0x6a, 0x74, 0x00,
X 0x80, 0x3c, 0x78, 0x00,
- 0x00, 0x65, 0xbe, 0x5d,
+ 0x00, 0x65, 0xca, 0x5d,
X 0x01, 0x3f, 0xc8, 0x30,
- 0xbf, 0x64, 0x50, 0x7a,
- 0x80, 0x64, 0x9a, 0x73,
- 0xa0, 0x64, 0xf8, 0x73,
- 0xc0, 0x64, 0xec, 0x73,
- 0xe0, 0x64, 0x28, 0x74,
- 0x01, 0x6a, 0xbe, 0x5e,
- 0x00, 0x65, 0xbe, 0x41,
+ 0xbf, 0x64, 0x52, 0x7a,
+ 0x80, 0x64, 0xa6, 0x73,
+ 0xa0, 0x64, 0x04, 0x74,
+ 0xc0, 0x64, 0xf8, 0x73,
+ 0xe0, 0x64, 0x34, 0x74,
+ 0x01, 0x6a, 0xca, 0x5e,
+ 0x00, 0x65, 0xc0, 0x41,
X 0xf7, 0x11, 0x22, 0x08,
X 0x01, 0x06, 0xd4, 0x30,
X 0xff, 0x6a, 0x24, 0x08,
X 0xf7, 0x01, 0x02, 0x08,
- 0x09, 0x0c, 0xd8, 0x79,
+ 0x09, 0x0c, 0xda, 0x79,
X 0x08, 0x0c, 0x04, 0x68,
- 0xb1, 0x6a, 0xbe, 0x5e,
+ 0xb1, 0x6a, 0xca, 0x5e,
X 0xff, 0x6a, 0x26, 0x09,
X 0x12, 0x01, 0x02, 0x00,
X 0x02, 0x6a, 0x08, 0x30,
@@ -257,33 +258,33 @@
X 0x00, 0xa5, 0x4a, 0x21,
X 0x00, 0xa6, 0x4c, 0x21,
X 0x00, 0xa7, 0x4e, 0x25,
- 0x08, 0xeb, 0xc2, 0x7e,
- 0x80, 0xeb, 0xf8, 0x79,
+ 0x08, 0xeb, 0xce, 0x7e,
+ 0x80, 0xeb, 0xfa, 0x79,
X 0xff, 0x6a, 0xd6, 0x09,
- 0x08, 0xeb, 0xfc, 0x69,
+ 0x08, 0xeb, 0xfe, 0x69,


X 0xff, 0x6a, 0xd4, 0x0c,

- 0x80, 0xa3, 0xc2, 0x6e,
- 0x88, 0xeb, 0x12, 0x72,
- 0x08, 0xeb, 0xc2, 0x6e,
- 0x04, 0xea, 0x16, 0xe2,
- 0x08, 0xee, 0xc2, 0x6e,
+ 0x80, 0xa3, 0xce, 0x6e,
+ 0x88, 0xeb, 0x14, 0x72,
+ 0x08, 0xeb, 0xce, 0x6e,
+ 0x04, 0xea, 0x18, 0xe2,
+ 0x08, 0xee, 0xce, 0x6e,
X 0x04, 0x6a, 0xd0, 0x81,
X 0x05, 0xa4, 0xc0, 0x89,
X 0x03, 0xa5, 0xc2, 0x31,
X 0x09, 0x6a, 0xd6, 0x05,
- 0x00, 0x65, 0xfa, 0x59,
+ 0x00, 0x65, 0xfc, 0x59,
X 0x06, 0xa4, 0xd4, 0x89,
- 0x80, 0x94, 0xc2, 0x7e,
+ 0x80, 0x94, 0xce, 0x7e,
X 0x07, 0xe9, 0x10, 0x31,
- 0x01, 0x8c, 0x1e, 0x7a,
+ 0x01, 0x8c, 0x20, 0x7a,
X 0x01, 0x55, 0xaa, 0x10,
X 0x01, 0xe9, 0x46, 0x31,
- 0x00, 0xa3, 0xa0, 0x5e,
- 0x00, 0x65, 0xec, 0x59,
+ 0x00, 0xa3, 0xac, 0x5e,
+ 0x00, 0x65, 0xee, 0x59,
X 0x01, 0xa4, 0xca, 0x30,
- 0x01, 0x55, 0x2a, 0x7a,
+ 0x01, 0x55, 0x2c, 0x7a,
X 0x04, 0x65, 0xca, 0x00,
- 0x80, 0xa3, 0x2e, 0x7a,
+ 0x80, 0xa3, 0x30, 0x7a,
X 0x02, 0x65, 0xca, 0x00,
X 0x01, 0x65, 0xf8, 0x31,
X 0x80, 0x93, 0x26, 0x01,
@@ -291,168 +292,168 @@
X 0x01, 0x8c, 0xc8, 0x30,
X 0x00, 0x88, 0xc8, 0x18,
X 0x02, 0x64, 0xc8, 0x88,
- 0xff, 0x64, 0xc2, 0x7e,
- 0xff, 0x8d, 0x44, 0x6a,
- 0xff, 0x8e, 0x44, 0x6a,
+ 0xff, 0x64, 0xce, 0x7e,
+ 0xff, 0x8d, 0x46, 0x6a,
+ 0xff, 0x8e, 0x46, 0x6a,
X 0x03, 0x8c, 0xd4, 0x98,
- 0x00, 0x65, 0xc2, 0x56,
+ 0x00, 0x65, 0xce, 0x56,
X 0x01, 0x64, 0x70, 0x30,
X 0xff, 0x64, 0xc8, 0x10,
X 0x01, 0x64, 0xc8, 0x18,
X 0x00, 0x8c, 0x18, 0x19,
X 0xff, 0x8d, 0x1a, 0x21,
X 0xff, 0x8e, 0x1c, 0x25,
- 0x80, 0x3c, 0x54, 0x6a,
- 0x21, 0x6a, 0xbe, 0x46,
+ 0x80, 0x3c, 0x56, 0x6a,
+ 0x21, 0x6a, 0xca, 0x46,
X 0xa8, 0x6a, 0x76, 0x00,
X 0x79, 0x6a, 0x76, 0x00,
- 0x40, 0x3f, 0x5c, 0x6a,
+ 0x40, 0x3f, 0x5e, 0x6a,
X 0x04, 0x3b, 0x76, 0x00,
X 0x04, 0x6a, 0xd4, 0x81,
- 0x20, 0x3c, 0x64, 0x7a,
- 0x51, 0x6a, 0xbe, 0x5e,
- 0x00, 0x65, 0x7e, 0x42,
+ 0x20, 0x3c, 0x66, 0x7a,
+ 0x51, 0x6a, 0xca, 0x5e,
+ 0x00, 0x65, 0x80, 0x42,
X 0x20, 0x3c, 0x78, 0x00,
- 0x00, 0xb3, 0xa0, 0x5e,
+ 0x00, 0xb3, 0xac, 0x5e,
X 0x07, 0xac, 0x10, 0x31,
X 0x05, 0xb3, 0x46, 0x31,


X 0x88, 0x6a, 0xcc, 0x00,

- 0xac, 0x6a, 0xd4, 0x5d,
+ 0xac, 0x6a, 0xe0, 0x5d,
X 0xa3, 0x6a, 0xcc, 0x00,
- 0xb3, 0x6a, 0xd8, 0x5d,
- 0x00, 0x65, 0x34, 0x5a,
+ 0xb3, 0x6a, 0xe4, 0x5d,
+ 0x00, 0x65, 0x36, 0x5a,
X 0xfd, 0xa4, 0x48, 0x09,
X 0x01, 0x8c, 0xaa, 0x08,
X 0x03, 0x8c, 0x10, 0x30,
- 0x00, 0x65, 0xcc, 0x5d,
- 0x01, 0xa4, 0x90, 0x7a,
+ 0x00, 0x65, 0xd8, 0x5d,
+ 0x01, 0xa4, 0x92, 0x7a,
X 0x04, 0x3b, 0x76, 0x08,


X 0x01, 0x3b, 0x26, 0x31,

X 0x80, 0x02, 0x04, 0x00,
- 0x10, 0x0c, 0x86, 0x7a,
- 0x03, 0x9e, 0x88, 0x6a,
+ 0x10, 0x0c, 0x88, 0x7a,
+ 0x03, 0x9e, 0x8a, 0x6a,
X 0x7f, 0x02, 0x04, 0x08,
- 0x91, 0x6a, 0xbe, 0x5e,
- 0x00, 0x65, 0xbe, 0x41,
+ 0x91, 0x6a, 0xca, 0x5e,
+ 0x00, 0x65, 0xc0, 0x41,
X 0x01, 0xa4, 0xca, 0x30,
- 0x80, 0xa3, 0x96, 0x7a,
+ 0x80, 0xa3, 0x98, 0x7a,
X 0x02, 0x65, 0xca, 0x00,
- 0x01, 0x55, 0x9a, 0x7a,
+ 0x01, 0x55, 0x9c, 0x7a,
X 0x04, 0x65, 0xca, 0x00,
X 0x01, 0x65, 0xf8, 0x31,


X 0x01, 0x3b, 0x26, 0x31,

- 0x00, 0x65, 0x00, 0x5a,
- 0x01, 0xfc, 0xa8, 0x6a,
- 0x80, 0x0b, 0x9e, 0x6a,
- 0x10, 0x0c, 0x9e, 0x7a,
- 0x20, 0x93, 0x9e, 0x6a,
+ 0x00, 0x65, 0x02, 0x5a,
+ 0x01, 0xfc, 0xaa, 0x6a,
+ 0x80, 0x0b, 0xa0, 0x6a,
+ 0x10, 0x0c, 0xa0, 0x7a,
+ 0x20, 0x93, 0xa0, 0x6a,
X 0x02, 0x93, 0x26, 0x01,
- 0x02, 0xfc, 0xb2, 0x7a,
- 0x40, 0x0d, 0xcc, 0x6a,
+ 0x02, 0xfc, 0xb4, 0x7a,
+ 0x40, 0x0d, 0xce, 0x6a,
X 0x01, 0xa4, 0x48, 0x01,
- 0x00, 0x65, 0xcc, 0x42,
- 0x40, 0x0d, 0xb8, 0x6a,
- 0x00, 0x65, 0x00, 0x5a,
- 0x00, 0x65, 0xaa, 0x42,
- 0x80, 0xfc, 0xc2, 0x7a,
- 0x80, 0xa4, 0xc2, 0x6a,
+ 0x00, 0x65, 0xce, 0x42,
+ 0x40, 0x0d, 0xba, 0x6a,
+ 0x00, 0x65, 0x02, 0x5a,
+ 0x00, 0x65, 0xac, 0x42,
+ 0x80, 0xfc, 0xc4, 0x7a,
+ 0x80, 0xa4, 0xc4, 0x6a,
X 0xff, 0xa5, 0x4a, 0x19,
X 0xff, 0xa6, 0x4c, 0x21,
X 0xff, 0xa7, 0x4e, 0x21,
X 0xf8, 0xfc, 0x48, 0x09,
X 0xff, 0x6a, 0xaa, 0x08,
- 0x04, 0xfc, 0xca, 0x7a,
+ 0x04, 0xfc, 0xcc, 0x7a,
X 0x01, 0x55, 0xaa, 0x00,
X 0xff, 0x6a, 0x46, 0x09,
- 0x04, 0x3b, 0xe4, 0x6a,
+ 0x04, 0x3b, 0xe6, 0x6a,
X 0x02, 0x93, 0x26, 0x01,
- 0x01, 0x94, 0xce, 0x7a,
- 0x01, 0x94, 0xce, 0x7a,
- 0x01, 0x94, 0xce, 0x7a,
- 0x01, 0x94, 0xce, 0x7a,
- 0x01, 0x94, 0xce, 0x7a,
- 0x01, 0xa4, 0xe2, 0x7a,
- 0x01, 0xfc, 0xdc, 0x7a,
- 0x01, 0x94, 0xe4, 0x6a,
- 0x00, 0x65, 0x7e, 0x42,
- 0x01, 0x94, 0xe2, 0x7a,
- 0x10, 0x94, 0xe4, 0x6a,
+ 0x01, 0x94, 0xd0, 0x7a,
+ 0x01, 0x94, 0xd0, 0x7a,
+ 0x01, 0x94, 0xd0, 0x7a,
+ 0x01, 0x94, 0xd0, 0x7a,
+ 0x01, 0x94, 0xd0, 0x7a,
+ 0x01, 0xa4, 0xe4, 0x7a,
+ 0x01, 0xfc, 0xde, 0x7a,
+ 0x01, 0x94, 0xe6, 0x6a,
+ 0x00, 0x65, 0x80, 0x42,
+ 0x01, 0x94, 0xe4, 0x7a,
+ 0x10, 0x94, 0xe6, 0x6a,
X 0xd7, 0x93, 0x26, 0x09,
- 0x28, 0x93, 0xe8, 0x6a,
+ 0x28, 0x93, 0xea, 0x6a,


X 0x01, 0x85, 0x0a, 0x01,

- 0x02, 0xfc, 0xf0, 0x6a,
+ 0x02, 0xfc, 0xf2, 0x6a,
X 0x01, 0x14, 0x46, 0x31,
X 0xff, 0x6a, 0x10, 0x09,
X 0xfe, 0x85, 0x0a, 0x09,
- 0xff, 0x38, 0xfe, 0x6a,
- 0x80, 0xa3, 0xfe, 0x7a,
- 0x80, 0x0b, 0xfc, 0x7a,
- 0x04, 0x3b, 0xfe, 0x7a,
+ 0xff, 0x38, 0x00, 0x6b,
+ 0x80, 0xa3, 0x00, 0x7b,
+ 0x80, 0x0b, 0xfe, 0x7a,
+ 0x04, 0x3b, 0x00, 0x7b,
X 0xbf, 0x3b, 0x76, 0x08,


X 0x01, 0x3b, 0x26, 0x31,

- 0x00, 0x65, 0x00, 0x5a,
- 0x01, 0x0b, 0x0c, 0x6b,
- 0x10, 0x0c, 0x00, 0x7b,
- 0x04, 0x93, 0x0a, 0x6b,
- 0x01, 0x94, 0x08, 0x7b,
- 0x10, 0x94, 0x0a, 0x6b,
+ 0x00, 0x65, 0x02, 0x5a,
+ 0x01, 0x0b, 0x0e, 0x6b,
+ 0x10, 0x0c, 0x02, 0x7b,
+ 0x04, 0x93, 0x0c, 0x6b,
+ 0x01, 0x94, 0x0a, 0x7b,
+ 0x10, 0x94, 0x0c, 0x6b,
X 0xc7, 0x93, 0x26, 0x09,
X 0x01, 0x99, 0xd4, 0x30,
- 0x38, 0x93, 0x0e, 0x6b,
- 0xff, 0x08, 0x60, 0x6b,
- 0xff, 0x09, 0x60, 0x6b,
- 0xff, 0x0a, 0x60, 0x6b,
- 0xff, 0x38, 0x2a, 0x7b,
+ 0x38, 0x93, 0x10, 0x6b,
+ 0xff, 0x08, 0x62, 0x6b,
+ 0xff, 0x09, 0x62, 0x6b,
+ 0xff, 0x0a, 0x62, 0x6b,
+ 0xff, 0x38, 0x2c, 0x7b,
X 0x04, 0x14, 0x10, 0x31,
X 0x01, 0x38, 0x18, 0x31,
X 0x02, 0x6a, 0x1a, 0x31,


X 0x88, 0x6a, 0xcc, 0x00,

- 0x14, 0x6a, 0xda, 0x5d,
- 0x00, 0x38, 0xc6, 0x5d,
+ 0x14, 0x6a, 0xe6, 0x5d,
+ 0x00, 0x38, 0xd2, 0x5d,
X 0xff, 0x6a, 0x70, 0x08,
- 0x00, 0x65, 0x56, 0x43,
- 0x80, 0xa3, 0x30, 0x7b,
+ 0x00, 0x65, 0x58, 0x43,
+ 0x80, 0xa3, 0x32, 0x7b,
X 0x01, 0xa4, 0x48, 0x01,
- 0x00, 0x65, 0x60, 0x43,
- 0x08, 0xeb, 0x36, 0x7b,
- 0x00, 0x65, 0x00, 0x5a,
- 0x08, 0xeb, 0x32, 0x6b,
+ 0x00, 0x65, 0x62, 0x43,
+ 0x08, 0xeb, 0x38, 0x7b,
+ 0x00, 0x65, 0x02, 0x5a,
+ 0x08, 0xeb, 0x34, 0x6b,
X 0x07, 0xe9, 0x10, 0x31,
X 0x01, 0xe9, 0xca, 0x30,
X 0x01, 0x65, 0x46, 0x31,
- 0x00, 0x6a, 0xa0, 0x5e,
+ 0x00, 0x6a, 0xac, 0x5e,


X 0x88, 0x6a, 0xcc, 0x00,

- 0xa4, 0x6a, 0xda, 0x5d,
- 0x08, 0x6a, 0xc6, 0x5d,
+ 0xa4, 0x6a, 0xe6, 0x5d,
+ 0x08, 0x6a, 0xd2, 0x5d,
X 0x0d, 0x93, 0x26, 0x01,
- 0x00, 0x65, 0x8e, 0x5e,


+ 0x00, 0x65, 0x9a, 0x5e,

X 0x88, 0x6a, 0xcc, 0x00,

- 0x00, 0x65, 0x70, 0x5e,
+ 0x00, 0x65, 0x7c, 0x5e,
X 0x01, 0x99, 0x46, 0x31,
- 0x00, 0xa3, 0xa0, 0x5e,
+ 0x00, 0xa3, 0xac, 0x5e,
X 0x01, 0x88, 0x10, 0x31,
- 0x00, 0x65, 0x34, 0x5a,
- 0x00, 0x65, 0xec, 0x59,
+ 0x00, 0x65, 0x36, 0x5a,
+ 0x00, 0x65, 0xee, 0x59,
X 0x03, 0x8c, 0x10, 0x30,
- 0x00, 0x65, 0xcc, 0x5d,
- 0x01, 0x8c, 0x5e, 0x7b,
+ 0x00, 0x65, 0xd8, 0x5d,
+ 0x01, 0x8c, 0x60, 0x7b,
X 0x01, 0x55, 0xaa, 0x10,
- 0x80, 0x0b, 0x7e, 0x6a,
- 0x80, 0x0b, 0x68, 0x6b,
- 0x01, 0x0c, 0x62, 0x7b,
- 0x10, 0x0c, 0x7e, 0x7a,
- 0x03, 0x9e, 0x7e, 0x6a,
- 0x00, 0x65, 0xf6, 0x59,
- 0x00, 0x6a, 0xa0, 0x5e,
- 0x01, 0xa4, 0x88, 0x6b,
- 0xff, 0x38, 0x7e, 0x7b,
+ 0x80, 0x0b, 0x80, 0x6a,
+ 0x80, 0x0b, 0x6a, 0x6b,
+ 0x01, 0x0c, 0x64, 0x7b,
+ 0x10, 0x0c, 0x80, 0x7a,
+ 0x03, 0x9e, 0x80, 0x6a,
+ 0x00, 0x65, 0xf8, 0x59,
+ 0x00, 0x6a, 0xac, 0x5e,
+ 0x01, 0xa4, 0x8a, 0x6b,
+ 0xff, 0x38, 0x80, 0x7b,
X 0x01, 0x38, 0xc8, 0x30,
X 0x00, 0x08, 0x40, 0x19,


X 0xff, 0x6a, 0xc8, 0x08,

X 0x00, 0x09, 0x42, 0x21,
X 0x00, 0x0a, 0x44, 0x21,
X 0xff, 0x6a, 0x70, 0x08,
- 0x00, 0x65, 0x80, 0x43,
+ 0x00, 0x65, 0x82, 0x43,
X 0x03, 0x08, 0x40, 0x31,
X 0x03, 0x08, 0x40, 0x31,
X 0x01, 0x08, 0x40, 0x31,
@@ -461,14 +462,19 @@
X 0xfd, 0xb4, 0x68, 0x09,
X 0x12, 0x01, 0x02, 0x00,
X 0x12, 0x01, 0x02, 0x00,
- 0x04, 0x3c, 0xbe, 0x79,
+ 0x04, 0x3c, 0xc0, 0x79,
X 0xfb, 0x3c, 0x78, 0x08,
- 0x04, 0x93, 0x2e, 0x79,
- 0x01, 0x0c, 0x94, 0x6b,
- 0x00, 0x65, 0x2e, 0x41,
- 0x00, 0x65, 0xbe, 0x41,
- 0x80, 0x3c, 0x9e, 0x6b,
- 0x21, 0x6a, 0xbe, 0x46,
+ 0x04, 0x93, 0x1e, 0x79,
+ 0x01, 0x0c, 0x96, 0x6b,
+ 0x01, 0x55, 0x1e, 0x79,
+ 0x80, 0x04, 0x1e, 0x79,
+ 0xe4, 0x6a, 0x60, 0x5d,
+ 0x23, 0x6a, 0x76, 0x5d,
+ 0x01, 0x6a, 0x76, 0x5d,
+ 0x00, 0x65, 0x1e, 0x41,
+ 0x00, 0x65, 0xc0, 0x41,
+ 0x80, 0x3c, 0xaa, 0x6b,
+ 0x21, 0x6a, 0xca, 0x46,
X 0x01, 0xbc, 0x18, 0x31,
X 0x02, 0x6a, 0x1a, 0x31,
X 0x02, 0x6a, 0xf8, 0x01,
@@ -478,16 +484,16 @@
X 0xff, 0x6a, 0x12, 0x08,
X 0xff, 0x6a, 0x14, 0x08,
X 0xf3, 0xbc, 0xd4, 0x18,
- 0xa0, 0x6a, 0xc4, 0x53,
+ 0xa0, 0x6a, 0xd0, 0x53,
X 0x04, 0xa0, 0x10, 0x31,
X 0xac, 0x6a, 0x26, 0x01,
X 0x04, 0xa0, 0x10, 0x31,
X 0x03, 0x08, 0x18, 0x31,


X 0x88, 0x6a, 0xcc, 0x00,

- 0xa0, 0x6a, 0xda, 0x5d,
- 0x00, 0xbc, 0xc6, 0x5d,
+ 0xa0, 0x6a, 0xe6, 0x5d,
+ 0x00, 0xbc, 0xd2, 0x5d,
X 0x3d, 0x6a, 0x26, 0x01,
- 0x00, 0x65, 0xdc, 0x43,
+ 0x00, 0x65, 0xe8, 0x43,
X 0xff, 0x6a, 0x10, 0x09,
X 0xa4, 0x6a, 0x26, 0x01,
X 0x0c, 0xa0, 0x32, 0x31,
@@ -497,117 +503,117 @@
X 0x36, 0x6a, 0x26, 0x01,
X 0x02, 0x93, 0x26, 0x01,
X 0x35, 0x6a, 0x26, 0x01,
- 0x00, 0x65, 0x82, 0x5e,
- 0x00, 0x65, 0x82, 0x5e,
+ 0x00, 0x65, 0x8e, 0x5e,
+ 0x00, 0x65, 0x8e, 0x5e,
X 0x02, 0x93, 0x26, 0x01,
- 0x04, 0x0b, 0xe0, 0x6b,
- 0x10, 0x0c, 0xdc, 0x7b,
- 0x01, 0x03, 0xe0, 0x6b,
- 0x20, 0x93, 0xdc, 0x6b,
+ 0x04, 0x0b, 0xec, 0x6b,
+ 0x10, 0x0c, 0xe8, 0x7b,
+ 0x01, 0x03, 0xec, 0x6b,
+ 0x20, 0x93, 0xe8, 0x6b,
X 0xc7, 0x93, 0x26, 0x09,
- 0x38, 0x93, 0xe6, 0x6b,
+ 0x38, 0x93, 0xf2, 0x6b,
X 0x10, 0x01, 0x02, 0x00,
- 0x00, 0x65, 0xbe, 0x41,
- 0x80, 0x3c, 0xf0, 0x6b,
- 0x21, 0x6a, 0xbe, 0x46,
+ 0x00, 0x65, 0xc0, 0x41,
+ 0x80, 0x3c, 0xfc, 0x6b,
+ 0x21, 0x6a, 0xca, 0x46,
X 0x01, 0x06, 0x50, 0x31,
- 0x00, 0x65, 0xbe, 0x41,
+ 0x00, 0x65, 0xc0, 0x41,
X 0x10, 0x3f, 0x06, 0x00,
X 0x10, 0x6a, 0x06, 0x00,
X 0x01, 0x3a, 0xca, 0x30,
- 0x80, 0x65, 0x14, 0x64,
- 0x10, 0xb8, 0x38, 0x6c,
+ 0x80, 0x65, 0x20, 0x64,
+ 0x10, 0xb8, 0x44, 0x6c,
X 0xc0, 0xba, 0xca, 0x00,
- 0x40, 0xb8, 0x04, 0x6c,
+ 0x40, 0xb8, 0x10, 0x6c,
X 0xbf, 0x65, 0xca, 0x08,
- 0x20, 0xb8, 0x18, 0x7c,
+ 0x20, 0xb8, 0x24, 0x7c,
X 0x01, 0x65, 0x0c, 0x30,
- 0x00, 0x65, 0xbe, 0x5d,
- 0xa0, 0x3f, 0x20, 0x64,
+ 0x00, 0x65, 0xca, 0x5d,
+ 0xa0, 0x3f, 0x2c, 0x64,
X 0x23, 0xb8, 0x0c, 0x08,
- 0x00, 0x65, 0xbe, 0x5d,
- 0xa0, 0x3f, 0x20, 0x64,
- 0x00, 0xbb, 0x18, 0x44,
- 0xff, 0x65, 0x18, 0x64,
- 0x00, 0x65, 0x38, 0x44,
+ 0x00, 0x65, 0xca, 0x5d,
+ 0xa0, 0x3f, 0x2c, 0x64,
+ 0x00, 0xbb, 0x24, 0x44,
+ 0xff, 0x65, 0x24, 0x64,
+ 0x00, 0x65, 0x44, 0x44,
X 0x40, 0x6a, 0x18, 0x00,
X 0x01, 0x65, 0x0c, 0x30,
- 0x00, 0x65, 0xbe, 0x5d,
- 0xa0, 0x3f, 0xf4, 0x73,
+ 0x00, 0x65, 0xca, 0x5d,
+ 0xa0, 0x3f, 0x00, 0x74,
X 0x40, 0x6a, 0x18, 0x00,
X 0x01, 0x3a, 0xa6, 0x30,
X 0x08, 0x6a, 0x74, 0x00,
- 0x00, 0x65, 0xbe, 0x41,
- 0x64, 0x6a, 0x4e, 0x5d,
- 0x80, 0x64, 0xbe, 0x6c,
- 0x04, 0x64, 0x84, 0x74,
- 0x02, 0x64, 0x92, 0x74,
- 0x00, 0x6a, 0x54, 0x74,
- 0x03, 0x64, 0xb0, 0x74,
- 0x23, 0x64, 0x40, 0x74,
- 0x08, 0x64, 0x50, 0x74,
- 0x61, 0x6a, 0xbe, 0x5e,
- 0x00, 0x65, 0xbe, 0x5d,
- 0x08, 0x51, 0xc0, 0x71,
- 0x00, 0x65, 0x38, 0x44,
- 0x80, 0x04, 0x4e, 0x7c,
- 0x51, 0x6a, 0x44, 0x5d,
- 0x01, 0x51, 0x4e, 0x64,
- 0x01, 0xa4, 0x4a, 0x7c,
- 0x01, 0x55, 0x50, 0x7c,
- 0x41, 0x6a, 0xbe, 0x5e,
- 0x00, 0x65, 0x50, 0x44,


- 0x07, 0x6a, 0x3a, 0x5d,

+ 0x00, 0x65, 0xc0, 0x41,
+ 0x64, 0x6a, 0x5a, 0x5d,
+ 0x80, 0x64, 0xca, 0x6c,
+ 0x04, 0x64, 0x90, 0x74,
+ 0x02, 0x64, 0x9e, 0x74,
+ 0x00, 0x6a, 0x60, 0x74,
+ 0x03, 0x64, 0xbc, 0x74,
+ 0x23, 0x64, 0x4c, 0x74,
+ 0x08, 0x64, 0x5c, 0x74,
+ 0x61, 0x6a, 0xca, 0x5e,
+ 0x00, 0x65, 0xca, 0x5d,
+ 0x08, 0x51, 0xc2, 0x71,
+ 0x00, 0x65, 0x44, 0x44,
+ 0x80, 0x04, 0x5a, 0x7c,
+ 0x51, 0x6a, 0x50, 0x5d,
+ 0x01, 0x51, 0x5a, 0x64,
+ 0x01, 0xa4, 0x56, 0x7c,
+ 0x01, 0x55, 0x5c, 0x7c,
+ 0x41, 0x6a, 0xca, 0x5e,
+ 0x00, 0x65, 0x5c, 0x44,
+ 0x07, 0x6a, 0x46, 0x5d,
X 0x01, 0x06, 0xd4, 0x30,
- 0x00, 0x65, 0xbe, 0x41,
- 0x10, 0xb8, 0x58, 0x7c,
- 0xa1, 0x6a, 0xbe, 0x5e,
- 0x01, 0xb4, 0x5e, 0x6c,
- 0x02, 0xb4, 0x60, 0x6c,
- 0x01, 0xa4, 0x60, 0x7c,
- 0xff, 0xa8, 0x70, 0x7c,
+ 0x00, 0x65, 0xc0, 0x41,
+ 0x10, 0xb8, 0x64, 0x7c,
+ 0xa1, 0x6a, 0xca, 0x5e,
+ 0x01, 0xb4, 0x6a, 0x6c,
+ 0x02, 0xb4, 0x6c, 0x6c,
+ 0x01, 0xa4, 0x6c, 0x7c,
+ 0xff, 0xa8, 0x7c, 0x7c,
X 0x04, 0xb4, 0x68, 0x01,


X 0x01, 0x6a, 0x76, 0x00,

- 0x00, 0xbb, 0xf8, 0x5d,
- 0xff, 0xa8, 0x70, 0x7c,
- 0x71, 0x6a, 0xbe, 0x5e,
- 0x40, 0x51, 0x70, 0x64,
- 0x00, 0x65, 0x98, 0x5e,
- 0x00, 0x65, 0xd0, 0x41,
- 0x00, 0xbb, 0x74, 0x5c,
- 0x00, 0x65, 0xd0, 0x41,
- 0x00, 0x65, 0x98, 0x5e,
+ 0x00, 0xbb, 0x04, 0x5e,
+ 0xff, 0xa8, 0x7c, 0x7c,
+ 0x71, 0x6a, 0xca, 0x5e,
+ 0x40, 0x51, 0x7c, 0x64,
+ 0x00, 0x65, 0xa4, 0x5e,
+ 0x00, 0x65, 0xd2, 0x41,
+ 0x00, 0xbb, 0x80, 0x5c,
+ 0x00, 0x65, 0xd2, 0x41,
+ 0x00, 0x65, 0xa4, 0x5e,
X 0x01, 0x65, 0xa2, 0x30,
X 0x01, 0xf8, 0xc8, 0x30,
X 0x01, 0x4e, 0xc8, 0x30,
- 0x00, 0x6a, 0x9c, 0xdd,
- 0x00, 0x51, 0xae, 0x5d,
+ 0x00, 0x6a, 0xa8, 0xdd,
+ 0x00, 0x51, 0xba, 0x5d,
X 0x01, 0x4e, 0x9c, 0x18,
X 0x02, 0x6a, 0x22, 0x05,
X 0x04, 0xb8, 0x70, 0x01,
- 0x00, 0x65, 0xba, 0x5e,
- 0x20, 0xb8, 0xd0, 0x69,
+ 0x00, 0x65, 0xc6, 0x5e,
+ 0x20, 0xb8, 0xd2, 0x69,
X 0x01, 0xbb, 0xa2, 0x30,
X 0x01, 0xba, 0x7c, 0x30,
- 0x00, 0xb9, 0xb4, 0x5c,
- 0x00, 0x65, 0xd0, 0x41,
+ 0x00, 0xb9, 0xc0, 0x5c,
+ 0x00, 0x65, 0xd2, 0x41,
X 0x01, 0x06, 0xd4, 0x30,
- 0x20, 0x3c, 0xbe, 0x79,
- 0x20, 0x3c, 0x50, 0x7c,
- 0x01, 0xa4, 0xa0, 0x7c,
+ 0x20, 0x3c, 0xc0, 0x79,
+ 0x20, 0x3c, 0x5c, 0x7c,
+ 0x01, 0xa4, 0xac, 0x7c,
X 0x01, 0xb4, 0x68, 0x01,
- 0x00, 0x65, 0xbe, 0x41,
- 0x00, 0x65, 0x50, 0x44,
+ 0x00, 0x65, 0xc0, 0x41,
+ 0x00, 0x65, 0x5c, 0x44,
X 0x04, 0x14, 0x58, 0x31,
X 0x01, 0x06, 0xd4, 0x30,
X 0x08, 0xa0, 0x60, 0x31,
X 0xac, 0x6a, 0xcc, 0x00,
- 0x14, 0x6a, 0xda, 0x5d,
+ 0x14, 0x6a, 0xe6, 0x5d,
X 0x01, 0x06, 0xd4, 0x30,
- 0xa0, 0x6a, 0xd2, 0x5d,
- 0x00, 0x65, 0xbe, 0x41,
+ 0xa0, 0x6a, 0xde, 0x5d,
+ 0x00, 0x65, 0xc0, 0x41,
X 0xdf, 0x3c, 0x78, 0x08,
- 0x00, 0x65, 0x50, 0x44,
+ 0x00, 0x65, 0x5c, 0x44,
X 0x4c, 0x65, 0xcc, 0x28,
X 0x01, 0x3e, 0x20, 0x31,
X 0xd0, 0x66, 0xcc, 0x18,
@@ -618,102 +624,102 @@
X 0xd0, 0x65, 0xca, 0x18,
X 0x01, 0x3e, 0x20, 0x31,
X 0x30, 0x65, 0xd4, 0x18,
- 0x00, 0x65, 0xcc, 0x4c,
+ 0x00, 0x65, 0xd8, 0x4c,
X 0xe1, 0x6a, 0x22, 0x01,
X 0xff, 0x6a, 0xd4, 0x08,
X 0x20, 0x65, 0xd4, 0x18,
- 0x00, 0x65, 0xd4, 0x54,
+ 0x00, 0x65, 0xe0, 0x54,
X 0xe1, 0x6a, 0x22, 0x01,
X 0xff, 0x6a, 0xd4, 0x08,
X 0x20, 0x65, 0xca, 0x18,
X 0xe0, 0x65, 0xd4, 0x18,
- 0x00, 0x65, 0xde, 0x4c,
+ 0x00, 0x65, 0xea, 0x4c,
X 0xe1, 0x6a, 0x22, 0x01,
X 0xff, 0x6a, 0xd4, 0x08,
X 0xd0, 0x65, 0xd4, 0x18,
- 0x00, 0x65, 0xe6, 0x54,
+ 0x00, 0x65, 0xf2, 0x54,
X 0xe1, 0x6a, 0x22, 0x01,
X 0xff, 0x6a, 0xd4, 0x08,
X 0x01, 0x6c, 0xa2, 0x30,
- 0xff, 0x51, 0xf8, 0x74,
- 0x00, 0x51, 0x74, 0x5d,
+ 0xff, 0x51, 0x04, 0x75,
+ 0x00, 0x51, 0x80, 0x5d,
X 0x01, 0x51, 0x20, 0x31,
- 0x00, 0x65, 0x1a, 0x45,
+ 0x00, 0x65, 0x26, 0x45,
X 0x01, 0xba, 0xc8, 0x30,
- 0x00, 0x3e, 0x1a, 0x75,
- 0x00, 0x65, 0x96, 0x5e,
+ 0x00, 0x3e, 0x26, 0x75,
+ 0x00, 0x65, 0xa2, 0x5e,
X 0x80, 0x3c, 0x78, 0x00,
X 0x01, 0x06, 0xd4, 0x30,
- 0x00, 0x65, 0xbe, 0x5d,
+ 0x00, 0x65, 0xca, 0x5d,
X 0x01, 0x3c, 0x78, 0x00,
- 0xe0, 0x3f, 0x36, 0x65,
+ 0xe0, 0x3f, 0x42, 0x65,
X 0x02, 0x3c, 0x78, 0x00,
- 0x20, 0x12, 0x36, 0x65,
- 0x51, 0x6a, 0x44, 0x5d,
- 0x00, 0x51, 0x74, 0x5d,
- 0x51, 0x6a, 0x44, 0x5d,
+ 0x20, 0x12, 0x42, 0x65,
+ 0x51, 0x6a, 0x50, 0x5d,
+ 0x00, 0x51, 0x80, 0x5d,
+ 0x51, 0x6a, 0x50, 0x5d,
X 0x01, 0x51, 0x20, 0x31,
X 0x04, 0x3c, 0x78, 0x00,
X 0x01, 0xb9, 0xc8, 0x30,
- 0x00, 0x3d, 0x34, 0x65,
+ 0x00, 0x3d, 0x40, 0x65,
X 0x08, 0x3c, 0x78, 0x00,
X 0x01, 0xba, 0xc8, 0x30,
- 0x00, 0x3e, 0x34, 0x65,
+ 0x00, 0x3e, 0x40, 0x65,
X 0x10, 0x3c, 0x78, 0x00,
- 0x04, 0xb8, 0x34, 0x7d,
+ 0x04, 0xb8, 0x40, 0x7d,
X 0xfb, 0xb8, 0x70, 0x09,
- 0x20, 0xb8, 0x2a, 0x6d,
+ 0x20, 0xb8, 0x36, 0x6d,
X 0x01, 0x90, 0xc8, 0x30,
X 0xff, 0x6a, 0xa2, 0x00,
- 0x00, 0x3d, 0xb4, 0x5c,
+ 0x00, 0x3d, 0xc0, 0x5c,
X 0x01, 0x64, 0x20, 0x31,
X 0x80, 0x6a, 0x78, 0x00,
- 0x00, 0x65, 0xfc, 0x58,
- 0x10, 0xb8, 0x50, 0x7c,
- 0xff, 0x6a, 0x3a, 0x5d,
- 0x00, 0x65, 0x50, 0x44,
- 0x00, 0x65, 0x96, 0x5e,
- 0x31, 0x6a, 0xbe, 0x5e,
- 0x00, 0x65, 0x50, 0x44,
+ 0x00, 0x65, 0xec, 0x58,
+ 0x10, 0xb8, 0x5c, 0x7c,
+ 0xff, 0x6a, 0x46, 0x5d,
+ 0x00, 0x65, 0x5c, 0x44,
+ 0x00, 0x65, 0xa2, 0x5e,
+ 0x31, 0x6a, 0xca, 0x5e,
+ 0x00, 0x65, 0x5c, 0x44,
X 0x10, 0x3f, 0x06, 0x00,
X 0x10, 0x6a, 0x06, 0x00,
X 0x01, 0x65, 0x74, 0x34,
- 0x81, 0x6a, 0xbe, 0x5e,
- 0x00, 0x65, 0x46, 0x45,
+ 0x81, 0x6a, 0xca, 0x5e,
+ 0x00, 0x65, 0x52, 0x45,
X 0x01, 0x06, 0xd4, 0x30,
- 0x01, 0x0c, 0x46, 0x7d,
- 0x04, 0x0c, 0x40, 0x6d,
+ 0x01, 0x0c, 0x52, 0x7d,
+ 0x04, 0x0c, 0x4c, 0x6d,
X 0xe0, 0x03, 0x7e, 0x08,
- 0xe0, 0x3f, 0xbe, 0x61,
+ 0xe0, 0x3f, 0xc0, 0x61,
X 0x01, 0x65, 0xcc, 0x30,
X 0x01, 0x12, 0xda, 0x34,
X 0x01, 0x06, 0xd4, 0x34,
- 0x01, 0x03, 0x54, 0x6d,
+ 0x01, 0x03, 0x60, 0x6d,
X 0x40, 0x03, 0xcc, 0x08,
X 0x01, 0x65, 0x06, 0x30,
X 0x40, 0x65, 0xc8, 0x08,
- 0x00, 0x66, 0x62, 0x75,
- 0x40, 0x65, 0x62, 0x7d,
- 0x00, 0x65, 0x62, 0x5d,
+ 0x00, 0x66, 0x6e, 0x75,
+ 0x40, 0x65, 0x6e, 0x7d,
+ 0x00, 0x65, 0x6e, 0x5d,
X 0xff, 0x6a, 0xd4, 0x08,
X 0xff, 0x6a, 0xd4, 0x08,
X 0xff, 0x6a, 0xd4, 0x08,


X 0xff, 0x6a, 0xd4, 0x0c,

X 0x08, 0x01, 0x02, 0x00,
- 0x02, 0x0b, 0x6c, 0x7d,
+ 0x02, 0x0b, 0x78, 0x7d,
X 0x01, 0x65, 0x0c, 0x30,
- 0x02, 0x0b, 0x70, 0x7d,
+ 0x02, 0x0b, 0x7c, 0x7d,
X 0xf7, 0x01, 0x02, 0x0c,


X 0x01, 0x65, 0xc8, 0x30,

- 0xff, 0x41, 0x94, 0x75,
+ 0xff, 0x41, 0xa0, 0x75,


X 0x01, 0x41, 0x20, 0x31,

X 0xff, 0x6a, 0xa4, 0x00,
- 0x00, 0x65, 0x84, 0x45,
- 0xff, 0xbf, 0x94, 0x75,
+ 0x00, 0x65, 0x90, 0x45,
+ 0xff, 0xbf, 0xa0, 0x75,
X 0x01, 0x90, 0xa4, 0x30,
X 0x01, 0xbf, 0x20, 0x31,
- 0x00, 0xbb, 0x7e, 0x65,
- 0xff, 0x52, 0x92, 0x75,
+ 0x00, 0xbb, 0x8a, 0x65,
+ 0xff, 0x52, 0x9e, 0x75,
X 0x01, 0xbf, 0xcc, 0x30,
X 0x01, 0x90, 0xca, 0x30,
X 0x01, 0x52, 0x20, 0x31,
@@ -721,28 +727,28 @@
X 0x01, 0x65, 0x20, 0x35,
X 0x01, 0xbf, 0x82, 0x34,
X 0x01, 0x64, 0xa2, 0x30,
- 0x00, 0x6a, 0xa6, 0x5e,
+ 0x00, 0x6a, 0xb2, 0x5e,
X 0x0d, 0x6a, 0x76, 0x00,
- 0x00, 0x51, 0xf8, 0x45,
+ 0x00, 0x51, 0x04, 0x46,
X 0x01, 0x65, 0xa4, 0x30,


X 0xe0, 0x6a, 0xcc, 0x00,

- 0x48, 0x6a, 0xec, 0x5d,
+ 0x48, 0x6a, 0xf8, 0x5d,
X 0x01, 0x6a, 0xd0, 0x01,
X 0x01, 0x6a, 0xdc, 0x05,


X 0x88, 0x6a, 0xcc, 0x00,

- 0x48, 0x6a, 0xec, 0x5d,
- 0x01, 0x6a, 0xc6, 0x5d,
+ 0x48, 0x6a, 0xf8, 0x5d,
+ 0x01, 0x6a, 0xd2, 0x5d,
X 0x01, 0x6a, 0x26, 0x05,
X 0x01, 0x65, 0xd8, 0x31,


X 0x09, 0xee, 0xdc, 0x01,

- 0x80, 0xee, 0xb2, 0x7d,
+ 0x80, 0xee, 0xbe, 0x7d,
X 0xff, 0x6a, 0xdc, 0x0d,
X 0x01, 0x65, 0x32, 0x31,


X 0x0a, 0x93, 0x26, 0x01,
- 0x00, 0x65, 0x8e, 0x46,

- 0x81, 0x6a, 0xbe, 0x5e,
- 0x01, 0x0c, 0xbe, 0x7d,
- 0x04, 0x0c, 0xbc, 0x6d,


+ 0x00, 0x65, 0x9a, 0x46,

+ 0x81, 0x6a, 0xca, 0x5e,
+ 0x01, 0x0c, 0xca, 0x7d,
+ 0x04, 0x0c, 0xc8, 0x6d,
X 0xe0, 0x03, 0x06, 0x08,
X 0xe0, 0x03, 0x7e, 0x0c,
X 0x01, 0x65, 0x18, 0x31,
@@ -761,7 +767,7 @@
X 0x01, 0x6c, 0xda, 0x34,
X 0x3d, 0x64, 0xa4, 0x28,
X 0x55, 0x64, 0xc8, 0x28,
- 0x00, 0x65, 0xec, 0x45,
+ 0x00, 0x65, 0xf8, 0x45,
X 0x2e, 0x64, 0xa4, 0x28,
X 0x66, 0x64, 0xc8, 0x28,


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 35'
echo 'File patch-2.4.14 is continued in part 36'
echo "36" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:07 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part44

#!/bin/sh -x
# this is part 44 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 44; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

- Skips invalid compressed data until a full flush point (see above the
- description of deflate with Z_FULL_FLUSH) can be found, or until all
- available input is skipped. No output is provided.
-
- inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
- if no more input was provided, Z_DATA_ERROR if no flush point has been found,
- or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
- case, the application may save the current current value of total_in which
- indicates where valid compressed data was found. In the error case, the
- application may repeatedly call inflateSync, providing more input each time,
- until success or end of the input data.
-*/
-
-ZEXTERN int ZEXPORT cramfs_inflateReset OF((z_streamp strm));
-/*
- This function is equivalent to inflateEnd followed by inflateInit,
- but does not free and reallocate all the internal decompression state.
- The stream will keep attributes that may have been set by inflateInit2.
-
- inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being NULL).
-*/
-
-
- /* utility functions */
-
-/*
- The following utility functions are implemented on top of the
- basic stream-oriented functions. To simplify the interface, some
- default options are assumed (compression level and memory usage,
- standard memory allocation functions). The source code of these
- utility functions can easily be modified if you need special options.
-*/
-
-ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Compresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be at least 0.1% larger than
- sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
- compressed buffer.
- This function can be used to compress a whole file at once if the
- input file is mmap'ed.
- compress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer.
-*/
-
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen,
- int level));
-/*
- Compresses the source buffer into the destination buffer. The level
- parameter has the same meaning as in deflateInit. sourceLen is the byte
- length of the source buffer. Upon entry, destLen is the total size of the
- destination buffer, which must be at least 0.1% larger than sourceLen plus
- 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
-
- compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_BUF_ERROR if there was not enough room in the output buffer,
- Z_STREAM_ERROR if the level parameter is invalid.
-*/
-
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Decompresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be large enough to hold the
- entire uncompressed data. (The size of the uncompressed data must have
- been saved previously by the compressor and transmitted to the decompressor
- by some mechanism outside the scope of this compression library.)
- Upon exit, destLen is the actual size of the compressed buffer.
- This function can be used to decompress a whole file at once if the
- input file is mmap'ed.
-
- uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer, or Z_DATA_ERROR if the input data was corrupted.
-*/
-
-
-typedef voidp gzFile;
-
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
-/*
- Opens a gzip (.gz) file for reading or writing. The mode parameter
- is as in fopen ("rb" or "wb") but can also include a compression level
- ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
- Huffman only compression as in "wb1h". (See the description
- of deflateInit2 for more information about the strategy parameter.)
-
- gzopen can be used to read a file which is not in gzip format; in this
- case gzread will directly read from the file without decompression.
-
- gzopen returns NULL if the file could not be opened or if there was
- insufficient memory to allocate the (de)compression state; errno
- can be checked to distinguish the two cases (if errno is zero, the
- zlib error is Z_MEM_ERROR). */
-
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
-/*
- gzdopen() associates a gzFile with the file descriptor fd. File
- descriptors are obtained from calls like open, dup, creat, pipe or
- fileno (in the file has been previously opened with fopen).
- The mode parameter is as in gzopen.
- The next call of gzclose on the returned gzFile will also close the
- file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
- descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
- gzdopen returns NULL if there was insufficient memory to allocate
- the (de)compression state.
-*/
-
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
-/*
- Dynamically update the compression level or strategy. See the description
- of deflateInit2 for the meaning of these parameters.
- gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
- opened for writing.
-*/
-
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
-/*
- Reads the given number of uncompressed bytes from the compressed file.
- If the input file was not in gzip format, gzread copies the given number
- of bytes into the buffer.
- gzread returns the number of uncompressed bytes actually read (0 for
- end of file, -1 for error). */
-
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
- const voidp buf, unsigned len));
-/*
- Writes the given number of uncompressed bytes into the compressed file.
- gzwrite returns the number of uncompressed bytes actually written
- (0 in case of error).
-*/
-
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
-/*
- Converts, formats, and writes the args to the compressed file under
- control of the format string, as in fprintf. gzprintf returns the number of
- uncompressed bytes actually written (0 in case of error).
-*/
-
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
-/*
- Writes the given null-terminated string to the compressed file, excluding
- the terminating null character.
- gzputs returns the number of characters written, or -1 in case of error.
-*/
-
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
-/*
- Reads bytes from the compressed file until len-1 characters are read, or
- a newline character is read and transferred to buf, or an end-of-file
- condition is encountered. The string is then terminated with a null
- character.
- gzgets returns buf, or Z_NULL in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
-/*
- Writes c, converted to an unsigned char, into the compressed file.
- gzputc returns the value that was written, or -1 in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
-/*
- Reads one byte from the compressed file. gzgetc returns this byte
- or -1 in case of end of file or error.
-*/
-
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
-/*
- Flushes all pending output into the compressed file. The parameter
- flush is as in the deflate() function. The return value is the zlib
- error number (see function gzerror below). gzflush returns Z_OK if
- the flush parameter is Z_FINISH and all output could be flushed.
- gzflush should be called only when strictly necessary because it can
- degrade compression.
-*/
-
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
- z_off_t offset, int whence));
-/*
- Sets the starting position for the next gzread or gzwrite on the
- given compressed file. The offset represents a number of bytes in the
- uncompressed data stream. The whence parameter is defined as in lseek(2);
- the value SEEK_END is not supported.
- If the file is opened for reading, this function is emulated but can be
- extremely slow. If the file is opened for writing, only forward seeks are
- supported; gzseek then compresses a sequence of zeroes up to the new
- starting position.
-
- gzseek returns the resulting offset location as measured in bytes from
- the beginning of the uncompressed stream, or -1 in case of error, in
- particular if the file is opened for writing and the new starting position
- would be before the current position.
-*/
-
-ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
-/*
- Rewinds the given file. This function is supported only for reading.
-
- gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
-*/
-
-ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
-/*
- Returns the starting position for the next gzread or gzwrite on the
- given compressed file. This position represents a number of bytes in the
- uncompressed data stream.
-
- gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
-*/
-
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
-/*
- Returns 1 when EOF has previously been detected reading the given
- input stream, otherwise zero.
-*/
-
-ZEXTERN int ZEXPORT gzclose OF((gzFile file));
-/*
- Flushes all pending output if necessary, closes the compressed file
- and deallocates all the (de)compression state. The return value is the zlib
- error number (see function gzerror below).
-*/
-
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
-/*
- Returns the error message for the last error which occurred on the
- given compressed file. errnum is set to zlib error number. If an
- error occurred in the file system and not in the compression library,
- errnum is set to Z_ERRNO and the application may consult errno
- to get the exact error code.
-*/
-
- /* checksum functions */
-
-/*
- These functions are not related to compression but are exported
- anyway because they might be useful in applications using the
- compression library.
-*/
-
-ZEXTERN uLong ZEXPORT cramfs_adler32 OF((uLong adler, const Bytef *buf, uInt len));
-
-/*
- Update a running Adler-32 checksum with the bytes buf[0..len-1] and
- return the updated checksum. If buf is NULL, this function returns
- the required initial value for the checksum.
- An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
- much faster. Usage example:
-
- uLong adler = adler32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- adler = adler32(adler, buffer, length);
- }
- if (adler != original_adler) error();
-*/
-
-ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
-/*
- Update a running crc with the bytes buf[0..len-1] and return the updated
- crc. If buf is NULL, this function returns the required initial value
- for the crc. Pre- and post-conditioning (one's complement) is performed
- within this function so it shouldn't be done by the application.
- Usage example:
-
- uLong crc = crc32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- crc = crc32(crc, buffer, length);
- }
- if (crc != original_crc) error();
-*/
-
-
- /* various hacks, don't look :) */
-
-/* deflateInit and inflateInit are macros to allow checking the zlib version
- * and the compiler's view of z_stream:
- */
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT cramfs_inflateInit_ OF((z_streamp strm,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
- int windowBits, int memLevel,
- int strategy, const char *version,
- int stream_size));
-ZEXTERN int ZEXPORT cramfs_inflateInit2_ OF((z_streamp strm, int windowBits,
- const char *version, int stream_size));
-#define deflateInit(strm, level) \
- deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
-#define cramfs_inflateInit(strm) \
- cramfs_inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
- deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
- (strategy), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
- cramfs_inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
-
-
-#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
- struct internal_state {int dummy;}; /* hack for buggy compilers */
-#endif
-
-ZEXTERN const char * ZEXPORT zError OF((int err));
-ZEXTERN int ZEXPORT cramfs_inflateSyncPoint OF((z_streamp z));
-ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _ZLIB_H */
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/zutil.h linux/fs/cramfs/inflate/zutil.h
--- v2.4.13/linux/fs/cramfs/inflate/zutil.h Mon Jan 3 12:01:31 2000
+++ linux/fs/cramfs/inflate/zutil.h Wed Dec 31 16:00:00 1969
@@ -1,70 +0,0 @@
-/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-1998 Jean-loup Gailly.


- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-

-/* @(#) $Id: zutil.h,v 1.1 2000/01/01 03:32:23 davem Exp $ */
-
-#ifndef _Z_UTIL_H
-#define _Z_UTIL_H
-
-#include "zlib.h"
-
-#include <linux/string.h>
-#include <linux/errno.h>
-
-#ifndef local
-# define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-typedef unsigned char uch;
-typedef uch FAR uchf;
-typedef unsigned short ush;
-typedef ush FAR ushf;
-typedef unsigned long ulg;
-
- /* common constants */
-
-#ifndef DEF_WBITS
-# define DEF_WBITS MAX_WBITS
-#endif
-/* default windowBits for decompression. MAX_WBITS is for compression only */
-
-#if MAX_MEM_LEVEL >= 8
-# define DEF_MEM_LEVEL 8
-#else
-# define DEF_MEM_LEVEL MAX_MEM_LEVEL
-#endif
-/* default memLevel */
-
-#define STORED_BLOCK 0
-#define STATIC_TREES 1
-#define DYN_TREES 2
-/* The three kinds of block type */
-
-#define MIN_MATCH 3
-#define MAX_MATCH 258
-/* The minimum and maximum match lengths */
-
-#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
-
- /* target dependencies */
-
- /* Common defaults */
-
-#ifndef OS_CODE
-# define OS_CODE 0x03 /* assume Unix */
-#endif
-
- /* functions */
-
-typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
- uInt len));
-
-#endif /* _Z_UTIL_H */
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inode.c linux/fs/cramfs/inode.c
--- v2.4.13/linux/fs/cramfs/inode.c Sun Sep 23 11:41:00 2001
+++ linux/fs/cramfs/inode.c Thu Oct 25 13:53:53 2001
@@ -175,7 +175,7 @@
X struct buffer_head * bh = bh_array[i];
X if (bh) {
X memcpy(data, bh->b_data, PAGE_CACHE_SIZE);
- bforget(bh);
+ brelse(bh);
X } else
X memset(data, 0, PAGE_CACHE_SIZE);
X data += PAGE_CACHE_SIZE;
@@ -446,3 +446,5 @@
X
X module_init(init_cramfs_fs)
X module_exit(exit_cramfs_fs)
+MODULE_LICENSE("GPL");
+
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/uncompress.c linux/fs/cramfs/uncompress.c
--- v2.4.13/linux/fs/cramfs/uncompress.c Sun Oct 1 20:35:16 2000
+++ linux/fs/cramfs/uncompress.c Thu Oct 25 13:53:53 2001
@@ -16,8 +16,9 @@
X */
X
X #include <linux/kernel.h>
-
-#include "inflate/zlib.h"
+#include <linux/errno.h>
+#include <linux/vmalloc.h>
+#include <linux/zlib_fs.h>
X
X static z_stream stream;
X static int initialized;
@@ -33,14 +34,14 @@
X stream.next_out = dst;
X stream.avail_out = dstlen;
X
- err = cramfs_inflateReset(&stream);
+ err = zlib_fs_inflateReset(&stream);
X if (err != Z_OK) {
- printk("cramfs_inflateReset error %d\n", err);
- cramfs_inflateEnd(&stream);
- cramfs_inflateInit(&stream);
+ printk("zlib_fs_inflateReset error %d\n", err);
+ zlib_fs_inflateEnd(&stream);
+ zlib_fs_inflateInit(&stream);
X }
X
- err = cramfs_inflate(&stream, Z_FINISH);
+ err = zlib_fs_inflate(&stream, Z_FINISH);
X if (err != Z_STREAM_END)
X goto err;
X return stream.total_out;
@@ -54,16 +55,23 @@
X int cramfs_uncompress_init(void)
X {
X if (!initialized++) {
+ stream.workspace = vmalloc(zlib_fs_inflate_workspacesize());
+ if ( !stream.workspace ) {
+ initialized = 0;
+ return -ENOMEM;
+ }
X stream.next_in = NULL;
X stream.avail_in = 0;
- cramfs_inflateInit(&stream);
+ zlib_fs_inflateInit(&stream);


X }
X return 0;
X }

X
X int cramfs_uncompress_exit(void)
X {
- if (!--initialized)
- cramfs_inflateEnd(&stream);
+ if (!--initialized) {
+ zlib_fs_inflateEnd(&stream);
+ vfree(stream.workspace);
+ }
X return 0;
X }
diff -u --recursive --new-file v2.4.13/linux/fs/devfs/base.c linux/fs/devfs/base.c
--- v2.4.13/linux/fs/devfs/base.c Thu Oct 11 08:02:26 2001
+++ linux/fs/devfs/base.c Sat Nov 3 10:06:38 2001
@@ -555,6 +555,11 @@
X Fixed buffer underrun in <try_modload>.
X Moved down_read() from <search_for_entry_in_dir> to <find_entry>
X v0.119
+ 20011029 Richard Gooch <rgo...@atnf.csiro.au>
+ Fixed race in <devfsd_ioctl> when setting event mask.
+ 20011103 Richard Gooch <rgo...@atnf.csiro.au>
+ Avoid deadlock in <devfs_follow_link> by using temporary buffer.
+ v0.120
X */
X #include <linux/types.h>
X #include <linux/errno.h>
@@ -587,7 +592,7 @@
X #include <asm/bitops.h>
X #include <asm/atomic.h>
X
-#define DEVFS_VERSION "0.119 (20011009)"
+#define DEVFS_VERSION "0.120 (20011103)"
X
X #define DEVFS_NAME "devfs"
X
@@ -3029,13 +3034,25 @@
X {
X int err;
X struct devfs_entry *de;
+ char *copy;
X
X de = get_devfs_entry_from_vfs_inode (dentry->d_inode, TRUE);
X if (!de) return -ENODEV;
X down_read (&symlink_rwsem);
- err = de->registered ? vfs_follow_link (nd,
- de->u.symlink.linkname) : -ENODEV;
+ if (!de->registered)
+ {
+ up_read (&symlink_rwsem);
+ return -ENODEV;
+ }
+ copy = kmalloc (de->u.symlink.length + 1, GFP_KERNEL);
+ if (copy) memcpy (copy, de->u.symlink.linkname, de->u.symlink.length + 1);
X up_read (&symlink_rwsem);
+ if (copy)
+ {
+ err = vfs_follow_link (nd, copy);
+ kfree (copy);
+ }
+ else err = -ENOMEM;
X return err;
X } /* End Function devfs_follow_link */
X
@@ -3212,7 +3229,6 @@
X {
X int ival;
X struct fs_info *fs_info = inode->i_sb->u.generic_sbp;
- static spinlock_t lock = SPIN_LOCK_UNLOCKED;
X
X switch (cmd)
X {
@@ -3226,7 +3242,14 @@
X doesn't matter who gets in first, as long as only one gets it */
X if (fs_info->devfsd_task == NULL)
X {
+ static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+
X if ( !spin_trylock (&lock) ) return -EBUSY;
+ if (fs_info->devfsd_task != NULL)
+ { /* We lost the race... */
+ spin_unlock (&lock);
+ return -EBUSY;
+ }
X fs_info->devfsd_task = current;
X spin_unlock (&lock);
X fs_info->devfsd_file = file;
diff -u --recursive --new-file v2.4.13/linux/fs/dquot.c linux/fs/dquot.c
--- v2.4.13/linux/fs/dquot.c Tue Oct 9 17:06:53 2001
+++ linux/fs/dquot.c Tue Oct 30 15:12:36 2001
@@ -1363,6 +1363,7 @@
X inode->i_flags |= S_NOQUOTA;
X
X dqopt->files[type] = f;
+ sb->dq_op = &dquot_operations;
X set_enable_flags(dqopt, type);
X
X dquot = dqget(sb, 0, type);
@@ -1370,7 +1371,6 @@
X dqopt->block_expire[type] = (dquot != NODQUOT) ? dquot->dq_btime : MAX_DQ_TIME;
X dqput(dquot);
X
- sb->dq_op = &dquot_operations;
X add_dquot_ref(sb, type);
X
X up(&dqopt->dqoff_sem);
diff -u --recursive --new-file v2.4.13/linux/fs/exec.c linux/fs/exec.c
--- v2.4.13/linux/fs/exec.c Sun Sep 23 11:41:00 2001
+++ linux/fs/exec.c Fri Nov 2 17:39:20 2001
@@ -275,6 +275,7 @@
X goto out;
X if (!pte_none(*pte))
X goto out;
+ lru_cache_add(page);
X flush_dcache_page(page);
X flush_page_to_ram(page);
X set_pte(pte, pte_mkdirty(pte_mkwrite(mk_pte(page, PAGE_COPY))));
@@ -770,7 +771,6 @@
X if (!bprm->loader && eh->fh.f_magic == 0x183 &&
X (eh->fh.f_flags & 0x3000) == 0x3000)
X {
- char * dynloader[] = { "/sbin/loader" };
X struct file * file;
X unsigned long loader;
X
@@ -780,10 +780,14 @@
X
X loader = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
X
- file = open_exec(dynloader[0]);
+ file = open_exec("/sbin/loader");
X retval = PTR_ERR(file);
X if (IS_ERR(file))
X return retval;
+
+ /* Remember if the application is TASO. */
+ bprm->sh_bang = eh->ah.entry < 0x100000000;
+
X bprm->file = file;
X bprm->loader = loader;
X retval = prepare_binprm(bprm);
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/Makefile linux/fs/inflate_fs/Makefile
--- v2.4.13/linux/fs/inflate_fs/Makefile Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/Makefile Thu Oct 25 13:53:53 2001
@@ -0,0 +1,33 @@
+#
+# This is a modified version of zlib, which does all memory
+# allocation ahead of time.
+#
+# Currently only decompression is supported.
+#
+# Decompression needs to be serialized for each memory
+# allocation.
+#
+#
+# (The upsides of the simplification is that you can't get in
+# any nasty situations wrt memory management, and that the
+# uncompression can be done without blocking on allocation).
+#
+# The modules are named *_fs.o to distinguish from other modified
+# compression libraries, like the one used by ppp.
+#
+# It is expected that when a deflate module is added it will be
+# a separate module in a deflate_fs directory, to avoid having to
+# load the deflate code for readonly filesystems.
+#
+
+O_TARGET := inflate_fs.o
+
+export-objs := inflate_syms.o
+
+obj-y := adler32.o infblock.o infcodes.o inffast.o inflate.o \
+ inftrees.o infutil.o inflate_syms.o
+obj-m := $(O_TARGET)
+
+EXTRA_CFLAGS += -I $(TOPDIR)/fs/inflate_fs
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/adler32.c linux/fs/inflate_fs/adler32.c
--- v2.4.13/linux/fs/inflate_fs/adler32.c Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/adler32.c Thu Oct 25 13:53:53 2001
@@ -0,0 +1,48 @@
+/* adler32.c -- compute the Adler-32 checksum of a data stream
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#include <linux/zlib_fs.h>
+
+#define BASE 65521L /* largest prime smaller than 65536 */
+#define NMAX 5552
+/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
+#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
+#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
+#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
+#define DO16(buf) DO8(buf,0); DO8(buf,8);
+
+/* ========================================================================= */
+uLong ZEXPORT zlib_fs_adler32(adler, buf, len)
+ uLong adler;
+ const Bytef *buf;
+ uInt len;
+{
+ unsigned long s1 = adler & 0xffff;
+ unsigned long s2 = (adler >> 16) & 0xffff;
+ int k;
+
+ if (buf == Z_NULL) return 1L;
+
+ while (len > 0) {
+ k = len < NMAX ? len : NMAX;
+ len -= k;
+ while (k >= 16) {
+ DO16(buf);
+ buf += 16;
+ k -= 16;
+ }
+ if (k != 0) do {
+ s1 += *buf++;
+ s2 += s1;
+ } while (--k);
+ s1 %= BASE;
+ s2 %= BASE;
+ }
+ return (s2 << 16) | s1;
+}
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/infblock.c linux/fs/inflate_fs/infblock.c
--- v2.4.13/linux/fs/inflate_fs/infblock.c Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/infblock.c Thu Oct 25 13:53:53 2001
@@ -0,0 +1,355 @@
+/* infblock.c -- interpret and process block types to last block
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+#include "inftrees.h"
+#include "infcodes.h"
+#include "infutil.h"
+
+struct inflate_codes_state;
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+/* Table for deflate from PKZIP's appnote.txt. */
+local const uInt border[] = { /* Order of the bit length code lengths */
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+/*
+ Notes beyond the 1.93a appnote.txt:
+
+ 1. Distance pointers never point before the beginning of the output
+ stream.
+ 2. Distance pointers can point back across blocks, up to 32k away.
+ 3. There is an implied maximum of 7 bits for the bit length table and
+ 15 bits for the actual data.
+ 4. If only one code exists, then it is encoded using one bit. (Zero
+ would be more efficient, but perhaps a little confusing.) If two
+ codes exist, they are coded using one bit each (0 and 1).
+ 5. There is no way of sending zero distance codes--a dummy must be
+ sent if there are none. (History: a pre 2.0 version of PKZIP would
+ store blocks with no distance codes, but this was discovered to be
+ too harsh a criterion.) Valid only for 1.93a. 2.04c does allow
+ zero distance codes, which is sent as one code of zero bits in
+ length.
+ 6. There are up to 286 literal/length codes. Code 256 represents the
+ end-of-block. Note however that the static length tree defines
+ 288 codes just to fill out the Huffman codes. Codes 286 and 287
+ cannot be used though, since there is no length base or extra bits
+ defined for them. Similarily, there are up to 30 distance codes.
+ However, static trees define 32 codes (all 5 bits) to fill out the
+ Huffman codes, but the last two had better not show up in the data.
+ 7. Unzip can check dynamic Huffman blocks for complete code sets.
+ The exception is that a single code would not be complete (see #4).
+ 8. The five bits following the block type is really the number of
+ literal codes sent minus 257.
+ 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
+ (1+6+6). Therefore, to output three times the length, you output
+ three codes (1+1+1), whereas to output four times the same length,
+ you only need two codes (1+3). Hmm.
+ 10. In the tree reconstruction algorithm, Code = Code + Increment
+ only if BitLength(i) is not zero. (Pretty obvious.)
+ 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
+ 12. Note: length code 284 can represent 227-258, but length code 285
+ really is 258. The last length deserves its own, short code
+ since it gets used a lot in very redundant files. The length
+ 258 is special since 258 - 3 (the min match length) is 255.
+ 13. The literal/length and distance code bit lengths are read as a
+ single stream of lengths. It is possible (and advantageous) for
+ a repeat code (16, 17, or 18) to go across the boundary between
+ the two sets of lengths.
+ */
+
+
+void zlib_fs_inflate_blocks_reset(s, z, c)
+inflate_blocks_statef *s;
+z_streamp z;
+uLongf *c;
+{
+ if (c != Z_NULL)
+ *c = s->check;
+ if (s->mode == CODES)
+ zlib_fs_inflate_codes_free(s->sub.decode.codes, z);
+ s->mode = TYPE;
+ s->bitk = 0;
+ s->bitb = 0;
+ s->read = s->write = s->window;
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
+}
+
+inflate_blocks_statef *zlib_fs_inflate_blocks_new(z, c, w)
+z_streamp z;
+check_func c;
+uInt w;
+{
+ inflate_blocks_statef *s;
+
+ s = &WS(z)->working_blocks_state;
+ s->hufts = WS(z)->working_hufts;
+ s->window = WS(z)->working_window;
+ s->end = s->window + w;
+ s->checkfn = c;
+ s->mode = TYPE;
+ zlib_fs_inflate_blocks_reset(s, z, Z_NULL);
+ return s;
+}
+
+
+int zlib_fs_inflate_blocks(s, z, r)
+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{
+ uInt t; /* temporary storage */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+
+ /* copy input/output information to locals (UPDATE macro restores) */
+ LOAD
+
+ /* process input based on current state */
+ while (1) switch (s->mode)
+ {
+ case TYPE:
+ NEEDBITS(3)
+ t = (uInt)b & 7;
+ s->last = t & 1;
+ switch (t >> 1)
+ {
+ case 0: /* stored */
+ DUMPBITS(3)
+ t = k & 7; /* go to byte boundary */
+ DUMPBITS(t)
+ s->mode = LENS; /* get length of stored block */
+ break;
+ case 1: /* fixed */
+ {
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+
+ zlib_fs_inflate_trees_fixed(&bl, &bd, &tl, &td, z);
+ s->sub.decode.codes = zlib_fs_inflate_codes_new(bl, bd, tl, td, z);
+ if (s->sub.decode.codes == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ }
+ DUMPBITS(3)
+ s->mode = CODES;
+ break;
+ case 2: /* dynamic */
+ DUMPBITS(3)
+ s->mode = TABLE;
+ break;
+ case 3: /* illegal */
+ DUMPBITS(3)
+ s->mode = B_BAD;
+ z->msg = (char*)"invalid block type";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ break;
+ case LENS:
+ NEEDBITS(32)
+ if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
+ {
+ s->mode = B_BAD;
+ z->msg = (char*)"invalid stored block lengths";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ s->sub.left = (uInt)b & 0xffff;
+ b = k = 0; /* dump bits */
+ s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);
+ break;
+ case STORED:
+ if (n == 0)
+ LEAVE
+ NEEDOUT
+ t = s->sub.left;
+ if (t > n) t = n;
+ if (t > m) t = m;
+ memcpy(q, p, t);
+ p += t; n -= t;
+ q += t; m -= t;
+ if ((s->sub.left -= t) != 0)
+ break;
+ s->mode = s->last ? DRY : TYPE;
+ break;
+ case TABLE:
+ NEEDBITS(14)
+ s->sub.trees.table = t = (uInt)b & 0x3fff;
+#ifndef PKZIP_BUG_WORKAROUND
+ if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
+ {
+ s->mode = B_BAD;
+ z->msg = (char*)"too many length or distance symbols";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+#endif
+ {
+ s->sub.trees.blens = WS(z)->working_blens;
+ }
+ DUMPBITS(14)
+ s->sub.trees.index = 0;
+ s->mode = BTREE;
+ case BTREE:
+ while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
+ {
+ NEEDBITS(3)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
+ DUMPBITS(3)
+ }
+ while (s->sub.trees.index < 19)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
+ s->sub.trees.bb = 7;
+ t = zlib_fs_inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
+ &s->sub.trees.tb, s->hufts, z);
+ if (t != Z_OK)
+ {
+ r = t;
+ if (r == Z_DATA_ERROR)
+ s->mode = B_BAD;
+ LEAVE
+ }
+ s->sub.trees.index = 0;
+ s->mode = DTREE;
+ case DTREE:
+ while (t = s->sub.trees.table,
+ s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
+ {
+ inflate_huft *h;
+ uInt i, j, c;
+
+ t = s->sub.trees.bb;
+ NEEDBITS(t)
+ h = s->sub.trees.tb + ((uInt)b & zlib_fs_inflate_mask[t]);
+ t = h->bits;
+ c = h->base;
+ if (c < 16)
+ {
+ DUMPBITS(t)
+ s->sub.trees.blens[s->sub.trees.index++] = c;
+ }
+ else /* c == 16..18 */
+ {
+ i = c == 18 ? 7 : c - 14;
+ j = c == 18 ? 11 : 3;
+ NEEDBITS(t + i)
+ DUMPBITS(t)
+ j += (uInt)b & zlib_fs_inflate_mask[i];
+ DUMPBITS(i)
+ i = s->sub.trees.index;
+ t = s->sub.trees.table;
+ if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
+ (c == 16 && i < 1))
+ {
+ s->mode = B_BAD;
+ z->msg = (char*)"invalid bit length repeat";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
+ do {
+ s->sub.trees.blens[i++] = c;
+ } while (--j);
+ s->sub.trees.index = i;
+ }
+ }
+ s->sub.trees.tb = Z_NULL;
+ {
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+ inflate_codes_statef *c;
+
+ bl = 9; /* must be <= 9 for lookahead assumptions */
+ bd = 6; /* must be <= 9 for lookahead assumptions */
+ t = s->sub.trees.table;
+ t = zlib_fs_inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
+ s->sub.trees.blens, &bl, &bd, &tl, &td,
+ s->hufts, z);
+ if (t != Z_OK)
+ {
+ if (t == (uInt)Z_DATA_ERROR)
+ s->mode = B_BAD;
+ r = t;
+ LEAVE
+ }
+ if ((c = zlib_fs_inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ s->sub.decode.codes = c;
+ }
+ s->mode = CODES;
+ case CODES:
+ UPDATE
+ if ((r = zlib_fs_inflate_codes(s, z, r)) != Z_STREAM_END)
+ return zlib_fs_inflate_flush(s, z, r);
+ r = Z_OK;
+ zlib_fs_inflate_codes_free(s->sub.decode.codes, z);
+ LOAD
+ if (!s->last)
+ {
+ s->mode = TYPE;
+ break;
+ }
+ s->mode = DRY;
+ case DRY:
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ s->mode = B_DONE;
+ case B_DONE:
+ r = Z_STREAM_END;
+ LEAVE
+ case B_BAD:
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+}
+
+
+int zlib_fs_inflate_blocks_free(s, z)
+inflate_blocks_statef *s;
+z_streamp z;
+{
+ zlib_fs_inflate_blocks_reset(s, z, Z_NULL);
+ return Z_OK;
+}
+
+
+void zlib_fs_inflate_set_dictionary(s, d, n)
+inflate_blocks_statef *s;
+const Bytef *d;
+uInt n;
+{
+ memcpy(s->window, d, n);
+ s->read = s->write = s->window + n;
+}
+
+
+/* Returns true if inflate is currently at the end of a block generated
+ * by Z_SYNC_FLUSH or Z_FULL_FLUSH.
+ * IN assertion: s != Z_NULL
+ */
+int zlib_fs_inflate_blocks_sync_point(s)
+inflate_blocks_statef *s;
+{
+ return s->mode == LENS;
+}
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/infblock.h linux/fs/inflate_fs/infblock.h
--- v2.4.13/linux/fs/inflate_fs/infblock.h Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/infblock.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,44 @@
+/* infblock.h -- header to use infblock.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+#ifndef _INFBLOCK_H
+#define _INFBLOCK_H
+
+struct inflate_blocks_state;
+typedef struct inflate_blocks_state FAR inflate_blocks_statef;
+
+extern inflate_blocks_statef * zlib_fs_inflate_blocks_new OF((
+ z_streamp z,
+ check_func c, /* check function */
+ uInt w)); /* window size */
+
+extern int zlib_fs_inflate_blocks OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int)); /* initial return code */
+
+extern void zlib_fs_inflate_blocks_reset OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ uLongf *)); /* check value on output */
+
+extern int zlib_fs_inflate_blocks_free OF((
+ inflate_blocks_statef *,
+ z_streamp));
+
+extern void zlib_fs_inflate_set_dictionary OF((
+ inflate_blocks_statef *s,
+ const Bytef *d, /* dictionary */
+ uInt n)); /* dictionary length */
+
+extern int zlib_fs_inflate_blocks_sync_point OF((
+ inflate_blocks_statef *s));
+
+#endif /* _INFBLOCK_H */
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/infcodes.c linux/fs/inflate_fs/infcodes.c
--- v2.4.13/linux/fs/inflate_fs/infcodes.c Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/infcodes.c Thu Oct 25 13:53:53 2001
@@ -0,0 +1,204 @@
+/* infcodes.c -- process literals and length/distance pairs
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "infblock.h"
+#include "infcodes.h"
+#include "infutil.h"
+#include "inffast.h"
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+inflate_codes_statef *zlib_fs_inflate_codes_new(bl, bd, tl, td, z)
+uInt bl, bd;
+inflate_huft *tl;
+inflate_huft *td; /* need separate declaration for Borland C++ */
+z_streamp z;
+{
+ inflate_codes_statef *c;
+
+ c = &WS(z)->working_state;
+ {
+ c->mode = START;
+ c->lbits = (Byte)bl;
+ c->dbits = (Byte)bd;
+ c->ltree = tl;
+ c->dtree = td;
+ }
+ return c;
+}
+
+
+int zlib_fs_inflate_codes(s, z, r)
+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{
+ uInt j; /* temporary storage */
+ inflate_huft *t; /* temporary pointer */
+ uInt e; /* extra bits or operation */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+ Bytef *f; /* pointer to copy strings from */
+ inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
+
+ /* copy input/output information to locals (UPDATE macro restores) */
+ LOAD
+
+ /* process input and output based on current state */
+ while (1) switch (c->mode)
+ { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
+ case START: /* x: set up for LEN */
+#ifndef SLOW
+ if (m >= 258 && n >= 10)
+ {
+ UPDATE
+ r = zlib_fs_inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
+ LOAD
+ if (r != Z_OK)
+ {
+ c->mode = r == Z_STREAM_END ? WASH : BADCODE;
+ break;
+ }
+ }
+#endif /* !SLOW */
+ c->sub.code.need = c->lbits;
+ c->sub.code.tree = c->ltree;
+ c->mode = LEN;
+ case LEN: /* i: get length/literal/eob next */
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & zlib_fs_inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e == 0) /* literal */
+ {
+ c->sub.lit = t->base;
+ c->mode = LIT;
+ break;
+ }
+ if (e & 16) /* length */
+ {
+ c->sub.copy.get = e & 15;
+ c->len = t->base;
+ c->mode = LENEXT;
+ break;
+ }
+ if ((e & 64) == 0) /* next table */
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ if (e & 32) /* end of block */
+ {
+ c->mode = WASH;
+ break;
+ }
+ c->mode = BADCODE; /* invalid code */
+ z->msg = (char*)"invalid literal/length code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case LENEXT: /* i: getting length extra (have base) */
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->len += (uInt)b & zlib_fs_inflate_mask[j];
+ DUMPBITS(j)
+ c->sub.code.need = c->dbits;
+ c->sub.code.tree = c->dtree;
+ c->mode = DIST;
+ case DIST: /* i: get distance next */
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & zlib_fs_inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e & 16) /* distance */
+ {
+ c->sub.copy.get = e & 15;
+ c->sub.copy.dist = t->base;
+ c->mode = DISTEXT;
+ break;
+ }
+ if ((e & 64) == 0) /* next table */
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ c->mode = BADCODE; /* invalid code */
+ z->msg = (char*)"invalid distance code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case DISTEXT: /* i: getting distance extra */
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->sub.copy.dist += (uInt)b & zlib_fs_inflate_mask[j];
+ DUMPBITS(j)
+ c->mode = COPY;
+ case COPY: /* o: copying bytes in window, waiting for space */
+#ifndef __TURBOC__ /* Turbo C bug for following expression */
+ f = (uInt)(q - s->window) < c->sub.copy.dist ?
+ s->end - (c->sub.copy.dist - (q - s->window)) :
+ q - c->sub.copy.dist;
+#else
+ f = q - c->sub.copy.dist;
+ if ((uInt)(q - s->window) < c->sub.copy.dist)
+ f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));
+#endif
+ while (c->len)
+ {
+ NEEDOUT
+ OUTBYTE(*f++)
+ if (f == s->end)
+ f = s->window;
+ c->len--;
+ }
+ c->mode = START;
+ break;
+ case LIT: /* o: got literal, waiting for output space */
+ NEEDOUT
+ OUTBYTE(c->sub.lit)
+ c->mode = START;
+ break;
+ case WASH: /* o: got eob, possibly more output */
+ if (k > 7) /* return unused byte, if any */
+ {
+ k -= 8;
+ n++;
+ p--; /* can always return one */
+ }
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ c->mode = END;
+ case END:
+ r = Z_STREAM_END;
+ LEAVE
+ case BADCODE: /* x: got error */
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
+}
+
+
+void zlib_fs_inflate_codes_free(c, z)
+inflate_codes_statef *c;
+z_streamp z;
+{
+}
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/infcodes.h linux/fs/inflate_fs/infcodes.h
--- v2.4.13/linux/fs/inflate_fs/infcodes.h Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/infcodes.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,33 @@
+/* infcodes.h -- header to use infcodes.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+#ifndef _INFCODES_H
+#define _INFCODES_H
+
+#include "infblock.h"
+
+struct inflate_codes_state;
+typedef struct inflate_codes_state FAR inflate_codes_statef;
+
+extern inflate_codes_statef *zlib_fs_inflate_codes_new OF((
+ uInt, uInt,
+ inflate_huft *, inflate_huft *,
+ z_streamp ));
+
+extern int zlib_fs_inflate_codes OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int));
+
+extern void zlib_fs_inflate_codes_free OF((
+ inflate_codes_statef *,
+ z_streamp ));
+
+#endif /* _INFCODES_H */
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/inffast.c linux/fs/inflate_fs/inffast.c
--- v2.4.13/linux/fs/inflate_fs/inffast.c Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/inffast.c Thu Oct 25 13:53:53 2001
@@ -0,0 +1,161 @@
+/* inffast.c -- process literals and length/distance pairs fast
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "infblock.h"
+#include "infcodes.h"
+#include "infutil.h"
+#include "inffast.h"
+
+struct inflate_codes_state;
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+/* macros for bit input with no checking and for returning unused bytes */
+#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
+#define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;}
+
+/* Called with number of bytes left to write in window at least 258
+ (the maximum string length) and number of input bytes available
+ at least ten. The ten bytes are six bytes for the longest length/
+ distance pair plus four bytes for overloading the bit buffer. */
+
+int zlib_fs_inflate_fast(bl, bd, tl, td, s, z)
+uInt bl, bd;
+inflate_huft *tl;
+inflate_huft *td; /* need separate declaration for Borland C++ */
+inflate_blocks_statef *s;
+z_streamp z;
+{
+ inflate_huft *t; /* temporary pointer */
+ uInt e; /* extra bits or operation */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+ uInt ml; /* mask for literal/length tree */
+ uInt md; /* mask for distance tree */
+ uInt c; /* bytes to copy */
+ uInt d; /* distance back to copy from */
+ Bytef *r; /* copy source pointer */
+
+ /* load input, output, bit values */
+ LOAD
+
+ /* initialize masks */
+ ml = zlib_fs_inflate_mask[bl];
+ md = zlib_fs_inflate_mask[bd];
+
+ /* do until not enough input or output space for fast loop */
+ do { /* assume called with m >= 258 && n >= 10 */
+ /* get literal/length code */
+ GRABBITS(20) /* max bits for literal/length code */
+ if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)
+ {
+ DUMPBITS(t->bits)
+ *q++ = (Byte)t->base;
+ m--;
+ continue;
+ }
+ do {
+ DUMPBITS(t->bits)
+ if (e & 16)
+ {
+ /* get extra bits for length */
+ e &= 15;
+ c = t->base + ((uInt)b & zlib_fs_inflate_mask[e]);
+ DUMPBITS(e)
+
+ /* decode distance base of block to copy */
+ GRABBITS(15); /* max bits for distance code */
+ e = (t = td + ((uInt)b & md))->exop;
+ do {
+ DUMPBITS(t->bits)
+ if (e & 16)
+ {
+ /* get extra bits to add to distance base */
+ e &= 15;
+ GRABBITS(e) /* get extra bits (up to 13) */
+ d = t->base + ((uInt)b & zlib_fs_inflate_mask[e]);
+ DUMPBITS(e)
+
+ /* do the copy */
+ m -= c;
+ if ((uInt)(q - s->window) >= d) /* offset before dest */
+ { /* just copy */
+ r = q - d;
+ *q++ = *r++; c--; /* minimum count is three, */
+ *q++ = *r++; c--; /* so unroll loop a little */
+ }
+ else /* else offset after destination */
+ {
+ e = d - (uInt)(q - s->window); /* bytes from offset to end */
+ r = s->end - e; /* pointer to offset */
+ if (c > e) /* if source crosses, */
+ {
+ c -= e; /* copy to end of window */
+ do {
+ *q++ = *r++;
+ } while (--e);
+ r = s->window; /* copy rest from start of window */
+ }
+ }
+ do { /* copy all or what's left */
+ *q++ = *r++;
+ } while (--c);
+ break;
+ }
+ else if ((e & 64) == 0)
+ {
+ t += t->base;
+ e = (t += ((uInt)b & zlib_fs_inflate_mask[e]))->exop;
+ }
+ else
+ {
+ z->msg = (char*)"invalid distance code";
+ UNGRAB
+ UPDATE
+ return Z_DATA_ERROR;
+ }
+ } while (1);
+ break;
+ }
+ if ((e & 64) == 0)
+ {
+ t += t->base;
+ if ((e = (t += ((uInt)b & zlib_fs_inflate_mask[e]))->exop) == 0)
+ {
+ DUMPBITS(t->bits)
+ *q++ = (Byte)t->base;
+ m--;
+ break;
+ }
+ }
+ else if (e & 32)
+ {
+ UNGRAB
+ UPDATE
+ return Z_STREAM_END;
+ }
+ else
+ {
+ z->msg = (char*)"invalid literal/length code";
+ UNGRAB
+ UPDATE
+ return Z_DATA_ERROR;
+ }
+ } while (1);
+ } while (m >= 258 && n >= 10);
+
+ /* not enough input or output--restore pointers and return */
+ UNGRAB
+ UPDATE
+ return Z_OK;
+}
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/inffast.h linux/fs/inflate_fs/inffast.h
--- v2.4.13/linux/fs/inflate_fs/inffast.h Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/inffast.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,17 @@
+/* inffast.h -- header to use inffast.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+extern int zlib_fs_inflate_fast OF((
+ uInt,
+ uInt,
+ inflate_huft *,
+ inflate_huft *,
+ inflate_blocks_statef *,
+ z_streamp ));
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/inffixed.h linux/fs/inflate_fs/inffixed.h
--- v2.4.13/linux/fs/inflate_fs/inffixed.h Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/inffixed.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,151 @@
+/* inffixed.h -- table for decoding fixed codes
+ * Generated automatically by the maketree.c program
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+local uInt fixed_bl = 9;
+local uInt fixed_bd = 5;
+local inflate_huft fixed_tl[] = {
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 44'
echo 'File patch-2.4.14 is continued in part 45'
echo "45" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:06 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part43

#!/bin/sh -x
# this is part 43 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 43; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

- * but removes the length bytes of the resulting empty stored block. When
- * decompressing, PPP checks that at the end of input packet, inflate is
- * waiting for these length bytes.
- */
-int ZEXPORT cramfs_inflateSyncPoint(z)
-z_streamp z;
-{
- if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL)
- return Z_STREAM_ERROR;
- return inflate_blocks_sync_point(z->state->blocks);
-}
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/inftrees.c linux/fs/cramfs/inflate/inftrees.c
--- v2.4.13/linux/fs/cramfs/inflate/inftrees.c Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/inftrees.c Wed Dec 31 16:00:00 1969
@@ -1,392 +0,0 @@
-/* inftrees.c -- generate Huffman trees for efficient decoding


- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-

-static const char inflate_copyright[] =
- " inflate 1.1.3 Copyright 1995-1998 Mark Adler ";
-/*
- If you use the zlib library in a product, an acknowledgment is welcome
- in the documentation of your product. If for some reason you cannot
- include such an acknowledgment, I would appreciate that you keep this
- copyright string in the executable of your product.
- */
-struct internal_state {int dummy;}; /* for buggy compilers */


-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-

-local int huft_build OF((
- uIntf *, /* code lengths in bits */
- uInt, /* number of codes */
- uInt, /* number of "simple" codes */
- const uIntf *, /* list of base values for non-simple codes */
- const uIntf *, /* list of extra bits for non-simple codes */
- inflate_huft * FAR*,/* result: starting table */
- uIntf *, /* maximum lookup bits (returns actual) */
- inflate_huft *, /* space for trees */
- uInt *, /* hufts used in space */
- uIntf * )); /* space for values */
-
-/* Tables for deflate from PKZIP's appnote.txt. */
-local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
- 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
- /* see note #13 above about 258 */
-local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
- 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */
-local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
- 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
- 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
- 8193, 12289, 16385, 24577};
-local const uInt cpdext[30] = { /* Extra bits for distance codes */
- 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
- 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
- 12, 12, 13, 13};
-
-/*
- Huffman code decoding is performed using a multi-level table lookup.
- The fastest way to decode is to simply build a lookup table whose
- size is determined by the longest code. However, the time it takes
- to build this table can also be a factor if the data being decoded
- is not very long. The most common codes are necessarily the
- shortest codes, so those codes dominate the decoding time, and hence
- the speed. The idea is you can have a shorter table that decodes the
- shorter, more probable codes, and then point to subsidiary tables for
- the longer codes. The time it costs to decode the longer codes is
- then traded against the time it takes to make longer tables.
-
- This results of this trade are in the variables lbits and dbits
- below. lbits is the number of bits the first level table for literal/
- length codes can decode in one step, and dbits is the same thing for
- the distance codes. Subsequent tables are also less than or equal to
- those sizes. These values may be adjusted either when all of the
- codes are shorter than that, in which case the longest code length in
- bits is used, or when the shortest code is *longer* than the requested
- table size, in which case the length of the shortest code in bits is
- used.
-
- There are two different values for the two tables, since they code a
- different number of possibilities each. The literal/length table
- codes 286 possible values, or in a flat code, a little over eight
- bits. The distance table codes 30 possible values, or a little less
- than five bits, flat. The optimum values for speed end up being
- about one bit more than those, so lbits is 8+1 and dbits is 5+1.
- The optimum values may differ though from machine to machine, and
- possibly even between compilers. Your mileage may vary.
- */
-
-
-/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
-#define BMAX 15 /* maximum bit length of any code */
-
-local int huft_build(b, n, s, d, e, t, m, hp, hn, v)
-uIntf *b; /* code lengths in bits (all assumed <= BMAX) */
-uInt n; /* number of codes (assumed <= 288) */
-uInt s; /* number of simple-valued codes (0..s-1) */
-const uIntf *d; /* list of base values for non-simple codes */
-const uIntf *e; /* list of extra bits for non-simple codes */
-inflate_huft * FAR *t; /* result: starting table */
-uIntf *m; /* maximum lookup bits, returns actual */
-inflate_huft *hp; /* space for trees */
-uInt *hn; /* hufts used in space */
-uIntf *v; /* working area: values in order of bit length */
-/* Given a list of code lengths and a maximum table size, make a set of
- tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
- if the given code set is incomplete (the tables are still built in this
- case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of
- lengths), or Z_MEM_ERROR if not enough memory. */
-{
-
- uInt a; /* counter for codes of length k */
- uInt c[BMAX+1]; /* bit length count table */
- uInt f; /* i repeats in table every f entries */
- int g; /* maximum code length */
- int h; /* table level */
- register uInt i; /* counter, current code */
- register uInt j; /* counter */
- register int k; /* number of bits in current code */
- int l; /* bits per table (returned in m) */
- uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */
- register uIntf *p; /* pointer into c[], b[], or v[] */
- inflate_huft *q; /* points to current table */
- struct inflate_huft_s r; /* table entry for structure assignment */
- inflate_huft *u[BMAX]; /* table stack */
- register int w; /* bits before this table == (l * h) */
- uInt x[BMAX+1]; /* bit offsets, then code stack */
- uIntf *xp; /* pointer into x */
- int y; /* number of dummy codes added */
- uInt z; /* number of entries in current table */
-
-
- /* Generate counts for each bit length */
- p = c;
-#define C0 *p++ = 0;
-#define C2 C0 C0 C0 C0
-#define C4 C2 C2 C2 C2
- C4 /* clear c[]--assume BMAX+1 is 16 */
- p = b; i = n;
- do {
- c[*p++]++; /* assume all entries <= BMAX */
- } while (--i);
- if (c[0] == n) /* null input--all zero length codes */
- {
- *t = (inflate_huft *)Z_NULL;
- *m = 0;


- return Z_OK;
- }
-
-

- /* Find minimum and maximum length, bound *m by those */
- l = *m;
- for (j = 1; j <= BMAX; j++)
- if (c[j])
- break;
- k = j; /* minimum code length */
- if ((uInt)l < j)
- l = j;
- for (i = BMAX; i; i--)
- if (c[i])
- break;
- g = i; /* maximum code length */
- if ((uInt)l > i)
- l = i;
- *m = l;
-
-
- /* Adjust last length count to fill out codes, if needed */
- for (y = 1 << j; j < i; j++, y <<= 1)
- if ((y -= c[j]) < 0)
- return Z_DATA_ERROR;
- if ((y -= c[i]) < 0)
- return Z_DATA_ERROR;
- c[i] += y;
-
-
- /* Generate starting offsets into the value table for each length */
- x[1] = j = 0;
- p = c + 1; xp = x + 2;
- while (--i) { /* note that i == g from above */
- *xp++ = (j += *p++);
- }
-
-
- /* Make a table of values in order of bit lengths */
- p = b; i = 0;
- do {
- if ((j = *p++) != 0)
- v[x[j]++] = i;
- } while (++i < n);
- n = x[g]; /* set n to length of v */
-
-
- /* Generate the Huffman codes and for each, make the table entries */
- x[0] = i = 0; /* first Huffman code is zero */
- p = v; /* grab values in bit order */
- h = -1; /* no tables yet--level -1 */
- w = -l; /* bits decoded == (l * h) */
- u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */
- q = (inflate_huft *)Z_NULL; /* ditto */
- z = 0; /* ditto */
-
- /* go through the bit lengths (k already is bits in shortest code) */
- for (; k <= g; k++)
- {
- a = c[k];
- while (a--)
- {
- /* here i is the Huffman code of length k bits for value *p */
- /* make tables up to required level */
- while (k > w + l)
- {
- h++;
- w += l; /* previous table always l bits */
-
- /* compute minimum size table less than or equal to l bits */
- z = g - w;
- z = z > (uInt)l ? l : z; /* table size upper limit */
- if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
- { /* too few codes for k-w bit table */
- f -= a + 1; /* deduct codes from patterns left */
- xp = c + k;
- if (j < z)
- while (++j < z) /* try smaller tables up to z bits */
- {
- if ((f <<= 1) <= *++xp)
- break; /* enough codes to use up j bits */
- f -= *xp; /* else deduct codes from patterns */
- }
- }
- z = 1 << j; /* table entries for j-bit table */
-
- /* allocate new table */
- if (*hn + z > MANY) /* (note: doesn't matter for fixed) */
- return Z_MEM_ERROR; /* not enough memory */
- u[h] = q = hp + *hn;
- *hn += z;
-
- /* connect to last table, if there is one */
- if (h)
- {
- x[h] = i; /* save pattern for backing up */
- r.bits = (Byte)l; /* bits to dump before this table */
- r.exop = (Byte)j; /* bits in this table */
- j = i >> (w - l);
- r.base = (uInt)(q - u[h-1] - j); /* offset to this table */
- u[h-1][j] = r; /* connect to last table */
- }
- else
- *t = q; /* first table is returned result */
- }
-
- /* set up table entry in r */
- r.bits = (Byte)(k - w);
- if (p >= v + n)
- r.exop = 128 + 64; /* out of values--invalid code */
- else if (*p < s)
- {
- r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */
- r.base = *p++; /* simple code is just the value */
- }
- else
- {
- r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */
- r.base = d[*p++ - s];
- }
-
- /* fill code-like entries with r */
- f = 1 << (k - w);
- for (j = i >> w; j < z; j += f)
- q[j] = r;
-
- /* backwards increment the k-bit code i */
- for (j = 1 << (k - 1); i & j; j >>= 1)
- i ^= j;
- i ^= j;
-
- /* backup over finished tables */
- mask = (1 << w) - 1; /* needed on HP, cc -O bug */
- while ((i & mask) != x[h])
- {
- h--; /* don't need to update q */
- w -= l;
- mask = (1 << w) - 1;


- }
- }
- }
-
-

- /* Return Z_BUF_ERROR if we were given an incomplete table */
- return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
-}
-
-
-int cramfs_inflate_trees_bits(c, bb, tb, hp, z)
-uIntf *c; /* 19 code lengths */
-uIntf *bb; /* bits tree desired/actual depth */
-inflate_huft * FAR *tb; /* bits tree result */
-inflate_huft *hp; /* space for trees */
-z_streamp z; /* for messages */
-{
- int r;
- uInt hn = 0; /* hufts used in space */
- uIntf *v; /* work area for huft_build */
- static unsigned int work_area[19];
-
- v = work_area;
- r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL,
- tb, bb, hp, &hn, v);


- if (r == Z_DATA_ERROR)

- z->msg = (char*)"oversubscribed dynamic bit lengths tree";
- else if (r == Z_BUF_ERROR || *bb == 0)
- {
- z->msg = (char*)"incomplete dynamic bit lengths tree";


- r = Z_DATA_ERROR;
- }

- return r;
-}
-
-int cramfs_inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z)
-uInt nl; /* number of literal/length codes */
-uInt nd; /* number of distance codes */
-uIntf *c; /* that many (total) code lengths */
-uIntf *bl; /* literal desired/actual bit depth */
-uIntf *bd; /* distance desired/actual bit depth */
-inflate_huft * FAR *tl; /* literal/length tree result */
-inflate_huft * FAR *td; /* distance tree result */
-inflate_huft *hp; /* space for trees */
-z_streamp z; /* for messages */
-{
- int r;
- uInt hn = 0; /* hufts used in space */
- uIntf *v; /* work area for huft_build */
- static unsigned int work_area[288];
-
- /* allocate work area */
- v = work_area;
-
- /* build literal/length tree */
- r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v);
- if (r != Z_OK || *bl == 0)
- {
- if (r == Z_DATA_ERROR)
- z->msg = (char*)"oversubscribed literal/length tree";
- else if (r != Z_MEM_ERROR)
- {
- z->msg = (char*)"incomplete literal/length tree";


- r = Z_DATA_ERROR;
- }

- return r;
- }
-
- /* build distance tree */
- r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v);
- if (r != Z_OK || (*bd == 0 && nl > 257))
- {
- if (r == Z_DATA_ERROR)
- z->msg = (char*)"oversubscribed distance tree";
- else if (r == Z_BUF_ERROR) {
-#ifdef PKZIP_BUG_WORKAROUND


- r = Z_OK;
- }

-#else
- z->msg = (char*)"incomplete distance tree";


- r = Z_DATA_ERROR;
- }

- else if (r != Z_MEM_ERROR)
- {
- z->msg = (char*)"empty distance tree with lengths";


- r = Z_DATA_ERROR;
- }

- return r;
-#endif
- }
-
- /* done */


- return Z_OK;
-}
-
-

-/* build fixed tables only once--keep them here */
-#include "inffixed.h"
-
-
-int cramfs_inflate_trees_fixed(bl, bd, tl, td, z)
-uIntf *bl; /* literal desired/actual bit depth */
-uIntf *bd; /* distance desired/actual bit depth */
-inflate_huft * FAR *tl; /* literal/length tree result */
-inflate_huft * FAR *td; /* distance tree result */
-z_streamp z; /* for memory allocation */
-{
- *bl = fixed_bl;
- *bd = fixed_bd;
- *tl = fixed_tl;
- *td = fixed_td;
- return Z_OK;
-}
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/inftrees.h linux/fs/cramfs/inflate/inftrees.h
--- v2.4.13/linux/fs/cramfs/inflate/inftrees.h Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/inftrees.h Wed Dec 31 16:00:00 1969
@@ -1,58 +0,0 @@
-/* inftrees.h -- header to use inftrees.c


- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-

-/* Huffman code lookup table entry--this entry is four bytes for machines
- that have 16-bit pointers (e.g. PC's in the small or medium model). */
-
-typedef struct inflate_huft_s FAR inflate_huft;
-
-struct inflate_huft_s {
- union {
- struct {
- Byte Exop; /* number of extra bits or operation */
- Byte Bits; /* number of bits in this code or subcode */
- } what;
- uInt pad; /* pad structure to a power of 2 (4 bytes for */
- } word; /* 16-bit, 8 bytes for 32-bit int's) */
- uInt base; /* literal, length base, distance base,
- or table offset */
-};
-
-/* Maximum size of dynamic tree. The maximum found in a long but non-
- exhaustive search was 1004 huft structures (850 for length/literals
- and 154 for distances, the latter actually the result of an
- exhaustive search). The actual maximum is not known, but the
- value below is more than safe. */
-#define MANY 1440
-
-extern int cramfs_inflate_trees_bits OF((
- uIntf *, /* 19 code lengths */
- uIntf *, /* bits tree desired/actual depth */
- inflate_huft * FAR *, /* bits tree result */
- inflate_huft *, /* space for trees */
- z_streamp)); /* for messages */
-
-extern int cramfs_inflate_trees_dynamic OF((
- uInt, /* number of literal/length codes */
- uInt, /* number of distance codes */
- uIntf *, /* that many (total) code lengths */
- uIntf *, /* literal desired/actual bit depth */
- uIntf *, /* distance desired/actual bit depth */
- inflate_huft * FAR *, /* literal/length tree result */
- inflate_huft * FAR *, /* distance tree result */
- inflate_huft *, /* space for trees */
- z_streamp)); /* for messages */
-
-extern int cramfs_inflate_trees_fixed OF((
- uIntf *, /* literal desired/actual bit depth */
- uIntf *, /* distance desired/actual bit depth */
- inflate_huft * FAR *, /* literal/length tree result */
- inflate_huft * FAR *, /* distance tree result */
- z_streamp)); /* for memory allocation */
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/infutil.c linux/fs/cramfs/inflate/infutil.c
--- v2.4.13/linux/fs/cramfs/inflate/infutil.c Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/infutil.c Wed Dec 31 16:00:00 1969
@@ -1,87 +0,0 @@
-/* inflate_util.c -- data and routines common to blocks and codes


- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "infblock.h"
-#include "inftrees.h"
-#include "infcodes.h"
-#include "infutil.h"
-
-struct inflate_codes_state {int dummy;}; /* for buggy compilers */
-

-/* And'ing with mask[n] masks the lower n bits */
-uInt cramfs_inflate_mask[17] = {
- 0x0000,
- 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
- 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
-};
-
-
-/* copy as much as possible from the sliding window to the output area */
-int cramfs_inflate_flush(s, z, r)


-inflate_blocks_statef *s;
-z_streamp z;
-int r;
-{

- uInt n;
- Bytef *p;
- Bytef *q;
-
- /* local copies of source and destination pointers */
- p = z->next_out;
- q = s->read;
-
- /* compute number of bytes to copy as far as end of window */
- n = (uInt)((q <= s->write ? s->write : s->end) - q);
- if (n > z->avail_out) n = z->avail_out;
- if (n && r == Z_BUF_ERROR) r = Z_OK;
-
- /* update counters */
- z->avail_out -= n;
- z->total_out += n;
-
- /* update check information */


- if (s->checkfn != Z_NULL)

- z->adler = s->check = (*s->checkfn)(s->check, q, n);
-
- /* copy as far as end of window */
- memcpy(p, q, n);
- p += n;
- q += n;
-
- /* see if more to copy at beginning of window */
- if (q == s->end)
- {
- /* wrap pointers */
- q = s->window;
- if (s->write == s->end)
- s->write = s->window;
-
- /* compute bytes to copy */
- n = (uInt)(s->write - q);
- if (n > z->avail_out) n = z->avail_out;
- if (n && r == Z_BUF_ERROR) r = Z_OK;
-
- /* update counters */
- z->avail_out -= n;
- z->total_out += n;
-
- /* update check information */


- if (s->checkfn != Z_NULL)

- z->adler = s->check = (*s->checkfn)(s->check, q, n);
-
- /* copy */
- memcpy(p, q, n);
- p += n;
- q += n;
- }
-
- /* update pointers */
- z->next_out = p;
- s->read = q;
-
- /* done */
- return r;
-}
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/infutil.h linux/fs/cramfs/inflate/infutil.h
--- v2.4.13/linux/fs/cramfs/inflate/infutil.h Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/infutil.h Wed Dec 31 16:00:00 1969
@@ -1,98 +0,0 @@
-/* infutil.h -- types and macros common to blocks and codes


- * Copyright (C) 1995-1998 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-

-#ifndef _INFUTIL_H
-#define _INFUTIL_H
-
-typedef enum {
- TYPE, /* get type bits (3, including end bit) */
- LENS, /* get lengths for stored */
- STORED, /* processing stored block */
- TABLE, /* get table lengths */
- BTREE, /* get bit lengths tree for a dynamic block */
- DTREE, /* get length, distance trees for a dynamic block */
- CODES, /* processing fixed or dynamic block */
- DRY, /* output remaining window bytes */
- DONE, /* finished last block, done */
- BAD} /* got a data error--stuck here */
-inflate_block_mode;
-
-/* inflate blocks semi-private state */
-struct inflate_blocks_state {


-
- /* mode */

- inflate_block_mode mode; /* current inflate_block mode */


-
- /* mode dependent information */
- union {

- uInt left; /* if STORED, bytes left to copy */
- struct {
- uInt table; /* table lengths (14 bits) */
- uInt index; /* index into blens (or border) */
- uIntf *blens; /* bit lengths of codes */
- uInt bb; /* bit length tree depth */
- inflate_huft *tb; /* bit length decoding tree */
- } trees; /* if DTREE, decoding info for trees */
- struct {
- inflate_codes_statef
- *codes;
- } decode; /* if CODES, current state */


- } sub; /* submode */

- uInt last; /* true if this block is the last block */


-
- /* mode independent information */

- uInt bitk; /* bits in bit buffer */
- uLong bitb; /* bit buffer */
- inflate_huft *hufts; /* single malloc for tree space */
- Bytef *window; /* sliding window */
- Bytef *end; /* one byte after sliding window */
- Bytef *read; /* window read pointer */
- Bytef *write; /* window write pointer */
- check_func checkfn; /* check function */
- uLong check; /* check on output */
-
-};
-
-
-/* defines for inflate input/output */
-/* update pointers and return */
-#define UPDBITS {s->bitb=b;s->bitk=k;}
-#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
-#define UPDOUT {s->write=q;}
-#define UPDATE {UPDBITS UPDIN UPDOUT}
-#define LEAVE {UPDATE return cramfs_inflate_flush(s,z,r);}
-/* get bytes and bits */
-#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
-#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
-#define NEXTBYTE (n--,*p++)
-#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
-#define DUMPBITS(j) {b>>=(j);k-=(j);}
-/* output bytes */
-#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q)
-#define LOADOUT {q=s->write;m=(uInt)WAVAIL;}
-#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
-#define FLUSH {UPDOUT r=cramfs_inflate_flush(s,z,r); LOADOUT}
-#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
-#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
-/* load local pointers */
-#define LOAD {LOADIN LOADOUT}
-
-/* masks for lower bits (size given to avoid silly warnings with Visual C++) */
-extern uInt cramfs_inflate_mask[17];
-
-/* copy as much as possible from the sliding window to the output area */
-extern int cramfs_inflate_flush OF((


- inflate_blocks_statef *,
- z_streamp ,
- int));
-

-struct internal_state {int dummy;}; /* for buggy compilers */
-
-#endif
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/uncompr.c linux/fs/cramfs/inflate/uncompr.c
--- v2.4.13/linux/fs/cramfs/inflate/uncompr.c Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/uncompr.c Wed Dec 31 16:00:00 1969
@@ -1,55 +0,0 @@
-/* uncompr.c -- decompress a memory buffer
- * Copyright (C) 1995-1998 Jean-loup Gailly.


- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#include "zlib.h"
-

-/* ===========================================================================


- Decompresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be large enough to hold the
- entire uncompressed data. (The size of the uncompressed data must have
- been saved previously by the compressor and transmitted to the decompressor
- by some mechanism outside the scope of this compression library.)
- Upon exit, destLen is the actual size of the compressed buffer.
- This function can be used to decompress a whole file at once if the
- input file is mmap'ed.
-
- uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer, or Z_DATA_ERROR if the input data was corrupted.
-*/

-int ZEXPORT uncompress (dest, destLen, source, sourceLen)
- Bytef *dest;
- uLongf *destLen;
- const Bytef *source;
- uLong sourceLen;
-{
- z_stream stream;
- int err;
-
- stream.next_in = (Bytef*)source;
- stream.avail_in = (uInt)sourceLen;
- /* Check for source > 64K on 16-bit machine: */
- if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
-
- stream.next_out = dest;
- stream.avail_out = (uInt)*destLen;
- if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
-
- err = cramfs_inflateInit(&stream);
- if (err != Z_OK) return err;
-


- err = cramfs_inflate(&stream, Z_FINISH);

- if (err != Z_STREAM_END) {
- cramfs_inflateEnd(&stream);
- return err == Z_OK ? Z_BUF_ERROR : err;
- }
- *destLen = stream.total_out;
-
- err = cramfs_inflateEnd(&stream);
- return err;
-}
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/zconf.h linux/fs/cramfs/inflate/zconf.h
--- v2.4.13/linux/fs/cramfs/inflate/zconf.h Wed Feb 9 18:48:03 2000
+++ linux/fs/cramfs/inflate/zconf.h Wed Dec 31 16:00:00 1969
@@ -1,90 +0,0 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-1998 Jean-loup Gailly.


- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-

-#ifndef _ZCONF_H
-#define _ZCONF_H
-
-#if defined(__GNUC__) || defined(__386__) || defined(i386)
-# ifndef __32BIT__
-# define __32BIT__
-# endif
-#endif
-
-#if defined(__STDC__) || defined(__cplusplus)
-# ifndef STDC
-# define STDC
-# endif
-#endif
-
-/* The memory requirements for deflate are (in bytes):
- (1 << (windowBits+2)) + (1 << (memLevel+9))
- that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
- make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
- The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-# define MAX_MEM_LEVEL 9
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-# define MAX_WBITS 15 /* 32K LZ77 window */
-#endif
-
- /* Type declarations */
-
-#ifndef OF /* function prototypes */
-# ifdef STDC
-# define OF(args) args
-# else
-# define OF(args) ()
-# endif
-#endif
-
-#ifndef ZEXPORT
-# define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-# define ZEXPORTVA
-#endif
-#ifndef ZEXTERN
-# define ZEXTERN extern
-#endif
-#ifndef FAR
-# define FAR
-#endif
-
-typedef unsigned char Byte; /* 8 bits */
-typedef unsigned int uInt; /* 16 bits or more */
-typedef unsigned long uLong; /* 32 bits or more */
-
-typedef Byte FAR Bytef;
-typedef char FAR charf;
-typedef int FAR intf;
-typedef uInt FAR uIntf;
-typedef uLong FAR uLongf;
-
-typedef void FAR *voidpf;
-typedef void *voidp;
-
-#include <linux/types.h> /* for off_t */
-#include <linux/unistd.h> /* for SEEK_* and off_t */
-#define z_off_t off_t
-
-#endif /* _ZCONF_H */
diff -u --recursive --new-file v2.4.13/linux/fs/cramfs/inflate/zlib.h linux/fs/cramfs/inflate/zlib.h
--- v2.4.13/linux/fs/cramfs/inflate/zlib.h Wed Apr 12 09:47:29 2000
+++ linux/fs/cramfs/inflate/zlib.h Wed Dec 31 16:00:00 1969
@@ -1,893 +0,0 @@
-/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.1.3, July 9th, 1998
-
- Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly Mark Adler
- jl...@gzip.org mad...@alumni.caltech.edu
-
-
- The data format used by the zlib library is described by RFCs (Request for
- Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
- (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
-*/
-
-#ifndef _ZLIB_H
-#define _ZLIB_H
-
-#include "zconf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ZLIB_VERSION "1.1.3"
-
-/*
- The 'zlib' compression library provides in-memory compression and
- decompression functions, including integrity checks of the uncompressed
- data. This version of the library supports only one compression method
- (deflation) but other algorithms will be added later and will have the same
- stream interface.
-
- Compression can be done in a single step if the buffers are large
- enough (for example if an input file is mmap'ed), or can be done by
- repeated calls of the compression function. In the latter case, the
- application must provide more input and/or consume the output
- (providing more output space) before each call.
-
- The library also supports reading and writing files in gzip (.gz) format
- with an interface similar to that of stdio.
-
- The library does not install any signal handler. The decoder checks
- the consistency of the compressed data, so the library should never
- crash even in case of corrupted input.
-*/
-
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void (*free_func) OF((voidpf opaque, voidpf address));
-
-struct internal_state;
-
-typedef struct z_stream_s {
- Bytef *next_in; /* next input byte */
- uInt avail_in; /* number of bytes available at next_in */
- uLong total_in; /* total nb of input bytes read so far */
-
- Bytef *next_out; /* next output byte should be put there */
- uInt avail_out; /* remaining free space at next_out */
- uLong total_out; /* total nb of bytes output so far */
-
- char *msg; /* last error message, NULL if no error */
- struct internal_state FAR *state; /* not visible by applications */
-
- alloc_func nozalloc; /* used to allocate the internal state */
- free_func nozfree; /* used to free the internal state */
- voidpf opaque; /* private data object passed to zalloc and zfree */
-
- int data_type; /* best guess about the data type: ascii or binary */
- uLong adler; /* adler32 value of the uncompressed data */
- uLong reserved; /* reserved for future use */
-} z_stream;
-
-typedef z_stream FAR *z_streamp;
-
-/*
- The application must update next_in and avail_in when avail_in has
- dropped to zero. It must update next_out and avail_out when avail_out
- has dropped to zero. The application must initialize zalloc, zfree and
- opaque before calling the init function. All other fields are set by the
- compression library and must not be updated by the application.
-
- The opaque value provided by the application will be passed as the first
- parameter for calls of zalloc and zfree. This can be useful for custom
- memory management. The compression library attaches no meaning to the
- opaque value.
-
- zalloc must return Z_NULL if there is not enough memory for the object.
- If zlib is used in a multi-threaded application, zalloc and zfree must be
- thread safe.
-
- On 16-bit systems, the functions zalloc and zfree must be able to allocate
- exactly 65536 bytes, but will not be required to allocate more than this
- if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
- pointers returned by zalloc for objects of exactly 65536 bytes *must*
- have their offset normalized to zero. The default allocation function
- provided by this library ensures this (see zutil.c). To reduce memory
- requirements and avoid any allocation of 64K objects, at the expense of
- compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
-
- The fields total_in and total_out can be used for statistics or
- progress reports. After compression, total_in holds the total size of
- the uncompressed data and may be saved for use in the decompressor
- (particularly if the decompressor wants to decompress everything in
- a single step).
-*/
-
- /* constants */
-
-#define Z_NO_FLUSH 0
-#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
-#define Z_SYNC_FLUSH 2
-#define Z_FULL_FLUSH 3
-#define Z_FINISH 4
-/* Allowed flush values; see deflate() below for details */
-
-#define Z_OK 0
-#define Z_STREAM_END 1
-#define Z_NEED_DICT 2
-#define Z_ERRNO (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR (-3)
-#define Z_MEM_ERROR (-4)
-#define Z_BUF_ERROR (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative
- * values are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION 0
-#define Z_BEST_SPEED 1
-#define Z_BEST_COMPRESSION 9
-#define Z_DEFAULT_COMPRESSION (-1)
-/* compression levels */
-
-#define Z_FILTERED 1
-#define Z_HUFFMAN_ONLY 2
-#define Z_DEFAULT_STRATEGY 0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY 0
-#define Z_ASCII 1
-#define Z_UNKNOWN 2
-/* Possible values of the data_type field */
-
-#define Z_DEFLATED 8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
-
-#define zlib_version zlibVersion()
-/* for compatibility with versions < 1.0.2 */
-
- /* basic functions */
-
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
-/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
- If the first character differs, the library code actually used is
- not compatible with the zlib.h header file used by the application.
- This check is automatically made by deflateInit and inflateInit.
- */
-
-/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
-
- Initializes the internal stream state for compression. The fields
- zalloc, zfree and opaque must be initialized before by the caller.
- If zalloc and zfree are set to Z_NULL, deflateInit updates them to
- use default allocation functions.
-
- The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
- 1 gives best speed, 9 gives best compression, 0 gives no compression at
- all (the input data is simply copied a block at a time).
- Z_DEFAULT_COMPRESSION requests a default compromise between speed and
- compression (currently equivalent to level 6).
-
- deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if level is not a valid compression level,
- Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
- with the version assumed by the caller (ZLIB_VERSION).
- msg is set to null if there is no error message. deflateInit does not
- perform any compression: this will be done by deflate().
-*/
-
-
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
-/*
- deflate compresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce some
- output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. deflate performs one or both of the
- following actions:
-
- - Compress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in and avail_in are updated and
- processing will resume at this point for the next call of deflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. This action is forced if the parameter flush is non zero.
- Forcing flush frequently degrades the compression ratio, so this parameter
- should be set only when necessary (in interactive applications).
- Some output may be provided even if flush is not set.
-
- Before the call of deflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating avail_in or avail_out accordingly; avail_out
- should never be zero before the call. The application can consume the
- compressed output when it wants, for example when the output buffer is full
- (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
- and with zero avail_out, it must be called again after making room in the
- output buffer because there might be more output pending.
-
- If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
- flushed to the output buffer and the output is aligned on a byte boundary, so
- that the decompressor can get all input data available so far. (In particular
- avail_in is zero after the call if enough output space has been provided
- before the call.) Flushing may degrade compression for some compression
- algorithms and so it should be used only when necessary.
-
- If flush is set to Z_FULL_FLUSH, all output is flushed as with
- Z_SYNC_FLUSH, and the compression state is reset so that decompression can
- restart from this point if previous compressed data has been damaged or if
- random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
- the compression.
-
- If deflate returns with avail_out == 0, this function must be called again
- with the same value of the flush parameter and more output space (updated
- avail_out), until the flush is complete (deflate returns with non-zero
- avail_out).
-
- If the parameter flush is set to Z_FINISH, pending input is processed,
- pending output is flushed and deflate returns with Z_STREAM_END if there
- was enough output space; if deflate returns with Z_OK, this function must be
- called again with Z_FINISH and more output space (updated avail_out) but no
- more input data, until it returns with Z_STREAM_END or an error. After
- deflate has returned Z_STREAM_END, the only possible operations on the
- stream are deflateReset or deflateEnd.
-
- Z_FINISH can be used immediately after deflateInit if all the compression
- is to be done in a single step. In this case, avail_out must be at least
- 0.1% larger than avail_in plus 12 bytes. If deflate does not return
- Z_STREAM_END, then it must be called again as described above.
-
- deflate() sets strm->adler to the adler32 checksum of all input read
- so far (that is, total_in bytes).
-
- deflate() may update data_type if it can make a good guess about
- the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
- binary. This field is only for information purposes and does not affect
- the compression algorithm in any manner.
-
- deflate() returns Z_OK if some progress has been made (more input
- processed or more output produced), Z_STREAM_END if all input has been
- consumed and all output has been produced (only when flush is set to
- Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
- if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
- (for example avail_in or avail_out was zero).
-*/
-
-
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
-
- deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
- stream state was inconsistent, Z_DATA_ERROR if the stream was freed
- prematurely (some input or output was discarded). In the error case,
- msg may be set but then points to a static string (which must not be
- deallocated).
-*/
-
-
-/*
-ZEXTERN int ZEXPORT cramfs_inflateInit OF((z_streamp strm));
-
- Initializes the internal stream state for decompression. The fields
- next_in, avail_in, zalloc, zfree and opaque must be initialized before by
- the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
- value depends on the compression method), inflateInit determines the
- compression method from the zlib header and allocates all data structures
- accordingly; otherwise the allocation will be deferred to the first call of
- inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
- use default allocation functions.
-
- inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller. msg is set to null if there is no error
- message. inflateInit does not perform any decompression apart from reading
- the zlib header if present: this will be done by inflate(). (So next_in and
- avail_in may be modified, but next_out and avail_out are unchanged.)
-*/
-
-
-ZEXTERN int ZEXPORT cramfs_inflate OF((z_streamp strm, int flush));
-/*
- inflate decompresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may some
- introduce some output latency (reading input without producing any output)
- except when forced to flush.
-
- The detailed semantics are as follows. inflate performs one or both of the
- following actions:
-
- - Decompress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in is updated and processing
- will resume at this point for the next call of inflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. inflate() provides as much output as possible, until there
- is no more input data or no more space in the output buffer (see below
- about the flush parameter).
-
- Before the call of inflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating the next_* and avail_* values accordingly.
- The application can consume the uncompressed output when it wants, for
- example when the output buffer is full (avail_out == 0), or after each
- call of inflate(). If inflate returns Z_OK and with zero avail_out, it
- must be called again after making room in the output buffer because there
- might be more output pending.
-
- If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
- output as possible to the output buffer. The flushing behavior of inflate is
- not specified for values of the flush parameter other than Z_SYNC_FLUSH
- and Z_FINISH, but the current implementation actually flushes as much output
- as possible anyway.
-
- inflate() should normally be called until it returns Z_STREAM_END or an
- error. However if all decompression is to be performed in a single step
- (a single call of inflate), the parameter flush should be set to
- Z_FINISH. In this case all pending input is processed and all pending
- output is flushed; avail_out must be large enough to hold all the
- uncompressed data. (The size of the uncompressed data may have been saved
- by the compressor for this purpose.) The next operation on this stream must
- be inflateEnd to deallocate the decompression state. The use of Z_FINISH
- is never required, but can be used to inform inflate that a faster routine
- may be used for the single inflate() call.
-
- If a preset dictionary is needed at this point (see inflateSetDictionary
- below), inflate sets strm-adler to the adler32 checksum of the
- dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
- it sets strm->adler to the adler32 checksum of all output produced
- so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
- an error code as described below. At the end of the stream, inflate()
- checks that its computed adler32 checksum is equal to that saved by the
- compressor and returns Z_STREAM_END only if the checksum is correct.
-
- inflate() returns Z_OK if some progress has been made (more input processed
- or more output produced), Z_STREAM_END if the end of the compressed data has
- been reached and all uncompressed output has been produced, Z_NEED_DICT if a
- preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
- corrupted (input stream not conforming to the zlib format or incorrect
- adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
- (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if no progress is possible or if there was not
- enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
- case, the application may then call inflateSync to look for a good
- compression block.
-*/
-
-
-ZEXTERN int ZEXPORT cramfs_inflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
-
- inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
- was inconsistent. In the error case, msg may be set but then points to a
- static string (which must not be deallocated).
-*/
-
- /* Advanced functions */
-
-/*
- The following functions are needed only in some special applications.
-*/
-
-/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
- int level,
- int method,
- int windowBits,
- int memLevel,
- int strategy));
-
- This is another version of deflateInit with more compression options. The
- fields next_in, zalloc, zfree and opaque must be initialized before by
- the caller.
-
- The method parameter is the compression method. It must be Z_DEFLATED in
- this version of the library.
-
- The windowBits parameter is the base two logarithm of the window size
- (the size of the history buffer). It should be in the range 8..15 for this
- version of the library. Larger values of this parameter result in better
- compression at the expense of memory usage. The default value is 15 if
- deflateInit is used instead.
-
- The memLevel parameter specifies how much memory should be allocated
- for the internal compression state. memLevel=1 uses minimum memory but
- is slow and reduces compression ratio; memLevel=9 uses maximum memory
- for optimal speed. The default value is 8. See zconf.h for total memory
- usage as a function of windowBits and memLevel.
-
- The strategy parameter is used to tune the compression algorithm. Use the
- value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
- filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
- string match). Filtered data consists mostly of small values with a
- somewhat random distribution. In this case, the compression algorithm is
- tuned to compress them better. The effect of Z_FILTERED is to force more
- Huffman coding and less string matching; it is somewhat intermediate
- between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
- the compression ratio but not the correctness of the compressed output even
- if it is not set appropriately.
-
- deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
- method). msg is set to null if there is no error message. deflateInit2 does
- not perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the compression dictionary from the given byte sequence
- without producing any compressed output. This function must be called
- immediately after deflateInit, deflateInit2 or deflateReset, before any
- call of deflate. The compressor and decompressor must use exactly the same
- dictionary (see inflateSetDictionary).
-
- The dictionary should consist of strings (byte sequences) that are likely
- to be encountered later in the data to be compressed, with the most commonly
- used strings preferably put towards the end of the dictionary. Using a
- dictionary is most useful when the data to be compressed is short and can be
- predicted with good accuracy; the data can then be compressed better than
- with the default empty dictionary.
-
- Depending on the size of the compression data structures selected by
- deflateInit or deflateInit2, a part of the dictionary may in effect be
- discarded, for example if the dictionary is larger than the window size in
- deflate or deflate2. Thus the strings most likely to be useful should be
- put at the end of the dictionary, not at the front.
-
- Upon return of this function, strm->adler is set to the Adler32 value
- of the dictionary; the decompressor may later use this value to determine
- which dictionary has been used by the compressor. (The Adler32 value
- applies to the whole dictionary even if only a subset of the dictionary is
- actually used by the compressor.)
-
- deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
- inconsistent (for example if deflate has already been called for this stream
- or if the compression method is bsort). deflateSetDictionary does not
- perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when several compression strategies will be
- tried, for example when there are several ways of pre-processing the input
- data with a filter. The streams that will be discarded should then be freed
- by calling deflateEnd. Note that deflateCopy duplicates the internal
- compression state which can be quite large, so this strategy is slow and
- can consume lots of memory.
-
- deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
-/*
- This function is equivalent to deflateEnd followed by deflateInit,
- but does not free and reallocate all the internal compression state.
- The stream will keep the same compression level and any other attributes
- that may have been set by deflateInit2.
-
- deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source


- stream state was inconsistent (such as zalloc or state being NULL).
-*/
-

-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
- int level,
- int strategy));
-/*
- Dynamically update the compression level and compression strategy. The
- interpretation of level and strategy is as in deflateInit2. This can be
- used to switch between compression and straight copy of the input data, or
- to switch to a different kind of input data requiring a different
- strategy. If the compression level is changed, the input available so far
- is compressed with the old level (and may be flushed); the new level will
- take effect only at the next call of deflate().
-
- Before the call of deflateParams, the stream state must be set as for
- a call of deflate(), since the currently available input may have to
- be compressed and flushed. In particular, strm->avail_out must be non-zero.
-
- deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
- stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
- if strm->avail_out was zero.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
- int windowBits));
-
- This is another version of inflateInit with an extra parameter. The
- fields next_in, avail_in, zalloc, zfree and opaque must be initialized
- before by the caller.
-
- The windowBits parameter is the base two logarithm of the maximum window
- size (the size of the history buffer). It should be in the range 8..15 for
- this version of the library. The default value is 15 if inflateInit is used
- instead. If a compressed stream with a larger window size is given as
- input, inflate() will return with the error code Z_DATA_ERROR instead of
- trying to allocate a larger window.
-
- inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
- memLevel). msg is set to null if there is no error message. inflateInit2
- does not perform any decompression apart from reading the zlib header if
- present: this will be done by inflate(). (So next_in and avail_in may be
- modified, but next_out and avail_out are unchanged.)
-*/
-
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the decompression dictionary from the given uncompressed byte
- sequence. This function must be called immediately after a call of inflate
- if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
- can be determined from the Adler32 value returned by this call of
- inflate. The compressor and decompressor must use exactly the same
- dictionary (see deflateSetDictionary).
-
- inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
- inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
- expected one (incorrect Adler32 value). inflateSetDictionary does not
- perform any decompression: this will be done by subsequent calls of
- inflate().
-*/
-
-ZEXTERN int ZEXPORT cramfs_inflateSync OF((z_streamp strm));
-/*

SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 43'
echo 'File patch-2.4.14 is continued in part 44'
echo "44" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:11 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part48

#!/bin/sh -x
# this is part 48 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 48; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

- /* reg. end-point 0 */ \
- (*((volatile Word *) io_p2v (_Ser0UDCCS0)))
-#define Ser0UDCCS1 /* Ser. port 0 UDC Control/Status */ \
- /* reg. end-point 1 (output) */ \
- (*((volatile Word *) io_p2v (_Ser0UDCCS1)))
-#define Ser0UDCCS2 /* Ser. port 0 UDC Control/Status */ \
- /* reg. end-point 2 (input) */ \
- (*((volatile Word *) io_p2v (_Ser0UDCCS2)))
-#define Ser0UDCD0 /* Ser. port 0 UDC Data reg. */ \
- /* end-point 0 */ \
- (*((volatile Word *) io_p2v (_Ser0UDCD0)))
-#define Ser0UDCWC /* Ser. port 0 UDC Write Count */ \
- /* reg. end-point 0 */ \
- (*((volatile Word *) io_p2v (_Ser0UDCWC)))
-#define Ser0UDCDR /* Ser. port 0 UDC Data Reg. */ \
- (*((volatile Word *) io_p2v (_Ser0UDCDR)))
-#define Ser0UDCSR /* Ser. port 0 UDC Status Reg. */ \
- (*((volatile Word *) io_p2v (_Ser0UDCSR)))
-#endif /* LANGUAGE == C */
+#define Ser0UDCCR __REG(0x80000000) /* Ser. port 0 UDC Control Reg. */
+#define Ser0UDCAR __REG(0x80000004) /* Ser. port 0 UDC Address Reg. */
+#define Ser0UDCOMP __REG(0x80000008) /* Ser. port 0 UDC Output Maximum Packet size reg. */
+#define Ser0UDCIMP __REG(0x8000000C) /* Ser. port 0 UDC Input Maximum Packet size reg. */
+#define Ser0UDCCS0 __REG(0x80000010) /* Ser. port 0 UDC Control/Status reg. end-point 0 */
+#define Ser0UDCCS1 __REG(0x80000014) /* Ser. port 0 UDC Control/Status reg. end-point 1 (output) */
+#define Ser0UDCCS2 __REG(0x80000018) /* Ser. port 0 UDC Control/Status reg. end-point 2 (input) */
+#define Ser0UDCD0 __REG(0x8000001C) /* Ser. port 0 UDC Data reg. end-point 0 */
+#define Ser0UDCWC __REG(0x80000020) /* Ser. port 0 UDC Write Count reg. end-point 0 */
+#define Ser0UDCDR __REG(0x80000028) /* Ser. port 0 UDC Data Reg. */
+#define Ser0UDCSR __REG(0x80000030) /* Ser. port 0 UDC Status Reg. */
X
X #define UDCCR_UDD 0x00000001 /* UDC Disable */
X #define UDCCR_UDA 0x00000002 /* UDC Active (read) */
@@ -413,51 +253,46 @@
X * fua, Tua Frequency, period of the UART communication.
X */
X
-#define _UTCR0(Nb) /* UART Control Reg. 0 [1..3] */ \
- (0x80010000 + ((Nb) - 1)*0x00020000)
-#define _UTCR1(Nb) /* UART Control Reg. 1 [1..3] */ \
- (0x80010004 + ((Nb) - 1)*0x00020000)
-#define _UTCR2(Nb) /* UART Control Reg. 2 [1..3] */ \
- (0x80010008 + ((Nb) - 1)*0x00020000)
-#define _UTCR3(Nb) /* UART Control Reg. 3 [1..3] */ \
- (0x8001000C + ((Nb) - 1)*0x00020000)
-#define _UTCR4(Nb) /* UART Control Reg. 4 [2] */ \
- (0x80010010 + ((Nb) - 1)*0x00020000)
-#define _UTDR(Nb) /* UART Data Reg. [1..3] */ \
- (0x80010014 + ((Nb) - 1)*0x00020000)
-#define _UTSR0(Nb) /* UART Status Reg. 0 [1..3] */ \
- (0x8001001C + ((Nb) - 1)*0x00020000)
-#define _UTSR1(Nb) /* UART Status Reg. 1 [1..3] */ \
- (0x80010020 + ((Nb) - 1)*0x00020000)
-
-#define _Ser1UTCR0 _UTCR0 (1) /* Ser. port 1 UART Control Reg. 0 */
-#define _Ser1UTCR1 _UTCR1 (1) /* Ser. port 1 UART Control Reg. 1 */
-#define _Ser1UTCR2 _UTCR2 (1) /* Ser. port 1 UART Control Reg. 2 */
-#define _Ser1UTCR3 _UTCR3 (1) /* Ser. port 1 UART Control Reg. 3 */
-#define _Ser1UTDR _UTDR (1) /* Ser. port 1 UART Data Reg. */
-#define _Ser1UTSR0 _UTSR0 (1) /* Ser. port 1 UART Status Reg. 0 */
-#define _Ser1UTSR1 _UTSR1 (1) /* Ser. port 1 UART Status Reg. 1 */
-
-#define _Ser2UTCR0 _UTCR0 (2) /* Ser. port 2 UART Control Reg. 0 */
-#define _Ser2UTCR1 _UTCR1 (2) /* Ser. port 2 UART Control Reg. 1 */
-#define _Ser2UTCR2 _UTCR2 (2) /* Ser. port 2 UART Control Reg. 2 */
-#define _Ser2UTCR3 _UTCR3 (2) /* Ser. port 2 UART Control Reg. 3 */
-#define _Ser2UTCR4 _UTCR4 (2) /* Ser. port 2 UART Control Reg. 4 */
-#define _Ser2UTDR _UTDR (2) /* Ser. port 2 UART Data Reg. */
-#define _Ser2UTSR0 _UTSR0 (2) /* Ser. port 2 UART Status Reg. 0 */
-#define _Ser2UTSR1 _UTSR1 (2) /* Ser. port 2 UART Status Reg. 1 */
-
-#define _Ser3UTCR0 _UTCR0 (3) /* Ser. port 3 UART Control Reg. 0 */
-#define _Ser3UTCR1 _UTCR1 (3) /* Ser. port 3 UART Control Reg. 1 */
-#define _Ser3UTCR2 _UTCR2 (3) /* Ser. port 3 UART Control Reg. 2 */
-#define _Ser3UTCR3 _UTCR3 (3) /* Ser. port 3 UART Control Reg. 3 */
-#define _Ser3UTDR _UTDR (3) /* Ser. port 3 UART Data Reg. */
-#define _Ser3UTSR0 _UTSR0 (3) /* Ser. port 3 UART Status Reg. 0 */
-#define _Ser3UTSR1 _UTSR1 (3) /* Ser. port 3 UART Status Reg. 1 */
+#define _UTCR0(Nb) __REG(0x80010000 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 0 [1..3] */
+#define _UTCR1(Nb) __REG(0x80010004 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 1 [1..3] */
+#define _UTCR2(Nb) __REG(0x80010008 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 2 [1..3] */
+#define _UTCR3(Nb) __REG(0x8001000C + ((Nb) - 1)*0x00020000) /* UART Control Reg. 3 [1..3] */
+#define _UTCR4(Nb) __REG(0x80010010 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 4 [2] */
+#define _UTDR(Nb) __REG(0x80010014 + ((Nb) - 1)*0x00020000) /* UART Data Reg. [1..3] */
+#define _UTSR0(Nb) __REG(0x8001001C + ((Nb) - 1)*0x00020000) /* UART Status Reg. 0 [1..3] */
+#define _UTSR1(Nb) __REG(0x80010020 + ((Nb) - 1)*0x00020000) /* UART Status Reg. 1 [1..3] */
+
+#define Ser1UTCR0 _UTCR0 (1) /* Ser. port 1 UART Control Reg. 0 */
+#define Ser1UTCR1 _UTCR1 (1) /* Ser. port 1 UART Control Reg. 1 */
+#define Ser1UTCR2 _UTCR2 (1) /* Ser. port 1 UART Control Reg. 2 */
+#define Ser1UTCR3 _UTCR3 (1) /* Ser. port 1 UART Control Reg. 3 */
+#define Ser1UTDR _UTDR (1) /* Ser. port 1 UART Data Reg. */
+#define Ser1UTSR0 _UTSR0 (1) /* Ser. port 1 UART Status Reg. 0 */
+#define Ser1UTSR1 _UTSR1 (1) /* Ser. port 1 UART Status Reg. 1 */
+
+#define Ser2UTCR0 _UTCR0 (2) /* Ser. port 2 UART Control Reg. 0 */
+#define Ser2UTCR1 _UTCR1 (2) /* Ser. port 2 UART Control Reg. 1 */
+#define Ser2UTCR2 _UTCR2 (2) /* Ser. port 2 UART Control Reg. 2 */
+#define Ser2UTCR3 _UTCR3 (2) /* Ser. port 2 UART Control Reg. 3 */
+#define Ser2UTCR4 _UTCR4 (2) /* Ser. port 2 UART Control Reg. 4 */
+#define Ser2UTDR _UTDR (2) /* Ser. port 2 UART Data Reg. */
+#define Ser2UTSR0 _UTSR0 (2) /* Ser. port 2 UART Status Reg. 0 */
+#define Ser2UTSR1 _UTSR1 (2) /* Ser. port 2 UART Status Reg. 1 */
+
+#define Ser3UTCR0 _UTCR0 (3) /* Ser. port 3 UART Control Reg. 0 */
+#define Ser3UTCR1 _UTCR1 (3) /* Ser. port 3 UART Control Reg. 1 */
+#define Ser3UTCR2 _UTCR2 (3) /* Ser. port 3 UART Control Reg. 2 */
+#define Ser3UTCR3 _UTCR3 (3) /* Ser. port 3 UART Control Reg. 3 */
+#define Ser3UTDR _UTDR (3) /* Ser. port 3 UART Data Reg. */
+#define Ser3UTSR0 _UTSR0 (3) /* Ser. port 3 UART Status Reg. 0 */
+#define Ser3UTSR1 _UTSR1 (3) /* Ser. port 3 UART Status Reg. 1 */
+
+/* Those are still used in some places */
+#define _Ser1UTCR0 __PREG(Ser1UTCR0)
+#define _Ser2UTCR0 __PREG(Ser2UTCR0)
+#define _Ser3UTCR0 __PREG(Ser3UTCR0)
X
-/*
- * Register offsets
- */
+/* Register offsets */
X #define UTCR0 0x00
X #define UTCR1 0x04
X #define UTCR2 0x08
@@ -466,83 +301,6 @@
X #define UTSR0 0x1c
X #define UTSR1 0x20
X
-#if LANGUAGE == C
-
-#define Ser1UTCR0 /* Ser. port 1 UART Control Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser1UTCR0)))
-#define Ser1UTCR1 /* Ser. port 1 UART Control Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser1UTCR1)))
-#define Ser1UTCR2 /* Ser. port 1 UART Control Reg. 2 */ \
- (*((volatile Word *) io_p2v (_Ser1UTCR2)))
-#define Ser1UTCR3 /* Ser. port 1 UART Control Reg. 3 */ \
- (*((volatile Word *) io_p2v (_Ser1UTCR3)))
-#define Ser1UTDR /* Ser. port 1 UART Data Reg. */ \
- (*((volatile Word *) io_p2v (_Ser1UTDR)))
-#define Ser1UTSR0 /* Ser. port 1 UART Status Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser1UTSR0)))
-#define Ser1UTSR1 /* Ser. port 1 UART Status Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser1UTSR1)))
-
-#define Ser2UTCR0 /* Ser. port 2 UART Control Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser2UTCR0)))
-#define Ser2UTCR1 /* Ser. port 2 UART Control Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser2UTCR1)))
-#define Ser2UTCR2 /* Ser. port 2 UART Control Reg. 2 */ \
- (*((volatile Word *) io_p2v (_Ser2UTCR2)))
-#define Ser2UTCR3 /* Ser. port 2 UART Control Reg. 3 */ \
- (*((volatile Word *) io_p2v (_Ser2UTCR3)))
-#define Ser2UTCR4 /* Ser. port 2 UART Control Reg. 4 */ \
- (*((volatile Word *) io_p2v (_Ser2UTCR4)))
-#define Ser2UTDR /* Ser. port 2 UART Data Reg. */ \
- (*((volatile Word *) io_p2v (_Ser2UTDR)))
-#define Ser2UTSR0 /* Ser. port 2 UART Status Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser2UTSR0)))
-#define Ser2UTSR1 /* Ser. port 2 UART Status Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser2UTSR1)))
-
-#define Ser3UTCR0 /* Ser. port 3 UART Control Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser3UTCR0)))
-#define Ser3UTCR1 /* Ser. port 3 UART Control Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser3UTCR1)))
-#define Ser3UTCR2 /* Ser. port 3 UART Control Reg. 2 */ \
- (*((volatile Word *) io_p2v (_Ser3UTCR2)))
-#define Ser3UTCR3 /* Ser. port 3 UART Control Reg. 3 */ \
- (*((volatile Word *) io_p2v (_Ser3UTCR3)))
-#define Ser3UTDR /* Ser. port 3 UART Data Reg. */ \
- (*((volatile Word *) io_p2v (_Ser3UTDR)))
-#define Ser3UTSR0 /* Ser. port 3 UART Status Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser3UTSR0)))
-#define Ser3UTSR1 /* Ser. port 3 UART Status Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser3UTSR1)))
-
-#elif LANGUAGE == Assembly
-#define Ser1UTCR0 ( io_p2v (_Ser1UTCR0))
-#define Ser1UTCR1 ( io_p2v (_Ser1UTCR1))
-#define Ser1UTCR2 ( io_p2v (_Ser1UTCR2))
-#define Ser1UTCR3 ( io_p2v (_Ser1UTCR3))
-#define Ser1UTDR ( io_p2v (_Ser1UTDR))
-#define Ser1UTSR0 ( io_p2v (_Ser1UTSR0))
-#define Ser1UTSR1 ( io_p2v (_Ser1UTSR1))
-
-#define Ser2UTCR0 ( io_p2v (_Ser2UTCR0))
-#define Ser2UTCR1 ( io_p2v (_Ser2UTCR1))
-#define Ser2UTCR2 ( io_p2v (_Ser2UTCR2))
-#define Ser2UTCR3 ( io_p2v (_Ser2UTCR3))
-#define Ser2UTCR4 ( io_p2v (_Ser2UTCR4))
-#define Ser2UTDR ( io_p2v (_Ser2UTDR))
-#define Ser2UTSR0 ( io_p2v (_Ser2UTSR0))
-#define Ser2UTSR1 ( io_p2v (_Ser2UTSR1))
-
-#define Ser3UTCR0 ( io_p2v (_Ser3UTCR0))
-#define Ser3UTCR1 ( io_p2v (_Ser3UTCR1))
-#define Ser3UTCR2 ( io_p2v (_Ser3UTCR2))
-#define Ser3UTCR3 ( io_p2v (_Ser3UTCR3))
-#define Ser3UTDR ( io_p2v (_Ser3UTDR))
-#define Ser3UTSR0 ( io_p2v (_Ser3UTSR0))
-#define Ser3UTSR1 ( io_p2v (_Ser3UTSR1))
-
-#endif /* LANGUAGE == C */
-
X #define UTCR0_PE 0x00000001 /* Parity Enable */
X #define UTCR0_OES 0x00000002 /* Odd/Even parity Select */
X #define UTCR0_OddPar (UTCR0_OES*0) /* Odd Parity */
@@ -657,33 +415,14 @@
X * fsd, Tsd Frequency, period of the SDLC communication.
X */
X
-#define _Ser1SDCR0 0x80020060 /* Ser. port 1 SDLC Control Reg. 0 */
-#define _Ser1SDCR1 0x80020064 /* Ser. port 1 SDLC Control Reg. 1 */
-#define _Ser1SDCR2 0x80020068 /* Ser. port 1 SDLC Control Reg. 2 */
-#define _Ser1SDCR3 0x8002006C /* Ser. port 1 SDLC Control Reg. 3 */
-#define _Ser1SDCR4 0x80020070 /* Ser. port 1 SDLC Control Reg. 4 */
-#define _Ser1SDDR 0x80020078 /* Ser. port 1 SDLC Data Reg. */
-#define _Ser1SDSR0 0x80020080 /* Ser. port 1 SDLC Status Reg. 0 */
-#define _Ser1SDSR1 0x80020084 /* Ser. port 1 SDLC Status Reg. 1 */
-
-#if LANGUAGE == C
-#define Ser1SDCR0 /* Ser. port 1 SDLC Control Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser1SDCR0)))
-#define Ser1SDCR1 /* Ser. port 1 SDLC Control Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser1SDCR1)))
-#define Ser1SDCR2 /* Ser. port 1 SDLC Control Reg. 2 */ \
- (*((volatile Word *) io_p2v (_Ser1SDCR2)))
-#define Ser1SDCR3 /* Ser. port 1 SDLC Control Reg. 3 */ \
- (*((volatile Word *) io_p2v (_Ser1SDCR3)))
-#define Ser1SDCR4 /* Ser. port 1 SDLC Control Reg. 4 */ \
- (*((volatile Word *) io_p2v (_Ser1SDCR4)))
-#define Ser1SDDR /* Ser. port 1 SDLC Data Reg. */ \
- (*((volatile Word *) io_p2v (_Ser1SDDR)))
-#define Ser1SDSR0 /* Ser. port 1 SDLC Status Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser1SDSR0)))
-#define Ser1SDSR1 /* Ser. port 1 SDLC Status Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser1SDSR1)))
-#endif /* LANGUAGE == C */
+#define Ser1SDCR0 __REG(0x80020060) /* Ser. port 1 SDLC Control Reg. 0 */
+#define Ser1SDCR1 __REG(0x80020064) /* Ser. port 1 SDLC Control Reg. 1 */
+#define Ser1SDCR2 __REG(0x80020068) /* Ser. port 1 SDLC Control Reg. 2 */
+#define Ser1SDCR3 __REG(0x8002006C) /* Ser. port 1 SDLC Control Reg. 3 */
+#define Ser1SDCR4 __REG(0x80020070) /* Ser. port 1 SDLC Control Reg. 4 */
+#define Ser1SDDR __REG(0x80020078) /* Ser. port 1 SDLC Data Reg. */
+#define Ser1SDSR0 __REG(0x80020080) /* Ser. port 1 SDLC Status Reg. 0 */
+#define Ser1SDSR1 __REG(0x80020084) /* Ser. port 1 SDLC Status Reg. 1 */
X
X #define SDCR0_SUS 0x00000001 /* SDLC/UART Select */
X #define SDCR0_SDLC (SDCR0_SUS*0) /* SDLC mode (TXD1 & RXD1) */
@@ -790,27 +529,12 @@
X * SA-1100.]
X */
X
-#define _Ser2HSCR0 0x80040060 /* Ser. port 2 HSSP Control Reg. 0 */
-#define _Ser2HSCR1 0x80040064 /* Ser. port 2 HSSP Control Reg. 1 */
-#define _Ser2HSDR 0x8004006C /* Ser. port 2 HSSP Data Reg. */
-#define _Ser2HSSR0 0x80040074 /* Ser. port 2 HSSP Status Reg. 0 */
-#define _Ser2HSSR1 0x80040078 /* Ser. port 2 HSSP Status Reg. 1 */
-#define _Ser2HSCR2 0x90060028 /* Ser. port 2 HSSP Control Reg. 2 */
-
-#if LANGUAGE == C
-#define Ser2HSCR0 /* Ser. port 2 HSSP Control Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser2HSCR0)))
-#define Ser2HSCR1 /* Ser. port 2 HSSP Control Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser2HSCR1)))
-#define Ser2HSDR /* Ser. port 2 HSSP Data Reg. */ \
- (*((volatile Word *) io_p2v (_Ser2HSDR)))
-#define Ser2HSSR0 /* Ser. port 2 HSSP Status Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser2HSSR0)))
-#define Ser2HSSR1 /* Ser. port 2 HSSP Status Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser2HSSR1)))
-#define Ser2HSCR2 /* Ser. port 2 HSSP Control Reg. 2 */ \
- (*((volatile Word *) io_p2v (_Ser2HSCR2)))
-#endif /* LANGUAGE == C */
+#define Ser2HSCR0 __REG(0x80040060) /* Ser. port 2 HSSP Control Reg. 0 */
+#define Ser2HSCR1 __REG(0x80040064) /* Ser. port 2 HSSP Control Reg. 1 */
+#define Ser2HSDR __REG(0x8004006C) /* Ser. port 2 HSSP Data Reg. */
+#define Ser2HSSR0 __REG(0x80040074) /* Ser. port 2 HSSP Status Reg. 0 */
+#define Ser2HSSR1 __REG(0x80040078) /* Ser. port 2 HSSP Status Reg. 1 */
+#define Ser2HSCR2 __REG(0x90060028) /* Ser. port 2 HSSP Control Reg. 2 */
X
X #define HSCR0_ITR 0x00000001 /* IrDA Transmission Rate */
X #define HSCR0_UART (HSCR0_ITR*0) /* UART mode (115.2 kb/s if IrDA) */
@@ -892,33 +616,12 @@
X * ftcm, Ttcm Frequency, period of the telecom sampling.
X */
X
-#define _Ser4MCCR0 0x80060000 /* Ser. port 4 MCP Control Reg. 0 */
-#define _Ser4MCDR0 0x80060008 /* Ser. port 4 MCP Data Reg. 0 */
- /* (audio) */
-#define _Ser4MCDR1 0x8006000C /* Ser. port 4 MCP Data Reg. 1 */
- /* (telecom) */
-#define _Ser4MCDR2 0x80060010 /* Ser. port 4 MCP Data Reg. 2 */
- /* (CODEC reg.) */
-#define _Ser4MCSR 0x80060018 /* Ser. port 4 MCP Status Reg. */
-#define _Ser4MCCR1 0x90060030 /* Ser. port 4 MCP Control Reg. 1 */
-
-#if LANGUAGE == C
-#define Ser4MCCR0 /* Ser. port 4 MCP Control Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser4MCCR0)))
-#define Ser4MCDR0 /* Ser. port 4 MCP Data Reg. 0 */ \
- /* (audio) */ \
- (*((volatile Word *) io_p2v (_Ser4MCDR0)))
-#define Ser4MCDR1 /* Ser. port 4 MCP Data Reg. 1 */ \
- /* (telecom) */ \
- (*((volatile Word *) io_p2v (_Ser4MCDR1)))
-#define Ser4MCDR2 /* Ser. port 4 MCP Data Reg. 2 */ \
- /* (CODEC reg.) */ \
- (*((volatile Word *) io_p2v (_Ser4MCDR2)))
-#define Ser4MCSR /* Ser. port 4 MCP Status Reg. */ \
- (*((volatile Word *) io_p2v (_Ser4MCSR)))
-#define Ser4MCCR1 /* Ser. port 4 MCP Control Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser4MCCR1)))
-#endif /* LANGUAGE == C */
+#define Ser4MCCR0 __REG(0x80060000) /* Ser. port 4 MCP Control Reg. 0 */
+#define Ser4MCDR0 __REG(0x80060008) /* Ser. port 4 MCP Data Reg. 0 (audio) */
+#define Ser4MCDR1 __REG(0x8006000C) /* Ser. port 4 MCP Data Reg. 1 (telecom) */
+#define Ser4MCDR2 __REG(0x80060010) /* Ser. port 4 MCP Data Reg. 2 (CODEC reg.) */
+#define Ser4MCSR __REG(0x80060018) /* Ser. port 4 MCP Status Reg. */
+#define Ser4MCCR1 __REG(0x90060030) /* Ser. port 4 MCP Control Reg. 1 */
X
X #define MCCR0_ASD Fld (7, 0) /* Audio Sampling rate Divisor/32 */
X /* [6..127] */
@@ -1036,21 +739,10 @@
X * fss, Tss Frequency, period of the SSP communication.
X */
X
-#define _Ser4SSCR0 0x80070060 /* Ser. port 4 SSP Control Reg. 0 */
-#define _Ser4SSCR1 0x80070064 /* Ser. port 4 SSP Control Reg. 1 */
-#define _Ser4SSDR 0x8007006C /* Ser. port 4 SSP Data Reg. */
-#define _Ser4SSSR 0x80070074 /* Ser. port 4 SSP Status Reg. */
-
-#if LANGUAGE == C
-#define Ser4SSCR0 /* Ser. port 4 SSP Control Reg. 0 */ \
- (*((volatile Word *) io_p2v (_Ser4SSCR0)))
-#define Ser4SSCR1 /* Ser. port 4 SSP Control Reg. 1 */ \
- (*((volatile Word *) io_p2v (_Ser4SSCR1)))
-#define Ser4SSDR /* Ser. port 4 SSP Data Reg. */ \
- (*((volatile Word *) io_p2v (_Ser4SSDR)))
-#define Ser4SSSR /* Ser. port 4 SSP Status Reg. */ \
- (*((volatile Word *) io_p2v (_Ser4SSSR)))
-#endif /* LANGUAGE == C */
+#define Ser4SSCR0 __REG(0x80070060) /* Ser. port 4 SSP Control Reg. 0 */
+#define Ser4SSCR1 __REG(0x80070064) /* Ser. port 4 SSP Control Reg. 1 */
+#define Ser4SSDR __REG(0x8007006C) /* Ser. port 4 SSP Data Reg. */
+#define Ser4SSSR __REG(0x80070074) /* Ser. port 4 SSP Status Reg. */
X
X #define SSCR0_DSS Fld (4, 0) /* Data Size - 1 Select [3..15] */
X #define SSCR0_DataSize(Size) /* Data Size Select [4..16] */ \
@@ -1128,33 +820,14 @@
X * (read/write).
X */
X
-#define _OSMR(Nb) /* OS timer Match Reg. [0..3] */ \
- (0x90000000 + (Nb)*4)
-#define _OSMR0 _OSMR (0) /* OS timer Match Reg. 0 */
-#define _OSMR1 _OSMR (1) /* OS timer Match Reg. 1 */
-#define _OSMR2 _OSMR (2) /* OS timer Match Reg. 2 */
-#define _OSMR3 _OSMR (3) /* OS timer Match Reg. 3 */
-#define _OSCR 0x90000010 /* OS timer Counter Reg. */
-#define _OSSR 0x90000014 /* OS timer Status Reg. */
-#define _OWER 0x90000018 /* OS timer Watch-dog Enable Reg. */
-#define _OIER 0x9000001C /* OS timer Interrupt Enable Reg. */
-
-#if LANGUAGE == C
-#define OSMR /* OS timer Match Reg. [0..3] */ \
- ((volatile Word *) io_p2v (_OSMR (0)))
-#define OSMR0 (OSMR [0]) /* OS timer Match Reg. 0 */
-#define OSMR1 (OSMR [1]) /* OS timer Match Reg. 1 */
-#define OSMR2 (OSMR [2]) /* OS timer Match Reg. 2 */
-#define OSMR3 (OSMR [3]) /* OS timer Match Reg. 3 */
-#define OSCR /* OS timer Counter Reg. */ \
- (*((volatile Word *) io_p2v (_OSCR)))
-#define OSSR /* OS timer Status Reg. */ \
- (*((volatile Word *) io_p2v (_OSSR)))
-#define OWER /* OS timer Watch-dog Enable Reg. */ \
- (*((volatile Word *) io_p2v (_OWER)))
-#define OIER /* OS timer Interrupt Enable Reg. */ \
- (*((volatile Word *) io_p2v (_OIER)))
-#endif /* LANGUAGE == C */
+#define OSMR0 __REG(0x90000000) /* OS timer Match Reg. 0 */
+#define OSMR1 __REG(0x90000004) /* OS timer Match Reg. 1 */
+#define OSMR2 __REG(0x90000008) /* OS timer Match Reg. 2 */
+#define OSMR3 __REG(0x9000000c) /* OS timer Match Reg. 3 */
+#define OSCR __REG(0x90000010) /* OS timer Counter Reg. */
+#define OSSR __REG(0x90000014 ) /* OS timer Status Reg. */
+#define OWER __REG(0x90000018 ) /* OS timer Watch-dog Enable Reg. */
+#define OIER __REG(0x9000001C ) /* OS timer Interrupt Enable Reg. */
X
X #define OSSR_M(Nb) /* Match detected [0..3] */ \
X (0x00000001 << (Nb))
@@ -1190,21 +863,10 @@
X * (1 Hz nominal).
X */
X
-#define _RTAR 0x90010000 /* RTC Alarm Reg. */
-#define _RCNR 0x90010004 /* RTC CouNt Reg. */
-#define _RTTR 0x90010008 /* RTC Trim Reg. */
-#define _RTSR 0x90010010 /* RTC Status Reg. */
-
-#if LANGUAGE == C
-#define RTAR /* RTC Alarm Reg. */ \
- (*((volatile Word *) io_p2v (_RTAR)))
-#define RCNR /* RTC CouNt Reg. */ \
- (*((volatile Word *) io_p2v (_RCNR)))
-#define RTTR /* RTC Trim Reg. */ \
- (*((volatile Word *) io_p2v (_RTTR)))
-#define RTSR /* RTC Status Reg. */ \
- (*((volatile Word *) io_p2v (_RTSR)))
-#endif /* LANGUAGE == C */
+#define RTAR __REG(0x90010000) /* RTC Alarm Reg. */
+#define RCNR __REG(0x90010004) /* RTC CouNt Reg. */
+#define RTTR __REG(0x90010008) /* RTC Trim Reg. */
+#define RTSR __REG(0x90010010) /* RTC Status Reg. */
X
X #define RTTR_C Fld (16, 0) /* clock divider Count - 1 */
X #define RTTR_D Fld (10, 16) /* trim Delete count */
@@ -1242,44 +904,14 @@
X * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
X */
X
-#define _PMCR 0x90020000 /* PM Control Reg. */
-#define _PSSR 0x90020004 /* PM Sleep Status Reg. */
-#define _PSPR 0x90020008 /* PM Scratch-Pad Reg. */
-#define _PWER 0x9002000C /* PM Wake-up Enable Reg. */
-#define _PCFR 0x90020010 /* PM general ConFiguration Reg. */
-#define _PPCR 0x90020014 /* PM PLL Configuration Reg. */
-#define _PGSR 0x90020018 /* PM GPIO Sleep state Reg. */
-#define _POSR 0x9002001C /* PM Oscillator Status Reg. */
-
-#if LANGUAGE == C
-#define PMCR /* PM Control Reg. */ \
- (*((volatile Word *) io_p2v (_PMCR)))
-#define PSSR /* PM Sleep Status Reg. */ \
- (*((volatile Word *) io_p2v (_PSSR)))
-#define PSPR /* PM Scratch-Pad Reg. */ \
- (*((volatile Word *) io_p2v (_PSPR)))
-#define PWER /* PM Wake-up Enable Reg. */ \
- (*((volatile Word *) io_p2v (_PWER)))
-#define PCFR /* PM general ConFiguration Reg. */ \
- (*((volatile Word *) io_p2v (_PCFR)))
-#define PPCR /* PM PLL Configuration Reg. */ \
- (*((volatile Word *) io_p2v (_PPCR)))
-#define PGSR /* PM GPIO Sleep state Reg. */ \
- (*((volatile Word *) io_p2v (_PGSR)))
-#define POSR /* PM Oscillator Status Reg. */ \
- (*((volatile Word *) io_p2v (_POSR)))
-
-#elif LANGUAGE == Assembly
-#define PMCR (io_p2v (_PMCR))
-#define PSSR (io_p2v (_PSSR))
-#define PSPR (io_p2v (_PSPR))
-#define PWER (io_p2v (_PWER))
-#define PCFR (io_p2v (_PCFR))
-#define PPCR (io_p2v (_PPCR))
-#define PGSR (io_p2v (_PGSR))
-#define POSR (io_p2v (_POSR))
-
-#endif /* LANGUAGE == C */
+#define PMCR __REG(0x90020000) /* PM Control Reg. */
+#define PSSR __REG(0x90020004) /* PM Sleep Status Reg. */
+#define PSPR __REG(0x90020008) /* PM Scratch-Pad Reg. */
+#define PWER __REG(0x9002000C) /* PM Wake-up Enable Reg. */
+#define PCFR __REG(0x90020010) /* PM general ConFiguration Reg. */
+#define PPCR __REG(0x90020014) /* PM PLL Configuration Reg. */
+#define PGSR __REG(0x90020018) /* PM GPIO Sleep state Reg. */
+#define POSR __REG(0x9002001C) /* PM Oscillator Status Reg. */
X
X #define PMCR_SF 0x00000001 /* Sleep Force (set only) */
X
@@ -1413,15 +1045,8 @@
X * RCSR Reset Controller (RC) Status Register (read/write).
X */
X
-#define _RSRR 0x90030000 /* RC Software Reset Reg. */
-#define _RCSR 0x90030004 /* RC Status Reg. */
-
-#if LANGUAGE == C
-#define RSRR /* RC Software Reset Reg. */ \
- (*((volatile Word *) io_p2v (_RSRR)))
-#define RCSR /* RC Status Reg. */ \
- (*((volatile Word *) io_p2v (_RCSR)))
-#endif /* LANGUAGE == C */
+#define RSRR __REG(0x90030000) /* RC Software Reset Reg. */
+#define RCSR __REG(0x90030004) /* RC Status Reg. */
X
X #define RSRR_SWR 0x00000001 /* SoftWare Reset (set only) */
X
@@ -1438,12 +1063,7 @@
X * TUCR Test Unit Control Register (read/write).
X */
X
-#define _TUCR 0x90030008 /* Test Unit Control Reg. */
-
-#if LANGUAGE == C
-#define TUCR /* Test Unit Control Reg. */ \
- (*((volatile Word *) io_p2v (_TUCR)))
-#endif /* LANGUAGE == C */
+#define TUCR __REG(0x90030008) /* Test Unit Control Reg. */
X
X #define TUCR_TIC 0x00000040 /* TIC mode */
X #define TUCR_TTST 0x00000080 /* Trim TeST mode */
@@ -1505,44 +1125,14 @@
X * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
X */
X
-#define _GPLR 0x90040000 /* GPIO Pin Level Reg. */
-#define _GPDR 0x90040004 /* GPIO Pin Direction Reg. */
-#define _GPSR 0x90040008 /* GPIO Pin output Set Reg. */
-#define _GPCR 0x9004000C /* GPIO Pin output Clear Reg. */
-#define _GRER 0x90040010 /* GPIO Rising-Edge detect Reg. */
-#define _GFER 0x90040014 /* GPIO Falling-Edge detect Reg. */
-#define _GEDR 0x90040018 /* GPIO Edge Detect status Reg. */
-#define _GAFR 0x9004001C /* GPIO Alternate Function Reg. */
-
-#if LANGUAGE == C
-#define GPLR /* GPIO Pin Level Reg. */ \
- (*((volatile Word *) io_p2v (_GPLR)))
-#define GPDR /* GPIO Pin Direction Reg. */ \
- (*((volatile Word *) io_p2v (_GPDR)))
-#define GPSR /* GPIO Pin output Set Reg. */ \
- (*((volatile Word *) io_p2v (_GPSR)))
-#define GPCR /* GPIO Pin output Clear Reg. */ \
- (*((volatile Word *) io_p2v (_GPCR)))
-#define GRER /* GPIO Rising-Edge detect Reg. */ \
- (*((volatile Word *) io_p2v (_GRER)))
-#define GFER /* GPIO Falling-Edge detect Reg. */ \
- (*((volatile Word *) io_p2v (_GFER)))
-#define GEDR /* GPIO Edge Detect status Reg. */ \
- (*((volatile Word *) io_p2v (_GEDR)))
-#define GAFR /* GPIO Alternate Function Reg. */ \
- (*((volatile Word *) io_p2v (_GAFR)))
-#elif LANGUAGE == Assembly
-
-#define GPLR (io_p2v (_GPLR))
-#define GPDR (io_p2v (_GPDR))
-#define GPSR (io_p2v (_GPSR))
-#define GPCR (io_p2v (_GPCR))
-#define GRER (io_p2v (_GRER))
-#define GFER (io_p2v (_GFER))
-#define GEDR (io_p2v (_GEDR))
-#define GAFR (io_p2v (_GAFR))
-
-#endif /* LANGUAGE == C */
+#define GPLR __REG(0x90040000) /* GPIO Pin Level Reg. */
+#define GPDR __REG(0x90040004) /* GPIO Pin Direction Reg. */
+#define GPSR __REG(0x90040008) /* GPIO Pin output Set Reg. */
+#define GPCR __REG(0x9004000C) /* GPIO Pin output Clear Reg. */
+#define GRER __REG(0x90040010) /* GPIO Rising-Edge detect Reg. */
+#define GFER __REG(0x90040014) /* GPIO Falling-Edge detect Reg. */
+#define GEDR __REG(0x90040018) /* GPIO Edge Detect status Reg. */
+#define GAFR __REG(0x9004001C) /* GPIO Alternate Function Reg. */
X
X #define GPIO_MIN (0)
X #define GPIO_MAX (27)
@@ -1640,27 +1230,12 @@
X * versions 2.0 (rev. = 8) and higher.]
X */
X
-#define _ICIP 0x90050000 /* IC IRQ Pending reg. */
-#define _ICMR 0x90050004 /* IC Mask Reg. */
-#define _ICLR 0x90050008 /* IC Level Reg. */
-#define _ICCR 0x9005000C /* IC Control Reg. */
-#define _ICFP 0x90050010 /* IC FIQ Pending reg. */
-#define _ICPR 0x90050020 /* IC Pending Reg. */
-
-#if LANGUAGE == C
-#define ICIP /* IC IRQ Pending reg. */ \
- (*((volatile Word *) io_p2v (_ICIP)))
-#define ICMR /* IC Mask Reg. */ \
- (*((volatile Word *) io_p2v (_ICMR)))
-#define ICLR /* IC Level Reg. */ \
- (*((volatile Word *) io_p2v (_ICLR)))
-#define ICCR /* IC Control Reg. */ \
- (*((volatile Word *) io_p2v (_ICCR)))
-#define ICFP /* IC FIQ Pending reg. */ \
- (*((volatile Word *) io_p2v (_ICFP)))
-#define ICPR /* IC Pending Reg. */ \
- (*((volatile Word *) io_p2v (_ICPR)))
-#endif /* LANGUAGE == C */
+#define ICIP __REG(0x90050000) /* IC IRQ Pending reg. */
+#define ICMR __REG(0x90050004) /* IC Mask Reg. */
+#define ICLR __REG(0x90050008) /* IC Level Reg. */
+#define ICCR __REG(0x9005000C) /* IC Control Reg. */
+#define ICFP __REG(0x90050010) /* IC FIQ Pending reg. */
+#define ICPR __REG(0x90050020) /* IC Pending Reg. */
X
X #define IC_GPIO(Nb) /* GPIO [0..10] */ \
X (0x00000001 << (Nb))
@@ -1728,26 +1303,11 @@
X * (read).
X */
X
-#define _PPDR 0x90060000 /* PPC Pin Direction Reg. */
-#define _PPSR 0x90060004 /* PPC Pin State Reg. */
-#define _PPAR 0x90060008 /* PPC Pin Assignment Reg. */
-#define _PSDR 0x9006000C /* PPC Sleep-mode pin Direction */
- /* Reg. */
-#define _PPFR 0x90060010 /* PPC Pin Flag Reg. */
-
-#if LANGUAGE == C
-#define PPDR /* PPC Pin Direction Reg. */ \
- (*((volatile Word *) io_p2v (_PPDR)))
-#define PPSR /* PPC Pin State Reg. */ \
- (*((volatile Word *) io_p2v (_PPSR)))
-#define PPAR /* PPC Pin Assignment Reg. */ \
- (*((volatile Word *) io_p2v (_PPAR)))
-#define PSDR /* PPC Sleep-mode pin Direction */ \
- /* Reg. */ \
- (*((volatile Word *) io_p2v (_PSDR)))
-#define PPFR /* PPC Pin Flag Reg. */ \
- (*((volatile Word *) io_p2v (_PPFR)))
-#endif /* LANGUAGE == C */
+#define PPDR __REG(0x90060000) /* PPC Pin Direction Reg. */
+#define PPSR __REG(0x90060004) /* PPC Pin State Reg. */
+#define PPAR __REG(0x90060008) /* PPC Pin Assignment Reg. */
+#define PSDR __REG(0x9006000C) /* PPC Sleep-mode pin Direction Reg. */
+#define PPFR __REG(0x90060010) /* PPC Pin Flag Reg. */
X
X #define PPC_LDD(Nb) /* LCD Data [0..7] */ \
X (0x00000001 << (Nb))
@@ -1828,29 +1388,10 @@
X * fcas, Tcas Frequency, period of the DRAM CAS shift registers.
X */
X
- /* Memory system: */
-#define _MDCNFG 0xA0000000 /* DRAM CoNFiGuration reg. */
-#define _MDCAS(Nb) /* DRAM CAS shift reg. [0..3] */ \
- (0xA0000004 + (Nb)*4)
-#define _MDCAS0 _MDCAS (0) /* DRAM CAS shift reg. 0 */
-#define _MDCAS1 _MDCAS (1) /* DRAM CAS shift reg. 1 */
-#define _MDCAS2 _MDCAS (2) /* DRAM CAS shift reg. 2 */
-
-#if LANGUAGE == C
- /* Memory system: */
-#define MDCNFG /* DRAM CoNFiGuration reg. */ \
- (*((volatile Word *) io_p2v (_MDCNFG)))
-#define MDCAS /* DRAM CAS shift reg. [0..3] */ \
- ((volatile Word *) io_p2v (_MDCAS (0)))
-#define MDCAS0 (MDCAS [0]) /* DRAM CAS shift reg. 0 */
-#define MDCAS1 (MDCAS [1]) /* DRAM CAS shift reg. 1 */
-#define MDCAS2 (MDCAS [2]) /* DRAM CAS shift reg. 2 */
-
-#elif LANGUAGE == Assembly
-
-#define MDCNFG (io_p2v(_MDCNFG))
-
-#endif /* LANGUAGE == C */
+#define MDCNFG __REG(0xA0000000) /* DRAM CoNFiGuration reg. */
+#define MDCAS0 __REG(0xA0000004) /* DRAM CAS shift reg. 0 */
+#define MDCAS1 __REG(0xA0000008) /* DRAM CAS shift reg. 1 */
+#define MDCAS2 __REG(0xA000000c) /* DRAM CAS shift reg. 2 */
X
X /* SA1100 MDCNFG values */
X #define MDCNFG_DE(Nb) /* DRAM Enable bank [0..3] */ \
@@ -1922,30 +1463,9 @@
X * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
X */
X
- /* Memory system: */
-#define _MSC(Nb) /* Static memory Control reg. */ \
- /* [0..1] */ \
- (0xA0000010 + (Nb)*4)
-#define _MSC0 _MSC (0) /* Static memory Control reg. 0 */
-#define _MSC1 _MSC (1) /* Static memory Control reg. 1 */
-#define _MSC2 0xA000002C /* Static memory Control reg. 2, not contiguous */
-
-#if LANGUAGE == C
- /* Memory system: */
-#define MSC /* Static memory Control reg. */ \
- /* [0..1] */ \
- ((volatile Word *) io_p2v (_MSC (0)))
-#define MSC0 (MSC [0]) /* Static memory Control reg. 0 */
-#define MSC1 (MSC [1]) /* Static memory Control reg. 1 */
-#define MSC2 (*(volatile Word *) io_p2v (_MSC2)) /* Static memory Control reg. 2 */
-
-#elif LANGUAGE == Assembly
-
-#define MSC0 io_p2v(0xa0000010)
-#define MSC1 io_p2v(0xa0000014)
-#define MSC2 io_p2v(0xa000002c)
-
-#endif /* LANGUAGE == C */
+#define MSC0 __REG(0xa0000010) /* Static memory Control reg. 0 */
+#define MSC1 __REG(0xa0000014) /* Static memory Control reg. 1 */
+#define MSC2 __REG(0xa000002c) /* Static memory Control reg. 2, not contiguous */
X
X #define MSC_Bnk(Nb) /* static memory Bank [0..3] */ \
X Fld (16, ((Nb) Modulo 2)*16)
@@ -2013,15 +1533,7 @@
X */
X
X /* Memory system: */
-#define _MECR 0xA0000018 /* Expansion memory bus (PCMCIA) */
- /* Configuration Reg. */
-
-#if LANGUAGE == C
- /* Memory system: */
-#define MECR /* Expansion memory bus (PCMCIA) */ \
- /* Configuration Reg. */ \
- (*((volatile Word *) io_p2v (_MECR)))
-#endif /* LANGUAGE == C */
+#define MECR __REG(0xA0000018) /* Expansion memory bus (PCMCIA) Configuration Reg. */
X
X #define MECR_PCMCIA(Nb) /* PCMCIA [0..1] */ \
X Fld (15, (Nb)*16)
@@ -2049,18 +1561,7 @@
X * On SA1110 only
X */
X
-#define _MDREFR 0xA000001C
-
-#if LANGUAGE == C
- /* Memory system: */
-#define MDREFR \
- (*((volatile Word *) io_p2v (_MDREFR)))
-
-#elif LANGUAGE == Assembly
-
-#define MDREFR (io_p2v(_MDREFR))
-
-#endif /* LANGUAGE == C */
+#define MDREFR __REG(0xA000001C)
X
X #define MDREFR_TRASR Fld (4, 0)
X #define MDREFR_DRI Fld (12, 4)
@@ -2162,286 +1663,14 @@
X
X #define DMASp 0x00000020 /* DMA control reg. Space [byte] */
X
-#define _DDAR(Nb) /* DMA Device Address Reg. */ \
- /* channel [0..5] */ \
- (0xB0000000 + (Nb)*DMASp)
-#define _SetDCSR(Nb) /* Set DMA Control & Status Reg. */ \
- /* channel [0..5] (write) */ \
- (0xB0000004 + (Nb)*DMASp)
-#define _ClrDCSR(Nb) /* Clear DMA Control & Status Reg. */ \
- /* channel [0..5] (write) */ \
- (0xB0000008 + (Nb)*DMASp)
-#define _RdDCSR(Nb) /* Read DMA Control & Status Reg. */ \
- /* channel [0..5] (read) */ \
- (0xB000000C + (Nb)*DMASp)
-#define _DBSA(Nb) /* DMA Buffer Start address reg. A */ \
- /* channel [0..5] */ \
- (0xB0000010 + (Nb)*DMASp)
-#define _DBTA(Nb) /* DMA Buffer Transfer count */ \
- /* reg. A channel [0..5] */ \
- (0xB0000014 + (Nb)*DMASp)
-#define _DBSB(Nb) /* DMA Buffer Start address reg. B */ \
- /* channel [0..5] */ \
- (0xB0000018 + (Nb)*DMASp)
-#define _DBTB(Nb) /* DMA Buffer Transfer count */ \
- /* reg. B channel [0..5] */ \
- (0xB000001C + (Nb)*DMASp)
-
-#define _DDAR0 _DDAR (0) /* DMA Device Address Reg. */
- /* channel 0 */
-#define _SetDCSR0 _SetDCSR (0) /* Set DMA Control & Status Reg. */
- /* channel 0 (write) */
-#define _ClrDCSR0 _ClrDCSR (0) /* Clear DMA Control & Status Reg. */
- /* channel 0 (write) */
-#define _RdDCSR0 _RdDCSR (0) /* Read DMA Control & Status Reg. */
- /* channel 0 (read) */
-#define _DBSA0 _DBSA (0) /* DMA Buffer Start address reg. A */
- /* channel 0 */
-#define _DBTA0 _DBTA (0) /* DMA Buffer Transfer count */
- /* reg. A channel 0 */
-#define _DBSB0 _DBSB (0) /* DMA Buffer Start address reg. B */
- /* channel 0 */
-#define _DBTB0 _DBTB (0) /* DMA Buffer Transfer count */
- /* reg. B channel 0 */
-
-#define _DDAR1 _DDAR (1) /* DMA Device Address Reg. */
- /* channel 1 */
-#define _SetDCSR1 _SetDCSR (1) /* Set DMA Control & Status Reg. */
- /* channel 1 (write) */
-#define _ClrDCSR1 _ClrDCSR (1) /* Clear DMA Control & Status Reg. */
- /* channel 1 (write) */
-#define _RdDCSR1 _RdDCSR (1) /* Read DMA Control & Status Reg. */
- /* channel 1 (read) */
-#define _DBSA1 _DBSA (1) /* DMA Buffer Start address reg. A */
- /* channel 1 */
-#define _DBTA1 _DBTA (1) /* DMA Buffer Transfer count */
- /* reg. A channel 1 */
-#define _DBSB1 _DBSB (1) /* DMA Buffer Start address reg. B */
- /* channel 1 */
-#define _DBTB1 _DBTB (1) /* DMA Buffer Transfer count */
- /* reg. B channel 1 */
-
-#define _DDAR2 _DDAR (2) /* DMA Device Address Reg. */
- /* channel 2 */
-#define _SetDCSR2 _SetDCSR (2) /* Set DMA Control & Status Reg. */
- /* channel 2 (write) */
-#define _ClrDCSR2 _ClrDCSR (2) /* Clear DMA Control & Status Reg. */
- /* channel 2 (write) */
-#define _RdDCSR2 _RdDCSR (2) /* Read DMA Control & Status Reg. */
- /* channel 2 (read) */
-#define _DBSA2 _DBSA (2) /* DMA Buffer Start address reg. A */
- /* channel 2 */
-#define _DBTA2 _DBTA (2) /* DMA Buffer Transfer count */
- /* reg. A channel 2 */
-#define _DBSB2 _DBSB (2) /* DMA Buffer Start address reg. B */
- /* channel 2 */
-#define _DBTB2 _DBTB (2) /* DMA Buffer Transfer count */
- /* reg. B channel 2 */
-
-#define _DDAR3 _DDAR (3) /* DMA Device Address Reg. */
- /* channel 3 */
-#define _SetDCSR3 _SetDCSR (3) /* Set DMA Control & Status Reg. */
- /* channel 3 (write) */
-#define _ClrDCSR3 _ClrDCSR (3) /* Clear DMA Control & Status Reg. */
- /* channel 3 (write) */
-#define _RdDCSR3 _RdDCSR (3) /* Read DMA Control & Status Reg. */
- /* channel 3 (read) */
-#define _DBSA3 _DBSA (3) /* DMA Buffer Start address reg. A */
- /* channel 3 */
-#define _DBTA3 _DBTA (3) /* DMA Buffer Transfer count */
- /* reg. A channel 3 */
-#define _DBSB3 _DBSB (3) /* DMA Buffer Start address reg. B */
- /* channel 3 */
-#define _DBTB3 _DBTB (3) /* DMA Buffer Transfer count */
- /* reg. B channel 3 */
-
-#define _DDAR4 _DDAR (4) /* DMA Device Address Reg. */
- /* channel 4 */
-#define _SetDCSR4 _SetDCSR (4) /* Set DMA Control & Status Reg. */
- /* channel 4 (write) */
-#define _ClrDCSR4 _ClrDCSR (4) /* Clear DMA Control & Status Reg. */
- /* channel 4 (write) */
-#define _RdDCSR4 _RdDCSR (4) /* Read DMA Control & Status Reg. */
- /* channel 4 (read) */
-#define _DBSA4 _DBSA (4) /* DMA Buffer Start address reg. A */
- /* channel 4 */
-#define _DBTA4 _DBTA (4) /* DMA Buffer Transfer count */
- /* reg. A channel 4 */
-#define _DBSB4 _DBSB (4) /* DMA Buffer Start address reg. B */
- /* channel 4 */
-#define _DBTB4 _DBTB (4) /* DMA Buffer Transfer count */
- /* reg. B channel 4 */
-
-#define _DDAR5 _DDAR (5) /* DMA Device Address Reg. */
- /* channel 5 */
-#define _SetDCSR5 _SetDCSR (5) /* Set DMA Control & Status Reg. */
- /* channel 5 (write) */
-#define _ClrDCSR5 _ClrDCSR (5) /* Clear DMA Control & Status Reg. */
- /* channel 5 (write) */
-#define _RdDCSR5 _RdDCSR (5) /* Read DMA Control & Status Reg. */
- /* channel 5 (read) */
-#define _DBSA5 _DBSA (5) /* DMA Buffer Start address reg. A */
- /* channel 5 */
-#define _DBTA5 _DBTA (5) /* DMA Buffer Transfer count */
- /* reg. A channel 5 */
-#define _DBSB5 _DBSB (5) /* DMA Buffer Start address reg. B */
- /* channel 5 */
-#define _DBTB5 _DBTB (5) /* DMA Buffer Transfer count */
- /* reg. B channel 5 */
-
-#if LANGUAGE == C
-
-#define DDAR0 /* DMA Device Address Reg. */ \
- /* channel 0 */ \
- (*((volatile Word *) io_p2v (_DDAR0)))
-#define SetDCSR0 /* Set DMA Control & Status Reg. */ \
- /* channel 0 (write) */ \
- (*((volatile Word *) io_p2v (_SetDCSR0)))
-#define ClrDCSR0 /* Clear DMA Control & Status Reg. */ \
- /* channel 0 (write) */ \
- (*((volatile Word *) io_p2v (_ClrDCSR0)))
-#define RdDCSR0 /* Read DMA Control & Status Reg. */ \
- /* channel 0 (read) */ \
- (*((volatile Word *) io_p2v (_RdDCSR0)))
-#define DBSA0 /* DMA Buffer Start address reg. A */ \
- /* channel 0 */ \
- (*((volatile Address *) io_p2v (_DBSA0)))
-#define DBTA0 /* DMA Buffer Transfer count */ \
- /* reg. A channel 0 */ \
- (*((volatile Word *) io_p2v (_DBTA0)))
-#define DBSB0 /* DMA Buffer Start address reg. B */ \
- /* channel 0 */ \
- (*((volatile Address *) io_p2v (_DBSB0)))
-#define DBTB0 /* DMA Buffer Transfer count */ \
- /* reg. B channel 0 */ \
- (*((volatile Word *) io_p2v (_DBTB0)))
-
-#define DDAR1 /* DMA Device Address Reg. */ \
- /* channel 1 */ \
- (*((volatile Word *) io_p2v (_DDAR1)))
-#define SetDCSR1 /* Set DMA Control & Status Reg. */ \
- /* channel 1 (write) */ \
- (*((volatile Word *) io_p2v (_SetDCSR1)))
-#define ClrDCSR1 /* Clear DMA Control & Status Reg. */ \
- /* channel 1 (write) */ \
- (*((volatile Word *) io_p2v (_ClrDCSR1)))
-#define RdDCSR1 /* Read DMA Control & Status Reg. */ \
- /* channel 1 (read) */ \
- (*((volatile Word *) io_p2v (_RdDCSR1)))
-#define DBSA1 /* DMA Buffer Start address reg. A */ \
- /* channel 1 */ \
- (*((volatile Address *) io_p2v (_DBSA1)))
-#define DBTA1 /* DMA Buffer Transfer count */ \
- /* reg. A channel 1 */ \
- (*((volatile Word *) io_p2v (_DBTA1)))
-#define DBSB1 /* DMA Buffer Start address reg. B */ \
- /* channel 1 */ \
- (*((volatile Address *) io_p2v (_DBSB1)))
-#define DBTB1 /* DMA Buffer Transfer count */ \
- /* reg. B channel 1 */ \
- (*((volatile Word *) io_p2v (_DBTB1)))
-
-#define DDAR2 /* DMA Device Address Reg. */ \
- /* channel 2 */ \
- (*((volatile Word *) io_p2v (_DDAR2)))
-#define SetDCSR2 /* Set DMA Control & Status Reg. */ \
- /* channel 2 (write) */ \
- (*((volatile Word *) io_p2v (_SetDCSR2)))
-#define ClrDCSR2 /* Clear DMA Control & Status Reg. */ \
- /* channel 2 (write) */ \
- (*((volatile Word *) io_p2v (_ClrDCSR2)))
-#define RdDCSR2 /* Read DMA Control & Status Reg. */ \
- /* channel 2 (read) */ \
- (*((volatile Word *) io_p2v (_RdDCSR2)))
-#define DBSA2 /* DMA Buffer Start address reg. A */ \
- /* channel 2 */ \
- (*((volatile Address *) io_p2v (_DBSA2)))
-#define DBTA2 /* DMA Buffer Transfer count */ \
- /* reg. A channel 2 */ \
- (*((volatile Word *) io_p2v (_DBTA2)))
-#define DBSB2 /* DMA Buffer Start address reg. B */ \
- /* channel 2 */ \
- (*((volatile Address *) io_p2v (_DBSB2)))
-#define DBTB2 /* DMA Buffer Transfer count */ \
- /* reg. B channel 2 */ \
- (*((volatile Word *) io_p2v (_DBTB2)))
-
-#define DDAR3 /* DMA Device Address Reg. */ \
- /* channel 3 */ \
- (*((volatile Word *) io_p2v (_DDAR3)))
-#define SetDCSR3 /* Set DMA Control & Status Reg. */ \
- /* channel 3 (write) */ \
- (*((volatile Word *) io_p2v (_SetDCSR3)))
-#define ClrDCSR3 /* Clear DMA Control & Status Reg. */ \
- /* channel 3 (write) */ \
- (*((volatile Word *) io_p2v (_ClrDCSR3)))
-#define RdDCSR3 /* Read DMA Control & Status Reg. */ \
- /* channel 3 (read) */ \
- (*((volatile Word *) io_p2v (_RdDCSR3)))
-#define DBSA3 /* DMA Buffer Start address reg. A */ \
- /* channel 3 */ \
- (*((volatile Address *) io_p2v (_DBSA3)))
-#define DBTA3 /* DMA Buffer Transfer count */ \
- /* reg. A channel 3 */ \
- (*((volatile Word *) io_p2v (_DBTA3)))
-#define DBSB3 /* DMA Buffer Start address reg. B */ \
- /* channel 3 */ \
- (*((volatile Address *) io_p2v (_DBSB3)))
-#define DBTB3 /* DMA Buffer Transfer count */ \
- /* reg. B channel 3 */ \
- (*((volatile Word *) io_p2v (_DBTB3)))
-
-#define DDAR4 /* DMA Device Address Reg. */ \
- /* channel 4 */ \
- (*((volatile Word *) io_p2v (_DDAR4)))
-#define SetDCSR4 /* Set DMA Control & Status Reg. */ \
- /* channel 4 (write) */ \
- (*((volatile Word *) io_p2v (_SetDCSR4)))
-#define ClrDCSR4 /* Clear DMA Control & Status Reg. */ \
- /* channel 4 (write) */ \
- (*((volatile Word *) io_p2v (_ClrDCSR4)))
-#define RdDCSR4 /* Read DMA Control & Status Reg. */ \
- /* channel 4 (read) */ \
- (*((volatile Word *) io_p2v (_RdDCSR4)))
-#define DBSA4 /* DMA Buffer Start address reg. A */ \
- /* channel 4 */ \
- (*((volatile Address *) io_p2v (_DBSA4)))
-#define DBTA4 /* DMA Buffer Transfer count */ \
- /* reg. A channel 4 */ \
- (*((volatile Word *) io_p2v (_DBTA4)))
-#define DBSB4 /* DMA Buffer Start address reg. B */ \
- /* channel 4 */ \
- (*((volatile Address *) io_p2v (_DBSB4)))
-#define DBTB4 /* DMA Buffer Transfer count */ \
- /* reg. B channel 4 */ \
- (*((volatile Word *) io_p2v (_DBTB4)))
-
-#define DDAR5 /* DMA Device Address Reg. */ \
- /* channel 5 */ \
- (*((volatile Word *) io_p2v (_DDAR5)))
-#define SetDCSR5 /* Set DMA Control & Status Reg. */ \
- /* channel 5 (write) */ \
- (*((volatile Word *) io_p2v (_SetDCSR5)))
-#define ClrDCSR5 /* Clear DMA Control & Status Reg. */ \
- /* channel 5 (write) */ \
- (*((volatile Word *) io_p2v (_ClrDCSR5)))
-#define RdDCSR5 /* Read DMA Control & Status Reg. */ \
- /* channel 5 (read) */ \
- (*((volatile Word *) io_p2v (_RdDCSR5)))
-#define DBSA5 /* DMA Buffer Start address reg. A */ \
- /* channel 5 */ \
- (*((volatile Address *) io_p2v (_DBSA5)))
-#define DBTA5 /* DMA Buffer Transfer count */ \
- /* reg. A channel 5 */ \
- (*((volatile Word *) io_p2v (_DBTA5)))
-#define DBSB5 /* DMA Buffer Start address reg. B */ \
- /* channel 5 */ \
- (*((volatile Address *) io_p2v (_DBSB5)))
-#define DBTB5 /* DMA Buffer Transfer count */ \
- /* reg. B channel 5 */ \
- (*((volatile Word *) io_p2v (_DBTB5)))
-
-#endif /* LANGUAGE == C */
+#define DDAR(Nb) __REG(0xB0000000 + (Nb)*DMASp) /* DMA Device Address Reg. channel [0..5] */
+#define SetDCSR(Nb) __REG(0xB0000004 + (Nb)*DMASp) /* Set DMA Control & Status Reg. channel [0..5] (write) */
+#define ClrDCSR(Nb) __REG(0xB0000008 + (Nb)*DMASp) /* Clear DMA Control & Status Reg. channel [0..5] (write) */
+#define RdDCSR(Nb) __REG(0xB000000C + (Nb)*DMASp) /* Read DMA Control & Status Reg. channel [0..5] (read) */
+#define DBSA(Nb) __REG(0xB0000010 + (Nb)*DMASp) /* DMA Buffer Start address reg. A channel [0..5] */
+#define DBTA(Nb) __REG(0xB0000014 + (Nb)*DMASp) /* DMA Buffer Transfer count reg. A channel [0..5] */
+#define DBSB(Nb) __REG(0xB0000018 + (Nb)*DMASp) /* DMA Buffer Start address reg. B channel [0..5] */
+#define DBTB(Nb) __REG(0xB000001C + (Nb)*DMASp) /* DMA Buffer Transfer count reg. B channel [0..5] */
X
X #define DDAR_RW 0x00000001 /* device data Read/Write */
X #define DDAR_DevWr (DDAR_RW*0) /* Device data Write */
@@ -2500,60 +1729,60 @@
X (((Add) & 0X003FFFFC) << (FShft (DDAR_DA) - 2)))
X #define DDAR_Ser0UDCWr /* Ser. port 0 UDC Write */ \
X (DDAR_DevWr + DDAR_Brst8 + DDAR_8BitDev + \
- DDAR_Ser0UDCTr + DDAR_DevAdd (_Ser0UDCDR))
+ DDAR_Ser0UDCTr + DDAR_DevAdd (__PREG(Ser0UDCDR)))
X #define DDAR_Ser0UDCRd /* Ser. port 0 UDC Read */ \
X (DDAR_DevRd + DDAR_Brst8 + DDAR_8BitDev + \
- DDAR_Ser0UDCRc + DDAR_DevAdd (_Ser0UDCDR))
+ DDAR_Ser0UDCRc + DDAR_DevAdd (__PREG(Ser0UDCDR)))
X #define DDAR_Ser1UARTWr /* Ser. port 1 UART Write */ \
X (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \
- DDAR_Ser1UARTTr + DDAR_DevAdd (_Ser1UTDR))
+ DDAR_Ser1UARTTr + DDAR_DevAdd (__PREG(Ser1UTDR)))
X #define DDAR_Ser1UARTRd /* Ser. port 1 UART Read */ \
X (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \
- DDAR_Ser1UARTRc + DDAR_DevAdd (_Ser1UTDR))
+ DDAR_Ser1UARTRc + DDAR_DevAdd (__PREG(Ser1UTDR)))
X #define DDAR_Ser1SDLCWr /* Ser. port 1 SDLC Write */ \
X (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \
- DDAR_Ser1SDLCTr + DDAR_DevAdd (_Ser1SDDR))
+ DDAR_Ser1SDLCTr + DDAR_DevAdd (__PREG(Ser1SDDR)))
X #define DDAR_Ser1SDLCRd /* Ser. port 1 SDLC Read */ \
X (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \
- DDAR_Ser1SDLCRc + DDAR_DevAdd (_Ser1SDDR))
+ DDAR_Ser1SDLCRc + DDAR_DevAdd (__PREG(Ser1SDDR)))
X #define DDAR_Ser2UARTWr /* Ser. port 2 UART Write */ \
X (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \
- DDAR_Ser2ICPTr + DDAR_DevAdd (_Ser2UTDR))
+ DDAR_Ser2ICPTr + DDAR_DevAdd (__PREG(Ser2UTDR)))
X #define DDAR_Ser2UARTRd /* Ser. port 2 UART Read */ \
X (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \
- DDAR_Ser2ICPRc + DDAR_DevAdd (_Ser2UTDR))
+ DDAR_Ser2ICPRc + DDAR_DevAdd (__PREG(Ser2UTDR)))
X #define DDAR_Ser2HSSPWr /* Ser. port 2 HSSP Write */ \
X (DDAR_DevWr + DDAR_Brst8 + DDAR_8BitDev + \
- DDAR_Ser2ICPTr + DDAR_DevAdd (_Ser2HSDR))


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 48'
echo 'File patch-2.4.14 is continued in part 49'
echo "49" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:10 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part47

#!/bin/sh -x
# this is part 47 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 47; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+/*
+ *
+ * This file contains the register definitions for the Excalibur
+ * Timer TIMER00.
+ *
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+

+#ifndef __INT_CTRL00_H
+#define __INT_CTRL00_H
+
+#define INT_MS(base_addr) (INT_CTRL00_TYPE (base_addr + 0x00 ))
+#define INT_MS_FC_MSK (0x10000)
+#define INT_MS_FC_OFST (16)
+#define INT_MS_M1_MSK (0x8000)
+#define INT_MS_M1_OFST (15)
+#define INT_MS_M0_MSK (0x4000)
+#define INT_MS_M0_OFST (14)
+#define INT_MS_AE_MSK (0x2000)
+#define INT_MS_AE_OFST (13)
+#define INT_MS_PE_MSK (0x1000)
+#define INT_MS_PE_OFST (12)
+#define INT_MS_EE_MSK (0x0800)
+#define INT_MS_EE_OFST (11)
+#define INT_MS_PS_MSK (0x0400)
+#define INT_MS_PS_OFST (10)
+#define INT_MS_T1_MSK (0x0200)
+#define INT_MS_T1_OFST (9)
+#define INT_MS_T0_MSK (0x0100)
+#define INT_MS_T0_OFST (8)
+#define INT_MS_UA_MSK (0x0080)
+#define INT_MS_UA_OFST (7)
+#define INT_MS_IP_MSK (0x0040)
+#define INT_MS_IP_OFST (6)
+#define INT_MS_P5_MSK (0x0020)
+#define INT_MS_P5_OFST (5)
+#define INT_MS_P4_MSK (0x0010)
+#define INT_MS_P4_OFST (4)
+#define INT_MS_P3_MSK (0x0008)
+#define INT_MS_P3_OFST (3)
+#define INT_MS_P2_MSK (0x0004)
+#define INT_MS_P2_OFST (2)
+#define INT_MS_P1_MSK (0x0002)
+#define INT_MS_P1_OFST (1)
+#define INT_MS_P0_MSK (0x0001)
+#define INT_MS_P0_OFST (0)
+
+#define INT_MC(base_addr) (INT_CTRL00_TYPE (base_addr + 0x04 ))
+#define INT_MC_FC_MSK (0x10000)
+#define INT_MC_FC_OFST (16)
+#define INT_MC_M1_MSK (0x8000)
+#define INT_MC_M1_OFST (15)
+#define INT_MC_M0_MSK (0x4000)
+#define INT_MC_M0_OFST (14)
+#define INT_MC_AE_MSK (0x2000)
+#define INT_MC_AE_OFST (13)
+#define INT_MC_PE_MSK (0x1000)
+#define INT_MC_PE_OFST (12)
+#define INT_MC_EE_MSK (0x0800)
+#define INT_MC_EE_OFST (11)
+#define INT_MC_PS_MSK (0x0400)
+#define INT_MC_PS_OFST (10)
+#define INT_MC_T1_MSK (0x0200)
+#define INT_MC_T1_OFST (9)
+#define INT_MC_T0_MSK (0x0100)
+#define INT_MC_T0_OFST (8)
+#define INT_MC_UA_MSK (0x0080)
+#define INT_MC_UA_OFST (7)
+#define INT_MC_IP_MSK (0x0040)
+#define INT_MC_IP_OFST (6)
+#define INT_MC_P5_MSK (0x0020)
+#define INT_MC_P5_OFST (5)
+#define INT_MC_P4_MSK (0x0010)
+#define INT_MC_P4_OFST (4)
+#define INT_MC_P3_MSK (0x0008)
+#define INT_MC_P3_OFST (3)
+#define INT_MC_P2_MSK (0x0004)
+#define INT_MC_P2_OFST (2)
+#define INT_MC_P1_MSK (0x0002)
+#define INT_MC_P1_OFST (1)
+#define INT_MC_P0_MSK (0x0001)
+#define INT_MC_P0_OFST (0)
+
+#define INT_SS(base_addr) (INT_CTRL00_TYPE (base_addr + 0x08 ))
+#define INT_SS_FC_SSK (0x8000)
+#define INT_SS_FC_OFST (15)
+#define INT_SS_M1_SSK (0x8000)
+#define INT_SS_M1_OFST (15)
+#define INT_SS_M0_SSK (0x4000)
+#define INT_SS_M0_OFST (14)
+#define INT_SS_AE_SSK (0x2000)
+#define INT_SS_AE_OFST (13)
+#define INT_SS_PE_SSK (0x1000)
+#define INT_SS_PE_OFST (12)
+#define INT_SS_EE_SSK (0x0800)
+#define INT_SS_EE_OFST (11)
+#define INT_SS_PS_SSK (0x0400)
+#define INT_SS_PS_OFST (10)
+#define INT_SS_T1_SSK (0x0200)
+#define INT_SS_T1_OFST (9)
+#define INT_SS_T0_SSK (0x0100)
+#define INT_SS_T0_OFST (8)
+#define INT_SS_UA_SSK (0x0080)
+#define INT_SS_UA_OFST (7)
+#define INT_SS_IP_SSK (0x0040)
+#define INT_SS_IP_OFST (6)
+#define INT_SS_P5_SSK (0x0020)
+#define INT_SS_P5_OFST (5)
+#define INT_SS_P4_SSK (0x0010)
+#define INT_SS_P4_OFST (4)
+#define INT_SS_P3_SSK (0x0008)
+#define INT_SS_P3_OFST (3)
+#define INT_SS_P2_SSK (0x0004)
+#define INT_SS_P2_OFST (2)
+#define INT_SS_P1_SSK (0x0002)
+#define INT_SS_P1_OFST (1)
+#define INT_SS_P0_SSK (0x0001)
+#define INT_SS_P0_OFST (0)
+
+#define INT_RS(base_addr) (INT_CTRL00_TYPE (base_addr + 0x0C ))
+#define INT_RS_FC_RSK (0x10000)
+#define INT_RS_FC_OFST (16)
+#define INT_RS_M1_RSK (0x8000)
+#define INT_RS_M1_OFST (15)
+#define INT_RS_M0_RSK (0x4000)
+#define INT_RS_M0_OFST (14)
+#define INT_RS_AE_RSK (0x2000)
+#define INT_RS_AE_OFST (13)
+#define INT_RS_PE_RSK (0x1000)
+#define INT_RS_PE_OFST (12)
+#define INT_RS_EE_RSK (0x0800)
+#define INT_RS_EE_OFST (11)
+#define INT_RS_PS_RSK (0x0400)
+#define INT_RS_PS_OFST (10)
+#define INT_RS_T1_RSK (0x0200)
+#define INT_RS_T1_OFST (9)
+#define INT_RS_T0_RSK (0x0100)
+#define INT_RS_T0_OFST (8)
+#define INT_RS_UA_RSK (0x0080)
+#define INT_RS_UA_OFST (7)
+#define INT_RS_IP_RSK (0x0040)
+#define INT_RS_IP_OFST (6)
+#define INT_RS_P5_RSK (0x0020)
+#define INT_RS_P5_OFST (5)
+#define INT_RS_P4_RSK (0x0010)
+#define INT_RS_P4_OFST (4)
+#define INT_RS_P3_RSK (0x0008)
+#define INT_RS_P3_OFST (3)
+#define INT_RS_P2_RSK (0x0004)
+#define INT_RS_P2_OFST (2)
+#define INT_RS_P1_RSK (0x0002)
+#define INT_RS_P1_OFST (1)
+#define INT_RS_P0_RSK (0x0001)
+#define INT_RS_P0_OFST (0)
+
+#define INT_ID(base_addr) (INT_CTRL00_TYPE (base_addr + 0x10 ))
+#define INT_ID_ID_MSK (0x3F)
+#define INT_ID_ID_OFST (0)
+
+#define INT_PLD_PRIORITY(base_addr) (INT_CTRL00_TYPE (base_addr + 0x14 ))
+#define INT_PLD_PRIORITY_PRI_MSK (0x3F)
+#define INT_PLD_PRIORITY_PRI_OFST (0)
+#define INT_PLD_PRIORITY_GA_MSK (0x40)
+#define INT_PLD_PRIORITY_GA_OFST (6)
+
+#define INT_MODE(base_addr) (INT_CTRL00_TYPE (base_addr + 0x18 ))
+#define INT_MODE_MODE_MSK (0x3)
+#define INT_MODE_MODE_OFST (0)
+
+#define INT_PRIORITY_P0(base_addr) (INT_CTRL00_TYPE (base_addr + 0x80 ))
+#define INT_PRIORITY_P0_PRI_MSK (0x3F)
+#define INT_PRIORITY_P0_PRI_OFST (0)
+#define INT_PRIORITY_P0_FQ_MSK (0x40)
+#define INT_PRIORITY_P0_FQ_OFST (6)
+
+#define INT_PRIORITY_P1(base_addr) (INT_CTRL00_TYPE (base_addr + 0x84 ))
+#define INT_PRIORITY_P1_PRI_MSK (0x3F)
+#define INT_PRIORITY_P1_PRI_OFST (0)
+#define INT_PRIORITY_P1_FQ_MSK (0x40)
+#define INT_PRIORITY_P1_FQ_OFST (6)
+
+#define INT_PRIORITY_P2(base_addr) (INT_CTRL00_TYPE (base_addr + 0x88 ))
+#define INT_PRIORITY_P2_PRI_MSK (0x3F)
+#define INT_PRIORITY_P2_PRI_OFST (0)
+#define INT_PRIORITY_P2_FQ_MSK (0x40)
+#define INT_PRIORITY_P2_FQ_OFST (6)
+
+#define INT_PRIORITY_P3(base_addr) (INT_CTRL00_TYPE (base_addr + 0x8C ))
+#define INT_PRIORITY_P3_PRI_MSK (0x3F)
+#define INT_PRIORITY_P3_PRI_OFST (0)
+#define INT_PRIORITY_P3_FQ_MSK (0x40)
+#define INT_PRIORITY_P3_FQ_OFST (6)
+
+#define INT_PRIORITY_P4(base_addr) (INT_CTRL00_TYPE (base_addr + 0x90 ))
+#define INT_PRIORITY_P4_PRI_MSK (0x3F)
+#define INT_PRIORITY_P4_PRI_OFST (0)
+#define INT_PRIORITY_P4_FQ_MSK (0x40)
+#define INT_PRIORITY_P4_FQ_OFST (6)
+
+#define INT_PRIORITY_P5(base_addr) (INT_CTRL00_TYPE (base_addr + 0x94 ))
+#define INT_PRIORITY_P5_PRI_MSK (0x3F)
+#define INT_PRIORITY_P5_PRI_OFST (0)
+#define INT_PRIORITY_P5_FQ_MSK (0x40)
+#define INT_PRIORITY_P5_FQ_OFST (6)
+
+#define INT_PRIORITY_IP(base_addr) (INT_CTRL00_TYPE (base_addr + 0x94 ))
+#define INT_PRIORITY_IP_PRI_MSK (0x3F)
+#define INT_PRIORITY_IP_PRI_OFST (0)
+#define INT_PRIORITY_IP_FQ_MSK (0x40)
+#define INT_PRIORITY_IP_FQ_OFST (6)
+
+#define INT_PRIORITY_UA(base_addr) (INT_CTRL00_TYPE (base_addr + 0x9C ))
+#define INT_PRIORITY_UA_PRI_MSK (0x3F)
+#define INT_PRIORITY_UA_PRI_OFST (0)
+#define INT_PRIORITY_UA_FQ_MSK (0x40)
+#define INT_PRIORITY_UA_FQ_OFST (6)
+
+#define INT_PRIORITY_T0(base_addr) (INT_CTRL00_TYPE (base_addr + 0xA0 ))
+#define INT_PRIORITY_T0_PRI_MSK (0x3F)
+#define INT_PRIORITY_T0_PRI_OFST (0)
+#define INT_PRIORITY_T0_FQ_MSK (0x40)
+#define INT_PRIORITY_T0_FQ_OFST (6)
+
+#define INT_PRIORITY_T1(base_addr) (INT_CTRL00_TYPE (base_addr + 0xA4 ))
+#define INT_PRIORITY_T1_PRI_MSK (0x3F)
+#define INT_PRIORITY_T1_PRI_OFST (0)
+#define INT_PRIORITY_T1_FQ_MSK (0x40)
+#define INT_PRIORITY_T1_FQ_OFST (6)
+
+#define INT_PRIORITY_PS(base_addr) (INT_CTRL00_TYPE (base_addr + 0xA8 ))
+#define INT_PRIORITY_PS_PRI_MSK (0x3F)
+#define INT_PRIORITY_PS_PRI_OFST (0)
+#define INT_PRIORITY_PS_FQ_MSK (0x40)
+#define INT_PRIORITY_PS_FQ_OFST (6)
+
+#define INT_PRIORITY_EE(base_addr) (INT_CTRL00_TYPE (base_addr + 0xAC ))
+#define INT_PRIORITY_EE_PRI_MSK (0x3F)
+#define INT_PRIORITY_EE_PRI_OFST (0)
+#define INT_PRIORITY_EE_FQ_MSK (0x40)
+#define INT_PRIORITY_EE_FQ_OFST (6)
+
+#define INT_PRIORITY_PE(base_addr) (INT_CTRL00_TYPE (base_addr + 0xB0 ))
+#define INT_PRIORITY_PE_PRI_MSK (0x3F)
+#define INT_PRIORITY_PE_PRI_OFST (0)
+#define INT_PRIORITY_PE_FQ_MSK (0x40)
+#define INT_PRIORITY_PE_FQ_OFST (6)
+
+#define INT_PRIORITY_AE(base_addr) (INT_CTRL00_TYPE (base_addr + 0xB4 ))
+#define INT_PRIORITY_AE_PRI_MSK (0x3F)
+#define INT_PRIORITY_AE_PRI_OFST (0)
+#define INT_PRIORITY_AE_FQ_MSK (0x40)
+#define INT_PRIORITY_AE_FQ_OFST (6)
+
+#define INT_PRIORITY_M0(base_addr) (INT_CTRL00_TYPE (base_addr + 0xB8 ))
+#define INT_PRIORITY_M0_PRI_MSK (0x3F)
+#define INT_PRIORITY_M0_PRI_OFST (0)
+#define INT_PRIORITY_M0_FQ_MSK (0x40)
+#define INT_PRIORITY_M0_FQ_OFST (6)
+
+#define INT_PRIORITY_M1(base_addr) (INT_CTRL00_TYPE (base_addr + 0xBC ))
+#define INT_PRIORITY_M1_PRI_MSK (0x3F)
+#define INT_PRIORITY_M1_PRI_OFST (0)
+#define INT_PRIORITY_M1_FQ_MSK (0x40)
+#define INT_PRIORITY_M1_FQ_OFST (6)
+
+#define INT_PRIORITY_FC(base_addr) (INT_CTRL00_TYPE (base_addr + 0xC0 ))
+#define INT_PRIORITY_FC_PRI_MSK (0x3F)
+#define INT_PRIORITY_FC_PRI_OFST (0)
+#define INT_PRIORITY_FC_FQ_MSK (0x40)
+#define INT_PRIORITY_FC_FQ_OFST (6)
+
+#endif /* __INT_CTRL00_H */
+
+
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/io.h linux/include/asm-arm/arch-epxa10db/io.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/io.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/io.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,55 @@
+/*
+ * linux/include/asm-arm/arch-epxa10db/io.h
+ *
+ * Copyright (C) 1999 ARM Limited


+ *
+ * This 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 __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffff
+
+
+/*
+ * Generic virtual read/write
+ */
+#define __arch_getw(a) (*(volatile unsigned short *)(a))
+#define __arch_putw(v,a) (*(volatile unsigned short *)(a) = (v))
+/*#define outsw __arch_writesw
+#define outsl __arch_writesl
+#define outsb __arch_writesb
+#define insb __arch_readsb
+#define insw __arch_readsw
+#define insl __arch_readsl*/
+
+#define __io(a) (a)
+#if 0
+#define __mem_pci(a) ((unsigned long)(a))
+#define __mem_isa(a) (PCI_MEMORY_VADDR + (unsigned long)(a))
+/*
+ * Validate the pci memory address for ioremap.
+ */
+#define iomem_valid_addr(iomem,size) \
+ ((iomem) > 0 && (iomem) + (size) <= 0x20000000)
+
+/*
+ * Convert PCI memory space to a CPU physical address
+ */
+#define iomem_to_phys(iomem) ((iomem) + PHYS_PCI_MEM_BASE)
+
+#endif
+
+#endif
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/irq.h linux/include/asm-arm/arch-epxa10db/irq.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/irq.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/irq.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,20 @@
+/*
+ * linux/include/asm-arm/arch-epxa10/irq.h
+ *
+ * Copyright (C) 1999 ARM Limited


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */

+#define fixup_irq(i) (i)
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/irqs.h linux/include/asm-arm/arch-epxa10db/irqs.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/irqs.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/irqs.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,45 @@
+/*
+ * linux/include/asm-arm/arch-camelot/irqs.h
+ *
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+

+/* Use the Excalibur chip definitions */
+#define INT_CTRL00_TYPE
+#include "asm/arch/int_ctrl00.h"
+
+
+#define IRQ_PLD0 INT_MS_P0_OFST
+#define IRQ_PLD1 INT_MS_P1_OFST
+#define IRQ_PLD2 INT_MS_P2_OFST
+#define IRQ_PLD3 INT_MS_P3_OFST
+#define IRQ_PLD4 INT_MS_P4_OFST
+#define IRQ_PLD5 INT_MS_P5_OFST
+#define IRQ_EXT INT_MS_IP_OFST
+#define IRQ_UART INT_MS_UA_OFST
+#define IRQ_TIMER0 INT_MS_T0_OFST
+#define IRQ_TIMER1 INT_MS_T1_OFST
+#define IRQ_PLL INT_MS_PLL_OFST
+#define IRQ_EBI INT_MS_EBI_OFST
+#define IRQ_STRIPE_BRIDGE INT_MS_PLL_OFST
+#define IRQ_AHB_BRIDGE INT_MS_PLL_OFST
+#define IRQ_COMMRX INT_MS_CR_OFST
+#define IRQ_COMMTX INT_MS_CT_OFST
+#define IRQ_FAST_COMM INT_MS_FC_OFST
+
+#define NR_IRQS (INT_MS_FC_OFST + 1)
+
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/memory.h linux/include/asm-arm/arch-epxa10db/memory.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/memory.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/memory.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,63 @@
+/*
+ * linux/include/asm-arm/arch-epxa10/memory.h
+ *
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */

+#ifndef __ASM_ARCH_MMU_H
+#define __ASM_ARCH_MMU_H
+
+/*
+ * Task size: 3GB
+ */
+#define TASK_SIZE (0xc0000000UL)
+#define TASK_SIZE_26 (0x04000000UL)
+
+/*
+ * This decides where the kernel will search for a free chunk of vm
+ * space during mmap's.
+ */
+#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
+
+/*
+ * Page offset: 3GB
+ */
+#define PAGE_OFFSET (0xc0000000UL)
+#define PHYS_OFFSET (0x00000000UL)
+
+#define PHYS_TO_NID(addr) (0)
+
+/*
+ * On epxa10, the dram is contiguous
+ */
+#define __virt_to_phys__is_a_macro
+#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET)
+#define __phys_to_virt__is_a_macro
+#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET)
+
+/*
+ * Virtual view <-> DMA view memory address translations
+ * virt_to_bus: Used to translate the virtual address to an
+ * address suitable to be passed to set_dma_addr
+ * bus_to_virt: Used to convert an address for DMA operations
+ * to an address that the kernel can use.
+ */
+#define __virt_to_bus__is_a_macro
+#define __virt_to_bus(x) (x - PAGE_OFFSET + /*SDRAM_BASE*/0)
+#define __bus_to_virt__is_a_macro
+#define __bus_to_virt(x) (x - /*SDRAM_BASE*/0 + PAGE_OFFSET)
+
+#endif
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/mode_ctrl00.h linux/include/asm-arm/arch-epxa10db/mode_ctrl00.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/mode_ctrl00.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/mode_ctrl00.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,80 @@
+#ifndef __MODE_CTRL00_H
+#define __MODE_CTRL00_H
+
+/*
+ * Register definitions for the reset and mode control
+ */
+
+/*
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+

+#define BOOT_CR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR ))
+#define BOOT_CR_BF_MSK (0x1)
+#define BOOT_CR_BF_OFST (0)
+#define BOOT_CR_HM_MSK (0x2)
+#define BOOT_CR_HM_OFST (1)
+#define BOOT_CR_RE_MSK (0x4)
+#define BOOT_CR_RE_OFST (2)
+
+#define RESET_SR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x4 ))
+#define RESET_SR_WR_MSK (0x1)
+#define RESET_SR_WR_OFST (0)
+#define RESET_SR_CR_MSK (0x2)
+#define RESET_SR_CR_OFST (1)
+#define RESET_SR_JT_MSK (0x4)
+#define RESET_SR_JT_OFST (2)
+#define RESET_SR_ER_MSK (0x8)
+#define RESET_SR_ER_OFST (3)
+
+#define ID_CODE(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x08 ))
+
+#define SRAM0_SR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x20 ))
+#define SRAM0_SR_SIZE_MSK (0xFFFFF000)
+#define SRAM0_SR_SIZE_OFST (12)
+
+#define SRAM1_SR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x24 ))
+#define SRAM1_SR_SIZE_MSK (0xFFFFF000)
+#define SRAM1_SR_SIZE_OFST (12)
+
+#define DPSRAM0_SR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x30 ))
+
+#define DPSRAM0_SR_MODE_MSK (0xF)
+#define DPSRAM0_SR_MODE_OFST (0)
+#define DPSRAM0_SR_GLBL_MSK (0x30)
+#define DPSRAM0_SR_SIZE_MSK (0xFFFFF000)
+#define DPSRAM0_SR_SIZE_OFST (12)
+
+#define DPSRAM0_LCR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x34 ))
+#define DPSRAM0_LCR_LCKADDR_MSK (0x1FFE0)
+#define DPSRAM0_LCR_LCKADDR_OFST (4)
+
+#define DPSRAM1_SR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x38 ))
+#define DPSRAM1_SR_MODE_MSK (0xF)
+#define DPSRAM1_SR_MODE_OFST (0)
+#define DPSRAM1_SR_GLBL_MSK (0x30)
+#define DPSRAM1_SR_GLBL_OFST (4)
+#define DPSRAM1_SR_SIZE_MSK (0xFFFFF000)
+#define DPSRAM1_SR_SIZE_OFST (12)
+
+#define DPSRAM1_LCR(BASE_ADDR) (MODE_CTRL00_TYPE (BASE_ADDR + 0x3C ))
+#define DPSRAM1_LCR_LCKADDR_MSK (0x1FFE0)
+#define DPSRAM1_LCR_LCKADDR_OFST (4)
+
+#endif /* __MODE_CTRL00_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/param.h linux/include/asm-arm/arch-epxa10db/param.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/param.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/param.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,21 @@
+/*
+ * linux/include/asm-arm/arch-epxa10db/param.h
+ *
+ * Copyright (C) 1999 ARM Limited


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+

+#define HZ 100
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/platform.h linux/include/asm-arm/arch-epxa10db/platform.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/platform.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/platform.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,7 @@
+#ifndef PLATFORM_H
+#define PLATFORM_H
+#include "excalibur.h"
+
+#define MAXIRQNUM 15
+#endif
+
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/pld_conf00.h linux/include/asm-arm/arch-epxa10db/pld_conf00.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/pld_conf00.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/pld_conf00.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,73 @@
+#ifndef __PLD_CONF00_H
+#define __PLD_CONF00_H
+
+/*
+ * Register definitions for the PLD Configuration Logic
+ */
+
+/*
+ *
+ * This file contains the register definitions for the Excalibur
+ * Interrupnt controller INT_CTRL00.
+ *
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+

+#define CONFIG_CONTROL(BASE_ADDR) (PLD_CONF00_TYPE (BASE_ADDR))
+#define CONFIG_CONTROL_LK_MSK (0x1)
+#define CONFIG_CONTROL_LK_OFST (0)
+#define CONFIG_CONTROL_CO_MSK (0x2)
+#define CONFIG_CONTROL_CO_OFST (1)
+#define CONFIG_CONTROL_B_MSK (0x4)
+#define CONFIG_CONTROL_B_OFST (2)
+#define CONFIG_CONTROL_PC_MSK (0x8)
+#define CONFIG_CONTROL_PC_OFST (3)
+#define CONFIG_CONTROL_E_MSK (0x10)
+#define CONFIG_CONTROL_E_OFST (4)
+#define CONFIG_CONTROL_ES_MSK (0xE0)
+#define CONFIG_CONTROL_ES_OFST (5)
+#define CONFIG_CONTROL_ES_0_MSK (0x20)
+#define CONFIG_CONTROL_ES_1_MSK (0x40)
+#define CONFIG_CONTROL_ES_2_MSK (0x80)
+
+#define CONFIG_CONTROL_CLOCK(BASE_ADDR) (PLD_CONF00_TYPE (BASE_ADDR + 0x4 ))
+#define CONFIG_CONTROL_CLOCK_RATIO_MSK (0xFFFF)
+#define CONFIG_CONTROL_CLOCK_RATIO_OFST (0)
+
+#define CONFIG_CONTROL_DATA(BASE_ADDR) (PLD_CONF00_TYPE (BASE_ADDR + 0x8 ))
+#define CONFIG_CONTROL_DATA_MSK (0xFFFFFFFF)
+#define CONFIG_CONTROL_DATA_OFST (0)
+
+#define CONFIG_UNLOCK(BASE_ADDR) (PLD_CONF00_TYPE (BASE_ADDR + 0xC ))
+#define CONFIG_UNLOCK_MSK (0xFFFFFFFF)
+#define CONFIG_UNLOCK_OFST (0)
+
+#define CONFIG_UNLOCK_MAGIC (0x554E4C4B)
+
+#endif /* __PLD_CONF00_H */


+
+
+
+
+
+
+
+
+
+

+
+
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/serial.h linux/include/asm-arm/arch-epxa10db/serial.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/serial.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/serial.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,50 @@
+/*
+ * linux/include/asm-arm/arch-epxa10db/serial.h
+ *
+ * Copyright (C) 1999 ARM Limited
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */

+#ifndef __ASM_ARCH_SERIAL_H
+#define __ASM_ARCH_SERIAL_H
+
+#include <asm/arch/platform.h>
+#include <asm/irq.h>
+
+/*
+ * This assumes you have a 1.8432 MHz clock for your UART.
+ *
+ * It'd be nice if someone built a serial card with a 24.576 MHz
+ * clock, since the 16550A is capable of handling a top speed of 1.5
+ * megabits/second; but this requires the faster clock.
+ */
+#define BASE_BAUD (1 / 16)
+
+#define _SER_IRQ0 IRQ_UARTINT0
+#define _SER_IRQ1 IRQ_UARTINT1
+
+#define RS_TABLE_SIZE 2
+
+#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
+
+ /* UART CLK PORT IRQ FLAGS */
+#define STD_SERIAL_PORT_DEFNS \
+ { 0, BASE_BAUD, 0x3F8, _SER_IRQ0, STD_COM_FLAGS }, /* ttyS0 */ \
+ { 0, BASE_BAUD, 0x2F8, _SER_IRQ1, STD_COM_FLAGS }, /* ttyS1 */
+
+#define EXTRA_SERIAL_PORT_DEFNS
+
+#endif
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/system.h linux/include/asm-arm/arch-epxa10db/system.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/system.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/system.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,41 @@
+/*
+ * linux/include/asm-arm/arch-epxa10db/system.h
+ *
+ * Copyright (C) 1999 ARM Limited
+ * Copyright (C) 2000 Deep Blue Solutions Ltd
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */

+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+#include <asm/arch/platform.h>
+
+static void arch_idle(void)
+{
+ /*
+ * This should do all the clock switching
+ * and wait for interrupt tricks
+ */
+ cpu_do_idle(0);
+}
+
+extern __inline__ void arch_reset(char mode)
+{
+ /* Hmm... We can probably do something with the watchdog... */
+}
+
+#endif
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/time.h linux/include/asm-arm/arch-epxa10db/time.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/time.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/time.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,61 @@
+/*
+ * linux/include/asm-arm/arch-epxa10db/time.h
+ *
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */

+#include <linux/config.h>
+#include <asm/system.h>
+#include <asm/leds.h>
+#include <asm/arch/hardware.h>
+#define TIMER00_TYPE (volatile unsigned int*)
+#include <asm/arch/timer00.h>
+
+
+/*
+ * IRQ handler for the timer
+ */
+static void excalibur_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;
+
+ do_leds();
+ do_timer(regs);
+ do_profile(regs);
+}
+
+/*
+ * Set up timer interrupt, and return the current time in seconds.
+ */
+extern __inline__ void setup_timer(void)
+{
+
+
+ timer_irq.handler = excalibur_timer_interrupt;
+
+
+ /*
+ * Make irqs happen for the system timer
+ */
+ setup_arm_irq(IRQ_TIMER0, &timer_irq);
+
+ /* Start the timer */
+ *TIMER0_LIMIT(IO_ADDRESS(EXC_TIMER00_BASE))=(unsigned int)(EXC_AHB2_CLK_FREQUENCY/50);
+ *TIMER0_PRESCALE(IO_ADDRESS(EXC_TIMER00_BASE))=1;
+ *TIMER0_CR(IO_ADDRESS(EXC_TIMER00_BASE))=TIMER0_CR_IE_MSK | TIMER0_CR_S_MSK;
+}
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/timer00.h linux/include/asm-arm/arch-epxa10db/timer00.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/timer00.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/timer00.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,98 @@
+/*
+ *
+ * This file contains the register definitions for the Excalibur
+ * Timer TIMER00.
+ *
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */

+#ifndef __TIMER00_H
+#define __TIMER00_H
+
+/*
+ * Register definitions for the timers
+ */
+
+
+#define TIMER0_CR(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x00 ))
+#define TIMER0_CR_B_MSK (0x20)
+#define TIMER0_CR_B_OFST (0x5)
+#define TIMER0_CR_S_MSK (0x10)
+#define TIMER0_CR_S_OFST (0x4)
+#define TIMER0_CR_CI_MSK (0x08)
+#define TIMER0_CR_CI_OFST (0x3)
+#define TIMER0_CR_IE_MSK (0x04)
+#define TIMER0_CR_IE_OFST (0x2)
+#define TIMER0_CR_MODE_MSK (0x3)
+#define TIMER0_CR_MODE_OFST (0)
+#define TIMER0_CR_MODE_FREE (0)
+#define TIMER0_CR_MODE_ONE (1)
+#define TIMER0_CR_MODE_INTVL (2)
+
+#define TIMER0_SR(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x00 ))
+#define TIMER0_SR_B_MSK (0x20)
+#define TIMER0_SR_B_OFST (0x5)
+#define TIMER0_SR_S_MSK (0x10)
+#define TIMER0_SR_S_OFST (0x4)
+#define TIMER0_SR_CI_MSK (0x08)
+#define TIMER0_SR_CI_OFST (0x3)
+#define TIMER0_SR_IE_MSK (0x04)
+#define TIMER0_SR_IE_OFST (0x2)
+#define TIMER0_SR_MODE_MSK (0x3)
+#define TIMER0_SR_MODE_OFST (0)
+#define TIMER0_SR_MODE_FREE (0)
+#define TIMER0_SR_MODE_ONE (1)
+#define TIMER0_SR_MODE_INTVL (2)
+
+#define TIMER0_PRESCALE(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x010 ))
+#define TIMER0_LIMIT(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x020 ))
+#define TIMER0_READ(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x030 ))
+
+#define TIMER1_CR(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x40 ))
+#define TIMER1_CR_B_MSK (0x20)
+#define TIMER1_CR_B_OFST (0x5)
+#define TIMER1_CR_S_MSK (0x10)
+#define TIMER1_CR_S_OFST (0x4)
+#define TIMER1_CR_CI_MSK (0x08)
+#define TIMER1_CR_CI_OFST (0x3)
+#define TIMER1_CR_IE_MSK (0x04)
+#define TIMER1_CR_IE_OFST (0x2)
+#define TIMER1_CR_MODE_MSK (0x3)
+#define TIMER1_CR_MODE_OFST (0)
+#define TIMER1_CR_MODE_FREE (0)
+#define TIMER1_CR_MODE_ONE (1)
+#define TIMER1_CR_MODE_INTVL (2)
+
+#define TIMER1_SR(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x40 ))
+#define TIMER1_SR_B_MSK (0x20)
+#define TIMER1_SR_B_OFST (0x5)
+#define TIMER1_SR_S_MSK (0x10)
+#define TIMER1_SR_S_OFST (0x4)
+#define TIMER1_SR_CI_MSK (0x08)
+#define TIMER1_SR_CI_OFST (0x3)
+#define TIMER1_SR_IE_MSK (0x04)
+#define TIMER1_SR_IE_OFST (0x2)
+#define TIMER1_SR_MODE_MSK (0x3)
+#define TIMER1_SR_MODE_OFST (0)
+#define TIMER1_SR_MODE_FREE (0)
+#define TIMER1_SR_MODE_ONE (1)
+#define TIMER1_SR_MODE_INTVL (2)
+
+#define TIMER1_PRESCALE(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x050 ))
+#define TIMER1_LIMIT(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x060 ))
+#define TIMER1_READ(BASE_ADDR) (TIMER00_TYPE (BASE_ADDR + 0x070 ))
+
+#endif /* __TIMER00_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/timex.h linux/include/asm-arm/arch-epxa10db/timex.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/timex.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/timex.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,26 @@
+/*
+ * linux/include/asm-arm/arch-epxa10db/timex.h
+ *
+ * Excalibur timex specifications
+ *
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+

+/*
+ * ??
+ */
+#define CLOCK_TICK_RATE (50000000 / 16)
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/uart00.h linux/include/asm-arm/arch-epxa10db/uart00.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/uart00.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/uart00.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,181 @@
+/* *
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */

+#ifndef __UART00_H
+#define __UART00_H
+
+/*
+ * Register definitions for the UART
+ */
+
+#define UART_TX_FIFO_SIZE (15)
+
+#define UART_RSR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x00 ))
+#define UART_RSR_RX_LEVEL_MSK (0x1f)
+#define UART_RSR_RX_LEVEL_OFST (0)
+#define UART_RSR_RE_MSK (0x80)
+#define UART_RSR_RE_OFST (7)
+
+#define UART_RDS(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x04 ))
+#define UART_RDS_BI_MSK (0x8)
+#define UART_RDS_BI_OFST (4)
+#define UART_RDS_FE_MSK (0x4)
+#define UART_RDS_FE_OFST (2)
+#define UART_RDS_PE_MSK (0x2)
+#define UART_RDS_PE_OFST (1)
+#define UART_RDS_OE_MSK (0x1)
+#define UART_RDS_OE_OFST (0)
+
+#define UART_RD(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x08 ))
+#define UART_RD_RX_DATA_MSK (0xff)
+#define UART_RD_RX_DATA_OFST (0)
+
+#define UART_TSR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x0c ))
+#define UART_TSR_TX_LEVEL_MSK (0x1f)
+#define UART_TSR_TX_LEVEL_OFST (0)
+#define UART_TSR_TXI_MSK (0x80)
+#define UART_TSR_TXI_OFST (7)
+
+#define UART_TD(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x10 ))
+#define UART_TD_TX_DATA_MSK (0xff)
+#define UART_TD_TX_DATA_OFST (0)
+
+#define UART_FCR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x14 ))
+#define UART_FCR_RX_THR_MSK (0xd0)
+#define UART_FCR_RX_THR_OFST (5)
+#define UART_FCR_RX_THR_1 (0x00)
+#define UART_FCR_RX_THR_2 (0x20)
+#define UART_FCR_RX_THR_4 (0x40)
+#define UART_FCR_RX_THR_6 (0x60)
+#define UART_FCR_RX_THR_8 (0x80)
+#define UART_FCR_RX_THR_10 (0xa0)
+#define UART_FCR_RX_THR_12 (0xc0)
+#define UART_FCR_RX_THR_14 (0xd0)
+#define UART_FCR_TX_THR_MSK (0x1c)
+#define UART_FCR_TX_THR_OFST (2)
+#define UART_FCR_TX_THR_0 (0x00)
+#define UART_FCR_TX_THR_2 (0x04)
+#define UART_FCR_TX_THR_4 (0x08)
+#define UART_FCR_TX_THR_8 (0x0c)
+#define UART_FCR_TX_THR_10 (0x10)
+#define UART_FCR_TX_THR_12 (0x14)
+#define UART_FCR_TX_THR_14 (0x18)
+#define UART_FCR_TX_THR_15 (0x1c)
+#define UART_FCR_RC_MSK (0x02)
+#define UART_FCR_RC_OFST (1)
+#define UART_FCR_TC_MSK (0x01)
+#define UART_FCR_TC_OFST (0)
+
+#define UART_IES(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x18 ))
+#define UART_IES_ME_MSK (0x8)
+#define UART_IES_ME_OFST (3)
+#define UART_IES_TIE_MSK (0x4)
+#define UART_IES_TIE_OFST (2)
+#define UART_IES_TE_MSK (0x2)
+#define UART_IES_TE_OFST (1)
+#define UART_IES_RE_MSK (0x1)
+#define UART_IES_RE_OFST (0)
+
+#define UART_IEC(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x1c ))
+#define UART_IEC_ME_MSK (0x8)
+#define UART_IEC_ME_OFST (3)
+#define UART_IEC_TIE_MSK (0x4)
+#define UART_IEC_TIE_OFST (2)
+#define UART_IEC_TE_MSK (0x2)
+#define UART_IEC_TE_OFST (1)
+#define UART_IEC_RE_MSK (0x1)
+#define UART_IEC_RE_OFST (0)
+
+#define UART_ISR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x20 ))
+#define UART_ISR_MI_MSK (0x8)
+#define UART_ISR_MI_OFST (3)
+#define UART_ISR_TII_MSK (0x4)
+#define UART_ISR_TII_OFST (2)
+#define UART_ISR_TI_MSK (0x2)
+#define UART_ISR_TI_OFST (1)
+#define UART_ISR_RI_MSK (0x1)
+#define UART_ISR_RI_OFST (0)
+
+#define UART_IID(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x24 ))
+#define UART_IID_IID_MSK (0x7)
+#define UART_IID_IID_OFST (0)
+
+#define UART_MC(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x28 ))
+#define UART_MC_OE_MSK (0x40)
+#define UART_MC_OE_OFST (6)
+#define UART_MC_SP_MSK (0x20)
+#define UART_MC_SP_OFST (5)
+#define UART_MC_EP_MSK (0x10)
+#define UART_MC_EP_OFST (4)
+#define UART_MC_PE_MSK (0x08)
+#define UART_MC_PE_OFST (3)
+#define UART_MC_ST_MSK (0x04)
+#define UART_MC_ST_ONE (0x0)
+#define UART_MC_ST_TWO (0x04)
+#define UART_MC_ST_OFST (2)
+#define UART_MC_CLS_MSK (0x03)
+#define UART_MC_CLS_OFST (0)
+#define UART_MC_CLS_CHARLEN_5 (0)
+#define UART_MC_CLS_CHARLEN_6 (1)
+#define UART_MC_CLS_CHARLEN_7 (2)
+#define UART_MC_CLS_CHARLEN_8 (3)
+
+#define UART_MCR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x2c ))
+#define UART_MCR_AC_MSK (0x80)
+#define UART_MCR_AC_OFST (7)
+#define UART_MCR_AR_MSK (0x40)
+#define UART_MCR_AR_OFST (6)
+#define UART_MCR_BR_MSK (0x20)
+#define UART_MCR_BR_OFST (5)
+#define UART_MCR_LB_MSK (0x10)
+#define UART_MCR_LB_OFST (4)
+#define UART_MCR_DCD_MSK (0x08)
+#define UART_MCR_DCD_OFST (3)
+#define UART_MCR_RI_MSK (0x04)
+#define UART_MCR_RI_OFST (2)
+#define UART_MCR_DTR_MSK (0x02)
+#define UART_MCR_DTR_OFST (1)
+#define UART_MCR_RTS_MSK (0x01)
+#define UART_MCR_RTS_OFST (0)
+
+#define UART_MSR(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x30 ))
+#define UART_MSR_DCD_MSK (0x80)
+#define UART_MSR_DCD_OFST (7)
+#define UART_MSR_RI_MSK (0x40)
+#define UART_MSR_RI_OFST (6)
+#define UART_MSR_DSR_MSK (0x20)
+#define UART_MSR_DSR_OFST (5)
+#define UART_MSR_CTS_MSK (0x10)
+#define UART_MSR_CTS_OFST (4)
+#define UART_MSR_DDCD_MSK (0x08)
+#define UART_MSR_DDCD_OFST (3)
+#define UART_MSR_TERI_MSK (0x04)
+#define UART_MSR_TERI_OFST (2)
+#define UART_MSR_DDSR_MSK (0x02)
+#define UART_MSR_DDSR_OFST (1)
+#define UART_MSR_DCTS_MSK (0x01)
+#define UART_MSR_DCTS_OFST (0)
+
+#define UART_DIV_LO(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x34 ))
+#define UART_DIV_LO_DIV_MSK (0xff)
+#define UART_DIV_LO_DIV_OFST (0)
+
+#define UART_DIV_HI(BASE_ADDR) (UART00_TYPE (BASE_ADDR + 0x38 ))
+#define UART_DIV_HI_DIV_MSK (0xff)
+#define UART_DIV_HI_DIV_OFST (0)
+
+#endif /* __UART00_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/uncompress.h linux/include/asm-arm/arch-epxa10db/uncompress.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/uncompress.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/uncompress.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,50 @@
+/*
+ * linux/include/asm-arm/arch-epxa10db/uncompress.h
+ *
+ * Copyright (C) 1999 ARM Limited
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */

+#include "asm/arch/platform.h"
+#include "asm/arch/hardware.h"
+#define UART00_TYPE (volatile unsigned int*)
+#include "asm/arch/uart00.h"
+
+/*
+ * This does not append a newline
+ */
+static void puts(const char *s)
+{
+ while (*s) {
+ while ((*UART_TSR(IO_ADDRESS(EXC_UART00_BASE)) & UART_TSR_TX_LEVEL_MSK)==15);
+
+ *UART_TD(IO_ADDRESS(EXC_UART00_BASE)) = *s;
+
+ if (*s == '\n') {
+ while ((*UART_TSR(IO_ADDRESS(EXC_UART00_BASE)) & UART_TSR_TX_LEVEL_MSK)==15);
+
+ *UART_TD(IO_ADDRESS(EXC_UART00_BASE)) = '\r';
+ }
+ s++;
+ }
+}
+
+/*
+ * nothing to do
+ */
+#define arch_decomp_setup()
+
+#define arch_decomp_wdog()
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/vmalloc.h linux/include/asm-arm/arch-epxa10db/vmalloc.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/vmalloc.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/vmalloc.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,32 @@
+/*
+ * linux/include/asm-arm/arch-epxa10db/vmalloc.h
+ *
+ * Copyright (C) 2000 Russell King.


+ *
+ * This 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
+ */
+

+/*
+ * 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
+ * any out-of-bounds memory accesses will hopefully be caught.
+ * The vmalloc() routines leaves a hole of 4kB between each vmalloced
+ * area for the same reason. ;)
+ */
+#define VMALLOC_OFFSET (8*1024*1024)
+#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
+#define VMALLOC_VMADDR(x) ((unsigned long)(x))
+#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-integrator/keyboard.h linux/include/asm-arm/arch-integrator/keyboard.h
--- v2.4.13/linux/include/asm-arm/arch-integrator/keyboard.h Fri Mar 2 18:38:39 2001
+++ linux/include/asm-arm/arch-integrator/keyboard.h Thu Oct 25 13:53:53 2001


@@ -1,7 +1,7 @@
X /*

X * linux/include/asm-arm/arch-integrator/keyboard.h
X *
- * Copyright (C) 2000 Deep Blue Solutions Ltd.
+ * Copyright (C) 2000-2001 Deep Blue Solutions Ltd.
X *
X * This program is free software; you can redistribute it and/or modify
X * it under the terms of the GNU General Public License version 2 as
@@ -22,24 +22,8 @@
X
X #define NR_SCANCODES 128
X
-extern unsigned char kmi_kbd_sysrq_xlate[NR_SCANCODES];
-
-extern int kmi_kbd_setkeycode(u_int scancode, u_int keycode);
-extern int kmi_kbd_getkeycode(u_int scancode);
-extern int kmi_kbd_translate(u_char scancode, u_char *keycode, char raw_mode);
-extern char kmi_kbd_unexpected_up(u_char keycode);
-extern void kmi_kbd_leds(u_char leds);
X extern int kmi_kbd_init(void);
X
-#define kbd_setkeycode(sc,kc) kmi_kbd_setkeycode(sc,kc)
-#define kbd_getkeycode(sc) kmi_kbd_getkeycode(sc)
-
-#define kbd_translate(sc, kcp, rm) kmi_kbd_translate(sc,kcp,rm)
-#define kbd_unexpected_up(kc) kmi_kbd_unexpected_up(kc)
-#define kbd_leds(leds) kmi_kbd_leds(leds)
-#define kbd_init_hw() kmi_kbd_init()
-#define kbd_sysrq_xlate kmi_kbd_sysrq_xlate
-#define kbd_disable_irq() disable_irq(IRQ_KMIINT0)
-#define kbd_enable_irq() enable_irq(IRQ_KMIINT0)
-
-#define SYSRQ_KEY 0x54
+#define kbd_disable_irq() disable_irq(IRQ_KMIINT0)
+#define kbd_enable_irq() enable_irq(IRQ_KMIINT0)
+#define kbd_init_hw() kmi_kbd_init()
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-l7200/param.h linux/include/asm-arm/arch-l7200/param.h
--- v2.4.13/linux/include/asm-arm/arch-l7200/param.h Mon May 15 12:00:33 2000
+++ linux/include/asm-arm/arch-l7200/param.h Thu Oct 25 13:53:53 2001
@@ -20,4 +20,13 @@
X */
X #define HZ 128
X
+/*
+ * Define hz_to_std, since we have a non 100Hz define
+ * (see include/asm-arm/param.h)
+ */
+
+#if defined(__KERNEL__)
+#define hz_to_std(a) ((a * HZ)/100)
+#endif
+
X #endif
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-nexuspci/keyboard.h linux/include/asm-arm/arch-nexuspci/keyboard.h
--- v2.4.13/linux/include/asm-arm/arch-nexuspci/keyboard.h Mon Feb 28 14:16:37 2000
+++ linux/include/asm-arm/arch-nexuspci/keyboard.h Thu Oct 25 13:53:53 2001
@@ -3,27 +3,12 @@
X *
X * Driver definitions for PCI card dummy keyboard.
X *
- * Copyright (C) 1998 Russell King
+ * Copyright (C) 1998-2001 Russell King
X * Copyright (C) 1998 Philip Blundell
X */
X
X #define NR_SCANCODES 128
X
-#define kbd_setkeycode(sc,kc) (-EINVAL)
-#define kbd_getkeycode(sc) (-EINVAL)
-
-/* Prototype: int kbd_pretranslate(scancode, raw_mode)
- * Returns : 0 to ignore scancode
- */
-#define kbd_pretranslate(sc,rm) (1)
-
-/* Prototype: int kbd_translate(scancode, *keycode, *up_flag, raw_mode)
- * Returns : 0 to ignore scancode, *keycode set to keycode, *up_flag
- * set to 0200 if scancode indicates release
- */
-#define kbd_translate(sc, kcp, rm) 0
-#define kbd_unexpected_up(kc) (0200)
-#define kbd_leds(leds) do { } while (0)
-#define kbd_init_hw() do { } while (0)
-#define kbd_disable_irq() do { } while (0)
-#define kbd_enable_irq() do { } while (0)
+#define kbd_init_hw() do { } while (0)
+#define kbd_disable_irq() do { } while (0)
+#define kbd_enable_irq() do { } while (0)
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-rpc/keyboard.h linux/include/asm-arm/arch-rpc/keyboard.h
--- v2.4.13/linux/include/asm-arm/arch-rpc/keyboard.h Mon Sep 18 15:15:23 2000
+++ linux/include/asm-arm/arch-rpc/keyboard.h Thu Oct 25 13:53:53 2001


@@ -1,7 +1,7 @@
X /*

X * linux/include/asm-arm/arch-rpc/keyboard.h
X *
- * Copyright (C) 1998 Russell King
+ * Copyright (C) 1998-2001 Russell King
X *
X * This program is free software; you can redistribute it and/or modify
X * it under the terms of the GNU General Public License version 2 as
@@ -13,19 +13,8 @@
X
X #define NR_SCANCODES 128
X
-extern void ps2kbd_leds(unsigned char leds);
-extern void ps2kbd_init_hw(void);
-extern unsigned char ps2kbd_sysrq_xlate[NR_SCANCODES];
+extern int ps2kbd_init_hw(void);
X
-#define kbd_setkeycode(sc,kc) (-EINVAL)
-#define kbd_getkeycode(sc) (-EINVAL)
-
-#define kbd_translate(sc, kcp, rm) ({ *(kcp) = (sc); 1; })
-#define kbd_unexpected_up(kc) (0200)
-#define kbd_leds(leds) ps2kbd_leds(leds)
-#define kbd_init_hw() ps2kbd_init_hw()
-#define kbd_sysrq_xlate ps2kbd_sysrq_xlate
-#define kbd_disable_irq() disable_irq(IRQ_KEYBOARDRX)
-#define kbd_enable_irq() enable_irq(IRQ_KEYBOARDRX)
-
-#define SYSRQ_KEY 13
+#define kbd_disable_irq() disable_irq(IRQ_KEYBOARDRX)
+#define kbd_enable_irq() enable_irq(IRQ_KEYBOARDRX)
+#define kbd_init_hw() ps2kbd_init_hw()
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-sa1100/SA-1100.h linux/include/asm-arm/arch-sa1100/SA-1100.h
--- v2.4.13/linux/include/asm-arm/arch-sa1100/SA-1100.h Mon Aug 27 12:41:47 2001
+++ linux/include/asm-arm/arch-sa1100/SA-1100.h Thu Oct 25 13:53:54 2001
@@ -12,9 +12,6 @@
X * architecture version 4). This file is based on the
X * StrongARM SA-1100 data sheet version 2.2.
X *
- * Language-specific definitions are selected by the
- * macro "LANGUAGE", which should be defined as either
- * "C" (default) or "Assembly".
X */
X
X
@@ -23,100 +20,7 @@
X #error You must include hardware.h not SA-1100.h
X #endif
X
-
-#ifndef LANGUAGE
-# ifdef __ASSEMBLY__
-# define LANGUAGE Assembly
-# else
-# define LANGUAGE C
-# endif
-#endif
-
-#ifndef io_p2v
-#define io_p2v(PhAdd) (PhAdd)
-#endif
-
-#include <asm/arch/bitfield.h>
-
-#define C 0
-#define Assembly 1
-


-
-#if LANGUAGE == C

-typedef unsigned short Word16 ;
-typedef unsigned int Word32 ;
-typedef Word32 Word ;
-typedef Word Quad [4] ;
-typedef void *Address ;
-typedef void (*ExcpHndlr) (void) ;


-#endif /* LANGUAGE == C */
-

-
-/*
- * Memory
- */
-
-#define MemBnkSp 0x08000000 /* Memory Bank Space [byte] */
-
-#define StMemBnkSp MemBnkSp /* Static Memory Bank Space [byte] */
-#define StMemBnk0Sp StMemBnkSp /* Static Memory Bank 0 Space */
- /* [byte] */
-#define StMemBnk1Sp StMemBnkSp /* Static Memory Bank 1 Space */
- /* [byte] */
-#define StMemBnk2Sp StMemBnkSp /* Static Memory Bank 2 Space */
- /* [byte] */
-#define StMemBnk3Sp StMemBnkSp /* Static Memory Bank 3 Space */
- /* [byte] */
-
-#define DRAMBnkSp MemBnkSp /* DRAM Bank Space [byte] */
-#define DRAMBnk0Sp DRAMBnkSp /* DRAM Bank 0 Space [byte] */
-#define DRAMBnk1Sp DRAMBnkSp /* DRAM Bank 1 Space [byte] */
-#define DRAMBnk2Sp DRAMBnkSp /* DRAM Bank 2 Space [byte] */
-#define DRAMBnk3Sp DRAMBnkSp /* DRAM Bank 3 Space [byte] */
-
-#define ZeroMemSp MemBnkSp /* Zero Memory bank Space [byte] */
-
-#define _StMemBnk(Nb) /* Static Memory Bank [0..3] */ \
- (0x00000000 + (Nb)*StMemBnkSp)
-#define _StMemBnk0 _StMemBnk (0) /* Static Memory Bank 0 */
-#define _StMemBnk1 _StMemBnk (1) /* Static Memory Bank 1 */
-#define _StMemBnk2 _StMemBnk (2) /* Static Memory Bank 2 */
-#define _StMemBnk3 _StMemBnk (3) /* Static Memory Bank 3 */


-
-#if LANGUAGE == C

-typedef Quad StMemBnkType [StMemBnkSp/sizeof (Quad)] ;
-#define StMemBnk /* Static Memory Bank [0..3] */ \
- ((StMemBnkType *) io_p2v (_StMemBnk (0)))
-#define StMemBnk0 (StMemBnk [0]) /* Static Memory Bank 0 */
-#define StMemBnk1 (StMemBnk [1]) /* Static Memory Bank 1 */
-#define StMemBnk2 (StMemBnk [2]) /* Static Memory Bank 2 */
-#define StMemBnk3 (StMemBnk [3]) /* Static Memory Bank 3 */


-#endif /* LANGUAGE == C */
-

-#define _DRAMBnk(Nb) /* DRAM Bank [0..3] */ \
- (0xC0000000 + (Nb)*DRAMBnkSp)
-#define _DRAMBnk0 _DRAMBnk (0) /* DRAM Bank 0 */
-#define _DRAMBnk1 _DRAMBnk (1) /* DRAM Bank 1 */
-#define _DRAMBnk2 _DRAMBnk (2) /* DRAM Bank 2 */
-#define _DRAMBnk3 _DRAMBnk (3) /* DRAM Bank 3 */


-
-#if LANGUAGE == C

-typedef Quad DRAMBnkType [DRAMBnkSp/sizeof (Quad)] ;
-#define DRAMBnk /* DRAM Bank [0..3] */ \
- ((DRAMBnkType *) io_p2v (_DRAMBnk (0)))
-#define DRAMBnk0 (DRAMBnk [0]) /* DRAM Bank 0 */
-#define DRAMBnk1 (DRAMBnk [1]) /* DRAM Bank 1 */
-#define DRAMBnk2 (DRAMBnk [2]) /* DRAM Bank 2 */
-#define DRAMBnk3 (DRAMBnk [3]) /* DRAM Bank 3 */


-#endif /* LANGUAGE == C */
-

-#define _ZeroMem 0xE0000000 /* Zero Memory bank */


-
-#if LANGUAGE == C

-typedef Quad ZeroMemType [ZeroMemSp/sizeof (Quad)] ;
-#define ZeroMem /* Zero Memory bank */ \
- (*((ZeroMemType *) io_p2v (_ZeroMem)))


-#endif /* LANGUAGE == C */

+#include "bitfield.h"
X
X
X /*
@@ -157,31 +61,6 @@
X #define _PCMCIA1Attr _PCMCIAAttr (1) /* PCMCIA 1 Attribute */
X #define _PCMCIA1Mem _PCMCIAMem (1) /* PCMCIA 1 Memory */


X
-#if LANGUAGE == C
-

-typedef Quad PCMCIAPrtType [PCMCIAPrtSp/sizeof (Quad)] ;
-typedef PCMCIAPrtType PCMCIAType [PCMCIASp/PCMCIAPrtSp] ;
-
-#define PCMCIA0 /* PCMCIA 0 */ \
- (*((PCMCIAType *) io_p2v (_PCMCIA0)))
-#define PCMCIA0IO /* PCMCIA 0 I/O */ \
- (*((PCMCIAPrtType *) io_p2v (_PCMCIA0IO)))
-#define PCMCIA0Attr /* PCMCIA 0 Attribute */ \
- (*((PCMCIAPrtType *) io_p2v (_PCMCIA0Attr)))
-#define PCMCIA0Mem /* PCMCIA 0 Memory */ \
- (*((PCMCIAPrtType *) io_p2v (_PCMCIA0Mem)))
-
-#define PCMCIA1 /* PCMCIA 1 */ \
- (*((PCMCIAType *) io_p2v (_PCMCIA1)))
-#define PCMCIA1IO /* PCMCIA 1 I/O */ \
- (*((PCMCIAPrtType *) io_p2v (_PCMCIA1IO)))
-#define PCMCIA1Attr /* PCMCIA 1 Attribute */ \
- (*((PCMCIAPrtType *) io_p2v (_PCMCIA1Attr)))
-#define PCMCIA1Mem /* PCMCIA 1 Memory */ \
- (*((PCMCIAPrtType *) io_p2v (_PCMCIA1Mem)))


-
-#endif /* LANGUAGE == C */
-
X

X /*
X * Universal Serial Bus (USB) Device Controller (UDC) control registers
@@ -218,56 +97,17 @@
X * Controller (UDC) Status Register (read/write).
X */
X
-#define _Ser0UDCCR 0x80000000 /* Ser. port 0 UDC Control Reg. */
-#define _Ser0UDCAR 0x80000004 /* Ser. port 0 UDC Address Reg. */
-#define _Ser0UDCOMP 0x80000008 /* Ser. port 0 UDC Output Maximum */
- /* Packet size reg. */
-#define _Ser0UDCIMP 0x8000000C /* Ser. port 0 UDC Input Maximum */
- /* Packet size reg. */
-#define _Ser0UDCCS0 0x80000010 /* Ser. port 0 UDC Control/Status */
- /* reg. end-point 0 */
-#define _Ser0UDCCS1 0x80000014 /* Ser. port 0 UDC Control/Status */


- /* reg. end-point 1 (output) */

-#define _Ser0UDCCS2 0x80000018 /* Ser. port 0 UDC Control/Status */


- /* reg. end-point 2 (input) */

-#define _Ser0UDCD0 0x8000001C /* Ser. port 0 UDC Data reg. */


- /* end-point 0 */

-#define _Ser0UDCWC 0x80000020 /* Ser. port 0 UDC Write Count */


- /* reg. end-point 0 */

-#define _Ser0UDCDR 0x80000028 /* Ser. port 0 UDC Data Reg. */
-#define _Ser0UDCSR 0x80000030 /* Ser. port 0 UDC Status Reg. */
-
-#if LANGUAGE == C
-#define Ser0UDCCR /* Ser. port 0 UDC Control Reg. */ \
- (*((volatile Word *) io_p2v (_Ser0UDCCR)))
-#define Ser0UDCAR /* Ser. port 0 UDC Address Reg. */ \
- (*((volatile Word *) io_p2v (_Ser0UDCAR)))
-#define Ser0UDCOMP /* Ser. port 0 UDC Output Maximum */ \
- /* Packet size reg. */ \
- (*((volatile Word *) io_p2v (_Ser0UDCOMP)))
-#define Ser0UDCIMP /* Ser. port 0 UDC Input Maximum */ \
- /* Packet size reg. */ \
- (*((volatile Word *) io_p2v (_Ser0UDCIMP)))
-#define Ser0UDCCS0 /* Ser. port 0 UDC Control/Status */ \


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 47'
echo 'File patch-2.4.14 is continued in part 48'
echo "48" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:03 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part40

#!/bin/sh -x
# this is part 40 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 40; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

- if ((devc->recmask & SOUND_MASK_MIC) == 0)
- return;
- mask = 0x0030;


- reg_l = 0x200;
- reg_r = 0x600;

- lev_left = SCALE(lev_left, 3) << 4;
- lev_right = SCALE(lev_right, 3) << 4;
- break;
+/*
+ * Set the ADC MUX to the specified values. We do NOT do any
+ * checking of the values passed, since we assume that the
+ * relevant *_select_input function has done that for us.
+ */
+static void
+waveartist_set_adc_mux(wavnc_info *devc, char left_dev, char right_dev)
+{
+ unsigned int reg_08, reg_09;
X
- case SOUND_MIXER_RECLEV:
- mask = 0x000f;
- reg_l = 0x300;
- reg_r = 0x700;
- lev_left = SCALE(lev_left, 10);
- lev_right = SCALE(lev_right, 10);
- break;
+ reg_08 = waveartist_cmd1_r(devc, WACMD_GET_LEVEL | 0x0800);
+ reg_09 = waveartist_cmd1_r(devc, WACMD_GET_LEVEL | 0x0900);
X
- case SOUND_MIXER_LINE1:
- if ((devc->recmask & SOUND_MASK_LINE1) == 0)
- return;
- mask = 0x003e;


- reg_l = 0x000;
- reg_r = 0x400;

- lev_left = SCALE(lev_left, 31) << 1;
- lev_right = SCALE(lev_right, 31) << 1;
- break;
+ reg_08 = (reg_08 & ~0x3f) | right_dev << 3 | left_dev;
X
- case SOUND_MIXER_PCM:
- waveartist_cmd3(devc, WACMD_SET_LEVEL,
- SCALE(lev_left, 32767),
- SCALE(lev_right, 32767));
- return;
+ waveartist_cmd3(devc, WACMD_SET_MIXER, reg_08, reg_09);
+}
X
- case SOUND_MIXER_SYNTH:
- waveartist_cmd3(devc, 0x0100 | WACMD_SET_LEVEL,
- SCALE(lev_left, 32767),
- SCALE(lev_right, 32767));
- return;
+/*
+ * Decode a recording mask into a mixer selection as follows:
+ *
+ * OSS Source WA Source Actual source
+ * SOUND_MASK_IMIX Mixer Mixer output (same as AD1848)
+ * SOUND_MASK_LINE Line Line in
+ * SOUND_MASK_LINE1 Aux 1 Aux 1 in
+ * SOUND_MASK_LINE2 Aux 2 Aux 2 in
+ * SOUND_MASK_MIC Mic Microphone
+ */
+static unsigned int
+waveartist_select_input(wavnc_info *devc, unsigned int recmask,
+ unsigned char *dev_l, unsigned char *dev_r)
+{
+ unsigned int recdev = ADC_MUX_NONE;
X
- default:
- return;
+ if (recmask & SOUND_MASK_IMIX) {
+ recmask = SOUND_MASK_IMIX;
+ recdev = ADC_MUX_MIXER;
+ } else if (recmask & SOUND_MASK_LINE2) {
+ recmask = SOUND_MASK_LINE2;
+ recdev = ADC_MUX_AUX2;
+ } else if (recmask & SOUND_MASK_LINE1) {
+ recmask = SOUND_MASK_LINE1;
+ recdev = ADC_MUX_AUX1;
+ } else if (recmask & SOUND_MASK_LINE) {
+ recmask = SOUND_MASK_LINE;
+ recdev = ADC_MUX_LINE;
+ } else if (recmask & SOUND_MASK_MIC) {
+ recmask = SOUND_MASK_MIC;
+ recdev = ADC_MUX_MIC;
X }
X
- /* read left setting */
- vals[0] = reg_l + WACMD_GET_LEVEL;
- waveartist_cmd(devc, 1, vals, 1, vals + 1);
+ *dev_l = *dev_r = recdev;
+
+ return recmask;
+}
+
+static int
+waveartist_decode_mixer(wavnc_info *devc, int dev, unsigned char lev_l,
+ unsigned char lev_r)
+{
+ switch (dev) {
+ case SOUND_MIXER_VOLUME:
+ case SOUND_MIXER_SYNTH:
+ case SOUND_MIXER_PCM:
+ case SOUND_MIXER_LINE:
+ case SOUND_MIXER_MIC:
+ case SOUND_MIXER_IGAIN:
+ case SOUND_MIXER_LINE1:
+ case SOUND_MIXER_LINE2:
+ devc->levels[dev] = lev_l | lev_r << 8;
+ break;
+
+ case SOUND_MIXER_IMIX:
+ break;
X
- /* read right setting */
- vals[0] = reg_r + 0x30;
- waveartist_cmd(devc, 1, vals, 1, vals + 2);
+ default:
+ dev = -EINVAL;
+ break;
+ }
X
- vals[1] = (vals[1] & ~mask) | (lev_left & mask);
- vals[2] = (vals[2] & ~mask) | (lev_right & mask);
+ return dev;
+}
X
- /* write left,right back */
- vals[0] = WACMD_SET_MIXER;
- waveartist_cmd(devc, 3, vals, 0, NULL);
+static int waveartist_get_mixer(wavnc_info *devc, int dev)
+{
+ return devc->levels[dev];
X }
X
+static const struct waveartist_mixer_info waveartist_mixer = {
+ supported_devs: SUPPORTED_MIXER_DEVICES | SOUND_MASK_IGAIN,
+ recording_devs: SOUND_MASK_LINE | SOUND_MASK_MIC |
+ SOUND_MASK_LINE1 | SOUND_MASK_LINE2 |
+ SOUND_MASK_IMIX,
+ stereo_devs: (SUPPORTED_MIXER_DEVICES | SOUND_MASK_IGAIN) & ~
+ (SOUND_MASK_SPEAKER | SOUND_MASK_IMIX),
+ select_input: waveartist_select_input,
+ decode_mixer: waveartist_decode_mixer,
+ get_mixer: waveartist_get_mixer,


+};
+
X static void

-waveartist_select_input(wavnc_info *devc, unsigned int input)
+waveartist_set_recmask(wavnc_info *devc, unsigned int recmask)
X {


- unsigned int vals[3];

+ unsigned char dev_l, dev_r;
X
- /*
- * Get reg 9
- */
- vals[0] = 0x0830;
- waveartist_cmd(devc, 1, vals, 1, vals + 1);
+ recmask &= devc->mix->recording_devs;
X
X /*
- * Get reg 10, only so that we can write it back.
+ * If more than one recording device selected,
+ * disable the device that is currently in use.
X */
- vals[0] = 0x0930;
- waveartist_cmd(devc, 1, vals, 1, vals + 2);
-
- if (debug_flg & DEBUG_MIXER)
- printk("RECSRC: old left: 0x%04X, old right: 0x%04X.\n",
- vals[1] & 0x07, (vals[1] >> 3) & 0x07);
+ if (hweight32(recmask) > 1)
+ recmask &= ~devc->recmask;
X
X /*
- * kill current left/right mux input select
+ * Translate the recording device mask into
+ * the ADC multiplexer settings.
X */
- vals[1] &= ~0x03F;
+ devc->recmask = devc->mix->select_input(devc, recmask,
+ &dev_l, &dev_r);
X
- switch (input) {
- case SOUND_MASK_MIC:
- /*
- * right=mic, left=mic
- */
- vals[1] |= 0x002D;
- break;
-
- case SOUND_MASK_LINE1:
- /*
- * right=none, left=Aux1;
- */
- vals[1] |= 0x0004;
- break;
+ waveartist_set_adc_mux(devc, dev_l, dev_r);
+}
X
- case SOUND_MASK_LINE:
- /*
- * right=Line, left=Line;
- */
- vals[1] |= 0x0012;
- break;
- }
+static int
+waveartist_set_mixer(wavnc_info *devc, int dev, unsigned int level)
+{
+ unsigned int lev_left = level & 0x00ff;
+ unsigned int lev_right = (level & 0xff00) >> 8;
X
- if (debug_flg & DEBUG_MIXER)
- printk("RECSRC %d: left=0x%04X, right=0x%04X.\n", input,
- vals[1] & 0x07, (vals[1] >> 3) & 0x07);


+ if (lev_left > 100)
+ lev_left = 100;
+ if (lev_right > 100)
+ lev_right = 100;

X
X /*
- * and finally - write the reg pair back....
+ * Mono devices have their right volume forced to their
+ * left volume. (from ALSA driver OSS emulation).
X */
- vals[0] = WACMD_SET_MIXER;
+ if (!(devc->mix->stereo_devs & (1 << dev)))
+ lev_right = lev_left;
X
- waveartist_cmd(devc, 3, vals, 0, NULL);
+ dev = devc->mix->decode_mixer(devc, dev, lev_left, lev_right);
+
+ if (dev >= 0)
+ waveartist_mixer_update(devc, dev);
+
+ return dev < 0 ? dev : 0;


X }
X
X static int

-waveartist_mixer_set(wavnc_info *devc, int whichDev, unsigned int level)
+waveartist_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
X {
- unsigned int lev_left = level & 0x007f;
- unsigned int lev_right = (level & 0x7f00) >> 8;
- int left, right, devmask;
-
- left = level & 0x7f;
- right = (level & 0x7f00) >> 8;
-
- if (debug_flg & DEBUG_MIXER)
- printk("wa_mixer_set(dev=%d, level=%X)\n",
- whichDev, level);
-
- switch (whichDev) {
- case SOUND_MIXER_VOLUME: /* master volume (0-7) */
- case SOUND_MIXER_LINE: /* external line (0-31) */
- case SOUND_MIXER_MIC: /* mono mic (0-3) */
- case SOUND_MIXER_RECLEV: /* recording level (0-7) */
- case SOUND_MIXER_LINE1: /* mono external aux1 (0-31) */
- case SOUND_MIXER_PCM: /* Waveartist PCM (0-32767) */
- case SOUND_MIXER_SYNTH: /* internal synth (0-31) */
- case SOUND_MIXER_IMIX: /* recording feedback */
- devc->levels[whichDev] = lev_left | lev_right << 8;
- waveartist_mixer_update(devc, whichDev);
- break;
+ wavnc_info *devc = (wavnc_info *)audio_devs[dev]->devc;
+ int ret = 0, val, nr;
X
- /* Select recording input source
+ /*
+ * All SOUND_MIXER_* ioctls use type 'M'
X */
- case SOUND_MIXER_RECSRC:
- devmask = level & devc->rec_devices;
+ if (((cmd >> 8) & 255) != 'M')
+ return -ENOIOCTLCMD;
X
X #ifdef CONFIG_ARCH_NETWINDER
- if (machine_is_netwinder())
- vnc_configure_mixer(devc);
+ if (machine_is_netwinder()) {
+ ret = vnc_private_ioctl(dev, cmd, arg);
+ if (ret != -ENOIOCTLCMD)
+ return ret;
X else


+ ret = 0;
+ }

X #endif
- {
- waveartist_select_input(devc, level);
X
- /*
- * if record monitoring is on, make sure the bit is set
- */
- if (devc->levels[SOUND_MIXER_IMIX])
- waveartist_mixer_update(devc, SOUND_MIXER_IMIX);
+ nr = cmd & 0xff;
+
+ if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
+ if (get_user(val, (int *)arg))
+ return -EFAULT;
+
+ switch (nr) {
+ case SOUND_MIXER_RECSRC:
+ waveartist_set_recmask(devc, val);


+ break;
+
+ default:
+ ret = -EINVAL;

+ if (nr < SOUND_MIXER_NRDEVICES &&
+ devc->mix->supported_devs & (1 << nr))
+ ret = waveartist_set_mixer(devc, nr, val);
X }
+ }
X
- /*
- * do not save in "levels", return current setting
- */
- return devc->recmask;
+ if (ret == 0 && _SIOC_DIR(cmd) & _SIOC_READ) {
+ ret = -EINVAL;
X
- default:
- return -EINVAL;
+ switch (nr) {
+ case SOUND_MIXER_RECSRC:
+ ret = devc->recmask;
+ break;
+
+ case SOUND_MIXER_DEVMASK:
+ ret = devc->mix->supported_devs;
+ break;
+
+ case SOUND_MIXER_STEREODEVS:
+ ret = devc->mix->stereo_devs;
+ break;
+
+ case SOUND_MIXER_RECMASK:
+ ret = devc->mix->recording_devs;
+ break;
+
+ case SOUND_MIXER_CAPS:
+ ret = SOUND_CAP_EXCL_INPUT;


+ break;
+
+ default:

+ if (nr < SOUND_MIXER_NRDEVICES)
+ ret = devc->mix->get_mixer(devc, nr);
+ break;
+ }
+
+ if (ret >= 0)
+ ret = put_user(ret, (int *)arg) ? -EFAULT : 0;
X }
X
- return devc->levels[whichDev];


+ return ret;
X }
X

+static struct mixer_operations waveartist_mixer_operations =
+{
+ owner: THIS_MODULE,
+ id: "WaveArtist",
+ name: "WaveArtist",
+ ioctl: waveartist_mixer_ioctl


+};
+
X static void

X waveartist_mixer_reset(wavnc_info *devc)
X {
@@ -1098,7 +1227,7 @@
X waveartist_cmd3(devc, WACMD_SET_MIXER, 0x9800, 0xa836);
X
X /*
- * set mixer input select to none, RX filter gains 0 db
+ * set mixer input select to none, RX filter gains 0 dB
X */
X waveartist_cmd3(devc, WACMD_SET_MIXER, 0x4c00, 0x8c00);
X
@@ -1110,90 +1239,12 @@
X /* set default input device = internal mic
X * current recording device = none
X */
- devc->recmask = 0;
+ waveartist_set_recmask(devc, 0);
X
X for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
X waveartist_mixer_update(devc, i);
-
- devc->supported_devices = SUPPORTED_MIXER_DEVICES;
- devc->rec_devices = POSSIBLE_RECORDING_DEVICES;
-
- if (machine_is_netwinder()) {
- devc->supported_devices |= SOUND_MASK_PHONEIN | SOUND_MASK_PHONEOUT;
- devc->rec_devices |= SOUND_MASK_PHONEIN;
- }
X }
X
-static int
-waveartist_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
-{
- wavnc_info *devc = (wavnc_info *)audio_devs[dev]->devc;
- int ret;
-
-#ifdef CONFIG_ARCH_NETWINDER
- if (machine_is_netwinder()) {
- ret = vnc_private_ioctl(dev, cmd, arg);
- if (ret != -ENOIOCTLCMD)
- return ret;
- }
-#endif
-
- if (((cmd >> 8) & 0xff) == 'M') {
- if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
- int val;
-
- if (get_user(val, (int *)arg))
- return -EFAULT;
-
- return waveartist_mixer_set(devc, cmd & 0xff, val);
- } else {
- /*
- * Return parameters
- */
- switch (cmd & 0xff) {
- case SOUND_MIXER_RECSRC:
- ret = devc->recmask;
- break;
-
- case SOUND_MIXER_DEVMASK:
- ret = devc->supported_devices;
- break;
-
- case SOUND_MIXER_STEREODEVS:
- ret = devc->supported_devices &
- ~(SOUND_MASK_SPEAKER|SOUND_MASK_IMIX);
- break;
-
- case SOUND_MIXER_RECMASK:
- ret = devc->rec_devices;
- break;
-
- case SOUND_MIXER_CAPS:
- ret = SOUND_CAP_EXCL_INPUT;


- break;
-
- default:

- if ((cmd & 0xff) < SOUND_MIXER_NRDEVICES)
- ret = devc->levels[cmd & 0xff];
- else


- return -EINVAL;
- }
-

- return put_user(ret, (int *)arg) ? -EFAULT : 0;
- }
- }
-
- return -ENOIOCTLCMD;
-}
-
-static struct mixer_operations waveartist_mixer_operations =
-{
- owner: THIS_MODULE,
- id: "WaveArtist",
- name: "WaveArtist NetWinder",
- ioctl: waveartist_mixer_ioctl
-};
-
X static int __init waveartist_init(wavnc_info *devc)
X {
X wavnc_port_info *portc;
@@ -1297,13 +1348,13 @@


X return 0;
X }
X

- if (hw_config->irq > _ISA_IRQ(15) || hw_config->irq < _ISA_IRQ(0)) {
+ if (hw_config->irq > 15 || hw_config->irq < 0) {
X printk(KERN_WARNING "WaveArtist: Bad IRQ %d\n",
X hw_config->irq);


X return 0;
X }
X

- if (hw_config->dma != _ISA_DMA(3)) {
+ if (hw_config->dma != 3) {
X printk(KERN_WARNING "WaveArtist: Bad DMA %d\n",
X hw_config->dma);
X return 0;
@@ -1317,7 +1368,8 @@


X return 1;
X }
X

-static void __init attach_waveartist(struct address_info *hw)
+static void __init
+attach_waveartist(struct address_info *hw, const struct waveartist_mixer_info *mix)
X {
X wavnc_info *devc = &adev_info[nr_waveartist_devs];
X
@@ -1339,6 +1391,7 @@
X
X request_region(hw->io_base, 15, devc->hw.name);
X
+ devc->mix = mix;
X devc->dev_no = waveartist_init(devc);
X
X if (devc->dev_no < 0)
@@ -1352,7 +1405,9 @@
X vnc_timer.data = nr_waveartist_devs;
X add_timer(&vnc_timer);
X
- vnc_configure_mixer(devc);
+ vnc_configure_mixer(devc, 0);
+
+ devc->no_autoselect = 1;
X }
X #endif
X nr_waveartist_devs += 1;
@@ -1408,10 +1463,14 @@
X "to unload\n");
X }
X
+#ifdef CONFIG_ARCH_NETWINDER
+
X /*
X * Rebel.com Netwinder specifics...
X */
X
+#include <asm/hardware/dec21285.h>
+
X #define VNC_TIMER_PERIOD (HZ/4) //check slider 4 times/sec
X
X #define MIXER_PRIVATE3_RESET 0x53570000
@@ -1427,7 +1486,7 @@
X extern spinlock_t gpio_lock;


X
X static inline void

-vnc_update_spkr_mute(wavnc_info *devc)
+vnc_mute_spkr(wavnc_info *devc)
X {


X unsigned long flags;
X

@@ -1437,8 +1496,22 @@
X }
X
X static void
-vnc_mute_lout(wavnc_info *devc, int mute)
+vnc_mute_lout(wavnc_info *devc)
X {
+ unsigned int left, right;
+
+ left = waveartist_cmd1_r(devc, WACMD_GET_LEVEL);
+ right = waveartist_cmd1_r(devc, WACMD_GET_LEVEL | 0x400);
+
+ if (devc->line_mute_state) {
+ left &= ~1;
+ right &= ~1;
+ } else {
+ left |= 1;
+ right |= 1;
+ }


+ waveartist_cmd3(devc, WACMD_SET_MIXER, left, right);
+

X }
X
X static int

@@ -1491,67 +1564,177 @@
X return old_slider_volume;
X }
X
-static void
-vnc_configure_mixer(wavnc_info *devc)
+/*
+ * Decode a recording mask into a mixer selection on the NetWinder
+ * as follows:
+ *
+ * OSS Source WA Source Actual source
+ * SOUND_MASK_IMIX Mixer Mixer output (same as AD1848)
+ * SOUND_MASK_LINE Line Line in
+ * SOUND_MASK_LINE1 Left Mic Handset
+ * SOUND_MASK_PHONEIN Left Aux Telephone microphone
+ * SOUND_MASK_MIC Right Mic Builtin microphone
+ */
+static unsigned int
+netwinder_select_input(wavnc_info *devc, unsigned int recmask,
+ unsigned char *dev_l, unsigned char *dev_r)
X {
- u_int vals[3];
+ unsigned int recdev_l = ADC_MUX_NONE, recdev_r = ADC_MUX_NONE;
X
- if (!devc->no_autoselect) {
- if (devc->handset_detect) {
- devc->recmask = SOUND_MASK_LINE1;
- devc->spkr_mute_state = devc->line_mute_state = 1;
- } else if (devc->telephone_detect) {
- devc->recmask = SOUND_MASK_PHONEIN;
- devc->spkr_mute_state = devc->line_mute_state = 1;
- } else {
- /* unless someone has asked for LINE-IN,
- * we default to MIC
- */


- if ((devc->recmask & SOUND_MASK_LINE) == 0)

- devc->recmask = SOUND_MASK_MIC;
- devc->spkr_mute_state = devc->line_mute_state = 0;
- }
- vnc_update_spkr_mute(devc);
- vnc_mute_lout(devc, devc->spkr_mute_state);
+ if (recmask & SOUND_MASK_IMIX) {
+ recmask = SOUND_MASK_IMIX;
+ recdev_l = ADC_MUX_MIXER;
+ recdev_r = ADC_MUX_MIXER;
+ } else if (recmask & SOUND_MASK_LINE) {
+ recmask = SOUND_MASK_LINE;
+ recdev_l = ADC_MUX_LINE;
+ recdev_r = ADC_MUX_LINE;
+ } else if (recmask & SOUND_MASK_LINE1) {
+ recmask = SOUND_MASK_LINE1;
+ waveartist_cmd1(devc, WACMD_SET_MONO); /* left */
+ recdev_l = ADC_MUX_MIC;
+ recdev_r = ADC_MUX_NONE;
+ } else if (recmask & SOUND_MASK_PHONEIN) {
+ recmask = SOUND_MASK_PHONEIN;
+ waveartist_cmd1(devc, WACMD_SET_MONO); /* left */
+ recdev_l = ADC_MUX_AUX1;
+ recdev_r = ADC_MUX_NONE;
+ } else if (recmask & SOUND_MASK_MIC) {
+ recmask = SOUND_MASK_MIC;
+ waveartist_cmd1(devc, WACMD_SET_MONO | 0x100); /* right */
+ recdev_l = ADC_MUX_NONE;
+ recdev_r = ADC_MUX_MIC;
X }
X
- /* Ok. At this point, we have done the autoswitch logic, or we
- * have had a command from an ioctl. We have a valid devc->recmask.
- * Now we have to connect up the hardware to reflect the recmask.
- */
- vals[1] = waveartist_cmd1_r(devc, WACMD_GET_LEVEL | 0x800);
- vals[2] = waveartist_cmd1_r(devc, WACMD_GET_LEVEL | 0x900);
+ *dev_l = recdev_l;
+ *dev_r = recdev_r;
X
- vals[1] &= ~0x3f;
+ return recmask;
+}
X
- switch(devc->recmask) {
- case SOUND_MASK_MIC: /* builtin mic */
- waveartist_cmd1(devc, WACMD_SET_MONO | 0x100); /* right */
- vals[1] |= 0x28;
+static int
+netwinder_decode_mixer(wavnc_info *devc, int dev, unsigned char lev_l,
+ unsigned char lev_r)
+{
+ switch (dev) {
+ case SOUND_MIXER_VOLUME:
+ case SOUND_MIXER_SYNTH:
+ case SOUND_MIXER_PCM:
+ case SOUND_MIXER_LINE:
+ case SOUND_MIXER_IGAIN:
+ devc->levels[dev] = lev_l | lev_r << 8;
X break;
X
- case SOUND_MASK_LINE1: /* out handset */
- waveartist_cmd1(devc, WACMD_SET_MONO); /* left */
- vals[1] |= 0x05;
+ case SOUND_MIXER_MIC: /* right mic only */
+ devc->levels[SOUND_MIXER_MIC] &= 0xff;
+ devc->levels[SOUND_MIXER_MIC] |= lev_l << 8;
X break;
X
- case SOUND_MASK_PHONEIN: /* our telephone mic */
- waveartist_cmd1(devc, WACMD_SET_MONO); /* left */
- vals[1] |= 0x04;
+ case SOUND_MIXER_LINE1: /* left mic only */
+ devc->levels[SOUND_MIXER_MIC] &= 0xff00;
+ devc->levels[SOUND_MIXER_MIC] |= lev_l;
+ dev = SOUND_MIXER_MIC;
X break;
X
- case SOUND_MASK_LINE: /* stereo line in */
- vals[1] |= 12;
+ case SOUND_MIXER_PHONEIN: /* left aux only */
+ devc->levels[SOUND_MIXER_LINE1] = lev_l;
+ dev = SOUND_MIXER_LINE1;
+ break;
+
+ case SOUND_MIXER_IMIX:
+ case SOUND_MIXER_PHONEOUT:


X break;
X
X default:

- return;
+ dev = -EINVAL;
+ break;
X }
+ return dev;
+}
+
+static int netwinder_get_mixer(wavnc_info *devc, int dev)
+{
+ int levels;
+
+ switch (dev) {
+ case SOUND_MIXER_VOLUME:
+ case SOUND_MIXER_SYNTH:
+ case SOUND_MIXER_PCM:
+ case SOUND_MIXER_LINE:
+ case SOUND_MIXER_IGAIN:
+ levels = devc->levels[dev];
+ break;
+
+ case SOUND_MIXER_MIC: /* builtin mic: right mic only */
+ levels = devc->levels[SOUND_MIXER_MIC] >> 8;
+ levels |= levels << 8;
+ break;
X
- vals[0] = WACMD_SET_MIXER;
- waveartist_cmd(devc, 3, vals, 0, NULL);
+ case SOUND_MIXER_LINE1: /* handset mic: left mic only */
+ levels = devc->levels[SOUND_MIXER_MIC] & 0xff;
+ levels |= levels << 8;
+ break;
+
+ case SOUND_MIXER_PHONEIN: /* phone mic: left aux1 only */
+ levels = devc->levels[SOUND_MIXER_LINE1] & 0xff;
+ levels |= levels << 8;
+ break;
X
- waveartist_mixer_update(devc, SOUND_MIXER_IMIX);
+ default:
+ levels = 0;
+ }
+
+ return levels;
+}
+
+/*
+ * Waveartist specific mixer information.
+ */
+static const struct waveartist_mixer_info netwinder_mixer = {
+ supported_devs: SOUND_MASK_VOLUME | SOUND_MASK_SYNTH |
+ SOUND_MASK_PCM | SOUND_MASK_SPEAKER |
+ SOUND_MASK_LINE | SOUND_MASK_MIC |
+ SOUND_MASK_IMIX | SOUND_MASK_LINE1 |
+ SOUND_MASK_PHONEIN | SOUND_MASK_PHONEOUT|
+ SOUND_MASK_IGAIN,
+
+ recording_devs: SOUND_MASK_LINE | SOUND_MASK_MIC |
+ SOUND_MASK_IMIX | SOUND_MASK_LINE1 |
+ SOUND_MASK_PHONEIN,
+
+ stereo_devs: SOUND_MASK_VOLUME | SOUND_MASK_SYNTH |
+ SOUND_MASK_PCM | SOUND_MASK_LINE |
+ SOUND_MASK_IMIX | SOUND_MASK_IGAIN,
+
+ select_input: netwinder_select_input,
+ decode_mixer: netwinder_decode_mixer,
+ get_mixer: netwinder_get_mixer,
+};
+
+static void
+vnc_configure_mixer(wavnc_info *devc, unsigned int recmask)
+{
+ if (!devc->no_autoselect) {
+ if (devc->handset_detect) {
+ recmask = SOUND_MASK_LINE1;
+ devc->spkr_mute_state = devc->line_mute_state = 1;
+ } else if (devc->telephone_detect) {
+ recmask = SOUND_MASK_PHONEIN;
+ devc->spkr_mute_state = devc->line_mute_state = 1;
+ } else {
+ /* unless someone has asked for LINE-IN,
+ * we default to MIC
+ */
+ if ((devc->recmask & SOUND_MASK_LINE) == 0)
+ devc->recmask = SOUND_MASK_MIC;
+ devc->spkr_mute_state = devc->line_mute_state = 0;
+ }
+ vnc_mute_spkr(devc);
+ vnc_mute_lout(devc);
+
+ if (recmask != devc->recmask)
+ waveartist_set_recmask(devc, recmask);
+ }


X }
X
X static int

@@ -1562,10 +1745,10 @@
X
X /*
X * read the "buttons" state.
- * Bit 4 = handset present,
- * Bit 5 = offhook
+ * Bit 4 = 0 means handset present
+ * Bit 5 = 1 means phone offhook
X */
- temp = inb(0x201) & 0x30;
+ temp = inb(0x201);
X
X old_hs = devc->handset_detect;
X old_td = devc->telephone_detect;
@@ -1576,7 +1759,7 @@
X if (!devc->no_autoselect &&
X (old_hs != devc->handset_detect ||
X old_td != devc->telephone_detect))
- vnc_configure_mixer(devc);
+ vnc_configure_mixer(devc, devc->recmask);
X
X slider_volume = vnc_volume_slider(devc);
X
@@ -1596,7 +1779,7 @@
X if (slider_volume != temp && devc->use_slider) {
X devc->slider_vol = slider_volume;
X
- waveartist_mixer_set(devc, SOUND_MIXER_VOLUME,
+ waveartist_set_mixer(devc, SOUND_MIXER_VOLUME,
X slider_volume | slider_volume << 8);
X
X return 1;
@@ -1648,13 +1831,13 @@
X devc->line_mute_state = (val & VNC_MUTE_LINE_OUT) ? 1 : 0;
X
X if (prev_spkr_mute != devc->spkr_mute_state)
- vnc_update_spkr_mute(devc);
+ vnc_mute_spkr(devc);
X
X if (prev_line_mute != devc->line_mute_state)
- vnc_mute_lout(devc, devc->line_mute_state);
+ vnc_mute_lout(devc);
X
X if (prev_auto_state != devc->no_autoselect)
- vnc_configure_mixer(devc);
+ vnc_configure_mixer(devc, devc->recmask);


X
X return 0;
X }

@@ -1735,32 +1918,40 @@
X return put_user(val, (int *)arg) ? -EFAULT : 0;
X }
X
- if (((cmd >> 8) & 0xff) == 'M') {
- if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
- /*
- * special case for master volume: if we
- * received this call - switch from hw
- * volume control to a software volume
- * control, till the hw volume is modified
- * to signal that user wants to be back in
- * hardware...
- */
- if ((cmd & 0xff) == SOUND_MIXER_VOLUME)
- devc->use_slider = 0;
- } else if ((cmd & 0xff) == SOUND_MIXER_STEREODEVS) {
- val = devc->supported_devices &
- ~(SOUND_MASK_IMIX |
- SOUND_MASK_MIC |
- SOUND_MASK_LINE1 |
- SOUND_MASK_PHONEIN |
- SOUND_MASK_PHONEOUT);
- return put_user(val, (int *)arg) ? -EFAULT : 0;
+ if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
+ /*
+ * special case for master volume: if we
+ * received this call - switch from hw
+ * volume control to a software volume
+ * control, till the hw volume is modified
+ * to signal that user wants to be back in
+ * hardware...
+ */
+ if ((cmd & 0xff) == SOUND_MIXER_VOLUME)
+ devc->use_slider = 0;
+
+ /* speaker output */
+ if ((cmd & 0xff) == SOUND_MIXER_SPEAKER) {
+ unsigned int val, l, r;
+
+ if (get_user(val, (int *)arg))
+ return -EFAULT;
+
+ l = val & 0x7f;
+ r = (val & 0x7f00) >> 8;
+ val = (l + r) / 2;
+ devc->levels[SOUND_MIXER_SPEAKER] = val | (val << 8);
+ devc->spkr_mute_state = (val <= 50);
+ vnc_mute_spkr(devc);
+ return 0;
X }
X }
X
X return -ENOIOCTLCMD;
X }
X
+#endif
+
X static struct address_info cfg;
X
X static int attached;
@@ -1771,13 +1962,10 @@
X static int __initdata dma2 = 0;
X
X
-MODULE_PARM(io, "i"); /* IO base */
-MODULE_PARM(irq, "i"); /* IRQ */
-MODULE_PARM(dma, "i"); /* DMA */
-MODULE_PARM(dma2, "i"); /* DMA2 */
-
X static int __init init_waveartist(void)
X {


+ const struct waveartist_mixer_info *mix;
+

X if (!io && machine_is_netwinder()) {
X /*
X * The NetWinder WaveArtist is at a fixed address.
@@ -1790,6 +1978,12 @@
X dma2 = 7;
X }
X
+ mix = &waveartist_mixer;
+#ifdef CONFIG_ARCH_NETWINDER
+ if (machine_is_netwinder())
+ mix = &netwinder_mixer;
+#endif
+
X cfg.io_base = io;
X cfg.irq = irq;
X cfg.dma = dma;
@@ -1798,7 +1992,7 @@
X if (!probe_waveartist(&cfg))
X return -ENODEV;
X
- attach_waveartist(&cfg);
+ attach_waveartist(&cfg, mix);
X attached = 1;
X
X return 0;
@@ -1830,3 +2024,10 @@
X }
X __setup("waveartist=", setup_waveartist);
X #endif
+
+MODULE_DESCRIPTION("Rockwell WaveArtist RWA-010 sound driver");
+MODULE_PARM(io, "i"); /* IO base */
+MODULE_PARM(irq, "i"); /* IRQ */
+MODULE_PARM(dma, "i"); /* DMA */
+MODULE_PARM(dma2, "i"); /* DMA2 */
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.13/linux/drivers/sound/waveartist.h linux/drivers/sound/waveartist.h
--- v2.4.13/linux/drivers/sound/waveartist.h Thu Oct 21 13:38:12 1999
+++ linux/drivers/sound/waveartist.h Thu Oct 25 13:53:52 2001
@@ -66,5 +66,27 @@
X #define WACMD_RST_MIXER 0x33
X #define WACMD_SET_MONO 0x34
X
+/*
+ * Definitions for left/right recording input mux
+ */
+#define ADC_MUX_NONE 0
+#define ADC_MUX_MIXER 1
+#define ADC_MUX_LINE 2
+#define ADC_MUX_AUX2 3
+#define ADC_MUX_AUX1 4
+#define ADC_MUX_MIC 5
+
+/*
+ * Definitions for mixer gain settings
+ */
+#define MIX_GAIN_LINE 0 /* line in */
+#define MIX_GAIN_AUX1 1 /* aux1 */
+#define MIX_GAIN_AUX2 2 /* aux2 */
+#define MIX_GAIN_XMIC 3 /* crossover mic */
+#define MIX_GAIN_MIC 4 /* normal mic */
+#define MIX_GAIN_PREMIC 5 /* preamp mic */
+#define MIX_GAIN_OUT 6 /* output */
+#define MIX_GAIN_MONO 7 /* mono in */
+
X int wa_sendcmd(unsigned int cmd);
X int wa_writecmd(unsigned int cmd, unsigned int arg);
diff -u --recursive --new-file v2.4.13/linux/drivers/telephony/ixj.c linux/drivers/telephony/ixj.c
--- v2.4.13/linux/drivers/telephony/ixj.c Sun Sep 23 11:41:00 2001
+++ linux/drivers/telephony/ixj.c Thu Oct 25 13:53:52 2001
@@ -387,7 +387,7 @@
X #ifdef PERFMON_STATS
X #define ixj_perfmon(x) ((x)++)
X #else
-#deifne ixj_perfmon(x) do {} while(0);
+#define ixj_perfmon(x) do {} while(0);
X #endif
X
X static int ixj_convert_loaded;
diff -u --recursive --new-file v2.4.13/linux/drivers/usb/Config.in linux/drivers/usb/Config.in
--- v2.4.13/linux/drivers/usb/Config.in Tue Oct 23 22:48:52 2001
+++ linux/drivers/usb/Config.in Fri Nov 2 17:18:58 2001
@@ -16,7 +16,6 @@
X define_bool CONFIG_USB_BANDWIDTH n
X fi
X bool ' Long timeout for slow-responding devices (some MGE Ellipse UPSes)' CONFIG_USB_LONG_TIMEOUT
- bool ' Large report fetching for "broken" devices (some APC UPSes)' CONFIG_USB_LARGE_CONFIG
X fi
X
X comment 'USB Controllers'
diff -u --recursive --new-file v2.4.13/linux/drivers/usb/devio.c linux/drivers/usb/devio.c
--- v2.4.13/linux/drivers/usb/devio.c Sun Sep 23 11:41:00 2001
+++ linux/drivers/usb/devio.c Fri Nov 2 17:18:58 2001
@@ -844,6 +844,14 @@
X uurb.buffer_length = totlen;
X break;
X
+ case USBDEVFS_URB_TYPE_INTERRUPT:
+ uurb.number_of_packets = 0;
+ if (uurb.buffer_length > 16384)
+ return -EINVAL;
+ if (!access_ok((uurb.endpoint & USB_DIR_IN) ? VERIFY_WRITE : VERIFY_READ, uurb.buffer, uurb.buffer_length))
+ return -EFAULT;
+ break;
+
X default:
X return -EINVAL;
X }
diff -u --recursive --new-file v2.4.13/linux/drivers/usb/serial/ir-usb.c linux/drivers/usb/serial/ir-usb.c
--- v2.4.13/linux/drivers/usb/serial/ir-usb.c Thu Oct 11 08:02:26 2001
+++ linux/drivers/usb/serial/ir-usb.c Fri Nov 2 17:18:58 2001
@@ -19,7 +19,13 @@
X * <d...@brattli.net>, and Jean Tourrilhes <j...@hpl.hp.com>
X
X * See Documentation/usb/usb-serial.txt for more information on using this driver
- *
+ *
+ * 2001_Nov_01 greg kh
+ * Added support for more IrDA USB devices.
+ * Added support for zero packet. Added buffer override paramater, so
+ * users can transfer larger packets at once if they wish. Both patches
+ * came from Dag Brattli <d...@obexcode.com>.
+ *
X * 2001_Oct_07 greg kh
X * initial version released.
X */
@@ -52,10 +58,14 @@
X /*
X * Version Information
X */
-#define DRIVER_VERSION "v0.1"
+#define DRIVER_VERSION "v0.2"
X #define DRIVER_AUTHOR "Greg Kroah-Hartman <gr...@kroah.com>"
X #define DRIVER_DESC "USB IR Dongle driver"
X
+/* if overridden by the user, then use their value for the size of the read and
+ * write urbs */
+static int buffer_size = 0;
+
X static int ir_startup (struct usb_serial *serial);
X static int ir_open (struct usb_serial_port *port, struct file *filep);
X static void ir_close (struct usb_serial_port *port, struct file *filep);
@@ -66,7 +76,10 @@
X
X
X static __devinitdata struct usb_device_id id_table [] = {
- { USB_DEVICE(0x09c4, 0x0011) },
+ { USB_DEVICE(0x050f, 0x0180) }, /* KC Technology, KC-180 */
+ { USB_DEVICE(0x08e9, 0x0100) }, /* XTNDAccess */
+ { USB_DEVICE(0x09c4, 0x0011) }, /* ACTiSys ACT-IR2000U */
+ { USB_INTERFACE_INFO (USB_CLASS_APP_SPEC, USB_CLASS_IRDA, 0) },
X { } /* Terminating entry */
X };
X
@@ -180,6 +193,7 @@
X static int ir_open (struct usb_serial_port *port, struct file *filp)
X {
X struct usb_serial *serial = port->serial;
+ char *buffer;
X int result = 0;
X
X if (port_paranoia_check (port, __FUNCTION__))
@@ -195,11 +209,28 @@
X if (!port->active) {
X port->active = 1;
X
- /* force low_latency on so that our tty_push actually forces the data through,
- otherwise it is scheduled, and with high data rates (like with OHCI) data
- can get lost. */
- port->tty->low_latency = 1;
-
+ if (buffer_size) {
+ /* override the default buffer sizes */
+ buffer = kmalloc (buffer_size, GFP_KERNEL);
+ if (!buffer) {
+ err (__FUNCTION__ " - out of memory.");
+ return -ENOMEM;
+ }
+ kfree (port->read_urb->transfer_buffer);
+ port->read_urb->transfer_buffer = buffer;
+ port->read_urb->transfer_buffer_length = buffer_size;
+
+ buffer = kmalloc (buffer_size, GFP_KERNEL);
+ if (!buffer) {
+ err (__FUNCTION__ " - out of memory.");
+ return -ENOMEM;
+ }
+ kfree (port->write_urb->transfer_buffer);
+ port->write_urb->transfer_buffer = buffer;
+ port->write_urb->transfer_buffer_length = buffer_size;
+ port->bulk_out_size = buffer_size;
+ }
+
X /* Start reading from the device */
X FILL_BULK_URB(port->read_urb, serial->dev,
X usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
@@ -279,12 +310,14 @@
X memcpy (&transfer_buffer[1], buf, count);
X }
X
- transfer_buffer[0] = 0x00;
+ /* use 12 XBOF's as default */
+ transfer_buffer[0] = 0x30;
X
X usb_serial_debug_data (__FILE__, __FUNCTION__, count+1, transfer_buffer);
X
X port->write_urb->transfer_buffer_length = count + 1;
X port->write_urb->dev = port->serial->dev;
+ port->write_urb->transfer_flags |= USB_ZERO_PACKET;
X result = usb_submit_urb (port->write_urb);
X if (result)
X err(__FUNCTION__ " - failed submitting write urb, error %d", result);
@@ -320,7 +353,6 @@
X struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
X struct tty_struct *tty;
X unsigned char *data = urb->transfer_buffer;
- int i;
X int result;
X
X if (port_paranoia_check (port, __FUNCTION__))
@@ -340,18 +372,11 @@
X
X usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
X
+ /* Bypass flip-buffers, and feed the ldisc directly due to our
+ * potentally large buffer size. Since we used to set low_latency,
+ * this is exactly what the tty layer did anyway :) */
X tty = port->tty;
- if (urb->actual_length > 1) {
- for (i = 1; i < urb->actual_length ; ++i) {
- /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */
- if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
- tty_flip_buffer_push(tty);
- }
- /* this doesn't actually push the data through unless tty->low_latency is set */
- tty_insert_flip_char(tty, data[i], 0);
- }
- tty_flip_buffer_push(tty);
- }
+ tty->ldisc.receive_buf(tty, data+1, NULL, urb->actual_length-1);
X
X /* Continue trying to always read */
X FILL_BULK_URB(port->read_urb, serial->dev,
@@ -449,4 +474,6 @@
X
X MODULE_PARM(debug, "i");
X MODULE_PARM_DESC(debug, "Debug enabled or not");
+MODULE_PARM(buffer_size, "i");
+MODULE_PARM_DESC(buffer_size, "Size of the transfer buffers");
X
diff -u --recursive --new-file v2.4.13/linux/drivers/usb/storage/sddr09.c linux/drivers/usb/storage/sddr09.c
--- v2.4.13/linux/drivers/usb/storage/sddr09.c Sun Sep 23 11:41:00 2001
+++ linux/drivers/usb/storage/sddr09.c Sun Nov 4 09:31:57 2001
@@ -637,9 +637,11 @@
X for (i=0; i<alloc_blocks; i++) {
X if (i<alloc_blocks-1) {
X sg[i].address = kmalloc( (1<<17), GFP_KERNEL );
+ sg[i].page = NULL;
X sg[i].length = (1<<17);
X } else {
X sg[i].address = kmalloc(alloc_len, GFP_KERNEL);
+ sg[i].page = NULL;
X sg[i].length = alloc_len;
X }
X alloc_len -= sg[i].length;
diff -u --recursive --new-file v2.4.13/linux/drivers/usb/usb-ohci.h linux/drivers/usb/usb-ohci.h
--- v2.4.13/linux/drivers/usb/usb-ohci.h Mon Aug 27 12:41:45 2001
+++ linux/drivers/usb/usb-ohci.h Wed Oct 24 08:26:12 2001
@@ -373,7 +373,7 @@
X
X typedef struct ohci {
X struct ohci_hcca *hcca; /* hcca */
- u32 hcca_dma;
+ dma_addr_t hcca_dma;
X
X int irq;
X int disabled; /* e.g. got a UE, we're hung */
diff -u --recursive --new-file v2.4.13/linux/drivers/usb/usb-uhci-debug.h linux/drivers/usb/usb-uhci-debug.h
--- v2.4.13/linux/drivers/usb/usb-uhci-debug.h Wed May 16 10:31:27 2001
+++ linux/drivers/usb/usb-uhci-debug.h Tue Oct 30 15:08:12 2001
@@ -5,7 +5,7 @@
X dbg("qh has not QH_TYPE");
X return;
X }
- dbg("QH @ %p/%08X:", qh, qh->dma_addr);
+ dbg("QH @ %p/%08llX:", qh, (unsigned long long)qh->dma_addr);
X
X if (qh->hw.qh.head & UHCI_PTR_TERM)
X dbg(" Head Terminate");
diff -u --recursive --new-file v2.4.13/linux/drivers/usb/usbnet.c linux/drivers/usb/usbnet.c
--- v2.4.13/linux/drivers/usb/usbnet.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/usb/usbnet.c Fri Nov 2 17:18:58 2001
@@ -1537,6 +1537,10 @@
X USB_DEVICE (0x0525, 0x1080), // NetChip ref design
X driver_info: (unsigned long) &net1080_info,
X },
+{
+ USB_DEVICE (0x06D0, 0x0622), // Laplink Gold
+ driver_info: (unsigned long) &net1080_info,
+},
X #endif
X
X #ifdef CONFIG_USB_PL2301
diff -u --recursive --new-file v2.4.13/linux/drivers/video/Makefile linux/drivers/video/Makefile
--- v2.4.13/linux/drivers/video/Makefile Sun Sep 23 11:41:00 2001
+++ linux/drivers/video/Makefile Thu Oct 25 13:53:52 2001
@@ -15,7 +15,7 @@
X fbcon-iplan2p8.o fbcon-vga-planes.o fbcon-cfb16.o \
X fbcon-cfb2.o fbcon-cfb24.o fbcon-cfb32.o fbcon-cfb4.o \
X fbcon-cfb8.o fbcon-mac.o fbcon-mfb.o \
- cyber2000fb.o fbcon-hga.o
+ cyber2000fb.o sa1100fb.o fbcon-hga.o
X
X # Each configuration option enables a list of files.
X
diff -u --recursive --new-file v2.4.13/linux/drivers/video/aty/atyfb_base.c linux/drivers/video/aty/atyfb_base.c
--- v2.4.13/linux/drivers/video/aty/atyfb_base.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/video/aty/atyfb_base.c Tue Oct 30 15:08:11 2001
@@ -2521,7 +2521,7 @@
X if (!options || !*options)
X return 0;
X
- while (this_opt = strsep(&options, ",")) {
+ while ((this_opt = strsep(&options, ",")) != NULL) {
X if (!strncmp(this_opt, "font:", 5)) {
X char *p;
X int i;
diff -u --recursive --new-file v2.4.13/linux/drivers/video/aty/mach64_cursor.c linux/drivers/video/aty/mach64_cursor.c
--- v2.4.13/linux/drivers/video/aty/mach64_cursor.c Sun Aug 12 13:28:00 2001
+++ linux/drivers/video/aty/mach64_cursor.c Thu Oct 25 13:53:52 2001
@@ -3,7 +3,7 @@
X * ATI Mach64 CT/VT/GT/LT Cursor Support
X */
X
-#include <linux/malloc.h>
+#include <linux/slab.h>
X #include <linux/console.h>
X #include <linux/fb.h>
X #include <linux/init.h>
diff -u --recursive --new-file v2.4.13/linux/drivers/video/clgenfb.c linux/drivers/video/clgenfb.c
--- v2.4.13/linux/drivers/video/clgenfb.c Tue Oct 9 17:06:53 2001
+++ linux/drivers/video/clgenfb.c Thu Oct 25 13:53:52 2001
@@ -56,6 +56,12 @@
X #ifdef CONFIG_AMIGA
X #include <asm/amigahw.h>
X #endif
+#ifdef CONFIG_ALL_PPC
+#include <asm/processor.h>
+#define isPReP (_machine == _MACH_prep)
+#else
+#define isPReP 0
+#endif
X
X #include <video/fbcon.h>
X #include <video/fbcon-mfb.h>
@@ -883,15 +889,15 @@
X case 16:
X _par->line_length = _par->var.xres_virtual * 2;
X _par->visual = FB_VISUAL_DIRECTCOLOR;
-#ifdef CONFIG_PREP
- _par->var.red.offset = 2;
- _par->var.green.offset = -3;
- _par->var.blue.offset = 8;
-#else
- _par->var.red.offset = 10;
- _par->var.green.offset = 5;
- _par->var.blue.offset = 0;
-#endif
+ if(isPReP) {
+ _par->var.red.offset = 2;
+ _par->var.green.offset = -3;
+ _par->var.blue.offset = 8;
+ } else {
+ _par->var.red.offset = 10;
+ _par->var.green.offset = 5;
+ _par->var.blue.offset = 0;
+ }
X _par->var.red.length = 5;
X _par->var.green.length = 5;
X _par->var.blue.length = 5;
@@ -900,15 +906,15 @@
X case 24:
X _par->line_length = _par->var.xres_virtual * 3;
X _par->visual = FB_VISUAL_DIRECTCOLOR;
-#ifdef CONFIG_PREP
- _par->var.red.offset = 8;
- _par->var.green.offset = 16;
- _par->var.blue.offset = 24;
-#else
- _par->var.red.offset = 16;
- _par->var.green.offset = 8;
- _par->var.blue.offset = 0;
-#endif
+ if(isPReP) {
+ _par->var.red.offset = 8;
+ _par->var.green.offset = 16;
+ _par->var.blue.offset = 24;
+ } else {
+ _par->var.red.offset = 16;
+ _par->var.green.offset = 8;
+ _par->var.blue.offset = 0;
+ }
X _par->var.red.length = 8;
X _par->var.green.length = 8;
X _par->var.blue.length = 8;
@@ -917,15 +923,15 @@
X case 32:
X _par->line_length = _par->var.xres_virtual * 4;
X _par->visual = FB_VISUAL_DIRECTCOLOR;
-#ifdef CONFIG_PREP
- _par->var.red.offset = 8;
- _par->var.green.offset = 16;
- _par->var.blue.offset = 24;
-#else
- _par->var.red.offset = 16;
- _par->var.green.offset = 8;
- _par->var.blue.offset = 0;
-#endif
+ if(isPReP) {
+ _par->var.red.offset = 8;
+ _par->var.green.offset = 16;
+ _par->var.blue.offset = 24;
+ } else {
+ _par->var.red.offset = 16;
+ _par->var.green.offset = 8;
+ _par->var.blue.offset = 0;
+ }
X _par->var.red.length = 8;
X _par->var.green.length = 8;
X _par->var.blue.length = 8;
@@ -1688,18 +1694,18 @@


X #ifdef FBCON_HAS_CFB16
X case 16:

X assert (regno < 16);
-#ifdef CONFIG_PREP
- 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);
-#endif
+ 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);
+ }
X #endif /* FBCON_HAS_CFB16 */
X
X #ifdef FBCON_HAS_CFB24
@@ -1715,17 +1721,17 @@


X #ifdef FBCON_HAS_CFB32
X case 32:

X assert (regno < 16);
-#ifdef CONFIG_PREP
- 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);
-#endif
+ 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);
+ }
X break;
X #endif /* FBCON_HAS_CFB32 */
X default:
@@ -2373,7 +2379,7 @@
X
X
X
-#ifdef CONFIG_PREP
+#ifdef CONFIG_ALL_PPC
X #define PREP_VIDEO_BASE ((volatile unsigned long) 0xC0000000)
X #define PREP_IO_BASE ((volatile unsigned char *) 0x80000000)
X static void __init get_prep_addrs (unsigned long *display, unsigned long *registers)
@@ -2386,7 +2392,7 @@
X DPRINTK ("EXIT\n");
X }
X
-#endif /* CONFIG_PREP */
+#endif /* CONFIG_ALL_PPC */
X
X
X
@@ -2509,26 +2515,26 @@
X
X info->pdev = pdev;
X
-#ifdef CONFIG_PREP
- /* Xbh does this, though 0 seems to be the init value */
- pcibios_write_config_dword (0, pdev->devfn, PCI_BASE_ADDRESS_0, 0x00000000);
-#endif
+ 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);
X
-#ifdef CONFIG_PREP
- get_prep_addrs (&board_addr, &info->fbregs_phys);
-#else /* CONFIG_PREP */
- DPRINTK ("Attempt to get PCI info for Cirrus Graphics Card\n");
- get_pci_addrs (pdev, &board_addr, &info->fbregs_phys);
-#endif /* CONFIG_PREP */
+#ifdef CONFIG_ALL_PPC
+ 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);
+ }
X
X DPRINTK ("Board address: 0x%lx, register address: 0x%lx\n", board_addr, info->fbregs_phys);
X
-#ifdef CONFIG_PREP
- /* 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? */
-#endif
+ 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? */
X
X if (*btype == BT_GD5480) {
X board_size = 32 * MB_;
@@ -2840,6 +2846,7 @@
X
X MODULE_AUTHOR("Copyright 1999,2000 Jeff Garzik <jga...@mandrakesoft.com>");
X MODULE_DESCRIPTION("Accelerated FBDev driver for Cirrus Logic chips");
+MODULE_LICENSE("GPL");
X
X static void __exit clgenfb_exit (void)
X {
@@ -3225,7 +3232,6 @@
X * bestclock() - determine closest possible clock lower(?) than the
X * desired pixel clock
X **************************************************************************/
-#define abs(x) ((x)<0 ? -(x) : (x))
X static void bestclock (long freq, long *best, long *nom,
X long *den, long *div, long maxfreq)
X {
diff -u --recursive --new-file v2.4.13/linux/drivers/video/cyber2000fb.c linux/drivers/video/cyber2000fb.c
--- v2.4.13/linux/drivers/video/cyber2000fb.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/video/cyber2000fb.c Thu Oct 25 13:53:52 2001
@@ -1680,8 +1680,6 @@
X { 0, }
X };
X
-MODULE_DEVICE_TABLE(pci, cyberpro_pci_table);
-
X static struct pci_driver cyberpro_driver = {
X name: "CyberPro",
X probe: cyberpro_probe,
@@ -1713,4 +1711,5 @@
X
X MODULE_AUTHOR("Russell King");
X MODULE_DESCRIPTION("CyberPro 2000, 2010 and 5000 framebuffer driver");
+MODULE_DEVICE_TABLE(pci,cyberpro_pci_table);
X MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.13/linux/drivers/video/radeon.h linux/drivers/video/radeon.h
--- v2.4.13/linux/drivers/video/radeon.h Sun Sep 23 11:41:00 2001
+++ linux/drivers/video/radeon.h Thu Oct 25 13:53:52 2001
@@ -7,7 +7,13 @@
X #define PCI_DEVICE_ID_RADEON_QE 0x5145
X #define PCI_DEVICE_ID_RADEON_QF 0x5146
X #define PCI_DEVICE_ID_RADEON_QG 0x5147
-#define PCI_DEVICE_ID_RADEON_VE 0x5159
+#define PCI_DEVICE_ID_RADEON_QY 0x5159
+#define PCI_DEVICE_ID_RADEON_QZ 0x515a
+#define PCI_DEVICE_ID_RADEON_LW 0x4c57
+#define PCI_DEVICE_ID_RADEON_LY 0x4c59
+#define PCI_DEVICE_ID_RADEON_LZ 0x4c5a
+#define PCI_DEVICE_ID_RADEON_QL 0x514c
+#define PCI_DEVICE_ID_RADEON_QW 0x5157
X
X #define RADEON_REGSIZE 0x4000
X
@@ -371,6 +377,19 @@
X #define SC_BOTTOM_RIGHT 0x16F0
X #define SRC_SC_BOTTOM_RIGHT 0x16F4
X #define RB2D_DSTCACHE_CTLSTAT 0x342C
+#define LVDS_GEN_CNTL 0x02d0
+#define LVDS_PLL_CNTL 0x02d4
+#define TMDS_CRC 0x02a0
+
+#define RADEON_BASE_CODE 0x0f0b
+#define RADEON_BIOS_0_SCRATCH 0x0010
+#define RADEON_BIOS_1_SCRATCH 0x0014
+#define RADEON_BIOS_2_SCRATCH 0x0018
+#define RADEON_BIOS_3_SCRATCH 0x001c
+#define RADEON_BIOS_4_SCRATCH 0x0020
+#define RADEON_BIOS_5_SCRATCH 0x0024
+#define RADEON_BIOS_6_SCRATCH 0x0028
+#define RADEON_BIOS_7_SCRATCH 0x002c
X
X
X #define CLK_PIN_CNTL 0x0001
@@ -440,6 +459,7 @@
X #define CRTC_HSYNC_DIS (1 << 8)
X #define CRTC_VSYNC_DIS (1 << 9)
X #define CRTC_DISPLAY_DIS (1 << 10)
+#define CRTC_CRT_ON (1 << 15)
X
X
X /* DSTCACHE_CTLSTAT bit constants */
@@ -451,6 +471,7 @@
X /* CRTC_GEN_CNTL bit constants */
X #define CRTC_DBL_SCAN_EN 0x00000001
X #define CRTC_CUR_EN 0x00010000
+#define CRTC_INTERLACE_EN (1 << 1)
X #define CRTC_EXT_DISP_EN (1 << 24)
X #define CRTC_EN (1 << 25)
X
@@ -460,6 +481,81 @@
X /* CUR_OFFSET, CUR_HORZ_VERT_POSN, CUR_HORZ_VERT_OFF bit constants */
X #define CUR_LOCK 0x80000000
X
+
+/* FP bit constants */
+#define FP_CRTC_H_TOTAL_MASK 0x000003ff
+#define FP_CRTC_H_DISP_MASK 0x01ff0000
+#define FP_CRTC_V_TOTAL_MASK 0x00000fff
+#define FP_CRTC_V_DISP_MASK 0x0fff0000
+#define FP_H_SYNC_STRT_CHAR_MASK 0x00001ff8
+#define FP_H_SYNC_WID_MASK 0x003f0000
+#define FP_V_SYNC_STRT_MASK 0x00000fff
+#define FP_V_SYNC_WID_MASK 0x001f0000
+#define FP_CRTC_H_TOTAL_SHIFT 0x00000000
+#define FP_CRTC_H_DISP_SHIFT 0x00000010
+#define FP_CRTC_V_TOTAL_SHIFT 0x00000000
+#define FP_CRTC_V_DISP_SHIFT 0x00000010
+#define FP_H_SYNC_STRT_CHAR_SHIFT 0x00000003
+#define FP_H_SYNC_WID_SHIFT 0x00000010
+#define FP_V_SYNC_STRT_SHIFT 0x00000000
+#define FP_V_SYNC_WID_SHIFT 0x00000010
+
+/* FP_GEN_CNTL bit constants */
+#define FP_FPON (1 << 0)
+#define FP_TMDS_EN (1 << 2)
+#define FP_EN_TMDS (1 << 7)
+#define FP_DETECT_SENSE (1 << 8)
+#define FP_SEL_CRTC2 (1 << 13)
+#define FP_CRTC_DONT_SHADOW_HPAR (1 << 15)
+#define FP_CRTC_DONT_SHADOW_VPAR (1 << 16)
+#define FP_CRTC_DONT_SHADOW_HEND (1 << 17)
+#define FP_CRTC_USE_SHADOW_VEND (1 << 18)
+#define FP_RMX_HVSYNC_CONTROL_EN (1 << 20)
+#define FP_DFP_SYNC_SEL (1 << 21)
+#define FP_CRTC_LOCK_8DOT (1 << 22)
+#define FP_CRT_SYNC_SEL (1 << 23)
+#define FP_USE_SHADOW_EN (1 << 24)
+#define FP_CRT_SYNC_ALT (1 << 26)
+
+/* LVDS_GEN_CNTL bit constants */
+#define LVDS_ON (1 << 0)
+#define LVDS_DISPLAY_DIS (1 << 1)
+#define LVDS_PANEL_TYPE (1 << 2)
+#define LVDS_PANEL_FORMAT (1 << 3)
+#define LVDS_EN (1 << 7)
+#define LVDS_DIGON (1 << 18)
+#define LVDS_BLON (1 << 19)
+#define LVDS_SEL_CRTC2 (1 << 23)
+
+/* LVDS_PLL_CNTL bit constatns */
+#define HSYNC_DELAY_SHIFT 0x1c
+#define HSYNC_DELAY_MASK (0xf << 0x1c)
+
+/* FP_HORZ_STRETCH bit constants */
+#define HORZ_STRETCH_RATIO_MASK 0xffff
+#define HORZ_STRETCH_RATIO_MAX 4096
+#define HORZ_PANEL_SIZE (0x1ff << 16)
+#define HORZ_PANEL_SHIFT 16
+#define HORZ_STRETCH_PIXREP (0 << 25)
+#define HORZ_STRETCH_BLEND (1 << 26)
+#define HORZ_STRETCH_ENABLE (1 << 25)
+#define HORZ_AUTO_RATIO (1 << 27)
+#define HORZ_FP_LOOP_STRETCH (0x7 << 28)
+#define HORZ_AUTO_RATIO_INC (1 << 31)
+
+
+/* FP_VERT_STRETCH bit constants */
+#define VERT_STRETCH_RATIO_MASK 0xfff
+#define VERT_STRETCH_RATIO_MAX 4096
+#define VERT_PANEL_SIZE (0xfff << 12)
+#define VERT_PANEL_SHIFT 12
+#define VERT_STRETCH_LINREP (0 << 26)
+#define VERT_STRETCH_BLEND (1 << 26)
+#define VERT_STRETCH_ENABLE (1 << 25)
+#define VERT_AUTO_RATIO_EN (1 << 27)
+#define VERT_FP_LOOP_STRETCH (0x7 << 28)
+#define VERT_STRETCH_RESERVED 0xf1000000
+
X /* DAC_CNTL bit constants */
X #define DAC_8BIT_EN 0x00000100
X #define DAC_4BPP_PIX_ORDER 0x00000200
@@ -497,6 +593,10 @@
X #define SOFT_RESET_RB (1 << 6)
X #define SOFT_RESET_HDP (1 << 7)
X
+/* SURFACE_CNTL bit consants */
+#define SURF_TRANSLATION_DIS (1 << 8)
+#define NONSURF_AP0_SWP_16BPP (1 << 20)
+#define NONSURF_AP0_SWP_32BPP (1 << 21)
X
X /* DEFAULT_SC_BOTTOM_RIGHT bit constants */
X #define DEFAULT_SC_RIGHT_MAX (0x1fff << 0)
diff -u --recursive --new-file v2.4.13/linux/drivers/video/radeonfb.c linux/drivers/video/radeonfb.c
--- v2.4.13/linux/drivers/video/radeonfb.c Tue Oct 23 22:48:52 2001
+++ linux/drivers/video/radeonfb.c Thu Oct 25 13:53:52 2001
@@ -11,15 +11,17 @@
X * 2001-02-19 mode bug fixes, 0.0.7
X * 2001-07-05 fixed scrolling issues, engine initialization,
X * and minor mode tweaking, 0.0.9
- *
- * 2001-09-07 Radeon VE support
+ * 2001-09-07 Radeon VE support, Nick Kurshev
+ * blanking, pan_display, and cmap fixes, 0.1.0
+ * 2001-10-10 Radeon 7500 and 8500 support, and experimental
+ * flat panel support, 0.1.1
X *
X * Special thanks to ATI DevRel team for their hardware donations.


X *
X */
X

X
-#define RADEON_VERSION "0.0.10"
+#define RADEON_VERSION "0.1.1"
X
X
X #include <linux/config.h>
@@ -39,6 +41,9 @@
X #include <linux/pci.h>
X
X #include <asm/io.h>
+#if defined(__powerpc__)
+#include <asm/prom.h>
+#endif


X
X #include <video/fbcon.h>
X #include <video/fbcon-cfb8.h>

@@ -64,7 +69,24 @@
X RADEON_QE,
X RADEON_QF,
X RADEON_QG,
- RADEON_VE
+ RADEON_QY,
+ RADEON_QZ,
+ RADEON_QL,
+ RADEON_QW,
+ RADEON_LW,
+ RADEON_LY,
+ RADEON_LZ
+};
+
+
+enum radeon_montype
+{
+ MT_NONE,
+ MT_CRT, /* CRT */
+ MT_LCD, /* LCD */
+ MT_DFP, /* DVI */
+ MT_CTV, /* composite TV */
+ MT_STV /* S-Video out */
X };
X
X
@@ -73,7 +95,13 @@
X { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_QE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QE},
X { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_QF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QF},
X { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_QG, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QG},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_VE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_VE},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_QY, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QY},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_QZ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QZ},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_QL, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QL},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_QW, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QW},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_LW, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_LW},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_LY, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_LY},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_LZ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_LZ},
X { 0, }
X };
X MODULE_DEVICE_TABLE(pci, radeonfb_pci_table);
@@ -151,22 +179,45 @@
X
X
X struct radeon_regs {


+ /* CRTC regs */

X u32 crtc_h_total_disp;
X u32 crtc_h_sync_strt_wid;
X u32 crtc_v_total_disp;
X u32 crtc_v_sync_strt_wid;
X u32 crtc_pitch;
+ u32 crtc_gen_cntl;
+ u32 crtc_ext_cntl;
+ u32 dac_cntl;
+
X u32 flags;
X u32 pix_clock;
X int xres, yres;
X int bpp;
- u32 crtc_gen_cntl;
- u32 crtc_ext_cntl;
- u32 dac_cntl;
+
+ /* DDA regs */
X u32 dda_config;
X u32 dda_on_off;
+
+ /* PLL regs */
X u32 ppll_div_3;
X u32 ppll_ref_div;
+
+ /* Flat panel regs */
+ u32 fp_crtc_h_total_disp;
+ u32 fp_crtc_v_total_disp;
+ u32 fp_gen_cntl;
+ u32 fp_h_sync_strt_wid;
+ u32 fp_horz_stretch;
+ u32 fp_panel_cntl;
+ u32 fp_v_sync_strt_wid;
+ u32 fp_vert_stretch;
+ u32 lvds_gen_cntl;
+ u32 lvds_pll_cntl;
+ u32 tmds_crc;
+
+#if defined(__BIG_ENDIAN)
+ u32 surface_cntl;
+#endif
X };
X
X
@@ -176,7 +227,7 @@
X struct radeon_regs state;
X struct radeon_regs init_state;
X
- char name[10];
+ char name[17];
X char ram_type[12];
X
X u32 mmio_base_phys;
@@ -199,6 +250,14 @@
X int pitch, bpp, depth;
X int xres, yres, pixclock;
X
+ int hasCRTC2;
+ int crtDisp_type;
+ int dviDisp_type;
+
+ int panel_xres, panel_yres;
+ int hOver_plus, hSync_width, hblank;
+ int vOver_plus, vSync_width, vblank;
+
X u32 dp_gui_master_cntl;
X
X struct pll_info pll;
@@ -206,11 +265,17 @@
X
X struct ram_info ram;
X
+ u32 hack_crtc_ext_cntl;
+ u32 hack_crtc_v_sync_strt_wid;
+
X #if defined(FBCON_HAS_CFB16) || defined(FBCON_HAS_CFB32)
X union {
X #if defined(FBCON_HAS_CFB16)
X u_int16_t cfb16[16];
X #endif
+#if defined(FBCON_HAS_CFB24)
+ u_int32_t cfb24[16];
+#endif
X #if defined(FBCON_HAS_CFB32)
X u_int32_t cfb32[16];
X #endif
@@ -263,6 +328,39 @@
X
X #define INPLL(addr) _INPLL(rinfo, addr)
X
+#define PRIMARY_MONITOR(rinfo) ((rinfo->dviDisp_type != MT_NONE) && \
+ (rinfo->dviDisp_type != MT_STV) && \
+ (rinfo->dviDisp_type != MT_CTV) ? \
+ rinfo->dviDisp_type : rinfo->crtDisp_type)
+
+static char *GET_MON_NAME(int type)
+{
+ char *pret = NULL;
+
+ switch (type) {
+ case MT_NONE:
+ pret = "no";
+ break;
+ case MT_CRT:
+ pret = "CRT";
+ break;
+ case MT_DFP:
+ pret = "DFP";
+ break;
+ case MT_LCD:
+ pret = "LCD";
+ break;
+ case MT_CTV:
+ pret = "CTV";
+ break;
+ case MT_STV:
+ pret = "STV";
+ break;
+ }
+
+ return pret;
+}
+
X
X /*
X * 2D engine routines
@@ -448,6 +546,7 @@
X static char fontname[40] __initdata;
X static char *mode_option __initdata;
X static char noaccel __initdata = 0;
+static char panel_yres __initdata = 0;
X
X #ifdef FBCON_HAS_CFB8
X static struct display_switch fbcon_radeon8;
@@ -481,7 +580,7 @@
X struct fb_info *info);
X static int radeon_setcolreg (unsigned regno, unsigned red, unsigned green,
X unsigned blue, unsigned transp, struct fb_info *info);
-static void radeon_set_dispsw (struct radeonfb_info *rinfo);


+static void radeon_set_dispsw (struct radeonfb_info *rinfo, struct display *disp);

X static void radeon_save_state (struct radeonfb_info *rinfo,
X struct radeon_regs *save);

X static void radeon_engine_init (struct radeonfb_info *rinfo);
@@ -497,7 +596,13 @@
X static void __devexit radeonfb_pci_unregister (struct pci_dev *pdev);
X static char *radeon_find_rom(struct radeonfb_info *rinfo);
X static void radeon_get_pllinfo(struct radeonfb_info *rinfo, char *bios_seg);
+static void radeon_get_moninfo (struct radeonfb_info *rinfo);
+static int radeon_get_dfpinfo (struct radeonfb_info *rinfo);
+static int radeon_read_OF (struct radeonfb_info *rinfo);
X
+#if defined(__powerpc__)
+extern struct device_node *pci_device_to_OF_node(struct pci_dev *dev);
+#endif
X
X static struct fb_ops radeon_fb_ops = {
X fb_get_fix: radeonfb_get_fix,
@@ -549,8 +654,10 @@
X memcpy(fontname, this_opt + 5, i);
X } else if (!strncmp(this_opt, "noaccel", 7)) {
X noaccel = 1;
- }
- else mode_option = this_opt;
+ } else if (!strncmp(this_opt, "panel_yres:", 11)) {
+ panel_yres = simple_strtoul((this_opt+11), NULL, 0);
+ } else
+ mode_option = this_opt;
X }
X
X return 0;
@@ -574,6 +681,8 @@
X int i, j;
X char *bios_seg = NULL;
X
+ RTRACE("radeonfb_pci_register BEGIN\n");
+
X rinfo = kmalloc (sizeof (struct radeonfb_info), GFP_KERNEL);
X if (!rinfo) {
X printk ("radeonfb: could not allocate memory\n");
@@ -582,6 +691,8 @@
X
X memset (rinfo, 0, sizeof (struct radeonfb_info));
X
+ rinfo->pdev = pdev;
+
X /* enable device */
X {
X int err;
@@ -627,6 +738,8 @@
X return -ENODEV;
X }
X
+ rinfo->chipset = pdev->device;
+
X /* chipset */
X switch (pdev->device) {
X case PCI_DEVICE_ID_RADEON_QD:
@@ -641,8 +754,33 @@
X case PCI_DEVICE_ID_RADEON_QG:
X strcpy(rinfo->name, "Radeon QG ");
X break;
- case PCI_DEVICE_ID_RADEON_VE:
- strcpy(rinfo->name, "Radeon VE ");
+ case PCI_DEVICE_ID_RADEON_QY:
+ strcpy(rinfo->name, "Radeon QY VE ");
+ rinfo->hasCRTC2 = 1;
+ break;
+ case PCI_DEVICE_ID_RADEON_QZ:
+ strcpy(rinfo->name, "Radeon QZ VE ");
+ rinfo->hasCRTC2 = 1;
+ break;
+ case PCI_DEVICE_ID_RADEON_QW:
+ strcpy(rinfo->name, "Radeon 7500 QW ");
+ rinfo->hasCRTC2 = 1;
+ break;
+ case PCI_DEVICE_ID_RADEON_QL:
+ strcpy(rinfo->name, "Radeon 8500 QL ");
+ rinfo->hasCRTC2 = 1;
+ break;
+ case PCI_DEVICE_ID_RADEON_LW:
+ strcpy(rinfo->name, "Radeon M7 LW ");
+ rinfo->hasCRTC2 = 1;
+ break;
+ case PCI_DEVICE_ID_RADEON_LY:
+ strcpy(rinfo->name, "Radeon M6 LY ");
+ rinfo->hasCRTC2 = 1;
+ break;
+ case PCI_DEVICE_ID_RADEON_LZ:
+ strcpy(rinfo->name, "Radeon M6 LZ ");
+ rinfo->hasCRTC2 = 1;
X break;
X default:
X return -ENODEV;
@@ -703,11 +841,22 @@
X bios_seg = radeon_find_rom(rinfo);
X radeon_get_pllinfo(rinfo, bios_seg);
X
- printk("radeonfb: ref_clk=%d, ref_div=%d, xclk=%d\n",
- rinfo->pll.ref_clk, rinfo->pll.ref_div, rinfo->pll.xclk);
-
X RTRACE("radeonfb: probed %s %dk videoram\n", (rinfo->ram_type), (rinfo->video_ram/1024));
X
+ radeon_get_moninfo(rinfo);
+ if ((rinfo->dviDisp_type == MT_DFP) || (rinfo->dviDisp_type == MT_LCD) ||
+ (rinfo->crtDisp_type == MT_DFP)) {
+ if (!radeon_get_dfpinfo(rinfo)) {
+ iounmap ((void*)rinfo->mmio_base);
+ release_mem_region (rinfo->mmio_base_phys,
+ pci_resource_len(pdev, 2));
+ release_mem_region (rinfo->fb_base_phys,
+ pci_resource_len(pdev, 0));
+ kfree (rinfo);


+ return -ENODEV;
+ }
+ }

+
X rinfo->fb_base = (u32) ioremap (rinfo->fb_base_phys,
X rinfo->video_ram);
X if (!rinfo->fb_base) {
@@ -759,9 +908,21 @@
X radeon_engine_init (rinfo);
X }
X
- printk ("radeonfb: ATI %s %d MB\n",rinfo->name,
+ printk ("radeonfb: ATI %s %s %d MB\n", rinfo->name, rinfo->ram_type,
X (rinfo->video_ram/(1024*1024)));
X
+ if (rinfo->hasCRTC2) {
+ printk("radeonfb: DVI port %s monitor connected\n",
+ GET_MON_NAME(rinfo->dviDisp_type));
+ printk("radeonfb: CRT port %s monitor connected\n",
+ GET_MON_NAME(rinfo->crtDisp_type));
+ } else {
+ printk("radeonfb: CRT port %s monitor connected\n",
+ GET_MON_NAME(rinfo->crtDisp_type));
+ }
+
+ RTRACE("radeonfb_pci_register END\n");
+


X return 0;
X }
X

@@ -793,65 +954,74 @@
X
X
X static char *radeon_find_rom(struct radeonfb_info *rinfo)
-{
+{
+#if defined(__i386__)
X u32 segstart;
X char *rom_base;
X char *rom;
X int stage;
- int i;
+ int i,j;
X char aty_rom_sig[] = "761295520";
- char radeon_sig[] = "RG6";
-
-#if defined(__i386__)
- for(segstart=0x000c0000; segstart<0x000f0000; segstart+=0x00001000) {

SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 40'
echo 'File patch-2.4.14 is continued in part 41'
echo "41" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:08 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part45

#!/bin/sh -x
# this is part 45 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 45; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},


+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},

+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},


+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},

+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},


+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},

+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
+ };
+local inflate_huft fixed_td[] = {
+ {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
+ {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
+ {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
+ {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
+ {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
+ {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
+ {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
+ {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
+ };
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/inflate.c linux/fs/inflate_fs/inflate.c
--- v2.4.13/linux/fs/inflate_fs/inflate.c Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/inflate.c Thu Oct 25 13:53:53 2001
@@ -0,0 +1,293 @@
+/* inflate.c -- zlib interface to inflate modules


+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+

+#include <linux/module.h>
+#include "zutil.h"
+#include "infblock.h"
+#include "infutil.h"
+
+int ZEXPORT zlib_fs_inflate_workspacesize(void)
+{
+ return sizeof(struct inflate_workspace);
+}
+
+
+int ZEXPORT zlib_fs_inflateReset(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->workspace == Z_NULL)
+ return Z_STREAM_ERROR;
+ z->total_in = z->total_out = 0;
+ z->msg = Z_NULL;
+ z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
+ zlib_fs_inflate_blocks_reset(z->state->blocks, z, Z_NULL);


+ return Z_OK;
+}
+
+

+int ZEXPORT zlib_fs_inflateEnd(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->workspace == Z_NULL)
+ return Z_STREAM_ERROR;
+ if (z->state->blocks != Z_NULL)
+ zlib_fs_inflate_blocks_free(z->state->blocks, z);
+ z->state = Z_NULL;


+ return Z_OK;
+}
+
+

+int ZEXPORT zlib_fs_inflateInit2_(z, w, version, stream_size)
+z_streamp z;
+int w;
+const char *version;
+int stream_size;
+{
+ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+ stream_size != sizeof(z_stream) || z->workspace == Z_NULL)
+ return Z_VERSION_ERROR;
+
+ /* initialize state */
+ if (z == Z_NULL)
+ return Z_STREAM_ERROR;
+ z->msg = Z_NULL;
+ z->state = &WS(z)->internal_state;
+ z->state->blocks = Z_NULL;
+
+ /* handle undocumented nowrap option (no zlib header or check) */
+ z->state->nowrap = 0;
+ if (w < 0)
+ {
+ w = - w;
+ z->state->nowrap = 1;
+ }
+
+ /* set window size */
+ if (w < 8 || w > 15)
+ {
+ zlib_fs_inflateEnd(z);
+ return Z_STREAM_ERROR;
+ }
+ z->state->wbits = (uInt)w;
+
+ /* create inflate_blocks state */
+ if ((z->state->blocks =
+ zlib_fs_inflate_blocks_new(z, z->state->nowrap ? Z_NULL : zlib_fs_adler32, (uInt)1 << w))
+ == Z_NULL)
+ {
+ zlib_fs_inflateEnd(z);
+ return Z_MEM_ERROR;
+ }
+
+ /* reset state */
+ zlib_fs_inflateReset(z);


+ return Z_OK;
+}
+
+

+int ZEXPORT zlib_fs_inflateInit_(z, version, stream_size)
+z_streamp z;
+const char *version;
+int stream_size;
+{
+ return zlib_fs_inflateInit2_(z, DEF_WBITS, version, stream_size);
+}
+
+#undef NEEDBYTE
+#undef NEXTBYTE
+#define NEEDBYTE {if(z->avail_in==0)return r;r=f;}
+#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
+
+int ZEXPORT zlib_fs_inflate(z, f)
+z_streamp z;
+int f;
+{
+ int r;
+ uInt b;
+
+ if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)
+ return Z_STREAM_ERROR;
+ f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
+ r = Z_BUF_ERROR;
+ while (1) switch (z->state->mode)
+ {
+ case METHOD:
+ NEEDBYTE
+ if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED)
+ {
+ z->state->mode = I_BAD;
+ z->msg = (char*)"unknown compression method";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
+ {
+ z->state->mode = I_BAD;
+ z->msg = (char*)"invalid window size";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ z->state->mode = FLAG;
+ case FLAG:
+ NEEDBYTE
+ b = NEXTBYTE;
+ if (((z->state->sub.method << 8) + b) % 31)
+ {
+ z->state->mode = I_BAD;
+ z->msg = (char*)"incorrect header check";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ if (!(b & PRESET_DICT))
+ {
+ z->state->mode = BLOCKS;
+ break;
+ }
+ z->state->mode = DICT4;
+ case DICT4:
+ NEEDBYTE
+ z->state->sub.check.need = (uLong)NEXTBYTE << 24;
+ z->state->mode = DICT3;
+ case DICT3:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 16;
+ z->state->mode = DICT2;
+ case DICT2:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 8;
+ z->state->mode = DICT1;
+ case DICT1:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE;
+ z->adler = z->state->sub.check.need;
+ z->state->mode = DICT0;
+ return Z_NEED_DICT;
+ case DICT0:
+ z->state->mode = I_BAD;
+ z->msg = (char*)"need dictionary";
+ z->state->sub.marker = 0; /* can try inflateSync */
+ return Z_STREAM_ERROR;
+ case BLOCKS:
+ r = zlib_fs_inflate_blocks(z->state->blocks, z, r);


+ if (r == Z_DATA_ERROR)

+ {
+ z->state->mode = I_BAD;
+ z->state->sub.marker = 0; /* can try inflateSync */
+ break;
+ }
+ if (r == Z_OK)
+ r = f;
+ if (r != Z_STREAM_END)
+ return r;
+ r = f;
+ zlib_fs_inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
+ if (z->state->nowrap)
+ {
+ z->state->mode = I_DONE;
+ break;
+ }
+ z->state->mode = CHECK4;
+ case CHECK4:
+ NEEDBYTE
+ z->state->sub.check.need = (uLong)NEXTBYTE << 24;
+ z->state->mode = CHECK3;
+ case CHECK3:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 16;
+ z->state->mode = CHECK2;
+ case CHECK2:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 8;
+ z->state->mode = CHECK1;
+ case CHECK1:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE;
+
+ if (z->state->sub.check.was != z->state->sub.check.need)
+ {
+ z->state->mode = I_BAD;
+ z->msg = (char*)"incorrect data check";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ z->state->mode = I_DONE;
+ case I_DONE:
+ return Z_STREAM_END;
+ case I_BAD:
+ return Z_DATA_ERROR;
+ default:
+ return Z_STREAM_ERROR;


+ }
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
+}
+
+

+int ZEXPORT zlib_fs_inflateSync(z)
+z_streamp z;
+{
+ uInt n; /* number of bytes to look at */
+ Bytef *p; /* pointer to bytes */
+ uInt m; /* number of marker bytes found in a row */
+ uLong r, w; /* temporaries to save total_in and total_out */
+
+ /* set up */
+ if (z == Z_NULL || z->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ if (z->state->mode != I_BAD)
+ {
+ z->state->mode = I_BAD;
+ z->state->sub.marker = 0;
+ }
+ if ((n = z->avail_in) == 0)
+ return Z_BUF_ERROR;
+ p = z->next_in;
+ m = z->state->sub.marker;
+
+ /* search */
+ while (n && m < 4)
+ {
+ static const Byte mark[4] = {0, 0, 0xff, 0xff};
+ if (*p == mark[m])
+ m++;
+ else if (*p)
+ m = 0;
+ else
+ m = 4 - m;
+ p++, n--;
+ }
+
+ /* restore */
+ z->total_in += p - z->next_in;
+ z->next_in = p;
+ z->avail_in = n;
+ z->state->sub.marker = m;
+
+ /* return no joy or set up to restart on a new block */
+ if (m != 4)
+ return Z_DATA_ERROR;
+ r = z->total_in; w = z->total_out;
+ zlib_fs_inflateReset(z);
+ z->total_in = r; z->total_out = w;
+ z->state->mode = BLOCKS;


+ return Z_OK;
+}
+
+

+/* Returns true if inflate is currently at the end of a block generated

+ * by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
+ * implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH
+ * but removes the length bytes of the resulting empty stored block. When
+ * decompressing, PPP checks that at the end of input packet, inflate is
+ * waiting for these length bytes.
+ */
+int ZEXPORT zlib_fs_inflateSyncPoint(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL)
+ return Z_STREAM_ERROR;
+ return zlib_fs_inflate_blocks_sync_point(z->state->blocks);
+}
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/inflate_syms.c linux/fs/inflate_fs/inflate_syms.c
--- v2.4.13/linux/fs/inflate_fs/inflate_syms.c Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/inflate_syms.c Thu Oct 25 13:53:53 2001


@@ -0,0 +1,21 @@
+/*

+ * linux/fs/zlib/inflate_syms.c
+ *
+ * Exported symbols for the inflate functionality.


+ *
+ */
+

+#include <linux/module.h>
+#include <linux/init.h>
+
+#include <linux/zlib_fs.h>
+
+EXPORT_SYMBOL(zlib_fs_inflate_workspacesize);
+EXPORT_SYMBOL(zlib_fs_inflate);
+EXPORT_SYMBOL(zlib_fs_inflateInit_);
+EXPORT_SYMBOL(zlib_fs_inflateInit2_);
+EXPORT_SYMBOL(zlib_fs_inflateEnd);
+EXPORT_SYMBOL(zlib_fs_inflateSync);
+EXPORT_SYMBOL(zlib_fs_inflateReset);
+EXPORT_SYMBOL(zlib_fs_adler32);
+EXPORT_SYMBOL(zlib_fs_inflateSyncPoint);
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/inftrees.c linux/fs/inflate_fs/inftrees.c
--- v2.4.13/linux/fs/inflate_fs/inftrees.c Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/inftrees.c Thu Oct 25 13:53:53 2001
@@ -0,0 +1,391 @@
+/* inftrees.c -- generate Huffman trees for efficient decoding


+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"

+#include "infutil.h"
+
+static const char inflate_copyright[] =
+ " inflate 1.1.3 Copyright 1995-1998 Mark Adler ";
+/*
+ If you use the zlib library in a product, an acknowledgment is welcome
+ in the documentation of your product. If for some reason you cannot
+ include such an acknowledgment, I would appreciate that you keep this
+ copyright string in the executable of your product.
+ */
+struct internal_state;


+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+

+local int huft_build OF((
+ uIntf *, /* code lengths in bits */
+ uInt, /* number of codes */
+ uInt, /* number of "simple" codes */
+ const uIntf *, /* list of base values for non-simple codes */
+ const uIntf *, /* list of extra bits for non-simple codes */
+ inflate_huft * FAR*,/* result: starting table */
+ uIntf *, /* maximum lookup bits (returns actual) */
+ inflate_huft *, /* space for trees */
+ uInt *, /* hufts used in space */
+ uIntf * )); /* space for values */
+
+/* Tables for deflate from PKZIP's appnote.txt. */
+local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+ /* see note #13 above about 258 */
+local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
+ 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */
+local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+ 8193, 12289, 16385, 24577};
+local const uInt cpdext[30] = { /* Extra bits for distance codes */
+ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
+ 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
+ 12, 12, 13, 13};
+
+/*
+ Huffman code decoding is performed using a multi-level table lookup.
+ The fastest way to decode is to simply build a lookup table whose
+ size is determined by the longest code. However, the time it takes
+ to build this table can also be a factor if the data being decoded
+ is not very long. The most common codes are necessarily the
+ shortest codes, so those codes dominate the decoding time, and hence
+ the speed. The idea is you can have a shorter table that decodes the
+ shorter, more probable codes, and then point to subsidiary tables for
+ the longer codes. The time it costs to decode the longer codes is
+ then traded against the time it takes to make longer tables.
+
+ This results of this trade are in the variables lbits and dbits
+ below. lbits is the number of bits the first level table for literal/
+ length codes can decode in one step, and dbits is the same thing for
+ the distance codes. Subsequent tables are also less than or equal to
+ those sizes. These values may be adjusted either when all of the
+ codes are shorter than that, in which case the longest code length in
+ bits is used, or when the shortest code is *longer* than the requested
+ table size, in which case the length of the shortest code in bits is
+ used.
+
+ There are two different values for the two tables, since they code a
+ different number of possibilities each. The literal/length table
+ codes 286 possible values, or in a flat code, a little over eight
+ bits. The distance table codes 30 possible values, or a little less
+ than five bits, flat. The optimum values for speed end up being
+ about one bit more than those, so lbits is 8+1 and dbits is 5+1.
+ The optimum values may differ though from machine to machine, and
+ possibly even between compilers. Your mileage may vary.
+ */
+
+
+/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
+#define BMAX 15 /* maximum bit length of any code */
+
+local int huft_build(b, n, s, d, e, t, m, hp, hn, v)
+uIntf *b; /* code lengths in bits (all assumed <= BMAX) */
+uInt n; /* number of codes (assumed <= 288) */
+uInt s; /* number of simple-valued codes (0..s-1) */
+const uIntf *d; /* list of base values for non-simple codes */
+const uIntf *e; /* list of extra bits for non-simple codes */
+inflate_huft * FAR *t; /* result: starting table */
+uIntf *m; /* maximum lookup bits, returns actual */
+inflate_huft *hp; /* space for trees */
+uInt *hn; /* hufts used in space */
+uIntf *v; /* working area: values in order of bit length */
+/* Given a list of code lengths and a maximum table size, make a set of
+ tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
+ if the given code set is incomplete (the tables are still built in this
+ case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of
+ lengths), or Z_MEM_ERROR if not enough memory. */
+{
+
+ uInt a; /* counter for codes of length k */
+ uInt c[BMAX+1]; /* bit length count table */
+ uInt f; /* i repeats in table every f entries */
+ int g; /* maximum code length */
+ int h; /* table level */
+ register uInt i; /* counter, current code */
+ register uInt j; /* counter */
+ register int k; /* number of bits in current code */
+ int l; /* bits per table (returned in m) */
+ uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */
+ register uIntf *p; /* pointer into c[], b[], or v[] */
+ inflate_huft *q; /* points to current table */
+ struct inflate_huft_s r; /* table entry for structure assignment */
+ inflate_huft *u[BMAX]; /* table stack */
+ register int w; /* bits before this table == (l * h) */
+ uInt x[BMAX+1]; /* bit offsets, then code stack */
+ uIntf *xp; /* pointer into x */
+ int y; /* number of dummy codes added */
+ uInt z; /* number of entries in current table */
+
+
+ /* Generate counts for each bit length */
+ p = c;
+#define C0 *p++ = 0;
+#define C2 C0 C0 C0 C0
+#define C4 C2 C2 C2 C2
+ C4 /* clear c[]--assume BMAX+1 is 16 */
+ p = b; i = n;
+ do {
+ c[*p++]++; /* assume all entries <= BMAX */
+ } while (--i);
+ if (c[0] == n) /* null input--all zero length codes */
+ {
+ *t = (inflate_huft *)Z_NULL;
+ *m = 0;


+ return Z_OK;
+ }
+
+

+ /* Find minimum and maximum length, bound *m by those */
+ l = *m;
+ for (j = 1; j <= BMAX; j++)
+ if (c[j])
+ break;
+ k = j; /* minimum code length */
+ if ((uInt)l < j)
+ l = j;
+ for (i = BMAX; i; i--)
+ if (c[i])
+ break;
+ g = i; /* maximum code length */
+ if ((uInt)l > i)
+ l = i;
+ *m = l;
+
+
+ /* Adjust last length count to fill out codes, if needed */
+ for (y = 1 << j; j < i; j++, y <<= 1)
+ if ((y -= c[j]) < 0)
+ return Z_DATA_ERROR;
+ if ((y -= c[i]) < 0)
+ return Z_DATA_ERROR;
+ c[i] += y;
+
+
+ /* Generate starting offsets into the value table for each length */
+ x[1] = j = 0;
+ p = c + 1; xp = x + 2;
+ while (--i) { /* note that i == g from above */
+ *xp++ = (j += *p++);
+ }
+
+
+ /* Make a table of values in order of bit lengths */
+ p = b; i = 0;
+ do {
+ if ((j = *p++) != 0)
+ v[x[j]++] = i;
+ } while (++i < n);
+ n = x[g]; /* set n to length of v */
+
+
+ /* Generate the Huffman codes and for each, make the table entries */
+ x[0] = i = 0; /* first Huffman code is zero */
+ p = v; /* grab values in bit order */
+ h = -1; /* no tables yet--level -1 */
+ w = -l; /* bits decoded == (l * h) */
+ u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */
+ q = (inflate_huft *)Z_NULL; /* ditto */
+ z = 0; /* ditto */
+
+ /* go through the bit lengths (k already is bits in shortest code) */
+ for (; k <= g; k++)
+ {
+ a = c[k];
+ while (a--)
+ {
+ /* here i is the Huffman code of length k bits for value *p */
+ /* make tables up to required level */
+ while (k > w + l)
+ {
+ h++;
+ w += l; /* previous table always l bits */
+
+ /* compute minimum size table less than or equal to l bits */
+ z = g - w;
+ z = z > (uInt)l ? l : z; /* table size upper limit */
+ if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
+ { /* too few codes for k-w bit table */
+ f -= a + 1; /* deduct codes from patterns left */
+ xp = c + k;
+ if (j < z)
+ while (++j < z) /* try smaller tables up to z bits */
+ {
+ if ((f <<= 1) <= *++xp)
+ break; /* enough codes to use up j bits */
+ f -= *xp; /* else deduct codes from patterns */
+ }
+ }
+ z = 1 << j; /* table entries for j-bit table */
+
+ /* allocate new table */
+ if (*hn + z > MANY) /* (note: doesn't matter for fixed) */
+ return Z_MEM_ERROR; /* not enough memory */
+ u[h] = q = hp + *hn;
+ *hn += z;
+
+ /* connect to last table, if there is one */
+ if (h)
+ {
+ x[h] = i; /* save pattern for backing up */
+ r.bits = (Byte)l; /* bits to dump before this table */
+ r.exop = (Byte)j; /* bits in this table */
+ j = i >> (w - l);
+ r.base = (uInt)(q - u[h-1] - j); /* offset to this table */
+ u[h-1][j] = r; /* connect to last table */
+ }
+ else
+ *t = q; /* first table is returned result */
+ }
+
+ /* set up table entry in r */
+ r.bits = (Byte)(k - w);
+ if (p >= v + n)
+ r.exop = 128 + 64; /* out of values--invalid code */
+ else if (*p < s)
+ {
+ r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */
+ r.base = *p++; /* simple code is just the value */
+ }
+ else
+ {
+ r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */
+ r.base = d[*p++ - s];
+ }
+
+ /* fill code-like entries with r */
+ f = 1 << (k - w);
+ for (j = i >> w; j < z; j += f)
+ q[j] = r;
+
+ /* backwards increment the k-bit code i */
+ for (j = 1 << (k - 1); i & j; j >>= 1)
+ i ^= j;
+ i ^= j;
+
+ /* backup over finished tables */
+ mask = (1 << w) - 1; /* needed on HP, cc -O bug */
+ while ((i & mask) != x[h])
+ {
+ h--; /* don't need to update q */
+ w -= l;
+ mask = (1 << w) - 1;


+ }
+ }
+ }
+
+

+ /* Return Z_BUF_ERROR if we were given an incomplete table */
+ return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
+}
+
+
+int zlib_fs_inflate_trees_bits(c, bb, tb, hp, z)
+uIntf *c; /* 19 code lengths */
+uIntf *bb; /* bits tree desired/actual depth */
+inflate_huft * FAR *tb; /* bits tree result */
+inflate_huft *hp; /* space for trees */
+z_streamp z; /* for messages */
+{
+ int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
+
+ v = WS(z)->tree_work_area_1;
+ r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL,
+ tb, bb, hp, &hn, v);


+ if (r == Z_DATA_ERROR)

+ z->msg = (char*)"oversubscribed dynamic bit lengths tree";
+ else if (r == Z_BUF_ERROR || *bb == 0)
+ {
+ z->msg = (char*)"incomplete dynamic bit lengths tree";


+ r = Z_DATA_ERROR;
+ }

+ return r;
+}
+
+int zlib_fs_inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z)
+uInt nl; /* number of literal/length codes */
+uInt nd; /* number of distance codes */
+uIntf *c; /* that many (total) code lengths */
+uIntf *bl; /* literal desired/actual bit depth */
+uIntf *bd; /* distance desired/actual bit depth */
+inflate_huft * FAR *tl; /* literal/length tree result */
+inflate_huft * FAR *td; /* distance tree result */
+inflate_huft *hp; /* space for trees */
+z_streamp z; /* for messages */
+{
+ int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
+
+ /* allocate work area */
+ v = WS(z)->tree_work_area_2;
+
+ /* build literal/length tree */
+ r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v);
+ if (r != Z_OK || *bl == 0)
+ {


+ if (r == Z_DATA_ERROR)

+ z->msg = (char*)"oversubscribed literal/length tree";
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"incomplete literal/length tree";


+ r = Z_DATA_ERROR;
+ }

+ return r;
+ }
+
+ /* build distance tree */
+ r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v);
+ if (r != Z_OK || (*bd == 0 && nl > 257))
+ {


+ if (r == Z_DATA_ERROR)

+ z->msg = (char*)"oversubscribed distance tree";
+ else if (r == Z_BUF_ERROR) {
+#ifdef PKZIP_BUG_WORKAROUND


+ r = Z_OK;
+ }

+#else
+ z->msg = (char*)"incomplete distance tree";


+ r = Z_DATA_ERROR;
+ }

+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"empty distance tree with lengths";


+ r = Z_DATA_ERROR;
+ }

+ return r;
+#endif
+ }
+
+ /* done */


+ return Z_OK;
+}
+
+

+/* build fixed tables only once--keep them here */
+#include "inffixed.h"
+
+
+int zlib_fs_inflate_trees_fixed(bl, bd, tl, td, z)
+uIntf *bl; /* literal desired/actual bit depth */
+uIntf *bd; /* distance desired/actual bit depth */
+inflate_huft * FAR *tl; /* literal/length tree result */
+inflate_huft * FAR *td; /* distance tree result */
+z_streamp z; /* for memory allocation */
+{
+ *bl = fixed_bl;
+ *bd = fixed_bd;
+ *tl = fixed_tl;
+ *td = fixed_td;
+ return Z_OK;
+}
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/inftrees.h linux/fs/inflate_fs/inftrees.h
--- v2.4.13/linux/fs/inflate_fs/inftrees.h Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/inftrees.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,63 @@
+/* inftrees.h -- header to use inftrees.c


+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+

+/* Huffman code lookup table entry--this entry is four bytes for machines
+ that have 16-bit pointers (e.g. PC's in the small or medium model). */
+
+#ifndef _INFTREES_H
+#define _INFTREES_H
+
+typedef struct inflate_huft_s FAR inflate_huft;
+
+struct inflate_huft_s {
+ union {
+ struct {
+ Byte Exop; /* number of extra bits or operation */
+ Byte Bits; /* number of bits in this code or subcode */
+ } what;
+ uInt pad; /* pad structure to a power of 2 (4 bytes for */
+ } word; /* 16-bit, 8 bytes for 32-bit int's) */
+ uInt base; /* literal, length base, distance base,
+ or table offset */
+};
+
+/* Maximum size of dynamic tree. The maximum found in a long but non-
+ exhaustive search was 1004 huft structures (850 for length/literals
+ and 154 for distances, the latter actually the result of an
+ exhaustive search). The actual maximum is not known, but the
+ value below is more than safe. */
+#define MANY 1440
+
+extern int zlib_fs_inflate_trees_bits OF((
+ uIntf *, /* 19 code lengths */
+ uIntf *, /* bits tree desired/actual depth */
+ inflate_huft * FAR *, /* bits tree result */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
+
+extern int zlib_fs_inflate_trees_dynamic OF((
+ uInt, /* number of literal/length codes */
+ uInt, /* number of distance codes */
+ uIntf *, /* that many (total) code lengths */
+ uIntf *, /* literal desired/actual bit depth */
+ uIntf *, /* distance desired/actual bit depth */
+ inflate_huft * FAR *, /* literal/length tree result */
+ inflate_huft * FAR *, /* distance tree result */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
+
+extern int zlib_fs_inflate_trees_fixed OF((
+ uIntf *, /* literal desired/actual bit depth */
+ uIntf *, /* distance desired/actual bit depth */
+ inflate_huft * FAR *, /* literal/length tree result */
+ inflate_huft * FAR *, /* distance tree result */
+ z_streamp)); /* for memory allocation */
+
+#endif /* _INFTREES_H */
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/infutil.c linux/fs/inflate_fs/infutil.c
--- v2.4.13/linux/fs/inflate_fs/infutil.c Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/infutil.c Thu Oct 25 13:53:53 2001
@@ -0,0 +1,87 @@
+/* inflate_util.c -- data and routines common to blocks and codes


+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+#include "inftrees.h"
+#include "infcodes.h"
+#include "infutil.h"
+
+struct inflate_codes_state;
+

+/* And'ing with mask[n] masks the lower n bits */
+uInt zlib_fs_inflate_mask[17] = {
+ 0x0000,
+ 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
+ 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
+};
+
+
+/* copy as much as possible from the sliding window to the output area */
+int zlib_fs_inflate_flush(s, z, r)


+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{

+ uInt n;
+ Bytef *p;
+ Bytef *q;
+
+ /* local copies of source and destination pointers */
+ p = z->next_out;
+ q = s->read;
+
+ /* compute number of bytes to copy as far as end of window */
+ n = (uInt)((q <= s->write ? s->write : s->end) - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ /* update counters */
+ z->avail_out -= n;
+ z->total_out += n;
+
+ /* update check information */


+ if (s->checkfn != Z_NULL)

+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ /* copy as far as end of window */
+ memcpy(p, q, n);
+ p += n;
+ q += n;
+
+ /* see if more to copy at beginning of window */
+ if (q == s->end)
+ {
+ /* wrap pointers */
+ q = s->window;
+ if (s->write == s->end)
+ s->write = s->window;
+
+ /* compute bytes to copy */
+ n = (uInt)(s->write - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ /* update counters */
+ z->avail_out -= n;
+ z->total_out += n;
+
+ /* update check information */


+ if (s->checkfn != Z_NULL)

+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ /* copy */
+ memcpy(p, q, n);
+ p += n;
+ q += n;
+ }
+
+ /* update pointers */
+ z->next_out = p;
+ s->read = q;
+
+ /* done */
+ return r;
+}
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/infutil.h linux/fs/inflate_fs/infutil.h
--- v2.4.13/linux/fs/inflate_fs/infutil.h Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/infutil.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,197 @@
+/* infutil.h -- types and macros common to blocks and codes


+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+

+#ifndef _INFUTIL_H
+#define _INFUTIL_H
+
+#include "zconf.h"
+#include "inftrees.h"
+#include "infcodes.h"
+
+typedef enum {
+ TYPE, /* get type bits (3, including end bit) */
+ LENS, /* get lengths for stored */
+ STORED, /* processing stored block */
+ TABLE, /* get table lengths */
+ BTREE, /* get bit lengths tree for a dynamic block */
+ DTREE, /* get length, distance trees for a dynamic block */
+ CODES, /* processing fixed or dynamic block */
+ DRY, /* output remaining window bytes */
+ B_DONE, /* finished last block, done */
+ B_BAD} /* got a data error--stuck here */
+inflate_block_mode;
+
+/* inflate blocks semi-private state */
+struct inflate_blocks_state {
+
+ /* mode */
+ inflate_block_mode mode; /* current inflate_block mode */
+
+ /* mode dependent information */
+ union {
+ uInt left; /* if STORED, bytes left to copy */
+ struct {
+ uInt table; /* table lengths (14 bits) */
+ uInt index; /* index into blens (or border) */
+ uIntf *blens; /* bit lengths of codes */
+ uInt bb; /* bit length tree depth */
+ inflate_huft *tb; /* bit length decoding tree */
+ } trees; /* if DTREE, decoding info for trees */
+ struct {
+ inflate_codes_statef
+ *codes;
+ } decode; /* if CODES, current state */
+ } sub; /* submode */
+ uInt last; /* true if this block is the last block */
+
+ /* mode independent information */
+ uInt bitk; /* bits in bit buffer */
+ uLong bitb; /* bit buffer */
+ inflate_huft *hufts; /* single malloc for tree space */
+ Bytef *window; /* sliding window */
+ Bytef *end; /* one byte after sliding window */
+ Bytef *read; /* window read pointer */
+ Bytef *write; /* window write pointer */
+ check_func checkfn; /* check function */
+ uLong check; /* check on output */
+
+};
+
+
+/* defines for inflate input/output */
+/* update pointers and return */
+#define UPDBITS {s->bitb=b;s->bitk=k;}
+#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
+#define UPDOUT {s->write=q;}
+#define UPDATE {UPDBITS UPDIN UPDOUT}
+#define LEAVE {UPDATE return zlib_fs_inflate_flush(s,z,r);}
+/* get bytes and bits */
+#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
+#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
+#define NEXTBYTE (n--,*p++)
+#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
+#define DUMPBITS(j) {b>>=(j);k-=(j);}
+/* output bytes */
+#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q)
+#define LOADOUT {q=s->write;m=(uInt)WAVAIL;}
+#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
+#define FLUSH {UPDOUT r=zlib_fs_inflate_flush(s,z,r); LOADOUT}
+#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
+#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
+/* load local pointers */
+#define LOAD {LOADIN LOADOUT}
+
+/* masks for lower bits (size given to avoid silly warnings with Visual C++) */
+extern uInt zlib_fs_inflate_mask[17];
+
+/* copy as much as possible from the sliding window to the output area */
+extern int zlib_fs_inflate_flush OF((


+ inflate_blocks_statef *,
+ z_streamp ,
+ int));
+

+/* inflate private state */
+typedef enum {
+ METHOD, /* waiting for method byte */
+ FLAG, /* waiting for flag byte */
+ DICT4, /* four dictionary check bytes to go */
+ DICT3, /* three dictionary check bytes to go */
+ DICT2, /* two dictionary check bytes to go */
+ DICT1, /* one dictionary check byte to go */
+ DICT0, /* waiting for inflateSetDictionary */
+ BLOCKS, /* decompressing blocks */
+ CHECK4, /* four check bytes to go */
+ CHECK3, /* three check bytes to go */
+ CHECK2, /* two check bytes to go */
+ CHECK1, /* one check byte to go */
+ I_DONE, /* finished check, done */
+ I_BAD} /* got an error--stay here */
+inflate_mode;
+
+struct internal_state {
+
+ /* mode */
+ inflate_mode mode; /* current inflate mode */
+
+ /* mode dependent information */
+ union {
+ uInt method; /* if FLAGS, method byte */
+ struct {
+ uLong was; /* computed check value */
+ uLong need; /* stream check value */
+ } check; /* if CHECK, check values to compare */
+ uInt marker; /* if BAD, inflateSync's marker bytes count */
+ } sub; /* submode */
+
+ /* mode independent information */
+ int nowrap; /* flag for no wrapper */
+ uInt wbits; /* log2(window size) (8..15, defaults to 15) */
+ inflate_blocks_statef
+ *blocks; /* current inflate_blocks state */
+
+};
+
+/* inflate codes private state */
+typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
+ START, /* x: set up for LEN */
+ LEN, /* i: get length/literal/eob next */
+ LENEXT, /* i: getting length extra (have base) */
+ DIST, /* i: get distance next */
+ DISTEXT, /* i: getting distance extra */
+ COPY, /* o: copying bytes in window, waiting for space */
+ LIT, /* o: got literal, waiting for output space */
+ WASH, /* o: got eob, possibly still output waiting */
+ END, /* x: got eob and all data flushed */
+ BADCODE} /* x: got error */
+inflate_codes_mode;
+
+struct inflate_codes_state {
+
+ /* mode */
+ inflate_codes_mode mode; /* current inflate_codes mode */
+
+ /* mode dependent information */
+ uInt len;
+ union {
+ struct {
+ inflate_huft *tree; /* pointer into tree */
+ uInt need; /* bits needed */
+ } code; /* if LEN or DIST, where in tree */
+ uInt lit; /* if LIT, literal */
+ struct {
+ uInt get; /* bits to get for extra */
+ uInt dist; /* distance back to copy from */
+ } copy; /* if EXT or COPY, where and how much */
+ } sub; /* submode */
+
+ /* mode independent information */
+ Byte lbits; /* ltree bits decoded per branch */
+ Byte dbits; /* dtree bits decoder per branch */
+ inflate_huft *ltree; /* literal/length/eob tree */
+ inflate_huft *dtree; /* distance tree */
+
+};
+
+/* memory allocation for inflation */
+
+struct inflate_workspace {
+ inflate_codes_statef working_state;
+ struct inflate_blocks_state working_blocks_state;
+ struct internal_state internal_state;
+ unsigned int tree_work_area_1[19];
+ unsigned int tree_work_area_2[288];
+ unsigned working_blens[258 + 0x1f + 0x1f];
+ inflate_huft working_hufts[MANY];
+ unsigned char working_window[1 << MAX_WBITS];
+};
+
+#define WS(z) ((struct inflate_workspace *)(z->workspace))
+
+#endif
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/zconf.h linux/fs/inflate_fs/zconf.h
--- v2.4.13/linux/fs/inflate_fs/zconf.h Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/zconf.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,90 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.


+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+

+#ifndef _ZCONF_H
+#define _ZCONF_H
+
+#if defined(__GNUC__) || defined(__386__) || defined(i386)
+# ifndef __32BIT__
+# define __32BIT__
+# endif
+#endif
+
+#if defined(__STDC__) || defined(__cplusplus)
+# ifndef STDC
+# define STDC
+# endif
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# define MAX_MEM_LEVEL 9
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+#ifndef FAR
+# define FAR
+#endif
+
+typedef unsigned char Byte; /* 8 bits */
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+typedef Byte FAR Bytef;
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+typedef void FAR *voidpf;
+typedef void *voidp;
+
+#include <linux/types.h> /* for off_t */
+#include <linux/unistd.h> /* for SEEK_* and off_t */
+#define z_off_t off_t
+
+#endif /* _ZCONF_H */
diff -u --recursive --new-file v2.4.13/linux/fs/inflate_fs/zutil.h linux/fs/inflate_fs/zutil.h
--- v2.4.13/linux/fs/inflate_fs/zutil.h Wed Dec 31 16:00:00 1969
+++ linux/fs/inflate_fs/zutil.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,70 @@
+/* zutil.h -- internal interface and configuration of the compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.


+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+

+/* @(#) $Id: zutil.h,v 1.1 2000/01/01 03:32:23 davem Exp $ */
+
+#ifndef _Z_UTIL_H
+#define _Z_UTIL_H
+
+#include <linux/zlib_fs.h>
+#include <linux/string.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+typedef unsigned char uch;
+typedef uch FAR uchf;
+typedef unsigned short ush;
+typedef ush FAR ushf;
+typedef unsigned long ulg;
+
+ /* common constants */
+
+#ifndef DEF_WBITS
+# define DEF_WBITS MAX_WBITS
+#endif
+/* default windowBits for decompression. MAX_WBITS is for compression only */
+
+#if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+#else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+/* default memLevel */
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES 2
+/* The three kinds of block type */
+
+#define MIN_MATCH 3
+#define MAX_MATCH 258
+/* The minimum and maximum match lengths */
+
+#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+
+ /* target dependencies */
+
+ /* Common defaults */
+
+#ifndef OS_CODE
+# define OS_CODE 0x03 /* assume Unix */
+#endif
+
+ /* functions */
+
+typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
+ uInt len));
+
+#endif /* _Z_UTIL_H */
diff -u --recursive --new-file v2.4.13/linux/fs/isofs/Makefile linux/fs/isofs/Makefile
--- v2.4.13/linux/fs/isofs/Makefile Fri Dec 29 14:07:23 2000
+++ linux/fs/isofs/Makefile Thu Oct 25 13:53:53 2001
@@ -11,7 +11,10 @@
X
X obj-y := namei.o inode.o dir.o util.o rock.o
X obj-$(CONFIG_JOLIET) += joliet.o
+obj-$(CONFIG_ZISOFS) += compress.o


X
X obj-m := $(O_TARGET)

+
+CFLAGS_compress.o := -I $(TOPDIR)/fs/inflate_fs
X
X include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.13/linux/fs/isofs/compress.c linux/fs/isofs/compress.c
--- v2.4.13/linux/fs/isofs/compress.c Wed Dec 31 16:00:00 1969
+++ linux/fs/isofs/compress.c Thu Oct 25 13:53:53 2001
@@ -0,0 +1,363 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ * Copyright 2001 H. Peter Anvin - All Rights Reserved


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by

+ * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
+ * USA; either version 2 of the License, or (at your option) any later
+ * version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * linux/fs/isofs/compress.c
+ *
+ * Transparent decompression of files on an iso9660 filesystem
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+
+#include <linux/stat.h>
+#include <linux/sched.h>
+#include <linux/iso_fs.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/mm.h>
+#include <linux/string.h>
+#include <linux/locks.h>
+#include <linux/slab.h>
+#include <linux/errno.h>
+#include <linux/cdrom.h>
+#include <linux/init.h>
+#include <linux/nls.h>
+#include <linux/ctype.h>
+#include <linux/smp_lock.h>
+#include <linux/blkdev.h>
+#include <linux/vmalloc.h>
+#include <linux/zlib_fs.h>
+
+#include <asm/system.h>
+#include <asm/uaccess.h>
+#include <asm/semaphore.h>
+
+#include "zisofs.h"
+
+#define min(a,b) ((a)<(b)?(a):(b))
+#define max(a,b) ((a)>(b)?(a):(b))
+
+/* This should probably be global. */
+static char zisofs_sink_page[PAGE_CACHE_SIZE];
+
+/*
+ * This contains the zlib memory allocation and the mutex for the
+ * allocation; this avoids failures at block-decompression time.
+ */
+static void *zisofs_zlib_workspace;
+static struct semaphore zisofs_zlib_semaphore;
+
+/*
+ * When decompressing, we typically obtain more than one page
+ * per reference. We inject the additional pages into the page
+ * cache as a form of readahead.
+ */
+static int zisofs_readpage(struct file *file, struct page *page)
+{
+ struct inode *inode = file->f_dentry->d_inode;
+ struct address_space *mapping = inode->i_mapping;
+ unsigned int maxpage, xpage, fpage, blockindex;
+ unsigned long offset;
+ unsigned long blockptr, blockendptr, cstart, cend, csize;
+ struct buffer_head *bh, *ptrbh[2];
+ unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
+ unsigned int bufshift = ISOFS_BUFFER_BITS(inode);
+ unsigned long bufmask = bufsize - 1;
+ int err = -EIO;
+ int i;
+ unsigned int header_size = inode->u.isofs_i.i_format_parm[0];
+ unsigned int zisofs_block_shift = inode->u.isofs_i.i_format_parm[1];
+ /* unsigned long zisofs_block_size = 1UL << zisofs_block_shift; */
+ unsigned int zisofs_block_page_shift = zisofs_block_shift-PAGE_CACHE_SHIFT;
+ unsigned long zisofs_block_pages = 1UL << zisofs_block_page_shift;
+ unsigned long zisofs_block_page_mask = zisofs_block_pages-1;
+ struct page *pages[zisofs_block_pages];
+ unsigned long index = page->index;
+ int indexblocks;
+
+ /* We have already been given one page, this is the one
+ we must do. */
+ xpage = index & zisofs_block_page_mask;
+ pages[xpage] = page;
+
+ /* The remaining pages need to be allocated and inserted */
+ offset = index & ~zisofs_block_page_mask;
+ blockindex = offset >> zisofs_block_page_shift;
+ maxpage = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+ maxpage = min(zisofs_block_pages, maxpage-offset);
+
+ for ( i = 0 ; i < maxpage ; i++, offset++ ) {
+ if ( i != xpage ) {
+ pages[i] = grab_cache_page_nowait(mapping, offset);
+ }
+ page = pages[i];
+ if ( page ) {
+ ClearPageError(page);
+ kmap(page);
+ }
+ }
+
+ /* This is the last page filled, plus one; used in case of abort. */
+ fpage = 0;
+
+ /* Find the pointer to this specific chunk */
+ /* Note: we're not using isonum_731() here because the data is known aligned */
+ /* Note: header_size is in 32-bit words (4 bytes) */
+ blockptr = (header_size + blockindex) << 2;
+ blockendptr = blockptr + 4;
+
+ indexblocks = ((blockptr^blockendptr) >> bufshift) ? 2 : 1;
+ ptrbh[0] = ptrbh[1] = 0;
+
+ if ( isofs_get_blocks(inode, blockptr >> bufshift, ptrbh, indexblocks) != indexblocks ) {
+ if ( ptrbh[0] ) brelse(ptrbh[0]);
+ printk(KERN_DEBUG "zisofs: Null buffer on reading block table, inode = %lu, block = %lu\n",
+ inode->i_ino, blockptr >> bufshift);
+ goto eio;
+ }
+ ll_rw_block(READ, indexblocks, ptrbh);
+
+ bh = ptrbh[0];
+ if ( !bh || (wait_on_buffer(bh), !buffer_uptodate(bh)) ) {
+ printk(KERN_DEBUG "zisofs: Failed to read block table, inode = %lu, block = %lu\n",
+ inode->i_ino, blockptr >> bufshift);
+ if ( ptrbh[1] )
+ brelse(ptrbh[1]);
+ goto eio;
+ }
+ cstart = le32_to_cpu(*(u32 *)(bh->b_data + (blockptr & bufmask)));
+
+ if ( indexblocks == 2 ) {
+ /* We just crossed a block boundary. Switch to the next block */
+ brelse(bh);
+ bh = ptrbh[1];
+ if ( !bh || (wait_on_buffer(bh), !buffer_uptodate(bh)) ) {
+ printk(KERN_DEBUG "zisofs: Failed to read block table, inode = %lu, block = %lu\n",
+ inode->i_ino, blockendptr >> bufshift);
+ goto eio;
+ }
+ }
+ cend = le32_to_cpu(*(u32 *)(bh->b_data + (blockendptr & bufmask)));
+ brelse(bh);
+
+ csize = cend-cstart;
+
+ /* Now page[] contains an array of pages, any of which can be NULL,
+ and the locks on which we hold. We should now read the data and
+ release the pages. If the pages are NULL the decompressed data
+ for that particular page should be discarded. */
+
+ if ( csize == 0 ) {
+ /* This data block is empty. */
+
+ for ( fpage = 0 ; fpage < maxpage ; fpage++ ) {
+ if ( (page = pages[fpage]) != NULL ) {
+ memset(page_address(page), 0, PAGE_CACHE_SIZE);
+
+ flush_dcache_page(page);
+ SetPageUptodate(page);
+ kunmap(page);
+ UnlockPage(page);
+ if ( fpage == xpage )
+ err = 0; /* The critical page */
+ else
+ page_cache_release(page);
+ }
+ }
+ } else {
+ /* This data block is compressed. */
+ z_stream stream;
+ int bail = 0, left_out = -1;
+ int zerr;
+ int needblocks = (csize + (cstart & bufmask) + bufmask) >> bufshift;
+ int haveblocks;
+ struct buffer_head *bhs[needblocks+1];
+ struct buffer_head **bhptr;
+
+ /* Because zlib is not thread-safe, do all the I/O at the top. */
+
+ blockptr = cstart >> bufshift;
+ memset(bhs, 0, (needblocks+1)*sizeof(struct buffer_head *));
+ haveblocks = isofs_get_blocks(inode, blockptr, bhs, needblocks);
+ ll_rw_block(READ, haveblocks, bhs);
+
+ bhptr = &bhs[0];
+ bh = *bhptr++;
+
+ /* First block is special since it may be fractional.
+ We also wait for it before grabbing the zlib
+ semaphore; odds are that the subsequent blocks are
+ going to come in in short order so we don't hold
+ the zlib semaphore longer than necessary. */
+
+ if ( !bh || (wait_on_buffer(bh), !buffer_uptodate(bh)) ) {
+ printk(KERN_DEBUG "zisofs: Hit null buffer, fpage = %d, xpage = %d, csize = %ld\n",
+ fpage, xpage, csize);
+ goto b_eio;
+ }
+ stream.next_in = bh->b_data + (cstart & bufmask);
+ stream.avail_in = min(bufsize-(cstart & bufmask), csize);
+ csize -= stream.avail_in;
+
+ stream.workspace = zisofs_zlib_workspace;
+ down(&zisofs_zlib_semaphore);
+
+ zerr = zlib_fs_inflateInit(&stream);
+ if ( zerr != Z_OK ) {
+ if ( err && zerr == Z_MEM_ERROR )
+ err = -ENOMEM;
+ printk(KERN_DEBUG "zisofs: zisofs_inflateInit returned %d\n",
+ zerr);
+ goto z_eio;
+ }
+
+ while ( !bail && fpage < maxpage ) {
+ page = pages[fpage];
+ if ( page )
+ stream.next_out = page_address(page);
+ else
+ stream.next_out = (void *)&zisofs_sink_page;
+ stream.avail_out = PAGE_CACHE_SIZE;
+
+ while ( stream.avail_out ) {
+ int ao, ai;
+ if ( stream.avail_in == 0 && left_out ) {
+ if ( !csize ) {
+ printk(KERN_WARNING "zisofs: ZF read beyond end of input\n");
+ bail = 1;
+ break;
+ } else {
+ bh = *bhptr++;
+ if ( !bh ||
+ (wait_on_buffer(bh), !buffer_uptodate(bh)) ) {
+ /* Reached an EIO */
+ printk(KERN_DEBUG "zisofs: Hit null buffer, fpage = %d, xpage = %d, csize = %ld\n",
+ fpage, xpage, csize);
+
+ bail = 1;
+ break;
+ }
+ stream.next_in = bh->b_data;
+ stream.avail_in = min(csize,bufsize);
+ csize -= stream.avail_in;
+ }
+ }
+ ao = stream.avail_out; ai = stream.avail_in;
+ zerr = zlib_fs_inflate(&stream, Z_SYNC_FLUSH);
+ left_out = stream.avail_out;
+ if ( zerr == Z_BUF_ERROR && stream.avail_in == 0 )
+ continue;
+ if ( zerr != Z_OK ) {
+ /* EOF, error, or trying to read beyond end of input */
+ if ( err && zerr == Z_MEM_ERROR )
+ err = -ENOMEM;
+ if ( zerr != Z_STREAM_END )
+ printk(KERN_DEBUG "zisofs: zisofs_inflate returned %d, inode = %lu, index = %lu, fpage = %d, xpage = %d, avail_in = %d, avail_out = %d, ai = %d, ao = %d\n",
+ zerr, inode->i_ino, index,
+ fpage, xpage,
+ stream.avail_in, stream.avail_out,
+ ai, ao);
+ bail = 1;


+ break;
+ }
+ }
+

+ if ( stream.avail_out && zerr == Z_STREAM_END ) {
+ /* Fractional page written before EOF. This may
+ be the last page in the file. */
+ memset(stream.next_out, 0, stream.avail_out);
+ stream.avail_out = 0;
+ }
+
+ if ( !stream.avail_out ) {
+ /* This page completed */
+ if ( page ) {
+ flush_dcache_page(page);
+ SetPageUptodate(page);
+ kunmap(page);
+ UnlockPage(page);
+ if ( fpage == xpage )
+ err = 0; /* The critical page */
+ else
+ page_cache_release(page);
+ }
+ fpage++;
+ }
+ }
+ zlib_fs_inflateEnd(&stream);
+
+ z_eio:
+ up(&zisofs_zlib_semaphore);
+
+ b_eio:
+ for ( i = 0 ; i < haveblocks ; i++ ) {
+ if ( bhs[i] )
+ brelse(bhs[i]);
+ }
+ }
+
+eio:
+
+ /* Release any residual pages, do not SetPageUptodate */
+ while ( fpage < maxpage ) {
+ page = pages[fpage];
+ if ( page ) {
+ flush_dcache_page(page);
+ if ( fpage == xpage )
+ SetPageError(page);
+ kunmap(page);
+ UnlockPage(page);
+ if ( fpage != xpage )
+ page_cache_release(page);
+ }
+ fpage++;
+ }
+
+ /* At this point, err contains 0 or -EIO depending on the "critical" page */


+ return err;
+}
+

+struct address_space_operations zisofs_aops = {
+ readpage: zisofs_readpage,
+ /* No sync_page operation supported? */
+ /* No bmap operation supported */
+};
+
+static int initialized = 0;
+
+int __init zisofs_init(void)
+{
+ if ( initialized ) {
+ printk("zisofs_init: called more than once\n");


+ return 0;
+ }
+

+ zisofs_zlib_workspace = vmalloc(zlib_fs_inflate_workspacesize());
+ if ( !zisofs_zlib_workspace )
+ return -ENOMEM;
+ init_MUTEX(&zisofs_zlib_semaphore);
+
+ initialized = 1;


+ return 0;
+}
+

+void __exit zisofs_cleanup(void)
+{
+ if ( !initialized ) {
+ printk("zisofs_cleanup: called without initialization\n");
+ return;
+ }
+
+ vfree(zisofs_zlib_workspace);


+ initialized = 0;
+}

diff -u --recursive --new-file v2.4.13/linux/fs/isofs/inode.c linux/fs/isofs/inode.c
--- v2.4.13/linux/fs/isofs/inode.c Tue Oct 23 22:48:53 2001
+++ linux/fs/isofs/inode.c Thu Oct 25 13:53:53 2001
@@ -32,6 +32,8 @@
X #include <asm/system.h>
X #include <asm/uaccess.h>
X
+#include "zisofs.h"
+
X /*
X * We have no support for "multi volume" CDs, but more and more disks carry
X * wrong information within the volume descriptors.
@@ -109,6 +111,7 @@
X char joliet;
X char cruft;
X char unhide;
+ char nocompress;
X unsigned char check;
X unsigned int blocksize;
X mode_t mode;
@@ -278,6 +281,7 @@
X popt->cruft = 'n';
X popt->unhide = 'n';
X popt->check = 'u'; /* unset */
+ popt->nocompress = 0;
X popt->blocksize = 1024;
X popt->mode = S_IRUGO | S_IXUGO; /* r-x for all. The disc could
X be shared with DOS machines so
@@ -311,6 +315,10 @@
X popt->utf8 = 1;
X continue;
X }
+ if (strncmp(this_char,"nocompress",10) == 0) {
+ popt->nocompress = 1;
+ continue;
+ }
X if ((value = strchr(this_char,'=')) != NULL)
X *value++ = 0;
X
@@ -758,6 +766,7 @@
X s->u.isofs_sb.s_uid = opt.uid;
X s->u.isofs_sb.s_gid = opt.gid;
X s->u.isofs_sb.s_utf8 = opt.utf8;
+ s->u.isofs_sb.s_nocompress = opt.nocompress;
X /*
X * It would be incredibly stupid to allow people to mark every file
X * on the disk as suid, so we merely allow them to set the default
@@ -874,93 +883,108 @@


X return 0;
X }
X

-/* Life is simpler than for other filesystem since we never
- * have to create a new block, only find an existing one.
+/*
+ * Get a set of blocks; filling in buffer_heads if already allocated
+ * or getblk() if they are not. Returns the number of blocks inserted
+ * (0 == error.)
X */
-static int isofs_get_block(struct inode *inode, long iblock,
- struct buffer_head *bh_result, int create)
+int isofs_get_blocks(struct inode *inode, long iblock,
+ struct buffer_head **bh_result, unsigned long nblocks)
X {
X unsigned long b_off;
X unsigned offset, sect_size;
X unsigned int firstext;
X unsigned long nextino;
- int i, err;
+ int section, rv;
+ unsigned int blocksize = inode->i_sb->s_blocksize;
X
X lock_kernel();
X
- err = -EROFS;
- if (create)
- goto abort_create_attempted;
-
- err = -EIO;
- if (iblock < 0)
- goto abort_negative;
+ rv = 0;
+ if (iblock < 0) {
+ printk("isofs_get_blocks: block < 0\n");
+ goto abort;
+ }
X
X b_off = iblock;
-
- /* If we are *way* beyond the end of the file, print a message.
- * Access beyond the end of the file up to the next page boundary
- * is normal, however because of the way the page cache works.


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 45'
echo 'File patch-2.4.14 is continued in part 46'
echo "46" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:13 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part50

#!/bin/sh -x
# this is part 50 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 50; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+++ linux/include/asm-arm/proc-armv/cache.h Thu Oct 25 13:53:55 2001
@@ -128,7 +128,14 @@
X #define clean_dcache_entry(_s) cpu_dcache_clean_entry((unsigned long)(_s))
X
X /*
- * I cache only
+ * I cache coherency stuff.
+ *
+ * This *is not* just icache. It is to make data written to memory
+ * consistent such that instructions fetched from the region are what
+ * we expect.
+ *
+ * This generally means that we have to clean out the Dcache and write
+ * buffers, and maybe flush the Icache in the specified range.
X */
X #define flush_icache_range(_s,_e) \
X do { \
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/proc-armv/uaccess.h linux/include/asm-arm/proc-armv/uaccess.h
--- v2.4.13/linux/include/asm-arm/proc-armv/uaccess.h Mon Aug 27 12:41:47 2001
+++ linux/include/asm-arm/proc-armv/uaccess.h Thu Oct 25 13:53:55 2001
@@ -57,8 +57,9 @@
X #define __put_user_asm_half(x,addr,err) \
X ({ \
X unsigned long __temp = (unsigned long)(x); \
- __put_user_asm_byte(__temp, addr, err); \
- __put_user_asm_byte(__temp >> 8, (int)(addr) + 1, err); \
+ unsigned long __ptr = (unsigned long)(addr); \
+ __put_user_asm_byte(__temp, __ptr, err); \
+ __put_user_asm_byte(__temp >> 8, __ptr + 1, err); \
X })
X
X #define __put_user_asm_word(x,addr,err) \
@@ -96,9 +97,9 @@
X
X #define __get_user_asm_half(x,addr,err) \
X ({ \
- unsigned long __b1, __b2; \
- __get_user_asm_byte(__b1, addr, err); \
- __get_user_asm_byte(__b2, (int)(addr) + 1, err); \
+ unsigned long __b1, __b2, __ptr = (unsigned long)addr; \
+ __get_user_asm_byte(__b1, __ptr, err); \
+ __get_user_asm_byte(__b2, __ptr + 1, err); \
X (x) = __b1 | (__b2 << 8); \
X })
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/setup.h linux/include/asm-arm/setup.h
--- v2.4.13/linux/include/asm-arm/setup.h Tue Oct 23 22:48:53 2001
+++ linux/include/asm-arm/setup.h Thu Oct 25 13:53:55 2001
@@ -99,7 +99,7 @@
X };
X
X /* it is allowed to have multiple ATAG_MEM nodes */
-#define ATAG_MEM 0x54410002
+#define ATAG_MEM 0x54410002
X
X struct tag_mem32 {
X u32 size;
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/uaccess.h linux/include/asm-arm/uaccess.h
--- v2.4.13/linux/include/asm-arm/uaccess.h Tue Oct 23 22:48:53 2001
+++ linux/include/asm-arm/uaccess.h Thu Oct 25 13:53:55 2001
@@ -117,8 +117,8 @@
X
X #define put_user(x,p) \
X ({ \
- const register typeof(*(p)) *__p asm("r0") = (p); \
X const register typeof(*(p)) __r1 asm("r1") = (x); \
+ const register typeof(*(p)) *__p asm("r0") = (p); \
X register int __e asm("r0"); \
X switch (sizeof(*(p))) { \
X case 1: \
diff -u --recursive --new-file v2.4.13/linux/include/asm-i386/floppy.h linux/include/asm-i386/floppy.h
--- v2.4.13/linux/include/asm-i386/floppy.h Thu Oct 18 13:47:38 2001
+++ linux/include/asm-i386/floppy.h Mon Nov 5 12:42:14 2001
@@ -315,5 +315,6 @@
X
X #define AUTO_DMA
X
+#define EXTRA_FLOPPY_PARAMS
X
X #endif /* __ASM_I386_FLOPPY_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-i386/io.h linux/include/asm-i386/io.h
--- v2.4.13/linux/include/asm-i386/io.h Thu Oct 18 13:48:01 2001
+++ linux/include/asm-i386/io.h Mon Nov 5 12:42:21 2001
@@ -189,11 +189,35 @@


X return retval;
X }
X

+/*
+ * Cache management
+ *
+ * This needed for two cases
+ * 1. Out of order aware processors
+ * 2. Accidentally out of order processors (PPro errata #51)
+ */
+
+#if defined(CONFIG_X86_OOSTORE) || defined(CONFIG_X86_PPRO_FENCE)
+
+static inline void flush_write_buffers(void)
+{
+ __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory");
+}
+
+#define dma_cache_inv(_start,_size) flush_write_buffers()
+#define dma_cache_wback(_start,_size) flush_write_buffers()
+#define dma_cache_wback_inv(_start,_size) flush_write_buffers()
+
+#else
+
X /* Nothing to do */
X
X #define dma_cache_inv(_start,_size) do { } while (0)
X #define dma_cache_wback(_start,_size) do { } while (0)
X #define dma_cache_wback_inv(_start,_size) do { } while (0)
+#define flush_write_buffers()
+
+#endif
X

X #endif /* __KERNEL__ */

X
diff -u --recursive --new-file v2.4.13/linux/include/asm-i386/spinlock.h linux/include/asm-i386/spinlock.h
--- v2.4.13/linux/include/asm-i386/spinlock.h Thu Oct 18 13:47:37 2001
+++ linux/include/asm-i386/spinlock.h Mon Nov 5 12:42:13 2001
@@ -66,9 +66,52 @@
X
X /*
X * This works. Despite all the confusion.
+ * (except on PPro SMP or if we are using OOSTORE)
+ * (PPro errata 66, 92)
X */
+
+#if !defined(CONFIG_X86_OOSTORE) && !defined(CONFIG_X86_PPRO_FENCE)
+
+#define spin_unlock_string \
+ "movb $1,%0" \
+ :"=m" (lock->lock) : : "memory"
+
+
+static inline void spin_unlock(spinlock_t *lock)
+{
+#if SPINLOCK_DEBUG
+ if (lock->magic != SPINLOCK_MAGIC)
+ BUG();
+ if (!spin_is_locked(lock))
+ BUG();
+#endif
+ __asm__ __volatile__(
+ spin_unlock_string
+ );
+}
+
+#else
+
X #define spin_unlock_string \
- "movb $1,%0"
+ "xchgb %b0, %1" \
+ :"=q" (oldval), "=m" (lock->lock) \
+ :"0" (oldval) : "memory"
+
+static inline void spin_unlock(spinlock_t *lock)
+{
+ char oldval = 1;
+#if SPINLOCK_DEBUG
+ if (lock->magic != SPINLOCK_MAGIC)
+ BUG();
+ if (!spin_is_locked(lock))
+ BUG();
+#endif
+ __asm__ __volatile__(
+ spin_unlock_string
+ );
+}
+
+#endif
X
X static inline int spin_trylock(spinlock_t *lock)


X {
@@ -95,18 +138,6 @@

X :"=m" (lock->lock) : : "memory");
X }
X
-static inline void spin_unlock(spinlock_t *lock)
-{
-#if SPINLOCK_DEBUG
- if (lock->magic != SPINLOCK_MAGIC)
- BUG();
- if (!spin_is_locked(lock))
- BUG();
-#endif
- __asm__ __volatile__(
- spin_unlock_string
- :"=m" (lock->lock) : : "memory");
-}
X
X /*
X * Read-write spinlocks, allowing multiple readers
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/atarihw.h linux/include/asm-m68k/atarihw.h
--- v2.4.13/linux/include/asm-m68k/atarihw.h Mon Nov 27 18:00:49 2000
+++ linux/include/asm-m68k/atarihw.h Thu Oct 25 13:53:55 2001
@@ -22,6 +22,7 @@
X
X #include <linux/types.h>
X #include <asm/bootinfo.h>
+#include <asm/raw_io.h>
X
X extern u_long atari_mch_cookie;
X extern u_long atari_mch_type;
@@ -121,6 +122,15 @@
X * reads from memory). Both '040 and '060 invalidate cache entries on snooped
X * DMA reads (i.e., writes to memory).
X */
+
+
+#define atari_readb raw_inb
+#define atari_writeb raw_outb
+
+#define atari_inb_p raw_inb
+#define atari_outb_p raw_outb
+
+
X
X #include <linux/mm.h>
X #include <asm/pgalloc.h>
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/bitops.h linux/include/asm-m68k/bitops.h
--- v2.4.13/linux/include/asm-m68k/bitops.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-m68k/bitops.h Thu Oct 25 13:53:55 2001
@@ -45,6 +45,8 @@
X __constant_set_bit(nr, vaddr) : \
X __generic_set_bit(nr, vaddr))
X
+#define __set_bit(nr,vaddr) set_bit(nr,vaddr)
+
X extern __inline__ void __constant_set_bit(int nr, volatile void * vaddr)
X {
X __asm__ __volatile__ ("bset %1,%0"
@@ -61,6 +63,8 @@
X (__builtin_constant_p(nr) ? \
X __constant_test_and_clear_bit(nr, vaddr) : \
X __generic_test_and_clear_bit(nr, vaddr))
+
+#define __test_and_clear_bit(nr,vaddr) test_and_clear_bit(nr,vaddr)
X
X extern __inline__ int __constant_test_and_clear_bit(int nr, volatile void * vaddr)
X {
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/floppy.h linux/include/asm-m68k/floppy.h
--- v2.4.13/linux/include/asm-m68k/floppy.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-m68k/floppy.h Thu Oct 25 13:53:55 2001
@@ -36,8 +36,6 @@
X
X /* basically PC init + set use_virtual_dma */
X #define FDC1 m68k_floppy_init()
-static int FDC2 = -1;
-
X
X #define N_FDC 1
X #define N_DRIVE 8
@@ -89,7 +87,7 @@
X {
X if(MACH_IS_Q40)
X return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
- "floppy", NULL);
+ "floppy", floppy_hardint);
X else if(MACH_IS_SUN3X)
X return sun3xflop_request_irq();
X
@@ -98,7 +96,7 @@
X static void fd_free_irq(void)
X {
X if(MACH_IS_Q40)
- free_irq(FLOPPY_IRQ, NULL);
+ free_irq(FLOPPY_IRQ, floppy_hardint);
X }
X
X #define fd_request_dma() vdma_request_dma(FLOPPY_DMA,"floppy")
@@ -254,5 +252,4 @@


X #endif
X }
X
-

-
+#define EXTRA_FLOPPY_PARAMS
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/hardirq.h linux/include/asm-m68k/hardirq.h
--- v2.4.13/linux/include/asm-m68k/hardirq.h Fri Dec 29 14:07:23 2000
+++ linux/include/asm-m68k/hardirq.h Thu Oct 25 13:53:55 2001
@@ -6,11 +6,11 @@
X
X /* entry.S is sensitive to the offsets of these fields */
X typedef struct {
- unsigned int __softirq_active;
- unsigned int __softirq_mask;
+ unsigned int __softirq_pending;
X unsigned int __local_irq_count;
X unsigned int __local_bh_count;
X unsigned int __syscall_count;
+ struct task_struct * __ksoftirqd_task;
X } ____cacheline_aligned irq_cpustat_t;
X
X #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/io.h linux/include/asm-m68k/io.h
--- v2.4.13/linux/include/asm-m68k/io.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-m68k/io.h Thu Oct 25 13:53:55 2001
@@ -48,7 +48,7 @@
X #define Q40_ISA_MEM_B(madr) (q40_isa_mem_base+1+4*((unsigned long)(madr)))
X #define Q40_ISA_MEM_W(madr) (q40_isa_mem_base+ 4*((unsigned long)(madr)))
X
-#define MACH_HAS_ISA 1
+#define MULTI_ISA 0
X #endif /* Q40 */
X
X /* GG-II Zorro to ISA bridge */
@@ -60,11 +60,11 @@
X #define GG2_ISA_MEM_B(madr) (gg2_isa_base+1+(((unsigned long)(madr)*4) & 0xfffff))
X #define GG2_ISA_MEM_W(madr) (gg2_isa_base+ (((unsigned long)(madr)*4) & 0xfffff))
X
-#ifndef MACH_HAS_ISA
-#define MACH_HAS_ISA 1
+#ifndef MULTI_ISA
+#define MULTI_ISA 0
X #else
-#undef MACH_HAS_ISA
-#define MACH_HAS_ISA m
+#undef MULTI_ISA
+#define MULTI_ISA 1
X #endif
X #endif /* GG2 */
X
@@ -74,36 +74,40 @@
X #define AG_ISA_IO_B(ioaddr) ( GAYLE_IO+(ioaddr)+(((ioaddr)&1)*GAYLE_ODD) )
X #define AG_ISA_IO_W(ioaddr) ( GAYLE_IO+(ioaddr) )
X
-#ifndef MACH_HAS_ISA
-#define MACH_HAS_ISA 1
+#ifndef MULTI_ISA
+#define MULTI_ISA 0
X #else
-#undef MACH_HAS_ISA
-#define MACH_HAS_ISA m
+#undef MULTI_ISA
+#define MULTI_ISA 1
X #endif
X #endif /* AMIGA_PCMCIA */
X
X
X
-#ifdef MACH_HAS_ISA
+#ifdef CONFIG_ISA
+
+#if MULTI_ISA == 0
+#undef MULTI_ISA
+#endif
X
X #define Q40_ISA (1)
X #define GG2_ISA (2)
X #define AG_ISA (3)
X
-#if defined(CONFIG_Q40) && MACH_HAS_ISA==1
+#if defined(CONFIG_Q40) && !defined(MULTI_ISA)
X #define ISA_TYPE Q40_ISA
X #define ISA_SEX 0
X #endif
-#if defined(CONFIG_AMIGA_PCMCIA) && MACH_HAS_ISA==1
+#if defined(CONFIG_AMIGA_PCMCIA) && !defined(MULTI_ISA)
X #define ISA_TYPE AG_ISA
X #define ISA_SEX 1
X #endif
-#if defined(CONFIG_GG2) && MACH_HAS_ISA==1
+#if defined(CONFIG_GG2) && !defined(MULTI_ISA)
X #define ISA_TYPE GG2_ISA
X #define ISA_SEX 0
X #endif
X
-#ifdef CONFIG_ISA
+#ifdef MULTI_ISA
X extern int isa_type;
X extern int isa_sex;
X
@@ -187,8 +191,25 @@
X #define isa_writeb(val,p) out_8(isa_mtb(p),(val))
X #define isa_writew(val,p) out_le16(isa_mtw(p),(val))
X
-#define isa_inb_p(p) ({unsigned char v=isa_inb(p);isa_outb(0,0x80);v;})
-#define isa_outb_p(v,p) ({isa_outb((v),(p));isa_outb(0,0x80);})
+static inline void isa_delay(void)
+{
+ switch(ISA_TYPE)
+ {
+#ifdef CONFIG_Q40
+ case Q40_ISA: isa_outb(0,0x80); break;
+#endif
+#ifdef CONFIG_GG2
+ case GG2_ISA: break;
+#endif
+#ifdef CONFIG_AMIGA_PCMCIA
+ case AG_ISA: break;
+#endif
+ default: break; /* avoid warnings */
+ }
+}
+
+#define isa_inb_p(p) ({unsigned char v=isa_inb(p);isa_delay();v;})
+#define isa_outb_p(v,p) ({isa_outb((v),(p));isa_delay();})
X
X #define isa_insb(port, buf, nr) raw_insb(isa_itb(port), (buf), (nr))
X #define isa_outsb(port, buf, nr) raw_outsb(isa_itb(port), (buf), (nr))
@@ -200,7 +221,7 @@
X #define isa_outsw(port, buf, nr) \
X (ISA_SEX ? raw_outsw(isa_itw(port), (buf), (nr)) : \
X raw_outsw_swapw(isa_itw(port), (buf), (nr)))
-#endif /* MACH_HAS_ISA */
+#endif /* CONFIG_ISA */
X
X
X #if defined(CONFIG_ISA) && !defined(CONFIG_PCI)
@@ -216,22 +237,24 @@
X #define insw isa_insw
X #define outsb isa_outsb
X #define outsw isa_outsw
-#endif /* MACH_HAS_ISA */
-
+#define readb isa_readb
+#define readw isa_readw
+#define writeb isa_writeb
+#define writew isa_writeb
+#endif /* CONFIG_ISA */
X
X #if defined(CONFIG_PCI)
X
-#define inl(port) in_le32(port)
-#define outl(val,port) out_le32((port),(val))
-
-#define readb(addr) in_8(addr)
-#define readw(addr) in_le16(addr)
-#define readl(addr) in_le32(addr)
-
+#define inl(port) in_le32(port)
+#define outl(val,port) out_le32((port),(val))
+#define readl(addr) in_le32(addr)
+#define writel(val,addr) out_le32((addr),(val))
+
+/* those can be defined for both ISA and PCI - it wont work though */
+#define readb(addr) in_8(addr)
+#define readw(addr) in_le16(addr)
X #define writeb(val,addr) out_8((addr),(val))
X #define writew(val,addr) out_le16((addr),(val))
-#define writel(val,addr) out_le32((addr),(val))
-
X
X #ifndef CONFIG_ISA
X #define inb(port) in_8(port)
@@ -243,7 +266,8 @@
X /*
X * kernel with both ISA and PCI compiled in, those have
X * conflicting defs for in/out. Simply consider port < 1024
- * ISA and everything else PCI
+ * ISA and everything else PCI. read,write not defined
+ * in this case
X */
X #define inb(port) ((port)<1024 ? isa_inb(port) : in_8(port))
X #define inb_p(port) ((port)<1024 ? isa_inb_p(port) : in_8(port))
@@ -287,13 +311,12 @@
X return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
X }
X
-extern void iounmap(void *addr);
X
-/* Nothing to do */
+/* m68k caches aren't DMA coherent */
+extern void dma_cache_wback_inv(unsigned long start, unsigned long size);
+extern void dma_cache_wback(unsigned long start, unsigned long size);
+extern void dma_cache_inv(unsigned long start, unsigned long size);
X
-#define dma_cache_inv(_start,_size) do { } while (0)
-#define dma_cache_wback(_start,_size) do { } while (0)
-#define dma_cache_wback_inv(_start,_size) do { } while (0)
X
X #ifndef CONFIG_SUN3
X #define IO_SPACE_LIMIT 0xffff
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/mc146818rtc.h linux/include/asm-m68k/mc146818rtc.h
--- v2.4.13/linux/include/asm-m68k/mc146818rtc.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-m68k/mc146818rtc.h Thu Oct 25 13:53:55 2001
@@ -5,6 +5,7 @@
X #define _ASM_MC146818RTC_H
X
X #include <linux/config.h>
+#include <asm/atarihw.h>
X
X #ifdef CONFIG_ATARI
X /* RTC in Atari machines */
@@ -36,12 +37,12 @@
X #define RTC_MINYEAR epoch
X
X #define CMOS_READ(addr) ({ \
-outb_p((addr),RTC_PORT(0)); \
-inb_p(RTC_PORT(1)); \
+atari_outb_p((addr),RTC_PORT(0)); \
+atari_inb_p(RTC_PORT(1)); \
X })
X #define CMOS_WRITE(val, addr) ({ \
-outb_p((addr),RTC_PORT(0)); \
-outb_p((val),RTC_PORT(1)); \
+atari_outb_p((addr),RTC_PORT(0)); \
+atari_outb_p((val),RTC_PORT(1)); \
X })
X #endif /* CONFIG_ATARI */
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/pgalloc.h linux/include/asm-m68k/pgalloc.h
--- v2.4.13/linux/include/asm-m68k/pgalloc.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-m68k/pgalloc.h Thu Oct 25 13:53:55 2001
@@ -126,6 +126,7 @@
X }
X
X #define flush_dcache_page(page) do { } while (0)
+#define flush_icache_page(vma,pg) do { } while (0)
X
X /* Push n pages at kernel virtual address and clear the icache */
X /* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
@@ -153,7 +154,7 @@
X }
X }
X
-#define flush_icache_page(vma,pg) do { } while (0)
+
X
X
X #ifdef CONFIG_SUN3
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/pgtable.h linux/include/asm-m68k/pgtable.h
--- v2.4.13/linux/include/asm-m68k/pgtable.h Mon Nov 27 18:00:49 2000
+++ linux/include/asm-m68k/pgtable.h Thu Oct 25 13:53:55 2001
@@ -160,7 +160,7 @@
X #define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
X #define swp_entry_to_pte(x) ((pte_t) { (x).val })
X
-#endif CONFIG_SUN3
+#endif /* CONFIG_SUN3 */
X
X #endif /* !__ASSEMBLY__ */
X
@@ -181,5 +181,10 @@
X #ifndef __ASSEMBLY__
X #include <asm-generic/pgtable.h>
X #endif /* !__ASSEMBLY__ */
+
+/*
+ * No page table caches to initialise
+ */
+#define pgtable_cache_init() do { } while (0)
X
X #endif /* _M68K_PGTABLE_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/raw_io.h linux/include/asm-m68k/raw_io.h
--- v2.4.13/linux/include/asm-m68k/raw_io.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-m68k/raw_io.h Thu Oct 25 13:53:55 2001


@@ -1,5 +1,5 @@
X /*

- * linux/include/asm-m68k/io_native.h
+ * linux/include/asm-m68k/raw_io.h
X *
X * 10/20/00 RZ: - created from bits of io.h and ide.h to cleanup namespace
X *
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/semaphore.h linux/include/asm-m68k/semaphore.h
--- v2.4.13/linux/include/asm-m68k/semaphore.h Tue Apr 17 17:19:31 2001
+++ linux/include/asm-m68k/semaphore.h Thu Oct 25 13:53:55 2001
@@ -126,7 +126,7 @@
X ".previous"
X : "=d" (result)
X : "a" (sem1)
- : "%d0", "memory");
+ : "memory");
X return result;
X }


X
@@ -152,7 +152,7 @@

X ".previous"
X : "=d" (result)
X : "a" (sem1)
- : "%d0", "memory");
+ : "memory");
X return result;
X }
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/serial.h linux/include/asm-m68k/serial.h
--- v2.4.13/linux/include/asm-m68k/serial.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-m68k/serial.h Thu Oct 25 13:53:55 2001
@@ -2,7 +2,7 @@
X * include/asm-m68k/serial.h
X *
X * currently this seems useful only for a Q40,
- * its an almost exact copy of ../asm/alpha/serial.h
+ * its an almost exact copy of ../asm-alpha/serial.h

X *
X */
X

diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/softirq.h linux/include/asm-m68k/softirq.h
--- v2.4.13/linux/include/asm-m68k/softirq.h Mon Nov 27 18:00:49 2000
+++ linux/include/asm-m68k/softirq.h Thu Oct 25 13:53:55 2001
@@ -12,6 +12,7 @@
X
X #define local_bh_disable() cpu_bh_disable(smp_processor_id())
X #define local_bh_enable() cpu_bh_enable(smp_processor_id())
+#define __local_bh_enable() local_bh_enable()
X
X #define in_softirq() (local_bh_count(smp_processor_id()) != 0)
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/stat.h linux/include/asm-m68k/stat.h
--- v2.4.13/linux/include/asm-m68k/stat.h Mon Nov 27 18:00:49 2000
+++ linux/include/asm-m68k/stat.h Thu Oct 25 13:53:55 2001
@@ -44,7 +44,7 @@
X struct stat64 {
X unsigned char __pad0[6];
X unsigned short st_dev;
- unsigned char __pad1[4];
+ unsigned char __pad1[2];
X
X #define STAT64_HAS_BROKEN_ST_INO 1
X unsigned long __st_ino;
@@ -57,7 +57,7 @@
X
X unsigned char __pad2[6];
X unsigned short st_rdev;
- unsigned char __pad3[4];
+ unsigned char __pad3[2];
X
X long long st_size;
X unsigned long st_blksize;
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/string.h linux/include/asm-m68k/string.h
--- v2.4.13/linux/include/asm-m68k/string.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-m68k/string.h Thu Oct 25 13:53:55 2001
@@ -375,6 +375,7 @@
X __memset_g((s),(c),(count)))
X
X #define __HAVE_ARCH_MEMCPY
+extern void * memcpy(void *, const void *, size_t );
X /*
X * __builtin_memcpy() does not handle page-sized memcpys very well,
X * thus following the same assumptions as for page-sized memsets, this


@@ -545,6 +546,7 @@
X }

X
X #define __HAVE_ARCH_MEMCMP
+extern int memcmp(const void * ,const void * ,size_t );
X #define memcmp(cs, ct, n) \
X (__builtin_constant_p(n) ? \
X __builtin_memcmp((cs),(ct),(n)) : \
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/sun3xflop.h linux/include/asm-m68k/sun3xflop.h
--- v2.4.13/linux/include/asm-m68k/sun3xflop.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-m68k/sun3xflop.h Thu Oct 25 13:53:55 2001
@@ -143,10 +143,10 @@
X
X for(lcount=virtual_dma_count, lptr=virtual_dma_addr;
X lcount; lcount--, lptr++) {
-// st=fd_inb(virtual_dma_port+4) & 0x80 ;
+/* st=fd_inb(virtual_dma_port+4) & 0x80 ; */
X st = *(sun3x_fdc.status_r);
-// if(st != 0xa0)
-// break;
+/* if(st != 0xa0) */
+/* break; */
X
X if((st & 0x80) == 0) {
X virtual_dma_count = lcount;
@@ -158,16 +158,16 @@
X break;
X
X if(virtual_dma_mode)
-// fd_outb(*lptr, virtual_dma_port+5);
+/* fd_outb(*lptr, virtual_dma_port+5); */
X *(sun3x_fdc.data_r) = *lptr;
X else
-// *lptr = fd_inb(virtual_dma_port+5);
+/* *lptr = fd_inb(virtual_dma_port+5); */
X *lptr = *(sun3x_fdc.data_r);
X }
X
X virtual_dma_count = lcount;
X virtual_dma_addr = lptr;
-// st = fd_inb(virtual_dma_port+4);
+/* st = fd_inb(virtual_dma_port+4); */
X st = *(sun3x_fdc.status_r);
X }
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/system.h linux/include/asm-m68k/system.h
--- v2.4.13/linux/include/asm-m68k/system.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-m68k/system.h Thu Oct 25 13:53:55 2001
@@ -42,7 +42,7 @@
X register void *_last __asm__ ("d1"); \
X __asm__ __volatile__("jbsr " SYMBOL_NAME_STR(resume) \
X : "=d" (_last) : "a" (_prev), "a" (_next) \
- : "d0", "d1", "d2", "d3", "d4", "d5", "a0", "a1"); \
+ : "d0", /* "d1", */ "d2", "d3", "d4", "d5", "a0", "a1"); \
X (last) = _last; \
X }
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/uaccess.h linux/include/asm-m68k/uaccess.h
--- v2.4.13/linux/include/asm-m68k/uaccess.h Tue Aug 29 14:09:15 2000
+++ linux/include/asm-m68k/uaccess.h Thu Oct 25 13:53:55 2001
@@ -59,6 +59,9 @@
X case 4: \
X __put_user_asm(__pu_err, __pu_val, ptr, l); \
X break; \
+ case 8: \
+ __pu_err = __constant_copy_to_user(ptr, &__pu_val, 8); \
+ break; \
X default: \
X __pu_err = __put_user_bad(); \
X break; \
@@ -105,6 +108,9 @@
X case 4: \
X __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \
X break; \
+ case 8: \
+ __gu_err = __constant_copy_from_user(&__gu_val, ptr, 8); \
+ break; \
X default: \
X __gu_val = 0; \
X __gu_err = __get_user_bad(); \
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/unistd.h linux/include/asm-m68k/unistd.h
--- v2.4.13/linux/include/asm-m68k/unistd.h Mon Nov 27 17:11:26 2000
+++ linux/include/asm-m68k/unistd.h Thu Oct 25 13:53:55 2001


@@ -243,9 +243,7 @@
X { \

X register long __res __asm__ ("%d0") = __NR_##name; \
X __asm__ __volatile__ ("trap #0" \
- : "=g" (__res) \
- : "0" (__res) \
- : "%d0"); \
+ : "+d" (__res) ); \
X __syscall_return(type,__res); \
X }
X
@@ -255,9 +253,8 @@
X register long __res __asm__ ("%d0") = __NR_##name; \
X register long __a __asm__ ("%d1") = (long)(a); \
X __asm__ __volatile__ ("trap #0" \
- : "=d" (__res) \
- : "0" (__res), "d" (__a) \
- : "%d0"); \
+ : "+d" (__res) \
+ : "d" (__a) ); \
X __syscall_return(type,__res); \
X }
X
@@ -268,9 +265,9 @@
X register long __a __asm__ ("%d1") = (long)(a); \
X register long __b __asm__ ("%d2") = (long)(b); \
X __asm__ __volatile__ ("trap #0" \
- : "=d" (__res) \
- : "0" (__res), "d" (__a), "d" (__b) \
- : "%d0"); \
+ : "+d" (__res) \
+ : "d" (__a), "d" (__b) \
+ ); \
X __syscall_return(type,__res); \
X }
X
@@ -282,10 +279,10 @@
X register long __b __asm__ ("%d2") = (long)(b); \
X register long __c __asm__ ("%d3") = (long)(c); \
X __asm__ __volatile__ ("trap #0" \
- : "=d" (__res) \
- : "0" (__res), "d" (__a), "d" (__b), \
+ : "+d" (__res) \
+ : "d" (__a), "d" (__b), \
X "d" (__c) \
- : "%d0"); \
+ ); \
X __syscall_return(type,__res); \
X }
X
@@ -298,10 +295,10 @@
X register long __c __asm__ ("%d3") = (long)(c); \
X register long __d __asm__ ("%d4") = (long)(d); \
X __asm__ __volatile__ ("trap #0" \
- : "=d" (__res) \
- : "0" (__res), "d" (__a), "d" (__b), \
+ : "+d" (__res) \
+ : "d" (__a), "d" (__b), \
X "d" (__c), "d" (__d) \
- : "%d0"); \
+ ); \
X __syscall_return(type,__res); \
X }
X
@@ -315,10 +312,10 @@
X register long __d __asm__ ("%d4") = (long)(d); \
X register long __e __asm__ ("%d5") = (long)(e); \
X __asm__ __volatile__ ("trap #0" \
- : "=d" (__res) \
- : "0" (__res), "d" (__a), "d" (__b), \
+ : "+d" (__res) \
+ : "d" (__a), "d" (__b), \
X "d" (__c), "d" (__d), "d" (__e) \
- : "%d0"); \
+ ); \
X __syscall_return(type,__res); \
X }
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-m68k/zorro.h linux/include/asm-m68k/zorro.h
--- v2.4.13/linux/include/asm-m68k/zorro.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-m68k/zorro.h Thu Oct 25 13:53:55 2001
@@ -1,5 +1,5 @@
-#ifndef _ASM_ZORRO_H
-#define _ASM_ZORRO_H
+#ifndef _ASM_M68K_ZORRO_H
+#define _ASM_M68K_ZORRO_H
X #include <asm/raw_io.h>
X
X #define z_readb raw_inb
@@ -14,5 +14,47 @@
X #define z_memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
X #define z_memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
X
+
+/* Values for nocacheflag and cmode */
+#ifndef IOMAP_FULL_CACHING
+#define IOMAP_FULL_CACHING 0
+#define IOMAP_NOCACHE_SER 1
+#define IOMAP_NOCACHE_NONSER 2
+#define IOMAP_WRITETHROUGH 3
+#endif
+
+extern void iounmap(void *addr);
+
+extern void *__ioremap(unsigned long physaddr, unsigned long size,
+ int cacheflag);
+extern void __iounmap(void *addr, unsigned long size);
+
+
+extern inline void *z_remap_nocache_ser(unsigned long physaddr,
+ unsigned long size)
+{
+ return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
+}
+
+extern inline void *z_remap_nocache_nonser(unsigned long physaddr,
+ unsigned long size)
+{
+ return __ioremap(physaddr, size, IOMAP_NOCACHE_NONSER);
+}
+
+extern inline void *z_remap_writethrough(unsigned long physaddr,
+ unsigned long size)
+{
+ return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
+}
+extern inline void *z_remap_fullcache(unsigned long physaddr,
+ unsigned long size)
+{
+ return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
+}
+
+#define z_unmap iounmap
+#define z_iounmap iounmap
+#define z_ioremap z_remap_nocache_ser
X
X #endif /* _ASM_ZORRO_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-mips/floppy.h linux/include/asm-mips/floppy.h
--- v2.4.13/linux/include/asm-mips/floppy.h Sun Jul 9 22:18:15 2000
+++ linux/include/asm-mips/floppy.h Thu Oct 25 13:53:55 2001
@@ -79,14 +79,6 @@
X
X #define FDC1 fd_ops->fd_getfdaddr1();
X
-/*
- * Hack: The floppy drivrer defines this, before including fdreg.h. We use
- * to define FDC2 only one and keep it a static variable in floppy.c.
- */
-#ifdef FDPATCHES
-static int FDC2 = -1;
-#endif
-
X #define N_FDC 1 /* do you *really* want a second controller? */
X #define N_DRIVE 8
X
@@ -106,5 +98,7 @@
X * hardware available with MIPS CPUs ...
X */
X #define CROSS_64KB(a,s) ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64)
+
+#define EXTRA_FLOPPY_PARAMS
X
X #endif /* _ASM_FLOPPY_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-mips64/floppy.h linux/include/asm-mips64/floppy.h
--- v2.4.13/linux/include/asm-mips64/floppy.h Sun Jul 9 22:18:15 2000
+++ linux/include/asm-mips64/floppy.h Thu Oct 25 13:53:55 2001
@@ -77,14 +77,6 @@
X
X #define FDC1 fd_ops->fd_getfdaddr1();
X
-/*
- * Hack: The floppy drivrer defines this, before including fdreg.h. We use
- * to define FDC2 only one and keep it a static variable in floppy.c.
- */
-#ifdef FDPATCHES
-static int FDC2=-1;
-#endif
-
X #define N_FDC 1 /* do you *really* want a second controller? */
X #define N_DRIVE 8
X
@@ -104,5 +96,7 @@
X * hardware available with MIPS CPUs ...
X */
X #define CROSS_64KB(a,s) ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64)
+
+#define EXTRA_FLOPPY_PARAMS
X
X #endif /* _ASM_FLOPPY_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/atomic.h linux/include/asm-ppc/atomic.h
--- v2.4.13/linux/include/asm-ppc/atomic.h Sun Sep 23 11:41:01 2001
+++ linux/include/asm-ppc/atomic.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.atomic.h 1.13 08/21/01 16:07:48 trini
+ * BK Id: SCCS/s.atomic.h 1.15 10/28/01 10:37:22 trini
X */
X /*
X * PowerPC atomic operations
@@ -7,9 +7,10 @@
X
X #ifndef _ASM_PPC_ATOMIC_H_
X #define _ASM_PPC_ATOMIC_H_
-#ifdef __KERNEL__
X
X typedef struct { volatile int counter; } atomic_t;
+
+#ifdef __KERNEL__
X
X #define ATOMIC_INIT(i) { (i) }
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/byteorder.h linux/include/asm-ppc/byteorder.h
--- v2.4.13/linux/include/asm-ppc/byteorder.h Mon May 21 15:02:06 2001
+++ linux/include/asm-ppc/byteorder.h Fri Nov 2 17:43:54 2001
@@ -1,13 +1,13 @@
X /*
- * BK Id: SCCS/s.byteorder.h 1.5 05/17/01 18:14:24 cort
+ * BK Id: SCCS/s.byteorder.h 1.8 10/11/01 13:02:49 trini
X */
X #ifndef _PPC_BYTEORDER_H
X #define _PPC_BYTEORDER_H
X
X #include <asm/types.h>
X
-#ifdef __KERNEL__
X #ifdef __GNUC__
+#ifdef __KERNEL__
X
X extern __inline__ unsigned ld_le16(const volatile unsigned short *addr)
X {
@@ -72,12 +72,14 @@
X #define __arch__swab16s(addr) st_le16(addr,*addr)
X #define __arch__swab32s(addr) st_le32(addr,*addr)
X
-#ifndef __STRICT_ANSI__
-#define __BYTEORDER_HAS_U64__
+#endif /* __KERNEL__ */
+
+#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+# define __BYTEORDER_HAS_U64__
+# define __SWAB_64_THRU_32__
X #endif
X
X #endif /* __GNUC__ */
-#endif /* __KERNEL__ */
X
X #include <linux/byteorder/big_endian.h>
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/cache.h linux/include/asm-ppc/cache.h
--- v2.4.13/linux/include/asm-ppc/cache.h Mon May 21 15:02:06 2001
+++ linux/include/asm-ppc/cache.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.cache.h 1.5 05/17/01 18:14:24 cort
+ * BK Id: SCCS/s.cache.h 1.10 10/18/01 15:02:09 trini
X */
X /*
X * include/asm-ppc/cache.h
@@ -12,20 +12,25 @@
X #include <asm/processor.h>
X
X /* bytes per L1 cache line */
-#if !defined(CONFIG_8xx) || defined(CONFIG_8260)
-#if defined(CONFIG_PPC64BRIDGE)
-#define L1_CACHE_BYTES 128
+#if defined(CONFIG_8xx) || defined(CONFIG_403GCX)
+#define L1_CACHE_LINE_SIZE 16
+#define LG_L1_CACHE_LINE_SIZE 4
+#define MAX_L1_COPY_PREFETCH 1
+#elif defined(CONFIG_PPC64BRIDGE)
+#define L1_CACHE_LINE_SIZE 128
+#define LG_L1_CACHE_LINE_SIZE 7
+#define MAX_L1_COPY_PREFETCH 1
X #else
-#define L1_CACHE_BYTES 32
-#endif /* PPC64 */
-#else
-#define L1_CACHE_BYTES 16
-#endif /* !8xx || 8260 */
+#define L1_CACHE_LINE_SIZE 32
+#define LG_L1_CACHE_LINE_SIZE 5
+#define MAX_L1_COPY_PREFETCH 4
+#endif
+
+#define L1_CACHE_BYTES L1_CACHE_LINE_SIZE
+#define SMP_CACHE_BYTES L1_CACHE_BYTES
X
X #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
X #define L1_CACHE_PAGES 8
-
-#define SMP_CACHE_BYTES L1_CACHE_BYTES
X
X #ifdef MODULE
X #define __cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES)))
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/fads.h linux/include/asm-ppc/fads.h
--- v2.4.13/linux/include/asm-ppc/fads.h Sun Sep 23 11:41:01 2001
+++ linux/include/asm-ppc/fads.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.fads.h 1.11 08/17/01 15:23:17 paulus
+ * BK Id: SCCS/s.fads.h 1.14 10/26/01 10:14:09 trini


X */
X
X /*

@@ -8,41 +8,33 @@
X *
X * Copyright (c) 1998 Dan Malek (dma...@jlc.net)
X */
-#ifndef __MACH_FADS_DEFS
-#define __MACH_FADS_DEFS
+#ifdef __KERNEL__
+#ifndef __ASM_FADS_H__
+#define __ASM_FADS_H__
X
-#ifndef __ASSEMBLY__
-/* A Board Information structure that is given to a program when
- * prom starts it up.
- */
-typedef struct bd_info {
- unsigned int bi_memstart; /* Memory start address */
- unsigned int bi_memsize; /* Memory (end) size in bytes */
- unsigned int bi_intfreq; /* Internal Freq, in Hz */
- unsigned int bi_busfreq; /* Bus Freq, in Hz */
- unsigned char bi_enetaddr[6];
- unsigned int bi_baudrate;
-} bd_t;
+#include <linux/config.h>
X
-extern bd_t m8xx_board_info;
+#include <asm/ppcboot.h>
X
X /* Memory map is configured by the PROM startup.
X * I tried to follow the FADS manual, although the startup PROM
X * dictates this and we simply have to move some of the physical
X * addresses for Linux.
X */
-#define BCSR_ADDR ((uint)0xfe000000)
+#define BCSR_ADDR ((uint)0xff010000)
X #define BCSR_SIZE ((uint)(64 * 1024))
-#define BCSR0 ((uint)0xfe000000)
-#define BCSR1 ((uint)0xfe000004)
-#define BCSR2 ((uint)0xfe000008)
-#define BCSR3 ((uint)0xfe00000c)
-#define BCSR4 ((uint)0xfe000010)
-#define IMAP_ADDR ((uint)0xf0000000)
+#define BCSR0 ((uint)0xff010000)
+#define BCSR1 ((uint)0xff010004)
+#define BCSR2 ((uint)0xff010008)
+#define BCSR3 ((uint)0xff01000c)
+#define BCSR4 ((uint)0xff010010)
+
+#define IMAP_ADDR ((uint)0xff000000)
X #define IMAP_SIZE ((uint)(64 * 1024))
-#define PCMCIA_MEM_ADDR ((uint)0x04000000)
+
+#define PCMCIA_MEM_ADDR ((uint)0xff020000)
X #define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
-
+
X /* Bits of interest in the BCSRs.
X */
X #define BCSR1_ETHEN ((uint)0x20000000)
@@ -55,8 +47,7 @@
X #define BCSR4_FETHCFG1 ((uint)0x00400000) /* PHY autoneg mode */
X #define BCSR4_FETHFDE ((uint)0x02000000) /* PHY FDX advertise */
X #define BCSR4_FETHRST ((uint)0x00200000) /* PHY Reset */
-#endif /* !__ASSEMBLY__ */
-
+
X /* Interrupt level assignments.
X */
X #define FEC_INTERRUPT SIU_LEVEL1 /* FEC interrupt */
@@ -65,5 +56,6 @@
X /* We don't use the 8259.
X */
X #define NR_8259_INTS 0
-
-#endif
+
+#endif /* __ASM_FADS_H__ */
+#endif /* __KERNEL__ */
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/fcntl.h linux/include/asm-ppc/fcntl.h
--- v2.4.13/linux/include/asm-ppc/fcntl.h Mon May 21 15:02:06 2001
+++ linux/include/asm-ppc/fcntl.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.fcntl.h 1.5 05/17/01 18:14:24 cort
+ * BK Id: SCCS/s.fcntl.h 1.8 09/19/01 23:06:01 paulus
X */
X #ifndef _PPC_FCNTL_H
X #define _PPC_FCNTL_H
@@ -22,7 +22,7 @@
X #define O_DIRECTORY 040000 /* must be a directory */
X #define O_NOFOLLOW 0100000 /* don't follow links */
X #define O_LARGEFILE 0200000
-#define O_DIRECT 0400000 /* direct disk access hint - currently ignored */
+#define O_DIRECT 0400000 /* direct disk access hint */
X
X #define F_DUPFD 0 /* dup */
X #define F_GETFD 1 /* get close_on_exec */
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/floppy.h linux/include/asm-ppc/floppy.h
--- v2.4.13/linux/include/asm-ppc/floppy.h Mon May 21 15:02:06 2001
+++ linux/include/asm-ppc/floppy.h Thu Oct 25 13:53:55 2001
@@ -58,4 +58,7 @@
X #define CROSS_64KB(a,s) (0)
X
X #endif /* __ASM_PPC_FLOPPY_H */
+
+#define EXTRA_FLOPPY_PARAMS
+
X #endif /* __KERNEL__ */
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/io.h linux/include/asm-ppc/io.h
--- v2.4.13/linux/include/asm-ppc/io.h Sun Sep 23 11:41:01 2001
+++ linux/include/asm-ppc/io.h Fri Nov 2 17:43:54 2001
@@ -1,11 +1,12 @@
X /*
- * BK Id: SCCS/s.io.h 1.11 08/28/01 15:48:26 paulus
+ * BK Id: SCCS/s.io.h 1.14 10/16/01 15:58:42 trini
X */
X #ifdef __KERNEL__
X #ifndef _PPC_IO_H
X #define _PPC_IO_H
X
X #include <linux/config.h>
+#include <linux/types.h>
X #include <asm/page.h>
X #include <asm/byteorder.h>
X
@@ -29,20 +30,18 @@
X #include <asm/mpc8xx.h>
X #elif defined(CONFIG_8260)
X #include <asm/mpc8260.h>
-#else /* 4xx/8xx/8260 */
-#ifdef CONFIG_APUS
+#elif defined(CONFIG_APUS)
X #define _IO_BASE 0
X #define _ISA_MEM_BASE 0
X #define PCI_DRAM_OFFSET 0
-#else /* CONFIG_APUS */
+#else /* Everyone else */
X extern unsigned long isa_io_base;
X extern unsigned long isa_mem_base;
X extern unsigned long pci_dram_offset;
X #define _IO_BASE isa_io_base
X #define _ISA_MEM_BASE isa_mem_base
X #define PCI_DRAM_OFFSET pci_dram_offset
-#endif /* CONFIG_APUS */
-#endif
+#endif /* Platform-dependant I/O */
X
X #define readb(addr) in_8((volatile u8 *)(addr))
X #define writeb(b,addr) out_8((volatile u8 *)(addr), (b))
@@ -89,16 +88,20 @@
X { \
X unsigned int x; \
X __asm__ __volatile__( \
- op " %0,0,%1\n" \
- "1: sync\n" \
- "2:\n" \
+ op " %0,0,%1\n" \
+ "1: twi 0,%0,0\n" \
+ "2: isync\n" \
+ "3: nop\n" \
+ "4:\n" \
X ".section .fixup,\"ax\"\n" \
- "3: li %0,-1\n" \
- " b 2b\n" \
+ "5: li %0,-1\n" \
+ " b 4b\n" \
X ".previous\n" \
X ".section __ex_table,\"a\"\n" \
X " .align 2\n" \
- " .long 1b,3b\n" \
+ " .long 1b,5b\n" \
+ " .long 2b,5b\n" \
+ " .long 3b,5b\n" \
X ".previous" \
X : "=&r" (x) \
X : "r" (port + _IO_BASE)); \
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/ivms8.h linux/include/asm-ppc/ivms8.h
--- v2.4.13/linux/include/asm-ppc/ivms8.h Sun Sep 23 11:41:01 2001
+++ linux/include/asm-ppc/ivms8.h Fri Nov 2 17:43:54 2001
@@ -1,77 +1,46 @@
X /*
- * BK Id: SCCS/s.ivms8.h 1.6 08/17/01 15:23:17 paulus
+ * BK Id: SCCS/s.ivms8.h 1.8 10/26/01 10:14:09 trini
X */
X /*
- * A collection of structures, addresses, and values associated with
- * Speech Design Integrated Voicemail Systems (IVMS8) boards.
+ * Speech Design Integrated Voicemail board specific definitions
+ * - IVMS8 (small, 8 channels)
+ * - IVML24 (large, 24 channels)
X *
- * Copyright (c) 2000 Wolfgang Denk (w...@denx.de)
+ * In 2.5 when we force a new bootloader, we can merge these two, and add
+ * in _MACH_'s for them. -- Tom
+ *
+ * Copyright (c) 2000, 2001 Wolfgang Denk (w...@denx.de)
X */
-#ifndef __MACH_IVMS8_DEFS
-#define __MACH_IVMS8_DEFS
-
-#ifndef __ASSEMBLY__
-
-typedef void (interrupt_handler_t)(void *);
X
-typedef struct serial_io {
- int (*getc)(void);
- int (*tstc)(void);
- void (*putc)(const char c);
- void (*printf)(const char *fmt, ...);
-} serial_io_t;
+#ifdef __KERNEL__
+#ifndef __ASM_IVMS8_H__
+#define __ASM_IVMS8_H__
X
-typedef struct intr_util {
- void (*install_hdlr)(int, interrupt_handler_t *, void *);
- void (*free_hdlr)(int);
-} intr_util_t;
-
-
-/* A Board Information structure that is given to a program when
- * ppcboot starts it up.
- */
-typedef struct bd_info {
- unsigned long bi_memstart; /* start of DRAM memory */
- unsigned long bi_memsize; /* size of DRAM memory in bytes */
- unsigned long bi_flashstart; /* start of FLASH memory */
- unsigned long bi_flashsize; /* size of FLASH memory */
- 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 */
- unsigned long bi_immr_base; /* base of IMMR register */
- unsigned long bi_bootflags; /* boot / reboot flag (for LynxOS) */
- unsigned long bi_ip_addr; /* IP Address */
- unsigned char bi_enetaddr[6]; /* Ethernet adress */
- unsigned char bi_reserved[2]; /* -- just for alignment -- */
- unsigned long bi_intfreq; /* Internal Freq, in MHz */
- unsigned long bi_busfreq; /* Bus Freq, in MHz */
- unsigned long bi_baudrate; /* Console Baudrate */
- serial_io_t bi_serial_io; /* Addr of monitor fnc for Console I/O */
- intr_util_t bi_interrupt; /* Addr of monitor fnc for Interrupts */
-} bd_t;
+#include <linux/config.h>
X
-#endif /* __ASSEMBLY__ */
+#include <asm/ppcboot.h>
X
-#define IVMS_IMMR_BASE 0xFFF00000 /* phys. addr of IMMR */
-#define IVMS_IMAP_SIZE (64 * 1024) /* size of mapped area */
+#define IVMS_IMMR_BASE 0xFFF00000 /* phys. addr of IMMR */
+#define IVMS_IMAP_SIZE (64 * 1024) /* size of mapped area */
X
-#define IMAP_ADDR IVMS_IMMR_BASE /* physical base address of IMMR area */
-#define IMAP_SIZE IVMS_IMAP_SIZE /* mapped size of IMMR area */
+#define IMAP_ADDR IVMS_IMMR_BASE /* phys. base address of IMMR area */
+#define IMAP_SIZE IVMS_IMAP_SIZE /* mapped size of IMMR area */
X
X #define PCMCIA_MEM_ADDR ((uint)0xFE100000)
X #define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
X
-#define FEC_INTERRUPT 9 /* = SIU_LEVEL4 */
-#define IDE0_INTERRUPT 10 /* = IRQ5 */
-#define CPM_INTERRUPT 11 /* = SIU_LEVEL5 (was: SIU_LEVEL2) */
-#define PHY_INTERRUPT 12 /* = IRQ6 */
+#define FEC_INTERRUPT 9 /* = SIU_LEVEL4 */
+#define IDE0_INTERRUPT 10 /* = IRQ5 */
+#define CPM_INTERRUPT 11 /* = SIU_LEVEL5 (was: SIU_LEVEL2) */
+#define PHY_INTERRUPT 12 /* = IRQ6 */
X
-#define MAX_HWIFS 1 /* overwrite default in include/asm-ppc/ide.h */
+/* override the default number of IDE hardware interfaces */
+#define MAX_HWIFS 1
X
X /*
X * Definitions for IDE0 Interface
X */
-#define IDE0_BASE_OFFSET 0x0000 /* Offset in PCMCIA memory */
+#define IDE0_BASE_OFFSET 0x0000 /* Offset in PCMCIA memory */
X #define IDE0_DATA_REG_OFFSET 0x0000
X #define IDE0_ERROR_REG_OFFSET 0x0081
X #define IDE0_NSECTOR_REG_OFFSET 0x0082
@@ -81,10 +50,10 @@
X #define IDE0_SELECT_REG_OFFSET 0x0086
X #define IDE0_STATUS_REG_OFFSET 0x0087
X #define IDE0_CONTROL_REG_OFFSET 0x0106
-#define IDE0_IRQ_REG_OFFSET 0x000A /* not used */
+#define IDE0_IRQ_REG_OFFSET 0x000A /* not used */
X
-/* We don't use the 8259.
-*/
+/* We don't use the 8259. */
X #define NR_8259_INTS 0
X
-#endif /* __MACH_IVMS8_DEFS */
+#endif /* __ASM_IVMS8_H__ */
+#endif /* __KERNEL__ */
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/m48t35.h linux/include/asm-ppc/m48t35.h
--- v2.4.13/linux/include/asm-ppc/m48t35.h Mon May 21 15:02:06 2001
+++ linux/include/asm-ppc/m48t35.h Fri Nov 2 17:43:54 2001
@@ -1,27 +1,83 @@
X /*
- * BK Id: SCCS/s.m48t35.h 1.5 05/17/01 18:14:25 cort
+ * BK Id: SCCS/s.m48t35.h 1.8 10/16/01 15:58:42 trini
X */
X /*
X * Registers for the SGS-Thomson M48T35 Timekeeper RAM chip
+ * and
+ * Registers for the SGS-Thomson M48T37 Timekeeper RAM chip
+ * The 37 is the 35 plus alarm and century thus the offsets
+ * are shifted by the extra registers.
X */
X
X #ifndef __PPC_M48T35_H
X #define __PPC_M48T35_H
X
X /* RTC offsets */
-#define M48T35_RTC_CONTROL 0
-#define M48T35_RTC_SECONDS 1
-#define M48T35_RTC_MINUTES 2
-#define M48T35_RTC_HOURS 3
-#define M48T35_RTC_DAY 4
-#define M48T35_RTC_DOM 5
-#define M48T35_RTC_MONTH 6
-#define M48T35_RTC_YEAR 7
+#define M48T35_RTC_FLAGS (-8) /* the negative regs are really T37 only */
+#define M48T35_RTC_CENTURY (-7)
+#define M48T35_RTC_AL_SEC (-6)
+#define M48T35_RTC_AL_MIN (-5)
+#define M48T35_RTC_AL_HRS (-4)
+#define M48T35_RTC_AL_DOM (-3)
+#define M48T35_RTC_INTERRUPT (-2)
+#define M48T35_RTC_WATCHDOG (-1)
+#define M48T35_RTC_CONTROL 0 /* T35 starts here */
+#define M48T35_RTC_SECONDS 1
+#define M48T35_RTC_MINUTES 2
+#define M48T35_RTC_HOURS 3
+#define M48T35_RTC_DAY 4
+#define M48T35_RTC_DOM 5
+#define M48T35_RTC_MONTH 6
+#define M48T35_RTC_YEAR 7
X
+/* this way help us know which bits go with which regs */
+#define M48T35_RTC_FLAGS_BL 0x10
+#define M48T35_RTC_FLAGS_AF 0x40
+#define M48T35_RTC_FLAGS_WDF 0x80
+
+#define M48T35_RTC_INTERRUPT_AFE 0x80
+#define M48T35_RTC_INTERRUPT_ABE 0x20
+#define M48T35_RTC_INTERRUPT_ALL (M48T35_RTC_INTERRUPT_AFE|M48T35_RTC_INTERRUPT_ABE)
+
+#define M48T35_RTC_WATCHDOG_RB 0x03
+#define M48T35_RTC_WATCHDOG_BMB 0x7c
+#define M48T35_RTC_WATCHDOG_WDS 0x80
+#define M48T35_RTC_WATCHDOG_ALL (M48T35_RTC_WATCHDOG_RB|M48T35_RTC_WATCHDOG_BMB|M48T35_RTC_W
+
+#define M48T35_RTC_CONTROL_WRITE 0x80
+#define M48T35_RTC_CONTROL_READ 0x40
+#define M48T35_RTC_CONTROL_CAL_SIGN 0x20
+#define M48T35_RTC_CONTROL_CAL_VALUE 0x1f
+#define M48T35_RTC_CONTROL_LOCKED (M48T35_RTC_WRITE|M48T35_RTC_READ)
+#define M48T35_RTC_CONTROL_CALIBRATION (M48T35_RTC_CONTROL_CAL_SIGN|M48T35_RTC_CONTROL_CAL_VALUE)
+
+#define M48T35_RTC_SECONDS_SEC_1 0x0f
+#define M48T35_RTC_SECONDS_SEC_10 0x70
+#define M48T35_RTC_SECONDS_ST 0x80
+#define M48T35_RTC_SECONDS_SEC_ALL (M48T35_RTC_SECONDS_SEC_1|M48T35_RTC_SECONDS_SEC_10)
+
+#define M48T35_RTC_MINUTES_MIN_1 0x0f
+#define M48T35_RTC_MINUTES_MIN_10 0x70
+#define M48T35_RTC_MINUTES_MIN_ALL (M48T35_RTC_MINUTES_MIN_1|M48T35_RTC_MINUTES_MIN_10)
+
+#define M48T35_RTC_HOURS_HRS_1 0x0f
+#define M48T35_RTC_HOURS_HRS_10 0x30
+#define M48T35_RTC_HOURS_HRS_ALL (M48T35_RTC_HOURS_HRS_1|M48T35_RTC_HOURS_HRS_10)
+
+#define M48T35_RTC_DAY_DAY_1 0x03
+#define M48T35_RTC_DAY_FT 0x40
+
+#define M48T35_RTC_ALARM_OFF 0x00
+#define M48T35_RTC_WATCHDOG_OFF 0x00
+
+
+/* legacy */
X #define M48T35_RTC_SET 0x80
X #define M48T35_RTC_STOPPED 0x80
X #define M48T35_RTC_READ 0x40
X
+
+/* read/write conversions */
X #ifndef BCD_TO_BIN
X #define BCD_TO_BIN(x) ((x)=((x)&15) + ((x)>>4)*10)
X #endif
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/machdep.h linux/include/asm-ppc/machdep.h
--- v2.4.13/linux/include/asm-ppc/machdep.h Sun Sep 23 11:41:01 2001
+++ linux/include/asm-ppc/machdep.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.machdep.h 1.21 08/29/01 10:07:29 paulus
+ * BK Id: SCCS/s.machdep.h 1.23 10/18/01 11:16:28 trini
X */
X #ifdef __KERNEL__
X #ifndef _PPC_MACHDEP_H
@@ -61,9 +61,7 @@
X char (*kbd_unexpected_up)(unsigned char keycode);
X void (*kbd_leds)(unsigned char leds);
X void (*kbd_init_hw)(void);
-#ifdef CONFIG_MAGIC_SYSRQ
X unsigned char *ppc_kbd_sysrq_xlate;
-#endif
X
X /*
X * optional PCI "hooks"
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/mpc8xx.h linux/include/asm-ppc/mpc8xx.h
--- v2.4.13/linux/include/asm-ppc/mpc8xx.h Mon May 21 15:02:06 2001
+++ linux/include/asm-ppc/mpc8xx.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.mpc8xx.h 1.10 05/17/01 18:14:25 cort
+ * BK Id: SCCS/s.mpc8xx.h 1.15 11/01/01 12:48:53 trini
X */
X
X /* This is the single file included by all MPC8xx build options.
@@ -36,7 +36,7 @@
X #include <asm/rpxclassic.h>
X #endif
X
-#if (defined(CONFIG_TQM860) || defined(CONFIG_TQM8xxL))
+#if defined(CONFIG_TQM8xxL)
X #include <asm/tqm8xx.h>
X #endif
X
@@ -44,7 +44,7 @@
X #include <asm/spd8xx.h>
X #endif
X
-#if defined(CONFIG_IVMS8)
+#if defined(CONFIG_IVMS8) || defined(CONFIG_IVML24)
X #include <asm/ivms8.h>
X #endif
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/oak.h linux/include/asm-ppc/oak.h
--- v2.4.13/linux/include/asm-ppc/oak.h Tue Oct 9 17:06:53 2001
+++ linux/include/asm-ppc/oak.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.oak.h 1.10 09/14/01 17:37:56 trini
+ * BK Id: SCCS/s.oak.h 1.12 10/11/01 13:05:07 trini
X */
X /*
X *
@@ -18,8 +18,6 @@
X #ifndef __OAK_H__
X #define __OAK_H__
X
-#include <asm/irq.h>
-
X #define _IO_BASE 0
X #define _ISA_MEM_BASE 0
X #define PCI_DRAM_OFFSET 0
@@ -38,10 +36,12 @@
X
X /* Interrupt assignments fixed by the hardware implementation */
X
-#define PPC403SPU_RX_INT AIC_INT4
-#define PPC403SPU_TX_INT AIC_INT5
-#define OAKNET_INT AIC_INT27
-#define OAKSERIAL_INT AIC_INT28
+/* This is annoying kbuild-2.4 problem. -- Tom */
+
+#define PPC403SPU_RX_INT 4 /* AIC_INT4 */
+#define PPC403SPU_TX_INT 5 /* AIC_INT5 */
+#define OAKNET_INT 27 /* AIC_INT27 */
+#define OAKSERIAL_INT 28 /* AIC_INT28 */
X
X #ifndef __ASSEMBLY__
X /*
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/pgtable.h linux/include/asm-ppc/pgtable.h
--- v2.4.13/linux/include/asm-ppc/pgtable.h Tue Jul 3 17:08:21 2001
+++ linux/include/asm-ppc/pgtable.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.pgtable.h 1.12 06/28/01 15:50:17 paulus
+ * BK Id: SCCS/s.pgtable.h 1.15 09/22/01 11:26:52 trini
X */
X #ifdef __KERNEL__
X #ifndef _PPC_PGTABLE_H
@@ -223,7 +223,8 @@
X #define _PAGE_RW 0x0040 /* software: user write access allowed */
X #define _PAGE_ACCESSED 0x0080 /* software: page referenced */
X
-#define _PAGE_DIRTY 0x0100 /* C: page changed (write protect) */
+#define _PAGE_HWWRITE 0x0100 /* h/w write enable: never set in Linux PTE */
+#define _PAGE_DIRTY 0x0200 /* software: page changed */
X #define _PAGE_USER 0x0800 /* One of the PP bits, the other is USER&~RW */
X
X #else /* CONFIG_6xx */
@@ -241,12 +242,35 @@
X #define _PAGE_RW 0x400 /* software: user write access allowed */
X #endif
X
+/* The non-standard PowerPC MMUs, which includes the 4xx and 8xx (and
+ * mabe 603e) have TLB miss handlers that unconditionally set the
+ * _PAGE_ACCESSED flag as a performance optimization. This causes
+ * problems for the page_none() macro, just like the HASHPTE flag does
+ * for the standard PowerPC MMUs. Depending upon the MMU configuration,
+ * either HASHPTE or ACCESSED will have to be masked to give us a
+ * proper pte_none() condition.
+ */
X #ifndef _PAGE_HASHPTE
X #define _PAGE_HASHPTE 0
+#define _PTE_NONE_MASK _PAGE_ACCESSED
+#else
+#define _PTE_NONE_MASK _PAGE_HASHPTE
X #endif
X #ifndef _PAGE_SHARED
X #define _PAGE_SHARED 0
X #endif
+#ifndef _PAGE_HWWRITE
+#define _PAGE_HWWRITE 0
+#endif
+
+/* We can't use _PAGE_HWWRITE on any SMP due to the lack of ability
+ * to atomically manage _PAGE_HWWRITE and it's coordination flags,
+ * _PAGE_DIRTY or _PAGE_RW. The SMP systems must manage HWWRITE
+ * or its logical equivalent in the MMU management software.
+ */
+#if CONFIG_SMP && _PAGE_HWWRITE
+#error "You can't configure SMP and HWWRITE"
+#endif
X
X #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
X
@@ -308,7 +332,7 @@
X
X #endif /* __ASSEMBLY__ */
X
-#define pte_none(pte) ((pte_val(pte) & ~_PAGE_HASHPTE) == 0)
+#define pte_none(pte) ((pte_val(pte) & ~_PTE_NONE_MASK) == 0)
X #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
X #define pte_clear(ptep) do { set_pte((ptep), __pte(0)); } while (0)
X
@@ -353,11 +377,11 @@
X static inline pte_t pte_rdprotect(pte_t pte) {
X pte_val(pte) &= ~_PAGE_USER; return pte; }
X static inline pte_t pte_wrprotect(pte_t pte) {
- pte_val(pte) &= ~_PAGE_RW; return pte; }
+ pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; }
X static inline pte_t pte_exprotect(pte_t pte) {
X pte_val(pte) &= ~_PAGE_EXEC; return pte; }
X static inline pte_t pte_mkclean(pte_t pte) {
- pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
+ pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; }
X static inline pte_t pte_mkold(pte_t pte) {
X pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
X
@@ -433,7 +457,7 @@
X
X static inline int ptep_test_and_clear_dirty(pte_t *ptep)
X {
- return (pte_update(ptep, _PAGE_DIRTY, 0) & _PAGE_DIRTY) != 0;
+ return (pte_update(ptep, (_PAGE_DIRTY | _PAGE_HWWRITE), 0) & _PAGE_DIRTY) != 0;
X }
X
X static inline pte_t ptep_get_and_clear(pte_t *ptep)
@@ -443,7 +467,7 @@
X
X static inline void ptep_set_wrprotect(pte_t *ptep)
X {
- pte_update(ptep, _PAGE_RW, 0);
+ pte_update(ptep, (_PAGE_RW | _PAGE_HWWRITE), 0);
X }
X
X static inline void ptep_mkdirty(pte_t *ptep)
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/ppcboot.h linux/include/asm-ppc/ppcboot.h
--- v2.4.13/linux/include/asm-ppc/ppcboot.h Tue Oct 23 22:48:53 2001
+++ linux/include/asm-ppc/ppcboot.h Fri Nov 2 17:43:54 2001
@@ -18,8 +18,8 @@
X * MA 02111-1307 USA
X */
X
-#ifndef _PPCBOOT_H_
-#define _PPCBOOT_H_ 1
+#ifndef __ASM_PPCBOOT_H__
+#define __ASM_PPCBOOT_H__
X
X /*
X * Board information passed to kernel from PPCBoot
@@ -28,7 +28,6 @@
X */
X
X #ifndef __ASSEMBLY__
-
X #include <linux/types.h>
X
X typedef void (interrupt_handler_t)(void *);
@@ -46,48 +45,47 @@
X } mon_fnc_t;
X
X typedef struct bd_info {
- unsigned long bi_memstart; /* start of DRAM memory */
- unsigned long bi_memsize; /* size of DRAM memory in bytes */
- unsigned long bi_flashstart; /* start of FLASH memory */
- unsigned long bi_flashsize; /* size of FLASH memory */
- 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 */
+ unsigned long bi_memstart; /* start of DRAM memory */
+ unsigned long bi_memsize; /* size of DRAM memory in bytes */
+ unsigned long bi_flashstart; /* start of FLASH memory */
+ unsigned long bi_flashsize; /* size of FLASH memory */
+ 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 */
X #if defined(CONFIG_8xx) || defined(CONFIG_8260)
- unsigned long bi_immr_base; /* base of IMMR register */
+ unsigned long bi_immr_base; /* base of IMMR register */
X #endif
- unsigned long bi_bootflags; /* boot / reboot flag (for LynxOS) */
- unsigned long bi_ip_addr; /* IP Address */
- unsigned char bi_enetaddr[6]; /* Ethernet adress */
- unsigned short bi_ethspeed; /* Ethernet speed in Mbps */
- unsigned long bi_intfreq; /* Internal Freq, in MHz */
- unsigned long bi_busfreq; /* Bus Freq, in MHz */
+ unsigned long bi_bootflags; /* boot / reboot flag (for LynxOS) */
+ unsigned long bi_ip_addr; /* IP Address */
+ unsigned char bi_enetaddr[6]; /* Ethernet adress */
+ unsigned short bi_ethspeed; /* Ethernet speed in Mbps */
+ unsigned long bi_intfreq; /* Internal Freq, in MHz */
+ unsigned long bi_busfreq; /* Bus Freq, in MHz */
X #if defined(CONFIG_8260)
- 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 */
+ 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 */
X #endif
- unsigned long bi_baudrate; /* Console Baudrate */
+ unsigned long bi_baudrate; /* Console Baudrate */
X #if defined(CONFIG_405GP)
- unsigned char bi_s_version[4]; /* Version of this structure */
- unsigned char bi_r_version[32]; /* Version of the ROM (IBM) */
- unsigned int bi_procfreq; /* CPU (Internal) Freq, in Hz */
+ unsigned char bi_s_version[4]; /* Version of this structure */
+ unsigned char bi_r_version[32]; /* Version of the ROM (IBM) */
+ unsigned int bi_procfreq; /* CPU (Internal) Freq, in Hz */
X unsigned int bi_plb_busfreq; /* PLB Bus speed, in Hz */
X unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
- unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */
+ unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */
X #endif
X #if defined(CONFIG_HYMOD)
- hymod_conf_t bi_hymod_conf; /* hymod configuration information */
+ hymod_conf_t bi_hymod_conf; /* hymod configuration information */
X #endif
X #if defined(CONFIG_EVB64260)
X /* the board has three onboard ethernet ports */
- unsigned char bi_enet1addr[6];
- unsigned char bi_enet2addr[6];
+ unsigned char bi_enet1addr[6];
+ unsigned char bi_enet2addr[6];
X #endif
- mon_fnc_t *bi_mon_fnc; /* Pointer to monitor functions */
+ mon_fnc_t *bi_mon_fnc; /* Pointer to monitor functions */
X } bd_t;
X
X #endif /* __ASSEMBLY__ */
-
-#endif /* _PPCBOOT_H_ */
+#endif /* __ASM_PPCBOOT_H__ */
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/serial.h linux/include/asm-ppc/serial.h
--- v2.4.13/linux/include/asm-ppc/serial.h Mon May 21 15:02:06 2001
+++ linux/include/asm-ppc/serial.h Fri Nov 2 17:43:54 2001
@@ -1,11 +1,14 @@
X /*
- * BK Id: SCCS/s.serial.h 1.12 05/17/01 18:14:25 cort
+ * BK Id: SCCS/s.serial.h 1.15 10/23/01 08:09:35 trini
X */
X /*
X * include/asm-ppc/serial.h
X */
X
X #ifdef __KERNEL__
+#ifndef __ASM_SERIAL_H__
+#define __ASM_SERIAL_H__
+
X #include <linux/config.h>
X
X #ifdef CONFIG_GEMINI
@@ -133,4 +136,5 @@
X MCA_SERIAL_PORT_DFNS
X
X #endif /* !CONFIG_GEMINI and others */
+#endif /* __ASM_SERIAL_H__ */
X #endif /* __KERNEL__ */
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/smplock.h linux/include/asm-ppc/smplock.h
--- v2.4.13/linux/include/asm-ppc/smplock.h Mon May 21 15:02:06 2001
+++ linux/include/asm-ppc/smplock.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.smplock.h 1.7 05/17/01 18:14:25 cort
+ * BK Id: SCCS/s.smplock.h 1.10 10/23/01 08:09:35 trini
X */
X /*
X * <asm/smplock.h>
@@ -7,6 +7,9 @@
X * Default SMP lock implementation
X */
X #ifdef __KERNEL__
+#ifndef __ASM_SMPLOCK_H__
+#define __ASM_SMPLOCK_H__
+
X #include <linux/interrupt.h>
X #include <linux/spinlock.h>
X
@@ -53,4 +56,5 @@
X if (--current->lock_depth < 0)
X spin_unlock(&kernel_flag);
X }
+#endif /* __ASM_SMPLOCK_H__ */
X #endif /* __KERNEL__ */
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/spd8xx.h linux/include/asm-ppc/spd8xx.h
--- v2.4.13/linux/include/asm-ppc/spd8xx.h Tue Oct 9 17:06:53 2001
+++ linux/include/asm-ppc/spd8xx.h Fri Nov 2 17:43:54 2001
@@ -1,76 +1,40 @@
X /*
- * BK Id: SCCS/s.spd8xx.h 1.6 09/14/01 17:37:56 trini
+ * BK Id: SCCS/s.spd8xx.h 1.8 10/27/01 13:39:41 trini
X */
X /*
- * A collection of structures, addresses, and values associated with
- * Speech Design SPD8xxTS boards.
- *
- * Copyright (c) 2000 Wolfgang Denk (w...@denx.de)
+ * Speech Design SPD8xxTS board specific definitions
+ *
+ * Copyright (c) 2000,2001 Wolfgang Denk (w...@denx.de)
X */
-#ifndef __MACH_SPD8xx_DEFS
-#define __MACH_SPD8xx_DEFS
X
-#ifndef __ASSEMBLY__
+#ifdef __KERNEL__
+#ifndef __ASM_SPD8XX_H__
+#define __ASM_SPD8XX_H__
+
+#include <linux/config.h>
+
+#include <asm/ppcboot.h>
X
-typedef void (interrupt_handler_t)(void *);
+#define SPD_IMMR_BASE 0xFFF00000 /* phys. addr of IMMR */
+#define SPD_IMAP_SIZE (64 * 1024) /* size of mapped area */
X
-typedef struct serial_io {
- int (*getc)(void);
- int (*tstc)(void);
- void (*putc)(const char c);
- void (*printf)(const char *fmt, ...);
-} serial_io_t;
-
-typedef struct intr_util {
- void (*install_hdlr)(int, interrupt_handler_t *, void *);
- void (*free_hdlr)(int);
-} intr_util_t;
-
-
-/* A Board Information structure that is given to a program when


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 50'
echo 'File patch-2.4.14 is continued in part 51'
echo "51" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:14 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part51

#!/bin/sh -x
# this is part 51 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 51; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

- * ppcboot starts it up.
- */
-typedef struct bd_info {
- unsigned long bi_memstart; /* start of DRAM memory */
- unsigned long bi_memsize; /* size of DRAM memory in bytes */
- unsigned long bi_flashstart; /* start of FLASH memory */
- unsigned long bi_flashsize; /* size of FLASH memory */
- 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 */
- unsigned long bi_immr_base; /* base of IMMR register */
- unsigned long bi_bootflags; /* boot / reboot flag (for LynxOS) */
- unsigned long bi_ip_addr; /* IP Address */
- unsigned char bi_enetaddr[6]; /* Ethernet adress */
- unsigned char bi_reserved[2]; /* -- just for alignment -- */
- unsigned long bi_intfreq; /* Internal Freq, in MHz */
- unsigned long bi_busfreq; /* Bus Freq, in MHz */
- unsigned long bi_baudrate; /* Console Baudrate */
- serial_io_t bi_serial_io; /* Addr of monitor fnc for Console I/O */
- intr_util_t bi_interrupt; /* Addr of monitor fnc for Interrupts */
-} bd_t;

-
-#endif /* __ASSEMBLY__ */
-
-#define SPD_IMMR_BASE 0xFFF00000 /* phys. addr of IMMR */
-#define SPD_IMAP_SIZE (64 * 1024) /* size of mapped area */
-
-#define IMAP_ADDR SPD_IMMR_BASE /* physical base address of IMMR area */
-#define IMAP_SIZE SPD_IMAP_SIZE /* mapped size of IMMR area */
+#define IMAP_ADDR SPD_IMMR_BASE /* physical base address of IMMR area */
+#define IMAP_SIZE SPD_IMAP_SIZE /* mapped size of IMMR area */


X
X #define PCMCIA_MEM_ADDR ((uint)0xFE100000)
X #define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
X

-#define IDE0_INTERRUPT 10 /* = IRQ5 */

-#define IDE1_INTERRUPT 12 /* = IRQ6 */
-#define CPM_INTERRUPT 13 /* = SIU_LEVEL6 (was: SIU_LEVEL2) */


+#define IDE0_INTERRUPT 10 /* = IRQ5 */

+#define IDE1_INTERRUPT 12 /* = IRQ6 */
+#define CPM_INTERRUPT 13 /* = SIU_LEVEL6 (was: SIU_LEVEL2) */
X
-#define MAX_HWIFS 2 /* overwrite default in include/asm-ppc/ide.h */


+/* override the default number of IDE hardware interfaces */

+#define MAX_HWIFS 2


X
X /*
X * Definitions for IDE0 Interface
X */
-#define IDE0_BASE_OFFSET 0x0000 /* Offset in PCMCIA memory */
+#define IDE0_BASE_OFFSET 0x0000 /* Offset in PCMCIA memory */
X #define IDE0_DATA_REG_OFFSET 0x0000
X #define IDE0_ERROR_REG_OFFSET 0x0081
X #define IDE0_NSECTOR_REG_OFFSET 0x0082

@@ -80,12 +44,12 @@


X #define IDE0_SELECT_REG_OFFSET 0x0086
X #define IDE0_STATUS_REG_OFFSET 0x0087
X #define IDE0_CONTROL_REG_OFFSET 0x0106
-#define IDE0_IRQ_REG_OFFSET 0x000A /* not used */
+#define IDE0_IRQ_REG_OFFSET 0x000A /* not used */
X

X /*
X * Definitions for IDE1 Interface
X */
-#define IDE1_BASE_OFFSET 0x0C00 /* Offset in PCMCIA memory */
+#define IDE1_BASE_OFFSET 0x0C00 /* Offset in PCMCIA memory */
X #define IDE1_DATA_REG_OFFSET 0x0000
X #define IDE1_ERROR_REG_OFFSET 0x0081
X #define IDE1_NSECTOR_REG_OFFSET 0x0082
@@ -95,10 +59,11 @@
X #define IDE1_SELECT_REG_OFFSET 0x0086
X #define IDE1_STATUS_REG_OFFSET 0x0087
X #define IDE1_CONTROL_REG_OFFSET 0x0106
-#define IDE1_IRQ_REG_OFFSET 0x000A /* not used */
+#define IDE1_IRQ_REG_OFFSET 0x000A /* not used */
X

X /* We don't use the 8259.
X */
X #define NR_8259_INTS 0

X
-#endif /* __MACH_SPD8xx_DEFS */
+#endif /* __ASM_SPD8XX_H__ */
+#endif /* __KERNEL__ */
diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/time.h linux/include/asm-ppc/time.h
--- v2.4.13/linux/include/asm-ppc/time.h Sun Sep 23 11:41:01 2001
+++ linux/include/asm-ppc/time.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.time.h 1.15 08/16/01 07:49:31 paulus
+ * BK Id: SCCS/s.time.h 1.17 10/23/01 08:09:35 trini
X */
X /*
X * Common time prototypes and such for all ppc machines.
@@ -9,6 +9,9 @@
X */
X
X #ifdef __KERNEL__
+#ifndef __ASM_TIME_H__
+#define __ASM_TIME_H__
+
X #include <linux/config.h>
X #include <linux/mc146818rtc.h>
X #include <linux/threads.h>
@@ -136,4 +139,5 @@
X ({unsigned z; asm ("mulhwu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;})
X
X unsigned mulhwu_scale_factor(unsigned, unsigned);
+#endif /* __ASM_TIME_H__ */


X #endif /* __KERNEL__ */

diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/uninorth.h linux/include/asm-ppc/uninorth.h
--- v2.4.13/linux/include/asm-ppc/uninorth.h Sun Sep 23 11:41:01 2001
+++ linux/include/asm-ppc/uninorth.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.uninorth.h 1.11 08/19/01 22:23:04 paulus
+ * BK Id: SCCS/s.uninorth.h 1.13 10/23/01 08:09:35 trini
X */
X /*
X * uninorth.h: definitions for using the "UniNorth" host bridge chip
@@ -7,7 +7,8 @@
X *
X */
X #ifdef __KERNEL__
-
+#ifndef __ASM_UNINORTH_H__
+#define __ASM_UNINORTH_H__
X
X /*
X * Uni-N config space reg. definitions
@@ -131,4 +132,5 @@
X
X /* Uninorth 1.5 rev. has additional perf. monitor registers at 0xf00-0xf50 */
X
+#endif /* __ASM_UNINORTH_H__ */


X #endif /* __KERNEL__ */

diff -u --recursive --new-file v2.4.13/linux/include/asm-ppc/unistd.h linux/include/asm-ppc/unistd.h
--- v2.4.13/linux/include/asm-ppc/unistd.h Mon May 21 15:02:06 2001
+++ linux/include/asm-ppc/unistd.h Fri Nov 2 17:43:54 2001


@@ -1,5 +1,5 @@
X /*

- * BK Id: SCCS/s.unistd.h 1.7 05/17/01 18:14:26 cort
+ * BK Id: SCCS/s.unistd.h 1.11 10/18/01 17:29:53 trini
X */
X #ifndef _ASM_PPC_UNISTD_H_
X #define _ASM_PPC_UNISTD_H_
@@ -198,6 +198,7 @@
X #define __NR_putpmsg 188 /* some people actually want streams */
X #define __NR_vfork 189
X #define __NR_ugetrlimit 190 /* SuS compliant getrlimit */
+#define __NR_readahead 191
X #define __NR_mmap2 192
X #define __NR_truncate64 193
X #define __NR_ftruncate64 194
@@ -213,6 +214,7 @@
X #define __NR_fcntl64 204
X #define __NR_madvise 205
X #define __NR_mincore 206
+#define __NR_gettid 207
X
X #define __NR(n) #n
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc/atomic.h linux/include/asm-sparc/atomic.h
--- v2.4.13/linux/include/asm-sparc/atomic.h Wed Jul 25 17:10:25 2001
+++ linux/include/asm-sparc/atomic.h Tue Oct 30 15:08:11 2001
@@ -56,11 +56,11 @@
X ptr = &v->counter;
X increment = i;
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___atomic_add
- add %%o7, 8, %%o7
-" : "=&r" (increment)
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___atomic_add\n\t"
+ " add %%o7, 8, %%o7\n"
+ : "=&r" (increment)
X : "0" (increment), "r" (ptr)
X : "g3", "g4", "g7", "memory", "cc");
X
@@ -75,11 +75,11 @@
X ptr = &v->counter;
X increment = i;
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___atomic_sub
- add %%o7, 8, %%o7
-" : "=&r" (increment)
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___atomic_sub\n\t"
+ " add %%o7, 8, %%o7\n"
+ : "=&r" (increment)
X : "0" (increment), "r" (ptr)
X : "g3", "g4", "g7", "memory", "cc");
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc/bitops.h linux/include/asm-sparc/bitops.h
--- v2.4.13/linux/include/asm-sparc/bitops.h Sun Aug 12 13:28:01 2001
+++ linux/include/asm-sparc/bitops.h Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.64 2001/07/18 13:48:23 anton Exp $
+/* $Id: bitops.h,v 1.65 2001/10/30 04:08:26 davem Exp $
X * bitops.h: Bit string operations on the Sparc.
X *
X * Copyright 1995 David S. Miller (da...@caip.rutgers.edu)
@@ -29,11 +29,11 @@
X ADDR = ((unsigned long *) addr) + (nr >> 5);
X mask = 1 << (nr & 31);
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___set_bit
- add %%o7, 8, %%o7
-" : "=&r" (mask)
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___set_bit\n\t"
+ " add %%o7, 8, %%o7\n"
+ : "=&r" (mask)
X : "0" (mask), "r" (ADDR)
X : "g3", "g4", "g5", "g7", "memory", "cc");
X
@@ -48,11 +48,11 @@
X ADDR = ((unsigned long *) addr) + (nr >> 5);
X mask = 1 << (nr & 31);
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___set_bit
- add %%o7, 8, %%o7
-" : "=&r" (mask)
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___set_bit\n\t"
+ " add %%o7, 8, %%o7\n"
+ : "=&r" (mask)
X : "0" (mask), "r" (ADDR)
X : "g3", "g4", "g5", "g7", "cc");
X }
@@ -65,11 +65,11 @@
X ADDR = ((unsigned long *) addr) + (nr >> 5);
X mask = 1 << (nr & 31);
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___clear_bit
- add %%o7, 8, %%o7
-" : "=&r" (mask)
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___clear_bit\n\t"
+ " add %%o7, 8, %%o7\n"
+ : "=&r" (mask)
X : "0" (mask), "r" (ADDR)
X : "g3", "g4", "g5", "g7", "memory", "cc");
X
@@ -84,11 +84,11 @@
X ADDR = ((unsigned long *) addr) + (nr >> 5);
X mask = 1 << (nr & 31);
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___clear_bit
- add %%o7, 8, %%o7
-" : "=&r" (mask)
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___clear_bit\n\t"
+ " add %%o7, 8, %%o7\n"
+ : "=&r" (mask)
X : "0" (mask), "r" (ADDR)
X : "g3", "g4", "g5", "g7", "cc");
X }
@@ -101,11 +101,11 @@
X ADDR = ((unsigned long *) addr) + (nr >> 5);
X mask = 1 << (nr & 31);
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___change_bit
- add %%o7, 8, %%o7
-" : "=&r" (mask)
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___change_bit\n\t"
+ " add %%o7, 8, %%o7\n"
+ : "=&r" (mask)
X : "0" (mask), "r" (ADDR)
X : "g3", "g4", "g5", "g7", "memory", "cc");
X
@@ -120,11 +120,11 @@
X ADDR = ((unsigned long *) addr) + (nr >> 5);
X mask = 1 << (nr & 31);
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___change_bit
- add %%o7, 8, %%o7
-" : "=&r" (mask)
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___change_bit\n\t"
+ " add %%o7, 8, %%o7\n"
+ : "=&r" (mask)
X : "0" (mask), "r" (ADDR)
X : "g3", "g4", "g5", "g7", "cc");
X }
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc/checksum.h linux/include/asm-sparc/checksum.h
--- v2.4.13/linux/include/asm-sparc/checksum.h Mon Jan 31 23:41:14 2000
+++ linux/include/asm-sparc/checksum.h Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: checksum.h,v 1.31 2000/01/31 01:26:52 davem Exp $ */
+/* $Id: checksum.h,v 1.32 2001/10/30 04:32:24 davem Exp $ */
X #ifndef __SPARC_CHECKSUM_H
X #define __SPARC_CHECKSUM_H
X
@@ -55,10 +55,10 @@
X register char *d asm("o1") = dst;
X register int l asm("g1") = len;
X
- __asm__ __volatile__ ("
- call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "
- mov %4, %%g7
- " : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (sum) :
+ __asm__ __volatile__ (
+ "call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
+ " mov %4, %%g7\n"
+ : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (sum) :
X "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7");
X return ret;
X }
@@ -77,15 +77,15 @@
X register int l asm("g1") = len;
X register unsigned int s asm("g7") = sum;
X
- __asm__ __volatile__ ("
- .section __ex_table,#alloc
- .align 4
- .word 1f,2
- .previous
-1:
- call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "
- st %5, [%%sp + 64]
- " : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) :
+ __asm__ __volatile__ (
+ ".section __ex_table,#alloc\n\t"
+ ".align 4\n\t"
+ ".word 1f,2\n\t"
+ ".previous\n"
+ "1:\n\t"
+ "call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
+ " st %5, [%%sp + 64]\n"
+ : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) :
X "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7");
X return ret;
X }
@@ -104,15 +104,15 @@
X register int l asm("g1") = len;
X register unsigned int s asm("g7") = sum;
X
- __asm__ __volatile__ ("
- .section __ex_table,#alloc
- .align 4
- .word 1f,1
- .previous
-1:
- call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "
- st %5, [%%sp + 64]
- " : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) :
+ __asm__ __volatile__ (
+ ".section __ex_table,#alloc\n\t"
+ ".align 4\n\t"
+ ".word 1f,1\n\t"
+ ".previous\n"
+ "1:\n\t"
+ "call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
+ " st %5, [%%sp + 64]\n"
+ : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) :
X "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7");
X return ret;
X }
@@ -214,27 +214,26 @@
X unsigned short proto,
X unsigned int sum)
X {
- __asm__ __volatile__ ("
- addcc %3, %4, %%g4
- addxcc %5, %%g4, %%g4
- ld [%2 + 0x0c], %%g2
- ld [%2 + 0x08], %%g3
- addxcc %%g2, %%g4, %%g4
- ld [%2 + 0x04], %%g2
- addxcc %%g3, %%g4, %%g4
- ld [%2 + 0x00], %%g3
- addxcc %%g2, %%g4, %%g4
- ld [%1 + 0x0c], %%g2
- addxcc %%g3, %%g4, %%g4
- ld [%1 + 0x08], %%g3
- addxcc %%g2, %%g4, %%g4
- ld [%1 + 0x04], %%g2
- addxcc %%g3, %%g4, %%g4
- ld [%1 + 0x00], %%g3
- addxcc %%g2, %%g4, %%g4
- addxcc %%g3, %%g4, %0
- addx 0, %0, %0
- "
+ __asm__ __volatile__ (
+ "addcc %3, %4, %%g4\n\t"
+ "addxcc %5, %%g4, %%g4\n\t"
+ "ld [%2 + 0x0c], %%g2\n\t"
+ "ld [%2 + 0x08], %%g3\n\t"
+ "addxcc %%g2, %%g4, %%g4\n\t"
+ "ld [%2 + 0x04], %%g2\n\t"
+ "addxcc %%g3, %%g4, %%g4\n\t"
+ "ld [%2 + 0x00], %%g3\n\t"
+ "addxcc %%g2, %%g4, %%g4\n\t"
+ "ld [%1 + 0x0c], %%g2\n\t"
+ "addxcc %%g3, %%g4, %%g4\n\t"
+ "ld [%1 + 0x08], %%g3\n\t"
+ "addxcc %%g2, %%g4, %%g4\n\t"
+ "ld [%1 + 0x04], %%g2\n\t"
+ "addxcc %%g3, %%g4, %%g4\n\t"
+ "ld [%1 + 0x00], %%g3\n\t"
+ "addxcc %%g2, %%g4, %%g4\n\t"
+ "addxcc %%g3, %%g4, %0\n\t"
+ "addx 0, %0, %0\n"
X : "=&r" (sum)
X : "r" (saddr), "r" (daddr),
X "r"(htonl(len)), "r"(htonl(proto)), "r"(sum)
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc/floppy.h linux/include/asm-sparc/floppy.h
--- v2.4.13/linux/include/asm-sparc/floppy.h Thu Sep 7 08:32:01 2000
+++ linux/include/asm-sparc/floppy.h Thu Oct 25 13:53:55 2001
@@ -96,8 +96,6 @@
X */
X #define FDC1 sun_floppy_init()
X
-static int FDC2=-1;


-
X #define N_FDC 1

X #define N_DRIVE 8
X

@@ -365,5 +363,7 @@
X }
X
X #define fd_eject(drive) sparc_eject()
+
+#define EXTRA_FLOPPY_PARAMS
X
X #endif /* !(__ASM_SPARC_FLOPPY_H) */
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc/scatterlist.h linux/include/asm-sparc/scatterlist.h
--- v2.4.13/linux/include/asm-sparc/scatterlist.h Tue Oct 23 22:48:53 2001
+++ linux/include/asm-sparc/scatterlist.h Tue Oct 30 15:08:11 2001
@@ -1,15 +1,23 @@
-/* $Id: scatterlist.h,v 1.6 2001/10/09 02:24:35 davem Exp $ */
+/* $Id: scatterlist.h,v 1.7 2001/10/30 04:34:57 davem Exp $ */
X #ifndef _SPARC_SCATTERLIST_H
X #define _SPARC_SCATTERLIST_H


X
X #include <linux/types.h>
X

X struct scatterlist {
- char * address; /* Location data is to be transferred to */
- unsigned int length;
+ /* This will disappear in 2.5.x */
+ char *address;
X
- __u32 dvma_address; /* A place to hang host-specific addresses at. */
- __u32 dvma_length;
+ /* These two are only valid if ADDRESS member of this
+ * struct is NULL.
+ */
+ struct page *page;
+ unsigned int offset;
+
+ unsigned int length;
+
+ __u32 dvma_address; /* A place to hang host-specific addresses at. */
+ __u32 dvma_length;
X };
X
X #define sg_dma_address(sg) ((sg)->dvma_address)
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc/semaphore.h linux/include/asm-sparc/semaphore.h
--- v2.4.13/linux/include/asm-sparc/semaphore.h Tue Apr 17 17:19:31 2001
+++ linux/include/asm-sparc/semaphore.h Tue Oct 30 15:08:11 2001
@@ -75,24 +75,25 @@
X ptr = &(sem->count.counter);
X increment = 1;
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___atomic_sub
- add %%o7, 8, %%o7
- tst %%g2
- bl 2f
- nop
-1:
- .subsection 2
-2: save %%sp, -64, %%sp
- mov %%g1, %%l1
- mov %%g5, %%l5
- call %3
- mov %%g1, %%o0
- mov %%l1, %%g1
- ba 1b
- restore %%l5, %%g0, %%g5
- .previous\n"
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___atomic_sub\n\t"
+ " add %%o7, 8, %%o7\n\t"
+ "tst %%g2\n\t"
+ "bl 2f\n\t"
+ " nop\n"
+ "1:\n\t"
+ ".subsection 2\n"
+ "2:\n\t"
+ "save %%sp, -64, %%sp\n\t"
+ "mov %%g1, %%l1\n\t"
+ "mov %%g5, %%l5\n\t"
+ "call %3\n\t"
+ " mov %%g1, %%o0\n\t"
+ "mov %%l1, %%g1\n\t"
+ "ba 1b\n\t"
+ " restore %%l5, %%g0, %%g5\n\t"
+ ".previous\n"
X : "=&r" (increment)
X : "0" (increment), "r" (ptr), "i" (__down)
X : "g3", "g4", "g7", "memory", "cc");
@@ -110,25 +111,26 @@
X ptr = &(sem->count.counter);
X increment = 1;
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___atomic_sub
- add %%o7, 8, %%o7
- tst %%g2
- bl 2f
- clr %%g2
-1:
- .subsection 2
-2: save %%sp, -64, %%sp
- mov %%g1, %%l1
- mov %%g5, %%l5
- call %3
- mov %%g1, %%o0
- mov %%l1, %%g1
- mov %%l5, %%g5
- ba 1b
- restore %%o0, %%g0, %%g2
- .previous\n"
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___atomic_sub\n\t"
+ " add %%o7, 8, %%o7\n\t"
+ "tst %%g2\n\t"
+ "bl 2f\n\t"
+ " clr %%g2\n"
+ "1:\n\t"
+ ".subsection 2\n"
+ "2:\n\t"
+ "save %%sp, -64, %%sp\n\t"
+ "mov %%g1, %%l1\n\t"
+ "mov %%g5, %%l5\n\t"
+ "call %3\n\t"
+ " mov %%g1, %%o0\n\t"
+ "mov %%l1, %%g1\n\t"
+ "mov %%l5, %%g5\n\t"
+ "ba 1b\n\t"
+ " restore %%o0, %%g0, %%g2\n\t"
+ ".previous\n"
X : "=&r" (increment)
X : "0" (increment), "r" (ptr), "i" (__down_interruptible)
X : "g3", "g4", "g7", "memory", "cc");
@@ -148,25 +150,26 @@
X ptr = &(sem->count.counter);
X increment = 1;
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___atomic_sub
- add %%o7, 8, %%o7
- tst %%g2
- bl 2f
- clr %%g2
-1:
- .subsection 2
-2: save %%sp, -64, %%sp
- mov %%g1, %%l1
- mov %%g5, %%l5
- call %3
- mov %%g1, %%o0
- mov %%l1, %%g1
- mov %%l5, %%g5
- ba 1b
- restore %%o0, %%g0, %%g2
- .previous\n"
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___atomic_sub\n\t"
+ " add %%o7, 8, %%o7\n\t"
+ "tst %%g2\n\t"
+ "bl 2f\n\t"
+ " clr %%g2\n"
+ "1:\n\t"
+ ".subsection 2\n"
+ "2:\n\t"
+ "save %%sp, -64, %%sp\n\t"
+ "mov %%g1, %%l1\n\t"
+ "mov %%g5, %%l5\n\t"
+ "call %3\n\t"
+ " mov %%g1, %%o0\n\t"
+ "mov %%l1, %%g1\n\t"
+ "mov %%l5, %%g5\n\t"
+ "ba 1b\n\t"
+ " restore %%o0, %%g0, %%g2\n\t"
+ ".previous\n"
X : "=&r" (increment)
X : "0" (increment), "r" (ptr), "i" (__down_trylock)
X : "g3", "g4", "g7", "memory", "cc");
@@ -186,24 +189,25 @@
X ptr = &(sem->count.counter);
X increment = 1;
X
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___atomic_add
- add %%o7, 8, %%o7
- tst %%g2
- ble 2f
- nop
-1:
- .subsection 2
-2: save %%sp, -64, %%sp
- mov %%g1, %%l1
- mov %%g5, %%l5
- call %3
- mov %%g1, %%o0
- mov %%l1, %%g1
- ba 1b
- restore %%l5, %%g0, %%g5
- .previous\n"
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___atomic_add\n\t"
+ " add %%o7, 8, %%o7\n\t"
+ "tst %%g2\n\t"
+ "ble 2f\n\t"
+ " nop\n"
+ "1:\n\t"
+ ".subsection 2\n"
+ "2:\n\t"
+ "save %%sp, -64, %%sp\n\t"
+ "mov %%g1, %%l1\n\t"
+ "mov %%g5, %%l5\n\t"
+ "call %3\n\t"
+ " mov %%g1, %%o0\n\t"
+ "mov %%l1, %%g1\n\t"
+ "ba 1b\n\t"
+ " restore %%l5, %%g0, %%g5\n\t"
+ ".previous\n"
X : "=&r" (increment)
X : "0" (increment), "r" (ptr), "i" (__up)
X : "g3", "g4", "g7", "memory", "cc");
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc/spinlock.h linux/include/asm-sparc/spinlock.h
--- v2.4.13/linux/include/asm-sparc/spinlock.h Mon Aug 14 13:09:07 2000
+++ linux/include/asm-sparc/spinlock.h Tue Oct 30 15:08:11 2001
@@ -99,18 +99,20 @@
X
X extern __inline__ void spin_lock(spinlock_t *lock)
X {
- __asm__ __volatile__("
-1: ldstub [%0], %%g2
- orcc %%g2, 0x0, %%g0
- bne,a 2f
- ldub [%0], %%g2
- .subsection 2
-2: orcc %%g2, 0x0, %%g0
- bne,a 2b
- ldub [%0], %%g2
- b,a 1b
- .previous
-" : /* no outputs */
+ __asm__ __volatile__(
+ "\n1:\n\t"
+ "ldstub [%0], %%g2\n\t"
+ "orcc %%g2, 0x0, %%g0\n\t"
+ "bne,a 2f\n\t"
+ " ldub [%0], %%g2\n\t"
+ ".subsection 2\n"
+ "2:\n\t"
+ "orcc %%g2, 0x0, %%g0\n\t"
+ "bne,a 2b\n\t"
+ " ldub [%0], %%g2\n\t"
+ "b,a 1b\n\t"
+ ".previous\n"
+ : /* no outputs */
X : "r" (lock)
X : "g2", "memory", "cc");
X }
@@ -167,11 +169,11 @@
X {
X register rwlock_t *lp asm("g1");
X lp = rw;
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___rw_read_enter
- ldstub [%%g1 + 3], %%g2
-" : /* no outputs */
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___rw_read_enter\n\t"
+ " ldstub [%%g1 + 3], %%g2\n"
+ : /* no outputs */
X : "r" (lp)
X : "g2", "g4", "memory", "cc");
X }
@@ -187,11 +189,11 @@
X {
X register rwlock_t *lp asm("g1");
X lp = rw;
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___rw_read_exit
- ldstub [%%g1 + 3], %%g2
-" : /* no outputs */
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___rw_read_exit\n\t"
+ " ldstub [%%g1 + 3], %%g2\n"
+ : /* no outputs */
X : "r" (lp)
X : "g2", "g4", "memory", "cc");
X }
@@ -207,11 +209,11 @@
X {
X register rwlock_t *lp asm("g1");
X lp = rw;
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___rw_write_enter
- ldstub [%%g1 + 3], %%g2
-" : /* no outputs */
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___rw_write_enter\n\t"
+ " ldstub [%%g1 + 3], %%g2\n"
+ : /* no outputs */
X : "r" (lp)
X : "g2", "g4", "memory", "cc");
X }
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc/system.h linux/include/asm-sparc/system.h
--- v2.4.13/linux/include/asm-sparc/system.h Tue Oct 3 09:24:41 2000
+++ linux/include/asm-sparc/system.h Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: system.h,v 1.84 2000/09/23 02:11:22 davem Exp $ */
+/* $Id: system.h,v 1.86 2001/10/30 04:57:10 davem Exp $ */
X #include <linux/config.h>
X
X #ifndef __SPARC_SYSTEM_H
@@ -149,17 +149,17 @@
X : "g1", "g2", "g3", "g4", "g5", "g7", "l0", "l1", \
X "l4", "l5", "l6", "l7", "i0", "i1", "i2", "i3", "i4", "i5", "o0", "o1", "o2", \
X "o3"); \
-here: } while(0)
+here:; } while(0)
X
X /*
X * Changing the IRQ level on the Sparc.
X */
X extern __inline__ void setipl(unsigned long __orig_psr)
X {
- __asm__ __volatile__("
- wr %0, 0x0, %%psr
- nop; nop; nop
-" : /* no outputs */
+ __asm__ __volatile__(
+ "wr %0, 0x0, %%psr\n\t"
+ "nop; nop; nop\n"
+ : /* no outputs */
X : "r" (__orig_psr)
X : "memory", "cc");
X }
@@ -168,13 +168,13 @@
X {
X unsigned long tmp;
X
- __asm__ __volatile__("
- rd %%psr, %0
- nop; nop; nop; /* Sun4m + Cypress + SMP bug */
- or %0, %1, %0
- wr %0, 0x0, %%psr
- nop; nop; nop
-" : "=r" (tmp)
+ __asm__ __volatile__(
+ "rd %%psr, %0\n\t"
+ "nop; nop; nop;\n\t" /* Sun4m + Cypress + SMP bug */
+ "or %0, %1, %0\n\t"
+ "wr %0, 0x0, %%psr\n\t"
+ "nop; nop; nop\n"
+ : "=r" (tmp)
X : "i" (PSR_PIL)
X : "memory");


X }
@@ -183,13 +183,13 @@

X {
X unsigned long tmp;
X
- __asm__ __volatile__("
- rd %%psr, %0
- nop; nop; nop; /* Sun4m + Cypress + SMP bug */
- andn %0, %1, %0
- wr %0, 0x0, %%psr
- nop; nop; nop
-" : "=r" (tmp)
+ __asm__ __volatile__(
+ "rd %%psr, %0\n\t"
+ "nop; nop; nop;\n\t" /* Sun4m + Cypress + SMP bug */
+ "andn %0, %1, %0\n\t"
+ "wr %0, 0x0, %%psr\n\t"
+ "nop; nop; nop\n"
+ : "=r" (tmp)
X : "i" (PSR_PIL)
X : "memory");
X }
@@ -206,18 +206,18 @@
X {
X unsigned long retval;
X
- __asm__ __volatile__("
- rd %%psr, %0
- nop; nop; nop; /* Sun4m + Cypress + SMP bug */
- and %0, %2, %%g1
- and %1, %2, %%g2
- xorcc %%g1, %%g2, %%g0
- be 1f
- nop
- wr %0, %2, %%psr
- nop; nop; nop;
-1:
-" : "=r" (retval)
+ __asm__ __volatile__(
+ "rd %%psr, %0\n\t"
+ "nop; nop; nop;\n\t" /* Sun4m + Cypress + SMP bug */
+ "and %0, %2, %%g1\n\t"
+ "and %1, %2, %%g2\n\t"
+ "xorcc %%g1, %%g2, %%g0\n\t"
+ "be 1f\n\t"
+ " nop\n\t"
+ "wr %0, %2, %%psr\n\t"
+ "nop; nop; nop;\n"
+ "1:\n"
+ : "=r" (retval)
X : "r" (__new_psr), "i" (PSR_PIL)
X : "g1", "g2", "memory", "cc");
X
@@ -228,13 +228,13 @@
X {
X unsigned long retval;
X
- __asm__ __volatile__("
- rd %%psr, %0
- nop; nop; nop; /* Sun4m + Cypress + SMP bug */
- or %0, %1, %%g1
- wr %%g1, 0x0, %%psr
- nop; nop; nop
-" : "=r" (retval)
+ __asm__ __volatile__(
+ "rd %%psr, %0\n\t"
+ "nop; nop; nop;\n\t" /* Sun4m + Cypress + SMP bug */
+ "or %0, %1, %%g1\n\t"
+ "wr %%g1, 0x0, %%psr\n\t"
+ "nop; nop; nop\n\t"
+ : "=r" (retval)
X : "i" (PSR_PIL)
X : "g1", "memory");
X
@@ -307,11 +307,11 @@
X
X /* Note: this is magic and the nop there is
X really needed. */
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___f____xchg32
- nop
-" : "=&r" (ret)
+ __asm__ __volatile__(
+ "mov %%o7, %%g4\n\t"
+ "call ___f____xchg32\n\t"
+ " nop\n\t"
+ : "=&r" (ret)
X : "0" (ret), "r" (ptr)
X : "g3", "g4", "g7", "memory", "cc");
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc/uaccess.h linux/include/asm-sparc/uaccess.h
--- v2.4.13/linux/include/asm-sparc/uaccess.h Tue Oct 9 17:06:53 2001
+++ linux/include/asm-sparc/uaccess.h Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: uaccess.h,v 1.23 2001/09/24 03:51:39 davem Exp $
+/* $Id: uaccess.h,v 1.24 2001/10/30 04:32:24 davem Exp $
X * uaccess.h: User space memore access functions.
X *
X * Copyright (C) 1996 David S. Miller (da...@caip.rutgers.edu)
@@ -322,16 +322,17 @@
X extern __inline__ __kernel_size_t __clear_user(void *addr, __kernel_size_t size)
X {
X __kernel_size_t ret;
- __asm__ __volatile__ ("
- .section __ex_table,#alloc
- .align 4
- .word 1f,3
- .previous
- mov %2, %%o1
-1: call __bzero
- mov %1, %%o0
- mov %%o0, %0
- " : "=r" (ret) : "r" (addr), "r" (size) :
+ __asm__ __volatile__ (
+ ".section __ex_table,#alloc\n\t"
+ ".align 4\n\t"
+ ".word 1f,3\n\t"
+ ".previous\n\t"
+ "mov %2, %%o1\n"
+ "1:\n\t"
+ "call __bzero\n\t"
+ " mov %1, %%o0\n\t"
+ "mov %%o0, %0\n"
+ : "=r" (ret) : "r" (addr), "r" (size) :
X "o0", "o1", "o2", "o3", "o4", "o5", "o7",
X "g1", "g2", "g3", "g4", "g5", "g7", "cc");
X return ret;
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc/xor.h linux/include/asm-sparc/xor.h
--- v2.4.13/linux/include/asm-sparc/xor.h Sun Nov 12 19:39:51 2000
+++ linux/include/asm-sparc/xor.h Tue Oct 30 15:08:11 2001
@@ -26,28 +26,27 @@
X int lines = bytes / (sizeof (long)) / 8;
X
X do {
- __asm__ __volatile__("
- ldd [%0 + 0x00], %%g2
- ldd [%0 + 0x08], %%g4
- ldd [%0 + 0x10], %%o0
- ldd [%0 + 0x18], %%o2
- ldd [%1 + 0x00], %%o4
- ldd [%1 + 0x08], %%l0
- ldd [%1 + 0x10], %%l2
- ldd [%1 + 0x18], %%l4
- xor %%g2, %%o4, %%g2
- xor %%g3, %%o5, %%g3
- xor %%g4, %%l0, %%g4
- xor %%g5, %%l1, %%g5
- xor %%o0, %%l2, %%o0
- xor %%o1, %%l3, %%o1
- xor %%o2, %%l4, %%o2
- xor %%o3, %%l5, %%o3
- std %%g2, [%0 + 0x00]
- std %%g4, [%0 + 0x08]
- std %%o0, [%0 + 0x10]
- std %%o2, [%0 + 0x18]
- "
+ __asm__ __volatile__(
+ "ldd [%0 + 0x00], %%g2\n\t"
+ "ldd [%0 + 0x08], %%g4\n\t"
+ "ldd [%0 + 0x10], %%o0\n\t"
+ "ldd [%0 + 0x18], %%o2\n\t"
+ "ldd [%1 + 0x00], %%o4\n\t"
+ "ldd [%1 + 0x08], %%l0\n\t"
+ "ldd [%1 + 0x10], %%l2\n\t"
+ "ldd [%1 + 0x18], %%l4\n\t"
+ "xor %%g2, %%o4, %%g2\n\t"
+ "xor %%g3, %%o5, %%g3\n\t"
+ "xor %%g4, %%l0, %%g4\n\t"
+ "xor %%g5, %%l1, %%g5\n\t"
+ "xor %%o0, %%l2, %%o0\n\t"
+ "xor %%o1, %%l3, %%o1\n\t"
+ "xor %%o2, %%l4, %%o2\n\t"
+ "xor %%o3, %%l5, %%o3\n\t"
+ "std %%g2, [%0 + 0x00]\n\t"
+ "std %%g4, [%0 + 0x08]\n\t"
+ "std %%o0, [%0 + 0x10]\n\t"
+ "std %%o2, [%0 + 0x18]\n"
X :
X : "r" (p1), "r" (p2)
X : "g2", "g3", "g4", "g5",
@@ -65,40 +64,39 @@
X int lines = bytes / (sizeof (long)) / 8;
X
X do {
- __asm__ __volatile__("
- ldd [%0 + 0x00], %%g2
- ldd [%0 + 0x08], %%g4
- ldd [%0 + 0x10], %%o0
- ldd [%0 + 0x18], %%o2
- ldd [%1 + 0x00], %%o4
- ldd [%1 + 0x08], %%l0
- ldd [%1 + 0x10], %%l2
- ldd [%1 + 0x18], %%l4
- xor %%g2, %%o4, %%g2
- xor %%g3, %%o5, %%g3
- ldd [%2 + 0x00], %%o4
- xor %%g4, %%l0, %%g4
- xor %%g5, %%l1, %%g5
- ldd [%2 + 0x08], %%l0
- xor %%o0, %%l2, %%o0
- xor %%o1, %%l3, %%o1
- ldd [%2 + 0x10], %%l2
- xor %%o2, %%l4, %%o2
- xor %%o3, %%l5, %%o3
- ldd [%2 + 0x18], %%l4
- xor %%g2, %%o4, %%g2
- xor %%g3, %%o5, %%g3
- xor %%g4, %%l0, %%g4
- xor %%g5, %%l1, %%g5
- xor %%o0, %%l2, %%o0
- xor %%o1, %%l3, %%o1
- xor %%o2, %%l4, %%o2
- xor %%o3, %%l5, %%o3
- std %%g2, [%0 + 0x00]
- std %%g4, [%0 + 0x08]
- std %%o0, [%0 + 0x10]
- std %%o2, [%0 + 0x18]
- "
+ __asm__ __volatile__(
+ "ldd [%0 + 0x00], %%g2\n\t"
+ "ldd [%0 + 0x08], %%g4\n\t"
+ "ldd [%0 + 0x10], %%o0\n\t"
+ "ldd [%0 + 0x18], %%o2\n\t"
+ "ldd [%1 + 0x00], %%o4\n\t"
+ "ldd [%1 + 0x08], %%l0\n\t"
+ "ldd [%1 + 0x10], %%l2\n\t"
+ "ldd [%1 + 0x18], %%l4\n\t"
+ "xor %%g2, %%o4, %%g2\n\t"
+ "xor %%g3, %%o5, %%g3\n\t"
+ "ldd [%2 + 0x00], %%o4\n\t"
+ "xor %%g4, %%l0, %%g4\n\t"
+ "xor %%g5, %%l1, %%g5\n\t"
+ "ldd [%2 + 0x08], %%l0\n\t"
+ "xor %%o0, %%l2, %%o0\n\t"
+ "xor %%o1, %%l3, %%o1\n\t"
+ "ldd [%2 + 0x10], %%l2\n\t"
+ "xor %%o2, %%l4, %%o2\n\t"
+ "xor %%o3, %%l5, %%o3\n\t"
+ "ldd [%2 + 0x18], %%l4\n\t"
+ "xor %%g2, %%o4, %%g2\n\t"
+ "xor %%g3, %%o5, %%g3\n\t"
+ "xor %%g4, %%l0, %%g4\n\t"
+ "xor %%g5, %%l1, %%g5\n\t"
+ "xor %%o0, %%l2, %%o0\n\t"
+ "xor %%o1, %%l3, %%o1\n\t"
+ "xor %%o2, %%l4, %%o2\n\t"
+ "xor %%o3, %%l5, %%o3\n\t"
+ "std %%g2, [%0 + 0x00]\n\t"
+ "std %%g4, [%0 + 0x08]\n\t"
+ "std %%o0, [%0 + 0x10]\n\t"
+ "std %%o2, [%0 + 0x18]\n"
X :
X : "r" (p1), "r" (p2), "r" (p3)
X : "g2", "g3", "g4", "g5",
@@ -117,52 +115,51 @@
X int lines = bytes / (sizeof (long)) / 8;
X
X do {
- __asm__ __volatile__("
- ldd [%0 + 0x00], %%g2
- ldd [%0 + 0x08], %%g4
- ldd [%0 + 0x10], %%o0
- ldd [%0 + 0x18], %%o2
- ldd [%1 + 0x00], %%o4
- ldd [%1 + 0x08], %%l0
- ldd [%1 + 0x10], %%l2
- ldd [%1 + 0x18], %%l4
- xor %%g2, %%o4, %%g2
- xor %%g3, %%o5, %%g3
- ldd [%2 + 0x00], %%o4
- xor %%g4, %%l0, %%g4
- xor %%g5, %%l1, %%g5
- ldd [%2 + 0x08], %%l0
- xor %%o0, %%l2, %%o0
- xor %%o1, %%l3, %%o1
- ldd [%2 + 0x10], %%l2
- xor %%o2, %%l4, %%o2
- xor %%o3, %%l5, %%o3
- ldd [%2 + 0x18], %%l4
- xor %%g2, %%o4, %%g2
- xor %%g3, %%o5, %%g3
- ldd [%3 + 0x00], %%o4
- xor %%g4, %%l0, %%g4
- xor %%g5, %%l1, %%g5
- ldd [%3 + 0x08], %%l0
- xor %%o0, %%l2, %%o0
- xor %%o1, %%l3, %%o1
- ldd [%3 + 0x10], %%l2
- xor %%o2, %%l4, %%o2
- xor %%o3, %%l5, %%o3
- ldd [%3 + 0x18], %%l4
- xor %%g2, %%o4, %%g2
- xor %%g3, %%o5, %%g3
- xor %%g4, %%l0, %%g4
- xor %%g5, %%l1, %%g5
- xor %%o0, %%l2, %%o0
- xor %%o1, %%l3, %%o1
- xor %%o2, %%l4, %%o2
- xor %%o3, %%l5, %%o3
- std %%g2, [%0 + 0x00]
- std %%g4, [%0 + 0x08]
- std %%o0, [%0 + 0x10]
- std %%o2, [%0 + 0x18]
- "
+ __asm__ __volatile__(
+ "ldd [%0 + 0x00], %%g2\n\t"
+ "ldd [%0 + 0x08], %%g4\n\t"
+ "ldd [%0 + 0x10], %%o0\n\t"
+ "ldd [%0 + 0x18], %%o2\n\t"
+ "ldd [%1 + 0x00], %%o4\n\t"
+ "ldd [%1 + 0x08], %%l0\n\t"
+ "ldd [%1 + 0x10], %%l2\n\t"
+ "ldd [%1 + 0x18], %%l4\n\t"
+ "xor %%g2, %%o4, %%g2\n\t"
+ "xor %%g3, %%o5, %%g3\n\t"
+ "ldd [%2 + 0x00], %%o4\n\t"
+ "xor %%g4, %%l0, %%g4\n\t"
+ "xor %%g5, %%l1, %%g5\n\t"
+ "ldd [%2 + 0x08], %%l0\n\t"
+ "xor %%o0, %%l2, %%o0\n\t"
+ "xor %%o1, %%l3, %%o1\n\t"
+ "ldd [%2 + 0x10], %%l2\n\t"
+ "xor %%o2, %%l4, %%o2\n\t"
+ "xor %%o3, %%l5, %%o3\n\t"
+ "ldd [%2 + 0x18], %%l4\n\t"
+ "xor %%g2, %%o4, %%g2\n\t"
+ "xor %%g3, %%o5, %%g3\n\t"
+ "ldd [%3 + 0x00], %%o4\n\t"
+ "xor %%g4, %%l0, %%g4\n\t"
+ "xor %%g5, %%l1, %%g5\n\t"
+ "ldd [%3 + 0x08], %%l0\n\t"
+ "xor %%o0, %%l2, %%o0\n\t"
+ "xor %%o1, %%l3, %%o1\n\t"
+ "ldd [%3 + 0x10], %%l2\n\t"
+ "xor %%o2, %%l4, %%o2\n\t"
+ "xor %%o3, %%l5, %%o3\n\t"
+ "ldd [%3 + 0x18], %%l4\n\t"
+ "xor %%g2, %%o4, %%g2\n\t"
+ "xor %%g3, %%o5, %%g3\n\t"
+ "xor %%g4, %%l0, %%g4\n\t"
+ "xor %%g5, %%l1, %%g5\n\t"
+ "xor %%o0, %%l2, %%o0\n\t"
+ "xor %%o1, %%l3, %%o1\n\t"
+ "xor %%o2, %%l4, %%o2\n\t"
+ "xor %%o3, %%l5, %%o3\n\t"
+ "std %%g2, [%0 + 0x00]\n\t"
+ "std %%g4, [%0 + 0x08]\n\t"
+ "std %%o0, [%0 + 0x10]\n\t"
+ "std %%o2, [%0 + 0x18]\n"
X :
X : "r" (p1), "r" (p2), "r" (p3), "r" (p4)
X : "g2", "g3", "g4", "g5",
@@ -182,64 +179,63 @@
X int lines = bytes / (sizeof (long)) / 8;
X
X do {
- __asm__ __volatile__("
- ldd [%0 + 0x00], %%g2
- ldd [%0 + 0x08], %%g4
- ldd [%0 + 0x10], %%o0
- ldd [%0 + 0x18], %%o2
- ldd [%1 + 0x00], %%o4
- ldd [%1 + 0x08], %%l0
- ldd [%1 + 0x10], %%l2
- ldd [%1 + 0x18], %%l4
- xor %%g2, %%o4, %%g2
- xor %%g3, %%o5, %%g3
- ldd [%2 + 0x00], %%o4
- xor %%g4, %%l0, %%g4
- xor %%g5, %%l1, %%g5
- ldd [%2 + 0x08], %%l0
- xor %%o0, %%l2, %%o0
- xor %%o1, %%l3, %%o1
- ldd [%2 + 0x10], %%l2
- xor %%o2, %%l4, %%o2
- xor %%o3, %%l5, %%o3
- ldd [%2 + 0x18], %%l4
- xor %%g2, %%o4, %%g2
- xor %%g3, %%o5, %%g3
- ldd [%3 + 0x00], %%o4
- xor %%g4, %%l0, %%g4
- xor %%g5, %%l1, %%g5
- ldd [%3 + 0x08], %%l0
- xor %%o0, %%l2, %%o0
- xor %%o1, %%l3, %%o1
- ldd [%3 + 0x10], %%l2
- xor %%o2, %%l4, %%o2
- xor %%o3, %%l5, %%o3
- ldd [%3 + 0x18], %%l4
- xor %%g2, %%o4, %%g2
- xor %%g3, %%o5, %%g3
- ldd [%4 + 0x00], %%o4
- xor %%g4, %%l0, %%g4
- xor %%g5, %%l1, %%g5
- ldd [%4 + 0x08], %%l0
- xor %%o0, %%l2, %%o0
- xor %%o1, %%l3, %%o1
- ldd [%4 + 0x10], %%l2
- xor %%o2, %%l4, %%o2
- xor %%o3, %%l5, %%o3
- ldd [%4 + 0x18], %%l4
- xor %%g2, %%o4, %%g2
- xor %%g3, %%o5, %%g3
- xor %%g4, %%l0, %%g4
- xor %%g5, %%l1, %%g5
- xor %%o0, %%l2, %%o0
- xor %%o1, %%l3, %%o1
- xor %%o2, %%l4, %%o2
- xor %%o3, %%l5, %%o3
- std %%g2, [%0 + 0x00]
- std %%g4, [%0 + 0x08]
- std %%o0, [%0 + 0x10]
- std %%o2, [%0 + 0x18]
- "
+ __asm__ __volatile__(
+ "ldd [%0 + 0x00], %%g2\n\t"
+ "ldd [%0 + 0x08], %%g4\n\t"
+ "ldd [%0 + 0x10], %%o0\n\t"
+ "ldd [%0 + 0x18], %%o2\n\t"
+ "ldd [%1 + 0x00], %%o4\n\t"
+ "ldd [%1 + 0x08], %%l0\n\t"
+ "ldd [%1 + 0x10], %%l2\n\t"
+ "ldd [%1 + 0x18], %%l4\n\t"
+ "xor %%g2, %%o4, %%g2\n\t"
+ "xor %%g3, %%o5, %%g3\n\t"
+ "ldd [%2 + 0x00], %%o4\n\t"
+ "xor %%g4, %%l0, %%g4\n\t"
+ "xor %%g5, %%l1, %%g5\n\t"
+ "ldd [%2 + 0x08], %%l0\n\t"
+ "xor %%o0, %%l2, %%o0\n\t"
+ "xor %%o1, %%l3, %%o1\n\t"
+ "ldd [%2 + 0x10], %%l2\n\t"
+ "xor %%o2, %%l4, %%o2\n\t"
+ "xor %%o3, %%l5, %%o3\n\t"
+ "ldd [%2 + 0x18], %%l4\n\t"
+ "xor %%g2, %%o4, %%g2\n\t"
+ "xor %%g3, %%o5, %%g3\n\t"
+ "ldd [%3 + 0x00], %%o4\n\t"
+ "xor %%g4, %%l0, %%g4\n\t"
+ "xor %%g5, %%l1, %%g5\n\t"
+ "ldd [%3 + 0x08], %%l0\n\t"
+ "xor %%o0, %%l2, %%o0\n\t"
+ "xor %%o1, %%l3, %%o1\n\t"
+ "ldd [%3 + 0x10], %%l2\n\t"
+ "xor %%o2, %%l4, %%o2\n\t"
+ "xor %%o3, %%l5, %%o3\n\t"
+ "ldd [%3 + 0x18], %%l4\n\t"
+ "xor %%g2, %%o4, %%g2\n\t"
+ "xor %%g3, %%o5, %%g3\n\t"
+ "ldd [%4 + 0x00], %%o4\n\t"
+ "xor %%g4, %%l0, %%g4\n\t"
+ "xor %%g5, %%l1, %%g5\n\t"
+ "ldd [%4 + 0x08], %%l0\n\t"
+ "xor %%o0, %%l2, %%o0\n\t"
+ "xor %%o1, %%l3, %%o1\n\t"
+ "ldd [%4 + 0x10], %%l2\n\t"
+ "xor %%o2, %%l4, %%o2\n\t"
+ "xor %%o3, %%l5, %%o3\n\t"
+ "ldd [%4 + 0x18], %%l4\n\t"
+ "xor %%g2, %%o4, %%g2\n\t"
+ "xor %%g3, %%o5, %%g3\n\t"
+ "xor %%g4, %%l0, %%g4\n\t"
+ "xor %%g5, %%l1, %%g5\n\t"
+ "xor %%o0, %%l2, %%o0\n\t"
+ "xor %%o1, %%l3, %%o1\n\t"
+ "xor %%o2, %%l4, %%o2\n\t"
+ "xor %%o3, %%l5, %%o3\n\t"
+ "std %%g2, [%0 + 0x00]\n\t"
+ "std %%g4, [%0 + 0x08]\n\t"
+ "std %%o0, [%0 + 0x10]\n\t"
+ "std %%o2, [%0 + 0x18]\n"
X :
X : "r" (p1), "r" (p2), "r" (p3), "r" (p4), "r" (p5)
X : "g2", "g3", "g4", "g5",
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc64/floppy.h linux/include/asm-sparc64/floppy.h
--- v2.4.13/linux/include/asm-sparc64/floppy.h Sun Sep 23 11:41:01 2001
+++ linux/include/asm-sparc64/floppy.h Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: floppy.h,v 1.31 2001/08/22 17:46:31 davem Exp $
+/* $Id: floppy.h,v 1.32 2001/10/26 17:59:36 davem Exp $
X * asm-sparc64/floppy.h: Sparc specific parts of the Floppy driver.
X *
X * Copyright (C) 1996 David S. Miller (da...@caip.rutgers.edu)
@@ -104,7 +104,6 @@
X #define FLOPPY1_TYPE sun_floppy_types[1]
X
X #define FDC1 ((unsigned long)sun_fdc)


-static int FDC2 = -1;

X
X #define N_FDC 1
X #define N_DRIVE 8

@@ -883,5 +882,7 @@
X
X return sun_floppy_types[0];
X }
+
+#define EXTRA_FLOPPY_PARAMS
X
X #endif /* !(__ASM_SPARC64_FLOPPY_H) */
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc64/pgalloc.h linux/include/asm-sparc64/pgalloc.h
--- v2.4.13/linux/include/asm-sparc64/pgalloc.h Tue Oct 23 22:48:53 2001
+++ linux/include/asm-sparc64/pgalloc.h Tue Oct 30 15:08:11 2001
@@ -1,4 +1,4 @@
-/* $Id: pgalloc.h,v 1.26 2001/10/18 09:06:37 davem Exp $ */
+/* $Id: pgalloc.h,v 1.29 2001/10/20 12:38:51 davem Exp $ */
X #ifndef _SPARC64_PGALLOC_H
X #define _SPARC64_PGALLOC_H
X
@@ -34,9 +34,9 @@
X extern void __flush_icache_page(unsigned long);
X extern void flush_dcache_page_impl(struct page *page);
X #ifdef CONFIG_SMP
-extern void smp_flush_dcache_page_impl(struct page *page);
+extern void smp_flush_dcache_page_impl(struct page *page, int cpu);
X #else
-#define smp_flush_dcache_page_impl flush_dcache_page_impl
+#define smp_flush_dcache_page_impl(page,cpu) flush_dcache_page_impl(page)
X #endif
X
X extern void flush_dcache_page(struct page *page);
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc64/pgtable.h linux/include/asm-sparc64/pgtable.h
--- v2.4.13/linux/include/asm-sparc64/pgtable.h Tue Oct 23 22:48:53 2001
+++ linux/include/asm-sparc64/pgtable.h Tue Oct 30 15:08:12 2001
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.147 2001/10/17 18:26:58 davem Exp $
+/* $Id: pgtable.h,v 1.151 2001/10/25 18:48:03 davem Exp $
X * pgtable.h: SpitFire page table operations.
X *
X * Copyright 1996,1997 David S. Miller (da...@caip.rutgers.edu)
@@ -46,31 +46,6 @@


X
X #ifndef __ASSEMBLY__
X

-#define PG_dcache_dirty PG_arch_1
-
-#define dcache_dirty_cpu(page) \
- (((page)->flags >> 24) & (NR_CPUS - 1UL))
-
-#define set_dcache_dirty(PAGE) \
-do { unsigned long mask = smp_processor_id(); \
- unsigned long non_cpu_bits = (1UL << 24UL) - 1UL; \
- mask = (mask << 24) | (1UL << PG_dcache_dirty); \
- __asm__ __volatile__("1:\n\t" \
- "ldx [%2], %%g7\n\t" \
- "and %%g7, %1, %%g5\n\t" \
- "or %%g5, %0, %%g5\n\t" \
- "casx [%2], %%g7, %%g5\n\t" \
- "cmp %%g7, %%g5\n\t" \
- "bne,pn %%xcc, 1b\n\t" \
- " nop" \
- : /* no outputs */ \
- : "r" (mask), "r" (non_cpu_bits), "r" (&(PAGE)->flags) \
- : "g5", "g7"); \
-} while (0)
-
-#define clear_dcache_dirty(PAGE) \
- clear_bit(PG_dcache_dirty, &(PAGE)->flags)
-
X /* Certain architectures need to do special things when pte's
X * within a page table are directly modified. Thus, the following
X * hook is made available.
@@ -106,6 +81,8 @@
X #define VMALLOC_START 0x0000000140000000UL
X #define VMALLOC_VMADDR(x) ((unsigned long)(x))
X #define VMALLOC_END 0x0000000200000000UL
+#define LOW_OBP_ADDRESS 0xf0000000UL
+#define HI_OBP_ADDRESS 0x100000000UL
X
X #define pte_ERROR(e) __builtin_trap()
X #define pmd_ERROR(e) __builtin_trap()
@@ -312,6 +289,10 @@


X #define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
X #define swp_entry_to_pte(x) ((pte_t) { (x).val })
X

+extern unsigned long prom_virt_to_phys(unsigned long, int *);
+#define LOW_OBP_ADDRESS 0xf0000000UL
+#define HI_OBP_ADDRESS 0x100000000UL
+
X extern __inline__ unsigned long
X sun4u_get_pte (unsigned long addr)
X {
@@ -321,6 +302,8 @@
X
X if (addr >= PAGE_OFFSET)
X return addr & _PAGE_PADDR;
+ if ((addr >= LOW_OBP_ADDRESS) && (addr < HI_OBP_ADDRESS))
+ return prom_virt_to_phys(addr, 0);
X pgdp = pgd_offset_k (addr);
X pmdp = pmd_offset (pgdp, addr);
X ptep = pte_offset (pmdp, addr);
diff -u --recursive --new-file v2.4.13/linux/include/asm-sparc64/xor.h linux/include/asm-sparc64/xor.h
--- v2.4.13/linux/include/asm-sparc64/xor.h Sun Nov 12 19:39:51 2000
+++ linux/include/asm-sparc64/xor.h Sun Nov 4 09:31:57 2001
@@ -52,8 +52,8 @@
X .globl xor_vis_2
X .type xor_vis_2,@function
X xor_vis_2:
- rd %fprs, %g1
- andcc %g1, FPRS_FEF|FPRS_DU, %g0
+ rd %fprs, %o5
+ andcc %o5, FPRS_FEF|FPRS_DU, %g0
X be,pt %icc, 0f
X sethi %hi(VISenter), %g1
X jmpl %g1 + %lo(VISenter), %g7
@@ -124,8 +124,8 @@
X .globl xor_vis_3
X .type xor_vis_3,@function
X xor_vis_3:
- rd %fprs, %g1
- andcc %g1, FPRS_FEF|FPRS_DU, %g0
+ rd %fprs, %o5
+ andcc %o5, FPRS_FEF|FPRS_DU, %g0
X be,pt %icc, 0f
X sethi %hi(VISenter), %g1
X jmpl %g1 + %lo(VISenter), %g7
@@ -193,8 +193,8 @@
X .globl xor_vis_4
X .type xor_vis_4,@function
X xor_vis_4:
- rd %fprs, %g1
- andcc %g1, FPRS_FEF|FPRS_DU, %g0
+ rd %fprs, %o5
+ andcc %o5, FPRS_FEF|FPRS_DU, %g0
X be,pt %icc, 0f
X sethi %hi(VISenter), %g1
X jmpl %g1 + %lo(VISenter), %g7
@@ -281,13 +281,15 @@
X .globl xor_vis_5
X .type xor_vis_5,@function
X xor_vis_5:
- rd %fprs, %g1
- andcc %g1, FPRS_FEF|FPRS_DU, %g0
+ mov %o5, %g5
+ rd %fprs, %o5
+ andcc %o5, FPRS_FEF|FPRS_DU, %g0
X be,pt %icc, 0f
X sethi %hi(VISenter), %g1
X jmpl %g1 + %lo(VISenter), %g7
X add %g7, 8, %g7
X 0: wr %g0, FPRS_FEF, %fprs
+ mov %g5, %o5
X rd %asi, %g1
X wr %g0, ASI_BLK_P, %asi
X membar #LoadStore|#StoreLoad|#StoreStore
diff -u --recursive --new-file v2.4.13/linux/include/linux/blkdev.h linux/include/linux/blkdev.h
--- v2.4.13/linux/include/linux/blkdev.h Tue Oct 23 22:48:53 2001
+++ linux/include/linux/blkdev.h Mon Nov 5 12:42:57 2001
@@ -66,14 +66,17 @@
X */
X #define QUEUE_NR_REQUESTS 8192
X
+struct request_list {
+ unsigned int count;
+ struct list_head free;
+};
+
X struct request_queue
X {
X /*
X * the queue request freelist, one for reads and one for writes
X */
- struct list_head request_freelist[2];
- struct list_head pending_freelist[2];
- int pending_free[2];
+ struct request_list rq[2];
X
X /*
X * Together with queue_head for cacheline sharing
diff -u --recursive --new-file v2.4.13/linux/include/linux/cdrom.h linux/include/linux/cdrom.h
--- v2.4.13/linux/include/linux/cdrom.h Thu Oct 18 13:49:34 2001
+++ linux/include/linux/cdrom.h Mon Nov 5 12:42:55 2001
@@ -777,10 +777,25 @@
X };
X
X /* the general block_device operations structure: */
-extern struct block_device_operations cdrom_fops;
+extern int cdrom_open(struct inode *, struct file *);
+extern int cdrom_release(struct inode *, struct file *);
+extern int cdrom_ioctl(struct inode *, struct file *, unsigned, unsigned long);
+extern int cdrom_media_changed(kdev_t);
X
X extern int register_cdrom(struct cdrom_device_info *cdi);
X extern int unregister_cdrom(struct cdrom_device_info *cdi);
+
+static inline void devfs_plain_cdrom(struct cdrom_device_info *cdi,
+ struct block_device_operations *ops)
+{
+ char vname[23];
+
+ sprintf (vname, "cdroms/cdrom%d", cdi->number);
+ cdi->de = devfs_register (NULL, vname, DEVFS_FL_DEFAULT,
+ MAJOR (cdi->dev), MINOR (cdi->dev),
+ S_IFBLK | S_IRUGO | S_IWUGO,
+ ops, NULL);
+}
X
X typedef struct {
X int data;
diff -u --recursive --new-file v2.4.13/linux/include/linux/fs.h linux/include/linux/fs.h
--- v2.4.13/linux/include/linux/fs.h Tue Oct 23 22:48:53 2001
+++ linux/include/linux/fs.h Mon Nov 5 12:42:14 2001
@@ -793,6 +793,7 @@
X int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long);
X int (*check_media_change) (kdev_t);
X int (*revalidate) (kdev_t);
+ struct module *owner;
X };
X
X /*
diff -u --recursive --new-file v2.4.13/linux/include/linux/i8k.h linux/include/linux/i8k.h
--- v2.4.13/linux/include/linux/i8k.h Wed Dec 31 16:00:00 1969
+++ linux/include/linux/i8k.h Fri Nov 2 17:46:47 2001
@@ -0,0 +1,46 @@
+/*
+ * i8k.h -- Linux driver for accessing the SMM BIOS on Dell I8000 laptops
+ *


+ * Copyright (C) 2001 Massimo Dal Zotto <d...@debian.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, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef _LINUX_I8K_H
+#define _LINUX_I8K_H
+
+#define I8K_PROC "/proc/i8k"
+#define I8K_PROC_FMT "1.0"
+
+#define I8K_BIOS_VERSION _IOR ('i', 0x80, 4)
+#define I8K_MACHINE_ID _IOR ('i', 0x81, 16)
+#define I8K_POWER_STATUS _IOR ('i', 0x82, sizeof(int))
+#define I8K_FN_STATUS _IOR ('i', 0x83, sizeof(int))
+#define I8K_GET_TEMP _IOR ('i', 0x84, sizeof(int))
+#define I8K_GET_SPEED _IOWR('i', 0x85, sizeof(int))
+#define I8K_GET_FAN _IOWR('i', 0x86, sizeof(int))
+#define I8K_SET_FAN _IOWR('i', 0x87, sizeof(int)*2)
+
+#define I8K_FAN_LEFT 1
+#define I8K_FAN_RIGHT 0
+#define I8K_FAN_OFF 0
+#define I8K_FAN_LOW 1
+#define I8K_FAN_HIGH 2
+#define I8K_FAN_MAX I8K_FAN_HIGH
+
+#define I8K_VOL_UP 0x01
+#define I8K_VOL_DOWN 0x02
+#define I8K_VOL_MUTE 0x03
+
+#define I8K_AC 1
+#define I8K_BATTERY 0
+
+#endif
diff -u --recursive --new-file v2.4.13/linux/include/linux/if.h linux/include/linux/if.h
--- v2.4.13/linux/include/linux/if.h Thu Oct 18 13:47:38 2001
+++ linux/include/linux/if.h Mon Nov 5 12:43:02 2001
@@ -22,7 +22,7 @@
X #include <linux/types.h> /* for "__kernel_caddr_t" et al */
X #include <linux/socket.h> /* for "struct sockaddr" et al */
X
-/* Standard interface flags. */
+/* Standard interface flags (netdevice->flags). */
X #define IFF_UP 0x1 /* interface is up */
X #define IFF_BROADCAST 0x2 /* broadcast address valid */
X #define IFF_DEBUG 0x4 /* turn on debugging */
@@ -44,6 +44,9 @@
X #define IFF_PORTSEL 0x2000 /* can set media type */
X #define IFF_AUTOMEDIA 0x4000 /* auto media select active */
X #define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/
+
+/* Private (from user) interface flags (netdevice->priv_flags). */
+#define IFF_802_1Q_VLAN 0x1 /* 802.1Q VLAN device. */
X
X /*
X * Device mapping structure. I'd just gone off and designed a
diff -u --recursive --new-file v2.4.13/linux/include/linux/if_arp.h linux/include/linux/if_arp.h
--- v2.4.13/linux/include/linux/if_arp.h Thu Oct 18 13:48:02 2001
+++ linux/include/linux/if_arp.h Mon Nov 5 12:43:05 2001
@@ -39,6 +39,7 @@
X #define ARPHRD_ATM 19 /* ATM */
X #define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */
X #define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */
+#define ARPHRD_EUI64 27 /* EUI-64 */
X
X /* Dummy types for non ARP hardware */
X #define ARPHRD_SLIP 256
diff -u --recursive --new-file v2.4.13/linux/include/linux/if_ether.h linux/include/linux/if_ether.h
--- v2.4.13/linux/include/linux/if_ether.h Thu Apr 19 08:38:50 2001
+++ linux/include/linux/if_ether.h Tue Oct 30 15:08:12 2001
@@ -56,6 +56,7 @@
X #define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
X #define ETH_P_ATALK 0x809B /* Appletalk DDP */
X #define ETH_P_AARP 0x80F3 /* Appletalk AARP */
+#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
X #define ETH_P_IPX 0x8137 /* IPX over DIX */
X #define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
X #define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
diff -u --recursive --new-file v2.4.13/linux/include/linux/if_vlan.h linux/include/linux/if_vlan.h
--- v2.4.13/linux/include/linux/if_vlan.h Wed Dec 31 16:00:00 1969
+++ linux/include/linux/if_vlan.h Mon Nov 5 12:45:19 2001
@@ -0,0 +1,265 @@
+/*
+ * VLAN An implementation of 802.1Q VLAN tagging.
+ *
+ * Authors: Ben Greear <gre...@candelatech.com>
+ *


+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.


+ *
+ */
+

+#ifndef _LINUX_IF_VLAN_H_
+#define _LINUX_IF_VLAN_H_
+
+#ifdef __KERNEL__
+
+/* externally defined structs */
+struct vlan_group;
+struct net_device;
+struct sk_buff;
+struct packet_type;
+struct vlan_collection;
+struct vlan_dev_info;
+
+#include <linux/proc_fs.h> /* for proc_dir_entry */
+#include <linux/netdevice.h>
+
+#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header)
+ * that VLAN requires.
+ */
+#define VLAN_ETH_ALEN 6 /* Octets in one ethernet addr */
+#define VLAN_ETH_HLEN 18 /* Total octets in header. */
+#define VLAN_ETH_ZLEN 64 /* Min. octets in frame sans FCS */
+
+/*
+ * According to 802.3ac, the packet can be 4 bytes longer. --Klika Jan
+ */
+#define VLAN_ETH_DATA_LEN 1500 /* Max. octets in payload */
+#define VLAN_ETH_FRAME_LEN 1518 /* Max. octets in frame sans FCS */
+
+struct vlan_ethhdr {
+ unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
+ unsigned char h_source[ETH_ALEN]; /* source ether addr */
+ unsigned short h_vlan_proto; /* Should always be 0x8100 */
+ unsigned short h_vlan_TCI; /* Encapsulates priority and VLAN ID */
+ unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */
+};
+
+struct vlan_hdr {
+ unsigned short h_vlan_TCI; /* Encapsulates priority and VLAN ID */
+ unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */
+};
+
+/* Find a VLAN device by the MAC address of it's Ethernet device, and
+ * it's VLAN ID. The default configuration is to have VLAN's scope
+ * to be box-wide, so the MAC will be ignored. The mac will only be
+ * looked at if we are configured to have a seperate set of VLANs per
+ * each MAC addressable interface. Note that this latter option does
+ * NOT follow the spec for VLANs, but may be useful for doing very
+ * large quantities of VLAN MUX/DEMUX onto FrameRelay or ATM PVCs.
+ */
+struct net_device *find_802_1Q_vlan_dev(struct net_device* real_dev,
+ unsigned short VID); /* vlan.c */
+
+/* found in af_inet.c */
+extern int (*vlan_ioctl_hook)(unsigned long arg);
+
+/* found in vlan_dev.c */
+struct net_device_stats* vlan_dev_get_stats(struct net_device* dev);
+int vlan_dev_rebuild_header(struct sk_buff *skb);
+int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
+ struct packet_type* ptype);
+int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
+ unsigned short type, void *daddr, void *saddr,
+ unsigned len);
+int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
+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_init(struct net_device* dev);
+void vlan_dev_destruct(struct net_device* dev);
+void vlan_dev_copy_and_sum(struct sk_buff *dest, unsigned char *src,
+ int length, int base);
+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);
+
+/* VLAN multicast stuff */
+/* Delete all of the MC list entries from this vlan device. Also deals
+ * with the underlying device...
+ */
+void vlan_flush_mc_list(struct net_device* dev);
+/* copy the mc_list into the vlan_info structure. */
+void vlan_copy_mc_list(struct dev_mc_list* mc_list, struct vlan_dev_info* vlan_info);
+/** dmi is a single entry into a dev_mc_list, a single node. mc_list is
+ * an entire list, and we'll iterate through it.
+ */
+int vlan_should_add_mc(struct dev_mc_list *dmi, struct dev_mc_list *mc_list);
+/** Taken from Gleb + Lennert's VLAN code, and modified... */
+void vlan_dev_set_multicast_list(struct net_device *vlan_dev);
+
+int vlan_collection_add_vlan(struct vlan_collection* vc, unsigned short vlan_id,
+ unsigned short flags);
+int vlan_collection_remove_vlan(struct vlan_collection* vc,
+ struct net_device* vlan_dev);
+int vlan_collection_remove_vlan_id(struct vlan_collection* vc, unsigned short vlan_id);
+
+/* found in vlan.c */
+/* Our listing of VLAN group(s) */
+extern struct vlan_group* p802_1Q_vlan_list;
+
+#define VLAN_NAME "vlan"
+
+/* if this changes, algorithm will have to be reworked because this
+ * depends on completely exhausting the VLAN identifier space. Thus
+ * it gives constant time look-up, but it many cases it wastes memory.
+ */
+#define VLAN_GROUP_ARRAY_LEN 4096
+
+struct vlan_group {
+ int real_dev_ifindex; /* The ifindex of the ethernet(like) device the vlan is attached to. */
+ struct net_device *vlan_devices[VLAN_GROUP_ARRAY_LEN];
+
+ struct vlan_group *next; /* the next in the list */
+};
+
+struct vlan_priority_tci_mapping {
+ unsigned long priority;
+ unsigned short vlan_qos; /* This should be shifted when first set, so we only do it
+ * at provisioning time.
+ * ((skb->priority << 13) & 0xE000)
+ */
+ struct vlan_priority_tci_mapping *next;
+};
+
+/* Holds information that makes sense if this device is a VLAN device. */
+struct vlan_dev_info {
+ /** This will be the mapping that correlates skb->priority to
+ * 3 bits of VLAN QOS tags...
+ */
+ unsigned long ingress_priority_map[8];
+ struct vlan_priority_tci_mapping *egress_priority_map[16]; /* hash table */
+
+ unsigned short vlan_id; /* The VLAN Identifier for this interface. */
+ unsigned short flags; /* (1 << 0) re_order_header This option will cause the
+ * VLAN code to move around the ethernet header on
+ * ingress to make the skb look **exactly** like it
+ * came in from an ethernet port. This destroys some of
+ * the VLAN information in the skb, but it fixes programs
+ * like DHCP that use packet-filtering and don't understand
+ * 802.1Q
+ */
+ struct dev_mc_list *old_mc_list; /* old multi-cast list for the VLAN interface..
+ * we save this so we can tell what changes were
+ * made, in order to feed the right changes down
+ * to the real hardware...
+ */
+ int old_allmulti; /* similar to above. */
+ int old_promiscuity; /* similar to above. */
+ struct net_device *real_dev; /* the underlying device/interface */
+ struct proc_dir_entry *dent; /* Holds the proc data */
+ unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */
+ unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */
+ struct net_device_stats dev_stats; /* Device stats (rx-bytes, tx-pkts, etc...) */
+};
+
+#define VLAN_DEV_INFO(x) ((struct vlan_dev_info *)(x->priv))
+
+/* inline functions */
+
+/* Used in vlan_skb_recv */
+static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
+{
+ if (VLAN_DEV_INFO(skb->dev)->flags & 1) {
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (skb) {
+ /* Lifted from Gleb's VLAN code... */
+ memmove(skb->data - ETH_HLEN,
+ skb->data - VLAN_ETH_HLEN, 12);
+ skb->mac.raw += VLAN_HLEN;
+ }
+ }
+
+ return skb;
+}
+
+static inline unsigned short vlan_dev_get_egress_qos_mask(struct net_device* dev,
+ struct sk_buff* skb)
+{
+ struct vlan_priority_tci_mapping *mp =
+ VLAN_DEV_INFO(dev)->egress_priority_map[(skb->priority & 0xF)];
+
+ while (mp) {
+ if (mp->priority == skb->priority) {
+ return mp->vlan_qos; /* This should already be shifted to mask
+ * correctly with the VLAN's TCI
+ */
+ }
+ mp = mp->next;
+ }


+ return 0;
+}
+

+static inline int vlan_dmi_equals(struct dev_mc_list *dmi1,
+ struct dev_mc_list *dmi2)
+{
+ return ((dmi1->dmi_addrlen == dmi2->dmi_addrlen) &&
+ (memcmp(dmi1->dmi_addr, dmi2->dmi_addr, dmi1->dmi_addrlen) == 0));
+}
+
+static inline void vlan_destroy_mc_list(struct dev_mc_list *mc_list)
+{
+ struct dev_mc_list *dmi = mc_list;
+ struct dev_mc_list *next;
+
+ while(dmi) {
+ next = dmi->next;
+ kfree(dmi);
+ dmi = next;
+ }
+}
+


+#endif /* __KERNEL__ */
+

+/* VLAN IOCTLs are found in sockios.h */
+
+/* Passed in vlan_ioctl_args structure to determine behaviour. */
+enum vlan_ioctl_cmds {
+ ADD_VLAN_CMD,
+ DEL_VLAN_CMD,
+ SET_VLAN_INGRESS_PRIORITY_CMD,
+ SET_VLAN_EGRESS_PRIORITY_CMD,
+ GET_VLAN_INGRESS_PRIORITY_CMD,
+ GET_VLAN_EGRESS_PRIORITY_CMD,
+ SET_VLAN_NAME_TYPE_CMD,
+ SET_VLAN_FLAG_CMD
+};
+
+enum vlan_name_types {
+ VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
+ VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
+ VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like: vlan5 */
+ VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like: eth0.5 */
+ VLAN_NAME_TYPE_HIGHEST
+};
+
+struct vlan_ioctl_args {
+ int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
+ char device1[24];
+
+ union {
+ char device2[24];
+ int VID;
+ unsigned int skb_priority;
+ unsigned int name_type;
+ unsigned int bind_type;
+ unsigned int flag; /* Matches vlan_dev_info flags */
+ } u;
+
+ short vlan_qos;
+};
+
+#endif /* !(_LINUX_IF_VLAN_H_) */
diff -u --recursive --new-file v2.4.13/linux/include/linux/iso_fs.h linux/include/linux/iso_fs.h
--- v2.4.13/linux/include/linux/iso_fs.h Thu Oct 18 13:48:52 2001
+++ linux/include/linux/iso_fs.h Mon Nov 5 12:42:52 2001
@@ -136,7 +136,7 @@
X char extent[4]; /* 731 */
X char parent[2]; /* 721 */
X char name[0];
-};
+} __attribute__((packed));
X
X /* high sierra is identical to iso, except that the date is only 6 bytes, and
X there is an extra reserved byte after the flags */
@@ -153,7 +153,7 @@
X char volume_sequence_number [ISODCL (29, 32)]; /* 723 */


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 51'
echo 'File patch-2.4.14 is continued in part 52'
echo "52" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:15 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part52

#!/bin/sh -x
# this is part 52 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 52; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

X unsigned char name_len [ISODCL (33, 33)]; /* 711 */


X char name [0];
-};
+} __attribute__((packed));
X

X #define ISOFS_BLOCK_BITS 11
X #define ISOFS_BLOCK_SIZE 2048
@@ -207,6 +207,8 @@
X }
X extern int iso_date(char *, int);
X
+struct inode; /* To make gcc happy */
+
X extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *);
X extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *);
X extern int isofs_name_translate(struct iso_directory_record *, char *, struct inode *);
@@ -218,6 +220,7 @@
X
X extern struct dentry *isofs_lookup(struct inode *, struct dentry *);
X extern struct buffer_head *isofs_bread(struct inode *, unsigned int, unsigned int);
+extern int isofs_get_blocks(struct inode *, long, struct buffer_head **, unsigned long);
X
X extern struct inode_operations isofs_dir_inode_operations;
X extern struct file_operations isofs_dir_operations;
diff -u --recursive --new-file v2.4.13/linux/include/linux/iso_fs_i.h linux/include/linux/iso_fs_i.h
--- v2.4.13/linux/include/linux/iso_fs_i.h Sat Feb 21 13:19:29 1998
+++ linux/include/linux/iso_fs_i.h Thu Oct 25 18:00:44 2001
@@ -1,12 +1,19 @@
X #ifndef _ISO_FS_I
X #define _ISO_FS_I
X
+enum isofs_file_format {
+ isofs_file_normal = 0,
+ isofs_file_sparse = 1,
+ isofs_file_compressed = 2,
+};
+
X /*
X * iso fs inode data in memory
X */
X struct iso_inode_info {
X unsigned int i_first_extent;
X unsigned char i_file_format;
+ unsigned char i_format_parm[3];
X unsigned long i_next_section_ino;
X off_t i_section_size;
X };
diff -u --recursive --new-file v2.4.13/linux/include/linux/iso_fs_sb.h linux/include/linux/iso_fs_sb.h
--- v2.4.13/linux/include/linux/iso_fs_sb.h Mon Aug 27 12:41:48 2001
+++ linux/include/linux/iso_fs_sb.h Thu Oct 25 18:01:00 2001
@@ -23,6 +23,8 @@
X unsigned char s_unhide;
X unsigned char s_nosuid;
X unsigned char s_nodev;
+ unsigned char s_nocompress;
+
X mode_t s_mode;
X gid_t s_gid;
X uid_t s_uid;
diff -u --recursive --new-file v2.4.13/linux/include/linux/lp.h linux/include/linux/lp.h
--- v2.4.13/linux/include/linux/lp.h Wed Feb 16 08:55:54 2000
+++ linux/include/linux/lp.h Thu Oct 25 00:07:39 2001
@@ -145,6 +145,9 @@
X struct semaphore port_mutex;
X wait_queue_head_t dataq;
X long timeout;
+ unsigned int best_mode;
+ unsigned int current_mode;
+ unsigned long bits;
X };
X
X /*
diff -u --recursive --new-file v2.4.13/linux/include/linux/mm.h linux/include/linux/mm.h
--- v2.4.13/linux/include/linux/mm.h Tue Oct 23 22:48:53 2001
+++ linux/include/linux/mm.h Mon Nov 5 12:42:15 2001
@@ -125,7 +125,7 @@
X struct vm_operations_struct {
X void (*open)(struct vm_area_struct * area);
X void (*close)(struct vm_area_struct * area);
- struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int write_access);
+ struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int unused);
X };
X
X /*
@@ -270,7 +270,7 @@
X #define PG_referenced 2
X #define PG_uptodate 3
X #define PG_dirty 4
-#define PG_decr_after 5
+#define PG_unused 5
X #define PG_active 6
X #define PG_inactive 7
X #define PG_slab 8
@@ -282,6 +282,7 @@
X #define PG_launder 15 /* written out by VM pressure.. */
X
X /* Make it prettier to test the above... */
+#define UnlockPage(page) unlock_page(page)
X #define Page_Uptodate(page) test_bit(PG_uptodate, &(page)->flags)
X #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags)
X #define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags)
@@ -296,13 +297,7 @@
X #define PageLaunder(page) test_bit(PG_launder, &(page)->flags)
X #define SetPageLaunder(page) set_bit(PG_launder, &(page)->flags)
X
-extern void __set_page_dirty(struct page *);
-
-static inline void set_page_dirty(struct page * page)
-{
- if (!test_and_set_bit(PG_dirty, &page->flags))
- __set_page_dirty(page);
-}
+extern void FASTCALL(set_page_dirty(struct page *));
X
X /*
X * The first mb is necessary to safely close the critical section opened by the
@@ -310,14 +305,6 @@
X * the clear_bit and the read of the waitqueue (to avoid SMP races with a
X * parallel wait_on_page).
X */
-#define UnlockPage(page) do { \
- clear_bit(PG_launder, &(page)->flags); \
- smp_mb__before_clear_bit(); \
- if (!test_and_clear_bit(PG_locked, &(page)->flags)) BUG(); \
- smp_mb__after_clear_bit(); \
- if (waitqueue_active(&(page)->wait)) \
- wake_up(&(page)->wait); \
- } while (0)
X #define PageError(page) test_bit(PG_error, &(page)->flags)
X #define SetPageError(page) set_bit(PG_error, &(page)->flags)
X #define ClearPageError(page) clear_bit(PG_error, &(page)->flags)
@@ -325,9 +312,6 @@
X #define SetPageReferenced(page) set_bit(PG_referenced, &(page)->flags)
X #define ClearPageReferenced(page) clear_bit(PG_referenced, &(page)->flags)
X #define PageTestandClearReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags)
-#define PageDecrAfter(page) test_bit(PG_decr_after, &(page)->flags)
-#define SetPageDecrAfter(page) set_bit(PG_decr_after, &(page)->flags)
-#define PageTestandClearDecrAfter(page) test_and_clear_bit(PG_decr_after, &(page)->flags)
X #define PageSlab(page) test_bit(PG_slab, &(page)->flags)
X #define PageSetSlab(page) set_bit(PG_slab, &(page)->flags)
X #define PageClearSlab(page) clear_bit(PG_slab, &(page)->flags)
@@ -413,7 +397,8 @@
X
X extern void clear_page_tables(struct mm_struct *, unsigned long, int);
X
-struct page * shmem_nopage(struct vm_area_struct * vma, unsigned long address, int no_share);
+extern int fail_writepage(struct page *);
+struct page * shmem_nopage(struct vm_area_struct * vma, unsigned long address, int unused);
X struct file *shmem_file_setup(char * name, loff_t size);
X extern void shmem_lock(struct file * file, int lock);
X extern int shmem_zero_setup(struct vm_area_struct *);
@@ -467,20 +452,8 @@
X return page_count(page) - !!page->buffers == 1;
X }
X
-/*
- * Work out if there are any other processes sharing this
- * swap cache page. Never mind the buffers.
- */
-static inline int exclusive_swap_page(struct page *page)
-{
- if (!PageLocked(page))
- BUG();
- if (!PageSwapCache(page))
- return 0;
- if (page_count(page) - !!page->buffers != 2) /* 2: us + cache */
- return 0;
- return swap_count(page) == 1; /* 1: just cache */
-}
+extern int can_share_swap_page(struct page *);
+extern int remove_exclusive_swap_page(struct page *);
X
X extern void __free_pte(pte_t);
X
diff -u --recursive --new-file v2.4.13/linux/include/linux/netdevice.h linux/include/linux/netdevice.h
--- v2.4.13/linux/include/linux/netdevice.h Thu Oct 18 13:48:02 2001
+++ linux/include/linux/netdevice.h Mon Nov 5 12:43:03 2001
@@ -183,7 +183,10 @@
X {
X struct hh_cache *hh_next; /* Next entry */
X atomic_t hh_refcnt; /* number of users */
- unsigned short hh_type; /* protocol identifier, f.e ETH_P_IP */
+ unsigned short hh_type; /* protocol identifier, f.e ETH_P_IP
+ * NOTE: For VLANs, this will be the
+ * encapuslated type. --BLG
+ */
X int hh_len; /* length of header */
X int (*hh_output)(struct sk_buff *skb);
X rwlock_t hh_lock;
@@ -287,6 +290,11 @@
X
X unsigned short flags; /* interface flags (a la BSD) */
X unsigned short gflags;
+ unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */
+ unsigned short unused_alignment_fixer; /* Because we need priv_flags,
+ * and we want to be 32-bit aligned.
+ */
+
X unsigned mtu; /* interface MTU value */
X unsigned short type; /* interface hardware type */
X unsigned short hard_header_len; /* hardware hdr length */
diff -u --recursive --new-file v2.4.13/linux/include/linux/netfilter_ipv4/ip_conntrack.h linux/include/linux/netfilter_ipv4/ip_conntrack.h
--- v2.4.13/linux/include/linux/netfilter_ipv4/ip_conntrack.h Fri Apr 27 14:15:01 2001
+++ linux/include/linux/netfilter_ipv4/ip_conntrack.h Tue Oct 30 15:08:12 2001
@@ -83,6 +83,10 @@
X
X #include <linux/netfilter_ipv4/ip_conntrack_ftp.h>
X
+#if defined(CONFIG_IP_NF_IRC) || defined(CONFIG_IP_NF_IRC_MODULE)
+#include <linux/netfilter_ipv4/ip_conntrack_irc.h>
+#endif
+
X struct ip_conntrack
X {
X /* Usage count in here is 1 for hash table/destruct timer, 1 per skb,
@@ -121,6 +125,9 @@
X
X union {
X struct ip_ct_ftp ct_ftp_info;
+#if defined(CONFIG_IP_NF_IRC) || defined(CONFIG_IP_NF_IRC_MODULE)
+ struct ip_ct_irc ct_irc_info;
+#endif
X } help;
X
X #ifdef CONFIG_IP_NF_NAT_NEEDED
diff -u --recursive --new-file v2.4.13/linux/include/linux/netfilter_ipv4/ip_conntrack_irc.h linux/include/linux/netfilter_ipv4/ip_conntrack_irc.h
--- v2.4.13/linux/include/linux/netfilter_ipv4/ip_conntrack_irc.h Wed Dec 31 16:00:00 1969
+++ linux/include/linux/netfilter_ipv4/ip_conntrack_irc.h Tue Oct 30 15:08:12 2001
@@ -0,0 +1,47 @@
+/* IRC extension for IP connection tracking.
+ * (C) 2000 by Harald Welte <laf...@gnumonks.org>
+ * based on RR's ip_conntrack_ftp.h
+ *
+ * ip_conntrack_irc.h,v 1.6 2000/11/07 18:26:42 laforge 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.
+ *
+ *

+ */
+#ifndef _IP_CONNTRACK_IRC_H
+#define _IP_CONNTRACK_IRC_H
+
+#ifndef __KERNEL__
+#error Only in kernel.
+#endif
+
+#include <linux/netfilter_ipv4/lockhelp.h>
+
+#define IP_CONNTR_IRC 2
+
+struct dccproto {
+ char* match;
+ int matchlen;
+};
+
+/* Protects irc part of conntracks */
+DECLARE_LOCK_EXTERN(ip_irc_lock);
+
+/* We record seq number and length of irc ip/port text here: all in
+ host order. */
+struct ip_ct_irc
+{
+ /* This tells NAT that this is an IRC connection */
+ int is_irc;
+ /* sequence number where address part of DCC command begins */
+ u_int32_t seq;
+ /* 0 means not found yet */
+ u_int32_t len;
+ /* Port that was to be used */
+ u_int16_t port;
+};
+
+#endif /* _IP_CONNTRACK_IRC_H */
diff -u --recursive --new-file v2.4.13/linux/include/linux/netfilter_ipv4/ipt_length.h linux/include/linux/netfilter_ipv4/ipt_length.h
--- v2.4.13/linux/include/linux/netfilter_ipv4/ipt_length.h Wed Dec 31 16:00:00 1969
+++ linux/include/linux/netfilter_ipv4/ipt_length.h Tue Oct 30 15:08:12 2001
@@ -0,0 +1,9 @@
+#ifndef _IPT_LENGTH_H
+#define _IPT_LENGTH_H
+
+struct ipt_length_info {
+ u_int16_t min, max;
+ u_int8_t invert;
+};
+
+#endif /*_IPT_LENGTH_H*/
diff -u --recursive --new-file v2.4.13/linux/include/linux/netfilter_ipv4/ipt_ttl.h linux/include/linux/netfilter_ipv4/ipt_ttl.h
--- v2.4.13/linux/include/linux/netfilter_ipv4/ipt_ttl.h Wed Dec 31 16:00:00 1969
+++ linux/include/linux/netfilter_ipv4/ipt_ttl.h Tue Oct 30 15:08:12 2001
@@ -0,0 +1,21 @@
+/* IP tables module for matching the value of the TTL
+ * (C) 2000 by Harald Welte <laf...@gnumonks.org> */
+
+#ifndef _IPT_TTL_H
+#define _IPT_TTL_H
+
+enum {
+ IPT_TTL_EQ = 0, /* equals */
+ IPT_TTL_NE, /* not equals */
+ IPT_TTL_LT, /* less than */
+ IPT_TTL_GT, /* greater than */
+};
+
+
+struct ipt_ttl_info {
+ u_int8_t mode;
+ u_int8_t ttl;
+};
+
+
+#endif
diff -u --recursive --new-file v2.4.13/linux/include/linux/ntfs_fs.h linux/include/linux/ntfs_fs.h
--- v2.4.13/linux/include/linux/ntfs_fs.h Sun Sep 23 11:41:01 2001
+++ linux/include/linux/ntfs_fs.h Sat Nov 3 16:35:46 2001
@@ -10,12 +10,12 @@
X * Attribute flags (16-bit).
X */
X typedef enum {
- ATTR_IS_COMPRESSED = cpu_to_le16(0x0001),
- ATTR_COMPRESSION_MASK = cpu_to_le16(0x00ff), /* Compression method
- * mask. Also, first
- * illegal value. */
- ATTR_IS_ENCRYPTED = cpu_to_le16(0x4000),
- ATTR_IS_SPARSE = cpu_to_le16(0x8000),
+ ATTR_IS_COMPRESSED = __constant_cpu_to_le16(0x0001),
+ ATTR_COMPRESSION_MASK = __constant_cpu_to_le16(0x00ff),
+ /* Compression method mask. Also,
+ * first illegal value. */
+ ATTR_IS_ENCRYPTED = __constant_cpu_to_le16(0x4000),
+ ATTR_IS_SPARSE = __constant_cpu_to_le16(0x8000),
X } __attribute__ ((__packed__)) ATTR_FLAGS;
X
X /*
diff -u --recursive --new-file v2.4.13/linux/include/linux/pagemap.h linux/include/linux/pagemap.h
--- v2.4.13/linux/include/linux/pagemap.h Thu Oct 18 13:47:49 2001
+++ linux/include/linux/pagemap.h Mon Nov 5 13:40:59 2001
@@ -29,7 +29,7 @@
X #define PAGE_CACHE_ALIGN(addr) (((addr)+PAGE_CACHE_SIZE-1)&PAGE_CACHE_MASK)
X
X #define page_cache_get(x) get_page(x)
-#define page_cache_release(x) __free_page(x)
+extern void FASTCALL(page_cache_release(struct page *));
X
X static inline struct page *page_cache_alloc(struct address_space *x)
X {
@@ -79,9 +79,11 @@
X extern struct page * find_or_create_page(struct address_space *mapping,
X unsigned long index, unsigned int gfp_mask);
X
-extern void lock_page(struct page *page);
+extern void FASTCALL(lock_page(struct page *page));
+extern void FASTCALL(unlock_page(struct page *page));
X #define find_lock_page(mapping, index) \
X __find_lock_page(mapping, index, page_hash(mapping, index))
+extern struct page *find_trylock_page(struct address_space *, unsigned long);
X
X extern void add_to_page_cache(struct page * page, struct address_space *mapping, unsigned long index);
X extern void add_to_page_cache_locked(struct page * page, struct address_space *mapping, unsigned long index);
@@ -96,6 +98,7 @@
X }
X
X extern struct page * grab_cache_page (struct address_space *, unsigned long);
+extern struct page * grab_cache_page_nowait (struct address_space *, unsigned long);
X
X typedef int filler_t(void *, struct page*);
X
diff -u --recursive --new-file v2.4.13/linux/include/linux/pci.h linux/include/linux/pci.h
--- v2.4.13/linux/include/linux/pci.h Tue Oct 23 22:48:53 2001
+++ linux/include/linux/pci.h Mon Nov 5 12:42:33 2001
@@ -3,7 +3,7 @@
X *
X * PCI defines and function prototypes
X * Copyright 1994, Drew Eckhardt
- * Copyright 1997--1999 Martin Mares <m...@suse.cz>
+ * Copyright 1997--1999 Martin Mares <m...@ucw.cz>
X *
X * For more information, please consult the following manuals (look at
X * http://www.pcisig.com/ for how to get them):
@@ -247,8 +247,8 @@
X #define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */
X #define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */
X #define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */
-#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 4x rate */
-#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 4x rate */
+#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */
+#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */
X #define PCI_AGP_SIZEOF 12
X
X /* Slot Identification */
diff -u --recursive --new-file v2.4.13/linux/include/linux/pci_ids.h linux/include/linux/pci_ids.h
--- v2.4.13/linux/include/linux/pci_ids.h Tue Oct 23 22:48:53 2001
+++ linux/include/linux/pci_ids.h Thu Oct 25 14:01:51 2001
@@ -285,6 +285,8 @@
X #define PCI_DEVICE_ID_NS_87415 0x0002
X #define PCI_DEVICE_ID_NS_87560_LIO 0x000e
X #define PCI_DEVICE_ID_NS_87560_USB 0x0012
+#define PCI_DEVICE_ID_NS_83815 0x0020
+#define PCI_DEVICE_ID_NS_83820 0x0022
X #define PCI_DEVICE_ID_NS_87410 0xd001
X
X #define PCI_VENDOR_ID_TSENG 0x100c
@@ -1261,6 +1263,10 @@
X #define PCI_VENDOR_ID_ITE 0x1283
X #define PCI_DEVICE_ID_ITE_IT8172G 0x8172
X
+#define PCI_VENDOR_ID_ITE 0x1283
+#define PCI_DEVICE_ID_ITE_8872 0x8872
+
+
X /* formerly Platform Tech */
X #define PCI_VENDOR_ID_ESS_OLD 0x1285
X #define PCI_DEVICE_ID_ESS_ESS0100 0x0100
@@ -1382,6 +1388,7 @@
X
X #define PCI_VENDOR_ID_NETGEAR 0x1385
X #define PCI_DEVICE_ID_NETGEAR_GA620 0x620a
+#define PCI_DEVICE_ID_NETGEAR_GA622 0x622a
X
X #define PCI_VENDOR_ID_APPLICOM 0x1389
X #define PCI_DEVICE_ID_APPLICOM_PCIGENERIC 0x0001
@@ -1500,6 +1507,10 @@
X #define PCI_VENDOR_ID_AVANCE 0x4005
X #define PCI_DEVICE_ID_AVANCE_ALG2064 0x2064
X #define PCI_DEVICE_ID_AVANCE_2302 0x2302
+
+#define PCI_VENDOR_ID_AKS 0x416c
+#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100
+#define PCI_DEVICE_ID_AKS_CPC 0x0200
X
X #define PCI_VENDOR_ID_NETVIN 0x4a14
X #define PCI_DEVICE_ID_NETVIN_NV5000SC 0x5000
diff -u --recursive --new-file v2.4.13/linux/include/linux/reiserfs_fs.h linux/include/linux/reiserfs_fs.h
--- v2.4.13/linux/include/linux/reiserfs_fs.h Tue Oct 23 22:48:53 2001
+++ linux/include/linux/reiserfs_fs.h Tue Oct 30 15:11:34 2001
@@ -115,6 +115,7 @@
X #define RFALSE( cond, format, args... ) do {;} while( 0 )
X #endif
X
+#define CONSTF __attribute__( ( const ) )
X /*
X * Disk Data Structures
X */
@@ -135,12 +136,15 @@
X #define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
X #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
X
-static inline int is_reiserfs_magic_string (struct reiserfs_super_block * rs)
+extern char reiserfs_super_magic_string[];
+extern char reiser2fs_super_magic_string[];
+
+static inline int is_reiserfs_magic_string (const struct reiserfs_super_block * rs)
X {
- return (!strncmp (rs->s_magic, REISERFS_SUPER_MAGIC_STRING,
- strlen ( REISERFS_SUPER_MAGIC_STRING)) ||
- !strncmp (rs->s_magic, REISER2FS_SUPER_MAGIC_STRING,
- strlen ( REISER2FS_SUPER_MAGIC_STRING)));
+ return (!strncmp (rs->s_magic, reiserfs_super_magic_string,
+ strlen ( reiserfs_super_magic_string)) ||
+ !strncmp (rs->s_magic, reiser2fs_super_magic_string,
+ strlen ( reiser2fs_super_magic_string)));
X }
X
X /* ReiserFS leaves the first 64k unused,
@@ -199,41 +203,11 @@
X */
X #define MIN_PACK_ON_CLOSE 512
X
-/* the defines below say, that if file size is >=
- DIRECT_TAIL_SUPPRESSION_SIZE * blocksize, then if tail is longer
- than MAX_BYTES_SUPPRESS_DIRECT_TAIL, it will be stored in
- unformatted node */
-#define DIRECT_TAIL_SUPPRESSION_SIZE 1024
-#define MAX_BYTES_SUPPRESS_DIRECT_TAIL 1024
-
-#if 0
-
-//
-#define mark_file_with_tail(inode,offset) \
-{\
-inode->u.reiserfs_i.i_has_tail = 1;\
-}
-
-#define mark_file_without_tail(inode) \
-{\
-inode->u.reiserfs_i.i_has_tail = 0;\
-}
-
-#endif
-
X // this says about version of all items (but stat data) the object
X // consists of
X #define inode_items_version(inode) ((inode)->u.reiserfs_i.i_version)
X
X
-/* We store tail in unformatted node if it is too big to fit into a
- formatted node or if DIRECT_TAIL_SUPPRESSION_SIZE,
- MAX_BYTES_SUPPRESS_DIRECT_TAIL and file size say that. */
-/* #define STORE_TAIL_IN_UNFM(n_file_size,n_tail_size,n_block_size) \ */
-/* ( ((n_tail_size) > MAX_DIRECT_ITEM_LEN(n_block_size)) || \ */
-/* ( ( (n_file_size) >= (n_block_size) * DIRECT_TAIL_SUPPRESSION_SIZE ) && \ */
-/* ( (n_tail_size) >= MAX_BYTES_SUPPRESS_DIRECT_TAIL ) ) ) */
-
X /* This is an aggressive tail suppression policy, I am hoping it
X improves our benchmarks. The principle behind it is that
X percentage space saving is what matters, not absolute space
@@ -469,7 +443,6 @@
X #define put_ih_item_len(ih, val) do { (ih)->ih_item_len = cpu_to_le16(val); } while (0)
X
X
-// FIXME: now would that work for other than i386 archs
X #define unreachable_item(ih) (ih_version(ih) & (1 << 15))
X
X #define get_ih_free_space(ih) (ih_version (ih) == ITEM_VERSION_2 ? 0 : ih_free_space (ih))
@@ -505,6 +478,7 @@
X //
X // here are conversion routines
X //
+static inline int uniqueness2type (__u32 uniqueness) CONSTF;
X static inline int uniqueness2type (__u32 uniqueness)
X {
X switch (uniqueness) {
@@ -522,6 +496,7 @@
X return TYPE_ANY;
X }
X
+static inline __u32 type2uniqueness (int type) CONSTF;
X static inline __u32 type2uniqueness (int type)
X {
X switch (type) {
@@ -543,25 +518,26 @@
X // there is no way to get version of object from key, so, provide
X // version to these defines
X //
-static inline loff_t le_key_k_offset (int version, struct key * key)
+static inline loff_t le_key_k_offset (int version, const struct key * key)
X {
X return (version == ITEM_VERSION_1) ?
X le32_to_cpu( key->u.k_offset_v1.k_offset ) :
X offset_v2_k_offset( &(key->u.k_offset_v2) );
X }
-static inline loff_t le_ih_k_offset (struct item_head * ih)
+
+static inline loff_t le_ih_k_offset (const struct item_head * ih)
X {
X return le_key_k_offset (ih_version (ih), &(ih->ih_key));
X }
X
-
-static inline loff_t le_key_k_type (int version, struct key * key)
+static inline loff_t le_key_k_type (int version, const struct key * key)
X {
X return (version == ITEM_VERSION_1) ?
X uniqueness2type( le32_to_cpu( key->u.k_offset_v1.k_uniqueness)) :
X offset_v2_k_type( &(key->u.k_offset_v2) );
X }
-static inline loff_t le_ih_k_type (struct item_head * ih)
+
+static inline loff_t le_ih_k_type (const struct item_head * ih)
X {
X return le_key_k_type (ih_version (ih), &(ih->ih_key));
X }
@@ -610,14 +586,14 @@
X //
X // key is pointer to cpu key, result is cpu
X //
-static inline loff_t cpu_key_k_offset (struct cpu_key * key)
+static inline loff_t cpu_key_k_offset (const struct cpu_key * key)
X {
X return (key->version == ITEM_VERSION_1) ?
X key->on_disk_key.u.k_offset_v1.k_offset :
X key->on_disk_key.u.k_offset_v2.k_offset;
X }
X
-static inline loff_t cpu_key_k_type (struct cpu_key * key)
+static inline loff_t cpu_key_k_type (const struct cpu_key * key)
X {
X return (key->version == ITEM_VERSION_1) ?
X uniqueness2type (key->on_disk_key.u.k_offset_v1.k_uniqueness) :
@@ -1058,8 +1034,8 @@
X #define I_DEH_N_ENTRY_LENGTH(ih,deh,i) \
X ((i) ? (deh_location((deh)-1) - deh_location((deh))) : (ih_item_len((ih)) - deh_location((deh))))
X */
-static inline int entry_length (struct buffer_head * bh, struct item_head * ih,
- int pos_in_item)
+static inline int entry_length (const struct buffer_head * bh,
+ const struct item_head * ih, int pos_in_item)
X {
X struct reiserfs_de_head * deh;
X
@@ -1295,7 +1271,7 @@
X
X // reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset
X #define U32_MAX (~(__u32)0)
-static inline loff_t max_reiserfs_offset (struct inode * inode)
+static inline loff_t max_reiserfs_offset (const struct inode * inode)
X {
X if (inode_items_version (inode) == ITEM_VERSION_1)
X return (loff_t)U32_MAX;
@@ -1464,41 +1440,6 @@
X see FILESYSTEM_CHANGED() macro in reiserfs_fs.h */
X } ;
X
-
-#if 0
- /* when balancing we potentially affect a 3 node wide column of nodes
- in the tree (the top of the column may be tapered). C is the nodes
- at the center of this column, and L and R are the nodes to the
- left and right. */
- struct seal * L_path_seals[MAX_HEIGHT];
- struct seal * C_path_seals[MAX_HEIGHT];
- struct seal * R_path_seals[MAX_HEIGHT];
- char L_path_lock_types[MAX_HEIGHT]; /* 'r', 'w', or 'n' for read, write, or none */
- char C_path_lock_types[MAX_HEIGHT];
- char R_path_lock_types[MAX_HEIGHT];
-
-
- struct seal_list_elem * C_seal[MAX_HEIGHT]; /* array of seals on nodes in the path */
- struct seal_list_elem * L_seal[MAX_HEIGHT]; /* array of seals on left neighbors of nodes in the path */
- struct seal_list_elem * R_seal[MAX_HEIGHT]; /* array of seals on right neighbors of nodes in the path*/
- struct seal_list_elem * FL_seal[MAX_HEIGHT]; /* array of seals on fathers of the left neighbors */
- struct seal_list_elem * FR_seal[MAX_HEIGHT]; /* array of seals on fathers of the right neighbors */
- struct seal_list_elem * CFL_seal[MAX_HEIGHT]; /* array of seals on common parents of center node and its left neighbor */
- struct seal_list_elem * CFR_seal[MAX_HEIGHT]; /* array of seals on common parents of center node and its right neighbor */
-
- struct char C_desired_lock_type[MAX_HEIGHT]; /* 'r', 'w', or 'n' for read, write, or none */
- struct char L_desired_lock_type[MAX_HEIGHT];
- struct char R_desired_lock_type[MAX_HEIGHT];
- struct char FL_desired_lock_type[MAX_HEIGHT];
- struct char FR_desired_lock_type[MAX_HEIGHT];
- struct char CFL_desired_lock_type[MAX_HEIGHT];
- struct char CFR_desired_lock_type[MAX_HEIGHT];
-#endif


-
-
-
-
-

X /* These are modes of balancing */
X
X /* When inserting an item. */
@@ -1639,28 +1580,6 @@
X #define B_I_POS_UNFM_POINTER(bh,ih,pos) le32_to_cpu(*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)))
X #define PUT_B_I_POS_UNFM_POINTER(bh,ih,pos, val) do {*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)) = cpu_to_le32(val); } while (0)
X
-/* Reiserfs buffer cache statistics. */
-#ifdef REISERFS_CACHE_STAT
- struct reiserfs_cache_stat
- {
- int nr_reiserfs_ll_r_block; /* Number of block reads. */
- int nr_reiserfs_ll_w_block; /* Number of block writes. */
- int nr_reiserfs_schedule; /* Number of locked buffers waits. */
- unsigned long nr_reiserfs_bread; /* Number of calls to reiserfs_bread function */
- unsigned long nr_returns; /* Number of breads of buffers that were hoped to contain a key but did not after bread completed
- (usually due to object shifting while bread was executing.)
- In the code this manifests as the number
- of times that the repeat variable is nonzero in search_by_key.*/
- unsigned long nr_fixed; /* number of calls of fix_nodes function */
- unsigned long nr_failed; /* number of calls of fix_nodes in which schedule occurred while the function worked */
- unsigned long nr_find1; /* How many times we access a child buffer using its direct pointer from an internal node.*/
- unsigned long nr_find2; /* Number of times there is neither a direct pointer to
- nor any entry in the child list pointing to the buffer. */
- unsigned long nr_find3; /* When parent is locked (meaning that there are no direct pointers)
- or parent is leaf and buffer to be found is an unformatted node. */
- } cache_stat;
-#endif
-
X struct reiserfs_iget4_args {
X __u32 objectid ;
X } ;
@@ -1767,7 +1686,7 @@
X int remove_from_transaction(struct super_block *p_s_sb, unsigned long blocknr, int already_cleaned) ;
X int remove_from_journal_list(struct super_block *s, struct reiserfs_journal_list *jl, struct buffer_head *bh, int remove_freed) ;
X
-int buffer_journaled(struct buffer_head *bh) ;
+int buffer_journaled(const struct buffer_head *bh) ;
X int mark_buffer_journal_new(struct buffer_head *bh) ;
X int reiserfs_sync_all_buffers(kdev_t dev, int wait) ;
X int reiserfs_sync_buffers(kdev_t dev, int wait) ;
@@ -1779,17 +1698,17 @@
X int reiserfs_allocate_list_bitmaps(struct super_block *s, struct reiserfs_list_bitmap *, int) ;
X
X /* why is this kerplunked right here? */
-static inline int reiserfs_buffer_prepared(struct buffer_head *bh) {
- if (bh && test_bit(BH_JPrepared, &bh->b_state))
+static inline int reiserfs_buffer_prepared(const struct buffer_head *bh) {
+ if (bh && test_bit(BH_JPrepared, ( struct buffer_head * ) &bh->b_state))
X return 1 ;
X else


X return 0 ;
X }
X

X /* buffer was journaled, waiting to get to disk */
-static inline int buffer_journal_dirty(struct buffer_head *bh) {
+static inline int buffer_journal_dirty(const struct buffer_head *bh) {
X if (bh)
- return test_bit(BH_JDirty_wait, &bh->b_state) ;
+ return test_bit(BH_JDirty_wait, ( struct buffer_head * ) &bh->b_state) ;
X else
X return 0 ;
X }
@@ -1811,28 +1730,32 @@
X int reiserfs_convert_objectid_map_v1(struct super_block *) ;
X
X /* stree.c */
-int B_IS_IN_TREE(struct buffer_head *);
-extern inline void copy_short_key (void * to, void * from);
-extern inline void copy_item_head(void * p_v_to, void * p_v_from);
+int B_IS_IN_TREE(const struct buffer_head *);
+extern inline void copy_short_key (void * to, const void * from);
+extern inline void copy_item_head(struct item_head * p_v_to,
+ const struct item_head * p_v_from);
X
X // first key is in cpu form, second - le
-extern inline int comp_keys (struct key * le_key, struct cpu_key * cpu_key);
-extern inline int comp_short_keys (struct key * le_key, struct cpu_key * cpu_key);
-extern inline void le_key2cpu_key (struct cpu_key * to, struct key * from);
+extern inline int comp_keys (const struct key * le_key,
+ const struct cpu_key * cpu_key);
+extern inline int comp_short_keys (const struct key * le_key,
+ const struct cpu_key * cpu_key);
+extern inline void le_key2cpu_key (struct cpu_key * to, const struct key * from);
X
X // both are cpu keys
-extern inline int comp_cpu_keys (struct cpu_key *, struct cpu_key *);
-extern inline int comp_short_cpu_keys (struct cpu_key *, struct cpu_key *);
-extern inline void cpu_key2cpu_key (struct cpu_key *, struct cpu_key *);
+extern inline int comp_cpu_keys (const struct cpu_key *, const struct cpu_key *);
+extern inline int comp_short_cpu_keys (const struct cpu_key *,
+ const struct cpu_key *);
+extern inline void cpu_key2cpu_key (struct cpu_key *, const struct cpu_key *);
X
X // both are in le form
-extern inline int comp_le_keys (struct key *, struct key *);
-extern inline int comp_short_le_keys (struct key *, struct key *);
+extern inline int comp_le_keys (const struct key *, const struct key *);
+extern inline int comp_short_le_keys (const struct key *, const struct key *);
X
X //
X // get key version from on disk key - kludge
X //
-static inline int le_key_version (struct key * key)
+static inline int le_key_version (const struct key * key)
X {
X int type;
X
@@ -1845,18 +1768,23 @@
X }
X
X
-static inline void copy_key (void * to, void * from)
+static inline void copy_key (struct key *to, const struct key *from)
X {
X memcpy (to, from, KEY_SIZE);
X }
X
X
-int comp_items (struct item_head * p_s_ih, struct path * p_s_path);
-struct key * get_rkey (struct path * p_s_chk_path, struct super_block * p_s_sb);
-inline int bin_search (void * p_v_key, void * p_v_base, int p_n_num, int p_n_width, int * p_n_pos);
-int search_by_key (struct super_block *, struct cpu_key *, struct path *, int);
+int comp_items (const struct item_head * stored_ih, const struct path * p_s_path);
+const struct key * get_rkey (const struct path * p_s_chk_path,
+ const struct super_block * p_s_sb);
+inline int bin_search (const void * p_v_key, const void * p_v_base,
+ int p_n_num, int p_n_width, int * p_n_pos);
+int search_by_key (struct super_block *, const struct cpu_key *,
+ struct path *, int);
X #define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL)
-int search_for_position_by_key (struct super_block * p_s_sb, struct cpu_key * p_s_cpu_key, struct path * p_s_search_path);
+int search_for_position_by_key (struct super_block * p_s_sb,
+ const struct cpu_key * p_s_cpu_key,
+ struct path * p_s_search_path);
X extern inline void decrement_bcount (struct buffer_head * p_s_bh);
X void decrement_counters_in_path (struct path * p_s_search_path);
X void pathrelse (struct path * p_s_search_path);
@@ -1865,12 +1793,12 @@
X
X int reiserfs_insert_item (struct reiserfs_transaction_handle *th,
X struct path * path,
- struct cpu_key * key,
+ const struct cpu_key * key,
X struct item_head * ih, const char * body);
X
X int reiserfs_paste_into_item (struct reiserfs_transaction_handle *th,
X struct path * path,
- struct cpu_key * key,
+ const struct cpu_key * key,
X const char * body, int paste_size);
X
X int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,


@@ -1882,7 +1810,7 @@
X

X int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
X struct path * path,
- struct cpu_key * key,
+ const struct cpu_key * key,
X struct inode * inode,
X struct buffer_head * p_s_un_bh);
X
@@ -1922,13 +1850,15 @@
X void reiserfs_truncate_file(struct inode *, int update_timestamps) ;
X void make_cpu_key (struct cpu_key * cpu_key, const struct inode * inode, loff_t offset,
X int type, int key_length);
-void make_le_item_head (struct item_head * ih, struct cpu_key * key, int version,
- loff_t offset, int type, int length, int entry_count);
+void make_le_item_head (struct item_head * ih, const struct cpu_key * key,
+ int version,
+ loff_t offset, int type, int length, int entry_count);
X /*void store_key (struct key * key);
X void forget_key (struct key * key);*/
X int reiserfs_get_block (struct inode * inode, long block,
X struct buffer_head * bh_result, int create);
-struct inode * reiserfs_iget (struct super_block * s, struct cpu_key * key);
+struct inode * reiserfs_iget (struct super_block * s,
+ const struct cpu_key * key);
X void reiserfs_read_inode (struct inode * inode) ;
X void reiserfs_read_inode2(struct inode * inode, void *p) ;
X void reiserfs_delete_inode (struct inode * inode);
@@ -1942,7 +1872,8 @@
X /* we don't mark inodes dirty, we just log them */
X void reiserfs_dirty_inode (struct inode * inode) ;
X
-struct inode * reiserfs_new_inode (struct reiserfs_transaction_handle *th, const struct inode * dir, int mode,
+struct inode * reiserfs_new_inode (struct reiserfs_transaction_handle *th,
+ const struct inode * dir, int mode,
X const char * symname, int item_len,
X struct dentry *dentry, struct inode *inode, int * err);
X int reiserfs_sync_inode (struct reiserfs_transaction_handle *th, struct inode * inode);
@@ -1951,7 +1882,8 @@
X
X /* namei.c */
X inline void set_de_name_and_namelen (struct reiserfs_dir_entry * de);
-int search_by_entry_key (struct super_block * sb, struct cpu_key * key, struct path * path,
+int search_by_entry_key (struct super_block * sb, const struct cpu_key * key,
+ struct path * path,
X struct reiserfs_dir_entry * de);
X struct dentry * reiserfs_lookup (struct inode * dir, struct dentry *dentry);
X int reiserfs_create (struct inode * dir, struct dentry *dentry, int mode);
@@ -1966,7 +1898,6 @@
X /* super.c */
X inline void reiserfs_mark_buffer_dirty (struct buffer_head * bh, int flag);
X inline void reiserfs_mark_buffer_clean (struct buffer_head * bh);
-void reiserfs_panic (struct super_block * s, const char * fmt, ...);
X void reiserfs_write_super (struct super_block * s);
X void reiserfs_put_super (struct super_block * s);
X int reiserfs_remount (struct super_block * s, int * flags, char * data);
@@ -1983,7 +1914,7 @@
X
X /* tail_conversion.c */
X int direct2indirect (struct reiserfs_transaction_handle *, struct inode *, struct path *, struct buffer_head *, loff_t);
-int indirect2direct (struct reiserfs_transaction_handle *, struct inode *, struct page *, struct path *, struct cpu_key *, loff_t, char *);
+int indirect2direct (struct reiserfs_transaction_handle *, struct inode *, struct page *, struct path *, const struct cpu_key *, loff_t, char *);
X void reiserfs_unmap_buffer(struct buffer_head *) ;
X
X
@@ -1997,22 +1928,26 @@
X
X /* buffer2.c */
X struct buffer_head * reiserfs_getblk (kdev_t n_dev, int n_block, int n_size);
-void wait_buffer_until_released (struct buffer_head * bh);
+void wait_buffer_until_released (const struct buffer_head * bh);
X struct buffer_head * reiserfs_bread (kdev_t n_dev, int n_block, int n_size);
X
X
X /* fix_nodes.c */
X void * reiserfs_kmalloc (size_t size, int flags, struct super_block * s);
X void reiserfs_kfree (const void * vp, size_t size, struct super_block * s);
-int fix_nodes (int n_op_mode, struct tree_balance * p_s_tb, struct item_head * p_s_ins_ih, const void *);
+int fix_nodes (int n_op_mode, struct tree_balance * p_s_tb,
+ struct item_head * p_s_ins_ih, const void *);
X void unfix_nodes (struct tree_balance *);
X void free_buffers_in_tb (struct tree_balance * p_s_tb);
X
X
X /* prints.c */
-void reiserfs_panic (struct super_block * s, const char * fmt, ...);
+void reiserfs_panic (struct super_block * s, const char * fmt, ...)
+__attribute__ ( ( noreturn ) );/* __attribute__( ( format ( printf, 2, 3 ) ) ) */
X void reiserfs_warning (const char * fmt, ...);
+/* __attribute__( ( format ( printf, 1, 2 ) ) ); */
X void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...);
+/* __attribute__( ( format ( printf, 3, 4 ) ) ); */
X void print_virtual_node (struct virtual_node * vn);
X void print_indirect_item (struct buffer_head * bh, int item_num);
X void store_print_tb (struct tree_balance * tb);
@@ -2092,7 +2027,7 @@
X __u32 r5_hash (const signed char *msg, int len);
X
X /* version.c */
-char *reiserfs_get_version_string(void) ;
+const char *reiserfs_get_version_string(void) CONSTF;
X
X /* the ext2 bit routines adjust for big or little endian as
X ** appropriate for the arch, so in our laziness we use them rather
@@ -2112,7 +2047,7 @@
X #ifdef __i386__
X
X static __inline__ int
-find_first_nonzero_bit(void * addr, unsigned size) {
+find_first_nonzero_bit(const void * addr, unsigned size) {
X int res;
X int __d0;
X void *__d1;
@@ -2140,7 +2075,8 @@
X
X #else /* __i386__ */
X
-static __inline__ int find_next_nonzero_bit(void * addr, unsigned size, unsigned offset)
+static __inline__ int find_next_nonzero_bit(const void * addr, unsigned size,
+ unsigned offset)
X {
X unsigned int * p = ((unsigned int *) addr) + (offset >> 5);
X unsigned int result = offset & ~31UL;
@@ -2188,10 +2124,10 @@
X absolutely safe */
X #define SPARE_SPACE 500
X
-static inline unsigned long reiserfs_get_journal_block(struct super_block *s) {
+static inline unsigned long reiserfs_get_journal_block(const struct super_block *s) {
X return le32_to_cpu(SB_DISK_SUPER_BLOCK(s)->s_journal_block) ;
X }
-static inline unsigned long reiserfs_get_journal_orig_size(struct super_block *s) {
+static inline unsigned long reiserfs_get_journal_orig_size(const struct super_block *s) {
X return le32_to_cpu(SB_DISK_SUPER_BLOCK(s)->s_orig_journal_size) ;
X }
X
diff -u --recursive --new-file v2.4.13/linux/include/linux/sched.h linux/include/linux/sched.h
--- v2.4.13/linux/include/linux/sched.h Thu Oct 18 13:47:38 2001
+++ linux/include/linux/sched.h Mon Nov 5 12:42:14 2001
@@ -413,6 +413,7 @@
X #define PF_DUMPCORE 0x00000200 /* dumped core */
X #define PF_SIGNALED 0x00000400 /* killed by a signal */
X #define PF_MEMALLOC 0x00000800 /* Allocating memory */
+#define PF_MEMDIE 0x00001000 /* Killed for out-of-memory */
X #define PF_FREE_PAGES 0x00002000 /* per process page freeing */
X
X #define PF_USEDFPU 0x00100000 /* task used FPU this quantum (SMP) */
diff -u --recursive --new-file v2.4.13/linux/include/linux/skbuff.h linux/include/linux/skbuff.h
--- v2.4.13/linux/include/linux/skbuff.h Thu Oct 18 13:47:57 2001
+++ linux/include/linux/skbuff.h Mon Nov 5 12:42:20 2001
@@ -35,7 +35,9 @@
X #define CHECKSUM_UNNECESSARY 2
X
X #define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES-1)) & ~(SMP_CACHE_BYTES-1))
-#define SKB_MAX_HEAD(X) ((PAGE_SIZE - (X) - sizeof(struct skb_shared_info))&~(SMP_CACHE_BYTES-1))
+#define SKB_MAX_ORDER(X,ORDER) (((PAGE_SIZE<<(ORDER)) - (X) - sizeof(struct skb_shared_info))&~(SMP_CACHE_BYTES-1))
+#define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X),0))
+#define SKB_MAX_ALLOC (SKB_MAX_ORDER(0,2))
X
X /* A. Checksumming of received packets by device.
X *
diff -u --recursive --new-file v2.4.13/linux/include/linux/sockios.h linux/include/linux/sockios.h
--- v2.4.13/linux/include/linux/sockios.h Sun Aug 12 13:28:01 2001
+++ linux/include/linux/sockios.h Tue Oct 30 15:08:12 2001
@@ -102,6 +102,9 @@
X #define SIOCADDDLCI 0x8980 /* Create new DLCI device */
X #define SIOCDELDLCI 0x8981 /* Delete DLCI device */
X
+#define SIOCGIFVLAN 0x8982 /* 802.1Q VLAN support */
+#define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */
+
X /* Device private ioctl calls */
X
X /*
diff -u --recursive --new-file v2.4.13/linux/include/linux/swap.h linux/include/linux/swap.h
--- v2.4.13/linux/include/linux/swap.h Tue Oct 23 22:48:53 2001
+++ linux/include/linux/swap.h Mon Nov 5 12:42:13 2001
@@ -79,6 +79,10 @@
X };
X
X extern int nr_swap_pages;
+
+/* Swap 50% full? Release swapcache more aggressively.. */
+#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
+
X extern unsigned int nr_free_pages(void);
X extern unsigned int nr_free_buffer_pages(void);
X extern int nr_active_pages;
@@ -101,7 +105,6 @@
X extern void FASTCALL(__lru_cache_del(struct page *));
X extern void FASTCALL(lru_cache_del(struct page *));
X
-extern void FASTCALL(deactivate_page(struct page *));
X extern void FASTCALL(activate_page(struct page *));
X
X extern void swap_setup(void);
@@ -129,8 +132,7 @@
X extern struct page * read_swap_cache_async(swp_entry_t);
X
X /* linux/mm/oom_kill.c */
-extern int out_of_memory(void);
-extern void oom_kill(void);
+extern void out_of_memory(void);
X
X /* linux/mm/swapfile.c */
X extern int total_swap_pages;
@@ -145,6 +147,7 @@
X extern int swap_count(struct page *);
X extern int valid_swaphandles(swp_entry_t, unsigned long *);
X extern void swap_free(swp_entry_t);
+extern void free_swap_and_cache(swp_entry_t);
X struct swap_list_t {
X int head; /* head of priority-ordered swapfile list */
X int next; /* swapfile to be used next */
@@ -192,7 +195,6 @@
X list_del(&(page)->lru); \
X ClearPageActive(page); \
X nr_active_pages--; \
- DEBUG_LRU_PAGE(page); \
X } while (0)
X
X #define del_page_from_inactive_list(page) \
@@ -200,7 +202,6 @@
X list_del(&(page)->lru); \
X ClearPageInactive(page); \
X nr_inactive_pages--; \
- DEBUG_LRU_PAGE(page); \
X } while (0)
X
X /*
diff -u --recursive --new-file v2.4.13/linux/include/linux/tcp.h linux/include/linux/tcp.h
--- v2.4.13/linux/include/linux/tcp.h Thu Oct 18 13:47:42 2001
+++ linux/include/linux/tcp.h Mon Nov 5 12:43:05 2001
@@ -110,7 +110,7 @@
X TCP_FLAG_RST = __constant_htonl(0x00040000),
X TCP_FLAG_SYN = __constant_htonl(0x00020000),
X TCP_FLAG_FIN = __constant_htonl(0x00010000),
- TCP_RESERVED_BITS = __constant_htonl(0x0FC00000),
+ TCP_RESERVED_BITS = __constant_htonl(0x0F000000),
X TCP_DATA_OFFSET = __constant_htonl(0xF0000000)
X };
X
diff -u --recursive --new-file v2.4.13/linux/include/linux/timer.h linux/include/linux/timer.h
--- v2.4.13/linux/include/linux/timer.h Thu Oct 18 13:47:37 2001
+++ linux/include/linux/timer.h Mon Nov 5 12:42:13 2001
@@ -59,6 +59,8 @@
X * 2. Because if the timer wrap changes in future you wont have to
X * alter your driver code.
X *
+ * time_after(a,b) returns true if the time a is after time b.
+ *
X * Do this with "<0" and ">=0" to only test the sign of the result. A
X * good compiler would generate better code (and a really good compiler
X * wouldn't care). Gcc is currently neither.
diff -u --recursive --new-file v2.4.13/linux/include/linux/zlib_fs.h linux/include/linux/zlib_fs.h
--- v2.4.13/linux/include/linux/zlib_fs.h Wed Dec 31 16:00:00 1969
+++ linux/include/linux/zlib_fs.h Mon Nov 5 13:40:59 2001
@@ -0,0 +1,679 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+ version 1.1.3, July 9th, 1998
+
+ Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jl...@gzip.org mad...@alumni.caltech.edu
+
+
+ The data format used by the zlib library is described by RFCs (Request for
+ Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
+ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef _ZLIB_H
+#define _ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.1.3"
+
+/*
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed
+ data. This version of the library supports only one compression method
+ (deflation) but other algorithms will be added later and will have the same
+ stream interface.
+
+ Compression can be done in a single step if the buffers are large
+ enough (for example if an input file is mmap'ed), or can be done by
+ repeated calls of the compression function. In the latter case, the
+ application must provide more input and/or consume the output
+ (providing more output space) before each call.
+
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never
+ crash even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void (*free_func) OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ Bytef *next_in; /* next input byte */
+ uInt avail_in; /* number of bytes available at next_in */
+ uLong total_in; /* total nb of input bytes read so far */
+
+ Bytef *next_out; /* next output byte should be put there */
+ uInt avail_out; /* remaining free space at next_out */
+ uLong total_out; /* total nb of bytes output so far */
+
+ char *msg; /* last error message, NULL if no error */
+ struct internal_state FAR *state; /* not visible by applications */
+
+ void *workspace; /* memory allocated for this stream */
+
+ int data_type; /* best guess about the data type: ascii or binary */
+ uLong adler; /* adler32 value of the uncompressed data */
+ uLong reserved; /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+ The application must update next_in and avail_in when avail_in has
+ dropped to zero. It must update next_out and avail_out when avail_out
+ has dropped to zero. The application must initialize zalloc, zfree and
+ opaque before calling the init function. All other fields are set by the
+ compression library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
+ opaque value.
+
+ zalloc must return Z_NULL if there is not enough memory for the object.
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
+ thread safe.
+
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this
+ if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
+ pointers returned by zalloc for objects of exactly 65536 bytes *must*
+ have their offset normalized to zero. The default allocation function
+ provided by this library ensures this (see zutil.c). To reduce memory
+ requirements and avoid any allocation of 64K objects, at the expense of
+ compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or
+ progress reports. After compression, total_in holds the total size of
+ the uncompressed data and may be saved for use in the decompressor
+ (particularly if the decompressor wants to decompress everything in
+ a single step).
+*/
+
+ /* constants */
+
+#define Z_NO_FLUSH 0
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_SYNC_FLUSH 2
+#define Z_FULL_FLUSH 3
+#define Z_FINISH 4
+/* Allowed flush values; see deflate() below for details */
+
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative
+ * values are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+/* compression levels */
+
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_DEFAULT_STRATEGY 0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY 0
+#define Z_ASCII 1
+#define Z_UNKNOWN 2
+/* Possible values of the data_type field */
+
+#define Z_DEFLATED 8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+
+ /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlib_fs_zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+ If the first character differs, the library code actually used is
+ not compatible with the zlib.h header file used by the application.
+ This check is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller.
+ If zalloc and zfree are set to Z_NULL, deflateInit updates them to
+ use default allocation functions.
+
+ The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at
+ all (the input data is simply copied a block at a time).
+ Z_DEFAULT_COMPRESSION requests a default compromise between speed and
+ compression (currently equivalent to level 6).
+
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+ Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+ with the version assumed by the caller (ZLIB_VERSION).
+ msg is set to null if there is no error message. deflateInit does not
+ perform any compression: this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT zlib_fs_deflate OF((z_streamp strm, int flush));
+/*
+ deflate compresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce some
+ output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. deflate performs one or both of the
+ following actions:
+
+ - Compress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in and avail_in are updated and
+ processing will resume at this point for the next call of deflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. This action is forced if the parameter flush is non zero.
+ Forcing flush frequently degrades the compression ratio, so this parameter
+ should be set only when necessary (in interactive applications).
+ Some output may be provided even if flush is not set.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating avail_in or avail_out accordingly; avail_out
+ should never be zero before the call. The application can consume the
+ compressed output when it wants, for example when the output buffer is full
+ (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
+ and with zero avail_out, it must be called again after making room in the
+ output buffer because there might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+ flushed to the output buffer and the output is aligned on a byte boundary, so
+ that the decompressor can get all input data available so far. (In particular
+ avail_in is zero after the call if enough output space has been provided
+ before the call.) Flushing may degrade compression for some compression
+ algorithms and so it should be used only when necessary.
+
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+ restart from this point if previous compressed data has been damaged or if
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ the compression.
+
+ If deflate returns with avail_out == 0, this function must be called again
+ with the same value of the flush parameter and more output space (updated
+ avail_out), until the flush is complete (deflate returns with non-zero
+ avail_out).
+
+ If the parameter flush is set to Z_FINISH, pending input is processed,
+ pending output is flushed and deflate returns with Z_STREAM_END if there
+ was enough output space; if deflate returns with Z_OK, this function must be
+ called again with Z_FINISH and more output space (updated avail_out) but no
+ more input data, until it returns with Z_STREAM_END or an error. After
+ deflate has returned Z_STREAM_END, the only possible operations on the
+ stream are deflateReset or deflateEnd.
+
+ Z_FINISH can be used immediately after deflateInit if all the compression
+ is to be done in a single step. In this case, avail_out must be at least
+ 0.1% larger than avail_in plus 12 bytes. If deflate does not return
+ Z_STREAM_END, then it must be called again as described above.
+
+ deflate() sets strm->adler to the adler32 checksum of all input read
+ so far (that is, total_in bytes).
+
+ deflate() may update data_type if it can make a good guess about
+ the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
+ binary. This field is only for information purposes and does not affect
+ the compression algorithm in any manner.
+
+ deflate() returns Z_OK if some progress has been made (more input
+ processed or more output produced), Z_STREAM_END if all input has been
+ consumed and all output has been produced (only when flush is set to
+ Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+ if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero).
+*/
+
+
+ZEXTERN int ZEXPORT zlib_fs_deflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+ stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+ prematurely (some input or output was discarded). In the error case,
+ msg may be set but then points to a static string (which must not be
+ deallocated).
+*/
+
+
+ZEXTERN int ZEXPORT zlib_fs_inflate_workspacesize OF((void));
+/*
+ Returns the number of bytes that needs to be allocated for a per-
+ stream workspace. A pointer to this number of bytes should be
+ returned in stream->workspace before calling zlib_fs_inflateInit().
+*/
+
+/*
+ZEXTERN int ZEXPORT zlib_fs_inflateInit OF((z_streamp strm));
+
+ Initializes the internal stream state for decompression. The fields
+ next_in, avail_in, and workspace must be initialized before by
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+ value depends on the compression method), inflateInit determines the
+ compression method from the zlib header and allocates all data structures
+ accordingly; otherwise the allocation will be deferred to the first call of
+ inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+ use default allocation functions.
+
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller. msg is set to null if there is no error
+ message. inflateInit does not perform any decompression apart from reading
+ the zlib header if present: this will be done by inflate(). (So next_in and
+ avail_in may be modified, but next_out and avail_out are unchanged.)
+*/
+
+
+ZEXTERN int ZEXPORT zlib_fs_inflate OF((z_streamp strm, int flush));
+/*
+ inflate decompresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may some
+ introduce some output latency (reading input without producing any output)
+ except when forced to flush.
+
+ The detailed semantics are as follows. inflate performs one or both of the
+ following actions:
+
+ - Decompress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in is updated and processing
+ will resume at this point for the next call of inflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 52'
echo 'File patch-2.4.14 is continued in part 53'
echo "53" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:09 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part46

#!/bin/sh -x
# this is part 46 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 46; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

- * In this case, we just return 0 so that we can properly fill
- * the page with useless information without generating any
- * I/O errors.
- */
- if (b_off > ((inode->i_size + PAGE_SIZE - 1) >> ISOFS_BUFFER_BITS(inode)))
- goto abort_beyond_end;
-
+
X offset = 0;
X firstext = inode->u.isofs_i.i_first_extent;
X sect_size = inode->u.isofs_i.i_section_size >> ISOFS_BUFFER_BITS(inode);
X nextino = inode->u.isofs_i.i_next_section_ino;
+ section = 0;
X
- i = 0;
- if (nextino) {
- while (b_off >= (offset + sect_size)) {
- struct inode *ninode;
-
- offset += sect_size;
- if (nextino == 0)
- goto abort;
- ninode = iget(inode->i_sb, nextino);
- if (!ninode)
+ while ( nblocks ) {
+ /* If we are *way* beyond the end of the file, print a message.
+ * Access beyond the end of the file up to the next page boundary
+ * is normal, however because of the way the page cache works.
+ * In this case, we just return 0 so that we can properly fill
+ * the page with useless information without generating any
+ * I/O errors.
+ */
+ if (b_off > ((inode->i_size + PAGE_CACHE_SIZE - 1) >> ISOFS_BUFFER_BITS(inode))) {
+ printk("isofs_get_blocks: block >= EOF (%ld, %ld)\n",
+ iblock, (unsigned long) inode->i_size);
+ goto abort;
+ }
+
+ if (nextino) {
+ while (b_off >= (offset + sect_size)) {
+ struct inode *ninode;
+
+ offset += sect_size;
+ if (nextino == 0)
+ goto abort;
+ ninode = iget(inode->i_sb, nextino);
+ if (!ninode)
+ goto abort;
+ firstext = ninode->u.isofs_i.i_first_extent;
+ sect_size = ninode->u.isofs_i.i_section_size;
+ nextino = ninode->u.isofs_i.i_next_section_ino;
+ 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);
+ goto abort;
+ }
+ }
+ }
+
+ if ( *bh_result ) {
+ (*bh_result)->b_dev = inode->i_dev;
+ (*bh_result)->b_blocknr = firstext + b_off - offset;
+ (*bh_result)->b_state |= (1UL << BH_Mapped);
+ } else {
+ *bh_result = getblk(inode->i_dev, firstext+b_off-offset, blocksize);
+ if ( !*bh_result )
X goto abort;
- firstext = ninode->u.isofs_i.i_first_extent;
- sect_size = ninode->u.isofs_i.i_section_size;
- nextino = ninode->u.isofs_i.i_next_section_ino;
- iput(ninode);
-
- if (++i > 100)
- goto abort_too_many_sections;
X }
+ bh_result++; /* Next buffer head */
+ b_off++; /* Next buffer offset */
+ nblocks--;
+ rv++;
X }
X
- bh_result->b_dev = inode->i_dev;
- bh_result->b_blocknr = firstext + b_off - offset;
- bh_result->b_state |= (1UL << BH_Mapped);
- err = 0;
X
X abort:
X unlock_kernel();
- return err;
+ return rv;
+}
X
-abort_create_attempted:
- printk("isofs_get_block: Kernel tries to allocate a block\n");
- goto abort;
-
-abort_negative:
- printk("isofs_get_block: block < 0\n");
- goto abort;
-
-abort_beyond_end:
- printk("isofs_get_block: block >= EOF (%ld, %ld)\n",
- iblock, (unsigned long) inode->i_size);
- goto abort;
-
-abort_too_many_sections:
- printk("isofs_get_block: More than 100 file sections ?!?, aborting...\n");
- printk("isofs_get_block: ino=%lu block=%ld firstext=%u sect_size=%u nextino=%lu\n",
- inode->i_ino, iblock, firstext, (unsigned) sect_size, nextino);
- goto abort;
+/*
+ * Used by the standard interfaces.
+ */
+static int isofs_get_block(struct inode *inode, long iblock,
+ struct buffer_head *bh_result, int create)
+{
+ if ( create ) {
+ printk("isofs_get_block: Kernel tries to allocate a block\n");
+ return -EROFS;
+ }
+
+ return isofs_get_blocks(inode, iblock, &bh_result, 1) ? 0 : -EIO;
X }
X
X static int isofs_bmap(struct inode *inode, int block)
@@ -1151,6 +1175,9 @@
X de = tmpde;
X }
X
+ /* Assume it is a normal-format file unless told otherwise */
+ inode->u.isofs_i.i_file_format = isofs_file_normal;
+
X if (de->flags[-high_sierra] & 2) {
X inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR;
X inode->i_nlink = 1; /* Set to 1. We know there are 2, but
@@ -1237,6 +1264,10 @@
X inode->u.isofs_i.i_first_extent = (isonum_733 (de->extent) +
X isonum_711 (de->ext_attr_length));
X
+ /* Set the number of blocks for stat() - should be done before RR */
+ inode->i_blksize = PAGE_CACHE_SIZE; /* For stat() only */
+ inode->i_blocks = (inode->i_size + 511) >> 9;
+
X /*
X * Now test for possible Rock Ridge extensions which will override
X * some of these numbers in the inode structure.
@@ -1276,7 +1307,16 @@
X {
X if (S_ISREG(inode->i_mode)) {
X inode->i_fop = &generic_ro_fops;
- inode->i_data.a_ops = &isofs_aops;
+ switch ( inode->u.isofs_i.i_file_format ) {
+#ifdef CONFIG_ZISOFS
+ case isofs_file_compressed:
+ inode->i_data.a_ops = &zisofs_aops;
+ break;
+#endif
+ default:
+ inode->i_data.a_ops = &isofs_aops;
+ break;
+ }
X } else if (S_ISDIR(inode->i_mode)) {
X inode->i_op = &isofs_dir_inode_operations;
X inode->i_fop = &isofs_dir_operations;
@@ -1336,15 +1376,27 @@
X
X static int __init init_iso9660_fs(void)
X {
+#ifdef CONFIG_ZISOFS
+ int err;
+
+ err = zisofs_init();
+ if ( err )
+ return err;
+#endif
X return register_filesystem(&iso9660_fs_type);
X }
X
X static void __exit exit_iso9660_fs(void)
X {
X unregister_filesystem(&iso9660_fs_type);
+#ifdef CONFIG_ZISOFS
+ zisofs_cleanup();
+#endif
X }
X
X EXPORT_NO_SYMBOLS;
X
X module_init(init_iso9660_fs)
X module_exit(exit_iso9660_fs)
+MODULE_LICENSE("GPL");
+
diff -u --recursive --new-file v2.4.13/linux/fs/isofs/rock.c linux/fs/isofs/rock.c
--- v2.4.13/linux/fs/isofs/rock.c Sun Sep 23 11:41:00 2001
+++ linux/fs/isofs/rock.c Thu Oct 25 13:53:53 2001
@@ -24,7 +24,7 @@
X * returns a symbolic link name, and a fourth one returns the extent number
X * for the file. */
X
-#define SIG(A,B) ((A << 8) | B)
+#define SIG(A,B) ((A) | ((B) << 8)) /* isonum_721() */
X
X
X /* This is a way of ensuring that we have something in the system
@@ -113,7 +113,7 @@
X while (len > 1){ /* There may be one byte for padding somewhere */
X rr = (struct rock_ridge *) chr;
X if (rr->len == 0) goto out; /* Something got screwed up here */
- sig = (chr[0] << 8) + chr[1];
+ sig = isonum_721(chr);
X chr += rr->len;
X len -= rr->len;
X
@@ -174,7 +174,7 @@
X while (len > 1){ /* There may be one byte for padding somewhere */
X rr = (struct rock_ridge *) chr;
X if (rr->len == 0) goto out; /* Something got screwed up here */
- sig = (chr[0] << 8) + chr[1];
+ sig = isonum_721(chr);
X chr += rr->len;
X len -= rr->len;
X
@@ -254,15 +254,17 @@
X while (len > 1){ /* There may be one byte for padding somewhere */
X rr = (struct rock_ridge *) chr;
X if (rr->len == 0) goto out; /* Something got screwed up here */
- sig = (chr[0] << 8) + chr[1];
+ sig = isonum_721(chr);
X chr += rr->len;
X len -= rr->len;
X
X switch(sig){
+#ifndef CONFIG_ZISOFS /* No flag for SF or ZF */
X case SIG('R','R'):
X if((rr->u.RR.flags[0] &
X (RR_PX | RR_TF | RR_SL | RR_CL)) == 0) goto out;
X break;
+#endif
X case SIG('S','P'):
X CHECK_SP(goto out);
X break;
@@ -375,11 +377,36 @@
X inode->i_gid = reloc->i_gid;
X inode->i_rdev = reloc->i_rdev;
X inode->i_size = reloc->i_size;
+ inode->i_blocks = reloc->i_blocks;
X inode->i_atime = reloc->i_atime;
X inode->i_ctime = reloc->i_ctime;
X inode->i_mtime = reloc->i_mtime;
X iput(reloc);
X break;
+#ifdef CONFIG_ZISOFS
+ case SIG('Z','F'):
+ if ( !inode->i_sb->u.isofs_sb.s_nocompress ) {
+ int algo;
+ algo = isonum_721(rr->u.ZF.algorithm);
+ if ( algo == SIG('p','z') ) {
+ int block_shift = isonum_711(&rr->u.ZF.parms[1]);
+ if ( block_shift < PAGE_CACHE_SHIFT || block_shift > 17 ) {
+ printk(KERN_WARNING "isofs: Can't handle ZF block size of 2^%d\n", block_shift);
+ } else {
+ /* Note: we don't change i_blocks here */
+ inode->u.isofs_i.i_file_format = isofs_file_compressed;
+ /* Parameters to compression algorithm (header size, block size) */
+ inode->u.isofs_i.i_format_parm[0] = isonum_711(&rr->u.ZF.parms[0]);
+ inode->u.isofs_i.i_format_parm[1] = isonum_711(&rr->u.ZF.parms[1]);
+ inode->i_size = isonum_733(rr->u.ZF.real_size);
+ }
+ } else {
+ printk(KERN_WARNING "isofs: Unknown ZF compression algorithm: %c%c\n",
+ rr->u.ZF.algorithm[0], rr->u.ZF.algorithm[1]);
+ }
+ }
+ break;
+#endif
X default:
X break;
X }
@@ -508,7 +535,7 @@
X rr = (struct rock_ridge *) chr;
X if (rr->len == 0)
X goto out; /* Something got screwed up here */
- sig = (chr[0] << 8) + chr[1];
+ sig = isonum_721(chr);
X chr += rr->len;
X len -= rr->len;
X
diff -u --recursive --new-file v2.4.13/linux/fs/isofs/rock.h linux/fs/isofs/rock.h
--- v2.4.13/linux/fs/isofs/rock.h Wed Aug 10 09:26:27 1994
+++ linux/fs/isofs/rock.h Thu Oct 25 13:53:53 2001
@@ -6,7 +6,7 @@
X struct SU_SP{
X unsigned char magic[2];
X unsigned char skip;
-};
+} __attribute__((packed));
X
X struct SU_CE{
X char extent[8];
@@ -20,11 +20,11 @@
X unsigned char len_src;
X unsigned char ext_ver;
X char data[0];
-};
+} __attribute__((packed));
X
X struct RR_RR{
X char flags[1];
-};
+} __attribute__((packed));
X
X struct RR_PX{
X char mode[8];
@@ -43,17 +43,17 @@
X unsigned char flags;
X unsigned char len;
X char text[0];
-};
+} __attribute__((packed));
X
X struct RR_SL{
X unsigned char flags;
X struct SL_component link;
-};
+} __attribute__((packed));
X
X struct RR_NM{
X unsigned char flags;


X char name[0];
-};
+} __attribute__((packed));
X

X struct RR_CL{
X char location[8];


@@ -65,11 +65,18 @@
X

X struct stamp{
X char time[7];
-};
+} __attribute__((packed));
X
X struct RR_TF{
X char flags;
X struct stamp times[0]; /* Variable number of these beasts */
+} __attribute__((packed));
+
+/* Linux-specific extension for transparent decompression */
+struct RR_ZF{
+ char algorithm[2];
+ char parms[2];
+ char real_size[8];
X };
X
X /* These are the bits and their meanings for flags in the TF structure. */
@@ -98,6 +105,7 @@
X struct RR_CL CL;
X struct RR_PL PL;
X struct RR_TF TF;
+ struct RR_ZF ZF;
X } u;
X };
X
diff -u --recursive --new-file v2.4.13/linux/fs/isofs/util.c linux/fs/isofs/util.c
--- v2.4.13/linux/fs/isofs/util.c Tue May 1 18:21:01 2001
+++ linux/fs/isofs/util.c Thu Oct 25 13:53:53 2001
@@ -3,7 +3,6 @@
X */
X
X #include <linux/time.h>
-#include <linux/fs.h>
X #include <linux/iso_fs.h>
X
X /*
diff -u --recursive --new-file v2.4.13/linux/fs/isofs/zisofs.h linux/fs/isofs/zisofs.h
--- v2.4.13/linux/fs/isofs/zisofs.h Wed Dec 31 16:00:00 1969
+++ linux/fs/isofs/zisofs.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,21 @@
+/* ----------------------------------------------------------------------- *


+ *
+ * Copyright 2001 H. Peter Anvin - All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
+ * USA; either version 2 of the License, or (at your option) any later
+ * version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*

+ * Prototypes for functions exported from the compressed isofs subsystem
+ */
+
+#ifdef CONFIG_ZISOFS
+extern struct address_space_operations zisofs_aops;
+extern int __init zisofs_init(void);
+extern void __exit zisofs_cleanup(void);
+#endif
diff -u --recursive --new-file v2.4.13/linux/fs/jffs2/background.c linux/fs/jffs2/background.c
--- v2.4.13/linux/fs/jffs2/background.c Tue Oct 9 17:06:53 2001
+++ linux/fs/jffs2/background.c Thu Oct 25 00:07:09 2001
@@ -31,7 +31,7 @@
X * provisions above, a recipient may use your version of this file
X * under either the RHEPL or the GPL.
X *
- * $Id: background.c,v 1.15 2001/09/20 08:05:04 dwmw2 Exp $
+ * $Id: background.c,v 1.16 2001/10/08 09:22:38 dwmw2 Exp $


X *
X */
X

@@ -118,6 +118,11 @@
X if (!thread_should_wake(c)) {
X set_current_state (TASK_INTERRUPTIBLE);
X 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
+ matter - We don't care if we miss a wakeup, because the GC thread
+ is only an optimisation anyway. */
+ schedule();
X }
X
X if (current->need_resched)
diff -u --recursive --new-file v2.4.13/linux/fs/nfs/nfs2xdr.c linux/fs/nfs/nfs2xdr.c
--- v2.4.13/linux/fs/nfs/nfs2xdr.c Fri Feb 9 11:29:44 2001
+++ linux/fs/nfs/nfs2xdr.c Fri Nov 2 17:40:09 2001
@@ -471,6 +471,8 @@
X
X for (nr = 0; *p++; nr++) {
X entry = p - 1;
+ if (p + 2 > end)
+ goto short_pkt;
X p++; /* fileid */
X len = ntohl(*p++);
X p += XDR_QUADLEN(len) + 1; /* name plus cookie */
@@ -479,13 +481,13 @@
X len);
X return -errno_NFSERR_IO;
X }
- if (p + 2 > end) {
- printk(KERN_NOTICE
- "NFS: short packet in readdir reply!\n");
- entry[0] = entry[1] = 0;
- break;
- }
+ if (p + 2 > end)
+ goto short_pkt;
X }
+ return nr;
+ short_pkt:
+ printk(KERN_NOTICE "NFS: short packet in readdir reply!\n");
+ entry[0] = entry[1] = 0;
X return nr;
X }
X
diff -u --recursive --new-file v2.4.13/linux/fs/nfs/nfs3xdr.c linux/fs/nfs/nfs3xdr.c
--- v2.4.13/linux/fs/nfs/nfs3xdr.c Fri Feb 9 11:29:44 2001
+++ linux/fs/nfs/nfs3xdr.c Fri Nov 2 17:40:09 2001
@@ -594,6 +594,8 @@
X end = (u32 *) ((u8 *) p + iov[1].iov_len);
X for (nr = 0; *p++; nr++) {
X entry = p - 1;
+ if (p + 3 > end)
+ goto short_pkt;
X p += 2; /* inode # */
X len = ntohl(*p++); /* string length */
X p += XDR_QUADLEN(len) + 2; /* name + cookie */
@@ -605,10 +607,17 @@
X
X if (res->plus) {
X /* post_op_attr */
- if (*p++)
+ if (p > end)
+ goto short_pkt;
+ if (*p++) {
X p += 21;
+ if (p > end)
+ goto short_pkt;
+ }
X /* post_op_fh3 */
X if (*p++) {
+ if (p > end)
+ goto short_pkt;
X len = ntohl(*p++);
X if (len > NFS3_FHSIZE) {
X printk(KERN_WARNING "NFS: giant filehandle in "
@@ -619,15 +628,15 @@
X }
X }
X
- if (p + 2 > end) {
- printk(KERN_NOTICE
- "NFS: short packet in readdir reply!\n");
- /* truncate listing */
- entry[0] = entry[1] = 0;
- break;
- }
+ if (p + 2 > end)
+ goto short_pkt;
X }
X
+ return nr;
+ short_pkt:
+ printk(KERN_NOTICE "NFS: short packet in readdir reply!\n");
+ /* truncate listing */
+ entry[0] = entry[1] = 0;
X return nr;
X }
X
diff -u --recursive --new-file v2.4.13/linux/fs/ntfs/dir.c linux/fs/ntfs/dir.c
--- v2.4.13/linux/fs/ntfs/dir.c Sun Sep 23 11:41:00 2001
+++ linux/fs/ntfs/dir.c Sat Nov 3 16:35:46 2001
@@ -19,6 +19,7 @@
X #include "support.h"
X #include "util.h"
X #include <linux/smp_lock.h>
+#include <linux/bitops.h>
X
X static char I30[] = "$I30";
X
diff -u --recursive --new-file v2.4.13/linux/fs/ramfs/inode.c linux/fs/ramfs/inode.c
--- v2.4.13/linux/fs/ramfs/inode.c Tue Oct 9 17:06:53 2001
+++ linux/fs/ramfs/inode.c Wed Oct 24 15:19:18 2001
@@ -75,17 +75,6 @@


X return 0;
X }
X
-/*

- * Writing: just make sure the page gets marked dirty, so that
- * the page stealer won't grab it.
- */
-static int ramfs_writepage(struct page *page)
-{
- SetPageDirty(page);
- UnlockPage(page);
- return 0;
-}
-
X static int ramfs_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to)
X {
X void *addr = kmap(page);
@@ -278,7 +267,7 @@
X
X static struct address_space_operations ramfs_aops = {
X readpage: ramfs_readpage,
- writepage: ramfs_writepage,
+ writepage: fail_writepage,
X prepare_write: ramfs_prepare_write,
X commit_write: ramfs_commit_write
X };
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/buffer2.c linux/fs/reiserfs/buffer2.c
--- v2.4.13/linux/fs/reiserfs/buffer2.c Tue Oct 9 17:06:53 2001
+++ linux/fs/reiserfs/buffer2.c Tue Oct 30 15:11:34 2001
@@ -33,7 +33,7 @@
X hold we did free all buffers in tree balance structure
X (get_empty_nodes and get_nodes_for_preserving) or in path structure
X only (get_new_buffer) just before calling this */


-void wait_buffer_until_released (struct buffer_head * bh)
+void wait_buffer_until_released (const struct buffer_head * bh)

X {
X int repeat_counter = 0;
X
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/dir.c linux/fs/reiserfs/dir.c
--- v2.4.13/linux/fs/reiserfs/dir.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/dir.c Tue Oct 30 15:11:34 2001
@@ -56,7 +56,7 @@
X INITIALIZE_PATH (path_to_entry);
X struct buffer_head * bh;
X int item_num, entry_num;
- struct key * rkey;
+ const struct key * rkey;
X struct item_head * ih, tmp_ih;
X int search_res;
X char * local_buf;
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/do_balan.c linux/fs/reiserfs/do_balan.c
--- v2.4.13/linux/fs/reiserfs/do_balan.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/do_balan.c Tue Oct 30 15:11:34 2001
@@ -106,7 +106,7 @@
X
X RFALSE( ih_item_len(ih) + IH_SIZE != -tb->insert_size[0],
X "vs-12013: mode Delete, insert size %d, ih to be deleted %h",
- ih);
+ -tb->insert_size [0], ih);
X
X bi.tb = tb;
X bi.bi_bh = tbS0;
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/ibalance.c linux/fs/reiserfs/ibalance.c
--- v2.4.13/linux/fs/reiserfs/ibalance.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/ibalance.c Tue Oct 30 15:11:34 2001
@@ -113,7 +113,7 @@
X break;
X
X default:
- reiserfs_panic (tb->tb_sb, "internal_define_dest_src_infos", "shift type is unknown (%d)", shift_mode);
+ reiserfs_panic (tb->tb_sb, "internal_define_dest_src_infos: shift type is unknown (%d)", shift_mode);
X }
X }
X
@@ -692,7 +692,7 @@
X
X return;
X }
- reiserfs_panic (tb->tb_sb, "balance_internal_when_delete", "unexpected tb->lnum[%d]==%d or tb->rnum[%d]==%d",
+ reiserfs_panic (tb->tb_sb, "balance_internal_when_delete: unexpected tb->lnum[%d]==%d or tb->rnum[%d]==%d",
X h, tb->lnum[h], h, tb->rnum[h]);
X }
X
@@ -920,7 +920,7 @@
X
X
X if ( tb->blknum[h] != 1 )
- reiserfs_panic(0, "balance_internal", "One new node required for creating the new root");
+ reiserfs_panic(0, "balance_internal: One new node required for creating the new root");
X /* S[h] = empty buffer from the list FEB. */
X tbSh = get_FEB (tb);
X blkh = B_BLK_HEAD(tbSh);
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/inode.c linux/fs/reiserfs/inode.c
--- v2.4.13/linux/fs/reiserfs/inode.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/inode.c Tue Oct 30 15:11:34 2001
@@ -81,8 +81,10 @@
X //
X // when key is 0, do not set version and short key
X //
-inline void make_le_item_head (struct item_head * ih, struct cpu_key * key, int version,
- loff_t offset, int type, int length, int entry_count/*or ih_free_space*/)
+inline void make_le_item_head (struct item_head * ih, const struct cpu_key * key,


+ int version,
+ loff_t offset, int type, int length,

+ int entry_count/*or ih_free_space*/)
X {
X if (key) {
X ih->ih_key.k_dir_id = cpu_to_le32 (key->on_disk_key.k_dir_id);
@@ -1141,7 +1143,7 @@
X }
X
X

-struct inode * reiserfs_iget (struct super_block * s, struct cpu_key * key)

+struct inode * reiserfs_iget (struct super_block * s, const struct cpu_key * key)
X {
X struct inode * inode;
X struct reiserfs_iget4_args args ;
@@ -1949,7 +1951,8 @@
X //
X // from ext2_prepare_write, but modified
X //
-int reiserfs_prepare_write(struct file *f, struct page *page, unsigned from, unsigned to) {
+int reiserfs_prepare_write(struct file *f, struct page *page,
+ unsigned from, unsigned to) {
X struct inode *inode = page->mapping->host ;
X reiserfs_wait_on_write_block(inode->i_sb) ;
X fix_tail_page_for_writing(page) ;
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/journal.c linux/fs/reiserfs/journal.c
--- v2.4.13/linux/fs/reiserfs/journal.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/journal.c Tue Oct 30 15:11:34 2001
@@ -369,9 +369,9 @@
X }
X
X /* buffer is in current transaction */
-inline int buffer_journaled(struct buffer_head *bh) {
+inline int buffer_journaled(const struct buffer_head *bh) {
X if (bh)
- return test_bit(BH_JDirty, &bh->b_state) ;
+ return test_bit(BH_JDirty, ( struct buffer_head * ) &bh->b_state) ;


X else
X return 0 ;
X }

@@ -379,9 +379,9 @@
X /* disk block was taken off free list before being in a finished transation, or written to disk
X ** journal_new blocks can be reused immediately, for any purpose
X */
-inline int buffer_journal_new(struct buffer_head *bh) {
+inline int buffer_journal_new(const struct buffer_head *bh) {
X if (bh)
- return test_bit(BH_JNew, &bh->b_state) ;
+ return test_bit(BH_JNew, ( struct buffer_head * )&bh->b_state) ;


X else
X return 0 ;
X }

@@ -725,8 +725,8 @@
X retry_count++ ;
X goto retry;
X }
- reiserfs_panic(s, "journal-563: flush_commit_list: BAD, j_commit_left is %lu, should be 1\n",
- atomic_read(&(jl->j_commit_left)));
+ reiserfs_panic(s, "journal-563: flush_commit_list: BAD, j_commit_left is %u, should be 1\n",
+ atomic_read(&(jl->j_commit_left)));
X }
X
X mark_buffer_dirty(jl->j_commit_bh) ;
@@ -866,7 +866,7 @@
X
X static void reiserfs_end_buffer_io_sync(struct buffer_head *bh, int uptodate) {
X if (buffer_journaled(bh)) {
- reiserfs_warning("clm-2084: pinned buffer %u:%s sent to disk\n",
+ reiserfs_warning("clm-2084: pinned buffer %lu:%s sent to disk\n",
X bh->b_blocknr, kdevname(bh->b_dev)) ;
X }
X mark_buffer_uptodate(bh, uptodate) ;
@@ -2108,7 +2108,7 @@
X }
X
X if (th->t_trans_id != SB_JOURNAL(p_s_sb)->j_trans_id) {
- reiserfs_panic(th->t_super, "journal-1577: handle trans id %d != current trans id %d\n",
+ reiserfs_panic(th->t_super, "journal-1577: handle trans id %ld != current trans id %ld\n",
X th->t_trans_id, SB_JOURNAL(p_s_sb)->j_trans_id);
X }
X p_s_sb->s_dirt = 1 ;
@@ -2445,7 +2445,7 @@
X int wait_on_commit = flags & WAIT ;
X
X if (th->t_trans_id != SB_JOURNAL(p_s_sb)->j_trans_id) {
- reiserfs_panic(th->t_super, "journal-1577: handle trans id %d != current trans id %d\n",
+ reiserfs_panic(th->t_super, "journal-1577: handle trans id %ld != current trans id %ld\n",
X th->t_trans_id, SB_JOURNAL(p_s_sb)->j_trans_id);
X }
X
@@ -2516,7 +2516,7 @@
X }
X
X if (SB_JOURNAL(p_s_sb)->j_start > JOURNAL_BLOCK_COUNT) {
- reiserfs_panic(p_s_sb, "journal-003: journal_end: j_start (%d) is too high\n", SB_JOURNAL(p_s_sb)->j_start) ;
+ reiserfs_panic(p_s_sb, "journal-003: journal_end: j_start (%ld) is too high\n", SB_JOURNAL(p_s_sb)->j_start) ;
X }
X return 1 ;
X }
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/lbalance.c linux/fs/reiserfs/lbalance.c
--- v2.4.13/linux/fs/reiserfs/lbalance.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/lbalance.c Tue Oct 30 15:11:34 2001
@@ -216,7 +216,7 @@
X /* merge to right only part of item */
X RFALSE( ih_item_len(ih) <= bytes_or_entries,
X "vs-10060: no so much bytes %lu (needed %lu)",
- ih_item_len(ih), bytes_or_entries);
+ ( unsigned long )ih_item_len(ih), ( unsigned long )bytes_or_entries);
X
X /* change first item key of the DEST */
X if ( is_direct_le_ih (dih) ) {
@@ -325,7 +325,8 @@
X t_dc = B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position);
X RFALSE( dc_block_number(t_dc) != dest->b_blocknr,
X "vs-10160: block number in bh does not match to field in disk_child structure %lu and %lu",
- dest->b_blocknr, dc_block_number(t_dc));
+ ( long unsigned ) dest->b_blocknr,
+ ( long unsigned ) dc_block_number(t_dc));
X put_dc_size( t_dc, dc_size(t_dc) + (j - last_inserted_loc + IH_SIZE * cpy_num ) );
X
X do_balance_mark_internal_dirty (dest_bi->tb, dest_bi->bi_parent, 0);
@@ -359,7 +360,7 @@
X if (is_indirect_le_ih (ih)) {
X RFALSE( cpy_bytes == ih_item_len(ih) && get_ih_free_space(ih),
X "vs-10180: when whole indirect item is bottle to left neighbor, it must have free_space==0 (not %lu)",
- get_ih_free_space (ih));
+ ( long unsigned ) get_ih_free_space (ih));
X set_ih_free_space (&n_ih, 0);
X }
X
@@ -989,7 +990,8 @@
X RFALSE( is_statdata_le_ih (ih), "10195: item is stat data");
X RFALSE( pos_in_item && pos_in_item + cut_size != ih_item_len(ih),
X "10200: invalid offset (%lu) or trunc_size (%lu) or ih_item_len (%lu)",
- pos_in_item, cut_size, ih_item_len (ih));
+ ( long unsigned ) pos_in_item, ( long unsigned ) cut_size,
+ ( long unsigned ) ih_item_len (ih));
X
X /* shift item body to left if cut is from the head of item */
X if (pos_in_item == 0) {
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/namei.c linux/fs/reiserfs/namei.c
--- v2.4.13/linux/fs/reiserfs/namei.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/namei.c Tue Oct 30 15:11:34 2001
@@ -125,7 +125,7 @@
X */
X
X /* The function is NOT SCHEDULE-SAFE! */


-int search_by_entry_key (struct super_block * sb, struct cpu_key * key,

+int search_by_entry_key (struct super_block * sb, const struct cpu_key * key,

X struct path * path, struct reiserfs_dir_entry * de)
X {
X int retval;
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/objectid.c linux/fs/reiserfs/objectid.c
--- v2.4.13/linux/fs/reiserfs/objectid.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/objectid.c Tue Oct 30 15:11:34 2001
@@ -21,7 +21,7 @@
X {
X if (le32_to_cpu (map[0]) != 1)
X reiserfs_panic (s, "vs-15010: check_objectid_map: map corrupted: %lx",
- le32_to_cpu (map[0]));
+ ( long unsigned int ) le32_to_cpu (map[0]));
X
X // FIXME: add something else here
X }


@@ -161,7 +161,7 @@
X }

X
X reiserfs_warning ("vs-15010: reiserfs_release_objectid: tried to free free object id (%lu)",
- objectid_to_release);
+ ( long unsigned ) objectid_to_release);
X }
X
X
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/prints.c linux/fs/reiserfs/prints.c
--- v2.4.13/linux/fs/reiserfs/prints.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/prints.c Tue Oct 30 15:11:34 2001
@@ -332,26 +332,8 @@
X do_reiserfs_warning(fmt);
X printk ( KERN_EMERG "%s", error_buf);
X BUG ();
- // console_print (error_buf);
- // for (;;);
-
- /* comment before release */
- //for (;;);
-
-#if 0 /* this is not needed, the state is ignored */
- if (sb && !(sb->s_flags & MS_RDONLY)) {
- sb->u.reiserfs_sb.s_mount_state |= REISERFS_ERROR_FS;
- sb->u.reiserfs_sb.s_rs->s_state = REISERFS_ERROR_FS;
-
- mark_buffer_dirty(sb->u.reiserfs_sb.s_sbh) ;
- sb->s_dirt = 1;
- }
-#endif
-
- /* this is to prevent panic from syncing this filesystem */
- if (sb)
- sb->s_flags |= MS_RDONLY;
X
+ /* this is not actually called, but makes reiserfs_panic() "noreturn" */
X panic ("REISERFS: panic (device %s): %s\n",
X sb ? kdevname(sb->s_dev) : "sb == 0", error_buf);
X }
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/stree.c linux/fs/reiserfs/stree.c
--- v2.4.13/linux/fs/reiserfs/stree.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/stree.c Tue Oct 30 15:11:34 2001
@@ -62,7 +62,7 @@
X #include <linux/smp_lock.h>
X
X /* Does the buffer contain a disk block which is in the tree. */
-inline int B_IS_IN_TREE (struct buffer_head * p_s_bh)
+inline int B_IS_IN_TREE (const struct buffer_head * p_s_bh)
X {
X
X RFALSE( B_LEVEL (p_s_bh) > MAX_HEIGHT,


@@ -74,7 +74,7 @@
X

X
X
-inline void copy_short_key (void * to, void * from)
+inline void copy_short_key (void * to, const void * from)
X {
X memcpy (to, from, SHORT_KEY_SIZE);
X }
@@ -82,7 +82,8 @@
X //
X // to gets item head in le form
X //
-inline void copy_item_head(void * p_v_to, void * p_v_from)
+inline void copy_item_head(struct item_head * p_v_to,

+ const struct item_head * p_v_from)
X {

X memcpy (p_v_to, p_v_from, IH_SIZE);
X }
@@ -94,7 +95,8 @@
X Returns: -1 if key1 < key2
X 0 if key1 == key2
X 1 if key1 > key2 */
-inline int comp_short_keys (struct key * le_key, struct cpu_key * cpu_key)
+inline int comp_short_keys (const struct key * le_key,

+ const struct cpu_key * cpu_key)

X {
X __u32 * p_s_le_u32, * p_s_cpu_u32;
X int n_key_length = REISERFS_SHORT_KEY_LEN;
@@ -117,7 +119,7 @@
X Compare keys using all 4 key fields.
X Returns: -1 if key1 < key2 0
X if key1 = key2 1 if key1 > key2 */
-inline int comp_keys (struct key * le_key, struct cpu_key * cpu_key)
+inline int comp_keys (const struct key * le_key, const struct cpu_key * cpu_key)
X {
X int retval;
X
@@ -146,7 +148,8 @@
X //
X // FIXME: not used yet
X //
-inline int comp_cpu_keys (struct cpu_key * key1, struct cpu_key * key2)
+inline int comp_cpu_keys (const struct cpu_key * key1,
+ const struct cpu_key * key2)
X {
X if (key1->on_disk_key.k_dir_id < key2->on_disk_key.k_dir_id)
X return -1;
@@ -173,7 +176,7 @@


X return 0;
X }
X

-inline int comp_short_le_keys (struct key * key1, struct key * key2)
+inline int comp_short_le_keys (const struct key * key1, const struct key * key2)
X {
X __u32 * p_s_1_u32, * p_s_2_u32;
X int n_key_length = REISERFS_SHORT_KEY_LEN;
@@ -189,8 +192,8 @@


X return 0;
X }
X

-inline int comp_short_cpu_keys (struct cpu_key * key1,
- struct cpu_key * key2)
+inline int comp_short_cpu_keys (const struct cpu_key * key1,
+ const struct cpu_key * key2)
X {
X __u32 * p_s_1_u32, * p_s_2_u32;
X int n_key_length = REISERFS_SHORT_KEY_LEN;
@@ -209,13 +212,13 @@
X
X
X
-inline void cpu_key2cpu_key (struct cpu_key * to, struct cpu_key * from)
+inline void cpu_key2cpu_key (struct cpu_key * to, const struct cpu_key * from)
X {
X memcpy (to, from, sizeof (struct cpu_key));
X }
X
X
-inline void le_key2cpu_key (struct cpu_key * to, struct key * from)
+inline void le_key2cpu_key (struct cpu_key * to, const struct key * from)
X {
X to->on_disk_key.k_dir_id = le32_to_cpu (from->k_dir_id);
X to->on_disk_key.k_objectid = le32_to_cpu (from->k_objectid);
@@ -235,7 +238,7 @@
X
X // this does not say which one is bigger, it only returns 1 if keys
X // are not equal, 0 otherwise
-inline int comp_le_keys (struct key * k1, struct key * k2)
+inline int comp_le_keys (const struct key * k1, const struct key * k2)
X {
X return memcmp (k1, k2, sizeof (struct key));
X }
@@ -255,8 +258,8 @@
X cut the number of possible items it could be by one more than half rounded down,
X or we find it. */
X inline int bin_search (
- void * p_v_key, /* Key to search for. */
- void * p_v_base, /* First item in the array. */
+ const void * p_v_key, /* Key to search for. */
+ const void * p_v_base,/* First item in the array. */
X int p_n_num, /* Number of items in the array. */
X int p_n_width, /* Item size in the array.
X searched. Lest the reader be
@@ -290,19 +293,19 @@
X
X
X /* Minimal possible key. It is never in the tree. */
-struct key MIN_KEY = {0, 0, {{0, 0},}};
+const struct key MIN_KEY = {0, 0, {{0, 0},}};
X
X /* Maximal possible key. It is never in the tree. */
-struct key MAX_KEY = {0xffffffff, 0xffffffff, {{0xffffffff, 0xffffffff},}};
+const struct key MAX_KEY = {0xffffffff, 0xffffffff, {{0xffffffff, 0xffffffff},}};
X
X
X /* Get delimiting key of the buffer by looking for it in the buffers in the path, starting from the bottom
X of the path, and going upwards. We must check the path's validity at each step. If the key is not in
X the path, there is no delimiting key in the tree (buffer is first or last buffer in tree), and in this
X case we return a special key, either MIN_KEY or MAX_KEY. */
-inline struct key * get_lkey (
- struct path * p_s_chk_path,
- struct super_block * p_s_sb
+inline const struct key * get_lkey (
+ const struct path * p_s_chk_path,


+ const struct super_block * p_s_sb

X ) {
X int n_position, n_path_offset = p_s_chk_path->path_length;
X struct buffer_head * p_s_parent;
@@ -339,9 +342,9 @@
X
X
X /* Get delimiting key of the buffer at the path and its right neighbor. */
-inline struct key * get_rkey (
- struct path * p_s_chk_path,
- struct super_block * p_s_sb
+inline const struct key * get_rkey (
+ const struct path * p_s_chk_path,


+ const struct super_block * p_s_sb

X ) {
X int n_position,
X n_path_offset = p_s_chk_path->path_length;
@@ -384,7 +387,7 @@
X this case get_lkey and get_rkey return a special key which is MIN_KEY or MAX_KEY. */
X static inline int key_in_buffer (
X struct path * p_s_chk_path, /* Path which should be checked. */
- struct cpu_key * p_s_key, /* Key which should be checked. */
+ const struct cpu_key * p_s_key, /* Key which should be checked. */
X struct super_block * p_s_sb /* Super block pointer. */
X ) {
X
@@ -635,7 +638,7 @@
X correctness of the bottom of the path */
X /* The function is NOT SCHEDULE-SAFE! */
X int search_by_key (struct super_block * p_s_sb,
- struct cpu_key * p_s_key, /* Key to search. */
+ const struct cpu_key * p_s_key, /* Key to search. */
X struct path * p_s_search_path, /* This structure was
X allocated and initialized
X by the calling
@@ -729,7 +732,8 @@
X // certain level
X if (!is_tree_node (p_s_bh, expected_level)) {
X reiserfs_warning ("vs-5150: search_by_key: "
- "invalid format found in block %d. Fsck?\n", p_s_bh->b_blocknr);
+ "invalid format found in block %ld. Fsck?\n",
+ p_s_bh->b_blocknr);
X pathrelse (p_s_search_path);
X return IO_ERROR;
X }
@@ -738,7 +742,7 @@
X n_node_level = B_LEVEL (p_s_bh);
X
X RFALSE( n_node_level < n_stop_level,
- "vs-5152: tree level is less than stop level (%d)",
+ "vs-5152: tree level (%d) is less than stop level (%d)",
X n_node_level, n_stop_level);
X
X n_retval = bin_search( p_s_key, B_N_PITEM_HEAD(p_s_bh, 0),
@@ -789,7 +793,7 @@
X
X /* The function is NOT SCHEDULE-SAFE! */
X int search_for_position_by_key (struct super_block * p_s_sb, /* Pointer to the super block. */
- struct cpu_key * p_cpu_key, /* Key to search (cpu variable) */
+ const struct cpu_key * p_cpu_key, /* Key to search (cpu variable) */
X struct path * p_s_search_path /* Filled up by this function. */
X ) {
X struct item_head * p_le_ih; /* pointer to on-disk structure */
@@ -857,7 +861,7 @@
X
X
X /* Compare given item and item pointed to by the path. */
-int comp_items (struct item_head * stored_ih, struct path * p_s_path)


+int comp_items (const struct item_head * stored_ih, const struct path * p_s_path)

X {
X struct buffer_head * p_s_bh;
X struct item_head * ih;
@@ -873,23 +877,6 @@
X /* we need only to know, whether it is the same item */
X ih = get_ih (p_s_path);
X return memcmp (stored_ih, ih, IH_SIZE);
-
-#if 0
- /* Get item at the path. */
- p_s_path_item = PATH_PITEM_HEAD(p_s_path);
- /* Compare keys. */
- if ( COMP_KEYS(&(p_s_path_item->ih_key), &(p_cpu_ih->ih_key)) )
- return 1;
-
- /* Compare other items fields. */
- if( ih_entry_count(p_s_path_item) != ih_entry_count(p_cpu_ih) ||
- ih_item_len(p_s_path_item) != ih_item_len(p_cpu_ih) ||
- ih_location(p_s_path_item) != ih_location(p_cpu_ih) )
- return 1;
-
- /* Items are equal. */
- return 0;
-#endif
X }
X
X
@@ -985,7 +972,7 @@
X struct reiserfs_transaction_handle *th,

X struct inode * inode,

X struct path * p_s_path,
- struct cpu_key * p_s_item_key,
+ const struct cpu_key * p_s_item_key,
X int * p_n_removed, /* Number of unformatted nodes which were removed
X from end of the file. */
X int * p_n_cut_size,
@@ -1279,7 +1266,7 @@
X /* Delete object item. */


X int reiserfs_delete_item (struct reiserfs_transaction_handle *th,

X struct path * p_s_path, /* Path to the deleted item. */
- struct cpu_key * p_s_item_key, /* Key to search for the deleted item. */
+ const struct cpu_key * p_s_item_key, /* Key to search for the deleted item. */
X struct inode * p_s_inode,/* inode is here just to update i_blocks */
X struct buffer_head * p_s_un_bh) /* NULL or unformatted node pointer. */
X {
@@ -1477,7 +1464,7 @@
X struct inode * p_s_inode,
X struct page *page,
X struct path * p_s_path,
- struct cpu_key * p_s_item_key,
+ const struct cpu_key * p_s_item_key,
X loff_t n_new_file_size,
X char * p_c_mode
X ) {
@@ -1637,7 +1624,7 @@
X indirect_to_direct_roll_back (th, p_s_inode, p_s_path);
X }
X if (n_ret_value == NO_DISK_SPACE)
- reiserfs_warning ("");
+ reiserfs_warning ("NO_DISK_SPACE");
X unfix_nodes (&s_cut_balance);
X return -EIO;
X }
@@ -1676,7 +1663,7 @@
X
X if (c_mode == M_DELETE && ih_item_len(le_ih) != UNFM_P_SIZE)
X reiserfs_panic (p_s_sb, "vs-5653: reiserfs_cut_from_item: "
- "completing indirect2direct conversion indirect item %h"
+ "completing indirect2direct conversion indirect item %h "
X "being deleted must be of 4 byte long", le_ih);
X
X if (c_mode == M_CUT && s_cut_balance.insert_size[0] != -UNFM_P_SIZE) {
@@ -1848,7 +1835,8 @@
X
X #ifdef CONFIG_REISERFS_CHECK
X // this makes sure, that we __append__, not overwrite or add holes
-static void check_research_for_paste (struct path * path, struct cpu_key * p_s_key)
+static void check_research_for_paste (struct path * path,
+ const struct cpu_key * p_s_key)
X {
X struct item_head * found_ih = get_ih (path);
X
@@ -1875,7 +1863,7 @@
X /* Paste bytes to the existing item. Returns bytes number pasted into the item. */


X int reiserfs_paste_into_item (struct reiserfs_transaction_handle *th,

X struct path * p_s_search_path, /* Path to the pasted item. */
- struct cpu_key * p_s_key, /* Key to search for the needed item.*/
+ const struct cpu_key * p_s_key, /* Key to search for the needed item.*/
X const char * p_c_body, /* Pointer to the bytes to paste. */
X int n_pasted_size) /* Size of pasted bytes. */
X {
@@ -1919,7 +1907,7 @@
X /* Insert new item into the buffer at the path. */
X int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
X struct path * p_s_path, /* Path to the inserteded item. */


- struct cpu_key * key,
+ const struct cpu_key * key,

X struct item_head * p_s_ih, /* Pointer to the item header to insert.*/
X const char * p_c_body) /* Pointer to the bytes to insert. */
X {
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/super.c linux/fs/reiserfs/super.c
--- v2.4.13/linux/fs/reiserfs/super.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/super.c Tue Oct 30 15:11:34 2001
@@ -23,7 +23,8 @@
X #define REISERFS_OLD_BLOCKSIZE 4096
X #define REISERFS_SUPER_MAGIC_STRING_OFFSET_NJ 20
X
-
+char reiserfs_super_magic_string[] = REISERFS_SUPER_MAGIC_STRING;
+char reiser2fs_super_magic_string[] = REISER2FS_SUPER_MAGIC_STRING;
X
X //
X // a portion of this function, particularly the VFS interface portion,
diff -u --recursive --new-file v2.4.13/linux/fs/reiserfs/tail_conversion.c linux/fs/reiserfs/tail_conversion.c
--- v2.4.13/linux/fs/reiserfs/tail_conversion.c Tue Oct 23 22:48:53 2001
+++ linux/fs/reiserfs/tail_conversion.c Tue Oct 30 15:11:34 2001
@@ -189,7 +189,7 @@
X struct inode * p_s_inode,
X struct page *page,
X struct path * p_s_path, /* path to the indirect item. */
- struct cpu_key * p_s_item_key, /* Key to look for unformatted node pointer to be cut. */
+ const struct cpu_key * p_s_item_key, /* Key to look for unformatted node pointer to be cut. */
X loff_t n_new_file_size, /* New file size. */
X char * p_c_mode)
X {
diff -u --recursive --new-file v2.4.13/linux/fs/super.c linux/fs/super.c
--- v2.4.13/linux/fs/super.c Tue Oct 23 22:48:53 2001
+++ linux/fs/super.c Tue Oct 30 15:08:12 2001
@@ -1060,7 +1060,10 @@
X vfsmnt->mnt_root = dget(sb->s_root);
X bdput(bdev); /* sb holds a reference */
X
+
+#ifdef CONFIG_ROOT_NFS
X attach_it:
+#endif
X root_nd.mnt = root_vfsmnt;
X root_nd.dentry = root_vfsmnt->mnt_sb->s_root;
X graft_tree(vfsmnt, &root_nd);
diff -u --recursive --new-file v2.4.13/linux/include/asm-alpha/a.out.h linux/include/asm-alpha/a.out.h
--- v2.4.13/linux/include/asm-alpha/a.out.h Fri Feb 6 10:06:55 1998
+++ linux/include/asm-alpha/a.out.h Fri Nov 2 17:39:20 2001
@@ -90,8 +90,16 @@
X
X #ifdef __KERNEL__
X
+/* Assume that start addresses below 4G belong to a TASO application.
+ Unfortunately, there is no proper bit in the exec header to check.
+ Worse, we have to notice the start address before swapping to use
+ /sbin/loader, which of course is _not_ a TASO application. */
+#define SET_AOUT_PERSONALITY(BFPM, EX) \
+ set_personality (BFPM->sh_bang || EX.ah.entry < 0x100000000 \
+ ? PER_LINUX_32BIT : PER_LINUX)
+
X #define STACK_TOP \
- ((current->personality==PER_LINUX_32BIT) ? (0x80000000) : (0x00120000000UL))
+ (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
X
X #endif
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-alpha/floppy.h linux/include/asm-alpha/floppy.h
--- v2.4.13/linux/include/asm-alpha/floppy.h Mon Jun 19 17:59:33 2000
+++ linux/include/asm-alpha/floppy.h Thu Oct 25 13:53:55 2001
@@ -116,4 +116,6 @@
X # endif
X #endif
X
+#define EXTRA_FLOPPY_PARAMS
+
X #endif /* __ASM_ALPHA_FLOPPY_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-alpha/hwrpb.h linux/include/asm-alpha/hwrpb.h
--- v2.4.13/linux/include/asm-alpha/hwrpb.h Mon Jun 19 17:59:33 2000
+++ linux/include/asm-alpha/hwrpb.h Fri Nov 2 17:39:20 2001
@@ -18,6 +18,12 @@
X #define PCA56_CPU 9 /* PCA56 (21164PC) */
X #define PCA57_CPU 10 /* PCA57 (notyet) */
X #define EV67_CPU 11 /* EV67 (21264A) */
+#define EV68CB_CPU 12 /* EV68CB (21264C) */
+#define EV68AL_CPU 13 /* EV68AL (21264B) */
+#define EV68CX_CPU 14 /* EV68CX (21264D) */
+#define EV7_CPU 15 /* EV7 (21364) */
+#define EV79_CPU 16 /* EV79 (21364??) */
+#define EV69_CPU 17 /* EV69 (21264/EV69A) */
X
X /*
X * DEC system types for Alpha systems. Found in HWRPB.
diff -u --recursive --new-file v2.4.13/linux/include/asm-alpha/pgtable.h linux/include/asm-alpha/pgtable.h
--- v2.4.13/linux/include/asm-alpha/pgtable.h Tue Oct 9 17:06:53 2001
+++ linux/include/asm-alpha/pgtable.h Thu Oct 25 14:00:32 2001
@@ -363,4 +363,7 @@
X */
X #define pgtable_cache_init() do { } while (0)
X
+/* We have our own get_unmapped_area to cope with ADDR_LIMIT_32BIT. */
+#define HAVE_ARCH_UNMAPPED_AREA
+
X #endif /* _ALPHA_PGTABLE_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-anakin/keyboard.h linux/include/asm-arm/arch-anakin/keyboard.h
--- v2.4.13/linux/include/asm-arm/arch-anakin/keyboard.h Mon Aug 27 12:41:47 2001
+++ linux/include/asm-arm/arch-anakin/keyboard.h Thu Oct 25 13:53:53 2001
@@ -10,20 +10,6 @@
X * Changelog:
X * 11-Apr-2001 TTC Created
X */
-
-#ifndef __ASM_ARCH_KEYBOARD_H
-#define __ASM_ARCH_KEYBOARD_H
-
-#define kbd_setkeycode(s, k) (-EINVAL)
-#define kbd_getkeycode(s) (-EINVAL)
-#define kbd_translate(s, k, r) 0
-#define kbd_unexpected_up(k) 0
-#define kbd_leds(l)
-#define kbd_init_hw()
-#define kbd_sysrq_xlate ((int *) 0)
-#define kbd_disable_irq()
-#define kbd_enable_irq()
-
-#define SYSRQ_KEY 0x54
-
-#endif


+#define kbd_init_hw() do { } while (0)

+#define kbd_enable_irq() do { } while (0)
+#define kbd_disable_irq() do { } while (0)
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-arc/keyboard.h linux/include/asm-arm/arch-arc/keyboard.h
--- v2.4.13/linux/include/asm-arm/arch-arc/keyboard.h Mon Sep 18 15:15:22 2000
+++ linux/include/asm-arm/arch-arc/keyboard.h Thu Oct 25 13:53:53 2001
@@ -1,7 +1,7 @@
X /*
X * linux/include/asm-arm/arch-arc/keyboard.h
X *


- * Copyright (C) 1998 Russell King
+ * Copyright (C) 1998-2001 Russell King
X *

X * This program is free software; you can redistribute it and/or modify
X * it under the terms of the GNU General Public License version 2 as
@@ -10,24 +10,12 @@
X * Keyboard driver definitions for Acorn Archimedes/A5000
X * architecture
X */
-
X #include <asm/irq.h>


X
X #define NR_SCANCODES 128
X

-extern void a5kkbd_leds(unsigned char leds);
X extern void a5kkbd_init_hw(void);
-extern unsigned char a5kkbd_sysrq_xlate[NR_SCANCODES];
-


-#define kbd_setkeycode(sc,kc) (-EINVAL)
-#define kbd_getkeycode(sc) (-EINVAL)
-
-#define kbd_translate(sc, kcp, rm) ({ *(kcp) = (sc); 1; })
-#define kbd_unexpected_up(kc) (0200)

-#define kbd_leds(leds) a5kkbd_leds(leds)
-#define kbd_init_hw() a5kkbd_init_hw()
-#define kbd_sysrq_xlate a5kkbd_sysrq_xlate


-#define kbd_disable_irq() disable_irq(IRQ_KEYBOARDRX)
-#define kbd_enable_irq() enable_irq(IRQ_KEYBOARDRX)

X

-#define SYSRQ_KEY 13
+#define kbd_disable_irq() disable_irq(IRQ_KEYBOARDRX)
+#define kbd_enable_irq() enable_irq(IRQ_KEYBOARDRX)

+#define kbd_init_hw() a5kkbd_init_hw()
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-cl7500/keyboard.h linux/include/asm-arm/arch-cl7500/keyboard.h
--- v2.4.13/linux/include/asm-arm/arch-cl7500/keyboard.h Tue Nov 23 22:23:11 1999
+++ linux/include/asm-arm/arch-cl7500/keyboard.h Thu Oct 25 13:53:53 2001
@@ -4,26 +4,12 @@
X *
X * Keyboard driver definitions for CL7500 architecture
X *
- * (C) 1998 Russell King


+ * Copyright (C) 1998-2001 Russell King

X */
-
-#include <asm/irq.h>
-


X #define NR_SCANCODES 128
X
-extern void ps2kbd_leds(unsigned char leds);
-extern void ps2kbd_init_hw(void);
-extern unsigned char ps2kbd_sysrq_xlate[NR_SCANCODES];

-


-#define kbd_setkeycode(sc,kc) (-EINVAL)
-#define kbd_getkeycode(sc) (-EINVAL)
-
-#define kbd_translate(sc, kcp, rm) ({ *(kcp) = (sc); 1; })
-#define kbd_unexpected_up(kc) (0200)
-#define kbd_leds(leds) ps2kbd_leds(leds)
-#define kbd_init_hw() ps2kbd_init_hw()
-#define kbd_sysrq_xlate ps2kbd_sysrq_xlate
-#define kbd_disable_irq() disable_irq(IRQ_KEYBOARDRX)
-#define kbd_enable_irq() enable_irq(IRQ_KEYBOARDRX)
+extern int ps2kbd_init_hw(void);
X

-#define SYSRQ_KEY 13
+#define kbd_disable_irq() disable_irq(IRQ_KEYBOARDRX)
+#define kbd_enable_irq() enable_irq(IRQ_KEYBOARDRX)
+#define kbd_init_hw() ps2kbd_init_hw()

diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-ebsa285/keyboard.h linux/include/asm-arm/arch-ebsa285/keyboard.h
--- v2.4.13/linux/include/asm-arm/arch-ebsa285/keyboard.h Sun Aug 13 09:54:15 2000
+++ linux/include/asm-arm/arch-ebsa285/keyboard.h Thu Oct 25 13:53:53 2001
@@ -3,13 +3,19 @@
X *
X * Keyboard driver definitions for EBSA285 architecture
X *
- * (C) 1998 Russell King


+ * Copyright (C) 1998-2001 Russell King

X * (C) 1998 Phil Blundell
X */
X #include <linux/ioport.h>
X #include <asm/irq.h>
X #include <asm/system.h>
X
+#define KEYBOARD_IRQ IRQ_ISA_KEYBOARD
+#define NR_SCANCODES 128
+


+#define kbd_disable_irq() do { } while (0)

+#define kbd_enable_irq() do { } while (0)
+
X extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
X extern int pckbd_getkeycode(unsigned int scancode);
X extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
@@ -19,55 +25,26 @@
X extern void pckbd_init_hw(void);
X extern unsigned char pckbd_sysrq_xlate[128];
X
-#define KEYBOARD_IRQ IRQ_ISA_KEYBOARD
-
-#define NR_SCANCODES 128
+static inline void kbd_init_hw(void)
+{
+ if (have_isa_bridge) {
+ k_setkeycode = pckbd_setkeycode;
+ k_getkeycode = pckbd_getkeycode;
+ k_translate = pckbd_translate;
+ k_unexpected_up = pckbd_unexpected_up;
+ k_leds = pckbd_leds;
+#ifdef CONFIG_MAGIC_SYSRQ
+ k_sysrq_key = 0x54;
+ k_sysrq_xlate = pckbd_sysrq_xlate;
+#endif
+ pckbd_init_hw();
+ }
+}
X
-#define kbd_setkeycode(sc,kc) \
- ({ \
- int __ret; \
- if (have_isa_bridge) \
- __ret = pckbd_setkeycode(sc,kc);\
- else \
- __ret = -EINVAL; \
- __ret; \
- })
-
-#define kbd_getkeycode(sc) \
- ({ \
- int __ret; \
- if (have_isa_bridge) \
- __ret = pckbd_getkeycode(sc); \
- else \
- __ret = -EINVAL; \
- __ret; \
- })
-
-#define kbd_translate(sc, kcp, rm) \
- ({ \
- pckbd_translate(sc, kcp, rm); \
- })
-
-#define kbd_unexpected_up pckbd_unexpected_up
-
-#define kbd_leds(leds) \
- do { \
- if (have_isa_bridge) \
- pckbd_leds(leds); \
- } while (0)
-
-#define kbd_init_hw() \
- do { \
- if (have_isa_bridge) \
- pckbd_init_hw(); \
- } while (0)
X
-#define kbd_sysrq_xlate pckbd_sysrq_xlate
-
-#define kbd_disable_irq()
-#define kbd_enable_irq()
-
-#define SYSRQ_KEY 0x54
+/*
+ * The rest of this file is to do with supporting pc_keyb.c
+ */
X
X /* resource allocation */
X #define kbd_request_region() request_region(0x60, 16, "keyboard")
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/dma.h linux/include/asm-arm/arch-epxa10db/dma.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/dma.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/dma.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,28 @@
+/*
+ * linux/include/asm-arm/arch-camelot/dma.h
+ *
+ * Copyright (C) 1997,1998 Russell King


+ *
+ * This 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 __ASM_ARCH_DMA_H
+#define __ASM_ARCH_DMA_H
+
+#define MAX_DMA_ADDRESS 0xffffffff
+
+#define MAX_DMA_CHANNELS 0
+
+#endif /* _ASM_ARCH_DMA_H */
+
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/excalibur.h linux/include/asm-arm/arch-epxa10db/excalibur.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/excalibur.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/excalibur.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,91 @@
+/* megafunction wizard: %ARM-Based Excalibur%
+ GENERATION: STANDARD
+ VERSION: WM1.0
+ MODULE: ARM-Based Excalibur
+ PROJECT: excalibur
+ ============================================================
+ File Name: v:\embedded\linux\bootldr\excalibur.h
+ Megafunction Name(s): ARM-Based Excalibur
+ ============================================================
+
+ ************************************************************
+ THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
+ ************************************************************/
+
+#ifndef EXCALIBUR_H_INCLUDED
+#define EXCALIBUR_H_INCLUDED
+
+#define EXC_DEFINE_PROCESSOR_LITTLE_ENDIAN
+#define EXC_DEFINE_BOOT_FROM_FLASH
+
+#define EXC_INPUT_CLK_FREQUENCY (50000000)
+#define EXC_AHB1_CLK_FREQUENCY (150000000)
+#define EXC_AHB2_CLK_FREQUENCY (75000000)
+#define EXC_SDRAM_CLK_FREQUENCY (75000000)
+
+/* Registers Block */
+#define EXC_REGISTERS_BASE (0x7fffc000)
+#define EXC_MODE_CTRL00_BASE (EXC_REGISTERS_BASE + 0x000)
+#define EXC_IO_CTRL00_BASE (EXC_REGISTERS_BASE + 0x040)
+#define EXC_MMAP00_BASE (EXC_REGISTERS_BASE + 0x080)
+#define EXC_PLD_CONFIG00_BASE (EXC_REGISTERS_BASE + 0x140)
+#define EXC_TIMER00_BASE (EXC_REGISTERS_BASE + 0x200)
+#define EXC_INT_CTRL00_BASE (EXC_REGISTERS_BASE + 0xc00)
+#define EXC_CLOCK_CTRL00_BASE (EXC_REGISTERS_BASE + 0x300)
+#define EXC_WATCHDOG00_BASE (EXC_REGISTERS_BASE + 0xa00)
+#define EXC_UART00_BASE (EXC_REGISTERS_BASE + 0x280)
+#define EXC_EBI00_BASE (EXC_REGISTERS_BASE + 0x380)
+#define EXC_SDRAM00_BASE (EXC_REGISTERS_BASE + 0x400)
+#define EXC_AHB12_BRIDGE_CTRL00_BASE (EXC_REGISTERS_BASE + 0x800)
+#define EXC_PLD_STRIPE_BRIDGE_CTRL00_BASE (EXC_REGISTERS_BASE + 0x100)
+#define EXC_STRIPE_PLD_BRIDGE_CTRL00_BASE (EXC_REGISTERS_BASE + 0x100)
+
+#define EXC_REGISTERS_SIZE (0x00004000)
+
+/* EBI Block(s) */
+#define EXC_EBI_BLOCK0_BASE (0x40000000)
+#define EXC_EBI_BLOCK0_SIZE (0x00400000)
+#define EXC_EBI_BLOCK0_WIDTH (8)
+#define EXC_EBI_BLOCK0_NON_CACHEABLE
+#define EXC_EBI_BLOCK1_BASE (0x40400000)
+#define EXC_EBI_BLOCK1_SIZE (0x00400000)
+#define EXC_EBI_BLOCK1_WIDTH (16)
+#define EXC_EBI_BLOCK1_NON_CACHEABLE
+#define EXC_EBI_BLOCK2_BASE (0x40800000)
+#define EXC_EBI_BLOCK2_SIZE (0x00400000)
+#define EXC_EBI_BLOCK2_WIDTH (16)
+#define EXC_EBI_BLOCK2_NON_CACHEABLE
+#define EXC_EBI_BLOCK3_BASE (0x40c00000)
+#define EXC_EBI_BLOCK3_SIZE (0x00400000)
+#define EXC_EBI_BLOCK3_WIDTH (16)
+#define EXC_EBI_BLOCK3_NON_CACHEABLE
+
+/* SDRAM Block(s) */
+#define EXC_SDRAM_BLOCK0_BASE (0x00000000)
+#define EXC_SDRAM_BLOCK0_SIZE (0x04000000)
+#define EXC_SDRAM_BLOCK0_WIDTH (32)
+#define EXC_SDRAM_BLOCK1_BASE (0x04000000)
+#define EXC_SDRAM_BLOCK1_SIZE (0x04000000)
+#define EXC_SDRAM_BLOCK1_WIDTH (32)
+
+/* Single Port SRAM Block(s) */
+#define EXC_SPSRAM_BLOCK0_BASE (0x08000000)
+#define EXC_SPSRAM_BLOCK0_SIZE (0x00020000)
+#define EXC_SPSRAM_BLOCK1_BASE (0x08020000)
+#define EXC_SPSRAM_BLOCK1_SIZE (0x00020000)
+
+/* PLD Block(s) */
+#define EXC_PLD_BLOCK0_BASE (0x80000000)
+#define EXC_PLD_BLOCK0_SIZE (0x00004000)
+#define EXC_PLD_BLOCK0_NON_CACHEABLE
+#define EXC_PLD_BLOCK1_BASE (0xf000000)
+#define EXC_PLD_BLOCK1_SIZE (0x00004000)
+#define EXC_PLD_BLOCK1_NON_CACHEABLE
+#define EXC_PLD_BLOCK2_BASE (0x80008000)
+#define EXC_PLD_BLOCK2_SIZE (0x00004000)
+#define EXC_PLD_BLOCK2_NON_CACHEABLE
+#define EXC_PLD_BLOCK3_BASE (0x8000c000)
+#define EXC_PLD_BLOCK3_SIZE (0x00004000)
+#define EXC_PLD_BLOCK3_NON_CACHEABLE
+
+#endif
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/hardware.h linux/include/asm-arm/arch-epxa10db/hardware.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/hardware.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/hardware.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,65 @@
+/*
+ * linux/include/asm-arm/arch-epxa10/hardware.h
+ *
+ * This file contains the hardware definitions of the Integrator.
+ *
+ * Copyright (C) 1999 ARM Limited.
+ * Copyright (C) 2001 Altera Corporation


+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by

+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *


+ * This program is distributed in the hope that it will be useful,

+ * but WITHOUT ANY WARRANTY; without even the implied warranty of


+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

+ * GNU General Public License for more details.
+ *

+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */

+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+#include <asm/arch/sizes.h>
+#include <asm/arch/platform.h>
+
+/*
+ * Where in virtual memory the IO devices (timers, system controllers
+ * and so on)
+ */
+#define IO_BASE 0xf0000000 // VA of IO
+#define IO_SIZE 0x10000000 // How much?
+#define IO_START EXC_REGISTERS_BASE // PA of IO
+/* macro to get at IO space when running virtually */
+#define IO_ADDRESS(x) ((x) | 0xf0000000)
+
+#define FLASH_VBASE 0xFE000000
+#define FLASH_SIZE 0x01000000
+#define FLASH_START EXC_EBI_BLOCK0_BASE
+#define FLASH_VADDR(x) ((x)|0xFE000000)
+/*
+ * Similar to above, but for PCI addresses (memory, IO, Config and the
+ * V3 chip itself). WARNING: this has to mirror definitions in platform.h
+ */
+#if 0
+#define PCI_MEMORY_VADDR 0xe8000000
+#define PCI_CONFIG_VADDR 0xec000000
+#define PCI_V3_VADDR 0xed000000
+#define PCI_IO_VADDR 0xee000000
+
+#define PCIO_BASE PCI_IO_VADDR
+#define PCIMEM_BASE PCI_MEMORY_VADDR
+
+
+#define pcibios_assign_all_busses() 1
+
+#define PCIBIOS_MIN_IO 0x6000
+#define PCIBIOS_MIN_MEM 0x00100000
+#endif
+
+
+#endif
+
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-epxa10db/int_ctrl00.h linux/include/asm-arm/arch-epxa10db/int_ctrl00.h
--- v2.4.13/linux/include/asm-arm/arch-epxa10db/int_ctrl00.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/arch-epxa10db/int_ctrl00.h Thu Oct 25 13:53:53 2001
@@ -0,0 +1,288 @@


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 46'
echo 'File patch-2.4.14 is continued in part 47'
echo "47" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:17 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part54

#!/bin/sh -x
# this is part 54 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 54; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ }
+}
+
+/*
+ * Check if we're the only user of a swap page,
+ * when the page is locked.
+ */
+static int exclusive_swap_page(struct page *page)
+{
+ int retval = 0;
+ struct swap_info_struct * p;
+ swp_entry_t entry;
+
+ entry.val = page->index;
+ p = swap_info_get(entry);
+ if (p) {
+ /* Is the only swap cache user the cache itself? */
+ if (p->swap_map[SWP_OFFSET(entry)] == 1) {
+ /* Recheck the page count with the pagecache lock held.. */
+ spin_lock(&pagecache_lock);
+ if (page_count(page) - !!page->buffers == 2)
+ retval = 1;
+ spin_unlock(&pagecache_lock);
+ }
+ swap_info_put(p);
+ }
+ return retval;
+}
+
+/*
+ * We can use this swap cache entry directly
+ * if there are no other references to it.
+ *
+ * Here "exclusive_swap_page()" does the real
+ * work, but we opportunistically check whether
+ * we need to get all the locks first..
+ */
+int can_share_swap_page(struct page *page)
+{
+ int retval = 0;
+
+ if (!PageLocked(page))
+ BUG();
+ switch (page_count(page)) {
+ case 3:
+ if (!page->buffers)
+ break;
+ /* Fallthrough */
+ case 2:
+ if (!PageSwapCache(page))
+ break;
+ retval = exclusive_swap_page(page);


+ break;
+ case 1:

+ if (PageReserved(page))
+ break;
+ retval = 1;
+ }
+ return retval;
+}
+
+/*
+ * Work out if there are any other processes sharing this
+ * swap cache page. Free it if you can. Return success.
+ */
+int remove_exclusive_swap_page(struct page *page)
+{
+ int retval;
+ struct swap_info_struct * p;
+ swp_entry_t entry;
+
+ if (!PageLocked(page))
+ BUG();
+ if (!PageSwapCache(page))
+ return 0;
+ if (page_count(page) - !!page->buffers != 2) /* 2: us + cache */
+ return 0;
+
+ entry.val = page->index;
+ p = swap_info_get(entry);
+ if (!p)
+ return 0;
+
+ /* Is the only swap cache user the cache itself? */
+ retval = 0;
+ if (p->swap_map[SWP_OFFSET(entry)] == 1) {
+ /* Recheck the page count with the pagecache lock held.. */
+ spin_lock(&pagecache_lock);
+ if (page_count(page) - !!page->buffers == 2) {
+ __delete_from_swap_cache(page);
+ SetPageDirty(page);
+ retval = 1;
+ }
+ spin_unlock(&pagecache_lock);
+ }
+ swap_info_put(p);
+
+ if (retval) {
+ block_flushpage(page, 0);
+ swap_free(entry);
+ page_cache_release(page);
+ }
+
+ return retval;
+}
+
+/*
+ * Free the swap entry like above, but also try to
+ * free the page cache entry if it is the last user.
+ */
+void free_swap_and_cache(swp_entry_t entry)
+{
+ struct swap_info_struct * p;
+ struct page *page = NULL;
+
+ p = swap_info_get(entry);
+ if (p) {
+ if (swap_entry_free(p, SWP_OFFSET(entry)) == 1)
+ page = find_trylock_page(&swapper_space, entry.val);
+ swap_info_put(p);
+ }
+ if (page) {
+ page_cache_get(page);
+ /* Only cache user (+us), or swap space full? Free it! */
+ if (page_count(page) == 2 || vm_swap_full()) {
+ delete_from_swap_cache(page);
+ SetPageDirty(page);
+ }
+ UnlockPage(page);
+ page_cache_release(page);
+ }
X }
X
X /*
diff -u --recursive --new-file v2.4.13/linux/mm/vmscan.c linux/mm/vmscan.c
--- v2.4.13/linux/mm/vmscan.c Tue Oct 23 22:48:53 2001
+++ linux/mm/vmscan.c Sun Nov 4 16:54:44 2001
@@ -49,8 +49,7 @@
X swp_entry_t entry;
X
X /* Don't look at this pte if it's been accessed recently. */
- if (ptep_test_and_clear_young(page_table)) {
- flush_tlb_page(vma, address);
+ if ((vma->vm_flags & VM_LOCKED) || ptep_test_and_clear_young(page_table)) {
X mark_page_accessed(page);
X return 0;
X }
@@ -75,6 +74,9 @@
X pte = ptep_get_and_clear(page_table);
X flush_tlb_page(vma, address);
X
+ if (pte_dirty(pte))
+ set_page_dirty(page);
+
X /*
X * Is the page already in the swap cache? If so, then
X * we can just drop our reference to it without doing
@@ -82,8 +84,6 @@
X */
X if (PageSwapCache(page)) {
X entry.val = page->index;
- if (pte_dirty(pte))
- set_page_dirty(page);
X swap_duplicate(entry);
X set_swap_pte:
X set_pte(page_table, swp_entry_to_pte(entry));
@@ -111,16 +111,9 @@
X * Basically, this just makes it possible for us to do
X * some real work in the future in "refill_inactive()".
X */
- if (page->mapping) {
- if (pte_dirty(pte))
- set_page_dirty(page);
+ if (page->mapping)
X goto drop_pte;
- }
- /*
- * Check PageDirty as well as pte_dirty: page may
- * have been brought back from swap by swapoff.
- */
- if (!pte_dirty(pte) && !PageDirty(page))
+ if (!PageDirty(page))
X goto drop_pte;
X
X /*
@@ -133,8 +126,12 @@
X entry = get_swap_page();
X if (!entry.val)
X break;
- /* Add it to the swap cache and mark it dirty */
+ /* Add it to the swap cache and mark it dirty
+ * (adding to the page cache will clear the dirty
+ * and uptodate bits, so we need to do it again)
+ */
X if (add_to_swap_cache(page, entry) == 0) {
+ SetPageUptodate(page);
X set_page_dirty(page);
X goto set_swap_pte;
X }
@@ -223,8 +220,8 @@
X pgd_t *pgdir;
X unsigned long end;
X
- /* Don't swap out areas which are locked down */
- if (vma->vm_flags & (VM_LOCKED|VM_RESERVED))
+ /* Don't swap out areas which are reserved */
+ if (vma->vm_flags & VM_RESERVED)
X return count;
X
X pgdir = pgd_offset(mm, address);
@@ -293,8 +290,7 @@
X int counter, nr_pages = SWAP_CLUSTER_MAX;
X struct mm_struct *mm;
X
- /* Then, look at the other mm's */
- counter = mmlist_nr / priority;
+ counter = mmlist_nr;
X do {
X if (unlikely(current->need_resched)) {
X __set_current_state(TASK_RUNNING);
@@ -330,13 +326,15 @@


X return 0;
X }
X

-static int FASTCALL(shrink_cache(int nr_pages, int max_mapped, zone_t * classzone, unsigned int gfp_mask));
-static int shrink_cache(int nr_pages, int max_mapped, zone_t * classzone, unsigned int gfp_mask)
+static int FASTCALL(shrink_cache(int nr_pages, zone_t * classzone, unsigned int gfp_mask, int priority));
+static int shrink_cache(int nr_pages, zone_t * classzone, unsigned int gfp_mask, int priority)
X {
X struct list_head * entry;
+ int max_scan = nr_inactive_pages / priority;
+ int max_mapped = nr_pages << (9 - priority);
X
X spin_lock(&pagemap_lru_lock);
- while (max_mapped && (entry = inactive_list.prev) != &inactive_list) {
+ while (--max_scan >= 0 && (entry = inactive_list.prev) != &inactive_list) {
X struct page * page;
X
X if (unlikely(current->need_resched)) {
@@ -355,11 +353,18 @@
X list_del(entry);
X list_add(entry, &inactive_list);
X
+ /*
+ * Zero page counts can happen because we unlink the pages
+ * _after_ decrementing the usage count..
+ */
+ if (unlikely(!page_count(page)))
+ continue;
+
X if (!memclass(page->zone, classzone))
X continue;
X
X /* Racy check to avoid trylocking when not worthwhile */
- if (!page->buffers && page_count(page) != 1)
+ if (!page->buffers && (page_count(page) != 1 || !page->mapping))
X goto page_mapped;
X
X /*
@@ -452,29 +457,35 @@
X }
X }
X
- if (unlikely(!page->mapping))
- BUG();
+ spin_lock(&pagecache_lock);
X
- if (unlikely(!spin_trylock(&pagecache_lock))) {
- /* we hold the page lock so the page cannot go away from under us */
- spin_unlock(&pagemap_lru_lock);
+ /*
+ * this is the non-racy check for busy page.
+ */
+ if (!page->mapping || !is_page_cache_freeable(page)) {
+ spin_unlock(&pagecache_lock);
+ UnlockPage(page);
+page_mapped:
+ if (--max_mapped >= 0)
+ continue;
X
- spin_lock(&pagecache_lock);
- spin_lock(&pagemap_lru_lock);
+ /*
+ * Alert! We've found too many mapped pages on the
+ * inactive list, so we start swapping out now!
+ */
+ spin_unlock(&pagemap_lru_lock);
+ swap_out(priority, gfp_mask, classzone);
+ return nr_pages;
X }
X
X /*
- * this is the non-racy check, it is critical to check
- * PageDirty _after_ we made sure the page is freeable
- * so not in use by anybody.
+ * It is critical to check PageDirty _after_ we made sure
+ * the page is freeable* so not in use by anybody.
X */
- if (!is_page_cache_freeable(page) || PageDirty(page)) {
+ if (PageDirty(page)) {
X spin_unlock(&pagecache_lock);
X UnlockPage(page);
-page_mapped:
- if (--max_mapped)
- continue;
- break;
+ continue;
X }
X
X /* point of no return */
@@ -530,6 +541,7 @@
X
X del_page_from_active_list(page);
X add_page_to_inactive_list(page);
+ SetPageReferenced(page);
X }
X spin_unlock(&pagemap_lru_lock);
X }
@@ -537,7 +549,6 @@
X static int FASTCALL(shrink_caches(zone_t * classzone, int priority, unsigned int gfp_mask, int nr_pages));
X static int shrink_caches(zone_t * classzone, int priority, unsigned int gfp_mask, int nr_pages)
X {
- int max_scan;
X int chunk_size = nr_pages;
X unsigned long ratio;
X
@@ -550,8 +561,7 @@
X ratio = (unsigned long) nr_pages * nr_active_pages / ((nr_inactive_pages + 1) * 2);
X refill_inactive(ratio);
X
- max_scan = nr_inactive_pages / priority;
- nr_pages = shrink_cache(nr_pages, max_scan, classzone, gfp_mask);
+ nr_pages = shrink_cache(nr_pages, classzone, gfp_mask, priority);
X if (nr_pages <= 0)
X return 0;
X
@@ -566,7 +576,6 @@
X
X int try_to_free_pages(zone_t *classzone, unsigned int gfp_mask, unsigned int order)
X {
- int ret = 0;
X int priority = DEF_PRIORITY;
X int nr_pages = SWAP_CLUSTER_MAX;
X
@@ -574,11 +583,14 @@
X nr_pages = shrink_caches(classzone, priority, gfp_mask, nr_pages);
X if (nr_pages <= 0)
X return 1;
-
- ret |= swap_out(priority, gfp_mask, classzone);
X } while (--priority);
X
- return ret;
+ /*
+ * Hmm.. Cache shrink failed - time to kill something?
+ * Mhwahahhaha! This is the part I really like. Giggle.
+ */
+ out_of_memory();
+ return 0;
X }
X
X DECLARE_WAIT_QUEUE_HEAD(kswapd_wait);
@@ -633,9 +645,6 @@
X do
X need_more_balance |= kswapd_balance_pgdat(pgdat);
X while ((pgdat = pgdat->node_next));
- if (need_more_balance && out_of_memory()) {
- oom_kill();
- }
X } while (need_more_balance);
X }
X
diff -u --recursive --new-file v2.4.13/linux/net/802/Makefile linux/net/802/Makefile
--- v2.4.13/linux/net/802/Makefile Fri Dec 29 14:07:24 2000
+++ linux/net/802/Makefile Tue Oct 30 15:08:12 2001
@@ -58,6 +58,3 @@
X
X cl2llc.c: cl2llc.pre
X sed -f ./pseudo/opcd2num.sed cl2llc.pre >cl2llc.c
-
-tar:
- tar -cvf /dev/f1 .
diff -u --recursive --new-file v2.4.13/linux/net/8021q/Makefile linux/net/8021q/Makefile
--- v2.4.13/linux/net/8021q/Makefile Wed Dec 31 16:00:00 1969
+++ linux/net/8021q/Makefile Tue Oct 30 15:08:12 2001
@@ -0,0 +1,15 @@
+#
+# Makefile for the Linux VLAN layer.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+# Note 2! The CFLAGS definition is now in the main makefile...
+
+O_TARGET := 8021q.o
+
+obj-y := vlan.o vlanproc.o vlan_dev.o
+obj-m := $(O_TARGET)
+
+include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.13/linux/net/8021q/vlan.c linux/net/8021q/vlan.c
--- v2.4.13/linux/net/8021q/vlan.c Wed Dec 31 16:00:00 1969
+++ linux/net/8021q/vlan.c Tue Oct 30 15:08:12 2001
@@ -0,0 +1,622 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Ethernet-type device handling.
+ *
+ * Authors: Ben Greear <gre...@candelatech.com>, <gre...@agcs.com>
+ *
+ * Fixes:
+ * Fix for packet capture - Nick Eggleston <ni...@dccinc.com>;
+ *
+ *


+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License

+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <asm/uaccess.h> /* for copy_from_user */
+#include <linux/module.h>
+#include <linux/netdevice.h>
+#include <linux/skbuff.h>
+#include <net/datalink.h>
+#include <linux/mm.h>
+#include <linux/in.h>
+#include <linux/init.h>
+#include <net/p8022.h>
+#include <net/arp.h>
+#include <linux/rtnetlink.h>
+#include <linux/brlock.h>
+#include <linux/notifier.h>
+
+#include <linux/if_vlan.h>
+#include "vlan.h"
+#include "vlanproc.h"
+
+/* Global VLAN variables */
+


+/* Our listing of VLAN group(s) */

+struct vlan_group *p802_1Q_vlan_list;
+
+static char vlan_fullname[] = "802.1Q VLAN Support";
+static unsigned int vlan_version = 1;
+static unsigned int vlan_release = 5;
+static char vlan_copyright[] = " Ben Greear <gre...@candelatech.com>";
+
+static int vlan_device_event(struct notifier_block *, unsigned long, void *);
+
+struct notifier_block vlan_notifier_block = {
+ notifier_call: vlan_device_event,
+};
+
+/* These may be changed at run-time through IOCTLs */
+
+/* Determines interface naming scheme. */
+unsigned short vlan_name_type = VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD;
+
+/* Counter for how many NON-VLAN protos we've received on a VLAN. */
+unsigned long vlan_bad_proto_recvd = 0;
+
+/* DO reorder the header by default */
+unsigned short vlan_default_dev_flags = 1;
+
+static struct packet_type vlan_packet_type = {
+ type: __constant_htons(ETH_P_8021Q),
+ dev: NULL,
+ func: vlan_skb_recv, /* VLAN receive method */
+ data: (void *)(-1), /* Set here '(void *)1' when this code can SHARE SKBs */
+ next: NULL
+};
+
+/* End of global variables definitions. */
+
+/*
+ * Function vlan_proto_init (pro)
+ *
+ * Initialize VLAN protocol layer,
+ *
+ */
+static int __init vlan_proto_init(void)
+{
+ int err;
+
+ printk(VLAN_INF "%s v%u.%u %s\n",
+ vlan_fullname, vlan_version, vlan_release, vlan_copyright);
+
+ /* proc file system initialization */
+ err = vlan_proc_init();
+ if (err < 0) {
+ printk(KERN_ERR __FUNCTION__
+ "%s: can't create entry in proc filesystem!\n",
+ VLAN_NAME);


+ return 1;
+ }
+

+ dev_add_pack(&vlan_packet_type);
+
+ /* Register us to receive netdevice events */
+ register_netdevice_notifier(&vlan_notifier_block);
+
+ vlan_ioctl_hook = vlan_ioctl_handler;
+
+ printk(VLAN_INF "%s Initialization complete.\n", VLAN_NAME);


+ return 0;
+}
+

+/*
+ * Module 'remove' entry point.
+ * o delete /proc/net/router directory and static entries.
+ */
+static void __exit vlan_cleanup_module(void)
+{
+ /* Un-register us from receiving netdevice events */
+ unregister_netdevice_notifier(&vlan_notifier_block);
+
+ dev_remove_pack(&vlan_packet_type);
+ vlan_proc_cleanup();
+
+ vlan_ioctl_hook = NULL;
+}
+
+module_init(vlan_proto_init);
+module_exit(vlan_cleanup_module);
+
+/** Will search linearly for now, based on device index. Could
+ * hash, or directly link, this some day. --Ben
+ * TODO: Potential performance issue here. Linear search where N is
+ * the number of 'real' devices used by VLANs.
+ */
+struct vlan_group* vlan_find_group(int real_dev_ifindex)
+{
+ struct vlan_group *grp = NULL;
+
+ br_read_lock_bh(BR_NETPROTO_LOCK);
+ for (grp = p802_1Q_vlan_list;
+ ((grp != NULL) && (grp->real_dev_ifindex != real_dev_ifindex));
+ grp = grp->next) {
+ /* nothing */ ;
+ }
+ br_read_unlock_bh(BR_NETPROTO_LOCK);
+
+ return grp;
+}
+
+/* Find the protocol handler. Assumes VID < 0xFFF.


+ */
+struct net_device *find_802_1Q_vlan_dev(struct net_device *real_dev,
+ unsigned short VID)

+{
+ struct vlan_group *grp = vlan_find_group(real_dev->ifindex);
+
+ if (grp)
+ return grp->vlan_devices[VID];
+


+ return NULL;
+}
+

+/** This method will explicitly do a dev_put on the device if do_dev_put
+ * is TRUE. This gets around a difficulty with reference counting, and
+ * the unregister-by-name (below). If do_locks is true, it will grab
+ * a lock before un-registering. If do_locks is false, it is assumed that
+ * the lock has already been grabbed externally... --Ben
+ */
+int unregister_802_1Q_vlan_dev(int real_dev_ifindex, unsigned short vlan_id,
+ int do_dev_put, int do_locks)
+{
+ struct net_device *dev = NULL;
+ struct vlan_group *grp;
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": VID: %i\n", vlan_id);
+#endif
+
+ /* sanity check */
+ if ((vlan_id >= 0xFFF) || (vlan_id <= 0))
+ return -EINVAL;
+
+ grp = vlan_find_group(real_dev_ifindex);
+ if (grp) {
+ dev = grp->vlan_devices[vlan_id];
+ if (dev) {
+ /* Remove proc entry */
+ vlan_proc_rem_dev(dev);
+
+ /* Take it out of our own structures */
+ grp->vlan_devices[vlan_id] = NULL;
+
+ /* Take it out of the global list of devices.
+ * NOTE: This deletes dev, don't access it again!!
+ */
+
+ if (do_dev_put)
+ dev_put(dev);
+
+ /* TODO: Please review this code. */
+ if (do_locks) {
+ rtnl_lock();
+ unregister_netdevice(dev);
+ rtnl_unlock();
+ } else {
+ unregister_netdevice(dev);
+ }
+
+ MOD_DEC_USE_COUNT;
+ }
+ }
+
+ return 0;
+}
+
+int unregister_802_1Q_vlan_device(const char *vlan_IF_name)
+{
+ struct net_device *dev = NULL;
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": unregister VLAN by name, name -:%s:-\n",
+ vlan_IF_name);
+#endif
+
+ dev = dev_get_by_name(vlan_IF_name);
+ if (dev) {
+ if (dev->priv_flags & IFF_802_1Q_VLAN) {
+ return unregister_802_1Q_vlan_dev(
+ VLAN_DEV_INFO(dev)->real_dev->ifindex,
+ (unsigned short)(VLAN_DEV_INFO(dev)->vlan_id),
+ 1 /* do dev_put */, 1 /* do locking */);
+ } else {
+ printk(VLAN_ERR __FUNCTION__
+ ": ERROR: Tried to remove a non-vlan device "
+ "with VLAN code, name: %s priv_flags: %hX\n",
+ dev->name, dev->priv_flags);
+ dev_put(dev);
+ return -EPERM;
+ }
+ } else {
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": WARNING: Could not find dev.\n");
+#endif


+ return -EINVAL;
+ }
+}

+
+/* Attach a VLAN device to a mac address (ie Ethernet Card).
+ * Returns the device that was created, or NULL if there was
+ * an error of some kind.
+ */
+struct net_device *register_802_1Q_vlan_device(const char* eth_IF_name,
+ unsigned short VLAN_ID)
+{
+ struct vlan_group *grp;
+ struct net_device *new_dev;
+ struct net_device *real_dev; /* the ethernet device */
+ int malloc_size = 0;
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": if_name -:%s:- vid: %i\n",
+ eth_IF_name, VLAN_ID);
+#endif
+
+ if (VLAN_ID >= 0xfff)
+ goto out_ret_null;
+
+ /* find the device relating to eth_IF_name. */
+ real_dev = dev_get_by_name(eth_IF_name);
+ if (!real_dev)
+ goto out_ret_null;
+
+ /* TODO: Make sure this device can really handle having a VLAN attached
+ * to it...
+ */
+ if (find_802_1Q_vlan_dev(real_dev, VLAN_ID)) {
+ /* was already registered. */
+ printk(VLAN_DBG __FUNCTION__ ": ALREADY had VLAN registered\n");
+ dev_put(real_dev);


+ return NULL;
+ }
+

+ malloc_size = (sizeof(struct net_device));
+ new_dev = (struct net_device *) kmalloc(malloc_size, GFP_KERNEL);
+ VLAN_MEM_DBG("net_device malloc, addr: %p size: %i\n",
+ new_dev, malloc_size);
+
+ if (new_dev == NULL)
+ goto out_put_dev;
+
+ memset(new_dev, 0, malloc_size);
+
+ /* set us up to not use a Qdisc, as the underlying Hardware device
+ * can do all the queueing we could want.
+ */
+ /* new_dev->qdisc_sleeping = &noqueue_qdisc; Not needed it seems. */
+ new_dev->tx_queue_len = 0; /* This should effectively give us no queue. */
+
+ /* Gotta set up the fields for the device. */
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG "About to allocate name, vlan_name_type: %i\n",
+ vlan_name_type);
+#endif
+ switch (vlan_name_type) {
+ case VLAN_NAME_TYPE_RAW_PLUS_VID:
+ /* name will look like: eth1.0005 */
+ sprintf(new_dev->name, "%s.%.4i", real_dev->name, VLAN_ID);
+ break;
+ case VLAN_NAME_TYPE_PLUS_VID_NO_PAD:
+ /* Put our vlan.VID in the name.
+ * Name will look like: vlan5
+ */
+ sprintf(new_dev->name, "vlan%i", VLAN_ID);
+ break;
+ case VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD:
+ /* Put our vlan.VID in the name.
+ * Name will look like: eth0.5
+ */
+ sprintf(new_dev->name, "%s.%i", real_dev->name, VLAN_ID);
+ break;
+ case VLAN_NAME_TYPE_PLUS_VID:
+ /* Put our vlan.VID in the name.
+ * Name will look like: vlan0005
+ */
+ default:
+ sprintf(new_dev->name, "vlan%.4i", VLAN_ID);
+ };
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG "Allocated new name -:%s:-\n", new_dev->name);
+#endif
+ /* set up method calls */
+ new_dev->init = vlan_dev_init;
+ new_dev->destructor = vlan_dev_destruct;
+
+ /* new_dev->ifindex = 0; it will be set when added to
+ * the global list.
+ * iflink is set as well.
+ */
+ new_dev->get_stats = vlan_dev_get_stats;
+
+ /* IFF_BROADCAST|IFF_MULTICAST; ??? */
+ new_dev->flags = real_dev->flags;
+ new_dev->flags &= ~IFF_UP;
+
+ /* Make this thing known as a VLAN device */
+ new_dev->priv_flags |= IFF_802_1Q_VLAN;
+
+ /* need 4 bytes for extra VLAN header info,
+ * hope the underlying device can handle it.
+ */
+ new_dev->mtu = real_dev->mtu;
+ new_dev->change_mtu = vlan_dev_change_mtu;
+
+ /* TODO: maybe just assign it to be ETHERNET? */
+ new_dev->type = real_dev->type;
+
+ /* Regular ethernet + 4 bytes (18 total). */
+ new_dev->hard_header_len = VLAN_HLEN + real_dev->hard_header_len;
+
+ new_dev->priv = kmalloc(sizeof(struct vlan_dev_info),
+ GFP_KERNEL);
+ VLAN_MEM_DBG("new_dev->priv malloc, addr: %p size: %i\n",
+ new_dev->priv,
+ sizeof(struct vlan_dev_info));
+
+ if (new_dev->priv == NULL) {
+ kfree(new_dev);
+ goto out_put_dev;
+ }
+
+ memset(new_dev->priv, 0, sizeof(struct vlan_dev_info));
+
+ memcpy(new_dev->broadcast, real_dev->broadcast, real_dev->addr_len);
+ memcpy(new_dev->dev_addr, real_dev->dev_addr, real_dev->addr_len);
+ new_dev->addr_len = real_dev->addr_len;
+
+ new_dev->open = vlan_dev_open;
+ new_dev->stop = vlan_dev_stop;
+ new_dev->hard_header = vlan_dev_hard_header;
+
+ new_dev->hard_start_xmit = vlan_dev_hard_start_xmit;
+ new_dev->rebuild_header = vlan_dev_rebuild_header;
+ new_dev->hard_header_parse = real_dev->hard_header_parse;
+ new_dev->set_mac_address = vlan_dev_set_mac_address;
+ new_dev->set_multicast_list = vlan_dev_set_multicast_list;
+
+ VLAN_DEV_INFO(new_dev)->vlan_id = VLAN_ID; /* 1 through 0xFFF */
+ VLAN_DEV_INFO(new_dev)->real_dev = real_dev;
+ VLAN_DEV_INFO(new_dev)->dent = NULL;
+ VLAN_DEV_INFO(new_dev)->flags = vlan_default_dev_flags;
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG "About to go find the group for idx: %i\n",
+ real_dev->ifindex);
+#endif
+
+ /* So, got the sucker initialized, now lets place
+ * it into our local structure.
+ */
+ grp = vlan_find_group(real_dev->ifindex);
+ if (!grp) { /* need to add a new group */
+ grp = kmalloc(sizeof(struct vlan_group), GFP_KERNEL);
+ VLAN_MEM_DBG("grp malloc, addr: %p size: %i\n",
+ grp, sizeof(struct vlan_group));
+ if (!grp) {
+ kfree(new_dev->priv);
+ VLAN_FMEM_DBG("new_dev->priv free, addr: %p\n",
+ new_dev->priv);
+ kfree(new_dev);
+ VLAN_FMEM_DBG("new_dev free, addr: %p\n", new_dev);
+
+ goto out_put_dev;
+ }
+
+ printk(KERN_ALERT "VLAN REGISTER: Allocated new group.\n");
+ memset(grp, 0, sizeof(struct vlan_group));
+ grp->real_dev_ifindex = real_dev->ifindex;
+
+ br_write_lock_bh(BR_NETPROTO_LOCK);
+ grp->next = p802_1Q_vlan_list;
+ p802_1Q_vlan_list = grp;
+ br_write_unlock_bh(BR_NETPROTO_LOCK);
+ }
+
+ grp->vlan_devices[VLAN_ID] = new_dev;
+ vlan_proc_add_dev(new_dev); /* create it's proc entry */
+
+ /* TODO: Please check this: RTNL --Ben */
+ rtnl_lock();
+ register_netdevice(new_dev);
+ rtnl_unlock();
+
+ /* NOTE: We have a reference to the real device,
+ * so hold on to the reference.
+ */
+ MOD_INC_USE_COUNT; /* Add was a success!! */
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG "Allocated new device successfully, returning.\n");
+#endif
+ return new_dev;
+
+out_put_dev:
+ dev_put(real_dev);
+
+out_ret_null:


+ return 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;
+ int i = 0;
+ struct net_device *vlandev = NULL;
+
+ switch (event) {
+ case NETDEV_CHANGEADDR:
+ /* Ignore for now */
+ break;
+
+ case NETDEV_GOING_DOWN:
+ /* Ignore for now */
+ break;
+
+ case NETDEV_DOWN:
+ /* TODO: Please review this code. */
+ /* put all related VLANs in the down state too. */
+ for (grp = p802_1Q_vlan_list; grp != NULL; grp = grp->next) {
+ int flgs = 0;
+
+ for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
+ vlandev = grp->vlan_devices[i];
+ if (!vlandev ||
+ (VLAN_DEV_INFO(vlandev)->real_dev != dev) ||
+ (!(vlandev->flags & IFF_UP)))
+ continue;
+
+ flgs = vlandev->flags;
+ flgs &= ~IFF_UP;
+ dev_change_flags(vlandev, flgs);
+ }
+ }
+ break;
+
+ case NETDEV_UP:
+ /* TODO: Please review this code. */
+ /* put all related VLANs in the down state too. */
+ for (grp = p802_1Q_vlan_list; grp != NULL; grp = grp->next) {
+ int flgs;
+
+ for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
+ vlandev = grp->vlan_devices[i];
+ if (!vlandev ||
+ (VLAN_DEV_INFO(vlandev)->real_dev != dev) ||
+ (vlandev->flags & IFF_UP))
+ continue;
+
+ flgs = vlandev->flags;
+ flgs |= IFF_UP;
+ dev_change_flags(vlandev, flgs);
+ }
+ }
+ break;
+
+ case NETDEV_UNREGISTER:
+ /* TODO: Please review this code. */
+ /* delete all related VLANs. */
+ for (grp = p802_1Q_vlan_list; grp != NULL; grp = grp->next) {
+ for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
+ vlandev = grp->vlan_devices[i];
+ if (!vlandev ||
+ (VLAN_DEV_INFO(vlandev)->real_dev != dev))
+ continue;
+
+ unregister_802_1Q_vlan_dev(
+ VLAN_DEV_INFO(vlandev)->real_dev->ifindex,
+ VLAN_DEV_INFO(vlandev)->vlan_id,
+ 0, 0);
+ vlandev = NULL;
+ }
+ }
+ break;
+ };
+
+ return NOTIFY_DONE;
+}
+
+/*
+ * VLAN IOCTL handler.
+ * o execute requested action or pass command to the device driver
+ * arg is really a void* to a vlan_ioctl_args structure.
+ */
+int vlan_ioctl_handler(unsigned long arg)
+{
+ int err = 0;
+ struct vlan_ioctl_args args;
+
+ /* everything here needs root permissions, except aguably the
+ * hack ioctls for sending packets. However, I know _I_ don't
+ * want users running that on my network! --BLG
+ */
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
+ if (copy_from_user(&args, (void*)arg,
+ sizeof(struct vlan_ioctl_args)))
+ return -EFAULT;
+
+ /* Null terminate this sucker, just in case. */
+ args.device1[23] = 0;
+ args.u.device2[23] = 0;
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": args.cmd: %x\n", args.cmd);
+#endif
+
+ switch (args.cmd) {
+ case SET_VLAN_INGRESS_PRIORITY_CMD:
+ err = vlan_dev_set_ingress_priority(args.device1,
+ args.u.skb_priority,
+ args.vlan_qos);
+ break;
+
+ case SET_VLAN_EGRESS_PRIORITY_CMD:
+ err = vlan_dev_set_egress_priority(args.device1,
+ args.u.skb_priority,
+ args.vlan_qos);
+ break;
+
+ case SET_VLAN_FLAG_CMD:
+ err = vlan_dev_set_vlan_flag(args.device1,
+ args.u.flag,
+ args.vlan_qos);
+ break;
+
+ case SET_VLAN_NAME_TYPE_CMD:
+ if ((args.u.name_type >= 0) &&
+ (args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) {
+ vlan_name_type = args.u.name_type;
+ err = 0;
+ } else {
+ err = -EINVAL;
+ }
+ break;
+
+ /* TODO: Figure out how to pass info back...
+ case GET_VLAN_INGRESS_PRIORITY_IOCTL:
+ err = vlan_dev_get_ingress_priority(args);
+ break;
+
+ case GET_VLAN_EGRESS_PRIORITY_IOCTL:
+ err = vlan_dev_get_egress_priority(args);
+ break;
+ */
+
+ case ADD_VLAN_CMD:
+ /* we have been given the name of the Ethernet Device we want to
+ * talk to: args.dev1 We also have the
+ * VLAN ID: args.u.VID
+ */
+ if (register_802_1Q_vlan_device(args.device1, args.u.VID)) {
+ err = 0;
+ } else {
+ err = -EINVAL;
+ }
+ break;
+
+ case DEL_VLAN_CMD:
+ /* Here, the args.dev1 is the actual VLAN we want
+ * to get rid of.
+ */
+ err = unregister_802_1Q_vlan_device(args.device1);


+ break;
+
+ default:

+ /* pass on to underlying device instead?? */
+ printk(VLAN_DBG __FUNCTION__ ": Unknown VLAN CMD: %x \n",
+ args.cmd);


+ return -EINVAL;
+ };
+

+ return err;
+}
+

+
diff -u --recursive --new-file v2.4.13/linux/net/8021q/vlan.h linux/net/8021q/vlan.h
--- v2.4.13/linux/net/8021q/vlan.h Wed Dec 31 16:00:00 1969
+++ linux/net/8021q/vlan.h Tue Oct 30 15:08:12 2001
@@ -0,0 +1,43 @@
+#ifndef __BEN_VLAN_802_1Q_INC__
+#define __BEN_VLAN_802_1Q_INC__
+
+#include <linux/if_vlan.h>
+
+/* Uncomment this if you want debug traces to be shown. */
+/* #define VLAN_DEBUG */
+
+#define VLAN_ERR KERN_ERR
+#define VLAN_INF KERN_ALERT
+#define VLAN_DBG KERN_ALERT /* change these... to debug, having a hard time
+ * changing the log level at run-time..for some reason.
+ */
+
+/*
+
+These I use for memory debugging. I feared a leak at one time, but
+I never found it..and the problem seems to have dissappeared. Still,
+I'll bet they might prove useful again... --Ben
+
+
+#define VLAN_MEM_DBG(x, y, z) printk(VLAN_DBG __FUNCTION__ ": " x, y, z);
+#define VLAN_FMEM_DBG(x, y) printk(VLAN_DBG __FUNCTION__ ": " x, y);
+*/
+
+/* This way they don't do anything! */
+#define VLAN_MEM_DBG(x, y, z)
+#define VLAN_FMEM_DBG(x, y)
+
+
+extern unsigned short vlan_name_type;
+
+/* Counter for how many NON-VLAN protos we've received on a VLAN. */
+extern unsigned long vlan_bad_proto_recvd;
+
+int vlan_ioctl_handler(unsigned long arg);
+
+/* Add some headers for the public VLAN methods. */
+int unregister_802_1Q_vlan_device(const char* vlan_IF_name);
+struct net_device *register_802_1Q_vlan_device(const char* eth_IF_name,
+ unsigned short VID);
+
+#endif /* !(__BEN_VLAN_802_1Q_INC__) */
diff -u --recursive --new-file v2.4.13/linux/net/8021q/vlan_dev.c linux/net/8021q/vlan_dev.c
--- v2.4.13/linux/net/8021q/vlan_dev.c Wed Dec 31 16:00:00 1969
+++ linux/net/8021q/vlan_dev.c Tue Oct 30 15:08:12 2001
@@ -0,0 +1,779 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Ethernet-type device handling.
+ *
+ * Authors: Ben Greear <gre...@candelatech.com>, <gre...@agcs.com>
+ *
+ * Fixes: Mar 22 2001: Martin Bokaemper <mboka...@unispherenetworks.com>
+ * - reset skb->pkt_type on incoming packets when MAC was changed
+ * - see that changed MAC is saddr for outgoing packets
+ * Oct 20, 2001: Ard van Breeman:
+ * - Fix MC-list, finally.
+ * - Flush MC-list on VLAN destroy.
+ *
+ *


+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License

+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.


+ */
+
+#include <linux/module.h>

+#include <linux/mm.h>
+#include <linux/in.h>
+#include <linux/init.h>
+#include <asm/uaccess.h> /* for copy_from_user */
+#include <linux/skbuff.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <net/datalink.h>
+#include <net/p8022.h>
+#include <net/arp.h>
+#include <linux/brlock.h>
+
+#include "vlan.h"
+#include "vlanproc.h"
+#include <linux/if_vlan.h>
+#include <net/ip.h>
+
+struct net_device_stats *vlan_dev_get_stats(struct net_device *dev)
+{
+ return &(((struct vlan_dev_info *)(dev->priv))->dev_stats);
+}
+
+
+/*
+ * Rebuild the Ethernet MAC header. This is called after an ARP
+ * (or in future other address resolution) has completed on this
+ * sk_buff. We now let ARP fill in the other fields.
+ *
+ * This routine CANNOT use cached dst->neigh!
+ * Really, it is used only when dst->neigh is wrong.
+ *
+ * TODO: This needs a checkup, I'm ignorant here. --BLG
+ */
+int vlan_dev_rebuild_header(struct sk_buff *skb)
+{
+ struct net_device *dev = skb->dev;
+ struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);
+
+ switch (veth->h_vlan_encapsulated_proto) {
+#ifdef CONFIG_INET
+ case __constant_htons(ETH_P_IP):
+
+ /* TODO: Confirm this will work with VLAN headers... */
+ return arp_find(veth->h_dest, skb);
+#endif
+ default:
+ printk(VLAN_DBG
+ "%s: unable to resolve type %X addresses.\n",
+ dev->name, (int)veth->h_vlan_encapsulated_proto);
+
+ memcpy(veth->h_source, dev->dev_addr, ETH_ALEN);
+ break;
+ };


+
+ return 0;
+}
+

+/*
+ * Determine the packet's protocol ID. The rule here is that we
+ * assume 802.3 if the type field is short enough to be a length.
+ * This is normal practice and works for any 'now in use' protocol.
+ *
+ * Also, at this point we assume that we ARE dealing exclusively with
+ * VLAN packets, or packets that should be made into VLAN packets based
+ * on a default VLAN ID.
+ *
+ * NOTE: Should be similar to ethernet/eth.c.
+ *
+ * SANITY NOTE: This method is called when a packet is moving up the stack
+ * towards userland. To get here, it would have already passed
+ * through the ethernet/eth.c eth_type_trans() method.
+ * SANITY NOTE 2: We are referencing to the VLAN_HDR frields, which MAY be
+ * stored UNALIGNED in the memory. RISC systems don't like
+ * such cases very much...
+ * SANITY NOTE 2a: According to Dave Miller & Alexey, it will always be aligned,
+ * so there doesn't need to be any of the unaligned stuff. It has
+ * been commented out now... --Ben
+ *
+ */


+int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
+ struct packet_type* ptype)

+{
+ unsigned char *rawp = NULL;
+ struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data);
+ unsigned short vid;
+ struct net_device_stats *stats;
+ unsigned short vlan_TCI;
+ unsigned short proto;
+
+ /* vlan_TCI = ntohs(get_unaligned(&vhdr->h_vlan_TCI)); */
+ vlan_TCI = ntohs(vhdr->h_vlan_TCI);
+
+ vid = (vlan_TCI & 0xFFF);
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": skb: %p vlan_id: %hx\n",
+ skb, vid);
+#endif
+
+ /* Ok, we will find the correct VLAN device, strip the header,
+ * and then go on as usual.
+ */
+
+ /* we have 12 bits of vlan ID. */
+ /* If it's NULL, we will tag it to be junked below */
+ skb->dev = find_802_1Q_vlan_dev(dev, vid);
+
+ if (!skb->dev) {
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": ERROR: No net_device for VID: %i on dev: %s [%i]\n",
+ (unsigned int)(vid), dev->name, dev->ifindex);
+#endif
+ kfree_skb(skb);
+ return -1;
+ }
+
+ /* Bump the rx counters for the VLAN device. */
+ stats = vlan_dev_get_stats(skb->dev);
+ stats->rx_packets++;
+ stats->rx_bytes += skb->len;
+
+ skb_pull(skb, VLAN_HLEN); /* take off the VLAN header (4 bytes currently) */
+
+ /* Ok, lets check to make sure the device (dev) we
+ * came in on is what this VLAN is attached to.
+ */
+
+ if (dev != VLAN_DEV_INFO(skb->dev)->real_dev) {
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": dropping skb: %p because came in on wrong device, dev: %s real_dev: %s, skb_dev: %s\n",
+ skb, dev->name, VLAN_DEV_INFO(skb->dev)->real_dev->name, skb->dev->name);
+#endif
+ kfree_skb(skb);
+ stats->rx_errors++;
+ return -1;
+ }
+
+ /*
+ * Deal with ingress priority mapping.
+ */
+ skb->priority = VLAN_DEV_INFO(skb->dev)->ingress_priority_map[(ntohs(vhdr->h_vlan_TCI) >> 13) & 0x7];
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": priority: %lu for TCI: %hu (hbo)\n",
+ (unsigned long)(skb->priority), ntohs(vhdr->h_vlan_TCI));
+#endif
+
+ /* The ethernet driver already did the pkt_type calculations
+ * for us...
+ */
+ switch (skb->pkt_type) {
+ case PACKET_BROADCAST: /* Yeah, stats collect these together.. */
+ // stats->broadcast ++; // no such counter :-(
+ case PACKET_MULTICAST:
+ stats->multicast++;
+ break;
+ case PACKET_OTHERHOST:
+ /* Our lower layer thinks this is not local, let's make sure.
+ * This allows the VLAN to have a different MAC than the underlying
+ * device, and still route correctly.
+ */
+ if (memcmp(skb->mac.ethernet->h_dest, skb->dev->dev_addr, ETH_ALEN) == 0) {
+ /* It is for our (changed) MAC-address! */
+ skb->pkt_type = PACKET_HOST;


+ }
+ break;
+ default:

+ break;
+ };
+
+ /* Was a VLAN packet, grab the encapsulated protocol, which the layer
+ * three protocols care about.
+ */
+ /* proto = get_unaligned(&vhdr->h_vlan_encapsulated_proto); */
+ proto = vhdr->h_vlan_encapsulated_proto;
+
+ skb->protocol = proto;
+ if (ntohs(proto) >= 1536) {
+ /* place it back on the queue to be handled by
+ * true layer 3 protocols.
+ */
+
+ /* See if we are configured to re-write the VLAN header
+ * to make it look like ethernet...
+ */
+ skb = vlan_check_reorder_header(skb);
+
+ /* Can be null if skb-clone fails when re-ordering */
+ if (skb) {
+ netif_rx(skb);
+ } else {
+ /* TODO: Add a more specific counter here. */
+ stats->rx_errors++;


+ }
+ return 0;
+ }
+

+ rawp = skb->data;
+
+ /*
+ * This is a magic hack to spot IPX packets. Older Novell breaks
+ * the protocol design and runs IPX over 802.3 without an 802.2 LLC
+ * layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
+ * won't work for fault tolerant netware but does for the rest.
+ */
+ if (*(unsigned short *)rawp == 0xFFFF) {
+ skb->protocol = __constant_htons(ETH_P_802_3);
+ /* place it back on the queue to be handled by true layer 3 protocols.
+ */
+
+ /* See if we are configured to re-write the VLAN header
+ * to make it look like ethernet...
+ */
+ skb = vlan_check_reorder_header(skb);
+
+ /* Can be null if skb-clone fails when re-ordering */
+ if (skb) {
+ netif_rx(skb);
+ } else {
+ /* TODO: Add a more specific counter here. */
+ stats->rx_errors++;


+ }
+ return 0;
+ }
+

+ /*
+ * Real 802.2 LLC
+ */
+ skb->protocol = __constant_htons(ETH_P_802_2);
+ /* place it back on the queue to be handled by upper layer protocols.
+ */
+
+ /* See if we are configured to re-write the VLAN header
+ * to make it look like ethernet...
+ */
+ skb = vlan_check_reorder_header(skb);
+
+ /* Can be null if skb-clone fails when re-ordering */
+ if (skb) {
+ netif_rx(skb);
+ } else {
+ /* TODO: Add a more specific counter here. */
+ stats->rx_errors++;


+ }
+ return 0;
+}
+

+/*
+ * Create the VLAN header for an arbitrary protocol layer
+ *
+ * saddr=NULL means use device source address
+ * daddr=NULL means leave destination address (eg unresolved arp)
+ *
+ * This is called when the SKB is moving down the stack towards the
+ * physical devices.
+ */


+int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
+ unsigned short type, void *daddr, void *saddr,
+ unsigned len)

+{
+ struct vlan_hdr *vhdr;
+ unsigned short veth_TCI = 0;
+ int rc = 0;
+ int build_vlan_header = 0;
+ struct net_device *vdev = dev; /* save this for the bottom of the method */
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": skb: %p type: %hx len: %x vlan_id: %hx, daddr: %p\n",
+ skb, type, len, VLAN_DEV_INFO(dev)->vlan_id, daddr);
+#endif
+
+ /* build vlan header only if re_order_header flag is NOT set. This
+ * fixes some programs that get confused when they see a VLAN device
+ * sending a frame that is VLAN encoded (the consensus is that the VLAN
+ * device should look completely like an Ethernet device when the
+ * REORDER_HEADER flag is set) The drawback to this is some extra
+ * header shuffling in the hard_start_xmit. Users can turn off this
+ * REORDER behaviour with the vconfig tool.
+ */
+ build_vlan_header = ((VLAN_DEV_INFO(dev)->flags & 1) == 0);
+
+ if (build_vlan_header) {
+ vhdr = (struct vlan_hdr *) skb_push(skb, VLAN_HLEN);
+
+ /* build the four bytes that make this a VLAN header. */
+
+ /* Now, construct the second two bytes. This field looks something
+ * like:
+ * usr_priority: 3 bits (high bits)
+ * CFI 1 bit
+ * VLAN ID 12 bits (low bits)
+ *
+ */
+ veth_TCI = VLAN_DEV_INFO(dev)->vlan_id;
+ veth_TCI |= vlan_dev_get_egress_qos_mask(dev, skb);
+
+ vhdr->h_vlan_TCI = htons(veth_TCI);
+
+ /*
+ * Set the protocol type.
+ * For a packet of type ETH_P_802_3 we put the length in here instead.
+ * It is up to the 802.2 layer to carry protocol information.
+ */
+
+ if (type != ETH_P_802_3) {
+ vhdr->h_vlan_encapsulated_proto = htons(type);
+ } else {
+ vhdr->h_vlan_encapsulated_proto = htons(len);
+ }
+ }
+
+ /* Before delegating work to the lower layer, enter our MAC-address */
+ if (saddr == NULL)
+ saddr = dev->dev_addr;
+
+ dev = VLAN_DEV_INFO(dev)->real_dev;
+
+ /* MPLS can send us skbuffs w/out enough space. This check will grow the
+ * skb if it doesn't have enough headroom. Not a beautiful solution, so
+ * I'll tick a counter so that users can know it's happening... If they
+ * care...
+ */
+
+ /* NOTE: This may still break if the underlying device is not the final
+ * device (and thus there are more headers to add...) It should work for
+ * good-ole-ethernet though.
+ */
+ if (skb_headroom(skb) < dev->hard_header_len) {
+ struct sk_buff *sk_tmp = skb;
+ skb = skb_realloc_headroom(sk_tmp, dev->hard_header_len);
+ kfree_skb(sk_tmp);
+ if (skb == NULL) {
+ struct net_device_stats *stats = vlan_dev_get_stats(vdev);
+ stats->tx_dropped++;
+ return -ENOMEM;
+ }
+ VLAN_DEV_INFO(vdev)->cnt_inc_headroom_on_tx++;
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": %s: had to grow skb.\n", vdev->name);
+#endif
+ }
+
+ if (build_vlan_header) {
+ /* Now make the underlying real hard header */
+ rc = dev->hard_header(skb, dev, ETH_P_8021Q, daddr, saddr, len + VLAN_HLEN);
+
+ if (rc > 0) {
+ rc += VLAN_HLEN;
+ } else if (rc < 0) {
+ rc -= VLAN_HLEN;
+ }
+ } else {
+ /* If here, then we'll just make a normal looking ethernet frame,
+ * but, the hard_start_xmit method will insert the tag (it has to
+ * be able to do this for bridged and other skbs that don't come
+ * down the protocol stack in an orderly manner.
+ */
+ rc = dev->hard_header(skb, dev, type, daddr, saddr, len);
+ }
+


+ return rc;
+}
+

+int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)

+{
+ struct net_device_stats *stats = vlan_dev_get_stats(dev);
+ struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);
+
+ /* Handle non-VLAN frames if they are sent to us, for example by DHCP.
+ *
+ * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING
+ * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs...
+ */
+
+ if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) {
+ /* This is not a VLAN frame...but we can fix that! */
+ unsigned short veth_TCI = 0;
+ VLAN_DEV_INFO(dev)->cnt_encap_on_xmit++;
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": proto to encap: 0x%hx (hbo)\n",
+ htons(veth->h_vlan_proto));
+#endif
+
+ if (skb_headroom(skb) < VLAN_HLEN) {
+ struct sk_buff *sk_tmp = skb;
+ skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN);
+ kfree_skb(sk_tmp);
+ if (skb == NULL) {
+ stats->tx_dropped++;
+ return -ENOMEM;
+ }
+ VLAN_DEV_INFO(dev)->cnt_inc_headroom_on_tx++;
+ } else {
+ if (!(skb = skb_unshare(skb, GFP_ATOMIC))) {
+ printk(KERN_ERR "vlan: failed to unshare skbuff\n");
+ stats->tx_dropped++;


+ return -ENOMEM;
+ }
+ }

+ veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);
+
+ /* Move the mac addresses to the beginning of the new header. */
+ memmove(skb->data, skb->data + VLAN_HLEN, 12);
+
+ /* first, the ethernet type */
+ /* put_unaligned(__constant_htons(ETH_P_8021Q), &veth->h_vlan_proto); */
+ veth->h_vlan_proto = __constant_htons(ETH_P_8021Q);
+
+ /* Now, construct the second two bytes. This field looks something
+ * like:
+ * usr_priority: 3 bits (high bits)
+ * CFI 1 bit
+ * VLAN ID 12 bits (low bits)
+ */
+ veth_TCI = VLAN_DEV_INFO(dev)->vlan_id;
+ veth_TCI |= vlan_dev_get_egress_qos_mask(dev, skb);
+
+ veth->h_vlan_TCI = htons(veth_TCI);
+ }
+
+ skb->dev = VLAN_DEV_INFO(dev)->real_dev;
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": about to send skb: %p to dev: %s\n",
+ skb, skb->dev->name);
+ printk(VLAN_DBG " %2hx.%2hx.%2hx.%2xh.%2hx.%2hx %2hx.%2hx.%2hx.%2hx.%2hx.%2hx %4hx %4hx %4hx\n",
+ veth->h_dest[0], veth->h_dest[1], veth->h_dest[2], veth->h_dest[3], veth->h_dest[4], veth->h_dest[5],
+ veth->h_source[0], veth->h_source[1], veth->h_source[2], veth->h_source[3], veth->h_source[4], veth->h_source[5],
+ veth->h_vlan_proto, veth->h_vlan_TCI, veth->h_vlan_encapsulated_proto);
+#endif
+
+ dev_queue_xmit(skb);
+ stats->tx_packets++; /* for statics only */
+ stats->tx_bytes += skb->len;


+ return 0;
+}
+

+int vlan_dev_change_mtu(struct net_device *dev, int new_mtu)

+{
+ /* TODO: gotta make sure the underlying layer can handle it,
+ * maybe an IFF_VLAN_CAPABLE flag for devices?
+ */
+ if (VLAN_DEV_INFO(dev)->real_dev->mtu < new_mtu)
+ return -ERANGE;
+
+ dev->mtu = new_mtu;
+
+ return new_mtu;
+}
+
+int vlan_dev_open(struct net_device *dev)
+{
+ if (!(VLAN_DEV_INFO(dev)->real_dev->flags & IFF_UP))
+ return -ENETDOWN;


+
+ return 0;
+}
+

+int vlan_dev_stop(struct net_device *dev)
+{
+ vlan_flush_mc_list(dev);


+ return 0;
+}
+

+int vlan_dev_init(struct net_device *dev)
+{
+ /* TODO: figure this out, maybe do nothing?? */


+ return 0;
+}
+

+void vlan_dev_destruct(struct net_device *dev)
+{
+ if (dev) {
+ vlan_flush_mc_list(dev);
+ if (dev->priv) {
+ dev_put(VLAN_DEV_INFO(dev)->real_dev);
+ if (VLAN_DEV_INFO(dev)->dent) {
+ printk(KERN_ERR __FUNCTION__ ": dent is NOT NULL!\n");
+
+ /* If we ever get here, there is a serious bug
+ * that must be fixed.
+ */
+ }
+
+ kfree(dev->priv);
+
+ VLAN_FMEM_DBG("dev->priv free, addr: %p\n", dev->priv);
+ dev->priv = NULL;
+ }
+
+ kfree(dev);
+ VLAN_FMEM_DBG("net_device free, addr: %p\n", dev);
+ dev = NULL;
+ }
+}
+


+int vlan_dev_set_ingress_priority(char *dev_name, __u32 skb_prio, short vlan_prio)

+{
+ struct net_device *dev = dev_get_by_name(dev_name);
+
+ if (dev) {
+ if (dev->priv_flags & IFF_802_1Q_VLAN) {
+ /* see if a priority mapping exists.. */
+ VLAN_DEV_INFO(dev)->ingress_priority_map[vlan_prio & 0x7] = skb_prio;
+ dev_put(dev);


+ return 0;
+ }
+

+ dev_put(dev);
+ }


+ return -EINVAL;
+}
+

+int vlan_dev_set_egress_priority(char *dev_name, __u32 skb_prio, short vlan_prio)

+{
+ struct net_device *dev = dev_get_by_name(dev_name);
+ struct vlan_priority_tci_mapping *mp = NULL;
+ struct vlan_priority_tci_mapping *np;
+
+ if (dev) {
+ if (dev->priv_flags & IFF_802_1Q_VLAN) {
+ /* See if a priority mapping exists.. */
+ mp = VLAN_DEV_INFO(dev)->egress_priority_map[skb_prio & 0xF];
+ while (mp) {
+ if (mp->priority == skb_prio) {
+ mp->vlan_qos = ((vlan_prio << 13) & 0xE000);
+ dev_put(dev);


+ return 0;
+ }
+ }
+

+ /* Create a new mapping then. */
+ mp = VLAN_DEV_INFO(dev)->egress_priority_map[skb_prio & 0xF];
+ np = kmalloc(sizeof(struct vlan_priority_tci_mapping), GFP_KERNEL);
+ if (np) {
+ np->next = mp;
+ np->priority = skb_prio;
+ np->vlan_qos = ((vlan_prio << 13) & 0xE000);
+ VLAN_DEV_INFO(dev)->egress_priority_map[skb_prio & 0xF] = np;
+ dev_put(dev);
+ return 0;
+ } else {
+ dev_put(dev);
+ return -ENOBUFS;
+ }
+ }
+ dev_put(dev);
+ }
+ return -EINVAL;
+}
+
+/* Flags are defined in the vlan_dev_info class in include/linux/if_vlan.h file. */


+int vlan_dev_set_vlan_flag(char *dev_name, __u32 flag, short flag_val)

+{
+ struct net_device *dev = dev_get_by_name(dev_name);
+
+ if (dev) {
+ if (dev->priv_flags & IFF_802_1Q_VLAN) {
+ /* verify flag is supported */
+ if (flag == 1) {
+ if (flag_val) {
+ VLAN_DEV_INFO(dev)->flags |= 1;
+ } else {
+ VLAN_DEV_INFO(dev)->flags &= ~1;
+ }
+ dev_put(dev);
+ return 0;
+ } else {
+ printk(KERN_ERR __FUNCTION__ ": flag %i is not valid.\n",
+ (int)(flag));
+ dev_put(dev);
+ return -EINVAL;
+ }
+ } else {
+ printk(KERN_ERR __FUNCTION__
+ ": %s is not a vlan device, priv_flags: %hX.\n",
+ dev->name, dev->priv_flags);
+ dev_put(dev);
+ }
+ } else {
+ printk(KERN_ERR __FUNCTION__ ": Could not find device: %s\n", dev_name);
+ }
+


+ return -EINVAL;
+}
+

+int vlan_dev_set_mac_address(struct net_device *dev, void *addr_struct_p)
+{
+ struct sockaddr *addr = (struct sockaddr *)(addr_struct_p);
+ int i;
+
+ if (netif_running(dev))
+ return -EBUSY;
+
+ memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+
+ printk("%s: Setting MAC address to ", dev->name);
+ for (i = 0; i < 6; i++)
+ printk(" %2.2x", dev->dev_addr[i]);
+ printk(".\n");
+
+ if (memcmp(VLAN_DEV_INFO(dev)->real_dev->dev_addr,
+ dev->dev_addr,
+ dev->addr_len) != 0) {
+ if (!(VLAN_DEV_INFO(dev)->real_dev->flags & IFF_PROMISC)) {
+ int flgs = VLAN_DEV_INFO(dev)->real_dev->flags;
+
+ /* Increment our in-use promiscuity counter */
+ dev_set_promiscuity(VLAN_DEV_INFO(dev)->real_dev, 1);
+
+ /* Make PROMISC visible to the user. */
+ flgs |= IFF_PROMISC;
+ printk("VLAN (%s): Setting underlying device (%s) to promiscious mode.\n",
+ dev->name, VLAN_DEV_INFO(dev)->real_dev->name);
+ dev_change_flags(VLAN_DEV_INFO(dev)->real_dev, flgs);
+ }
+ } else {
+ printk("VLAN (%s): Underlying device (%s) has same MAC, not checking promiscious mode.\n",
+ dev->name, VLAN_DEV_INFO(dev)->real_dev->name);
+ }


+
+ return 0;
+}
+

+/** Taken from Gleb + Lennert's VLAN code, and modified... */
+void vlan_dev_set_multicast_list(struct net_device *vlan_dev)

+{
+ struct dev_mc_list *dmi;
+ struct net_device *real_dev;
+ int inc;
+
+ if (vlan_dev && (vlan_dev->priv_flags & IFF_802_1Q_VLAN)) {
+ /* Then it's a real vlan device, as far as we can tell.. */
+ real_dev = VLAN_DEV_INFO(vlan_dev)->real_dev;
+
+ /* compare the current promiscuity to the last promisc we had.. */
+ inc = vlan_dev->promiscuity - VLAN_DEV_INFO(vlan_dev)->old_promiscuity;
+ if (inc) {
+ printk(KERN_INFO "%s: dev_set_promiscuity(master, %d)\n",
+ vlan_dev->name, inc);
+ dev_set_promiscuity(real_dev, inc); /* found in dev.c */
+ VLAN_DEV_INFO(vlan_dev)->old_promiscuity = vlan_dev->promiscuity;
+ }
+
+ inc = vlan_dev->allmulti - VLAN_DEV_INFO(vlan_dev)->old_allmulti;
+ if (inc) {
+ printk(KERN_INFO "%s: dev_set_allmulti(master, %d)\n",
+ vlan_dev->name, inc);
+ dev_set_allmulti(real_dev, inc); /* dev.c */
+ VLAN_DEV_INFO(vlan_dev)->old_allmulti = vlan_dev->allmulti;
+ }
+
+ /* looking for addresses to add to master's list */
+ for (dmi = vlan_dev->mc_list; dmi != NULL; dmi = dmi->next) {
+ if (vlan_should_add_mc(dmi, VLAN_DEV_INFO(vlan_dev)->old_mc_list)) {
+ dev_mc_add(real_dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
+ printk(KERN_INFO "%s: add %.2x:%.2x:%.2x:%.2x:%.2x:%.2x mcast address to master interface\n",
+ vlan_dev->name,
+ dmi->dmi_addr[0],
+ dmi->dmi_addr[1],
+ dmi->dmi_addr[2],
+ dmi->dmi_addr[3],
+ dmi->dmi_addr[4],
+ dmi->dmi_addr[5]);
+ }
+ }
+
+ /* looking for addresses to delete from master's list */
+ for (dmi = VLAN_DEV_INFO(vlan_dev)->old_mc_list; dmi != NULL; dmi = dmi->next) {
+ if (vlan_should_add_mc(dmi, vlan_dev->mc_list)) {
+ /* if we think we should add it to the new list, then we should really
+ * delete it from the real list on the underlying device.
+ */
+ dev_mc_delete(real_dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
+ printk(KERN_INFO "%s: del %.2x:%.2x:%.2x:%.2x:%.2x:%.2x mcast address from master interface\n",
+ vlan_dev->name,
+ dmi->dmi_addr[0],
+ dmi->dmi_addr[1],
+ dmi->dmi_addr[2],
+ dmi->dmi_addr[3],
+ dmi->dmi_addr[4],
+ dmi->dmi_addr[5]);
+ }
+ }
+
+ /* save multicast list */
+ vlan_copy_mc_list(vlan_dev->mc_list, VLAN_DEV_INFO(vlan_dev));
+ }
+}
+


+/** dmi is a single entry into a dev_mc_list, a single node. mc_list is
+ * an entire list, and we'll iterate through it.
+ */
+int vlan_should_add_mc(struct dev_mc_list *dmi, struct dev_mc_list *mc_list)

+{
+ struct dev_mc_list *idmi;
+
+ for (idmi = mc_list; idmi != NULL; ) {
+ if (vlan_dmi_equals(dmi, idmi)) {
+ if (dmi->dmi_users > idmi->dmi_users)


+ return 1;
+ else
+ return 0;

+ } else {
+ idmi = idmi->next;
+ }
+ }
+
+ return 1;
+}
+


+void vlan_copy_mc_list(struct dev_mc_list *mc_list, struct vlan_dev_info *vlan_info)

+{
+ struct dev_mc_list *dmi, *new_dmi;
+
+ vlan_destroy_mc_list(vlan_info->old_mc_list);
+ vlan_info->old_mc_list = NULL;
+
+ for (dmi = mc_list; dmi != NULL; dmi = dmi->next) {
+ new_dmi = kmalloc(sizeof(*new_dmi), GFP_ATOMIC);
+ if (new_dmi == NULL) {
+ printk(KERN_ERR "vlan: cannot allocate memory. "
+ "Multicast may not work properly from now.\n");
+ return;
+ }
+
+ /* Copy whole structure, then make new 'next' pointer */
+ *new_dmi = *dmi;
+ new_dmi->next = vlan_info->old_mc_list;
+ vlan_info->old_mc_list = new_dmi;
+ }
+}
+
+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_INFO "%s: del %.2x:%.2x:%.2x:%.2x:%.2x:%.2x mcast address from vlan interface\n",
+ dev->name,
+ dmi->dmi_addr[0],
+ dmi->dmi_addr[1],
+ dmi->dmi_addr[2],
+ dmi->dmi_addr[3],
+ dmi->dmi_addr[4],
+ dmi->dmi_addr[5]);
+ dmi = dev->mc_list;
+ }
+
+ /* dev->mc_list is NULL by the time we get here. */
+ vlan_destroy_mc_list(VLAN_DEV_INFO(dev)->old_mc_list);
+ VLAN_DEV_INFO(dev)->old_mc_list = NULL;
+}
diff -u --recursive --new-file v2.4.13/linux/net/8021q/vlanproc.c linux/net/8021q/vlanproc.c
--- v2.4.13/linux/net/8021q/vlanproc.c Wed Dec 31 16:00:00 1969
+++ linux/net/8021q/vlanproc.c Tue Oct 30 15:08:12 2001
@@ -0,0 +1,481 @@
+/******************************************************************************
+ * vlanproc.c VLAN Module. /proc filesystem interface.
+ *
+ * This module is completely hardware-independent and provides
+ * access to the router using Linux /proc filesystem.
+ *
+ * Author: Ben Greear, <gre...@candelatech.com> coppied from wanproc.c
+ * by: Gene Kozin <ge...@compuserve.com>
+ *
+ * Copyright: (c) 1998 Ben Greear


+ *
+ * This 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.
+ * ============================================================================
+ * Jan 20, 1998 Ben Greear Initial Version
+ *****************************************************************************/
+
+#include <linux/config.h>
+#include <linux/stddef.h> /* offsetof(), etc. */
+#include <linux/errno.h> /* return codes */
+#include <linux/kernel.h>
+#include <linux/malloc.h> /* kmalloc(), kfree() */
+#include <linux/mm.h> /* verify_area(), etc. */
+#include <linux/string.h> /* inline mem*, str* functions */
+#include <linux/init.h> /* __initfunc et al. */
+#include <asm/segment.h> /* kernel <-> user copy */
+#include <asm/byteorder.h> /* htons(), etc. */
+#include <asm/uaccess.h> /* copy_to_user */
+#include <asm/io.h>
+#include <linux/proc_fs.h>
+#include <linux/fs.h>
+#include <linux/netdevice.h>
+#include <linux/if_vlan.h>
+#include "vlanproc.h"
+#include "vlan.h"
+
+/****** Function Prototypes *************************************************/
+
+#ifdef CONFIG_PROC_FS
+
+/* Proc filesystem interface */
+static ssize_t vlan_proc_read(struct file *file, char *buf, size_t count,
+ loff_t *ppos);
+
+/* Methods for preparing data for reading proc entries */
+
+static int vlan_config_get_info(char *buf, char **start, off_t offs, int len);
+static int vlandev_get_info(char *buf, char **start, off_t offs, int len);
+
+/* Miscellaneous */
+
+/*
+ * Global Data
+ */
+
+/*
+ * Names of the proc directory entries
+ */
+
+static char name_root[] = "vlan";
+static char name_conf[] = "config";
+static char term_msg[] = "***KERNEL: Out of buffer space!***\n";
+
+/*
+ * Structures for interfacing with the /proc filesystem.
+ * VLAN creates its own directory /proc/net/vlan with the folowing
+ * entries:
+ * config device status/configuration
+ * <device> entry for each device
+ */
+
+/*
+ * Generic /proc/net/vlan/<file> file and inode operations
+ */
+
+static struct file_operations vlan_fops = {
+ read: vlan_proc_read,
+ ioctl: NULL, /* vlan_proc_ioctl */
+};
+
+/*
+ * /proc/net/vlan/<device> file and inode operations
+ */
+
+static struct file_operations vlandev_fops = {
+ read: vlan_proc_read,
+ ioctl: NULL, /* vlan_proc_ioctl */
+};
+
+/*
+ * Proc filesystem derectory entries.
+ */
+
+/*
+ * /proc/net/vlan
+ */
+
+static struct proc_dir_entry *proc_vlan_dir;
+
+/*
+ * /proc/net/vlan/config
+ */
+
+static struct proc_dir_entry *proc_vlan_conf;
+
+/* Strings */
+static char conf_hdr[] = "VLAN Dev name | VLAN ID\n";
+
+/*
+ * Interface functions
+ */
+
+/*
+ * Clean up /proc/net/vlan entries
+ */
+
+void __exit vlan_proc_cleanup(void)
+{
+ if (proc_vlan_conf)
+ remove_proc_entry(name_conf, proc_vlan_dir);
+
+ if (proc_vlan_dir)
+ proc_net_remove(name_root);
+
+ /* Dynamically added entries should be cleaned up as their vlan_device
+ * is removed, so we should not have to take care of it here...


+ */
+}
+
+/*

+ * Create /proc/net/vlan entries
+ */
+
+int __init vlan_proc_init(void)
+{
+ proc_vlan_dir = proc_mkdir(name_root, proc_net);
+ if (proc_vlan_dir) {
+ proc_vlan_conf = create_proc_entry(name_conf,
+ S_IFREG|S_IRUSR|S_IWUSR,
+ proc_vlan_dir);
+ if (proc_vlan_conf) {
+ proc_vlan_conf->proc_fops = &vlan_fops;
+ proc_vlan_conf->get_info = vlan_config_get_info;


+ return 0;
+ }
+ }

+ vlan_proc_cleanup();


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 54'
echo 'File patch-2.4.14 is continued in part 55'
echo "55" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:16 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part53

#!/bin/sh -x
# this is part 53 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 53; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ accordingly. inflate() provides as much output as possible, until there
+ is no more input data or no more space in the output buffer (see below
+ about the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least


+ one of the actions is possible, by providing more input and/or consuming

+ more output, and updating the next_* and avail_* values accordingly.
+ The application can consume the uncompressed output when it wants, for
+ example when the output buffer is full (avail_out == 0), or after each
+ call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+ must be called again after making room in the output buffer because there
+ might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
+ output as possible to the output buffer. The flushing behavior of inflate is
+ not specified for values of the flush parameter other than Z_SYNC_FLUSH
+ and Z_FINISH, but the current implementation actually flushes as much output
+ as possible anyway.
+
+ inflate() should normally be called until it returns Z_STREAM_END or an
+ error. However if all decompression is to be performed in a single step
+ (a single call of inflate), the parameter flush should be set to
+ Z_FINISH. In this case all pending input is processed and all pending
+ output is flushed; avail_out must be large enough to hold all the
+ uncompressed data. (The size of the uncompressed data may have been saved
+ by the compressor for this purpose.) The next operation on this stream must
+ be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+ is never required, but can be used to inform inflate that a faster routine
+ may be used for the single inflate() call.
+
+ If a preset dictionary is needed at this point (see inflateSetDictionary
+ below), inflate sets strm-adler to the adler32 checksum of the
+ dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
+ it sets strm->adler to the adler32 checksum of all output produced
+ so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
+ an error code as described below. At the end of the stream, inflate()
+ checks that its computed adler32 checksum is equal to that saved by the
+ compressor and returns Z_STREAM_END only if the checksum is correct.
+
+ inflate() returns Z_OK if some progress has been made (more input processed
+ or more output produced), Z_STREAM_END if the end of the compressed data has
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+ corrupted (input stream not conforming to the zlib format or incorrect
+ adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
+ (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if no progress is possible or if there was not
+ enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
+ case, the application may then call inflateSync to look for a good
+ compression block.
+*/
+
+
+ZEXTERN int ZEXPORT zlib_fs_inflateEnd OF((z_streamp strm));


+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+

+ inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+ was inconsistent. In the error case, msg may be set but then points to a
+ static string (which must not be deallocated).
+*/
+
+ /* Advanced functions */
+
+/*
+ The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
+
+ This is another version of deflateInit with more compression options. The
+ fields next_in, zalloc, zfree and opaque must be initialized before by
+ the caller.
+
+ The method parameter is the compression method. It must be Z_DEFLATED in
+ this version of the library.
+
+ The windowBits parameter is the base two logarithm of the window size
+ (the size of the history buffer). It should be in the range 8..15 for this
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
+ deflateInit is used instead.
+
+ The memLevel parameter specifies how much memory should be allocated
+ for the internal compression state. memLevel=1 uses minimum memory but
+ is slow and reduces compression ratio; memLevel=9 uses maximum memory
+ for optimal speed. The default value is 8. See zconf.h for total memory
+ usage as a function of windowBits and memLevel.
+
+ The strategy parameter is used to tune the compression algorithm. Use the
+ value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+ filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
+ string match). Filtered data consists mostly of small values with a
+ somewhat random distribution. In this case, the compression algorithm is
+ tuned to compress them better. The effect of Z_FILTERED is to force more
+ Huffman coding and less string matching; it is somewhat intermediate
+ between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
+ the compression ratio but not the correctness of the compressed output even
+ if it is not set appropriately.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+ method). msg is set to null if there is no error message. deflateInit2 does
+ not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT zlib_fs_deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the compression dictionary from the given byte sequence
+ without producing any compressed output. This function must be called
+ immediately after deflateInit, deflateInit2 or deflateReset, before any
+ call of deflate. The compressor and decompressor must use exactly the same
+ dictionary (see inflateSetDictionary).
+
+ The dictionary should consist of strings (byte sequences) that are likely
+ to be encountered later in the data to be compressed, with the most commonly
+ used strings preferably put towards the end of the dictionary. Using a
+ dictionary is most useful when the data to be compressed is short and can be
+ predicted with good accuracy; the data can then be compressed better than
+ with the default empty dictionary.
+
+ Depending on the size of the compression data structures selected by
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
+ discarded, for example if the dictionary is larger than the window size in
+ deflate or deflate2. Thus the strings most likely to be useful should be
+ put at the end of the dictionary, not at the front.
+
+ Upon return of this function, strm->adler is set to the Adler32 value
+ of the dictionary; the decompressor may later use this value to determine
+ which dictionary has been used by the compressor. (The Adler32 value
+ applies to the whole dictionary even if only a subset of the dictionary is
+ actually used by the compressor.)
+
+ deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent (for example if deflate has already been called for this stream
+ or if the compression method is bsort). deflateSetDictionary does not


+ perform any compression: this will be done by deflate().
+*/
+

+ZEXTERN int ZEXPORT zlib_fs_deflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when several compression strategies will be
+ tried, for example when there are several ways of pre-processing the input
+ data with a filter. The streams that will be discarded should then be freed
+ by calling deflateEnd. Note that deflateCopy duplicates the internal
+ compression state which can be quite large, so this strategy is slow and
+ can consume lots of memory.
+
+ deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT zlib_fs_deflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to deflateEnd followed by deflateInit,
+ but does not free and reallocate all the internal compression state.
+ The stream will keep the same compression level and any other attributes
+ that may have been set by deflateInit2.
+
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT zlib_fs_deflateParams OF((z_streamp strm,
+ int level,
+ int strategy));
+/*
+ Dynamically update the compression level and compression strategy. The
+ interpretation of level and strategy is as in deflateInit2. This can be
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different
+ strategy. If the compression level is changed, the input available so far
+ is compressed with the old level (and may be flushed); the new level will
+ take effect only at the next call of deflate().
+
+ Before the call of deflateParams, the stream state must be set as for
+ a call of deflate(), since the currently available input may have to
+ be compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+ deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+ stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
+ if strm->avail_out was zero.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+ int windowBits));
+
+ This is another version of inflateInit with an extra parameter. The
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+ before by the caller.
+
+ The windowBits parameter is the base two logarithm of the maximum window
+ size (the size of the history buffer). It should be in the range 8..15 for
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. If a compressed stream with a larger window size is given as
+ input, inflate() will return with the error code Z_DATA_ERROR instead of
+ trying to allocate a larger window.
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
+ memLevel). msg is set to null if there is no error message. inflateInit2
+ does not perform any decompression apart from reading the zlib header if
+ present: this will be done by inflate(). (So next_in and avail_in may be
+ modified, but next_out and avail_out are unchanged.)
+*/
+
+ZEXTERN int ZEXPORT zlib_fs_inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the decompression dictionary from the given uncompressed byte
+ sequence. This function must be called immediately after a call of inflate
+ if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the Adler32 value returned by this call of
+ inflate. The compressor and decompressor must use exactly the same
+ dictionary (see deflateSetDictionary).
+
+ inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+ expected one (incorrect Adler32 value). inflateSetDictionary does not
+ perform any decompression: this will be done by subsequent calls of
+ inflate().
+*/
+
+ZEXTERN int ZEXPORT zlib_fs_inflateSync OF((z_streamp strm));
+/*
+ Skips invalid compressed data until a full flush point (see above the
+ description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+ if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+ or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+ case, the application may save the current current value of total_in which
+ indicates where valid compressed data was found. In the error case, the
+ application may repeatedly call inflateSync, providing more input each time,
+ until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT zlib_fs_inflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to inflateEnd followed by inflateInit,
+ but does not free and reallocate all the internal decompression state.
+ The stream will keep attributes that may have been set by inflateInit2.
+
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ /* checksum functions */
+
+/*
+ These functions are not related to compression but are exported
+ anyway because they might be useful in applications using the
+ compression library.
+*/
+
+ZEXTERN uLong ZEXPORT zlib_fs_adler32 OF((uLong adler, const Bytef *buf, uInt len));
+
+/*
+ Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+ return the updated checksum. If buf is NULL, this function returns
+ the required initial value for the checksum.
+ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+ much faster. Usage example:
+
+ uLong adler = adler32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ adler = adler32(adler, buffer, length);
+ }
+ if (adler != original_adler) error();
+*/
+
+ZEXTERN uLong ZEXPORT zlib_fs_crc32 OF((uLong crc, const Bytef *buf, uInt len));
+/*
+ Update a running crc with the bytes buf[0..len-1] and return the updated
+ crc. If buf is NULL, this function returns the required initial value
+ for the crc. Pre- and post-conditioning (one's complement) is performed
+ within this function so it shouldn't be done by the application.
+ Usage example:
+
+ uLong crc = crc32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ crc = crc32(crc, buffer, length);
+ }
+ if (crc != original_crc) error();
+*/
+
+
+ /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT zlib_fs_deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT zlib_fs_inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT zlib_fs_deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+ZEXTERN int ZEXPORT zlib_fs_inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
+#define zlib_fs_deflateInit(strm, level) \
+ zlib_fs_deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
+#define zlib_fs_inflateInit(strm) \
+ zlib_fs_inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
+#define zlib_fs_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ zlib_fs_deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, sizeof(z_stream))
+#define zlib_fs_inflateInit2(strm, windowBits) \
+ zlib_fs_inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+
+
+#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
+ struct internal_state {int dummy;}; /* hack for buggy compilers */
+#endif
+
+ZEXTERN const char * ZEXPORT zlib_fs_zError OF((int err));
+ZEXTERN int ZEXPORT zlib_fs_inflateSyncPoint OF((z_streamp z));
+ZEXTERN const uLongf * ZEXPORT zlib_fs_get_crc_table OF((void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZLIB_H */
diff -u --recursive --new-file v2.4.13/linux/include/net/inet_ecn.h linux/include/net/inet_ecn.h
--- v2.4.13/linux/include/net/inet_ecn.h Thu Oct 18 13:47:47 2001
+++ linux/include/net/inet_ecn.h Tue Oct 30 15:08:12 2001
@@ -1,10 +1,6 @@
X #ifndef _INET_ECN_H_
X #define _INET_ECN_H_
X
-#include <linux/config.h>
-
-#ifdef CONFIG_INET_ECN
-
X static inline int INET_ECN_is_ce(__u8 dsfield)
X {
X return (dsfield&3) == 3;
@@ -39,18 +35,6 @@
X if (INET_ECN_is_capable((sk)->protinfo.af_inet.tos)) \
X (label) |= __constant_htons(2 << 4); \
X } while (0)
-
-
-#else
-#define INET_ECN_is_ce(x...) (0)
-#define INET_ECN_is_not_ce(x...) (0)
-#define INET_ECN_is_capable(x...) (0)
-#define INET_ECN_encapsulate(x, y) (x)
-#define IP6_ECN_flow_init(x...) do { } while (0)
-#define IP6_ECN_flow_xmit(x...) do { } while (0)
-#define INET_ECN_xmit(x...) do { } while (0)
-#define INET_ECN_dontxmit(x...) do { } while (0)
-#endif
X
X static inline void IP_ECN_set_ce(struct iphdr *iph)
X {
diff -u --recursive --new-file v2.4.13/linux/include/net/route.h linux/include/net/route.h
--- v2.4.13/linux/include/net/route.h Tue Oct 23 22:48:53 2001
+++ linux/include/net/route.h Mon Nov 5 12:43:09 2001
@@ -147,12 +147,7 @@
X dst_release(&rt->u.dst);
X }
X
-#ifdef CONFIG_INET_ECN
X #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3)
-#else
-#define IPTOS_RT_MASK IPTOS_TOS_MASK
-#endif
-
X
X extern __u8 ip_tos2prio[16];
X
diff -u --recursive --new-file v2.4.13/linux/include/net/sock.h linux/include/net/sock.h
--- v2.4.13/linux/include/net/sock.h Thu Oct 18 13:48:05 2001
+++ linux/include/net/sock.h Mon Nov 5 12:43:09 2001
@@ -416,6 +416,8 @@
X unsigned int keepalive_time; /* time before keep alive takes place */
X unsigned int keepalive_intvl; /* time interval between keep alive probes */
X int linger2;
+
+ unsigned long last_synq_overflow;
X };
X
X
diff -u --recursive --new-file v2.4.13/linux/include/net/tcp_ecn.h linux/include/net/tcp_ecn.h
--- v2.4.13/linux/include/net/tcp_ecn.h Thu Oct 18 13:47:54 2001
+++ linux/include/net/tcp_ecn.h Fri Nov 2 17:43:26 2001
@@ -1,13 +1,9 @@
X #ifndef _NET_TCP_ECN_H_
X #define _NET_TCP_ECN_H_ 1
X
-#include <linux/config.h>
-
-#ifdef CONFIG_INET_ECN
-
X #include <net/inet_ecn.h>
X
-#define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH)|TCP_FLAG_ECE|TCP_FLAG_CWR)
+#define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH))
X
X #define TCP_ECN_OK 1
X #define TCP_ECN_QUEUE_CWR 2
@@ -132,31 +128,5 @@
X if (sysctl_tcp_ecn && th->ece && th->cwr)
X req->ecn_ok = 1;
X }
-
-
-
-#else
-
-#define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH))
-
-
-#define TCP_ECN_send_syn(x...) do { } while (0)
-#define TCP_ECN_send_synack(x...) do { } while (0)
-#define TCP_ECN_make_synack(x...) do { } while (0)
-#define TCP_ECN_send(x...) do { } while (0)
-
-#define TCP_ECN_queue_cwr(x...) do { } while (0)
-
-#define TCP_ECN_accept_cwr(x...) do { } while (0)
-#define TCP_ECN_check_ce(x...) do { } while (0)
-#define TCP_ECN_rcv_synack(x...) do { } while (0)
-#define TCP_ECN_rcv_syn(x...) do { } while (0)
-#define TCP_ECN_rcv_ecn_echo(x...) (0)
-#define TCP_ECN_openreq_child(x...) do { } while (0)
-#define TCP_ECN_create_request(x...) do { } while (0)
-#define TCP_ECN_withdraw_cwr(x...) do { } while (0)
-
-
-#endif
X
X #endif
diff -u --recursive --new-file v2.4.13/linux/kernel/exec_domain.c linux/kernel/exec_domain.c
--- v2.4.13/linux/kernel/exec_domain.c Tue Oct 9 17:06:53 2001
+++ linux/kernel/exec_domain.c Wed Oct 24 08:25:30 2001
@@ -100,7 +100,7 @@
X }
X #endif
X
- ep = &default_exec_domain;
+ ep = NULL;
X out:
X read_unlock(&exec_domains_lock);
X return (ep);
diff -u --recursive --new-file v2.4.13/linux/kernel/ksyms.c linux/kernel/ksyms.c
--- v2.4.13/linux/kernel/ksyms.c Tue Oct 23 22:48:53 2001
+++ linux/kernel/ksyms.c Mon Nov 5 13:40:59 2001
@@ -94,6 +94,7 @@
X EXPORT_SYMBOL(alloc_pages_node);
X EXPORT_SYMBOL(__get_free_pages);
X EXPORT_SYMBOL(get_zeroed_page);
+EXPORT_SYMBOL(page_cache_release);
X EXPORT_SYMBOL(__free_pages);
X EXPORT_SYMBOL(free_pages);
X EXPORT_SYMBOL(num_physpages);
@@ -115,7 +116,6 @@
X EXPORT_SYMBOL(find_vma);
X EXPORT_SYMBOL(get_unmapped_area);
X EXPORT_SYMBOL(init_mm);
-EXPORT_SYMBOL(deactivate_page);
X #ifdef CONFIG_HIGHMEM
X EXPORT_SYMBOL(kmap_high);
X EXPORT_SYMBOL(kunmap_high);
@@ -253,6 +253,7 @@
X EXPORT_SYMBOL(__find_get_page);
X EXPORT_SYMBOL(__find_lock_page);
X EXPORT_SYMBOL(grab_cache_page);
+EXPORT_SYMBOL(grab_cache_page_nowait);
X EXPORT_SYMBOL(read_cache_page);
X EXPORT_SYMBOL(vfs_readlink);
X EXPORT_SYMBOL(vfs_follow_link);
@@ -275,6 +276,7 @@
X EXPORT_SYMBOL(filemap_fdatasync);
X EXPORT_SYMBOL(filemap_fdatawait);
X EXPORT_SYMBOL(lock_page);
+EXPORT_SYMBOL(unlock_page);
X
X /* device registration */
X EXPORT_SYMBOL(register_chrdev);
@@ -491,7 +493,6 @@
X EXPORT_SYMBOL(fsync_inode_buffers);
X EXPORT_SYMBOL(fsync_inode_data_buffers);
X EXPORT_SYMBOL(clear_inode);
-EXPORT_SYMBOL(nr_async_pages);
X EXPORT_SYMBOL(___strtok);
X EXPORT_SYMBOL(init_special_inode);
X EXPORT_SYMBOL(read_ahead);
diff -u --recursive --new-file v2.4.13/linux/kernel/printk.c linux/kernel/printk.c
--- v2.4.13/linux/kernel/printk.c Sun Sep 23 11:41:01 2001
+++ linux/kernel/printk.c Fri Nov 2 17:29:14 2001
@@ -24,10 +24,18 @@
X #include <linux/init.h>
X #include <linux/module.h>
X #include <linux/interrupt.h> /* For in_interrupt() */
+#include <linux/config.h>
X
X #include <asm/uaccess.h>
X
+#ifdef CONFIG_MULTIQUAD
+#define LOG_BUF_LEN (65536)
+#elif defined(CONFIG_SMP)
+#define LOG_BUF_LEN (32768)
+#else
X #define LOG_BUF_LEN (16384) /* This must be a power of two */
+#endif
+
X #define LOG_BUF_MASK (LOG_BUF_LEN-1)
X
X /* printk's without a loglevel use this.. */
diff -u --recursive --new-file v2.4.13/linux/kernel/softirq.c linux/kernel/softirq.c
--- v2.4.13/linux/kernel/softirq.c Sun Sep 23 11:41:01 2001
+++ linux/kernel/softirq.c Wed Oct 31 10:26:02 2001
@@ -361,7 +361,7 @@
X
X static int ksoftirqd(void * __bind_cpu)
X {
- int bind_cpu = *(int *) __bind_cpu;
+ int bind_cpu = (int) (long) __bind_cpu;
X int cpu = cpu_logical_map(bind_cpu);
X
X daemonize();
@@ -401,7 +401,7 @@
X int cpu;
X
X for (cpu = 0; cpu < smp_num_cpus; cpu++) {
- if (kernel_thread(ksoftirqd, (void *) &cpu,
+ if (kernel_thread(ksoftirqd, (void *) (long) cpu,
X CLONE_FS | CLONE_FILES | CLONE_SIGNAL) < 0)
X printk("spawn_ksoftirqd() failed for cpu %d\n", cpu);
X else {
diff -u --recursive --new-file v2.4.13/linux/mm/Makefile linux/mm/Makefile
--- v2.4.13/linux/mm/Makefile Wed Jul 25 17:10:26 2001
+++ linux/mm/Makefile Wed Oct 24 15:21:18 2001
@@ -9,7 +9,7 @@
X
X O_TARGET := mm.o
X
-export-objs := shmem.o
+export-objs := shmem.o filemap.o
X
X obj-y := memory.o mmap.o filemap.o mprotect.o mlock.o mremap.o \
X vmalloc.o slab.o bootmem.o swap.o vmscan.o page_io.o \
diff -u --recursive --new-file v2.4.13/linux/mm/filemap.c linux/mm/filemap.c
--- v2.4.13/linux/mm/filemap.c Tue Oct 23 22:48:53 2001
+++ linux/mm/filemap.c Mon Nov 5 13:40:59 2001
@@ -49,8 +49,13 @@
X
X spinlock_t pagecache_lock ____cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
X /*
- * NOTE: to avoid deadlocking you must never acquire the pagecache_lock with
- * the pagemap_lru_lock held.
+ * NOTE: to avoid deadlocking you must never acquire the pagemap_lru_lock
+ * with the pagecache_lock held.
+ *
+ * Ordering:
+ * swap_lock ->
+ * pagemap_lru_lock ->
+ * pagecache_lock
X */
X spinlock_t pagemap_lru_lock ____cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
X
@@ -136,17 +141,21 @@
X /*
X * Add a page to the dirty page list.
X */
-void __set_page_dirty(struct page *page)
+void set_page_dirty(struct page *page)
X {
- struct address_space *mapping = page->mapping;
+ if (!test_and_set_bit(PG_dirty, &page->flags)) {
+ struct address_space *mapping = page->mapping;
X
- spin_lock(&pagecache_lock);
- list_del(&page->list);
- list_add(&page->list, &mapping->dirty_pages);
- spin_unlock(&pagecache_lock);
+ if (mapping) {
+ spin_lock(&pagecache_lock);
+ list_del(&page->list);
+ list_add(&page->list, &mapping->dirty_pages);
+ spin_unlock(&pagecache_lock);
X
- if (mapping->host)
- mark_inode_dirty_pages(mapping->host);
+ if (mapping->host)
+ mark_inode_dirty_pages(mapping->host);
+ }
+ }
X }
X
X /**
@@ -164,8 +173,8 @@
X
X head = &inode->i_mapping->clean_pages;
X
- spin_lock(&pagecache_lock);
X spin_lock(&pagemap_lru_lock);
+ spin_lock(&pagecache_lock);
X curr = head->next;
X
X while (curr != head) {
@@ -196,8 +205,8 @@
X continue;
X }
X
- spin_unlock(&pagemap_lru_lock);
X spin_unlock(&pagecache_lock);
+ spin_unlock(&pagemap_lru_lock);
X }
X
X static inline void truncate_partial_page(struct page *page, unsigned partial)
@@ -524,6 +533,30 @@


X return retval;
X }
X
+/*

+ * In-memory filesystems have to fail their
+ * writepage function - and this has to be
+ * worked around in the VM layer..
+ *
+ * We
+ * - mark the page dirty again (but do NOT
+ * add it back to the inode dirty list, as
+ * that would livelock in fdatasync)
+ * - activate the page so that the page stealer
+ * doesn't try to write it out over and over
+ * again.
+ */
+int fail_writepage(struct page *page)
+{
+ activate_page(page);
+ SetPageReferenced(page);
+ SetPageDirty(page);
+ UnlockPage(page);


+ return 0;
+}
+

+EXPORT_SYMBOL(fail_writepage);
+
X /**
X * filemap_fdatasync - walk the list of dirty pages of the given address space
X * and writepage() all of them.
@@ -610,8 +643,9 @@
X spin_lock(&pagecache_lock);
X add_page_to_inode_queue(mapping, page);
X add_page_to_hash_queue(page, page_hash(mapping, index));
- lru_cache_add(page);
X spin_unlock(&pagecache_lock);
+
+ lru_cache_add(page);
X }
X
X /*
@@ -630,7 +664,6 @@
X page->index = offset;
X add_page_to_inode_queue(mapping, page);
X add_page_to_hash_queue(page, hash);
- lru_cache_add(page);
X }
X
X void add_to_page_cache(struct page * page, struct address_space * mapping, unsigned long offset)
@@ -638,6 +671,7 @@
X spin_lock(&pagecache_lock);
X __add_to_page_cache(page, mapping, offset, page_hash(mapping, offset));
X spin_unlock(&pagecache_lock);
+ lru_cache_add(page);
X }
X
X int add_to_page_cache_unique(struct page * page,
@@ -657,6 +691,8 @@
X }
X
X spin_unlock(&pagecache_lock);
+ if (!err)
+ lru_cache_add(page);
X return err;
X }
X
@@ -740,6 +776,17 @@
X remove_wait_queue(&page->wait, &wait);
X }
X
+void unlock_page(struct page *page)
+{
+ clear_bit(PG_launder, &(page)->flags);
+ smp_mb__before_clear_bit();
+ if (!test_and_clear_bit(PG_locked, &(page)->flags))
+ BUG();
+ smp_mb__after_clear_bit();
+ if (waitqueue_active(&(page)->wait))
+ wake_up(&(page)->wait);
+}
+
X /*
X * Get a lock on the page, assuming we need to sleep
X * to get it..
@@ -796,6 +843,24 @@
X }
X
X /*
+ * Same as above, but trylock it instead of incrementing the count.
+ */
+struct page *find_trylock_page(struct address_space *mapping, unsigned long offset)
+{
+ struct page *page;
+ struct page **hash = page_hash(mapping, offset);
+
+ spin_lock(&pagecache_lock);
+ page = __find_page_nolock(mapping, offset, *hash);
+ if (page) {
+ if (TryLockPage(page))
+ page = NULL;
+ }
+ spin_unlock(&pagecache_lock);
+ return page;
+}
+
+/*
X * Must be called with the pagecache lock held,
X * will return with it held (but it may be dropped
X * during blocking operations..
@@ -868,7 +933,9 @@
X newpage = NULL;
X }
X spin_unlock(&pagecache_lock);
- if (unlikely(newpage != NULL))
+ if (newpage == NULL)
+ lru_cache_add(page);
+ else
X page_cache_release(newpage);
X }
X }
@@ -884,6 +951,51 @@
X }
X
X
+/*
+ * Same as grab_cache_page, but do not wait if the page is unavailable.
+ * This is intended for speculative data generators, where the data can
+ * be regenerated if the page couldn't be grabbed. This routine should
+ * be safe to call while holding the lock for another page.
+ */
+struct page *grab_cache_page_nowait(struct address_space *mapping, unsigned long index)
+{
+ struct page *page, **hash;
+
+ hash = page_hash(mapping, index);
+ page = __find_get_page(mapping, index, hash);
+


+ if ( page ) {

+ if ( !TryLockPage(page) ) {
+ /* Page found and locked */
+ /* This test is overly paranoid, but what the heck... */
+ if ( unlikely(page->mapping != mapping || page->index != index) ) {
+ /* Someone reallocated this page under us. */
+ UnlockPage(page);
+ page_cache_release(page);
+ return NULL;
+ } else {
+ return page;
+ }
+ } else {
+ /* Page locked by someone else */
+ page_cache_release(page);


+ return NULL;
+ }
+ }
+

+ page = page_cache_alloc(mapping);
+ if ( unlikely(!page) )
+ return NULL; /* Failed to allocate a page */
+
+ if ( unlikely(add_to_page_cache_unique(page, mapping, index, hash)) ) {
+ /* Someone else grabbed the page already. */
+ page_cache_release(page);


+ return NULL;
+ }
+

+ return page;
+}
+
X #if 0
X #define PROFILE_READAHEAD
X #define DEBUG_READAHEAD
@@ -1344,6 +1456,7 @@
X page = cached_page;
X __add_to_page_cache(page, mapping, index, hash);
X spin_unlock(&pagecache_lock);
+ lru_cache_add(page);
X cached_page = NULL;
X
X goto readpage;
@@ -1630,14 +1743,13 @@
X * it in the page cache, and handles the special cases reasonably without
X * having a lot of duplicated code.
X */
-struct page * filemap_nopage(struct vm_area_struct * area,
- unsigned long address, int no_share)
+struct page * filemap_nopage(struct vm_area_struct * area, unsigned long address, int unused)
X {
X int error;
X struct file *file = area->vm_file;
X struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
X struct inode *inode = mapping->host;
- struct page *page, **hash, *old_page;
+ struct page *page, **hash;
X unsigned long size, pgoff, endoff;
X
X pgoff = ((address - area->vm_start) >> PAGE_CACHE_SHIFT) + area->vm_pgoff;
@@ -1683,22 +1795,9 @@
X * Found the page and have a reference on it, need to check sharing
X * and possibly copy it over to another page..
X */
- old_page = page;
X mark_page_accessed(page);
- if (no_share) {
- struct page *new_page = alloc_page(GFP_HIGHUSER);
-
- if (new_page) {
- copy_user_highpage(new_page, old_page, address);
- flush_page_to_ram(new_page);
- } else
- new_page = NOPAGE_OOM;
- page_cache_release(page);
- return new_page;
- }
-
- flush_page_to_ram(old_page);
- return old_page;
+ flush_page_to_ram(page);
+ return page;
X
X no_cached_page:
X /*
@@ -1799,8 +1898,7 @@
X struct page *page = pte_page(pte);
X if (VALID_PAGE(page) && !PageReserved(page) && ptep_test_and_clear_dirty(ptep)) {
X flush_tlb_page(vma, address);
- if (page->mapping)
- set_page_dirty(page);
+ set_page_dirty(page);


X }
X }
X return 0;

diff -u --recursive --new-file v2.4.13/linux/mm/memory.c linux/mm/memory.c
--- v2.4.13/linux/mm/memory.c Tue Oct 23 22:48:53 2001
+++ linux/mm/memory.c Sun Nov 4 09:29:14 2001
@@ -78,15 +78,8 @@
X struct page *page = pte_page(pte);
X if ((!VALID_PAGE(page)) || PageReserved(page))
X return;
- /*
- * free_page() used to be able to clear swap cache
- * entries. We may now have to do it manually.
- */


- if (page->mapping) {
- if (pte_dirty(pte))
- set_page_dirty(page);

- }
-

+ if (pte_dirty(pte))
+ set_page_dirty(page);

X free_page_and_swap_cache(page);


X }
X
@@ -184,7 +177,7 @@

X pgd_t * src_pgd, * dst_pgd;
X unsigned long address = vma->vm_start;
X unsigned long end = vma->vm_end;
- unsigned long cow = (vma->vm_flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE;
+ unsigned long cow = (vma->vm_flags & (VM_SHARED | VM_WRITE)) == VM_WRITE;
X
X src_pgd = pgd_offset(src, address)-1;
X dst_pgd = pgd_offset(dst, address)-1;
@@ -325,7 +318,7 @@
X /* This will eventually call __free_pte on the pte. */
X tlb_remove_page(tlb, ptep, address + offset);
X } else {
- swap_free(pte_to_swp_entry(pte));
+ free_swap_and_cache(pte_to_swp_entry(pte));
X pte_clear(ptep);
X }
X }
@@ -906,7 +899,8 @@
X * change only once the write actually happens. This avoids a few races,
X * and potentially makes it more efficient.
X *
- * We hold the mm semaphore and the page_table_lock on entry and exit.
+ * We hold the mm semaphore and the page_table_lock on entry and exit
+ * with the page_table_lock released.
X */
X static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
X unsigned long address, pte_t *page_table, pte_t pte)
@@ -916,41 +910,16 @@
X old_page = pte_page(pte);
X if (!VALID_PAGE(old_page))
X goto bad_wp_page;
-
- /*
- * We can avoid the copy if:
- * - we're the only user (count == 1)
- * - the only other user is the swap cache,
- * and the only swap cache user is itself,
- * in which case we can just continue to
- * use the same swap cache (it will be
- * marked dirty).
- */
- switch (page_count(old_page)) {
- int can_reuse;
- case 3:
- if (!old_page->buffers)
- break;
- /* FallThrough */
- case 2:
- if (!PageSwapCache(old_page))
- break;
- if (TryLockPage(old_page))
- break;
- /* Recheck swapcachedness once the page is locked */
- can_reuse = exclusive_swap_page(old_page);
- if (can_reuse)
- delete_from_swap_cache(old_page);
- UnlockPage(old_page);
- if (!can_reuse)
- break;
- /* FallThrough */
- case 1:
- if (PageReserved(old_page))
- break;
- flush_cache_page(vma, address);
- establish_pte(vma, address, page_table, pte_mkyoung(pte_mkdirty(pte_mkwrite(pte))));
- return 1; /* Minor fault */
+
+ if (!TryLockPage(old_page)) {
+ int reuse = can_share_swap_page(old_page);
+ unlock_page(old_page);
+ if (reuse) {
+ flush_cache_page(vma, address);
+ establish_pte(vma, address, page_table, pte_mkyoung(pte_mkdirty(pte_mkwrite(pte))));
+ spin_unlock(&mm->page_table_lock);
+ return 1; /* Minor fault */
+ }
X }
X
X /*
@@ -963,7 +932,6 @@
X if (!new_page)
X goto no_mem;
X copy_cow_page(old_page,new_page,address);
- page_cache_release(old_page);
X
X /*
X * Re-check the pte - we dropped the lock
@@ -973,19 +941,22 @@
X if (PageReserved(old_page))
X ++mm->rss;
X break_cow(vma, new_page, address, page_table);
+ lru_cache_add(new_page);
X
X /* Free the old page.. */
X new_page = old_page;
X }
+ spin_unlock(&mm->page_table_lock);
X page_cache_release(new_page);
+ page_cache_release(old_page);
X return 1; /* Minor fault */
X
X bad_wp_page:
+ spin_unlock(&mm->page_table_lock);
X printk("do_wp_page: bogus page at address %08lx (page 0x%lx)\n",address,(unsigned long)old_page);
X return -1;
X no_mem:
X page_cache_release(old_page);
- spin_lock(&mm->page_table_lock);


X return -1;
X }
X

@@ -1090,10 +1061,6 @@
X */
X num = valid_swaphandles(entry, &offset);
X for (i = 0; i < num; offset++, i++) {
- /* Don't block on I/O for read-ahead */
- if (atomic_read(&nr_async_pages) >=
- pager_daemon.swap_cluster << page_cluster)
- break;
X /* Ok, do the async read-ahead now */
X new_page = read_swap_cache_async(SWP_ENTRY(SWP_TYPE(entry), offset));
X if (!new_page)
@@ -1103,12 +1070,9 @@
X return;
X }
X
-/* Swap 80% full? Release the pages as they are paged in.. */
-#define vm_swap_full() \
- (swapper_space.nrpages*5 > total_swap_pages*4)
-
X /*
- * We hold the mm semaphore and the page_table_lock on entry and exit.
+ * We hold the mm semaphore and the page_table_lock on entry and
+ * should release the pagetable lock on exit..
X */
X static int do_swap_page(struct mm_struct * mm,
X struct vm_area_struct * vma, unsigned long address,
@@ -1125,23 +1089,21 @@
X swapin_readahead(entry);
X page = read_swap_cache_async(entry);
X if (!page) {
- spin_lock(&mm->page_table_lock);
X /*
X * Back out if somebody else faulted in this pte while
X * we released the page table lock.
X */
- return pte_same(*page_table, orig_pte) ? -1 : 1;
+ int retval;
+ spin_lock(&mm->page_table_lock);
+ retval = pte_same(*page_table, orig_pte) ? -1 : 1;
+ spin_unlock(&mm->page_table_lock);
+ return retval;
X }
X
X /* Had to read the page from swap area: Major fault */
X ret = 2;
X }
X
- /*
- * Freeze the "shared"ness of the page, ie page_count + swap_count.
- * Must lock page before transferring our swap count to already
- * obtained page count.
- */
X lock_page(page);
X
X /*
@@ -1150,26 +1112,23 @@
X */
X spin_lock(&mm->page_table_lock);
X if (!pte_same(*page_table, orig_pte)) {
- UnlockPage(page);
+ spin_unlock(&mm->page_table_lock);
+ unlock_page(page);
X page_cache_release(page);


X return 1;
X }
-

+
X /* The page isn't present yet, go ahead with the fault. */
+
+ swap_free(entry);
+ if (vm_swap_full())
+ remove_exclusive_swap_page(page);
+
X mm->rss++;
X pte = mk_pte(page, vma->vm_page_prot);
-
- swap_free(entry);
- mark_page_accessed(page);
- if (exclusive_swap_page(page)) {
- if (write_access || vm_swap_full()) {
- pte = pte_mkdirty(pte);
- if (vma->vm_flags & VM_WRITE)
- pte = pte_mkwrite(pte);
- delete_from_swap_cache(page);
- }
- }
- UnlockPage(page);
+ if (write_access && can_share_swap_page(page))
+ pte = pte_mkdirty(pte_mkwrite(pte));
+ unlock_page(page);
X
X flush_page_to_ram(page);
X flush_icache_page(vma, page);
@@ -1177,6 +1136,7 @@
X
X /* No need to invalidate - it was non-present before */
X update_mmu_cache(vma, address, pte);
+ spin_unlock(&mm->page_table_lock);


X return ret;
X }
X

@@ -1207,21 +1167,23 @@
X spin_lock(&mm->page_table_lock);
X if (!pte_none(*page_table)) {
X page_cache_release(page);
+ spin_unlock(&mm->page_table_lock);
X return 1;
X }
X mm->rss++;
X flush_page_to_ram(page);
X entry = pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
+ lru_cache_add(page);
X }
X
X set_pte(page_table, entry);
X
X /* No need to invalidate - it was non-present before */
X update_mmu_cache(vma, addr, entry);
+ spin_unlock(&mm->page_table_lock);
X return 1; /* Minor fault */
X
X no_mem:
- spin_lock(&mm->page_table_lock);


X return -1;
X }
X

@@ -1235,7 +1197,7 @@
X * do not need to flush old virtual caches or the TLB.
X *
X * This is called with the MM semaphore held and the page table
- * spinlock held.
+ * spinlock held. Exit with the spinlock released.
X */
X static int do_no_page(struct mm_struct * mm, struct vm_area_struct * vma,
X unsigned long address, int write_access, pte_t *page_table)
@@ -1247,18 +1209,27 @@
X return do_anonymous_page(mm, vma, page_table, write_access, address);
X spin_unlock(&mm->page_table_lock);
X
- /*
- * The third argument is "no_share", which tells the low-level code
- * to copy, not share the page even if sharing is possible. It's
- * essentially an early COW detection.
- */
- new_page = vma->vm_ops->nopage(vma, address & PAGE_MASK, (vma->vm_flags & VM_SHARED)?0:write_access);
+ new_page = vma->vm_ops->nopage(vma, address & PAGE_MASK, 0);
X
- spin_lock(&mm->page_table_lock);
X if (new_page == NULL) /* no page was available -- SIGBUS */
X return 0;
X if (new_page == NOPAGE_OOM)
X return -1;
+
+ /*
+ * Should we do an early C-O-W break?
+ */
+ if (write_access && !(vma->vm_flags & VM_SHARED)) {
+ struct page * page = alloc_page(GFP_HIGHUSER);
+ if (!page)
+ return -1;
+ copy_highpage(page, new_page);
+ page_cache_release(new_page);
+ lru_cache_add(page);
+ new_page = page;
+ }
+
+ spin_lock(&mm->page_table_lock);
X /*
X * This silly early PAGE_DIRTY setting removes a race
X * due to the bad i386 page protection. But it's valid
@@ -1275,20 +1246,19 @@
X flush_page_to_ram(new_page);
X flush_icache_page(vma, new_page);
X entry = mk_pte(new_page, vma->vm_page_prot);
- if (write_access) {
+ if (write_access)
X entry = pte_mkwrite(pte_mkdirty(entry));
- } else if (page_count(new_page) > 1 &&
- !(vma->vm_flags & VM_SHARED))
- entry = pte_wrprotect(entry);
X set_pte(page_table, entry);
X } else {
X /* One of our sibling threads was faster, back out. */
X page_cache_release(new_page);
+ spin_unlock(&mm->page_table_lock);


X return 1;
X }
X

X /* no need to invalidate: a not-present page shouldn't be cached */
X update_mmu_cache(vma, address, entry);
+ spin_unlock(&mm->page_table_lock);
X return 2; /* Major fault */
X }
X
@@ -1309,6 +1279,9 @@
X * The adding of pages is protected by the MM semaphore (which we hold),
X * so we don't need to worry about a page being suddenly been added into
X * our VM.
+ *
+ * We enter with the pagetable spinlock held, we are supposed to
+ * release it when done.
X */
X static inline int handle_pte_fault(struct mm_struct *mm,
X struct vm_area_struct * vma, unsigned long address,
@@ -1336,6 +1309,7 @@
X }
X entry = pte_mkyoung(entry);
X establish_pte(vma, address, pte, entry);
+ spin_unlock(&mm->page_table_lock);


X return 1;
X }
X

@@ -1345,7 +1319,6 @@
X int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma,
X unsigned long address, int write_access)
X {
- int ret = -1;
X pgd_t *pgd;
X pmd_t *pmd;
X
@@ -1362,10 +1335,10 @@
X if (pmd) {
X pte_t * pte = pte_alloc(mm, pmd, address);
X if (pte)
- ret = handle_pte_fault(mm, vma, address, write_access, pte);
+ return handle_pte_fault(mm, vma, address, write_access, pte);
X }
X spin_unlock(&mm->page_table_lock);
- return ret;
+ return -1;
X }
X
X /*
diff -u --recursive --new-file v2.4.13/linux/mm/mmap.c linux/mm/mmap.c
--- v2.4.13/linux/mm/mmap.c Tue Oct 9 17:06:53 2001
+++ linux/mm/mmap.c Sun Nov 4 10:17:20 2001
@@ -76,7 +76,7 @@
X * This double-counts: the nrpages are both in the page-cache
X * and in the swapper space. At the same time, this compensates
X * for the swap-space over-allocation (ie "nr_swap_pages" being
- * too small.
+ * too small.
X */
X free += swapper_space.nrpages;
X
diff -u --recursive --new-file v2.4.13/linux/mm/oom_kill.c linux/mm/oom_kill.c
--- v2.4.13/linux/mm/oom_kill.c Tue Oct 9 17:06:53 2001
+++ linux/mm/oom_kill.c Sat Nov 3 17:05:25 2001
@@ -150,7 +150,7 @@
X * exit() and clear out its resources quickly...
X */
X p->counter = 5 * HZ;
- p->flags |= PF_MEMALLOC;
+ p->flags |= PF_MEMALLOC | PF_MEMDIE;
X
X /* This process has hardware access, be more careful. */
X if (cap_t(p->cap_effective) & CAP_TO_MASK(CAP_SYS_RAWIO)) {
@@ -168,7 +168,7 @@
X * OR try to be smart about which process to kill. Note that we
X * don't have to be perfect here, we just have to be good.
X */
-void oom_kill(void)
+static void oom_kill(void)
X {
X struct task_struct *p = select_bad_process(), *q;
X
@@ -193,66 +193,53 @@
X return;
X }
X
-static inline int node_zones_low(pg_data_t *pgdat)
-{
- zone_t * zone;
- int i;
-
- for (i = pgdat->nr_zones-1; i >= 0; i--) {
- zone = pgdat->node_zones + i;
-
- if (zone->free_pages > (zone->pages_low))


- return 0;
-
- }

- return 1;
-}
-

-static int all_zones_low(void)
-{
- pg_data_t * pgdat = pgdat_list;
-
- pgdat = pgdat_list;
- do {
- if (node_zones_low(pgdat))
- continue;
- return 0;
- } while ((pgdat = pgdat->node_next));
-


- return 1;
-}
-

X /**
X * out_of_memory - is the system out of memory?
- *
- * Returns 0 if there is still enough memory left,
- * 1 when we are out of memory (otherwise).
X */
-int out_of_memory(void)
+void out_of_memory(void)
X {
- long cache_mem, limit;
+ static unsigned long first, last, count;
+ unsigned long now, since;
X
- /* Enough free memory? Not OOM. */
- if (!all_zones_low())
- return 0;
-
- /* Enough swap space left? Not OOM. */
+ /*
+ * Enough swap space left? Not OOM.
+ */
X if (nr_swap_pages > 0)
- return 0;
+ return;
+
+ now = jiffies;
+ since = now - last;
+ last = now;
+
+ /*
+ * If it's been a long time since last failure,
+ * we're not oom.
+ */
+ last = now;
+ if (since > 5*HZ)
+ goto reset;
+
+ /*
+ * If we haven't tried for at least one second,
+ * we're not really oom.
+ */
+ since = now - first;
+ if (since < HZ)
+ return;
X
X /*
- * If the buffer and page cache (including swap cache) are over
- * their (/proc tunable) minimum, we're still not OOM. We test
- * this to make sure we don't return OOM when the system simply
- * has a hard time with the cache.
+ * If we have gotten only a few failures,
+ * we're not really oom.
X */
- cache_mem = atomic_read(&page_cache_size);
- limit = 2;
- limit *= num_physpages / 100;
+ if (++count < 10)
+ return;
X
- if (cache_mem > limit)
- return 0;
+ /*
+ * Ok, really out of memory. Kill something.
+ */
+ oom_kill();
X
- /* Else... */
- return 1;
+reset:
+ first = now;
+ count = 0;
X }
diff -u --recursive --new-file v2.4.13/linux/mm/page_alloc.c linux/mm/page_alloc.c
--- v2.4.13/linux/mm/page_alloc.c Tue Oct 23 22:48:53 2001
+++ linux/mm/page_alloc.c Mon Nov 5 08:25:38 2001
@@ -80,8 +80,6 @@
X BUG();
X if (PageLocked(page))
X BUG();
- if (PageDecrAfter(page))
- BUG();
X if (PageActive(page))
X BUG();
X if (PageInactive(page))
@@ -139,14 +137,10 @@
X return;
X
X local_freelist:
- /*
- * This is a little subtle: if the allocation order
- * wanted is major than zero we'd better take all the pages
- * local since we must deal with fragmentation too and we
- * can't rely on the nr_local_pages information.
- */
- if (current->nr_local_pages && !current->allocation_order)
+ if (current->nr_local_pages)
X goto back_local_freelist;
+ if (in_interrupt())
+ goto back_local_freelist;
X
X list_add(&page->list, &current->local_pages);
X page->index = order;
@@ -274,8 +268,6 @@
X BUG();
X if (PageLocked(page))
X BUG();
- if (PageDecrAfter(page))
- BUG();
X if (PageActive(page))
X BUG();
X if (PageInactive(page))
@@ -358,7 +350,7 @@
X /* here we're in the low on memory slow path */
X
X rebalance:
- if (current->flags & PF_MEMALLOC) {
+ if (current->flags & (PF_MEMALLOC | PF_MEMDIE)) {
X zone = zonelist->zones;
X for (;;) {
X zone_t *z = *(zone++);
@@ -394,7 +386,7 @@
X }
X
X /* Don't let big-order allocations loop */
- if (order > 1)
+ if (order > 3)
X return NULL;
X
X /* Yield for kswapd, and try again */
@@ -430,6 +422,15 @@


X return 0;
X }
X

+void page_cache_release(struct page *page)
+{
+ if (!PageReserved(page) && put_page_testzero(page)) {
+ if (PageActive(page) || PageInactive(page))
+ lru_cache_del(page);
+ __free_pages_ok(page, 0);
+ }
+}
+
X void __free_pages(struct page *page, unsigned int order)
X {
X if (!PageReserved(page) && put_page_testzero(page))
@@ -514,14 +515,14 @@
X pg_data_t *tmpdat = pgdat;
X
X printk("Free pages: %6dkB (%6dkB HighMem)\n",
- nr_free_pages() << (PAGE_SHIFT-10),
- nr_free_highpages() << (PAGE_SHIFT-10));
+ K(nr_free_pages()),
+ K(nr_free_highpages()));
X
X while (tmpdat) {
X zone_t *zone;
X for (zone = tmpdat->node_zones;
X zone < tmpdat->node_zones + MAX_NR_ZONES; zone++)
- printk("Zone:%s freepages:%6lukB min:%6luKB low:%6lukB "
+ printk("Zone:%s freepages:%6lukB min:%6lukB low:%6lukB "
X "high:%6lukB\n",
X zone->name,
X K(zone->free_pages),
@@ -532,10 +533,6 @@
X tmpdat = tmpdat->node_next;
X }
X
- printk("Free pages: %6dkB (%6dkB HighMem)\n",
- K(nr_free_pages()),
- K(nr_free_highpages()));
-
X printk("( Active: %d, inactive: %d, free: %d )\n",
X nr_active_pages,
X nr_inactive_pages,
@@ -560,8 +557,7 @@
X nr++;
X }
X total += nr * (1 << order);
- printk("%lu*%lukB ", nr,
- (PAGE_SIZE>>10) << order);
+ printk("%lu*%lukB ", nr, K(1UL) << order);
X }
X spin_unlock_irqrestore(&zone->lock, flags);
X }
diff -u --recursive --new-file v2.4.13/linux/mm/page_io.c linux/mm/page_io.c
--- v2.4.13/linux/mm/page_io.c Wed Apr 25 14:46:21 2001
+++ linux/mm/page_io.c Mon Oct 29 12:11:17 2001
@@ -43,11 +43,6 @@
X struct inode *swapf = 0;
X int wait = 0;
X
- /* Don't allow too many pending pages in flight.. */
- if ((rw == WRITE) && atomic_read(&nr_async_pages) >
- pager_daemon.swap_cluster * (1 << page_cluster))
- wait = 1;
-
X if (rw == READ) {
X ClearPageUptodate(page);
X kstat.pswpin++;
@@ -75,10 +70,6 @@


X } else {
X return 0;
X }

- if (!wait) {
- SetPageDecrAfter(page);
- atomic_inc(&nr_async_pages);
- }
X
X /* block_size == PAGE_SIZE/zones_used */
X brw_page(rw, page, dev, zones, block_size);
diff -u --recursive --new-file v2.4.13/linux/mm/shmem.c linux/mm/shmem.c
--- v2.4.13/linux/mm/shmem.c Tue Oct 23 22:48:53 2001
+++ linux/mm/shmem.c Sun Nov 4 10:28:58 2001
@@ -212,9 +212,7 @@
X entry = *ptr;
X *ptr = (swp_entry_t){0};
X freed++;
-
- /* vmscan will do the actual page freeing later.. */
- swap_free (entry);
+ free_swap_and_cache(entry);
X }
X return freed;
X }
@@ -422,7 +420,6 @@
X */
X static int shmem_writepage(struct page * page)
X {
- int error;
X struct shmem_inode_info *info;
X swp_entry_t *entry, swap;
X struct address_space *mapping;
@@ -438,12 +435,8 @@
X info = SHMEM_I(inode);
X getswap:
X swap = get_swap_page();
- if (!swap.val) {
- activate_page(page);
- SetPageDirty(page);
- error = -ENOMEM;
- goto out;
- }
+ if (!swap.val)
+ return fail_writepage(page);
X
X spin_lock(&info->lock);
X entry = shmem_swp_entry(info, index, 0);
@@ -454,7 +447,6 @@
X BUG();
X
X /* Remove it from the page cache */
- lru_cache_del(page);
X remove_inode_page(page);
X page_cache_release(page);
X
@@ -473,11 +465,10 @@
X *entry = swap;
X info->swapped++;
X spin_unlock(&info->lock);
+ SetPageUptodate(page);
X set_page_dirty(page);
- error = 0;
-out:
X UnlockPage(page);
- return error;
+ return 0;
X }
X
X /*
@@ -628,7 +619,7 @@
X return error;
X }


X
-struct page * shmem_nopage(struct vm_area_struct * vma, unsigned long address, int no_share)

+struct page * shmem_nopage(struct vm_area_struct * vma, unsigned long address, int unused)

X {


X struct page * page;

X unsigned int idx;
@@ -640,19 +631,7 @@
X if (shmem_getpage(inode, idx, &page))
X return page;
X
- if (no_share) {
- struct page *new_page = page_cache_alloc(inode->i_mapping);
-
- if (new_page) {
- copy_user_highpage(new_page, page, address);
- flush_page_to_ram(new_page);
- } else
- new_page = NOPAGE_OOM;
- page_cache_release(page);
- return new_page;
- }
-
- flush_page_to_ram (page);
+ flush_page_to_ram(page);
X return(page);
X }
X
@@ -831,7 +810,6 @@
X while (count) {
X unsigned long bytes, index, offset;
X char *kaddr;
- int deactivate = 1;
X
X /*
X * Try to find the page in the cache. If it isn't there,
@@ -842,7 +820,6 @@
X bytes = PAGE_CACHE_SIZE - offset;
X if (bytes > count) {
X bytes = count;
- deactivate = 0;
X }
X
X /*
@@ -889,8 +866,6 @@
X unlock:
X /* Mark it unlocked again and drop the page.. */
X UnlockPage(page);
- if (deactivate)
- deactivate_page(page);
X page_cache_release(page);
X
X if (status < 0)
@@ -1157,7 +1132,7 @@
X
X inode = dentry->d_inode;
X info = SHMEM_I(inode);
- inode->i_size = len;
+ inode->i_size = len-1;
X if (len <= sizeof(struct shmem_inode_info)) {
X /* do it inline */
X memcpy(info, symname, len);
diff -u --recursive --new-file v2.4.13/linux/mm/swap.c linux/mm/swap.c
--- v2.4.13/linux/mm/swap.c Tue Oct 23 22:48:53 2001
+++ linux/mm/swap.c Sun Nov 4 10:29:49 2001
@@ -27,42 +27,12 @@
X /* How many pages do we try to swap or page in/out together? */
X int page_cluster;
X
-/* We track the number of pages currently being asynchronously swapped
- out, so that we don't try to swap TOO many pages out at once */
-atomic_t nr_async_pages = ATOMIC_INIT(0);
-
X pager_daemon_t pager_daemon = {
X 512, /* base number for calculating the number of tries */
X SWAP_CLUSTER_MAX, /* minimum number of tries */
X 8, /* do swap I/O in clusters of this size */
X };
X
-/**
- * (de)activate_page - move pages from/to active and inactive lists
- * @page: the page we want to move
- * @nolock - are we already holding the pagemap_lru_lock?
- *
- * Deactivate_page will move an active page to the right
- * inactive list, while activate_page will move a page back
- * from one of the inactive lists to the active list. If
- * called on a page which is not on any of the lists, the
- * page is left alone.
- */
-static inline void deactivate_page_nolock(struct page * page)
-{
- if (PageActive(page)) {
- del_page_from_active_list(page);
- add_page_to_inactive_list(page);
- }
-}
-
-void deactivate_page(struct page * page)
-{
- spin_lock(&pagemap_lru_lock);
- deactivate_page_nolock(page);
- spin_unlock(&pagemap_lru_lock);
-}
-
X /*
X * Move an inactive page to the active list.
X */
@@ -87,11 +57,11 @@
X */
X void lru_cache_add(struct page * page)
X {


- if (!PageLocked(page))
- BUG();

- spin_lock(&pagemap_lru_lock);
- add_page_to_inactive_list(page);
- spin_unlock(&pagemap_lru_lock);
+ if (!PageActive(page) && !PageInactive(page)) {
+ spin_lock(&pagemap_lru_lock);
+ add_page_to_inactive_list(page);
+ spin_unlock(&pagemap_lru_lock);
+ }
X }
X
X /**
@@ -107,9 +77,9 @@
X del_page_from_active_list(page);
X } else if (PageInactive(page)) {
X del_page_from_inactive_list(page);
- } else
- printk("VM: __lru_cache_del, found unknown page ?!\n");
- DEBUG_LRU_PAGE(page);
+ } else {
+// printk("VM: __lru_cache_del, found unknown page ?!\n");
+ }
X }
X
X /**
@@ -118,8 +88,6 @@
X */
X void lru_cache_del(struct page * page)
X {


- if (!PageLocked(page))
- BUG();

X spin_lock(&pagemap_lru_lock);
X __lru_cache_del(page);
X spin_unlock(&pagemap_lru_lock);
diff -u --recursive --new-file v2.4.13/linux/mm/swap_state.c linux/mm/swap_state.c
--- v2.4.13/linux/mm/swap_state.c Tue Oct 9 17:06:53 2001
+++ linux/mm/swap_state.c Wed Oct 31 15:31:03 2001
@@ -23,8 +23,7 @@
X */
X static int swap_writepage(struct page *page)
X {
- if (exclusive_swap_page(page)) {
- delete_from_swap_cache(page);
+ if (remove_exclusive_swap_page(page)) {
X UnlockPage(page);
X return 0;
X }
@@ -82,7 +81,6 @@
X INC_CACHE_INFO(exist_race);
X return -EEXIST;
X }
- SetPageUptodate(page);
X if (!PageLocked(page))
X BUG();
X if (!PageSwapCache(page))
@@ -119,8 +117,7 @@
X if (!PageLocked(page))
X BUG();
X
- if (block_flushpage(page, 0))
- lru_cache_del(page);
+ block_flushpage(page, 0);
X

X entry.val = page->index;

X
@@ -148,8 +145,7 @@
X * - Marcelo
X */
X if (PageSwapCache(page) && !TryLockPage(page)) {
- if (exclusive_swap_page(page))
- delete_from_swap_cache(page);
+ remove_exclusive_swap_page(page);
X UnlockPage(page);
X }
X page_cache_release(page);
diff -u --recursive --new-file v2.4.13/linux/mm/swapfile.c linux/mm/swapfile.c
--- v2.4.13/linux/mm/swapfile.c Tue Oct 23 22:48:53 2001
+++ linux/mm/swapfile.c Sat Nov 3 17:05:25 2001
@@ -145,18 +145,13 @@
X return entry;
X }
X
-/*
- * Caller has made sure that the swapdevice corresponding to entry
- * is still around or has not been recycled.
- */
-void swap_free(swp_entry_t entry)
+static struct swap_info_struct * swap_info_get(swp_entry_t entry)
X {
X struct swap_info_struct * p;
X unsigned long offset, type;
X
X if (!entry.val)
X goto out;
-
X type = SWP_TYPE(entry);
X if (type >= nr_swapfiles)
X goto bad_nofile;
@@ -172,8 +167,37 @@
X if (p->prio > swap_info[swap_list.next].prio)
X swap_list.next = type;
X swap_device_lock(p);
- if (p->swap_map[offset] < SWAP_MAP_MAX) {
- if (!--(p->swap_map[offset])) {
+ return p;
+
+bad_free:
+ printk(KERN_ERR "swap_free: %s%08lx\n", Unused_offset, entry.val);
+ goto out;
+bad_offset:
+ printk(KERN_ERR "swap_free: %s%08lx\n", Bad_offset, entry.val);
+ goto out;
+bad_device:
+ printk(KERN_ERR "swap_free: %s%08lx\n", Unused_file, entry.val);
+ goto out;
+bad_nofile:
+ printk(KERN_ERR "swap_free: %s%08lx\n", Bad_file, entry.val);
+out:


+ return NULL;
+}
+

+static void swap_info_put(struct swap_info_struct * p)
+{
+ swap_device_unlock(p);
+ swap_list_unlock();
+}
+
+static int swap_entry_free(struct swap_info_struct *p, unsigned long offset)
+{
+ int count = p->swap_map[offset];
+
+ if (count < SWAP_MAP_MAX) {
+ count--;
+ p->swap_map[offset] = count;
+ if (!count) {
X if (offset < p->lowest_bit)
X p->lowest_bit = offset;
X if (offset > p->highest_bit)
@@ -181,23 +205,152 @@
X nr_swap_pages++;
X }
X }
- swap_device_unlock(p);
- swap_list_unlock();
-out:
- return;
+ return count;
+}
X
-bad_nofile:
- printk(KERN_ERR "swap_free: %s%08lx\n", Bad_file, entry.val);
- goto out;
-bad_device:
- printk(KERN_ERR "swap_free: %s%08lx\n", Unused_file, entry.val);
- goto out;
-bad_offset:
- printk(KERN_ERR "swap_free: %s%08lx\n", Bad_offset, entry.val);
- goto out;
-bad_free:
- printk(KERN_ERR "swap_free: %s%08lx\n", Unused_offset, entry.val);
- goto out;
+/*
+ * Caller has made sure that the swapdevice corresponding to entry
+ * is still around or has not been recycled.
+ */
+void swap_free(swp_entry_t entry)


+{
+ struct swap_info_struct * p;
+

+ p = swap_info_get(entry);
+ if (p) {

+ swap_entry_free(p, SWP_OFFSET(entry));
+ swap_info_put(p);


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 53'
echo 'File patch-2.4.14 is continued in part 54'
echo "54" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:18 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part55

#!/bin/sh -x
# this is part 55 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 55; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ return -ENOBUFS;
+}
+
+/*
+ * Add directory entry for VLAN device.
+ */
+
+int vlan_proc_add_dev (struct net_device *vlandev)
+{
+ struct vlan_dev_info *dev_info = VLAN_DEV_INFO(vlandev);
+
+ if (!(vlandev->priv_flags & IFF_802_1Q_VLAN)) {
+ printk(KERN_ERR
+ "ERROR: vlan_proc_add, device -:%s:- is NOT a VLAN\n",
+ vlandev->name);


+ return -EINVAL;
+ }
+

+ dev_info->dent = create_proc_entry(vlandev->name,


+ S_IFREG|S_IRUSR|S_IWUSR,
+ proc_vlan_dir);

+ if (!dev_info->dent)
+ return -ENOBUFS;
+
+ dev_info->dent->proc_fops = &vlandev_fops;
+ dev_info->dent->get_info = &vlandev_get_info;
+ dev_info->dent->data = vlandev;
+
+#ifdef VLAN_DEBUG
+ printk(KERN_ERR "vlan_proc_add, device -:%s:- being added.\n",
+ vlandev->name);
+#endif


+ return 0;
+}
+
+/*

+ * Delete directory entry for VLAN device.
+ */
+int vlan_proc_rem_dev(struct net_device *vlandev)
+{
+ if (!vlandev) {
+ printk(VLAN_ERR __FUNCTION__ ": invalid argument: %p\n",
+ vlandev);


+ return -EINVAL;
+ }
+

+ if (!(vlandev->priv_flags & IFF_802_1Q_VLAN)) {
+ printk(VLAN_DBG __FUNCTION__ ": invalid argument, device: %s is not a VLAN device, priv_flags: 0x%4hX.\n",
+ vlandev->name, vlandev->priv_flags);


+ return -EINVAL;
+ }
+

+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": dev: %p\n", vlandev);
+#endif
+
+ /** NOTE: This will consume the memory pointed to by dent, it seems. */
+ remove_proc_entry(VLAN_DEV_INFO(vlandev)->dent->name, proc_vlan_dir);
+ VLAN_DEV_INFO(vlandev)->dent = NULL;


+
+ return 0;
+}
+

+/****** Proc filesystem entry points ****************************************/
+
+/*
+ * Read VLAN proc directory entry.
+ * This is universal routine for reading all entries in /proc/net/vlan
+ * directory. Each directory entry contains a pointer to the 'method' for
+ * preparing data for that entry.
+ * o verify arguments
+ * o allocate kernel buffer
+ * o call get_info() to prepare data
+ * o copy data to user space
+ * o release kernel buffer
+ *
+ * Return: number of bytes copied to user space (0, if no data)
+ * <0 error
+ */


+static ssize_t vlan_proc_read(struct file *file, char *buf,

+ size_t count, loff_t *ppos)


+{
+ struct inode *inode = file->f_dentry->d_inode;

+ struct proc_dir_entry *dent;
+ char *page;
+ int pos, offs, len;
+
+ if (count <= 0)
+ return 0;
+
+ dent = inode->u.generic_ip;
+ if ((dent == NULL) || (dent->get_info == NULL))
+ return 0;
+
+ page = kmalloc(VLAN_PROC_BUFSZ, GFP_KERNEL);
+ VLAN_MEM_DBG("page malloc, addr: %p size: %i\n",
+ page, VLAN_PROC_BUFSZ);
+
+ if (page == NULL)
+ return -ENOBUFS;
+
+ pos = dent->get_info(page, dent->data, 0, 0);
+ offs = file->f_pos;
+ if (offs < pos) {
+ len = min_t(int, pos - offs, count);
+ if (copy_to_user(buf, (page + offs), len))
+ return -EFAULT;
+
+ file->f_pos += len;
+ } else {
+ len = 0;
+ }
+
+ kfree(page);
+ VLAN_FMEM_DBG("page free, addr: %p\n", page);
+ return len;
+}
+
+/*
+ * The following few functions build the content of /proc/net/vlan/config
+ */
+
+static int vlan_proc_get_vlan_info(char* buf, unsigned int cnt)
+{


+ struct net_device *vlandev = NULL;
+ struct vlan_group *grp = NULL;
+ int i = 0;

+ char *nm_type = NULL;
+ struct vlan_dev_info *dev_info = NULL;
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": cnt == %i\n", cnt);
+#endif
+
+ if (vlan_name_type == VLAN_NAME_TYPE_RAW_PLUS_VID) {
+ nm_type = "VLAN_NAME_TYPE_RAW_PLUS_VID";
+ } else if (vlan_name_type == VLAN_NAME_TYPE_PLUS_VID_NO_PAD) {
+ nm_type = "VLAN_NAME_TYPE_PLUS_VID_NO_PAD";
+ } else if (vlan_name_type == VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD) {
+ nm_type = "VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD";
+ } else if (vlan_name_type == VLAN_NAME_TYPE_PLUS_VID) {
+ nm_type = "VLAN_NAME_TYPE_PLUS_VID";
+ } else {
+ nm_type = "UNKNOWN";
+ }
+
+ cnt += sprintf(buf + cnt, "Name-Type: %s bad_proto_recvd: %lu\n",
+ nm_type, vlan_bad_proto_recvd);
+


+ for (grp = p802_1Q_vlan_list; grp != NULL; grp = grp->next) {

+ /* loop through all devices for this device */
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": found a group, addr: %p\n",grp);
+#endif


+ for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
+ vlandev = grp->vlan_devices[i];

+ if (!vlandev)
+ continue;


+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__

+ ": found a vlan_dev, addr: %p\n", vlandev);
+#endif
+ if ((cnt + 100) > VLAN_PROC_BUFSZ) {
+ if ((cnt+strlen(term_msg)) < VLAN_PROC_BUFSZ)
+ cnt += sprintf(buf+cnt, "%s", term_msg);
+
+ return cnt;
+ }
+ if (!vlandev->priv) {
+ printk(KERN_ERR __FUNCTION__
+ ": ERROR: vlandev->priv is NULL\n");
+ continue;
+ }
+
+ dev_info = VLAN_DEV_INFO(vlandev);


+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__

+ ": got a good vlandev, addr: %p\n",
+ VLAN_DEV_INFO(vlandev));
+#endif
+ cnt += sprintf(buf + cnt, "%-15s| %d | %s\n",
+ vlandev->name, dev_info->vlan_id,
+ dev_info->real_dev->name);
+ }
+ }
+ return cnt;
+}
+
+/*
+ * Prepare data for reading 'Config' entry.
+ * Return length of data.
+ */


+
+static int vlan_config_get_info(char *buf, char **start,

+ off_t offs, int len)
+{
+ strcpy(buf, conf_hdr);
+ return vlan_proc_get_vlan_info(buf, (unsigned int)(strlen(conf_hdr)));
+}
+
+/*
+ * Prepare data for reading <device> entry.
+ * Return length of data.
+ *
+ * On entry, the 'start' argument will contain a pointer to VLAN device
+ * data space.
+ */
+


+static int vlandev_get_info(char *buf, char **start,

+ off_t offs, int len)
+{
+ struct net_device *vlandev = (void *) start;
+ struct net_device_stats *stats = NULL;
+ struct vlan_dev_info *dev_info = NULL;
+ struct vlan_priority_tci_mapping *mp;
+ int cnt = 0;
+ int i;
+
+#ifdef VLAN_DEBUG
+ printk(VLAN_DBG __FUNCTION__ ": vlandev: %p\n", vlandev);
+#endif
+
+ if ((vlandev == NULL) || (!vlandev->priv_flags & IFF_802_1Q_VLAN))
+ return 0;
+
+ dev_info = VLAN_DEV_INFO(vlandev);
+
+ cnt += sprintf(buf + cnt, "%s VID: %d REORDER_HDR: %i dev->priv_flags: %hx\n",
+ vlandev->name, dev_info->vlan_id,
+ (int)(dev_info->flags & 1), vlandev->priv_flags);
+
+ stats = vlan_dev_get_stats(vlandev);
+
+ cnt += sprintf(buf + cnt, "%30s: %12lu\n",
+ "total frames received", stats->rx_packets);
+
+ cnt += sprintf(buf + cnt, "%30s: %12lu\n",
+ "total bytes received", stats->rx_bytes);
+
+ cnt += sprintf(buf + cnt, "%30s: %12lu\n",
+ "Broadcast/Multicast Rcvd", stats->multicast);
+
+ cnt += sprintf(buf + cnt, "\n%30s: %12lu\n",
+ "total frames transmitted", stats->tx_packets);
+
+ cnt += sprintf(buf + cnt, "%30s: %12lu\n",
+ "total bytes transmitted", stats->tx_bytes);
+
+ cnt += sprintf(buf + cnt, "%30s: %12lu\n",
+ "total headroom inc", dev_info->cnt_inc_headroom_on_tx);
+
+ cnt += sprintf(buf + cnt, "%30s: %12lu\n",
+ "total encap on xmit", dev_info->cnt_encap_on_xmit);
+
+ cnt += sprintf(buf + cnt, "Device: %s", dev_info->real_dev->name);
+
+ /* now show all PRIORITY mappings relating to this VLAN */
+ cnt += sprintf(buf + cnt, "\nINGRESS priority mappings: 0:%lu 1:%lu 2:%lu 3:%lu 4:%lu 5:%lu 6:%lu 7:%lu\n",
+ dev_info->ingress_priority_map[0],
+ dev_info->ingress_priority_map[1],
+ dev_info->ingress_priority_map[2],
+ dev_info->ingress_priority_map[3],
+ dev_info->ingress_priority_map[4],
+ dev_info->ingress_priority_map[5],
+ dev_info->ingress_priority_map[6],
+ dev_info->ingress_priority_map[7]);
+
+ if ((cnt + 100) > VLAN_PROC_BUFSZ) {
+ if ((cnt + strlen(term_msg)) >= VLAN_PROC_BUFSZ) {
+ /* should never get here */
+ return cnt;
+ } else {
+ cnt += sprintf(buf + cnt, "%s", term_msg);
+ return cnt;
+ }
+ }
+
+ cnt += sprintf(buf + cnt, "EGRESSS priority Mappings: ");
+
+ for (i = 0; i<16; i++) {
+ mp = dev_info->egress_priority_map[i];
+ while (mp) {
+ cnt += sprintf(buf + cnt, "%lu:%hu ",
+ mp->priority, ((mp->vlan_qos >> 13) & 0x7));
+
+ if ((cnt + 100) > VLAN_PROC_BUFSZ) {
+ if ((cnt + strlen(term_msg)) >= VLAN_PROC_BUFSZ) {
+ /* should never get here */
+ return cnt;
+ } else {
+ cnt += sprintf(buf + cnt, "%s", term_msg);
+ return cnt;
+ }
+ }
+ mp = mp->next;
+ }
+ }
+
+ cnt += sprintf(buf + cnt, "\n");
+
+ return cnt;
+}
+
+#else /* No CONFIG_PROC_FS */
+
+/*
+ * No /proc - output stubs


+ */
+
+int __init vlan_proc_init (void)

+{
+ return 0;
+}
+

+void __exit vlan_proc_cleanup(void)
+{
+ return;
+}
+
+
+int vlan_proc_add_dev(struct net_device *vlandev)


+{
+ return 0;
+}
+

+int vlan_proc_rem_dev(struct net_device *vlandev)


+{
+ return 0;
+}
+

+#endif /* No CONFIG_PROC_FS */
diff -u --recursive --new-file v2.4.13/linux/net/8021q/vlanproc.h linux/net/8021q/vlanproc.h
--- v2.4.13/linux/net/8021q/vlanproc.h Wed Dec 31 16:00:00 1969
+++ linux/net/8021q/vlanproc.h Tue Oct 30 15:08:12 2001
@@ -0,0 +1,12 @@
+#ifndef __BEN_VLAN_PROC_INC__
+#define __BEN_VLAN_PROC_INC__
+
+int vlan_proc_init(void);
+
+int vlan_proc_rem_dev(struct net_device *vlandev);
+int vlan_proc_add_dev (struct net_device *vlandev);
+void vlan_proc_cleanup (void);
+
+#define VLAN_PROC_BUFSZ (4096) /* buffer size for printing proc info */
+
+#endif /* !(__BEN_VLAN_PROC_INC__) */
diff -u --recursive --new-file v2.4.13/linux/net/Config.in linux/net/Config.in
--- v2.4.13/linux/net/Config.in Tue Mar 6 22:44:15 2001
+++ linux/net/Config.in Tue Oct 30 15:08:12 2001
@@ -46,6 +46,9 @@
X tristate ' Multi-Protocol Over ATM (MPOA) support' CONFIG_ATM_MPOA
X fi
X fi
+
+ dep_tristate '802.1Q VLAN Support (EXPERIMENTAL)' CONFIG_VLAN_8021Q $CONFIG_EXPERIMENTAL
+
X fi
X
X comment ' '
diff -u --recursive --new-file v2.4.13/linux/net/Makefile linux/net/Makefile
--- v2.4.13/linux/net/Makefile Tue Jul 3 17:08:22 2001
+++ linux/net/Makefile Tue Oct 30 15:08:12 2001
@@ -45,6 +45,7 @@
X subdir-$(CONFIG_ATM) += atm
X subdir-$(CONFIG_DECNET) += decnet
X subdir-$(CONFIG_ECONET) += econet
+subdir-$(CONFIG_VLAN_8021Q) += 8021q
X
X
X obj-y := socket.o $(join $(subdir-y), $(patsubst %,/%.o,$(notdir $(subdir-y))))
diff -u --recursive --new-file v2.4.13/linux/net/core/Makefile linux/net/core/Makefile
--- v2.4.13/linux/net/core/Makefile Fri Dec 29 14:07:24 2000
+++ linux/net/core/Makefile Tue Oct 30 15:08:12 2001
@@ -28,6 +28,3 @@
X obj-$(CONFIG_NET_PROFILE) += profile.o
X
X include $(TOPDIR)/Rules.make


-
-tar:
- tar -cvf /dev/f1 .

diff -u --recursive --new-file v2.4.13/linux/net/core/dev.c linux/net/core/dev.c
--- v2.4.13/linux/net/core/dev.c Tue Oct 23 22:48:54 2001
+++ linux/net/core/dev.c Tue Oct 30 15:08:12 2001
@@ -107,6 +107,7 @@
X extern int plip_init(void);
X #endif
X
+
X /* This define, if set, will randomly drop a packet when congestion
X * is more than moderate. It helps fairness in the multi-interface
X * case when one of them is a hog, but it kills performance for the
@@ -137,9 +138,17 @@
X * and the routines to invoke.
X *
X * Why 16. Because with 16 the only overlap we get on a hash of the
- * low nibble of the protocol value is RARP/SNAP/X.25.
+ * low nibble of the protocol value is RARP/SNAP/X.25.
+ *
+ * NOTE: That is no longer true with the addition of VLAN tags. Not
+ * sure which should go first, but I bet it won't make much
+ * difference if we are running VLANs. The good news is that
+ * this protocol won't be in the list unless compiled in, so
+ * the average user (w/out VLANs) will not be adversly affected.
+ * --BLG
X *
X * 0800 IP
+ * 8100 802.1Q VLAN
X * 0001 802.3
X * 0002 AX.25
X * 0004 802.2
diff -u --recursive --new-file v2.4.13/linux/net/core/dv.c linux/net/core/dv.c
--- v2.4.13/linux/net/core/dv.c Wed Jul 25 17:10:26 2001
+++ linux/net/core/dv.c Sun Nov 4 09:31:57 2001
@@ -53,7 +53,7 @@
X {
X int alloc_size = (sizeof(struct divert_blk) + 3) & ~3;
X
- if (!strncmp(dev->name, "eth", 3)) {
+ if (dev->type == ARPHRD_ETHER) {
X printk(KERN_DEBUG "divert: allocating divert_blk for %s\n",
X dev->name);
X
diff -u --recursive --new-file v2.4.13/linux/net/ethernet/Makefile linux/net/ethernet/Makefile
--- v2.4.13/linux/net/ethernet/Makefile Fri Dec 29 14:07:24 2000
+++ linux/net/ethernet/Makefile Tue Oct 30 15:08:12 2001
@@ -26,6 +26,3 @@
X obj-$(CONFIG_NET) := $(OBJS) $(OBJ2)
X
X include $(TOPDIR)/Rules.make


-
-tar:
- tar -cvf /dev/f1 .

diff -u --recursive --new-file v2.4.13/linux/net/ipv4/Makefile linux/net/ipv4/Makefile
--- v2.4.13/linux/net/ipv4/Makefile Fri Dec 29 14:07:24 2000
+++ linux/net/ipv4/Makefile Tue Oct 30 15:08:12 2001
@@ -27,6 +27,3 @@
X obj-$(CONFIG_IP_PNP) += ipconfig.o
X
X include $(TOPDIR)/Rules.make


-
-tar:
- tar -cvf /dev/f1 .

diff -u --recursive --new-file v2.4.13/linux/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
--- v2.4.13/linux/net/ipv4/af_inet.c Sun Aug 12 13:28:01 2001
+++ linux/net/ipv4/af_inet.c Mon Nov 5 09:46:12 2001
@@ -5,7 +5,7 @@
X *
X * PF_INET protocol family socket handler.
X *
- * Version: $Id: af_inet.c,v 1.133 2001/08/06 13:21:16 davem Exp $
+ * Version: $Id: af_inet.c,v 1.135 2001/10/27 03:27:13 davem Exp $
X *
X * Authors: Ross Biro, <bi...@leland.Stanford.Edu>
X * Fred N. van Kempen, <wal...@uWalt.NL.Mugnet.ORG>
@@ -143,6 +143,10 @@
X int (*br_ioctl_hook)(unsigned long);
X #endif
X
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+int (*vlan_ioctl_hook)(unsigned long arg);
+#endif
+
X /* The inetsw table contains everything that inet_create needs to
X * build a new socket.
X */
@@ -879,6 +883,18 @@
X #endif
X if (br_ioctl_hook != NULL)
X return br_ioctl_hook(arg);
+#endif
+ return -ENOPKG;
+
+ case SIOCGIFVLAN:
+ case SIOCSIFVLAN:
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#ifdef CONFIG_KMOD
+ if (vlan_ioctl_hook == NULL)
+ request_module("8021q");
+#endif
+ if (vlan_ioctl_hook != NULL)
+ return vlan_ioctl_hook(arg);
X #endif
X return -ENOPKG;
X
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/ip_gre.c linux/net/ipv4/ip_gre.c
--- v2.4.13/linux/net/ipv4/ip_gre.c Tue Oct 9 17:06:53 2001
+++ linux/net/ipv4/ip_gre.c Tue Oct 30 15:08:12 2001
@@ -548,16 +548,12 @@
X static inline u8
X ipgre_ecn_encapsulate(u8 tos, struct iphdr *old_iph, struct sk_buff *skb)
X {
-#ifdef CONFIG_INET_ECN
X u8 inner = 0;
X if (skb->protocol == __constant_htons(ETH_P_IP))
X inner = old_iph->tos;
X else if (skb->protocol == __constant_htons(ETH_P_IPV6))
X inner = ip6_get_dsfield((struct ipv6hdr*)old_iph);
X return INET_ECN_encapsulate(tos, inner);
-#else
- return tos;
-#endif
X }
X
X int ipgre_rcv(struct sk_buff *skb)
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/ip_sockglue.c linux/net/ipv4/ip_sockglue.c
--- v2.4.13/linux/net/ipv4/ip_sockglue.c Sun Sep 23 11:41:01 2001
+++ linux/net/ipv4/ip_sockglue.c Tue Oct 30 15:08:12 2001
@@ -5,7 +5,7 @@
X *
X * The IP to API glue.
X *
- * Version: $Id: ip_sockglue.c,v 1.60 2001/09/18 22:29:09 davem Exp $
+ * Version: $Id: ip_sockglue.c,v 1.61 2001/10/20 00:00:11 davem Exp $
X *
X * Authors: see ip.c
X *
@@ -474,16 +474,10 @@
X sk->protinfo.af_inet.cmsg_flags &= ~IP_CMSG_RETOPTS;
X break;
X case IP_TOS: /* This sets both TOS and Precedence */
- /* Reject setting of unused bits */
-#ifndef CONFIG_INET_ECN
- if (val & ~(IPTOS_TOS_MASK|IPTOS_PREC_MASK))
- goto e_inval;
-#else
X if (sk->type == SOCK_STREAM) {
X val &= ~3;
X val |= sk->protinfo.af_inet.tos & 3;
X }
-#endif
X if (IPTOS_PREC(val) >= IPTOS_PREC_CRITIC_ECP &&
X !capable(CAP_NET_ADMIN)) {
X err = -EPERM;
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/ipconfig.c linux/net/ipv4/ipconfig.c
--- v2.4.13/linux/net/ipv4/ipconfig.c Tue Oct 23 22:48:54 2001
+++ linux/net/ipv4/ipconfig.c Tue Oct 30 15:08:12 2001


@@ -1,5 +1,5 @@
X /*

- * $Id: ipconfig.c,v 1.39 2001/10/13 01:47:31 davem Exp $
+ * $Id: ipconfig.c,v 1.40 2001/10/30 03:08:02 davem Exp $
X *
X * Automatic Configuration of IP -- use DHCP, BOOTP, RARP, or
X * user-supplied information to configure own IP address and routes.
@@ -861,6 +861,13 @@
X printk(" by server %u.%u.%u.%u\n",
X NIPQUAD(ic_servaddr));
X #endif
+ /* The DHCP indicated server address takes
+ * precedence over the bootp header one if
+ * they are different.
+ */
+ if ((server_id != INADDR_NONE) &&
+ (b->server_ip != server_id))
+ b->server_ip = ic_servaddr;
X break;
X
X case DHCPACK:
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/netfilter/Config.in linux/net/ipv4/netfilter/Config.in
--- v2.4.13/linux/net/ipv4/netfilter/Config.in Tue Mar 6 22:44:16 2001
+++ linux/net/ipv4/netfilter/Config.in Tue Oct 30 15:08:12 2001
@@ -7,6 +7,7 @@
X tristate 'Connection tracking (required for masq/NAT)' CONFIG_IP_NF_CONNTRACK
X if [ "$CONFIG_IP_NF_CONNTRACK" != "n" ]; then
X dep_tristate ' FTP protocol support' CONFIG_IP_NF_FTP $CONFIG_IP_NF_CONNTRACK
+ dep_tristate ' IRC protocol support' CONFIG_IP_NF_IRC $CONFIG_IP_NF_CONNTRACK
X fi
X
X if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_NETLINK" = "y" ]; then
@@ -20,6 +21,8 @@
X dep_tristate ' netfilter MARK match support' CONFIG_IP_NF_MATCH_MARK $CONFIG_IP_NF_IPTABLES
X dep_tristate ' Multiple port match support' CONFIG_IP_NF_MATCH_MULTIPORT $CONFIG_IP_NF_IPTABLES
X dep_tristate ' TOS match support' CONFIG_IP_NF_MATCH_TOS $CONFIG_IP_NF_IPTABLES
+ dep_tristate ' LENGTH match support' CONFIG_IP_NF_MATCH_LENGTH $CONFIG_IP_NF_IPTABLES
+ dep_tristate ' TTL match support' CONFIG_IP_NF_MATCH_TTL $CONFIG_IP_NF_IPTABLES
X dep_tristate ' tcpmss match support' CONFIG_IP_NF_MATCH_TCPMSS $CONFIG_IP_NF_IPTABLES
X if [ "$CONFIG_IP_NF_CONNTRACK" != "n" ]; then
X dep_tristate ' Connection state match support' CONFIG_IP_NF_MATCH_STATE $CONFIG_IP_NF_CONNTRACK $CONFIG_IP_NF_IPTABLES
@@ -43,6 +46,16 @@
X define_bool CONFIG_IP_NF_NAT_NEEDED y
X dep_tristate ' MASQUERADE target support' CONFIG_IP_NF_TARGET_MASQUERADE $CONFIG_IP_NF_NAT
X dep_tristate ' REDIRECT target support' CONFIG_IP_NF_TARGET_REDIRECT $CONFIG_IP_NF_NAT
+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ dep_tristate ' Basic SNMP-ALG support (EXPERIMENTAL)' CONFIG_IP_NF_NAT_SNMP_BASIC $CONFIG_IP_NF_NAT
+ fi
+ if [ "$CONFIG_IP_NF_IRC" = "m" ]; then
+ define_tristate CONFIG_IP_NF_NAT_IRC m
+ else
+ if [ "$CONFIG_IP_NF_IRC" = "y" ]; then
+ define_tristate CONFIG_IP_NF_NAT_IRC $CONFIG_IP_NF_NAT
+ fi
+ fi
X # If they want FTP, set to $CONFIG_IP_NF_NAT (m or y),
X # or $CONFIG_IP_NF_FTP (m or y), whichever is weaker. Argh.
X if [ "$CONFIG_IP_NF_FTP" = "m" ]; then
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/netfilter/Makefile linux/net/ipv4/netfilter/Makefile
--- v2.4.13/linux/net/ipv4/netfilter/Makefile Wed Apr 25 15:00:28 2001
+++ linux/net/ipv4/netfilter/Makefile Tue Oct 30 15:08:12 2001
@@ -31,6 +31,10 @@
X # connection tracking
X obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o
X
+# IRC support
+obj-$(CONFIG_IP_NF_IRC) += ip_conntrack_irc.o
+obj-$(CONFIG_IP_NF_NAT_IRC) += ip_nat_irc.o
+
X # connection tracking helpers
X obj-$(CONFIG_IP_NF_FTP) += ip_conntrack_ftp.o
X
@@ -52,6 +56,10 @@
X obj-$(CONFIG_IP_NF_MATCH_MULTIPORT) += ipt_multiport.o
X obj-$(CONFIG_IP_NF_MATCH_OWNER) += ipt_owner.o
X obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
+
+obj-$(CONFIG_IP_NF_MATCH_LENGTH) += ipt_length.o
+
+obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o
X obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o
X obj-$(CONFIG_IP_NF_MATCH_UNCLEAN) += ipt_unclean.o
X obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
@@ -63,6 +71,7 @@
X obj-$(CONFIG_IP_NF_TARGET_MARK) += ipt_MARK.o
X obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o
X obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
+obj-$(CONFIG_IP_NF_NAT_SNMP_BASIC) += ip_nat_snmp_basic.o
X obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o
X obj-$(CONFIG_IP_NF_TARGET_TCPMSS) += ipt_TCPMSS.o
X
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/netfilter/ip_conntrack_ftp.c linux/net/ipv4/netfilter/ip_conntrack_ftp.c
--- v2.4.13/linux/net/ipv4/netfilter/ip_conntrack_ftp.c Tue Oct 9 17:06:53 2001
+++ linux/net/ipv4/netfilter/ip_conntrack_ftp.c Tue Oct 30 15:08:12 2001
@@ -335,7 +335,7 @@
X LOCK_BH(&ip_ftp_lock);
X if (htonl((array[0] << 24) | (array[1] << 16) | (array[2] << 8) | array[3])
X == ct->tuplehash[dir].tuple.src.ip) {
- info->is_ftp = 1;
+ info->is_ftp = 21;
X info->seq = ntohl(tcph->seq) + matchoff;
X info->len = matchlen;
X info->ftptype = search[i].ftptype;
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/netfilter/ip_conntrack_irc.c linux/net/ipv4/netfilter/ip_conntrack_irc.c
--- v2.4.13/linux/net/ipv4/netfilter/ip_conntrack_irc.c Wed Dec 31 16:00:00 1969
+++ linux/net/ipv4/netfilter/ip_conntrack_irc.c Tue Oct 30 15:08:12 2001
@@ -0,0 +1,277 @@
+/* IRC extension for IP connection tracking, Version 1.19


+ * (C) 2000 by Harald Welte <laf...@gnumonks.org>

+ * based on RR's ip_conntrack_ftp.c
+ *
+ * ip_conntrack_irc.c,v 1.19 2001/10/25 14:34:21 laforge 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.

+ **
+ * Module load syntax:
+ * insmod ip_nat_irc.o ports=port1,port2,...port<MAX_PORTS>
+ *
+ * please give the ports of all IRC servers You wish to connect to.
+ * If You don't specify ports, the default will be port 6667


+ *
+ */
+

+#include <linux/module.h>
+#include <linux/netfilter.h>
+#include <linux/ip.h>
+#include <net/checksum.h>
+#include <net/tcp.h>
+
+#include <linux/netfilter_ipv4/lockhelp.h>
+#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
+#include <linux/netfilter_ipv4/ip_conntrack_irc.h>
+
+#define MAX_PORTS 8
+static int ports[MAX_PORTS];
+static int ports_n_c = 0;
+
+MODULE_AUTHOR("Harald Welte <laf...@gnumonks.org>");
+MODULE_DESCRIPTION("IRC (DCC) connection tracking module");
+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
+
+#define NUM_DCCPROTO 5
+struct dccproto dccprotos[NUM_DCCPROTO] = {
+ {"SEND ", 5},
+ {"CHAT ", 5},
+ {"MOVE ", 5},
+ {"TSEND ", 6},
+ {"SCHAT ", 6}
+};
+#define MAXMATCHLEN 6
+
+DECLARE_LOCK(ip_irc_lock);
+struct module *ip_conntrack_irc = THIS_MODULE;
+
+#if 0
+#define DEBUGP(format, args...) printk(KERN_DEBUG __FILE__ ":" __FUNCTION__ \
+ ":" format, ## args)
+#else
+#define DEBUGP(format, args...)
+#endif
+
+int parse_dcc(char *data, char *data_end, u_int32_t * ip, u_int16_t * port,
+ char **ad_beg_p, char **ad_end_p)
+/* tries to get the ip_addr and port out of a dcc command
+ return value: -1 on failure, 0 on success
+ data pointer to first byte of DCC command data
+ data_end pointer to last byte of dcc command data
+ ip returns parsed ip of dcc command
+ port returns parsed port of dcc command
+ ad_beg_p returns pointer to first byte of addr data
+ ad_end_p returns pointer to last byte of addr data */
+{
+
+ /* at least 12: "AAAAAAAA P\1\n" */
+ while (*data++ != ' ')
+ if (data > data_end - 12)
+ return -1;
+
+ *ad_beg_p = data;
+ *ip = simple_strtoul(data, &data, 10);
+
+ /* skip blanks between ip and port */
+ while (*data == ' ')
+ data++;
+
+
+ *port = simple_strtoul(data, &data, 10);
+ *ad_end_p = data;


+
+ return 0;
+}
+
+

+/* FIXME: This should be in userspace. Later. */
+static int help(const struct iphdr *iph, size_t len,
+ struct ip_conntrack *ct, enum ip_conntrack_info ctinfo)
+{
+ /* tcplen not negative guarenteed by ip_conntrack_tcp.c */
+ struct tcphdr *tcph = (void *) iph + iph->ihl * 4;
+ const char *data = (const char *) tcph + tcph->doff * 4;
+ const char *_data = data;
+ char *data_limit;
+ u_int32_t tcplen = len - iph->ihl * 4;
+ u_int32_t datalen = tcplen - tcph->doff * 4;
+ int dir = CTINFO2DIR(ctinfo);
+ struct ip_conntrack_tuple t, mask;
+
+ u_int32_t dcc_ip;
+ u_int16_t dcc_port;
+ int i;
+ char *addr_beg_p, *addr_end_p;
+
+ struct ip_ct_irc *info = &ct->help.ct_irc_info;
+
+ memset(&mask, 0, sizeof(struct ip_conntrack_tuple));
+ mask.dst.u.tcp.port = 0xFFFF;
+ mask.dst.protonum = 0xFFFF;
+
+ DEBUGP("entered\n");
+ /* Can't track connections formed before we registered */
+ if (!info)
+ return NF_ACCEPT;
+
+ /* If packet is coming from IRC server */
+ if (dir == IP_CT_DIR_REPLY)
+ return NF_ACCEPT;
+
+ /* Until there's been traffic both ways, don't look in packets. */
+ if (ctinfo != IP_CT_ESTABLISHED
+ && ctinfo != IP_CT_ESTABLISHED + IP_CT_IS_REPLY) {
+ DEBUGP("Conntrackinfo = %u\n", ctinfo);
+ return NF_ACCEPT;
+ }
+
+ /* Not whole TCP header? */
+ if (tcplen < sizeof(struct tcphdr) || tcplen < tcph->doff * 4) {
+ DEBUGP("tcplen = %u\n", (unsigned) tcplen);
+ return NF_ACCEPT;
+ }
+
+ /* Checksum invalid? Ignore. */
+ /* FIXME: Source route IP option packets --RR */
+ if (tcp_v4_check(tcph, tcplen, iph->saddr, iph->daddr,
+ csum_partial((char *) tcph, tcplen, 0))) {
+ DEBUGP("bad csum: %p %u %u.%u.%u.%u %u.%u.%u.%u\n",
+ tcph, tcplen, NIPQUAD(iph->saddr),
+ NIPQUAD(iph->daddr));
+ return NF_ACCEPT;
+ }
+
+ data_limit = (char *) data + datalen;
+ while (data < (data_limit - (22 + MAXMATCHLEN))) {
+ if (memcmp(data, "\1DCC ", 5)) {
+ data++;
+ continue;
+ }
+
+ data += 5;
+
+ DEBUGP("DCC found in master %u.%u.%u.%u:%u %u.%u.%u.%u:%u...\n",
+ NIPQUAD(iph->saddr), ntohs(tcph->source),
+ NIPQUAD(iph->daddr), ntohs(tcph->dest));
+
+ for (i = 0; i < NUM_DCCPROTO; i++) {
+ if (memcmp(data, dccprotos[i].match,
+ dccprotos[i].matchlen)) {
+ /* no match */
+ continue;
+ }
+
+ DEBUGP("DCC %s detected\n", dccprotos[i].match);
+ data += dccprotos[i].matchlen;
+ if (parse_dcc((char *) data, data_limit, &dcc_ip,
+ &dcc_port, &addr_beg_p, &addr_end_p)) {
+ /* unable to parse */
+ DEBUGP("unable to parse dcc command\n");
+ continue;
+ }
+ DEBUGP("DCC bound ip/port: %u.%u.%u.%u:%u\n",
+ HIPQUAD(dcc_ip), dcc_port);
+
+ if (ct->tuplehash[dir].tuple.src.ip != htonl(dcc_ip)) {
+ if (net_ratelimit())
+ printk(KERN_WARNING
+ "Forged DCC command from "
+ "%u.%u.%u.%u: %u.%u.%u.%u:%u\n",
+ NIPQUAD(ct->tuplehash[dir].tuple.src.ip),
+ HIPQUAD(dcc_ip), dcc_port);


+
+ continue;
+ }
+

+ LOCK_BH(&ip_irc_lock);
+
+ /* save position of address in dcc string,
+ * neccessary for NAT */
+ info->is_irc = IP_CONNTR_IRC;
+ DEBUGP("tcph->seq = %u\n", tcph->seq);
+ info->seq = ntohl(tcph->seq) + (addr_beg_p - _data);
+ info->len = (addr_end_p - addr_beg_p);
+ info->port = dcc_port;
+ DEBUGP("wrote info seq=%u (ofs=%u), len=%d\n",
+ info->seq, (addr_end_p - _data), info->len);
+
+ memset(&t, 0, sizeof(t));
+ t.src.ip = 0;
+ t.src.u.tcp.port = 0;
+ t.dst.ip = htonl(dcc_ip);
+ t.dst.u.tcp.port = htons(info->port);
+ t.dst.protonum = IPPROTO_TCP;
+
+ DEBUGP("expect_related %u.%u.%u.%u:%u-%u.%u.%u.%u:%u\n",
+ NIPQUAD(t.src.ip),
+ ntohs(t.src.u.tcp.port),
+ NIPQUAD(t.dst.ip),
+ ntohs(t.dst.u.tcp.port));
+
+ ip_conntrack_expect_related(ct, &t, &mask, NULL);
+ UNLOCK_BH(&ip_irc_lock);
+
+ return NF_ACCEPT;
+ } /* for .. NUM_DCCPROTO */
+ } /* while data < ... */
+
+ return NF_ACCEPT;
+}
+
+static struct ip_conntrack_helper irc_helpers[MAX_PORTS];
+
+static void fini(void);
+
+static int __init init(void)
+{
+ int i, ret;
+
+ /* If no port given, default to standard irc port */
+ if (ports[0] == 0)
+ ports[0] = 6667;
+
+ for (i = 0; (i < MAX_PORTS) && ports[i]; i++) {
+ memset(&irc_helpers[i], 0,
+ sizeof(struct ip_conntrack_helper));
+ irc_helpers[i].tuple.src.u.tcp.port = htons(ports[i]);
+ irc_helpers[i].tuple.dst.protonum = IPPROTO_TCP;
+ irc_helpers[i].mask.src.u.tcp.port = 0xFFFF;
+ irc_helpers[i].mask.dst.protonum = 0xFFFF;
+ irc_helpers[i].help = help;
+
+ DEBUGP("port #%d: %d\n", i, ports[i]);
+
+ ret = ip_conntrack_helper_register(&irc_helpers[i]);
+
+ if (ret) {
+ printk("ip_conntrack_irc: ERROR registering port %d\n",
+ ports[i]);
+ fini();
+ return -EBUSY;
+ }
+ ports_n_c++;


+ }
+ return 0;
+}
+

+/* This function is intentionally _NOT_ defined as __exit, because
+ * it is needed by the init function */
+static void fini(void)
+{
+ int i;
+ for (i = 0; (i < MAX_PORTS) && ports[i]; i++) {
+ DEBUGP("unregistering port %d\n",
+ ports[i]);
+ ip_conntrack_helper_unregister(&irc_helpers[i]);
+ }
+}
+
+module_init(init);
+module_exit(fini);
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/netfilter/ip_nat_ftp.c linux/net/ipv4/netfilter/ip_nat_ftp.c
--- v2.4.13/linux/net/ipv4/netfilter/ip_nat_ftp.c Tue Oct 9 17:06:53 2001
+++ linux/net/ipv4/netfilter/ip_nat_ftp.c Tue Oct 30 15:08:12 2001
@@ -52,7 +52,7 @@
X ftpinfo = &master->help.ct_ftp_info;
X
X LOCK_BH(&ip_ftp_lock);
- if (!ftpinfo->is_ftp) {
+ if (ftpinfo->is_ftp != 21) {
X UNLOCK_BH(&ip_ftp_lock);
X DEBUGP("nat_expected: master not ftp\n");
X return 0;
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/netfilter/ip_nat_irc.c linux/net/ipv4/netfilter/ip_nat_irc.c
--- v2.4.13/linux/net/ipv4/netfilter/ip_nat_irc.c Wed Dec 31 16:00:00 1969
+++ linux/net/ipv4/netfilter/ip_nat_irc.c Tue Oct 30 15:08:12 2001
@@ -0,0 +1,317 @@
+/* IRC extension for TCP NAT alteration.


+ * (C) 2000 by Harald Welte <laf...@gnumonks.org>

+ * based on a copy of RR's ip_nat_ftp.c
+ *
+ * ip_nat_irc.c,v 1.15 2001/10/22 10:43:53 laforge 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.
+ *

+ * Module load syntax:
+ * insmod ip_nat_irc.o ports=port1,port2,...port<MAX_PORTS>
+ *
+ * please give the ports of all IRC servers You wish to connect to.
+ * If You don't specify ports, the default will be port 6667


+ */
+
+#include <linux/module.h>

+#include <linux/netfilter_ipv4.h>
+#include <linux/ip.h>
+#include <linux/tcp.h>
+#include <linux/kernel.h>
+#include <net/tcp.h>
+#include <linux/netfilter_ipv4/ip_nat.h>
+#include <linux/netfilter_ipv4/ip_nat_helper.h>
+#include <linux/netfilter_ipv4/ip_nat_rule.h>
+#include <linux/netfilter_ipv4/ip_conntrack_irc.h>
+#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
+
+#if 0
+#define DEBUGP printk
+#else
+#define DEBUGP(format, args...)
+#endif
+
+#define MAX_PORTS 8
+static int ports[MAX_PORTS];
+static int ports_c = 0;
+
+MODULE_AUTHOR("Harald Welte <laf...@gnumonks.org>");
+MODULE_DESCRIPTION("IRC (DCC) network address translation module");
+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);
+
+/* FIXME: Time out? --RR */
+
+static int
+irc_nat_expected(struct sk_buff **pskb,
+ unsigned int hooknum,
+ struct ip_conntrack *ct,
+ struct ip_nat_info *info,
+ struct ip_conntrack *master,
+ struct ip_nat_info *masterinfo, unsigned int *verdict)
+{
+ struct ip_nat_multi_range mr;
+ u_int32_t newdstip, newsrcip, newip;
+ struct ip_ct_irc *ircinfo;
+
+ IP_NF_ASSERT(info);
+ IP_NF_ASSERT(master);
+ IP_NF_ASSERT(masterinfo);
+
+ IP_NF_ASSERT(!(info->initialized & (1 << HOOK2MANIP(hooknum))));
+
+ DEBUGP("nat_expected: We have a connection!\n");
+
+ /* Master must be an irc connection */
+ ircinfo = &master->help.ct_irc_info;
+ LOCK_BH(&ip_irc_lock);
+ if (ircinfo->is_irc != IP_CONNTR_IRC) {
+ UNLOCK_BH(&ip_irc_lock);
+ DEBUGP("nat_expected: master not irc\n");
+ return 0;
+ }
+
+ newdstip = master->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip;
+ newsrcip = master->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip;
+ DEBUGP("nat_expected: DCC cmd. %u.%u.%u.%u->%u.%u.%u.%u\n",
+ NIPQUAD(newsrcip), NIPQUAD(newdstip));
+
+ UNLOCK_BH(&ip_irc_lock);
+
+ if (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC)
+ newip = newsrcip;
+ else
+ newip = newdstip;
+
+ DEBUGP("nat_expected: IP to %u.%u.%u.%u\n", NIPQUAD(newip));
+
+ mr.rangesize = 1;
+ /* We don't want to manip the per-protocol, just the IPs. */
+ mr.range[0].flags = IP_NAT_RANGE_MAP_IPS;
+ mr.range[0].min_ip = mr.range[0].max_ip = newip;
+
+ *verdict = ip_nat_setup_info(ct, &mr, hooknum);


+
+ return 1;
+}
+

+static int irc_data_fixup(const struct ip_ct_irc *ct_irc_info,
+ struct ip_conntrack *ct,
+ unsigned int datalen,
+ struct sk_buff **pskb,
+ enum ip_conntrack_info ctinfo)
+{
+ u_int32_t newip;
+ struct ip_conntrack_tuple t;
+ struct iphdr *iph = (*pskb)->nh.iph;
+ struct tcphdr *tcph = (void *) iph + iph->ihl * 4;
+ int port;
+
+ /* "4294967296 65635 " */
+ char buffer[18];
+
+ MUST_BE_LOCKED(&ip_irc_lock);
+
+ DEBUGP("IRC_NAT: info (seq %u + %u) packet(seq %u + %u)\n",
+ ct_irc_info->seq, ct_irc_info->len,
+ ntohl(tcph->seq), datalen);
+
+ newip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
+
+ /* Alter conntrack's expectations. */
+
+ /* We can read expect here without conntrack lock, since it's
+ only set in ip_conntrack_irc, with ip_irc_lock held
+ writable */
+
+ t = ct->expected.tuple;
+ t.dst.ip = newip;
+ for (port = ct_irc_info->port; port != 0; port++) {
+ t.dst.u.tcp.port = htons(port);
+ if (ip_conntrack_expect_related(ct, &t,
+ &ct->expected.mask,
+ NULL) == 0) {
+ DEBUGP("using port %d", port);


+ break;
+ }
+
+ }

+ if (port == 0)
+ return 0;
+
+ /* strlen("\1DCC CHAT chat AAAAAAAA P\1\n")=27
+ * strlen("\1DCC SCHAT chat AAAAAAAA P\1\n")=28
+ * strlen("\1DCC SEND F AAAAAAAA P S\1\n")=26
+ * strlen("\1DCC MOVE F AAAAAAAA P S\1\n")=26
+ * strlen("\1DCC TSEND F AAAAAAAA P S\1\n")=27
+ * AAAAAAAAA: bound addr (1.0.0.0==16777216, min 8 digits,
+ * 255.255.255.255==4294967296, 10 digits)
+ * P: bound port (min 1 d, max 5d (65635))
+ * F: filename (min 1 d )
+ * S: size (min 1 d )
+ * 0x01, \n: terminators
+ */
+
+ sprintf(buffer, "%u %u", ntohl(newip), port);
+ DEBUGP("ip_nat_irc: Inserting '%s' == %u.%u.%u.%u, port %u\n",
+ buffer, NIPQUAD(newip), port);
+
+ return ip_nat_mangle_tcp_packet(pskb, ct, ctinfo,
+ ct_irc_info->seq - ntohl(tcph->seq),
+ ct_irc_info->len, buffer,
+ strlen(buffer));
+}
+
+static unsigned int help(struct ip_conntrack *ct,
+ struct ip_nat_info *info,
+ enum ip_conntrack_info ctinfo,
+ unsigned int hooknum, struct sk_buff **pskb)
+{
+ struct iphdr *iph = (*pskb)->nh.iph;
+ struct tcphdr *tcph = (void *) iph + iph->ihl * 4;
+ unsigned int datalen;
+ int dir;
+ int score;
+ struct ip_ct_irc *ct_irc_info = &ct->help.ct_irc_info;
+
+ /* Delete SACK_OK on initial TCP SYNs. */
+ if (tcph->syn && !tcph->ack)
+ ip_nat_delete_sack(*pskb, tcph);
+
+ /* Only mangle things once: original direction in POST_ROUTING
+ and reply direction on PRE_ROUTING. */
+ dir = CTINFO2DIR(ctinfo);
+ if (!((hooknum == NF_IP_POST_ROUTING && dir == IP_CT_DIR_ORIGINAL)
+ || (hooknum == NF_IP_PRE_ROUTING && dir == IP_CT_DIR_REPLY))) {
+ DEBUGP("nat_irc: Not touching dir %s at hook %s\n",
+ dir == IP_CT_DIR_ORIGINAL ? "ORIG" : "REPLY",
+ hooknum == NF_IP_POST_ROUTING ? "POSTROUTING"
+ : hooknum == NF_IP_PRE_ROUTING ? "PREROUTING"
+ : hooknum == NF_IP_LOCAL_OUT ? "OUTPUT" : "???");
+ return NF_ACCEPT;
+ }
+ DEBUGP("got beyond not touching\n");
+
+ datalen = (*pskb)->len - iph->ihl * 4 - tcph->doff * 4;
+ score = 0;
+ LOCK_BH(&ip_irc_lock);
+ if (ct_irc_info->len) {
+ DEBUGP("got beyond ct_irc_info->len\n");
+
+ /* If it's in the right range... */
+ score += between(ct_irc_info->seq, ntohl(tcph->seq),
+ ntohl(tcph->seq) + datalen);
+ score += between(ct_irc_info->seq + ct_irc_info->len,
+ ntohl(tcph->seq),
+ ntohl(tcph->seq) + datalen);
+ if (score == 1) {
+ /* Half a match? This means a partial retransmisison.
+ It's a cracker being funky. */
+ if (net_ratelimit()) {
+ printk
+ ("IRC_NAT: partial packet %u/%u in %u/%u\n",
+ ct_irc_info->seq, ct_irc_info->len,
+ ntohl(tcph->seq),
+ ntohl(tcph->seq) + datalen);
+ }
+ UNLOCK_BH(&ip_irc_lock);
+ return NF_DROP;
+ } else if (score == 2) {
+ DEBUGP("IRC_NAT: score=2, calling fixup\n");
+ if (!irc_data_fixup(ct_irc_info, ct, datalen,
+ pskb, ctinfo)) {
+ UNLOCK_BH(&ip_irc_lock);
+ return NF_DROP;
+ }
+ /* skb may have been reallocated */
+ iph = (*pskb)->nh.iph;
+ tcph = (void *) iph + iph->ihl * 4;
+ }
+ }
+
+ UNLOCK_BH(&ip_irc_lock);
+
+ ip_nat_seq_adjust(*pskb, ct, ctinfo);
+
+ return NF_ACCEPT;
+}
+
+static struct ip_nat_helper ip_nat_irc_helpers[MAX_PORTS];
+static char ip_nih_names[MAX_PORTS][6];
+
+static struct ip_nat_expect irc_expect
+ = { {NULL, NULL}, irc_nat_expected };
+
+
+/* This function is intentionally _NOT_ defined as __exit, because
+ * it is needed by init() */
+static void fini(void)
+{
+ int i;
+
+ for (i = 0; i < ports_c; i++) {
+ DEBUGP("ip_nat_irc: unregistering helper for port %d\n",
+ ports[i]);
+ ip_nat_helper_unregister(&ip_nat_irc_helpers[i]);
+ }
+ ip_nat_expect_unregister(&irc_expect);
+}
+static int __init init(void)
+{
+ int ret;
+ int i;
+ struct ip_nat_helper *hlpr;
+ char *tmpname;
+
+ ret = ip_nat_expect_register(&irc_expect);
+ if (ret == 0) {
+
+ if (ports[0] == 0) {
+ ports[0] = 6667;
+ }
+
+ for (i = 0; (i < MAX_PORTS) && ports[i] != 0; i++) {
+ hlpr = &ip_nat_irc_helpers[i];
+ memset(hlpr, 0,
+ sizeof(struct ip_nat_helper));
+
+ hlpr->tuple.dst.protonum = IPPROTO_TCP;
+ hlpr->tuple.src.u.tcp.port = htons(ports[i]);
+ hlpr->mask.src.u.tcp.port = 0xFFFF;
+ hlpr->mask.dst.protonum = 0xFFFF;
+ hlpr->help = help;
+
+ tmpname = &ip_nih_names[i][0];
+ sprintf(tmpname, "irc%2.2d", i);
+
+ hlpr->name = tmpname;
+ DEBUGP
+ ("ip_nat_irc: Trying to register helper for port %d: name %s\n",
+ ports[i], hlpr->name);
+ ret = ip_nat_helper_register(hlpr);
+
+ if (ret) {
+ printk
+ ("ip_nat_irc: error registering helper for port %d\n",
+ ports[i]);
+ fini();
+ return 1;
+ }
+ ports_c++;


+ }
+ }
+ return ret;
+}
+
+

+module_init(init);
+module_exit(fini);
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/netfilter/ip_nat_snmp_basic.c linux/net/ipv4/netfilter/ip_nat_snmp_basic.c
--- v2.4.13/linux/net/ipv4/netfilter/ip_nat_snmp_basic.c Wed Dec 31 16:00:00 1969
+++ linux/net/ipv4/netfilter/ip_nat_snmp_basic.c Tue Oct 30 15:08:12 2001
@@ -0,0 +1,1354 @@
+/*
+ * ip_nat_snmp_basic.c
+ *
+ * Basic SNMP Application Layer Gateway
+ *
+ * This IP NAT module is intended for use with SNMP network
+ * discovery and monitoring applications where target networks use
+ * conflicting private address realms.
+ *
+ * Static NAT is used to remap the networks from the view of the network
+ * management system at the IP layer, and this module remaps some application
+ * layer addresses to match.
+ *
+ * The simplest form of ALG is performed, where only tagged IP addresses
+ * are modified. The module does not need to be MIB aware and only scans
+ * messages at the ASN.1/BER level.
+ *
+ * Currently, only SNMPv1 and SNMPv2 are supported.
+ *
+ * More information on ALG and associated issues can be found in
+ * RFC 2962
+ *
+ * The ASB.1/BER parsing code is derived from the gxsnmp package by Gregory
+ * McLean & Jochen Friedrich, stripped down for use in the kernel.
+ *
+ * Copyright (c) 2000 RP Internet (www.rpi.net.au).
+ *


+ * This 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

+ *
+ * Author: James Morris <jmo...@intercode.com.au>
+ *
+ * Updates:
+ * 2000-08-06: Convert to new helper API (Harald Welte).
+ *
+ */
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/netfilter_ipv4.h>
+#include <linux/netfilter_ipv4/ip_nat.h>
+#include <linux/netfilter_ipv4/ip_nat_helper.h>
+#include <linux/brlock.h>
+#include <linux/types.h>
+#include <linux/ip.h>
+#include <net/udp.h>
+#include <asm/uaccess.h>
+#include <asm/checksum.h>
+
+
+
+#define SNMP_PORT 161
+#define SNMP_TRAP_PORT 162
+#define NOCT1(n) (u_int8_t )((n) & 0xff)
+
+static int debug = 0;
+static spinlock_t snmp_lock = SPIN_LOCK_UNLOCKED;
+
+/*
+ * Application layer address mapping mimics the NAT mapping, but
+ * only for the first octet in this case (a more flexible system
+ * can be implemented if needed).
+ */
+struct oct1_map
+{
+ u_int8_t from;
+ u_int8_t to;
+};
+
+
+/*****************************************************************************
+ *
+ * Basic ASN.1 decoding routines (gxsnmp author Dirk Wisse)
+ *
+ *****************************************************************************/
+
+/* Class */
+#define ASN1_UNI 0 /* Universal */
+#define ASN1_APL 1 /* Application */
+#define ASN1_CTX 2 /* Context */
+#define ASN1_PRV 3 /* Private */
+
+/* Tag */
+#define ASN1_EOC 0 /* End Of Contents */
+#define ASN1_BOL 1 /* Boolean */
+#define ASN1_INT 2 /* Integer */
+#define ASN1_BTS 3 /* Bit String */
+#define ASN1_OTS 4 /* Octet String */
+#define ASN1_NUL 5 /* Null */
+#define ASN1_OJI 6 /* Object Identifier */
+#define ASN1_OJD 7 /* Object Description */
+#define ASN1_EXT 8 /* External */
+#define ASN1_SEQ 16 /* Sequence */
+#define ASN1_SET 17 /* Set */
+#define ASN1_NUMSTR 18 /* Numerical String */
+#define ASN1_PRNSTR 19 /* Printable String */
+#define ASN1_TEXSTR 20 /* Teletext String */
+#define ASN1_VIDSTR 21 /* Video String */
+#define ASN1_IA5STR 22 /* IA5 String */
+#define ASN1_UNITIM 23 /* Universal Time */
+#define ASN1_GENTIM 24 /* General Time */
+#define ASN1_GRASTR 25 /* Graphical String */
+#define ASN1_VISSTR 26 /* Visible String */
+#define ASN1_GENSTR 27 /* General String */
+
+/* Primitive / Constructed methods*/
+#define ASN1_PRI 0 /* Primitive */
+#define ASN1_CON 1 /* Constructed */
+
+/*
+ * Error codes.
+ */
+#define ASN1_ERR_NOERROR 0
+#define ASN1_ERR_DEC_EMPTY 2
+#define ASN1_ERR_DEC_EOC_MISMATCH 3
+#define ASN1_ERR_DEC_LENGTH_MISMATCH 4
+#define ASN1_ERR_DEC_BADVALUE 5
+
+/*
+ * ASN.1 context.
+ */
+struct asn1_ctx
+{
+ int error; /* Error condition */
+ unsigned char *pointer; /* Octet just to be decoded */
+ unsigned char *begin; /* First octet */
+ unsigned char *end; /* Octet after last octet */
+};
+
+/*
+ * Octet string (not null terminated)
+ */
+struct asn1_octstr
+{
+ unsigned char *data;
+ unsigned int len;
+};
+
+static void asn1_open(struct asn1_ctx *ctx,
+ unsigned char *buf,
+ unsigned int len)
+{
+ ctx->begin = buf;
+ ctx->end = buf + len;
+ ctx->pointer = buf;
+ ctx->error = ASN1_ERR_NOERROR;
+}
+
+static unsigned char asn1_octet_decode(struct asn1_ctx *ctx, unsigned char *ch)
+{
+ if (ctx->pointer >= ctx->end) {
+ ctx->error = ASN1_ERR_DEC_EMPTY;
+ return 0;
+ }
+ *ch = *(ctx->pointer)++;


+ return 1;
+}
+

+static unsigned char asn1_tag_decode(struct asn1_ctx *ctx, unsigned int *tag)
+{
+ unsigned char ch;
+
+ *tag = 0;
+
+ do
+ {
+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+ *tag <<= 7;
+ *tag |= ch & 0x7F;
+ } while ((ch & 0x80) == 0x80);


+ return 1;
+}
+

+static unsigned char asn1_id_decode(struct asn1_ctx *ctx,
+ unsigned int *cls,
+ unsigned int *con,
+ unsigned int *tag)
+{
+ unsigned char ch;
+
+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+
+ *cls = (ch & 0xC0) >> 6;
+ *con = (ch & 0x20) >> 5;
+ *tag = (ch & 0x1F);
+
+ if (*tag == 0x1F) {
+ if (!asn1_tag_decode(ctx, tag))
+ return 0;
+ }


+ return 1;
+}
+

+static unsigned char asn1_length_decode(struct asn1_ctx *ctx,
+ unsigned int *def,
+ unsigned int *len)
+{
+ unsigned char ch, cnt;
+
+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+
+ if (ch == 0x80)
+ *def = 0;
+ else {
+ *def = 1;
+
+ if (ch < 0x80)
+ *len = ch;
+ else {
+ cnt = (unsigned char) (ch & 0x7F);
+ *len = 0;
+
+ while (cnt > 0) {
+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+ *len <<= 8;
+ *len |= ch;
+ cnt--;


+ }
+ }
+ }
+ return 1;
+}
+

+static unsigned char asn1_header_decode(struct asn1_ctx *ctx,
+ unsigned char **eoc,
+ unsigned int *cls,
+ unsigned int *con,
+ unsigned int *tag)
+{
+ unsigned int def, len;
+
+ if (!asn1_id_decode(ctx, cls, con, tag))
+ return 0;
+
+ if (!asn1_length_decode(ctx, &def, &len))
+ return 0;
+
+ if (def)
+ *eoc = ctx->pointer + len;
+ else
+ *eoc = 0;


+ return 1;
+}
+

+static unsigned char asn1_eoc_decode(struct asn1_ctx *ctx, unsigned char *eoc)
+{
+ unsigned char ch;
+
+ if (eoc == 0) {
+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+
+ if (ch != 0x00) {
+ ctx->error = ASN1_ERR_DEC_EOC_MISMATCH;


+ return 0;
+ }
+

+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+
+ if (ch != 0x00) {
+ ctx->error = ASN1_ERR_DEC_EOC_MISMATCH;
+ return 0;
+ }


+ return 1;
+ } else {

+ if (ctx->pointer != eoc) {
+ ctx->error = ASN1_ERR_DEC_LENGTH_MISMATCH;
+ return 0;
+ }


+ return 1;
+ }
+}
+

+static unsigned char asn1_null_decode(struct asn1_ctx *ctx, unsigned char *eoc)
+{
+ ctx->pointer = eoc;


+ return 1;
+}
+

+static unsigned char asn1_long_decode(struct asn1_ctx *ctx,
+ unsigned char *eoc,
+ long *integer)
+{
+ unsigned char ch;
+ unsigned int len;
+
+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+
+ *integer = (signed char) ch;
+ len = 1;
+
+ while (ctx->pointer < eoc) {
+ if (++len > sizeof (long)) {
+ ctx->error = ASN1_ERR_DEC_BADVALUE;


+ return 0;
+ }
+

+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+
+ *integer <<= 8;
+ *integer |= ch;


+ }
+ return 1;
+}
+

+static unsigned char asn1_uint_decode(struct asn1_ctx *ctx,
+ unsigned char *eoc,
+ unsigned int *integer)
+{
+ unsigned char ch;
+ unsigned int len;
+
+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+
+ *integer = ch;
+ if (ch == 0) len = 0;
+ else len = 1;
+
+ while (ctx->pointer < eoc) {
+ if (++len > sizeof (unsigned int)) {
+ ctx->error = ASN1_ERR_DEC_BADVALUE;


+ return 0;
+ }
+

+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+
+ *integer <<= 8;
+ *integer |= ch;


+ }
+ return 1;
+}
+

+static unsigned char asn1_ulong_decode(struct asn1_ctx *ctx,
+ unsigned char *eoc,
+ unsigned long *integer)
+{
+ unsigned char ch;
+ unsigned int len;
+
+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+
+ *integer = ch;
+ if (ch == 0) len = 0;
+ else len = 1;
+
+ while (ctx->pointer < eoc) {
+ if (++len > sizeof (unsigned long)) {
+ ctx->error = ASN1_ERR_DEC_BADVALUE;


+ return 0;
+ }
+

+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+
+ *integer <<= 8;
+ *integer |= ch;


+ }
+ return 1;
+}
+

+static unsigned char asn1_octets_decode(struct asn1_ctx *ctx,
+ unsigned char *eoc,
+ unsigned char **octets,
+ unsigned int *len)
+{
+ unsigned char *ptr;
+
+ *len = 0;
+
+ *octets = kmalloc(eoc - ctx->pointer, GFP_ATOMIC);
+ if (*octets == NULL) {
+ if (net_ratelimit())
+ printk("OOM in bsalg (%d)\n", __LINE__);


+ return 0;
+ }
+

+ ptr = *octets;
+ while (ctx->pointer < eoc) {
+ if (!asn1_octet_decode(ctx, (unsigned char *)ptr++)) {
+ kfree(*octets);
+ *octets = NULL;
+ return 0;
+ }
+ (*len)++;


+ }
+ return 1;
+}
+

+static unsigned char asn1_subid_decode(struct asn1_ctx *ctx,
+ unsigned long *subid)
+{
+ unsigned char ch;
+
+ *subid = 0;
+
+ do {
+ if (!asn1_octet_decode(ctx, &ch))
+ return 0;
+
+ *subid <<= 7;
+ *subid |= ch & 0x7F;
+ } while ((ch & 0x80) == 0x80);


+ return 1;
+}
+

+static unsigned char asn1_oid_decode(struct asn1_ctx *ctx,
+ unsigned char *eoc,
+ unsigned long **oid,
+ unsigned int *len)
+{
+ unsigned long subid;
+ unsigned int size;
+ unsigned long *optr;
+
+ size = eoc - ctx->pointer + 1;
+ *oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC);
+ if (*oid == NULL) {
+ if (net_ratelimit())
+ printk("OOM in bsalg (%d)\n", __LINE__);


+ return 0;
+ }
+

+ optr = *oid;
+
+ if (!asn1_subid_decode(ctx, &subid)) {
+ kfree(*oid);
+ *oid = NULL;


+ return 0;
+ }
+

+ if (subid < 40) {
+ optr [0] = 0;
+ optr [1] = subid;
+ } else if (subid < 80) {
+ optr [0] = 1;
+ optr [1] = subid - 40;
+ } else {
+ optr [0] = 2;
+ optr [1] = subid - 80;
+ }
+
+ *len = 2;
+ optr += 2;
+
+ while (ctx->pointer < eoc) {
+ if (++(*len) > size) {
+ ctx->error = ASN1_ERR_DEC_BADVALUE;
+ kfree(*oid);
+ *oid = NULL;


+ return 0;
+ }
+

+ if (!asn1_subid_decode(ctx, optr++)) {
+ kfree(*oid);
+ *oid = NULL;


+ return 0;
+ }
+ }

+ return 1;
+}
+
+/*****************************************************************************
+ *
+ * SNMP decoding routines (gxsnmp author Dirk Wisse)
+ *
+ *****************************************************************************/
+
+/* SNMP Versions */
+#define SNMP_V1 0
+#define SNMP_V2C 1
+#define SNMP_V2 2
+#define SNMP_V3 3
+
+/* Default Sizes */
+#define SNMP_SIZE_COMM 256
+#define SNMP_SIZE_OBJECTID 128
+#define SNMP_SIZE_BUFCHR 256
+#define SNMP_SIZE_BUFINT 128
+#define SNMP_SIZE_SMALLOBJECTID 16
+
+/* Requests */
+#define SNMP_PDU_GET 0
+#define SNMP_PDU_NEXT 1
+#define SNMP_PDU_RESPONSE 2
+#define SNMP_PDU_SET 3
+#define SNMP_PDU_TRAP1 4
+#define SNMP_PDU_BULK 5
+#define SNMP_PDU_INFORM 6
+#define SNMP_PDU_TRAP2 7
+
+/* Errors */
+#define SNMP_NOERROR 0
+#define SNMP_TOOBIG 1
+#define SNMP_NOSUCHNAME 2
+#define SNMP_BADVALUE 3
+#define SNMP_READONLY 4
+#define SNMP_GENERROR 5
+#define SNMP_NOACCESS 6
+#define SNMP_WRONGTYPE 7
+#define SNMP_WRONGLENGTH 8
+#define SNMP_WRONGENCODING 9
+#define SNMP_WRONGVALUE 10
+#define SNMP_NOCREATION 11
+#define SNMP_INCONSISTENTVALUE 12
+#define SNMP_RESOURCEUNAVAILABLE 13
+#define SNMP_COMMITFAILED 14
+#define SNMP_UNDOFAILED 15
+#define SNMP_AUTHORIZATIONERROR 16
+#define SNMP_NOTWRITABLE 17
+#define SNMP_INCONSISTENTNAME 18
+
+/* General SNMP V1 Traps */
+#define SNMP_TRAP_COLDSTART 0
+#define SNMP_TRAP_WARMSTART 1
+#define SNMP_TRAP_LINKDOWN 2
+#define SNMP_TRAP_LINKUP 3
+#define SNMP_TRAP_AUTFAILURE 4
+#define SNMP_TRAP_EQPNEIGHBORLOSS 5
+#define SNMP_TRAP_ENTSPECIFIC 6
+
+/* SNMPv1 Types */
+#define SNMP_NULL 0
+#define SNMP_INTEGER 1 /* l */
+#define SNMP_OCTETSTR 2 /* c */
+#define SNMP_DISPLAYSTR 2 /* c */
+#define SNMP_OBJECTID 3 /* ul */
+#define SNMP_IPADDR 4 /* uc */
+#define SNMP_COUNTER 5 /* ul */
+#define SNMP_GAUGE 6 /* ul */
+#define SNMP_TIMETICKS 7 /* ul */
+#define SNMP_OPAQUE 8 /* c */
+
+/* Additional SNMPv2 Types */
+#define SNMP_UINTEGER 5 /* ul */
+#define SNMP_BITSTR 9 /* uc */
+#define SNMP_NSAP 10 /* uc */
+#define SNMP_COUNTER64 11 /* ul */
+#define SNMP_NOSUCHOBJECT 12
+#define SNMP_NOSUCHINSTANCE 13
+#define SNMP_ENDOFMIBVIEW 14
+
+union snmp_syntax
+{
+ unsigned char uc[0]; /* 8 bit unsigned */
+ char c[0]; /* 8 bit signed */
+ unsigned long ul[0]; /* 32 bit unsigned */
+ long l[0]; /* 32 bit signed */
+};
+
+struct snmp_object
+{
+ unsigned long *id;
+ unsigned int id_len;
+ unsigned short type;
+ unsigned int syntax_len;
+ union snmp_syntax syntax;
+};
+
+struct snmp_request
+{
+ unsigned long id;
+ unsigned int error_status;
+ unsigned int error_index;
+};
+
+struct snmp_v1_trap
+{
+ unsigned long *id;
+ unsigned int id_len;
+ unsigned long ip_address; /* pointer */
+ unsigned int general;
+ unsigned int specific;
+ unsigned long time;
+};
+
+/* SNMP types */
+#define SNMP_IPA 0
+#define SNMP_CNT 1
+#define SNMP_GGE 2
+#define SNMP_TIT 3
+#define SNMP_OPQ 4
+#define SNMP_C64 6
+
+/* SNMP errors */
+#define SERR_NSO 0
+#define SERR_NSI 1
+#define SERR_EOM 2
+
+static void inline mangle_address(unsigned char *begin,
+ unsigned char *addr,
+ const struct oct1_map *map,
+ u_int16_t *check);
+struct snmp_cnv
+{
+ unsigned int class;
+ unsigned int tag;
+ int syntax;
+};
+
+static struct snmp_cnv snmp_conv [] =
+{
+ {ASN1_UNI, ASN1_NUL, SNMP_NULL},
+ {ASN1_UNI, ASN1_INT, SNMP_INTEGER},
+ {ASN1_UNI, ASN1_OTS, SNMP_OCTETSTR},
+ {ASN1_UNI, ASN1_OTS, SNMP_DISPLAYSTR},
+ {ASN1_UNI, ASN1_OJI, SNMP_OBJECTID},
+ {ASN1_APL, SNMP_IPA, SNMP_IPADDR},
+ {ASN1_APL, SNMP_CNT, SNMP_COUNTER}, /* Counter32 */
+ {ASN1_APL, SNMP_GGE, SNMP_GAUGE}, /* Gauge32 == Unsigned32 */
+ {ASN1_APL, SNMP_TIT, SNMP_TIMETICKS},
+ {ASN1_APL, SNMP_OPQ, SNMP_OPAQUE},
+
+ /* SNMPv2 data types and errors */
+ {ASN1_UNI, ASN1_BTS, SNMP_BITSTR},
+ {ASN1_APL, SNMP_C64, SNMP_COUNTER64},
+ {ASN1_CTX, SERR_NSO, SNMP_NOSUCHOBJECT},
+ {ASN1_CTX, SERR_NSI, SNMP_NOSUCHINSTANCE},
+ {ASN1_CTX, SERR_EOM, SNMP_ENDOFMIBVIEW},
+ {0, 0, -1}
+};
+
+static unsigned char snmp_tag_cls2syntax(unsigned int tag,
+ unsigned int cls,
+ unsigned short *syntax)
+{
+ struct snmp_cnv *cnv;
+
+ cnv = snmp_conv;
+
+ while (cnv->syntax != -1) {
+ if (cnv->tag == tag && cnv->class == cls) {
+ *syntax = cnv->syntax;
+ return 1;
+ }
+ cnv++;


+ }
+ return 0;
+}
+

+static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
+ struct snmp_object **obj)
+{
+ unsigned int cls, con, tag, len, idlen;
+ unsigned short type;
+ unsigned char *eoc, *end, *p;
+ unsigned long *lp, *id;
+ unsigned long ul;
+ long l;
+
+ *obj = NULL;
+ id = NULL;
+
+ if (!asn1_header_decode(ctx, &eoc, &cls, &con, &tag))
+ return 0;
+
+ if (cls != ASN1_UNI || con != ASN1_CON || tag != ASN1_SEQ)
+ return 0;
+
+ if (!asn1_header_decode(ctx, &end, &cls, &con, &tag))
+ return 0;
+
+ if (cls != ASN1_UNI || con != ASN1_PRI || tag != ASN1_OJI)
+ return 0;
+
+ if (!asn1_oid_decode(ctx, end, &id, &idlen))
+ return 0;
+
+ if (!asn1_header_decode(ctx, &end, &cls, &con, &tag)) {
+ kfree(id);


+ return 0;
+ }
+

+ if (con != ASN1_PRI) {
+ kfree(id);


+ return 0;
+ }
+

+ if (!snmp_tag_cls2syntax(tag, cls, &type)) {
+ kfree(id);


+ return 0;
+ }
+

+ switch (type) {
+ case SNMP_INTEGER:
+ len = sizeof(long);
+ if (!asn1_long_decode(ctx, end, &l)) {
+ kfree(id);
+ return 0;
+ }
+ *obj = kmalloc(sizeof(struct snmp_object) + len,
+ GFP_ATOMIC);
+ if (*obj == NULL) {
+ kfree(id);
+ if (net_ratelimit())
+ printk("OOM in bsalg (%d)\n", __LINE__);
+ return 0;
+ }
+ (*obj)->syntax.l[0] = l;
+ break;
+ case SNMP_OCTETSTR:
+ case SNMP_OPAQUE:
+ if (!asn1_octets_decode(ctx, end, &p, &len)) {
+ kfree(id);
+ return 0;
+ }
+ *obj = kmalloc(sizeof(struct snmp_object) + len,
+ GFP_ATOMIC);
+ if (*obj == NULL) {
+ kfree(id);
+ if (net_ratelimit())
+ printk("OOM in bsalg (%d)\n", __LINE__);
+ return 0;
+ }
+ memcpy((*obj)->syntax.c, p, len);
+ kfree(p);
+ break;
+ case SNMP_NULL:
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ len = 0;
+ *obj = kmalloc(sizeof(struct snmp_object), GFP_ATOMIC);
+ if (*obj == NULL) {
+ kfree(id);
+ if (net_ratelimit())
+ printk("OOM in bsalg (%d)\n", __LINE__);
+ return 0;
+ }
+ if (!asn1_null_decode(ctx, end)) {
+ kfree(id);
+ kfree(*obj);
+ *obj = NULL;
+ return 0;
+ }
+ break;
+ case SNMP_OBJECTID:
+ if (!asn1_oid_decode(ctx, end, (unsigned long **)&lp, &len)) {
+ kfree(id);
+ return 0;
+ }
+ len *= sizeof(unsigned long);
+ *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
+ if (*obj == NULL) {
+ kfree(id);
+ if (net_ratelimit())
+ printk("OOM in bsalg (%d)\n", __LINE__);
+ return 0;
+ }
+ memcpy((*obj)->syntax.ul, lp, len);
+ kfree(lp);
+ break;
+ case SNMP_IPADDR:
+ if (!asn1_octets_decode(ctx, end, &p, &len)) {
+ kfree(id);
+ return 0;
+ }
+ if (len != 4) {
+ kfree(p);
+ kfree(id);
+ return 0;
+ }
+ *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
+ if (*obj == NULL) {
+ kfree(p);
+ kfree(id);
+ if (net_ratelimit())
+ printk("OOM in bsalg (%d)\n", __LINE__);


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 55'
echo 'File patch-2.4.14 is continued in part 56'
echo "56" > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:19 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part56

#!/bin/sh -x
# this is part 56 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 56; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ return 0;
+ }
+ memcpy((*obj)->syntax.uc, p, len);
+ kfree(p);
+ break;
+ case SNMP_COUNTER:
+ case SNMP_GAUGE:
+ case SNMP_TIMETICKS:
+ len = sizeof(unsigned long);
+ if (!asn1_ulong_decode(ctx, end, &ul)) {


+ kfree(id);
+ return 0;
+ }
+ *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
+ if (*obj == NULL) {

+ kfree(id);
+ if (net_ratelimit())
+ printk("OOM in bsalg (%d)\n", __LINE__);
+ return 0;
+ }

+ (*obj)->syntax.ul[0] = ul;
+ break;
+ default:


+ kfree(id);
+ return 0;
+ }
+

+ (*obj)->syntax_len = len;
+ (*obj)->type = type;
+ (*obj)->id = id;
+ (*obj)->id_len = idlen;
+
+ if (!asn1_eoc_decode(ctx, eoc)) {


+ kfree(id);
+ kfree(*obj);
+ *obj = NULL;
+ return 0;
+ }

+ return 1;
+}
+

+static unsigned char snmp_request_decode(struct asn1_ctx *ctx,
+ struct snmp_request *request)
+{
+ unsigned int cls, con, tag;
+ unsigned char *end;


+
+ if (!asn1_header_decode(ctx, &end, &cls, &con, &tag))
+ return 0;
+

+ if (cls != ASN1_UNI || con != ASN1_PRI || tag != ASN1_INT)
+ return 0;
+
+ if (!asn1_ulong_decode(ctx, end, &request->id))


+ return 0;
+
+ if (!asn1_header_decode(ctx, &end, &cls, &con, &tag))
+ return 0;
+

+ if (cls != ASN1_UNI || con != ASN1_PRI || tag != ASN1_INT)
+ return 0;
+
+ if (!asn1_uint_decode(ctx, end, &request->error_status))


+ return 0;
+
+ if (!asn1_header_decode(ctx, &end, &cls, &con, &tag))
+ return 0;
+

+ if (cls != ASN1_UNI || con != ASN1_PRI || tag != ASN1_INT)
+ return 0;
+
+ if (!asn1_uint_decode(ctx, end, &request->error_index))


+ return 0;
+
+ return 1;
+}
+

+static unsigned char snmp_trap_decode(struct asn1_ctx *ctx,
+ struct snmp_v1_trap *trap,


+ const struct oct1_map *map,
+ u_int16_t *check)

+{
+ unsigned int cls, con, tag, len;
+ unsigned char *end;


+
+ if (!asn1_header_decode(ctx, &end, &cls, &con, &tag))
+ return 0;
+
+ if (cls != ASN1_UNI || con != ASN1_PRI || tag != ASN1_OJI)
+ return 0;
+

+ if (!asn1_oid_decode(ctx, end, &trap->id, &trap->id_len))


+ return 0;
+
+ if (!asn1_header_decode(ctx, &end, &cls, &con, &tag))

+ goto err_id_free;
+
+ if (!((cls == ASN1_APL && con == ASN1_PRI && tag == SNMP_IPA) ||
+ (cls == ASN1_UNI && con == ASN1_PRI && tag == ASN1_OTS)))
+ goto err_id_free;
+
+ if (!asn1_octets_decode(ctx, end, (unsigned char **)&trap->ip_address, &len))
+ goto err_id_free;
+
+ /* IPv4 only */


+ if (len != 4)

+ goto err_addr_free;
+
+ mangle_address(ctx->begin, ctx->pointer - 4, map, check);


+
+ if (!asn1_header_decode(ctx, &end, &cls, &con, &tag))

+ goto err_addr_free;
+
+ if (cls != ASN1_UNI || con != ASN1_PRI || tag != ASN1_INT)
+ goto err_addr_free;;
+
+ if (!asn1_uint_decode(ctx, end, &trap->general))
+ goto err_addr_free;;


+
+ if (!asn1_header_decode(ctx, &end, &cls, &con, &tag))

+ goto err_addr_free;
+
+ if (cls != ASN1_UNI || con != ASN1_PRI || tag != ASN1_INT)
+ goto err_addr_free;
+
+ if (!asn1_uint_decode(ctx, end, &trap->specific))
+ goto err_addr_free;


+
+ if (!asn1_header_decode(ctx, &end, &cls, &con, &tag))

+ goto err_addr_free;
+
+ if (!((cls == ASN1_APL && con == ASN1_PRI && tag == SNMP_TIT) ||
+ (cls == ASN1_UNI && con == ASN1_PRI && tag == ASN1_INT)))
+ goto err_addr_free;
+
+ if (!asn1_ulong_decode(ctx, end, &trap->time))
+ goto err_addr_free;


+
+ return 1;
+

+err_id_free:
+ kfree(trap->id);
+
+err_addr_free:
+ kfree((unsigned long *)trap->ip_address);


+
+ return 0;
+}
+

+/*****************************************************************************
+ *
+ * Misc. routines


+ *
+ *****************************************************************************/
+

+static void 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");
+}
+
+/*
+ * 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 void inline 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).
+ */
+static int snmp_parse_mangle(unsigned char *msg,
+ u_int16_t len,


+ const struct oct1_map *map,
+ u_int16_t *check)

+{
+ unsigned char *eoc, *end;
+ unsigned int cls, con, tag, vers, pdutype;
+ struct asn1_ctx ctx;
+ struct asn1_octstr comm;
+ struct snmp_object **obj;
+
+ if (debug > 1)
+ hex_dump(msg, len);
+
+ asn1_open(&ctx, msg, len);
+
+ /*
+ * Start of SNMP message.
+ */
+ if (!asn1_header_decode(&ctx, &eoc, &cls, &con, &tag))


+ return 0;
+ if (cls != ASN1_UNI || con != ASN1_CON || tag != ASN1_SEQ)
+ return 0;
+

+ /*
+ * Version 1 or 2 handled.
+ */
+ if (!asn1_header_decode(&ctx, &end, &cls, &con, &tag))
+ return 0;
+ if (cls != ASN1_UNI || con != ASN1_PRI || tag != ASN1_INT)
+ return 0;
+ if (!asn1_uint_decode (&ctx, end, &vers))
+ return 0;
+ if (debug > 1)
+ printk(KERN_DEBUG "bsalg: snmp version: %u\n", vers + 1);
+ if (vers > 1)
+ return 1;
+
+ /*
+ * Community.
+ */
+ if (!asn1_header_decode (&ctx, &end, &cls, &con, &tag))
+ return 0;
+ if (cls != ASN1_UNI || con != ASN1_PRI || tag != ASN1_OTS)
+ return 0;
+ if (!asn1_octets_decode(&ctx, end, &comm.data, &comm.len))
+ return 0;
+ if (debug > 1) {
+ unsigned int i;
+
+ printk(KERN_DEBUG "bsalg: community: ");
+ for (i = 0; i < comm.len; i++)
+ printk("%c", comm.data[i]);


+ printk("\n");
+ }

+ kfree(comm.data);
+
+ /*
+ * PDU type
+ */
+ if (!asn1_header_decode(&ctx, &eoc, &cls, &con, &pdutype))
+ return 0;
+ if (cls != ASN1_CTX || con != ASN1_CON)
+ return 0;
+ if (debug > 1) {
+ unsigned char *pdus[] = {
+ [SNMP_PDU_GET] = "get",
+ [SNMP_PDU_NEXT] = "get-next",
+ [SNMP_PDU_RESPONSE] = "response",
+ [SNMP_PDU_SET] = "set",
+ [SNMP_PDU_TRAP1] = "trapv1",
+ [SNMP_PDU_BULK] = "bulk",
+ [SNMP_PDU_INFORM] = "inform",
+ [SNMP_PDU_TRAP2] = "trapv2"
+ };
+
+ if (pdutype > SNMP_PDU_TRAP2)
+ printk(KERN_DEBUG "bsalg: bad pdu type %u\n", pdutype);
+ else
+ printk(KERN_DEBUG "bsalg: pdu: %s\n", pdus[pdutype]);
+ }
+ if (pdutype != SNMP_PDU_RESPONSE &&
+ pdutype != SNMP_PDU_TRAP1 && pdutype != SNMP_PDU_TRAP2)
+ return 1;
+
+ /*
+ * Request header or v1 trap
+ */
+ if (pdutype == SNMP_PDU_TRAP1) {
+ struct snmp_v1_trap trap;
+ unsigned char ret = snmp_trap_decode(&ctx, &trap, map, check);
+
+ /* Discard trap allocations regardless */
+ kfree(trap.id);
+ kfree((unsigned long *)trap.ip_address);
+
+ if (!ret)
+ return ret;
+
+ } else {
+ struct snmp_request req;
+
+ if (!snmp_request_decode(&ctx, &req))
+ return 0;
+
+ if (debug > 1)
+ printk(KERN_DEBUG "bsalg: request: id=0x%lx error_status=%u "
+ "error_index=%u\n", req.id, req.error_status,
+ req.error_index);
+ }
+
+ /*
+ * Loop through objects, look for IP addresses to mangle.
+ */
+ if (!asn1_header_decode(&ctx, &eoc, &cls, &con, &tag))


+ return 0;
+
+ if (cls != ASN1_UNI || con != ASN1_CON || tag != ASN1_SEQ)
+ return 0;
+

+ obj = kmalloc(sizeof(struct snmp_object), GFP_ATOMIC);
+ if (obj == NULL) {
+ if (net_ratelimit())
+ printk(KERN_WARNING "OOM in bsalg(%d)\n", __LINE__);


+ return 0;
+ }
+

+ while (!asn1_eoc_decode(&ctx, eoc)) {
+ unsigned int i;
+
+ if (!snmp_object_decode(&ctx, obj)) {
+ if (*obj) {
+ if ((*obj)->id)
+ kfree((*obj)->id);
+ kfree(*obj);
+ }
+ kfree(obj);


+ return 0;
+ }
+

+ if (debug > 1) {
+ printk(KERN_DEBUG "bsalg: object: ");
+ for (i = 0; i < (*obj)->id_len; i++) {
+ if (i > 0)
+ printk(".");
+ printk("%lu", (*obj)->id[i]);
+ }
+ printk(": type=%u\n", (*obj)->type);
+
+ }
+
+ if ((*obj)->type == SNMP_IPADDR)
+ mangle_address(ctx.begin, ctx.pointer - 4 , map, check);
+
+ kfree((*obj)->id);
+ kfree(*obj);
+ }
+ kfree(obj);
+
+ if (!asn1_eoc_decode(&ctx, eoc))


+ return 0;
+
+ return 1;
+}
+

+/*****************************************************************************
+ *
+ * NAT routines.


+ *
+ *****************************************************************************/
+
+/*

+ * SNMP translation routine.
+ */
+static int snmp_translate(struct ip_conntrack *ct,


+ struct ip_nat_info *info,
+ enum ip_conntrack_info ctinfo,
+ unsigned int hooknum,

+ struct sk_buff **pskb)


+{
+ struct iphdr *iph = (*pskb)->nh.iph;

+ struct udphdr *udph = (struct udphdr *)((u_int32_t *)iph + iph->ihl);
+ u_int16_t udplen = ntohs(udph->len);
+ u_int16_t paylen = udplen - sizeof(struct udphdr);


+ int dir = CTINFO2DIR(ctinfo);

+ struct oct1_map map;
+
+ /*
+ * Determine mappping for application layer addresses based
+ * on NAT manipulations for the packet.
+ */
+ if (dir == IP_CT_DIR_ORIGINAL) {
+ /* SNAT traps */
+ map.from = NOCT1(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip);
+ map.to = NOCT1(ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip);
+ } else {
+ /* DNAT replies */
+ map.from = NOCT1(ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.ip);
+ map.to = NOCT1(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip);
+ }
+
+ if (map.from == map.to)
+ return NF_ACCEPT;
+
+ if (!snmp_parse_mangle((unsigned char *)udph + sizeof(struct udphdr),
+ paylen, &map, &udph->check)) {
+ printk(KERN_WARNING "bsalg: parser failed\n");
+ return NF_DROP;
+ }
+ return NF_ACCEPT;
+}
+
+/*
+ * NAT helper function, packets arrive here from NAT code.
+ */
+static unsigned int nat_help(struct ip_conntrack *ct,


+ struct ip_nat_info *info,
+ enum ip_conntrack_info ctinfo,
+ unsigned int hooknum,

+ struct sk_buff **pskb)
+{


+ int dir = CTINFO2DIR(ctinfo);

+ struct iphdr *iph = (*pskb)->nh.iph;

+ struct udphdr *udph = (struct udphdr *)((u_int32_t *)iph + iph->ihl);
+
+ spin_lock_bh(&snmp_lock);
+
+ /*
+ * Translate snmp replies on pre-routing (DNAT) and snmp traps
+ * on post routing (SNAT).
+ */
+ if (!((dir == IP_CT_DIR_REPLY && hooknum == NF_IP_PRE_ROUTING &&
+ udph->source == __constant_ntohs(SNMP_PORT)) ||
+ (dir == IP_CT_DIR_ORIGINAL && hooknum == NF_IP_POST_ROUTING &&
+ udph->dest == __constant_ntohs(SNMP_TRAP_PORT)))) {
+ spin_unlock_bh(&snmp_lock);


+ return NF_ACCEPT;
+ }
+

+ if (debug > 1) {
+ printk(KERN_DEBUG "bsalg: dir=%s hook=%d manip=%s len=%d "
+ "src=%u.%u.%u.%u:%u dst=%u.%u.%u.%u:%u "
+ "osrc=%u.%u.%u.%u odst=%u.%u.%u.%u "
+ "rsrc=%u.%u.%u.%u rdst=%u.%u.%u.%u "
+ "\n",
+ dir == IP_CT_DIR_REPLY ? "reply" : "orig", hooknum,
+ HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC ? "snat" :
+ "dnat", (*pskb)->len,
+ NIPQUAD(iph->saddr), ntohs(udph->source),
+ NIPQUAD(iph->daddr), ntohs(udph->dest),
+ NIPQUAD(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip),
+ NIPQUAD(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip),
+ NIPQUAD(ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.ip),
+ NIPQUAD(ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip));
+ }
+
+ /*
+ * Make sure the packet length is ok. So far, we were only guaranteed
+ * to have a valid length IP header plus 8 bytes, which means we have
+ * enough room for a UDP header. Just verify the UDP length field so we
+ * can mess around with the payload.
+ */
+ if (ntohs(udph->len) == (*pskb)->len - (iph->ihl << 2)) {
+ int ret = snmp_translate(ct, info, ctinfo, hooknum, pskb);
+ spin_unlock_bh(&snmp_lock);


+ return ret;
+ }
+

+ if (net_ratelimit())
+ printk(KERN_WARNING "bsalg: dropping malformed packet "
+ "src=%u.%u.%u.%u dst=%u.%u.%u.%u\n",
+ NIPQUAD(iph->saddr), NIPQUAD(iph->daddr));
+ spin_unlock_bh(&snmp_lock);


+ return NF_DROP;
+}
+

+static struct ip_nat_helper snmp = { { NULL, NULL },
+ { { 0, { __constant_htons(SNMP_PORT) } },
+ { 0, { 0 }, IPPROTO_UDP } },
+ { { 0, { 0xFFFF } },
+ { 0, { 0 }, 0xFFFF } },
+ nat_help, "snmp" };
+
+static struct ip_nat_helper snmp_trap = { { NULL, NULL },
+ { { 0, { __constant_htons(SNMP_TRAP_PORT) } },
+ { 0, { 0 }, IPPROTO_UDP } },
+ { { 0, { 0xFFFF } },
+ { 0, { 0 }, 0xFFFF } },
+ nat_help, "snmp_trap" };
+
+/*****************************************************************************
+ *
+ * Module stuff.


+ *
+ *****************************************************************************/
+

+static int __init init(void)
+{

+ int ret = 0;
+
+ ret = ip_nat_helper_register(&snmp);
+ if (ret < 0)
+ return ret;
+ ret = ip_nat_helper_register(&snmp_trap);
+ if (ret < 0) {
+ ip_nat_helper_unregister(&snmp);
+ return ret;
+ }


+ return ret;
+}
+

+static void __exit fini(void)
+{
+ ip_nat_helper_unregister(&snmp);
+ ip_nat_helper_unregister(&snmp_trap);
+ br_write_lock_bh(BR_NETPROTO_LOCK);
+ br_write_unlock_bh(BR_NETPROTO_LOCK);
+}
+
+module_init(init);
+module_exit(fini);
+
+MODULE_PARM(debug, "i");
+MODULE_DESCRIPTION("Basic SNMP Application Layer Gateway");
+MODULE_LICENSE("GPL");
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/netfilter/ip_tables.c linux/net/ipv4/netfilter/ip_tables.c
--- v2.4.13/linux/net/ipv4/netfilter/ip_tables.c Tue Oct 9 17:06:53 2001
+++ linux/net/ipv4/netfilter/ip_tables.c Tue Oct 30 15:08:12 2001
@@ -1059,6 +1059,10 @@
X if (len != sizeof(tmp) + tmp.size)
X return -ENOPROTOOPT;
X
+ /* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */
+ if ((SMP_ALIGN(tmp.size) >> PAGE_SHIFT) + 2 > num_physpages)
+ return -ENOMEM;
+
X newinfo = vmalloc(sizeof(struct ipt_table_info)
X + SMP_ALIGN(tmp.size) * smp_num_cpus);
X if (!newinfo)
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/netfilter/ipt_LOG.c linux/net/ipv4/netfilter/ipt_LOG.c
--- v2.4.13/linux/net/ipv4/netfilter/ipt_LOG.c Tue Oct 9 17:06:53 2001
+++ linux/net/ipv4/netfilter/ipt_LOG.c Mon Nov 5 09:53:07 2001
@@ -95,7 +95,11 @@
X printk("WINDOW=%u ", ntohs(tcph->window));
X /* Max length: 9 "RES=0x3F " */
X printk("RES=0x%02x ", (u_int8_t)(ntohl(tcp_flag_word(tcph) & TCP_RESERVED_BITS) >> 22));
- /* Max length: 36 "URG ACK PSH RST SYN FIN " */
+ /* Max length: 32 "CWR ECE URG ACK PSH RST SYN FIN " */
+ if (tcph->cwr)
+ printk("CWR ");
+ if (tcph->ece)
+ printk("ECE ");
X if (tcph->urg)
X printk("URG ");
X if (tcph->ack)


@@ -254,7 +258,7 @@
X

X /* Proto Max log string length */
X /* IP: 40+46+6+11+127 = 230 */
- /* TCP: 10+max(25,20+30+13+9+36+11+127) = 256 */
+ /* TCP: 10+max(25,20+30+13+9+32+11+127) = 252 */
X /* UDP: 10+max(25,20) = 35 */
X /* ICMP: 11+max(25, 18+25+max(19,14,24+3+n+10,3+n+10)) = 91+n */
X /* ESP: 10+max(25)+15 = 50 */
@@ -263,7 +267,7 @@
X
X /* (ICMP allows recursion one level deep) */
X /* maxlen = IP + ICMP + IP + max(TCP,UDP,ICMP,unknown) */
- /* maxlen = 230+ 91 + 230 + 256 = 807 */
+ /* maxlen = 230+ 91 + 230 + 252 = 803 */
X }
X
X static unsigned int
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/netfilter/ipt_length.c linux/net/ipv4/netfilter/ipt_length.c
--- v2.4.13/linux/net/ipv4/netfilter/ipt_length.c Wed Dec 31 16:00:00 1969
+++ linux/net/ipv4/netfilter/ipt_length.c Tue Oct 30 15:08:12 2001
@@ -0,0 +1,55 @@
+/* Kernel module to match packet length. */
+#include <linux/module.h>
+#include <linux/skbuff.h>
+
+#include <linux/netfilter_ipv4/ipt_length.h>
+#include <linux/netfilter_ipv4/ip_tables.h>
+
+MODULE_AUTHOR("James Morris <jmo...@intercode.com.au>");
+MODULE_DESCRIPTION("IP tables packet length matching module");
+MODULE_LICENSE("GPL");
+
+static int
+match(const struct sk_buff *skb,
+ const struct net_device *in,
+ const struct net_device *out,
+ const void *matchinfo,
+ int offset,
+ const void *hdr,
+ u_int16_t datalen,
+ int *hotdrop)
+{
+ const struct ipt_length_info *info = matchinfo;
+ u_int16_t pktlen = ntohs(skb->nh.iph->tot_len);
+
+ return (pktlen >= info->min && pktlen <= info->max) ^ info->invert;
+}
+
+static int
+checkentry(const char *tablename,
+ const struct ipt_ip *ip,
+ void *matchinfo,
+ unsigned int matchsize,
+ unsigned int hook_mask)
+{
+ if (matchsize != IPT_ALIGN(sizeof(struct ipt_length_info)))


+ return 0;
+
+ return 1;
+}
+

+static struct ipt_match length_match
+= { { NULL, NULL }, "length", &match, &checkentry, NULL, THIS_MODULE };


+
+static int __init init(void)
+{

+ return ipt_register_match(&length_match);
+}
+
+static void __exit fini(void)
+{
+ ipt_unregister_match(&length_match);
+}
+
+module_init(init);
+module_exit(fini);
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/netfilter/ipt_ttl.c linux/net/ipv4/netfilter/ipt_ttl.c
--- v2.4.13/linux/net/ipv4/netfilter/ipt_ttl.c Wed Dec 31 16:00:00 1969
+++ linux/net/ipv4/netfilter/ipt_ttl.c Tue Oct 30 15:08:12 2001
@@ -0,0 +1,75 @@


+/* IP tables module for matching the value of the TTL
+ *

+ * ipt_ttl.c,v 1.5 2000/11/13 11:16:08 laforge Exp
+ *
+ * (C) 2000,2001 by Harald Welte <laf...@gnumonks.org>
+ *
+ * This software is distributed under the terms GNU GPL


+ */
+
+#include <linux/module.h>

+#include <linux/skbuff.h>
+
+#include <linux/netfilter_ipv4/ipt_ttl.h>
+#include <linux/netfilter_ipv4/ip_tables.h>


+
+MODULE_AUTHOR("Harald Welte <laf...@gnumonks.org>");

+MODULE_DESCRIPTION("IP tables TTL matching module");
+MODULE_LICENSE("GPL");
+
+static int match(const struct sk_buff *skb, const struct net_device *in,
+ const struct net_device *out, const void *matchinfo,
+ int offset, const void *hdr, u_int16_t datalen,
+ int *hotdrop)
+{
+ const struct ipt_ttl_info *info = matchinfo;
+ const struct iphdr *iph = skb->nh.iph;
+
+ switch (info->mode) {
+ case IPT_TTL_EQ:
+ return (iph->ttl == info->ttl);
+ break;
+ case IPT_TTL_NE:
+ return (!(iph->ttl == info->ttl));
+ break;
+ case IPT_TTL_LT:
+ return (iph->ttl < info->ttl);
+ break;
+ case IPT_TTL_GT:
+ return (iph->ttl > info->ttl);
+ break;
+ default:
+ printk(KERN_WARNING "ipt_ttl: unknown mode %d\n",
+ info->mode);


+ return 0;
+ }
+

+ return 0;
+}
+

+static int checkentry(const char *tablename, const struct ipt_ip *ip,
+ void *matchinfo, unsigned int matchsize,
+ unsigned int hook_mask)
+{
+ if (matchsize != IPT_ALIGN(sizeof(struct ipt_ttl_info)))


+ return 0;
+
+ return 1;
+}
+

+static struct ipt_match ttl_match = { { NULL, NULL }, "ttl", &match,
+ &checkentry, NULL, THIS_MODULE };


+
+static int __init init(void)
+{

+ return ipt_register_match(&ttl_match);
+}
+
+static void __exit fini(void)
+{
+ ipt_unregister_match(&ttl_match);


+
+}
+
+module_init(init);
+module_exit(fini);

diff -u --recursive --new-file v2.4.13/linux/net/ipv4/route.c linux/net/ipv4/route.c
--- v2.4.13/linux/net/ipv4/route.c Tue Oct 23 22:48:54 2001
+++ linux/net/ipv4/route.c Tue Oct 30 15:08:12 2001


@@ -5,7 +5,7 @@
X *

X * ROUTE - implementation of the IP router.
X *
- * Version: $Id: route.c,v 1.100 2001/10/15 12:34:50 davem Exp $
+ * Version: $Id: route.c,v 1.101 2001/10/20 00:00:11 davem Exp $
X *


X * Authors: Ross Biro, <bi...@leland.Stanford.Edu>
X * Fred N. van Kempen, <wal...@uWalt.NL.Mugnet.ORG>

@@ -150,11 +150,7 @@
X entry_size: sizeof(struct rtable),
X };
X
-#ifdef CONFIG_INET_ECN
X #define ECN_OR_COST(class) TC_PRIO_##class
-#else
-#define ECN_OR_COST(class) TC_PRIO_FILLER
-#endif
X
X __u8 ip_tos2prio[16] = {
X TC_PRIO_BESTEFFORT,
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/syncookies.c linux/net/ipv4/syncookies.c
--- v2.4.13/linux/net/ipv4/syncookies.c Tue Oct 23 22:48:54 2001
+++ linux/net/ipv4/syncookies.c Tue Oct 30 15:08:12 2001
@@ -9,7 +9,7 @@
X * as published by the Free Software Foundation; either version
X * 2 of the License, or (at your option) any later version.
X *
- * $Id: syncookies.c,v 1.15 2001/10/15 12:34:50 davem Exp $
+ * $Id: syncookies.c,v 1.17 2001/10/26 14:55:41 davem Exp $
X *
X * Missing: IPv6 support.
X */
@@ -23,8 +23,6 @@
X
X extern int sysctl_tcp_syncookies;
X
-static unsigned long tcp_lastsynq_overflow;
-
X /*
X * This table has to be sorted and terminated with (__u16)-1.
X * XXX generate a better table.
@@ -53,7 +51,9 @@
X int mssind;
X const __u16 mss = *mssp;
X
- tcp_lastsynq_overflow = jiffies;
+
+ sk->tp_pinfo.af_tcp.last_synq_overflow = jiffies;
+
X /* XXX sort msstab[] by probability? Binary search? */
X for (mssind = 0; mss > msstab[mssind + 1]; mssind++)
X ;
@@ -78,14 +78,11 @@
X * Check if a ack sequence number is a valid syncookie.
X * Return the decoded mss if it is, or 0 if not.
X */
-static inline int cookie_check(struct sk_buff *skb, __u32 cookie)
+static inline int cookie_check(struct sk_buff *skb, __u32 cookie)
X {
X __u32 seq;
X __u32 mssind;
X
- if ((jiffies - tcp_lastsynq_overflow) > TCP_TIMEOUT_INIT)
- return 0;
-
X seq = ntohl(skb->h.th->seq)-1;
X mssind = check_tcp_syn_cookie(cookie,
X skb->nh.iph->saddr, skb->nh.iph->daddr,
@@ -126,8 +123,8 @@
X if (!sysctl_tcp_syncookies || !skb->h.th->ack)
X goto out;
X
- mss = cookie_check(skb, cookie);
- if (!mss) {
+ if (time_after(jiffies, sk->tp_pinfo.af_tcp.last_synq_overflow + TCP_TIMEOUT_INIT) ||
+ (mss = cookie_check(skb, cookie)) == 0) {
X NET_INC_STATS_BH(SyncookiesFailed);
X goto out;
X }
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/sysctl_net_ipv4.c linux/net/ipv4/sysctl_net_ipv4.c
--- v2.4.13/linux/net/ipv4/sysctl_net_ipv4.c Sun Sep 23 11:41:01 2001
+++ linux/net/ipv4/sysctl_net_ipv4.c Tue Oct 30 15:08:12 2001
@@ -1,7 +1,7 @@
X /*
X * sysctl_net_ipv4.c: sysctl interface to net IPV4 subsystem.
X *
- * $Id: sysctl_net_ipv4.c,v 1.49 2001/08/22 20:38:41 davem Exp $
+ * $Id: sysctl_net_ipv4.c,v 1.50 2001/10/20 00:00:11 davem Exp $
X *
X * Begun April 1, 1996, Mike Shaver.
X * Added /proc/sys/net/ipv4 directory entry (empty =) ). [MS]
@@ -201,10 +201,8 @@
X &sysctl_tcp_fack, sizeof(int), 0644, NULL, &proc_dointvec},
X {NET_TCP_REORDERING, "tcp_reordering",
X &sysctl_tcp_reordering, sizeof(int), 0644, NULL, &proc_dointvec},
-#ifdef CONFIG_INET_ECN
X {NET_TCP_ECN, "tcp_ecn",
X &sysctl_tcp_ecn, sizeof(int), 0644, NULL, &proc_dointvec},
-#endif
X {NET_TCP_DSACK, "tcp_dsack",
X &sysctl_tcp_dsack, sizeof(int), 0644, NULL, &proc_dointvec},
X {NET_TCP_MEM, "tcp_mem",
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
--- v2.4.13/linux/net/ipv4/tcp.c Thu Oct 11 08:02:26 2001
+++ linux/net/ipv4/tcp.c Tue Oct 30 15:08:12 2001


@@ -5,7 +5,7 @@
X *

X * Implementation of the Transmission Control Protocol(TCP).
X *
- * Version: $Id: tcp.c,v 1.213 2001/10/10 23:54:50 davem Exp $
+ * Version: $Id: tcp.c,v 1.214 2001/10/20 00:00:11 davem Exp $
X *


X * Authors: Ross Biro, <bi...@leland.Stanford.Edu>
X * Fred N. van Kempen, <wal...@uWalt.NL.Mugnet.ORG>

@@ -2391,10 +2391,8 @@
X info.tcpi_snd_wscale = 0;
X info.tcpi_rcv_wscale = 0;
X }
-#ifdef CONFIG_INET_ECN
X if (tp->ecn_flags&TCP_ECN_OK)
X info.tcpi_options |= TCPI_OPT_ECN;
-#endif
X
X info.tcpi_rto = (1000000*tp->rto)/HZ;
X info.tcpi_ato = (1000000*tp->ack.ato)/HZ;
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/tcp_input.c linux/net/ipv4/tcp_input.c
--- v2.4.13/linux/net/ipv4/tcp_input.c Tue Oct 9 17:06:53 2001
+++ linux/net/ipv4/tcp_input.c Tue Oct 30 15:08:12 2001


@@ -5,7 +5,7 @@
X *

X * Implementation of the Transmission Control Protocol(TCP).
X *
- * Version: $Id: tcp_input.c,v 1.237 2001/09/21 21:27:34 davem Exp $
+ * Version: $Id: tcp_input.c,v 1.238 2001/10/20 00:00:11 davem Exp $
X *


X * Authors: Ross Biro, <bi...@leland.Stanford.Edu>
X * Fred N. van Kempen, <wal...@uWalt.NL.Mugnet.ORG>

@@ -69,10 +69,6 @@
X #include <net/inet_common.h>
X #include <linux/ipsec.h>
X
-
-/* These are on by default so the code paths get tested.
- * For the final 2.2 this may be undone at our discretion. -DaveM
- */
X int sysctl_tcp_timestamps = 1;
X int sysctl_tcp_window_scaling = 1;
X int sysctl_tcp_sack = 1;
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/tcp_ipv4.c linux/net/ipv4/tcp_ipv4.c
--- v2.4.13/linux/net/ipv4/tcp_ipv4.c Tue Oct 23 22:48:54 2001
+++ linux/net/ipv4/tcp_ipv4.c Mon Nov 5 09:46:12 2001


@@ -5,7 +5,7 @@
X *

X * Implementation of the Transmission Control Protocol(TCP).
X *
- * Version: $Id: tcp_ipv4.c,v 1.234 2001/10/18 09:49:08 davem Exp $
+ * Version: $Id: tcp_ipv4.c,v 1.235 2001/10/26 14:51:13 davem Exp $
X *
X * IPv4 specific functions
X *
diff -u --recursive --new-file v2.4.13/linux/net/ipv4/tcp_output.c linux/net/ipv4/tcp_output.c
--- v2.4.13/linux/net/ipv4/tcp_output.c Tue Oct 9 17:06:53 2001
+++ linux/net/ipv4/tcp_output.c Mon Nov 5 09:46:12 2001


@@ -5,7 +5,7 @@
X *

X * Implementation of the Transmission Control Protocol(TCP).
X *
- * Version: $Id: tcp_output.c,v 1.142 2001/09/21 21:27:34 davem Exp $
+ * Version: $Id: tcp_output.c,v 1.143 2001/10/26 14:51:13 davem Exp $


X *
X * Authors: Ross Biro, <bi...@leland.Stanford.Edu>
X * Fred N. van Kempen, <wal...@uWalt.NL.Mugnet.ORG>

diff -u --recursive --new-file v2.4.13/linux/net/ipv6/netfilter/Config.in linux/net/ipv6/netfilter/Config.in
--- v2.4.13/linux/net/ipv6/netfilter/Config.in Wed May 24 08:36:34 2000
+++ linux/net/ipv6/netfilter/Config.in Tue Oct 30 15:08:12 2001
@@ -16,6 +16,11 @@
X if [ "$CONFIG_IP6_NF_IPTABLES" != "n" ]; then
X # The simple matches.
X dep_tristate ' limit match support' CONFIG_IP6_NF_MATCH_LIMIT $CONFIG_IP6_NF_IPTABLES
+ dep_tristate ' MAC address match support' CONFIG_IP6_NF_MATCH_MAC $CONFIG_IP6_NF_IPTABLES
+ dep_tristate ' Multiple port match support' CONFIG_IP6_NF_MATCH_MULTIPORT $CONFIG_IP6_NF_IPTABLES


+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then

+ dep_tristate ' Owner match support (EXPERIMENTAL)' CONFIG_IP6_NF_MATCH_OWNER $CONFIG_IP6_NF_IPTABLES
+ fi
X # dep_tristate ' MAC address match support' CONFIG_IP6_NF_MATCH_MAC $CONFIG_IP6_NF_IPTABLES
X dep_tristate ' netfilter MARK match support' CONFIG_IP6_NF_MATCH_MARK $CONFIG_IP6_NF_IPTABLES
X # dep_tristate ' Multiple port match support' CONFIG_IP6_NF_MATCH_MULTIPORT $CONFIG_IP6_NF_IPTABLES
@@ -30,6 +35,9 @@
X
X # The targets
X dep_tristate ' Packet filtering' CONFIG_IP6_NF_FILTER $CONFIG_IP6_NF_IPTABLES
+ if [ "$CONFIG_IP6_NF_FILTER" != "n" ]; then
+ dep_tristate ' LOG target support' CONFIG_IP6_NF_TARGET_LOG $CONFIG_IP6_NF_FILTER
+ fi
X
X # if [ "$CONFIG_IP6_NF_FILTER" != "n" ]; then
X # dep_tristate ' REJECT target support' CONFIG_IP6_NF_TARGET_REJECT $CONFIG_IP6_NF_FILTER
diff -u --recursive --new-file v2.4.13/linux/net/ipv6/netfilter/Makefile linux/net/ipv6/netfilter/Makefile
--- v2.4.13/linux/net/ipv6/netfilter/Makefile Sun Aug 12 13:28:01 2001
+++ linux/net/ipv6/netfilter/Makefile Tue Oct 30 15:08:12 2001
@@ -17,8 +17,10 @@
X obj-$(CONFIG_IP6_NF_MATCH_MARK) += ip6t_mark.o
X obj-$(CONFIG_IP6_NF_MATCH_MAC) += ip6t_mac.o
X obj-$(CONFIG_IP6_NF_MATCH_MULTIPORT) += ip6t_multiport.o
+obj-$(CONFIG_IP6_NF_MATCH_OWNER) += ip6t_owner.o
X obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o
X obj-$(CONFIG_IP6_NF_MANGLE) += ip6table_mangle.o
X obj-$(CONFIG_IP6_NF_TARGET_MARK) += ip6t_MARK.o
+obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o
X
X include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.13/linux/net/ipv6/netfilter/ip6_tables.c linux/net/ipv6/netfilter/ip6_tables.c
--- v2.4.13/linux/net/ipv6/netfilter/ip6_tables.c Tue Oct 9 17:06:53 2001
+++ linux/net/ipv6/netfilter/ip6_tables.c Tue Oct 30 15:08:12 2001
@@ -1102,6 +1102,10 @@
X if (copy_from_user(&tmp, user, sizeof(tmp)) != 0)
X return -EFAULT;
X
+ /* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */
+ if ((SMP_ALIGN(tmp.size) >> PAGE_SHIFT) + 2 > num_physpages)
+ return -ENOMEM;
+
X newinfo = vmalloc(sizeof(struct ip6t_table_info)
X + SMP_ALIGN(tmp.size) * smp_num_cpus);
X if (!newinfo)
diff -u --recursive --new-file v2.4.13/linux/net/ipv6/netfilter/ip6t_LOG.c linux/net/ipv6/netfilter/ip6t_LOG.c
--- v2.4.13/linux/net/ipv6/netfilter/ip6t_LOG.c Wed Dec 31 16:00:00 1969
+++ linux/net/ipv6/netfilter/ip6t_LOG.c Mon Nov 5 09:53:07 2001


@@ -0,0 +1,355 @@
+/*

+ * This is a module which is used for logging packets.
+ */
+#include <linux/module.h>
+#include <linux/skbuff.h>
+#include <linux/ip.h>
+#include <linux/spinlock.h>
+#include <linux/icmpv6.h>
+#include <net/udp.h>
+#include <net/tcp.h>
+#include <net/ipv6.h>
+#include <linux/netfilter_ipv6/ip6_tables.h>
+
+MODULE_AUTHOR("Jan Rekorajski <bag...@pld.org.pl>");
+MODULE_DESCRIPTION("IP6 tables LOG target module");
+MODULE_LICENSE("GPL");
+
+struct in_device;
+#include <net/route.h>
+#include <linux/netfilter_ipv6/ip6t_LOG.h>


+
+#if 0
+#define DEBUGP printk
+#else
+#define DEBUGP(format, args...)
+#endif
+

+#define NIP6(addr) \
+ ntohs((addr).s6_addr16[0]), \
+ ntohs((addr).s6_addr16[1]), \
+ ntohs((addr).s6_addr16[2]), \
+ ntohs((addr).s6_addr16[3]), \
+ ntohs((addr).s6_addr16[4]), \
+ ntohs((addr).s6_addr16[5]), \
+ ntohs((addr).s6_addr16[6]), \
+ ntohs((addr).s6_addr16[7])
+
+struct esphdr {
+ __u32 spi;
+}; /* FIXME evil kludge */
+
+/* Use lock to serialize, so printks don't overlap */
+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 */
+static u_int8_t ip6_nexthdr(u_int8_t currenthdr, u_int8_t **hdrptr)
+{
+ u_int8_t hdrlen, nexthdr = 0;
+
+ switch(currenthdr){
+ case IPPROTO_AH:
+ /* whoever decided to do the length of AUTH for ipv6
+ in 32bit units unlike other headers should be beaten...
+ repeatedly...with a large stick...no, an even LARGER
+ stick...no, you're still not thinking big enough */
+ nexthdr = **hdrptr;
+ hdrlen = *hdrptr[1] * 4 + 8;
+ *hdrptr = *hdrptr + hdrlen;
+ break;
+ /*stupid rfc2402 */
+ case IPPROTO_DSTOPTS:
+ case IPPROTO_ROUTING:
+ case IPPROTO_HOPOPTS:
+ nexthdr = **hdrptr;
+ hdrlen = *hdrptr[1] * 8 + 8;
+ *hdrptr = *hdrptr + hdrlen;
+ break;
+ case IPPROTO_FRAGMENT:
+ nexthdr = **hdrptr;
+ *hdrptr = *hdrptr + 8;
+ break;
+ }
+ return nexthdr;
+
+}
+
+/* One level of recursion won't kill us */
+static void dump_packet(const struct ip6t_log_info *info,
+ struct ipv6hdr *ipv6h, int recurse)
+{
+ u_int8_t currenthdr = ipv6h->nexthdr;
+ u_int8_t *hdrptr;
+ int fragment;
+
+ /* Max length: 88 "SRC=0000.0000.0000.0000.0000.0000.0000.0000 DST=0000.0000.0000.0000.0000.0000.0000.0000" */
+ printk("SRC=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(ipv6h->saddr));
+ printk("DST=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", NIP6(ipv6h->daddr));
+
+ /* Max length: 44 "LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=FFFFF " */
+ printk("LEN=%u TC=%u HOPLIMIT=%u FLOWLBL=%u ",
+ ntohs(ipv6h->payload_len) + sizeof(struct ipv6hdr),
+ (ntohl(*(u_int32_t *)ipv6h) & 0x0ff00000) >> 20,
+ ipv6h->hop_limit,
+ (ntohl(*(u_int32_t *)ipv6h) & 0x000fffff));
+
+ fragment = 0;
+ hdrptr = (u_int8_t *)(ipv6h + 1);
+ while (currenthdr) {
+ if ((currenthdr == IPPROTO_TCP) ||
+ (currenthdr == IPPROTO_UDP) ||
+ (currenthdr == IPPROTO_ICMPV6))
+ break;
+ /* Max length: 48 "OPT (...) " */
+ printk("OPT ( ");
+ switch (currenthdr) {
+ case IPPROTO_FRAGMENT: {
+ struct frag_hdr *fhdr = (struct frag_hdr *)hdrptr;
+
+ /* Max length: 11 "FRAG:65535 " */
+ printk("FRAG:%u ", ntohs(fhdr->frag_off) & 0xFFF8);
+
+ /* Max length: 11 "INCOMPLETE " */
+ if (fhdr->frag_off & __constant_htons(0x0001))
+ printk("INCOMPLETE ");
+
+ printk("ID:%08x ", fhdr->identification);
+
+ if (ntohs(fhdr->frag_off) & 0xFFF8)
+ fragment = 1;
+
+ break;
+ }
+ case IPPROTO_DSTOPTS:
+ case IPPROTO_ROUTING:
+ case IPPROTO_HOPOPTS:
+ break;
+ /* Max Length */
+ case IPPROTO_AH:
+ case IPPROTO_ESP:
+ if (info->logflags & IP6T_LOG_IPOPT) {
+ struct esphdr *esph = (struct esphdr *)hdrptr;
+ int esp = (currenthdr == IPPROTO_ESP);
+
+ /* Max length: 4 "ESP " */
+ printk("%s ",esp ? "ESP" : "AH");
+
+ /* Length: 15 "SPI=0xF1234567 " */
+ printk("SPI=0x%x ", ntohl(esph->spi) );
+ break;
+ }
+ default:
+ break;
+ }
+ printk(") ");
+ currenthdr = ip6_nexthdr(currenthdr, &hdrptr);
+ }
+
+ switch (currenthdr) {
+ case IPPROTO_TCP: {
+ struct tcphdr *tcph = (struct tcphdr *)hdrptr;
+
+ /* Max length: 10 "PROTO=TCP " */
+ printk("PROTO=TCP ");
+
+ if (fragment)
+ break;
+
+ /* Max length: 20 "SPT=65535 DPT=65535 " */
+ printk("SPT=%u DPT=%u ",
+ ntohs(tcph->source), ntohs(tcph->dest));
+ /* Max length: 30 "SEQ=4294967295 ACK=4294967295 " */
+ if (info->logflags & IP6T_LOG_TCPSEQ)
+ printk("SEQ=%u ACK=%u ",
+ ntohl(tcph->seq), ntohl(tcph->ack_seq));
+ /* Max length: 13 "WINDOW=65535 " */
+ printk("WINDOW=%u ", ntohs(tcph->window));
+ /* Max length: 9 "RES=0x3F " */
+ printk("RES=0x%02x ", (u_int8_t)(ntohl(tcp_flag_word(tcph) & TCP_RESERVED_BITS) >> 22));
+ /* Max length: 32 "CWR ECE URG ACK PSH RST SYN FIN " */
+ if (tcph->cwr)
+ printk("CWR ");
+ if (tcph->ece)
+ printk("ECE ");
+ if (tcph->urg)
+ printk("URG ");
+ if (tcph->ack)
+ printk("ACK ");
+ if (tcph->psh)
+ printk("PSH ");
+ if (tcph->rst)
+ printk("RST ");
+ if (tcph->syn)
+ printk("SYN ");
+ if (tcph->fin)
+ printk("FIN ");
+ /* Max length: 11 "URGP=65535 " */
+ printk("URGP=%u ", ntohs(tcph->urg_ptr));
+
+ if ((info->logflags & IP6T_LOG_TCPOPT)
+ && tcph->doff * 4 != sizeof(struct tcphdr)) {
+ unsigned int i;
+
+ /* Max length: 127 "OPT (" 15*4*2chars ") " */
+ printk("OPT (");
+ for (i =sizeof(struct tcphdr); i < tcph->doff * 4; i++)
+ printk("%02X", ((u_int8_t *)tcph)[i]);
+ printk(") ");
+ }
+ break;
+ }
+ case IPPROTO_UDP: {
+ struct udphdr *udph = (struct udphdr *)hdrptr;
+
+ /* Max length: 10 "PROTO=UDP " */
+ printk("PROTO=UDP ");
+
+ if (fragment)
+ break;
+
+ /* Max length: 20 "SPT=65535 DPT=65535 " */
+ printk("SPT=%u DPT=%u LEN=%u ",
+ ntohs(udph->source), ntohs(udph->dest),
+ ntohs(udph->len));
+ break;
+ }
+ case IPPROTO_ICMPV6: {
+ struct icmp6hdr *icmp6h = (struct icmp6hdr *)hdrptr;
+
+ /* Max length: 13 "PROTO=ICMPv6 " */
+ printk("PROTO=ICMPv6 ");
+
+ if (fragment)
+ break;
+
+ /* Max length: 18 "TYPE=255 CODE=255 " */
+ printk("TYPE=%u CODE=%u ", icmp6h->icmp6_type, icmp6h->icmp6_code);
+
+ switch (icmp6h->icmp6_type) {
+ case ICMPV6_ECHO_REQUEST:
+ case ICMPV6_ECHO_REPLY:
+ /* Max length: 19 "ID=65535 SEQ=65535 " */
+ printk("ID=%u SEQ=%u ",
+ ntohs(icmp6h->icmp6_identifier),
+ ntohs(icmp6h->icmp6_sequence));
+ break;
+ case ICMPV6_MGM_QUERY:
+ case ICMPV6_MGM_REPORT:
+ case ICMPV6_MGM_REDUCTION:
+ break;
+
+ case ICMPV6_PARAMPROB:
+ /* Max length: 17 "POINTER=ffffffff " */
+ printk("POINTER=%08x ", ntohl(icmp6h->icmp6_pointer));
+ /* Fall through */
+ case ICMPV6_DEST_UNREACH:
+ case ICMPV6_PKT_TOOBIG:
+ case ICMPV6_TIME_EXCEED:
+ /* Max length: 3+maxlen */
+ if (recurse) {
+ printk("[");
+ dump_packet(info, (struct ipv6hdr *)(icmp6h + 1), 0);
+ printk("] ");
+ }
+
+ /* Max length: 10 "MTU=65535 " */
+ if (icmp6h->icmp6_type == ICMPV6_PKT_TOOBIG)
+ printk("MTU=%u ", ntohl(icmp6h->icmp6_mtu));
+ }
+ break;
+ }
+ /* Max length: 10 "PROTO 255 " */
+ default:
+ printk("PROTO=%u ", currenthdr);
+ }
+}
+
+static unsigned int
+ip6t_log_target(struct sk_buff **pskb,
+ unsigned int hooknum,
+ const struct net_device *in,
+ const struct net_device *out,
+ const void *targinfo,
+ void *userinfo)
+{
+ struct ipv6hdr *ipv6h = (*pskb)->nh.ipv6h;
+ const struct ip6t_log_info *loginfo = targinfo;
+ char level_string[4] = "< >";
+
+ level_string[1] = '0' + (loginfo->level % 8);
+ spin_lock_bh(&log_lock);
+ printk(level_string);
+ printk("%sIN=%s OUT=%s ",
+ loginfo->prefix,
+ in ? in->name : "",
+ out ? out->name : "");
+ if (in && !out) {
+ /* MAC logging for input chain only. */
+ printk("MAC=");
+ if ((*pskb)->dev && (*pskb)->dev->hard_header_len && (*pskb)->mac.raw != (void*)ipv6h) {
+ int i;
+ unsigned char *p = (*pskb)->mac.raw;
+ for (i = 0; i < (*pskb)->dev->hard_header_len; i++,p++)
+ printk("%02x%c", *p,
+ i==(*pskb)->dev->hard_header_len - 1
+ ? ' ':':');
+ } else
+ printk(" ");
+ }
+
+ dump_packet(loginfo, ipv6h, 1);
+ printk("\n");
+ spin_unlock_bh(&log_lock);
+
+ return IP6T_CONTINUE;
+}
+
+static int ip6t_log_checkentry(const char *tablename,
+ const struct ip6t_entry *e,
+ void *targinfo,
+ unsigned int targinfosize,
+ unsigned int hook_mask)
+{
+ const struct ip6t_log_info *loginfo = targinfo;
+
+ if (targinfosize != IP6T_ALIGN(sizeof(struct ip6t_log_info))) {
+ DEBUGP("LOG: targinfosize %u != %u\n",
+ targinfosize, IP6T_ALIGN(sizeof(struct ip6t_log_info)));


+ return 0;
+ }
+

+ if (loginfo->level >= 8) {
+ DEBUGP("LOG: level %u >= 8\n", loginfo->level);


+ return 0;
+ }
+

+ if (loginfo->prefix[sizeof(loginfo->prefix)-1] != '\0') {
+ DEBUGP("LOG: prefix term %i\n",
+ loginfo->prefix[sizeof(loginfo->prefix)-1]);


+ return 0;
+ }
+

+ return 1;
+}
+

+static struct ip6t_target ip6t_log_reg
+= { { NULL, NULL }, "LOG", ip6t_log_target, ip6t_log_checkentry, NULL,
+ THIS_MODULE };


+
+static int __init init(void)
+{

+ if (ip6t_register_target(&ip6t_log_reg))
+ return -EINVAL;
+


+ return 0;
+}
+

+static void __exit fini(void)
+{
+ ip6t_unregister_target(&ip6t_log_reg);
+}
+
+module_init(init);
+module_exit(fini);
diff -u --recursive --new-file v2.4.13/linux/net/ipv6/netfilter/ip6t_limit.c linux/net/ipv6/netfilter/ip6t_limit.c
--- v2.4.13/linux/net/ipv6/netfilter/ip6t_limit.c Tue Oct 9 17:06:53 2001
+++ linux/net/ipv6/netfilter/ip6t_limit.c Tue Oct 30 15:08:12 2001
@@ -13,7 +13,7 @@
X #include <linux/interrupt.h>
X
X #include <linux/netfilter_ipv6/ip6_tables.h>
-#include <linux/netfilter_ipv4/ipt_limit.h>
+#include <linux/netfilter_ipv6/ip6t_limit.h>
X
X /* The algorithm used is the Simple Token Bucket Filter (TBF)
X * see net/sched/sch_tbf.c in the linux source tree
@@ -42,7 +42,7 @@
X #define CREDITS_PER_JIFFY 128
X
X static int
-ipt_limit_match(const struct sk_buff *skb,
+ip6t_limit_match(const struct sk_buff *skb,
X const struct net_device *in,
X const struct net_device *out,
X const void *matchinfo,
@@ -51,7 +51,7 @@
X u_int16_t datalen,
X int *hotdrop)
X {
- struct ipt_rateinfo *r = ((struct ipt_rateinfo *)matchinfo)->master;
+ struct ip6t_rateinfo *r = ((struct ip6t_rateinfo *)matchinfo)->master;
X unsigned long now = jiffies;
X
X spin_lock_bh(&limit_lock);
@@ -77,32 +77,32 @@
X /* If multiplying would overflow... */
X if (user > 0xFFFFFFFF / (HZ*CREDITS_PER_JIFFY))
X /* Divide first. */
- return (user / IPT_LIMIT_SCALE) * HZ * CREDITS_PER_JIFFY;
+ return (user / IP6T_LIMIT_SCALE) * HZ * CREDITS_PER_JIFFY;
X
- return (user * HZ * CREDITS_PER_JIFFY) / IPT_LIMIT_SCALE;
+ return (user * HZ * CREDITS_PER_JIFFY) / IP6T_LIMIT_SCALE;


X }
X
X static int

-ipt_limit_checkentry(const char *tablename,
+ip6t_limit_checkentry(const char *tablename,
X const struct ip6t_ip6 *ip,
X void *matchinfo,
X unsigned int matchsize,
X unsigned int hook_mask)
X {
- struct ipt_rateinfo *r = matchinfo;
+ struct ip6t_rateinfo *r = matchinfo;
X
- if (matchsize != IP6T_ALIGN(sizeof(struct ipt_rateinfo)))
+ if (matchsize != IP6T_ALIGN(sizeof(struct ip6t_rateinfo)))
X return 0;
X
X /* Check for overflow. */
X if (r->burst == 0
X || user2credits(r->avg * r->burst) < user2credits(r->avg)) {
- printk("Call rusty: overflow in ipt_limit: %u/%u\n",
+ printk("Call rusty: overflow in ip6t_limit: %u/%u\n",
X r->avg, r->burst);


X return 0;
X }
X

- /* User avg in seconds * IPT_LIMIT_SCALE: convert to jiffies *
+ /* User avg in seconds * IP6T_LIMIT_SCALE: convert to jiffies *
X 128. */
X r->prev = jiffies;
X r->credit = user2credits(r->avg * r->burst); /* Credits full. */
@@ -115,20 +115,20 @@


X return 1;
X }
X

-static struct ip6t_match ipt_limit_reg
-= { { NULL, NULL }, "limit", ipt_limit_match, ipt_limit_checkentry, NULL,
+static struct ip6t_match ip6t_limit_reg
+= { { NULL, NULL }, "limit", ip6t_limit_match, ip6t_limit_checkentry, NULL,
X THIS_MODULE };
X
X static int __init init(void)
X {
- if (ip6t_register_match(&ipt_limit_reg))
+ if (ip6t_register_match(&ip6t_limit_reg))
X return -EINVAL;


X return 0;
X }
X

X static void __exit fini(void)
X {
- ip6t_unregister_match(&ipt_limit_reg);
+ ip6t_unregister_match(&ip6t_limit_reg);
X }
X
X module_init(init);
diff -u --recursive --new-file v2.4.13/linux/net/ipv6/netfilter/ip6t_mac.c linux/net/ipv6/netfilter/ip6t_mac.c
--- v2.4.13/linux/net/ipv6/netfilter/ip6t_mac.c Tue Oct 23 22:48:54 2001
+++ linux/net/ipv6/netfilter/ip6t_mac.c Tue Oct 30 15:08:12 2001
@@ -27,7 +27,7 @@


X }
X
X static int

-ipt_mac_checkentry(const char *tablename,
+ip6t_mac_checkentry(const char *tablename,
X const struct ip6t_ip6 *ip,
X void *matchinfo,
X unsigned int matchsize,
@@ -35,7 +35,7 @@
X {
X if (hook_mask
X & ~((1 << NF_IP6_PRE_ROUTING) | (1 << NF_IP6_LOCAL_IN))) {
- printk("ipt_mac: only valid for PRE_ROUTING or LOCAL_IN.\n");
+ printk("ip6t_mac: only valid for PRE_ROUTING or LOCAL_IN.\n");
X return 0;
X }
X
@@ -46,7 +46,7 @@
X }
X
X static struct ip6t_match mac_match
-= { { NULL, NULL }, "mac", &match, &ipt_mac_checkentry, NULL, THIS_MODULE };
+= { { NULL, NULL }, "mac", &match, &ip6t_mac_checkentry, NULL, THIS_MODULE };
X
X static int __init init(void)
X {
diff -u --recursive --new-file v2.4.13/linux/net/ipv6/netfilter/ip6t_multiport.c linux/net/ipv6/netfilter/ip6t_multiport.c
--- v2.4.13/linux/net/ipv6/netfilter/ip6t_multiport.c Tue Jun 20 14:32:27 2000
+++ linux/net/ipv6/netfilter/ip6t_multiport.c Tue Oct 30 15:08:12 2001
@@ -51,7 +51,7 @@
X if (offset == 0 && datalen < sizeof(struct udphdr)) {
X /* We've been asked to examine this packet, and we
X can't. Hence, no choice but to drop. */
- duprintf("ipt_multiport:"
+ duprintf("ip6t_multiport:"
X " Dropping evil offset=0 tinygram.\n");
X *hotdrop = 1;
X return 0;
diff -u --recursive --new-file v2.4.13/linux/net/ipv6/netfilter/ip6t_owner.c linux/net/ipv6/netfilter/ip6t_owner.c
--- v2.4.13/linux/net/ipv6/netfilter/ip6t_owner.c Wed Dec 31 16:00:00 1969
+++ linux/net/ipv6/netfilter/ip6t_owner.c Tue Oct 30 15:08:12 2001
@@ -0,0 +1,158 @@
+/* Kernel module to match various things tied to sockets associated with
+ locally generated outgoing packets.
+
+ Copyright (C) 2000,2001 Marc Boucher
+ */
+#include <linux/module.h>
+#include <linux/skbuff.h>
+#include <linux/file.h>
+#include <net/sock.h>
+
+#include <linux/netfilter_ipv6/ip6t_owner.h>
+#include <linux/netfilter_ipv6/ip6_tables.h>
+
+MODULE_AUTHOR("Marc Boucher <ma...@mbsi.ca>");
+MODULE_DESCRIPTION("IP6 tables owner matching module");
+MODULE_LICENSE("GPL");
+
+static int
+match_pid(const struct sk_buff *skb, pid_t pid)
+{
+ struct task_struct *p;
+ struct files_struct *files;
+ int i;
+
+ read_lock(&tasklist_lock);
+ p = find_task_by_pid(pid);
+ if (!p)
+ goto out;
+ task_lock(p);
+ files = p->files;
+ if(files) {
+ read_lock(&files->file_lock);
+ for (i=0; i < files->max_fds; i++) {
+ if (fcheck_files(files, i) == skb->sk->socket->file) {
+ read_unlock(&files->file_lock);
+ task_unlock(p);
+ read_unlock(&tasklist_lock);


+ return 1;
+ }
+ }

+ read_unlock(&files->file_lock);
+ }
+ task_unlock(p);
+out:
+ read_unlock(&tasklist_lock);


+ return 0;
+}
+

+static int
+match_sid(const struct sk_buff *skb, pid_t sid)
+{
+ struct task_struct *p;
+ struct file *file = skb->sk->socket->file;
+ int i, found=0;
+
+ read_lock(&tasklist_lock);
+ for_each_task(p) {
+ struct files_struct *files;
+ if (p->session != sid)
+ continue;
+
+ task_lock(p);
+ files = p->files;
+ if (files) {
+ read_lock(&files->file_lock);
+ for (i=0; i < files->max_fds; i++) {
+ if (fcheck_files(files, i) == file) {
+ found = 1;
+ break;
+ }
+ }
+ read_unlock(&files->file_lock);
+ }
+ task_unlock(p);
+ if(found)
+ break;
+ }
+ read_unlock(&tasklist_lock);
+
+ return found;
+}
+
+static int
+match(const struct sk_buff *skb,
+ const struct net_device *in,
+ const struct net_device *out,
+ const void *matchinfo,
+ int offset,
+ const void *hdr,
+ u_int16_t datalen,
+ int *hotdrop)
+{
+ const struct ip6t_owner_info *info = matchinfo;
+
+ if (!skb->sk || !skb->sk->socket || !skb->sk->socket->file)
+ return 0;
+
+ if(info->match & IP6T_OWNER_UID) {
+ if((skb->sk->socket->file->f_uid != info->uid) ^
+ !!(info->invert & IP6T_OWNER_UID))


+ return 0;
+ }
+

+ if(info->match & IP6T_OWNER_GID) {
+ if((skb->sk->socket->file->f_gid != info->gid) ^
+ !!(info->invert & IP6T_OWNER_GID))


+ return 0;
+ }
+

+ if(info->match & IP6T_OWNER_PID) {
+ if (!match_pid(skb, info->pid) ^
+ !!(info->invert & IP6T_OWNER_PID))


+ return 0;
+ }
+

+ if(info->match & IP6T_OWNER_SID) {
+ if (!match_sid(skb, info->sid) ^
+ !!(info->invert & IP6T_OWNER_SID))


+ return 0;
+ }
+
+ return 1;
+}
+

+static int
+checkentry(const char *tablename,
+ const struct ip6t_ip6 *ip,
+ void *matchinfo,
+ unsigned int matchsize,
+ unsigned int hook_mask)
+{
+ if (hook_mask
+ & ~((1 << NF_IP6_LOCAL_OUT) | (1 << NF_IP6_POST_ROUTING))) {
+ printk("ip6t_owner: only valid for LOCAL_OUT or POST_ROUTING.\n");


+ return 0;
+ }
+

+ if (matchsize != IP6T_ALIGN(sizeof(struct ip6t_owner_info)))


+ return 0;
+
+ return 1;
+}
+

+static struct ip6t_match owner_match
+= { { NULL, NULL }, "owner", &match, &checkentry, NULL, THIS_MODULE };


+
+static int __init init(void)
+{

+ return ip6t_register_match(&owner_match);
+}
+
+static void __exit fini(void)
+{
+ ip6t_unregister_match(&owner_match);
+}
+
+module_init(init);
+module_exit(fini);
diff -u --recursive --new-file v2.4.13/linux/net/ipx/Makefile linux/net/ipx/Makefile
--- v2.4.13/linux/net/ipx/Makefile Fri Dec 29 14:07:24 2000
+++ linux/net/ipx/Makefile Tue Oct 30 15:08:12 2001
@@ -23,6 +23,3 @@
X obj-$(CONFIG_SPX) += af_spx.o


X
X include $(TOPDIR)/Rules.make
-
-tar:
- tar -cvf /dev/f1 .

diff -u --recursive --new-file v2.4.13/linux/net/irda/Makefile linux/net/irda/Makefile
--- v2.4.13/linux/net/irda/Makefile Wed Jul 25 17:10:27 2001
+++ linux/net/irda/Makefile Tue Oct 30 15:08:12 2001
@@ -41,10 +41,3 @@
X endif


X
X include $(TOPDIR)/Rules.make
-
-tar:
- tar -cvf /dev/f1 .

-
-
-
-
diff -u --recursive --new-file v2.4.13/linux/net/netsyms.c linux/net/netsyms.c
--- v2.4.13/linux/net/netsyms.c Sun Sep 23 11:41:02 2001
+++ linux/net/netsyms.c Mon Nov 5 09:46:12 2001
@@ -30,6 +30,7 @@
X #include <net/pkt_sched.h>
X #include <net/scm.h>
X #include <linux/if_bridge.h>
+#include <linux/if_vlan.h>
X #include <linux/random.h>
X #ifdef CONFIG_NET_DIVERT
X #include <linux/divert.h>
@@ -213,6 +214,12 @@
X EXPORT_SYMBOL(destroy_EII_client);
X #endif
X
+/* for 801q VLAN support */
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+EXPORT_SYMBOL(dev_change_flags);
+EXPORT_SYMBOL(vlan_ioctl_hook);
+#endif
+
X EXPORT_SYMBOL(sklist_destroy_socket);
X EXPORT_SYMBOL(sklist_insert_socket);
X
@@ -432,6 +439,9 @@
X EXPORT_SYMBOL(rtnl_lock);
X EXPORT_SYMBOL(rtnl_unlock);
X
+/* ABI emulation layers need this */
+EXPORT_SYMBOL(move_addr_to_kernel);
+EXPORT_SYMBOL(move_addr_to_user);
X
X /* Used by at least ipip.c. */
X EXPORT_SYMBOL(ipv4_config);
diff -u --recursive --new-file v2.4.13/linux/net/packet/af_packet.c linux/net/packet/af_packet.c
--- v2.4.13/linux/net/packet/af_packet.c Sun Aug 12 13:28:01 2001
+++ linux/net/packet/af_packet.c Tue Oct 30 15:08:12 2001


@@ -5,7 +5,7 @@
X *

X * PACKET - implements raw packet sockets.
X *
- * Version: $Id: af_packet.c,v 1.56 2001/08/06 13:21:16 davem Exp $
+ * Version: $Id: af_packet.c,v 1.57 2001/10/30 03:38:37 davem Exp $


X *
X * Authors: Ross Biro, <bi...@leland.Stanford.Edu>
X * Fred N. van Kempen, <wal...@uWalt.NL.Mugnet.ORG>

@@ -623,6 +623,18 @@
X
X h->tp_status = status;
X mb();
+
+ {
+ struct page *p_start, *p_end;
+ u8 *h_end = (u8 *)h + macoff + snaplen - 1;
+
+ p_start = virt_to_page(h);
+ p_end = virt_to_page(h_end);
+ while (p_start <= p_end) {
+ flush_dcache_page(p_start);
+ p_start++;
+ }
+ }
X
X sk->data_ready(sk, 0);
X
diff -u --recursive --new-file v2.4.13/linux/net/unix/af_unix.c linux/net/unix/af_unix.c
--- v2.4.13/linux/net/unix/af_unix.c Sun Sep 23 11:41:02 2001
+++ linux/net/unix/af_unix.c Mon Nov 5 08:32:32 2001
@@ -1317,8 +1317,8 @@
X if (size > sk->sndbuf/2 - 64)
X size = sk->sndbuf/2 - 64;
X
- if (size > (128 * 1024) / 2)
- size = (128 * 1024) / 2;
+ if (size > SKB_MAX_ALLOC)
+ size = SKB_MAX_ALLOC;
X
X /*
X * Grab a buffer


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'

echo 'File patch-2.4.14 is complete' &&
chmod 644 patch-2.4.14 ||


echo 'restore of patch-2.4.14 failed'

Cksum="`cksum < 'patch-2.4.14'`"
if ! test "2802419045 3212485" = "$Cksum" ; then
echo 'patch-2.4.14: original Checksum 2802419045 3212485, current one' "$Cksum"
rm -f _shar_wnt_.tmp
rm -f _shar_seq_.tmp
exit 1
fi
rm -f _shar_wnt_.tmp
fi
rm -f _shar_seq_.tmp
echo 'You have unpacked the last part.'
exit 0

Thomas Kobienia

unread,
Nov 6, 2001, 4:00:12 AM11/6/01
to
Archive-name: v2.4/patch-2.4.14/part49

#!/bin/sh -x
# this is part 49 of a 56 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.4.14 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck

if test "$Scheck" != 49; then


echo "Please unpack part $Scheck next!"
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping patch-2.4.14'
else
echo 'x - continuing with patch-2.4.14'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.4.14' &&

+ DDAR_Ser2ICPTr + DDAR_DevAdd (__PREG(Ser2HSDR)))
X #define DDAR_Ser2HSSPRd /* Ser. port 2 HSSP Read */ \


X (DDAR_DevRd + DDAR_Brst8 + DDAR_8BitDev + \

- DDAR_Ser2ICPRc + DDAR_DevAdd (_Ser2HSDR))
+ DDAR_Ser2ICPRc + DDAR_DevAdd (__PREG(Ser2HSDR)))
X #define DDAR_Ser3UARTWr /* Ser. port 3 UART Write */ \


X (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \

- DDAR_Ser3UARTTr + DDAR_DevAdd (_Ser3UTDR))
+ DDAR_Ser3UARTTr + DDAR_DevAdd (__PREG(Ser3UTDR)))
X #define DDAR_Ser3UARTRd /* Ser. port 3 UART Read */ \


X (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \

- DDAR_Ser3UARTRc + DDAR_DevAdd (_Ser3UTDR))
+ DDAR_Ser3UARTRc + DDAR_DevAdd (__PREG(Ser3UTDR)))
X #define DDAR_Ser4MCP0Wr /* Ser. port 4 MCP 0 Write (audio) */ \
X (DDAR_DevWr + DDAR_Brst4 + DDAR_16BitDev + \
- DDAR_Ser4MCP0Tr + DDAR_DevAdd (_Ser4MCDR0))
+ DDAR_Ser4MCP0Tr + DDAR_DevAdd (__PREG(Ser4MCDR0)))
X #define DDAR_Ser4MCP0Rd /* Ser. port 4 MCP 0 Read (audio) */ \
X (DDAR_DevRd + DDAR_Brst4 + DDAR_16BitDev + \
- DDAR_Ser4MCP0Rc + DDAR_DevAdd (_Ser4MCDR0))
+ DDAR_Ser4MCP0Rc + DDAR_DevAdd (__PREG(Ser4MCDR0)))
X #define DDAR_Ser4MCP1Wr /* Ser. port 4 MCP 1 Write */ \
X /* (telecom) */ \
X (DDAR_DevWr + DDAR_Brst4 + DDAR_16BitDev + \
- DDAR_Ser4MCP1Tr + DDAR_DevAdd (_Ser4MCDR1))
+ DDAR_Ser4MCP1Tr + DDAR_DevAdd (__PREG(Ser4MCDR1)))
X #define DDAR_Ser4MCP1Rd /* Ser. port 4 MCP 1 Read */ \
X /* (telecom) */ \
X (DDAR_DevRd + DDAR_Brst4 + DDAR_16BitDev + \
- DDAR_Ser4MCP1Rc + DDAR_DevAdd (_Ser4MCDR1))
+ DDAR_Ser4MCP1Rc + DDAR_DevAdd (__PREG(Ser4MCDR1)))
X #define DDAR_Ser4SSPWr /* Ser. port 4 SSP Write (16 bits) */ \
X (DDAR_DevWr + DDAR_Brst4 + DDAR_16BitDev + \
- DDAR_Ser4SSPTr + DDAR_DevAdd (_Ser4SSDR))
+ DDAR_Ser4SSPTr + DDAR_DevAdd (__PREG(Ser4SSDR)))
X #define DDAR_Ser4SSPRd /* Ser. port 4 SSP Read (16 bits) */ \
X (DDAR_DevRd + DDAR_Brst4 + DDAR_16BitDev + \
- DDAR_Ser4SSPRc + DDAR_DevAdd (_Ser4SSDR))
+ DDAR_Ser4SSPRc + DDAR_DevAdd (__PREG(Ser4SSDR)))
X
X #define DCSR_RUN 0x00000001 /* DMA RUNing */
X #define DCSR_IE 0x00000002 /* DMA Interrupt Enable */
@@ -2664,44 +1893,15 @@
X #define LCD_Int100_0A 0xF /* LCD Intensity = 100.0% = 1 */
X /* (Alternative) */
X
-#define _LCCR0 0xB0100000 /* LCD Control Reg. 0 */
-#define _LCSR 0xB0100004 /* LCD Status Reg. */
-#define _DBAR1 0xB0100010 /* LCD DMA Base Address Reg. */


- /* channel 1 */

-#define _DCAR1 0xB0100014 /* LCD DMA Current Address Reg. */


- /* channel 1 */

-#define _DBAR2 0xB0100018 /* LCD DMA Base Address Reg. */


- /* channel 2 */

-#define _DCAR2 0xB010001C /* LCD DMA Current Address Reg. */


- /* channel 2 */

-#define _LCCR1 0xB0100020 /* LCD Control Reg. 1 */
-#define _LCCR2 0xB0100024 /* LCD Control Reg. 2 */
-#define _LCCR3 0xB0100028 /* LCD Control Reg. 3 */
-
-#if LANGUAGE == C
-#define LCCR0 /* LCD Control Reg. 0 */ \
- (*((volatile Word *) io_p2v (_LCCR0)))
-#define LCSR /* LCD Status Reg. */ \
- (*((volatile Word *) io_p2v (_LCSR)))
-#define DBAR1 /* LCD DMA Base Address Reg. */ \


- /* channel 1 */ \

- (*((volatile Address *) io_p2v (_DBAR1)))
-#define DCAR1 /* LCD DMA Current Address Reg. */ \


- /* channel 1 */ \

- (*((volatile Address *) io_p2v (_DCAR1)))
-#define DBAR2 /* LCD DMA Base Address Reg. */ \


- /* channel 2 */ \

- (*((volatile Address *) io_p2v (_DBAR2)))
-#define DCAR2 /* LCD DMA Current Address Reg. */ \


- /* channel 2 */ \

- (*((volatile Address *) io_p2v (_DCAR2)))
-#define LCCR1 /* LCD Control Reg. 1 */ \
- (*((volatile Word *) io_p2v (_LCCR1)))
-#define LCCR2 /* LCD Control Reg. 2 */ \
- (*((volatile Word *) io_p2v (_LCCR2)))
-#define LCCR3 /* LCD Control Reg. 3 */ \
- (*((volatile Word *) io_p2v (_LCCR3)))


-#endif /* LANGUAGE == C */

+#define LCCR0 __REG(0xB0100000) /* LCD Control Reg. 0 */
+#define LCSR __REG(0xB0100004) /* LCD Status Reg. */
+#define DBAR1 __REG(0xB0100010) /* LCD DMA Base Address Reg. channel 1 */
+#define DCAR1 __REG(0xB0100014) /* LCD DMA Current Address Reg. channel 1 */
+#define DBAR2 __REG(0xB0100018) /* LCD DMA Base Address Reg. channel 2 */
+#define DCAR2 __REG(0xB010001C) /* LCD DMA Current Address Reg. channel 2 */
+#define LCCR1 __REG(0xB0100020) /* LCD Control Reg. 1 */
+#define LCCR2 __REG(0xB0100024) /* LCD Control Reg. 2 */
+#define LCCR3 __REG(0xB0100028) /* LCD Control Reg. 3 */
X
X #define LCCR0_LEN 0x00000001 /* LCD ENable */
X #define LCCR0_CMS 0x00000002 /* Color/Monochrome display Select */
@@ -2845,7 +2045,18 @@
X #define LCCR3_OutEnH (LCCR3_OEP*0) /* Output Enable active High */
X #define LCCR3_OutEnL (LCCR3_OEP*1) /* Output Enable active Low */
X
+#ifndef __ASSEMBLY__
+extern unsigned int processor_id;
+#endif
X
-#undef C
-#undef Assembly
-
+#define CPU_REVISION (processor_id & 15)
+#define CPU_SA1110_A0 (0)
+#define CPU_SA1110_B0 (4)
+#define CPU_SA1110_B1 (5)
+#define CPU_SA1110_B2 (6)
+#define CPU_SA1110_B4 (8)
+
+#define CPU_SA1100_ID (0x4401a110)
+#define CPU_SA1100_MASK (0xfffffff0)
+#define CPU_SA1110_ID (0x6901b110)
+#define CPU_SA1110_MASK (0xfffffff0)
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-sa1100/SA-1111.h linux/include/asm-arm/arch-sa1100/SA-1111.h
--- v2.4.13/linux/include/asm-arm/arch-sa1100/SA-1111.h Tue Oct 23 22:48:53 2001
+++ linux/include/asm-arm/arch-sa1100/SA-1111.h Thu Oct 25 13:53:54 2001
@@ -34,6 +34,11 @@
X
X #define SA1111_SAC_DMA_MIN_XFER (0x800)
X
+/*
+ * SA1111 register definitions.
+ */
+#define __CCREG(x) __REGP(SA1111_VBASE + (x))
+
X /* System Bus Interface (SBI)
X *
X * Registers
@@ -42,15 +47,15 @@
X * SKID ID Register
X */
X
-#define _SBI_SKCR _SA1111( 0x0000 )
-#define _SBI_SMCR _SA1111( 0x0004 )
-#define _SBI_SKID _SA1111( 0x0008 )
+#define _SBI_SKCR _SA1111(0x0000)
+#define _SBI_SMCR _SA1111(0x0004)
+#define _SBI_SKID _SA1111(0x0008)
X
X #if LANGUAGE == C
X
-#define SBI_SKCR (*((volatile Word *) SA1111_p2v (_SBI_SKCR)))
-#define SBI_SMCR (*((volatile Word *) SA1111_p2v (_SBI_SMCR)))
-#define SBI_SKID (*((volatile Word *) SA1111_p2v (_SBI_SKID)))
+#define SBI_SKCR __CCREG(0x0000)
+#define SBI_SMCR __CCREG(0x0004)
+#define SBI_SKID __CCREG(0x0008)
X
X #endif /* LANGUAGE == C */
X
@@ -120,15 +125,15 @@
X
X #if LANGUAGE == C
X
-#define SKPCR (*((volatile Word *) SA1111_p2v (_SKPCR)))
-#define SKCDR (*((volatile Word *) SA1111_p2v (_SKCDR)))
-#define SKAUD (*((volatile Word *) SA1111_p2v (_SKAUD)))
-#define SKPMC (*((volatile Word *) SA1111_p2v (_SKPMC)))
-#define SKPTC (*((volatile Word *) SA1111_p2v (_SKPTC)))
-#define SKPEN0 (*((volatile Word *) SA1111_p2v (_SKPEN0)))
-#define SKPWM0 (*((volatile Word *) SA1111_p2v (_SKPWM0)))
-#define SKPEN1 (*((volatile Word *) SA1111_p2v (_SKPEN1)))
-#define SKPWM1 (*((volatile Word *) SA1111_p2v (_SKPWM1)))
+#define SKPCR __CCREG(0x0200)
+#define SKCDR __CCREG(0x0204)
+#define SKAUD __CCREG(0x0208)
+#define SKPMC __CCREG(0x020c)
+#define SKPTC __CCREG(0x0210)
+#define SKPEN0 __CCREG(0x0214)
+#define SKPWM0 __CCREG(0x0218)
+#define SKPEN1 __CCREG(0x021c)
+#define SKPWM1 __CCREG(0x0220)
X
X #endif /* LANGUAGE == C */
X
@@ -154,10 +159,10 @@
X
X #if LANGUAGE == C
X
-#define USB_OHCI_OP_BASE (*((volatile Word *) SA1111_p2v (_USB_OHCI_OP_BASE)))
-#define USB_STATUS (*((volatile Word *) SA1111_p2v (_USB_STATUS)))
-#define USB_RESET (*((volatile Word *) SA1111_p2v (_USB_RESET)))
-#define USB_INTERRUPTEST (*((volatile Word *) SA1111_p2v (_USB_INTERRUPTEST)))
+#define USB_OHCI_OP_BASE __CCREG(0x0400)
+#define USB_STATUS __CCREG(0x0518)
+#define USB_RESET __CCREG(0x051c)
+#define USB_INTERRUPTEST __CCReG(0x0520)
X
X #endif /* LANGUAGE == C */
X
@@ -227,30 +232,30 @@
X
X #if LANGUAGE == C
X
-#define SACR0 (*((volatile Word *) SA1111_p2v (_SACR0)))
-#define SACR1 (*((volatile Word *) SA1111_p2v (_SACR1)))
-#define SACR2 (*((volatile Word *) SA1111_p2v (_SACR2)))
-#define SASR0 (*((volatile Word *) SA1111_p2v (_SASR0)))
-#define SASR1 (*((volatile Word *) SA1111_p2v (_SASR1)))
-#define SASCR (*((volatile Word *) SA1111_p2v (_SASCR)))
-#define L3_CAR (*((volatile Word *) SA1111_p2v (_L3_CAR)))
-#define L3_CDR (*((volatile Word *) SA1111_p2v (_L3_CDR)))
-#define ACCAR (*((volatile Word *) SA1111_p2v (_ACCAR)))
-#define ACCDR (*((volatile Word *) SA1111_p2v (_ACCDR)))
-#define ACSAR (*((volatile Word *) SA1111_p2v (_ACSAR)))
-#define ACSDR (*((volatile Word *) SA1111_p2v (_ACSDR)))
-#define SADTCS (*((volatile Word *) SA1111_p2v (_SADTCS)))
-#define SADTSA (*((volatile Word *) SA1111_p2v (_SADTSA)))
-#define SADTCA (*((volatile Word *) SA1111_p2v (_SADTCA)))
-#define SADTSB (*((volatile Word *) SA1111_p2v (_SADTSB)))
-#define SADTCB (*((volatile Word *) SA1111_p2v (_SADTCB)))
-#define SADRCS (*((volatile Word *) SA1111_p2v (_SADRCS)))
-#define SADRSA (*((volatile Word *) SA1111_p2v (_SADRSA)))
-#define SADRCA (*((volatile Word *) SA1111_p2v (_SADRCA)))
-#define SADRSB (*((volatile Word *) SA1111_p2v (_SADRSB)))
-#define SADRCB (*((volatile Word *) SA1111_p2v (_SADRCB)))
-#define SAITR (*((volatile Word *) SA1111_p2v (_SAITR)))
-#define SADR (*((volatile Word *) SA1111_p2v (_SADR)))
+#define SACR0 __CCREG(0x0600)
+#define SACR1 __CCREG(0x0604)
+#define SACR2 __CCREG(0x0608)
+#define SASR0 __CCREG(0x060c)
+#define SASR1 __CCREG(0x0610)
+#define SASCR __CCREG(0x0618)
+#define L3_CAR __CCREG(0x061c)
+#define L3_CDR __CCREG(0x0620)
+#define ACCAR __CCREG(0x0624)
+#define ACCDR __CCREG(0x0628)
+#define ACSAR __CCREG(0x062c)
+#define ACSDR __CCREG(0x0630)
+#define SADTCS __CCREG(0x0634)
+#define SADTSA __CCREG(0x0638)
+#define SADTCA __CCREG(0x063c)
+#define SADTSB __CCREG(0x0640)
+#define SADTCB __CCREG(0x0644)
+#define SADRCS __CCREG(0x0648)
+#define SADRSA __CCREG(0x064c)
+#define SADRCA __CCREG(0x0650)
+#define SADRSB __CCREG(0x0654)
+#define SADRCB __CCREG(0x0658)
+#define SAITR __CCREG(0x065c)
+#define SADR __CCREG(0x0680)
X
X #endif /* LANGUAGE == C */
X
@@ -376,21 +381,21 @@
X
X #if LANGUAGE == C
X
-#define PA_DDR (*((volatile Word *) SA1111_p2v (_PA_DDR)))
-#define PA_DRR (*((volatile Word *) SA1111_p2v (_PA_DRR)))
-#define PA_DWR (*((volatile Word *) SA1111_p2v (_PA_DWR)))
-#define PA_SDR (*((volatile Word *) SA1111_p2v (_PA_SDR)))
-#define PA_SSR (*((volatile Word *) SA1111_p2v (_PA_SSR)))
-#define PB_DDR (*((volatile Word *) SA1111_p2v (_PB_DDR)))
-#define PB_DRR (*((volatile Word *) SA1111_p2v (_PB_DRR)))
-#define PB_DWR (*((volatile Word *) SA1111_p2v (_PB_DWR)))
-#define PB_SDR (*((volatile Word *) SA1111_p2v (_PB_SDR)))
-#define PB_SSR (*((volatile Word *) SA1111_p2v (_PB_SSR)))
-#define PC_DDR (*((volatile Word *) SA1111_p2v (_PC_DDR)))
-#define PC_DRR (*((volatile Word *) SA1111_p2v (_PC_DRR)))
-#define PC_DWR (*((volatile Word *) SA1111_p2v (_PC_DWR)))
-#define PC_SDR (*((volatile Word *) SA1111_p2v (_PC_SDR)))
-#define PC_SSR (*((volatile Word *) SA1111_p2v (_PC_SSR)))
+#define PA_DDR __CCREG(0x1000)
+#define PA_DRR __CCREG(0x1004)
+#define PA_DWR __CCREG(0x1004)
+#define PA_SDR __CCREG(0x1008)
+#define PA_SSR __CCREG(0x100c)
+#define PB_DDR __CCREG(0x1010)
+#define PB_DRR __CCREG(0x1014)
+#define PB_DWR __CCREG(0x1014)
+#define PB_SDR __CCREG(0x1018)
+#define PB_SSR __CCREG(0x101c)
+#define PC_DDR __CCREG(0x1020)
+#define PC_DRR __CCREG(0x1024)
+#define PC_DWR __CCREG(0x1024)
+#define PC_SDR __CCREG(0x1028)
+#define PC_SSR __CCREG(0x102c)
X
X #endif /* LANGUAGE == C */
X

@@ -433,21 +438,21 @@
X

X #if LANGUAGE == C
X
-#define INTTEST0 (*((volatile Word *) SA1111_p2v (_INTTEST0)))
-#define INTTEST1 (*((volatile Word *) SA1111_p2v (_INTTEST1)))
-#define INTEN0 (*((volatile Word *) SA1111_p2v (_INTEN0)))
-#define INTEN1 (*((volatile Word *) SA1111_p2v (_INTEN1)))
-#define INTPOL0 (*((volatile Word *) SA1111_p2v (_INTPOL0)))
-#define INTPOL1 (*((volatile Word *) SA1111_p2v (_INTPOL1)))
-#define INTTSTSEL (*((volatile Word *) SA1111_p2v (_INTTSTSEL)))
-#define INTSTATCLR0 (*((volatile Word *) SA1111_p2v (_INTSTATCLR0)))
-#define INTSTATCLR1 (*((volatile Word *) SA1111_p2v (_INTSTATCLR1)))
-#define INTSET0 (*((volatile Word *) SA1111_p2v (_INTSET0)))
-#define INTSET1 (*((volatile Word *) SA1111_p2v (_INTSET1)))
-#define WAKE_EN0 (*((volatile Word *) SA1111_p2v (_WAKE_EN0)))
-#define WAKE_EN1 (*((volatile Word *) SA1111_p2v (_WAKE_EN1)))
-#define WAKE_POL0 (*((volatile Word *) SA1111_p2v (_WAKE_POL0)))
-#define WAKE_POL1 (*((volatile Word *) SA1111_p2v (_WAKE_POL1)))
+#define INTTEST0 __CCREG(0x1600)
+#define INTTEST1 __CCREG(0x1604)
+#define INTEN0 __CCREG(0x1608)
+#define INTEN1 __CCREG(0x160c)
+#define INTPOL0 __CCREG(0x1610)
+#define INTPOL1 __CCREG(0x1614)
+#define INTTSTSEL __CCREG(0x1618)
+#define INTSTATCLR0 __CCREG(0x161c)
+#define INTSTATCLR1 __CCREG(0x1620)
+#define INTSET0 __CCREG(0x1624)
+#define INTSET1 __CCREG(0x1628)
+#define WAKE_EN0 __CCREG(0x162c)
+#define WAKE_EN1 __CCREG(0x1630)
+#define WAKE_POL0 __CCREG(0x1634)
+#define WAKE_POL1 __CCREG(0x1638)
X
X #endif /* LANGUAGE == C */
X
@@ -479,12 +484,12 @@
X #define _KBD( x ) _SA1111( 0x0A00 )
X #define _MSE( x ) _SA1111( 0x0C00 )
X
-#define _KBDCR _SA1111( 0x0A00 )
+#define _KBDCR _SA1111( 0x0A00 )
X #define _KBDSTAT _SA1111( 0x0A04 )
X #define _KBDDATA _SA1111( 0x0A08 )
X #define _KBDCLKDIV _SA1111( 0x0A0C )
X #define _KBDPRECNT _SA1111( 0x0A10 )
-#define _MSECR _SA1111( 0x0C00 )
+#define _MSECR _SA1111( 0x0C00 )
X #define _MSESTAT _SA1111( 0x0C04 )
X #define _MSEDATA _SA1111( 0x0C08 )
X #define _MSECLKDIV _SA1111( 0x0C0C )
@@ -492,24 +497,16 @@
X
X #if ( LANGUAGE == C )
X
-#define KBDCR (*((volatile Word *) SA1111_p2v (_KBDCR)))
-#define KBDSTAT (*((volatile Word *) SA1111_p2v (_KBDSTAT)))
-#define KBDDATA (*((volatile Word *) SA1111_p2v (_KBDDATA)))
-#define KBDCLKDIV (*((volatile Word *) SA1111_p2v (_KBDCLKDIV)))
-#define KBDPRECNT (*((volatile Word *) SA1111_p2v (_KBDPRECNT)))
-#define KBDTEST1 (*((volatile Word *) SA1111_p2v (_KBDTEST1)))
-#define KBDTEST2 (*((volatile Word *) SA1111_p2v (_KBDTEST2)))
-#define KBDTEST3 (*((volatile Word *) SA1111_p2v (_KBDTEST3)))
-#define KBDTEST4 (*((volatile Word *) SA1111_p2v (_KBDTEST4)))
-#define MSECR (*((volatile Word *) SA1111_p2v (_MSECR)))
-#define MSESTAT (*((volatile Word *) SA1111_p2v (_MSESTAT)))
-#define MSEDATA (*((volatile Word *) SA1111_p2v (_MSEDATA)))
-#define MSECLKDIV (*((volatile Word *) SA1111_p2v (_MSECLKDIV)))
-#define MSEPRECNT (*((volatile Word *) SA1111_p2v (_MSEPRECNT)))
-#define MSETEST1 (*((volatile Word *) SA1111_p2v (_MSETEST1)))
-#define MSETEST2 (*((volatile Word *) SA1111_p2v (_MSETEST2)))
-#define MSETEST3 (*((volatile Word *) SA1111_p2v (_MSETEST3)))
-#define MSETEST4 (*((volatile Word *) SA1111_p2v (_MSETEST4)))
+#define KBDCR __CCREG(0x0a00)
+#define KBDSTAT __CCREG(0x0a04)
+#define KBDDATA __CCREG(0x0a08)
+#define KBDCLKDIV __CCREG(0x0a0c)
+#define KBDPRECNT __CCREG(0x0a10)
+#define MSECR __CCREG(0x0c00)
+#define MSESTAT __CCREG(0x0c04)
+#define MSEDATA __CCREG(0x0c08)
+#define MSECLKDIV __CCREG(0x0c0c)
+#define MSEPRECNT __CCREG(0x0c10)
X
X #define KBDCR_ENA 0x08
X #define KBDCR_FKD 0x02
@@ -614,9 +611,9 @@
X
X #if LANGUAGE == C
X
-#define PCCR (*((volatile Word *) SA1111_p2v (_PCCR)))
-#define PCSSR (*((volatile Word *) SA1111_p2v (_PCSSR)))
-#define PCSR (*((volatile Word *) SA1111_p2v (_PCSR)))
+#define PCCR __CCREG(0x1800)
+#define PCSSR __CCREG(0x1804)
+#define PCSR __CCREG(0x1808)
X
X #endif /* LANGUAGE == C */
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-sa1100/assabet.h linux/include/asm-arm/arch-sa1100/assabet.h
--- v2.4.13/linux/include/asm-arm/arch-sa1100/assabet.h Tue Oct 23 22:48:53 2001
+++ linux/include/asm-arm/arch-sa1100/assabet.h Thu Oct 25 13:53:54 2001
@@ -4,114 +4,111 @@
X * Created 2000/06/05 by Nicolas Pitre <ni...@cam.org>
X *
X * This file contains the hardware specific definitions for Assabet
+ * Only include this file from SA1100-specific files.
X *
X * 2000/05/23 John Dorsey <jo...@cs.cmu.edu>
X * Definitions for Neponset added.
X */
-
-#ifndef __ASM_ARCH_HARDWARE_H
-#error "include <asm/hardware.h> instead"
-#endif
-
+#ifndef __ASM_ARCH_ASSABET_H
+#define __ASM_ARCH_ASSABET_H
X
X /* System Configuration Register flags */
X
-#define SCR_SDRAM_LOW (1<<2) /* SDRAM size (low bit) */
-#define SCR_SDRAM_HIGH (1<<3) /* SDRAM size (high bit) */
-#define SCR_FLASH_LOW (1<<4) /* Flash size (low bit) */
-#define SCR_FLASH_HIGH (1<<5) /* Flash size (high bit) */
-#define SCR_GFX (1<<8) /* Graphics Accelerator (0 = present) */
-#define SCR_SA1111 (1<<9) /* Neponset (0 = present) */
+#define ASSABET_SCR_SDRAM_LOW (1<<2) /* SDRAM size (low bit) */
+#define ASSABET_SCR_SDRAM_HIGH (1<<3) /* SDRAM size (high bit) */
+#define ASSABET_SCR_FLASH_LOW (1<<4) /* Flash size (low bit) */
+#define ASSABET_SCR_FLASH_HIGH (1<<5) /* Flash size (high bit) */
+#define ASSABET_SCR_GFX (1<<8) /* Graphics Accelerator (0 = present) */
+#define ASSABET_SCR_SA1111 (1<<9) /* Neponset (0 = present) */
X
-#define SCR_INIT -1
+#define ASSABET_SCR_INIT -1
X
X
X /* Board Control Register */
X
-#define BCR_BASE 0xf1000000
-#define BCR (*(volatile unsigned int *)(BCR_BASE))
+#define ASSABET_BCR_BASE 0xf1000000
+#define ASSABET_BCR (*(volatile unsigned int *)(ASSABET_BCR_BASE))
X
-#define BCR_DB1110 \
- (BCR_SPK_OFF | BCR_QMUTE | BCR_LED_GREEN | BCR_LED_RED | \
- BCR_RS232EN | BCR_LCD_12RGB | BCR_IRDA_MD0)
-
-#define BCR_DB1111 \
- (BCR_SPK_OFF | BCR_QMUTE | BCR_LED_GREEN | BCR_LED_RED | \
- BCR_RS232EN | BCR_LCD_12RGB | BCR_CF_BUS_OFF | BCR_STEREO_LB | \
- BCR_IRDA_MD0 | BCR_CF_RST)
-
-#define BCR_CF_PWR (1<<0) /* Compact Flash Power (1 = 3.3v, 0 = off) */
-#define BCR_CF_RST (1<<1) /* Compact Flash Reset (1 = power up reset) */
-#define BCR_GFX_RST (1<<1) /* Graphics Accelerator Reset (0 = hold reset) */
-#define BCR_CODEC_RST (1<<2) /* 0 = Holds UCB1300, ADI7171, and UDA1341 in reset */
-#define BCR_IRDA_FSEL (1<<3) /* IRDA Frequency select (0 = SIR, 1 = MIR/ FIR) */
-#define BCR_IRDA_MD0 (1<<4) /* Range/Power select */
-#define BCR_IRDA_MD1 (1<<5) /* Range/Power select */
-#define BCR_STEREO_LB (1<<6) /* Stereo Loopback */
-#define BCR_CF_BUS_OFF (1<<7) /* Compact Flash bus (0 = on, 1 = off (float)) */
-#define BCR_AUDIO_ON (1<<8) /* Audio power on */
-#define BCR_LIGHT_ON (1<<9) /* Backlight */
-#define BCR_LCD_12RGB (1<<10) /* 0 = 16RGB, 1 = 12RGB */
-#define BCR_LCD_ON (1<<11) /* LCD power on */
-#define BCR_RS232EN (1<<12) /* RS232 transceiver enable */
-#define BCR_LED_RED (1<<13) /* D9 (0 = on, 1 = off) */
-#define BCR_LED_GREEN (1<<14) /* D8 (0 = on, 1 = off) */
-#define BCR_VIB_ON (1<<15) /* Vibration motor (quiet alert) */
-#define BCR_COM_DTR (1<<16) /* COMport Data Terminal Ready */
-#define BCR_COM_RTS (1<<17) /* COMport Request To Send */
-#define BCR_RAD_WU (1<<18) /* Radio wake up interrupt */
-#define BCR_SMB_EN (1<<19) /* System management bus enable */
-#define BCR_TV_IR_DEC (1<<20) /* TV IR Decode Enable */
-#define BCR_QMUTE (1<<21) /* Quick Mute */
-#define BCR_RAD_ON (1<<22) /* Radio Power On */
-#define BCR_SPK_OFF (1<<23) /* 1 = Speaker amplifier power off */
+#define ASSABET_BCR_DB1110 \
+ (ASSABET_BCR_SPK_OFF | ASSABET_BCR_QMUTE | \
+ ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
+ ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
+ ASSABET_BCR_IRDA_MD0)
+
+#define ASSABET_BCR_DB1111 \
+ (ASSABET_BCR_SPK_OFF | ASSABET_BCR_QMUTE | \
+ ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
+ ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
+ ASSABET_BCR_CF_BUS_OFF | ASSABET_BCR_STEREO_LB | \
+ ASSABET_BCR_IRDA_MD0 | ASSABET_BCR_CF_RST)
+
+#define ASSABET_BCR_CF_PWR (1<<0) /* Compact Flash Power (1 = 3.3v, 0 = off) */
+#define ASSABET_BCR_CF_RST (1<<1) /* Compact Flash Reset (1 = power up reset) */
+#define ASSABET_BCR_GFX_RST (1<<1) /* Graphics Accelerator Reset (0 = hold reset) */
+#define ASSABET_BCR_CODEC_RST (1<<2) /* 0 = Holds UCB1300, ADI7171, and UDA1341 in reset */
+#define ASSABET_BCR_IRDA_FSEL (1<<3) /* IRDA Frequency select (0 = SIR, 1 = MIR/ FIR) */
+#define ASSABET_BCR_IRDA_MD0 (1<<4) /* Range/Power select */
+#define ASSABET_BCR_IRDA_MD1 (1<<5) /* Range/Power select */
+#define ASSABET_BCR_STEREO_LB (1<<6) /* Stereo Loopback */
+#define ASSABET_BCR_CF_BUS_OFF (1<<7) /* Compact Flash bus (0 = on, 1 = off (float)) */
+#define ASSABET_BCR_AUDIO_ON (1<<8) /* Audio power on */
+#define ASSABET_BCR_LIGHT_ON (1<<9) /* Backlight */
+#define ASSABET_BCR_LCD_12RGB (1<<10) /* 0 = 16RGB, 1 = 12RGB */
+#define ASSABET_BCR_LCD_ON (1<<11) /* LCD power on */
+#define ASSABET_BCR_RS232EN (1<<12) /* RS232 transceiver enable */
+#define ASSABET_BCR_LED_RED (1<<13) /* D9 (0 = on, 1 = off) */
+#define ASSABET_BCR_LED_GREEN (1<<14) /* D8 (0 = on, 1 = off) */
+#define ASSABET_BCR_VIB_ON (1<<15) /* Vibration motor (quiet alert) */
+#define ASSABET_BCR_COM_DTR (1<<16) /* COMport Data Terminal Ready */
+#define ASSABET_BCR_COM_RTS (1<<17) /* COMport Request To Send */
+#define ASSABET_BCR_RAD_WU (1<<18) /* Radio wake up interrupt */
+#define ASSABET_BCR_SMB_EN (1<<19) /* System management bus enable */
+#define ASSABET_BCR_TV_IR_DEC (1<<20) /* TV IR Decode Enable (not implemented) */
+#define ASSABET_BCR_QMUTE (1<<21) /* Quick Mute */
+#define ASSABET_BCR_RAD_ON (1<<22) /* Radio Power On */
+#define ASSABET_BCR_SPK_OFF (1<<23) /* 1 = Speaker amplifier power off */
X
-#ifndef __ASSEMBLY__
X extern unsigned long SCR_value;
X extern unsigned long BCR_value;
-#define BCR_set( x ) BCR = (BCR_value |= (x))
-#define BCR_clear( x ) BCR = (BCR_value &= ~(x))
-#endif
+#define ASSABET_BCR_set(x) ASSABET_BCR = (BCR_value |= (x))
+#define ASSABET_BCR_clear(x) ASSABET_BCR = (BCR_value &= ~(x))
X
-#define BSR_BASE 0xf1000000
-#define BSR (*(volatile unsigned int*)(BSR_BASE))
+#define ASSABET_BSR_BASE 0xf1000000
+#define ASSABET_BSR (*(volatile unsigned int*)(ASSABET_BSR_BASE))
X
-#define BSR_RS232_VALID (1 << 24)
-#define BSR_COM_DCD (1 << 25)
-#define BSR_COM_CTS (1 << 26)
-#define BSR_COM_DSR (1 << 27)
-#define BSR_RAD_CTS (1 << 28)
-#define BSR_RAD_DSR (1 << 29)
-#define BSR_RAD_DCD (1 << 30)
-#define BSR_RAD_RI (1 << 31)
+#define ASSABET_BSR_RS232_VALID (1 << 24)
+#define ASSABET_BSR_COM_DCD (1 << 25)
+#define ASSABET_BSR_COM_CTS (1 << 26)
+#define ASSABET_BSR_COM_DSR (1 << 27)
+#define ASSABET_BSR_RAD_CTS (1 << 28)
+#define ASSABET_BSR_RAD_DSR (1 << 29)
+#define ASSABET_BSR_RAD_DCD (1 << 30)
+#define ASSABET_BSR_RAD_RI (1 << 31)
X
X
X /* GPIOs for which the generic definition doesn't say much */
-#define GPIO_RADIO_IRQ GPIO_GPIO (14) /* Radio interrupt request */
-#define GPIO_L3_I2C_SDA GPIO_GPIO (15) /* L3 and SMB control ports */
-#define GPIO_PS_MODE_SYNC GPIO_GPIO (16) /* Power supply mode/sync */
-#define GPIO_L3_MODE GPIO_GPIO (17) /* L3 mode signal with LED */
-#define GPIO_L3_I2C_SCL GPIO_GPIO (18) /* L3 and I2C control ports */
-#define GPIO_STEREO_64FS_CLK GPIO_GPIO (19) /* SSP UDA1341 clock input */
-#define GPIO_CF_IRQ GPIO_GPIO (21) /* CF IRQ */
-#define GPIO_MBGNT GPIO_GPIO (21) /* 1111 MBGNT */
-#define GPIO_CF_CD GPIO_GPIO (22) /* CF CD */
-#define GPIO_MBREQ GPIO_GPIO (22) /* 1111 MBREQ */
-#define GPIO_UCB1300_IRQ GPIO_GPIO (23) /* UCB GPIO and touchscreen */
-#define GPIO_CF_BVD2 GPIO_GPIO (24) /* CF BVD */
-#define GPIO_GFX_IRQ GPIO_GPIO (24) /* Graphics IRQ */
-#define GPIO_CF_BVD1 GPIO_GPIO (25) /* CF BVD */
-#define GPIO_NEP_IRQ GPIO_GPIO (25) /* Neponset IRQ */
-#define GPIO_BATT_LOW GPIO_GPIO (26) /* Low battery */
-#define GPIO_RCLK GPIO_GPIO (26) /* CCLK/2 */
-
-#define IRQ_GPIO_CF_IRQ IRQ_GPIO21
-#define IRQ_GPIO_CF_CD IRQ_GPIO22
-#define IRQ_GPIO_MBREQ IRQ_GPIO22
-#define IRQ_GPIO_UCB1300_IRQ IRQ_GPIO23
-#define IRQ_GPIO_CF_BVD2 IRQ_GPIO24
-#define IRQ_GPIO_CF_BVD1 IRQ_GPIO25
-#define IRQ_GPIO_NEP_IRQ IRQ_GPIO25
+#define ASSABET_GPIO_RADIO_IRQ GPIO_GPIO (14) /* Radio interrupt request */
+#define ASSABET_GPIO_L3_I2C_SDA GPIO_GPIO (15) /* L3 and SMB control ports */
+#define ASSABET_GPIO_PS_MODE_SYNC GPIO_GPIO (16) /* Power supply mode/sync */
+#define ASSABET_GPIO_L3_MODE GPIO_GPIO (17) /* L3 mode signal with LED */
+#define ASSABET_GPIO_L3_I2C_SCL GPIO_GPIO (18) /* L3 and I2C control ports */
+#define ASSABET_GPIO_STEREO_64FS_CLK GPIO_GPIO (19) /* SSP UDA1341 clock input */
+#define ASSABET_GPIO_CF_IRQ GPIO_GPIO (21) /* CF IRQ */
+#define ASSABET_GPIO_CF_CD GPIO_GPIO (22) /* CF CD */
+#define ASSABET_GPIO_UCB1300_IRQ GPIO_GPIO (23) /* UCB GPIO and touchscreen */
+#define ASSABET_GPIO_CF_BVD2 GPIO_GPIO (24) /* CF BVD */
+#define ASSABET_GPIO_GFX_IRQ GPIO_GPIO (24) /* Graphics IRQ */
+#define ASSABET_GPIO_CF_BVD1 GPIO_GPIO (25) /* CF BVD */
+#define ASSABET_GPIO_NEP_IRQ GPIO_GPIO (25) /* Neponset IRQ */
+#define ASSABET_GPIO_BATT_LOW GPIO_GPIO (26) /* Low battery */
+#define ASSABET_GPIO_RCLK GPIO_GPIO (26) /* CCLK/2 */
+
+#define ASSABET_IRQ_GPIO_CF_IRQ IRQ_GPIO21
+#define ASSABET_IRQ_GPIO_CF_CD IRQ_GPIO22
+#define ASSABET_IRQ_GPIO_UCB1300_IRQ IRQ_GPIO23
+#define ASSABET_IRQ_GPIO_CF_BVD2 IRQ_GPIO24
+#define ASSABET_IRQ_GPIO_CF_BVD1 IRQ_GPIO25
+#define ASSABET_IRQ_GPIO_NEP_IRQ IRQ_GPIO25
X
X
X /*
@@ -139,8 +136,6 @@
X
X #define _LEDS 0x10000010 /* LEDs [31:0] (WO) */
X
-#ifndef __ASSEMBLY__
-
X #define IRR (*((volatile u_char *) Nep_p2v(_IRR)))
X #define AUD_CTL (*((volatile u_char *) Nep_p2v(_AUD_CTL)))
X #define MDM_CTL_0 (*((volatile u_char *) Nep_p2v(_MDM_CTL_0)))
@@ -153,8 +148,6 @@
X
X #define LEDS (*((volatile Word *) Nep_p2v(_LEDS)))
X
-#endif
-
X #define IRR_ETHERNET (1<<0)
X #define IRR_USAR (1<<1)
X #define IRR_SA1111 (1<<2)
@@ -182,11 +175,10 @@
X #define NCR_A0VPP (1<<5)
X #define NCR_A1VPP (1<<6)
X
-#ifndef __ASSEMBLY__
X #ifdef CONFIG_ASSABET_NEPONSET
-#define machine_has_neponset() ((SCR_value & SCR_SA1111) == 0)
+#define machine_has_neponset() ((SCR_value & ASSABET_SCR_SA1111) == 0)
X #else
X #define machine_has_neponset() (0)
X #endif
-#endif
X
+#endif
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-sa1100/bitfield.h linux/include/asm-arm/arch-sa1100/bitfield.h
--- v2.4.13/linux/include/asm-arm/arch-sa1100/bitfield.h Tue Jul 18 22:43:25 2000
+++ linux/include/asm-arm/arch-sa1100/bitfield.h Thu Oct 25 13:53:54 2001
@@ -12,21 +12,14 @@
X
X
X
-#ifndef BITFIELD
-#define BITFIELD
+#ifndef __BITFIELD_H
+#define __BITFIELD_H
X
-#ifndef LANGUAGE
-#define LANGUAGE C
-#endif /* !defined (LANGUAGE) */


-
-#define C 0
-#define Assembly 1

-
-#if LANGUAGE == C

-#define UData(Data) ((unsigned int) (Data))
-#elif LANGUAGE == Assembly
+#ifndef __ASSEMBLY__
+#define UData(Data) ((unsigned long) (Data))
+#else
X #define UData(Data) (Data)
-#endif /* LANGUAGE == C || LANGUAGE == Assembly */
+#endif
X
X
X /*
@@ -117,7 +110,4 @@
X ((UData (Data) >> FShft (Field)) & FAlnMsk (Field))
X
X
-#undef C
-#undef Assembly
-
-#endif /* !defined (BITFIELD) */
+#endif /* __BITFIELD_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-sa1100/cerf.h linux/include/asm-arm/arch-sa1100/cerf.h
--- v2.4.13/linux/include/asm-arm/arch-sa1100/cerf.h Mon Sep 18 15:15:23 2000
+++ linux/include/asm-arm/arch-sa1100/cerf.h Thu Oct 25 13:53:54 2001
@@ -1,19 +1,108 @@
X #ifndef _INCLUDE_CERF_H_
X #define _INCLUDE_CERF_H_
X
-/* GPIOs for CF+ slot lines */
-#define GPIO_CF_IRQ GPIO_GPIO (22) /* 1111 MBGNT _OR_ CF IRQ */
-#define GPIO_CF_CD GPIO_GPIO (23) /* 1111 MBREQ _OR_ CF CD */
-#define GPIO_CF_BVD2 GPIO_GPIO (19) /* Graphics IRQ _OR_ CF BVD */
-#define GPIO_CF_BVD1 GPIO_GPIO (20) /* 1111 IRQ _OR_ CF BVD */
-
-#define IRQ_GPIO_CF_IRQ IRQ_GPIO22
-#define IRQ_GPIO_CF_CD IRQ_GPIO23
-#define IRQ_GPIO_CF_BVD2 IRQ_GPIO19
-#define IRQ_GPIO_CF_BVD1 IRQ_GPIO20
+#ifdef CONFIG_SA1100_CERF_CPLD
X
-#define GPIO_UCB1200_IRQ GPIO_GPIO (18)
-#define IRQ_GPIO_UCB1200_IRQ IRQ_GPIO18
X
-#endif
+// Map sa1100fb.c to sa1100_frontlight.c - Not pretty, but necessary.
+#define CERF_BACKLIGHT_ENABLE sa1100_fl_enable
+#define CERF_BACKLIGHT_DISABLE sa1100_fl_disable
X
+//
+// IO Pins for devices
+//
+
+#define CERF_PDA_CPLD 0xf1000000
+#define CERF_PDA_CPLD_WRCLRINT (0x0)
+#define CERF_PDA_CPLD_BACKLIGHT (0x2)
+#define CERF_PDA_CPLD_SOUND_FREQ (0x4)
+#define CERF_PDA_CPLD_KEYPAD_A (0x6)
+#define CERF_PDA_CPLD_BATTFAULT (0x8)
+#define CERF_PDA_CPLD_KEYPAD_B (0xa)
+#define CERF_PDA_CPLD_SOUND_ENA (0xc)
+#define CERF_PDA_CPLD_SOUND_RESET (0xe)
+
+#define GPIO_CF_BVD2 GPIO_GPIO (5)
+#define GPIO_CF_BVD1 GPIO_GPIO (6)
+#define GPIO_CF_RESET GPIO_GPIO (7)
+#define GPIO_CF_IRQ GPIO_GPIO (8)
+#define GPIO_CF_CD GPIO_GPIO (9)
+
+#define GPIO_PWR_SHUTDOWN GPIO_GPIO (25)
+
+#define UCB1200_GPIO_CONT_CS 0x0001
+#define UCB1200_GPIO_CONT_DOWN 0x0002
+#define UCB1200_GPIO_CONT_INC 0x0004
+#define UCB1200_GPIO_CONT_ENA 0x0008
+#define UCB1200_GPIO_LCD_RESET 0x0010
+#define UCB1200_GPIO_IRDA_ENABLE 0x0020
+#define UCB1200_GPIO_BT_ENABLE 0x0040
+#define UCB1200_GPIO_L3_DATA 0x0080
+#define UCB1200_GPIO_L3_CLOCK 0x0100
+#define UCB1200_GPIO_L3_MODE 0x0200
+
+//
+// IRQ for devices
+//
+
+#define IRQ_UCB1200_CONT_CS IRQ_UCB1200_IO0
+#define IRQ_UCB1200_CONT_DOWN IRQ_UCB1200_IO1
+#define IRQ_UCB1200_CONT_INC IRQ_UCB1200_IO2
+#define IRQ_UCB1200_CONT_ENA IRQ_UCB1200_IO3
+#define IRQ_UCB1200_LCD_RESET IRQ_UCB1200_IO4
+#define IRQ_UCB1200_IRDA_ENABLE IRQ_UCB1200_IO5
+#define IRQ_UCB1200_BT_ENABLE IRQ_UCB1200_IO6
+#define IRQ_UCB1200_L3_DATA IRQ_UCB1200_IO7
+#define IRQ_UCB1200_L3_CLOCK IRQ_UCB1200_IO8
+#define IRQ_UCB1200_L3_MODE IRQ_UCB1200_IO9
+
+#define IRQ_GPIO_CF_BVD2 IRQ_GPIO5
+#define IRQ_GPIO_CF_BVD1 IRQ_GPIO6
+#define IRQ_GPIO_CF_IRQ IRQ_GPIO8
+#define IRQ_GPIO_CF_CD IRQ_GPIO9
+
+//
+// Device parameters
+//
+
+#define CERF_PDA_CPLD_SOUND_FREQ_8000 (0x01)
+#define CERF_PDA_CPLD_SOUND_FREQ_11025 (0x05)
+#define CERF_PDA_CPLD_SOUND_FREQ_16000 (0x02)
+#define CERF_PDA_CPLD_SOUND_FREQ_22050 (0x06)
+#define CERF_PDA_CPLD_SOUND_FREQ_32000 (0x03)
+#define CERF_PDA_CPLD_SOUND_FREQ_44100 (0x07)
+#define CERF_PDA_CPLD_SOUND_FREQ_48000 (0x0b)
+
+//
+// General Functions
+//
+
+#define CERF_PDA_CPLD_Get(x, y) (*((char*)(CERF_PDA_CPLD + (x))) & (y))
+#define CERF_PDA_CPLD_Set(x, y, z) (*((char*)(CERF_PDA_CPLD + (x))) = (*((char*)(CERF_PDA_CPLD + (x))) & ~(z)) | (y))
+#define CERF_PDA_CPLD_UnSet(x, y, z) (*((char*)(CERF_PDA_CPLD + (x))) = (*((char*)(CERF_PDA_CPLD + (x))) & ~(z)) & ~(y))
+
+
+#else // CONFIG_SA1100_CERF_CPLD
+
+
+#define GPIO_CF_BVD2 GPIO_GPIO (19)
+#define GPIO_CF_BVD1 GPIO_GPIO (20)
+#define GPIO_CF_RESET 0
+#define GPIO_CF_IRQ GPIO_GPIO (22)
+#define GPIO_CF_CD GPIO_GPIO (23)
+
+#define GPIO_LCD_RESET GPIO_GPIO (15)
+
+#define IRQ_GPIO_CF_BVD2 IRQ_GPIO19
+#define IRQ_GPIO_CF_BVD1 IRQ_GPIO20
+#define IRQ_GPIO_CF_IRQ IRQ_GPIO22
+#define IRQ_GPIO_CF_CD IRQ_GPIO23
+
+
+#endif // CONFIG_SA1100_CERF_CPLD
+
+
+#define GPIO_UCB1200_IRQ GPIO_GPIO (18)
+#define IRQ_GPIO_UCB1200_IRQ IRQ_GPIO18
+
+#endif // _INCLUDE_CERF_H_
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-sa1100/graphicsclient.h linux/include/asm-arm/arch-sa1100/graphicsclient.h
--- v2.4.13/linux/include/asm-arm/arch-sa1100/graphicsclient.h Thu Feb 8 16:32:44 2001
+++ linux/include/asm-arm/arch-sa1100/graphicsclient.h Thu Oct 25 13:53:54 2001
@@ -63,6 +63,27 @@
X #define _ADS_UARTC 0x10140000 /* UART C */
X #define _ADS_UARTD 0x10160000 /* UART D */
X
+/* UART controll lines GPIOs */
+#define GPIO_GC_UART0_RTS GPIO_GPIO15
+#define GPIO_GC_UART1_RTS GPIO_GPIO17
+#define GPIO_GC_UART2_RTS GPIO_GPIO19
+#define GPIO_GC_UART0_CTS GPIO_GPIO14
+#define GPIO_GC_UART1_CTS GPIO_GPIO16
+#define GPIO_GC_UART2_CTS GPIO_GPIO17
+
+/* UART controll lines IRQs */
+#define IRQ_GC_UART0_CTS IRQ_GPIO14
+#define IRQ_GC_UART1_CTS IRQ_GPIO16
+#define IRQ_GC_UART2_CTS IRQ_GPIO17
+
+#ifndef __ASSEMBLY__
+struct gc_uart_ctrl_data_t {
+ int cts_gpio;
+ int cts_prev_state;
+ struct uart_info *info;
+ struct uart_port *port;
+};
+#endif /* __ASSEMBLY__ */
X
X /* LEDs */
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-sa1100/hardware.h linux/include/asm-arm/arch-sa1100/hardware.h
--- v2.4.13/linux/include/asm-arm/arch-sa1100/hardware.h Tue Oct 23 22:48:53 2001
+++ linux/include/asm-arm/arch-sa1100/hardware.h Thu Oct 25 13:53:54 2001
@@ -59,6 +59,31 @@
X #define io_v2p( x ) \
X ( (((x)&0x00ffffff) | (((x)&(0x30000000>>VIO_SHIFT))<<VIO_SHIFT)) + PIO_START )
X
+#ifndef __ASSEMBLY__
+
+#if 0
+# define __REG(x) (*((volatile unsigned long *)io_p2v(x)))
+#else
+/*
+ * This __REG() version gives the same results as the one above, except
+ * that we are fooling gcc somehow so it generates far better and smaller
+ * assembly code for access to contigous registers. It's a shame that gcc
+ * doesn't guess this by itself.
+ */
+typedef struct { volatile unsigned long offset[4096]; } __regbase;
+# define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2]
+# define __REG(x) __REGP(io_p2v(x))
+#endif
+
+# define __PREG(x) (io_v2p((unsigned long)&(x)))
+
+#else
+
+# define __REG(x) io_p2v(x)
+# define __PREG(x) io_v2p(x)
+
+#endif
+
X #include "SA-1100.h"
X
X
@@ -83,20 +108,18 @@
X
X
X /*
- * Implementation specifics
+ * Implementation specifics.
+ *
+ * *** NOTE ***
+ * Any definitions in these files should be prefixed by an identifier -
+ * eg, ASSABET_UCB1300_IRQ This will allow us to eleminate these
+ * ifdefs, and lots of other preprocessor gunk elsewhere.
X */
X
X #ifdef CONFIG_SA1100_PANGOLIN
X #include "pangolin.h"
X #endif
X
-#ifdef CONFIG_SA1100_ASSABET
-#include "assabet.h"
-#else
-#define machine_has_neponset() (0)
-#endif
-
-
X #ifdef CONFIG_SA1100_HUW_WEBPANEL
X #include "huw_webpanel.h"
X #endif
@@ -190,8 +213,14 @@
X
X #ifdef CONFIG_SA1111
X
-#define SA1111_p2v( x ) ((x) - SA1111_BASE + 0xf4000000)
-#define SA1111_v2p( x ) ((x) - 0xf4000000 + SA1111_BASE)
+/*
+ * The SA1111 is always located at virtual 0xf4000000.
+ */
+
+#define SA1111_VBASE 0xf4000000
+
+#define SA1111_p2v( x ) ((x) - SA1111_BASE + SA1111_VBASE)
+#define SA1111_v2p( x ) ((x) - SA1111_VBASE + SA1111_BASE)
X
X #include "SA-1111.h"
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-sa1100/keyboard.h linux/include/asm-arm/arch-sa1100/keyboard.h
--- v2.4.13/linux/include/asm-arm/arch-sa1100/keyboard.h Tue Oct 23 22:48:53 2001
+++ linux/include/asm-arm/arch-sa1100/keyboard.h Thu Oct 25 13:53:54 2001
@@ -3,84 +3,34 @@
X * Created 16 Dec 1999 by Nicolas Pitre <ni...@cam.org>
X * This file contains the SA1100 architecture specific keyboard definitions
X */
-
X #ifndef _SA1100_KEYBOARD_H
X #define _SA1100_KEYBOARD_H
X
X #include <linux/config.h>
X #include <asm/mach-types.h>
-#include <asm/hardware.h>
-
-extern struct kbd_ops_struct *kbd_ops;
+#include <asm/arch/assabet.h>
X
X #define kbd_disable_irq() do { } while(0);
X #define kbd_enable_irq() do { } while(0);
X
-
-/*
- * SA1111 keyboard driver
- */
X extern void sa1111_kbd_init_hw(void);
-
-/*
- * GraphicsClient keyboard driver
- */
X extern void gc_kbd_init_hw(void);
+extern void smartio_kbd_init_hw(void);
+extern void cerf_kbd_init_hw(void);
X
X static inline void kbd_init_hw(void)
X {
- if (machine_is_assabet() && machine_has_neponset())
+ if ((machine_is_assabet() && machine_has_neponset()) ||
+ machine_is_graphicsmaster())
X sa1111_kbd_init_hw();
-
X if (machine_is_graphicsclient())
X gc_kbd_init_hw();
-}
-
-
-
-#if 0 /* Brutus needs fixing */
-
-extern int Brutus_kbd_translate(unsigned char scancode, unsigned char *keycode,
- char raw_mode);
-extern void Brutus_kbd_leds(unsigned char leds);
-extern void Brutus_kbd_init_hw(void);
-extern void Brutus_kbd_enable_irq(void);
-extern void Brutus_kbd_disable_irq(void);
-extern unsigned char Brutus_kbd_sysrq_xlate[128];
-
-#define kbd_setkeycode(x...) (-ENOSYS)
-#define kbd_getkeycode(x...) (-ENOSYS)
-#define kbd_translate Brutus_kbd_translate
-#define kbd_unexpected_up(x...) (1)
-#define kbd_leds Brutus_kbd_leds
-#define kbd_init_hw Brutus_kbd_init_hw
-#define kbd_enable_irq Brutus_kbd_enable_irq
-#define kbd_disable_irq Brutus_kbd_disable_irq
-#define kbd_sysrq_xlate Brutus_kbd_sysrq_xlate


-
-#define SYSRQ_KEY 0x54
-

-#elif 0 // CONFIG_SA1100_GRAPHICSCLIENT
-extern int gc_kbd_setkeycode(unsigned int scancode, unsigned int keycode);
-extern int gc_kbd_getkeycode(unsigned int scancode);
-extern int gc_kbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode);
-extern void gc_kbd_leds(unsigned char leds);
-extern void gc_kbd_init_hw(void);
-extern void gc_kbd_enable_irq(void);
-extern void gc_kbd_disable_irq(void);
-extern unsigned char gc_kbd_sysrq_xlate[128];
-
-#define kbd_setkeycode(x...) gc_kbd_setkeycode //(-ENOSYS)
-#define kbd_getkeycode(x...) gc_kbd_getkeycode //(-ENOSYS)
-#define kbd_translate gc_kbd_translate
-#define kbd_unexpected_up(x...) (1)
-#define kbd_leds gc_kbd_leds
-#define kbd_init_hw gc_kbd_init_hw
-#define kbd_enable_irq gc_kbd_enable_irq
-#define kbd_disable_irq gc_kbd_disable_irq
-#define kbd_sysrq_xlate (1)
-
+ if (machine_is_adsbitsy())
+ smartio_kbd_init_hw();
+#ifdef CONFIG_SA1100_CERF_CPLD
+ if (machine_is_cerf())
+ cerf_kbd_init_hw();
X #endif
+}
X
X #endif /* _SA1100_KEYBOARD_H */
-
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-sa1100/simpad.h linux/include/asm-arm/arch-sa1100/simpad.h
--- v2.4.13/linux/include/asm-arm/arch-sa1100/simpad.h Mon Aug 27 12:41:47 2001
+++ linux/include/asm-arm/arch-sa1100/simpad.h Thu Oct 25 13:53:54 2001
@@ -1,11 +1,11 @@
X /*
- * linux/include/asm-arm/arch-sa1100/trizeps.h
+ * linux/include/asm-arm/arch-sa1100/simpad.h
X *
X * based of assabet.h same as HUW_Webpanel
X *
- * This file contains the hardware specific definitions for Trizeps
+ * This file contains the hardware specific definitions for SIMpad
X *
- * 2001/03/14 Peter Lueg <peter...@dsa-ac.de>
+ * 2001/05/14 Juergen Messerer <juergen....@siemens.ch>
X */
X
X #ifndef SIMPAD_H
@@ -16,17 +16,6 @@
X #error "include <asm/hardware.h> instead"
X #endif
X
-/* System Configuration Register flags */
-
-#define SCR_SDRAM_LOW (1<<2) /* SDRAM size (low bit) */
-#define SCR_SDRAM_HIGH (1<<3) /* SDRAM size (high bit) */
-#define SCR_FLASH_LOW (1<<4) /* Flash size (low bit) */
-#define SCR_FLASH_HIGH (1<<5) /* Flash size (high bit) */
-#define SCR_GFX (1<<8) /* Graphics Accelerator (0 = present) */
-#define SCR_SA1111 (1<<9) /* Neponset (0 = present) */
-
-#define SCR_INIT -1
-
X #define GPIO_UART1_RTS GPIO_GPIO14
X #define GPIO_UART1_DTR GPIO_GPIO7
X #define GPIO_UART1_CTS GPIO_GPIO8
@@ -39,6 +28,8 @@
X #define GPIO_UART3_DCD GPIO_GPIO18
X #define GPIO_UART3_DSR GPIO_GPIO17
X
+#define GPIO_UCB1300_IRQ GPIO_GPIO (22) /* UCB GPIO and touchscreen */
+
X #define IRQ_UART1_CTS IRQ_GPIO15
X #define IRQ_UART1_DCD GPIO_GPIO23
X #define IRQ_UART1_DSR GPIO_GPIO6
@@ -46,56 +37,39 @@
X #define IRQ_UART3_DCD GPIO_GPIO18
X #define IRQ_UART3_DSR GPIO_GPIO17
X
-#define GPIO_UCB1300_IRQ GPIO_GPIO (22) /* UCB GPIO and touchscreen */
-#define IRQ_GPIO_UCB1300_IRQ IRQ_GPIO22
-
-#define SA1100_UART1_EXT \
- (struct huw_irq_desc){GPIO_UART1_CTS, IRQ_UART1_CTS, \
- GPIO_UART1_DCD, IRQ_UART1_DCD, \
- GPIO_UART1_DSR, IRQ_UART1_DSR}
-#define SA1100_UART3_EXT \
- (struct huw_irq_desc){GPIO_UART3_CTS, IRQ_UART3_CTS, \
- GPIO_UART3_DCD, IRQ_UART3_DCD, \
- GPIO_UART3_DSR, IRQ_UART3_DSR}
+#define IRQ_GPIO_UCB1300_IRQ IRQ_GPIO22
X
X
X /*--- PCMCIA ---*/
X #define GPIO_CF_CD GPIO_GPIO24
-#define GPIO_CF_IRQ GPIO_GPIO1
+#define GPIO_CF_IRQ GPIO_GPIO1
X #define IRQ_GPIO_CF_IRQ IRQ_GPIO1
-#define IRQ_GPIO_CF_CD IRQ_GPIO24
+#define IRQ_GPIO_CF_CD IRQ_GPIO24
X
-// CS3 Latch is write only, a shadow is neccessary
+// CS3 Latch is write only, a shadow is neccessary
X
-#define CS3BUSTYPE unsigned volatile long
+#define CS3BUSTYPE unsigned volatile long
X #define CS3_BASE 0xf1000000
X
-#define VCC_5V_EN 0x0001
-#define VCC_3V_EN 0x0002
-#define EN1 0x0004
-#define EN0 0x0008
+#define VCC_5V_EN 0x0001 // For 5V PCMCIA
+#define VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA
+#define EN1 0x0004 // This is only for EPROM's
+#define EN0 0x0008 // Both should be enable for 3.3V or 5V
X #define DISPLAY_ON 0x0010
X #define PCMCIA_BUFF_DIS 0x0020
X #define MQ_RESET 0x0040
X #define PCMCIA_RESET 0x0080
X #define DECT_POWER_ON 0x0100
-#define IRDA_SD 0x0200
+#define IRDA_SD 0x0200 // Shutdown for powersave
X #define RS232_ON 0x0400
-#define SD_MEDIAQ 0x0800
-#define LED2_ON 0x1000
-#define IRDA_MODE 0x2000
-#define ENABLE_5V 0x4000
+#define SD_MEDIAQ 0x0800 // Shutdown for powersave
+#define LED2_ON 0x1000
+#define IRDA_MODE 0x2000 // Fast/Slow IrDA mode
+#define ENABLE_5V 0x4000 // Enable 5V circuit
X #define RESET_SIMCARD 0x8000
X
X #define RS232_ENABLE 0x0440
-#define PCMCIAMASK 0x402f
-
-#ifndef __ASSEMBLY__
-static long cs3_shadow;
-void init_simpad_cs3();
-void PCMCIA_setbit(int value);
-void PCMCIA_clearbit(int value);
-#endif
+#define PCMCIAMASK 0x402f
X
X #endif // SIMPAD_H
X
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-sa1100/system.h linux/include/asm-arm/arch-sa1100/system.h
--- v2.4.13/linux/include/asm-arm/arch-sa1100/system.h Mon Aug 27 12:41:47 2001
+++ linux/include/asm-arm/arch-sa1100/system.h Thu Oct 25 13:53:54 2001
@@ -7,8 +7,13 @@
X
X static inline void arch_idle(void)
X {
- if (!hlt_counter)
- cpu_do_idle(0);
+ if (!hlt_counter) {
+ int flags;
+ local_irq_save(flags);
+ if (!current->need_resched)
+ cpu_do_idle(0);
+ local_irq_restore(flags);
+ }
X }
X
X #ifdef CONFIG_SA1100_VICTOR
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/dma.h linux/include/asm-arm/arch-shark/dma.h
--- v2.4.13/linux/include/asm-arm/arch-shark/dma.h Mon Aug 27 12:41:47 2001
+++ linux/include/asm-arm/arch-shark/dma.h Thu Oct 25 13:53:54 2001


@@ -1,7 +1,7 @@
X /*

X * linux/include/asm-arm/arch-shark/dma.h
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X */
X #ifndef __ASM_ARCH_DMA_H
X #define __ASM_ARCH_DMA_H
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/hardware.h linux/include/asm-arm/arch-shark/hardware.h
--- v2.4.13/linux/include/asm-arm/arch-shark/hardware.h Thu Apr 12 12:20:31 2001
+++ linux/include/asm-arm/arch-shark/hardware.h Thu Oct 25 13:53:54 2001


@@ -1,7 +1,7 @@
X /*

X * linux/include/asm-arm/arch-shark/hardware.h
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X *
X * derived from:
X * linux/include/asm-arm/arch-ebsa110/hardware.h
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/ide.h linux/include/asm-arm/arch-shark/ide.h
--- v2.4.13/linux/include/asm-arm/arch-shark/ide.h Thu Apr 12 12:20:31 2001
+++ linux/include/asm-arm/arch-shark/ide.h Thu Oct 25 13:53:55 2001


@@ -1,7 +1,7 @@
X /*

X * linux/include/asm-arm/arch-shark/ide.h
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X *
X * derived from:
X * linux/include/asm-arm/arch-ebsa285/ide.h
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/io.h linux/include/asm-arm/arch-shark/io.h
--- v2.4.13/linux/include/asm-arm/arch-shark/io.h Mon Aug 27 12:41:47 2001
+++ linux/include/asm-arm/arch-shark/io.h Thu Oct 25 13:53:55 2001


@@ -1,7 +1,7 @@
X /*

X * linux/include/asm-arm/arch-shark/io.h
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X *
X * derived from:
X * linux/include/asm-arm/arch-ebsa110/io.h
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/irq.h linux/include/asm-arm/arch-shark/irq.h
--- v2.4.13/linux/include/asm-arm/arch-shark/irq.h Thu Apr 12 12:20:31 2001
+++ linux/include/asm-arm/arch-shark/irq.h Thu Oct 25 13:53:55 2001


@@ -1,7 +1,7 @@
X /*

X * linux/include/asm-arm/arch-shark/irq.h
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X *
X * derived from linux/arch/ppc/kernel/i8259.c and:
X * include/asm-arm/arch-ebsa110/irq.h
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/irqs.h linux/include/asm-arm/arch-shark/irqs.h
--- v2.4.13/linux/include/asm-arm/arch-shark/irqs.h Thu Apr 12 12:20:31 2001
+++ linux/include/asm-arm/arch-shark/irqs.h Thu Oct 25 13:53:55 2001


@@ -1,7 +1,7 @@
X /*

X * linux/include/asm-arm/arch-shark/irqs.h
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X */
X
X #define NR_IRQS 16
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/keyboard.h linux/include/asm-arm/arch-shark/keyboard.h
--- v2.4.13/linux/include/asm-arm/arch-shark/keyboard.h Thu Apr 12 12:20:31 2001
+++ linux/include/asm-arm/arch-shark/keyboard.h Thu Oct 25 13:53:55 2001
@@ -1,6 +1,6 @@
X /*
X * linux/include/asm-arm/arch-shark/keyboard.h
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X *
X * Derived from linux/include/asm-arm/arch-ebsa285/keyboard.h
X * (C) 1998 Russell King
@@ -11,6 +11,12 @@
X #include <asm/io.h>


X #include <asm/system.h>
X
+#define KEYBOARD_IRQ IRQ_ISA_KEYBOARD
+#define NR_SCANCODES 128
+
+#define kbd_disable_irq() do { } while (0)
+#define kbd_enable_irq() do { } while (0)
+
X extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
X extern int pckbd_getkeycode(unsigned int scancode);
X extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,

@@ -20,22 +26,25 @@


X extern void pckbd_init_hw(void);
X extern unsigned char pckbd_sysrq_xlate[128];
X
-#define KEYBOARD_IRQ IRQ_ISA_KEYBOARD
-
-#define NR_SCANCODES 128

-
-#define kbd_setkeycode(sc,kc) pckbd_setkeycode(sc,kc)
-#define kbd_getkeycode(sc) pckbd_getkeycode(sc)
-#define kbd_translate(sc, kcp, rm) pckbd_translate(sc, kcp, rm)
-#define kbd_unexpected_up pckbd_unexpected_up
-#define kbd_leds(leds) pckbd_leds(leds)
-#define kbd_init_hw() pckbd_init_hw()
-#define kbd_sysrq_xlate pckbd_sysrq_xlate


+static inline void kbd_init_hw(void)
+{
+ if (have_isa_bridge) {
+ k_setkeycode = pckbd_setkeycode;
+ k_getkeycode = pckbd_getkeycode;
+ k_translate = pckbd_translate;
+ k_unexpected_up = pckbd_unexpected_up;
+ k_leds = pckbd_leds;
+#ifdef CONFIG_MAGIC_SYSRQ
+ k_sysrq_key = 0x54;
+ k_sysrq_xlate = pckbd_sysrq_xlate;
+#endif
+ pckbd_init_hw();
+ }
+}
X

-#define kbd_disable_irq()
-#define kbd_enable_irq()
-
-#define SYSRQ_KEY 0x54
+/*

+ * PC Keyboard specifics


+ */
X
X /* resource allocation */

X #define kbd_request_region() request_region(0x60, 16, "keyboard")
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/memory.h linux/include/asm-arm/arch-shark/memory.h
--- v2.4.13/linux/include/asm-arm/arch-shark/memory.h Mon Aug 27 12:41:47 2001
+++ linux/include/asm-arm/arch-shark/memory.h Thu Oct 25 13:53:55 2001


@@ -1,7 +1,7 @@
X /*

X * linux/include/asm-arm/arch-shark/memory.h
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X *
X * derived from:
X * linux/include/asm-arm/arch-ebsa110/memory.h
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/param.h linux/include/asm-arm/arch-shark/param.h
--- v2.4.13/linux/include/asm-arm/arch-shark/param.h Thu Apr 12 12:20:31 2001
+++ linux/include/asm-arm/arch-shark/param.h Thu Oct 25 13:53:55 2001
@@ -1,10 +1,12 @@
X /*
X * linux/include/asm-arm/arch-shark/param.h
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X */
X
X /* This must be a power of 2 because the RTC
X * can't use anything else.
X */
X #define HZ 64
+


+#define hz_to_std(a) ((a * HZ)/100)

diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/system.h linux/include/asm-arm/arch-shark/system.h
--- v2.4.13/linux/include/asm-arm/arch-shark/system.h Thu Apr 12 12:20:31 2001
+++ linux/include/asm-arm/arch-shark/system.h Thu Oct 25 13:53:55 2001


@@ -1,7 +1,7 @@
X /*

X * linux/include/asm-arm/arch-shark/system.h
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X */
X #ifndef __ASM_ARCH_SYSTEM_H
X #define __ASM_ARCH_SYSTEM_H
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/time.h linux/include/asm-arm/arch-shark/time.h
--- v2.4.13/linux/include/asm-arm/arch-shark/time.h Mon Aug 27 12:41:47 2001
+++ linux/include/asm-arm/arch-shark/time.h Thu Oct 25 13:53:55 2001


@@ -1,7 +1,7 @@
X /*

X * linux/include/asm-arm/arch-shark/time.h
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X *
X * Uses the real time clock because you can't run
X * the timer with level triggered interrupts and
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/timex.h linux/include/asm-arm/arch-shark/timex.h
--- v2.4.13/linux/include/asm-arm/arch-shark/timex.h Thu Apr 12 12:20:31 2001
+++ linux/include/asm-arm/arch-shark/timex.h Thu Oct 25 13:53:55 2001
@@ -1,5 +1,5 @@
X /*
X * linux/include/asm-arm/arch-shark/timex.h
X *
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X */
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-shark/uncompress.h linux/include/asm-arm/arch-shark/uncompress.h
--- v2.4.13/linux/include/asm-arm/arch-shark/uncompress.h Thu Apr 12 12:20:31 2001
+++ linux/include/asm-arm/arch-shark/uncompress.h Thu Oct 25 13:53:55 2001
@@ -1,6 +1,6 @@
X /*
X * linux/include/asm-arm/arch-shark/uncompress.h
- * by Alexander Schulz <asc...@netwinder.org>
+ * by Alexander Schulz
X *
X * derived from:
X * linux/include/asm-arm/arch-ebsa285/uncompress.h
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/arch-tbox/keyboard.h linux/include/asm-arm/arch-tbox/keyboard.h
--- v2.4.13/linux/include/asm-arm/arch-tbox/keyboard.h Mon Sep 18 15:15:23 2000
+++ linux/include/asm-arm/arch-tbox/keyboard.h Thu Oct 25 13:53:55 2001
@@ -3,27 +3,12 @@
X *
X * Driver definitions for Tbox dummy keyboard.


X *
- * Copyright (C) 1998 Russell King
+ * Copyright (C) 1998-2001 Russell King

X * Copyright (C) 1998 Philip Blundell
X */

X
X #define NR_SCANCODES 128
X

-#define kbd_setkeycode(sc,kc) (-EINVAL)
-#define kbd_getkeycode(sc) (-EINVAL)
-

-/* Prototype: int kbd_pretranslate(scancode, raw_mode)
- * Returns : 0 to ignore scancode
- */
-#define kbd_pretranslate(sc,rm) (1)
-
-/* Prototype: int kbd_translate(scancode, *keycode, *up_flag, raw_mode)
- * Returns : 0 to ignore scancode, *keycode set to keycode, *up_flag
- * set to 0200 if scancode indicates release
- */
-#define kbd_translate(sc, kcp, rm) 0

-#define kbd_unexpected_up(kc) (0200)


-#define kbd_leds(leds) do { } while (0)
-#define kbd_init_hw() do { } while (0)
-#define kbd_disable_irq() do { } while (0)

-#define kbd_enable_irq() do { } while (0)


+#define kbd_init_hw() do { } while (0)

+#define kbd_disable_irq() do { } while (0)
+#define kbd_enable_irq() do { } while (0)

diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/hardware/ep7211.h linux/include/asm-arm/hardware/ep7211.h
--- v2.4.13/linux/include/asm-arm/hardware/ep7211.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/hardware/ep7211.h Thu Oct 25 13:53:55 2001
@@ -0,0 +1,40 @@
+/*
+ * linux/include/asm-arm/hardware/ep7211.h
+ *
+ * This file contains the hardware definitions of the EP7211 internal
+ * registers.
+ *
+ * Copyright (C) 2001 Blue Mug, Inc. All Rights Reserved.
+ *


+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by

+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *


+ * This 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 __ASM_HARDWARE_EP7211_H
+#define __ASM_HARDWARE_EP7211_H
+
+#include <asm/hardware/clps7111.h>
+
+/*
+ * define EP7211_BASE to be the base address of the region
+ * you want to access.
+ */
+
+#define EP7211_PHYS_BASE (0x80000000)
+
+/*
+ * XXX mi...@bluemug.com: need to introduce EP7211 registers (those not
+ * present in 7212) here.
+ */
+
+#endif /* __ASM_HARDWARE_EP7211_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/hardware/ep7212.h linux/include/asm-arm/hardware/ep7212.h
--- v2.4.13/linux/include/asm-arm/hardware/ep7212.h Thu Apr 12 12:20:31 2001
+++ linux/include/asm-arm/hardware/ep7212.h Thu Oct 25 13:53:55 2001
@@ -23,6 +23,8 @@
X #ifndef __ASM_HARDWARE_EP7212_H
X #define __ASM_HARDWARE_EP7212_H
X
+#include <linux/config.h>
+
X /*
X * define EP7212_BASE to be the base address of the region
X * you want to access.
@@ -47,6 +49,10 @@
X #define INTSR3 0x2240
X #define INTMR3 0x2280
X #define LEDFLSH 0x22c0
+#if defined (CONFIG_ARCH_CDB89712)
+#define SDCONF 0x2300
+#define SDRFPR 0x2340
+#endif
X
X #define DAIR_DAIEN (1 << 16)
X #define DAIR_ECS (1 << 17)
@@ -80,5 +86,19 @@
X #define SYSCON3_FASTWAKE (1 << 8)
X #define SYSCON3_DAIEN (1 << 9)
X
+#if defined (CONFIG_ARCH_CDB89712)
+#define SDCONF_ACTIVE (1 << 10)
+#define SDCONF_CLKCTL (1 << 9)
+#define SDCONF_WIDTH_4 (0 << 7)
+#define SDCONF_WIDTH_8 (1 << 7)
+#define SDCONF_WIDTH_16 (2 << 7)
+#define SDCONF_WIDTH_32 (3 << 7)
+#define SDCONF_SIZE_16 (0 << 5)
+#define SDCONF_SIZE_64 (1 << 5)
+#define SDCONF_SIZE_128 (2 << 5)
+#define SDCONF_SIZE_256 (3 << 5)
+#define SDCONF_CASLAT_2 (2)
+#define SDCONF_CASLAT_3 (3)
+#endif
X
X #endif /* __ASM_HARDWARE_EP7212_H */
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/keyboard.h linux/include/asm-arm/keyboard.h
--- v2.4.13/linux/include/asm-arm/keyboard.h Mon Aug 27 12:41:47 2001
+++ linux/include/asm-arm/keyboard.h Thu Oct 25 13:53:55 2001
@@ -12,6 +12,9 @@
X #ifndef __ASM_ARM_KEYBOARD_H
X #define __ASM_ARM_KEYBOARD_H
X
+#include <linux/kd.h>
+#include <linux/pm.h>
+
X /*
X * We provide a unified keyboard interface when in VC_MEDIUMRAW
X * mode. This means that all keycodes must be common between
@@ -21,13 +24,48 @@


X */
X #ifdef __KERNEL__

X
-#include <asm/arch/keyboard.h>
+extern int (*k_setkeycode)(unsigned int, unsigned int);
+extern int (*k_getkeycode)(unsigned int);
+extern int (*k_translate)(unsigned char, unsigned char *, char);
+extern char (*k_unexpected_up)(unsigned char);
+extern void (*k_leds)(unsigned char);
+
+
+static inline int kbd_setkeycode(unsigned int sc, unsigned int kc)
+{
+ int ret = -EINVAL;
+
+ if (k_setkeycode)
+ ret = k_setkeycode(sc, kc);


+
+ return ret;
+}

X
-#ifndef kbd_rate
-struct kbd_repeat;
+static inline int kbd_getkeycode(unsigned int sc)
+{
+ int ret = -EINVAL;
X
-extern int kbd_rate(struct kbd_repeat *rate) __attribute__((weak));
-#endif
+ if (k_getkeycode)
+ ret = k_getkeycode(sc);


+
+ return ret;
+}
+

+static inline void kbd_leds(unsigned char leds)
+{
+ if (k_leds)
+ k_leds(leds);
+}
+
+extern int k_sysrq_key;
+extern unsigned char *k_sysrq_xlate;
+
+#define SYSRQ_KEY k_sysrq_key
+#define kbd_sysrq_xlate k_sysrq_xlate
+#define kbd_translate k_translate
+#define kbd_unexpected_up k_unexpected_up
+
+#include <asm/arch/keyboard.h>
X

X #endif /* __KERNEL__ */

X
diff -u --recursive --new-file v2.4.13/linux/include/asm-arm/proc-armv/cache.h linux/include/asm-arm/proc-armv/cache.h
--- v2.4.13/linux/include/asm-arm/proc-armv/cache.h Mon Aug 27 12:41:47 2001


SHAR_EOF
true || echo 'restore of patch-2.4.14 failed'
fi

echo 'End of part 49'
echo 'File patch-2.4.14 is continued in part 50'
echo "50" > _shar_seq_.tmp
exit 0

0 new messages