Linux Kernel Patch v2.3, patch-2.3.10 (00/37)

6 views
Skip to first unread message

Thomas Kobienia

unread,
Jul 9, 1999, 3:00:00 AM7/9/99
to
Archive-name: v2.3/patch-2.3.10/part00

lines added deleted
linux/CREDITS : 60 25 7
linux/Documentation/Changes : 12 0 6
linux/Documentation/Configure.help : 673 355 61
linux/Documentation/SMP.txt : 8 1 1
linux/Documentation/cpqarray.txt : 107 107 0
linux/Documentation/fb/tgafb.txt : 51 51 0
linux/Documentation/java.txt : 365 295 34
linux/Documentation/kernel-parameters.txt : 8 1 1
linux/Documentation/networking/arcnet-hardware.txt : 167 27 27
linux/Documentation/networking/arcnet.txt : 141 18 19
linux/Documentation/networking/baycom.txt : 21 3 3
linux/Documentation/networking/cs89x0.txt : 58 9 9
linux/Documentation/networking/olympic.txt : 75 75 0
linux/Documentation/networking/policy-routing.txt : 8 1 1
linux/Documentation/networking/z8530drv.txt : 8 1 1
linux/Documentation/oops-tracing.txt : 35 10 10
linux/Documentation/parport.txt : 150 75 35
linux/Documentation/pcwd-watchdog.txt : 25 6 3
linux/Documentation/sound/Introduction : 263 142 17
linux/Documentation/sound/OPL3-SA2 : 21 15 0
linux/Documentation/sysctl/README : 5 1 1
linux/Documentation/sysctl/fs.txt : 5 1 1
linux/Documentation/sysctl/kernel.txt : 32 15 6
linux/Documentation/sysctl/sunrpc.txt : 5 1 1
linux/Documentation/sysctl/vm.txt : 5 1 1
linux/Documentation/video4linux/API.html : 60 24 4
linux/Documentation/video4linux/README.buz : 212 212 0
linux/Documentation/video4linux/bttv/PROBLEMS : 31 7 7
linux/Documentation/video4linux/bttv/README.RADIO : 8 1 1
linux/Documentation/video4linux/bttv/THANKS : 8 1 1
linux/MAINTAINERS : 106 42 9
linux/Makefile : 25 2 4
linux/README : 21 4 4
linux/arch/alpha/config.in : 14 1 7
linux/arch/alpha/kernel/ptrace.c : 292 20 243
linux/arch/alpha/kernel/signal.c : 7 0 1
linux/arch/alpha/kernel/smp.c : 8 1 1
linux/arch/arm/kernel/process.c : 9 0 2
linux/arch/arm/kernel/time.c : 8 0 2
linux/arch/arm/nwfpe/fpmodule.c : 7 0 1
linux/arch/i386/boot/setup.S : 33 14 4
linux/arch/i386/config.in : 14 1 7
linux/arch/i386/defconfig : 65 21 7
linux/arch/i386/kernel/irq.h : 8 1 1
linux/arch/i386/kernel/process.c : 9 0 2
linux/arch/i386/kernel/ptrace.c : 238 10 207
linux/arch/i386/kernel/setup.c : 44 11 12
linux/arch/i386/kernel/smp.c : 8 1 1
linux/arch/i386/math-emu/fpu_emu.h : 8 0 2
linux/arch/i386/mm/fault.c : 39 16 3
linux/arch/mips/boot/elf2ecoff.c : 7 0 1
linux/arch/mips/config.in : 8 1 1
linux/arch/mips/defconfig : 11 0 5
linux/arch/mips/kernel/irixioctl.c : 29 9 8
linux/arch/mips/kernel/ptrace.c : 255 11 220
linux/arch/mips/kernel/r4k_misc.S : 7 0 1
linux/arch/mips/kernel/setup.c : 7 0 1
linux/arch/mips/mm/fault.c : 94 44 7
linux/arch/mips/sgi/kernel/indy_sc.c : 7 0 1
linux/arch/ppc/amiga/amiints.c : 8 1 1
linux/arch/ppc/amiga/config.c : 7 0 1
linux/arch/ppc/config.in : 14 1 7
linux/arch/ppc/kernel/irq.c : 7 0 1
linux/arch/ppc/kernel/pci.c : 7 0 1
linux/arch/ppc/kernel/ppc-stub.c : 7 0 1
linux/arch/ppc/kernel/prep_setup.c : 7 0 1
linux/arch/ppc/kernel/process.c : 7 0 1
linux/arch/ppc/kernel/setup.c : 7 0 1
linux/arch/ppc/kernel/smp.c : 8 1 1
linux/arch/sparc/ap1000/aplib.c : 7 0 1
linux/arch/sparc/kernel/pcic.c : 15 0 2
linux/arch/sparc/kernel/process.c : 7 0 1
linux/arch/sparc/kernel/ptrace.c : 334 27 271
linux/arch/sparc/kernel/sparc-stub.c : 7 0 1
linux/arch/sparc/kernel/sparc_ksyms.c : 7 0 1
linux/arch/sparc/kernel/sun4d_smp.c : 8 1 1
linux/arch/sparc/kernel/sun4m_smp.c : 8 1 1
linux/arch/sparc/kernel/sunos_ioctl.c : 12 1 2
linux/arch/sparc/kernel/sys_sunos.c : 7 0 1
linux/arch/sparc/mm/asyncd.c : 5 1 1
linux/arch/sparc/mm/fault.c : 13 1 2
linux/arch/sparc/mm/srmmu.c : 15 2 0
linux/arch/sparc/mm/sun4c.c : 19 4 1
linux/arch/sparc64/config.in : 45 13 15
linux/arch/sparc64/defconfig : 29 11 3
linux/arch/sparc64/kernel/binfmt_aout32.c : 27 4 1
linux/arch/sparc64/kernel/ioctl32.c : 20 4 2
linux/arch/sparc64/kernel/psycho.c : 48 8 6
linux/arch/sparc64/kernel/ptrace.c : 656 55 541
linux/arch/sparc64/kernel/smp.c : 8 1 1
linux/arch/sparc64/kernel/sparc64_ksyms.c : 37 11 2
linux/arch/sparc64/kernel/sys_sparc32.c : 37 2 6
linux/arch/sparc64/kernel/sys_sunos32.c : 16 1 2
linux/arch/sparc64/lib/Makefile : 15 3 2
linux/arch/sparc64/lib/atomic.S : 32 32 0
linux/arch/sparc64/lib/rwlock.S : 81 81 0
linux/arch/sparc64/mm/asyncd.c : 5 1 1
linux/arch/sparc64/mm/fault.c : 5 1 1
linux/arch/sparc64/solaris/ioctl.c : 69 7 15
linux/arch/sparc64/solaris/socksys.c : 7 0 1
linux/drivers/acorn/char/keyb_arc.c : 7 0 1
linux/drivers/ap1000/bif.c : 7 0 1
linux/drivers/ap1000/ringbuf.c : 7 1 0
linux/drivers/block/Config.in : 112 47 28
linux/drivers/block/Makefile : 25 10 2
linux/drivers/block/alim15x3.c : 114 66 5
linux/drivers/block/amiflop.c : 24 3 3
linux/drivers/block/ataflop.c : 44 5 5
linux/drivers/block/cmd646.c : 32 6 2
linux/drivers/block/cpqarray.c : 1730 1730 0
linux/drivers/block/cpqarray.h : 120 120 0
linux/drivers/block/floppy.c : 71 8 8
linux/drivers/block/genhd.c : 340 114 29
linux/drivers/block/hd.c : 17 2 2
linux/drivers/block/hpt343.c : 392 0 392
linux/drivers/block/hpt34x.c : 408 408 0
linux/drivers/block/icside.c : 17 4 0
linux/drivers/block/ida_cmd.h : 347 347 0
linux/drivers/block/ida_ioctl.h : 83 83 0
linux/drivers/block/ide-disk.c : 11 3 2
linux/drivers/block/ide-dma.c : 99 13 13
linux/drivers/block/ide-pci.c : 101 26 20
linux/drivers/block/ide-probe.c : 32 9 4
linux/drivers/block/ide-tape.c : 185 31 18
linux/drivers/block/ide.c : 111 42 7
linux/drivers/block/ll_rw_blk.c : 33 12 1
linux/drivers/block/loop.c : 51 13 4
linux/drivers/block/nbd.c : 8 1 1
linux/drivers/block/pdc202xx.c : 78 3 15
linux/drivers/block/piix.c : 98 21 10
linux/drivers/block/smart1,2.h : 274 274 0
linux/drivers/cdrom/aztcd.c : 17 2 2
linux/drivers/cdrom/cdu31a.c : 35 6 6
linux/drivers/cdrom/cm206.c : 44 5 5
linux/drivers/cdrom/gscd.c : 44 5 5
linux/drivers/cdrom/isp16.c : 65 12 12
linux/drivers/cdrom/mcd.c : 18 2 3
linux/drivers/cdrom/mcdx.c : 26 3 3
linux/drivers/cdrom/optcd.c : 26 3 3
linux/drivers/cdrom/sbpcd.c : 74 9 9
linux/drivers/cdrom/sjcd.c : 17 2 2
linux/drivers/cdrom/sonycd535.c : 21 4 4
linux/drivers/char/Config.in : 55 14 3
linux/drivers/char/Makefile : 75 48 0
linux/drivers/char/acquirewdt.c : 8 1 1
linux/drivers/char/adbmouse.c : 35 2 5
linux/drivers/char/amigamouse.c : 16 1 2
linux/drivers/char/amikeyb.c : 16 2 2
linux/drivers/char/atarimouse.c : 17 2 2
linux/drivers/char/atixlmouse.c : 8 1 1
linux/drivers/char/bttv.c : 625 183 133
linux/drivers/char/bttv.h : 20 3 3
linux/drivers/char/busmouse.c : 17 2 2
linux/drivers/char/buz.c : 3478 3478 0
linux/drivers/char/buz.h : 319 319 0
linux/drivers/char/bw-qcam.c : 17 3 1
linux/drivers/char/c-qcam.c : 132 39 24
linux/drivers/char/chipsets.h : 41 41 0
linux/drivers/char/console.c : 8 1 1
linux/drivers/char/consolemap.c : 10 2 2
linux/drivers/char/cyclades.c : 767 387 63
linux/drivers/char/dn_keyb.c : 8 1 1
linux/drivers/char/dsp56k.c : 9 1 2
linux/drivers/char/dz.c : 34 5 6
linux/drivers/char/esp.c : 16 1 2
linux/drivers/char/ftape/lowlevel/ftape-init.c : 8 1 1
linux/drivers/char/ftape/lowlevel/ftape-proc.c : 16 2 1
linux/drivers/char/ftape/lowlevel/ftape-setup.c : 8 1 1
linux/drivers/char/ftape/zftape/zftape-init.c : 8 1 1
linux/drivers/char/hfmodem/main.c : 70 7 8
linux/drivers/char/hfmodem/refclock.c : 17 2 2
linux/drivers/char/i2c-parport.c : 9 0 2
linux/drivers/char/i2c.c : 29 16 0
linux/drivers/char/joystick/joy-db9.c : 8 1 1
linux/drivers/char/lp.c : 1105 367 492
linux/drivers/char/lp_intern.c : 7 0 1
linux/drivers/char/n_hdlc.c : 7 0 1
linux/drivers/char/pc_keyb.c : 7 0 1
linux/drivers/char/pcwd.c : 136 50 9
linux/drivers/char/ppdev.c : 548 548 0
linux/drivers/char/ppdev.h : 65 65 0
linux/drivers/char/radio-aimslab.c : 8 1 1
linux/drivers/char/radio-aztech.c : 8 1 1
linux/drivers/char/radio-cadet.c : 37 4 8
linux/drivers/char/radio-gemtek.c : 26 3 3
linux/drivers/char/radio-miropcm20.c : 8 1 1
linux/drivers/char/radio-rtrack2.c : 8 1 1
linux/drivers/char/radio-sf16fmi.c : 8 1 1
linux/drivers/char/radio-terratec.c : 353 353 0
linux/drivers/char/radio-zoltrix.c : 8 1 1
linux/drivers/char/rocket.c : 31 1 4
linux/drivers/char/saa7111.c : 421 421 0
linux/drivers/char/saa7185.c : 379 379 0
linux/drivers/char/serial.c : 7 0 1
linux/drivers/char/sysrq.c : 49 10 12
linux/drivers/char/tpqic02.c : 26 3 3
linux/drivers/char/tty_io.c : 101 19 10
linux/drivers/char/videodev.c : 48 18 0
linux/drivers/char/zr36057.h : 168 168 0
linux/drivers/char/zr36060.h : 35 35 0
linux/drivers/fc4/socal.c : 7 0 1
linux/drivers/i2o/README : 47 14 6
linux/drivers/i2o/README.lan : 32 4 4
linux/drivers/i2o/i2o_block.c : 97 12 14
linux/drivers/i2o/i2o_config.c : 252 141 6
linux/drivers/i2o/i2o_core.c : 1730 662 618
linux/drivers/i2o/i2o_lan.c : 953 321 231
linux/drivers/i2o/i2o_lan.h : 45 8 8
linux/drivers/i2o/i2o_pci.c : 42 13 2
linux/drivers/i2o/i2o_proc.c : 2780 1414 695
linux/drivers/i2o/i2o_proc.h : 111 1 106
linux/drivers/i2o/i2o_scsi.c : 299 87 54
linux/drivers/isdn/avmb1/capidrv.c : 15 2 1
linux/drivers/isdn/hisax/amd7930.c : 10 2 2
linux/drivers/isdn/hisax/asuscom.c : 10 2 2
linux/drivers/isdn/hisax/avm_a1.c : 10 2 2
linux/drivers/isdn/hisax/config.c : 21 4 4
linux/drivers/isdn/hisax/diva.c : 10 2 2
linux/drivers/isdn/hisax/foreign.c : 10 2 2
linux/drivers/isdn/hisax/hfc_2bds0.c : 21 4 4
linux/drivers/isdn/hisax/hfc_2bs0.c : 21 4 4
linux/drivers/isdn/hisax/ix1_micro.c : 10 2 2
linux/drivers/isdn/hisax/mic.c : 10 2 2
linux/drivers/isdn/hisax/netjet.c : 21 4 4
linux/drivers/isdn/hisax/niccy.c : 10 2 2
linux/drivers/isdn/hisax/sedlbauer.c : 10 2 2
linux/drivers/isdn/hisax/sportster.c : 21 4 4
linux/drivers/isdn/hisax/teleint.c : 10 2 2
linux/drivers/isdn/hisax/teles0.c : 10 2 2
linux/drivers/isdn/hisax/teles3.c : 10 2 2
linux/drivers/isdn/hisax/teles3c.c : 10 2 2
linux/drivers/isdn/isdn_bsdcomp.c : 7 0 1
linux/drivers/macintosh/macserial.c : 7 0 1
linux/drivers/misc/Config.in : 37 37 0
linux/drivers/misc/Makefile : 26 11 2
linux/drivers/misc/parport_arc.c : 87 24 32
linux/drivers/misc/parport_atari.c : 9 0 3
linux/drivers/misc/parport_ax.c : 201 55 82
linux/drivers/misc/parport_daisy.c : 473 473 0
linux/drivers/misc/parport_ieee1284.c : 555 489 35
linux/drivers/misc/parport_ieee1284_ops.c : 848 848 0
linux/drivers/misc/parport_init.c : 65 33 7
linux/drivers/misc/parport_pc.c : 2008 1162 396
linux/drivers/misc/parport_probe.c : 212 212 0
linux/drivers/misc/parport_procfs.c : 59 8 12
linux/drivers/misc/parport_share.c : 374 99 80
linux/drivers/net/3c501.c : 17 2 2
linux/drivers/net/3c503.c : 32 6 6
linux/drivers/net/3c505.c : 26 3 3
linux/drivers/net/3c507.c : 17 2 2
linux/drivers/net/3c523.c : 17 2 2
linux/drivers/net/3c527.c : 17 2 2
linux/drivers/net/82596.c : 8 1 1
linux/drivers/net/Config.in : 188 54 17
linux/drivers/net/Makefile : 80 37 9
linux/drivers/net/Space.c : 62 11 3
linux/drivers/net/a2065.c : 9 1 2
linux/drivers/net/ac3200.c : 17 2 2
linux/drivers/net/acenic.c : 44 5 5
linux/drivers/net/apne.c : 18 2 3
linux/drivers/net/arc-rimi.c : 35 4 4
linux/drivers/net/arcnet.c : 44 11 5
linux/drivers/net/ariadne.c : 8 1 1
linux/drivers/net/ariadne2.c : 20 3 4
linux/drivers/net/arlan-proc.c : 1059 1059 0
linux/drivers/net/arlan.c : 2079 2079 0
linux/drivers/net/arlan.h : 575 574 0
linux/drivers/net/atari_bionet.c : 10 2 2
linux/drivers/net/atari_pamsnet.c : 10 2 2
linux/drivers/net/atarilance.c : 40 10 10
linux/drivers/net/atp.c : 37 5 5
linux/drivers/net/com20020.c : 35 4 4
linux/drivers/net/com90io.c : 35 4 4
linux/drivers/net/com90xx.c : 44 5 5
linux/drivers/net/cops.c : 26 3 3
linux/drivers/net/cosa.c : 8 1 1
linux/drivers/net/cs89x0.c : 65 11 13
linux/drivers/net/de4x5.c : 144 21 28
linux/drivers/net/de600.c : 10 2 2
linux/drivers/net/de620.c : 32 6 6
linux/drivers/net/defxx.c : 70 10 26
linux/drivers/net/depca.c : 133 24 26
linux/drivers/net/dgrs.c : 72 12 12
linux/drivers/net/dlci.c : 8 1 1
linux/drivers/net/dummy.c : 17 2 2
linux/drivers/net/e2100.c : 17 2 2
linux/drivers/net/eepro100.c : 18 3 2
linux/drivers/net/eexpress.c : 28 4 4
linux/drivers/net/eql.c : 103 10 16
linux/drivers/net/es3210.c : 17 2 2
linux/drivers/net/eth16i.c : 26 3 3
linux/drivers/net/ethertap.c : 8 1 1
linux/drivers/net/ewrk3.c : 256 49 50
linux/drivers/net/fmv18x.c : 19 3 3
linux/drivers/net/hamradio/6pack.c : 8 1 1
linux/drivers/net/hamradio/baycom_par.c : 26 3 3
linux/drivers/net/hamradio/baycom_ser_fdx.c : 26 3 3
linux/drivers/net/hamradio/baycom_ser_hdx.c : 26 3 3
linux/drivers/net/hamradio/bpqether.c : 8 1 1
linux/drivers/net/hamradio/dmascc.c : 27 3 4
linux/drivers/net/hamradio/hdlcdrv.c : 16 1 2
linux/drivers/net/hamradio/mkiss.c : 17 2 2
linux/drivers/net/hamradio/pi2.c : 17 2 2
linux/drivers/net/hamradio/pt.c : 18 2 3
linux/drivers/net/hamradio/scc.c : 8 1 1
linux/drivers/net/hamradio/soundmodem/sm.c : 29 4 4
linux/drivers/net/hamradio/soundmodem/sm.h : 8 0 2
linux/drivers/net/hostess_sv11.c : 9 2 1
linux/drivers/net/hp-plus.c : 17 2 2
linux/drivers/net/hp.c : 17 2 2
linux/drivers/net/hp100.c : 28 4 3
linux/drivers/net/hplance.c : 17 2 2
linux/drivers/net/hydra.c : 8 1 1
linux/drivers/net/ibmtr.c : 74 7 9
linux/drivers/net/irda/actisys.c : 8 1 1
linux/drivers/net/irda/esi.c : 8 1 1
linux/drivers/net/irda/girbil.c : 8 1 1
linux/drivers/net/irda/irport.c : 8 1 1
linux/drivers/net/irda/irtty.c : 8 1 1
linux/drivers/net/irda/litelink.c : 8 1 1
linux/drivers/net/irda/pc87108.c : 8 1 1
linux/drivers/net/irda/smc-ircc.c : 17 1 3
linux/drivers/net/irda/tekram.c : 8 1 1
linux/drivers/net/irda/toshoboe.c : 22 3 3
linux/drivers/net/irda/uircc.c : 17 1 3
linux/drivers/net/irda/w83977af_ir.c : 8 1 1
linux/drivers/net/lance.c : 17 3 1
linux/drivers/net/lne390.c : 17 2 2
linux/drivers/net/loopback.c : 8 1 1
linux/drivers/net/ltpc.c : 26 3 3
linux/drivers/net/myri_sbus.c : 8 1 1
linux/drivers/net/ne.c : 26 3 3
linux/drivers/net/ne2.c : 18 2 3
linux/drivers/net/ne2k-pci.c : 346 97 86
linux/drivers/net/ne3210.c : 17 2 2
linux/drivers/net/olympic.c : 1663 1663 0
linux/drivers/net/olympic.h : 303 303 0
linux/drivers/net/ppp.c : 7 0 1
linux/drivers/net/rtl8139.c : 368 105 52
linux/drivers/net/sealevel.c : 471 471 0
linux/drivers/net/seeq8005.c : 74 51 3
linux/drivers/net/slhc.c : 7 0 1
linux/drivers/net/sunbmac.c : 7 0 1
linux/drivers/net/sunhme.c : 8 1 1
linux/drivers/net/sunlance.c : 7 0 1
linux/drivers/net/tulip.c : 68 16 5
linux/drivers/net/via-rhine.c : 86 11 10
linux/drivers/net/wavelan.c : 184 36 56
linux/drivers/net/z85230.c : 71 16 2
linux/drivers/net/zlib.c : 10 0 4
linux/drivers/pci/oldproc.c : 56 7 1
linux/drivers/pci/pci.c : 59 14 4
linux/drivers/pnp/Config.in : 16 0 13
linux/drivers/pnp/Makefile : 24 0 12
linux/drivers/pnp/parport_probe.c : 288 0 288
linux/drivers/sbus/char/bpp.c : 20 2 3
linux/drivers/sbus/char/sab82532.c : 22 2 3
linux/drivers/sbus/char/su.c : 22 2 3
linux/drivers/sbus/sbus.c : 7 0 1
linux/drivers/scsi/53c7xx.c : 26 1 3
linux/drivers/scsi/NCR53C9x.c : 27 5 0
linux/drivers/scsi/aha152x.c : 5441 2452 2285
linux/drivers/scsi/aic7xxx/aic7xxx.reg : 8 1 1
linux/drivers/scsi/aic7xxx.c : 308 88 70
linux/drivers/scsi/aic7xxx_reg.h : 12 1 1
linux/drivers/scsi/atp870u.c : 37 8 1
linux/drivers/scsi/constants.c : 148 45 20
linux/drivers/scsi/i60uscsi.c : 14 3 3
linux/drivers/scsi/ide-scsi.c : 38 10 5
linux/drivers/scsi/ini9100u.c : 64 5 22
linux/drivers/scsi/inia100.c : 58 5 17
linux/drivers/scsi/megaraid.c : 9 0 2
linux/drivers/scsi/mvme16x.c : 7 0 1
linux/drivers/scsi/ncr53c8xx.c : 8 1 1
linux/drivers/scsi/pas16.c : 6 0 1
linux/drivers/scsi/ppa.c : 17 3 3
linux/drivers/scsi/qlogicfc.c : 1001 275 143
linux/drivers/scsi/qlogicfc.h : 39 14 5
linux/drivers/scsi/qlogicisp.c : 10 2 0
linux/drivers/scsi/scsi_debug.c : 10 0 4
linux/drivers/scsi/sd.c : 7 1 0
linux/drivers/scsi/st.c : 8 1 1
linux/drivers/scsi/sym53c416.c : 84 18 1
linux/drivers/sgi/char/graphics.c : 9 1 2
linux/drivers/sgi/char/shmiq.c : 9 1 2
linux/drivers/sgi/char/usema.c : 10 2 2
linux/drivers/sound/cmpci.c : 17 0 3
linux/drivers/sound/dev_table.h : 56 8 18
linux/drivers/sound/es1370.c : 11 2 2
linux/drivers/sound/es1371.c : 11 2 2
linux/drivers/sound/lowlevel/awe_compat-fbsd.h : 7 0 1
linux/drivers/sound/maui.c : 14 5 2
linux/drivers/sound/msnd_pinnacle.c : 110 13 13
linux/drivers/sound/opl3sa2.c : 34 6 3
linux/drivers/sound/sb_ess.c : 1438 615 420
linux/drivers/sound/sb_mixer.c : 52 31 7
linux/drivers/sound/sb_mixer.h : 11 5 0
linux/drivers/sound/sgalaxy.c : 8 1 1
linux/drivers/sound/sonicvibes.c : 11 2 2
linux/drivers/sound/sound_calls.h : 57 23 5
linux/drivers/sound/sound_syms.c : 17 4 0
linux/drivers/sound/trix.c : 33 9 4
linux/drivers/sound/wavfront.c : 73 6 12
linux/drivers/sound/wf_midi.c : 18 2 3
linux/drivers/usb/CREDITS : 8 1 1
linux/drivers/usb/hub.h : 16 2 1
linux/drivers/usb/ohci-debug.c : 21 3 4
linux/drivers/usb/ohci.c : 208 64 22
linux/drivers/usb/ohci.h : 7 0 1
linux/drivers/usb/printer.c : 28 6 2
linux/drivers/usb/uhci.c : 74 18 9
linux/drivers/usb/uhci.h : 18 6 6
linux/drivers/usb/usb.c : 65 20 9
linux/drivers/usb/usb.h : 123 43 12
linux/drivers/video/Makefile : 11 2 0
linux/drivers/video/fbmem.c : 16 2 1
linux/drivers/video/tgafb.c : 1551 695 593
linux/drivers/video/tgafb.h : 190 190 0
linux/fs/binfmt_aout.c : 9 2 1
linux/fs/binfmt_elf.c : 8 2 0
linux/fs/coda/cache.c : 9 1 1
linux/fs/coda/cnode.c : 49 19 10
linux/fs/coda/coda_linux.c : 8 2 0
linux/fs/coda/dir.c : 20 4 4
linux/fs/coda/inode.c : 99 23 13
linux/fs/coda/sysctl.c : 122 36 14
linux/fs/coda/upcall.c : 71 44 4
linux/fs/devices.c : 15 2 0
linux/fs/dquot.c : 70 13 8
linux/fs/exec.c : 39 7 3
linux/fs/ext2/ioctl.c : 58 23 15
linux/fs/fat/dir.c : 44 9 3
linux/fs/fat/mmap.c : 9 1 2
linux/fs/fcntl.c : 109 26 26
linux/fs/fifo.c : 7 1 0
linux/fs/file_table.c : 192 87 45
linux/fs/inode.c : 48 2 26
linux/fs/ioctl.c : 31 4 2
linux/fs/locks.c : 157 40 47
linux/fs/minix/file.c : 15 0 2
linux/fs/namei.c : 25 7 3
linux/fs/ncpfs/dir.c : 7 0 1
linux/fs/ncpfs/mmap.c : 9 1 2
linux/fs/nfs/read.c : 11 3 2
linux/fs/nfs/write.c : 15 1 1
linux/fs/nfsd/nfsctl.c : 7 0 1
linux/fs/nfsd/vfs.c : 8 1 1
linux/fs/open.c : 242 39 35
linux/fs/pipe.c : 29 5 1
linux/fs/proc/fd.c : 29 3 4
linux/fs/proc/inode.c : 59 22 2
linux/fs/proc/link.c : 24 7 0
linux/fs/proc/root.c : 52 28 16
linux/fs/qnx4/dir.c : 11 5 0
linux/fs/qnx4/symlinks.c : 14 2 2
linux/fs/select.c : 26 7 5
linux/fs/super.c : 7 1 0
linux/fs/sysv/file.c : 9 0 3
linux/fs/ufs/balloc.c : 29 15 7
linux/fs/ufs/super.c : 9 2 1
linux/fs/umsdos/file.c : 7 0 1
linux/include/asm-i386/bugs.h : 22 0 16
linux/include/asm-i386/setup.h : 4 4 0
linux/include/asm-mips/processor.h : 9 0 3
linux/include/asm-mips/ptrace.h : 8 1 1
linux/include/asm-sparc/asm_offsets.h : 135 44 40
linux/include/asm-sparc/audioio.h : 7 0 1
linux/include/asm-sparc/page.h : 13 1 2
linux/include/asm-sparc64/asm_offsets.h : 212 69 63
linux/include/asm-sparc64/atomic.h : 100 29 61
linux/include/asm-sparc64/audioio.h : 7 0 1
linux/include/asm-sparc64/spinlock.h : 135 37 83
linux/include/linux/blk.h : 33 19 1
linux/include/linux/coda.h : 167 44 27
linux/include/linux/coda_proc.h : 7 1 0
linux/include/linux/coda_psdev.h : 7 1 0
linux/include/linux/cyclades.h : 8 1 1
linux/include/linux/file.h : 66 20 10
linux/include/linux/fs.h : 130 30 24
linux/include/linux/i2c.h : 19 6 4
linux/include/linux/i2o.h : 229 124 34
linux/include/linux/ide.h : 23 3 0
linux/include/linux/isdn.h : 9 0 3
linux/include/linux/isdn_timru.h : 119 0 119
linux/include/linux/lp.h : 54 10 9
linux/include/linux/major.h : 21 13 0
linux/include/linux/mm.h : 19 4 2
linux/include/linux/mount.h : 8 1 1
linux/include/linux/parport.h : 580 248 143
linux/include/linux/parport_pc.h : 222 82 83
linux/include/linux/pci.h : 86 17 0
linux/include/linux/proc_fs.h : 26 7 6
linux/include/linux/sched.h : 24 3 1
linux/include/linux/soundcard.h : 12 6 0
linux/include/linux/swap.h : 9 0 3
linux/include/linux/tty.h : 7 1 0
linux/include/linux/video_decoder.h : 37 37 0
linux/include/linux/video_encoder.h : 21 21 0
linux/include/linux/videodev.h : 7 1 0
linux/include/net/irda/irmod.h : 8 1 1
linux/include/net/sock.h : 73 1 45
linux/include/net/tcp.h : 93 5 47
linux/include/net/udp.h : 27 13 1
linux/init/main.c : 19 6 0
linux/ipc/shm.c : 41 5 2
linux/kernel/Makefile : 8 1 1
linux/kernel/acct.c : 8 1 1
linux/kernel/exit.c : 25 3 6
linux/kernel/fork.c : 71 13 8
linux/kernel/ksyms.c : 27 4 2
linux/kernel/ptrace.c : 163 163 0
linux/kernel/sched.c : 17 2 2
linux/kernel/signal.c : 67 9 7
linux/kernel/sys.c : 8 2 0
linux/kernel/sysctl.c : 7 0 1
linux/lib/string.c : 17 14 0
linux/mm/filemap.c : 105 5 19
linux/mm/memory.c : 431 162 94
linux/mm/mlock.c : 71 2 10
linux/mm/mmap.c : 100 12 12
linux/mm/mprotect.c : 33 2 4
linux/mm/mremap.c : 48 7 6
linux/mm/page_alloc.c : 90 0 87
linux/mm/vmscan.c : 71 13 4
linux/net/appletalk/ddp.c : 26 5 1
linux/net/ax25/af_ax25.c : 9 3 0
linux/net/bridge/br.c : 12 0 4
linux/net/core/scm.c : 23 4 5
linux/net/decnet/dn_fib.c : 7 0 1
linux/net/econet/econet.c : 9 2 1
linux/net/ipv4/af_inet.c : 271 56 55
linux/net/ipv4/icmp.c : 7 0 1
linux/net/ipv4/proc.c : 198 1 184
linux/net/ipv4/raw.c : 165 77 47
linux/net/ipv4/tcp.c : 8 1 1
linux/net/ipv4/tcp_input.c : 58 13 14
linux/net/ipv4/tcp_ipv4.c : 633 352 162
linux/net/ipv4/tcp_timer.c : 70 2 41
linux/net/ipv4/udp.c : 394 144 151
linux/net/ipv6/af_inet6.c : 76 9 14
linux/net/ipv6/ip6_fw.c : 15 3 4
linux/net/ipv6/proc.c : 149 1 135
linux/net/ipv6/raw.c : 182 88 49
linux/net/ipv6/route.c : 7 0 1
linux/net/ipv6/tcp_ipv6.c : 484 297 111
linux/net/ipv6/udp.c : 332 158 89
linux/net/ipx/af_ipx.c : 9 2 1
linux/net/irda/compressors/irda_deflate.c : 7 0 1
linux/net/irda/irmod.c : 8 2 0
linux/net/netrom/af_netrom.c : 19 5 1
linux/net/netsyms.c : 93 10 13
linux/net/rose/af_rose.c : 19 5 1
linux/net/socket.c : 8 1 1
linux/net/sunrpc/xprt.c : 51 1 37
linux/net/unix/af_unix.c : 7 0 1
linux/net/unix/garbage.c : 8 1 1
linux/net/wanrouter/wanproc.c : 41 12 6
linux/net/x25/af_x25.c : 7 0 1
linux/net/x25/x25_dev.c : 7 0 1
linux/scripts/ksymoops/Makefile : 79 0 79
linux/scripts/ksymoops/README : 405 6 398
linux/scripts/ksymoops/io.c : 139 0 139
linux/scripts/ksymoops/ksymoops.c : 678 0 678
linux/scripts/ksymoops/ksymoops.h : 146 0 146
linux/scripts/ksymoops/ksyms.c : 294 0 294
linux/scripts/ksymoops/map.c : 251 0 251
linux/scripts/ksymoops/misc.c : 108 0 108
linux/scripts/ksymoops/object.c : 230 0 230
linux/scripts/ksymoops/oops.c : 1377 0 1377
linux/scripts/ksymoops/re.c : 145 0 145
linux/scripts/ksymoops/symbol.c : 444 0 444
linux/scripts/ver_linux : 15 5 3

Thomas Kobienia

unread,
Jul 9, 1999, 3:00:00 AM7/9/99
to
Archive-name: v2.3/patch-2.3.10/part01

#!/bin/sh
# 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 37 - 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.3.10 ==============
if test -f 'patch-2.3.10' -a X"$1" != X"-c"; then
echo 'x - skipping patch-2.3.10 (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting patch-2.3.10 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'patch-2.3.10' &&
diff -u --recursive --new-file v2.3.9/linux/CREDITS linux/CREDITS
--- v2.3.9/linux/CREDITS Wed Jun 30 13:38:18 1999
+++ linux/CREDITS Tue Jul 6 10:19:57 1999
@@ -163,7 +163,7 @@
X D: Various bugfixes and changes to sound drivers
X S: USA
X
-M: Krzysztof G. Baranowski
+N: Krzysztof G. Baranowski
X E: k...@manjak.knm.org.pl
X P: 1024/FA6F16D1 96 D1 1A CF 5F CA 69 EC F9 4F 36 1F 6D 60 7B DA
X D: Maintainer of the System V file system.
@@ -174,6 +174,17 @@
X S: 62-300 Wrzesnia
X S: Poland
X
+N: Carlos Henrique Bauer
+E: chb...@acm.org
+E: ba...@atlas.unisinos.tche.br
+D: A test for detection of EPP-1.7 and ECP/EPP parports.
+D: Some new sysctl entries for the parport driver.
+S: Universidade do Vale do Rio dos Sinos - UNISINOS
+S: DSI/IDASI
+S: Av. Unisinos, 950
+S: 93022000 Sao Leopoldo RS
+S: Brazil
+
X N: Peter Bauer
X E: 10013...@compuserve.com
X D: Driver for depca-ethernet-board
@@ -869,13 +880,11 @@
X S: 65760 Eschborn
X S: Germany
X
-N: Kenji Tsutomu Hollis
-E: kho...@bitgate.com
-W: http://www.nurk.org/
+N: Kenji Hollis
+E: ke...@bitgate.com
+W: http://www.bitgate.com/
X D: Berkshire PC Watchdog Driver
-S: Post Office Box 15
-S: Grants Pass, Oregon 97526
-S: USA
+D: Small/Industrial Driver Project
X
X N: Nick Holloway
X E: Nick.H...@alfie.demon.co.uk
@@ -1660,6 +1669,15 @@
X S: 4390 Albany Drive #41A
X S: San Jose, California 95129
X S: USA
+
+N: Augusto Cesar Radtke
+E: bis...@sekure.org
+W: http://bishop.sekure.org
+D: {copy,get,put}_user calls updates
+D: Miscellaneous hacks
+S: R. Otto Marquardt, 226 - Garcia
+S: 89020-350 Blumenau - Santa Catarina
+S: Brazil
X
X N: Eric S. Raymond
X E: e...@thyrsus.com
diff -u --recursive --new-file v2.3.9/linux/Documentation/Changes linux/Documentation/Changes
--- v2.3.9/linux/Documentation/Changes Fri May 7 09:31:25 1999
+++ linux/Documentation/Changes Thu Jul 1 10:54:31 1999
@@ -191,12 +191,6 @@
X users should especially try to use the 2.9.1.0.x releases, as they
X resolve known issues with glibc2 and binutils-2.8.x releases.
X
- libbfd, libiberty, and /usr/include/bfd.h, which are part of recent
-binutils packages, are also required to compile ksymoops. Depending
-upon your distribution, this may require you to install both binutils
-and binutils-development packages (Debian puts bfd.h in binutils-dev,
-for example).
-
X Gnu C
X =====
X
diff -u --recursive --new-file v2.3.9/linux/Documentation/Configure.help linux/Documentation/Configure.help
--- v2.3.9/linux/Documentation/Configure.help Wed Jun 30 13:38:18 1999
+++ linux/Documentation/Configure.help Mon Jul 5 20:37:25 1999
@@ -530,7 +530,7 @@
X People with SCSI-only systems should say N here; if unsure say Y.
X
X Generic PCI bus-master DMA support
-CONFIG_BLK_DEV_IDEDMA
+CONFIG_BLK_DEV_IDEDMA_PCI
X If your PCI system uses IDE drive(s) (as opposed to SCSI, say) and
X is capable of bus-master DMA operation (most Pentium PCI systems),
X you will want to say Y here to reduce CPU overhead. You can then use
@@ -546,6 +546,26 @@
X
X It is safe to say Y to this question.
X
+Good-Bad DMA Model-Firmware (EXPERIMENTAL)
+IDEDMA_NEW_DRIVE_LISTINGS
+ This test compares both the model and firmware revision for buggy drives
+ that claim to (U)DMA capable. This is a blanket on/off test with no speed
+ limit options. Straight GNU GCC 2.7.3/2.8.X compilers are known to be safe;
+ whereas, many versions of EGCS have a problem and miscompile.
+
+ If in doubt, say N.
+
+Generic ATA-66 support (DANGEROUS)
+CONFIG_IDEDMA_ULTRA_66
+ This allows for your Generic IDE control to attempt support for
+ using ATA-66 or UDMA-66 transfer modes 3/4. If you are not sure what you
+ are attempting, "DO NOT" even think about this option, unless your
+ mainboard's chipset is verified. Do not complain to anyone if you
+ do not know what you are doing and are just playing around.
+ This option has no known success cases to date.
+
+ Say N, or beware.........
+
X Winbond SL82c105 support
X CONFIG_BLK_DEV_SL82C105
X If you have a Winbond SL82c105 IDE controller, say Y here to enable
@@ -562,13 +582,16 @@
X improve the usability of some boot managers such as LILO when
X booting from a drive on an off-board controller.
X
+ Requires that all onboard ide controllers be disabled or calling
+ "pci=reverse" to invert the device scan order.
+
X Note that, if you say Y here, the order of the hd* devices will be
X rearranged which may require modification of fstab and other files.
X
X If in doubt, say N.
X
X Use DMA by default when available
-CONFIG_IDEDMA_AUTO
+CONFIG_IDEDMA_PCI_AUTO
X Prior to kernel version 2.1.112, Linux used to automatically use
X DMA for IDE drives and chipsets which support it. Due to concerns
X about a couple of cases where buggy hardware may have caused damage,
@@ -664,7 +687,7 @@
X This driver adds detection and support for the CY82C693 chipset
X used on Digital's PC-Alpha 164SX boards.
X
- This requires CONFIG_IDEDMA_AUTO to be enabled.
+ This requires CONFIG_IDEDMA_PCI_AUTO to be enabled.
X
X Please read the comments at the top of drivers/block/cy82c693.c
X
@@ -679,7 +702,7 @@
X (while running a "cat") provided you enabled "proc" support and
X set DISPLAY_APOLLO_TIMINGS in via82c586.c
X
- This requires CONFIG_IDEDMA_AUTO to be enabled.
+ This requires CONFIG_IDEDMA_PCI_AUTO to be enabled.
X
X If unsure, say N.
X
@@ -693,14 +716,15 @@
X onboard chipsets. It also tests for Simplex mode and enables
X normal dual channel support.
X
- This requires CONFIG_IDEDMA_AUTO to be enabled.
+ This requires CONFIG_IDEDMA_PCI_AUTO to be enabled.
X
X Please read the comments at the top of drivers/block/alim15x3.c
X
X If unsure, say N.
X
-PROMISE PDC20246 support (EXPERIMENTAL)
-CONFIG_BLK_DEV_PDC20246
+PROMISE PDC20246/PDC20262 support
+CONFIG_BLK_DEV_PDC202XX
+ Promise Ultra33 or PDC20246.
X This driver adds up to 4 more eide devices sharing a single interrupt.
X This add-on card is a bootable PCI UDMA controller.
X Since multiple cards can be installed and there are BIOS ROM problems
@@ -708,38 +732,49 @@
X do not match. Should you be unable to make new BIOS chips with a burner,
X the driver attempts to dynamic tuning of the chipset at boot-time
X for max-speed. Ultra33 BIOS 1.25 or new required for more than one card.
+ This card may require "PDC202XX Special UDMA Feature (EXPERIMENTAL)".
X
- This requires CONFIG_IDEDMA_AUTO to be enabled.
-
- Please read the comments at the top of drivers/block/pdc202xx.c
-
- If unsure, say N.
-
-PROMISE PDC20262 support (EXPERIMENTAL)
-CONFIG_BLK_DEV_PDC20262
+ Promise Ultra66 or PDC20262.
X This driver adds up to 4 more eide devices sharing a single interrupt.
X This add-on card is a bootable PCI UDMA ATA-66 controller.
X The driver attempts to dynamic tuning of the chipset at boot-time
X for max-speed. Note tested limits are UDMA-2.
X Ultra66 BIOS 1.11 or newer required.
X
- This requires CONFIG_IDEDMA_AUTO to be enabled.
+ This requires CONFIG_IDEDMA_PCI_AUTO to be enabled.
X
X Please read the comments at the top of drivers/block/pdc202xx.c
X
X If unsure, say N.
X
+Special UDMA Feature (EXPERIMENTAL)
+PDC202XX_FORCE_BURST_BIT
+ For PDC20246 and PDC20262 Ultra DMA chipsets.
+ Designed originally for PDC20246/Ultra33 that has BIOS setup failures
+ when using 3 or more cards.
+
+ Please read the comments at the top of drivers/block/pdc202xx.c
+
+ If unsure, say N.
+
+Special Mode Feature (DANGEROUS)
+PDC202XX_FORCE_MASTER_MODE
+ For PDC20246 and PDC20262 Ultra DMA chipsets.
+ This is reserved for possible Hardware RAID 0,1 for the FastTrak Series.
+
+ Say N.
+
X AEC6210 chipset support
X CONFIG_BLK_DEV_AEC6210
X This driver adds up to 4 more eide devices sharing a single interrupt.
X This add-on card is a bootable PCI UDMA controller. In order to get this
X card to initialize correctly in some cases, you should include this driver.
X
- This prefers CONFIG_IDEDMA_AUTO to be enabled, regardless.
+ This prefers CONFIG_IDEDMA_PCI_AUTO to be enabled, regardless.
X
X Please read the comments at the top of drivers/block/aec6210.c
X
-Intel PIIXn chipsets support (EXPERIMENTAL)
+Intel PIIXn chipsets support
X CONFIG_BLK_DEV_PIIX
X This driver adds PIO mode setting and tuning for all PIIX IDE
X controllers by Intel. Since the BIOS can sometimes improperly tune
@@ -750,15 +785,31 @@
X
X If unsure, say N.
X
-HPT343 chipset support (EXPERIMENTAL)
-CONFIG_BLK_DEV_HPT343
+PIIXn Tuning support (EXPERIMENTAL)
+CONFIG_BLK_DEV_PIIX_TUNING
+ This driver extension adds DMA mode setting and tuning for all PIIX IDE
+ controllers by Intel. Since the BIOS can sometimes improperly setup
+ the device/adapter combination and speed limits, It has become a necessity
+ to back/forward speed devices as needed.
+
+ Case 430HX/440FX PIIX3 need speed limits to reduce UDMA to DMA mode 2
+ if the BIOS can to perform this task at INIT.
+
+ If unsure, say N.
+
+HPT34X chipset support
+CONFIG_BLK_DEV_HPT34X
X This driver adds up to 4 more EIDE devices sharing a single
- interrupt. The HPT343 chipset in its current form is a non-bootable
- PCI UDMA controller. This driver requires dynamic tuning of the
- chipset during the ide-probe at boot. It is reported to support DVD
- II drives, by the manufacturer.
+ interrupt. The HPT343 chipset in its current form is a non-bootable or
+ HPT345/HPT363 chipset is bootable (needs BIOS FIX) PCI UDMA controllers.
+ This driver requires dynamic tuning of the chipset during the ide-probe
+ at boot. It is reported to support DVD II drives, by the manufacturer.
+
+ Please read the comments at the top of drivers/block/hpt343.c
X
- This requires CONFIG_IDEDMA_AUTO to be enabled.
+HPT34X DMA support (DANGEROUS)
+CONFIG_BLK_DEV_HPT34X_DMA
+ This requires CONFIG_IDEDMA_PCI_AUTO to be enabled.
X
X Please read the comments at the top of drivers/block/hpt343.c
X
@@ -821,17 +872,17 @@
X Say Y if you have an IDE doubler. The driver is enabled at kernel
X runtime using the "ide=doubler" kernel boot parameter.
X
- Support for PowerMac IDE devices (must also enable IDE)
- CONFIG_BLK_DEV_IDE_PMAC
- No help for CONFIG_BLK_DEV_IDE_PMAC
-
- PowerMac IDE DMA support
- CONFIG_BLK_DEV_IDEDMA_PMAC
- No help for CONFIG_BLK_DEV_IDEDMA_PMAC
-
- Use DMA by default
- CONFIG_PMAC_IDEDMA_AUTO
- No help for CONFIG_PMAC_IDEDMA_AUTO
+Support for PowerMac IDE devices (must also enable IDE)
+CONFIG_BLK_DEV_IDE_PMAC
+ No help for CONFIG_BLK_DEV_IDE_PMAC
+
+PowerMac IDE DMA support
+CONFIG_BLK_DEV_IDEDMA_PMAC
+ No help for CONFIG_BLK_DEV_IDEDMA_PMAC
+
+Use DMA by default
+CONFIG_IDEDMA_PMAC_AUTO
+ No help for CONFIG_IDEDMA_PMAC_AUTO
X
X Macintosh Quadra/Powerbook IDE interface support
X CONFIG_BLK_DEV_MAC_IDE
@@ -843,9 +894,21 @@
X (hard disks, CD-ROM drives, etc.) that are connected to the builtin
X IDE interface.
X
- RapIDE interface support
- CONFIG_BLK_DEV_IDE_RAPIDE
- No help for CONFIG_BLK_DEV_IDE_RAPIDE
+ICS IDE interface support
+CONFIG_BLK_DEV_IDE_ICSIDE
+ No help for CONFIG_BLK_DEV_IDE_ICSIDE
+
+ICS DMA support
+CONFIG_BLK_DEV_IDEDMA_ICS
+ No help for CONFIG_BLK_DEV_IDEDMA_ICS
+
+Use ICS DMA by default
+CONFIG_IDEDMA_ICS_AUTO
+ No help for CONFIG_IDEDMA_ICS_AUTO
+
+RapIDE interface support
+CONFIG_BLK_DEV_IDE_RAPIDE
+ No help for CONFIG_BLK_DEV_IDE_RAPIDE
X
X XT hard disk support
X CONFIG_BLK_DEV_XD
@@ -1611,6 +1674,45 @@
X CONFIG_FB_SGIVW
X SGI Visual Workstation support for framebuffer graphics.
X
+I2O support
+CONFIG_I2O
+ The Intelligent Input/Output (I2O) architecture allows
+ hardware drivers to be split into two parts: an operating system
+ specific module called the OSM and an hardware specific module
+ called the HDM. The OSM can talk to a whole range of HDM's, and
+ ideally the HDM's are not OS dependent. This allows for the same
+ driver to be used under different operating systems if the relevant
+ OSM is in place. If you say Y here, you will get a choice of OSM's
+ with the following questions.
+
+ This support is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt.
+
+ If unsure, say N.
+
+I2O PCI support
+CONFIG_I2O_PCI
+ Build in support for PCI bus I2O interface adapters. Currently this
+ is the only variety supported.
+
+I2O Block OSM
+CONFIG_I2O_BLOCK
+ Include support for the I2O Block OSM. The Block OSM presents disk and
+ other structured block devices to the operating system.
+
+I2O LAN OSM
+CONFIG_I2O_LAN
+ Include support for the LAN OSM. You will also need to include support
+ for token ring or fddi if you wish to use token ring or FDDI I2O cards
+ with this driver.
+
+I2O SCSI OSM
+CONFIG_I2O_SCSI
+ Allow direct scsi access to scsi devices on a SCSI or FibreChannel I2O
+ controller. You can use both the SCSI and Block OSM together if you wish.
+
X System V IPC
X CONFIG_SYSVIPC
X Inter Process Communication is a suite of library functions and
@@ -1977,6 +2079,11 @@
X You will get a boot time penguin logo at no additional cost. Please
X read Documentation/fb/vesafb.txt. If unsure, say Y.
X
+VGA 16-color graphics console
+CONFIG_FB_VGA16
+ This is the frame buffer device driver for VGA 16 color graphic
+ cards. Say Y if you have such a card.
+
X Backward compatibility mode for Xpmac
X CONFIG_FB_COMPAT_XPMAC
X If you use the Xpmac X server (common with mklinux), you'll need to
@@ -2218,12 +2325,12 @@
X whenever you want), say M here and read Documentation/modules.txt.
X The module will be called parport.o. If you have more than one
X parallel port and want to specify which port and IRQ to be used by
- this driver at module load time, read
- Documentation/networking/net-modules.txt.
+ this driver at module load time, take a look at
+ Documentation/networking/parport.txt.
X
X If unsure, say Y.
X
-PC-style hardware
+PC-style hardware
X CONFIG_PARPORT_PC
X You should say Y here if you have a PC-style parallel port. All IBM
X PC compatible computers and some Alphas have PC-style parallel
@@ -2236,28 +2343,36 @@
X
X If unsure, say Y.
X
+Use FIFO/DMA if available
+CONFIG_PARPORT_PC_FIFO
+ Many parallel port chipsets provide hardware that can speed up
+ printing. Say Y here if you want to take advantage of that.
+
+ As well as actually having a FIFO, or DMA capability, the kernel
+ will need to know which IRQ the parallel port has. By default,
+ parallel port interrupts will not be used, and so neither will the
+ FIFO. See Documentation/parport.txt to find out how to specify
+ which IRQ/DMA to use.
+
X Support foreign hardware
X CONFIG_PARPORT_OTHER
X Say Y here if you want to be able to load driver modules to support
X other non-standard types of parallel ports. This causes a
X performance loss, so most people say N.
X
-Sun Ultra/AX-style hardware
+Sun Ultra/AX-style hardware
X CONFIG_PARPORT_AX
X Say Y here if you need support for the parallel port hardware on Sun
X Ultra/AX machines. This code is also available as a module (say M),
X called parport_ax.o. If in doubt, saying N is the safe plan.
X
-Plug and Play support
-CONFIG_PNP
- Plug and Play support allows the kernel to automatically configure
- some peripheral devices. Say Y to enable PnP.
-
-Auto-probe for parallel devices
-CONFIG_PNP_PARPORT
- Some IEEE-1284 conforming parallel-port devices can identify
- themselves when requested. Say Y to enable this feature, or M to
- compile it as a module (parport_probe.o). If in doubt, say N.
+IEEE1284 transfer modes
+CONFIG_PARPORT_1284
+ If you have a printer that supports status readback or device ID, or
+ want to use a device that uses enhanced parallel port transfer modes
+ such as EPP and ECP, say Y here to enable advanced IEEE 1284
+ transfer modes. Also say Y if you want device ID information to
+ appear in /proc/sys/dev/parport/*/autoprobe*. It is safe to say N.
X
X Enable loadable module support
X CONFIG_MODULES
@@ -5160,6 +5275,17 @@
X module, say M here and read Documentation/modules.txt as well as
X Documentation/networking/net-modules.txt.
X
+Aironet Arlan 655 & IC2200 DS support
+CONFIG_ARLAN
+ Aironet makes Arlan. www.aironet.com. Uses www.Telxon.com chip, which is
+ used on several similar cards. Driver is tested on 655 and IC2200 series.
+ Look for http://www.ylenurme.ee/~elmer/655/ for latest information.
+ Driver is build as two modules, arlan and arlan-proc. The later is /proc
+ interface and not needed most of time.
+ On some computers the card ends up in non-valid state after some time.
+ Use a ping-reset script to clear it.
+
+
X LAPB over Ethernet driver
X CONFIG_LAPBETHER
X This is a driver for a pseudo device (typically called /dev/lapb0)
@@ -5286,6 +5412,15 @@
X module, say M here and read Documentation/modules.txt. If you don't
X know what to use this for, you don't need it.
X
+Sealevel Systems 4021 support
+CONFIG_SEALEVEL_4021
+ This is a driver for the Sealevel Systems ACB 56 serial I/O adapter.
+
+ This driver can only be compiled as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ If you want to do that, say M here. The module will be called
+ sealevel.o.
+
X Frame Relay (DLCI) support
X CONFIG_DLCI
X This is support for the frame relay protocol; frame relay is a fast
@@ -5692,6 +5827,40 @@
X you say N, the PPP support will not be included in the driver (saves
X about 16 KB of kernel memory).
X
+Cyclom 2X(tm) multiprotocol cards
+CONFIG_CYCLADES_SYNC
+ Cyclom 2X from Cyclades Corporation (http://www.cyclades.com and
+ http://www.cyclades.com.br; to browse the WWW, you need to have
+ access to a machine on the Internet that has a program like lynx or
+ netscape) is an intelligent multiprotocol WAN adapter with data
+ transfer rates up to 512 Kbps). These cards support the X.25 and SNA
+ related protocols. If you have one or more of these cards, say Y to
+ this option. The next questions will ask you about the protocols you
+ want the driver to support (for now only X.25 is supported).
+
+ While no documentation is available at this time please grab the
+ wanconfig tarball in http://www.conectiva.com.br/~acme/cycsyn-devel
+ (with minor changes to make it compile with the current wanrouter
+ include files; efforts are being made to use the original package
+ available at ftp://ftp.sangoma.com).
+
+ Feel free to contact me or the cycsyn-devel mailing list at
+ ac...@conectiva.com.br and cycsyn...@bazar.conectiva.com.br for
+ aditional details, I hope to have documentation available as soon
+ as possible.
+
+ The driver will be compiled as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module will be called cyclomx.o. For general information about
+ modules read Documentation/modules.txt.
+
+Cyclom 2X X.25 support
+CONFIG_CYCLOMX_X25
+ Say Y to this option if you are planning to connect a Cyclom 2X card
+ to an X.25 network.
+ If you say N, the X.25 support will not be included in the driver
+ (saves about 11 KB of kernel memory).
+
X Ethernet (10 or 100Mbit)
X CONFIG_NET_ETHERNET
X Ethernet (also called IEEE 802.3 or ISO 8802-2) is the most common
@@ -5905,7 +6074,7 @@
X say M here and read Documentation/modules.txt. This is recommended.
X The module will be called yellowfin.o.
X
-Alteon AceNIC / 3Com 3C985 Gigabit Ethernet support.
+Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support
X CONFIG_ACENIC
X Say Y here if you have an Alteon AceNIC or 3Com 3C985 PCI Gigabit
X Ethernet adapter. The driver allows for using the Jumbo Frame
@@ -6663,6 +6832,25 @@
X The module will be called ibmtr.o. If you want to compile it as a
X module, say M here and read Documentation/modules.txt.
X
+IBM Olympic chipset PCI adapter support
+CONFIG_IBMOL
+ This is support for all non-Lanstreamer IBM PCI Token Ring Cards.
+ Specifically this is all IBM PCI, PCI Wake On Lan, PCI II, PCI II
+ Wake On Lan, and PCI 100/16/4 adapters.
+
+ If you have such an adapter, say Y and read the Token-Ring mini-HOWTO,
+ available via FTP (user:anonymous) from
+ ftp://metalab.unc/edu/pub/Linux/docs/HOWTO.
+
+ This driver is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module will will be called olympic.o. If you want to compile it as a
+ module, say M here and read Documentation/modules.txt.
+
+ Also read the linux/Documentation/networking/olympic.txt or check the
+ Linux Token Ring Project site for the latest information at
+ http://www.linuxtr.net
+
X SysKonnect adapter support
X CONFIG_SKTR
X This is support for all SysKonnect Token Ring cards, specifically
@@ -8316,6 +8504,16 @@
X
X If you haven't heard about it, it's safe to say N.
X
+Cyclades-Z interrupt mode operation (EXPERIMENTAL)
+CONFIG_CYZ_INTR
+ The Cyclades-Z family of multiport cards allows 2 (two) driver
+ op modes: polling and interrupt. In polling mode, the driver will
+ check the status of the Cyclades-Z ports every certain amount of
+ time (which is called polling cycle and is configurable). In
+ interrupt mode, it will use an interrupt line (IRQ) in order to check
+ the status of the Cyclades-Z ports. The default op mode is polling.
+ If unsure, say N.
+
X Stallion multiport serial support
X CONFIG_STALDRV
X Stallion cards give you many serial ports. You would need something
@@ -8440,7 +8638,8 @@
X corresponding drivers into the kernel. If you want to compile this
X driver as a module however ( = code which can be inserted in and
X removed from the running kernel whenever you want), say M here and
- read Documentation/modules.txt. The module will be called lp.o.
+ read Documentation/modules.txt and Documentation/parport.txt. The
+ module will be called lp.o.
X
X If you have several parallel ports, you can specify which ports to
X use with the "lp" kernel command line option. (Try "man bootparam"
@@ -8454,11 +8653,18 @@
X If you have more than 3 printers, you need to increase the LP_NO
X variable in lp.c.
X
-Support IEEE1284 status readback
-CONFIG_PRINTER_READBACK
- If your printer conforms to IEEE 1284, it may be able to provide a
- status indication when you read from it (for example, with `cat
- /dev/lp1'). To use this feature, say Y here.
+Support for console on line printer
+CONFIG_LP_CONSOLE
+ If you want kernel messages to be printed out as they occur, you
+ can have a console on the printer. This option adds support for
+ doing that; to actually get it to happen you need to pass the
+ option "console=lp" to the kernel at boot time.
+
+ Note that kernel messages can get lost if the printer is out of
+ paper (or off, or unplugged, or too busy..), but this behaviour
+ can be changed. See drivers/char/lp.c (do this at your own risk).
+
+ If unsure, say N.
X
X Mouse Support (not serial mice)
X CONFIG_MOUSE
@@ -9397,7 +9603,7 @@
X after the PnP configuration is finished. To do this, say M here and
X read Documentation/modules.txt as well as
X Documentation/sound/README.modules; the module will be called
- sound.o.
+ soundcore.o.
X
X I'm told that even without a sound card, you can make your computer
X say more than an occasional beep, by programming the PC speaker.
@@ -10943,6 +11149,11 @@
X Choose Y here if you have this FM radio card, and then fill in the
X port address below.
X
+ If you have GemTeks combined (PnP) sound- and radio card you must use
+ this driver as a module and setup the card with isapnptools. You must
+ also pass the module a suitable io parameter, 0x248 has been reported
+ to be used by these cards.
+
X In order to control your radio card, you will need to use programs
X that are compatible with the Video for Linux API. Information on
X this API and pointers to "v4l" programs may be found on the WWW at
@@ -11119,6 +11330,40 @@
X Enter either 0x20c, 0x30c, 0x24c or 0x34c here. The card default is
X 0x34c, if you haven't changed the jumper setting on the card.
X
+PlanB Video-In for PowerMacs
+CONFIG_VIDEO_PLANB
+ PlanB is the V4L driver for the PowerMac 7x00/8x00 series video
+ input hardware. If you want to experiment with this, say Y.
+ Otherwise, or if you don't understand a word, say N.
+ See http://www.cpu.lu/~mlan/planb.html for more info.
+
+ Saying M will compile this driver as a module (planb.o).
+
+TerraTec ActiveRadio
+CONFIG_RADIO_TERRATEC
+ Choose Y here if you have this FM radio card, and then fill in the
+ port address below. (TODO)
+
+ Note: This driver is in its early stages. Right now volume and frequency
+ control and muting works at least for me, but unfortunately i have not
+ found anybody who wants to use this card with linux. So if it is this
+ what YOU are trying to do right now, PLEASE DROP ME A NOTE!!
+ Rolf Offermanns (ro...@offermanns.de)
+
+ In order to control your radio card, you will need to use programs
+ that are compatible with the Video for Linux API. Information on
+ this API and pointers to "v4l" programs may be found on the WWW at
+ http://roadrunner.swansea.uk.linux.org/v4l.shtml; to browse the WWW,
+ you need to have access to a machine on the Internet that has a
+ program like lynx or netscape.
+
+
+ If you want to compile this driver as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want),
+ say M here and read Documentation/modules.txt. The module will be
+ called radio-terratec.o.
+
+
X BT848 Video For Linux
X CONFIG_VIDEO_BT848
X Support for BT848 based frame grabber/overlay boards. This includes
@@ -11165,6 +11410,14 @@
X from the running kernel whenever you want). If you want to compile
X it as a module, say M here and read Documentation/modules.txt.
X
+Compaq SMART2 support
+CONFIG_BLK_CPQ_DA
+ This is the driver for Compaq Smart Array controllers.
+ Everyone using these boards should say Y here.
+ See "linux/Documentation/cpqarray.txt" for the current list of
+ boards supported by this driver, and for further information
+ on the use of this driver.
+
X #
X # ARM options
X #
@@ -11463,6 +11716,21 @@
X
X If unsure, say Y.
X
+IrPORT IrDA Device Driver
+CONFIG_IRPORT_SIR
+ Say Y here if you want to build support for the IrPORT IrDA device
+ driver. If you want to compile it as a module, say M here and
+ read Documentation/modules.txt. IrPORT can be used instead of
+ IrTTY and sometimes this can be better. One example is if your
+ IrDA port does not have echo-canceling, which will work OK with
+ IrPORT since this driver is working in half-duplex mode only. You
+ don't need to use irattach with IrPORT, but you just insert it
+ the same way as FIR drivers (insmod irport io=0x3e8 irq=11).
+ Notice that IrPORT is a SIR device driver which means that speed
+ is limited to 115200 bps.
+
+ If unsure, say Y.
+
X Winbond W83977AF IrDA Device Driver
X CONFIG_WINBOND_FIR
X Say Y here if you want to build IrDA support for the Winbond
@@ -11486,6 +11754,13 @@
X read Documentation/modules.txt. This chipset is used by the Toshiba
X Tecra laptops.
X
+Toshiba Type-O IR Port Device Driver
+CONFIG_TOSHIBA_FIR
+ Say Y here if you want to build support for the Toshiba Type-O IR
+ chipset. If you want to compile it as a module, say M here and
+ read Documentation/modules.txt. This chipset is used by the Toshiba
+ Libretto 100CT, and many more laptops.
+
X ESI JetEye PC Dongle
X CONFIG_ESI_DONGLE
X Say Y here if you want to build support for the Extended Systems
@@ -11523,6 +11798,15 @@
X by IrTTY. To activate support for Greenwich dongles you will have to
X insert "irattach -d girbil" in the /etc/irda/drivers script.
X
+Parallax Litelink dongle
+CONFIG_LITELINK_DONGLE
+ Say Y here if you want to build support for the Parallax Litelink
+ dongle. If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. The Parallax dongle attaches to the
+ normal 9-pin serial port connector, and can currently only be used
+ by IrTTY. To activate support for Parallax dongles you will have to
+ insert "irattach -d litelink" in the /etc/irda/drivers script.
+
X VME (Motorola and BVM) support
X CONFIG_VME
X Say Y here if you want to build a kernel for a 680x0 based VME
@@ -11658,6 +11942,16 @@
X CONFIG_USB_ACM
X This driver allows for devices which support the Abstract Control Model,
X including many USB-based modems, ISDN adapters, and network adapters.
+
+Support for user-space parallel port device drivers
+CONFIG_PPDEV
+ Saying Y to this adds support for /dev/parport device nodes.
+ NB. You have to make them before you can use them:
+ mknod /dev/parport00 c 99 0
+ mknod /dev/parport01 c 99 1
+ mknod /dev/parport10 c 99 16
+ mknod /dev/parport11 c 99 17
+ etc..
X
X #
X # A couple of things I keep forgetting:
diff -u --recursive --new-file v2.3.9/linux/Documentation/SMP.txt linux/Documentation/SMP.txt
--- v2.3.9/linux/Documentation/SMP.txt Wed Jun 24 14:30:07 1998
+++ linux/Documentation/SMP.txt Thu Jul 1 10:45:57 1999
@@ -1,7 +1,7 @@
X SMP on x86/Linux is now an official feature and is not experimental.
X Experimental SMP support for other architectures is underway.
X
-Please view linux/Documentation/smp for more information about enabling SMP.
+Please view linux/Documentation/smp.txt for more information about enabling SMP.
X
X SMP support for Linux with up to 16 processors using the Intel MP
X specification.
diff -u --recursive --new-file v2.3.9/linux/Documentation/cpqarray.txt linux/Documentation/cpqarray.txt
--- v2.3.9/linux/Documentation/cpqarray.txt Wed Dec 31 16:00:00 1969
+++ linux/Documentation/cpqarray.txt Mon Jul 5 19:52:13 1999
@@ -0,0 +1,107 @@
+This driver is for Compaq's SMART2 Intellegent Disk Array Controllers.
+
+WARNING:
+--------
+
+This driver comes with NO WARRANTY. It is not officially supported by
+Compaq. Do not call technical support. Use at your own risk.
+
+Supported Cards:
+----------------
+
+This driver is known to work with the following cards:
+
+ * SMART (EISA)
+ * SMART-2/E (EISA)
+ * SMART-2/P
+ * SMART-2DH
+ * SMART-2SL
+ * SMART-221
+ * SMART-3100ES
+ * SMART-3200
+ * Integrated Smart Array Controller
+ * SA 4200
+ * SA 4250ES
+
+It should also work with some really old Disk array adapters, but I am
+unable to test against these cards:
+
+ * IDA
+ * IDA-2
+ * IAES
+
+Installing:
+-----------
+
+You need to build a new kernel to use this device, even if you want to
+use a loadable module.
+
+Apply the patch to a 2.2.x kernel:
+
+# cd linux
+# patch -p1 <smart2.patch
+
+Then build a new kernel and turn on Compaq SMART2 Disk Array support.
+Create device nodes for the diskarray device:
+
+# mkdev.ida [ctlrs]
+
+Where ctlrs is the number of controllers you have (defaults to 1 if not
+specified).
+
+EISA Controllers:
+-----------------
+
+If you want to use an EISA controller you'll have to supply some
+insmod/lilo paramaters. If the driver is compiled into the kernel, must
+give it the controller's IO port address at boot time (it is no longer
+necessary to specifiy the IRQ). For example, if you had two SMART-2/E
+controllers, in EISA slots 1 and 2 you'd give it a boot argument like
+this:
+
+ smart2=0x1000,0x2000
+
+If you were loading the driver as a module, you'd give load it like this:
+
+ insmod cpqarray.o eisa=0x1000,0x2000
+
+You can use EISA and PCI adapters at the same time.
+
+Booting:
+--------
+
+You'll need to use a modified lilo if you want to boot from a disk array.
+Its simply a version of lilo with some code added to tell it how to
+understand Compaq diskarray devices.
+
+Device Naming:
+--------------
+
+You need some entries in /dev for the ida device. The mkdev.ida script
+can make device nodes for you automatically. Currently the device setup
+is as follows:
+
+Major numbers:
+ 72 ida0
+ 73 ida1
+ 74 ida2
+ etc...
+
+Minor numbers:
+ b7 b6 b5 b4 b3 b2 b1 b0
+ |----+----| |----+----|
+ | |
+ | +-------- Partition ID (0=wholedev, 1-15 partition)
+ |
+ +-------------------- Logical Volume number
+
+The suggested device naming scheme is:
+/dev/ida/c0d0 Controller 0, disk 0, whole device
+/dev/ida/c0d0p1 Controller 0, disk 0, partition 1
+/dev/ida/c0d0p2 Controller 0, disk 0, partition 2
+/dev/ida/c0d0p3 Controller 0, disk 0, partition 3
+
+/dev/ida/c1d1 Controller 1, disk 1, whole device
+/dev/ida/c1d1p1 Controller 1, disk 1, partition 1
+/dev/ida/c1d1p2 Controller 1, disk 1, partition 2
+/dev/ida/c1d1p3 Controller 1, disk 1, partition 3
diff -u --recursive --new-file v2.3.9/linux/Documentation/fb/tgafb.txt linux/Documentation/fb/tgafb.txt
--- v2.3.9/linux/Documentation/fb/tgafb.txt Wed Dec 31 16:00:00 1969
+++ linux/Documentation/fb/tgafb.txt Thu Jul 1 10:57:36 1999
@@ -0,0 +1,51 @@
+[Also cloned from vesafb.txt, thanks to Gerd]
+
+What is tgafb?
+===============
+
+This is a driver for DECChip 21030 based graphics framebuffers, a.k.a. TGA
+cards, specifically the following models
+
+ZLxP-E1 (8bpp, 4 MB VRAM)
+ZLxP-E2 (32bpp, 8 MB VRAM)
+ZLxP-E3 (32bpp, 16 MB VRAM, Zbuffer)
+
+This version, tgafb-1.12, is almost a complete rewrite of the code written
+by Geert Uytterhoeven, which was based on the original TGA console code
+written by Jay Estabrook.
+
+Major new features:
+
+ * Support for multiple resolutions, including setting the resolution at
+ boot time, allowing the use of a fixed-frequency monitor.
+ * Complete code rewrite to follow Geert's skeletonfb spec which will allow
+ future implementation of hardware acceleration and other features.
+
+
+Configuration
+=============
+
+You can pass kernel command line options to tgafb with
+`video=tga:option1,option2:value2,option3' (multiple options should be
+separated by comma, values are separated from options by `:').
+Accepted options:
+
+font:X - default font to use. All fonts are supported, including the
+ SUN12x22 font which is very nice at high resolutions.
+mode:X - default video mode. See drivers/video/tgafb.c for a list.
+
+X11
+===
+
+XF68_FBDev should work just fine, but I haven't tested it. Running
+the XF86_TGA server (reasonably recent versions of which support all TGA
+cards) works fine for me.
+
+One minor problem with XF86_TGA is when running tgafb in resolutions higher
+than 640x480, on switching VCs from tgafb to X, the entire screen is not
+re-drawn and must be manually refreshed. This is an X server problem, not a
+tgafb problem.
+
+Enjoy!
+
+Martin Lucina <ma...@kotelna.sk>
diff -u --recursive --new-file v2.3.9/linux/Documentation/java.txt linux/Documentation/java.txt
--- v2.3.9/linux/Documentation/java.txt Tue Apr 28 14:22:04 1998
+++ linux/Documentation/java.txt Thu Jul 1 10:47:08 1999
@@ -21,7 +21,7 @@
X 2) You have to compile BINFMT_MISC either as a module or into
X the kernel (CONFIG_BINFMT_MISC) and set it up properly.
X If you choose to compile it as a module, you will have
- to insert it manually with modprobe/insmod, as kerneld
+ to insert it manually with modprobe/insmod, as kmod
X can not easy be supported with binfmt_misc.
X Read the file 'binfmt_misc.txt' in this directory to know
X more about the configuration process.
@@ -29,14 +29,15 @@
X 3) Add the following configuration items to binfmt_misc
X (you should really have read binfmt_misc.txt now):
X support for Java applications:
- ':Java:M::\xca\xfe\xba\xbe::/usr/local/java/bin/javawrapper:'
+ ':Java:M::\xca\xfe\xba\xbe::/usr/local/bin/javawrapper:'
X support for Java Applets:
- ':Applet:E::html::/usr/local/java/bin/appletviewer:'
+ ':Applet:E::html::/usr/bin/appletviewer:'
X or the following, if you want to be more selective:
- ':Applet:M::<!--applet::/usr/local/java/bin/appletviewer:'
+ ':Applet:M::<!--applet::/usr/bin/appletviewer:'
X
- Of cause you have to fix the path names, if you installed the JDK
- at another place than /usr/local/java.
+ Of cause you have to fix the path names. Given path/file names in this
+ document match the Debian 2.1 system. (i.e. jdk installed in /usr,
+ custom wrappers from this document in /usr/local)
X
X Note, that for the more selective applet support you have to modify
X existing html-files to contain <!--applet--> in the first line
@@ -45,42 +46,300 @@
X For the compiled Java programs you need a wrapper script like the
X following (this is because Java is broken in case of the filename
X handling), again fix the path names, both in the script and in the
- above given configuration string:
+ above given configuration string.
+
+ You, too, need the little program after the script. Compile like
+ gcc -O2 -o javaclassname javaclassname.c
+ and stick it to /usr/local/bin.
+
+ Both the javawrapper shellscript and the javaclassname program
+ were supplied by Colin J. Watson <cj...@cam.ac.uk>.
X
X ====================== Cut here ===================
X #!/bin/bash
-# /usr/local/java/bin/javawrapper - the wrapper for binfmt_misc/java
-CLASS=$1
+# /usr/local/bin/javawrapper - the wrapper for binfmt_misc/java
X
-# if classname is a link, we follow it (this could be done easier - how?)
-if [ -L "$1" ] ; then
- CLASS=`ls --color=no -l $1 | tr -s '\t ' ' ' | cut -d ' ' -f 11`
+if [ -z "$1" ]; then
+ exec 1>&2
+ echo Usage: $0 class-file
+ exit 1
X fi
-CLASSN=`basename $CLASS .class`
-CLASSP=`dirname $CLASS`
X
-FOO=$PATH
-PATH=$CLASSPATH
-if [ -z "`type -p -a $CLASSN.class`" ] ; then
- # class is not in CLASSPATH
- if [ -e "$CLASSP/$CLASSN.class" ] ; then
- # append dir of class to CLASSPATH
- if [ -z "${CLASSPATH}" ] ; then
- export CLASSPATH=$CLASSP
- else
- export CLASSPATH=$CLASSP:$CLASSPATH
- fi
- else
- # uh! now we would have to create a symbolic link - really
- # ugly, i.e. print a message that one has to change the setup
- echo "Hey! This is not a good setup to run $1 !"
- exit 1
- fi
+CLASS=$1
+FQCLASS=`/usr/local/bin/javaclassname $1`
+FQCLASSN=`echo $FQCLASS | sed -e 's/^.*\.\([^.]*\)$/\1/'`
+FQCLASSP=`echo $FQCLASS | sed -e 's-\.-/-g' -e 's-^[^/]*$--' -e 's-/[^/]*$--'`
+
+# for example:
+# CLASS=Test.class
+# FQCLASS=foo.bar.Test
+# FQCLASSN=Test
+# FQCLASSP=foo/bar
+
+unset CLASSBASE
+
+declare -i LINKLEVEL=0
+
+while :; do
+ if [ "`basename $CLASS .class`" == "$FQCLASSN" ]; then
+ # See if this directory works straight off
+ cd -L `dirname $CLASS`
+ CLASSDIR=$PWD
+ cd $OLDPWD
+ if echo $CLASSDIR | grep -q "$FQCLASSP$"; then
+ CLASSBASE=`echo $CLASSDIR | sed -e "s.$FQCLASSP$.."`
+ break;
+ fi
+ # Try dereferencing the directory name
+ cd -P `dirname $CLASS`
+ CLASSDIR=$PWD
+ cd $OLDPWD
+ if echo $CLASSDIR | grep -q "$FQCLASSP$"; then
+ CLASSBASE=`echo $CLASSDIR | sed -e "s.$FQCLASSP$.."`
+ break;
+ fi
+ # If no other possible filename exists
+ if [ ! -L $CLASS ]; then
+ exec 1>&2
+ echo $0:
+ echo " $CLASS should be in a" \
+ "directory tree called $FQCLASSP"
+ exit 1
+ fi
+ fi
+ if [ ! -L $CLASS ]; then break; fi
+ # Go down one more level of symbolic links
+ let LINKLEVEL+=1
+ if [ $LINKLEVEL -gt 5 ]; then
+ exec 1>&2
+ echo $0:
+ echo " Too many symbolic links encountered"
+ exit 1
+ fi
+ CLASS=`ls --color=no -l $CLASS | sed -e 's/^.* \([^ ]*\)$/\1/'`
+done
+
+if [ -z "$CLASSBASE" ]; then
+ if [ -z "$FQCLASSP" ]; then
+ GOODNAME=$FQCLASSN.class
+ else
+ GOODNAME=$FQCLASSP/$FQCLASSN.class
+ fi
+ exec 1>&2
+ echo $0:
+ echo " $FQCLASS should be in a file called $GOODNAME"
+ exit 1
+fi
+
+if ! echo $CLASSPATH | grep -q "^\(.*:\)*$CLASSBASE\(:.*\)*"; then
+ # class is not in CLASSPATH, so prepend dir of class to CLASSPATH
+ if [ -z "${CLASSPATH}" ] ; then
+ export CLASSPATH=$CLASSBASE
+ else
+ export CLASSPATH=$CLASSBASE:$CLASSPATH
+ fi
X fi
-PATH=$FOO
X
X shift
-/usr/local/java/bin/java $CLASSN "$@"
+/usr/bin/java $FQCLASS "$@"
+====================== Cut here ===================
+
+
+====================== Cut here ===================
+/* javaclassname.c
+ *
+ * Extracts the class name from a Java class file; intended for use in a Java
+ * wrapper of the type supported by the binfmt_misc option in the Linux kernel.
+ *
+ * Copyright (C) 1999 Colin J. Watson <cj...@cam.ac.uk>.
+ *
+ * This program is free software; 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 <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <sys/types.h>
+
+/* From Sun's Java VM Specification, as tag entries in the constant pool. */
+
+#define CP_UTF8 1
+#define CP_INTEGER 3
+#define CP_FLOAT 4
+#define CP_LONG 5
+#define CP_DOUBLE 6
+#define CP_CLASS 7
+#define CP_STRING 8
+#define CP_FIELDREF 9
+#define CP_METHODREF 10
+#define CP_INTERFACEMETHODREF 11
+#define CP_NAMEANDTYPE 12
+
+/* Define some commonly used error messages */
+
+#define seek_error() error("%s: Cannot seek\n", program)
+#define corrupt_error() error("%s: Class file corrupt\n", program)
+#define eof_error() error("%s: Unexpected end of file\n", program)
+#define utf8_error() error("%s: Only ASCII 1-255 supported\n", program);
+
+char *program;
+
+long *pool;
+
+u_int8_t read_8(FILE *classfile);
+u_int16_t read_16(FILE *classfile);
+void skip_constant(FILE *classfile, u_int16_t *cur);
+void error(const char *format, ...);
+int main(int argc, char **argv);
+
+/* Reads in an unsigned 8-bit integer. */
+u_int8_t read_8(FILE *classfile)
+{
+ int b = fgetc(classfile);
+ if(b == EOF)
+ eof_error();
+ return (u_int8_t)b;
+}
+
+/* Reads in an unsigned 16-bit integer. */
+u_int16_t read_16(FILE *classfile)
+{
+ int b1, b2;
+ b1 = fgetc(classfile);
+ if(b1 == EOF)
+ eof_error();
+ b2 = fgetc(classfile);
+ if(b2 == EOF)
+ eof_error();
+ return (u_int16_t)((b1 << 8) | b2);
+}
+
+/* Reads in a value from the constant pool. */
+void skip_constant(FILE *classfile, u_int16_t *cur)
+{
+ u_int16_t len;
+ int seekerr = 1;
+ pool[*cur] = ftell(classfile);
+ switch(read_8(classfile))
+ {
+ case CP_UTF8:
+ len = read_16(classfile);
+ seekerr = fseek(classfile, len, SEEK_CUR);
+ break;
+ case CP_CLASS:
+ case CP_STRING:
+ seekerr = fseek(classfile, 2, SEEK_CUR);
+ break;
+ case CP_INTEGER:
+ case CP_FLOAT:
+ case CP_FIELDREF:
+ case CP_METHODREF:
+ case CP_INTERFACEMETHODREF:
+ case CP_NAMEANDTYPE:
+ seekerr = fseek(classfile, 4, SEEK_CUR);
+ break;
+ case CP_LONG:
+ case CP_DOUBLE:
+ seekerr = fseek(classfile, 8, SEEK_CUR);
+ ++(*cur);
+ break;
+ default:
+ corrupt_error();
+ }
+ if(seekerr)
+ seek_error();
+}
+
+void error(const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ exit(1);
+}
+
+int main(int argc, char **argv)
+{
+ FILE *classfile;
+ u_int16_t cp_count, i, this_class, classinfo_ptr;
+ u_int8_t length;
+
+ program = argv[0];
+
+ if(!argv[1])
+ error("%s: Missing input file\n", program);
+ classfile = fopen(argv[1], "rb");
+ if(!classfile)
+ error("%s: Error opening %s\n", program, argv[1]);
+
+ if(fseek(classfile, 8, SEEK_SET)) /* skip magic and version numbers */
+ seek_error();
+ cp_count = read_16(classfile);
+ pool = calloc(cp_count, sizeof(long));
+ if(!pool)
+ error("%s: Out of memory for constant pool\n", program);
+
+ for(i = 1; i < cp_count; ++i)
+ skip_constant(classfile, &i);
+ if(fseek(classfile, 2, SEEK_CUR)) /* skip access flags */
+ seek_error();
+
+ this_class = read_16(classfile);
+ if(this_class < 1 || this_class >= cp_count)
+ corrupt_error();
+ if(!pool[this_class] || pool[this_class] == -1)
+ corrupt_error();
+ if(fseek(classfile, pool[this_class] + 1, SEEK_SET))
+ seek_error();
+
+ classinfo_ptr = read_16(classfile);
+ if(classinfo_ptr < 1 || classinfo_ptr >= cp_count)
+ corrupt_error();
+ if(!pool[classinfo_ptr] || pool[classinfo_ptr] == -1)
+ corrupt_error();
+ if(fseek(classfile, pool[classinfo_ptr] + 1, SEEK_SET))
+ seek_error();
+
+ length = read_16(classfile);
+ for(i = 0; i < length; ++i)
+ {
+ u_int8_t x = read_8(classfile);
+ if((x & 0x80) || !x)
+ {
+ if((x & 0xE0) == 0xC0)
+ {
+ u_int8_t y = read_8(classfile);
+ if((y & 0xC0) == 0x80)
+ {
+ int c = ((x & 0x1f) << 6) + (y & 0x3f);
+ if(c) putchar(c);
+ else utf8_error();
+ }
+ else utf8_error();
+ }
+ else utf8_error();
+ }
+ else if(x == '/') putchar('.');
+ else putchar(x);
+ }
+ putchar('\n');
+ free(pool);
+ fclose(classfile);
+ return 0;
+}
X ====================== Cut here ===================
X
X
@@ -116,4 +375,6 @@
X
X
X originally by Brian A. Lantz, br...@lantz.com
-heavily edited for binfmt_misc by Richard Günther.
+heavily edited for binfmt_misc by Richard Günther
+new scripts by Colin J. Watson <cj...@cam.ac.uk>.
+
diff -u --recursive --new-file v2.3.9/linux/Documentation/kernel-parameters.txt linux/Documentation/kernel-parameters.txt
--- v2.3.9/linux/Documentation/kernel-parameters.txt Wed Jun 2 11:32:45 1999
+++ linux/Documentation/kernel-parameters.txt Mon Jul 5 19:52:52 1999
@@ -37,7 +37,7 @@
X SOUND Appropriate sound system support is enabled.
X VGA The VGA console has been enabled.
X VT Virtual terminal support is enabled.
- XT IBM PC/XT support is enabled.
+ XT IBM PC/XT MFM hard disk support is enabled.
X
X In addition, the following text indicates that the option:
X
diff -u --recursive --new-file v2.3.9/linux/Documentation/networking/arcnet-hardware.txt linux/Documentation/networking/arcnet-hardware.txt
--- v2.3.9/linux/Documentation/networking/arcnet-hardware.txt Thu Jan 7 08:41:55 1999
+++ linux/Documentation/networking/arcnet-hardware.txt Mon Jul 5 19:52:52 1999
@@ -20,14 +20,14 @@
X ARCnet is a network type which works in a way similar to popular Ethernet
X networks but which is also different in some very important ways.
X
-First of all, you can get ARCnet cards in at least two speeds: 2.5Mbps
-(slower than Ethernet) and 100Mbps (faster than normal Ethernet). In fact,
+First of all, you can get ARCnet cards in at least two speeds: 2.5 Mbps
+(slower than Ethernet) and 100 Mbps (faster than normal Ethernet). In fact,
X there are others as well, but these are less common. The different hardware
X types, as far as I'm aware, are not compatible and so you cannot wire a
-100Mbps card to a 2.5Mbps card, and so on. From what I hear, my driver does
-work with 100Mbps cards, but I haven't been able to verify this myself,
-since I only have the 2.5Mbps variety. It is probably not going to saturate
-your 100Mbps card. Stop complaining :)
+100 Mbps card to a 2.5 Mbps card, and so on. From what I hear, my driver does
+work with 100 Mbps cards, but I haven't been able to verify this myself,
+since I only have the 2.5 Mbps variety. It is probably not going to saturate
+your 100 Mbps card. Stop complaining. :)
X
X You also cannot connect an ARCnet card to any kind of Ethernet card and
X expect it to work.
@@ -52,17 +52,17 @@
X useful for realtime networks.
X
X In addition, all known ARCnet cards have an (almost) identical programming
-interface. This means that with one "arcnet" driver you can support any
-card; whereas, with Ethernet, each manufacturer uses what is sometimes a
+interface. This means that with one ARCnet driver you can support any
+card, whereas with Ethernet each manufacturer uses what is sometimes a
X completely different programming interface, leading to a lot of different,
X sometimes very similar, Ethernet drivers. Of course, always using the same
X programming interface also means that when high-performance hardware
-facilities like PCI busmastering DMA appear, it's hard to take advantage of
+facilities like PCI bus mastering DMA appear, it's hard to take advantage of
X them. Let's not go into that.
X
X One thing that makes ARCnet cards difficult to program for, however, is the
X limit on their packet sizes; standard ARCnet can only send packets that are
-up to 508 bytes in length. This is smaller than the internet "bare minimum"
+up to 508 bytes in length. This is smaller than the Internet "bare minimum"
X of 576 bytes, let alone the Ethernet MTU of 1500. To compensate, an extra
X level of encapsulation is defined by RFC1201, which I call "packet
X splitting," that allows "virtual packets" to grow as large as 64K each,
@@ -1005,9 +1005,9 @@
X only (the JP0 jumper is hardwired), and BNC only.
X
X This is a LCS-8830-T made by SMC, I think ('SMC' only appears on one PLCC,
-nowhere else, not even on the few xeroxed sheets from the manual).
+nowhere else, not even on the few Xeroxed sheets from the manual).
X
-SMC Arcnet Board Type LCS-8830-T
+SMC ARCnet Board Type LCS-8830-T
X
X ------------------------------------
X | |
@@ -1070,7 +1070,7 @@
X
X DIP Switches 1-5 of SW2 encode the RAM and ROM Address Range:
X
-Switches Ram Rom
+Switches RAM ROM
X 12345 Address Range Address Range
X 00000 C:0000-C:07ff C:2000-C:3fff
X 10000 C:0800-C:0fff
@@ -1170,11 +1170,11 @@
X DIP Switches:
X
X The DIP switches accessible on the accessible end of the card while
- it is installed, is used to set the arcnet address. There are 8
+ it is installed, is used to set the ARCnet address. There are 8
X switches. Use an address from 1 to 254.
X
X Switch No.
- 12345678 Arcnet address
+ 12345678 ARCnet address
X -----------------------------------------
X 00000000 FF (Don't use this!)
X 00000001 FE
@@ -1222,7 +1222,7 @@
X from the upper memory regions, and then attempting to load ARCETHER
X using these addresses.
X
- I recommend using an arcnet memory address of 0xD000, and putting
+ I recommend using an ARCnet memory address of 0xD000, and putting
X the EMS page frame at 0xC000 while using QEMM stealth mode. That
X way, you get contiguous high memory from 0xD100 almost all the way
X the end of the megabyte.
@@ -1687,7 +1687,7 @@
X |____________________________________________| |__|
X
X
-UM9065L : Arcnet Controller
+UM9065L : ARCnet Controller
X
X SW 1 : Shared Memory Address and I/O Base
X
@@ -1800,7 +1800,7 @@
X J1-J5 IRQ Select
X J6-J21 Unknown (Probably extra timeouts & ROM enable ...)
X LED1 Activity LED
-BNC Coax connector (STAR arcnet)
+BNC Coax connector (STAR ARCnet)
X RAM 2k of SRAM
X ROM Boot ROM socket
X UFS Unidentified Flying Sockets
@@ -1905,7 +1905,7 @@
X ------------------------
X - from Vojtech Pavlik <Vojtech...@st.mff.cuni.cz>
X
-This is another SMC 90C65 based arcnet card. I couldn't identify the
+This is another SMC 90C65-based ARCnet card. I couldn't identify the
X manufacturer, but it might be DataPoint, because the card has the
X original arcNet logo in its upper right corner.
X
@@ -1942,9 +1942,9 @@
X SW2 1-8: Node ID Select
X SW3 1-5: IRQ Select
X 6-7: Extra Timeout
- 8 : Rom Enable
+ 8 : ROM Enable
X BNC Coax connector
-XTAL 20MHz Crystal
+XTAL 20 MHz Crystal
X
X
X Setting the Node ID
@@ -2081,11 +2081,11 @@
X 6-8 Base I/O Address Select
X SW2 1-8 Node ID Select (ID0-ID7)
X J1 IRQ Select
-J2 Rom Enable
+J2 ROM Enable
X J3 Extra Timeout
X LED1 Activity LED
-BNC Coax connector (BUS arcnet)
-RJ Twisted Pair Connector (daisychain)
+BNC Coax connector (BUS ARCnet)
+RJ Twisted Pair Connector (daisy chain)
X
X
X Setting the Node ID
@@ -2419,7 +2419,7 @@
X
X Legend:
X
-COM90C65: Arcnet Probe
+COM90C65: ARCnet Probe
X S1 1-8: Node ID Select
X S2 1-3: I/O Base Address Select
X 4-6: Memory Base Address Select
@@ -2791,7 +2791,7 @@
X SW2 1-8: Node ID Select (ID0-ID7)
X SW3 1-5: IRQ Select
X 6-7: Extra Timeout
- 8 : Rom Enable
+ 8 : ROM Enable
X JP1 Led connector
X BNC Coax connector
X
@@ -3089,7 +3089,7 @@
X 0 = Jumper Installed
X 1 = Open
X
-Top Jumper line Bit 7 = Rom Enable 654=Memory location 321=I/O
+Top Jumper line Bit 7 = ROM Enable 654=Memory location 321=I/O
X
X Settings for Memory Location (Top Jumper Line)
X 456 Address selected
diff -u --recursive --new-file v2.3.9/linux/Documentation/networking/arcnet.txt linux/Documentation/networking/arcnet.txt
--- v2.3.9/linux/Documentation/networking/arcnet.txt Mon Sep 14 11:32:22 1998
+++ linux/Documentation/networking/arcnet.txt Mon Jul 5 19:52:52 1999
@@ -1,4 +1,3 @@
-
X ----------------------------------------------------------------------------
X NOTE: See also arcnet-hardware.txt in this directory for jumper-setting
X and cabling information if you're like many of us and didn't happen to get a
@@ -92,10 +91,10 @@
X http://www.perftech.com/ or ftp to ftp.perftech.com.
X
X Novell makes a networking stack for DOS which includes ARCnet drivers. Try
-ftp'ing to ftp.novell.com.
+FTPing to ftp.novell.com.
X
X You can get the Crynwr packet driver collection (including arcether.com, the
-one you'll want to use with arcnet cards) from
+one you'll want to use with ARCnet cards) from
X oak.oakland.edu:/simtel/msdos/pktdrvr. It won't work perfectly on a 386+
X without patches, though, and also doesn't like several cards. Fixed
X versions are available on my WWW page, or via e-mail if you don't have WWW
@@ -183,7 +182,7 @@
X -----------------------
X
X Configure and rebuild Linux. When asked, answer 'm' to "Generic ARCnet
-support" and to support for your ARcnet chipset if you want to use the
+support" and to support for your ARCnet chipset if you want to use the
X loadable module. You can also say 'y' to "Generic ARCnet support" and 'm'
X to the chipset support if you wish.
X
@@ -269,7 +268,7 @@
X Arcether client, assuming you remember to load winpkt of course.
X
X LAN Manager and Windows for Workgroups: These programs use protocols that
- are incompatible with the internet standard. They try to pretend
+ are incompatible with the Internet standard. They try to pretend
X the cards are Ethernet, and confuse everyone else on the network.
X
X However, v2.00 and higher of the Linux ARCnet driver supports this
@@ -288,7 +287,7 @@
X you're completely insane, and/or you need to build some kind of
X hybrid network that uses both encapsulation types.
X
-OS2: I've been told it works under Warp Connect with an ARCnet driver from
+OS/2: I've been told it works under Warp Connect with an ARCnet driver from
X SMC. You need to use the 'arc0e' interface for this. If you get
X the SMC driver to work with the TCP/IP stuff included in the
X "normal" Warp Bonus Pack, let me know.
@@ -309,7 +308,7 @@
X The ARCnet driver v2.10 ALPHA supports three protocols, each on its own
X "virtual network device":
X
- arc0 - RFC1201 protocol, the official internet standard which just
+ arc0 - RFC1201 protocol, the official Internet standard which just
X happens to be 100% compatible with Novell's TRXNET driver.
X Version 1.00 of the ARCnet driver supported _only_ this
X protocol. arc0 is the fastest of the three protocols (for
@@ -331,13 +330,13 @@
X reasons yet to be determined. (Probably it's the smaller
X MTU that does it.)
X
- arc0s - The "[s]imple" RFC1051 protocol is the "previous" internet
+ arc0s - The "[s]imple" RFC1051 protocol is the "previous" Internet
X standard that is completely incompatible with the new
X standard. Some software today, however, continues to
X support the old standard (and only the old standard)
X including NetBSD and AmiTCP. RFC1051 also does not support
X RFC1201's packet splitting, and the MTU of 507 is still
- smaller than the internet "requirement," so it's quite
+ smaller than the Internet "requirement," so it's quite
X possible that you may run into problems. It's also slower
X than RFC1201 by about 25%, for the same reason as arc0e.
X
@@ -388,16 +387,16 @@
X Linux but runs the free Microsoft LANMAN Client instead.
X
X Worse, one of the Linux computers (freedom) also has a modem and acts as
- a router to my internet provider. The other Linux box (insight) also has
+ a router to my Internet provider. The other Linux box (insight) also has
X its own IP address and needs to use freedom as its default gateway. The
- XT (patience), however, does not have its own internet IP address and so
+ XT (patience), however, does not have its own Internet IP address and so
X I assigned it one on a "private subnet" (as defined by RFC1597).
X
X To start with, take a simple network with just insight and freedom.
X Insight needs to:
X - talk to freedom via RFC1201 (arc0) protocol, because I like it
X more and it's faster.
- - use freedom as its internet gateway.
+ - use freedom as its Internet gateway.
X
X That's pretty easy to do. Set up insight like this:
X ifconfig arc0 insight
@@ -417,20 +416,20 @@
X /* and default gateway is configured by pppd */
SHAR_EOF
true || echo 'restore of patch-2.3.10 failed'
fi
echo 'End of part 01'
echo 'File patch-2.3.10 is continued in part 02'
echo 02 > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Jul 9, 1999, 3:00:00 AM7/9/99
to
Archive-name: v2.3/patch-2.3.10/part02

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


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

# file patch-2.3.10 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.3.10'
else
echo 'x - continuing with patch-2.3.10'


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

X
X Great, now insight talks to freedom directly on arc0, and sends packets
- to the internet through freedom. If you didn't know how to do the above,
+ to the Internet through freedom. If you didn't know how to do the above,
X you should probably stop reading this section now because it only gets
X worse.
X
X Now, how do I add patience into the network? It will be using LANMAN
X Client, which means I need the arc0e device. It needs to be able to talk
X to both insight and freedom, and also use freedom as a gateway to the
- internet. (Recall that patience has a "private IP address" which won't
- work on the internet; that's okay, I configured Linux IP masquerading on
+ Internet. (Recall that patience has a "private IP address" which won't
+ work on the Internet; that's okay, I configured Linux IP masquerading on
X freedom for this subnet).
X
X So patience (necessarily; I don't have another IP number from my
X provider) has an IP address on a different subnet than freedom and
- insight, but needs to use freedom as an internet gateway. Worse, most
+ insight, but needs to use freedom as an Internet gateway. Worse, most
X DOS networking programs, including LANMAN, have braindead networking
X schemes that rely completely on the netmask and a 'default gateway' to
X determine how to route packets. This means that to get to freedom or
@@ -449,7 +448,7 @@
X
X This way, freedom will send all packets for patience through arc0e,
X giving its IP address as gatekeeper (on the private subnet). When it
- talks to insight or the internet, it will use its "freedom" internet IP
+ talks to insight or the Internet, it will use its "freedom" Internet IP
X address.
X
X You will notice that we haven't configured the arc0e device on insight.
@@ -473,7 +472,7 @@
X
X
X [RFC1201 NETWORK] [ETHER-ENCAP NETWORK]
- (registered internet subnet) (RFC1597 private subnet)
+ (registered Internet subnet) (RFC1597 private subnet)
X
X (IP Masquerade)
X /---------------\ * /---------------\
@@ -523,7 +522,7 @@
X Once the driver is running, you can run the arcdump shell script (available
X from me or in the full ARCnet package, if you have it) as root to list the
X contents of the arcnet buffers at any time. To make any sense at all out of
-this, you should grab the pertinent RFC's. (some are listed near the top of
+this, you should grab the pertinent RFCs. (some are listed near the top of
X arcnet.c). arcdump assumes your card is at 0xD0000. If it isn't, edit the
X script.
X
diff -u --recursive --new-file v2.3.9/linux/Documentation/networking/baycom.txt linux/Documentation/networking/baycom.txt
--- v2.3.9/linux/Documentation/networking/baycom.txt Sun Jun 7 11:13:44 1998
+++ linux/Documentation/networking/baycom.txt Tue Jul 6 19:16:55 1999
@@ -31,7 +31,7 @@
X Its devices are called bcp0 through bcp3.
X
X baycom_epp:
- This driver supports the epp modem.
+ This driver supports the EPP modem.
X Its devices are called bce0 through bce3.
X This driver is work-in-progress.
X
@@ -60,10 +60,10 @@
X an additional power supply. Furthermore, it incorporates a carrier
X detect circuitry.
X
-epp: This is a high speed modem adaptor that connects to an enhanced parallel port.
+EPP: This is a high-speed modem adaptor that connects to an enhanced parallel port.
X Its target audience is users working over a high speed hub (76.8kbit/s).
X
-eppfpga: This is a redesign of the epp adaptor.
+eppfpga: This is a redesign of the EPP adaptor.
X
X
X
diff -u --recursive --new-file v2.3.9/linux/Documentation/networking/cs89x0.txt linux/Documentation/networking/cs89x0.txt
--- v2.3.9/linux/Documentation/networking/cs89x0.txt Fri Sep 11 11:21:57 1998
+++ linux/Documentation/networking/cs89x0.txt Tue Jul 6 19:16:55 1999
@@ -203,7 +203,7 @@
X * io=### - specify IO address (200h-360h)
X * irq=## - specify interrupt level
X * mmode=##### - specify memory base address
-* dma=# - specify dma channel
+* dma=# - specify DMA channel
X * media=rj45 - specify media type
X or media=2
X or media=aui
@@ -412,33 +412,33 @@
X assigned during hardware configuration. The following tests are performed:
X
X * IO Register Read/Write Test
- The IO Register Read/Write test insures that the CS8900/20 can be
+ The IO Register Read/Write test ensures that the CS8900/20 can be
X accessed in IO mode, and that the IO base address is correct.
X
X * Shared Memory Test
- The Shared Memory test insures the CS8900/20 can be accessed in memory
+ The Shared Memory test ensures the CS8900/20 can be accessed in memory
X mode and that the range of memory addresses assigned does not conflict
X with other devices in the system.
X
X * Interrupt Test
- The Interrupt test insures there are no conflicts with the assigned IRQ
+ The Interrupt test ensures there are no conflicts with the assigned IRQ
X signal.
X
X * EEPROM Test
- The EEPROM test insures the EEPROM can be read.
+ The EEPROM test ensures the EEPROM can be read.
X
X * Chip RAM Test
- The Chip RAM test insures the 4K of memory internal to the CS8900/20 is
+ The Chip RAM test ensures the 4 K of memory internal to the CS8900/20 is
X working properly.
X
X * Internal Loop-back Test
- The Internal Loop Back test insures the adapter's transmitter and
+ The Internal Loop Back test ensures the adapter's transmitter and
X receiver are operating properly. If this test fails, make sure the
X adapter's cable is connected to the network (check for LED activity for
X example).
X
X * Boot PROM Test
- The Boot PROM test insures the Boot PROM is present, and can be read.
+ The Boot PROM test ensures the Boot PROM is present, and can be read.
X Failure indicates the Boot PROM was not successfully read due to a
X hardware problem or due to a conflicts on the Boot PROM address
X assignment. (Test only applies if the adapter is configured to use the
@@ -564,7 +564,7 @@
X Telephone :(800) 888-5016 (from inside U.S. and Canada)
X :(512) 442-7555 (from outside the U.S. and Canada)
X Fax :(512) 912-3871
-Email :ethe...@crystal.cirrus.com
+E-mail :ethe...@crystal.cirrus.com
X WWW :http://www.crystal.com
X
X
diff -u --recursive --new-file v2.3.9/linux/Documentation/networking/olympic.txt linux/Documentation/networking/olympic.txt
--- v2.3.9/linux/Documentation/networking/olympic.txt Wed Dec 31 16:00:00 1969
+++ linux/Documentation/networking/olympic.txt Mon Jul 5 19:54:55 1999
@@ -0,0 +1,75 @@
+
+IBM PCI Pit/Pit-Phy/Olympic CHIPSET BASED TOKEN RING CARDS README
+
+Release 0.2.0 - Release
+ June 8th 1999 Peter De Schrijver & Mike Phillips
+
+
+Thanks:
+Erik De Cock, Adrian Bridgett and Frank Fiene for their
+patience and testing.
+Paul Norton without whose tr.c code we would have had
+a lot more work to do.
+
+Options:
+
+The driver accepts three options: ringspeed, pkt_buf_sz, and
+message_level.
+
+These options can be specified differently for each card found.
+
+ringspeed: Has one of three settings 0 (default), 4 or 16. 0 will
+make the card autosense the ringspeed and join at the appropriate speed,
+this will be the default option for most people. 4 or 16 allow you to
+explicitly force the card to operate at a certain speed. The card will fail
+if you try to insert it at the wrong speed. (Although some hubs will allow
+this so be *very* careful). The main purpose for explicitly setting the ring
+speed is for when the card is first on the ring. In autosense mode, if the card
+cannot detect any active monitors on the ring it will not open, so you must
+re-init the card at the appropriate speed. Unfortunately at present the only
+way of doing this is rmmod and insmod which is a bit tough if it is compiled
+in the kernel.
+
+pkt_buf_sz: This is this initial receive buffer allocation size. This will
+default to 4096 if no value is entered. You may increase performance of the
+driver by setting this to a value larger than the network packet size, although
+the driver now re-sizes buffers based on MTU settings as well.
+
+message_level: Controls level of messages created by the driver. Defaults to 0:
+which only displays start-up and critical messages. Presently any non-zero
+value will display all soft messages as well. NB This does not turn
+debuging messages on, that must be done by modified the source code.
+
+Multi-card:
+
+The driver will detect multiple cards and will work with shared interrupts,
+each card is assigned the next token ring device, i.e. tr0 , tr1, tr2. The
+driver should also happily reside in the system with other drivers. It has
+been tested with ibmtr.c running, and I personnally have had one Olicom PCI
+card and two IBM olympic cards (all on the same interrupt), all running
+together.
+
+Variable MTU size:
+
+The driver can handle a MTU size upto either 4500 or 18000 depending upon
+ring speed. The driver also changes the size of the receive buffers as part
+of the mtu re-sizing, so if you set mtu = 18000, you will need to be able
+to allocate 16 * (sk_buff with 18000 buffer size) call it 18500 bytes per ring
+position = 296,000 bytes of memory space, plus of course anything
+necessary for the tx sk_buff's. Remember this is per card, so if you are
+building routers, gateway's etc, you could start to use a lot of memory
+real fast.
+
+Network Monitor Mode:
+
+By modifying the #define OLYMPIC_NETWORK_MONITOR from 0 to 1 in the
+source code the driver will implement a quasi network monitoring
+mode. All unexpected MAC frames (beaconing etc.) will be received
+by the driver and the source and destination addresses printed.
+Also an entry will be added in /proc/net called olympic_tr. This
+displays low level information about the configuration of the ring and
+the adapter. This feature has been designed for network adiministrators
+to assist in the diagnosis of network / ring problems.
+
+6/8/99 Peter De Schrijver and Mike Phillips
+
diff -u --recursive --new-file v2.3.9/linux/Documentation/networking/policy-routing.txt linux/Documentation/networking/policy-routing.txt
--- v2.3.9/linux/Documentation/networking/policy-routing.txt Thu May 14 10:26:22 1998
+++ linux/Documentation/networking/policy-routing.txt Tue Jul 6 19:05:48 1999
@@ -83,7 +83,7 @@
X 2. Opposite case. Just forget all that you know about routing
X tables. Every rule is supplied with its own gateway, device
X info. record. This approach is not appropriate for automated
- route maintanance, but it is ideal for manual configuration.
+ route maintenance, but it is ideal for manual configuration.
X
X HOWTO: iproute addrule [ from PREFIX ] [ to PREFIX ] [ tos TOS ]
X [ dev INPUTDEV] [ pref PREFERENCE ] route [ gw GATEWAY ]
diff -u --recursive --new-file v2.3.9/linux/Documentation/networking/z8530drv.txt linux/Documentation/networking/z8530drv.txt
--- v2.3.9/linux/Documentation/networking/z8530drv.txt Wed May 20 18:54:34 1998
+++ linux/Documentation/networking/z8530drv.txt Tue Jul 6 19:05:48 1999
@@ -252,7 +252,7 @@
X
X speed 1200 # the default baudrate
X clock dpll # clock source:
- # dpll = normal halfduplex operation
+ # dpll = normal half duplex operation
X # external = MODEM provides own Rx/Tx clock
X # divider = use full duplex divider if
X # installed (1)
diff -u --recursive --new-file v2.3.9/linux/Documentation/oops-tracing.txt linux/Documentation/oops-tracing.txt
--- v2.3.9/linux/Documentation/oops-tracing.txt Tue Jan 5 11:14:24 1999
+++ linux/Documentation/oops-tracing.txt Thu Jul 1 10:54:31 1999
@@ -1,15 +1,16 @@
X Quick Summary
X -------------
X
-cd /usr/src/linux/scripts/ksymoops
-make ksymoops
-./ksymoops < the_oops.txt
+Install ksymoops from ftp://ftp.ocs.com.au/pub/ksymoops
+Read the ksymoops man page.
+ksymoops < the_oops.txt
X
X and send the output the maintainer of the kernel area that seems to be
-involved with the problem. Don't worry too much about getting the wrong
-person. If you are unsure send it to the person responsible for the code
-relevant to what you were doing. If it occurs repeatably try and describe
-how to recreate it. Thats worth even more than the oops
+involved with the problem, not to the ksymoops maintainer. Don't worry
+too much about getting the wrong person. If you are unsure send it to
+the person responsible for the code relevant to what you were doing.
+If it occurs repeatably try and describe how to recreate it. Thats
+worth even more than the oops
X
X If you are totally stumped as to whom to send the report, send it to
X linux-...@vger.rutgers.edu. Thanks for your help in making Linux as
@@ -41,9 +42,8 @@
X same compiler and similar setups.
X
X The other thing to do is disassemble the "Code:" part of the bug report:
-ksymoops will do this too with the correct tools (and new version of
-ksymoops), but if you don't have the tools you can just do a silly
-program:
+ksymoops will do this too with the correct tools, but if you don't have
+the tools you can just do a silly program:
X
X char str[] = "\xXX\xXX\xXX...";
X main(){}
diff -u --recursive --new-file v2.3.9/linux/Documentation/parport.txt linux/Documentation/parport.txt
--- v2.3.9/linux/Documentation/parport.txt Fri Mar 26 13:23:24 1999
+++ linux/Documentation/parport.txt Sun Jul 4 10:14:13 1999
@@ -28,8 +28,8 @@
X
X to tell the parport code that you want three PC-style ports, one at
X 0x3bc with no IRQ, one at 0x378 using IRQ 7, and one at 0x278 with an
-auto-detected IRQ. Currently, PC-style (parport_pc) and Sun Ultra/AX
-(parport_ax) hardware is supported; more is in the works.
+auto-detected IRQ. Currently, PC-style (parport_pc), Sun Ultra/AX
+(parport_ax), Amiga, Atari, and MFC3 hardware is supported.
X
X
X KMod
@@ -38,7 +38,7 @@
X If you use kmod, you will find it useful to edit /etc/conf.modules.
X Here is an example of the lines that need to be added:
X
- alias parport_lowlevel parport_pc
+ post-install parport modprobe -k parport_pc
X options parport_pc io=0x378,0x278 irq=7,auto
X
X KMod will then automatically load parport_pc (with the options
@@ -49,20 +49,15 @@
X Parport probe [optional]
X -------------
X
-Once the architecture-dependent part of the parport code is loaded
-into the kernel, you can insert the parport_probe module with:
-
- # insmod parport_probe.o
-
-This will perform an IEEE1284 probe of any attached devices and log a
-message similar to:
+In 2.2 kernels there was a module called parport_probe, which was used
+for collecting IEEE 1284 device ID information. This has now been
+enhanced and now lives with the IEEE 1284 support. When a parallel
+port is detected, the devices that are connected to it are analysed,
+and information is logged like this:
X
X parport0: Printer, BJC-210 (Canon)
X
-(If you are using kmod and have configured parport_probe as a module,
-this will just happen.)
-
-The probe information is available in /proc/parport/?/autoprobe.
+The probe information is available from files in /proc/sys/dev/parport/.
X
X
X Parport linked into the kernel statically
@@ -85,29 +80,74 @@
X ==============
X
X If you have configured the /proc filesystem into your kernel, you will
-see a new directory entry: /proc/parport. In there will be a
+see a new directory entry: /proc/sys/dev/parport. In there will be a
X directory entry for each parallel port for which parport is
-configured. In each of those directories are four files describing
-that parallel port. For example:
-
-File: Contents:
-
-/proc/parport/0/devices A list of the device drivers using
- that port. A "+" will appear by the
- name of the device currently using the
- port (it might not appear against any).
-
-/proc/parport/0/hardware Parallel port's base address, IRQ line
- and DMA channel.
-
-/proc/parport/0/irq The IRQ that parport is using for that
- port. This is in a separate file to
- allow you to alter it by writing a new
- value in (IRQ number or "none").
+configured. In each of those directories are a collection of files
+describing that parallel port.
X
-/proc/parport/0/autoprobe Any IEEE-1284 device ID information
- that has been acquired.
+The /proc/sys/dev/parport directory tree looks like:
X
+parport
+|-- default
+| |-- spintime
+| `-- timeslice
+|-- parport0
+| |-- autoprobe
+| |-- autoprobe0
+| |-- autoprobe1
+| |-- autoprobe2
+| |-- autoprobe3
+| |-- devices
+| | |-- active
+| | `-- lp
+| | `-- timeslice
+| |-- hardware
+| `-- spintime
+`-- parport1
+ |-- autoprobe
+ |-- autoprobe0
+ |-- autoprobe1
+ |-- autoprobe2
+ |-- autoprobe3
+ |-- devices
+ | |-- active
+ | `-- ppa
+ | `-- timeslice
+ |-- hardware
+ `-- spintime
+
+
+File: Contents:
+
+devices/active A list of the device drivers using that port. A "+"
+ will appear by the name of the device currently using
+ the port (it might not appear against any). The
+ string "none" means that there are no device drivers
+ using that port.
+
+hardware Parallel port's base address, IRQ line and DMA channel.
+
+autoprobe Any IEEE-1284 device ID information that has been
+ acquired from the (non-IEEE 1284.3) device.
+
+autoprobe[0-3] IEEE 1284 device ID information retrieved from
+ daisy-chain devices that conform to IEEE 1284.3.
+
+spintime The number of microseconds to busy-loop while waiting
+ for the peripheral to respond. You might find that
+ adjusting this improves performance, depending on your
+ peripherals. This is a port-wide setting, i.e. it
+ applies to all devices on a particular port.
+
+timeslice The number of jiffies (FIXME: this should be in
+ milliseconds or something) that a device driver is
+ allowed to keep a port claimed for. This is advisory,
+ and driver can ignore it if it must.
+
+default/* The defaults for spintime and timeslice. When a new
+ port is registered, it picks up the default spintime.
+ When a new device is registered, it picks up the
+ default timeslice.
X
X Device drivers
X ==============
@@ -135,7 +175,7 @@
X
X Also:
X
- * If you selected the IEEE-1284 autoprobe at compile time, you can say
+ * If you selected the IEEE 1284 support at compile time, you can say
X `lp=auto' on the kernel command line, and lp will create devices
X only for those ports that seem to have printers attached.
X
diff -u --recursive --new-file v2.3.9/linux/Documentation/pcwd-watchdog.txt linux/Documentation/pcwd-watchdog.txt
--- v2.3.9/linux/Documentation/pcwd-watchdog.txt Sun Jan 19 05:47:24 1997
+++ linux/Documentation/pcwd-watchdog.txt Tue Jul 6 19:05:48 1999
@@ -1,6 +1,6 @@
X Berkshire Products PC Watchdog Card
X Support for ISA Cards Revision A and C
- Documentation and Driver by Ken Hollis <kho...@nurk.org>
+ Documentation and Driver by Ken Hollis <ke...@bitgate.com>
X
X The PC Watchdog is a card that offers the same type of functionality that
X the WDT card does, only it doesn't require an IRQ to run. Furthermore,
@@ -15,7 +15,7 @@
X The Watchdog Driver will automatically find your watchdog card, and will
X attach a running driver for use with that card. After the watchdog
X drivers have initialized, you can then talk to the card using the PC
- Watchdog program, available from ftp.bitgate.com:/pub/bitgate/pcwd.
+ Watchdog program, available from http://ftp.bitgate.com/pcwd/.
X
X I suggest putting a "watchdog -d" before the beginning of an fsck, and
X a "watchdog -e -t 1" immediately after the end of an fsck. (Remember
@@ -128,4 +128,7 @@
X And that's all she wrote!
X
X -- Ken Hollis
- (kho...@nurk.org)
+ (ke...@bitgate.com)
+
+(This documentation may be out of date. Check
+ http://ftp.bitgate.com/pcwd/ for the absolute latest additions.)
diff -u --recursive --new-file v2.3.9/linux/Documentation/sound/Introduction linux/Documentation/sound/Introduction
--- v2.3.9/linux/Documentation/sound/Introduction Thu Apr 29 11:53:41 1999
+++ linux/Documentation/sound/Introduction Mon Jul 5 20:04:47 1999
@@ -1,6 +1,6 @@
-Soundcore Notes on Modular Sound Drivers and Soundcore
+Introduction Notes on Modular Sound Drivers and Soundcore
X Wade Hampton
-11/20/1998
+6/30/1999
X
X Purpose:
X ========
@@ -10,13 +10,21 @@
X
X Note, some of this probably should be added to the Sound-HOWTO!
X
+
X Copying:
X ========
X none
X
+
X History:
X ========
-0.1.0 11/20/1998 First version
+0.1.0 11/20/1998 First version, draft
+1.0.0 11/1998 Alan Cox changes, incorporation in 2.2.0
+ as /usr/src/linux/Documentation/sound/Introduction
+1.1.0 6/30/1999 Second version, added notes on making the drivers,
+ added info on multiple sound cards of similar types,]
+ added more diagnostics info, added info about esd.
+ added info on OSS and ALSA.
X
X
X Modular Sound Drivers:
@@ -58,6 +66,53 @@
X for the same or a similar feature (dma1= versus dma16=). As a last
X resort, inspect the code (search for MODULE_PARM).
X
+Notes:
+
+1. There is a new OpenSource sound driver called ALSA which is
+ currently under development: http://www.alsa-project.org/
+ I have not tried it nor am I aware of its status, but it is
+ currently under development.
+
+2. The commercial OSS driver may be obtained from the site:
+ http://www/opensound.com. This may be used for cards that
+ are unsupported by the kernel driver, or may be used
+ by other operating systems.
+
+3. The enlightenment sound daemon may be used for playing
+ multiple sounds at the same time via a single card, eliminating
+ some of the requirements for multiple sound card systems. For
+ more information, see: http://www.tux.org/~ricdude/EsounD.html
+ The "esd" program may be used with the real-player and mpeg
+ players like mpg123 and x11amp.
+
+
+Building the Modules:
+=====================
+
+This document does not provide full details on building the
+kernel, etc. The notes below apply only to making the kernel
+sound modules. If this conflicts with the kernel's README,
+the README takes precedence.
+
+1. To make the kernel sound modules, cd to your /usr/src/linux
+ directory (typically) and type make config, make menuconfig,
+ or make xconfig (to start the command line, dialog, or x-based
+ configuration tool).
+
+2. Select the Sound option and a dialog will be displayed.
+
+3. Select M (module) for "Sound card support".
+
+4. Select your sound driver(s) as a module. For ProAudio, Sound
+ Blaster, etc., select M (module) for OSS sound modules.
+ [thanks to marvin stodolsky <stod...@erols.com>]A
+
+5. Make the kernel (e.g., make dep ; make bzImage), and install
+ the kernel.
+
+6. Make the modules and install them (make modules; make modules_install).
+
+
X
X INSMOD:
X =======
@@ -82,6 +137,9 @@
X /sbin/insmod uart401
X /sbin/insmod sb io=$SB_BASE irq=$SB_IRQ dma=$SB_DMA dma16=$SB_DMA2 mpu_io=$SB_MP
X
+When using sound as a module, I typically put these commands
+in a file such as /root/soundon.sh.
+
X
X MODPROBE:
X =========
@@ -117,8 +175,8 @@
X soundcore 1968 8 [sb sound]
X
X
-Removing Sound:
-===============
+Removing Sound:
+===============
X
X Sound may be removed by using /sbin/rmmod in the reverse order
X in which you load the modules. Note, if a program has a sound device
@@ -134,6 +192,25 @@
X /sbin/rmmod soundlow
X /sbin/rmmod soundcore
X
+When using sound as a module, I typically put these commands
+in a script such as /root/soundoff.sh.
+
+
+Removing Sound for use with OSS:
+================================
+
+If you get really stuck or have a card that the kernel modules
+will not support, you can get a commercial sound driver from
+http://www.opensound.com. Before loading the commercial sound
+driver, you should do the following:
+
+1. remove sound modules (detailed above)
+2. remove the sound modules from /etc/conf.modules
+3. move the sound modules from /lib/modules/<kernel>/misc
+ (for example, I make a /lib/modules/<kernel>/misc/tmp
+ directory and copy the sound module files to that
+ directory).
+
X
X Multiple Sound Cards:
X =====================
@@ -154,11 +231,30 @@
X first (in my case "sb") and then load the other one
X (in my case "cs4232").
X
+If you have two cards of the same type that are jumpered
+cards or different PnP revisions, you may load the same
+module twice. For example, I have a SoundBlaster vibra 16
+and an older SoundBlaster 16 (jumpers). To load the module
+twice, you need to do the following:
+
+1. Copy the sound modules to a new name. For example
+ sb.o could be copied (or symlinked) to sb1.o for the
+ second SoundBlasster.
+
+2. Make a second entry in /etc/conf.modules, for example,
+ sound1 or sb1. This second entry should refer to the
+ new module names for example sb1, and should include
+ the I/O, etc. for the second sound card.
+
+3. Update your soundon.sh script, etc.
+
X Warning: I have never been able to get two PnP sound cards of the
X same type to load at the same time. I have tried this several times
X with the Soundblaster Vibra 16 cards. OSS has indicated that this
X is a PnP problem.... If anyone has any luck doing this, please
-send me an E-MAIL. PCI sound cards should not have this problem.
+send me an E-MAIL. PCI sound cards should not have this problem.a
+Since this was originally release, I have received a couple of
+mails from people who have accomplished this!
X
X
X Sound Problems:
@@ -175,6 +271,8 @@
X write down what addresses, IRQ, and DMA channels
X those were using for the same hardware. You probably
X can use these addresses, IRQs, and DMA channels.
+ You should really do this BEFORE attempting to get
+ sound working!
X
X B) Check (cat) /proc/interrupts, /proc/ioports,
X and /proc/dma. Are you trying to use an address,
@@ -184,22 +282,44 @@
X may need a kernel patch to get this device).
X
X D) Inspect your /var/log/messages file. Often that will
- indicate what IRQ or IO port could not be obtained
+ indicate what IRQ or IO port could not be obtained.
X
X E) Try another port or IRQ. Note this may involve
X using the PnP tools to move the sound card to
- another location.
+ another location. Sometimes this is the only way
+ and it is more or less trial and error.
X
-2) If you get motorboating (the same sound or part of a
+2) If you get motor-boating (the same sound or part of a
X sound clip repeated), you probably have either an IRQ
- or DMA conflict. Move the card to another address. This
- has happened to me when playing long files when I had
- an IRQ conflict.
+ or DMA conflict. Move the card to another IRQ or DMA
+ port. This has happened to me when playing long files
+ when I had an IRQ conflict.
+
+3. If you get dropouts or pauses when playing high sample
+ rate files such as using mpg123 or x11amp/xmms, you may
+ have too slow of a CPU and may have to use the options to
+ play the files at 1/2 speed. For example, you may use
+ the -2 or -4 option on mpg123. You may also get this
+ when trying to play mpeg files stored on a CD-ROM
+ (my Toshiba T8000 PII/366 sometimes has this problem).
+
+4. If you get "cannot access device" errors, your /dev/dsp
+ files, etc. may be set to owner root, mode 600. You
+ may have to use the command:
+ chmod 666 /dev/dsp /dev/mixer /dev/audio
+
+5. If you get "device busy" errors, another program has the
+ sound device open. For example, if using the Enlightenment
+ sound daemon "esd", the "esd" program has the sound device.
+ If using "esd", please RTFM the docs on ESD. For example,
+ esddsp <program> may be used to play files via a non-esd
+ aware program.
+
X
-3) Ask for help on the sound list or send E-MAIL to the
+6) Ask for help on the sound list or send E-MAIL to the
X sound driver author/maintainer.
X
-4) Turn on debug in drivers/sound/sound_config.h (DEB, DDB, MDB).
+7) Turn on debug in drivers/sound/sound_config.h (DEB, DDB, MDB).
X
X
X Configuring Sound:
@@ -210,7 +330,8 @@
X 1) Hardcoded in the kernel at compile time (not applicable when
X using sound modules). This was the OLD way!
X
-2) On the command line when using insmod.
+2) On the command line when using insmod or in a bash script
+ using command line calls to load sound.
X
X 3) In /etc/conf.modules when using modprobe.
X
@@ -224,7 +345,6 @@
X Anyone want to write a linuxconf module for configuring sound?
X
X
-
X For More Information (RTFM):
X ============================
X 1) Information on kernel modules: linux/Documentation/modules.txt
@@ -242,12 +362,17 @@
X
X 7) The sndconfig and rhsound documentation from Red Hat.
X
-8) The Linux-sound mailing list: sound...@redhat.com
+8) The Linux-sound mailing list: sound...@redhat.com.
+
+9) Enlightenment documentation (for info on esd)
+ http://www.tux.org/~ricdude/EsounD.html.
X
+10) ALSA home page: http://www.alsa-project.org/
X
X
X Contact Information:
X ====================
X Wade Hampton: (wham...@staffnet.com)
+
X
X
diff -u --recursive --new-file v2.3.9/linux/Documentation/sound/OPL3-SA2 linux/Documentation/sound/OPL3-SA2
--- v2.3.9/linux/Documentation/sound/OPL3-SA2 Thu Jan 14 22:53:02 1999
+++ linux/Documentation/sound/OPL3-SA2 Mon Jul 5 20:04:47 1999
@@ -46,6 +46,21 @@
X then email me if you are willing to experiment in an effort to make it
X work.
X
+************************************************************************
+* I have now had two such machines, and I have fixed this to work
+* properly when built into the kernel. The Toshiba Libretto series, or
+* at least models 70CT and 110CT which I have owned, use a Yamaha
+* OPL3-SAx (OPL3-SA3 according to documentation) sound chip, IRQ 5,
+* IO addresses 220/530/388/330/370 and DMA 1,0 (_not_ 0,1). All these
+* configuration settings can be gathered by booting another OS which
+* recognizes the card already.
+*
+* I have made things 'just work' for the non-modular case on such
+* machines when configured properly.
+*
+* David Luyer <lu...@ucs.uwa.edu.au>
+************************************************************************
+
X If you are using isapnp, follow the directions in its documentation to
X produce a configuration file. Here is the relevant excerpt I use for
X my SAx card from my isapnp.conf:
diff -u --recursive --new-file v2.3.9/linux/Documentation/sysctl/README linux/Documentation/sysctl/README
--- v2.3.9/linux/Documentation/sysctl/README Mon Apr 12 10:10:27 1999
+++ linux/Documentation/sysctl/README Mon Jul 5 20:04:47 1999
@@ -1,4 +1,4 @@
-Documentation for /proc/sys/ kernel version 2.2.5
+Documentation for /proc/sys/ kernel version 2.2.10
X (c) 1998, 1999, Rik van Riel <ri...@nl.linux.org>
X
X 'Why', I hear you ask, 'would anyone even _want_ documentation
diff -u --recursive --new-file v2.3.9/linux/Documentation/sysctl/fs.txt linux/Documentation/sysctl/fs.txt
--- v2.3.9/linux/Documentation/sysctl/fs.txt Mon Apr 12 10:10:27 1999
+++ linux/Documentation/sysctl/fs.txt Mon Jul 5 20:04:47 1999
@@ -1,4 +1,4 @@
-Documentation for /proc/sys/fs/* kernel version 2.2.5
+Documentation for /proc/sys/fs/* kernel version 2.2.10
X (c) 1998, 1999, Rik van Riel <ri...@nl.linux.org>
X
X For general info and legal blurb, please look in README.
diff -u --recursive --new-file v2.3.9/linux/Documentation/sysctl/kernel.txt linux/Documentation/sysctl/kernel.txt
--- v2.3.9/linux/Documentation/sysctl/kernel.txt Mon Apr 12 10:10:27 1999
+++ linux/Documentation/sysctl/kernel.txt Mon Jul 5 20:04:47 1999
@@ -1,4 +1,4 @@
-Documentation for /proc/sys/kernel/* kernel version 2.2.5
+Documentation for /proc/sys/kernel/* kernel version 2.2.10
X (c) 1998, 1999, Rik van Riel <ri...@nl.linux.org>
X
X For general info and legal blurb, please look in README.
@@ -76,12 +76,21 @@
X
X domainname & hostname:
X
-These files can be controlled to set the domainname and
-hostname of your box. For the classic darkstar.frop.org
-a simple:
+These files can be used to set the NIS/YP domainname and the
+hostname of your box in exactly the same way as the commands
+domainname and hostname, i.e.:
X # echo "darkstar" > /proc/sys/kernel/hostname
-# echo "frop.org" > /proc/sys/kernel/domainname
-would suffice to set your hostname and domainname.
+# echo "mydomain" > /proc/sys/kernel/domainname
+has the same effect as
+# hostname "darkstar" > /proc/sys/kernel/hostname
+# domainname "mydomain" > /proc/sys/kernel/domainname
+
+Note, however, that the classic darkstar.frop.org has the
+hostname "darkstar" and DNS (Internet Domain Name Server)
+domainname "frop.org", not to be confused with the NIS (Network
+Information Service) or YP (Yellow Pages) domainname. These two
+domain names are in general different. For a detailed discussion
+see the hostname(1) man page.
X
X ==============================================================
X
diff -u --recursive --new-file v2.3.9/linux/Documentation/sysctl/sunrpc.txt linux/Documentation/sysctl/sunrpc.txt
--- v2.3.9/linux/Documentation/sysctl/sunrpc.txt Mon Apr 12 10:10:27 1999
+++ linux/Documentation/sysctl/sunrpc.txt Mon Jul 5 20:04:47 1999
@@ -1,4 +1,4 @@
-Documentation for /proc/sys/sunrpc/* kernel version 2.2.5
+Documentation for /proc/sys/sunrpc/* kernel version 2.2.10
X (c) 1998, 1999, Rik van Riel <ri...@nl.linux.org>
X
X For general info and legal blurb, please look in README.
diff -u --recursive --new-file v2.3.9/linux/Documentation/sysctl/vm.txt linux/Documentation/sysctl/vm.txt
--- v2.3.9/linux/Documentation/sysctl/vm.txt Thu Apr 29 11:53:41 1999
+++ linux/Documentation/sysctl/vm.txt Mon Jul 5 20:04:47 1999
@@ -1,4 +1,4 @@
-Documentation for /proc/sys/vm/* kernel version 2.2.5
+Documentation for /proc/sys/vm/* kernel version 2.2.10
X (c) 1998, 1999, Rik van Riel <ri...@nl.linux.org>
X
X For general info and legal blurb, please look in README.
diff -u --recursive --new-file v2.3.9/linux/Documentation/video4linux/API.html linux/Documentation/video4linux/API.html
--- v2.3.9/linux/Documentation/video4linux/API.html Thu Jan 7 08:41:55 1999
+++ linux/Documentation/video4linux/API.html Mon Jul 5 20:04:47 1999
@@ -1,6 +1,9 @@
X <HTML><HEAD>
-<TITLE>Video4Linux Kernel API Reference v0.1:19980516</TITLE>
+<TITLE>Video4Linux Kernel API Reference v0.1:19990430</TITLE>
X </HEAD>
+<! Revision History: >
+<! 4/30/1999 - Fred Gleason (fr...@wava.com)>
+<! Documented extensions for the Radio Data System (RDS) extensions >
X <BODY bgcolor="#ffffff">
X <H3>Devices</H3>
X Video4Linux provides the following sets of device files. These live on the
@@ -117,7 +120,7 @@
X </TABLE>
X <P>
X Merely setting the window does not enable capturing. Overlay capturing
-is activatied by passing the <b>VIDIOCCAPTURE</b> ioctl a value of 1, and
+is activated by passing the <b>VIDIOCCAPTURE</b> ioctl a value of 1, and
X disabled by passing it a value of 0.
X <P>
X Some capture devices can capture a subfield of the image they actually see.
@@ -150,7 +153,7 @@
X nature of the channel itself.
X <P>
X The <b>VIDIOCSCHAN</b> ioctl takes an integer argument and switches the
-capture to this input. It is not defined whether paramters such as colour
+capture to this input. It is not defined whether parameters such as colour
X settings or tuning are maintained across a channel switch. The caller should
X maintain settings as desired for each channel. (This is reasonable as
X different video inputs may have different properties).
@@ -249,6 +252,8 @@
X <TR><TD><b>VIDEO_TUNER_LOW</b><TD>Frequency is in a lower range</TD>
X <TR><TD><b>VIDEO_TUNER_NORM</b><TD>The norm for this tuner is settable</TD>
X <TR><TD><b>VIDEO_TUNER_STEREO_ON</b><TD>The tuner is seeing stereo audio</TD>
+<TR><TD><b>VIDEO_TUNER_RDS_ON</b><TD>The tuner is seeing a RDS datastream</TD>
+<TR><TD><b>VIDEO_TUNER_MBS_ON</b><TD>The tuner is seeing a MBS datastream</TD>
X </TABLE>
X <P>
X The following modes are defined
@@ -349,6 +354,21 @@
X <TR><TD><b>teletext</b><TD>Teletext device</TD>
X </TABLE>
X <P>
-
+<H3>RDS Datastreams</H3>
+For radio devices that support it, it is possible to receive Radio Data
+System (RDS) data by means of a read() on the device. The data is packed in
+groups of three, as follows:
+<TABLE>
+<TR><TD>First Octet</TD><TD>Least Siginificant Byte of RDS Block</TD></TR>
+<TR><TD>Second Octet</TD><TD>Most Siginificant Byte of RDS Block
+<TR><TD>Third Octet</TD><TD>Bit 7:</TD><TD>Error bit. Indicates that
+an uncorrectable error occured during reception of this block.</TD></TR>
+<TR><TD>&nbsp;</TD><TD>Bit 6:</TD><TD>Corrected bit. Indicates that
+an error was corrected for this data block.</TD></TR>
+<TR><TD>&nbsp;</TD><TD>Bits 5-3:</TD><TD>Reeived Offset. Indicates the
+offset received by the sync system.</TD></TR>
+<TR><TD>&nbsp;</TD><TD>Bits 2-0:</TD><TD>Offset Name. Indicates the
+offset applied to this data.</TD></TR>
+</TABLE>
X </BODY>
X </HTML>
diff -u --recursive --new-file v2.3.9/linux/Documentation/video4linux/README.buz linux/Documentation/video4linux/README.buz
--- v2.3.9/linux/Documentation/video4linux/README.buz Wed Dec 31 16:00:00 1969
+++ linux/Documentation/video4linux/README.buz Mon Jul 5 20:04:47 1999
@@ -0,0 +1,212 @@
+Iomega Buz Driver for Linux
+===========================
+
+by Rainer Johanni <Rai...@Johanni.de>
+
+Compiling and Loading the Driver
+================================
+
+You must run a 2.2.x kernel in order to use this driver.
+
+To compile the driver, just type make.
+
+Besides the files in this directory, the driver needs the
+'videodev' and the 'i2c' module from the Linux kernel.
+In order to get these modules available, enable module support
+for VIDEODEV and BTTV (which implies i2c) in your kernel
+configuration. You find these devices in the menu
+"Character Devices" in your Kernel Configuration.
+
+Before you load the driver you must have a video device
+at major device node 81. If you don't have it yet, do the
+following (as root!):
+
+cd /dev
+mknod video0 c 81 0
+ln -s video0 video
+
+Edit the 'update' script if you want to give the driver
+special options and then type (as root)
+
+./update
+
+to insert all the necessary modules into the kernel.
+
+If you want to make full use of the Video for Linux uncompressed
+grabbing facilities, you must either
+
+- obtain and install the "big_physarea patch" for your kernel and
+ set aside the necessary memory during boot time.
+ There seem to be several versions of this patch against
+ various kernel versions floating around in the net,
+ you may obtain one e.g. from:
+ http://www.polyware.nl/~middelin/patch/bigphysarea-2.2.1.tar.gz
+ You also have to compile your driber AFTER installing that patch
+ in order to get it working
+
+ or
+
+- start your kernel with the mem=xxx option, where xxx is your
+ real memory minus the memory needed for the buffers.
+ For doing this add an entry in lilo.conf (if you use lilo):
+ append "mem=xxxM"
+ or add a line in your linux.par file (if you use loadlin):
+ mem=xxxM
+
+The second method is by far easier, however it is dangerous
+if more than one driver at a time has the idea to use the memory
+leftover by setting the mem=xxx parameter below the actual
+memory size.
+
+Read also below how to use this memory!
+
+
+
+Driver Options
+==============
+
+You are able to customize the behavior of the driver by giving
+it some options at start time.
+
+default_input, default_norm
+---------------------------
+
+As soon as the driver is loaded, the Buz samples video signals
+from one of its input ports and displays it on its output.
+The driver uses the Composite Input and the video norm PAL for this.
+If you want to change this default behavior, set default_input=1
+(for S-VHS input) or default_norm=1 for NTSC.
+
+v4l_nbufs, v4l_bufsize
+----------------------
+
+In order to make to make full use of the Video for Linux picture
+grabbing facilities of the driver (which are needed by many
+Video for Linux applications), the driver needs a set of
+physically contiguous buffers for grabbing. These parameters
+determine how many buffers of which size the driver will
+allocate at open (the open will fail if it is unable to do so!).
+
+These values do not affect the MJPEG grabbing facilities of the driver,
+they are needed for uncompressed image grabbing only!!!
+
+v4l_nbufs is the number of buffers to allocate, a value of 2 (the default)
+should be sufficient in allmost all cases. Only special applications
+(streaming captures) will need more buffers and then mostly the
+MJPEG capturing features of the Buz will be more apropriate.
+So leave this parameter at it's default unless you know what you do.
+
+The things for v4l_bufsize are more complicated:
+v4l_bufsize is set by default to 128 [KB] which is the maximum
+amount of physically contiguous memory Linux is able to allocate
+without kernel changes. This is sufficient for grabbing 24 bit color images
+up to sizes of approx. 240x180 pixels (240*180*3 = 129600, 128 KB = 131072).
+
+In order to be able to capture bigger images you have either to
+- obtain and install the "big_physarea patch" and set aside
+ the necessary memory during boot time or
+- start your kernel with the mem=xxx option, where xxx is your
+ real memory minus the memory needed for the buffers.
+In that case, usefull settings for v4l_bufsize are
+- 1296 [Kb] for grabbing 24 bit images of max size 768*576
+- 1728 [Kb] for 32bit images of same size (4*768*576 = 1728 Kb!)
+You may reduce these numbers accordingly if you know you are only
+grabbing 720 pixels wide images or NTSC images (max height 480).
+
+In some cases it may happen that Linux isn't even able to obtain
+the default 128 KB buffers. If you don't need uncompressed image
+grabbing at all, set v4l_bufsize to an arbitrary small value (e.g. 4)
+in order to be able to open the video device.
+
+vidmem
+------
+
+The video mem address of the video card.
+The driver has a little database for some videocards
+to determine it from there. If your video card is not in there
+you have either to give it to the driver as a parameter
+or set in in a VIDIOCSFBUF ioctl
+
+The videocard database is contained in the file "videocards.h"
+Gernot Ziegler wants to keep an actual version of that file.
+If your card is not contained in that file, look at
+http://www.lysator.liu.se/~gz/buz/ for an actual version of
+"videocards.h".
+
+triton, natoma
+--------------
+
+The driver tries to detect if you have a triton or natome chipset
+in order to take special messures for these chipsets.
+If this detection fails but you are sure you have such a chipset,
+set the corresponding variable to 1.
+This is a very special option and may go away in the future.
+
+
+
+Programming interface
+=====================
+
+This driver should be fully compliant to Video for Linux, so all
+tools working with Video for Linux should work with (hopefully)
+no problems.
+
+A description of the Video for Linux programming interace can be found at:
+http://roadrunner.swansea.linux.org.uk/v4lapi.shtml
+
+Besides the Video for Linux interface, the driver has a "proprietary"
+interface for accessing the Buz's MJPEG capture and playback facilities.
+
+The ioctls for that interface are as follows:
+
+BUZIOC_G_PARAMS
+BUZIOC_S_PARAMS
+
+Get and set the parameters of the buz. The user should allways
+do a BUZIOC_G_PARAMS (with a struct buz_params) to obtain the default
+settings, change what he likes and then make a BUZIOC_S_PARAMS call.
+A typical application should at least set the members
+input, norm and decimation of the struct buz_params.
+For a full description of all members see "buz.h"
+
+BUZIOC_REQBUFS
+
+Before being able to capture/playback, the user has to request
+the buffers he is wanting to use. Fill the structure
+buz_requestbuffers with the size (recommended: 256*1024) and
+the number (recommended 32 up to 256). There are no such restrictions
+as for the Video for Linux buffers, you should LEAVE SUFFICIENT
+MEMORY for your system however, else strange things will happen ....
+On return, the buz_requestbuffers structure contains number and
+size of the actually allocated buffers.
+You should use these numbers for doing a mmap of the buffers
+into the user space.
+The BUZIOC_REQBUFS ioctl also makes it happen, that the next mmap
+maps the MJPEG buffer instead of the V4L buffers.
+
+BUZIOC_QBUF_CAPT
+BUZIOC_QBUF_PLAY
+
+Queue a buffer for capture or playback. The first call also starts
+streaming capture. When streaming capture is going on, you may
+only queue further buffers or issue syncs until streaming
+capture is switched off again with a argument of -1 to
+a BUZIOC_QBUF_CAPT/BUZIOC_QBUF_PLAY ioctl.
+
+BUZIOC_SYNC
+
+Issue this ioctl when all buffers are queued. This ioctl will
+block until the first buffer becomes free for saving its
+data to disk (after BUZIOC_QBUF_CAPT) or for reuse (after BUZIOC_QBUF_PLAY).
+
+BUZIOC_G_STATUS
+
+Get the status of the input lines (video source connected/norm).
+This ioctl may be subject to change.
+
+
+
+
+
+See the examples directory delivered with this driver
+for actual coding examples!
diff -u --recursive --new-file v2.3.9/linux/Documentation/video4linux/bttv/PROBLEMS linux/Documentation/video4linux/bttv/PROBLEMS
--- v2.3.9/linux/Documentation/video4linux/bttv/PROBLEMS Sun Aug 23 13:32:25 1998
+++ linux/Documentation/video4linux/bttv/PROBLEMS Mon Jul 5 20:04:47 1999
@@ -17,9 +17,9 @@
X If this 64MB area overlaps the IO memory of the Bt848 you also have to
X remap this. E.g.: insmod bttv vidmem=0xfb0 remap=0xfa0
X
- If the videomemory is found at the right place and there are no address
- conflicts but still no picture (or the computer even crashes.),
- try disabling features of your PCI chipset in the BIOS Setup.
+ If the video memory is found at the right place and there are no address
+ conflicts but still no picture (or the computer even crashes),
+ try disabling features of your PCI chipset in the BIOS setup.
X
X Frank Kapahnke <fr...@kapahnke.prima.ruhr.de> also reported that problems
X with his S3 868 went away when he upgraded to XFree 3.2.
@@ -50,13 +50,13 @@
X
X Disable backing store by starting X with the option "-bs"
X
-- When using 32bpp in XFree or 24+8bpp mode in AccelX 3.1 the system
+- When using 32 bpp in XFree or 24+8bpp mode in AccelX 3.1 the system
X can sometimes lock up if you use more than 1 bt848 card at the same time.
X You will always get pixel errors when e.g. using more than 1 card in full
X screen mode. Maybe we need something faster than the PCI bus ...
X
X
-- Some S3 cards and the Matrox Mystique will produce pixel erros with
- full resolution in 32bit mode.
+- Some S3 cards and the Matrox Mystique will produce pixel errors with
+ full resolution in 32-bit mode.
X
-- Some video cards have problems with Accelerated X 4.1
\ No newline at end of file
+- Some video cards have problems with Accelerated X 4.1
diff -u --recursive --new-file v2.3.9/linux/Documentation/video4linux/bttv/README.RADIO linux/Documentation/video4linux/bttv/README.RADIO
--- v2.3.9/linux/Documentation/video4linux/bttv/README.RADIO Sun Aug 23 13:32:25 1998
+++ linux/Documentation/video4linux/bttv/README.RADIO Mon Jul 5 20:04:47 1999
@@ -6,7 +6,7 @@
X
X So you should have TV with (stereo) sound now. Radio does _not_ work.
X It probably does not work with sat receivers. I can't test this and
-therefore hav'nt added support for it yet. If someone needs this and
+therefore have not added support for it yet. If someone needs this and
X can help testing the sat stuff, drop me a note.
X
X Gerd
diff -u --recursive --new-file v2.3.9/linux/Documentation/video4linux/bttv/THANKS linux/Documentation/video4linux/bttv/THANKS
--- v2.3.9/linux/Documentation/video4linux/bttv/THANKS Sun Aug 23 13:32:25 1998
+++ linux/Documentation/video4linux/bttv/THANKS Mon Jul 5 20:04:47 1999
@@ -17,7 +17,7 @@
X components on their cards. (E.g. how the tuner type is detected)
X Without their card I could not have debugged the NTSC mode.
X
-- Hauppauge for telling how the sound input is selected and what compenents
+- Hauppauge for telling how the sound input is selected and what components
X they do and will use on their radio cards.
X Also many thanks for faxing me the FM1216 data sheet.
X
diff -u --recursive --new-file v2.3.9/linux/MAINTAINERS linux/MAINTAINERS
--- v2.3.9/linux/MAINTAINERS Wed Jun 30 13:38:18 1999
+++ linux/MAINTAINERS Tue Jul 6 19:16:55 1999
@@ -16,8 +16,8 @@
X SMC etherpower for that.)
X
X 3. Make sure your changes compile correctly in multiple
- configurations. In paticular check changes work both as a module
- and built into the kernel.
+ configurations. In particular check that changes work both as a
+ module and built into the kernel.
X
X 4. When you are happy with a change make it generally available for
X testing and await feedback.
@@ -28,7 +28,7 @@
X and variable names. These aren't as silly as they seem. One
X job the maintainers (and especially Linus) do is to keep things
X looking the same. Sometimes this means that the clever hack in
- your driver to get around a problem actual needs to become a
+ your driver to get around a problem actually needs to become a
X generalized kernel feature ready for next time. See
X Documentation/CodingStyle for guidance here.
X
@@ -49,8 +49,8 @@
X
X Maintainers List (try to look for most precise areas first)
X
-Note: For the hard of thinking, this list is meant to remain in Alphabetical
-order. If you could add yourselves to it in Alphabetical order that would
+Note: For the hard of thinking, this list is meant to remain in alphabetical
+order. If you could add yourselves to it in alphabetical order that would
X so much easier [Ed]
X
X P: Person
@@ -163,6 +163,12 @@
X W: http://www.ife.ee.ethz.ch/~sailer/ham/ham.html
X S: Maintained
X
+BERKSHIRE PRODUCTS PC WATCHDOG DRIVER
+P: Kenji Hollis
+M: ke...@bitgate.com
+W: http://ftp.bitgate.com/pcwd/
+S: Maintained
+
X BUSLOGIC SCSI DRIVER
X P: Leonard N. Zubkoff
X M: Leonard N. Zubkoff <l...@dandelion.com>
@@ -271,6 +277,12 @@
X L: linux...@i-connect.net, linux...@vger.rutgers.edu
X S: Maintained
X
+COMPAQ SMART2 RAID DRIVER
+P: Charles White
+M: Charles White <arr...@compaq.com>
+L: compaqa...@yps.org
+S: Maintained
+
X EATA ISA/EISA/PCI SCSI DRIVER
X P: Dario Ballabio
X M: da...@milano.europe.dg.com
@@ -579,6 +591,26 @@
X L: linux-...@vger.rutgers.edu
X S: Maintained
X
+OLYMPIC NETWORK DRIVER
+P: Peter De Shrijver
+M: p...@ace.ulyssis.sutdent.kuleuven.ac.be
+P: Mike Phillips
+M: phi...@amtrak.com
+L: linu...@vger.rutgers.edu
+L: linu...@emissary.aus-etc.com
+W: http://www.linuxtr.net
+S: Maintained
+
+OLYMPIC NETWORK DRIVER
+P: Peter De Shrijver
+M: p...@ace.ulyssis.sutdent.kuleuven.ac.be
+P: Mike Phillips
+M: phi...@amtrak.com
+L: linu...@vger.rutgers.edu
+L: linu...@emissary.aus-etc.com
+W: http://www.linuxtr.net
+S: Maintained
+
X OPL3-SA2, SA3, and SAx DRIVER
X P: Scott Murray
X M: sco...@interlog.com
@@ -645,7 +677,7 @@
X
X REAL TIME CLOCK DRIVER
X P: Paul Gortmaker
-M gpg...@rsphy1.anu.edu.au
+M: gpg...@rsphy1.anu.edu.au
X L: linux-...@vger.rutgers.edu
X S: Maintained
X
@@ -697,9 +729,10 @@
X S: Maintained
X
X SMB FILESYSTEM
-P: Volker Lendecke
-M: v...@kki.org
-L: sa...@listproc.anu.edu.au
+P: Andrew Tridgell
+M: tri...@samba.org
+W: http://samba.org/
+L: sa...@samba.org
X S: Maintained
X
X SMP: (except SPARC)
diff -u --recursive --new-file v2.3.9/linux/Makefile linux/Makefile
--- v2.3.9/linux/Makefile Wed Jun 30 13:38:18 1999
+++ linux/Makefile Thu Jul 1 10:54:31 1999
@@ -1,6 +1,6 @@
X VERSION = 2
X PATCHLEVEL = 3
-SUBLEVEL = 9
+SUBLEVEL = 10
X EXTRAVERSION =
X
X ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)


@@ -351,8 +351,7 @@
X

X clean: archclean
X rm -f kernel/ksyms.lst include/linux/compile.h
- rm -f core `find . -name '*.[oas]' ! -regex '.*lxdialog/.*' \
- ! -regex '.*ksymoops/.*' -print`
+ rm -f core `find . -name '*.[oas]' ! -regex '.*lxdialog/.*' -print`
X rm -f core `find . -type f -name 'core' -print`
X rm -f core `find . -name '.*.flags' -print`
X rm -f vmlinux System.map
@@ -376,7 +375,6 @@
X rm -f .version .config* config.in config.old
X rm -f scripts/tkparse scripts/kconfig.tk scripts/kconfig.tmp
X rm -f scripts/lxdialog/*.o scripts/lxdialog/lxdialog
- rm -f scripts/ksymoops/*.o scripts/ksymoops/ksymoops
X rm -f .menuconfig.log
X rm -f include/asm
X rm -rf include/config
diff -u --recursive --new-file v2.3.9/linux/README linux/README
--- v2.3.9/linux/README Sun May 30 10:17:43 1999
+++ linux/README Thu Jul 1 10:54:08 1999
@@ -9,9 +9,9 @@
X bugs. It is *strongly* recommended that you back up the previous kernel
X before installing any new 2.3.xx release.
X
-If you need to use a proven and stable Linux kernel, please use 1.2.13,
-2.0.36 or 2.2.xx. All features which will be in the 2.3.xx releases will
-be contained in 2.4.xx when the code base has stabilized again.
+If you need to use a proven and stable Linux kernel, please use 2.0.37
+or 2.2.xx. All features which will be in the 2.3.xx releases will be
+contained in 2.4.xx when the code base has stabilized again.
X
X If you decide to use 2.3, it is recommended that you join the kernel mailing
X list. To do this, e-mail majo...@vger.rutgers.edu, and put in the body
@@ -105,7 +105,7 @@
X
X SOFTWARE REQUIREMENTS
X
- Compiling and running the 2.3.x kernels requires up-to-date
+ Compiling and running the 2.3.xx kernels requires up-to-date
X versions of various software packages. Consult
X ./Documentation/Changes for the minimum version numbers required
X and how to get updates for these packages. Beware that using
diff -u --recursive --new-file v2.3.9/linux/arch/alpha/config.in linux/arch/alpha/config.in
--- v2.3.9/linux/arch/alpha/config.in Wed Jun 30 13:38:18 1999
+++ linux/arch/alpha/config.in Thu Jul 1 14:22:56 1999
@@ -188,13 +188,7 @@
X tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
X tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
X tristate 'Kernel support for Linux/Intel ELF binaries' CONFIG_BINFMT_EM86
-tristate 'Parallel port support' CONFIG_PARPORT
-if [ "$CONFIG_PARPORT" != "n" ]; then
- dep_tristate ' PC-style hardware' CONFIG_PARPORT_PC $CONFIG_PARPORT
- if [ "$CONFIG_PARPORT_PC" != "n" ]; then
- bool ' Support foreign hardware' CONFIG_PARPORT_OTHER
- fi
-fi
+source drivers/misc/Config.in
X endmenu
X
X source drivers/pnp/Config.in
diff -u --recursive --new-file v2.3.9/linux/arch/alpha/kernel/ptrace.c linux/arch/alpha/kernel/ptrace.c
--- v2.3.9/linux/arch/alpha/kernel/ptrace.c Mon Jun 7 11:15:33 1999
+++ linux/arch/alpha/kernel/ptrace.c Sun Jul 4 13:41:08 1999
@@ -135,242 +135,18 @@
X return 0;
X }
X
-/*
- * This routine gets a long from any process space by following the page
- * tables. NOTE! You should check that the long isn't on a page boundary,
- * and that it is in the task area before calling this: this routine does
- * no checking.
- */
-static unsigned long
-get_long(struct task_struct * tsk, struct vm_area_struct * vma,
- unsigned long addr)
-{
- pgd_t * pgdir;
- pmd_t * pgmiddle;
- pte_t * pgtable;
- unsigned long page;
-
- DBG(DBG_MEM_ALL, ("getting long at 0x%lx\n", addr));
- repeat:
- pgdir = pgd_offset(vma->vm_mm, addr);
- if (pgd_none(*pgdir)) {
- handle_mm_fault(tsk, vma, addr, 0);
- goto repeat;
- }
- if (pgd_bad(*pgdir)) {
- printk("ptrace: bad page directory %08lx\n", pgd_val(*pgdir));
- pgd_clear(pgdir);
- return 0;
- }
- pgmiddle = pmd_offset(pgdir, addr);
- if (pmd_none(*pgmiddle)) {
- handle_mm_fault(tsk, vma, addr, 0);
- goto repeat;
- }
- if (pmd_bad(*pgmiddle)) {
- printk("ptrace: bad page middle %08lx\n", pmd_val(*pgmiddle));
- pmd_clear(pgmiddle);
- return 0;
- }
- pgtable = pte_offset(pgmiddle, addr);
- if (!pte_present(*pgtable)) {
- handle_mm_fault(tsk, vma, addr, 0);
- goto repeat;
- }
- page = pte_page(*pgtable);
- /* this is a hack for non-kernel-mapped video buffers and similar */
- if (MAP_NR(page) >= max_mapnr)
- return 0;
- page += addr & ~PAGE_MASK;
- return *(unsigned long *) page;
-}
-
-/*
- * This routine puts a long into any process space by following the page
- * tables. NOTE! You should check that the long isn't on a page boundary,
- * and that it is in the task area before calling this: this routine does
- * no checking.
- *
- * Now keeps R/W state of page so that a text page stays readonly
- * even if a debugger scribbles breakpoints into it. -M.U-
- */
-static void
-put_long(struct task_struct * tsk, struct vm_area_struct * vma,
- unsigned long addr, unsigned long data)
+static inline int
+read_int(struct task_struct *task, unsigned long addr, int * data)
X {
- pgd_t *pgdir;
- pmd_t *pgmiddle;
- pte_t *pgtable;
- unsigned long page;
-
- repeat:
- pgdir = pgd_offset(vma->vm_mm, addr);
- if (!pgd_present(*pgdir)) {
- handle_mm_fault(tsk, vma, addr, 1);
- goto repeat;
- }
- if (pgd_bad(*pgdir)) {
- printk("ptrace: bad page directory %08lx\n", pgd_val(*pgdir));
- pgd_clear(pgdir);
- return;
- }
- pgmiddle = pmd_offset(pgdir, addr);
- if (pmd_none(*pgmiddle)) {
- handle_mm_fault(tsk, vma, addr, 1);
- goto repeat;
- }
- if (pmd_bad(*pgmiddle)) {
- printk("ptrace: bad page middle %08lx\n", pmd_val(*pgmiddle));
- pmd_clear(pgmiddle);
- return;


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

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

Thomas Kobienia

unread,
Jul 9, 1999, 3:00:00 AM7/9/99
to
Archive-name: v2.3/patch-2.3.10/part07

#!/bin/sh
# this is part 07 of a 37 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.10 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.3.10'
else
echo 'x - continuing with patch-2.3.10'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.10' &&
X

X #if PDC202XX_DECODE_REGISTER_INFO
X pci_read_config_byte(dev, (drive_pci), &AP);
@@ -436,8 +426,6 @@
X printk("0x%08x\n", drive_conf);
X #endif /* PDC202XX_DEBUG_DRIVE_INFO */
X
-chipset_is_set:
-
X return ((int) ((id->dma_ultra >> 11) & 3) ? ide_dma_on :
X ((id->dma_ultra >> 8) & 7) ? ide_dma_on :
X ((id->dma_mword >> 8) & 7) ? ide_dma_on :
@@ -533,7 +521,7 @@
X (primary_mode & 1) ? "MASTER" : "PCI",
X (secondary_mode & 1) ? "MASTER" : "PCI" );
X
-#if PDC202XX_FORCE_BURST_BIT
+#ifdef PDC202XX_FORCE_BURST_BIT
X if (!(udma_speed_flag & 1)) {
X printk("%s: FORCING BURST BIT 0x%02x -> 0x%02x ", name, udma_speed_flag, (udma_speed_flag|1));
X outb(udma_speed_flag|1, high_16 + 0x001f);
@@ -541,7 +529,7 @@
X }
X #endif /* PDC202XX_FORCE_BURST_BIT */
X
-#if PDC202XX_FORCE_MASTER_MODE
+#ifdef PDC202XX_FORCE_MASTER_MODE
X if (!(primary_mode & 1)) {
X printk("%s: FORCING PRIMARY MODE BIT 0x%02x -> 0x%02x ",
X name, primary_mode, (primary_mode|1));
diff -u --recursive --new-file v2.3.9/linux/drivers/block/piix.c linux/drivers/block/piix.c
--- v2.3.9/linux/drivers/block/piix.c Wed Jun 2 22:21:51 1999
+++ linux/drivers/block/piix.c Sat Jul 3 10:45:04 1999
@@ -1,5 +1,5 @@
X /*
- * linux/drivers/block/piix.c Version 0.23 May 29, 1999
+ * linux/drivers/block/piix.c Version 0.24 June 28, 1999
X *
X * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer
X * Copyright (C) 1998-1999 Andre Hedrick, Author and Maintainer
@@ -44,8 +44,15 @@
X * pci_read_config_word(HWIF(drive)->pci_dev, 0x48, &reg48);
X * pci_read_config_word(HWIF(drive)->pci_dev, 0x4a, &reg4a);
X *
+ * #if 0
+ * int err;
+ * err = ide_config_drive_speed(drive, speed);
+ * (void) ide_config_drive_speed(drive, speed);
+ * #else
+ * #endif
X */
X
+#include <linux/config.h>
X #include <linux/types.h>
X #include <linux/kernel.h>
X #include <linux/ioport.h>
@@ -62,6 +69,7 @@
X
X extern char *ide_xfer_verbose (byte xfer_rate);
X
+#ifdef CONFIG_BLK_DEV_PIIX_TUNING
X /*
X *
X */
@@ -91,6 +99,7 @@


X return 0;
X }
X }

+#endif /* CONFIG_BLK_DEV_PIIX_TUNING */
X
X /*
X * Based on settings done by AMI BIOS
@@ -111,11 +120,7 @@
X { 2, 1 },
X { 2, 3 }, };
X
-#if 1
X pio = ide_get_best_pio_mode(drive, pio, 5, NULL);
-#else
- pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
-#endif
X pci_read_config_word(HWIF(drive)->pci_dev, master_port, &master_data);
X if (is_slave) {
X master_data = master_data | 0x4000;
@@ -142,6 +147,8 @@
X restore_flags(flags);
X }
X
+#ifdef CONFIG_BLK_DEV_PIIX_TUNING
+
X static int piix_config_drive_for_dma(ide_drive_t *drive, int ultra)
X {
X struct hd_driveid *id = drive->id;
@@ -246,17 +253,13 @@
X }
X speed = XFER_SW_DMA_2;
X } else {
-#if 0
- speed = XFER_PIO_0;
-#else
X speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL);
-#endif
X }
X
X restore_flags(flags);
X piix_tune_drive(drive, piix_dma_2_pio(speed));
X
- (void) ide_wait_cmd(drive, WIN_SETFEATURES, speed, SETFEATURES_XFER, 0, NULL);
+ (void) ide_config_drive_speed(drive, speed);
X
X #if PIIX_DEBUG_DRIVE_INFO
X printk("%s: %s drive%d ",
@@ -284,11 +287,19 @@
X /* Other cases are done by generic IDE-DMA code. */
X return ide_dmaproc(func, drive);
X }
+#endif /* CONFIG_BLK_DEV_PIIX_TUNING */
X
X void ide_init_piix (ide_hwif_t *hwif)
X {
X hwif->tuneproc = &piix_tune_drive;
+#ifdef CONFIG_BLK_DEV_PIIX_TUNING
X if (hwif->dma_base) {
X hwif->dmaproc = &piix_dmaproc;
+ } else
+#endif /* CONFIG_BLK_DEV_PIIX_TUNING */
+ {
+ hwif->drives[0].autotune = 1;
+ hwif->drives[1].autotune = 1;
X }
+
X }
diff -u --recursive --new-file v2.3.9/linux/drivers/block/smart1,2.h linux/drivers/block/smart1,2.h
--- v2.3.9/linux/drivers/block/smart1,2.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/block/smart1,2.h Mon Jul 5 19:52:52 1999
@@ -0,0 +1,274 @@
+/*
+ * Disk Array driver for Compaq SMART2 Controllers
+ * Copyright 1998 Compaq Computer 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, GOOD TITLE or
+ * NON INFRINGEMENT. See the GNU General Public License for more details.


+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software

+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Questions/Comments/Bugfixes to arr...@compaq.com
+ *
+ * If you want to make changes, improve or add functionality to this
+ * driver, you'll probably need the Compaq Array Controller Interface
+ * Specificiation (Document number ECG086/1198)
+ */
+
+/*
+ * This file contains the controller communication implementation for
+ * Compaq SMART-1 and SMART-2 controllers. To the best of my knowledge,
+ * this should support:
+ *
+ * PCI:
+ * SMART-2/P, SMART-2DH, SMART-2SL, SMART-221, SMART-3100ES, SMART-3200
+ * Integerated SMART Array Controller, SMART-4200, SMART-4250ES
+ *
+ * EISA:
+ * SMART-2/E, SMART, IAES, IDA-2, IDA
+ */
+
+/*
+ * Memory mapped FIFO interface (SMART 42xx cards)
+ */
+static void smart4_submit_command(ctlr_info_t *h, cmdlist_t *c)
+{
+ writel(c->busaddr, h->vaddr + S42XX_REQUEST_PORT_OFFSET);
+}
+
+/*
+ * This card is the oposite of the other cards.
+ * 0 turns interrupts on...
+ * 0x08 turns them off...
+ */
+static void smart4_intr_mask(ctlr_info_t *h, unsigned long val)
+{
+ if (val)
+ { /* Turn interrupts on */
+ writel(0, h->vaddr + S42XX_REPLY_INTR_MASK_OFFSET);
+ } else /* Turn them off */
+ {
+ writel( S42XX_INTR_OFF,
+ h->vaddr + S42XX_REPLY_INTR_MASK_OFFSET);
+ }
+}
+
+/*
+ * For this card fifo is full if reading this port returns 0!
+ *
+ */
+static unsigned long smart4_fifo_full(ctlr_info_t *h)
+{
+
+ return (~readl(h->vaddr + S42XX_REQUEST_PORT_OFFSET));
+}
+
+/* This type of controller returns -1 if the fifo is empty,
+ * Not 0 like the others.
+ * And we need to let it know we read a value out
+ */
+static unsigned long smart4_completed(ctlr_info_t *h)
+{
+ long register_value
+ = readl(h->vaddr + S42XX_REPLY_PORT_OFFSET);
+
+ /* Fifo is empty */
+ if( register_value == -1)
+ return 0;
+
+ /* Need to let it know we got the reply */
+ /* We do this by writing a 0 to the port we just read from */
+ writel(0, h->vaddr + S42XX_REPLY_PORT_OFFSET);
+
+ return ((unsigned long) register_value);
+}
+
+ /*
+ * This hardware returns interrupt pending at a different place and
+ * it does not tell us if the fifo is empty, we will have check
+ * that by getting a 0 back from the comamnd_completed call.
+ */
+static unsigned long smart4_intr_pending(ctlr_info_t *h)
+{
+ unsigned long register_value =
+ readl(h->vaddr + S42XX_INTR_STATUS);
+
+ if( register_value & S42XX_INTR_PENDING)
+ return FIFO_NOT_EMPTY;
+ return 0 ;
+}
+
+static struct access_method smart4_access = {
+ smart4_submit_command,
+ smart4_intr_mask,
+ smart4_fifo_full,
+ smart4_intr_pending,
+ smart4_completed,
+};
+
+/*
+ * Memory mapped FIFO interface (PCI SMART2 and SMART 3xxx cards)
+ */
+static void smart2_submit_command(ctlr_info_t *h, cmdlist_t *c)
+{
+ writel(c->busaddr, h->vaddr + COMMAND_FIFO);
+}
+
+static void smart2_intr_mask(ctlr_info_t *h, unsigned long val)
+{
+ writel(val, h->vaddr + INTR_MASK);
+}
+
+static unsigned long smart2_fifo_full(ctlr_info_t *h)
+{
+ return readl(h->vaddr + COMMAND_FIFO);
+}
+
+static unsigned long smart2_completed(ctlr_info_t *h)
+{
+ return readl(h->vaddr + COMMAND_COMPLETE_FIFO);
+}
+
+static unsigned long smart2_intr_pending(ctlr_info_t *h)
+{
+ return readl(h->vaddr + INTR_PENDING);
+}
+
+static struct access_method smart2_access = {
+ smart2_submit_command,
+ smart2_intr_mask,
+ smart2_fifo_full,
+ smart2_intr_pending,
+ smart2_completed,
+};
+
+/*
+ * IO access for SMART-2/E cards
+ */
+static void smart2e_submit_command(ctlr_info_t *h, cmdlist_t *c)
+{
+ outl(c->busaddr, h->ioaddr + COMMAND_FIFO);
+}
+
+static void smart2e_intr_mask(ctlr_info_t *h, unsigned long val)
+{
+ outl(val, h->ioaddr + INTR_MASK);
+}
+
+static unsigned long smart2e_fifo_full(ctlr_info_t *h)
+{
+ return inl(h->ioaddr + COMMAND_FIFO);
+}
+
+static unsigned long smart2e_completed(ctlr_info_t *h)
+{
+ return inl(h->ioaddr + COMMAND_COMPLETE_FIFO);
+}
+
+static unsigned long smart2e_intr_pending(ctlr_info_t *h)
+{
+ return inl(h->ioaddr + INTR_PENDING);
+}
+
+static struct access_method smart2e_access = {
+ smart2e_submit_command,
+ smart2e_intr_mask,
+ smart2e_fifo_full,
+ smart2e_intr_pending,
+ smart2e_completed,
+};
+
+/*
+ * IO access for older SMART-1 type cards
+ */
+#define SMART1_SYSTEM_MASK 0xC8E
+#define SMART1_SYSTEM_DOORBELL 0xC8F
+#define SMART1_LOCAL_MASK 0xC8C
+#define SMART1_LOCAL_DOORBELL 0xC8D
+#define SMART1_INTR_MASK 0xC89
+#define SMART1_LISTADDR 0xC90
+#define SMART1_LISTLEN 0xC94
+#define SMART1_TAG 0xC97
+#define SMART1_COMPLETE_ADDR 0xC98
+#define SMART1_LISTSTATUS 0xC9E
+
+#define CHANNEL_BUSY 0x01
+#define CHANNEL_CLEAR 0x02
+
+static void smart1_submit_command(ctlr_info_t *h, cmdlist_t *c)
+{
+ /*
+ * This __u16 is actually a bunch of control flags on SMART
+ * and below. We want them all to be zero.
+ */
+ c->hdr.size = 0;
+
+ outb(CHANNEL_CLEAR, h->ioaddr + SMART1_SYSTEM_DOORBELL);
+
+ outl(c->busaddr, h->ioaddr + SMART1_LISTADDR);
+ outw(c->size, h->ioaddr + SMART1_LISTLEN);
+
+ outb(CHANNEL_BUSY, h->ioaddr + SMART1_LOCAL_DOORBELL);
+}
+
+static void smart1_intr_mask(ctlr_info_t *h, unsigned long val)
+{
+ if (val == 1) {
+ outb(0xFD, h->ioaddr + SMART1_SYSTEM_DOORBELL);
+ outb(CHANNEL_BUSY, h->ioaddr + SMART1_LOCAL_DOORBELL);
+ outb(0x01, h->ioaddr + SMART1_INTR_MASK);
+ outb(0x01, h->ioaddr + SMART1_SYSTEM_MASK);
+ } else {
+ outb(0, h->ioaddr + 0xC8E);
+ }
+}
+
+static unsigned long smart1_fifo_full(ctlr_info_t *h)
+{
+ unsigned char chan;
+ chan = inb(h->ioaddr + SMART1_SYSTEM_DOORBELL) & CHANNEL_CLEAR;
+ return chan;
+}
+
+static unsigned long smart1_completed(ctlr_info_t *h)
+{
+ unsigned char status;
+ unsigned long cmd;
+
+ if (inb(h->ioaddr + SMART1_SYSTEM_DOORBELL) & CHANNEL_BUSY) {
+ outb(CHANNEL_BUSY, h->ioaddr + SMART1_SYSTEM_DOORBELL);
+
+ cmd = inl(h->ioaddr + SMART1_COMPLETE_ADDR);
+ status = inb(h->ioaddr + SMART1_LISTSTATUS);
+
+ outb(CHANNEL_CLEAR, h->ioaddr + SMART1_LOCAL_DOORBELL);
+
+ if (cmd) ((cmdlist_t*)bus_to_virt(cmd))->req.hdr.rcode = status;
+ } else {
+ cmd = 0;
+ }
+ return cmd;
+}
+
+static unsigned long smart1_intr_pending(ctlr_info_t *h)
+{
+ unsigned char chan;
+ chan = inb(h->ioaddr + SMART1_SYSTEM_DOORBELL) & CHANNEL_BUSY;
+ return chan;
+}
+
+static struct access_method smart1_access = {
+ smart1_submit_command,
+ smart1_intr_mask,
+ smart1_fifo_full,
+ smart1_intr_pending,
+ smart1_completed,
+};
diff -u --recursive --new-file v2.3.9/linux/drivers/cdrom/aztcd.c linux/drivers/cdrom/aztcd.c
--- v2.3.9/linux/drivers/cdrom/aztcd.c Wed May 12 13:27:37 1999
+++ linux/drivers/cdrom/aztcd.c Tue Jul 6 19:05:48 1999
@@ -1087,7 +1087,7 @@
X #ifdef AZT_KERNEL_PRIOR_2_1
X void aztcd_setup(char *str, int *ints)
X #else
-__initfunc(void aztcd_setup(char *str, int *ints))
+void __init aztcd_setup(char *str, int *ints)
X #endif
X { if (ints[0] > 0)
X azt_port = ints[1];
@@ -1617,7 +1617,7 @@
X #ifdef AZT_KERNEL_PRIOR_2_1
X int aztcd_init(void)
X #else
-__initfunc(int aztcd_init(void))
+int __init aztcd_init(void)
X #endif
X { long int count, max_count;
X unsigned char result[50];
diff -u --recursive --new-file v2.3.9/linux/drivers/cdrom/cdu31a.c linux/drivers/cdrom/cdu31a.c
--- v2.3.9/linux/drivers/cdrom/cdu31a.c Wed May 12 13:27:37 1999
+++ linux/drivers/cdrom/cdu31a.c Tue Jul 6 19:05:48 1999
@@ -3251,10 +3251,10 @@
X /* The different types of disc loading mechanisms supported */
X static const char *load_mech[] __initdata = { "caddy", "tray", "pop-up", "unknown" };
X
-__initfunc(static void
+static void __init
X get_drive_configuration(unsigned short base_io,
X unsigned char res_reg[],
- unsigned int *res_size))
+ unsigned int *res_size)
X {
X int retry_count;
X
@@ -3318,9 +3318,9 @@
X /*
X * Set up base I/O and interrupts, called from main.c.
X */
-__initfunc(void
+void __init
X cdu31a_setup(char *strings,
- int *ints))
+ int *ints)
X {
X if (ints[0] > 0)


X {
@@ -3349,8 +3349,8 @@

X /*
X * Initialize the driver.
X */
-__initfunc(int
-cdu31a_init(void))
+int __init
+cdu31a_init(void)
X {
X struct s_sony_drive_config drive_config;
X unsigned int res_size;
diff -u --recursive --new-file v2.3.9/linux/drivers/cdrom/cm206.c linux/drivers/cdrom/cm206.c
--- v2.3.9/linux/drivers/cdrom/cm206.c Wed May 12 13:27:37 1999
+++ linux/drivers/cdrom/cm206.c Tue Jul 6 19:05:48 1999
@@ -1294,7 +1294,7 @@
X check_region, 15 bits of one port and 6 of another make things
X likely enough to accept the region on the first hit...
X */
-__initfunc(int probe_base_port(int base))
+int __init probe_base_port(int base)
X {
X int b=0x300, e=0x370; /* this is the range of start addresses */
X volatile int fool, i;
@@ -1314,7 +1314,7 @@
X
X #if !defined(MODULE) || defined(AUTO_PROBE_MODULE)
X /* Probe for irq# nr. If nr==0, probe for all possible irq's. */
-__initfunc(int probe_irq(int nr)) {
+int __init probe_irq(int nr){
X int irqs, irq;
X outw(dc_normal | READ_AHEAD, r_data_control); /* disable irq-generation */
X sti();
@@ -1328,7 +1328,7 @@
X }
X #endif
X
-__initfunc(int cm206_init(void))
+int __init cm206_init(void)
X {
X uch e=0;
X long int size=sizeof(struct cm206_struct);
@@ -1413,7 +1413,7 @@
X
X static int cm206[2] = {0,0}; /* for compatible `insmod' parameter passing */
X
-__initfunc(void parse_options(void))
+void __init parse_options(void)
X {
X int i;
X for (i=0; i<2; i++) {


@@ -1447,7 +1447,7 @@
X

X /* This setup function accepts either `auto' or numbers in the range
X * 3--11 (for irq) or 0x300--0x370 (for base port) or both. */
-__initfunc(void cm206_setup(char *s, int *p))
+void __init cm206_setup(char *s, int *p)
X {
X int i;
X if (!strcmp(s, "auto")) auto_probe=1;
diff -u --recursive --new-file v2.3.9/linux/drivers/cdrom/gscd.c linux/drivers/cdrom/gscd.c
--- v2.3.9/linux/drivers/cdrom/gscd.c Sat May 15 15:05:36 1999
+++ linux/drivers/cdrom/gscd.c Tue Jul 6 19:05:48 1999
@@ -194,7 +194,7 @@
X }
X
X
-__initfunc(void gscd_setup (char *str, int *ints))
+void __init gscd_setup (char *str, int *ints)
X {
X if (ints[0] > 0)
X {
@@ -851,7 +851,7 @@
X return;
X }
X
-__initfunc(int find_drives (void))
+int __init find_drives (void)
X {
X int *pdrv;
X int drvnum;
@@ -902,7 +902,7 @@
X return drvnum;
X }
X
-__initfunc(void init_cd_drive ( int num ))
+void __init init_cd_drive ( int num )
X {
X char resp [50];
X int i;
@@ -994,7 +994,7 @@
X
X
X /* Test for presence of drive and initialize it. Called only at boot time. */
-__initfunc(int gscd_init (void))
+int __init gscd_init (void)
X {
X return my_gscd_init ();
X }
@@ -1002,7 +1002,7 @@
X
X /* This is the common initialisation for the GoldStar drive. */
X /* It is called at boot time AND for module init. */
-__initfunc(int my_gscd_init (void))
+int __init my_gscd_init (void)
X {
X int i;
X int result;
diff -u --recursive --new-file v2.3.9/linux/drivers/cdrom/isp16.c linux/drivers/cdrom/isp16.c
--- v2.3.9/linux/drivers/cdrom/isp16.c Tue Dec 2 11:41:44 1997
+++ linux/drivers/cdrom/isp16.c Tue Jul 6 19:05:48 1999
@@ -77,8 +77,8 @@
X #define ISP16_OUT(p,b) (outb(isp16_ctrl,ISP16_CTRL_PORT), outb(b,p))
X
X
-__initfunc(void
-isp16_setup(char *str, int *ints))
+void __init
+isp16_setup(char *str, int *ints)
X {
X if ( ints[0] > 0 )
X isp16_cdrom_base = ints[1];
@@ -94,8 +94,8 @@
X * ISP16 initialisation.
X *
X */
-__initfunc(int
-isp16_init(void))
+int __init
+isp16_init(void)
X {
X u_char expected_drive;
X
@@ -144,8 +144,8 @@
X return(0);
X }
X
-__initfunc(static short
-isp16_detect(void))
+static short __init
+isp16_detect(void)
X {
X
X if ( isp16_c929__detect() >= 0 )
@@ -154,8 +154,8 @@
X return(isp16_c928__detect());
X }
X
-__initfunc(static short
-isp16_c928__detect(void))
+static short __init
+isp16_c928__detect(void)
X {
X u_char ctrl;
X u_char enable_cdrom;
@@ -203,8 +203,8 @@
X return(i);
X }
X
-__initfunc(static short
-isp16_c929__detect(void))
+static short __init
+isp16_c929__detect(void)
X {
X u_char ctrl;
X u_char tmp;
@@ -230,8 +230,8 @@
X return(2);
X }
X
-__initfunc(static short
-isp16_cdi_config(int base, u_char drive_type, int irq, int dma))
+static short __init
+isp16_cdi_config(int base, u_char drive_type, int irq, int dma)
X {
X u_char base_code;
X u_char irq_code;
diff -u --recursive --new-file v2.3.9/linux/drivers/cdrom/mcd.c linux/drivers/cdrom/mcd.c
--- v2.3.9/linux/drivers/cdrom/mcd.c Wed May 12 13:27:37 1999
+++ linux/drivers/cdrom/mcd.c Tue Jul 6 19:05:48 1999
@@ -230,8 +230,7 @@
X };
X
X
-
-__initfunc(void mcd_setup(char *str, int *ints))
+void __init mcd_setup(char *str, int *ints)
X {
X if (ints[0] > 0)
X mcd_port = ints[1];
@@ -1155,7 +1154,7 @@
X * Test for presence of drive and initialize it. Called at boot time.
X */
X
-__initfunc(int mcd_init(void))
+int __init mcd_init(void)
X {
X int count;
X unsigned char result[3];
diff -u --recursive --new-file v2.3.9/linux/drivers/cdrom/mcdx.c linux/drivers/cdrom/mcdx.c
--- v2.3.9/linux/drivers/cdrom/mcdx.c Wed May 12 13:27:37 1999
+++ linux/drivers/cdrom/mcdx.c Tue Jul 6 19:05:48 1999
@@ -770,7 +770,7 @@
X return 1;
X }
X
-__initfunc(void mcdx_setup(char *str, int *pi))
+void __init mcdx_setup(char *str, int *pi)
X {
X if (pi[0] > 0) mcdx_drive_map[0][0] = pi[1];
X if (pi[0] > 1) mcdx_drive_map[0][1] = pi[2];
@@ -1013,7 +1013,7 @@
X
X /* Support functions ************************************************/
X
-__initfunc(int mcdx_init_drive(int drive))
+int __init mcdx_init_drive(int drive)
X {
X struct s_version version;
X struct s_drive_stuff* stuffp;
@@ -1174,7 +1174,7 @@


X return 0;
X }
X

-__initfunc(int mcdx_init(void))
+int __init mcdx_init(void)
X {
X int drive;
X #ifdef MODULE
diff -u --recursive --new-file v2.3.9/linux/drivers/cdrom/optcd.c linux/drivers/cdrom/optcd.c
--- v2.3.9/linux/drivers/cdrom/optcd.c Wed May 12 13:27:37 1999
+++ linux/drivers/cdrom/optcd.c Tue Jul 6 19:05:48 1999
@@ -1966,7 +1966,7 @@
X
X /* Returns 1 if a drive is detected with a version string
X starting with "DOLPHIN". Otherwise 0. */
-__initfunc(static int version_ok(void))
+static int __init version_ok(void)
X {
X char devname[100];
X int count, i, ch, status;
@@ -2022,7 +2022,7 @@
X
X
X /* Get kernel parameter when used as a kernel driver */
-__initfunc(void optcd_setup(char *str, int *ints))
+void __init optcd_setup(char *str, int *ints)
X {
X if (ints[0] > 0)
X optcd_port = ints[1];
@@ -2030,7 +2030,7 @@
X
X /* Test for presence of drive and initialize it. Called at boot time
X or during module initialisation. */
-__initfunc(int optcd_init(void))
+int __init optcd_init(void)
X {
X int status;
X
diff -u --recursive --new-file v2.3.9/linux/drivers/cdrom/sbpcd.c linux/drivers/cdrom/sbpcd.c
--- v2.3.9/linux/drivers/cdrom/sbpcd.c Sat May 15 15:05:36 1999
+++ linux/drivers/cdrom/sbpcd.c Tue Jul 6 19:05:48 1999
@@ -3215,7 +3215,7 @@
X }
X #endif FUTURE
X /*==========================================================================*/
-__initfunc(static void check_datarate(void))
+static void __init check_datarate(void)
X {
X int i=0;


X
@@ -3285,7 +3285,7 @@
X }

X #endif
X /*==========================================================================*/
-__initfunc(static void ask_mail(void))
+static void __init ask_mail(void)
X {
X int i;
X
@@ -3304,7 +3304,7 @@
X msg(DBG_INF,"infobuf =%s\n", msgbuf);
X }
X /*==========================================================================*/
-__initfunc(static int check_version(void))
+static int __init check_version(void)
X {
X int i, j, l;
X int teac_possible=0;
@@ -3602,7 +3602,7 @@
X /*
X * probe for the presence of an interface card
X */
-__initfunc(static int check_card(int port))
+static int __init check_card(int port)
X {
X #undef N_RESPO
X #define N_RESPO 20
@@ -3706,7 +3706,7 @@
X /*
X * probe for the presence of drives on the selected controller
X */
-__initfunc(static int check_drives(void))
+static int __init check_drives(void)
X {
X int i, j;
X
@@ -5458,9 +5458,9 @@
X *
X */
X #if (SBPCD_ISSUE-1)
-__initfunc(static void sbpcd_setup(const char *s, int *p))
+static void __init sbpcd_setup(const char *s, int *p)
X #else
-__initfunc(void sbpcd_setup(const char *s, int *p))
+void __init sbpcd_setup(const char *s, int *p)
X #endif
X {
X setup_done++;
@@ -5512,7 +5512,7 @@
X * port 0x330, we have to use an offset of 8; so, the real CDROM port
X * address is 0x338.
X */
-__initfunc(static int config_spea(void))
+static int __init config_spea(void)
X {
X /*
X * base address offset between configuration port and CDROM port,
@@ -5571,7 +5571,7 @@
X #ifdef MODULE
X int init_module(void)
X #else
-__initfunc(int SBPCD_INIT(void))
+int __init SBPCD_INIT(void)
X #endif MODULE
X {
X int i=0, j=0;
diff -u --recursive --new-file v2.3.9/linux/drivers/cdrom/sjcd.c linux/drivers/cdrom/sjcd.c
--- v2.3.9/linux/drivers/cdrom/sjcd.c Wed May 12 13:27:37 1999
+++ linux/drivers/cdrom/sjcd.c Tue Jul 6 19:05:48 1999
@@ -163,7 +163,7 @@
X * Set up device, i.e., use command line data to set
X * base address.
X */
-__initfunc(void sjcd_setup( char *str, int *ints ))
+void __init sjcd_setup( char *str, int *ints )
X {
X if (ints[0] > 0)
X sjcd_base = ints[1];
@@ -1457,7 +1457,7 @@
X * Test for presence of drive and initialize it. Called at boot time.
X * Probe cdrom, find out version and status.
X */
-__initfunc(int sjcd_init( void )){
+int __init sjcd_init( void ){
X int i;
X
X printk(KERN_INFO "SJCD: Sanyo CDR-H94A cdrom driver version %d.%d.\n", SJCD_VERSION_MAJOR,
diff -u --recursive --new-file v2.3.9/linux/drivers/cdrom/sonycd535.c linux/drivers/cdrom/sonycd535.c
--- v2.3.9/linux/drivers/cdrom/sonycd535.c Wed May 26 09:31:44 1999
+++ linux/drivers/cdrom/sonycd535.c Tue Jul 6 19:05:48 1999
@@ -1486,8 +1486,8 @@
X /*
X * Initialize the driver.
X */
-__initfunc(int
-sony535_init(void))
+int __init
+sony535_init(void)
X {
X struct s535_sony_drive_config drive_config;
X Byte cmd_buff[3];
@@ -1655,8 +1655,8 @@
X *
X * the address value has to be the existing CDROM port address.
X */
-__initfunc(void
-sonycd535_setup(char *strings, int *ints))
+void __init
+sonycd535_setup(char *strings, int *ints)
X {
X /* if IRQ change and default io base desired,
X * then call with io base of 0
diff -u --recursive --new-file v2.3.9/linux/drivers/char/Config.in linux/drivers/char/Config.in
--- v2.3.9/linux/drivers/char/Config.in Wed Jun 30 13:38:19 1999
+++ linux/drivers/char/Config.in Tue Jul 6 19:16:55 1999
@@ -28,6 +28,9 @@
X tristate 'Digiboard PC/Xx Support' CONFIG_DIGI
X fi
X tristate 'Cyclades async mux support' CONFIG_CYCLADES
+ if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_CYCLADES" != "n" ]; then
+ bool ' Cyclades-Z interrupt mode operation (EXPERIMENTAL)' CONFIG_CYZ_INTR
+ fi
X bool 'Stallion multiport serial support' CONFIG_STALDRV
X if [ "$CONFIG_STALDRV" = "y" ]; then
X tristate ' Stallion EasyIO or EC8/32 support' CONFIG_STALLION
@@ -52,8 +55,9 @@
X if [ "$CONFIG_PARPORT" != "n" ]; then
X dep_tristate 'Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT
X if [ "$CONFIG_PRINTER" != "n" ]; then
- bool ' Support IEEE1284 status readback' CONFIG_PRINTER_READBACK
+ bool ' Support for console on line printer' CONFIG_LP_CONSOLE
X fi
+ dep_tristate 'Support for user-space parallel port device drivers' CONFIG_PPDEV $CONFIG_PARPORT
X fi
X
X bool 'Mouse Support (not serial mice)' CONFIG_MOUSE
@@ -79,6 +83,9 @@
X comment ' from the tpqic02-support package. It is available at'
X comment ' metalab.unc.edu or ftp://titus.cfw.com/pub/Linux/util/'
X fi
+ dep_tristate 'Zoran ZR36057/36060 support' CONFIG_VIDEO_ZORAN $CONFIG_VIDEO_DEV
+ dep_tristate ' Include support for Iomega Buz' CONFIG_VIDEO_BUZ $CONFIG_VIDEO_ZORAN
+ dep_tristate ' Include support for LML33' CONFIG_VIDEO_LML33 $CONFIG_VIDEO_ZORAN
X fi
X
X bool 'Watchdog Timer Support' CONFIG_WATCHDOG
@@ -111,6 +118,7 @@
X
X tristate 'Video For Linux' CONFIG_VIDEO_DEV
X if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
+ dep_tristate 'ADS Cadet AM/FM Tuner' CONFIG_RADIO_CADET $CONFIG_VIDEO_DEV
X dep_tristate 'AIMSlab RadioTrack (aka RadioReveal) support' CONFIG_RADIO_RTRACK $CONFIG_VIDEO_DEV
X if [ "$CONFIG_RADIO_RTRACK" = "y" ]; then
X hex ' RadioTrack i/o port (0x20f or 0x30f)' CONFIG_RADIO_RTRACK_PORT 20f
@@ -123,11 +131,14 @@
X if [ "$CONFIG_RADIO_AZTECH" = "y" ]; then
X hex ' Aztech/Packard Bell I/O port (0x350 or 0x358)' CONFIG_RADIO_AZTECH_PORT 350
X fi
- dep_tristate 'ADS Cadet AM/FM Tuner' CONFIG_RADIO_CADET $CONFIG_VIDEO_DEV
- dep_tristate 'Miro PCM20 Radio' CONFIG_RADIO_MIROPCM20 $CONFIG_VIDEO_DEV
X dep_tristate 'GemTek Radio Card support' CONFIG_RADIO_GEMTEK $CONFIG_VIDEO_DEV
X if [ "$CONFIG_RADIO_GEMTEK" = "y" ]; then
X hex ' GemTek i/o port (0x20c, 0x30c, 0x24c or 0x34c)' CONFIG_RADIO_GEMTEK_PORT 34c
+ fi
+ dep_tristate 'Miro PCM20 Radio' CONFIG_RADIO_MIROPCM20 $CONFIG_VIDEO_DEV
+ dep_tristate 'TerraTec ActiveRadio ISA Standalone' CONFIG_RADIO_TERRATEC $CONFIG_VIDEO_DEV
+ if [ "$CONFIG_RADIO_TERRATEC" = "y" ]; then
+ hex ' Terratec i/o port (normally 0x590)' CONFIG_RADIO_TERRATEC_PORT 590
X fi
X if [ "$CONFIG_PCI" != "n" ]; then
X dep_tristate 'BT848 Video For Linux' CONFIG_VIDEO_BT848 $CONFIG_VIDEO_DEV
diff -u --recursive --new-file v2.3.9/linux/drivers/char/Makefile linux/drivers/char/Makefile
--- v2.3.9/linux/drivers/char/Makefile Sat May 22 15:02:48 1999
+++ linux/drivers/char/Makefile Tue Jul 6 19:16:55 1999
@@ -356,6 +356,30 @@
X endif
X endif
X
+ifeq ($(CONFIG_VIDEO_ZORAN),y)
+L_OBJS += buz.o
+else
+ ifeq ($(CONFIG_VIDEO_LML33),m)
+ M_OBJS += buz.o
+ endif
+endif
+
+ifeq ($(CONFIG_VIDEO_LML33),y)
+L_OBJS += bt856.o bt819.o
+else
+ ifeq ($(CONFIG_VIDEO_LML33),m)
+ M_OBJS += bt856.o bt819.o
+ endif
+endif
+
+ifeq ($(CONFIG_VIDEO_BUZ),y)
+L_OBJS += saa7111.o saa7185.o
+else
+ ifeq ($(CONFIG_VIDEO_BUZ),m)
+ M_OBJS += saa7111.o saa7185.o
+ endif
+endif
+
X ifeq ($(CONFIG_VIDEO_PMS),y)
X L_OBJS += pms.o
X else
@@ -372,6 +396,14 @@
X endif
X endif
X
+ifeq ($(CONFIG_VIDEO_VINO),y)
+L_OBJS += vino.o
+else
+ ifeq ($(CONFIG_VIDEO_VINO),m)
+ M_OBJS += vino.o
+ endif
+endif
+
X ifeq ($(CONFIG_RADIO_AZTECH),y)
X L_OBJS += radio-aztech.o
X else
@@ -444,6 +476,14 @@
X endif
X endif
X
+ifeq ($(CONFIG_RADIO_TERRATEC),y)
+L_OBJS += radio-terratec.o
+else
+ ifeq ($(CONFIG_RADIO_TERRATEC),m)
+ M_OBJS += radio-terratec.o
+ endif
+endif
+
X ifeq ($(CONFIG_QIC02_TAPE),y)
X L_OBJS += tpqic02.o
X else
@@ -466,6 +506,14 @@
X
X ifdef CONFIG_H8
X LX_OBJS += h8.o
+endif
+
+ifeq ($(CONFIG_PPDEV),y)
+L_OBJS += ppdev.o
+else
+ ifeq ($(CONFIG_PPDEV),m)
+ M_OBJS += ppdev.o
+ endif
X endif
X
X ifeq ($(L_I2C),y)
diff -u --recursive --new-file v2.3.9/linux/drivers/char/acquirewdt.c linux/drivers/char/acquirewdt.c
--- v2.3.9/linux/drivers/char/acquirewdt.c Wed Jun 2 11:29:13 1999
+++ linux/drivers/char/acquirewdt.c Tue Jul 6 19:16:55 1999
@@ -212,7 +212,7 @@
X
X #endif
X
-__initfunc(int acq_init(void))
+int __init acq_init(void)
X {
X printk("WDT driver for Acquire single board computer initialising.\n");
X
diff -u --recursive --new-file v2.3.9/linux/drivers/char/adbmouse.c linux/drivers/char/adbmouse.c
--- v2.3.9/linux/drivers/char/adbmouse.c Mon Jun 7 12:12:22 1999
+++ linux/drivers/char/adbmouse.c Tue Jul 6 19:16:55 1999
@@ -38,9 +38,7 @@
X #ifdef __powerpc__
X #include <asm/processor.h>
X #endif
-#ifdef __mc68000__
X #include <asm/setup.h>
-#endif
X
X static struct mouse_status mouse;
X static unsigned char adb_mouse_buttons[16];
@@ -244,7 +242,7 @@
X ADB_MOUSE_MINOR, "adbmouse", &adb_mouse_fops
X };
X
-__initfunc(int adb_mouse_init(void))
+int __init adb_mouse_init(void)
X {
X mouse.active = 0;
X mouse.ready = 0;
@@ -270,7 +268,7 @@
X * option, which is about using ADB keyboard buttons to emulate
X * mouse buttons. -- paulus
X */
-__initfunc(void adb_mouse_setup(char *str, int *ints))
+void __init adb_mouse_setup(char *str, int *ints)
X {
X if (ints[0] >= 1) {
X adb_emulate_buttons = ints[1] > 0;
@@ -282,7 +280,6 @@
X }
X
X #ifdef MODULE
-#include <asm/setup.h>
X
X int init_module(void)
X {
diff -u --recursive --new-file v2.3.9/linux/drivers/char/amigamouse.c linux/drivers/char/amigamouse.c
--- v2.3.9/linux/drivers/char/amigamouse.c Mon Aug 24 13:02:43 1998
+++ linux/drivers/char/amigamouse.c Tue Jul 6 19:16:55 1999
@@ -309,7 +309,7 @@
X AMIGAMOUSE_MINOR, "amigamouse", &amiga_mouse_fops
X };
X
-__initfunc(int amiga_mouse_init(void))
+int __init amiga_mouse_init(void)
X {
X if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_MOUSE))
X return -ENODEV;
@@ -333,7 +333,6 @@
X }
X
X #ifdef MODULE
-#include <asm/setup.h>
X
X int init_module(void)
X {
diff -u --recursive --new-file v2.3.9/linux/drivers/char/amikeyb.c linux/drivers/char/amikeyb.c
--- v2.3.9/linux/drivers/char/amikeyb.c Mon Apr 26 13:25:54 1999
+++ linux/drivers/char/amikeyb.c Tue Jul 6 19:16:55 1999
@@ -295,7 +295,7 @@
X }
X }
X
-__initfunc(int amiga_keyb_init(void))
+int __init amiga_keyb_init(void)
X {
X if (!AMIGAHW_PRESENT(AMI_KEYBOARD))
X return -EIO;
@@ -343,6 +343,6 @@
X }
X
X /* for "kbd-reset" cmdline param */
-__initfunc(void amiga_kbd_reset_setup(char *str, int *ints))
+void __init amiga_kbd_reset_setup(char *str, int *ints)
X {
X }
diff -u --recursive --new-file v2.3.9/linux/drivers/char/atarimouse.c linux/drivers/char/atarimouse.c
--- v2.3.9/linux/drivers/char/atarimouse.c Mon Aug 24 13:02:43 1998
+++ linux/drivers/char/atarimouse.c Tue Jul 6 19:16:55 1999
@@ -159,7 +159,7 @@
X ATARIMOUSE_MINOR, "atarimouse", &atari_mouse_fops
X };
X
-__initfunc(int atari_mouse_init(void))
+int __init atari_mouse_init(void)
X {
X int r;
X
@@ -182,7 +182,7 @@
X #define MIN_THRESHOLD 1
X #define MAX_THRESHOLD 20 /* more seems not reasonable... */
X
-__initfunc(void atari_mouse_setup( char *str, int *ints ))
+void __init atari_mouse_setup( char *str, int *ints )
X {
X if (ints[0] < 1) {
X printk( "atari_mouse_setup: no arguments!\n" );
diff -u --recursive --new-file v2.3.9/linux/drivers/char/atixlmouse.c linux/drivers/char/atixlmouse.c
--- v2.3.9/linux/drivers/char/atixlmouse.c Wed May 12 13:27:37 1999
+++ linux/drivers/char/atixlmouse.c Tue Jul 6 19:16:55 1999
@@ -202,7 +202,7 @@
X };
X
X
-__initfunc(int atixl_busmouse_init(void))
+int __init atixl_busmouse_init(void)
X {
X unsigned char a,b,c;
X
diff -u --recursive --new-file v2.3.9/linux/drivers/char/bttv.c linux/drivers/char/bttv.c
--- v2.3.9/linux/drivers/char/bttv.c Mon Jun 7 16:17:59 1999
+++ linux/drivers/char/bttv.c Mon Jul 5 20:35:18 1999
@@ -43,7 +43,6 @@
X #include <linux/types.h>
X #include <linux/wrapper.h>
X #include <linux/interrupt.h>
-#include <linux/version.h>
X
X #if LINUX_VERSION_CODE >= 0x020100
X #include <asm/uaccess.h>
@@ -81,8 +80,8 @@
X #include "bttv.h"
X #include "tuner.h"
X
-#define DEBUG(x) /* Debug driver */
-#define IDEBUG(x) /* Debug interrupt handler */
+#define DEBUG(x) /* Debug driver */
+#define IDEBUG(x) /* Debug interrupt handler */
X
X #if LINUX_VERSION_CODE >= 0x020117
X MODULE_PARM(vidmem,"i");
@@ -110,7 +109,7 @@
X #define CARD_DEFAULT 0
X #endif
X
-static unsigned int remap[BTTV_MAX]; /* remap Bt848 */
+static unsigned long remap[BTTV_MAX]; /* remap Bt848 */
X static unsigned int radio[BTTV_MAX];
X static unsigned int card[BTTV_MAX] = { CARD_DEFAULT, CARD_DEFAULT,
X CARD_DEFAULT, CARD_DEFAULT };
@@ -129,51 +128,80 @@
X #define EEPROM_WRITE_DELAY 20000
X #define BURSTOFFSET 76
X
-
-
X /*******************************/
X /* Memory management functions */
X /*******************************/
X
-/* convert virtual user memory address to physical address */
-/* (virt_to_phys only works for kmalloced kernel memory) */
+#define MDEBUG(x) do { } while(0) /* Debug memory management */
+
+/* [DaveM] I've recoded most of this so that:
+ * 1) It's easier to tell what is happening
+ * 2) It's more portable, especially for translating things
+ * out of vmalloc mapped areas in the kernel.
+ * 3) Less unnecessary translations happen.
+ *
+ * The code used to assume that the kernel vmalloc mappings
+ * existed in the page tables of every process, this is simply
+ * not guarenteed. We now use pgd_offset_k which is the
+ * defined way to get at the kernel page tables.
+ */
X
-static inline unsigned long uvirt_to_phys(unsigned long adr)
+/* Given PGD from the address space's page table, return the kernel
+ * virtual mapping of the physical memory mapped at ADR.
+ */
+static inline unsigned long uvirt_to_kva(pgd_t *pgd, unsigned long adr)
X {
- pgd_t *pgd;
+ unsigned long ret = 0UL;
X pmd_t *pmd;
X pte_t *ptep, pte;
X
- pgd = pgd_offset(current->mm, adr);
- if (pgd_none(*pgd))
- return 0;
- pmd = pmd_offset(pgd, adr);
- if (pmd_none(*pmd))
- return 0;
- ptep = pte_offset(pmd, adr/*&(~PGDIR_MASK)*/);
- pte = *ptep;
- if(pte_present(pte))
- return
- virt_to_phys((void *)(pte_page(pte)|(adr&(PAGE_SIZE-1))));
- return 0;
+ if (!pgd_none(*pgd)) {
+ pmd = pmd_offset(pgd, adr);
+ if (!pmd_none(*pmd)) {
+ ptep = pte_offset(pmd, adr);
+ pte = *ptep;
+ if(pte_present(pte))
+ ret = (pte_page(pte)|(adr&(PAGE_SIZE-1)));
+ }
+ }
+ MDEBUG(printk("uv2kva(%lx-->%lx)", adr, ret));
+ return ret;
X }
X
X static inline unsigned long uvirt_to_bus(unsigned long adr)
X {
- return virt_to_bus(phys_to_virt(uvirt_to_phys(adr)));
-}
+ unsigned long kva, ret;
X
-/* convert virtual kernel memory address to physical address */
-/* (virt_to_phys only works for kmalloced kernel memory) */
+ kva = uvirt_to_kva(pgd_offset(current->mm, adr), adr);
+ ret = virt_to_bus((void *)kva);
+ MDEBUG(printk("uv2b(%lx-->%lx)", adr, ret));
+ return ret;
+}
X
-static inline unsigned long kvirt_to_phys(unsigned long adr)
+static inline unsigned long kvirt_to_bus(unsigned long adr)
X {
- return uvirt_to_phys(VMALLOC_VMADDR(adr));
+ unsigned long va, kva, ret;
+
+ va = VMALLOC_VMADDR(adr);
+ kva = uvirt_to_kva(pgd_offset_k(va), va);
+ ret = virt_to_bus((void *)kva);
+ MDEBUG(printk("kv2b(%lx-->%lx)", adr, ret));
+ return ret;
X }
X
-static inline unsigned long kvirt_to_bus(unsigned long adr)
+/* Here we want the physical address of the memory.
+ * This is used when initializing the contents of the
+ * area and marking the pages as reserved.
+ */
+static inline unsigned long kvirt_to_pa(unsigned long adr)
X {
- return uvirt_to_bus(VMALLOC_VMADDR(adr));
+ unsigned long va, kva, ret;
+
+ va = VMALLOC_VMADDR(adr);
+ kva = uvirt_to_kva(pgd_offset_k(va), va);
+ ret = __pa(kva);
+ MDEBUG(printk("kv2pa(%lx-->%lx)", adr, ret));
+ return ret;
X }
X
X static void * rvmalloc(unsigned long size)
@@ -188,8 +216,8 @@
X adr=(unsigned long) mem;
X while (size > 0)
X {
- page = kvirt_to_phys(adr);
- mem_map_reserve(MAP_NR(phys_to_virt(page)));
+ page = kvirt_to_pa(adr);
+ mem_map_reserve(MAP_NR(__va(page)));
X adr+=PAGE_SIZE;
X size-=PAGE_SIZE;
X }
@@ -206,8 +234,8 @@
X adr=(unsigned long) mem;
X while (size > 0)
X {
- page = kvirt_to_phys(adr);
- mem_map_unreserve(MAP_NR(phys_to_virt(page)));
+ page = kvirt_to_pa(adr);
+ mem_map_unreserve(MAP_NR(__va(page)));
X adr+=PAGE_SIZE;
X size-=PAGE_SIZE;
X }
@@ -541,13 +569,13 @@
X /* Aimslab VHX */
X { 3, 1, 0, 2, 7, { 2, 3, 1, 1}, { 0, 1, 2, 3, 4}},
X /* Zoltrix TV-Max */
- { 3, 1, 0, 2,15, { 2, 3, 1, 1}, { 0, 0, 0, 0, 0}},
+ { 3, 1, 0, 2, 0x00000f, { 2, 3, 1, 1}, { 0, 0, 0, 0, 0x8}},
X /* Pixelview PlayTV (bt878) */
X { 3, 4, 0, 2, 0x01e000, { 2, 0, 1, 1}, {0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 }},
X /* "Leadtek WinView 601", */
X { 3, 1, 0, 2, 0x8300f8, { 2, 3, 1, 1,0}, {0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007}},
X /* AVEC Intercapture */
- { 3, 1, 9, 2, 0, { 2, 3, 1, 1}, { 0, 0, 0, 0, 0}},
+ { 3, 2, 0, 2, 0, { 2, 3, 1, 1}, { 1, 0, 0, 0, 0}},
X };
X #define TVCARDS (sizeof(tvcards)/sizeof(tvcard))
X
@@ -823,30 +851,30 @@
X unsigned int *po=(unsigned int *) btv->vbi_odd;
X unsigned int *pe=(unsigned int *) btv->vbi_even;
X
- DEBUG(printk(KERN_DEBUG "vbiodd: 0x%08x\n",(int)btv->vbi_odd));
- DEBUG(printk(KERN_DEBUG "vbievn: 0x%08x\n",(int)btv->vbi_even));
- DEBUG(printk(KERN_DEBUG "po: 0x%08x\n",(int)po));
- DEBUG(printk(KERN_DEBUG "pe: 0x%08x\n",(int)pe));
+ DEBUG(printk(KERN_DEBUG "vbiodd: 0x%lx\n",(long)btv->vbi_odd));
+ DEBUG(printk(KERN_DEBUG "vbievn: 0x%lx\n",(long)btv->vbi_even));
+ DEBUG(printk(KERN_DEBUG "po: 0x%lx\n",(long)po));
+ DEBUG(printk(KERN_DEBUG "pe: 0x%lx\n",(long)pe));
X
- *(po++)=BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1; *(po++)=0;
+ *(po++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1); *(po++)=0;
X for (i=0; i<16; i++)
X {
- *(po++)=VBI_RISC;
- *(po++)=kvirt_to_bus((unsigned long)btv->vbibuf+i*2048);
+ *(po++)=cpu_to_le32(VBI_RISC);
+ *(po++)=cpu_to_le32(kvirt_to_bus((unsigned long)btv->vbibuf+i*2048));
X }
- *(po++)=BT848_RISC_JUMP;
- *(po++)=virt_to_bus(btv->risc_jmp+4);
+ *(po++)=cpu_to_le32(BT848_RISC_JUMP);
+ *(po++)=cpu_to_le32(virt_to_bus(btv->risc_jmp+4));
X
- *(pe++)=BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1; *(pe++)=0;
+ *(pe++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1); *(pe++)=0;
X for (i=16; i<32; i++)
X {
- *(pe++)=VBI_RISC;
- *(pe++)=kvirt_to_bus((unsigned long)btv->vbibuf+i*2048);
+ *(pe++)=cpu_to_le32(VBI_RISC);
+ *(pe++)=cpu_to_le32(kvirt_to_bus((unsigned long)btv->vbibuf+i*2048));
X }
- *(pe++)=BT848_RISC_JUMP|BT848_RISC_IRQ|(0x01<<16);
- *(pe++)=virt_to_bus(btv->risc_jmp+10);
- DEBUG(printk(KERN_DEBUG "po: 0x%08x\n",(int)po));
- DEBUG(printk(KERN_DEBUG "pe: 0x%08x\n",(int)pe));
+ *(pe++)=cpu_to_le32(BT848_RISC_JUMP|BT848_RISC_IRQ|(0x01<<16));
+ *(pe++)=cpu_to_le32(virt_to_bus(btv->risc_jmp+10));
+ DEBUG(printk(KERN_DEBUG "po: 0x%lx\n",(long)po));
+ DEBUG(printk(KERN_DEBUG "pe: 0x%lx\n",(long)pe));
X }
X
X int fmtbppx2[16] = {
@@ -881,8 +909,8 @@
X unsigned long bpl=1024; /* bytes per line */
X unsigned long vadr=(unsigned long) vbuf;
X
- *(ro++)=BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1; *(ro++)=0;
- *(re++)=BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1; *(re++)=0;
+ *(ro++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1); *(ro++)=0;
+ *(re++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1); *(re++)=0;
X
X /* In PAL 650 blocks of 256 DWORDs are sampled, but only if VDELAY
X is 2 and without separate VBI grabbing.
@@ -890,17 +918,17 @@
X
X for (line=0; line < 640; line++)
X {
- *(ro++)=BT848_RISC_WRITE|bpl|BT848_RISC_SOL|BT848_RISC_EOL;
- *(ro++)=kvirt_to_bus(vadr);
- *(re++)=BT848_RISC_WRITE|bpl|BT848_RISC_SOL|BT848_RISC_EOL;
- *(re++)=kvirt_to_bus(vadr+BTTV_MAX_FBUF/2);
+ *(ro++)=cpu_to_le32(BT848_RISC_WRITE|bpl|BT848_RISC_SOL|BT848_RISC_EOL);
+ *(ro++)=cpu_to_le32(kvirt_to_bus(vadr));
+ *(re++)=cpu_to_le32(BT848_RISC_WRITE|bpl|BT848_RISC_SOL|BT848_RISC_EOL);
+ *(re++)=cpu_to_le32(kvirt_to_bus(vadr+BTTV_MAX_FBUF/2));
X vadr+=bpl;
X }
X
- *(ro++)=BT848_RISC_JUMP;
- *(ro++)=btv->bus_vbi_even;
- *(re++)=BT848_RISC_JUMP|BT848_RISC_IRQ|(2<<16);
- *(re++)=btv->bus_vbi_odd;
+ *(ro++)=cpu_to_le32(BT848_RISC_JUMP);
+ *(ro++)=cpu_to_le32(btv->bus_vbi_even);
+ *(re++)=cpu_to_le32(BT848_RISC_JUMP|BT848_RISC_IRQ|(2<<16));
+ *(re++)=cpu_to_le32(btv->bus_vbi_odd);
X
X return 0;
X }
@@ -954,8 +982,8 @@
X cradr=cbadr+csize;
X inter = (height>btv->win.cropheight/2) ? 1 : 0;
X
- *(ro++)=BT848_RISC_SYNC|BT848_FIFO_STATUS_FM3; *(ro++)=0;
- *(re++)=BT848_RISC_SYNC|BT848_FIFO_STATUS_FM3; *(re++)=0;
+ *(ro++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM3); *(ro++)=0;
+ *(re++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM3); *(re++)=0;
X
X for (line=0; line < (height<<(1^inter)); line++)
X {
@@ -991,15 +1019,15 @@
X todo-=bl;
X if(!todo) rcmd|=BT848_RISC_EOL; /* if this is the last EOL */
X
- *((*rp)++)=rcmd|bl;
- *((*rp)++)=blcb|(blcr<<16);
- *((*rp)++)=kvirt_to_bus(vadr);
+ *((*rp)++)=cpu_to_le32(rcmd|bl);
+ *((*rp)++)=cpu_to_le32(blcb|(blcr<<16));
+ *((*rp)++)=cpu_to_le32(kvirt_to_bus(vadr));
X vadr+=bl;
X if((rcmd&(15<<28))==BT848_RISC_WRITE123)
X {
- *((*rp)++)=kvirt_to_bus(cbadr);
+ *((*rp)++)=cpu_to_le32(kvirt_to_bus(cbadr));
X cbadr+=blcb;
- *((*rp)++)=kvirt_to_bus(cradr);
+ *((*rp)++)=cpu_to_le32(kvirt_to_bus(cradr));
X cradr+=blcr;
X }
X
@@ -1007,10 +1035,10 @@
X }
X }
X
- *(ro++)=BT848_RISC_JUMP;
- *(ro++)=btv->bus_vbi_even;
- *(re++)=BT848_RISC_JUMP|BT848_RISC_IRQ|(2<<16);
- *(re++)=btv->bus_vbi_odd;
+ *(ro++)=cpu_to_le32(BT848_RISC_JUMP);
+ *(ro++)=cpu_to_le32(btv->bus_vbi_even);
+ *(re++)=cpu_to_le32(BT848_RISC_JUMP|BT848_RISC_IRQ|(2<<16));
+ *(re++)=cpu_to_le32(btv->bus_vbi_odd);
X
X return 0;
X }
@@ -1037,8 +1065,8 @@
X inter = (height>btv->win.cropheight/2) ? 1 : 0;
X bpl=width*fmtbppx2[palette2fmt[palette]&0xf]/2;
X
- *(ro++)=BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1; *(ro++)=0;
- *(re++)=BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1; *(re++)=0;
+ *(ro++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1); *(ro++)=0;
+ *(re++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1); *(re++)=0;
X
X for (line=0; line < (height<<(1^inter)); line++)
X {
@@ -1050,35 +1078,35 @@
X bl=PAGE_SIZE-((PAGE_SIZE-1)&vadr);
X if (bpl<=bl)
X {
- *((*rp)++)=BT848_RISC_WRITE|BT848_RISC_SOL|
- BT848_RISC_EOL|bpl;
- *((*rp)++)=kvirt_to_bus(vadr);
+ *((*rp)++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL|
+ BT848_RISC_EOL|bpl);
+ *((*rp)++)=cpu_to_le32(kvirt_to_bus(vadr));
X vadr+=bpl;
X }
X else
X {
X todo=bpl;
- *((*rp)++)=BT848_RISC_WRITE|BT848_RISC_SOL|bl;
- *((*rp)++)=kvirt_to_bus(vadr);
+ *((*rp)++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL|bl);
+ *((*rp)++)=cpu_to_le32(kvirt_to_bus(vadr));
X vadr+=bl;
X todo-=bl;
X while (todo>PAGE_SIZE)
X {
- *((*rp)++)=BT848_RISC_WRITE|PAGE_SIZE;
- *((*rp)++)=kvirt_to_bus(vadr);
+ *((*rp)++)=cpu_to_le32(BT848_RISC_WRITE|PAGE_SIZE);
+ *((*rp)++)=cpu_to_le32(kvirt_to_bus(vadr));
X vadr+=PAGE_SIZE;
X todo-=PAGE_SIZE;
X }
- *((*rp)++)=BT848_RISC_WRITE|BT848_RISC_EOL|todo;
- *((*rp)++)=kvirt_to_bus(vadr);
+ *((*rp)++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_EOL|todo);
+ *((*rp)++)=cpu_to_le32(kvirt_to_bus(vadr));
X vadr+=todo;
X }
X }
X
- *(ro++)=BT848_RISC_JUMP;
- *(ro++)=btv->bus_vbi_even;
- *(re++)=BT848_RISC_JUMP|BT848_RISC_IRQ|(2<<16);
- *(re++)=btv->bus_vbi_odd;
+ *(ro++)=cpu_to_le32(BT848_RISC_JUMP);
+ *(ro++)=cpu_to_le32(btv->bus_vbi_even);
+ *(re++)=cpu_to_le32(BT848_RISC_JUMP|BT848_RISC_IRQ|(2<<16));
+ *(re++)=cpu_to_le32(btv->bus_vbi_odd);
X
X return 0;
X }
@@ -1162,10 +1190,10 @@
X adr=btv->win.vidadr+btv->win.x*bpp+btv->win.y*bpl;
X if ((clipmap=vmalloc(VIDEO_CLIPMAP_SIZE))==NULL) {
X /* can't clip, don't generate any risc code */
- *(ro++)=BT848_RISC_JUMP;
- *(ro++)=btv->bus_vbi_even;
- *(re++)=BT848_RISC_JUMP;
- *(re++)=btv->bus_vbi_odd;
+ *(ro++)=cpu_to_le32(BT848_RISC_JUMP);
+ *(ro++)=cpu_to_le32(btv->bus_vbi_even);
+ *(re++)=cpu_to_le32(BT848_RISC_JUMP);
+ *(re++)=cpu_to_le32(btv->bus_vbi_odd);
X }
X if (ncr < 0) { /* bitmap was pased */
X memcpy(clipmap, (unsigned char *)cr, VIDEO_CLIPMAP_SIZE);
@@ -1187,8 +1215,8 @@
X if (btv->win.y<0)
X clip_draw_rectangle(clipmap, 0, 0, 1024, -(btv->win.y));
X
- *(ro++)=BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1; *(ro++)=0;
- *(re++)=BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1; *(re++)=0;
+ *(ro++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1); *(ro++)=0;
+ *(re++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1); *(re++)=0;
X
X /* translate bitmap to risc code */
X for (line=outofmem=0; line < (height<<inter) && !outofmem; line++)
@@ -1206,10 +1234,10 @@
X flags |= ((!sx) ? BT848_RISC_SOL : 0);
X flags |= ((sx + dx == width) ? BT848_RISC_EOL : 0);
X if (!lastbit) {
- *((*rp)++)=BT848_RISC_WRITE|flags|len;
- *((*rp)++)=adr + bpp * sx;
+ *((*rp)++)=cpu_to_le32(BT848_RISC_WRITE|flags|len);
+ *((*rp)++)=cpu_to_le32(adr + bpp * sx);
X } else
- *((*rp)++)=BT848_RISC_SKIP|flags|len;
+ *((*rp)++)=cpu_to_le32(BT848_RISC_SKIP|flags|len);
X lastbit=cbit;
X sx += dx;
X dx = 1;
@@ -1224,10 +1252,10 @@
X }
X vfree(clipmap);
X /* outofmem flag relies on the following code to discard extra data */
- *(ro++)=BT848_RISC_JUMP;
- *(ro++)=btv->bus_vbi_even;
- *(re++)=BT848_RISC_JUMP;
- *(re++)=btv->bus_vbi_odd;
+ *(ro++)=cpu_to_le32(BT848_RISC_JUMP);
+ *(ro++)=cpu_to_le32(btv->bus_vbi_even);
+ *(re++)=cpu_to_le32(BT848_RISC_JUMP);
+ *(re++)=cpu_to_le32(btv->bus_vbi_odd);
X }
X
X /* set geometry for even/odd frames
@@ -1297,6 +1325,23 @@
X set_pll(btv);
X
X btwrite(fmt, BT848_COLOR_FMT);
+#ifdef __sparc__
+ if(fmt == BT848_COLOR_FMT_RGB32 ||
+ fmt == BT848_COLOR_FMT_RGB24) {
+ btwrite((BT848_COLOR_CTL_GAMMA |
+ BT848_COLOR_CTL_WSWAP_ODD |
+ BT848_COLOR_CTL_WSWAP_EVEN |
+ BT848_COLOR_CTL_BSWAP_ODD |
+ BT848_COLOR_CTL_BSWAP_EVEN),
+ BT848_COLOR_CTL);
+ } else if(fmt == BT848_COLOR_FMT_RGB16 ||
+ fmt == BT848_COLOR_FMT_RGB15) {
+ btwrite((BT848_COLOR_CTL_GAMMA |
+ BT848_COLOR_CTL_BSWAP_ODD |
+ BT848_COLOR_CTL_BSWAP_EVEN),
+ BT848_COLOR_CTL);
+ }
+#endif
X hactive=width;
X
X vtc=0;
@@ -1474,7 +1519,7 @@
X btor(BT848_VSCALE_COMB, BT848_E_VSCALE_HI);
X btor(BT848_VSCALE_COMB, BT848_O_VSCALE_HI);
X }
- btv->risc_jmp[12]=BT848_RISC_JUMP|(0x8<<16)|BT848_RISC_IRQ;
+ btv->risc_jmp[12]=cpu_to_le32(BT848_RISC_JUMP|(0x8<<16)|BT848_RISC_IRQ);
X }
X btor(3, BT848_CAP_CTL);
X btor(3, BT848_GPIO_DMA_CTL);
@@ -2268,7 +2313,7 @@
X pos=(unsigned long) btv->fbuffer;
X while (size > 0)
X {
- page = kvirt_to_phys(pos);
+ page = kvirt_to_pa(pos);
X if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
X return -EAGAIN;
X start+=PAGE_SIZE;
@@ -3110,44 +3155,44 @@
X int flags=btv->cap;
X
X /* Sync to start of odd field */
- btv->risc_jmp[0]=BT848_RISC_SYNC|BT848_RISC_RESYNC|BT848_FIFO_STATUS_VRE;
+ btv->risc_jmp[0]=cpu_to_le32(BT848_RISC_SYNC|BT848_RISC_RESYNC|BT848_FIFO_STATUS_VRE);
X btv->risc_jmp[1]=0;
X
X /* Jump to odd vbi sub */
- btv->risc_jmp[2]=BT848_RISC_JUMP|(0x5<<20);
+ btv->risc_jmp[2]=cpu_to_le32(BT848_RISC_JUMP|(0x5<<20));
X if (flags&8)
- btv->risc_jmp[3]=virt_to_bus(btv->vbi_odd);
+ btv->risc_jmp[3]=cpu_to_le32(virt_to_bus(btv->vbi_odd));
X else
- btv->risc_jmp[3]=virt_to_bus(btv->risc_jmp+4);
+ btv->risc_jmp[3]=cpu_to_le32(virt_to_bus(btv->risc_jmp+4));
X
X /* Jump to odd sub */
- btv->risc_jmp[4]=BT848_RISC_JUMP|(0x6<<20);
+ btv->risc_jmp[4]=cpu_to_le32(BT848_RISC_JUMP|(0x6<<20));
X if (flags&2)
- btv->risc_jmp[5]=virt_to_bus(btv->risc_odd);
+ btv->risc_jmp[5]=cpu_to_le32(virt_to_bus(btv->risc_odd));
X else
- btv->risc_jmp[5]=virt_to_bus(btv->risc_jmp+6);
+ btv->risc_jmp[5]=cpu_to_le32(virt_to_bus(btv->risc_jmp+6));
X
X
X /* Sync to start of even field */
- btv->risc_jmp[6]=BT848_RISC_SYNC|BT848_RISC_RESYNC|BT848_FIFO_STATUS_VRO;
+ btv->risc_jmp[6]=cpu_to_le32(BT848_RISC_SYNC|BT848_RISC_RESYNC|BT848_FIFO_STATUS_VRO);
X btv->risc_jmp[7]=0;
X
X /* Jump to even vbi sub */
- btv->risc_jmp[8]=BT848_RISC_JUMP;
+ btv->risc_jmp[8]=cpu_to_le32(BT848_RISC_JUMP);
X if (flags&4)
- btv->risc_jmp[9]=virt_to_bus(btv->vbi_even);
+ btv->risc_jmp[9]=cpu_to_le32(virt_to_bus(btv->vbi_even));
X else
- btv->risc_jmp[9]=virt_to_bus(btv->risc_jmp+10);
+ btv->risc_jmp[9]=cpu_to_le32(virt_to_bus(btv->risc_jmp+10));
X
X /* Jump to even sub */
- btv->risc_jmp[10]=BT848_RISC_JUMP|(8<<20);
+ btv->risc_jmp[10]=cpu_to_le32(BT848_RISC_JUMP|(8<<20));
X if (flags&1)
- btv->risc_jmp[11]=virt_to_bus(btv->risc_even);
+ btv->risc_jmp[11]=cpu_to_le32(virt_to_bus(btv->risc_even));
X else
- btv->risc_jmp[11]=virt_to_bus(btv->risc_jmp+12);
+ btv->risc_jmp[11]=cpu_to_le32(virt_to_bus(btv->risc_jmp+12));
X
- btv->risc_jmp[12]=BT848_RISC_JUMP;
- btv->risc_jmp[13]=virt_to_bus(btv->risc_jmp);
+ btv->risc_jmp[12]=cpu_to_le32(BT848_RISC_JUMP);
+ btv->risc_jmp[13]=cpu_to_le32(virt_to_bus(btv->risc_jmp));
X
X /* enable capturing */
X btaor(flags, ~0x0f, BT848_CAP_CTL);
@@ -3165,7 +3210,7 @@
X
X /* reset the bt848 */
X btwrite(0, BT848_SRESET);
- DEBUG(printk(KERN_DEBUG "bttv%d: bt848_mem: 0x%08x\n",i,(unsigned int) btv->bt848_mem));
+ DEBUG(printk(KERN_DEBUG "bttv%d: bt848_mem: 0x%lx\n",i,(unsigned long) btv->bt848_mem));
X
X /* default setup for max. PAL size in a 1024xXXX hicolor framebuffer */
X btv->win.norm=0; /* change this to 1 for NTSC, 2 for SECAM */
@@ -3330,8 +3375,7 @@
X if (!astat)
X return;
X btwrite(astat,BT848_INT_STAT);
- IDEBUG(printk ("bttv%d: astat %08x\n", btv->nr, astat));
- IDEBUG(printk ("bttv%d: stat %08x\n", btv->nr, stat));
+ IDEBUG(printk ("bttv%d: astat %08x stat %08x\n", btv->nr, astat, stat));
X
X /* get device status bits */
X dstat=btread(BT848_DSTATUS);
@@ -3387,8 +3431,8 @@
X btv->gro = btv->gro_next;
X btv->gre = btv->gre_next;
X btv->grf = btv->grf_next;
- btv->risc_jmp[5]=btv->gro;
- btv->risc_jmp[11]=btv->gre;
+ btv->risc_jmp[5]=cpu_to_le32(btv->gro);
+ btv->risc_jmp[11]=cpu_to_le32(btv->gre);
X bt848_set_geo(btv, btv->gwidth,
X btv->gheight,
X btv->gfmt);
@@ -3405,9 +3449,9 @@
X }
X if (stat&(8<<28))
X {
- btv->risc_jmp[5]=btv->gro;
- btv->risc_jmp[11]=btv->gre;
- btv->risc_jmp[12]=BT848_RISC_JUMP;
+ btv->risc_jmp[5]=cpu_to_le32(btv->gro);
+ btv->risc_jmp[11]=cpu_to_le32(btv->gre);
+ btv->risc_jmp[12]=cpu_to_le32(BT848_RISC_JUMP);
X bt848_set_geo(btv, btv->gwidth, btv->gheight,
X btv->gfmt);
X }
@@ -3502,14 +3546,16 @@
X
X if (remap[bttv_num])
X {
+ unsigned int dw = btv->bt848_adr;
+
X if (remap[bttv_num] < 0x1000)
X remap[bttv_num]<<=20;
X remap[bttv_num]&=PCI_BASE_ADDRESS_MEM_MASK;
- printk(KERN_INFO "bttv%d: remapping to : 0x%08x.\n",
+ printk(KERN_INFO "bttv%d: remapping to : 0x%lx.\n",
X bttv_num,remap[bttv_num]);
X remap[bttv_num]|=btv->bt848_adr&(~PCI_BASE_ADDRESS_MEM_MASK);
X pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, remap[bttv_num]);
- pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &btv->bt848_adr);
+ pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &dw);
X btv->dev->base_address[0] = btv->bt848_adr;
X }
X btv->bt848_adr&=PCI_BASE_ADDRESS_MEM_MASK;
@@ -3518,7 +3564,7 @@
X bttv_num,btv->id, btv->revision);
X printk("bus: %d, devfn: %d, ",dev->bus->number, dev->devfn);
X printk("irq: %d, ",btv->irq);
- printk("memory: 0x%08x.\n", btv->bt848_adr);
+ printk("memory: 0x%lx.\n", btv->bt848_adr);
X
X btv->pll.pll_crystal = 0;
X btv->pll.pll_ifreq = 0;
@@ -3542,7 +3588,11 @@
X }
X }
X
+#ifdef __sparc__
+ btv->bt848_mem=(unsigned char *)btv->bt848_adr;
+#else
X btv->bt848_mem=ioremap(btv->bt848_adr, 0x1000);
+#endif
X
X /* clear interrupt mask */
X btwrite(0, BT848_INT_MASK);
@@ -3817,17 +3867,17 @@
X if (btv->risc_even)
X kfree((void *) btv->risc_even);
X
- DEBUG(printk(KERN_DEBUG "free: risc_jmp: 0x%08x.\n", btv->risc_jmp));
+ DEBUG(printk(KERN_DEBUG "free: risc_jmp: 0x%p.\n", btv->risc_jmp));
X if (btv->risc_jmp)
X kfree((void *) btv->risc_jmp);
X
- DEBUG(printk(KERN_DEBUG "bt848_vbibuf: 0x%08x.\n", btv->vbibuf));
+ DEBUG(printk(KERN_DEBUG "bt848_vbibuf: 0x%p.\n", btv->vbibuf));
X if (btv->vbibuf)
X vfree((void *) btv->vbibuf);
X
X
X free_irq(btv->irq,btv);
- DEBUG(printk(KERN_DEBUG "bt848_mem: 0x%08x.\n", btv->bt848_mem));
+ DEBUG(printk(KERN_DEBUG "bt848_mem: 0x%p.\n", btv->bt848_mem));
X if (btv->bt848_mem)
X iounmap(btv->bt848_mem);
X
diff -u --recursive --new-file v2.3.9/linux/drivers/char/bttv.h linux/drivers/char/bttv.h
--- v2.3.9/linux/drivers/char/bttv.h Mon Jun 7 16:17:59 1999
+++ linux/drivers/char/bttv.h Mon Jul 5 20:07:02 1999
@@ -102,9 +102,9 @@
X #else
X struct pci_dev *dev;
X #endif
- unsigned char irq; /* IRQ used by Bt848 card */
+ unsigned int irq; /* IRQ used by Bt848 card */
X unsigned char revision;
- unsigned int bt848_adr; /* bus address of IO mem returned by PCI BIOS */
+ unsigned long bt848_adr; /* bus address of IO mem returned by PCI BIOS */
X unsigned char *bt848_mem; /* pointer to mapped IO memory */
X unsigned long busriscmem;
X u32 *riscmem;
@@ -274,7 +274,7 @@
X #define TEA6320_S 0x07 /* switch register */
X /* values for those registers: */
X #define TEA6320_S_SA 0x01 /* stereo A input */
-#define TEA6320_S_SB 0x02 /* stereo B */
+#define TEA6320_S_SB 0x07 /* stereo B -- databook wrong? this works */
X #define TEA6320_S_SC 0x04 /* stereo C */
X #define TEA6320_S_GMU 0x80 /* general mute */
X
diff -u --recursive --new-file v2.3.9/linux/drivers/char/busmouse.c linux/drivers/char/busmouse.c
--- v2.3.9/linux/drivers/char/busmouse.c Wed May 12 13:27:37 1999
+++ linux/drivers/char/busmouse.c Tue Jul 6 19:16:55 1999
@@ -60,7 +60,7 @@
X MODULE_PARM(mouse_irq, "i");
X #endif
X
-__initfunc(void bmouse_setup(char *str, int *ints))
+void __init bmouse_setup(char *str, int *ints)
X {
X if (ints[0] > 0)
X mouse_irq=ints[1];
@@ -252,7 +252,7 @@
X LOGITECH_BUSMOUSE, "busmouse", &bus_mouse_fops
X };
X
-__initfunc(int bus_mouse_init(void))
+int __init bus_mouse_init(void)
X {
X if (check_region(LOGIBM_BASE, LOGIBM_EXTENT)) {
X mouse.present = 0;
diff -u --recursive --new-file v2.3.9/linux/drivers/char/buz.c linux/drivers/char/buz.c
--- v2.3.9/linux/drivers/char/buz.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/buz.c Tue Jul 6 10:11:40 1999
@@ -0,0 +1,3478 @@
+#define MAX_KMALLOC_MEM (512*1024)
+/*
+ buz - Iomega Buz driver version 1.0
+
+ Copyright (C) 1999 Rainer Johanni <Rai...@Johanni.de>
+
+ based on
+
+ buz.0.0.3 Copyright (C) 1998 Dave Perks <dpe...@ibm.net>
+
+ and
+
+ bttv - Bt848 frame grabber driver
+
+ Copyright (C) 1996,97,98 Ralph Metzler (rj...@thp.uni-koeln.de)
+ & Marcus Metzler (mo...@thp.uni-koeln.de)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/malloc.h>
+#include <linux/mm.h>
+#include <linux/pci.h>
+#include <linux/signal.h>
+#include <asm/io.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+#include <linux/sched.h>
+#include <asm/segment.h>
+#include <linux/types.h>
+#include <linux/wrapper.h>
+#include <asm/spinlock.h>
+
+#include <linux/videodev.h>
+
+#include <linux/version.h>
+#include <asm/uaccess.h>
+
+#include <linux/i2c.h>
+#include "buz.h"
+#include <linux/video_decoder.h>
+#include <linux/video_encoder.h>
+
+#define IRQ_MASK ( ZR36057_ISR_GIRQ0 | /* ZR36057_ISR_GIRQ1 | ZR36057_ISR_CodRepIRQ | */ ZR36057_ISR_JPEGRepIRQ )
+#define GPIO_MASK 0xdf
+
+/*
+
+ BUZ
+
+ GPIO0 = 1, take board out of reset
+ GPIO1 = 1, take JPEG codec out of sleep mode
+ GPIO3 = 1, deassert FRAME# to 36060
+
+
+ GIRQ0 signals a vertical sync of the video signal


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

echo 'End of part 07'
echo 'File patch-2.3.10 is continued in part 08'
echo 08 > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Jul 9, 1999, 3:00:00 AM7/9/99
to
Archive-name: v2.3/patch-2.3.10/part04

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


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.10 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.3.10'
else
echo 'x - continuing with patch-2.3.10'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.10' &&

- fi
- dep_tristate ' Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT
- if [ "$CONFIG_PRINTER" != "n" ]; then


- bool ' Support IEEE1284 status readback' CONFIG_PRINTER_READBACK

- fi
- fi
+ source drivers/misc/Config.in
+ dep_tristate ' Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT
X tristate 'SUNW,envctrl support' CONFIG_ENVCTRL
X fi
X endmenu
@@ -232,6 +220,16 @@
X bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
X if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
X int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256
+fi
+endmenu
+
+mainmenu_option next_comment
+comment 'Video For Linux'
+tristate 'Video For Linux' CONFIG_VIDEO_DEV
+if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
+ if [ "$CONFIG_PCI" != "n" ]; then
+ dep_tristate 'BT848 Video For Linux' CONFIG_VIDEO_BT848 $CONFIG_VIDEO_DEV
+ fi
X fi
X endmenu
X
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/defconfig linux/arch/sparc64/defconfig
--- v2.3.9/linux/arch/sparc64/defconfig Wed Jun 30 13:38:19 1999
+++ linux/arch/sparc64/defconfig Tue Jul 6 19:05:48 1999
@@ -93,11 +93,13 @@
X CONFIG_BINFMT_MISC=m
X CONFIG_SOLARIS_EMUL=m
X CONFIG_PARPORT=m
-CONFIG_PARPORT_AX=m
-CONFIG_PARPORT_LOWLEVEL_MODULE=y
+# CONFIG_PARPORT_PC is not set
+# CONFIG_PARPORT_AMIGA is not set
+# CONFIG_PARPORT_MFC3 is not set
+# CONFIG_PARPORT_ATARI is not set
X # CONFIG_PARPORT_OTHER is not set
+# CONFIG_PARPORT_1284 is not set
X CONFIG_PRINTER=m
-CONFIG_PRINTER_READBACK=y
X CONFIG_ENVCTRL=m
X
X #
@@ -260,6 +262,12 @@
X #
X CONFIG_UNIX98_PTYS=y
X CONFIG_UNIX98_PTY_COUNT=256
+
+#
+# Video For Linux
+#
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_BT848=y
X
X #
X # Filesystems
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/kernel/binfmt_aout32.c linux/arch/sparc64/kernel/binfmt_aout32.c
--- v2.3.9/linux/arch/sparc64/kernel/binfmt_aout32.c Wed Jun 30 13:38:19 1999
+++ linux/arch/sparc64/kernel/binfmt_aout32.c Thu Jul 1 17:33:12 1999
@@ -311,9 +311,10 @@
X fd = open_dentry(bprm->dentry, O_RDONLY);
X if (fd < 0)
X return fd;
- file = fcheck(fd);
+ file = fget(fd);
X
X if (!file->f_op || !file->f_op->mmap) {
+ fput(fd);
X sys_close(fd);
X do_brk(0, ex.a_text+ex.a_data);
X read_exec(bprm->dentry, fd_offset,
@@ -327,6 +328,7 @@
X fd_offset);
X
X if (error != N_TXTADDR(ex)) {
+ fput(file);
X sys_close(fd);
X send_sig(SIGKILL, current, 0);
X return error;
@@ -336,6 +338,7 @@
X PROT_READ | PROT_WRITE | PROT_EXEC,
X MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
X fd_offset + ex.a_text);
+ fput(file);
X sys_close(fd);
X if (error != N_DATADDR(ex)) {
X send_sig(SIGKILL, current, 0);
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/kernel/ioctl32.c linux/arch/sparc64/kernel/ioctl32.c
--- v2.3.9/linux/arch/sparc64/kernel/ioctl32.c Wed Jun 9 14:44:25 1999
+++ linux/arch/sparc64/kernel/ioctl32.c Tue Jul 6 10:11:40 1999
@@ -1696,9 +1696,9 @@
X int error = -EBADF;
X
X lock_kernel();
- filp = fcheck(fd);
+ filp = fget(fd);
X if(!filp)
- goto out;
+ goto out2;
X
X if (!filp->f_op || !filp->f_op->ioctl) {
X error = sys_ioctl (fd, cmd, arg);
@@ -2381,6 +2381,8 @@
X break;
X }
X out:
+ fput(filp);
+out2:
X unlock_kernel();
X return error;
X }
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/kernel/psycho.c linux/arch/sparc64/kernel/psycho.c
--- v2.3.9/linux/arch/sparc64/kernel/psycho.c Thu Apr 22 19:24:51 1999
+++ linux/arch/sparc64/kernel/psycho.c Mon Jul 5 20:35:18 1999
@@ -1,4 +1,4 @@
-/* $Id: psycho.c,v 1.85 1999/04/02 14:54:28 davem Exp $
+/* $Id: psycho.c,v 1.86 1999/07/01 10:39:43 davem Exp $
X * psycho.c: Ultra/AX U2P PCI controller support.
X *
X * Copyright (C) 1997 David S. Miller (da...@caipfs.rutgers.edu)
@@ -68,7 +68,6 @@
X #include <linux/smp_lock.h>
X #include <linux/pci.h>
X
-#include <asm/io.h>
X #include <asm/oplib.h>
X #include <asm/pbm.h>
X #include <asm/apb.h>
@@ -757,13 +756,15 @@
X unsigned short stmp;
X unsigned int itmp;
X
+#if 0
X for(pdev = pci_devices; pdev; pdev = pdev->next) {
X if(pdev->vendor == PCI_VENDOR_ID_SUN &&
X pdev->device == PCI_DEVICE_ID_SUN_SABRE) {
- pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 128);
+ pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 64);
X break;
X }
X }
+#endif
X for (pdev = sabre->pci_bus->devices; pdev; pdev = pdev->sibling) {
X if (pdev->vendor == PCI_VENDOR_ID_SUN &&
X pdev->device == PCI_DEVICE_ID_SUN_SIMBA) {
@@ -795,13 +796,14 @@
X pci_read_config_dword(pdev, APB_PCI_CONTROL_LOW, &itmp);
X itmp = APB_PCI_CTL_LOW_ERRINT_EN | 0x0f;
X pci_write_config_dword(pdev, APB_PCI_CONTROL_LOW, itmp);
-
+#if 0
X /* Don't mess with the retry limit and PIO/DMA latency
X * timer settings. But do set primary and secondary
X * latency timers.
X */
- pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 128);
- pci_write_config_byte(pdev, PCI_SEC_LATENCY_TIMER, 128);
+ pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 64);
+ pci_write_config_byte(pdev, PCI_SEC_LATENCY_TIMER, 64);
+#endif
X }
X }
X }
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/kernel/ptrace.c linux/arch/sparc64/kernel/ptrace.c
--- v2.3.9/linux/arch/sparc64/kernel/ptrace.c Thu Jun 17 01:08:50 1999
+++ linux/arch/sparc64/kernel/ptrace.c Mon Jul 5 11:30:11 1999
@@ -28,242 +28,6 @@
X
X #define MAGIC_CONSTANT 0x80000000


X
-/*
- * This routine gets a long from any process space by following the page
- * tables. NOTE! You should check that the long isn't on a page boundary,
- * and that it is in the task area before calling this: this routine does
- * no checking.
- */

-static pte_t *ptrace_get_page(struct task_struct * tsk,
- struct vm_area_struct * vma, unsigned long addr, int write)


-{
- pgd_t * pgdir;
- pmd_t * pgmiddle;
- pte_t * pgtable;
-

-repeat:


- pgdir = pgd_offset(vma->vm_mm, addr);
-

- /* Seems non-intuitive but the page copy/clear routines always
- * check current's value.
- */
- current->mm->segments = (void *) (addr & PAGE_SIZE);
-
- if (pgd_none(*pgdir)) {
- handle_mm_fault(tsk, vma, addr, write);


- goto repeat;
- }
- if (pgd_bad(*pgdir)) {

- printk("ptrace: bad page directory %016lx\n", pgd_val(*pgdir));


- pgd_clear(pgdir);
- return 0;
- }
- pgmiddle = pmd_offset(pgdir, addr);
- if (pmd_none(*pgmiddle)) {

- handle_mm_fault(tsk, vma, addr, write);


- goto repeat;
- }
- if (pmd_bad(*pgmiddle)) {

- printk("ptrace: bad page middle %016lx\n", pmd_val(*pgmiddle));


- pmd_clear(pgmiddle);
- return 0;
- }
- pgtable = pte_offset(pgmiddle, addr);
- if (!pte_present(*pgtable)) {

- handle_mm_fault(tsk, vma, addr, write);
- goto repeat;
- }
- if (write && !pte_write(*pgtable)) {
- handle_mm_fault(tsk, vma, addr, write);
- goto repeat;
- }
- return pgtable;
-}
-
-/* We must bypass the L1-cache to avoid alias issues. -DaveM */
-static __inline__ unsigned long read_user_long(unsigned long kvaddr)
-{
- unsigned long ret;
-
- __asm__ __volatile__("ldxa [%1] %2, %0"
- : "=r" (ret)
- : "r" (__pa(kvaddr)), "i" (ASI_PHYS_USE_EC));
- return ret;
-}
-
-static __inline__ unsigned int read_user_int(unsigned long kvaddr)
-{
- unsigned int ret;
-
- __asm__ __volatile__("lduwa [%1] %2, %0"
- : "=r" (ret)
- : "r" (__pa(kvaddr)), "i" (ASI_PHYS_USE_EC));
- return ret;
-}
-
-static __inline__ void write_user_long(unsigned long kvaddr, unsigned long val)
-{
- __asm__ __volatile__("stxa %0, [%1] %2"
- : /* no outputs */
- : "r" (val), "r" (__pa(kvaddr)), "i" (ASI_PHYS_USE_EC));
-}
-
-static __inline__ void write_user_int(unsigned long kvaddr, unsigned int val)
-{
- __asm__ __volatile__("stwa %0, [%1] %2"
- : /* no outputs */
- : "r" (val), "r" (__pa(kvaddr)), "i" (ASI_PHYS_USE_EC));
-}
-
-static inline unsigned long get_long(struct task_struct * tsk,
- struct vm_area_struct * vma, unsigned long addr)
-{
- pte_t * pgtable;
- unsigned long page, retval;
-
- if (!(pgtable = ptrace_get_page (tsk, vma, addr, 0))) return 0;
- page = pte_page(*pgtable);
-/* this is a hack for non-kernel-mapped video buffers and similar */


- if (MAP_NR(page) >= max_mapnr)
- return 0;
- page += addr & ~PAGE_MASK;

- retval = read_user_long(page);
- flush_page_to_ram(page);
- return retval;
-}
-
-static inline void put_long(struct task_struct * tsk, struct vm_area_struct * vma,


- unsigned long addr, unsigned long data)

-{


- pte_t *pgtable;
- unsigned long page;
-

- if (!(pgtable = ptrace_get_page (tsk, vma, addr, 1))) return;
- page = pte_page(*pgtable);
-/* this is a hack for non-kernel-mapped video buffers and similar */
- flush_cache_page(vma, addr);
- if (MAP_NR(page) < max_mapnr) {
- unsigned long pgaddr;
-
- pgaddr = page + (addr & ~PAGE_MASK);
- write_user_long(pgaddr, data);
-
- __asm__ __volatile__("
- membar #StoreStore
- flush %0
-" : : "r" (pgaddr & ~7) : "memory");
- }
-/* we're bypassing pagetables, so we have to set the dirty bit ourselves */
-/* this should also re-instate whatever read-only mode there was before */
- set_pte(pgtable, pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
- flush_tlb_page(vma, addr);
-}
-
-static inline unsigned int get_int(struct task_struct * tsk,
- struct vm_area_struct * vma, unsigned long addr)
-{


- pte_t * pgtable;
- unsigned long page;

- unsigned int retval;
-
- if (!(pgtable = ptrace_get_page (tsk, vma, addr, 0))) return 0;
- page = pte_page(*pgtable);
-/* this is a hack for non-kernel-mapped video buffers and similar */


- if (MAP_NR(page) >= max_mapnr)
- return 0;
- page += addr & ~PAGE_MASK;

- retval = read_user_int(page);
- flush_page_to_ram(page);
- return retval;
-}
-
-static inline void put_int(struct task_struct * tsk, struct vm_area_struct * vma,
- unsigned long addr, unsigned int data)
-{


- pte_t *pgtable;
- unsigned long page;
-

- if (!(pgtable = ptrace_get_page (tsk, vma, addr, 1))) return;
- page = pte_page(*pgtable);
-/* this is a hack for non-kernel-mapped video buffers and similar */
- flush_cache_page(vma, addr);
- if (MAP_NR(page) < max_mapnr) {
- unsigned long pgaddr;
-
- pgaddr = page + (addr & ~PAGE_MASK);
- write_user_int(pgaddr, data);
-
- __asm__ __volatile__("
- membar #StoreStore
- flush %0
-" : : "r" (pgaddr & ~7) : "memory");
- }
-/* we're bypassing pagetables, so we have to set the dirty bit ourselves */
-/* this should also re-instate whatever read-only mode there was before */
- set_pte(pgtable, pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
- flush_tlb_page(vma, addr);
-}
-
-/*
- * This routine checks the page boundaries, and that the offset is
- * within the task area. It then calls get_long() to read a long.
- */
-static int read_long(struct task_struct * tsk, unsigned long addr,
- unsigned long * result)
-{
- struct vm_area_struct * vma = find_extend_vma(tsk, addr);
-
- if (!vma)
- return -EIO;
- *result = get_long(tsk, vma, addr);


- return 0;
-}
-

-/*
- * This routine checks the page boundaries, and that the offset is
- * within the task area. It then calls get_int() to read a int.
- */
-static int read_int(struct task_struct * tsk, unsigned long addr,
- unsigned int * result)
-{
- struct vm_area_struct * vma = find_extend_vma(tsk, addr);
-
- if (!vma)
- return -EIO;
- *result = get_int(tsk, vma, addr);


- return 0;
-}
-

-/*
- * This routine checks the page boundaries, and that the offset is
- * within the task area. It then calls put_long() to write a long.
- */
-static int write_long(struct task_struct * tsk, unsigned long addr,
- unsigned long data)
-{
- struct vm_area_struct * vma = find_extend_vma(tsk, addr);
-
- if (!vma)
- return -EIO;
- put_long(tsk, vma, addr, data);


- return 0;
-}
-

-/*
- * This routine checks the page boundaries, and that the offset is
- * within the task area. It then calls put_int() to write a int.
- */
-static int write_int(struct task_struct * tsk, unsigned long addr,
- unsigned int data)
-{
- struct vm_area_struct * vma = find_extend_vma(tsk, addr);
-
- if (!vma)
- return -EIO;
- put_int(tsk, vma, addr, data);


- return 0;
-}
-

X /* Returning from ptrace is a bit tricky because the syscall return
X * low level code assumes any value returned which is negative and
X * is a valid errno will mean setting the condition codes to indicate
@@ -310,175 +74,6 @@
X pt_succ_return_linux (regs, val, addr);
X }
X
-#if 0
-/* XXX: Implement this some day */
-/* Fuck me gently with a chainsaw... */
-static inline void read_sunos_user(struct pt_regs *regs, unsigned long offset,
- struct task_struct *tsk, long *addr)
-{
- struct pt_regs *cregs = tsk->tss.kregs;
- struct thread_struct *t = &tsk->tss;
- int v;
-
- if(offset >= 1024)
- offset -= 1024; /* whee... */
- if(offset & ((sizeof(unsigned int) - 1))) {
- pt_error_return(regs, EIO);
- return;
- }
- if(offset >= 16 && offset < 784) {
- offset -= 16; offset >>= 2;
- if (t->w_saved)
- pt_os_succ_return(regs, *(((unsigned long *)(&t->reg_window[0]))+offset), addr);
- return;
- }
- if(offset >= 784 && offset < 832) {
- offset -= 784; offset >>= 2;
- if (t->w_saved)
- pt_os_succ_return(regs, *(((unsigned long *)(&t->rwbuf_stkptrs[0]))+offset), addr);
- return;
- }
- switch(offset) {
- case 0:
- v = t->ksp;
- break;
-#if 0
- case 4:
- v = t->kpc;
- break;
-#endif
- case 8:
- v = t->kpsr;
- break;
- case 12:
- v = t->uwinmask;
- break;
- case 832:
- v = t->w_saved;
- break;
- case 896:
- v = cregs->u_regs[UREG_I0];
- break;
- case 900:
- v = cregs->u_regs[UREG_I1];
- break;
- case 904:
- v = cregs->u_regs[UREG_I2];
- break;
- case 908:
- v = cregs->u_regs[UREG_I3];
- break;
- case 912:
- v = cregs->u_regs[UREG_I4];
- break;
- case 916:
- v = cregs->u_regs[UREG_I5];
- break;
- case 920:
- v = cregs->u_regs[UREG_I6];
- break;
- case 924:
- if(tsk->tss.flags & MAGIC_CONSTANT)
- v = cregs->u_regs[UREG_G1];
- else
- v = 0;
- break;
- case 940:
- v = cregs->u_regs[UREG_I0];
- break;
- case 944:
- v = cregs->u_regs[UREG_I1];
- break;
-
- case 948:
- /* Isn't binary compatibility _fun_??? */
- if(cregs->psr & PSR_C)
- v = cregs->u_regs[UREG_I0] << 24;
- else
- v = 0;
- break;
-
- /* Rest of them are completely unsupported. */
- default:
- printk("%s [%d]: Wants to read user offset %ld\n",
- current->comm, current->pid, offset);
- pt_error_return(regs, EIO);
- return;
- }
- pt_os_succ_return_linux (regs, v, addr);
- return;
-}
-
-static inline void write_sunos_user(struct pt_regs *regs, unsigned long offset,
- struct task_struct *tsk)
-{
- struct pt_regs *cregs = tsk->tss.kregs;
- struct thread_struct *t = &tsk->tss;
- unsigned int value = regs->u_regs[UREG_I3];
-
- if(offset >= 1024)
- offset -= 1024; /* whee... */
- if(offset & ((sizeof(unsigned long) - 1)))
- goto failure;
- if(offset >= 16 && offset < 784) {
- offset -= 16; offset >>= 2;
- if (t->w_saved)
- *(((unsigned long *)(&t->reg_window[0]))+offset) = value;
- goto success;
- }
- if(offset >= 784 && offset < 832) {
- offset -= 784; offset >>= 2;
- if (t->w_saved)
- *(((unsigned long *)(&t->rwbuf_stkptrs[0]))+offset) = value;
- goto success;
- }
- switch(offset) {
- case 896:
- cregs->u_regs[UREG_I0] = value;
- break;
- case 900:
- cregs->u_regs[UREG_I1] = value;
- break;
- case 904:
- cregs->u_regs[UREG_I2] = value;
- break;
- case 908:
- cregs->u_regs[UREG_I3] = value;
- break;
- case 912:
- cregs->u_regs[UREG_I4] = value;
- break;
- case 916:
- cregs->u_regs[UREG_I5] = value;
- break;
- case 920:
- cregs->u_regs[UREG_I6] = value;
- break;
- case 924:
- cregs->u_regs[UREG_I7] = value;
- break;
- case 940:
- cregs->u_regs[UREG_I0] = value;
- break;
- case 944:
- cregs->u_regs[UREG_I1] = value;
- break;
-
- /* Rest of them are completely unsupported or "no-touch". */
- default:
- printk("%s [%d]: Wants to write user offset %ld\n",
- current->comm, current->pid, offset);
- goto failure;
- }
-success:
- pt_succ_return(regs, 0);
- return;
-failure:
- pt_error_return(regs, EIO);
- return;
-}
-#endif
-
X /* #define ALLOW_INIT_TRACING */
X /* #define DEBUG_PTRACE */
X
@@ -642,76 +237,54 @@
X switch(request) {
X case PTRACE_PEEKTEXT: /* read word at location addr. */
X case PTRACE_PEEKDATA: {
- unsigned long tmp;
- int res;
+ unsigned long tmp64;
+ unsigned int tmp32;
+ int res, copied;
X
- /* Non-word alignment _not_ allowed on Sparc. */
+ res = -EIO;
X if (current->tss.flags & SPARC_FLAG_32BIT) {
- unsigned int x;
- if(addr & (sizeof(unsigned int) - 1)) {
- pt_error_return(regs, EINVAL);
- goto out;
- }
- down(&child->mm->mmap_sem);
- res = read_int(child, addr, &x);
- up(&child->mm->mmap_sem);
- tmp = x;
+ copied = access_process_vm(child, addr,
+ &tmp32, sizeof(tmp32), 0);
+ tmp64 = (unsigned long) tmp32;
+ if (copied == sizeof(tmp32))
+ res = 0;
X } else {
- if(addr & (sizeof(unsigned long) - 1)) {
- pt_error_return(regs, EINVAL);
- goto out;
- }
- down(&child->mm->mmap_sem);
- res = read_long(child, addr, &tmp);
- up(&child->mm->mmap_sem);
+ copied = access_process_vm(child, addr,
+ &tmp64, sizeof(tmp64), 0);
+ if (copied == sizeof(tmp64))
+ res = 0;
X }
- if (res < 0) {
+ if (res < 0)
X pt_error_return(regs, -res);
- goto out;
- }
- pt_os_succ_return(regs, tmp, (long *) data);
- goto out;
+ else
+ pt_os_succ_return(regs, tmp64, (long *) data);
+ goto flush_and_out;
X }
X
- case PTRACE_PEEKUSR:
-#if 0
- read_sunos_user(regs, addr, child, (long *) data);
-#endif
- goto out;
-
- case PTRACE_POKEUSR:
-#if 0
- write_sunos_user(regs, addr, child);
-#endif
- goto out;
-
X case PTRACE_POKETEXT: /* write the word at location addr. */
X case PTRACE_POKEDATA: {
- int res;
+ unsigned long tmp64;
+ unsigned int tmp32;
+ int copied, res = -EIO;
X
- /* Non-word alignment _not_ allowed on Sparc. */
X if (current->tss.flags & SPARC_FLAG_32BIT) {
- if(addr & (sizeof(unsigned int) - 1)) {
- pt_error_return(regs, EINVAL);
- goto out;
- }
- down(&child->mm->mmap_sem);
- res = write_int(child, addr, data);
- up(&child->mm->mmap_sem);
+ tmp32 = data;
+ copied = access_process_vm(child, addr,
+ &tmp32, sizeof(tmp32), 1);
+ if (copied == sizeof(tmp32))
+ res = 0;
X } else {
- if(addr & (sizeof(unsigned long) - 1)) {
- pt_error_return(regs, EINVAL);
- goto out;
- }
- down(&child->mm->mmap_sem);
- res = write_long(child, addr, data);
- up(&child->mm->mmap_sem);
+ tmp64 = data;
+ copied = access_process_vm(child, addr,
+ &tmp64, sizeof(tmp64), 1);
+ if (copied == sizeof(tmp64))
+ res = 0;
X }
X if(res < 0)
X pt_error_return(regs, -res);
X else
X pt_succ_return(regs, res);
- goto out;
+ goto flush_and_out;
X }
X
X case PTRACE_GETREGS: {
@@ -926,98 +499,31 @@
X
X case PTRACE_READTEXT:
X case PTRACE_READDATA: {
- unsigned char *dest = (unsigned char *) addr2;
- unsigned long src = addr;
- int len = data, curlen;
- struct vm_area_struct *vma;


- pte_t *pgtable;
- unsigned long page;
-

- while(len) {
- down(&child->mm->mmap_sem);
- vma = find_extend_vma(child, src);
- if (!vma) {
- up(&child->mm->mmap_sem);
- pt_error_return(regs, EIO);
- goto flush_and_out;
- }
- pgtable = ptrace_get_page (child, vma, src, 0);
- up(&child->mm->mmap_sem);
- if (src & ~PAGE_MASK) {
- curlen = PAGE_SIZE - (src & ~PAGE_MASK);
- if (curlen > len) curlen = len;
- } else if (len > PAGE_SIZE)
- curlen = PAGE_SIZE;
- else
- curlen = len;
- if (pgtable && MAP_NR(page = pte_page(*pgtable)) < max_mapnr) {
- if (copy_to_user (dest, ((char *)page) + (src & ~PAGE_MASK), curlen)) {
- flush_page_to_ram(page);
- pt_error_return(regs, EFAULT);
- goto flush_and_out;
- }
- flush_page_to_ram(page);
- } else {
- if (clear_user (dest, curlen)) {
- pt_error_return(regs, EFAULT);
- goto flush_and_out;
- }
- }
- src += curlen;
- dest += curlen;
- len -= curlen;
+ int res = ptrace_readdata(child, addr,
+ (void *)addr2, data);
+ if (res == data) {
+ pt_succ_return(regs, 0);
+ goto flush_and_out;
X }
- pt_succ_return(regs, 0);
+ if (res >= 0)
+ res = -EIO;
+ pt_error_return(regs, -res);
X goto flush_and_out;
X }
X
X case PTRACE_WRITETEXT:
X case PTRACE_WRITEDATA: {
- unsigned char *src = (unsigned char *) addr2;
- unsigned long dest = addr;
- int len = data, curlen;
- struct vm_area_struct *vma;


- pte_t *pgtable;
- unsigned long page;
-

- while(len) {
- down(&child->mm->mmap_sem);
- vma = find_extend_vma(child, dest);
- if (!vma) {
- up(&child->mm->mmap_sem);
- pt_error_return(regs, EIO);
- goto flush_and_out;
- }
- pgtable = ptrace_get_page (child, vma, dest, 1);
- up(&child->mm->mmap_sem);
- if (dest & ~PAGE_MASK) {
- curlen = PAGE_SIZE - (dest & ~PAGE_MASK);
- if (curlen > len) curlen = len;
- } else if (len > PAGE_SIZE)
- curlen = PAGE_SIZE;
- else
- curlen = len;
- if (pgtable && MAP_NR(page = pte_page(*pgtable)) < max_mapnr) {
- flush_cache_page(vma, dest);
- if (copy_from_user (((char *)page) + (dest & ~PAGE_MASK), src, curlen)) {
- flush_page_to_ram(page);
- set_pte(pgtable, pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
- flush_tlb_page(vma, dest);
- pt_error_return(regs, EFAULT);
- goto flush_and_out;
- }
- flush_page_to_ram(page);
- set_pte(pgtable, pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
- flush_tlb_page(vma, dest);
- }
- src += curlen;
- dest += curlen;
- len -= curlen;
+ int res = ptrace_writedata(child, (void *) addr2,
+ addr, data);
+ if (res == data) {
+ pt_succ_return(regs, 0);
+ goto flush_and_out;
X }
- pt_succ_return(regs, 0);
+ if (res >= 0)
+ res = -EIO;
+ pt_error_return(regs, -res);
X goto flush_and_out;
X }
-
X case PTRACE_SYSCALL: /* continue and stop at (return from) syscall */
X addr = 1;
X
@@ -1105,6 +611,14 @@
X unsigned long va;
X for(va = 0; va < (PAGE_SIZE << 1); va += 32)
X spitfire_put_dcache_tag(va, 0x0);
+ if (request == PTRACE_PEEKTEXT ||
+ request == PTRACE_POKETEXT ||
+ request == PTRACE_READTEXT ||
+ request == PTRACE_WRITETEXT) {
+ for(va = 0; va < (PAGE_SIZE << 1); va += 32)
+ spitfire_put_icache_tag(va, 0x0);
+ __asm__ __volatile__("flush %g6");
+ }
X }
X out:
X unlock_kernel();
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/kernel/smp.c linux/arch/sparc64/kernel/smp.c
--- v2.3.9/linux/arch/sparc64/kernel/smp.c Thu May 27 09:55:21 1999
+++ linux/arch/sparc64/kernel/smp.c Thu Jul 1 15:09:01 1999
@@ -615,7 +615,7 @@
X unsigned int *inc, *inc2;
X
X update_one_process(current, 1, user, !user, cpu);
- if(--current->counter < 0) {
+ if(--current->counter <= 0) {
X current->counter = 0;
X current->need_resched = 1;
X }
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/kernel/sparc64_ksyms.c linux/arch/sparc64/kernel/sparc64_ksyms.c
--- v2.3.9/linux/arch/sparc64/kernel/sparc64_ksyms.c Wed Jun 30 13:38:19 1999
+++ linux/arch/sparc64/kernel/sparc64_ksyms.c Mon Jul 5 20:35:18 1999
@@ -1,4 +1,4 @@
-/* $Id: sparc64_ksyms.c,v 1.59 1999/06/28 11:28:50 davem Exp $
+/* $Id: sparc64_ksyms.c,v 1.60 1999/07/03 22:11:12 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)
@@ -45,7 +45,6 @@
X #include <asm/ebus.h>
X #endif
X #include <asm/a.out.h>
-#include <asm/svr4.h>
X
X struct poll {
X int fd;
@@ -118,6 +117,12 @@
X
X /* used by various drivers */
X #ifdef __SMP__
+/* Out of line rw-locking implementation. */
+EXPORT_SYMBOL_PRIVATE(read_lock);
+EXPORT_SYMBOL_PRIVATE(read_unlock);
+EXPORT_SYMBOL_PRIVATE(write_lock);
+EXPORT_SYMBOL_PRIVATE(write_unlock);
+
X /* Kernel wide locking */
X EXPORT_SYMBOL(kernel_flag);
X
@@ -157,6 +162,10 @@
X EXPORT_SYMBOL(local_irq_count);
X EXPORT_SYMBOL(local_bh_count);
X #endif
+
+/* Atomic counter implementation. */
+EXPORT_SYMBOL_PRIVATE(atomic_add);
+EXPORT_SYMBOL_PRIVATE(atomic_sub);
X
X EXPORT_SYMBOL(ivector_table);
X EXPORT_SYMBOL(enable_irq);
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/kernel/sys_sparc32.c linux/arch/sparc64/kernel/sys_sparc32.c
--- v2.3.9/linux/arch/sparc64/kernel/sys_sparc32.c Wed Jun 30 13:38:19 1999
+++ linux/arch/sparc64/kernel/sys_sparc32.c Tue Jul 6 10:11:40 1999
@@ -17,7 +17,6 @@
X #include <linux/utime.h>
X #include <linux/resource.h>
X #include <linux/times.h>
-#include <linux/utime.h>
X #include <linux/utsname.h>
X #include <linux/timex.h>
X #include <linux/smp.h>
@@ -32,18 +31,15 @@
X #include <linux/smb_mount.h>
X #include <linux/ncp_fs.h>
X #include <linux/quota.h>
-#include <linux/file.h>
X #include <linux/module.h>
X #include <linux/sunrpc/svc.h>
X #include <linux/nfsd/nfsd.h>
X #include <linux/nfsd/cache.h>
X #include <linux/nfsd/xdr.h>
X #include <linux/nfsd/syscall.h>
-#include <linux/module.h>
X #include <linux/poll.h>
X #include <linux/personality.h>
X #include <linux/stat.h>
-#include <linux/timex.h>
X
X #include <asm/types.h>
X #include <asm/ipc.h>
@@ -2328,8 +2324,8 @@
X break;
X }
X /* Bump the usage count and install the file. */
- atomic_inc(&fp[i]->f_count);
- current->files->fd[new_fd] = fp[i];
+ get_file(fp[i]);
+ fd_install(new_fd, fp[i]);
X }
X
X if (i > 0) {
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/kernel/sys_sunos32.c linux/arch/sparc64/kernel/sys_sunos32.c
--- v2.3.9/linux/arch/sparc64/kernel/sys_sunos32.c Wed Jun 30 13:38:19 1999
+++ linux/arch/sparc64/kernel/sys_sunos32.c Tue Jul 6 10:11:40 1999
@@ -25,7 +25,6 @@
X #include <linux/signal.h>
X #include <linux/uio.h>
X #include <linux/utsname.h>
-#include <linux/fs.h>
X #include <linux/major.h>
X #include <linux/stat.h>
X #include <linux/malloc.h>
@@ -712,7 +711,7 @@
X struct inode *inode;
X struct file *file;
X
- file = current->files->fd [fd];
+ file = fcheck(fd);
X if(!file)
X return 0;
X
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/lib/Makefile linux/arch/sparc64/lib/Makefile
--- v2.3.9/linux/arch/sparc64/lib/Makefile Tue Oct 27 09:52:20 1998
+++ linux/arch/sparc64/lib/Makefile Sun Jul 4 09:53:12 1999
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.18 1998/10/13 09:07:24 davem Exp $
+# $Id: Makefile,v 1.19 1999/07/03 22:11:08 davem Exp $
X # Makefile for Sparc library files..
X #
X
@@ -6,7 +6,8 @@
X
X OBJS = PeeCeeI.o blockops.o debuglocks.o strlen.o strncmp.o \
X memscan.o strncpy_from_user.o strlen_user.o memcmp.o checksum.o \
- VIScopy.o VISbzero.o VISmemset.o VIScsum.o VIScsumcopy.o VISsave.o
+ VIScopy.o VISbzero.o VISmemset.o VIScsum.o VIScsumcopy.o VISsave.o \
+ atomic.o rwlock.o
X
X lib.a: $(OBJS)
X $(AR) rcs lib.a $(OBJS)
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/lib/atomic.S linux/arch/sparc64/lib/atomic.S
--- v2.3.9/linux/arch/sparc64/lib/atomic.S Wed Dec 31 16:00:00 1969
+++ linux/arch/sparc64/lib/atomic.S Sun Jul 4 09:53:12 1999
@@ -0,0 +1,32 @@
+/* $Id: atomic.S,v 1.1 1999/07/03 22:11:04 davem Exp $
+ * atomic.S: These things are too big to do inline.
+ *
+ * Copyright (C) 1999 David S. Miller (da...@redhat.com)
+ */
+
+#include <asm/asi.h>
+
+ .text
+ .align 64
+
+ .globl __atomic_add
+__atomic_add:
+ lduw [%g1], %g5
+ add %g5, %g2, %g7
+ cas [%g1], %g5, %g7
+ cmp %g5, %g7
+ bne,pn %icc, __atomic_add
+ nop
+ jmpl %g3 + 8, %g0
+ add %g7, %g2, %g2
+
+ .globl __atomic_sub
+__atomic_sub:
+ lduw [%g1], %g5
+ sub %g5, %g2, %g7
+ cas [%g1], %g5, %g7
+ cmp %g5, %g7
+ bne,pn %icc, __atomic_sub
+ nop
+ jmpl %g3 + 8, %g0
+ sub %g7, %g2, %g2
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/lib/rwlock.S linux/arch/sparc64/lib/rwlock.S
--- v2.3.9/linux/arch/sparc64/lib/rwlock.S Wed Dec 31 16:00:00 1969
+++ linux/arch/sparc64/lib/rwlock.S Sun Jul 4 09:53:12 1999
@@ -0,0 +1,81 @@
+/* $Id: rwlock.S,v 1.1 1999/07/03 22:11:06 davem Exp $
+ * rwlocks.S: These things are too big to do inline.
+ *
+ * Copyright (C) 1999 David S. Miller (da...@redhat.com)
+ */
+
+ .text
+ .align 64
+
+ /* The non-contention read lock usage is 2 cache lines. */
+
+ .globl __read_lock, __read_unlock
+ /* g1=lock, g3=retpc, g5/g7=scratch */
+__read_lock:
+ ldsw [%g1], %g5
+ brlz,pn %g5, __read_wait_for_writer
+4: add %g5, 1, %g7
+ cas [%g1], %g5, %g7
+ cmp %g5, %g7
+ bne,pn %icc, __read_lock
+ membar #StoreLoad | #StoreStore
+99: jmpl %g3 + 8, %g0
+ nop
+__read_unlock:
+ lduw [%g1], %g5
+ sub %g5, 1, %g7
+ cas [%g1], %g5, %g7
+ cmp %g5, %g7
+ be,pt %xcc, 99b
+ membar #StoreLoad | #StoreStore
+ b,a,pt %xcc, __read_unlock
+
+__read_wait_for_writer:
+ ldsw [%g1], %g5
+ brlz,pt %g5, __read_wait_for_writer
+ membar #LoadLoad
+ b,a,pt %xcc, 4b
+__write_wait_for_writer:
+ ldsw [%g1], %g5
+ brlz,pt %g5, __write_wait_for_writer
+ membar #LoadLoad
+ b,a,pt %xcc, 4f
+
+ /* Similarly, 2 cache lines for non-contention write locks. */
+
+ .align 64
+ .globl __write_unlock
+ /* g1=lock, g3=retpc, g2/g5/g7=scratch */
+__write_unlock:
+ sethi %hi(0x80000000), %g2
+1: lduw [%g1], %g5
+ andn %g5, %g2, %g7
+ cas [%g1], %g5, %g7
+ cmp %g5, %g7
+ be,pt %icc, 99b
+ membar #StoreLoad | #StoreStore
+ b,a,pt %xcc, 1b
+
+ .globl __write_lock
+__write_lock:
+ sethi %hi(0x80000000), %g2
+1: ldsw [%g1], %g5
+4: brnz,pn %g5, 5f
+ or %g5, %g2, %g7
+ cas [%g1], %g5, %g7
+ cmp %g5, %g7
+ be,pt %icc, 99b
+ membar #StoreLoad | #StoreStore
+
+ b,a,pt %xcc, 1b
+5: brlz %g5, __write_wait_for_writer
+ or %g5, %g2, %g7
+ cas [%g1], %g5, %g7
+ cmp %g5, %g7
+ bne,pn %icc, 5b
+8: ldsw [%g1], %g5
+ cmp %g5, %g2
+ be,pn %icc, 99b
+ membar #LoadLoad
+ b,a,pt %xcc, 99b
+
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/mm/asyncd.c linux/arch/sparc64/mm/asyncd.c
--- v2.3.9/linux/arch/sparc64/mm/asyncd.c Wed May 12 08:41:12 1999
+++ linux/arch/sparc64/mm/asyncd.c Sun Jul 4 09:53:12 1999
@@ -1,4 +1,4 @@
-/* $Id: asyncd.c,v 1.6 1999/05/12 11:11:48 davem Exp $
+/* $Id: asyncd.c,v 1.8 1999/07/04 04:35:55 davem Exp $
X * The asyncd kernel daemon. This handles paging on behalf of
X * processes that receive page faults due to remote (async) memory
X * accesses.
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/mm/fault.c linux/arch/sparc64/mm/fault.c
--- v2.3.9/linux/arch/sparc64/mm/fault.c Tue Mar 16 21:52:06 1999
+++ linux/arch/sparc64/mm/fault.c Sun Jul 4 09:53:12 1999
@@ -1,4 +1,4 @@
-/* $Id: fault.c,v 1.34 1999/03/16 12:12:28 jj Exp $
+/* $Id: fault.c,v 1.36 1999/07/04 04:35:56 davem Exp $
X * arch/sparc64/mm/fault.c: Page fault handlers for the 64-bit Sparc.
X *
X * Copyright (C) 1996 David S. Miller (da...@caip.rutgers.edu)
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/solaris/ioctl.c linux/arch/sparc64/solaris/ioctl.c
--- v2.3.9/linux/arch/sparc64/solaris/ioctl.c Wed May 26 18:14:37 1999
+++ linux/arch/sparc64/solaris/ioctl.c Tue Jul 6 10:11:40 1999
@@ -367,15 +367,8 @@
X static inline int solaris_timod(unsigned int fd, unsigned int cmd, u32 arg,
X int len, int *len_p)
X {
- struct file *filp;
X struct inode *ino;
X int ret;
-
- filp = current->files->fd[fd];
- if (! filp ||
- ! (ino = filp->f_dentry->d_inode) ||
- ! ino->i_sock)
- return TBADF;
X
X switch (cmd & 0xff) {
X case 141: /* TI_OPTMGMT */
@@ -459,7 +452,7 @@
X return TNOTSUPPORT;
X }
X
-static inline int solaris_S(unsigned int fd, unsigned int cmd, u32 arg)
+static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd, u32 arg)
X {
X char *p;
X int ret;
@@ -470,9 +463,7 @@
X struct sol_socket_struct *sock;
X struct module_info *mi;
X
- filp = current->files->fd[fd];
- if (! filp ||
- ! (ino = filp->f_dentry->d_inode) ||
+ if (! (ino = filp->f_dentry->d_inode) ||
X ! ino->i_sock)
X return -EBADF;
X sock = filp->private_data;
@@ -696,14 +687,14 @@
X struct file *filp;
X int error = -EBADF;
X
- lock_kernel();
- filp = fcheck(fd);
+ filp = fget(fd);
X if (!filp)
X goto out;
X
+ lock_kernel();
X error = -EFAULT;
X switch ((cmd >> 8) & 0xff) {
- case 'S': error = solaris_S(fd, cmd, arg); break;
+ case 'S': error = solaris_S(filp, fd, cmd, arg); break;
X case 'T': error = solaris_T(fd, cmd, arg); break;
X case 'i': error = solaris_i(fd, cmd, arg); break;
X case 'r': error = solaris_r(fd, cmd, arg); break;
@@ -714,6 +705,8 @@
X error = -ENOSYS;
X break;
X }
+ unlock_kernel();
+ fput(filp);
X out:
X if (error == -ENOSYS) {
X unsigned char c = cmd>>8;
@@ -723,6 +716,5 @@
X (int)fd, (unsigned int)cmd, c, (unsigned int)arg);
X error = -EINVAL;
X }
- unlock_kernel();
X return error;
X }
diff -u --recursive --new-file v2.3.9/linux/arch/sparc64/solaris/socksys.c linux/arch/sparc64/solaris/socksys.c
--- v2.3.9/linux/arch/sparc64/solaris/socksys.c Sun Oct 4 10:22:43 1998
+++ linux/arch/sparc64/solaris/socksys.c Mon Jul 5 20:35:18 1999
@@ -16,7 +16,6 @@
X #include <linux/file.h>
X #include <linux/init.h>
X #include <linux/poll.h>
-#include <linux/file.h>
X #include <linux/malloc.h>
X
X #include <asm/uaccess.h>
diff -u --recursive --new-file v2.3.9/linux/drivers/acorn/char/keyb_arc.c linux/drivers/acorn/char/keyb_arc.c
--- v2.3.9/linux/drivers/acorn/char/keyb_arc.c Thu Jun 17 01:11:35 1999
+++ linux/drivers/acorn/char/keyb_arc.c Mon Jul 5 20:35:18 1999
@@ -22,7 +22,6 @@
X #include <linux/ctype.h>
X #include <linux/init.h>
X #include <linux/kbd_ll.h>
-#include <linux/tty.h>
X #include <linux/kbd_kern.h>
X #include <linux/delay.h>
X
diff -u --recursive --new-file v2.3.9/linux/drivers/ap1000/bif.c linux/drivers/ap1000/bif.c
--- v2.3.9/linux/drivers/ap1000/bif.c Fri May 8 00:47:24 1998
+++ linux/drivers/ap1000/bif.c Mon Jul 5 20:35:18 1999
@@ -30,7 +30,6 @@
X #include <asm/io.h>
X
X #include <linux/inet.h>
-#include <linux/netdevice.h>
X #include <linux/etherdevice.h>
X #include <linux/skbuff.h>
X #include <net/sock.h>
diff -u --recursive --new-file v2.3.9/linux/drivers/ap1000/ringbuf.c linux/drivers/ap1000/ringbuf.c
--- v2.3.9/linux/drivers/ap1000/ringbuf.c Wed Jun 30 13:38:19 1999
+++ linux/drivers/ap1000/ringbuf.c Sun Jul 4 10:02:30 1999
@@ -318,6 +318,7 @@
X NULL, /* mknod */
X NULL, /* rename */
X NULL, /* readlink */
+ NULL, /* follow_link */
X NULL, /* get_block */
X NULL, /* readpage */
X NULL, /* writepage */
diff -u --recursive --new-file v2.3.9/linux/drivers/block/Config.in linux/drivers/block/Config.in
--- v2.3.9/linux/drivers/block/Config.in Wed Jun 30 13:38:19 1999
+++ linux/drivers/block/Config.in Mon Jul 5 19:52:13 1999
@@ -41,30 +41,49 @@
X bool ' Generic PCI bus-master DMA support' CONFIG_BLK_DEV_IDEDMA_PCI
X if [ "$CONFIG_BLK_DEV_IDEDMA_PCI" = "y" ]; then
X bool ' Use PCI DMA by default when available' CONFIG_IDEDMA_PCI_AUTO
+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ bool ' Good-Bad DMA Model-Firmware (EXPERIMENTAL)' IDEDMA_NEW_DRIVE_LISTINGS
+ bool ' Generic ATA-66 support (DANGEROUS)' CONFIG_IDEDMA_ULTRA_66
+ define_bool IDEDMA_PCI_EXPERIMENTAL y
+ else
+ define_bool IDEDMA_PCI_EXPERIMENTAL n
+ fi
X fi
X bool ' Boot off-board chipsets first support' CONFIG_BLK_DEV_OFFBOARD
X bool ' AEC6210 chipset support' CONFIG_BLK_DEV_AEC6210
+ if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" ]; then
+ bool ' ALI M15x3 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_ALI15X3
+ bool ' CMD646 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_CMD646
+ bool ' CY82C693 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_CY82C693
+ fi
+ bool ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X
+ if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" -a \
+ "$CONFIG_BLK_DEV_HPT34X" = "y" ]; then
+ bool ' HPT34X DMA support (DANGEROUS)' CONFIG_BLK_DEV_HPT34X_DMA
+ fi
+ bool ' Intel PIIXn chipsets support' CONFIG_BLK_DEV_PIIX
+ if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" -a \
+ "$CONFIG_BLK_DEV_PIIX" = "y" ]; then
+ bool ' PIIXn Tuning support (EXPERIMENTAL)' CONFIG_BLK_DEV_PIIX_TUNING
+ fi
+ if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" ]; then
+ bool ' NS87415 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_NS87415
+ fi
X if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
X bool ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621
- bool ' Intel PIIXn chipsets support (EXPERIMENTAL)' CONFIG_BLK_DEV_PIIX
- if [ "$CONFIG_BLK_DEV_IDEDMA_PCI" = "y" ]; then
- bool ' Tekram TRM290 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_TRM290
- bool ' NS87415 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_NS87415
- bool ' VIA82C586 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_VIA82C586
- bool ' CMD646 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_CMD646
- bool ' ALI M15x3 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_ALI15X3
- bool ' CY82C693 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_CY82C693
- bool ' PDC20246 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC20246
- bool ' PDC20262 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC20262
- if [ "$CONFIG_BLK_DEV_PDC20246" = "y" -o \
- "$CONFIG_BLK_DEV_PDC20262" = "y" ]; then
- define_bool CONFIG_BLK_DEV_PDC202XX y
- else
- define_bool CONFIG_BLK_DEV_PDC202XX n
- fi
- bool ' HPT343 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_HPT343
+ fi
+ if [ "$CONFIG_BLK_DEV_IDEDMA_PCI" = "y" ]; then
+ bool ' PROMISE PDC20246/PDC20262 support' CONFIG_BLK_DEV_PDC202XX
+ if [ "$CONFIG_EXPERIMENTAL" = "y" -a \
+ "$CONFIG_BLK_DEV_PDC202XX" = "y" ]; then
+ bool ' Special UDMA Feature (EXPERIMENTAL)' PDC202XX_FORCE_BURST_BIT
+ bool ' Special Mode Feature (DANGEROUS)' PDC202XX_FORCE_MASTER_MODE
X fi
X fi
+ if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" ]; then
+ bool ' Tekram TRM290 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_TRM290
+ bool ' VIA82C586 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_VIA82C586
+ fi
X fi
X if [ "$CONFIG_PPC" = "y" -o "$CONFIG_ARM" = "y" ]; then
X bool ' Winbond SL82c105 support' CONFIG_BLK_DEV_SL82C105
@@ -106,13 +125,12 @@
X bool ' ALI M14xx support' CONFIG_BLK_DEV_ALI14XX
X bool ' DTC-2278 support' CONFIG_BLK_DEV_DTC2278
X bool ' Holtek HT6560B support' CONFIG_BLK_DEV_HT6560B
+ if [ "$CONFIG_BLK_DEV_IDEDISK" = "y" -a \
+ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ bool ' PROMISE DC4030 support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC4030
+ fi
X bool ' QDI QD6580 support' CONFIG_BLK_DEV_QD6580
X bool ' UMC-8672 support' CONFIG_BLK_DEV_UMC8672
- if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- if [ "$CONFIG_BLK_DEV_IDEDISK" = "y" ]; then
- bool ' PROMISE DC4030 support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC4030
- fi
- fi
X fi
X if [ "$CONFIG_AMIGA" = "y" ]; then
X bool ' Amiga Gayle IDE interface support' CONFIG_BLK_DEV_GAYLE
@@ -145,6 +163,7 @@
X dep_tristate 'Atari SLM laser printer support' CONFIG_ATARI_SLM $CONFIG_ATARI_ACSI
X fi
X fi
+tristate 'Compaq SMART2 support' CONFIG_BLK_CPQ_DA
X
X comment 'Additional Block Devices'
X
@@ -182,13 +201,13 @@
X source drivers/block/paride/Config.in
X fi
X
-
-if [ "$CONFIG_BLK_DEV_CMD640" = "y" -o \
- "$CONFIG_IDE_CHIPSETS" = "y" -o \
- "$CONFIG_BLK_DEV_OPTI621" = "y" -o \
- "$CONFIG_BLK_DEV_IDE_PMAC" = "y" -o \
+if [ "$CONFIG_IDE_CHIPSETS" = "y" -o \
+ "$CONFIG_BLK_DEV_ALI15X3" = "y" -o \
+ "$CONFIG_BLK_DEV_CMD640" = "y" -o \
X "$CONFIG_BLK_DEV_CY82C693" = "y" -o \
- "$CONFIG_BLK_DEV_HPT343" = "y" -o \
+ "$CONFIG_BLK_DEV_HPT34X" = "y" -o \
+ "$CONFIG_BLK_DEV_IDE_PMAC" = "y" -o \
+ "$CONFIG_BLK_DEV_OPTI621" = "y" -o \
X "$CONFIG_BLK_DEV_PIIX" = "y" -o \
X "$CONFIG_BLK_DEV_SL82C105" = "y" ]; then
X define_bool CONFIG_BLK_DEV_IDE_MODES y
diff -u --recursive --new-file v2.3.9/linux/drivers/block/Makefile linux/drivers/block/Makefile
--- v2.3.9/linux/drivers/block/Makefile Wed May 26 09:30:31 1999
+++ linux/drivers/block/Makefile Mon Jul 5 19:52:13 1999
@@ -202,8 +202,8 @@
X IDE_OBJS += aec6210.o
X endif
X
-ifeq ($(CONFIG_BLK_DEV_HPT343),y)
-IDE_OBJS += hpt343.o
+ifeq ($(CONFIG_BLK_DEV_HPT34X),y)
+IDE_OBJS += hpt34x.o
X endif
X
X ### if CONFIG_BLK_DEV_IDE is n, IDE_OBJS will be ignored
@@ -271,6 +271,14 @@
X else
X ifeq ($(CONFIG_BLK_DEV_XD),m)
X M_OBJS += xd.o
+ endif
+endif
+
+ifeq ($(CONFIG_BLK_CPQ_DA),y)
+L_OBJS += cpqarray.o
+else
+ ifeq ($(CONFIG_BLK_CPQ_DA),m)
+ M_OBJS += cpqarray.o


X endif
X endif
X

diff -u --recursive --new-file v2.3.9/linux/drivers/block/alim15x3.c linux/drivers/block/alim15x3.c
--- v2.3.9/linux/drivers/block/alim15x3.c Wed May 26 16:55:40 1999
+++ linux/drivers/block/alim15x3.c Thu Jul 1 10:25:38 1999


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

- * linux/drivers/block/alim15x3.c Version 0.04 Feb. 8, 1999
+ * linux/drivers/block/alim15x3.c Version 0.05 Jun. 29, 1999
X *
X * Copyright (C) 1998-99 Michel Aubry, Maintainer
X * Copyright (C) 1998-99 Andrzej Krzysztofowicz, Maintainer
@@ -20,6 +20,8 @@
X
X #include <asm/io.h>
X
+#include "ide_modes.h"
+
X #define DISPLAY_ALI_TIMINGS
X
X #if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS)
@@ -59,6 +61,55 @@
X };
X #endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */
X
+static void ali15x3_tune_drive (ide_drive_t *drive, byte pio)
+{
+ ide_pio_data_t d;
+ ide_hwif_t *hwif = HWIF(drive);
+ struct pci_dev *dev = hwif->pci_dev;
+ int s_time, a_time, c_time;
+ byte s_clc, a_clc, r_clc;
+ unsigned long flags;
+ int bus_speed = ide_system_bus_speed();
+ int port = hwif->index ? 0x5c : 0x58;
+
+ pio = ide_get_best_pio_mode(drive, pio, 5, &d);
+ s_time = ide_pio_timings[pio].setup_time;
+ a_time = ide_pio_timings[pio].active_time;
+ if ((s_clc = (s_time * bus_speed + 999) / 1000) >= 8)
+ s_clc = 0;
+ if ((a_clc = (a_time * bus_speed + 999) / 1000) >= 8)
+ a_clc = 0;
+ c_time = ide_pio_timings[pio].cycle_time;
+
+#if 0
+ if ((r_clc = ((c_time - s_time - a_time) * bus_speed + 999) / 1000) >= 16)
+ r_clc = 0;
+#endif
+
+ if (!(r_clc = (c_time * bus_speed + 999) / 1000 - a_clc - s_clc)) {
+ r_clc = 1;
+ } else {
+ if (r_clc >= 16)
+ r_clc = 0;
+ }
+ save_flags(flags);
+ cli();
+ pci_write_config_byte(dev, port, s_clc);
+ pci_write_config_byte(dev, port+drive->select.b.unit+2, (a_clc << 4) | r_clc);
+ restore_flags(flags);
+
+ /*
+ * setup active rec
+ * { 70, 165, 365 }, PIO Mode 0
+ * { 50, 125, 208 }, PIO Mode 1
+ * { 30, 100, 110 }, PIO Mode 2
+ * { 30, 80, 70 }, PIO Mode 3 with IORDY
+ * { 25, 70, 25 }, PIO Mode 4 with IORDY ns
+ * { 20, 50, 30 } PIO Mode 5 with IORDY (nonstandard)
+ */
+
+}
+
X __initfunc(unsigned int pci_init_ali15x3 (struct pci_dev *dev, const char *name))
X {
X byte confreg0 = 0, confreg1 =0, progif = 0;
@@ -146,19 +197,22 @@
X __initfunc(void ide_init_ali15x3 (ide_hwif_t *hwif))
X {
X struct pci_dev *dev;
- byte ideic, inmir;
+ byte ideic, inmir, iderev;
X byte irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6,
X 1, 11, 0, 12, 0, 14, 0, 15 };
+
+ pci_read_config_byte(hwif->pci_dev, PCI_REVISION_ID, &iderev);
+
X hwif->irq = hwif->channel ? 15 : 14;
X for (dev = pci_devices; dev; dev=dev->next) /* look for ISA bridge */
X if (dev->vendor==PCI_VENDOR_ID_AL &&
- dev->device==PCI_DEVICE_ID_AL_M1533)
+ dev->device==PCI_DEVICE_ID_AL_M1533)
X break;
X if (dev) {
X pci_read_config_byte(dev, 0x58, &ideic);
X ideic = ideic & 0x03;
X if ((hwif->channel && ideic == 0x03) ||
- (!hwif->channel && !ideic)) {
+ (!hwif->channel && !ideic)) {
X pci_read_config_byte(dev, 0x44, &inmir);
X inmir = inmir & 0x0f;
X hwif->irq = irq_routing_table[inmir];
@@ -174,8 +228,15 @@
X ali_display_info = &ali_get_info;
X #endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */
X
- if (hwif->dma_base)
+ hwif->tuneproc = &ali15x3_tune_drive;
+ if ((hwif->dma_base) && (iderev >= 0xC1)) {
+ /* M1543C or newer for DMAing */
X hwif->dmaproc = &ali15x3_dmaproc;
+ } else {
+ hwif->autodma = 0;


+ hwif->drives[0].autotune = 1;
+ hwif->drives[1].autotune = 1;

+ }
X return;
X }
X
diff -u --recursive --new-file v2.3.9/linux/drivers/block/amiflop.c linux/drivers/block/amiflop.c
--- v2.3.9/linux/drivers/block/amiflop.c Tue May 11 23:33:42 1999
+++ linux/drivers/block/amiflop.c Tue Jul 6 19:05:48 1999
@@ -1755,13 +1755,13 @@
X NULL, /* revalidate */
X };
X
-__initfunc(void amiga_floppy_setup (char *str, int *ints))
+void __init amiga_floppy_setup (char *str, int *ints)
X {
X printk (KERN_INFO "amiflop: Setting default df0 to %x\n", ints[1]);
X fd_def_df0 = ints[1];
X }
X
-__initfunc(static int fd_probe_drives(void))
+static int __init fd_probe_drives(void)
X {
X int drive,drives,nomem;
X
@@ -1791,7 +1791,7 @@
X return -ENOMEM;
X }
X
-__initfunc(int amiga_floppy_init(void))
+int __init amiga_floppy_init(void)


X {
X int i;
X

diff -u --recursive --new-file v2.3.9/linux/drivers/block/ataflop.c linux/drivers/block/ataflop.c
--- v2.3.9/linux/drivers/block/ataflop.c Sat May 15 23:43:04 1999
+++ linux/drivers/block/ataflop.c Tue Jul 6 19:05:48 1999
@@ -1771,7 +1771,7 @@
X
X /* Initialize the 'unit' variable for drive 'drive' */
X
-__initfunc(static void fd_probe( int drive ))
+static void __init fd_probe( int drive )
X {
X UD.connected = 0;
X UDT = NULL;
@@ -1814,7 +1814,7 @@
X * declared absent.
X */
X
-__initfunc(static int fd_test_drive_present( int drive ))
+static int __init fd_test_drive_present( int drive )
X {
X unsigned long timeout;
X unsigned char status;
@@ -1861,7 +1861,7 @@
X * floppies, additionally start the disk-change and motor-off timers.
X */
X
-__initfunc(static void config_types( void ))
+static void __init config_types( void )
X {
X int drive, cnt = 0;
X
@@ -2006,7 +2006,7 @@
X floppy_revalidate, /* revalidate */
X };
X
-__initfunc(int atari_floppy_init (void))
+int __init atari_floppy_init (void)


X {
X int i;
X

@@ -2075,7 +2075,7 @@
X }
X
X
-__initfunc(void atari_floppy_setup( char *str, int *ints ))
+void __init atari_floppy_setup( char *str, int *ints )
X {
X int i;
X
diff -u --recursive --new-file v2.3.9/linux/drivers/block/cmd646.c linux/drivers/block/cmd646.c
--- v2.3.9/linux/drivers/block/cmd646.c Thu May 27 09:55:21 1999
+++ linux/drivers/block/cmd646.c Tue Jul 6 19:05:48 1999
@@ -1,4 +1,4 @@
-/* $Id: cmd646.c,v 1.13 1999/05/27 04:49:38 davem Exp $
+/* $Id: cmd646.c,v 1.14 1999/07/03 08:56:09 davem Exp $
X * cmd646.c: Enable interrupts at initialization time on Ultra/PCI machines.
X * Note, this driver is not used at all on other systems because
X * there the "BIOS" has done all of the following already.
@@ -94,6 +94,9 @@
X
X static void cmd646_do_setfeature(ide_drive_t *drive, byte command)
X {
+#if 0
+ (void) ide_config_drive_speed(drive, command);
+#else
X unsigned long flags;
X byte old_select;
X
@@ -116,6 +119,7 @@
X out:
X OUT_BYTE(old_select, IDE_SELECT_REG);
X restore_flags(flags);
+#endif
X }
X
X static void cmd646_dma2_enable(ide_drive_t *drive, unsigned long dma_base)
@@ -236,7 +240,7 @@
X return cmd646_dmaproc(func, drive);
X }
X
-__initfunc(void ide_init_cmd646 (ide_hwif_t *hwif))
+void __init ide_init_cmd646 (ide_hwif_t *hwif)
X {
X struct pci_dev *dev = hwif->pci_dev;
X unsigned char mrdmode;
diff -u --recursive --new-file v2.3.9/linux/drivers/block/cpqarray.c linux/drivers/block/cpqarray.c
--- v2.3.9/linux/drivers/block/cpqarray.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/block/cpqarray.c Tue Jul 6 10:11:40 1999
@@ -0,0 +1,1730 @@


+/*
+ * Disk Array driver for Compaq SMART2 Controllers
+ * Copyright 1998 Compaq Computer 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, GOOD TITLE or
+ * NON INFRINGEMENT. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Questions/Comments/Bugfixes to arr...@compaq.com
+ *
+ * If you want to make changes, improve or add functionality to this
+ * driver, you'll probably need the Compaq Array Controller Interface
+ * Specificiation (Document number ECG086/1198)
+ */

+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/kernel.h>
+#include <linux/malloc.h>
+#include <linux/delay.h>
+#include <linux/major.h>
+#include <linux/fs.h>
+#include <linux/blkpg.h>
+#include <linux/timer.h>
+#include <linux/proc_fs.h>
+#include <linux/hdreg.h>
+#include <asm/uaccess.h>
+#include <asm/spinlock.h>
+#include <asm/io.h>
+
+
+#define SMART2_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
+
+#define DRIVER_NAME "Compaq SMART2 Driver (v 1.0.4)"
+#define DRIVER_VERSION SMART2_DRIVER_VERSION(1,0,4)
+#define MAJOR_NR COMPAQ_SMART2_MAJOR
+#include <linux/blk.h>
+#include <linux/blkdev.h>
+#include <linux/genhd.h>
+
+#include "cpqarray.h"
+#include "ida_cmd.h"
+#include "smart1,2.h"
+#include "ida_ioctl.h"
+
+#define READ_AHEAD 128
+#define NR_CMDS 128 /* This could probably go as high as ~400 */
+
+#define MAX_CTLR 8
+#define CTLR_SHIFT 8
+
+static int nr_ctlr = 0;
+static ctlr_info_t *hba[MAX_CTLR] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+
+static int eisa[8] = { 0, 0 ,0 ,0, 0, 0 ,0 ,0 };
+
+#define NR_PRODUCTS (sizeof(products)/sizeof(struct board_type))
+
+/* board_id = Subsystem Device ID & Vendor ID
+ * product = Marketing Name for the board
+ * access = Address of the struct of function pointers
+ */
+struct board_type products[] = {
+ { 0x0040110E, "IDA", &smart1_access },
+ { 0x0140110E, "IDA-2", &smart1_access },
+ { 0x1040110E, "IAES", &smart1_access },
+ { 0x2040110E, "SMART", &smart1_access },
+ { 0x3040110E, "SMART-2/E", &smart2e_access },
+ { 0x40300E11, "SMART-2/P", &smart2_access },
+ { 0x40310E11, "SMART-2SL", &smart2_access },
+ { 0x40320E11, "Smart Array 3200", &smart2_access },
+ { 0x40330E11, "Smart Array 3100ES", &smart2_access },
+ { 0x40340E11, "Smart Array 221", &smart2_access },
+ { 0x40400E11, "Integrated Array", &smart4_access },
+ { 0x40500E11, "Smart Array 4200", &smart4_access },
+ { 0x40510E11, "Smart Array 4250ES", &smart4_access },
+};
+
+static struct hd_struct * ida;
+static int * ida_sizes;
+static int * ida_blocksizes;
+static int * ida_hardsizes;
+static struct gendisk ida_gendisk[MAX_CTLR];
+
+struct proc_dir_entry *proc_array = NULL;
+
+/* Debug... */
+#define DBG(s) do { s } while(0)
+/* Debug (general info)... */
+#define DBGINFO(s) do { } while(0)
+/* Debug Paranoid... */
+#define DBGP(s) do { } while(0)
+/* Debug Extra Paranoid... */
+#define DBGPX(s) do { } while(0)
+
+void cpqarray_init(void);
+static int cpqarray_pci_detect(void);
+static int cpqarray_pci_init(ctlr_info_t *c, unchar bus, unchar device_fn);
+static ulong remap_pci_mem(ulong base, ulong size);
+static int cpqarray_eisa_detect(void);
+static int pollcomplete(int ctlr);
+static void getgeometry(int ctlr);
+static void start_fwbk(int ctlr);
+
+static cmdlist_t * cmd_alloc(ctlr_info_t *h);
+static void cmd_free(ctlr_info_t *h, cmdlist_t *c);
+
+static int sendcmd(
+ __u8 cmd,
+ int ctlr,
+ void *buff,
+ size_t size,
+ unsigned int blk,
+ unsigned int blkcnt,
+ unsigned int log_unit );
+
+static int ida_open(struct inode *inode, struct file *filep);
+static int ida_release(struct inode *inode, struct file *filep);
+static int ida_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, unsigned long arg);
+static int ida_ctlr_ioctl(int ctlr, int dsk, ida_ioctl_t *io);
+
+static void do_ida_request(int i);
+/*
+ * This is a hack. This driver eats a major number for each controller, and
+ * sets blkdev[xxx].request_fn to each one of these so the real request
+ * function knows what controller its working with.
+ */
+#define DO_IDA_REQUEST(x) { do_ida_request(x); }
+
+static void do_ida_request0(void) DO_IDA_REQUEST(0);
+static void do_ida_request1(void) DO_IDA_REQUEST(1);
+static void do_ida_request2(void) DO_IDA_REQUEST(2);
+static void do_ida_request3(void) DO_IDA_REQUEST(3);
+static void do_ida_request4(void) DO_IDA_REQUEST(4);
+static void do_ida_request5(void) DO_IDA_REQUEST(5);
+static void do_ida_request6(void) DO_IDA_REQUEST(6);
+static void do_ida_request7(void) DO_IDA_REQUEST(7);
+
+static void start_io(ctlr_info_t *h);
+
+static inline void addQ(cmdlist_t **Qptr, cmdlist_t *c);
+static inline cmdlist_t *removeQ(cmdlist_t **Qptr, cmdlist_t *c);
+static inline void complete_buffers(struct buffer_head *bh, int ok);
+static inline void complete_command(cmdlist_t *cmd, int timeout);
+
+static void do_ida_intr(int irq, void *dev_id, struct pt_regs * regs);
+static void ida_timer(unsigned long tdata);
+static int frevalidate_logvol(kdev_t dev);
+static int revalidate_logvol(kdev_t dev, int maxusage);
+static int revalidate_allvol(kdev_t dev);
+
+static void ida_procinit(int i);
+static int ida_proc_get_info(char *buffer, char **start, off_t offset, int length, int *eof, void *data);
+
+static void ida_geninit(struct gendisk *g)
+{
+ int ctlr = g-ida_gendisk;
+ int i,j;
+ drv_info_t *drv;
+
+ for(i=0; i<NWD; i++) {
+ drv = &hba[ctlr]->drv[i];
+ if (!drv->nr_blks)
+ continue;
+ ida[(ctlr<<CTLR_SHIFT) + (i<<NWD_SHIFT)].nr_sects =
+ ida_sizes[(ctlr<<CTLR_SHIFT) + (i<<NWD_SHIFT)] =
+ drv->nr_blks;
+
+ for(j=0; j<16; j++) {
+ ida_blocksizes[(ctlr<<CTLR_SHIFT) + (i<<NWD_SHIFT)+j] =
+ 1024;
+ ida_hardsizes[(ctlr<<CTLR_SHIFT) + (i<<NWD_SHIFT)+j] =
+ drv->blk_size;
+ }
+ ida_gendisk[ctlr].nr_real++;
+ }
+
+}
+
+struct file_operations ida_fops = {
+ NULL, /* lseek - default */
+ block_read, /* read - general block-dev read */
+ block_write, /* write - general block-dev write */
+ NULL, /* readdir - bad */
+ NULL, /* select */
+ ida_ioctl, /* ioctl */
+ NULL, /* mmap */
+ ida_open, /* open code */
+ NULL,
+ ida_release, /* release */
+ block_fsync, /* fsync */
+ NULL, /* fasync */
+ NULL, /* Disk change */
+ frevalidate_logvol, /* revalidate */
+};
+
+
+/*
+ * Get us a file in /proc/array that says something about each controller.
+ * Create /proc/array if it doesn't exist yet.
+ */
+static void ida_procinit(int i)
+{
+ struct proc_dir_entry *pd;
+
+ if (proc_array == NULL) {
+ proc_array = create_proc_entry("array", S_IFDIR|S_IRUGO|S_IXUGO,
+ &proc_root);
+ if (!proc_array) return;
+ }
+
+ pd = create_proc_entry(hba[i]->devname, S_IFREG|S_IRUGO, proc_array);
+ if (!pd) return;
+ pd->read_proc = ida_proc_get_info;
+ pd->data = hba[i];
+}
+
+/*
+ * Report information about this controller.
+ */
+static int ida_proc_get_info(char *buffer, char **start, off_t offset, int length, int *eof, void *data)
+{
+ off_t pos = 0;
+ off_t len = 0;
+ int size, i, ctlr;
+ ctlr_info_t *h = (ctlr_info_t*)data;
+ drv_info_t *drv;
+#ifdef CPQ_PROC_PRINT_QUEUES
+ cmdlist_t *c;
+#endif
+
+ ctlr = h->ctlr;
+ size = sprintf(buffer, "%s: Compaq %s Controller\n"
+ " Board ID: %08lx\n"
+ " Firmware Revision: %c%c%c%c\n"
+ " Controller Sig: %08lx\n"
+ " Memory Address: %08lx\n"
+ " I/O Port: %04x\n"
+ " IRQ: %x\n"
+ " Logical drives: %d\n"
+ " Physical drives: %d\n\n"
+ " Current Q depth: %d\n"
+ " Max Q depth since init: %d\n\n",
+ h->devname,
+ h->product_name,
+ (unsigned long)h->board_id,
+ h->firm_rev[0], h->firm_rev[1], h->firm_rev[2], h->firm_rev[3],
+ (unsigned long)h->ctlr_sig, (unsigned long)h->vaddr,
+ (unsigned int) h->ioaddr, (unsigned int)h->intr,
+ h->log_drives, h->phys_drives,
+ h->Qdepth, h->maxQsinceinit);
+
+ pos += size; len += size;
+
+ size = sprintf(buffer+len, "Logical Drive Info:\n");
+ pos += size; len += size;
+
+ for(i=0; i<h->log_drives; i++) {
+ drv = &h->drv[i];
+ size = sprintf(buffer+len, "ida/c%dd%d: blksz=%d nr_blks=%d\n",
+ ctlr, i, drv->blk_size, drv->nr_blks);
+ pos += size; len += size;
+ }
+
+#ifdef CPQ_PROC_PRINT_QUEUES
+ size = sprintf(buffer+len, "\nCurrent Queues:\n");
+ pos += size; len += size;
+
+ c = h->reqQ;
+ size = sprintf(buffer+len, "reqQ = %p", c); pos += size; len += size;
+ if (c) c=c->next;
+ while(c && c != h->reqQ) {
+ size = sprintf(buffer+len, "->%p", c);
+ pos += size; len += size;
+ c=c->next;
+ }
+
+ c = h->cmpQ;
+ size = sprintf(buffer+len, "\ncmpQ = %p", c); pos += size; len += size;
+ if (c) c=c->next;
+ while(c && c != h->cmpQ) {
+ size = sprintf(buffer+len, "->%p", c);
+ pos += size; len += size;
+ c=c->next;
+ }
+
+ size = sprintf(buffer+len, "\n"); pos += size; len += size;
+#endif
+ size = sprintf(buffer+len, "nr_allocs = %d\nnr_frees = %d\n",
+ h->nr_allocs, h->nr_frees);
+ pos += size; len += size;
+
+ *eof = 1;
+ *start = buffer+offset;
+ len -= offset;
+ if (len>length)
+ len = length;


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

echo 'End of part 04'
echo 'File patch-2.3.10 is continued in part 05'
echo 05 > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Jul 9, 1999, 3:00:00 AM7/9/99
to
Archive-name: v2.3/patch-2.3.10/part08

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


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.10 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.3.10'
else
echo 'x - continuing with patch-2.3.10'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.10' &&

+ GIRQ1 signals that ZR36060's DATERR# line is asserted.
+
+ SAA7111A
+
+ In their infinite wisdom, the Iomega engineers decided to
+ use the same input line for composite and S-Video Color,
+ although there are two entries not connected at all!
+ Through this ingenious strike, it is not possible to
+ keep two running video sources connected at the same time
+ to Composite and S-VHS input!
+
+ mode 0 - N/C
+ mode 1 - S-Video Y
+ mode 2 - noise or something I don't know
+ mode 3 - Composite and S-Video C
+ mode 4 - N/C
+ mode 5 - S-Video (gain C independently selectable of gain Y)
+ mode 6 - N/C
+ mode 7 - S-Video (gain C adapted to gain Y)
+ */
+
+#define MAJOR_VERSION 1 /* driver major version */
+#define MINOR_VERSION 0 /* driver minor version */
+
+#define BUZ_NAME "Iomega BUZ V-1.0" /* name of the driver */
+


+#define DEBUG(x) /* Debug driver */
+#define IDEBUG(x) /* Debug interrupt handler */

+#define IOCTL_DEBUG(x)
+
+
+/* The parameters for this driver */
+
+/*
+ The video mem address of the video card.
+ The driver has a little database for some videocards
+ to determine it from there. If your video card is not in there
+ you have either to give it to the driver as a parameter
+ or set in in a VIDIOCSFBUF ioctl
+ */
+
+static unsigned long vidmem = 0; /* Video memory base address */
+
+/* Special purposes only: */
+
+static int triton = 0; /* 0=no, 1=yes */
+static int natoma = 0; /* 0=no, 1=yes */
+
+/*
+ Number and size of grab buffers for Video 4 Linux
+ The vast majority of applications should not need more than 2,
+ the very popular BTTV driver actually does ONLY have 2.
+ Time sensitive applications might need more, the maximum
+ is VIDEO_MAX_FRAME (defined in <linux/videodev.h>).
+
+ The size is set so that the maximum possible request
+ can be satisfied. Decrease it, if bigphys_area alloc'd
+ memory is low. If you don't have the bigphys_area patch,
+ set it to 128 KB. Will you allow only to grab small
+ images with V4L, but that's better than nothing.
+
+ v4l_bufsize has to be given in KB !
+
+ */
+
+static int v4l_nbufs = 2;
+static int v4l_bufsize = 128; /* Everybody should be able to work with this setting */
+
+/*
+ Default input and video norm at startup of the driver.
+ */
+
+static int default_input = 0; /* 0=Composite, 1=S-VHS */
+static int default_norm = 0; /* 0=PAL, 1=NTSC */
+
+MODULE_PARM(vidmem, "i");
+MODULE_PARM(triton, "i");
+MODULE_PARM(natoma, "i");
+MODULE_PARM(v4l_nbufs, "i");
+MODULE_PARM(v4l_bufsize, "i");
+MODULE_PARM(default_input, "i");
+MODULE_PARM(default_norm, "i");
+
+/* Anybody who uses more than four? */
+#define BUZ_MAX 4
+
+static int zoran_num; /* number of Buzs in use */
+static struct zoran zoran[BUZ_MAX];
+
+/* forward references */
+
+static void v4l_fbuffer_free(struct zoran *zr);
+static void jpg_fbuffer_free(struct zoran *zr);
+static void zoran_feed_stat_com(struct zoran *zr);
+
+
+
+/*
+ * Allocate the V4L grab buffers
+ *
+ * These have to be pysically contiguous.
+ * If v4l_bufsize <= MAX_KMALLOC_MEM we use kmalloc
+ */
+
+static int v4l_fbuffer_alloc(struct zoran *zr)
+{
+ int i, off;
+ unsigned char *mem;
+
+ for (i = 0; i < v4l_nbufs; i++) {
+ if (zr->v4l_gbuf[i].fbuffer)
+ printk(KERN_WARNING "%s: v4l_fbuffer_alloc: buffer %d allready allocated ?\n", zr->name, i);
+
+ if (v4l_bufsize <= MAX_KMALLOC_MEM) {
+ /* Use kmalloc */
+
+ mem = (unsigned char *) kmalloc(v4l_bufsize, GFP_KERNEL);
+ if (mem == 0) {
+ printk(KERN_ERR "%s: kmalloc for V4L bufs failed\n", zr->name);
+ v4l_fbuffer_free(zr);
+ return -ENOBUFS;
+ }
+ zr->v4l_gbuf[i].fbuffer = mem;
+ zr->v4l_gbuf[i].fbuffer_phys = virt_to_phys(mem);
+ zr->v4l_gbuf[i].fbuffer_bus = virt_to_bus(mem);
+ for (off = 0; off < v4l_bufsize; off += PAGE_SIZE)
+ mem_map_reserve(MAP_NR(mem + off));
+ DEBUG(printk(BUZ_INFO ": V4L frame %d mem 0x%x (bus: 0x%x=%d)\n", i, mem, virt_to_bus(mem), virt_to_bus(mem)));
+ } else {
+ return -ENOBUFS;
+ }
+ }
+


+ return 0;
+}
+

+/* free the V4L grab buffers */
+static void v4l_fbuffer_free(struct zoran *zr)
+{
+ int i, off;
+ unsigned char *mem;
+
+ for (i = 0; i < v4l_nbufs; i++) {
+ if (!zr->v4l_gbuf[i].fbuffer)
+ continue;
+
+ mem = zr->v4l_gbuf[i].fbuffer;
+ for (off = 0; off < v4l_bufsize; off += PAGE_SIZE)
+ mem_map_unreserve(MAP_NR(mem + off));
+ kfree((void *) zr->v4l_gbuf[i].fbuffer);
+ zr->v4l_gbuf[i].fbuffer = NULL;
+ }
+}
+
+/*
+ * Allocate the MJPEG grab buffers.
+ *
+ * If the requested buffer size is smaller than MAX_KMALLOC_MEM,
+ * kmalloc is used to request a physically contiguous area,
+ * else we allocate the memory in framgents with get_free_page.
+ *
+ * If a Natoma chipset is present and this is a revision 1 zr36057,
+ * each MJPEG buffer needs to be physically contiguous.
+ * (RJ: This statement is from Dave Perks' original driver,
+ * I could never check it because I have a zr36067)
+ * The driver cares about this because it reduces the buffer
+ * size to MAX_KMALLOC_MEM in that case (which forces contiguous allocation).
+ *
+ * RJ: The contents grab buffers needs never be accessed in the driver.
+ * Therefore there is no need to allocate them with vmalloc in order
+ * to get a contiguous virtual memory space.
+ * I don't understand why many other drivers first allocate them with
+ * vmalloc (which uses internally also get_free_page, but delivers you
+ * virtual addresses) and then again have to make a lot of efforts
+ * to get the physical address.
+ *
+ */
+
+static int jpg_fbuffer_alloc(struct zoran *zr)
+{
+ int i, j, off, alloc_contig;
+ unsigned long mem;
+
+ /* Decide if we should alloc contiguous or fragmented memory */
+ /* This has to be identical in jpg_fbuffer_alloc and jpg_fbuffer_free */
+
+ alloc_contig = (zr->jpg_bufsize < MAX_KMALLOC_MEM);
+
+ for (i = 0; i < zr->jpg_nbufs; i++) {
+ if (zr->jpg_gbuf[i].frag_tab)
+ printk(KERN_WARNING "%s: jpg_fbuffer_alloc: buffer %d allready allocated ???\n", zr->name, i);
+
+ /* Allocate fragment table for this buffer */
+
+ mem = get_free_page(GFP_KERNEL);
+ if (mem == 0) {
+ printk(KERN_ERR "%s: jpg_fbuffer_alloc: get_free_page (frag_tab) failed for buffer %d\n", zr->name, i);
+ jpg_fbuffer_free(zr);
+ return -ENOBUFS;
+ }
+ memset((void *) mem, 0, PAGE_SIZE);
+ zr->jpg_gbuf[i].frag_tab = (u32 *) mem;
+ zr->jpg_gbuf[i].frag_tab_bus = virt_to_bus((void *) mem);
+
+ if (alloc_contig) {
+ mem = (unsigned long) kmalloc(zr->jpg_bufsize, GFP_KERNEL);
+ if (mem == 0) {
+ jpg_fbuffer_free(zr);
+ return -ENOBUFS;
+ }
+ zr->jpg_gbuf[i].frag_tab[0] = virt_to_bus((void *) mem);
+ zr->jpg_gbuf[i].frag_tab[1] = ((zr->jpg_bufsize / 4) << 1) | 1;
+ for (off = 0; off < zr->jpg_bufsize; off += PAGE_SIZE)
+ mem_map_reserve(MAP_NR(mem + off));
+ } else {
+ /* jpg_bufsize is alreay page aligned */
+ for (j = 0; j < zr->jpg_bufsize / PAGE_SIZE; j++) {
+ mem = get_free_page(GFP_KERNEL);
+ if (mem == 0) {
+ jpg_fbuffer_free(zr);
+ return -ENOBUFS;
+ }
+ zr->jpg_gbuf[i].frag_tab[2 * j] = virt_to_bus((void *) mem);
+ zr->jpg_gbuf[i].frag_tab[2 * j + 1] = (PAGE_SIZE / 4) << 1;
+ mem_map_reserve(MAP_NR(mem));
+ }
+
+ zr->jpg_gbuf[i].frag_tab[2 * j - 1] |= 1;
+ }
+ }
+
+ DEBUG(printk("jpg_fbuffer_alloc: %d KB allocated\n",
+ (zr->jpg_nbufs * zr->jpg_bufsize) >> 10));
+ zr->jpg_buffers_allocated = 1;


+ return 0;
+}
+

+/* free the MJPEG grab buffers */
+static void jpg_fbuffer_free(struct zoran *zr)
+{
+ int i, j, off, alloc_contig;
+ unsigned char *mem;
+
+ /* Decide if we should alloc contiguous or fragmented memory */
+ /* This has to be identical in jpg_fbuffer_alloc and jpg_fbuffer_free */
+
+ alloc_contig = (zr->jpg_bufsize < MAX_KMALLOC_MEM);
+
+ for (i = 0; i < zr->jpg_nbufs; i++) {
+ if (!zr->jpg_gbuf[i].frag_tab)
+ continue;
+
+ if (alloc_contig) {
+ if (zr->jpg_gbuf[i].frag_tab[0]) {
+ mem = (unsigned char *) bus_to_virt(zr->jpg_gbuf[i].frag_tab[0]);
+ for (off = 0; off < zr->jpg_bufsize; off += PAGE_SIZE)
+ mem_map_unreserve(MAP_NR(mem + off));
+ kfree((void *) mem);
+ zr->jpg_gbuf[i].frag_tab[0] = 0;
+ zr->jpg_gbuf[i].frag_tab[1] = 0;
+ }
+ } else {
+ for (j = 0; j < zr->jpg_bufsize / PAGE_SIZE; j++) {
+ if (!zr->jpg_gbuf[i].frag_tab[2 * j])
+ break;
+ mem_map_unreserve(MAP_NR(bus_to_virt(zr->jpg_gbuf[i].frag_tab[2 * j])));
+ free_page((unsigned long) bus_to_virt(zr->jpg_gbuf[i].frag_tab[2 * j]));
+ zr->jpg_gbuf[i].frag_tab[2 * j] = 0;
+ zr->jpg_gbuf[i].frag_tab[2 * j + 1] = 0;
+ }
+ }
+
+ free_page((unsigned long) zr->jpg_gbuf[i].frag_tab);
+ zr->jpg_gbuf[i].frag_tab = NULL;
+ }
+ zr->jpg_buffers_allocated = 0;
+}
+
+
+/* ----------------------------------------------------------------------- */
+
+/* I2C functions */
+
+#define I2C_DELAY 10
+
+
+/* software I2C functions */
+
+static void i2c_setlines(struct i2c_bus *bus, int ctrl, int data)
+{
+ struct zoran *zr = (struct zoran *) bus->data;
+ btwrite((data << 1) | ctrl, ZR36057_I2CBR);
+ btread(ZR36057_I2CBR);
+ udelay(I2C_DELAY);
+}
+
+static int i2c_getdataline(struct i2c_bus *bus)
+{
+ struct zoran *zr = (struct zoran *) bus->data;
+ return (btread(ZR36057_I2CBR) >> 1) & 1;
+}
+
+void attach_inform(struct i2c_bus *bus, int id)
+{
+ DEBUG(struct zoran *zr = (struct zoran *) bus->data);
+ DEBUG(printk(BUZ_DEBUG "-%u: i2c attach %02x\n", zr->id, id));
+}
+
+void detach_inform(struct i2c_bus *bus, int id)
+{
+ DEBUG(struct zoran *zr = (struct zoran *) bus->data);
+ DEBUG(printk(BUZ_DEBUG "-%u: i2c detach %02x\n", zr->id, id));
+}
+
+static struct i2c_bus zoran_i2c_bus_template =
+{
+ "zr36057",
+ I2C_BUSID_BT848,
+ NULL,
+
+ SPIN_LOCK_UNLOCKED,
+
+ attach_inform,
+ detach_inform,
+
+ i2c_setlines,
+ i2c_getdataline,
+ NULL,
+ NULL,
+};
+
+
+/* ----------------------------------------------------------------------- */
+
+static void GPIO(struct zoran *zr, unsigned bit, unsigned value)
+{
+ u32 reg;
+ u32 mask;
+
+ mask = 1 << (24 + bit);
+ reg = btread(ZR36057_GPPGCR1) & ~mask;
+ if (value) {
+ reg |= mask;
+ }
+ btwrite(reg, ZR36057_GPPGCR1);
+ /* Stop any PCI posting on the GPIO bus */
+ btread(ZR36057_I2CBR);
+}
+
+
+/*
+ * Set the registers for the size we have specified. Don't bother
+ * trying to understand this without the ZR36057 manual in front of
+ * you [AC].
+ *
+ * PS: The manual is free for download in .pdf format from
+ * www.zoran.com - nicely done those folks.
+ */
+
+struct tvnorm {
+ u16 Wt, Wa, Ht, Ha, HStart, VStart;
+};
+
+static struct tvnorm tvnorms[] =
+{
+ /* PAL-BDGHI */
+ {864, 720, 625, 576, 31, 16},
+ /* NTSC */
+ {858, 720, 525, 480, 21, 8},
+};
+#define TVNORMS (sizeof(tvnorms) / sizeof(tvnorm))
+
+static int format2bpp(int format)
+{
+ int bpp;
+
+ /* Determine the number of bytes per pixel for the video format requested */
+
+ switch (format) {
+
+ case VIDEO_PALETTE_YUV422:
+ bpp = 2;
+ break;
+
+ case VIDEO_PALETTE_RGB555:
+ bpp = 2;
+ break;
+
+ case VIDEO_PALETTE_RGB565:
+ bpp = 2;
+ break;
+
+ case VIDEO_PALETTE_RGB24:
+ bpp = 3;
+ break;
+
+ case VIDEO_PALETTE_RGB32:
+ bpp = 4;
+ break;
+
+ default:
+ bpp = 0;
+ }
+
+ return bpp;
+}
+
+/*
+ * set geometry
+ */
+static void zr36057_set_vfe(struct zoran *zr, int video_width, int video_height,
+ unsigned int video_format)
+{
+ struct tvnorm *tvn;
+ unsigned HStart, HEnd, VStart, VEnd;
+ unsigned DispMode;
+ unsigned VidWinWid, VidWinHt;
+ unsigned hcrop1, hcrop2, vcrop1, vcrop2;
+ unsigned Wa, We, Ha, He;
+ unsigned X, Y, HorDcm, VerDcm;
+ u32 reg;
+ unsigned mask_line_size;
+
+ if (zr->params.norm < 0 || zr->params.norm > 1) {
+ printk(KERN_ERR "%s: set_vfe: video_norm = %d not valid\n", zr->name, zr->params.norm);
+ return;
+ }
+ if (video_width < BUZ_MIN_WIDTH || video_height < BUZ_MIN_HEIGHT) {
+ printk(KERN_ERR "%s: set_vfe: w=%d h=%d not valid\n", zr->name, video_width, video_height);
+ return;
+ }
+ tvn = &tvnorms[zr->params.norm];
+
+ Wa = tvn->Wa;
+ Ha = tvn->Ha;
+
+ /* if window has more than half of active height,
+ switch on interlacing - we want the full information */
+
+ zr->video_interlace = (video_height > Ha / 2);
+
+/**** zr36057 ****/
+
+ /* horizontal */
+ VidWinWid = video_width;
+ X = (VidWinWid * 64 + tvn->Wa - 1) / tvn->Wa;
+ We = (VidWinWid * 64) / X;
+ HorDcm = 64 - X;
+ hcrop1 = 2 * ((tvn->Wa - We) / 4);
+ hcrop2 = tvn->Wa - We - hcrop1;
+ HStart = tvn->HStart | 1;
+ HEnd = HStart + tvn->Wa - 1;
+ HStart += hcrop1;
+ HEnd -= hcrop2;
+ reg = ((HStart & ZR36057_VFEHCR_Hmask) << ZR36057_VFEHCR_HStart)
+ | ((HEnd & ZR36057_VFEHCR_Hmask) << ZR36057_VFEHCR_HEnd);
+ reg |= ZR36057_VFEHCR_HSPol;
+ btwrite(reg, ZR36057_VFEHCR);
+
+ /* Vertical */
+ DispMode = !zr->video_interlace;
+ VidWinHt = DispMode ? video_height : video_height / 2;
+ Y = (VidWinHt * 64 * 2 + tvn->Ha - 1) / tvn->Ha;
+ He = (VidWinHt * 64) / Y;
+ VerDcm = 64 - Y;
+ vcrop1 = (tvn->Ha / 2 - He) / 2;
+ vcrop2 = tvn->Ha / 2 - He - vcrop1;
+ VStart = tvn->VStart;
+ VEnd = VStart + tvn->Ha / 2 - 1;
+ VStart += vcrop1;
+ VEnd -= vcrop2;
+ reg = ((VStart & ZR36057_VFEVCR_Vmask) << ZR36057_VFEVCR_VStart)
+ | ((VEnd & ZR36057_VFEVCR_Vmask) << ZR36057_VFEVCR_VEnd);
+ reg |= ZR36057_VFEVCR_VSPol;
+ btwrite(reg, ZR36057_VFEVCR);
+
+ /* scaler and pixel format */
+ reg = 0 // ZR36057_VFESPFR_ExtFl /* Trying to live without ExtFl */
+ | (HorDcm << ZR36057_VFESPFR_HorDcm)
+ | (VerDcm << ZR36057_VFESPFR_VerDcm)
+ | (DispMode << ZR36057_VFESPFR_DispMode)
+ | ZR36057_VFESPFR_LittleEndian;
+ /* RJ: I don't know, why the following has to be the opposite
+ of the corresponding ZR36060 setting, but only this way
+ we get the correct colors when uncompressing to the screen */
+ reg |= ZR36057_VFESPFR_VCLKPol;
+ /* RJ: Don't know if that is needed for NTSC also */
+ reg |= ZR36057_VFESPFR_TopField;
+ switch (video_format) {
+
+ case VIDEO_PALETTE_YUV422:
+ reg |= ZR36057_VFESPFR_YUV422;
+ break;
+
+ case VIDEO_PALETTE_RGB555:
+ reg |= ZR36057_VFESPFR_RGB555 | ZR36057_VFESPFR_ErrDif;
+ break;
+
+ case VIDEO_PALETTE_RGB565:
+ reg |= ZR36057_VFESPFR_RGB565 | ZR36057_VFESPFR_ErrDif;
+ break;
+
+ case VIDEO_PALETTE_RGB24:
+ reg |= ZR36057_VFESPFR_RGB888 | ZR36057_VFESPFR_Pack24;
+ break;
+
+ case VIDEO_PALETTE_RGB32:
+ reg |= ZR36057_VFESPFR_RGB888;
+ break;
+
+ default:
+ printk(KERN_INFO "%s: Unknown color_fmt=%x\n", zr->name, video_format);
+ return;
+
+ }
+ if (HorDcm >= 48) {
+ reg |= 3 << ZR36057_VFESPFR_HFilter; /* 5 tap filter */
+ } else if (HorDcm >= 32) {
+ reg |= 2 << ZR36057_VFESPFR_HFilter; /* 4 tap filter */
+ } else if (HorDcm >= 16) {
+ reg |= 1 << ZR36057_VFESPFR_HFilter; /* 3 tap filter */
+ }
+ btwrite(reg, ZR36057_VFESPFR);
+
+ /* display configuration */
+
+ reg = (16 << ZR36057_VDCR_MinPix)
+ | (VidWinHt << ZR36057_VDCR_VidWinHt)
+ | (VidWinWid << ZR36057_VDCR_VidWinWid);
+ if (triton)
+ reg &= ~ZR36057_VDCR_Triton;
+ else
+ reg |= ZR36057_VDCR_Triton;
+ btwrite(reg, ZR36057_VDCR);
+
+ /* Write overlay clipping mask data, but don't enable overlay clipping */
+ /* RJ: since this makes only sense on the screen, we use
+ zr->window.width instead of video_width */
+
+ mask_line_size = (BUZ_MAX_WIDTH + 31) / 32;
+ reg = virt_to_bus(zr->overlay_mask);
+ btwrite(reg, ZR36057_MMTR);
+ reg = virt_to_bus(zr->overlay_mask + mask_line_size);
+ btwrite(reg, ZR36057_MMBR);
+ reg = mask_line_size - (zr->window.width + 31) / 32;
+ if (DispMode == 0)
+ reg += mask_line_size;
+ reg <<= ZR36057_OCR_MaskStride;
+ btwrite(reg, ZR36057_OCR);
+
+}
+
+/*
+ * Switch overlay on or off
+ */
+
+static void zr36057_overlay(struct zoran *zr, int on)
+{
+ int fmt, bpp;
+ u32 reg;
+
+ if (on) {
+ /* do the necessary settings ... */
+
+ btand(~ZR36057_VDCR_VidEn, ZR36057_VDCR); /* switch it off first */
+
+ switch (zr->buffer.depth) {
+ case 15:
+ fmt = VIDEO_PALETTE_RGB555;
+ bpp = 2;
+ break;
+ case 16:
+ fmt = VIDEO_PALETTE_RGB565;
+ bpp = 2;
+ break;
+ case 24:
+ fmt = VIDEO_PALETTE_RGB24;
+ bpp = 3;
+ break;
+ case 32:
+ fmt = VIDEO_PALETTE_RGB32;
+ bpp = 4;
+ break;
+ default:
+ fmt = 0;
+ bpp = 0;
+ }
+
+ zr36057_set_vfe(zr, zr->window.width, zr->window.height, fmt);
+
+ /* Start and length of each line MUST be 4-byte aligned.
+ This should be allready checked before the call to this routine.
+ All error messages are internal driver checking only! */
+
+ /* video display top and bottom registers */
+
+ reg = (u32) zr->buffer.base
+ + zr->window.x * bpp
+ + zr->window.y * zr->buffer.bytesperline;
+ btwrite(reg, ZR36057_VDTR);
+ if (reg & 3)
+ printk(KERN_ERR "%s: zr36057_overlay: video_address not aligned\n", zr->name);
+ if (zr->video_interlace)
+ reg += zr->buffer.bytesperline;
+ btwrite(reg, ZR36057_VDBR);
+
+ /* video stride, status, and frame grab register */
+
+ reg = zr->buffer.bytesperline - zr->window.width * bpp;
+ if (zr->video_interlace)
+ reg += zr->buffer.bytesperline;
+ if (reg & 3)
+ printk(KERN_ERR "%s: zr36057_overlay: video_stride not aligned\n", zr->name);
+ reg = (reg << ZR36057_VSSFGR_DispStride);
+ reg |= ZR36057_VSSFGR_VidOvf; /* clear overflow status */
+ btwrite(reg, ZR36057_VSSFGR);
+
+ /* Set overlay clipping */
+
+ if (zr->window.clipcount)
+ btor(ZR36057_OCR_OvlEnable, ZR36057_OCR);
+
+ /* ... and switch it on */
+
+ btor(ZR36057_VDCR_VidEn, ZR36057_VDCR);
+ } else {
+ /* Switch it off */
+
+ btand(~ZR36057_VDCR_VidEn, ZR36057_VDCR);
+ }
+}
+
+/*
+ * The overlay mask has one bit for each pixel on a scan line,
+ * and the maximum window size is BUZ_MAX_WIDTH * BUZ_MAX_HEIGHT pixels.
+ */
+static void write_overlay_mask(struct zoran *zr, struct video_clip *vp, int count)
+{
+ unsigned mask_line_size = (BUZ_MAX_WIDTH + 31) / 32;
+ u32 *mask;
+ int x, y, width, height;
+ unsigned i, j, k;
+ u32 reg;
+
+ /* fill mask with one bits */
+ memset(zr->overlay_mask, ~0, mask_line_size * 4 * BUZ_MAX_HEIGHT);
+ reg = 0;
+
+ for (i = 0; i < count; ++i) {
+ /* pick up local copy of clip */
+ x = vp[i].x;
+ y = vp[i].y;
+ width = vp[i].width;
+ height = vp[i].height;
+
+ /* trim clips that extend beyond the window */
+ if (x < 0) {
+ width += x;
+ x = 0;
+ }
+ if (y < 0) {
+ height += y;
+ y = 0;
+ }
+ if (x + width > zr->window.width) {
+ width = zr->window.width - x;
+ }
+ if (y + height > zr->window.height) {
+ height = zr->window.height - y;
+ }
+ /* ignore degenerate clips */
+ if (height <= 0) {
+ continue;
+ }
+ if (width <= 0) {
+ continue;
+ }
+ /* apply clip for each scan line */
+ for (j = 0; j < height; ++j) {
+ /* reset bit for each pixel */
+ /* this can be optimized later if need be */
+ mask = zr->overlay_mask + (y + j) * mask_line_size;
+ for (k = 0; k < width; ++k) {
+ mask[(x + k) / 32] &= ~((u32) 1 << (x + k) % 32);


+ }
+ }
+ }
+}
+

+/* Enable/Disable uncompressed memory grabbing of the 36057 */
+
+static void zr36057_set_memgrab(struct zoran *zr, int mode)
+{
+ if (mode) {
+ if (btread(ZR36057_VSSFGR) & (ZR36057_VSSFGR_SnapShot | ZR36057_VSSFGR_FrameGrab))
+ printk(KERN_WARNING "%s: zr36057_set_memgrab_on with SnapShot or FrameGrab on ???\n", zr->name);
+
+ /* switch on VSync interrupts */
+
+ btwrite(IRQ_MASK, ZR36057_ISR); // Clear Interrupts
+
+ btor(ZR36057_ICR_GIRQ0, ZR36057_ICR);
+
+ /* enable SnapShot */
+
+ btor(ZR36057_VSSFGR_SnapShot, ZR36057_VSSFGR);
+
+ /* Set zr36057 video front end and enable video */
+
+#ifdef XAWTV_HACK
+ zr36057_set_vfe(zr, zr->gwidth > 720 ? 720 : zr->gwidth, zr->gheight, zr->gformat);
+#else
+ zr36057_set_vfe(zr, zr->gwidth, zr->gheight, zr->gformat);
+#endif
+
+ zr->v4l_memgrab_active = 1;
+ } else {
+ zr->v4l_memgrab_active = 0;
+
+ /* switch off VSync interrupts */
+
+ btand(~ZR36057_ICR_GIRQ0, ZR36057_ICR);
+
+ /* reenable grabbing to screen if it was running */
+
+ if (zr->v4l_overlay_active) {
+ zr36057_overlay(zr, 1);
+ } else {
+ btand(~ZR36057_VDCR_VidEn, ZR36057_VDCR);
+ btand(~ZR36057_VSSFGR_SnapShot, ZR36057_VSSFGR);
+ }
+ }
+}
+
+static int wait_grab_pending(struct zoran *zr)
+{


+ unsigned long flags;
+

+ /* wait until all pending grabs are finished */
+
+ if (!zr->v4l_memgrab_active)
+ return 0;
+
+ while (zr->v4l_pend_tail != zr->v4l_pend_head) {
+ interruptible_sleep_on(&zr->v4l_capq);
+ if (signal_pending(current))
+ return -ERESTARTSYS;
+ }
+
+ spin_lock_irqsave(&zr->lock, flags);
+ zr36057_set_memgrab(zr, 0);
+ spin_unlock_irqrestore(&zr->lock, flags);
+


+ return 0;
+}
+

+/*
+ * V4L Buffer grabbing
+ */
+
+static int v4l_grab(struct zoran *zr, struct video_mmap *mp)
+{
+ unsigned long flags;
+ int res, bpp;
+
+ /*
+ * There is a long list of limitations to what is allowed to be grabbed
+ * We don't output error messages her, since some programs (e.g. xawtv)
+ * just try several settings to find out what is valid or not.
+ */
+
+ /* No grabbing outside the buffer range! */
+
+ if (mp->frame >= v4l_nbufs || mp->frame < 0)
+ return -EINVAL;
+
+ /* Check size and format of the grab wanted */
+
+ if (mp->height < BUZ_MIN_HEIGHT || mp->width < BUZ_MIN_WIDTH)
+ return -EINVAL;
+ if (mp->height > BUZ_MAX_HEIGHT || mp->width > BUZ_MAX_WIDTH)
+ return -EINVAL;
+
+ bpp = format2bpp(mp->format);
+ if (bpp == 0)
+ return -EINVAL;
+
+ /* Check against available buffer size */
+
+ if (mp->height * mp->width * bpp > v4l_bufsize)
+ return -EINVAL;
+
+ /* The video front end needs 4-byte alinged line sizes */
+
+ if ((bpp == 2 && (mp->width & 1)) || (bpp == 3 && (mp->width & 3)))
+ return -EINVAL;
+
+ /*
+ * To minimize the time spent in the IRQ routine, we avoid setting up
+ * the video front end there.
+ * If this grab has different parameters from a running streaming capture
+ * we stop the streaming capture and start it over again.
+ */
+
+ if (zr->v4l_memgrab_active &&
+ (zr->gwidth != mp->width || zr->gheight != mp->height || zr->gformat != mp->format)) {
+ res = wait_grab_pending(zr);
+ if (res)
+ return res;
+ }
+ zr->gwidth = mp->width;
+ zr->gheight = mp->height;
+ zr->gformat = mp->format;
+ zr->gbpl = bpp * zr->gwidth;
+
+
+ spin_lock_irqsave(&zr->lock, flags);
+
+ /* make sure a grab isn't going on currently with this buffer */
+
+ switch (zr->v4l_gbuf[mp->frame].state) {
+
+ default:
+ case BUZ_STATE_PEND:
+ res = -EBUSY; /* what are you doing? */
+ break;
+
+ case BUZ_STATE_USER:
+ case BUZ_STATE_DONE:
+ /* since there is at least one unused buffer there's room for at least one more pend[] entry */
+ zr->v4l_pend[zr->v4l_pend_head++ & V4L_MASK_FRAME] = mp->frame;
+ zr->v4l_gbuf[mp->frame].state = BUZ_STATE_PEND;
+ res = 0;
+ break;
+
+ }
+
+ /* put the 36057 into frame grabbing mode */
+
+ if (!res && !zr->v4l_memgrab_active)
+ zr36057_set_memgrab(zr, 1);
+
+ spin_unlock_irqrestore(&zr->lock, flags);
+
+ return res;
+}
+
+/*
+ * Sync on a V4L buffer
+ */
+
+static int v4l_sync(struct zoran *zr, int frame)
+{


+ unsigned long flags;
+

+
+ /* check passed-in frame number */
+ if (frame >= v4l_nbufs || frame < 0) {
+ printk(KERN_ERR "%s: v4l_sync: frame %d is invalid\n", zr->name, frame);
+ return -EINVAL;
+ }
+ /* Check if is buffer was queued at all */
+
+ if (zr->v4l_gbuf[frame].state == BUZ_STATE_USER) {
+// printk(KERN_ERR "%s: v4l_sync: Trying to sync on a buffer which was not queued?\n", zr->name);
+ return -EINVAL;
+ }
+ /* wait on this buffer to get ready */
+
+ while (zr->v4l_gbuf[frame].state == BUZ_STATE_PEND) {
+ interruptible_sleep_on(&zr->v4l_capq);
+ if (signal_pending(current))
+ return -ERESTARTSYS;
+ }
+
+ /* buffer should now be in BUZ_STATE_DONE */
+
+ if (zr->v4l_gbuf[frame].state != BUZ_STATE_DONE)
+ printk(KERN_ERR "%s: v4l_sync - internal error\n", zr->name);
+
+ /* Check if streaming capture has finished */
+
+ spin_lock_irqsave(&zr->lock, flags);
+
+ if (zr->v4l_pend_tail == zr->v4l_pend_head)
+ zr36057_set_memgrab(zr, 0);
+
+ spin_unlock_irqrestore(&zr->lock, flags);
+
+ return 0;
+}
+/*****************************************************************************
+ * *
+ * Set up the Buz-specific MJPEG part *
+ * *
+ *****************************************************************************/
+
+/*
+ * Wait til post office is no longer busy
+ */
+
+static int post_office_wait(struct zoran *zr)
+{
+ u32 por;
+ u32 ct=0;
+
+ while (((por = btread(ZR36057_POR)) & (ZR36057_POR_POPen | ZR36057_POR_POTime)) == ZR36057_POR_POPen) {
+ ct++;
+ if(ct>100000)
+ {
+ printk(KERN_ERR "%s: timeout on post office.\n", zr->name);
+ return -1;
+ }
+ /* wait for something to happen */
+ }
+ if ((por & ZR36057_POR_POPen) != 0) {
+ printk(KERN_WARNING "%s: pop pending %08x\n", zr->name, por);
+ return -1;
+ }
+ if ((por & (ZR36057_POR_POTime | ZR36057_POR_POPen)) != 0) {
+ printk(KERN_WARNING "%s: pop timeout %08x\n", zr->name, por);
+ return -1;
+ }


+ return 0;
+}
+

+static int post_office_write(struct zoran *zr, unsigned guest, unsigned reg, unsigned value)
+{
+ u32 por;
+
+ post_office_wait(zr);
+ por = ZR36057_POR_PODir | ZR36057_POR_POTime | ((guest & 7) << 20) | ((reg & 7) << 16) | (value & 0xFF);
+ btwrite(por, ZR36057_POR);
+ return post_office_wait(zr);
+}
+
+static int post_office_read(struct zoran *zr, unsigned guest, unsigned reg)
+{
+ u32 por;
+
+ post_office_wait(zr);
+ por = ZR36057_POR_POTime | ((guest & 7) << 20) | ((reg & 7) << 16);
+ btwrite(por, ZR36057_POR);
+ if (post_office_wait(zr) < 0) {
+ return -1;
+ }
+ return btread(ZR36057_POR) & 0xFF;
+}
+
+static int zr36060_write_8(struct zoran *zr, unsigned reg, unsigned val)
+{
+ if (post_office_wait(zr)
+ || post_office_write(zr, 0, 1, reg >> 8)
+ || post_office_write(zr, 0, 2, reg)) {
+ return -1;
+ }
+ return post_office_write(zr, 0, 3, val);
+}
+
+static int zr36060_write_16(struct zoran *zr, unsigned reg, unsigned val)
+{
+ if (zr36060_write_8(zr, reg + 0, val >> 8)) {
+ return -1;
+ }
+ return zr36060_write_8(zr, reg + 1, val >> 0);
+}
+
+static int zr36060_write_24(struct zoran *zr, unsigned reg, unsigned val)
+{
+ if (zr36060_write_8(zr, reg + 0, val >> 16)) {
+ return -1;
+ }
+ return zr36060_write_16(zr, reg + 1, val >> 0);
+}
+
+static int zr36060_write_32(struct zoran *zr, unsigned reg, unsigned val)
+{
+ if (zr36060_write_16(zr, reg + 0, val >> 16)) {
+ return -1;
+ }
+ return zr36060_write_16(zr, reg + 2, val >> 0);
+}
+
+static u32 zr36060_read_8(struct zoran *zr, unsigned reg)
+{
+ if (post_office_wait(zr)
+ || post_office_write(zr, 0, 1, reg >> 8)
+ || post_office_write(zr, 0, 2, reg)) {
+ return -1;
+ }
+ return post_office_read(zr, 0, 3) & 0xFF;
+}
+
+static int zr36060_reset(struct zoran *zr)
+{
+ return post_office_write(zr, 3, 0, 0);
+}
+
+static void zr36060_sleep(struct zoran *zr, int sleep)
+{
+ GPIO(zr, 1, !sleep);
+}
+
+
+static void zr36060_set_jpg(struct zoran *zr, enum zoran_codec_mode mode)
+{
+ struct tvnorm *tvn;
+ u32 reg;
+ int size;
+
+ reg = (1 << 0) /* CodeMstr */
+ |(0 << 2) /* CFIS=0 */
+ |(0 << 6) /* Endian=0 */
+ |(0 << 7); /* Code16=0 */
+ zr36060_write_8(zr, 0x002, reg);
+
+ switch (mode) {
+
+ case BUZ_MODE_MOTION_DECOMPRESS:
+ case BUZ_MODE_STILL_DECOMPRESS:
+ reg = 0x00; /* Codec mode = decompression */
+ break;
+
+ case BUZ_MODE_MOTION_COMPRESS:
+ case BUZ_MODE_STILL_COMPRESS:
+ default:
+ reg = 0xa4; /* Codec mode = compression with variable scale factor */
+ break;
+
+ }
+ zr36060_write_8(zr, 0x003, reg);
+
+ reg = 0x00; /* reserved, mbz */
+ zr36060_write_8(zr, 0x004, reg);
+
+ reg = 0xff; /* 510 bits/block */
+ zr36060_write_8(zr, 0x005, reg);
+
+ /* JPEG markers */
+ reg = (zr->params.jpeg_markers) & 0x38; /* DRI, DQT, DHT */
+ if (zr->params.COM_len)
+ reg |= JPEG_MARKER_COM;
+ if (zr->params.APP_len)
+ reg |= JPEG_MARKER_APP;
+ zr36060_write_8(zr, 0x006, reg);
+
+ reg = (0 << 3) /* DATERR=0 */
+ |(0 << 2) /* END=0 */
+ |(0 << 1) /* EOI=0 */
+ |(0 << 0); /* EOAV=0 */
+ zr36060_write_8(zr, 0x007, reg);
+
+ /* code volume */
+
+ /* Target field size in pixels: */
+ tvn = &tvnorms[zr->params.norm];
+ size = (tvn->Ha / 2) * (tvn->Wa) / (zr->params.HorDcm) / (zr->params.VerDcm);
+
+ /* Target compressed field size in bits: */
+ size = size * 16; /* uncompressed size in bits */
+ size = size * zr->params.quality / 400; /* quality = 100 is a compression ratio 1:4 */
+
+ /* Lower limit (arbitrary, 1 KB) */
+ if (size < 8192)
+ size = 8192;
+
+ /* Upper limit: 7/8 of the code buffers */
+ if (size * zr->params.field_per_buff > zr->jpg_bufsize * 7)
+ size = zr->jpg_bufsize * 7 / zr->params.field_per_buff;
+
+ reg = size;
+ zr36060_write_32(zr, 0x009, reg);
+
+ /* how do we set initial SF as a function of quality parameter? */
+ reg = 0x0100; /* SF=1.0 */
+ zr36060_write_16(zr, 0x011, reg);
+
+ reg = 0x00ffffff; /* AF=max */
+ zr36060_write_24(zr, 0x013, reg);
+
+ reg = 0x0000; /* test */
+ zr36060_write_16(zr, 0x024, reg);
+}
+
+static void zr36060_set_video(struct zoran *zr, enum zoran_codec_mode mode)
+{
+ struct tvnorm *tvn;
+ u32 reg;
+
+ reg = (0 << 7) /* Video8=0 */
+ |(0 << 6) /* Range=0 */
+ |(0 << 3) /* FlDet=0 */
+ |(1 << 2) /* FlVedge=1 */
+ |(0 << 1) /* FlExt=0 */
+ |(0 << 0); /* SyncMstr=0 */
+
+ /* According to ZR36067 documentation, FlDet should correspond
+ to the odd_even flag of the ZR36067 */
+ if (zr->params.odd_even)
+ reg |= (1 << 3);
+
+ if (mode != BUZ_MODE_STILL_DECOMPRESS) {
+ /* limit pixels to range 16..235 as per CCIR-601 */
+ reg |= (1 << 6); /* Range=1 */
+ }
+ zr36060_write_8(zr, 0x030, reg);
+
+ reg = (0 << 7) /* VCLKPol=0 */
+ |(0 << 6) /* PValPol=0 */
+ |(1 << 5) /* PoePol=1 */
+ |(0 << 4) /* SImgPol=0 */
+ |(0 << 3) /* BLPol=0 */
+ |(0 << 2) /* FlPol=0 */
+ |(0 << 1) /* HSPol=0, sync on falling edge */
+ |(1 << 0); /* VSPol=1 */
+ zr36060_write_8(zr, 0x031, reg);
+
+ switch (zr->params.HorDcm) {
+ default:
+ case 1:
+ reg = (0 << 0);
+ break; /* HScale = 0 */
+
+ case 2:
+ reg = (1 << 0);
+ break; /* HScale = 1 */
+
+ case 4:
+ reg = (2 << 0);
+ break; /* HScale = 2 */
+ }
+ if (zr->params.VerDcm == 2)
+ reg |= (1 << 2);
+ zr36060_write_8(zr, 0x032, reg);
+
+ reg = 0x80; /* BackY */
+ zr36060_write_8(zr, 0x033, reg);
+
+ reg = 0xe0; /* BackU */
+ zr36060_write_8(zr, 0x034, reg);
+
+ reg = 0xe0; /* BackV */
+ zr36060_write_8(zr, 0x035, reg);
+
+ /* sync generator */
+
+ tvn = &tvnorms[zr->params.norm];
+
+ reg = tvn->Ht - 1; /* Vtotal */
+ zr36060_write_16(zr, 0x036, reg);
+
+ reg = tvn->Wt - 1; /* Htotal */
+ zr36060_write_16(zr, 0x038, reg);
+
+ reg = 6 - 1; /* VsyncSize */
+ zr36060_write_8(zr, 0x03a, reg);
+
+ reg = 100 - 1; /* HsyncSize */
+ zr36060_write_8(zr, 0x03b, reg);
+
+ reg = tvn->VStart - 1; /* BVstart */
+ zr36060_write_8(zr, 0x03c, reg);
+
+ reg += tvn->Ha / 2; /* BVend */
+ zr36060_write_16(zr, 0x03e, reg);
+
+ reg = tvn->HStart - 1; /* BHstart */
+ zr36060_write_8(zr, 0x03d, reg);
+
+ reg += tvn->Wa; /* BHend */
+ zr36060_write_16(zr, 0x040, reg);
+
+ /* active area */
+ reg = zr->params.img_y + tvn->VStart; /* Vstart */
+ zr36060_write_16(zr, 0x042, reg);
+
+ reg += zr->params.img_height; /* Vend */
+ zr36060_write_16(zr, 0x044, reg);
+
+ reg = zr->params.img_x + tvn->HStart; /* Hstart */
+ zr36060_write_16(zr, 0x046, reg);
+
+ reg += zr->params.img_width; /* Hend */
+ zr36060_write_16(zr, 0x048, reg);
+
+ /* subimage area */
+ reg = zr->params.img_y + tvn->VStart; /* SVstart */
+ zr36060_write_16(zr, 0x04a, reg);
+
+ reg += zr->params.img_height; /* SVend */
+ zr36060_write_16(zr, 0x04c, reg);
+
+ reg = zr->params.img_x + tvn->HStart; /* SHstart */
+ zr36060_write_16(zr, 0x04e, reg);
+
+ reg += zr->params.img_width; /* SHend */
+ zr36060_write_16(zr, 0x050, reg);
+}
+
+static void zr36060_set_jpg_SOF(struct zoran *zr)
+{
+ u32 reg;
+
+
+ reg = 0xffc0; /* SOF marker */
+ zr36060_write_16(zr, 0x060, reg);
+
+ reg = 17; /* SOF length */
+ zr36060_write_16(zr, 0x062, reg);
+
+ reg = 8; /* precision 8 bits */
+ zr36060_write_8(zr, 0x064, reg);
+
+ reg = zr->params.img_height / zr->params.VerDcm; /* image height */
+ zr36060_write_16(zr, 0x065, reg);
+
+ reg = zr->params.img_width / zr->params.HorDcm; /* image width */
+ zr36060_write_16(zr, 0x067, reg);
+
+ reg = 3; /* 3 color components */
+ zr36060_write_8(zr, 0x069, reg);
+
+ reg = 0x002100; /* Y component */
+ zr36060_write_24(zr, 0x06a, reg);
+
+ reg = 0x011101; /* U component */
+ zr36060_write_24(zr, 0x06d, reg);
+
+ reg = 0x021101; /* V component */
+ zr36060_write_24(zr, 0x070, reg);
+}
+
+static void zr36060_set_jpg_SOS(struct zoran *zr)
+{
+ u32 reg;
+
+
+ reg = 0xffda; /* SOS marker */
+ zr36060_write_16(zr, 0x07a, reg);
+
+ reg = 12; /* SOS length */
+ zr36060_write_16(zr, 0x07c, reg);
+
+ reg = 3; /* 3 color components */
+ zr36060_write_8(zr, 0x07e, reg);
+
+ reg = 0x0000; /* Y component */
+ zr36060_write_16(zr, 0x07f, reg);
+
+ reg = 0x0111; /* U component */
+ zr36060_write_16(zr, 0x081, reg);
+
+ reg = 0x0211; /* V component */
+ zr36060_write_16(zr, 0x083, reg);
+
+ reg = 0x003f00; /* Start, end spectral scans */
+ zr36060_write_24(zr, 0x085, reg);
+}
+
+static void zr36060_set_jpg_DRI(struct zoran *zr)
+{
+ u32 reg;
+
+
+ reg = 0xffdd; /* DRI marker */
+ zr36060_write_16(zr, 0x0c0, reg);
+
+ reg = 4; /* DRI length */
+ zr36060_write_16(zr, 0x0c2, reg);
+
+ reg = 8; /* length in MCUs */
+ zr36060_write_16(zr, 0x0c4, reg);
+}
+
+static void zr36060_set_jpg_DQT(struct zoran *zr)
+{
+ unsigned i;
+ unsigned adr;
+ static const u8 dqt[] =
+ {
+ 0xff, 0xdb, /* DHT marker */
+ 0x00, 0x84, /* DHT length */
+ 0x00, /* table ID 0 */
+ 0x10, 0x0b, 0x0c, 0x0e, 0x0c, 0x0a, 0x10, 0x0e,
+ 0x0d, 0x0e, 0x12, 0x11, 0x10, 0x13, 0x18, 0x28,
+ 0x1a, 0x18, 0x16, 0x16, 0x18, 0x31, 0x23, 0x25,
+ 0x1d, 0x28, 0x3a, 0x33, 0x3d, 0x3c, 0x39, 0x33,
+ 0x38, 0x37, 0x40, 0x48, 0x5c, 0x4e, 0x40, 0x44,
+ 0x57, 0x45, 0x37, 0x38, 0x50, 0x6d, 0x51, 0x57,
+ 0x5f, 0x62, 0x67, 0x68, 0x67, 0x3e, 0x4d, 0x71,
+ 0x79, 0x70, 0x64, 0x78, 0x5c, 0x65, 0x67, 0x63,
+ 0x01, /* table ID 1 */
+ 0x11, 0x12, 0x12, 0x18, 0x15, 0x18, 0x2f, 0x1a,
+ 0x1a, 0x2f, 0x63, 0x42, 0x38, 0x42, 0x63, 0x63,
+ 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
+ 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
+ 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
+ 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
+ 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
+ 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63
+ };
+
+ /* write fixed quantitization tables */
+ adr = 0x0cc;
+ for (i = 0; i < sizeof(dqt); ++i) {
+ zr36060_write_8(zr, adr++, dqt[i]);
+ }
+}
+
+static void zr36060_set_jpg_DHT(struct zoran *zr)
+{
+ unsigned i;
+ unsigned adr;
+ static const u8 dht[] =
+ {
+ 0xff, 0xc4, /* DHT marker */
+ 0x01, 0xa2, /* DHT length */
+ 0x00, /* table class 0, ID 0 */
+ 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, /* # codes of length 1..8 */
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* # codes of length 8..16 */
+ 0x00, /* values for codes of length 2 */
+ 0x01, 0x02, 0x03, 0x04, 0x05, /* values for codes of length 3 */
+ 0x06, /* values for codes of length 4 */
+ 0x07, /* values for codes of length 5 */
+ 0x08, /* values for codes of length 6 */
+ 0x09, /* values for codes of length 7 */
+ 0x0a, /* values for codes of length 8 */
+ 0x0b, /* values for codes of length 9 */
+ 0x01, /* table class 0, ID 1 */
+ 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* # codes of length 1..8 */
+ 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, /* # codes of length 9..16 */
+ 0x00, 0x01, 0x02, /* values for codes of length 2 */
+ 0x03, /* values for codes of length 3 */
+ 0x04, /* values for codes of length 4 */
+ 0x05, /* values for codes of length 5 */
+ 0x06, /* values for codes of length 6 */
+ 0x07, /* values for codes of length 7 */
+ 0x08, /* values for codes of length 8 */
+ 0x09, /* values for codes of length 9 */
+ 0x0a, /* values for codes of length 10 */
+ 0x0b, /* values for codes of length 11 */
+ 0x10,
+ 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03,
+ 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d,
+ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
+ 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
+ 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
+ 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
+ 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
+ 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
+ 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
+ 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
+ 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
+ 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
+ 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
+ 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
+ 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
+ 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
+ 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
+ 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
+ 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
+ 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
+ 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
+ 0xf9, 0xfa, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04,
+ 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00,
+ 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11,
+ 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51,
+ 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08,
+ 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23,
+ 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, 0x0a,
+ 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18,
+ 0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35,
+ 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45,
+ 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55,
+ 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65,
+ 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75,
+ 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, 0x84,
+ 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93,
+ 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2,
+ 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa,
+ 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
+ 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8,
+ 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd8, 0xd9, 0xda, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
+ 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5,
+ 0xf6, 0xf7, 0xf8, 0xf9, 0xfa
+ };
+
+ /* write fixed Huffman tables */
+ adr = 0x1d4;
+ for (i = 0; i < sizeof(dht); ++i) {
+ zr36060_write_8(zr, adr++, dht[i]);
+ }
+}
+
+static void zr36060_set_jpg_APP(struct zoran *zr)
+{
+ unsigned adr;
+ int len, i;
+ u32 reg;
+
+
+ len = zr->params.APP_len;
+ if (len < 0)
+ len = 0;
+ if (len > 60)
+ len = 60;
+
+ i = zr->params.APPn;
+ if (i < 0)
+ i = 0;
+ if (i > 15)
+ i = 15;
+
+ reg = 0xffe0 + i; /* APPn marker */
+ zr36060_write_16(zr, 0x380, reg);
+
+ reg = len + 2; /* APPn len */
+ zr36060_write_16(zr, 0x382, reg);
+
+ /* write APPn data */
+ adr = 0x384;
+ for (i = 0; i < 60; i++) {
+ zr36060_write_8(zr, adr++, (i < len ? zr->params.APP_data[i] : 0));
+ }
+}
+
+static void zr36060_set_jpg_COM(struct zoran *zr)
+{
+ unsigned adr;
+ int len, i;
+ u32 reg;
+
+
+ len = zr->params.COM_len;
+ if (len < 0)
+ len = 0;
+ if (len > 60)
+ len = 60;
+
+ reg = 0xfffe; /* COM marker */
+ zr36060_write_16(zr, 0x3c0, reg);
+
+ reg = len + 2; /* COM len */
+ zr36060_write_16(zr, 0x3c2, reg);
+
+ /* write COM data */
+ adr = 0x3c4;
+ for (i = 0; i < 60; i++) {
+ zr36060_write_8(zr, adr++, (i < len ? zr->params.COM_data[i] : 0));
+ }
+}
+
+static void zr36060_set_cap(struct zoran *zr, enum zoran_codec_mode mode)
+{
+ unsigned i;
+ u32 reg;
+
+ zr36060_reset(zr);
+ mdelay(10);
+
+ reg = (0 << 7) /* Load=0 */
+ |(1 << 0); /* SynRst=1 */
+ zr36060_write_8(zr, 0x000, reg);
+
+ zr36060_set_jpg(zr, mode);
+ zr36060_set_video(zr, mode);
+ zr36060_set_jpg_SOF(zr);
+ zr36060_set_jpg_SOS(zr);
+ zr36060_set_jpg_DRI(zr);
+ zr36060_set_jpg_DQT(zr);
+ zr36060_set_jpg_DHT(zr);
+ zr36060_set_jpg_APP(zr);
+ zr36060_set_jpg_COM(zr);
+
+ reg = (1 << 7) /* Load=1 */
+ |(0 << 0); /* SynRst=0 */
+ zr36060_write_8(zr, 0x000, reg);
+
+ /* wait for codec to unbusy */
+ for (i = 0; i < 1000; ++i) {
+ reg = zr36060_read_8(zr, 0x001);
+ if ((reg & (1 << 7)) == 0) {
+ DEBUG(printk(KERN_DEBUG "060: loaded, loops=%u\n", i));
+ return;
+ }
+ udelay(1000);
+ }
+ printk(KERN_INFO "060: stuck busy, statux=%02x\n", reg);
+}
+
+static void zr36057_set_jpg(struct zoran *zr, enum zoran_codec_mode mode)
+{
+ struct tvnorm *tvn;
+ u32 reg;
+ int i;
+
+ tvn = &tvnorms[zr->params.norm];
+
+ /* assert P_Reset */
+ btwrite(0, ZR36057_JPC);
+
+ /* re-initialize DMA ring stuff */
+ zr->jpg_que_head = 0;
+ zr->jpg_dma_head = 0;
+ zr->jpg_dma_tail = 0;
+ zr->jpg_que_tail = 0;
+ zr->jpg_seq_num = 0;
+ for (i = 0; i < BUZ_NUM_STAT_COM; ++i) {
+ zr->stat_com[i] = 1; /* mark as unavailable to zr36057 */
+ }
+ for (i = 0; i < zr->jpg_nbufs; i++) {
+ zr->jpg_gbuf[i].state = BUZ_STATE_USER; /* nothing going on */
+ }
+
+ /* MJPEG compression mode */
+ switch (mode) {
+
+ case BUZ_MODE_MOTION_COMPRESS:
+ default:
+ reg = ZR36057_JMC_MJPGCmpMode;
+ break;
+
+ case BUZ_MODE_MOTION_DECOMPRESS:
+ reg = ZR36057_JMC_MJPGExpMode;
+ reg |= ZR36057_JMC_SyncMstr;
+ /* RJ: The following is experimental - improves the output to screen */
+ if (zr->params.VFIFO_FB)
+ reg |= ZR36057_JMC_VFIFO_FB;
+ break;
+
+ case BUZ_MODE_STILL_COMPRESS:
+ reg = ZR36057_JMC_JPGCmpMode;
+ break;
+
+ case BUZ_MODE_STILL_DECOMPRESS:
+ reg = ZR36057_JMC_JPGExpMode;
+ break;
+
+ }
+ reg |= ZR36057_JMC_JPG;
+ if (zr->params.field_per_buff == 1)
+ reg |= ZR36057_JMC_Fld_per_buff;
+ btwrite(reg, ZR36057_JMC);
+
+ /* vertical */
+ btor(ZR36057_VFEVCR_VSPol, ZR36057_VFEVCR);
+ reg = (6 << ZR36057_VSP_VsyncSize) | (tvn->Ht << ZR36057_VSP_FrmTot);
+ btwrite(reg, ZR36057_VSP);
+ reg = ((zr->params.img_y + tvn->VStart) << ZR36057_FVAP_NAY)
+ | (zr->params.img_height << ZR36057_FVAP_PAY);
+ btwrite(reg, ZR36057_FVAP);
+
+ /* horizontal */
+ btor(ZR36057_VFEHCR_HSPol, ZR36057_VFEHCR);
+ reg = ((tvn->Wt - 100) << ZR36057_HSP_HsyncStart) | (tvn->Wt << ZR36057_HSP_LineTot);
+ btwrite(reg, ZR36057_HSP);
+ reg = ((zr->params.img_x + tvn->HStart) << ZR36057_FHAP_NAX)
+ | (zr->params.img_width << ZR36057_FHAP_PAX);
+ btwrite(reg, ZR36057_FHAP);
+
+ /* field process parameters */
+ if (zr->params.odd_even)
+ reg = ZR36057_FPP_Odd_Even;
+ else
+ reg = 0;
+ btwrite(reg, ZR36057_FPP);
+
+ /* Set proper VCLK Polarity, else colors will be wrong during playback */
+ btor(ZR36057_VFESPFR_VCLKPol, ZR36057_VFESPFR);
+
+ /* code base address and FIFO threshold */
+ reg = virt_to_bus(zr->stat_com);
+ btwrite(reg, ZR36057_JCBA);
+ reg = 0x50;
+ btwrite(reg, ZR36057_JCFT);
+
+ /* JPEG codec guest ID */
+ reg = (1 << ZR36057_JCGI_JPEGuestID) | (0 << ZR36057_JCGI_JPEGuestReg);
+ btwrite(reg, ZR36057_JCGI);
+
+ /* Code transfer guest ID */
+ reg = (0 << ZR36057_MCTCR_CodGuestID) | (3 << ZR36057_MCTCR_CodGuestReg);
+ reg |= ZR36057_MCTCR_CFlush;
+ btwrite(reg, ZR36057_MCTCR);
+
+ /* deassert P_Reset */
+ btwrite(ZR36057_JPC_P_Reset, ZR36057_JPC);
+}
+
+static void zr36057_enable_jpg(struct zoran *zr, enum zoran_codec_mode mode)
+{
+ static int zero = 0;
+ static int one = 1;
+
+ switch (mode) {
+
+ case BUZ_MODE_MOTION_COMPRESS:
+ zr36060_set_cap(zr, mode);
+ zr36057_set_jpg(zr, mode);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_ENABLE_OUTPUT, &one);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEOENCODER, ENCODER_SET_INPUT, &zero);
+
+ /* deassert P_Reset, assert Code transfer enable */
+ btwrite(IRQ_MASK, ZR36057_ISR);
+ btand(~ZR36057_MCTCR_CFlush, ZR36057_MCTCR);
+ break;
+
+ case BUZ_MODE_MOTION_DECOMPRESS:
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_ENABLE_OUTPUT, &zero);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEOENCODER, ENCODER_SET_INPUT, &one);
+ zr36060_set_cap(zr, mode);
+ zr36057_set_jpg(zr, mode);
+
+ /* deassert P_Reset, assert Code transfer enable */
+ btwrite(IRQ_MASK, ZR36057_ISR);
+ btand(~ZR36057_MCTCR_CFlush, ZR36057_MCTCR);
+ break;
+
+ case BUZ_MODE_IDLE:
+ default:
+ /* shut down processing */
+ btor(ZR36057_MCTCR_CFlush, ZR36057_MCTCR);
+ btwrite(ZR36057_JPC_P_Reset, ZR36057_JPC);
+ btand(~ZR36057_JMC_VFIFO_FB, ZR36057_JMC);
+ btand(~ZR36057_JMC_SyncMstr, ZR36057_JMC);
+ btand(~ZR36057_JMC_Go_en, ZR36057_JMC);
+ btwrite(0, ZR36057_ISR);
+ zr36060_reset(zr);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_ENABLE_OUTPUT, &one);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEOENCODER, ENCODER_SET_INPUT, &zero);
+ break;
+
+ }
+ zr->codec_mode = mode;
+}
+
+/*
+ * Queue a MJPEG buffer for capture/playback
+ */
+
+static int jpg_qbuf(struct zoran *zr, int frame, enum zoran_codec_mode mode)
+{
+ unsigned long flags;
+ int res;
+
+ /* Check if buffers are allocated */
+
+ if (!zr->jpg_buffers_allocated) {
+ printk(KERN_ERR "%s: jpg_qbuf: buffers not yet allocated\n", zr->name);
+ return -ENOMEM;
+ }
+ /* Does the user want to stop streaming? */
+
+ if (frame < 0) {
+ if (zr->codec_mode == mode) {
+ zr36057_enable_jpg(zr, BUZ_MODE_IDLE);
+ return 0;
+ } else {
+ printk(KERN_ERR "%s: jpg_qbuf - stop streaming but not in streaming mode\n", zr->name);
+ return -EINVAL;
+ }
+ }
+ /* No grabbing outside the buffer range! */
+
+ if (frame >= zr->jpg_nbufs) {
+ printk(KERN_ERR "%s: jpg_qbuf: buffer %d out of range\n", zr->name, frame);
+ return -EINVAL;
+ }
+ /* what is the codec mode right now? */
+
+ if (zr->codec_mode == BUZ_MODE_IDLE) {
+ /* Ok load up the zr36060 and go */
+ zr36057_enable_jpg(zr, mode);
+ } else if (zr->codec_mode != mode) {
+ /* wrong codec mode active - invalid */
+ printk(KERN_ERR "%s: jpg_qbuf - codec in wrong mode\n", zr->name);
+ return -EINVAL;
+ }
+ spin_lock_irqsave(&zr->lock, flags);
+
+ /* make sure a grab isn't going on currently with this buffer */
+
+ switch (zr->jpg_gbuf[frame].state) {
+
+ default:
+ case BUZ_STATE_DMA:
+ case BUZ_STATE_PEND:
+ case BUZ_STATE_DONE:
+ res = -EBUSY; /* what are you doing? */
+ break;
+
+ case BUZ_STATE_USER:
+ /* since there is at least one unused buffer there's room for at least one more pend[] entry */
+ zr->jpg_pend[zr->jpg_que_head++ & BUZ_MASK_FRAME] = frame;
+ zr->jpg_gbuf[frame].state = BUZ_STATE_PEND;
+ zoran_feed_stat_com(zr);
+ res = 0;
+ break;
+
+ }
+
+ spin_unlock_irqrestore(&zr->lock, flags);
+
+ /* Start the zr36060 when the first frame is queued */
+ if (zr->jpg_que_head == 1) {
+ btor(ZR36057_JMC_Go_en, ZR36057_JMC);
+ btwrite(ZR36057_JPC_P_Reset | ZR36057_JPC_CodTrnsEn | ZR36057_JPC_Active, ZR36057_JPC);
+ }
+ return res;
+}
+
+/*
+ * Sync on a MJPEG buffer
+ */
+
+static int jpg_sync(struct zoran *zr, struct zoran_sync *bs)
+{
+ unsigned long flags;
+ int frame;
+
+ if (zr->codec_mode != BUZ_MODE_MOTION_DECOMPRESS &&
+ zr->codec_mode != BUZ_MODE_MOTION_COMPRESS) {
+ return -EINVAL;
+ }
+ while (zr->jpg_que_tail == zr->jpg_dma_tail) {
+ interruptible_sleep_on(&zr->jpg_capq);
+ if (signal_pending(current))
+ return -ERESTARTSYS;
+ }
+
+ spin_lock_irqsave(&zr->lock, flags);
+
+ frame = zr->jpg_pend[zr->jpg_que_tail++ & BUZ_MASK_FRAME];
+
+ /* buffer should now be in BUZ_STATE_DONE */
+
+ if (zr->jpg_gbuf[frame].state != BUZ_STATE_DONE)
+ printk(KERN_ERR "%s: jpg_sync - internal error\n", zr->name);
+
+ *bs = zr->jpg_gbuf[frame].bs;
+ zr->jpg_gbuf[frame].state = BUZ_STATE_USER;
+
+ spin_unlock_irqrestore(&zr->lock, flags);
+


+ return 0;
+}
+

+/* when this is called the spinlock must be held */
+static void zoran_feed_stat_com(struct zoran *zr)
+{
+ /* move frames from pending queue to DMA */
+
+ int frame, i, max_stat_com;
+
+ max_stat_com = (zr->params.TmpDcm == 1) ? BUZ_NUM_STAT_COM : (BUZ_NUM_STAT_COM >> 1);
+
+ while ((zr->jpg_dma_head - zr->jpg_dma_tail) < max_stat_com
+ && zr->jpg_dma_head != zr->jpg_que_head) {
+
+ frame = zr->jpg_pend[zr->jpg_dma_head & BUZ_MASK_FRAME];
+ if (zr->params.TmpDcm == 1) {
+ /* fill 1 stat_com entry */
+ i = zr->jpg_dma_head & BUZ_MASK_STAT_COM;
+ zr->stat_com[i] = zr->jpg_gbuf[frame].frag_tab_bus;
+ } else {
+ /* fill 2 stat_com entries */
+ i = (zr->jpg_dma_head & 1) * 2;
+ zr->stat_com[i] = zr->jpg_gbuf[frame].frag_tab_bus;
+ zr->stat_com[i + 1] = zr->jpg_gbuf[frame].frag_tab_bus;
+ }
+ zr->jpg_gbuf[frame].state = BUZ_STATE_DMA;
+ zr->jpg_dma_head++;
+
+ }
+}
+
+/* when this is called the spinlock must be held */
+static void zoran_reap_stat_com(struct zoran *zr)
+{
+ /* move frames from DMA queue to done queue */
+
+ int i;
+ u32 stat_com;
+ unsigned int seq;
+ unsigned int dif;
+ int frame;
+ struct zoran_gbuffer *gbuf;
+
+ /* In motion decompress we don't have a hardware frame counter,
+ we just count the interrupts here */
+
+ if (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS)
+ zr->jpg_seq_num++;
+
+ while (zr->jpg_dma_tail != zr->jpg_dma_head) {
+ if (zr->params.TmpDcm == 1)
+ i = zr->jpg_dma_tail & BUZ_MASK_STAT_COM;
+ else
+ i = (zr->jpg_dma_tail & 1) * 2 + 1;
+
+ stat_com = zr->stat_com[i];
+
+ if ((stat_com & 1) == 0) {
+ return;
+ }
+ frame = zr->jpg_pend[zr->jpg_dma_tail & BUZ_MASK_FRAME];
+ gbuf = &zr->jpg_gbuf[frame];
+ get_fast_time(&gbuf->bs.timestamp);
+
+ if (zr->codec_mode == BUZ_MODE_MOTION_COMPRESS) {
+ gbuf->bs.length = (stat_com & 0x7fffff) >> 1;
+
+ /* update sequence number with the help of the counter in stat_com */
+
+ seq = stat_com >> 24;
+ dif = (seq - zr->jpg_seq_num) & 0xff;
+ zr->jpg_seq_num += dif;
+ } else {
+ gbuf->bs.length = 0;
+ }
+ gbuf->bs.seq = zr->params.TmpDcm == 2 ? (zr->jpg_seq_num >> 1) : zr->jpg_seq_num;
+ gbuf->state = BUZ_STATE_DONE;
+
+ zr->jpg_dma_tail++;
+ }
+}
+
+static void zoran_irq(int irq, void *dev_id, struct pt_regs *regs)
+{
+ u32 stat, astat;
+ int count;
+ struct zoran *zr;


+ unsigned long flags;
+

+ zr = (struct zoran *) dev_id;
+ count = 0;
+
+ spin_lock_irqsave(&zr->lock, flags);
+ while (1) {
+ /* get/clear interrupt status bits */
+ stat = btread(ZR36057_ISR);
+ astat = stat & IRQ_MASK;
+ if (!astat) {
+ break;
+ }
+ btwrite(astat, ZR36057_ISR);
+ IDEBUG(printk(BUZ_DEBUG "-%u: astat %08x stat %08x\n", zr->id, astat, stat));
+
+#if (IRQ_MASK & ZR36057_ISR_GIRQ0)
+ if (astat & ZR36057_ISR_GIRQ0) {
+
+ /* Interrupts may still happen when zr->v4l_memgrab_active is switched off.
+ We simply ignore them */
+
+ if (zr->v4l_memgrab_active) {
+
+/* A lot more checks should be here ... */
+ if ((btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_SnapShot) == 0)
+ printk(KERN_WARNING "%s: BuzIRQ with SnapShot off ???\n", zr->name);
+
+ if (zr->v4l_grab_frame != NO_GRAB_ACTIVE) {
+ /* There is a grab on a frame going on, check if it has finished */
+
+ if ((btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_FrameGrab) == 0) {
+ /* it is finished, notify the user */
+
+ zr->v4l_gbuf[zr->v4l_grab_frame].state = BUZ_STATE_DONE;
+ zr->v4l_grab_frame = NO_GRAB_ACTIVE;
+ zr->v4l_grab_seq++;
+ zr->v4l_pend_tail++;
+ }
+ }
+ if (zr->v4l_grab_frame == NO_GRAB_ACTIVE)
+ wake_up_interruptible(&zr->v4l_capq);
+
+ /* Check if there is another grab queued */
+
+ if (zr->v4l_grab_frame == NO_GRAB_ACTIVE &&
+ zr->v4l_pend_tail != zr->v4l_pend_head) {
+
+ int frame = zr->v4l_pend[zr->v4l_pend_tail & V4L_MASK_FRAME];
+ u32 reg;
+
+ zr->v4l_grab_frame = frame;
+
+ /* Set zr36057 video front end and enable video */
+
+ /* Buffer address */
+
+ reg = zr->v4l_gbuf[frame].fbuffer_bus;
+ btwrite(reg, ZR36057_VDTR);
+ if (zr->video_interlace)
+ reg += zr->gbpl;
+ btwrite(reg, ZR36057_VDBR);
+
+ /* video stride, status, and frame grab register */
+
+#ifdef XAWTV_HACK
+ reg = (zr->gwidth > 720) ? ((zr->gwidth & ~3) - 720) * zr->gbpl / zr->gwidth : 0;
+#else
+ reg = 0;
+#endif
+ if (zr->video_interlace)
+ reg += zr->gbpl;
+ reg = (reg << ZR36057_VSSFGR_DispStride);
+ reg |= ZR36057_VSSFGR_VidOvf;
+ reg |= ZR36057_VSSFGR_SnapShot;
+ reg |= ZR36057_VSSFGR_FrameGrab;
+ btwrite(reg, ZR36057_VSSFGR);
+
+ btor(ZR36057_VDCR_VidEn, ZR36057_VDCR);
+ }
+ }
+ }
+#endif /* (IRQ_MASK & ZR36057_ISR_GIRQ0) */
+
+#if (IRQ_MASK & ZR36057_ISR_GIRQ1)
+ if (astat & ZR36057_ISR_GIRQ1) {
+ unsigned csr = zr36060_read_8(zr, 0x001);
+ unsigned isr = zr36060_read_8(zr, 0x008);
+
+ IDEBUG(printk(KERN_DEBUG "%s: ZR36057_ISR_GIRQ1 60_code=%02x 60_intr=%02x\n",
+ zr->name, csr, isr));
+
+ btand(~ZR36057_ICR_GIRQ1, ZR36057_ICR);
+ zoran_reap_stat_com(zr);
+ zoran_feed_stat_com(zr);
+ }
+#endif /* (IRQ_MASK & ZR36057_ISR_GIRQ1) */
+
+#if (IRQ_MASK & ZR36057_ISR_CodRepIRQ)
+ if (astat & ZR36057_ISR_CodRepIRQ) {
+ IDEBUG(printk(KERN_DEBUG "%s: ZR36057_ISR_CodRepIRQ\n", zr->name));
+ btand(~ZR36057_ICR_CodRepIRQ, ZR36057_ICR);
+ }
+#endif /* (IRQ_MASK & ZR36057_ISR_CodRepIRQ) */
+
+#if (IRQ_MASK & ZR36057_ISR_JPEGRepIRQ)
+ if ((astat & ZR36057_ISR_JPEGRepIRQ) &&
+ (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS ||
+ zr->codec_mode == BUZ_MODE_MOTION_COMPRESS)) {
+ zoran_reap_stat_com(zr);
+ zoran_feed_stat_com(zr);
+ wake_up_interruptible(&zr->jpg_capq);
+ }
+#endif /* (IRQ_MASK & ZR36057_ISR_JPEGRepIRQ) */
+
+ count++;
+ if (count > 10) {
+ printk(KERN_WARNING "%s: irq loop %d\n", zr->name, count);
+ if (count > 20) {
+ btwrite(0, ZR36057_ICR);
+ printk(KERN_ERR "%s: IRQ lockup, cleared int mask\n", zr->name);
+ break;
+ }
+ }
+ }
+ spin_unlock_irqrestore(&zr->lock, flags);
+}
+
+/* Check a zoran_params struct for correctness, insert default params */
+
+static int zoran_check_params(struct zoran *zr, struct zoran_params *params)
+{
+ int err = 0, err0 = 0;
+
+ /* insert constant params */
+
+ params->major_version = MAJOR_VERSION;
+ params->minor_version = MINOR_VERSION;
+
+ /* Check input and norm */
+
+ if (params->input != 0 && params->input != 1) {
+ err++;
+ }
+ if (params->norm != VIDEO_MODE_PAL && params->norm != VIDEO_MODE_NTSC) {
+ err++;
+ }
+ /* Check decimation, set default values for decimation = 1, 2, 4 */
+
+ switch (params->decimation) {
+ case 1:
+
+ params->HorDcm = 1;
+ params->VerDcm = 1;
+ params->TmpDcm = 1;
+ params->field_per_buff = 2;
+
+ params->img_x = 0;
+ params->img_y = 0;
+ params->img_width = 720;
+ params->img_height = tvnorms[params->norm].Ha / 2;
+ break;
+
+ case 2:
+
+ params->HorDcm = 2;
+ params->VerDcm = 1;
+ params->TmpDcm = 2;
+ params->field_per_buff = 1;
+
+ params->img_x = 8;
+ params->img_y = 0;
+ params->img_width = 704;
+ params->img_height = tvnorms[params->norm].Ha / 2;
+ break;
+
+ case 4:
+
+ params->HorDcm = 4;
+ params->VerDcm = 2;
+ params->TmpDcm = 2;
+ params->field_per_buff = 1;
+
+ params->img_x = 8;
+ params->img_y = 0;
+ params->img_width = 704;
+ params->img_height = tvnorms[params->norm].Ha / 2;
+ break;
+
+ case 0:
+
+ /* We have to check the data the user has set */
+
+ if (params->HorDcm != 1 && params->HorDcm != 2 && params->HorDcm != 4)
+ err0++;
+ if (params->VerDcm != 1 && params->VerDcm != 2)
+ err0++;
+ if (params->TmpDcm != 1 && params->TmpDcm != 2)
+ err0++;
+ if (params->field_per_buff != 1 && params->field_per_buff != 2)
+ err0++;
+
+ if (params->img_x < 0)
+ err0++;
+ if (params->img_y < 0)
+ err0++;
+ if (params->img_width < 0)
+ err0++;
+ if (params->img_height < 0)
+ err0++;
+ if (params->img_x + params->img_width > 720)
+ err0++;
+ if (params->img_y + params->img_height > tvnorms[params->norm].Ha / 2)
+ err0++;
+ if (params->img_width % (16 * params->HorDcm) != 0)
+ err0++;
+ if (params->img_height % (8 * params->VerDcm) != 0)
+ err0++;
+
+ if (err0) {
+ err++;
+ }
+ break;
+
+ default:
+ err++;
+ break;
+ }
+
+ if (params->quality > 100)
+ params->quality = 100;
+ if (params->quality < 5)
+ params->quality = 5;
+
+ if (params->APPn < 0)
+ params->APPn = 0;
+ if (params->APPn > 15)
+ params->APPn = 15;
+ if (params->APP_len < 0)
+ params->APP_len = 0;
+ if (params->APP_len > 60)
+ params->APP_len = 60;
+ if (params->COM_len < 0)
+ params->COM_len = 0;
+ if (params->COM_len > 60)
+ params->COM_len = 60;
+
+ if (err)
+ return -EINVAL;
+


+ return 0;
+
+}

+static void zoran_open_init_params(struct zoran *zr)
+{
+ int i;
+
+ /* Per default, map the V4L Buffers */
+
+ zr->map_mjpeg_buffers = 0;
+
+ /* User must explicitly set a window */
+
+ zr->window_set = 0;
+
+ zr->window.x = 0;
+ zr->window.y = 0;
+ zr->window.width = 0;
+ zr->window.height = 0;
+ zr->window.chromakey = 0;
+ zr->window.flags = 0;
+ zr->window.clips = NULL;
+ zr->window.clipcount = 0;
+
+ zr->video_interlace = 0;
+
+ zr->v4l_memgrab_active = 0;
+ zr->v4l_overlay_active = 0;
+
+ zr->v4l_grab_frame = NO_GRAB_ACTIVE;
+ zr->v4l_grab_seq = 0;
+
+ zr->gwidth = 0;
+ zr->gheight = 0;
+ zr->gformat = 0;
+ zr->gbpl = 0;
+
+ /* DMA ring stuff for V4L */
+
+ zr->v4l_pend_tail = 0;
+ zr->v4l_pend_head = 0;
+ for (i = 0; i < v4l_nbufs; i++) {
+ zr->v4l_gbuf[i].state = BUZ_STATE_USER; /* nothing going on */
+ }
+
+ /* Set necessary params and call zoran_check_params to set the defaults */
+
+ zr->params.decimation = 1;
+
+ zr->params.quality = 50; /* default compression factor 8 */
+ zr->params.odd_even = 1;
+
+ zr->params.APPn = 0;
+ zr->params.APP_len = 0; /* No APPn marker */
+ for (i = 0; i < 60; i++)
+ zr->params.APP_data[i] = 0;
+
+ zr->params.COM_len = 0; /* No COM marker */
+ for (i = 0; i < 60; i++)
+ zr->params.COM_data[i] = 0;
+
+ zr->params.VFIFO_FB = 0;
+
+ memset(zr->params.reserved, 0, sizeof(zr->params.reserved));
+
+ zr->params.jpeg_markers = JPEG_MARKER_DHT | JPEG_MARKER_DQT;


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

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

Thomas Kobienia

unread,
Jul 9, 1999, 3:00:00 AM7/9/99
to
Archive-name: v2.3/patch-2.3.10/part09

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


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.10 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.3.10'
else
echo 'x - continuing with patch-2.3.10'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.10' &&
+

+ i = zoran_check_params(zr, &zr->params);
+ if (i)
+ printk(KERN_ERR "%s: zoran_open_init_params internal error\n", zr->name);
+}
+
+/*
+ * Open a buz card. Right now the flags stuff is just playing
+ */
+
+static int zoran_open(struct video_device *dev, int flags)
+{
+ struct zoran *zr = (struct zoran *) dev;
+
+ DEBUG(printk(KERN_INFO ": zoran_open\n"));
+
+ switch (flags) {
+
+ case 0:
+ if (zr->user)
+ return -EBUSY;
+ zr->user++;
+
+ if (v4l_fbuffer_alloc(zr) < 0) {
+ zr->user--;
+ return -ENOMEM;
+ }
+ /* default setup */
+
+ zoran_open_init_params(zr);
+
+ zr36057_enable_jpg(zr, BUZ_MODE_IDLE);
+
+ btwrite(IRQ_MASK, ZR36057_ISR); // Clears interrupts
+
+ btor(ZR36057_ICR_IntPinEn, ZR36057_ICR);


+
+ break;
+
+ default:

+ return -EBUSY;
+
+ }
+ MOD_INC_USE_COUNT;


+ return 0;
+}
+

+static void zoran_close(struct video_device *dev)
+{
+ struct zoran *zr = (struct zoran *) dev;
+
+ DEBUG(printk(KERN_INFO ": zoran_close\n"));
+
+ /* disable interrupts */
+ btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR);
+
+ /* wake up sleeping beauties */
+ wake_up_interruptible(&zr->v4l_capq);
+ wake_up_interruptible(&zr->jpg_capq);
+
+ zr36057_enable_jpg(zr, BUZ_MODE_IDLE);
+ zr36057_set_memgrab(zr, 0);
+ if (zr->v4l_overlay_active)
+ zr36057_overlay(zr, 0);
+
+ zr->user--;
+
+ v4l_fbuffer_free(zr);
+ jpg_fbuffer_free(zr);
+ zr->jpg_nbufs = 0;
+
+ MOD_DEC_USE_COUNT;
+ DEBUG(printk(KERN_INFO ": zoran_close done\n"));
+}
+
+
+static long zoran_read(struct video_device *dev, char *buf, unsigned long count, int nonblock)
+{


+ return -EINVAL;
+}
+

+static long zoran_write(struct video_device *dev, const char *buf, unsigned long count, int nonblock)
+{


+ return -EINVAL;
+}
+

+/*
+ * ioctl routine
+ */
+
+
+static int zoran_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
+{
+ struct zoran *zr = (struct zoran *) dev;
+
+ switch (cmd) {
+
+ case VIDIOCGCAP:
+ {
+ struct video_capability b;
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCGCAP\n"));
+ strncpy(b.name, zr->video_dev.name, sizeof(b.name));
+ b.type = VID_TYPE_CAPTURE |
+ VID_TYPE_OVERLAY |
+ VID_TYPE_CLIPPING |
+ VID_TYPE_FRAMERAM |
+ VID_TYPE_SCALES;
+ /* theoretically we could also flag VID_TYPE_SUBCAPTURE
+ but this is not even implemented in the BTTV driver */
+
+ b.channels = 2; /* composite, svhs */
+ b.audios = 0;
+ b.maxwidth = BUZ_MAX_WIDTH;
+ b.maxheight = BUZ_MAX_HEIGHT;
+ b.minwidth = BUZ_MIN_WIDTH;
+ b.minheight = BUZ_MIN_HEIGHT;
+ if (copy_to_user(arg, &b, sizeof(b))) {
+ return -EFAULT;


+ }
+ return 0;
+ }
+

+ case VIDIOCGCHAN:
+ {
+ struct video_channel v;
+
+ if (copy_from_user(&v, arg, sizeof(v))) {
+ return -EFAULT;
+ }
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCGCHAN for channel %d\n", v.channel));
+ switch (v.channel) {
+ case 0:
+ strcpy(v.name, "Composite");
+ break;
+ case 1:
+ strcpy(v.name, "SVHS");
+ break;
+ default:
+ return -EINVAL;
+ }
+ v.tuners = 0;
+ v.flags = 0;
+ v.type = VIDEO_TYPE_CAMERA;
+ v.norm = zr->params.norm;
+ if (copy_to_user(arg, &v, sizeof(v))) {
+ return -EFAULT;


+ }
+ return 0;
+ }
+

+ /* RJ: the documentation at http://roadrunner.swansea.linux.org.uk/v4lapi.shtml says:
+
+ * "The VIDIOCSCHAN ioctl takes an integer argument and switches the capture to this input."
+ * ^^^^^^^
+ * The famos BTTV driver has it implemented with a struct video_channel argument
+ * and we follow it for compatibility reasons
+ *
+ * BTW: this is the only way the user can set the norm!
+ */
+
+ case VIDIOCSCHAN:
+ {
+ struct video_channel v;
+ int input;
+ int on, res;
+
+ if (copy_from_user(&v, arg, sizeof(v))) {
+ return -EFAULT;
+ }
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCSCHAN: channel=%d, norm=%d\n", v.channel, v.norm));
+ switch (v.channel) {
+ case 0:
+ input = 3;
+ break;
+ case 1:
+ input = 7;
+ break;
+ default:


+ return -EINVAL;
+ }
+

+ if (v.norm != VIDEO_MODE_PAL
+ && v.norm != VIDEO_MODE_NTSC) {
+ return -EINVAL;
+ }
+ zr->params.norm = v.norm;
+ zr->params.input = v.channel;
+
+ /* We switch overlay off and on since a change in the norm
+ needs different VFE settings */
+
+ on = zr->v4l_overlay_active && !zr->v4l_memgrab_active;
+ if (on)
+ zr36057_overlay(zr, 0);
+
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_SET_INPUT, &input);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_SET_NORM, &zr->params.norm);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEOENCODER, ENCODER_SET_NORM, &zr->params.norm);
+
+ if (on)
+ zr36057_overlay(zr, 1);
+
+ /* Make sure the changes come into effect */


+ res = wait_grab_pending(zr);
+ if (res)
+ return res;
+

+ return 0;
+ }
+
+ case VIDIOCGTUNER:
+ case VIDIOCSTUNER:
+ return -EINVAL;
+
+ case VIDIOCGPICT:
+ {
+ struct video_picture p = zr->picture;
+
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCGPICT\n"));
+ p.depth = zr->buffer.depth;


+ switch (zr->buffer.depth) {
+ case 15:

+ p.palette = VIDEO_PALETTE_RGB555;
+ break;
+
+ case 16:
+ p.palette = VIDEO_PALETTE_RGB565;
+ break;
+
+ case 24:
+ p.palette = VIDEO_PALETTE_RGB24;
+ break;
+
+ case 32:
+ p.palette = VIDEO_PALETTE_RGB32;
+ break;
+ }
+
+ if (copy_to_user(arg, &p, sizeof(p))) {
+ return -EFAULT;


+ }
+ return 0;
+ }
+

+ case VIDIOCSPICT:
+ {
+ struct video_picture p;
+
+ if (copy_from_user(&p, arg, sizeof(p))) {
+ return -EFAULT;
+ }
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_SET_PICTURE, &p);
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCSPICT bri=%d hue=%d col=%d con=%d dep=%d pal=%d\n",
+ p.brightness, p.hue, p.colour, p.contrast, p.depth, p.palette));
+ /* The depth and palette values have no meaning to us,
+ should we return -EINVAL if they don't fit ? */
+ zr->picture = p;


+ return 0;
+ }
+

+ case VIDIOCCAPTURE:
+ {
+ int v, res;
+
+ if (copy_from_user(&v, arg, sizeof(v))) {
+ return -EFAULT;
+ }
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCCAPTURE: %d\n", v));
+ /* If there is nothing to do, return immediatly */
+
+ if ((v && zr->v4l_overlay_active) || (!v && !zr->v4l_overlay_active))
+ return 0;
+
+ if (v == 0) {


+ zr->v4l_overlay_active = 0;

+ if (!zr->v4l_memgrab_active)
+ zr36057_overlay(zr, 0);
+ /* When a grab is running, the video simply won't be switched on any more */
+ } else {
+ if (!zr->buffer_set || !zr->window_set) {
+ return -EINVAL;
+ }
+ zr->v4l_overlay_active = 1;
+ if (!zr->v4l_memgrab_active)
+ zr36057_overlay(zr, 1);
+ /* When a grab is running, the video will be switched on when grab is finished */
+ }
+ /* Make sure the changes come into effect */


+ res = wait_grab_pending(zr);
+ if (res)
+ return res;

+ return 0;
+ }
+
+ case VIDIOCGWIN:
+ {
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCGWIN\n"));
+ if (copy_to_user(arg, &zr->window, sizeof(zr->window))) {
+ return -EFAULT;


+ }
+ return 0;
+ }
+

+ case VIDIOCSWIN:
+ {
+ struct video_clip *vcp;
+ struct video_window vw;
+ int on, end, res;
+
+ if (copy_from_user(&vw, arg, sizeof(vw))) {
+ return -EFAULT;
+ }
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCSWIN: x=%d y=%d w=%d h=%d clipcount=%d\n", vw.x, vw.y, vw.width, vw.height, vw.clipcount));
+ if (!zr->buffer_set) {


+ return -EINVAL;
+ }
+ /*

+ * The video front end needs 4-byte alinged line sizes, we correct that
+ * silently here if necessary
+ */
+
+ if (zr->buffer.depth == 15 || zr->buffer.depth == 16) {
+ end = (vw.x + vw.width) & ~1; /* round down */
+ vw.x = (vw.x + 1) & ~1; /* round up */
+ vw.width = end - vw.x;
+ }
+ if (zr->buffer.depth == 24) {
+ end = (vw.x + vw.width) & ~3; /* round down */
+ vw.x = (vw.x + 3) & ~3; /* round up */
+ vw.width = end - vw.x;
+ }
+#if 0
+ // At least xawtv seems to care about the following - just leave it away
+ /*
+ * Also corrected silently (as long as window fits at all):
+ * video not fitting the screen
+ */
+#if 0
+ if (vw.x < 0 || vw.y < 0 || vw.x + vw.width > zr->buffer.width ||
+ vw.y + vw.height > zr->buffer.height) {
+ printk(BUZ_ERR ": VIDIOCSWIN: window does not fit frame buffer: %dx%d+%d*%d\n",
+ vw.width, vw.height, vw.x, vw.y);
+ return -EINVAL;
+ }
+#else
+ if (vw.x < 0)
+ vw.x = 0;
+ if (vw.y < 0)
+ vw.y = 0;
+ if (vw.x + vw.width > zr->buffer.width)
+ vw.width = zr->buffer.width - vw.x;
+ if (vw.y + vw.height > zr->buffer.height)
+ vw.height = zr->buffer.height - vw.y;
+#endif
+#endif
+
+ /* Check for vaild parameters */
+ if (vw.width < BUZ_MIN_WIDTH || vw.height < BUZ_MIN_HEIGHT ||
+ vw.width > BUZ_MAX_WIDTH || vw.height > BUZ_MAX_HEIGHT) {
+ return -EINVAL;
+ }
+#ifdef XAWTV_HACK
+ if (vw.width > 720)
+ vw.width = 720;
+#endif
+
+ zr->window.x = vw.x;
+ zr->window.y = vw.y;
+ zr->window.width = vw.width;
+ zr->window.height = vw.height;


+ zr->window.chromakey = 0;

+ zr->window.flags = 0; // RJ: Is this intended for interlace on/off ?
+


+ zr->window.clips = NULL;

+ zr->window.clipcount = vw.clipcount;
+
+ /*
+ * If an overlay is running, we have to switch it off
+ * and switch it on again in order to get the new settings in effect.
+ *
+ * We also want to avoid that the overlay mask is written
+ * when an overlay is running.
+ */
+
+ on = zr->v4l_overlay_active && !zr->v4l_memgrab_active;
+ if (on)
+ zr36057_overlay(zr, 0);
+
+ /*
+ * Write the overlay mask if clips are wanted.
+ */
+ if (vw.clipcount) {
+ vcp = vmalloc(sizeof(struct video_clip) * (vw.clipcount + 4));
+ if (vcp == NULL) {
+ return -ENOMEM;
+ }
+ if (copy_from_user(vcp, vw.clips, sizeof(struct video_clip) * vw.clipcount)) {
+ vfree(vcp);
+ return -EFAULT;
+ }
+ write_overlay_mask(zr, vcp, vw.clipcount);
+ vfree(vcp);
+ }
+ if (on)
+ zr36057_overlay(zr, 1);
+ zr->window_set = 1;
+
+ /* Make sure the changes come into effect */


+ res = wait_grab_pending(zr);
+ if (res)
+ return res;
+

+ return 0;
+ }
+
+ case VIDIOCGFBUF:
+ {
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCGFBUF\n"));
+ if (copy_to_user(arg, &zr->buffer, sizeof(zr->buffer))) {
+ return -EFAULT;


+ }
+ return 0;
+ }
+

+ case VIDIOCSFBUF:
+ {
+ struct video_buffer v;
+
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+
+ if (copy_from_user(&v, arg, sizeof(v)))
+ return -EFAULT;
+
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCSFBUF: base=0x%x w=%d h=%d depth=%d bpl=%d\n", (u32) v.base, v.width, v.height, v.depth, v.bytesperline));
+ if (zr->v4l_overlay_active) {
+ /* Has the user gotten crazy ... ? */
+ return -EINVAL;
+ }
+ if (v.depth != 15
+ && v.depth != 16
+ && v.depth != 24
+ && v.depth != 32) {
+ return -EINVAL;
+ }
+ if (v.height <= 0 || v.width <= 0 || v.bytesperline <= 0) {
+ return -EINVAL;
+ }
+ if (v.bytesperline & 3) {
+ return -EINVAL;
+ }
+ if (v.base) {
+ zr->buffer.base = (void *) ((unsigned long) v.base & ~3);
+ }
+ zr->buffer.height = v.height;
+ zr->buffer.width = v.width;
+ zr->buffer.depth = v.depth;
+ zr->buffer.bytesperline = v.bytesperline;
+
+ if (zr->buffer.base)
+ zr->buffer_set = 1;
+ zr->window_set = 0; /* The user should set new window parameters */


+ return 0;
+ }
+

+ /* RJ: what is VIDIOCKEY intended to do ??? */
+
+ case VIDIOCGFREQ:
+ case VIDIOCSFREQ:
+ case VIDIOCGAUDIO:
+ case VIDIOCSAUDIO:
+ return -EINVAL;
+
+ case VIDIOCSYNC:
+ {
+ int v;
+
+ if (copy_from_user(&v, arg, sizeof(v))) {
+ return -EFAULT;
+ }
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCSYNC %d\n", v));
+ return v4l_sync(zr, v);
+ }
+
+ case VIDIOCMCAPTURE:
+ {
+ struct video_mmap vm;
+
+ if (copy_from_user((void *) &vm, (void *) arg, sizeof(vm))) {
+ return -EFAULT;
+ }
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCMCAPTURE frame=%d geom=%dx%d fmt=%d\n",
+ vm.frame, vm.height, vm.width, vm.format));
+ return v4l_grab(zr, &vm);
+ }
+
+ case VIDIOCGMBUF:
+ {
+ struct video_mbuf vm;
+ int i;
+
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCGMBUF\n"));
+
+ vm.size = v4l_nbufs * v4l_bufsize;
+ vm.frames = v4l_nbufs;


+ for (i = 0; i < v4l_nbufs; i++) {

+ vm.offsets[i] = i * v4l_bufsize;
+ }
+
+ /* The next mmap will map the V4L buffers */


+ zr->map_mjpeg_buffers = 0;
+

+ if (copy_to_user(arg, &vm, sizeof(vm))) {
+ return -EFAULT;


+ }
+ return 0;
+ }
+

+ case VIDIOCGUNIT:
+ {
+ struct video_unit vu;
+
+ IOCTL_DEBUG(printk("buz ioctl VIDIOCGUNIT\n"));
+ vu.video = zr->video_dev.minor;
+ vu.vbi = VIDEO_NO_UNIT;
+ vu.radio = VIDEO_NO_UNIT;
+ vu.audio = VIDEO_NO_UNIT;
+ vu.teletext = VIDEO_NO_UNIT;
+ if (copy_to_user(arg, &vu, sizeof(vu)))
+ return -EFAULT;


+ return 0;
+ }
+
+ /*

+ * RJ: In principal we could support subcaptures for V4L grabbing.
+ * Not even the famous BTTV driver has them, however.
+ * If there should be a strong demand, one could consider
+ * to implement them.
+ */
+ case VIDIOCGCAPTURE:
+ case VIDIOCSCAPTURE:
+ return -EINVAL;
+
+ case BUZIOC_G_PARAMS:
+ {
+ IOCTL_DEBUG(printk("buz ioctl BUZIOC_G_PARAMS\n"));
+ if (copy_to_user(arg, &(zr->params), sizeof(zr->params)))
+ return -EFAULT;


+ return 0;
+ }
+

+ case BUZIOC_S_PARAMS:
+ {
+ struct zoran_params bp;
+ int input, on;
+
+ if (zr->codec_mode != BUZ_MODE_IDLE) {
+ return -EINVAL;
+ }
+ if (copy_from_user(&bp, arg, sizeof(bp))) {
+ return -EFAULT;
+ }
+ IOCTL_DEBUG(printk("buz ioctl BUZIOC_S_PARAMS\n"));
+
+ /* Check the params first before overwriting our internal values */
+
+ if (zoran_check_params(zr, &bp))
+ return -EINVAL;
+
+ zr->params = bp;
+
+ /* Make changes of input and norm go into effect immediatly */
+
+ /* We switch overlay off and on since a change in the norm
+ needs different VFE settings */
+
+ on = zr->v4l_overlay_active && !zr->v4l_memgrab_active;
+ if (on)
+ zr36057_overlay(zr, 0);
+
+ input = zr->params.input == 0 ? 3 : 7;
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_SET_INPUT, &input);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_SET_NORM, &zr->params.norm);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEOENCODER, ENCODER_SET_NORM, &zr->params.norm);
+
+ if (on)
+ zr36057_overlay(zr, 1);
+
+ if (copy_to_user(arg, &bp, sizeof(bp))) {
+ return -EFAULT;


+ }
+ return 0;
+ }
+

+ case BUZIOC_REQBUFS:
+ {
+ struct zoran_requestbuffers br;
+
+ if (zr->jpg_buffers_allocated) {
+ return -EINVAL;
+ }
+ if (copy_from_user(&br, arg, sizeof(br))) {
+ return -EFAULT;
+ }
+ IOCTL_DEBUG(printk("buz ioctl BUZIOC_REQBUFS count = %lu size=%lu\n",
+ br.count, br.size));
+ /* Enforce reasonable lower and upper limits */
+ if (br.count < 4)
+ br.count = 4; /* Could be choosen smaller */
+ if (br.count > BUZ_MAX_FRAME)
+ br.count = BUZ_MAX_FRAME;
+ br.size = PAGE_ALIGN(br.size);
+ if (br.size < 8192)
+ br.size = 8192; /* Arbitrary */
+ /* br.size is limited by 1 page for the stat_com tables to a Maximum of 2 MB */
+ if (br.size > (512 * 1024))
+ br.size = (512 * 1024); /* 512 K should be enough */
+ if (zr->need_contiguous && br.size > MAX_KMALLOC_MEM)
+ br.size = MAX_KMALLOC_MEM;
+
+ zr->jpg_nbufs = br.count;
+ zr->jpg_bufsize = br.size;
+
+ if (jpg_fbuffer_alloc(zr))
+ return -ENOMEM;
+
+ /* The next mmap will map the MJPEG buffers */
+ zr->map_mjpeg_buffers = 1;
+
+ if (copy_to_user(arg, &br, sizeof(br))) {
+ return -EFAULT;


+ }
+ return 0;
+ }
+

+ case BUZIOC_QBUF_CAPT:
+ {
+ int nb;
+
+ if (copy_from_user((void *) &nb, (void *) arg, sizeof(int))) {
+ return -EFAULT;
+ }
+ IOCTL_DEBUG(printk("buz ioctl BUZIOC_QBUF_CAPT %d\n", nb));
+ return jpg_qbuf(zr, nb, BUZ_MODE_MOTION_COMPRESS);
+ }
+
+ case BUZIOC_QBUF_PLAY:
+ {
+ int nb;
+
+ if (copy_from_user((void *) &nb, (void *) arg, sizeof(int))) {
+ return -EFAULT;
+ }
+ IOCTL_DEBUG(printk("buz ioctl BUZIOC_QBUF_PLAY %d\n", nb));
+ return jpg_qbuf(zr, nb, BUZ_MODE_MOTION_DECOMPRESS);
+ }
+
+ case BUZIOC_SYNC:
+ {
+ struct zoran_sync bs;
+ int res;
+
+ IOCTL_DEBUG(printk("buz ioctl BUZIOC_SYNC\n"));
+ res = jpg_sync(zr, &bs);
+ if (copy_to_user(arg, &bs, sizeof(bs))) {
+ return -EFAULT;


+ }
+ return res;
+ }
+

+ case BUZIOC_G_STATUS:
+ {
+ struct zoran_status bs;
+ int norm, input, status;
+
+ if (zr->codec_mode != BUZ_MODE_IDLE) {
+ return -EINVAL;
+ }
+ if (copy_from_user(&bs, arg, sizeof(bs))) {
+ return -EFAULT;
+ }
+ IOCTL_DEBUG(printk("buz ioctl BUZIOC_G_STATUS\n"));
+ switch (bs.input) {
+ case 0:
+ input = 3;
+ break;
+ case 1:
+ input = 7;
+ break;
+ default:


+ return -EINVAL;
+ }
+

+ /* Set video norm to VIDEO_MODE_AUTO */
+
+ norm = VIDEO_MODE_AUTO;
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_SET_INPUT, &input);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_SET_NORM, &norm);
+
+ /* sleep 1 second */
+
+ schedule_timeout(HZ);
+
+ /* Get status of video decoder */
+
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_GET_STATUS, &status);
+ bs.signal = (status & DECODER_STATUS_GOOD) ? 1 : 0;
+ bs.norm = (status & DECODER_STATUS_NTSC) ? VIDEO_MODE_NTSC : VIDEO_MODE_PAL;
+ bs.color = (status & DECODER_STATUS_COLOR) ? 1 : 0;
+
+ /* restore previous input and norm */
+ input = zr->params.input == 0 ? 3 : 7;
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_SET_INPUT, &input);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_SET_NORM, &zr->params.norm);
+
+ if (copy_to_user(arg, &bs, sizeof(bs))) {
+ return -EFAULT;


+ }
+ return 0;
+ }
+

+ default:
+ return -ENOIOCTLCMD;


+
+ }
+ return 0;
+}
+

+
+/*
+ * This maps the buffers to user space.
+ *
+ * Depending on the state of zr->map_mjpeg_buffers
+ * the V4L or the MJPEG buffers are mapped


+ *
+ */
+

+static int zoran_mmap(struct video_device *dev, const char *adr, unsigned long size)
+{
+ struct zoran *zr = (struct zoran *) dev;
+ unsigned long start = (unsigned long) adr;
+ unsigned long page, pos, todo, fraglen;
+ int i, j;
+
+ if (zr->map_mjpeg_buffers) {
+ /* Map the MJPEG buffers */


+
+ if (!zr->jpg_buffers_allocated) {

+ return -ENOMEM;
+ }
+ if (size > zr->jpg_nbufs * zr->jpg_bufsize) {


+ return -EINVAL;
+ }
+

+ for (i = 0; i < zr->jpg_nbufs; i++) {

+ for (j = 0; j < zr->jpg_bufsize / PAGE_SIZE; j++) {

+ fraglen = (zr->jpg_gbuf[i].frag_tab[2 * j + 1] & ~1) << 1;
+ todo = size;
+ if (todo > fraglen)
+ todo = fraglen;
+ pos = (unsigned long) zr->jpg_gbuf[i].frag_tab[2 * j];
+ page = virt_to_phys(bus_to_virt(pos)); /* should just be pos on i386 */
+ if (remap_page_range(start, page, todo, PAGE_SHARED)) {
+ printk(KERN_ERR "%s: zoran_mmap(V4L): remap_page_range failed\n", zr->name);
+ return -EAGAIN;
+ }
+ size -= todo;
+ start += todo;
+ if (size == 0)
+ break;
+ if (zr->jpg_gbuf[i].frag_tab[2 * j + 1] & 1)
+ break; /* was last fragment */
+ }
+ if (size == 0)
+ break;
+ }
+ } else {
+ /* Map the V4L buffers */
+
+ if (size > v4l_nbufs * v4l_bufsize) {


+ return -EINVAL;
+ }
+

+ for (i = 0; i < v4l_nbufs; i++) {

+ todo = size;
+ if (todo > v4l_bufsize)
+ todo = v4l_bufsize;
+ page = zr->v4l_gbuf[i].fbuffer_phys;
+ DEBUG(printk("V4L remap page range %d 0x%x %d to 0x%x\n", i, page, todo, start));
+ if (remap_page_range(start, page, todo, PAGE_SHARED)) {
+ printk(KERN_ERR "%s: zoran_mmap(V4L): remap_page_range failed\n", zr->name);
+ return -EAGAIN;
+ }
+ size -= todo;
+ start += todo;
+ if (size == 0)
+ break;
+ }
+ }


+ return 0;
+}
+

+static int zoran_init_done(struct video_device *dev)


+{
+ return 0;
+}
+

+static struct video_device zoran_template =
+{
+ BUZ_NAME,
+ VID_TYPE_CAPTURE | VID_TYPE_OVERLAY | VID_TYPE_CLIPPING | VID_TYPE_FRAMERAM |
+ VID_TYPE_SCALES | VID_TYPE_SUBCAPTURE,
+ VID_HARDWARE_BT848, /* Not true, but the buz is not yet in the list */
+ zoran_open,
+ zoran_close,
+ zoran_read,
+ zoran_write,
+ NULL,
+ zoran_ioctl,
+ zoran_mmap,
+ zoran_init_done,
+ NULL,
+ 0,
+ 0
+};
+
+static int zr36057_init(int i)
+{
+ struct zoran *zr = &zoran[i];
+ unsigned long mem;
+ unsigned mem_needed;
+ int j;
+ int rev;
+
+ /* reset zr36057 */
+ btwrite(0, ZR36057_SPGPPCR);
+ mdelay(10);
+
+ /* default setup of all parameters which will persist beetween opens */
+
+ zr->user = 0;
+
+ init_waitqueue_head(&zr->v4l_capq);
+ init_waitqueue_head(&zr->jpg_capq);
+
+ zr->map_mjpeg_buffers = 0; /* Map V4L buffers by default */
+
+ zr->jpg_nbufs = 0;
+ zr->jpg_bufsize = 0;


+ zr->jpg_buffers_allocated = 0;
+

+ zr->buffer_set = 0; /* Flag if frame buffer has been set */
+ zr->buffer.base = (void *) vidmem;
+ zr->buffer.width = 0;
+ zr->buffer.height = 0;
+ zr->buffer.depth = 0;
+ zr->buffer.bytesperline = 0;
+
+ zr->params.norm = default_norm ? 1 : 0; /* Avoid nonsense settings from user */
+ zr->params.input = default_input ? 1 : 0; /* Avoid nonsense settings from user */


+ zr->video_interlace = 0;
+

+ /* Should the following be reset at every open ? */
+
+ zr->picture.colour = 32768;
+ zr->picture.brightness = 32768;
+ zr->picture.hue = 32768;
+ zr->picture.contrast = 32768;
+ zr->picture.whiteness = 0;
+ zr->picture.depth = 0;
+ zr->picture.palette = 0;
+
+ for (j = 0; j < VIDEO_MAX_FRAME; j++) {
+ zr->v4l_gbuf[i].fbuffer = 0;
+ zr->v4l_gbuf[i].fbuffer_phys = 0;
+ zr->v4l_gbuf[i].fbuffer_bus = 0;
+ }
+
+ zr->stat_com = 0;
+
+ /* default setup (will be repeated at every open) */
+
+ zoran_open_init_params(zr);
+
+ /* allocate memory *before* doing anything to the hardware in case allocation fails */
+
+ /* STAT_COM table and overlay mask */
+
+ mem_needed = (BUZ_NUM_STAT_COM + ((BUZ_MAX_WIDTH + 31) / 32) * BUZ_MAX_HEIGHT) * 4;
+ mem = (unsigned long) kmalloc(mem_needed, GFP_KERNEL);
+ if (!mem) {
+ return -ENOMEM;
+ }
+ memset((void *) mem, 0, mem_needed);
+
+ zr->stat_com = (u32 *) mem;
+ for (j = 0; j < BUZ_NUM_STAT_COM; j++) {
+ zr->stat_com[j] = 1; /* mark as unavailable to zr36057 */
+ }
+ zr->overlay_mask = (u32 *) (mem + BUZ_NUM_STAT_COM * 4);
+
+ /* Initialize zr->jpg_gbuf */
+
+ for (j = 0; j < BUZ_MAX_FRAME; j++) {
+ zr->jpg_gbuf[j].frag_tab = 0;
+ zr->jpg_gbuf[j].frag_tab_bus = 0;
+ zr->jpg_gbuf[j].state = BUZ_STATE_USER;
+ zr->jpg_gbuf[j].bs.frame = j;
+ }
+
+ /* take zr36057 out of reset now */
+ btwrite(ZR36057_SPGPPCR_SoftReset, ZR36057_SPGPPCR);
+ mdelay(10);
+
+ /* stop all DMA processes */
+ btwrite(ZR36057_MCTCR_CFlush, ZR36057_MCTCR);
+ btand(~ZR36057_VDCR_VidEn, ZR36057_VDCR);


+ /* assert P_Reset */
+ btwrite(0, ZR36057_JPC);
+

+ switch(zr->board)
+ {
+ case BOARD_BUZ:
+
+ /* set up GPIO direction */
+ btwrite(ZR36057_SPGPPCR_SoftReset | 0, ZR36057_SPGPPCR);
+
+ /* Set up guest bus timing - Guests 0..3 Tdur=12, Trec=3 */
+ btwrite((GPIO_MASK << 24) | 0x8888, ZR36057_GPPGCR1);
+ mdelay(10);
+
+ /* reset video decoder */
+
+ GPIO(zr, 0, 0);
+ mdelay(10);
+ GPIO(zr, 0, 1);
+ mdelay(10);
+
+ /* reset JPEG codec */
+ zr36060_sleep(zr, 0);
+ mdelay(10);
+ zr36060_reset(zr);
+ mdelay(10);
+ zr36060_sleep(zr, 1);
+ mdelay(10);
+
+ /* display codec revision */
+ if ((rev=zr36060_read_8(zr, 0x022)) == 0x33) {
+ printk(KERN_INFO "%s: Zoran ZR36060 (rev %d)\n",
+ zr->name, zr36060_read_8(zr, 0x023));
+ } else {
+ printk(KERN_ERR "%s: Zoran ZR36060 not found (Rev=%d)\n", zr->name, rev);
+ kfree((void *) zr->stat_com);
+ return -1;
+ }
+ break;
+
+ case BOARD_LML33:
+// btwrite(btread(ZR36057_SPGPPCR)&~ZR36057_SPGPPCR_SoftReset , ZR36057_SPGPPCR);
+// udelay(100);
+// btwrite(btread(ZR36057_SPGPPCR)|ZR36057_SPGPPCR_SoftReset , ZR36057_SPGPPCR);
+// udelay(1000);
+
+ /*
+ * Set up the GPIO direction
+ */
+ btwrite(btread(ZR36057_SPGPPCR_SoftReset)|0 , ZR36057_SPGPPCR);
+ /* Set up guest bus timing - Guests 0..2 Tdur=12, Trec=3 */
+ btwrite(0xFF00F888, ZR36057_GPPGCR1);
+ mdelay(10);
+ GPIO(zr, 5, 0); /* Analog video bypass */
+ udelay(3000);
+ GPIO(zr, 0, 0); /* Reset 819 */
+ udelay(3000);
+ GPIO(zr, 0, 1); /* 819 back */
+ udelay(3000);
+ /* reset JPEG codec */
+ zr36060_sleep(zr, 0);
+ udelay(3000);
+ zr36060_reset(zr);
+ udelay(3000);
+ zr36060_sleep(zr, 1);
+ udelay(3000);
+
+ /* display codec revision */
+ if ((rev=zr36060_read_8(zr, 0x022)) == 0x33) {
+ printk(KERN_INFO "%s: Zoran ZR36060 (rev %d)\n",
+ zr->name, zr36060_read_8(zr, 0x023));
+ } else {
+ printk(KERN_ERR "%s: Zoran ZR36060 not found (rev=%d)\n", zr->name, rev);
+// kfree((void *) zr->stat_com);
+// return -1;
+ }
+ break;
+ }
+ /* i2c */
+ memcpy(&zr->i2c, &zoran_i2c_bus_template, sizeof(struct i2c_bus));
+ sprintf(zr->i2c.name, "zoran%u%u", zr->id);
+ zr->i2c.data = zr;
+ if (i2c_register_bus(&zr->i2c) < 0) {
+ kfree((void *) zr->stat_com);


+ return -1;
+ }
+ /*

+ * Now add the template and register the device unit.
+ */
+ memcpy(&zr->video_dev, &zoran_template, sizeof(zoran_template));
+ sprintf(zr->video_dev.name, "zoran%u", zr->id);
+ if (video_register_device(&zr->video_dev, VFL_TYPE_GRABBER) < 0) {
+ i2c_unregister_bus(&zr->i2c);
+ kfree((void *) zr->stat_com);
+ return -1;
+ }
+ /* toggle JPEG codec sleep to sync PLL */
+ zr36060_sleep(zr, 1);
+ mdelay(10);
+ zr36060_sleep(zr, 0);
+ mdelay(10);
+
+ /* Enable bus-mastering */
+ pci_set_master(zr->pci_dev);
+
+ j = zr->params.input == 0 ? 3 : 7;
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_SET_INPUT, &j);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_SET_NORM, &zr->params.norm);
+ i2c_control_device(&zr->i2c, I2C_DRIVERID_VIDEOENCODER, ENCODER_SET_NORM, &zr->params.norm);
+
+ /* set individual interrupt enables (without GIRQ0)
+ but don't global enable until zoran_open() */
+
+ btwrite(IRQ_MASK & ~ZR36057_ISR_GIRQ0, ZR36057_ICR);
+
+ if(request_irq(zr->pci_dev->irq, zoran_irq,
+ SA_SHIRQ | SA_INTERRUPT, zr->name, (void *) zr)<0)
+ {
+ printk(KERN_ERR "%s: Can't assign irq.\n", zr->name);
+ video_unregister_device(&zr->video_dev);
+ i2c_unregister_bus(&zr->i2c);
+ kfree((void *) zr->stat_com);
+ return -1;
+ }
+ zr->initialized = 1;


+ return 0;
+}
+
+

+
+static void release_zoran(void)
+{
+ u8 command;
+ int i;


+ struct zoran *zr;
+

+ for (i = 0; i < zoran_num; i++) {
+ zr = &zoran[i];
+
+ if (!zr->initialized)
+ continue;
+
+ /* unregister i2c_bus */
+ i2c_unregister_bus((&zr->i2c));
+
+ /* disable PCI bus-mastering */
+ pci_read_config_byte(zr->pci_dev, PCI_COMMAND, &command);
+ command &= ~PCI_COMMAND_MASTER;
+ pci_write_config_byte(zr->pci_dev, PCI_COMMAND, command);
+
+ /* put chip into reset */
+ btwrite(0, ZR36057_SPGPPCR);
+
+ free_irq(zr->pci_dev->irq, zr);
+
+ /* unmap and free memory */
+
+ kfree((void *) zr->stat_com);
+
+ iounmap(zr->zr36057_mem);
+
+ video_unregister_device(&zr->video_dev);
+ }
+}
+
+/*
+ * Scan for a Buz card (actually for the PCI controller ZR36057),
+ * request the irq and map the io memory
+ */
+
+static int find_zr36057(void)
+{
+ unsigned char latency;
+ struct zoran *zr;
+ struct pci_dev *dev = NULL;
+
+ zoran_num = 0;
+
+ while (zoran_num < BUZ_MAX
+ && (dev = pci_find_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
+ zr = &zoran[zoran_num];
+ zr->pci_dev = dev;
+ zr->zr36057_mem = NULL;
+ zr->id = zoran_num;
+ sprintf(zr->name, "zoran%u", zr->id);
+
+ spin_lock_init(&zr->lock);
+
+ zr->zr36057_adr = zr->pci_dev->base_address[0] & PCI_BASE_ADDRESS_MEM_MASK;
+ pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION, &zr->revision);
+ if (zr->revision < 2) {
+ printk(KERN_INFO "%s: Zoran ZR36057 (rev %d) irq: %d, memory: 0x%08x.\n",
+ zr->name, zr->revision, zr->pci_dev->irq, zr->zr36057_adr);
+ } else {
+ unsigned short ss_vendor_id, ss_id;
+
+ pci_read_config_word(zr->pci_dev, PCI_SUBSYSTEM_VENDOR_ID, &ss_vendor_id);
+ pci_read_config_word(zr->pci_dev, PCI_SUBSYSTEM_ID, &ss_id);
+ printk(KERN_INFO "%s: Zoran ZR36067 (rev %d) irq: %d, memory: 0x%08x\n",
+ zr->name, zr->revision, zr->pci_dev->irq, zr->zr36057_adr);
+ printk(KERN_INFO "%s: subsystem vendor=0x%04x id=0x%04x\n",
+ zr->name, ss_vendor_id, ss_id);
+ if(ss_vendor_id==0xFF10 && ss_id == 0xDE41)
+ {
+ zr->board = BOARD_LML33;
+ printk(KERN_INFO "%s: LML33 detected.\n", zr->name);
+ }
+ }
+
+ zr->zr36057_mem = ioremap(zr->zr36057_adr, 0x1000);
+
+ /* set PCI latency timer */
+ pci_read_config_byte(zr->pci_dev, PCI_LATENCY_TIMER, &latency);
+ if (latency != 48) {
+ printk(KERN_INFO "%s: Changing PCI latency from %d to 48.\n", zr->name, latency);
+ latency = 48;
+ pci_write_config_byte(zr->pci_dev, PCI_LATENCY_TIMER, latency);
+ }
+ zoran_num++;
+ }
+ if (zoran_num == 0)
+ printk(KERN_INFO "zoran: no cards found.\n");
+
+ return zoran_num;
+}
+
+#include "chipsets.h"
+
+static void handle_chipset(void)
+{
+ int index;
+ struct pci_dev *dev = NULL;
+
+ for (index = 0; index < sizeof(black) / sizeof(black[0]); index++) {
+ if ((dev = pci_find_device(black[index].vendor, black[index].device, dev)) != NULL) {
+ printk(KERN_INFO ": Host bridge: %s, ", black[index].name);
+ switch (black[index].action) {
+
+ case TRITON:
+ printk("enabling Triton support.\n");
+ triton = 1;
+ break;
+
+ case NATOMA:
+ printk("enabling Natoma workaround.\n");
+ natoma = 1;


+ break;
+ }
+ }
+ }
+}

+
+#ifdef MODULE
+int init_module(void)
+#else
+int init_zoran_cards(struct video_init *unused)
+#endif


+{
+ int i;
+
+

+ printk(KERN_INFO "Zoran driver 1.00 (c) 1999 Rainer Johanni, Dave Perks.\n");
+
+ /* Look for Buz cards */
+
+ if (find_zr36057() <= 0) {
+ return -EIO;
+ }
+ printk(KERN_INFO"zoran: %d zoran card(s) found\n", zoran_num);
+
+ if (zoran_num == 0)
+ return -ENXIO;
+
+
+ /* check the parameters we have been given, adjust if necessary */
+
+ if (v4l_nbufs < 0)
+ v4l_nbufs = 0;
+ if (v4l_nbufs > VIDEO_MAX_FRAME)
+ v4l_nbufs = VIDEO_MAX_FRAME;
+ /* The user specfies the in KB, we want them in byte (and page aligned) */
+ v4l_bufsize = PAGE_ALIGN(v4l_bufsize * 1024);
+ if (v4l_bufsize < 32768)
+ v4l_bufsize = 32768;
+ /* 2 MB is arbitrary but sufficient for the maximum possible images */
+ if (v4l_bufsize > 2048 * 1024)
+ v4l_bufsize = 2048 * 1024;
+
+ printk(KERN_INFO "zoran: using %d V4L buffers of size %d KB\n", v4l_nbufs, v4l_bufsize >> 10);
+
+ /* Use parameter for vidmem or try to find a video card */
+
+ if (vidmem) {
+ printk(KERN_INFO "zoran: Using supplied video memory base address @ 0x%lx\n", vidmem);
+ }
+
+ /* check if we have a Triton or Natome chipset */
+
+ handle_chipset();
+
+ /* take care of Natoma chipset and a revision 1 zr36057 */
+
+ for (i = 0; i < zoran_num; i++) {
+ if (natoma && zoran[i].revision <= 1) {
+ zoran[i].need_contiguous = 1;
+ printk(KERN_INFO "%s: ZR36057/Natome bug, max. buffer size is 128K\n", zoran[i].name);
+ } else {
+ zoran[i].need_contiguous = 0;
+ }
+ }
+
+ /* initialize the Buzs */
+
+ /* We have to know which ones must be released if an error occurs */
+ for (i = 0; i < zoran_num; i++)
+ zoran[i].initialized = 0;
+
+ for (i = 0; i < zoran_num; i++) {
+ if (zr36057_init(i) < 0) {
+ release_zoran();
+ return -EIO;


+ }
+ }
+
+ return 0;
+}
+
+

+
+#ifdef MODULE
+
+void cleanup_module(void)
+{
+ release_zoran();
+}
+
+#endif
diff -u --recursive --new-file v2.3.9/linux/drivers/char/buz.h linux/drivers/char/buz.h
--- v2.3.9/linux/drivers/char/buz.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/buz.h Mon Jul 5 20:07:02 1999
@@ -0,0 +1,319 @@


+/*
+ buz - Iomega Buz driver

+
+ Copyright (C) 1999 Rainer Johanni <Rai...@Johanni.de>
+
+ based on
+
+ buz.0.0.3 Copyright (C) 1998 Dave Perks <dpe...@ibm.net>
+
+ and
+
+ bttv - Bt848 frame grabber driver

+ Copyright (C) 1996,97 Ralph Metzler (rj...@thp.uni-koeln.de)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+


+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef _BUZ_H_
+#define _BUZ_H_
+
+/* The Buz only supports a maximum width of 720, but some V4L
+ applications (e.g. xawtv are more happy with 768).
+ If XAWTV_HACK is defined, we try to fake a device with bigger width */
+
+#define XAWTV_HACK
+
+#ifdef XAWTV_HACK
+#define BUZ_MAX_WIDTH 768 /* never display more than 768 pixels */
+#else
+#define BUZ_MAX_WIDTH 720 /* never display more than 720 pixels */
+#endif
+#define BUZ_MAX_HEIGHT 576 /* never display more than 576 rows */
+#define BUZ_MIN_WIDTH 32 /* never display less than 32 pixels */
+#define BUZ_MIN_HEIGHT 24 /* never display less than 24 rows */
+
+struct zoran_requestbuffers {
+ unsigned long count; /* Number of buffers for MJPEG grabbing */
+ unsigned long size; /* Size PER BUFFER in bytes */
+};
+
+struct zoran_sync {
+ unsigned long frame; /* number of buffer that has been free'd */
+ unsigned long length; /* number of code bytes in buffer (capture only) */
+ unsigned long seq; /* frame sequence number */
+ struct timeval timestamp; /* timestamp */
+};
+
+struct zoran_status {
+ int input; /* Input channel, has to be set prior to BUZIOC_G_STATUS */
+ int signal; /* Returned: 1 if valid video signal detected */
+ int norm; /* Returned: VIDEO_MODE_PAL or VIDEO_MODE_NTSC */
+ int color; /* Returned: 1 if color signal detected */
+};
+
+struct zoran_params {
+
+ /* The following parameters can only be queried */
+
+ int major_version; /* Major version number of driver */
+ int minor_version; /* Minor version number of driver */
+
+ /* Main control parameters */
+
+ int input; /* Input channel: 0 = Composite, 1 = S-VHS */
+ int norm; /* Norm: VIDEO_MODE_PAL or VIDEO_MODE_NTSC */
+ int decimation; /* decimation of captured video,
+ enlargement of video played back.
+ Valid values are 1, 2, 4 or 0.
+ 0 is a special value where the user
+ has full control over video scaling */
+
+ /* The following parameters only have to be set if decimation==0,
+ for other values of decimation they provide the data how the image is captured */
+
+ int HorDcm; /* Horizontal decimation: 1, 2 or 4 */
+ int VerDcm; /* Vertical decimation: 1 or 2 */
+ int TmpDcm; /* Temporal decimation: 1 or 2,
+ if TmpDcm==2 in capture every second frame is dropped,
+ in playback every frame is played twice */
+ int field_per_buff; /* Number of fields per buffer: 1 or 2 */
+ int img_x; /* start of image in x direction */
+ int img_y; /* start of image in y direction */
+ int img_width; /* image width BEFORE decimation,
+ must be a multiple of HorDcm*16 */
+ int img_height; /* image height BEFORE decimation,
+ must be a multiple of VerDcm*8 */
+
+ /* --- End of parameters for decimation==0 only --- */
+
+ /* JPEG control parameters */
+
+ int quality; /* Measure for quality of compressed images.
+ Scales linearly with the size of the compressed images.
+ Must be beetween 0 and 100, 100 is a compression
+ ratio of 1:4 */
+
+ int odd_even; /* Which field should come first ??? */
+
+ int APPn; /* Number of APP segment to be written, must be 0..15 */
+ int APP_len; /* Length of data in JPEG APPn segment */
+ char APP_data[60]; /* Data in the JPEG APPn segment. */
+
+ int COM_len; /* Length of data in JPEG COM segment */
+ char COM_data[60]; /* Data in JPEG COM segment */
+
+ unsigned long jpeg_markers; /* Which markers should go into the JPEG output.
+ Unless you exactly know what you do, leave them untouched.
+ Inluding less markers will make the resulting code
+ smaller, but there will be fewer aplications
+ which can read it.
+ The presence of the APP and COM marker is
+ influenced by APP0_len and COM_len ONLY! */
+#define JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
+#define JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
+#define JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
+#define JPEG_MARKER_COM (1<<6) /* Comment segment */
+#define JPEG_MARKER_APP (1<<7) /* App segment, driver will allways use APP0 */
+
+ int VFIFO_FB; /* Flag for enabling Video Fifo Feedback.
+ If this flag is turned on and JPEG decompressing
+ is going to the screen, the decompress process
+ is stopped every time the Video Fifo is full.
+ This enables a smooth decompress to the screen
+ but the video output signal will get scrambled */
+
+ /* Misc */
+
+ char reserved[312]; /* Makes 512 bytes for this structure */
+};
+
+/*
+ Private IOCTL to set up for displaying MJPEG
+ */
+#define BUZIOC_G_PARAMS _IOR ('v', BASE_VIDIOCPRIVATE+0, struct zoran_params)
+#define BUZIOC_S_PARAMS _IOWR('v', BASE_VIDIOCPRIVATE+1, struct zoran_params)
+#define BUZIOC_REQBUFS _IOWR('v', BASE_VIDIOCPRIVATE+2, struct zoran_requestbuffers)
+#define BUZIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOCPRIVATE+3, int)
+#define BUZIOC_QBUF_PLAY _IOW ('v', BASE_VIDIOCPRIVATE+4, int)
+#define BUZIOC_SYNC _IOR ('v', BASE_VIDIOCPRIVATE+5, struct zoran_sync)
+#define BUZIOC_G_STATUS _IOWR('v', BASE_VIDIOCPRIVATE+6, struct zoran_status)
+
+
+#ifdef __KERNEL__
+
+#define BUZ_NUM_STAT_COM 4
+#define BUZ_MASK_STAT_COM 3
+
+#define BUZ_MAX_FRAME 256 /* Must be a power of 2 */
+#define BUZ_MASK_FRAME 255 /* Must be BUZ_MAX_FRAME-1 */
+
+#if VIDEO_MAX_FRAME <= 32
+#define V4L_MAX_FRAME 32
+#elif VIDEO_MAX_FRAME <= 64
+#define V4L_MAX_FRAME 64
+#else
+#error "Too many video frame buffers to handle"
+#endif
+#define V4L_MASK_FRAME (V4L_MAX_FRAME - 1)
+
+
+#include "zr36057.h"
+
+enum zoran_codec_mode {
+ BUZ_MODE_IDLE, /* nothing going on */
+ BUZ_MODE_MOTION_COMPRESS, /* grabbing frames */
+ BUZ_MODE_MOTION_DECOMPRESS, /* playing frames */
+ BUZ_MODE_STILL_COMPRESS, /* still frame conversion */
+ BUZ_MODE_STILL_DECOMPRESS /* still frame conversion */
+};
+
+enum zoran_buffer_state {
+ BUZ_STATE_USER, /* buffer is owned by application */
+ BUZ_STATE_PEND, /* buffer is queued in pend[] ready to feed to I/O */
+ BUZ_STATE_DMA, /* buffer is queued in dma[] for I/O */
+ BUZ_STATE_DONE /* buffer is ready to return to application */
+};
+
+struct zoran_gbuffer {
+ u32 *frag_tab; /* addresses of frag table */
+ u32 frag_tab_bus; /* same value cached to save time in ISR */
+ enum zoran_buffer_state state; /* non-zero if corresponding buffer is in use in grab queue */
+ struct zoran_sync bs; /* DONE: info to return to application */
+};
+
+struct v4l_gbuffer {
+ char *fbuffer; /* virtual address of frame buffer */
+ unsigned long fbuffer_phys; /* physical address of frame buffer */
+ unsigned long fbuffer_bus; /* bus address of frame buffer */
+ enum zoran_buffer_state state; /* state: unused/pending/done */
+};
+
+struct zoran {
+ struct video_device video_dev;
+ struct i2c_bus i2c;
+
+ int initialized; /* flag if zoran has been correctly initalized */
+ int user; /* number of current users (0 or 1) */
+
+ unsigned short id; /* number of this device */
+ char name[32]; /* name of this device */
+ struct pci_dev *pci_dev; /* PCI device */
+ unsigned char revision; /* revision of zr36057 */
+ int board; /* Board type */
+#define BOARD_BUZ 0
+#define BOARD_LML33 1
+ unsigned int zr36057_adr; /* bus address of IO mem returned by PCI BIOS */
+ unsigned char *zr36057_mem; /* pointer to mapped IO memory */
+
+ int map_mjpeg_buffers; /* Flag which bufferset will map by next mmap() */
+
+ spinlock_t lock; /* Spinlock */
+
+ /* Video for Linux parameters */
+
+ struct video_picture picture; /* Current picture params */
+ struct video_buffer buffer; /* Current buffer params */
+ struct video_window window; /* Current window params */
+ int buffer_set, window_set; /* Flags if the above structures are set */
+ int video_interlace; /* Image on screen is interlaced */
+
+ u32 *overlay_mask;
+
+ wait_queue_head_t v4l_capq; /* wait here for grab to finish */
+
+ int v4l_overlay_active; /* Overlay grab is activated */
+ int v4l_memgrab_active; /* Memory grab is activated */
+
+ int v4l_grab_frame; /* Frame number being currently grabbed */
+#define NO_GRAB_ACTIVE (-1)
+ int v4l_grab_seq; /* Number of frames grabbed */
+ int gwidth; /* Width of current memory capture */
+ int gheight; /* Height of current memory capture */
+ int gformat; /* Format of ... */
+ int gbpl; /* byte per line of ... */
+
+ /* V4L grab queue of frames pending */
+
+ unsigned v4l_pend_head;
+ unsigned v4l_pend_tail;
+ int v4l_pend[V4L_MAX_FRAME];
+
+ struct v4l_gbuffer v4l_gbuf[VIDEO_MAX_FRAME]; /* V4L buffers' info */
+
+ /* Buz MJPEG parameters */
+
+ unsigned long jpg_nbufs; /* Number of buffers */
+ unsigned long jpg_bufsize; /* Size of mjpeg buffers in bytes */
+ int jpg_buffers_allocated; /* Flag if buffers are allocated */
+ int need_contiguous; /* Flag if contiguous buffers are needed */
+
+ enum zoran_codec_mode codec_mode; /* status of codec */
+ struct zoran_params params; /* structure with a lot of things to play with */
+
+ wait_queue_head_t jpg_capq; /* wait here for grab to finish */
+
+ /* grab queue counts/indices, mask with BUZ_MASK_STAT_COM before using as index */
+ /* (dma_head - dma_tail) is number active in DMA, must be <= BUZ_NUM_STAT_COM */
+ /* (value & BUZ_MASK_STAT_COM) corresponds to index in stat_com table */
+ unsigned long jpg_que_head; /* Index where to put next buffer which is queued */
+ unsigned long jpg_dma_head; /* Index of next buffer which goes into stat_com */
+ unsigned long jpg_dma_tail; /* Index of last buffer in stat_com */
+ unsigned long jpg_que_tail; /* Index of last buffer in queue */
+ unsigned long jpg_seq_num; /* count of frames since grab/play started */
+
+ /* zr36057's code buffer table */
+ u32 *stat_com; /* stat_com[i] is indexed by dma_head/tail & BUZ_MASK_STAT_COM */
+
+ /* (value & BUZ_MASK_FRAME) corresponds to index in pend[] queue */
+ int jpg_pend[BUZ_MAX_FRAME];
+
+ /* array indexed by frame number */
+ struct zoran_gbuffer jpg_gbuf[BUZ_MAX_FRAME]; /* MJPEG buffers' info */
+};
+
+#endif
+
+/*The following should be done in more portable way. It depends on define
+ of _ALPHA_BUZ in the Makefile. */
+
+#ifdef _ALPHA_BUZ
+#define btwrite(dat,adr) writel((dat),(char *) (zr->zr36057_adr+(adr)))
+#define btread(adr) readl(zr->zr36057_adr+(adr))
+#else
+#define btwrite(dat,adr) writel((dat), (char *) (zr->zr36057_mem+(adr)))
+#define btread(adr) readl(zr->zr36057_mem+(adr))
+#endif
+
+#define btand(dat,adr) btwrite((dat) & btread(adr), adr)
+#define btor(dat,adr) btwrite((dat) | btread(adr), adr)
+#define btaor(dat,mask,adr) btwrite((dat) | ((mask) & btread(adr)), adr)
+
+#define I2C_TSA5522 0xc2
+#define I2C_TDA9850 0xb6
+#define I2C_HAUPEE 0xa0
+#define I2C_STBEE 0xae
+#define I2C_SAA7111 0x48
+#define I2C_SAA7185 0x88
+
+#define TDA9850_CON1 0x04
+#define TDA9850_CON2 0x05
+#define TDA9850_CON3 0x06
+#define TDA9850_CON4 0x07
+#define TDA9850_ALI1 0x08
+#define TDA9850_ALI2 0x09
+#define TDA9850_ALI3 0x0a
+
+#endif
diff -u --recursive --new-file v2.3.9/linux/drivers/char/bw-qcam.c linux/drivers/char/bw-qcam.c
--- v2.3.9/linux/drivers/char/bw-qcam.c Fri Mar 26 13:57:41 1999
+++ linux/drivers/char/bw-qcam.c Mon Jul 5 20:07:02 1999
@@ -159,6 +159,8 @@
X struct qcam_device *q;
X
X q = kmalloc(sizeof(struct qcam_device), GFP_KERNEL);
+ if(q==NULL)
+ return NULL;
X
X q->pport = port;
X q->pdev = parport_register_device(port, "bw-qcam", NULL, NULL,
@@ -1045,7 +1047,7 @@
X close_bwqcam(qcams[i]);
X }
X #else
-__initfunc(int init_bw_qcams(struct video_init *unused))
+int __init init_bw_qcams(struct video_init *unused)
X {
X struct parport *port;
X
diff -u --recursive --new-file v2.3.9/linux/drivers/char/c-qcam.c linux/drivers/char/c-qcam.c
--- v2.3.9/linux/drivers/char/c-qcam.c Wed Dec 16 12:53:13 1998
+++ linux/drivers/char/c-qcam.c Mon Jul 5 20:07:02 1999
@@ -1,6 +1,6 @@
X /*
X * Video4Linux Colour QuickCam driver
- * Copyright 1997-1998 Philip Blundell <ph...@gnu.org>
+ * Copyright 1997-1999 Philip Blundell <ph...@gnu.org>


X *
X */
X

@@ -294,7 +294,7 @@
X if (is_bi_dir)
X {
X /* Turn the port around */
- parport_frob_control(q->pport, 0x20, 0x20);
+ parport_data_reverse(q->pport);
X mdelay(3);
X qcam_set_ack(q, 0);
X if (qcam_await_ready1(q, 1)) {
@@ -336,7 +336,7 @@
X {
X printk("qcam: short read.\n");
X if (is_bi_dir)
- parport_frob_control(q->pport, 0x20, 0);
+ parport_data_forward(q->pport);
X qc_setup(q);
X return len;
X }
@@ -355,11 +355,11 @@
X if (qcam_await_ready1(q, 1))
X {
X printk("qcam: no ack after EOF\n");
- parport_frob_control(q->pport, 0x20, 0);
+ parport_data_forward(q->pport);
X qc_setup(q);
X return len;
X }
- parport_frob_control(q->pport, 0x20, 0);
+ parport_data_forward(q->pport);
X mdelay(3);
X qcam_set_ack(q, 1);
X if (qcam_await_ready1(q, 0))
@@ -641,12 +641,14 @@
X struct qcam_device *q;
X
X q = kmalloc(sizeof(struct qcam_device), GFP_KERNEL);
+ if(q==NULL)
+ return NULL;
X
X q->pport = port;
X q->pdev = parport_register_device(port, "c-qcam", NULL, NULL,
X NULL, 0, NULL);
X
- q->bidirectional = (q->pport->modes & PARPORT_MODE_PCPS2)?1:0;
+ q->bidirectional = (q->pport->modes & PARPORT_MODE_TRISTATE)?1:0;
X
X if (q->pdev == NULL)
X {
@@ -678,10 +680,7 @@
X struct qcam_device *qcam;
X
X if (num_cams == MAX_CAMS)
- {
- printk(KERN_ERR "Too many Quickcams (max %d)\n", MAX_CAMS);
X return -ENOSPC;
- }
X
X qcam = qcam_init(port);
X if (qcam==NULL)
@@ -725,19 +724,40 @@
X kfree(qcam);
X }
X
-#define BANNER "Connectix Colour Quickcam driver v0.02\n"
+#define BANNER "Connectix Colour Quickcam driver v0.03"
X
-#ifdef MODULE
-int init_module(void)
+static void cq_attach(struct parport *port)
+{
+ init_cqcam(port);
+}
+
+static void cq_detach(struct parport *port)
+{
+ /* Write this some day. */
+}
+
+static struct parport_driver cqcam_driver = {
+ "cqcam",
+ cq_attach,
+ cq_detach,
+ NULL
+};
+
+static void cqcam_init(void)
X {
- struct parport *port;
+ printk(BANNER "\n");
+ parport_register_driver(&cqcam_driver);
+}
X
- printk(BANNER);
+#ifdef MODULE
X
- for (port = parport_enumerate(); port; port=port->next)
- init_cqcam(port);
+MODULE_AUTHOR("Philip Blundell <ph...@gnu.org>");
+MODULE_DESCRIPTION(BANNER);
X
- return (num_cams)?0:-ENODEV;
+int init_module(void)
+{
+ cqcam_init();
+ return 0;
X }
X
X void cleanup_module(void)
@@ -747,14 +767,9 @@
X close_cqcam(qcams[i]);
X }
X #else
-__initfunc(int init_colour_qcams(struct video_init *unused))
+int __init init_colour_qcams(struct video_init *unused)
X {
- struct parport *port;
-
- printk(BANNER);
-
- for (port = parport_enumerate(); port; port=port->next)
- init_cqcam(port);
+ cqcam_init();
X return 0;
X }
X #endif
diff -u --recursive --new-file v2.3.9/linux/drivers/char/chipsets.h linux/drivers/char/chipsets.h
--- v2.3.9/linux/drivers/char/chipsets.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/char/chipsets.h Mon Jul 5 20:07:02 1999
@@ -0,0 +1,41 @@
+static const struct {
+ unsigned short vendor;
+ unsigned short device;
+ enum {
+ TRITON,
+ NATOMA
+ } action;
+ const char *name;
+} black[] = {
+
+ {
+ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437, TRITON, "82437"
+ },
+ {
+ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437VX, TRITON, "82437VX Triton II"
+ },
+ {
+ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82439, TRITON, "82439HX Triton II"
+ },
+ {
+ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82439TX, TRITON, "82439TX"
+ },
+ {
+ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, NATOMA, "82441FX Natoma"
+ },
+ {
+ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443LX_0, NATOMA, "440LX - 82443LX PAC Host"
+ },
+ {
+ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443LX_1, NATOMA, "440LX - 82443LX PAC AGP"
+ },
+ {
+ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_0, NATOMA, "440BX - 82443BX Host"
+ },
+ {
+ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_1, NATOMA, "440BX - 82443BX AGP"
+ },
+ {
+ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_2, NATOMA, "440BX - 82443BX Host (no AGP)"
+ },
+};
diff -u --recursive --new-file v2.3.9/linux/drivers/char/console.c linux/drivers/char/console.c
--- v2.3.9/linux/drivers/char/console.c Tue May 11 14:37:40 1999
+++ linux/drivers/char/console.c Tue Jul 6 19:16:55 1999
@@ -2282,7 +2282,7 @@
X struct tty_driver console_driver;
X static int console_refcount;
X
-__initfunc(unsigned long con_init(unsigned long kmem_start))
+unsigned long __init con_init(unsigned long kmem_start)
X {
X const char *display_desc = NULL;
X unsigned int currcons = 0;
diff -u --recursive --new-file v2.3.9/linux/drivers/char/consolemap.c linux/drivers/char/consolemap.c
--- v2.3.9/linux/drivers/char/consolemap.c Tue Dec 29 14:28:37 1998
+++ linux/drivers/char/consolemap.c Tue Jul 6 19:16:55 1999
@@ -671,8 +671,8 @@
X * initialized. It must be possible to call kmalloc(..., GFP_KERNEL)
X * from this function, hence the call from sys_setup.
X */
-__initfunc(void
-console_map_init(void))
+void __init
+console_map_init(void)


X {
X int i;
X

diff -u --recursive --new-file v2.3.9/linux/drivers/char/cyclades.c linux/drivers/char/cyclades.c
--- v2.3.9/linux/drivers/char/cyclades.c Mon May 24 22:38:07 1999
+++ linux/drivers/char/cyclades.c Tue Jul 6 19:05:48 1999
@@ -1,7 +1,7 @@
X #define BLOCKMOVE
X #define Z_WAKE
X static char rcsid[] =
-"$Revision: 2.2.2.2 $$Date: 1999/05/21 17:18:15 $";
+"$Revision: 2.2.2.3 $$Date: 1999/06/28 11:13:29 $";
X
X /*
X * linux/drivers/char/cyclades.c
@@ -31,6 +31,16 @@
X * void cleanup_module(void);
X *
X * $Log: cyclades.c,v $
+ * Revision 2.2.2.3 1999/06/28 11:13:29 ivan
+ * Added support for interrupt mode operation for the Z cards;
+ * Removed the driver inactivity control for the Z;
+ * Added a missing MOD_DEC_USE_COUNT in the cy_open function for when
+ * the Z firmware is not loaded yet;
+ * Replaced the "manual" Z Tx flush buffer by a call to a FW command of
+ * same functionality;
+ * Implemented workaround for IRQ setting loss on the PCI configuration
+ * registers after a PCI bridge EEPROM reload (affects PLX9060 only);
+ *
X * Revision 2.2.2.2 1999/05/14 17:18:15 ivan
X * /proc entry location changed to /proc/tty/driver/cyclades;
X * Added support to shared IRQ's (only for PCI boards);
@@ -528,7 +538,7 @@
X constant in the definition below. No other change is necessary to
X support more boards/ports. */
X
-#define NR_PORTS 128
+#define NR_PORTS 256
X
X #define ZE_V1_NPORTS 64
X #define ZO_V1 0
@@ -810,13 +820,15 @@
X #ifndef CONFIG_COBALT_27
X static void cy_probe(int, void *, struct pt_regs *);
X #endif /* CONFIG_COBALT_27 */
-static void cyz_poll(unsigned long);
X #ifdef CYCLOM_SHOW_STATUS
X static void show_status(int);
X #endif
X
X static int cyclades_get_proc_info(char *, char **, off_t , int , int *, void *);
X
+#ifndef CONFIG_CYZ_INTR
+static void cyz_poll(unsigned long);
+
X /* The Cyclades-Z polling cycle is defined by this variable */
X static long cyz_polling_cycle = CZ_DEF_POLL;
X
@@ -825,6 +837,7 @@
X cyz_timerlist = {
X NULL, NULL, 0, 0, cyz_poll
X };
+#endif /* CONFIG_CYZ_INTR */
X
X /**************************************************
X error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(unsigned long));
@@ -1197,7 +1210,7 @@
X
X if((cinfo = (struct cyclades_card *)dev_id) == 0){
X #ifdef CY_DEBUG_INTERRUPTS
- printk("cy_interrupt: spurious interrupt %d\n\r", irq);
+ printk("cyy_interrupt: spurious interrupt %d\n\r", irq);
X #endif
X return; /* spurious interrupt */
X }
@@ -1229,7 +1242,7 @@
X }
X if (status & CySRReceive) { /* reception interrupt */
X #ifdef CY_DEBUG_INTERRUPTS
- printk("cy_interrupt: rcvd intr, chip %d\n\r", chip);
+ printk("cyy_interrupt: rcvd intr, chip %d\n\r", chip);
X #endif
X /* determine the channel & change to that context */
X save_xir = (u_char) cy_readb(base_addr+(CyRIR<<index));
@@ -1356,7 +1369,7 @@
X is empty, we know we can always stuff a dozen
X characters. */
X #ifdef CY_DEBUG_INTERRUPTS
- printk("cy_interrupt: xmit intr, chip %d\n\r", chip);
+ printk("cyy_interrupt: xmit intr, chip %d\n\r", chip);
X #endif
X
X /* determine the channel & change to that context */
@@ -1636,12 +1649,285 @@
X } /* cyz_update_channel */
X #endif
X
-
+#ifdef CONFIG_CYZ_INTR
X static void
X cyz_interrupt(int irq, void *dev_id, struct pt_regs *regs)
X {
+ struct tty_struct *tty;
+ struct cyclades_card *cinfo;
+ struct cyclades_port *info;
+ static volatile struct FIRM_ID *firm_id;
+ static volatile struct ZFW_CTRL *zfw_ctrl;
+ static volatile struct BOARD_CTRL *board_ctrl;
+ static volatile struct CH_CTRL *ch_ctrl;
+ static volatile struct BUF_CTRL *buf_ctrl;
+ uclong channel;
+ ucchar cmd;
+ uclong param;
+ uclong hw_ver, fw_ver;
+ char data;
+ volatile int char_count, special_count;
+#ifdef BLOCKMOVE
+ int small_count;
+#endif
+ volatile uclong tx_put, tx_get, tx_bufsize;
+ volatile uclong rx_put, rx_get, rx_bufsize;
+
+ if((cinfo = (struct cyclades_card *)dev_id) == 0){
+#ifdef CY_DEBUG_INTERRUPTS
+ printk("cyz_interrupt: spurious interrupt %d\n\r", irq);
+#endif
+ return; /* spurious interrupt */
+ }
+
+ firm_id = (struct FIRM_ID *)(cinfo->base_addr + ID_ADDRESS);
+ if (!ISZLOADED(*cinfo)) {
+#ifdef CY_DEBUG_INTERRUPTS
+ printk("cyz_interrupt: board not yet loaded (INT %d).\n\r", irq);
+#endif
+ return;
+ }
+
+ zfw_ctrl = (struct ZFW_CTRL *)
+ (cinfo->base_addr + cy_readl(&firm_id->zfwctrl_addr));
+ board_ctrl = &(zfw_ctrl->board_ctrl);
+ fw_ver = cy_readl(&board_ctrl->fw_version);
+ hw_ver = cy_readl(&((struct RUNTIME_9060 *)
+ (cinfo->ctl_addr))->mail_box_0);
+
+ while(cyz_fetch_msg(cinfo, &channel, &cmd, &param) == 1) {
+ special_count = 0;
+ info = &cy_port[channel + cinfo->first_line];
+ if((tty = info->tty) == 0) continue;
+ ch_ctrl = &(zfw_ctrl->ch_ctrl[channel]);
+ buf_ctrl = &(zfw_ctrl->buf_ctrl[channel]);
+
+ switch(cmd){
+ case C_CM_PR_ERROR:
+ tty->flip.count++;
+ *tty->flip.flag_buf_ptr++ = TTY_PARITY;
+ *tty->flip.char_buf_ptr++ = 0;
+ special_count++;
+ break;
+ case C_CM_FR_ERROR:
+ tty->flip.count++;
+ *tty->flip.flag_buf_ptr++ = TTY_FRAME;
+ *tty->flip.char_buf_ptr++ = 0;
+ special_count++;
+ break;
+ case C_CM_RXBRK:
+ tty->flip.count++;
+ *tty->flip.flag_buf_ptr++ = TTY_BREAK;
+ *tty->flip.char_buf_ptr++ = 0;
+ special_count++;
+ break;
+ case C_CM_MDCD:
+ if (info->flags & ASYNC_CHECK_CD){
+ if ((fw_ver > 241 ?
+ ((u_long)param) :
+ cy_readl(&ch_ctrl[channel].rs_status)) & C_RS_DCD) {
+ /* SP("Open Wakeup\n"); */
+ cy_sched_event(info,
+ Cy_EVENT_OPEN_WAKEUP);
+ }else if(!((info->flags
+ & ASYNC_CALLOUT_ACTIVE)
+ &&(info->flags
+ & ASYNC_CALLOUT_NOHUP))){
+ /* SP("Hangup\n"); */
+ cy_sched_event(info,
+ Cy_EVENT_HANGUP);
+ }
+ }
+ break;
+ case C_CM_MCTS:
+ if (info->flags & ASYNC_CTS_FLOW) {
+ if(info->tty->hw_stopped){
+ if( cy_readl(&ch_ctrl[channel].rs_status) & C_RS_DCD){
+ /* cy_start isn't used because...
+ HW flow is handled by the board */
+ /* SP("Write Wakeup\n"); */
+ cy_sched_event(info,
+ Cy_EVENT_WRITE_WAKEUP);
+ }
+ }else{
+ if(!(cy_readl(&ch_ctrl[channel].rs_status) & C_RS_CTS)){
+ /* cy_stop isn't used because
+ HW flow is handled by the board */
+ /* SP("Write stop\n"); */
+ }
+ }
+ }
+ break;
+ case C_CM_MRI:
+ break;
+ case C_CM_MDSR:
+ break;
+#ifdef Z_WAKE
+ case C_CM_IOCTLW:
+ cy_sched_event(info, Cy_EVENT_SHUTDOWN_WAKEUP);
+ break;
+#endif
+ case C_CM_RXHIWM:
+ case C_CM_RXNNDT:
+ /* Reception Interrupt */
+#ifdef CY_DEBUG_INTERRUPTS
+ printk("cyz_interrupt: rcvd intr, card %d, port %ld\n\r",
+ info->card, channel);
+#endif
+
+ rx_get = cy_readl(&buf_ctrl->rx_get);
+ rx_put = cy_readl(&buf_ctrl->rx_put);
+ rx_bufsize = cy_readl(&buf_ctrl->rx_bufsize);
+ if (rx_put >= rx_get)
+ char_count = rx_put - rx_get;
+ else
+ char_count = rx_put - rx_get + rx_bufsize;
+
+ if ( char_count ){
+
+#ifdef CY_ENABLE_MONITORING
+ info->mon.int_count++;
+ info->mon.char_count += char_count;
+ if (char_count > info->mon.char_max)
+ info->mon.char_max = char_count;
+ info->mon.char_last = char_count;
+#endif
+ info->idle_stats.recv_bytes += char_count;
+ info->idle_stats.recv_idle = jiffies;
+ if( tty == 0){
+ /* flush received characters */
+ rx_get = (rx_get + char_count) & (rx_bufsize - 1);
+ /* SP("-"); */
+ info->rflush_count++;


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

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

Thomas Kobienia

unread,
Jul 9, 1999, 3:00:00 AM7/9/99
to
Archive-name: v2.3/patch-2.3.10/part15

#!/bin/sh
# this is part 15 of a 37 - part archive


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.10 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.3.10'
else
echo 'x - continuing with patch-2.3.10'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.10' &&

+ len += sprintf(buf+len, "FrameCopiedErrors : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[5]));
+ len += sprintf(buf+len, "FrequencyErrors : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[6]));
+ len += sprintf(buf+len, "InternalErrors : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[7]));
+ len += sprintf(buf+len, "LastRingStatus : %s\n", ring_status[work64[8]]);
+ len += sprintf(buf+len, "TokenError : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[9]));
+ len += sprintf(buf+len, "UpstreamNodeAddress : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[10]));
+ len += sprintf(buf+len, "LastRingID : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[11]));
+ len += sprintf(buf+len, "LastBeaconType : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[12]));
+
+ spin_unlock(&i2o_proc_lock);
+ return len;
+}
X
X /* LAN group 0400h - Required FDDI Statistics (scalar) */
X int i2o_proc_read_lan_fddi_stats(char *buf, char **start, off_t offset,
@@ -2208,23 +2846,31 @@
X return len;
X }
X
- len += sprintf(buf, "ConfigurationState: %s\n", conf_state[work64[0]]);
- len += sprintf(buf+len, "UpstreamNode: " FMT_U64_HEX "\n", U64_VAL(&work64[1]));
- len += sprintf(buf+len, "DownStreamNode: " FMT_U64_HEX "\n", U64_VAL(&work64[2]));
- len += sprintf(buf+len, "FrameErrors: " FMT_U64_HEX "\n", U64_VAL(&work64[3]));
- len += sprintf(buf+len, "FramesLost: " FMT_U64_HEX "\n", U64_VAL(&work64[4]));
- len += sprintf(buf+len, "RingMgmtState: %s\n", ring_state[work64[5]]);
- len += sprintf(buf+len, "LCTFailures: " FMT_U64_HEX "\n", U64_VAL(&work64[6]));
- len += sprintf(buf+len, "LEMRejects: " FMT_U64_HEX "\n", U64_VAL(&work64[7]));
- len += sprintf(buf+len, "LEMCount: " FMT_U64_HEX "\n", U64_VAL(&work64[8]));
- len += sprintf(buf+len, "LConnectionState: %s\n", link_state[work64[9]]);
+ len += sprintf(buf, "ConfigurationState : %s\n", conf_state[work64[0]]);
+ len += sprintf(buf+len, "UpstreamNode : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[1]));
+ len += sprintf(buf+len, "DownStreamNode : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[2]));
+ len += sprintf(buf+len, "FrameErrors : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[3]));
+ len += sprintf(buf+len, "FramesLost : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[4]));
+ len += sprintf(buf+len, "RingMgmtState : %s\n", ring_state[work64[5]]);
+ len += sprintf(buf+len, "LCTFailures: " FMT_U64_HEX "\n",
+ U64_VAL(&work64[6]));
+ len += sprintf(buf+len, "LEMRejects : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[7]));
+ len += sprintf(buf+len, "LEMCount : " FMT_U64_HEX "\n",
+ U64_VAL(&work64[8]));
+ len += sprintf(buf+len, "LConnectionState : %s\n",
+ link_state[work64[9]]);
X
X spin_unlock(&i2o_proc_lock);
X return len;
X }
X
-static int i2o_proc_create_entries(void *data,
- i2o_proc_entry *pentry, struct proc_dir_entry *parent)
+static int i2o_proc_create_entries(void *data, i2o_proc_entry *pentry,
+ struct proc_dir_entry *parent)
X {
X struct proc_dir_entry *ent;
X
@@ -2245,7 +2891,7 @@
X }
X
X static void i2o_proc_remove_entries(i2o_proc_entry *pentry,
- struct proc_dir_entry *parent)
+ struct proc_dir_entry *parent)
X {
X while(pentry->name != NULL)
X {
@@ -2255,7 +2901,7 @@
X }
X
X static int i2o_proc_add_controller(struct i2o_controller *pctrl,
- struct proc_dir_entry *root )
+ struct proc_dir_entry *root )
X {
X struct proc_dir_entry *dir, *dir1;
X struct i2o_device *dev;
@@ -2291,6 +2937,23 @@
X break;
X case I2O_CLASS_LAN:
X i2o_proc_create_entries(dev, lan_entries, dir1);
+ switch(dev->subclass)
+ {
+ case I2O_LAN_ETHERNET:
+ i2o_proc_create_entries(dev, lan_eth_entries,
+ dir1);
+ break;
+ case I2O_LAN_FDDI:
+ i2o_proc_create_entries(dev, lan_fddi_entries,
+ dir1);
+ break;
+ case I2O_LAN_TR:
+ i2o_proc_create_entries(dev, lan_tr_entries,
+ dir1);
+ break;
+ default:
+ break;
+ }
X break;
X default:
X break;
@@ -2301,17 +2964,58 @@
X }
X
X static void i2o_proc_remove_controller(struct i2o_controller *pctrl,
- struct proc_dir_entry *parent)
+ struct proc_dir_entry *parent)
X {
X char buff[10];
+ char dev_id[10];
+ struct proc_dir_entry *de;
+ struct i2o_device *dev;
X
- sprintf(buff, "iop%d", pctrl->unit);
+ /* Remove unused device entries */
+ for(dev=pctrl->devices; dev; dev=dev->next)
+ {
+ de=dev->proc_entry;
+ sprintf(dev_id, "%0#5x", dev->id);
X
- i2o_proc_remove_entries(generic_iop_entries, pctrl->proc_entry);
+ /* Would it be safe to remove _files_ even if they are in use? */
+ if((de) && (!de->count))
+ {
+ i2o_proc_remove_entries(generic_dev_entries, de);
X
- remove_proc_entry(buff, parent);
+ switch(dev->class)
+ {
+ case I2O_CLASS_SCSI_PERIPHERAL:
+ case I2O_CLASS_RANDOM_BLOCK_STORAGE:
+ i2o_proc_remove_entries(rbs_dev_entries, de);
+ break;
+ case I2O_CLASS_LAN:
+ i2o_proc_remove_entries(lan_entries, de);
+ switch(dev->subclass)
+ {
+ case I2O_LAN_ETHERNET:
+ i2o_proc_remove_entries(lan_eth_entries, de);
+ break;
+ case I2O_LAN_FDDI:
+ i2o_proc_remove_entries(lan_fddi_entries, de);
+ break;
+ case I2O_LAN_TR:
+ i2o_proc_remove_entries(lan_tr_entries, de);
+ break;
+ }
+ }
+ remove_proc_entry(dev_id, parent);
+ }
+ }
X
- pctrl->proc_entry = NULL;
+ if(!pctrl->proc_entry->count)
+ {
+ sprintf(buff, "iop%d", pctrl->unit);
+
+ i2o_proc_remove_entries(generic_iop_entries, pctrl->proc_entry);
+
+ remove_proc_entry(buff, parent);
+ pctrl->proc_entry = NULL;
+ }
X }
X
X static int create_i2o_procfs(void)
@@ -2327,7 +3031,10 @@
X {
X pctrl = i2o_find_controller(i);
X if(pctrl)
+ {
X i2o_proc_add_controller(pctrl, i2o_proc_dir_root);
+ i2o_unlock_controller(pctrl);
+ }
X };
X
X return 0;
@@ -2345,19 +3052,25 @@
X {
X pctrl = i2o_find_controller(i);
X if(pctrl)
+ {
X i2o_proc_remove_controller(pctrl, i2o_proc_dir_root);
+ i2o_unlock_controller(pctrl);
+ }
X };
X
- remove_proc_entry("i2o", 0);
+ if(!i2o_proc_dir_root->count)
+ remove_proc_entry("i2o", 0);
+ else
+ return -1;
+


X return 0;
X }
X

X #ifdef MODULE
+#define i2o_proc_init init_module
+#endif
X
-MODULE_AUTHOR("Intel Corporation");
-MODULE_DESCRIPTION("I2O procfs Handler");
-
-int init_module(void)
+__init int i2o_proc_init(void)
X {
X if(create_i2o_procfs())
X return -EBUSY;
@@ -2372,6 +3085,12 @@


X
X return 0;
X }

+
+#ifdef MODULE
+
+
+MODULE_AUTHOR("Intel Corporation");
+MODULE_DESCRIPTION("I2O procfs Handler");
X
X void cleanup_module(void)
X {
diff -u --recursive --new-file v2.3.9/linux/drivers/i2o/i2o_proc.h linux/drivers/i2o/i2o_proc.h
--- v2.3.9/linux/drivers/i2o/i2o_proc.h Wed Jun 2 14:40:22 1999
+++ linux/drivers/i2o/i2o_proc.h Mon Jul 5 20:09:40 1999
@@ -32,110 +32,5 @@
X u8 reserved;
X u8 req_status;
X } i2o_mult_reply_msg, *pi2o_mult_reply_msg;
-
-/**************************************************************************
- * HRT related constants and structures
- **************************************************************************/
-#define I2O_BUS_LOCAL 0
-#define I2O_BUS_ISA 1
-#define I2O_BUS_EISA 2
-#define I2O_BUS_MCA 3
-#define I2O_BUS_PCI 4
-#define I2O_BUS_PCMCIA 5
-#define I2O_BUS_NUBUS 6
-#define I2O_BUS_CARDBUS 7
-#define I2O_BUS_UNKNOWN 0x80
-
-typedef struct _i2o_pci_bus {
- u8 PciFunctionNumber;
- u8 PciDeviceNumber;
- u8 PciBusNumber;
- u8 reserved;
- u16 PciVendorID;
- u16 PciDeviceID;
-} i2o_pci_bus, *pi2o_pci_bus;
-
-typedef struct _i2o_local_bus {
- u16 LbBaseIOPort;
- u16 reserved;
- u32 LbBaseMemoryAddress;
-} i2o_local_bus, *pi2o_local_bus;
-
-typedef struct _i2o_isa_bus {
- u16 IsaBaseIOPort;
- u8 CSN;
- u8 reserved;
- u32 IsaBaseMemoryAddress;
-} i2o_isa_bus, *pi2o_isa_bus;
-
-/* I2O_EISA_BUS_INFO */
-typedef struct _i2o_eisa_bus_info {
- u16 EisaBaseIOPort;
- u8 reserved;
- u8 EisaSlotNumber;
- u32 EisaBaseMemoryAddress;
-} i2o_eisa_bus, *pi2o_eisa_bus;
-
-typedef struct _i2o_mca_bus {
- u16 McaBaseIOPort;
- u8 reserved;
- u8 McaSlotNumber;
- u32 McaBaseMemoryAddress;
-} i2o_mca_bus, *pi2o_mca_bus;
-
-typedef struct _i2o_other_bus {
- u16 BaseIOPort;
- u16 reserved;
- u32 BaseMemoryAddress;
-} i2o_other_bus, *pi2o_other_bus;
-
-
-typedef struct _i2o_hrt_entry {
- u32 adapter_id;
- u32 parent_tid:12;
- u32 state:4;
- u32 bus_num:8;
- u32 bus_type:8;
- union {
- i2o_pci_bus pci_bus;
- i2o_local_bus local_bus;
- i2o_isa_bus isa_bus;
- i2o_eisa_bus eisa_bus;
- i2o_mca_bus mca_bus;
- i2o_other_bus other_bus;
- } bus;
-} i2o_hrt_entry, *pi2o_hrt_entry;
-
-typedef struct _i2o_hrt {
- u16 num_entries;
- u8 entry_len;
- u8 hrt_version;
- u32 change_ind;
- i2o_hrt_entry hrt_entry[1];
-} i2o_hrt, *pi2o_hrt;
-
-typedef struct _i2o_lct_entry {
- u32 entry_size:16;
- u32 tid:12;
- u32 reserved:4;
- u32 change_ind;
- u32 device_flags;
- u32 class_id;
- u32 sub_class;
- u32 user_tid:12;
- u32 parent_tid:12;
- u32 bios_info:8;
- u8 identity_tag[8];
- u32 event_capabilities;
-} i2o_lct_entry, *pi2o_lct_entry;
-
-typedef struct _i2o_lct {
- u32 table_size:16;
- u32 boot_tid:12;
- u32 lct_ver:4;
- u32 iop_flags;
- u32 current_change_ind;
- i2o_lct_entry lct_entry[1];
-} i2o_lct, *pi2o_lct;
-
+
X #endif /* i2oproc_h */
diff -u --recursive --new-file v2.3.9/linux/drivers/i2o/i2o_scsi.c linux/drivers/i2o/i2o_scsi.c
--- v2.3.9/linux/drivers/i2o/i2o_scsi.c Wed Jun 2 14:40:22 1999
+++ linux/drivers/i2o/i2o_scsi.c Mon Jul 5 20:35:18 1999
@@ -26,6 +26,9 @@
X * Fixes:
X * Steve Ralston : Scatter gather now works
X *
+ * To Do
+ * 64bit cleanups
+ * Fix the resource management problems.
X */
X
X #include <linux/module.h>
@@ -37,7 +40,6 @@
X #include <linux/interrupt.h>
X #include <linux/timer.h>
X #include <linux/delay.h>
-#include <linux/sched.h>
X #include <linux/proc_fs.h>
X #include <asm/dma.h>
X #include <asm/system.h>
@@ -83,6 +85,7 @@
X /*
X * SG Chain buffer support...
X */
+
X #define SG_MAX_FRAGS 64
X
X /*
@@ -204,9 +207,12 @@
X }
X
X
- /* Low byte is the adapter status, next is the device */
- as=(u8)m[4];
- ds=(u8)(m[4]>>8);
+ /*
+ * Low byte is device status, next is adapter status,
+ * (then one byte reserved), then request status.
+ */
+ ds=(u8)m[4];
+ as=(u8)(m[4]>>8);
X st=(u8)(m[4]>>24);
X
X dprintk(("i2o got a scsi reply %08X: ", m[0]));
@@ -264,10 +270,10 @@
X
X dprintk((KERN_DEBUG "SCSI error %08X", m[4]));
X
- if (ds == 0x0E)
+ if (as == 0x0E)
X /* SCSI Reset */
X current_command->result = DID_RESET << 16;
- else if (ds == 0x0F)
+ else if (as == 0x0F)
X current_command->result = DID_PARITY << 16;
X else
X current_command->result = DID_ERROR << 16;
@@ -433,7 +439,6 @@
X )
X continue;
X
-// printk("Found a controller.\n");
X shpnt = scsi_register(tpnt, sizeof(struct i2o_scsi_host));
X save_flags(flags);
X cli();
@@ -443,7 +448,6 @@
X shpnt->irq = 0;
X shpnt->this_id = /* Good question */15;
X restore_flags(flags);
-// printk("Scanning I2O port %d.\n", d->id);
X i2o_scsi_init(c, d, shpnt);
X count++;
X }
@@ -534,25 +538,12 @@
X int direction;
X int scsidir;
X u32 len;
+ u32 reqlen;
+ u32 tag;
X
X static int max_qd = 1;
X
X /*
- * The scsi layer should be handling this stuff
- */
-
- if(is_dir_out(SCpnt))
- {
- direction=0x04000000;
- scsidir=0x80000000;
- }
- else
- {
- scsidir=0x40000000;
- direction=0x00000000;
- }
-
- /*
X * Do the incoming paperwork
X */
X
@@ -604,13 +595,45 @@
X * Put together a scsi execscb message
X */
X
+ len = SCpnt->request_bufflen;
+ direction = 0x00000000; // SGL IN (osm<--iop)
+
+ /*
+ * The scsi layer should be handling this stuff
+ */
+
+ scsidir = 0x00000000; // DATA NO XFER
+ if(len)
+ {
+ if(is_dir_out(SCpnt))
+ {
+ direction=0x04000000; // SGL OUT (osm-->iop)
+ scsidir =0x80000000; // DATA OUT (iop-->dev)
+ }
+ else
+ {
+ scsidir =0x40000000; // DATA IN (iop<--dev)
+ }
+ }
+
X msg[1] = I2O_CMD_SCSI_EXEC<<24|HOST_TID<<12|tid;
X msg[2] = scsi_context; /* So the I2O layer passes to us */
X /* Sorry 64bit folks. FIXME */
X msg[3] = (u32)SCpnt; /* We want the SCSI control block back */
- /* Direction, disconnect ok, no tagging (yet) */
- msg[4] = scsidir|(1<<29)|SCpnt->cmd_len;
X
+ /* LSI_920_PCI_QUIRK
+ *
+ * Intermittant observations of msg frame word data corruption
+ * observed on msg[4] after:
+ * WRITE, READ-MODIFY-WRITE
+ * operations. 19990606 -sralston
+ *
+ * (Hence we build this word via tag. Its good practice anyway
+ * we don't want fetches over PCI needlessly)
+ */
+
+ tag=0;
+
X /*
X * Attach tags to the devices
X */
@@ -623,25 +646,24 @@
X */
X if((jiffies - hostdata->tagclock[SCpnt->target][SCpnt->lun]) > (5*HZ))
X {
- msg[4]|=(1<<23)|(1<<24);
+ tag=0x01800000; /* ORDERED! */
X hostdata->tagclock[SCpnt->target][SCpnt->lun]=jiffies;
X }
- else switch(SCpnt->tag)
+ else
X {
- case SIMPLE_QUEUE_TAG:
- msg[4]|=(1<<23);
- break;
- case HEAD_OF_QUEUE_TAG:
- msg[4]|=(1<<24);
- break;
- case ORDERED_QUEUE_TAG:
- msg[4]|=(1<<23)|(1<<24);
- break;
- default:
- msg[4]|=(1<<23);
+ /* Hmmm... I always see value of 0 here,
+ * of which {HEAD_OF, ORDERED, SIMPLE} are NOT! -sralston
+ */
+ if(SCpnt->tag == HEAD_OF_QUEUE_TAG)
+ tag=0x01000000;
+ else if(SCpnt->tag == ORDERED_QUEUE_TAG)
+ tag=0x01800000;
X }
X }
X
+ /* Direction, disconnect ok, tag, CDBLen */
+ msg[4] = scsidir|0x20000000|SCpnt->cmd_len|tag;
+
X mptr=msg+5;
X
X /*
@@ -652,7 +674,7 @@
X mptr+=4;
X lenptr=mptr++; /* Remember me - fill in when we know */
X
-
+ reqlen = 12; // SINGLE SGE
X /*
X * Now fill in the SGList and command
X *
@@ -664,21 +686,22 @@
X if(SCpnt->use_sg)
X {
X struct scatterlist *sg = (struct scatterlist *)SCpnt->request_buffer;
+ int chain = 0;
X
X if((sg_max_frags > 11) && (SCpnt->use_sg > 11))
X {
+ chain = 1;
X /*
X * Need to chain!
X */
- SCpnt->host_scribble = (void*)(sg_chain_pool + sg_chain_tag);
X *mptr++=direction|0xB0000000|(SCpnt->use_sg*2*4);
- *mptr=virt_to_bus(SCpnt->host_scribble);
- mptr = (u32*)SCpnt->host_scribble;
+ *mptr=virt_to_bus(sg_chain_pool + sg_chain_tag);
+ mptr = (u32*)(sg_chain_pool + sg_chain_tag);
X if (SCpnt->use_sg > max_sg_len)
X {
X max_sg_len = SCpnt->use_sg;
X printk("i2o_scsi: Chain SG! SCpnt=%p, SG_FragCnt=%d, SG_idx=%d\n",
- SCpnt, SCpnt->use_sg, (chain_buf*)SCpnt->host_scribble-sg_chain_pool);
+ SCpnt, SCpnt->use_sg, sg_chain_tag);
X }
X if ( ++sg_chain_tag == SG_MAX_BUFS )
X sg_chain_tag = 0;
@@ -693,7 +716,15 @@
X *mptr++=virt_to_bus(sg->address);
X sg++;
X }
- mptr[-2]|=0xC0000000; /* End of List and block */
+
+ /* Make this an end of list. Again evade the 920 bug and
+ unwanted PCI read traffic */
+
+ mptr[-2]=direction|0xD0000000|(sg-1)->length;
+
+ if(!chain)
+ reqlen = mptr - msg;
+
X *lenptr=len;
X if(len != SCpnt->underflow)
X printk("Cmd len %08X Cmd underflow %08X\n",
@@ -703,19 +734,23 @@
X {
X dprintk(("non sg for %p, %d\n", SCpnt->request_buffer,
X SCpnt->request_bufflen));
- *mptr++=0xD0000000|direction|SCpnt->request_bufflen;
- *mptr++=virt_to_bus(SCpnt->request_buffer);
X *lenptr = len = SCpnt->request_bufflen;
- /* No transfer ? - fix up the request */
X if(len == 0)
- msg[4]&=~0xC0000000;
+ {
+ reqlen = 9;
+ }
+ else
+ {
+ *mptr++=0xD0000000|direction|SCpnt->request_bufflen;
+ *mptr++=virt_to_bus(SCpnt->request_buffer);
+ }
X }
X
X /*
X * Stick the headers on
X */
X
- msg[0] = (mptr-msg)<<16 | SGL_OFFSET_10;
+ msg[0] = reqlen<<16 | SGL_OFFSET_10;
X
X /* Queue the message */
X i2o_post_message(c,m);
@@ -757,7 +792,7 @@
X u32 m;
X int tid;
X
- printk("i2o_scsi_abort\n");
+ printk("i2o_scsi: Aborting command block.\n");
X
X host = SCpnt->host;
X hostdata = (struct i2o_scsi_host *)host->hostdata;
@@ -790,8 +825,6 @@
X wmb();
X i2o_post_message(c,m);
X wmb();
-// SCpnt->result = DID_RESET << 16;
-// SCpnt->scsi_done(SCpnt);
X return SCSI_ABORT_PENDING;
X }
X
@@ -804,12 +837,12 @@
X u32 m;
X u32 *msg;
X
- printk("i2o_scsi_reset\n");
-
X /*
X * Find the TID for the bus
X */
X
+ printk("i2o_scsi: Attempting to reset the bus.\n");
+
X host = SCpnt->host;
X hostdata = (struct i2o_scsi_host *)host->hostdata;
X tid = hostdata->bus_task;
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/avmb1/capidrv.c linux/drivers/isdn/avmb1/capidrv.c
--- v2.3.9/linux/drivers/isdn/avmb1/capidrv.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/avmb1/capidrv.c Mon Jul 5 20:09:40 1999
@@ -1386,13 +1386,14 @@
X handle_data(&s_cmsg, skb);
X continue;
X }
- kfree_skb(skb);
X if ((s_cmsg.adr.adrController & 0xffffff00) == 0)
X handle_controller(&s_cmsg);
X else if ((s_cmsg.adr.adrPLCI & 0xffff0000) == 0)
X handle_plci(&s_cmsg);
X else
X handle_ncci(&s_cmsg);
+
+ kfree_skb(skb);
X }
X }
X
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/amd7930.c linux/drivers/isdn/hisax/amd7930.c
--- v2.3.9/linux/drivers/isdn/hisax/amd7930.c Wed Apr 1 16:20:57 1998
+++ linux/drivers/isdn/hisax/amd7930.c Tue Jul 6 19:05:48 1999
@@ -747,8 +747,8 @@
X return(0);
X }
X
-__initfunc(int
-setup_amd7930(struct IsdnCard *card))
+int __init
+setup_amd7930(struct IsdnCard *card)
X {
X struct IsdnCardState *cs = card->cs;
X char tmp[64];
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/asuscom.c linux/drivers/isdn/hisax/asuscom.c
--- v2.3.9/linux/drivers/isdn/hisax/asuscom.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/asuscom.c Tue Jul 6 19:05:48 1999
@@ -334,8 +334,8 @@
X return(0);
X }
X
-__initfunc(int
-setup_asuscom(struct IsdnCard *card))
+int __init
+setup_asuscom(struct IsdnCard *card)
X {
X int bytecnt;
X struct IsdnCardState *cs = card->cs;
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/avm_a1.c linux/drivers/isdn/hisax/avm_a1.c
--- v2.3.9/linux/drivers/isdn/hisax/avm_a1.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/avm_a1.c Tue Jul 6 19:05:48 1999
@@ -234,8 +234,8 @@
X return(0);
X }
X
-__initfunc(int
-setup_avm_a1(struct IsdnCard *card))
+int __init
+setup_avm_a1(struct IsdnCard *card)
X {
X u_char val;
X struct IsdnCardState *cs = card->cs;
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/config.c linux/drivers/isdn/hisax/config.c
--- v2.3.9/linux/drivers/isdn/hisax/config.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/config.c Tue Jul 6 19:05:48 1999
@@ -442,8 +442,8 @@
X #ifdef MODULE
X #define HiSax_init init_module
X #else
-__initfunc(void
-HiSax_setup(char *str, int *ints))
+void __init
+HiSax_setup(char *str, int *ints)
X {
X int i, j, argc;
X
@@ -1236,8 +1236,8 @@
X }
X
X
-__initfunc(int
-HiSax_init(void))
+int __init
+HiSax_init(void)


X {
X int i;
X

diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/diva.c linux/drivers/isdn/hisax/diva.c
--- v2.3.9/linux/drivers/isdn/hisax/diva.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/diva.c Tue Jul 6 19:05:48 1999
@@ -459,8 +459,8 @@
X static struct pci_dev *dev_diva __initdata = NULL;
X static struct pci_dev *dev_diva_u __initdata = NULL;
X
-__initfunc(int
-setup_diva(struct IsdnCard *card))
+int __init
+setup_diva(struct IsdnCard *card)
X {
X int bytecnt;
X u_char val;
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/foreign.c linux/drivers/isdn/hisax/foreign.c
--- v2.3.9/linux/drivers/isdn/hisax/foreign.c Mon Mar 15 16:11:30 1999
+++ linux/drivers/isdn/hisax/foreign.c Tue Jul 6 19:05:48 1999
@@ -744,8 +744,8 @@
X extern struct foreign_interface dbri_foreign_interface;
X #endif
X
-__initfunc(int
-setup_foreign(struct IsdnCard *card))
+int __init
+setup_foreign(struct IsdnCard *card)
X {
X struct IsdnCardState *cs = card->cs;
X char tmp[64];
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/hfc_2bds0.c linux/drivers/isdn/hisax/hfc_2bds0.c
--- v2.3.9/linux/drivers/isdn/hisax/hfc_2bds0.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/hfc_2bds0.c Tue Jul 6 19:05:48 1999
@@ -1166,8 +1166,8 @@
X #endif
X }
X
-__initfunc(unsigned int
-*init_send_hfcd(int cnt))
+unsigned int __init
+*init_send_hfcd(int cnt)
X {
X int i, *send;
X
@@ -1181,8 +1181,8 @@
X return(send);
X }
X
-__initfunc(void
-init2bds0(struct IsdnCardState *cs))
+void __init
+init2bds0(struct IsdnCardState *cs)
X {
X cs->setstack_d = setstack_hfcd;
X cs->dbusytimer.function = (void *) hfc_dbusy_timer;
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/hfc_2bs0.c linux/drivers/isdn/hisax/hfc_2bs0.c
--- v2.3.9/linux/drivers/isdn/hisax/hfc_2bs0.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/hfc_2bs0.c Tue Jul 6 19:05:48 1999
@@ -555,8 +555,8 @@
X return (0);
X }
X
-__initfunc(void
-init_send(struct BCState *bcs))
+void __init
+init_send(struct BCState *bcs)


X {
X int i;
X

@@ -569,8 +569,8 @@
X bcs->hw.hfc.send[i] = 0x1fff;
X }
X
-__initfunc(void
-inithfc(struct IsdnCardState *cs))
+void __init
+inithfc(struct IsdnCardState *cs)
X {
X init_send(&cs->bcs[0]);
X init_send(&cs->bcs[1]);
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/ix1_micro.c linux/drivers/isdn/hisax/ix1_micro.c
--- v2.3.9/linux/drivers/isdn/hisax/ix1_micro.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/ix1_micro.c Tue Jul 6 19:05:48 1999
@@ -289,8 +289,8 @@
X }
X
X
-__initfunc(int
-setup_ix1micro(struct IsdnCard *card))
+int __init
+setup_ix1micro(struct IsdnCard *card)
X {
X struct IsdnCardState *cs = card->cs;
X char tmp[64];
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/mic.c linux/drivers/isdn/hisax/mic.c
--- v2.3.9/linux/drivers/isdn/hisax/mic.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/mic.c Tue Jul 6 19:05:48 1999
@@ -231,8 +231,8 @@
X return(0);
X }
X
-__initfunc(int
-setup_mic(struct IsdnCard *card))
+int __init
+setup_mic(struct IsdnCard *card)
X {
X int bytecnt;
X struct IsdnCardState *cs = card->cs;
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/netjet.c linux/drivers/isdn/hisax/netjet.c
--- v2.3.9/linux/drivers/isdn/hisax/netjet.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/netjet.c Tue Jul 6 19:05:48 1999
@@ -858,8 +858,8 @@
X }
X
X
-__initfunc(void
-inittiger(struct IsdnCardState *cs))
+void __init
+inittiger(struct IsdnCardState *cs)
X {
X if (!(cs->bcs[0].hw.tiger.send = kmalloc(NETJET_DMA_SIZE * sizeof(unsigned int),
X GFP_KERNEL | GFP_DMA))) {
@@ -1050,8 +1050,8 @@
X
X static struct pci_dev *dev_netjet __initdata = NULL;
X
-__initfunc(int
-setup_netjet(struct IsdnCard *card))
+int __init
+setup_netjet(struct IsdnCard *card)
X {
X int bytecnt;
X struct IsdnCardState *cs = card->cs;
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/niccy.c linux/drivers/isdn/hisax/niccy.c
--- v2.3.9/linux/drivers/isdn/hisax/niccy.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/niccy.c Tue Jul 6 19:05:48 1999
@@ -263,8 +263,8 @@
X
X static struct pci_dev *niccy_dev __initdata = NULL;
X
-__initfunc(int
-setup_niccy(struct IsdnCard *card))
+int __init
+setup_niccy(struct IsdnCard *card)
X {
X struct IsdnCardState *cs = card->cs;
X char tmp[64];
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/sedlbauer.c linux/drivers/isdn/hisax/sedlbauer.c
--- v2.3.9/linux/drivers/isdn/hisax/sedlbauer.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/sedlbauer.c Tue Jul 6 19:05:48 1999
@@ -533,8 +533,8 @@
X static int pci_index __initdata = 0;
X #endif
X
-__initfunc(int
-setup_sedlbauer(struct IsdnCard *card))
+int __init
+setup_sedlbauer(struct IsdnCard *card)
X {
X int bytecnt, ver, val;
X struct IsdnCardState *cs = card->cs;
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/sportster.c linux/drivers/isdn/hisax/sportster.c
--- v2.3.9/linux/drivers/isdn/hisax/sportster.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/sportster.c Tue Jul 6 19:05:48 1999
@@ -204,8 +204,8 @@
X return(0);
X }
X
-__initfunc(int
-get_io_range(struct IsdnCardState *cs))
+int __init
+get_io_range(struct IsdnCardState *cs)
X {
X int i, j, adr;
X

@@ -230,8 +230,8 @@
X }

X }
X
-__initfunc(int
-setup_sportster(struct IsdnCard *card))
+int __init
+setup_sportster(struct IsdnCard *card)
X {
X struct IsdnCardState *cs = card->cs;
X char tmp[64];
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/teleint.c linux/drivers/isdn/hisax/teleint.c
--- v2.3.9/linux/drivers/isdn/hisax/teleint.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/teleint.c Tue Jul 6 19:05:49 1999
@@ -289,8 +289,8 @@
X return(0);
X }
X
-__initfunc(int
-setup_TeleInt(struct IsdnCard *card))
+int __init
+setup_TeleInt(struct IsdnCard *card)
X {
X struct IsdnCardState *cs = card->cs;
X char tmp[64];
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/teles0.c linux/drivers/isdn/hisax/teles0.c
--- v2.3.9/linux/drivers/isdn/hisax/teles0.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/teles0.c Tue Jul 6 19:05:49 1999
@@ -302,8 +302,8 @@
X return(0);
X }
X
-__initfunc(int
-setup_teles0(struct IsdnCard *card))
+int __init
+setup_teles0(struct IsdnCard *card)
X {
X u_char val;
X struct IsdnCardState *cs = card->cs;
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/teles3.c linux/drivers/isdn/hisax/teles3.c
--- v2.3.9/linux/drivers/isdn/hisax/teles3.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/teles3.c Tue Jul 6 19:05:49 1999
@@ -321,8 +321,8 @@
X return(0);
X }
X
-__initfunc(int
-setup_teles3(struct IsdnCard *card))
+int __init
+setup_teles3(struct IsdnCard *card)
X {
X u_char val;
X struct IsdnCardState *cs = card->cs;
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/hisax/teles3c.c linux/drivers/isdn/hisax/teles3c.c
--- v2.3.9/linux/drivers/isdn/hisax/teles3c.c Sun May 23 10:03:41 1999
+++ linux/drivers/isdn/hisax/teles3c.c Tue Jul 6 19:05:49 1999
@@ -140,8 +140,8 @@
X return(0);
X }
X
-__initfunc(int
-setup_t163c(struct IsdnCard *card))
+int __init
+setup_t163c(struct IsdnCard *card)
X {
X struct IsdnCardState *cs = card->cs;
X char tmp[64];
diff -u --recursive --new-file v2.3.9/linux/drivers/isdn/isdn_bsdcomp.c linux/drivers/isdn/isdn_bsdcomp.c
--- v2.3.9/linux/drivers/isdn/isdn_bsdcomp.c Sun May 23 10:03:42 1999
+++ linux/drivers/isdn/isdn_bsdcomp.c Mon Jul 5 20:35:18 1999
@@ -64,7 +64,6 @@
X #include <linux/malloc.h>
X #include <linux/tty.h>
X #include <linux/errno.h>
-#include <linux/sched.h> /* to get the struct task_struct */
X #include <linux/string.h> /* used in new tty drivers */
X #include <linux/signal.h> /* used in new tty drivers */
X
diff -u --recursive --new-file v2.3.9/linux/drivers/macintosh/macserial.c linux/drivers/macintosh/macserial.c
--- v2.3.9/linux/drivers/macintosh/macserial.c Mon Jun 7 12:12:32 1999
+++ linux/drivers/macintosh/macserial.c Thu Jul 1 15:09:01 1999
@@ -1558,7 +1558,6 @@
X char_time = MIN(char_time, timeout);
X while ((read_zsreg(info->zs_channel, 1) & ALL_SNT) == 0) {
X current->state = TASK_INTERRUPTIBLE;
- current->counter = 0; /* make us low-priority */
X schedule_timeout(char_time);
X if (signal_pending(current))
X break;
diff -u --recursive --new-file v2.3.9/linux/drivers/misc/Config.in linux/drivers/misc/Config.in
--- v2.3.9/linux/drivers/misc/Config.in Wed Dec 31 16:00:00 1969
+++ linux/drivers/misc/Config.in Thu Jul 1 14:22:57 1999
@@ -0,0 +1,37 @@
+#
+# For a description of the syntax of this configuration file,
+# see the Configure script.
+#
+# Parport configuration.
+#
+
+tristate 'Parallel port support' CONFIG_PARPORT
+if [ "$CONFIG_PARPORT" != "n" ]; then
+ dep_tristate ' PC-style hardware' CONFIG_PARPORT_PC $CONFIG_PARPORT
+ if [ "$CONFIG_PARPORT_PC" != "n" ]; then
+ bool ' Use FIFO/DMA if available' CONFIG_PARPORT_PC_FIFO
+ fi
+ if [ "$CONFIG_ARM" = "y" ]; then
+ dep_tristate ' Archimedes hardware' CONFIG_PARPORT_ARC $CONFIG_PARPORT
+ fi
+ if [ "$CONFIG_AMIGA" = "y" ]; then
+ dep_tristate ' Amiga builtin port' CONFIG_PARPORT_AMIGA $CONFIG_PARPORT
+ if [ "$CONFIG_ZORRO" != "n" ]; then
+ dep_tristate ' Multiface III parallel port' CONFIG_PARPORT_MFC3 $CONFIG_PARPORT
+ fi
+ else
+ define_bool CONFIG_PARPORT_AMIGA n
+ define_bool CONFIG_PARPORT_MFC3 n
+ fi
+ if [ "$CONFIG_ATARI" = "y" ]; then
+ dep_tristate ' Atari hardware' CONFIG_PARPORT_ATARI $CONFIG_PARPORT
+ else
+ define_bool CONFIG_PARPORT_ATARI n
+ fi
+
+ # If exactly one hardware type is selected then parport will optimise away
+ # support for loading any others. Defeat this if the user is keen.
+ bool ' Support foreign hardware' CONFIG_PARPORT_OTHER
+
+ bool ' IEEE 1284 transfer modes' CONFIG_PARPORT_1284
+fi
diff -u --recursive --new-file v2.3.9/linux/drivers/misc/Makefile linux/drivers/misc/Makefile
--- v2.3.9/linux/drivers/misc/Makefile Thu Jun 3 16:21:47 1999
+++ linux/drivers/misc/Makefile Thu Jul 1 14:22:57 1999
@@ -23,7 +23,13 @@
X MIX_OBJS :=
X
X ifeq ($(CONFIG_PARPORT),y)
- L_OBJS += parport_share.o parport_ieee1284.o parport_procfs.o
+ L_OBJS += parport_share.o parport_ieee1284.o parport_ieee1284_ops.o \
+ parport_procfs.o
+
+ ifeq ($(CONFIG_PARPORT_1284),y)
+ L_OBJS += parport_daisy.o parport_probe.o
+ endif
+
X ifeq ($(CONFIG_PARPORT_PC),y)
X LX_OBJS += parport_pc.o
X else
@@ -62,7 +68,10 @@
X LX_OBJS += parport_init.o
X else
X ifeq ($(CONFIG_PARPORT),m)
- MI_OBJS += parport_share.o parport_ieee1284.o
+ MI_OBJS += parport_share.o parport_ieee1284.o parport_ieee1284_ops.o
+ ifeq ($(CONFIG_PARPORT_1284),y)
+ MI_OBJS += parport_daisy.o parport_probe.o
+ endif
X ifneq ($(CONFIG_PROC_FS),n)
X MI_OBJS += parport_procfs.o
X endif
diff -u --recursive --new-file v2.3.9/linux/drivers/misc/parport_arc.c linux/drivers/misc/parport_arc.c
--- v2.3.9/linux/drivers/misc/parport_arc.c Thu Jun 3 16:21:47 1999
+++ linux/drivers/misc/parport_arc.c Thu Jul 1 14:22:57 1999
@@ -98,41 +98,36 @@
X arc_read_control,
X arc_frob_control,
X
- NULL, /* write_econtrol */
- NULL, /* read_econtrol */
- NULL, /* frob_econtrol */
-
- arc_write_status,
X arc_read_status,
X
- NULL, /* write_fifo */
- NULL, /* read_fifo */
-
- NULL, /* change_mode */
-
- NULL, /* epp_write_data */
- NULL, /* epp_read_data */
- NULL, /* epp_write_addr */
- NULL, /* epp_read_addr */
- NULL, /* epp_check_timeout */
+ arc_enable_irq,
+ arc_disable_irq,
X
- NULL, /* epp_write_block */
- NULL, /* epp_read_block */
+ arc_data_forward,
+ arc_data_reverse,
+
+ arc_interrupt,
X
- NULL, /* ecp_write_block */
- NULL, /* epp_write_block */
-
X arc_init_state,
X arc_save_state,
X arc_restore_state,
X
- arc_enable_irq,
- arc_disable_irq,
- arc_interrupt,
-
X arc_inc_use_count,
X arc_dec_use_count,
- arc_fill_inode
+ arc_fill_inode,
+
+ parport_ieee1284_epp_write_data,
+ parport_ieee1284_epp_read_data,
+ parport_ieee1284_epp_write_addr,
+ parport_ieee1284_epp_read_addr,
+
+ parport_ieee1284_ecp_write_data,
+ parport_ieee1284_ecp_read_data,
+ parport_ieee1284_ecp_write_addr,
+
+ parport_ieee1284_write_compat,
+ parport_ieee1284_read_nibble,
+ parport_ieee1284_read_byte,
X };
X
X /* --- Initialisation code -------------------------------- */
@@ -142,11 +137,11 @@
X /* Archimedes hardware provides only one port, at a fixed address */
X struct parport *p;
X
- if (check_region(PORT_BASE, 4))
+ if (check_region(PORT_BASE, 1))
X return 0;
-
- p = parport_register_port(base, IRQ_PRINTERACK,
- PARPORT_DMA_NONE, &parport_arc_ops);
+
+ p = parport_register_port (PORT_BASE, IRQ_PRINTERACK,
+ PARPORT_DMA_NONE, &parport_arc_ops);
X
X if (!p)
X return 0;
@@ -157,9 +152,6 @@
X printk(KERN_INFO "%s: Archimedes on-board port, using irq %d\n",
X p->irq);
X parport_proc_register(p);
-
- if (parport_probe_hook)
- (*parport_probe_hook)(p);
X
X /* Tell the high-level drivers about the port. */
X parport_announce_port (p);
diff -u --recursive --new-file v2.3.9/linux/drivers/misc/parport_atari.c linux/drivers/misc/parport_atari.c
--- v2.3.9/linux/drivers/misc/parport_atari.c Thu Jun 3 16:21:47 1999
+++ linux/drivers/misc/parport_atari.c Thu Jul 1 14:22:57 1999
@@ -221,9 +221,6 @@
X printk(KERN_INFO "%s: Atari built-in port using irq\n", p->name);
X parport_proc_register(p);
X
- if (parport_probe_hook)
- (*parport_probe_hook)(p);
-
X parport_announce_port (p);
X
X return 1;
diff -u --recursive --new-file v2.3.9/linux/drivers/misc/parport_ax.c linux/drivers/misc/parport_ax.c
--- v2.3.9/linux/drivers/misc/parport_ax.c Wed Jun 9 14:44:25 1999
+++ linux/drivers/misc/parport_ax.c Sun Jul 4 09:53:12 1999
@@ -1,4 +1,4 @@
-/* $Id: parport_ax.c,v 1.19 1999/06/09 08:24:40 davem Exp $
+/* $Id: parport_ax.c,v 1.20 1999/07/03 08:56:21 davem Exp $
X * Parallel-port routines for Sun Ultra/AX architecture
X *
X * Author: Eddie C. Dost <e...@skynet.be>
@@ -164,6 +164,7 @@
X void
X parport_ax_change_mode(struct parport *p, int m)
X {
+ /* FIXME */
X parport_ax_frob_econtrol(p, 0xe0, m << 5);
X }
X
@@ -201,58 +202,40 @@
X writel(dcsr, (unsigned long)&dma->dcsr);
X }
X
-int
-parport_ax_claim_resources(struct parport *p)
-{
-}
-
X void
-parport_ax_init_state(struct parport_state *s)
+parport_ax_init_state(struct pardevice *dev, struct parport_state *s)
X {
- s->u.pc.ctr = 0xc;
- s->u.pc.ecr = 0x0;
+ struct linux_ebus_dma *dma = dev->port->private_data;
+
+ s->u.ax.ctr = 0xc | (dev->irq_func ? 0x10 : 0x0);
+ s->u.ax.ecr = 0x0;
+
+ if (dev->irq_func)
+ s->u.ax.dcsr = (readl((unsigned long)&dma->dcsr)
+ | EBUS_DCSR_INT_EN);
+ else
+ s->u.ax.dcsr = (readl((unsigned long)&dma->dcsr)
+ & ~EBUS_DCSR_INT_EN);
X }
X
X void
X parport_ax_save_state(struct parport *p, struct parport_state *s)
X {
- s->u.pc.ctr = parport_ax_read_control(p);
- s->u.pc.ecr = parport_ax_read_econtrol(p);
+ struct linux_ebus_dma *dma = p->private_data;
+
+ s->u.ax.ctr = parport_ax_read_control(p);
+ s->u.ax.ecr = parport_ax_read_econtrol(p);
+ s->u.ax.dcsr = readl((unsigned long)&dma->dcsr);
X }
X
X void
X parport_ax_restore_state(struct parport *p, struct parport_state *s)
X {
- parport_ax_write_control(p, s->u.pc.ctr);
- parport_ax_write_econtrol(p, s->u.pc.ecr);
-}
-
-size_t
-parport_ax_epp_read_block(struct parport *p, void *buf, size_t length)
-{
- return 0; /* FIXME */
-}
-
-size_t
-parport_ax_epp_write_block(struct parport *p, void *buf, size_t length)
-{
- return 0; /* FIXME */
-}
-
-int
-parport_ax_ecp_read_block(struct parport *p, void *buf, size_t length,
- void (*fn)(struct parport *, void *, size_t),
- void *handle)
-{
- return 0; /* FIXME */
-}
+ struct linux_ebus_dma *dma = p->private_data;
X
-int
-parport_ax_ecp_write_block(struct parport *p, void *buf, size_t length,
- void (*fn)(struct parport *, void *, size_t),
- void *handle)
-{
- return 0; /* FIXME */
+ parport_ax_write_control(p, s->u.ax.ctr);
+ parport_ax_write_econtrol(p, s->u.ax.ecr);
+ writel(s->u.ax.dcsr, (unsigned long)&dma->dcsr);
X }
X
X void
@@ -290,41 +273,36 @@
X parport_ax_read_control,
X parport_ax_frob_control,
X
- parport_ax_write_econtrol,
- parport_ax_read_econtrol,
- parport_ax_frob_econtrol,
-
- parport_ax_write_status,
X parport_ax_read_status,
X
- parport_ax_write_fifo,
- parport_ax_read_fifo,
-
- parport_ax_change_mode,
-
- parport_ax_write_epp,
- parport_ax_read_epp,
- parport_ax_write_epp_addr,
- parport_ax_read_epp_addr,
- parport_ax_check_epp_timeout,
+ parport_ax_enable_irq,
+ parport_ax_disable_irq,
X
- parport_ax_epp_write_block,
- parport_ax_epp_read_block,
+ parport_ax_data_forward,
+ parport_ax_data_reverse,
+
+ parport_ax_interrupt,
X
- parport_ax_ecp_write_block,
- parport_ax_ecp_read_block,
-
X parport_ax_init_state,
X parport_ax_save_state,
X parport_ax_restore_state,
X
- parport_ax_enable_irq,
- parport_ax_disable_irq,
- parport_ax_interrupt,
-
X parport_ax_inc_use_count,
X parport_ax_dec_use_count,
- parport_ax_fill_inode
+ parport_ax_fill_inode,
+
+ parport_ieee1284_epp_write_data,
+ parport_ieee1284_epp_read_data,
+ parport_ieee1284_epp_write_addr,
+ parport_ieee1284_epp_read_addr,
+
+ parport_ieee1284_ecp_write_data,
+ parport_ieee1284_ecp_read_data,
+ parport_ieee1284_ecp_write_addr,
+
+ parport_ieee1284_write_compat,
+ parport_ieee1284_read_nibble,
+ parport_ieee1284_read_byte,
X };
X
X
@@ -539,20 +517,6 @@
X if (p->dma == PARPORT_DMA_AUTO)
X p->dma = (p->modes & PARPORT_MODE_PCECP) ? 0 : PARPORT_DMA_NONE;
X
- if (p->irq != PARPORT_IRQ_NONE) {
- int err;
- if ((err = request_irq(p->irq, parport_ax_interrupt,
- 0, p->name, p)) != 0)
- return err;
- else
- parport_ax_enable_irq(p);
- }
- request_region(p->base, p->size, p->name);
- if (p->modes & PARPORT_MODE_PCECR)
- request_region(p->base+0x400, 3, p->name);
- request_region((unsigned long)p->private_data,
- sizeof(struct linux_ebus_dma), p->name);
-
X printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base);
X if (p->irq != PARPORT_IRQ_NONE)
X printk(", irq %s", __irq_itoa(p->irq));
@@ -569,12 +533,21 @@
X printk("]\n");
X parport_proc_register(p);
X
+ if (p->irq != PARPORT_IRQ_NONE)
+ if ((err = request_irq(p->irq, parport_ax_interrupt,
+ 0, p->name, p)) != 0)
+ return 0; /* @@@ FIXME */
+
+ request_region(p->base, p->size, p->name);
+ if (p->modes & PARPORT_MODE_PCECR)
+ request_region(p->base+0x400, 3, p->name);
+ request_region((unsigned long)p->private_data,
+ sizeof(struct linux_ebus_dma), p->name);
+
X p->ops->write_control(p, 0x0c);
X p->ops->write_data(p, 0);
X
- if (parport_probe_hook)
- (*parport_probe_hook)(p);
-
+ /* Tell the high-level drivers about the port. */
X parport_announce_port (p);
X
X return 1;
diff -u --recursive --new-file v2.3.9/linux/drivers/misc/parport_daisy.c linux/drivers/misc/parport_daisy.c
--- v2.3.9/linux/drivers/misc/parport_daisy.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/misc/parport_daisy.c Sat Jul 3 10:45:04 1999
@@ -0,0 +1,473 @@
+/*
+ * IEEE 1284.3 Parallel port daisy chain and multiplexor code
+ *
+ * Copyright (C) 1999 Tim Waugh <t...@cyberelk.demon.co.uk>
+ *
+ * This program is free software; 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.
+ *
+ * ??-12-1998: Initial implementation.
+ * 31-01-1999: Make port-cloning transparent.
+ * 13-02-1999: Move DeviceID technique from parport_probe.
+ * 13-03-1999: Get DeviceID from non-IEEE 1284.3 devices too.


+ *
+ */
+

+#include <linux/parport.h>
+#include <linux/delay.h>
+#include <asm/uaccess.h>
+
+#define DEBUG /* undef me for production */
+
+#ifdef DEBUG
+#define DPRINTK(stuff...) printk (stuff)
+#else
+#define DPRINTK(stuff...)
+#endif
+
+static struct daisydev {
+ struct daisydev *next;
+ struct parport *port;
+ int daisy;
+ int devnum;
+} *topology = NULL;
+
+static int numdevs = 0;
+
+/* Forward-declaration of lower-level functions. */
+static int mux_present (struct parport *port);
+static int num_mux_ports (struct parport *port);
+static int select_port (struct parport *port);
+static int assign_addrs (struct parport *port);
+
+/* Add a device to the discovered topology. */
+static void add_dev (int devnum, struct parport *port, int daisy)
+{
+ struct daisydev *newdev;
+ newdev = kmalloc (GFP_KERNEL, sizeof (struct daisydev));
+ if (newdev) {
+ newdev->port = port;
+ newdev->daisy = daisy;
+ newdev->devnum = devnum;
+ newdev->next = topology;
+ if (!topology || topology->devnum >= devnum)
+ topology = newdev;
+ else {
+ struct daisydev *prev = topology;
+ while (prev->next && prev->next->devnum < devnum)
+ prev = prev->next;
+ newdev->next = prev->next;
+ prev->next = newdev;
+ }
+ }
+}
+
+/* Clone a parport (actually, make an alias). */
+static struct parport *clone_parport (struct parport *real, int muxport)
+{
+ struct parport *extra = parport_register_port (real->base,
+ real->irq,
+ real->dma,
+ real->ops);
+ if (extra) {
+ extra->portnum = real->portnum;
+ extra->physport = real;
+ extra->muxport = muxport;
+ }
+
+ return extra;
+}
+
+/* Discover the IEEE1284.3 topology on a port -- muxes and daisy chains. */
+int parport_daisy_init (struct parport *port)
+{
+ char *deviceid;
+ static const char *th[] = { /*0*/"th", "st", "nd", "rd", "th" };
+ int num_ports;
+ int i;
+
+ /* Because this is called before any other devices exist,
+ * we don't have to claim exclusive access. */
+
+ /* If mux present on normal port, need to create new
+ * parports for each extra port. */
+ if (port->muxport < 0 && mux_present (port) &&
+ /* don't be fooled: a mux must have 2 or 4 ports. */
+ ((num_ports = num_mux_ports (port)) == 2 || num_ports == 4)) {
+ /* Leave original as port zero. */
+ port->muxport = 0;
+ printk (KERN_INFO
+ "%s: 1st (default) port of %d-way multiplexor\n",
+ port->name, num_ports);
+ for (i = 1; i < num_ports; i++) {
+ /* Clone the port. */
+ struct parport *extra = clone_parport (port, i);
+ if (!extra) {
+ if (signal_pending (current))
+ break;
+
+ schedule ();
+ continue;
+ }
+
+ printk (KERN_INFO
+ "%s: %d%s port of %d-way multiplexor on %s\n",
+ extra->name, i + 1, th[i + 1], num_ports,
+ port->name);
+
+ /* Analyse that port too. We won't recurse
+ forever because of the 'port->muxport < 0'
+ test above. */
+ parport_announce_port (extra);
+ }
+ }
+
+ if (port->muxport >= 0)
+ select_port (port);
+
+ parport_daisy_deselect_all (port);
+ assign_addrs (port);
+
+ /* Count the potential legacy device at the end. */
+ add_dev (numdevs++, port, -1);
+
+ /* Find out the legacy device's IEEE 1284 device ID. */
+ deviceid = kmalloc (1000, GFP_KERNEL);
+ if (deviceid) {
+ parport_device_id (numdevs - 1, deviceid, 1000);
+ kfree (deviceid);


+ }
+
+ return 0;
+}
+

+/* Forget about devices on a physical port. */
+void parport_daisy_fini (struct parport *port)
+{
+ struct daisydev *dev, *prev = topology;
+ while (prev && prev->port == port)
+ prev = topology = topology->next;
+
+ while (prev) {
+ dev = prev->next;
+ if (dev && dev->port == port)
+ prev->next = dev->next;
+
+ prev = prev->next;
+ }
+
+ /* Gaps in the numbering could be handled better. How should
+ someone enumerate through all IEEE1284.3 devices in the
+ topology?. */
+ if (!topology) numdevs = 0;
+ return; }
+
+/* Find a device by canonical device number. */
+struct pardevice *parport_open (int devnum, const char *name,
+ int (*pf) (void *), void (*kf) (void *),
+ void (*irqf) (int, void *, struct pt_regs *),
+ int flags, void *handle)
+{
+ struct parport *port = parport_enumerate ();
+ struct pardevice *dev;
+ int portnum;
+ int muxnum;
+ int daisynum;
+
+ if (parport_device_coords (devnum, &portnum, &muxnum, &daisynum))
+ return NULL;
+
+ while (port && ((port->portnum != portnum) ||
+ (port->muxport != muxnum)))
+ port = port->next;
+
+ if (!port)
+ /* No corresponding parport. */
+ return NULL;
+
+ dev = parport_register_device (port, name, pf, kf,
+ irqf, flags, handle);
+ if (dev)
+ dev->daisy = daisynum;
+
+ /* Check that there really is a device to select. */
+ if (daisynum >= 0) {
+ int selected;
+ parport_claim_or_block (dev);
+ selected = port->daisy;
+ parport_release (dev);
+
+ if (selected != port->daisy) {
+ /* No corresponding device. */
+ parport_unregister_device (dev);
+ return NULL;
+ }
+ }
+
+ return dev;
+}
+
+/* The converse of parport_open. */
+void parport_close (struct pardevice *dev)
+{
+ parport_unregister_device (dev);
+}
+
+/* Convert device coordinates into a canonical device number. */
+int parport_device_num (int parport, int mux, int daisy)
+{
+ struct daisydev *dev = topology;
+
+ while (dev && dev->port->portnum != parport &&
+ dev->port->muxport != mux && dev->daisy != daisy)
+ dev = dev->next;
+
+ if (!dev)
+ return -ENXIO;
+
+ return dev->devnum;
+}
+
+/* Convert a canonical device number into device coordinates. */
+int parport_device_coords (int devnum, int *parport, int *mux, int *daisy)
+{
+ struct daisydev *dev = topology;
+
+ while (dev && dev->devnum != devnum)
+ dev = dev->next;
+
+ if (!dev)
+ return -ENXIO;
+
+ if (parport) *parport = dev->port->portnum;
+ if (mux) *mux = dev->port->muxport;
+ if (daisy) *daisy = dev->daisy;


+ return 0;
+}
+

+/* Send a daisy-chain-style CPP command packet. */
+static int cpp_daisy (struct parport *port, int cmd)
+{
+ unsigned char s;
+
+ parport_write_data (port, 0xaa); udelay (2);
+ parport_write_data (port, 0x55); udelay (2);
+ parport_write_data (port, 0x00); udelay (2);
+ parport_write_data (port, 0xff); udelay (2);
+ s = parport_read_status (port) & (PARPORT_STATUS_BUSY
+ | PARPORT_STATUS_PAPEROUT
+ | PARPORT_STATUS_SELECT
+ | PARPORT_STATUS_ERROR);
+ if (s != (PARPORT_STATUS_BUSY
+ | PARPORT_STATUS_PAPEROUT
+ | PARPORT_STATUS_SELECT
+ | PARPORT_STATUS_ERROR)) {
+ DPRINTK (KERN_DEBUG "%s: cpp_daisy: aa5500ff(%02x)\n",
+ port->name, s);


+ return -ENXIO;
+ }
+

+ parport_write_data (port, 0x87); udelay (2);
+ s = parport_read_status (port) & (PARPORT_STATUS_BUSY
+ | PARPORT_STATUS_PAPEROUT
+ | PARPORT_STATUS_SELECT
+ | PARPORT_STATUS_ERROR);
+ if (s != (PARPORT_STATUS_SELECT | PARPORT_STATUS_ERROR)) {
+ DPRINTK (KERN_DEBUG "%s: cpp_daisy: aa5500ff87(%02x)\n",
+ port->name, s);


+ return -ENXIO;
+ }
+

+ parport_write_data (port, 0x78); udelay (2);
+ parport_write_data (port, cmd); udelay (2);
+ parport_frob_control (port,
+ PARPORT_CONTROL_STROBE,
+ PARPORT_CONTROL_STROBE);
+ udelay (1);
+ parport_frob_control (port, PARPORT_CONTROL_STROBE, 0);
+ udelay (1);
+ s = parport_read_status (port);
+ parport_write_data (port, 0xff); udelay (2);
+
+ return s;
+}
+
+/* Send a mux-style CPP command packet. */
+static int cpp_mux (struct parport *port, int cmd)
+{
+ unsigned char s;
+ int rc;
+
+ parport_write_data (port, 0xaa); udelay (2);
+ parport_write_data (port, 0x55); udelay (2);
+ parport_write_data (port, 0xf0); udelay (2);
+ parport_write_data (port, 0x0f); udelay (2);
+ parport_write_data (port, 0x52); udelay (2);
+ parport_write_data (port, 0xad); udelay (2);
+ parport_write_data (port, cmd); udelay (2);
+
+ s = parport_read_status (port);
+ if (!(s & PARPORT_STATUS_ACK)) {
+ DPRINTK (KERN_DEBUG "%s: cpp_mux: aa55f00f52ad%02x(%02x)\n",
+ port->name, cmd, s);


+ return -EIO;
+ }
+

+ rc = (((s & PARPORT_STATUS_SELECT ? 1 : 0) << 0) |
+ ((s & PARPORT_STATUS_PAPEROUT ? 1 : 0) << 1) |
+ ((s & PARPORT_STATUS_BUSY ? 0 : 1) << 2) |
+ ((s & PARPORT_STATUS_ERROR ? 0 : 1) << 3));
+
+ return rc;
+}
+
+void parport_daisy_deselect_all (struct parport *port)
+{
+ cpp_daisy (port, 0x30);
+}
+
+int parport_daisy_select (struct parport *port, int daisy, int mode)
+{
+ /* mode is currently ignored. FIXME? */
+ return cpp_daisy (port, 0xe0 + daisy) & PARPORT_STATUS_ERROR;
+}
+
+static int mux_present (struct parport *port)
+{
+ return cpp_mux (port, 0x51) == 3;
+}
+
+static int num_mux_ports (struct parport *port)
+{
+ return cpp_mux (port, 0x58);
+}
+
+static int select_port (struct parport *port)
+{
+ int muxport = port->muxport;
+ return cpp_mux (port, 0x60 + muxport) == muxport;
+}
+
+static int assign_addrs (struct parport *port)
+{
+ unsigned char s, last_dev;
+ unsigned char daisy;
+ int thisdev = numdevs;
+ char *deviceid;
+
+ parport_write_data (port, 0xaa); udelay (2);
+ parport_write_data (port, 0x55); udelay (2);
+ parport_write_data (port, 0x00); udelay (2);
+ parport_write_data (port, 0xff); udelay (2);
+ s = parport_read_status (port) & (PARPORT_STATUS_BUSY
+ | PARPORT_STATUS_PAPEROUT
+ | PARPORT_STATUS_SELECT
+ | PARPORT_STATUS_ERROR);
+ if (s != (PARPORT_STATUS_BUSY
+ | PARPORT_STATUS_PAPEROUT
+ | PARPORT_STATUS_SELECT
+ | PARPORT_STATUS_ERROR)) {
+ DPRINTK (KERN_DEBUG "%s: assign_addrs: aa5500ff(%02x)\n",
+ port->name, s);


+ return -ENXIO;
+ }
+

+ parport_write_data (port, 0x87); udelay (2);
+ s = parport_read_status (port) & (PARPORT_STATUS_BUSY
+ | PARPORT_STATUS_PAPEROUT
+ | PARPORT_STATUS_SELECT
+ | PARPORT_STATUS_ERROR);
+ if (s != (PARPORT_STATUS_SELECT | PARPORT_STATUS_ERROR)) {
+ DPRINTK (KERN_DEBUG "%s: assign_addrs: aa5500ff87(%02x)\n",
+ port->name, s);


+ return -ENXIO;
+ }
+

+ parport_write_data (port, 0x78); udelay (2);
+ last_dev = 0; /* We've just been speaking to a device, so we
+ know there must be at least _one_ out there. */
+
+ for (daisy = 0; daisy < 4; daisy++) {
+ parport_write_data (port, daisy);
+ udelay (2);
+ parport_frob_control (port,
+ PARPORT_CONTROL_STROBE,
+ PARPORT_CONTROL_STROBE);
+ udelay (1);
+ parport_frob_control (port, PARPORT_CONTROL_STROBE, 0);
+ udelay (1);
+
+ if (last_dev)
+ /* No more devices. */
+ break;
+
+ last_dev = !(parport_read_status (port)
+ & PARPORT_STATUS_BUSY);
+
+ add_dev (numdevs++, port, daisy);
+ }
+
+ parport_write_data (port, 0xff); udelay (2);
+ DPRINTK (KERN_DEBUG "%s: Found %d daisy-chained devices\n", port->name,
+ numdevs - thisdev);
+
+ /* Ask the new devices to introduce themselves. */
+ deviceid = kmalloc (1000, GFP_KERNEL);
+ if (!deviceid) return 0;
+
+ for (daisy = 0; thisdev < numdevs; thisdev++, daisy++)
+ parport_device_id (thisdev, deviceid, 1000);
+
+ kfree (deviceid);


+ return 0;
+}
+

+/* Find a device with a particular manufacturer and model string,
+ starting from a given device number. Like the PCI equivalent,
+ 'from' itself is skipped. */
+int parport_find_device (const char *mfg, const char *mdl, int from)
+{
+ struct daisydev *d = topology; /* sorted by devnum */
+
+ /* Find where to start. */
+ while (d && d->devnum <= from)
+ d = d->next;
+
+ /* Search. */
+ while (d) {
+ struct parport_device_info *info;
+ info = &d->port->probe_info[1 + d->daisy];
+ if ((!mfg || !strcmp (mfg, info->mfr)) &&
+ (!mdl || !strcmp (mdl, info->model)))
+ break;
+
+ d = d->next;
+ }
+
+ if (d)
+ return d->devnum;
+


+ return -1;
+}
+

+/* Find a device in a particular class. Like the PCI equivalent,
+ 'from' itself is skipped. */
+int parport_find_class (parport_device_class cls, int from)
+{
+ struct daisydev *d = topology; /* sorted by devnum */
+
+ /* Find where to start. */
+ while (d && d->devnum <= from)
+ d = d->next;
+
+ /* Search. */
+ while (d && d->port->probe_info[1 + d->daisy].class != cls)
+ d = d->next;
+
+ if (d)
+ return d->devnum;
+
+ return -1;
+}
diff -u --recursive --new-file v2.3.9/linux/drivers/misc/parport_ieee1284.c linux/drivers/misc/parport_ieee1284.c
--- v2.3.9/linux/drivers/misc/parport_ieee1284.c Mon May 10 10:26:31 1999
+++ linux/drivers/misc/parport_ieee1284.c Wed Jul 7 12:55:47 1999
@@ -4,12 +4,73 @@
X * Authors: Phil Blundell <Philip....@pobox.com>
X * Carsten Gross <car...@sol.wohnheim.uni-ulm.de>
X * Jose Renau <re...@acm.org>
+ * Tim Waugh <t...@cyberelk.demon.co.uk> (largely rewritten)
+ *
+ * This file is responsible for IEEE 1284 negotiation, and for handing
+ * read/write requests to low-level drivers.


X */
X
+#include <linux/config.h>

X #include <linux/tasks.h>
X #include <linux/parport.h>
X #include <linux/delay.h>
X #include <linux/kernel.h>
+#include <linux/interrupt.h>
+
+#undef DEBUG /* undef me for production */
+
+#ifdef CONFIG_LP_CONSOLE
+#undef DEBUG /* Don't want a garbled console */
+#endif
+
+#ifdef DEBUG
+#define DPRINTK(stuff...) printk (stuff)
+#else
+#define DPRINTK(stuff...)
+#endif
+
+/* Make parport_wait_peripheral wake up.
+ * It will be useful to call this from an interrupt handler. */
+void parport_ieee1284_wakeup (struct parport *port)
+{
+ up (&port->physport->ieee1284.irq);
+}
+
+static struct parport *port_from_cookie[PARPORT_MAX];
+static void timeout_waiting_on_port (unsigned long cookie)
+{
+ parport_ieee1284_wakeup (port_from_cookie[cookie % PARPORT_MAX]);
+}
+
+/* Wait for a parport_ieee1284_wakeup.
+ * 0: success
+ * <0: error (exit as soon as possible)
+ * >0: timed out
+ */
+int parport_wait_event (struct parport *port, signed long timeout)
+{
+ int ret;
+ struct timer_list timer;
+
+ if (!port->physport->cad->timeout)
+ /* Zero timeout is special, and we can't down() the
+ semaphore. */
+ return 1;
+
+ init_timer (&timer);
+ timer.expires = jiffies + timeout;
+ timer.function = timeout_waiting_on_port;
+ port_from_cookie[port->number % PARPORT_MAX] = port;
+ timer.data = port->number;
+
+ add_timer (&timer);
+ ret = down_interruptible (&port->physport->ieee1284.irq);
+ if (!del_timer (&timer) && !ret)
+ /* Timed out. */
+ ret = 1;
+


+ return ret;
+}
X

X /* Wait for Status line(s) to change in 35 ms - see IEEE1284-1994 page 24 to
X * 25 for this. After this time we can create a timeout because the
@@ -19,53 +80,446 @@
X * are able to eat the time up to 40ms.
X */
X
-int parport_wait_peripheral(struct parport *port, unsigned char mask,
- unsigned char result)
+int parport_wait_peripheral(struct parport *port,
+ unsigned char mask,
+ unsigned char result)
X {
X int counter;
- unsigned char status;
-
- for (counter = 0; counter < 20; counter++) {
- status = parport_read_status(port);
+ long deadline;


+ unsigned char status;
+

+ counter = port->physport->spintime; /* usecs of fast polling */
+ if (!port->physport->cad->timeout)
+ /* A zero timeout is "special": busy wait for the
+ entire 35ms. */
+ counter = 35000;
+
+ /* Fast polling.
+ *
+ * This should be adjustable.
+ * How about making a note (in the device structure) of how long
+ * it takes, so we know for next time?
+ */
+ for (counter /= 5; counter > 0; counter--) {
+ status = parport_read_status (port);
X if ((status & mask) == result)
X return 0;
- udelay(25);
+ if (signal_pending (current))
+ return -EINTR;
X if (current->need_resched)
- schedule();
+ break;
+ udelay(5);
X }
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(HZ/25); /* wait for 40ms */
- status = parport_read_status(port);
- return ((status & mask) == result)?0:1;
+
+ if (!port->physport->cad->timeout)
+ /* We may be in an interrupt handler, so we can't poll
+ * slowly anyway. */
+ return 1;
+
+ /* 40ms of slow polling. */
+ deadline = jiffies + (HZ + 24) / 25;
+ while (time_before (jiffies, deadline)) {
+ int ret;
+
+ if (signal_pending (current))
+ return -EINTR;
+
+ /* Wait for 10ms (or until an interrupt occurs if
+ * the handler is set) */
+ if ((ret = parport_wait_event (port, (HZ + 99) / 100)) < 0)
+ return ret;
+
+ status = parport_read_status (port);
+ if ((status & mask) == result)
+ return 0;
+
+ if (!ret) {
+ /* parport_wait_event didn't time out, but the
+ * peripheral wasn't actually ready either.
+ * Wait for another 10ms. */
+ current->state = TASK_INTERRUPTIBLE;
+ schedule_timeout ((HZ+ 99) / 100);
+ }
+ }
+
+ return 1;
+}
+
+#ifdef CONFIG_PARPORT_1284
+/* Terminate a negotiated mode. */
+static void parport_ieee1284_terminate (struct parport *port)
+{
+ port = port->physport;
+
+ port->ieee1284.phase = IEEE1284_PH_TERMINATE;
+
+ /* EPP terminates differently. */
+ switch (port->ieee1284.mode) {
+ case IEEE1284_MODE_EPP:
+ case IEEE1284_MODE_EPPSL:
+ case IEEE1284_MODE_EPPSWE:
+ /* Terminate from EPP mode. */
+
+ /* Event 68: Set nInit low */
+ parport_frob_control (port,
+ PARPORT_CONTROL_INIT,
+ PARPORT_CONTROL_INIT);
+ udelay (50);
+
+ /* Event 69: Set nInit high, nSelectIn low */
+ parport_frob_control (port,
+ PARPORT_CONTROL_SELECT,
+ PARPORT_CONTROL_SELECT);


+ break;
+
+ default:

+ /* Terminate from all other modes. */
+
+ /* Event 22: Set nSelectIn low, nAutoFd high */
+ parport_frob_control (port,
+ PARPORT_CONTROL_SELECT
+ | PARPORT_CONTROL_AUTOFD,
+ PARPORT_CONTROL_SELECT);
+
+ /* Event 24: nAck goes low */
+ parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0);
+
+ /* Event 25: Set nAutoFd low */
+ parport_frob_control (port,
+ PARPORT_CONTROL_AUTOFD,
+ PARPORT_CONTROL_AUTOFD);
+
+ /* Event 27: nAck goes high */
+ parport_wait_peripheral (port,
+ PARPORT_STATUS_ACK,
+ PARPORT_STATUS_ACK);
+
+ /* Event 29: Set nAutoFd high */
+ parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
+ }
+
+ port->ieee1284.mode = IEEE1284_MODE_COMPAT;
+ port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
+
+ DPRINTK (KERN_DEBUG "%s: In compatibility (forward idle) mode\n",
+ port->name);
X }
+#endif /* IEEE1284 support */
X
-/* Test if the peripheral is IEEE 1284 compliant.
+/* Negotiate an IEEE 1284 mode.
X * return values are:
- * 0 - handshake failed; peripheral is not compliant (or none present)
- * 1 - handshake OK; IEEE1284 peripheral present but no data available
- * 2 - handshake OK; IEEE1284 peripheral and data available
+ * 0 - handshake OK; IEEE1284 peripheral and mode available
+ * -1 - handshake failed; peripheral is not compliant (or none present)
+ * 1 - handshake OK; IEEE1284 peripheral present but mode not available
X */
-int parport_ieee1284_nibble_mode_ok(struct parport *port, unsigned char mode)
+int parport_negotiate (struct parport *port, int mode)
X {
- /* make sure it's a valid state, set nStrobe & nAutoFeed high */
- parport_frob_control (port, (1|2), 0);
- udelay(1);
- parport_write_data(port, mode);
- udelay(400);
- /* nSelectIn high, nAutoFd low */
- parport_frob_control(port, (2|8), 2);
- if (parport_wait_peripheral(port, 0x78, 0x38)) {


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

echo 'End of part 15'
echo 'File patch-2.3.10 is continued in part 16'
echo 16 > _shar_seq_.tmp
exit 0

Thomas Kobienia

unread,
Jul 9, 1999, 3:00:00 AM7/9/99
to
Archive-name: v2.3/patch-2.3.10/part11

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


# do not concatenate these parts, unpack them in order with /bin/sh
# file patch-2.3.10 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.3.10'
else
echo 'x - continuing with patch-2.3.10'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.3.10' &&

X NULL, /* Seek */
X pcwd_read, /* Read */
@@ -539,14 +577,14 @@
X #ifdef MODULE


X int init_module(void)
X #else

-__initfunc(int pcwatchdog_init(void))
+int __init pcwatchdog_init(void)
X #endif
X {
X int i, found = 0;
X
X revision = PCWD_REVISION_A;
X
- printk("pcwd: v%s Ken Hollis (kho...@nurk.org)\n", WD_VER);
+ printk("pcwd: v%s Ken Hollis (ke...@bitgate.com)\n", WD_VER);
X
X /* Initial variables */
X is_open = 0;
@@ -588,6 +626,9 @@
X printk("pcwd: Unable to get revision.\n");
X return -1;
X }
+
+ if (supports_temp)
+ printk("pcwd: Temperature Option Detected.\n");
X
X debug_off();
X
diff -u --recursive --new-file v2.3.9/linux/drivers/char/ppdev.c linux/drivers/char/pp