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

Linux Kernel Patch v2.1, patch-2.2.0-pre6 (0/8)

6 views
Skip to first unread message

Thomas...@ciw.uni-karlsruhe.de

unread,
Jan 10, 1999, 3:00:00 AM1/10/99
to
Archive-name: v2.1/patch-2.2.0-pre6/part0

lines added deleted
linux/CREDITS : 42 20 2
linux/Documentation/cdrom/mcdx : 15 2 2
linux/Documentation/digiboard.txt : 8 1 1
linux/Documentation/digiepca.txt : 17 2 2
linux/Documentation/fb/matroxfb.txt : 27 12 2
linux/Documentation/isdn/README.act2000 : 8 1 1
linux/Documentation/isdn/README.concap : 17 2 2
linux/Documentation/isdn/README.x25 : 8 1 1
linux/Documentation/locks.txt : 8 1 1
linux/Documentation/m68k/kernel-options.txt : 8 1 1
linux/Documentation/networking/6pack.txt : 17 2 2
linux/Documentation/networking/arcnet-hardware.txt : 8 1 1
linux/Documentation/networking/cops.txt : 8 1 1
linux/Documentation/networking/de4x5.txt : 8 1 1
linux/Documentation/sound/AudioExcelDSP16 : 8 1 1
linux/Documentation/sound/OPL3-SA2 : 40 7 20
linux/Documentation/sound/VIA-chipset : 43 43 0
linux/Documentation/sysctl/README : 8 1 1
linux/Documentation/video4linux/API.html : 8 1 1
linux/Makefile : 8 1 1
linux/README : 32 4 4
linux/REPORTING-BUGS : 56 56 0
linux/arch/alpha/kernel/process.c : 7 0 1
linux/arch/i386/config.in : 8 2 0
linux/arch/i386/kernel/apm.c : 197 36 32
linux/arch/i386/kernel/entry.S : 16 3 2
linux/arch/i386/kernel/process.c : 18 12 0
linux/arch/i386/kernel/ptrace.c : 45 5 6
linux/arch/i386/kernel/setup.c : 8 1 1
linux/arch/m68k/amiga/amiints.c : 17 2 2
linux/arch/m68k/apollo/dn_ints.c : 8 1 1
linux/arch/m68k/kernel/signal.c : 17 2 2
linux/arch/ppc/amiga/amiints.c : 17 2 2
linux/arch/ppc/boot/ns16550.c : 56 56 0
linux/arch/ppc/boot/ns16550.h : 34 34 0
linux/arch/ppc/common_defconfig : 19 3 2
linux/arch/ppc/kernel/mbx_setup.c : 33 9 6
linux/arch/ppc/kernel/pci.c : 33 4 3
linux/arch/ppc/kernel/ppc_ksyms.c : 7 1 0
linux/arch/ppc/kernel/process.c : 46 14 14
linux/arch/ppc/kernel/setup.c : 49 11 3
linux/arch/ppc/mm/init.c : 24 4 2
linux/arch/sparc/lib/checksum.S : 17 2 2
linux/drivers/acorn/block/fd1772.c : 8 1 1
linux/drivers/block/ide-dma.c : 27 8 1
linux/drivers/block/ide-tape.c : 8 1 1
linux/drivers/block/xd.c : 8 1 1
linux/drivers/cdrom/cdrom.c : 53 6 6
linux/drivers/cdrom/sonycd535.c : 106 14 9
linux/drivers/char/README.epca : 28 4 4
linux/drivers/char/console.c : 20 7 0
linux/drivers/char/keyboard.c : 15 7 2
linux/drivers/char/n_tty.c : 54 13 7
linux/drivers/char/radio-zoltrix.c : 291 117 52
linux/drivers/char/tty_io.c : 69 20 12
linux/drivers/isdn/icn/icn.h : 11 2 2
linux/drivers/isdn/isdn_x25iface.c : 8 1 1
linux/drivers/misc/Makefile : 11 1 4
linux/drivers/misc/parport_arc.c : 7 0 1
linux/drivers/misc/parport_ax.c : 7 0 1
linux/drivers/misc/parport_procfs.c : 7 1 0
linux/drivers/net/3c515.c : 8 1 1
linux/drivers/net/3c523.c : 8 1 1
linux/drivers/net/3c59x.c : 1882 487 533
linux/drivers/net/82596.c : 8 1 1
linux/drivers/net/8390.c : 12 6 0
linux/drivers/net/Makefile : 8 1 1
linux/drivers/net/acenic.c : 332 74 95
linux/drivers/net/acenic.h : 11 3 0
linux/drivers/net/acenic_firmware.h : 44 5 5
linux/drivers/net/ariadne2.c : 16 2 1
linux/drivers/net/at1700.c : 12 2 0
linux/drivers/net/cops.h : 8 1 1
linux/drivers/net/dgrs_i82596.h : 17 2 2
linux/drivers/net/eepro.c : 1157 338 304
linux/drivers/net/eexpress.c : 17 2 2
linux/drivers/net/eth16i.c : 14 2 2
linux/drivers/net/hp100.c : 8 1 1
linux/drivers/net/ne2.c : 37 6 4
linux/drivers/net/rcmtl.h : 8 1 1
linux/drivers/net/sdladrv.c : 8 1 1
linux/drivers/net/sktr.c : 35 4 4
linux/drivers/net/sktr_firmware.h : 7 1 1
linux/drivers/net/sonic.c : 8 1 1
linux/drivers/net/tlan.c : 8 1 1
linux/drivers/net/z85230.c : 8 1 1
linux/drivers/net/znet.c : 13 2 2
linux/drivers/pci/quirks.c : 8 1 1
linux/drivers/sbus/audio/amd7930.c : 8 1 1
linux/drivers/sbus/audio/dbri.h : 8 1 1
linux/drivers/sbus/char/vfc_i2c.c : 17 2 2
linux/drivers/scsi/README.ncr53c8xx : 17 2 2
linux/drivers/scsi/aic7xxx/aic7xxx.reg : 8 1 1
linux/drivers/scsi/eata_dma_proc.c : 5 0 2
linux/drivers/scsi/eata_pio_proc.c : 5 0 2
linux/drivers/scsi/imm.h : 7 1 0
linux/drivers/scsi/ppa.h : 7 1 0
linux/drivers/scsi/scsi.c : 8 1 1
linux/drivers/scsi/scsi_error.c : 8 1 1
linux/drivers/scsi/wd7000.c : 8 1 1
linux/drivers/sound/ad1848.c : 18 4 1
linux/drivers/sound/dev_table.h : 28 8 0
linux/drivers/sound/es1370.c : 35 5 3
linux/drivers/sound/es1371.c : 26 4 2
linux/drivers/sound/gus_card.c : 23 6 3
linux/drivers/sound/gus_wave.c : 7 0 1
linux/drivers/sound/lowlevel/awe_compat.h : 24 0 11
linux/drivers/sound/mad16.c : 32 15 8
linux/drivers/sound/opl3sa2.c : 245 43 114
linux/drivers/sound/sb.h : 12 2 1
linux/drivers/sound/sb_audio.c : 191 70 71
linux/drivers/sound/sb_common.c : 78 27 9
linux/drivers/sound/sb_mixer.c : 323 170 92
linux/drivers/sound/sb_mixer.h : 88 1 70
linux/drivers/sound/sonicvibes.c : 35 5 3
linux/drivers/sound/sound_core.c : 17 3 4
linux/drivers/sound/waveartist.c : 1956 1956 0
linux/drivers/sound/waveartist.h : 68 68 0
linux/drivers/video/matroxfb.c : 213 43 18
linux/fs/buffer.c : 44 5 5
linux/fs/coda/psdev.c : 8 1 1
linux/fs/coda/upcall.c : 8 1 1
linux/fs/dcache.c : 28 18 2
linux/fs/nfsd/stats.c : 7 0 1
linux/fs/super.c : 19 2 3
linux/fs/ufs/dir.c : 18 1 4
linux/fs/ufs/super.c : 72 23 5
linux/include/asm-alpha/pci.h : 8 1 1
linux/include/asm-alpha/termbits.h : 17 11 0
linux/include/asm-arm/a.out.h : 9 5 0
linux/include/asm-arm/arch-arc/a.out.h : 7 0 1
linux/include/asm-arm/arch-arc/dma.h : 14 0 8
linux/include/asm-arm/arch-arc/hardware.h : 9 2 0
linux/include/asm-arm/arch-arc/io.h : 119 16 16
linux/include/asm-arm/arch-arc/processor.h : 7 0 1
linux/include/asm-arm/arch-arc/system.h : 33 8 8
linux/include/asm-arm/arch-ebsa110/a.out.h : 7 0 1
linux/include/asm-arm/arch-ebsa110/dma.h : 15 0 9
linux/include/asm-arm/arch-ebsa110/hardware.h : 8 1 1
linux/include/asm-arm/arch-ebsa110/io.h : 101 14 14
linux/include/asm-arm/arch-ebsa110/processor.h : 7 0 1
linux/include/asm-arm/arch-ebsa110/system.h : 14 1 2
linux/include/asm-arm/arch-ebsa110/time.h : 30 6 0
linux/include/asm-arm/arch-ebsa285/a.out.h : 7 0 1
linux/include/asm-arm/arch-ebsa285/dma.h : 20 0 9
linux/include/asm-arm/arch-ebsa285/hardware.h : 83 4 60
linux/include/asm-arm/arch-ebsa285/io.h : 161 59 14
linux/include/asm-arm/arch-ebsa285/irq.h : 7 0 1
linux/include/asm-arm/arch-ebsa285/mmu.h : 17 4 4
linux/include/asm-arm/arch-ebsa285/processor.h : 7 0 1
linux/include/asm-arm/arch-ebsa285/serial.h : 7 1 0
linux/include/asm-arm/arch-ebsa285/system.h : 36 17 10
linux/include/asm-arm/arch-ebsa285/time.h : 40 8 2
linux/include/asm-arm/arch-ebsa285/uncompress.h : 41 14 16
linux/include/asm-arm/arch-nexuspci/a.out.h : 7 0 1
linux/include/asm-arm/arch-nexuspci/dma.h : 6 0 3
linux/include/asm-arm/arch-nexuspci/hardware.h : 7 1 1
linux/include/asm-arm/arch-nexuspci/processor.h : 7 0 1
linux/include/asm-arm/arch-nexuspci/system.h : 14 1 2
linux/include/asm-arm/arch-rpc/a.out.h : 7 0 1
linux/include/asm-arm/arch-rpc/dma.h : 15 0 9
linux/include/asm-arm/arch-rpc/hardware.h : 7 1 0
linux/include/asm-arm/arch-rpc/io.h : 101 14 14
linux/include/asm-arm/arch-rpc/processor.h : 7 0 1
linux/include/asm-arm/arch-rpc/system.h : 12 2 2
linux/include/asm-arm/arch-vnc/a.out.h : 7 0 1
linux/include/asm-arm/arch-vnc/dma.h : 15 0 9
linux/include/asm-arm/arch-vnc/hardware.h : 30 26 1
linux/include/asm-arm/arch-vnc/io.h : 71 8 8
linux/include/asm-arm/arch-vnc/irqs.h : 26 7 2
linux/include/asm-arm/arch-vnc/processor.h : 7 0 1
linux/include/asm-arm/arch-vnc/system.h : 27 2 6
linux/include/asm-arm/arch-vnc/time.h : 90 61 3
linux/include/asm-arm/atomic.h : 26 10 4
linux/include/asm-arm/byteorder.h : 29 12 3
linux/include/asm-arm/dec21285.h : 184 68 101
linux/include/asm-arm/dma.h : 37 20 0
linux/include/asm-arm/hardware.h : 259 2 251
linux/include/asm-arm/init.h : 17 4 1
linux/include/asm-arm/io.h : 17 3 1
linux/include/asm-arm/ioc.h : 56 56 0
linux/include/asm-arm/iomd.h : 180 180 0
linux/include/asm-arm/leds.h : 19 5 1
linux/include/asm-arm/memc.h : 13 13 0
linux/include/asm-arm/proc-armo/pgtable.h : 21 4 4
linux/include/asm-arm/proc-armo/system.h : 122 48 48
linux/include/asm-arm/proc-armv/mm-init.h : 8 1 1
linux/include/asm-arm/proc-armv/page.h : 19 5 0
linux/include/asm-arm/proc-armv/semaphore.h : 119 51 41
linux/include/asm-arm/proc-armv/system.h : 161 63 61
linux/include/asm-arm/proc-armv/uaccess.h : 8 1 1
linux/include/asm-arm/semaphore.h : 12 2 1
linux/include/asm-arm/signal.h : 26 5 1
linux/include/asm-arm/softirq.h : 24 3 3
linux/include/asm-arm/spinlock.h : 33 12 4
linux/include/asm-arm/termbits.h : 25 15 4
linux/include/asm-arm/timex.h : 13 9 0
linux/include/asm-arm/unistd.h : 148 90 33
linux/include/asm-i386/termbits.h : 25 15 4
linux/include/asm-i386/unistd.h : 7 1 0
linux/include/asm-m68k/termbits.h : 25 15 4
linux/include/asm-mips/termbits.h : 25 15 4
linux/include/asm-ppc/bitops.h : 23 11 1
linux/include/asm-ppc/dma.h : 19 7 0
linux/include/asm-ppc/ide.h : 70 16 8
linux/include/asm-ppc/pgtable.h : 16 3 1
linux/include/asm-ppc/termbits.h : 17 11 0
linux/include/linux/mm.h : 18 4 3
linux/include/linux/nls.h : 7 1 0
linux/include/linux/sched.h : 26 4 2
linux/include/linux/sunrpc/stats.h : 7 1 0
linux/include/linux/sunrpc/xprt.h : 8 1 1
linux/include/linux/tty.h : 15 2 0
linux/include/linux/ufs_fs.h : 14 2 2
linux/include/net/br.h : 6 1 1
linux/include/net/ip_masq.h : 9 2 1
linux/kernel/exit.c : 7 1 0
linux/kernel/fork.c : 17 4 0
linux/mm/page_alloc.c : 18 1 4
linux/mm/vmscan.c : 22 8 1
linux/net/bridge/br.c : 97 16 16
linux/net/bridge/br_tree.c : 40 8 3
linux/net/core/dev.c : 29 13 3
linux/net/ipv4/ip_fw.c : 76 21 7
linux/net/ipv4/tcp.c : 8 1 1
linux/net/netrom/af_netrom.c : 19 8 1
linux/net/netsyms.c : 21 6 2
linux/net/sched/sch_api.c : 8 1 1
linux/net/sched/sch_csz.c : 8 1 1
linux/net/sunrpc/sched.c : 10 4 0
linux/net/sunrpc/sysctl.c : 7 1 0
linux/net/sunrpc/xprt.c : 21 9 2
linux/net/wanrouter/patchlevel : 3 1 2
linux/scripts/header.tk : 8 1 1
linux/scripts/mkdep.c : 38 5 5
linux/scripts/tkgen.c : 7 1 0
linux/scripts/ver_linux : 29 29 0
--
Thomas Koenig, Thomas...@ciw.uni-karlsruhe.de, ig...@dkauni2.bitnet.
The joy of engineering is to find a straight line on a double
logarithmic diagram.

Thomas...@ciw.uni-karlsruhe.de

unread,
Jan 10, 1999, 3:00:00 AM1/10/99
to
Archive-name: v2.1/patch-2.2.0-pre6/part1

#!/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 1 of a 8 - 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.2.0-pre6 ==============
if test -f 'patch-2.2.0-pre6' -a X"$1" != X"-c"; then
echo 'x - skipping patch-2.2.0-pre6 (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting patch-2.2.0-pre6 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'patch-2.2.0-pre6' &&
diff -u --recursive --new-file v2.2.0-pre5/linux/CREDITS linux/CREDITS
--- v2.2.0-pre5/linux/CREDITS Thu Jan 7 15:11:35 1999
+++ linux/CREDITS Thu Jan 7 08:41:54 1999
@@ -1581,8 +1581,8 @@
X S: France
X
X N: Rik van Riel
-E: H.H.v...@phys.uu.nl
-W: http://www.phys.uu.nl/~riel/
+E: H.H.v...@humbolt.geo.uu.nl
+W: http://humbolt.geo.uu.nl/
X D: Maintainer of the mm-patches page (see www.linuxhq.com)
X D: Documentation/sysctl/*, kswapd fixes, random kernel hacker
X S: Vorenkampsweg 1
@@ -1631,6 +1631,14 @@
X E: rub...@ipvvis.unipv.it
X D: the gpm mouse server and kernel support for it
X
+N: Philipp Rumpf
+E: pru...@jcsbs.lanobis.de
+D: ipi_count for x86
+D: random bugfixes
+S: Rueting 4
+S: 23743 Groemitz
+S: Germany
+
X N: Paul Russell
X E: Paul.R...@rustcorp.com.au
X W: http://www.rustcorp.com
@@ -1719,6 +1727,16 @@
X D: wd33c93 SCSI driver (linux-m68k)
X S: San Jose, California
X S: USA
+
+N: Jaspreet Singh
+E: jasp...@sangoma.com
+W: www.sangoma.com
+D: WANPIPE driver for Sangoma S508/FT1 cards
+S: Sangoma Technologies Inc.,
+S: 1001 Denison Street
+S: Suite 101
+S: Markham, Ontario L3R 2Z6
+S: Canada
X
X N: Rick Sladkey
X E: j...@world.std.com
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/cdrom/mcdx linux/Documentation/cdrom/mcdx
--- v2.2.0-pre5/linux/Documentation/cdrom/mcdx Sat May 2 14:19:50 1998
+++ linux/Documentation/cdrom/mcdx Thu Jan 7 08:41:54 1999
@@ -21,13 +21,13 @@
X
X This driver:
X
- o handles XA (and hopefully) multi session CDs as well as
+ o handles XA and (hopefully) multi session CDs as well as
X ordinary CDs;
X o supports up to 5 drives (of course, you'll need free
X IRQs, i/o ports and slots);
X o uses much less kernel memory than the standard mcd driver
X (no extra driver internal buffers!).
- o plays audio (like the `old' driver, I hope)
+ o plays audio (like the `old' driver, I hope)
X
X This version doesn't support yet:
X
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/digiboard.txt linux/Documentation/digiboard.txt
--- v2.2.0-pre5/linux/Documentation/digiboard.txt Sat May 2 14:19:51 1998
+++ linux/Documentation/digiboard.txt Thu Jan 7 08:41:54 1999
@@ -10,7 +10,7 @@
X
X In case you have problems with this version (1.6.1) of this driver, please
X email directly to me as I made the last update. It you have a report about
-runnning it on other architectures than intel, email me, so I can document
+running it on other architectures than intel, email me, so I can document
X it here.
X
X A version of this driver has been taken by Digiboard to make a driver
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/digiepca.txt linux/Documentation/digiepca.txt
--- v2.2.0-pre5/linux/Documentation/digiepca.txt Tue May 13 22:40:59 1997
+++ linux/Documentation/digiepca.txt Thu Jan 7 08:41:54 1999
@@ -27,7 +27,7 @@
X drivers started device names with 1.
X
X PCI boards are auto-detected and configured by the driver. PCI boards will
-be allocated device numbers (internally) begining with the lowest PCI slot
+be allocated device numbers (internally) beginning with the lowest PCI slot
X first. In other words a PCI card in slot 3 will always have higher device
X nodes than a PCI card in slot 1.
X
@@ -46,7 +46,7 @@
X Base of memory window (in HEX if using string identifiers),
X
X NOTE : PCI boards are auto-detected and configured. Do not attempt to
-configure PCI boards with the LILO append comand. If you wish to override
+configure PCI boards with the LILO append command. If you wish to override
X previous configuration data (As set by digiConfig), but you do not wish to
X configure any specific card (Example if there are PCI cards in the system)
X the following override command will accomplish this:
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/fb/matroxfb.txt linux/Documentation/fb/matroxfb.txt
--- v2.2.0-pre5/linux/Documentation/fb/matroxfb.txt Tue Dec 22 14:16:53 1998
+++ linux/Documentation/fb/matroxfb.txt Thu Jan 7 12:18:09 1999
@@ -118,8 +118,17 @@
X noinit - tells driver, that devices were already initialized. You should use it
X if you have G100 and/or if driver cannot detect memory, you see strange
X pattern on screen and so on. Devices not enabled by BIOS are still
- initialized.
-init - driver initializes every device it knows about. It is default.
+ initialized. It is default.
+init - driver initializes every device it knows about.
+nomtrr - disables write combining on frame buffer. This slows down driver but
+ there is reported minor incompatibility between GUS DMA and XFree under
+ high loads if write combining is enabled (sound dropouts).
+mtrr - enables write combining on frame buffer. It speeds up video accesses
+ much. It is default. You must have MTRR support enabled in kernel and
+ your CPU must have MTRR (f.e. Pentium II have them).
+sgram - tells to driver that you have G200 with SGRAM memory. It has no effect
+ without `init'.
+sdram - tells to driver that you have G200 with SDRAM memory. It is a default.
X inv24 - change timings parameters for 24bpp modes on Millenium and Millenium II.
X Specify this if you see strange color shadows around characters.
X noinv24 - use standard timmings. It is default.
@@ -200,6 +209,7 @@
X + 24bpp does not support correctly XF-FBDev on big-endian architectures.
X + interlaced text mode is not supported; it looks like hardware limitiation,
X but I'm not sure.
+ + G200 SGRAM/SDRAM is not autodetected.
X + maybe more...
X And following misfeatures:
X + SVGALib does not restore screen on exit.
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/isdn/README.act2000 linux/Documentation/isdn/README.act2000
--- v2.2.0-pre5/linux/Documentation/isdn/README.act2000 Sat May 2 14:19:51 1998
+++ linux/Documentation/isdn/README.act2000 Thu Jan 7 08:41:54 1999
@@ -7,7 +7,7 @@
X Version. Currently, only the ISA-Bus version of the card is supported.
X However MCA and PCMCIA will follow soon.
X
-The ISA-Bus Version uses 8 IO-ports. The base port adress has to be set
+The ISA-Bus Version uses 8 IO-ports. The base port address has to be set
X manually using the DIP switches.
X
X Setting up the DIP switches for the IBM Active 2000 ISDN card:
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/isdn/README.concap linux/Documentation/isdn/README.concap
--- v2.2.0-pre5/linux/Documentation/isdn/README.concap Sat May 2 14:19:51 1998
+++ linux/Documentation/isdn/README.concap Thu Jan 7 08:41:54 1999
@@ -229,7 +229,7 @@
X then the interface of the service function could be changed
X by passing a pointer of type (struct device*) instead of
X type (struct concap_proto*). Doing so would make many of the service
-functions compatible to network device support fuctions.
+functions compatible to network device support functions.
X
X e.g. instead of the concap protocol's service function
X
@@ -241,7 +241,7 @@
X
X As this is compatible to the dev->hard_start_xmit() method, the device
X driver could directly register the concap protocol's encap_and_xmit()
-fuction as its hard_start_xmit() method. This would eliminate one
+function as its hard_start_xmit() method. This would eliminate one
X procedure call layer.
X
X
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/isdn/README.x25 linux/Documentation/isdn/README.x25
--- v2.2.0-pre5/linux/Documentation/isdn/README.x25 Sat May 2 14:19:51 1998
+++ linux/Documentation/isdn/README.x25 Thu Jan 7 08:41:54 1999
@@ -210,7 +210,7 @@
X isdnloop driver. It seems that it is not caused by the isdn code.
X Somehow, the inode of a socket is freed while a process still refers
X the socket's wait queue. This causes problems when the process tries to
-remove itself from the wait queue (refered by the dangling
+remove itself from the wait queue (referred by the dangling
X sock->sleep pointer) before returning from a select() system call.
X
X - Henner
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/locks.txt linux/Documentation/locks.txt
--- v2.2.0-pre5/linux/Documentation/locks.txt Sat May 2 14:19:51 1998
+++ linux/Documentation/locks.txt Thu Jan 7 08:41:54 1999
@@ -45,7 +45,7 @@
X I wanted the two lock styles to be cooperative, but there were so many
X race and deadlock conditions that the current solution was the only
X practical one. It puts us in the same position as, for example, SunOS
-4.1.x and serveral other commercial Unices. The only OS's that support
+4.1.x and several other commercial Unices. The only OS's that support
X cooperative flock()/fcntl() are those that emulate flock() using
X fcntl(), with all the problems that implies.
X
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/m68k/kernel-options.txt linux/Documentation/m68k/kernel-options.txt
--- v2.2.0-pre5/linux/Documentation/m68k/kernel-options.txt Sat May 2 14:19:51 1998
+++ linux/Documentation/m68k/kernel-options.txt Thu Jan 7 08:41:54 1999
@@ -617,7 +617,7 @@
X Legal values are between 0 and 255. Default: 255/0. Note: This
X value is forced to 0 on a Falcon, since scatter-gather isn't
X possible with the ST-DMA. Not using scatter-gather hurts
- perfomance significantly.
+ performance significantly.
X
X <host-id>:
X The SCSI ID to be used by the initiator (your Atari). This is
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/networking/6pack.txt linux/Documentation/networking/6pack.txt
--- v2.2.0-pre5/linux/Documentation/networking/6pack.txt Sat May 2 14:19:51 1998
+++ linux/Documentation/networking/6pack.txt Thu Jan 7 08:41:54 1999
@@ -16,7 +16,7 @@
X - The PC is given full control over the radio
X channel. Special control data is exchanged between the PC and the TNC so
X that the PC knows at any time if the TNC is receiving data, if a TNC
- buffer underrun or overrun has occured, if the PTT is
+ buffer underrun or overrun has occurred, if the PTT is
X set and so on. This control data is processed at a higher priority than
X normal data, so a data stream can be interrupted at any time to issue an
X important event. This helps to improve the channel access and timing
@@ -167,7 +167,7 @@
X some cleaning and optimizing. This will be done in a later release.
X
X If you encounter a bug or if you have a question or suggestion concerning the
-driver, feel free to mail me, using the adresses given at the beginning of
+driver, feel free to mail me, using the addresses given at the beginning of
X this file.
X
X Have fun!
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/networking/arcnet-hardware.txt linux/Documentation/networking/arcnet-hardware.txt
--- v2.2.0-pre5/linux/Documentation/networking/arcnet-hardware.txt Thu Sep 17 17:53:34 1998
+++ linux/Documentation/networking/arcnet-hardware.txt Thu Jan 7 08:41:55 1999
@@ -2560,7 +2560,7 @@
X --------------------
X
X The two jumpers labeled ET1 and ET2 are used to determine the timeout
-parameters (respons and reconfiguration time). Every node in a network
+parameters (response and reconfiguration time). Every node in a network
X must be set to the same timeout values.
X
X ET1 ET2 | Response Time (us) | Reconfiguration Time (ms)
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/networking/cops.txt linux/Documentation/networking/cops.txt
--- v2.2.0-pre5/linux/Documentation/networking/cops.txt Sat May 2 14:19:51 1998
+++ linux/Documentation/networking/cops.txt Thu Jan 7 08:41:55 1999
@@ -17,7 +17,7 @@
X DAYNA driver mode:
X Dayna DL2000/DaynaTalk PC (Half Length), COPS LT-95,
X Farallon PhoneNET PC III, Farallon PhoneNET PC II
-Other cards possibly supported mode unkown though:
+Other cards possibly supported mode unknown though:
X Dayna DL2000 (Full length)
X
X The COPS driver defaults to using Dayna mode. To change the driver's
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/networking/de4x5.txt linux/Documentation/networking/de4x5.txt
--- v2.2.0-pre5/linux/Documentation/networking/de4x5.txt Sun Jun 7 11:16:26 1998
+++ linux/Documentation/networking/de4x5.txt Thu Jan 7 08:41:55 1999
@@ -151,7 +151,7 @@
X autonegotiation feature in the SROM autoconf code, this detection will
X occur automatically for that case.
X
- Command line arguements are now allowed, similar to passing arguements
+ Command line arguments are now allowed, similar to passing arguments
X through LILO. This will allow a per adapter board set up of full duplex
X and media. The only lexical constraints are: the board name (dev->name)
X appears in the list before its parameters. The list of parameters ends
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/sound/AudioExcelDSP16 linux/Documentation/sound/AudioExcelDSP16
--- v2.2.0-pre5/linux/Documentation/sound/AudioExcelDSP16 Sat Sep 5 16:46:40 1998
+++ linux/Documentation/sound/AudioExcelDSP16 Thu Jan 7 08:41:55 1999
@@ -51,7 +51,7 @@
X ad1848 are the corresponding options for the MSS and OPL3 modules.
X
X Loading MSS and OPL3 needs to pre load the aedsp16 module to set up correctly
-the sound card. Installation dependancies must be written in the conf.modules
+the sound card. Installation dependencies must be written in the conf.modules
X file:
X
X pre-install ad1848 modprobe aedsp16
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/sound/OPL3-SA2 linux/Documentation/sound/OPL3-SA2
--- v2.2.0-pre5/linux/Documentation/sound/OPL3-SA2 Thu Jan 7 15:11:35 1999
+++ linux/Documentation/sound/OPL3-SA2 Thu Jan 7 08:41:55 1999
@@ -2,7 +2,7 @@
X ---------------------------------------------------------------
X
X Scott Murray, sco...@interlog.com
-December, 1998
+January 5, 1998
X
X NOTE: All trade-marked terms mentioned below are properties of their
X respective owners.
@@ -97,25 +97,12 @@
X
X If you still cannot get the module to load, look at the contents of
X your system log file, usually /var/log/messages. If you see the
-message "No Yamaha audio controller found", then you have a different
-chipset than I've encountered so far. Look for a line in the log file
-that says "opl3sa2.c: chipset version = <some number>". If you want
-me to add support for your card, send me the number from this line and
-any information you have on the make and chipset of your sound card,
-and I should be able to work up a permanent fix.
-
-A temporary solution is to force the driver to act as either a SA2 or
-SA3. If you use the modular driver, this can be done with the "force"
-option. Using "force=2" makes the driver treat your card as a SA2,
-and "force=3" makes it treat your card as a SA3. Note that the driver
-does not really differentiate internally between the SA3 and SAx, so
-"force=3" is actually suitable for an SAx card.
-
-If you build the driver into the kernel, a similar option is
-available, "Chipset". Setting it to 2 or 3 will yield the same result
-as the "force" option does for the module. I recommend trying
-auto-probing first ("Chipset" equal to the default of -1) before
-forcing compatibility with a specific chipset.
+message "Unknown Yamaha audio controller version", then you have a
+different chipset than I've encountered so far. Look for a line in
+the log file that says "opl3sa2.c: chipset version = <some number>".
+If you want me to add support for your card, send me the number from
+this line and any information you have on the make and chipset of your
+sound card, and I should be able to work up a permanent fix.
X
X If you do not see the chipset version message, and none of the other
X messages present in the system log are helpful, email me some details
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/sound/VIA-chipset linux/Documentation/sound/VIA-chipset
--- v2.2.0-pre5/linux/Documentation/sound/VIA-chipset Wed Dec 31 16:00:00 1969
+++ linux/Documentation/sound/VIA-chipset Thu Jan 7 08:41:55 1999
@@ -0,0 +1,43 @@
+Running sound cards on VIA chipsets
+
+o There are problems with VIA chipsets and sound cards that appear to
+ lock the hardware solidly. Test programs under DOS have verified the
+ problem exists on at least some (but apparently not all) VIA boards
+
+o VIA have so far failed to bother to answer support mail on the subject
+ so if you are a VIA engineer feeling aggrieved as you read this
+ document go chase your own people. If there is a workaround please
+ let us know so we can implement it.
+
+
+Certain patterns of ISA DMA access used for most PC sound cards cause the
+VIA chipsets to lock up. From the collected reports this appears to cover a
+wide range of boards. Some also lock up with sound cards under Win* as well.
+
+Linux implements a workaround providing your chipset is PCI and you compiled
+with PCI Quirks enabled. If so you will see a message
+ "Activating ISA DMA bug workarounds"
+
+during booting. If you have a VIA PCI chipset that hangs when you use the
+sound and is not generating this message even with PCI quirks enabled
+please report the information to the linux-kernel list (see REPORTING-BUGS).
+
+If you are one of the tiny number of unfortunates with a 486 ISA/VLB VIA
+chipset board you need to do the following to build a special kernel for
+your board
+
+ edit linux/include/asm-i386/dma.h
+
+change
+
+#define isa_dma_bridge_buggy (0)
+
+to
+
+#define isa_dma_bridge_buggy (1)
+
+and rebuild a kernel without PCI quirk support.
+
+
+Other than this paticular glitch the VIA [M]VP* chipsets appear to work
+perfectly with Linux.
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/sysctl/README linux/Documentation/sysctl/README
--- v2.2.0-pre5/linux/Documentation/sysctl/README Thu Nov 19 09:56:27 1998
+++ linux/Documentation/sysctl/README Thu Jan 7 08:41:55 1999
@@ -13,7 +13,7 @@
X be actually used, not just for the fun of programming it :-)
X
X If you prefer HTML, feel free to visit the Linux-MM homepage
-<http://www.phys.uu.nl/~riel/mm-patch/>...
+<http://humbolt.geo.uu.nl/Linux-MM/>...
X
X ==============================================================
X
diff -u --recursive --new-file v2.2.0-pre5/linux/Documentation/video4linux/API.html linux/Documentation/video4linux/API.html
--- v2.2.0-pre5/linux/Documentation/video4linux/API.html Wed Aug 26 11:37:33 1998
+++ linux/Documentation/video4linux/API.html Thu Jan 7 08:41:55 1999
@@ -314,7 +314,7 @@
X To use the mmap interface a user first sets the desired image size and depth
X properties. Next the VIDIOCGMBUF ioctl is issued. This reports the size
X of buffer to mmap and the offset within the buffer for each frame. The
-number of frames supported is device dependant and may only be one.
+number of frames supported is device dependent and may only be one.
X <P>
X The video_mbuf structure contains the following fields
X <P>
diff -u --recursive --new-file v2.2.0-pre5/linux/Makefile linux/Makefile
--- v2.2.0-pre5/linux/Makefile Thu Jan 7 15:11:35 1999
+++ linux/Makefile Wed Jan 6 15:01:15 1999
@@ -1,7 +1,7 @@
X VERSION = 2
X PATCHLEVEL = 2
X SUBLEVEL = 0
-EXTRAVERSION =-pre5
+EXTRAVERSION =-pre6
X
X ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
X
diff -u --recursive --new-file v2.2.0-pre5/linux/README linux/README
--- v2.2.0-pre5/linux/README Mon Jan 4 15:08:16 1999
+++ linux/README Thu Jan 7 08:41:55 1999
@@ -48,12 +48,12 @@
X - If you install the full sources, do a
X
X cd /usr/src
- gzip -cd linux-2.1.XX.tar.gz | tar xfv -
+ gzip -cd linux-2.2.XX.tar.gz | tar xfv -
X
X to get it all put in place. Replace "XX" with the version number of the
X latest kernel.
X
- - You can also upgrade between 2.1.xx releases by patching. Patches are
+ - You can also upgrade between 2.2.xx releases by patching. Patches are
X distributed in the traditional gzip and the new bzip2 format. To
X install by patching, get all the newer patch files and do
X
@@ -91,7 +91,7 @@
X
X SOFTWARE REQUIREMENTS
X
- Compiling and running the 2.1.x kernels requires up-to-date
+ Compiling and running the 2.2.x 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
@@ -145,7 +145,7 @@
X
X COMPILING the kernel:
X
- - Make sure you have gcc-2.7.0 or newer available. It seems older gcc
+ - Make sure you have gcc-2.7.2 or newer available. It seems older gcc
X versions can have problems compiling newer versions of Linux. This
X is mainly because the older compilers can only generate "a.out"-format
X executables. As of Linux 2.1.0, the kernel must be compiled as an
diff -u --recursive --new-file v2.2.0-pre5/linux/REPORTING-BUGS linux/REPORTING-BUGS
--- v2.2.0-pre5/linux/REPORTING-BUGS Wed Dec 31 16:00:00 1969
+++ linux/REPORTING-BUGS Thu Jan 7 08:41:55 1999
@@ -0,0 +1,56 @@
+[Some of this is taken from Frohwalt Egerer's original linux-kernel FAQ]
+
+ What follows is a suggested proceedure for reporting Linux bugs. You
+aren't obliged to use the bug reporting format, it is provided as a guide
+to the kind of information that can be useful to developers - no more.
+
+ If the failure includes an "OOPS:" type message in your log or on
+screen please read "Documentation/oops-tracing.txt" before posting your
+bug report. This explains what you should do with the "Oops" information
+to make it useful to the recipient.
+
+ 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. That is worth even more than the oops itself.
+The list of maintainers is in the MAINTAINERS file in this directory.
+
+ If you are totally stumped as to whom to send the report, send it to
+linux-...@vger.rutgers.edu. (For more information on the linux-kernel
+mailing list see http://www.tux.org/lkml/).
+
+This is a suggested format for a bug report sent to the Linux kernel mailing
+list. Having a standardized bug report form makes it easier for you not to
+overlook things, and easier for the developers to find the pieces of
+information they're really interested in.
+
+ First run the ver_linux script included as scripts/ver_linux or
+at <URL:ftp://ftp.sai.msu.su//sai2/ftp/pub/Linux/ver_linux> It checks out
+the version of some important subsystems. Run it with the commnd
+"sh scripts/ver_linux"
+
+Use that information to fill in all fields of the bug report form, and
+post it to the mailing list with a subject of "ISSUE: <one line
+summary from [1.]>" for easy identification by the developers
+
+[1.] One line summary of the problem:
+[2.] Full description of the problem/report:
+[3.] Keywords (i.e., modules, networking, kernel):
+[4.] Kernel version (from /proc/version):
+[5.] Output of Oops.. message (if applicable) with symbolic information
+ resolved (see Documentation/oops-tracing.txt)
+[6.] A small shell script or example program which triggers the
+ problem (if possible)
+[7.] Environment
+[7.1.] Software (add the output of the ver_linux script here)
+[7.2.] Processor information (from /proc/cpuinfo):
+[7.3.] Module information (from /proc/modules):
+[7.4.] SCSI information (from /proc/scsi/scsi)
+[7.5.] Other information that might be relevant to the problem
+ (please look in /proc and include all information that you
+ think to be relevant):
+[X.] Other notes, patches, fixes, workarounds:
+
+
+Thank you
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/alpha/kernel/process.c linux/arch/alpha/kernel/process.c
--- v2.2.0-pre5/linux/arch/alpha/kernel/process.c Wed Dec 16 10:32:54 1998
+++ linux/arch/alpha/kernel/process.c Thu Jan 7 08:41:55 1999
@@ -55,7 +55,6 @@
X unsigned long init_user_stack[1024] = { STACK_MAGIC, };
X static struct vm_area_struct init_mmap = INIT_MMAP;
X static struct fs_struct init_fs = INIT_FS;
-static struct file * init_fd_array[NR_OPEN] = { NULL, };
X static struct files_struct init_files = INIT_FILES;
X static struct signal_struct init_signals = INIT_SIGNALS;
X struct mm_struct init_mm = INIT_MM;
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/i386/config.in linux/arch/i386/config.in
--- v2.2.0-pre5/linux/arch/i386/config.in Thu Jan 7 15:11:35 1999
+++ linux/arch/i386/config.in Thu Jan 7 08:41:55 1999
@@ -97,6 +97,8 @@
X bool ' Power off on shutdown' CONFIG_APM_POWER_OFF
X bool ' Ignore multiple suspend' CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
X bool ' Ignore multiple suspend/resume cycles' CONFIG_APM_IGNORE_SUSPEND_BOUNCE
+ bool ' RTC stores time in GMT' CONFIG_APM_RTC_IS_GMT
+ bool ' Allow interrupts during APM BIOS calls' CONFIG_APM_ALLOW_INTS
X fi
X
X endmenu
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/i386/kernel/apm.c linux/arch/i386/kernel/apm.c
--- v2.2.0-pre5/linux/arch/i386/kernel/apm.c Wed Dec 16 10:32:54 1998
+++ linux/arch/i386/kernel/apm.c Thu Jan 7 08:41:55 1999
@@ -31,6 +31,7 @@
X * Aug 1998, Version 1.5
X * Sep 1998, Version 1.6
X * Nov 1998, Version 1.7
+ * Jan 1999, Version 1.8
X *
X * History:
X * 0.6b: first version in official kernel, Linux 1.3.46
@@ -72,6 +73,11 @@
X * Make boot messages far less verbose by default
X * Make asm safer
X * Stephen Rothwell
+ * 1.8: Add CONFIG_APM_RTC_IS_GMT
+ * Richard Gooch <rgo...@atnf.csiro.au>
+ * change APM_NOINTS to CONFIG_APM_ALLOW_INTS
+ * remove dependency on CONFIG_PROC_FS
+ * Stephen Rothwell
X *
X * APM 1.1 Reference:
X *
@@ -105,10 +111,8 @@
X #include <linux/fcntl.h>
X #include <linux/malloc.h>
X #include <linux/linkage.h>
-#ifdef CONFIG_PROC_FS
X #include <linux/stat.h>
X #include <linux/proc_fs.h>
-#endif
X #include <linux/miscdevice.h>
X #include <linux/apm_bios.h>
X #include <linux/init.h>
@@ -202,13 +206,6 @@
X #define ALWAYS_CALL_BUSY
X
X /*
- * Define to disable interrupts in APM BIOS calls (the CPU Idle BIOS call
- * should turn interrupts on before it does a 'hlt').
- * This reportedly needs undefining for the ThinkPad 600.
- */
-#define APM_NOINTS
-
-/*
X * Define to make the APM BIOS calls zero all data segment registers (so
X * that an incorrect BIOS implementation will cause a kernel panic if it
X * tries to write to arbitrary memory).
@@ -266,9 +263,7 @@
X static unsigned int do_poll(struct file *, poll_table *);
X static int do_ioctl(struct inode *, struct file *, u_int, u_long);
X
-#ifdef CONFIG_PROC_FS
X static int apm_get_info(char *, char **, off_t, int, int);
-#endif
X
X extern int apm_register_callback(int (*)(apm_event_t));
X extern void apm_unregister_callback(int (*)(apm_event_t));
@@ -290,8 +285,13 @@
X static int waiting_for_resume = 0;
X #endif
X
+#ifdef CONFIG_APM_RTC_IS_GMT
+# define clock_cmos_diff 0
+# define got_clock_diff 1
+#else
X static long clock_cmos_diff;
X static int got_clock_diff = 0;
+#endif
X static int debug = 0;
X static int apm_disabled = 0;
X
@@ -300,7 +300,7 @@
X
X static struct timer_list apm_timer;
X
-static char driver_version[] = "1.7"; /* no spaces */
+static char driver_version[] = "1.8"; /* no spaces */
X
X #ifdef APM_DEBUG
X static char * apm_event_name[] = {
@@ -375,22 +375,22 @@
X #define ERROR_COUNT (sizeof(error_table)/sizeof(lookup_t))
X
X /*
- * These are the actual BIOS calls. Depending on APM_ZERO_SEGS
- * and APM_NOINTS, we are being really paranoid here! Not only are
- * interrupts disabled, but all the segment registers (except SS) are
- * saved and zeroed this means that if the BIOS tries to reference any
- * data without explicitly loading the segment registers, the kernel will
- * fault immediately rather than have some unforeseen circumstances for
- * the rest of the kernel. And it will be very obvious! :-) Doing this
- * depends on CS referring to the same physical memory as DS so that DS
- * can be zeroed before the call. Unfortunately, we can't do anything
+ * These are the actual BIOS calls. Depending on APM_ZERO_SEGS and
+ * CONFIG_APM_ALLOW_INTS, we are being really paranoid here! Not only
+ * are interrupts disabled, but all the segment registers (except SS)
+ * are saved and zeroed this means that if the BIOS tries to reference
+ * any data without explicitly loading the segment registers, the kernel
+ * will fault immediately rather than have some unforeseen circumstances
+ * for the rest of the kernel. And it will be very obvious! :-) Doing
+ * this depends on CS referring to the same physical memory as DS so that
+ * DS can be zeroed before the call. Unfortunately, we can't do anything
X * about the stack segment/pointer. Also, we tell the compiler that
X * everything could change.
X *
X * Also, we KNOW that for the non error case of apm_bios_call, there
X * is no useful data returned in the low order 8 bits of eax.
X */
-#ifdef APM_NOINTS
+#ifndef CONFIG_APM_ALLOW_INTS
X # define APM_DO_CLI __cli()
X #else
X # define APM_DO_CLI
@@ -747,14 +747,17 @@
X unsigned long flags;
X int err;
X
- /* Estimate time zone so that set_time can
- update the clock */
+#ifndef CONFIG_APM_RTC_IS_GMT
+ /*
+ * Estimate time zone so that set_time can update the clock
+ */
X save_flags(flags);
X clock_cmos_diff = -get_cmos_time();
X cli();
X clock_cmos_diff += CURRENT_TIME;
X got_clock_diff = 1;
X restore_flags(flags);
+#endif
X
X err = apm_set_power_state(APM_STATE_SUSPEND);
X if (err)
@@ -826,7 +829,7 @@
X apm_event_t event;
X #ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
X static unsigned long last_resume = 0;
- static int did_resume = 0;
+ static int ignore_bounce = 0;
X #endif
X
X while ((event = get_event()) != 0) {
@@ -838,6 +841,10 @@
X printk(KERN_DEBUG "apm: received unknown "
X "event 0x%02x\n", event);
X #endif
+#ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
+ if (ignore_bounce && ((jiffies - last_resume) > HZ))
+ ignore_bounce = 0;
+#endif
X switch (event) {
X case APM_SYS_STANDBY:
X case APM_USER_STANDBY:
@@ -859,7 +866,7 @@
X #endif
X case APM_SYS_SUSPEND:
X #ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
- if (did_resume && ((jiffies - last_resume) < HZ))
+ if (ignore_bounce)
X break;
X #endif
X #ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
@@ -880,7 +887,7 @@
X #endif
X #ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
X last_resume = jiffies;
- did_resume = 1;
+ ignore_bounce = 1;
X #endif
X set_time();
X send_event(event, 0, NULL);
@@ -1139,7 +1146,6 @@
X return 0;
X }
X
-#ifdef CONFIG_PROC_FS
X int apm_get_info(char *buf, char **start, off_t fpos, int length, int dummy)
X {
X char * p;
@@ -1228,7 +1234,6 @@
X
X return p - buf;
X }
-#endif
X
X void __init apm_setup(char *str, int *dummy)
X {
@@ -1422,10 +1427,9 @@
X apm_timer.expires = APM_CHECK_TIMEOUT + jiffies;
X add_timer(&apm_timer);
X
-#ifdef CONFIG_PROC_FS
X ent = create_proc_entry("apm", 0, 0);
- ent->get_info = apm_get_info;
-#endif
+ if (ent != NULL)
+ ent->get_info = apm_get_info;
X
X misc_register(&apm_device);
X
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S
--- v2.2.0-pre5/linux/arch/i386/kernel/entry.S Mon Dec 28 15:00:52 1998
+++ linux/arch/i386/kernel/entry.S Fri Jan 8 14:01:36 1999
@@ -559,13 +559,14 @@
X .long SYMBOL_NAME(sys_sendfile)
X .long SYMBOL_NAME(sys_ni_syscall) /* streams1 */
X .long SYMBOL_NAME(sys_ni_syscall) /* streams2 */
+ .long SYMBOL_NAME(sys_vfork) /* 190 */
X
X /*
- * NOTE!! This doesn' thave to be exact - we just have
+ * NOTE!! This doesn't have to be exact - we just have
X * to make sure we have _enough_ of the "sys_ni_syscall"
X * entries. Don't panic if you notice that this hasn't
X * been shrunk every time we add a new system call.
X */
- .rept NR_syscalls-189
+ .rept NR_syscalls-190
X .long SYMBOL_NAME(sys_ni_syscall)
X .endr
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
--- v2.2.0-pre5/linux/arch/i386/kernel/process.c Mon Dec 28 15:00:52 1998
+++ linux/arch/i386/kernel/process.c Fri Jan 8 15:05:41 1999
@@ -781,6 +781,18 @@
X return do_fork(clone_flags, newsp, &regs);
X }
X
+asmlinkage int sys_vfork(struct pt_regs regs)
+{
+ int child;
+
+ child = do_fork(CLONE_VM | SIGCHLD, regs.esp, &regs);
+
+ if (child > 0)
+ sleep_on(&current->vfork_sleep);
+
+ return child;
+}
+
X /*
X * sys_execve() executes a new program.
X */
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/i386/kernel/ptrace.c linux/arch/i386/kernel/ptrace.c
--- v2.2.0-pre5/linux/arch/i386/kernel/ptrace.c Thu Jan 7 15:11:35 1999
+++ linux/arch/i386/kernel/ptrace.c Fri Jan 8 10:21:10 1999
@@ -70,7 +70,7 @@
X extern int _stext, _etext;
X static void print_child_state(struct task_struct *task)
X {
- unsigned int * stack = (unsigned int *) task->tss.esp0;
+ unsigned int * stack = (unsigned int *) task->tss.esp;
X int count = 40;
X
X printk("Process: %s (stack=%p, task=%p)\n", task->comm, stack, task);
@@ -78,7 +78,7 @@
X unsigned int data;
X if ((unsigned int) stack < (unsigned int) task)
X break;
- if ((unsigned int) stack >= PAGE_SIZE + (unsigned int) task)
+ if ((unsigned int) stack >= 2*PAGE_SIZE + (unsigned int) task)
X break;
X data = *stack;
X stack++;
@@ -394,15 +394,16 @@
X ret = 0;
X goto out;
X }
- if (pid == 1) /* you may not mess with init */
- goto out;
X ret = -ESRCH;
X read_lock(&tasklist_lock);
X child = find_task_by_pid(pid);
X read_unlock(&tasklist_lock); /* FIXME!!! */
X if (!child)
X goto out;
+print_child_state(child);
X ret = -EPERM;
+ if (pid == 1) /* you may not mess with init */
+ goto out;
X if (request == PTRACE_ATTACH) {
X if (child == current)
X goto out;
@@ -435,8 +436,6 @@
X if (!(child->flags & PF_PTRACED))
X goto out;
X if (child->state != TASK_STOPPED) {
-print_child_state(child);
-goto out;
X if (request != PTRACE_KILL)
X goto out;
X }
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- v2.2.0-pre5/linux/arch/i386/kernel/setup.c Mon Jan 4 15:08:16 1999
+++ linux/arch/i386/kernel/setup.c Thu Jan 7 08:41:55 1999
@@ -619,7 +619,7 @@
X else
X printk("%s", c->x86_model_id);
X
- if (c->x86_mask)
+ if (c->x86_mask || c->cpuid_level>=0)
X printk(" stepping %02x", c->x86_mask);
X
X if(c->x86_vendor == X86_VENDOR_CENTAUR)
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/m68k/amiga/amiints.c linux/arch/m68k/amiga/amiints.c
--- v2.2.0-pre5/linux/arch/m68k/amiga/amiints.c Fri Oct 9 13:27:05 1998
+++ linux/arch/m68k/amiga/amiints.c Thu Jan 7 08:41:55 1999
@@ -15,7 +15,7 @@
X * - IRQ_FLG_SLOW: handler is inserted at bottom of list and before
X * they're executed irq level is set to the previous
X * one, but handlers don't need to be reentrant, if
- * reentrance occured, slow handlers will be just
+ * reentrance occurred, slow handlers will be just
X * called again.
X * The whole interrupt handling for CIAs is moved to cia.c
X * /Roman Zippel
@@ -367,7 +367,7 @@
X for (;;) {
X for (; node; node = node->next)
X node->handler(irq, node->dev_id, fp);
- /* if reentrance occured, serve slow handlers again */
+ /* if reentrance occurred, serve slow handlers again */
X custom.intena = ami_intena_vals[irq];
X if (!server->reentrance) {
X server->count--;
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/m68k/apollo/dn_ints.c linux/arch/m68k/apollo/dn_ints.c
--- v2.2.0-pre5/linux/arch/m68k/apollo/dn_ints.c Tue Feb 17 13:12:44 1998
+++ linux/arch/m68k/apollo/dn_ints.c Thu Jan 7 08:41:55 1999
@@ -30,7 +30,7 @@
X dn_irqs[irq-160].handler(irq,dn_irqs[irq-160].dev_id,fp);
X }
X else {
- printk("spurious irq %d occured\n",irq);
+ printk("spurious irq %d occurred\n",irq);
X }
X
X #if 0
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/m68k/kernel/signal.c linux/arch/m68k/kernel/signal.c
--- v2.2.0-pre5/linux/arch/m68k/kernel/signal.c Sat Sep 5 16:46:40 1998
+++ linux/arch/m68k/kernel/signal.c Thu Jan 7 08:41:55 1999
@@ -361,7 +361,7 @@
X : "a0");
X #undef frame_offset
X /*
- * If we ever get here an exception occured while
+ * If we ever get here an exception occurred while
X * building the above stack-frame.
X */
X goto badframe;
@@ -460,7 +460,7 @@
X : "a0");
X #undef frame_offset
X /*
- * If we ever get here an exception occured while
+ * If we ever get here an exception occurred while
X * building the above stack-frame.
X */
X goto badframe;
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/ppc/amiga/amiints.c linux/arch/ppc/amiga/amiints.c
--- v2.2.0-pre5/linux/arch/ppc/amiga/amiints.c Thu Nov 19 09:56:27 1998
+++ linux/arch/ppc/amiga/amiints.c Thu Jan 7 08:46:58 1999
@@ -19,7 +19,7 @@
X * - IRQ_FLG_SLOW: handler is inserted at bottom of list and before
X * they're executed irq level is set to the previous
X * one, but handlers don't need to be reentrant, if
- * reentrance occured, slow handlers will be just
+ * reentrance occurred, slow handlers will be just
X * called again.
X * The whole interrupt handling for CIAs is moved to cia.c
X * /Roman Zippel
@@ -396,7 +396,7 @@
X for (;;) {
X for (; node; node = node->next)
X node->handler(irq, node->dev_id, fp);
- /* if reentrance occured, serve slow handlers again */
+ /* if reentrance occurred, serve slow handlers again */
X custom.intena = ami_intena_vals[irq];
X if (!server->reentrance) {
X server->count--;
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/ppc/boot/ns16550.c linux/arch/ppc/boot/ns16550.c
--- v2.2.0-pre5/linux/arch/ppc/boot/ns16550.c Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/boot/ns16550.c Thu Jan 7 12:06:57 1999
@@ -0,0 +1,56 @@
+/*
+ * COM1 NS16550 support
+ */
+
+#include "ns16550.h"
+typedef struct NS16550 *NS16550_t;
+
+const NS16550_t COM_PORTS[] = { (NS16550_t) COM1,
+ (NS16550_t) COM2,
+ (NS16550_t) COM3,
+ (NS16550_t) COM4 };
+
+volatile struct NS16550 *
+NS16550_init(int chan)
+{
+ volatile struct NS16550 *com_port;
+ volatile unsigned char xx;
+ com_port = (struct NS16550 *) COM_PORTS[chan];
+ /* See if port is present */
+ com_port->lcr = 0x00;
+ com_port->ier = 0xFF;
+#if 0
+ if (com_port->ier != 0x0F) return ((struct NS16550 *)0);
+#endif
+ com_port->ier = 0x00;
+ com_port->lcr = 0x80; /* Access baud rate */
+ com_port->dll = 0xc; /* 9600 baud */
+ com_port->dlm = 0xc >> 8;
+ com_port->lcr = 0x03; /* 8 data, 1 stop, no parity */
+ com_port->mcr = 0x03; /* RTS/DTR */
+ com_port->fcr = 0x07; /* Clear & enable FIFOs */
+ return (com_port);
+}
+
+
+NS16550_putc(volatile struct NS16550 *com_port, unsigned char c)
+{
+ volatile int i;
+ while ((com_port->lsr & LSR_THRE) == 0) ;
+ com_port->thr = c;
+}
+
+unsigned char
+NS16550_getc(volatile struct NS16550 *com_port)
+{
+ while ((com_port->lsr & LSR_DR) == 0) ;
+ return (com_port->rbr);
+}
+
+NS16550_tstc(volatile struct NS16550 *com_port)
+{
+ return ((com_port->lsr & LSR_DR) != 0);
+}
+
+
+
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/ppc/boot/ns16550.h linux/arch/ppc/boot/ns16550.h
--- v2.2.0-pre5/linux/arch/ppc/boot/ns16550.h Wed Dec 31 16:00:00 1969
+++ linux/arch/ppc/boot/ns16550.h Thu Jan 7 12:06:57 1999
@@ -0,0 +1,34 @@
+/*
+ * NS16550 Serial Port
+ */
+
+struct NS16550
+ {
+ unsigned char rbr; /* 0 */
+ unsigned char ier; /* 1 */
+ unsigned char fcr; /* 2 */
+ unsigned char lcr; /* 3 */
+ unsigned char mcr; /* 4 */
+ unsigned char lsr; /* 5 */
+ unsigned char msr; /* 6 */
+ unsigned char scr; /* 7 */
+ };
+
+#define thr rbr
+#define iir fcr
+#define dll rbr
+#define dlm ier
+
+#define LSR_DR 0x01 /* Data ready */
+#define LSR_OE 0x02 /* Overrun */
+#define LSR_PE 0x04 /* Parity error */
+#define LSR_FE 0x08 /* Framing error */
+#define LSR_BI 0x10 /* Break */
+#define LSR_THRE 0x20 /* Xmit holding register empty */
+#define LSR_TEMT 0x40 /* Xmitter empty */
+#define LSR_ERR 0x80 /* Error */
+
+#define COM1 0x800003F8
+#define COM2 0x800002F8
+#define COM3 0x800003F8
+#define COM4 0x80000388
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/ppc/common_defconfig linux/arch/ppc/common_defconfig
--- v2.2.0-pre5/linux/arch/ppc/common_defconfig Thu Jan 7 15:11:36 1999
+++ linux/arch/ppc/common_defconfig Thu Jan 7 12:06:57 1999
@@ -253,16 +253,17 @@
X CONFIG_FB_CONTROL=y
X CONFIG_FB_PLATINUM=y
X CONFIG_FB_VALKYRIE=y
-# CONFIG_FB_ATY is not set
+CONFIG_FB_ATY=y
X CONFIG_FB_IMSTT=y
X CONFIG_FB_CT65550=y
X # CONFIG_FB_S3TRIO is not set
X # CONFIG_FB_MATROX is not set
-# CONFIG_FB_ATY is not set
+CONFIG_FB_ATY=y
X # CONFIG_FB_VIRTUAL is not set
X # CONFIG_FBCON_ADVANCED is not set
X CONFIG_FBCON_CFB8=y
X CONFIG_FBCON_CFB16=y
+CONFIG_FBCON_CFB24=y
X CONFIG_FBCON_CFB32=y
X # CONFIG_FBCON_FONTWIDTH8_ONLY is not set
X CONFIG_FBCON_FONTS=y
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/ppc/kernel/mbx_setup.c linux/arch/ppc/kernel/mbx_setup.c
--- v2.2.0-pre5/linux/arch/ppc/kernel/mbx_setup.c Tue Dec 22 14:16:54 1998
+++ linux/arch/ppc/kernel/mbx_setup.c Thu Jan 7 12:06:57 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: mbx_setup.c,v 1.4 1998/11/15 19:58:55 cort Exp $
+ * $Id: mbx_setup.c,v 1.5 1998/12/29 18:55:07 cort Exp $
X *
X * linux/arch/ppc/kernel/setup.c
X *
@@ -59,18 +59,21 @@
X void __init powermac_init(void)
X {
X }
+
X void __init adbdev_init(void)
X {
X }
X
X void __init mbx_ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq)
X {
+ ide_ioreg_t port = base;
+ int i = 8;
X
- *p = 0;
- *irq = 0;
-
- if (base != 0) /* Only map the first ATA flash drive */
- return;
+ while (i--)
+ *p++ = port++;
+ *p++ = base + 0x206;
+ if (irq != NULL)
+ *irq = 0;
X #ifdef ATA_FLASH
X base = (unsigned long) ioremap(PCMCIA_MEM_ADDR, 0x200);
X for (i = 0; i < 8; ++i)
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/ppc/kernel/pci.c linux/arch/ppc/kernel/pci.c
--- v2.2.0-pre5/linux/arch/ppc/kernel/pci.c Tue Dec 22 14:16:54 1998
+++ linux/arch/ppc/kernel/pci.c Thu Jan 7 12:06:57 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: pci.c,v 1.42 1998/12/04 14:31:37 cort Exp $
+ * $Id: pci.c,v 1.43 1998/12/29 18:55:11 cort Exp $
X * Common pmac/prep/chrp pci routines. -- Cort
X */
X
@@ -123,8 +123,8 @@
X __initfunc(void
X setup_pci_ptrs(void))
X {
- PPC_DEVICE *hostbridge;
X #ifndef CONFIG_MBX
+ PPC_DEVICE *hostbridge;
X switch (_machine) {
X case _MACH_prep:
X hostbridge=residual_find_device(PROCESSORDEVICE, NULL,
@@ -188,6 +188,7 @@
X extern struct bridge_data **bridges;
X extern unsigned char *Motherboard_map;
X extern unsigned char *Motherboard_routes;
+ unsigned char i;
X #ifndef CONFIG_MBX
X switch (_machine )
X {
@@ -200,7 +201,7 @@
X * irq this device uses. This is necessary on things
X * without residual data. -- Cort
X */
- unsigned char d = PCI_SLOT(dev->devfn), i;
+ unsigned char d = PCI_SLOT(dev->devfn);
X dev->irq = Motherboard_routes[Motherboard_map[d]];
X for ( i = 0 ; i <= 5 ; i++ )
X {
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/ppc/kernel/ppc_ksyms.c linux/arch/ppc/kernel/ppc_ksyms.c
--- v2.2.0-pre5/linux/arch/ppc/kernel/ppc_ksyms.c Thu Dec 31 10:28:59 1998
+++ linux/arch/ppc/kernel/ppc_ksyms.c Thu Jan 7 12:06:57 1999
@@ -194,6 +194,7 @@
X EXPORT_SYMBOL(find_path_device);
X EXPORT_SYMBOL(find_phandle);
X EXPORT_SYMBOL(get_property);
+EXPORT_SYMBOL(device_is_compatible);
X EXPORT_SYMBOL(pci_io_base);
X EXPORT_SYMBOL(pci_device_loc);
X EXPORT_SYMBOL(feature_set);
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/ppc/kernel/process.c linux/arch/ppc/kernel/process.c
--- v2.2.0-pre5/linux/arch/ppc/kernel/process.c Thu Jan 7 15:11:36 1999
+++ linux/arch/ppc/kernel/process.c Thu Jan 7 12:06:57 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: process.c,v 1.69 1998/12/28 10:28:49 paulus Exp $
+ * $Id: process.c,v 1.70 1999/01/07 16:28:59 cort Exp $
X *
X * linux/arch/ppc/kernel/process.c
X *
@@ -191,19 +191,6 @@
X _enable_interrupts(s);
X }
X
-void instruction_dump (unsigned long *pc)
-{
- int i;
-
- if((((unsigned long) pc) & 3))
- return;
-
- printk("Instruction DUMP:");
- for(i = -3; i < 6; i++)
- printk("%c%08lx%c",i?' ':'<',pc[i],i?' ':'>');
- printk("\n");
-}
-
X void show_regs(struct pt_regs * regs)
X {
X int i;
@@ -242,6 +229,19 @@
X }
X }
X out:
+}
+
+void instruction_dump (unsigned long *pc)
+{
+ int i;
+
+ if((((unsigned long) pc) & 3))
+ return;
+
+ printk("Instruction DUMP:");
+ for(i = -3; i < 6; i++)
+ printk("%c%08lx%c",i?' ':'<',pc[i],i?' ':'>');
+ printk("\n");
X }
X
X void exit_thread(void)
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/ppc/kernel/setup.c linux/arch/ppc/kernel/setup.c
--- v2.2.0-pre5/linux/arch/ppc/kernel/setup.c Tue Dec 22 14:16:54 1998
+++ linux/arch/ppc/kernel/setup.c Thu Jan 7 12:06:57 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: setup.c,v 1.120 1998/12/10 00:24:28 cort Exp $
+ * $Id: setup.c,v 1.122 1998/12/31 20:51:19 cort Exp $
X * Common prep/pmac/chrp boot and setup code.
X */
X
@@ -259,6 +259,9 @@
X break;
X }
X #endif
+#if defined(CONFIG_MBX)
+ mbx_ide_init_hwif_ports(p,base,irq);
+#endif
X }
X EXPORT_SYMBOL(ide_init_hwif_ports);
X #endif
@@ -464,9 +467,9 @@
X * Find out what kind of machine we're on and save any data we need
X * from the early boot process (devtree is copied on pmac by prom_init() )
X */
-__initfunc(unsigned long
+unsigned long __init
X identify_machine(unsigned long r3, unsigned long r4, unsigned long r5,
- unsigned long r6, unsigned long r7))
+ unsigned long r6, unsigned long r7)
X {
X extern void setup_pci_ptrs(void);
X
@@ -491,6 +494,9 @@
X char *model;
X
X have_of = 1;
+
+ /* prom_init has already been called from __start */
+ finish_device_tree();
X /* ask the OF info if we're a chrp or pmac */
X model = get_property(find_path_device("/"), "device_type", NULL);
X if ( model && !strncmp("chrp",model,4) )
@@ -510,8 +516,10 @@
X
X if ( have_of )
X {
+#ifdef CONFIG_MACH_SPECIFIC
X /* prom_init has already been called from __start */
X finish_device_tree();
+#endif /* CONFIG_MACH_SPECIFIC */
X /*
X * If we were booted via quik, r3 points to the physical
X * address of the command-line parameters.
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/ppc/mm/init.c linux/arch/ppc/mm/init.c
--- v2.2.0-pre5/linux/arch/ppc/mm/init.c Tue Dec 22 14:16:54 1998
+++ linux/arch/ppc/mm/init.c Thu Jan 7 12:06:57 1999
@@ -1,5 +1,5 @@
X /*
- * $Id: init.c,v 1.138 1998/12/15 17:34:43 cort Exp $
+ * $Id: init.c,v 1.139 1998/12/29 19:53:49 cort Exp $
X *
X * PowerPC version
X * Copyright (C) 1995-1996 Gary Thomas (g...@linuxppc.org)
@@ -1027,6 +1027,8 @@
X ioremap(MBX_CSR_ADDR, MBX_CSR_SIZE);
X ioremap(IMAP_ADDR, IMAP_SIZE);
X ioremap(PCI_CSR_ADDR, PCI_CSR_SIZE);
+ /* ide needs to be able to get at PCI space -- Cort */
+ ioremap(0x80000000, 0x4000);
X #endif /* CONFIG_8xx */
X }
X
@@ -1297,7 +1299,7 @@
X /*
X * This finds the amount of physical ram and does necessary
X * setup for prep. This is pretty architecture specific so
- * this will likely stay seperate from the pmac.
+ * this will likely stay separate from the pmac.
X * -- Cort
X */
X __initfunc(unsigned long *prep_find_end_of_memory(void))
diff -u --recursive --new-file v2.2.0-pre5/linux/arch/sparc/lib/checksum.S linux/arch/sparc/lib/checksum.S
--- v2.2.0-pre5/linux/arch/sparc/lib/checksum.S Wed Apr 23 19:01:16 1997
+++ linux/arch/sparc/lib/checksum.S Thu Jan 7 08:46:58 1999
@@ -535,7 +535,7 @@
X /* %o1 is dst
X * %o3 is # bytes to zero out
X * %o4 is faulting address
- * %o5 is %pc where fault occured */
+ * %o5 is %pc where fault occurred */
X clr %o2
X 31:
X /* %o0 is src
@@ -543,7 +543,7 @@
X * %o2 is # of bytes to copy from src to dst
X * %o3 is # bytes to zero out
X * %o4 is faulting address
- * %o5 is %pc where fault occured */
+ * %o5 is %pc where fault occurred */
X save %sp, -104, %sp
X mov %i5, %o0
X mov %i7, %o1
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/acorn/block/fd1772.c linux/drivers/acorn/block/fd1772.c
--- v2.2.0-pre5/linux/drivers/acorn/block/fd1772.c Mon Dec 28 15:00:52 1998
+++ linux/drivers/acorn/block/fd1772.c Thu Jan 7 08:46:58 1999
@@ -1039,7 +1039,7 @@
X static void fd_times_out(unsigned long dummy)
X {
X SET_IRQ_HANDLER(NULL);
- /* If the timeout occured while the readtrack_check timer was
+ /* If the timeout occurred while the readtrack_check timer was
X * active, we need to cancel it, else bad things will happen */
X del_timer( &readtrack_timer );
X FDC1772_WRITE(FDC1772REG_CMD, FDC1772CMD_FORCI);
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/block/ide-dma.c linux/drivers/block/ide-dma.c
--- v2.2.0-pre5/linux/drivers/block/ide-dma.c Thu Dec 31 10:28:59 1998
+++ linux/drivers/block/ide-dma.c Thu Jan 7 08:46:58 1999
@@ -100,11 +100,18 @@
X * bad_dma_drives() lists the model names (from "hdparm -i")
X * of drives which supposedly support (U)DMA but which are
X * known to corrupt data with this interface under Linux.
+ *
+ * This is an empirical list. Its generated from bug reports. That means
+ * while it reflects actual problem distributions it doesn't answer whether
+ * the drive or the controller, or cabling, or software, or some combination
+ * thereof is the fault. If you don't happen to agree with the kernel's
+ * opinion of your drive - use hdparm to turn DMA on.
X */
X const char *bad_dma_drives[] = {"WDC AC11000H",
X "WDC AC22100H",
X "WDC AC32500H",
X "WDC AC33100H",
+ "WDC AC31600H",
X NULL};
X
X /*
@@ -246,7 +253,7 @@
X list = bad_dma_drives;
X while (*list) {
X if (!strcmp(*list++,id->model)) {
- printk("%s: (U)DMA capability is broken for %s\n",
+ printk("%s: Disabling (U)DMA for %s\n",
X drive->name, id->model);
X return 1;
X }
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/block/ide-tape.c linux/drivers/block/ide-tape.c
--- v2.2.0-pre5/linux/drivers/block/ide-tape.c Thu Jan 7 15:11:36 1999
+++ linux/drivers/block/ide-tape.c Fri Jan 8 10:04:58 1999
@@ -483,7 +483,7 @@
X /*
X * Some tape drives require a long irq timeout
X */
-#define IDETAPE_WAIT_CMD 60
+#define IDETAPE_WAIT_CMD (60*HZ)
X
X /*
X * DSC timings.
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/block/xd.c linux/drivers/block/xd.c
--- v2.2.0-pre5/linux/drivers/block/xd.c Thu Nov 12 16:21:18 1998
+++ linux/drivers/block/xd.c Thu Jan 7 08:46:58 1999
@@ -894,7 +894,7 @@
X xd_setparam(CMD_WDSETPARAM,drive,xd_info[drive].heads,xd_info[drive].cylinders,
X ((u_short *) (buf))[0xD8],((u_short *) (buf))[0xDA],buf[0x1B4]);
X }
- /* 1002 based RLL controler requests converted adressing, but reports physical
+ /* 1002 based RLL controler requests converted addressing, but reports physical
X (physical 26 sec., logical 17 sec.)
X 1004 based ???? */
X if (rll & wd_1002) {
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/cdrom/cdrom.c linux/drivers/cdrom/cdrom.c
--- v2.2.0-pre5/linux/drivers/cdrom/cdrom.c Thu Jan 7 15:11:36 1999
+++ linux/drivers/cdrom/cdrom.c Thu Jan 7 08:46:59 1999
@@ -417,7 +417,7 @@
X cdo->lock_door(cdi, 1);
X cdinfo(CD_OPEN, "door locked.\n");
X }
- cdinfo(CD_OPEN, "device opened sucessfully.\n");
+ cdinfo(CD_OPEN, "device opened successfully.\n");
X return ret;
X
X /* Something failed. Try to unlock the drive, because some drivers
@@ -699,7 +699,7 @@
X sanitize_format(&ms_info.addr, &ms_info.addr_format,
X requested_format);
X IOCTL_OUT(arg, struct cdrom_multisession, ms_info);
- cdinfo(CD_DO_IOCTL, "CDROMMULTISESSION sucessful\n");
+ cdinfo(CD_DO_IOCTL, "CDROMMULTISESSION successful\n");
X return 0;
X }
X
@@ -789,7 +789,7 @@
X if ((ret=cdo->get_mcn(cdi, &mcn)))
X return ret;
X IOCTL_OUT(arg, struct cdrom_mcn, mcn);
- cdinfo(CD_DO_IOCTL, "CDROM_GET_MCN sucessful\n");
+ cdinfo(CD_DO_IOCTL, "CDROM_GET_MCN successful\n");
X return 0;
X }
X
@@ -895,7 +895,7 @@
X sanitize_format(&q.cdsc_absaddr, &back, requested);
X sanitize_format(&q.cdsc_reladdr, &q.cdsc_format, requested);
X IOCTL_OUT(arg, struct cdrom_subchnl, q);
- /* cdinfo(CD_DO_IOCTL, "CDROMSUBCHNL sucessful\n"); */
+ /* cdinfo(CD_DO_IOCTL, "CDROMSUBCHNL successful\n"); */
X return 0;
X }
X case CDROMREADTOCHDR: {
@@ -908,7 +908,7 @@
X if ((ret=cdo->audio_ioctl(cdi, cmd, &header)))
X return ret;
X IOCTL_OUT(arg, struct cdrom_tochdr, header);
- /* cdinfo(CD_DO_IOCTL, "CDROMREADTOCHDR sucessful\n"); */
+ /* cdinfo(CD_DO_IOCTL, "CDROMREADTOCHDR successful\n"); */
X return 0;
X }
X case CDROMREADTOCENTRY: {
@@ -930,7 +930,7 @@
X sanitize_format(&entry.cdte_addr,
X &entry.cdte_format, requested_format);
X IOCTL_OUT(arg, struct cdrom_tocentry, entry);
- /* cdinfo(CD_DO_IOCTL, "CDROMREADTOCENTRY sucessful\n"); */
+ /* cdinfo(CD_DO_IOCTL, "CDROMREADTOCENTRY successful\n"); */
X return 0;
X }
X case CDROMPLAYMSF: {
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/cdrom/sonycd535.c linux/drivers/cdrom/sonycd535.c
--- v2.2.0-pre5/linux/drivers/cdrom/sonycd535.c Sun Nov 8 14:02:53 1998
+++ linux/drivers/cdrom/sonycd535.c Thu Jan 7 08:46:59 1999
@@ -151,6 +151,8 @@
X # define CDU535_MESSAGE_NAME "Sony CDU-535"
X #endif
X
+#define CDU535_BLOCK_SIZE 2048
+
X #ifndef MAX_SPINUP_RETRY
X # define MAX_SPINUP_RETRY 3 /* 1 is sufficient for most drives... */
X #endif
@@ -591,7 +593,6 @@
X seek_and_read_N_blocks(Byte params[], int n_blocks, Byte status[2],
X Byte **buff, int buf_size)
X {
- const int block_size = 2048;
X Byte cmd_buff[7];
X int i;
X int read_status;
@@ -599,7 +600,7 @@
X Byte *data_buff;
X int sector_count = 0;
X
- if (buf_size < ((long)block_size) * n_blocks)
+ if (buf_size < CDU535_BLOCK_SIZE * n_blocks)
X return NO_ROOM;
X
X set_drive_mode(SONY535_CDROM_DRIVE_MODE, status);
@@ -625,7 +626,7 @@
X if ((read_status & SONY535_DATA_NOT_READY_BIT) == 0) {
X /* data is ready, read it */
X data_buff = buff[sector_count++];
- for (i = 0; i < block_size; i++)
+ for (i = 0; i < CDU535_BLOCK_SIZE; i++)
X *data_buff++ = inb(data_reg); /* unrolling this loop does not seem to help */
X data_valid = 1;
X break; /* exit the timeout loop */
@@ -639,7 +640,7 @@
X /* read all the data, now read the status */
X if ((i = read_exec_status(status)) != 0)
X return i;
- return block_size * sector_count;
+ return CDU535_BLOCK_SIZE * sector_count;
X } /* seek_and_read_N_blocks() */
X
X /****************************************************************************
@@ -776,7 +777,7 @@
X * The OS calls this to perform a read or write operation to the drive.
X * Write obviously fail. Reads to a read ahead of sony_buffer_size
X * bytes to help speed operations. This especially helps since the OS
- * uses 1024 byte blocks and the drive uses 2048 byte blocks. Since most
+ * may use 1024 byte blocks and the drive uses 2048 byte blocks. Since most
X * data access on a CD is done sequentially, this saves a lot of operations.
X */
X static void
@@ -873,7 +874,7 @@
X * seek_and_read_N_blocks for the various cases.
X */
X int readStatus = seek_and_read_N_blocks(params, read_size,
- status, sony_buffer, (read_size * 2048));
+ status, sony_buffer, (read_size * CDU535_BLOCK_SIZE));
X if (0 <= readStatus) /* Good data; common case, placed first */
X break;
X if (readStatus == NO_ROOM || spin_up_retry == MAX_SPINUP_RETRY) {
@@ -1480,6 +1481,8 @@
X NULL /* revalidate */
X };
X
+static int sonycd535_block_size = CDU535_BLOCK_SIZE;
+
X /*
X * Initialize the driver.
X */
@@ -1580,7 +1583,7 @@
X if (do_sony_cmd(cmd_buff, 2, status, ret_buff, 1, 1) == 0) {
X /* set the drive mode successful, we are set! */
X sony_buffer_size = SONY535_BUFFER_SIZE;
- sony_buffer_sectors = sony_buffer_size / 2048;
+ sony_buffer_sectors = sony_buffer_size / CDU535_BLOCK_SIZE;
X
X printk(KERN_INFO CDU535_MESSAGE_NAME " I/F CDROM : %8.8s %16.16s %4.4s",
X drive_config.vendor_id,
@@ -1597,6 +1600,7 @@
X return -EIO;
X }
X blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+ blksize_size[MAJOR_NR] = &sonycd535_block_size;
X read_ahead[MAJOR_NR] = 8; /* 8 sector (4kB) read-ahead */
X
X sony_toc = (struct s535_sony_toc *)
@@ -1617,7 +1621,8 @@
X return -ENOMEM;
X }
X for (i = 0; i < sony_buffer_sectors; i++) {
- sony_buffer[i] = (Byte *)kmalloc(2048, GFP_KERNEL);
+ sony_buffer[i] =
+ (Byte *)kmalloc(CDU535_BLOCK_SIZE, GFP_KERNEL);
X if (sony_buffer[i] == NULL) {
X while (--i>=0)
X kfree(sony_buffer[i]);
@@ -1680,7 +1685,7 @@
X
X release_region(sony535_cd_base_io, 4);
X for (i = 0; i < sony_buffer_sectors; i++)
- kfree_s(sony_buffer[i], 2048);
+ kfree_s(sony_buffer[i], CDU535_BLOCK_SIZE);
X kfree_s(sony_buffer, 4 * sony_buffer_sectors);
X kfree_s(last_sony_subcode, sizeof *last_sony_subcode);
X kfree_s(sony_toc, sizeof *sony_toc);
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/char/README.epca linux/drivers/char/README.epca
--- v2.2.0-pre5/linux/drivers/char/README.epca Sun Jun 7 11:16:29 1998
+++ linux/drivers/char/README.epca Thu Jan 7 08:46:59 1999
@@ -155,7 +155,7 @@
X current digiConfig application does not provide this function for PCI cards
X (Though it does build device nodes for non-PCI cards). To use this program
SHAR_EOF
true || echo 'restore of patch-2.2.0-pre6 failed'
fi
echo 'End of part 1'
echo 'File patch-2.2.0-pre6 is continued in part 2'
echo 2 > _shar_seq_.tmp
exit 0

Thomas...@ciw.uni-karlsruhe.de

unread,
Jan 10, 1999, 3:00:00 AM1/10/99
to
Archive-name: v2.1/patch-2.2.0-pre6/part3

#!/bin/sh
# this is part 3 of a 8 - part archive


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

# file patch-2.2.0-pre6 continued
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck
if test "$Scheck" != 3; 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.2.0-pre6'
else
echo 'x - continuing with patch-2.2.0-pre6'


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

+ media_tbl[dev->if_port].media_bits, ioaddr + Wn4_Media);
+ }
X
X /* Switch to the stats window, and clear all stats by reading. */
X outw(StatsDisable, ioaddr + EL3_CMD);
@@ -1138,22 +1110,23 @@
X printk(KERN_DEBUG "%s: Filling in the Rx ring.\n", dev->name);
X for (i = 0; i < RX_RING_SIZE; i++) {
X struct sk_buff *skb;
- vp->rx_ring[i].next = virt_to_bus(&vp->rx_ring[i+1]);
+ vp->rx_ring[i].next = cpu_to_le32(virt_to_bus(&vp->rx_ring[i+1]));
X vp->rx_ring[i].status = 0; /* Clear complete bit. */
- vp->rx_ring[i].length = PKT_BUF_SZ | LAST_FRAG;
- skb = DEV_ALLOC_SKB(PKT_BUF_SZ);
+ vp->rx_ring[i].length = cpu_to_le32(PKT_BUF_SZ | LAST_FRAG);
+ skb = dev_alloc_skb(PKT_BUF_SZ);
X vp->rx_skbuff[i] = skb;
X if (skb == NULL)
X break; /* Bad news! */
X skb->dev = dev; /* Mark as being used by this device. */
X #if LINUX_VERSION_CODE >= 0x10300
X skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
- vp->rx_ring[i].addr = virt_to_bus(skb->tail);
+ vp->rx_ring[i].addr = cpu_to_le32(virt_to_bus(skb->tail));
X #else
X vp->rx_ring[i].addr = virt_to_bus(skb->data);
X #endif
X }
- vp->rx_ring[i-1].next = virt_to_bus(&vp->rx_ring[0]); /* Wrap the ring. */
+ /* Wrap the ring. */
+ vp->rx_ring[i-1].next = cpu_to_le32(virt_to_bus(&vp->rx_ring[0]));
X outl(virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr);
X }
X if (vp->full_bus_master_tx) { /* Boomerang bus master Tx. */
@@ -1181,14 +1154,16 @@
X (vp->full_bus_master_tx ? DownComplete : TxAvailable) |
X (vp->full_bus_master_rx ? UpComplete : RxComplete) |
X (vp->bus_master ? DMADone : 0);
+ vp->intr_enable = SetIntrEnb | IntLatch | TxAvailable | RxComplete |
+ StatsFull | HostError | TxComplete | IntReq
+ | (vp->bus_master ? DMADone : 0) | UpComplete | DownComplete;
X outw(vp->status_enable, ioaddr + EL3_CMD);
X /* Ack all pending events, and set active indicator mask. */
X outw(AckIntr | IntLatch | TxAvailable | RxEarly | IntReq,
X ioaddr + EL3_CMD);
- outw(SetIntrEnb | IntLatch | TxAvailable | RxComplete | StatsFull
- | HostError | TxComplete
- | (vp->bus_master ? DMADone : 0) | UpComplete | DownComplete,
- ioaddr + EL3_CMD);
+ outw(vp->intr_enable, ioaddr + EL3_CMD);
+ if (vp->cb_fn_base) /* The PCMCIA people are idiots. */
+ writel(0x8000, vp->cb_fn_base + 4);
X
X MOD_INC_USE_COUNT;
X
@@ -1197,24 +1172,23 @@
X
X static void vortex_timer(unsigned long data)
X {
-#ifdef AUTOMEDIA
X struct device *dev = (struct device *)data;
X struct vortex_private *vp = (struct vortex_private *)dev->priv;
- int ioaddr = dev->base_addr;
- unsigned long flags;
+ long ioaddr = dev->base_addr;
+ int next_tick = 0;
X int ok = 0;
+ int media_status, mii_status, old_window;
X
X if (vortex_debug > 1)
X printk(KERN_DEBUG "%s: Media selection timer tick happened, %s.\n",
X dev->name, media_tbl[dev->if_port].name);
X
- save_flags(flags); cli(); {
- int old_window = inw(ioaddr + EL3_CMD) >> 13;
- int media_status;
- EL3WINDOW(4);
- media_status = inw(ioaddr + Wn4_Media);
- switch (dev->if_port) {
- case XCVR_10baseT: case XCVR_100baseTx: case XCVR_100baseFx:
+ disable_irq(dev->irq);
+ old_window = inw(ioaddr + EL3_CMD) >> 13;
+ EL3WINDOW(4);
+ media_status = inw(ioaddr + Wn4_Media);
+ switch (dev->if_port) {
+ case XCVR_10baseT: case XCVR_100baseTx: case XCVR_100baseFx:
X if (media_status & Media_LnkBeat) {
X ok = 1;
X if (vortex_debug > 1)
@@ -1223,27 +1197,40 @@
X } else if (vortex_debug > 1)
X printk(KERN_DEBUG "%s: Media %s is has no link beat, %x.\n",
X dev->name, media_tbl[dev->if_port].name, media_status);
-
X break;
- case XCVR_MII:
- {
- int mii_reg1 = mdio_read(ioaddr, vp->phys[0], 1);
+ case XCVR_MII: case XCVR_NWAY:
+ mii_status = mdio_read(ioaddr, vp->phys[0], 1);
+ ok = 1;
+ if (debug > 1)
+ printk(KERN_DEBUG "%s: MII transceiver has status %4.4x.\n",
+ dev->name, mii_status);
+ if (mii_status & 0x0004) {
X int mii_reg5 = mdio_read(ioaddr, vp->phys[0], 5);
- if (vortex_debug > 1)
- printk(KERN_DEBUG "%s: MII #%d status register is %4.4x, "
- "link partner capability %4.4x.\n",
- dev->name, vp->phys[0], mii_reg1, mii_reg5);
- if (mii_reg1 & 0x0004)
- ok = 1;
- break;
+ if (! vp->force_fd && mii_reg5 != 0xffff) {
+ int duplex = (mii_reg5&0x0100) ||
+ (mii_reg5 & 0x01C0) == 0x0040;
+ if (vp->full_duplex != duplex) {
+ vp->full_duplex = duplex;
+ printk(KERN_INFO "%s: Setting %s-duplex based on MII "
+ "#%d link partner capability of %4.4x.\n",
+ dev->name, vp->full_duplex ? "full" : "half",
+ vp->phys[0], mii_reg5);
+ /* Set the full-duplex bit. */
+ outb((vp->full_duplex ? 0x20 : 0) |
+ (dev->mtu > 1500 ? 0x40 : 0),
+ ioaddr + Wn3_MAC_Ctrl);
+ }
+ next_tick = 60*HZ;
+ }
X }
+ break;
X default: /* Other media types handled by Tx timeouts. */
X if (vortex_debug > 1)
X printk(KERN_DEBUG "%s: Media %s is has no indication, %x.\n",
X dev->name, media_tbl[dev->if_port].name, media_status);
X ok = 1;
- }
- if ( ! ok) {
+ }
+ if ( ! ok) {
X union wn3_config config;
X
X do {
@@ -1260,8 +1247,7 @@
X printk(KERN_DEBUG "%s: Media selection failed, now trying "
X "%s port.\n",
X dev->name, media_tbl[dev->if_port].name);
- vp->timer.expires = RUN_AT(media_tbl[dev->if_port].wait);
- add_timer(&vp->timer);
+ next_tick = RUN_AT(media_tbl[dev->if_port].wait);
X }
X outw((media_status & ~(Media_10TP|Media_SQE)) |
X media_tbl[dev->if_port].media_bits, ioaddr + Wn4_Media);
@@ -1273,21 +1259,25 @@
X
X outw(dev->if_port == XCVR_10base2 ? StartCoax : StopCoax,
X ioaddr + EL3_CMD);
- }
- EL3WINDOW(old_window);
- } restore_flags(flags);
- if (vortex_debug > 1)
+ }
+ EL3WINDOW(old_window);
+ enable_irq(dev->irq);
+
+ if (vortex_debug > 2)
X printk(KERN_DEBUG "%s: Media selection timer finished, %s.\n",
X dev->name, media_tbl[dev->if_port].name);
X
-#endif /* AUTOMEDIA*/
+ if (next_tick) {
+ vp->timer.expires = RUN_AT(next_tick);
+ add_timer(&vp->timer);
+ }
X return;
X }
X
X static void vortex_tx_timeout(struct device *dev)
X {
X struct vortex_private *vp = (struct vortex_private *)dev->priv;
- int ioaddr = dev->base_addr;
+ long ioaddr = dev->base_addr;
X int j;
X
X printk(KERN_ERR "%s: transmit timed out, tx_status %2.2x status %4.4x.\n",
@@ -1301,7 +1291,7 @@
X printk(KERN_ERR "%s: Interrupt posted but not delivered --"
X " IRQ blocked by another device?\n", dev->name);
X /* Bad idea here.. but we might as well handle a few events. */
- vortex_interrupt IRQ(dev->irq, dev, 0);
+ vortex_interrupt(dev->irq, dev, 0);
X }
X outw(TxReset, ioaddr + EL3_CMD);
X for (j = 200; j >= 0 ; j--)
@@ -1320,8 +1310,8 @@
X for (i = 0; i < TX_RING_SIZE; i++) {
X printk(KERN_DEBUG " %d: @%p length %8.8x status %8.8x\n", i,
X &vp->tx_ring[i],
- vp->tx_ring[i].length,
- vp->tx_ring[i].status);
+ le32_to_cpu(vp->tx_ring[i].length),
+ le32_to_cpu(vp->tx_ring[i].status));
X }
X }
X #endif
@@ -1351,14 +1341,14 @@
X }
X
X /*
- * Handle uncommon interrupt sources. This is a seperate routine to minimize
+ * Handle uncommon interrupt sources. This is a separate routine to minimize
X * the cache impact.


X */
X static void

X vortex_error(struct device *dev, int status)
X {
X struct vortex_private *vp = (struct vortex_private *)dev->priv;
- int ioaddr = dev->base_addr;
+ long ioaddr = dev->base_addr;
X int do_tx_reset = 0;
X int i;
X
@@ -1398,8 +1388,10 @@
X DoneDidThat++;
X }
X }
- if (status & IntReq) /* Restore all interrupt sources. */
- outw(ioaddr + EL3_CMD, vp->status_enable);
+ if (status & IntReq) { /* Restore all interrupt sources. */
+ outw(vp->status_enable, ioaddr + EL3_CMD);
+ outw(vp->intr_enable, ioaddr + EL3_CMD);
+ }
X if (status & HostError) {
X u16 fifo_diag;
X EL3WINDOW(4);
@@ -1445,7 +1437,7 @@
X vortex_start_xmit(struct sk_buff *skb, struct device *dev)
X {
X struct vortex_private *vp = (struct vortex_private *)dev->priv;
- int ioaddr = dev->base_addr;
+ long ioaddr = dev->base_addr;
X
X if (test_and_set_bit(0, (void*)&dev->tbusy) != 0) {
X if (jiffies - dev->trans_start >= TX_TIMEOUT)
@@ -1455,7 +1447,6 @@
X
X /* Put out the doubleword header... */
X outl(skb->len, ioaddr + TX_FIFO);
-#ifdef VORTEX_BUS_MASTER
X if (vp->bus_master) {
X /* Set the bus-master controller to transfer the packet. */
X outl(virt_to_bus(skb->data), ioaddr + Wn7_MasterAddr);
@@ -1473,16 +1464,6 @@
X /* Interrupt us when the FIFO has room for max-sized packet. */
X outw(SetTxThreshold + (1536>>2), ioaddr + EL3_CMD);
X }
-#else
- /* ... and the packet rounded to a doubleword. */
- outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2);
- DEV_FREE_SKB(skb);
- if (inw(ioaddr + TxFree) > 1536) {
- clear_bit(0, (void*)&dev->tbusy);
- } else
- /* Interrupt us when the FIFO has room for max-sized packet. */
- outw(SetTxThreshold + (1536>>2), ioaddr + EL3_CMD);
-#endif /* bus master */
X
X dev->trans_start = jiffies;
X
@@ -1517,7 +1498,7 @@
X boomerang_start_xmit(struct sk_buff *skb, struct device *dev)
X {
X struct vortex_private *vp = (struct vortex_private *)dev->priv;
- int ioaddr = dev->base_addr;
+ long ioaddr = dev->base_addr;
X
X if (test_and_set_bit(0, (void*)&dev->tbusy) != 0) {
X if (jiffies - dev->trans_start >= TX_TIMEOUT)
@@ -1539,13 +1520,12 @@
X printk(KERN_WARNING "%s: Tx Ring full, refusing to send buffer.\n",
X dev->name);
X return 1;
- }
- /* end change 06/25/97 M. Sievers */
+ }
X vp->tx_skbuff[entry] = skb;
X vp->tx_ring[entry].next = 0;
- vp->tx_ring[entry].addr = virt_to_bus(skb->data);
- vp->tx_ring[entry].length = skb->len | LAST_FRAG;
- vp->tx_ring[entry].status = skb->len | TxIntrUploaded;
+ vp->tx_ring[entry].addr = cpu_to_le32(virt_to_bus(skb->data));
+ vp->tx_ring[entry].length = cpu_to_le32(skb->len | LAST_FRAG);
+ vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded);
X
X save_flags(flags);
X cli();
@@ -1554,7 +1534,7 @@
X for (i = 600; i >= 0 ; i--)
X if ( (inw(ioaddr + EL3_STATUS) & CmdInProgress) == 0)
X break;
- prev_entry->next = virt_to_bus(&vp->tx_ring[entry]);
+ prev_entry->next = cpu_to_le32(virt_to_bus(&vp->tx_ring[entry]));
X if (inl(ioaddr + DownListPtr) == 0) {
X outl(virt_to_bus(&vp->tx_ring[entry]), ioaddr + DownListPtr);
X queued_packet++;
@@ -1566,7 +1546,7 @@
X if (vp->cur_tx - vp->dirty_tx > TX_RING_SIZE - 1)
X vp->tx_full = 1;
X else { /* Clear previous interrupt enable. */
- prev_entry->status &= ~TxIntrUploaded;
+ prev_entry->status &= cpu_to_le32(~TxIntrUploaded);
X clear_bit(0, (void*)&dev->tbusy);
X }
X dev->trans_start = jiffies;
@@ -1576,28 +1556,33 @@
X
X /* The interrupt handler does all of the Rx thread work and cleans up
X after the Tx thread. */
-static void vortex_interrupt IRQ(int irq, void *dev_id, struct pt_regs *regs)
+static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs)
X {
-#ifdef SA_SHIRQ /* Use the now-standard shared IRQ implementation. */
X struct device *dev = dev_id;
-#else
- struct device *dev = (struct device *)(irq2dev_map[irq]);
-#endif
- struct vortex_private *vp;
- int ioaddr, status;
- int latency;
+ struct vortex_private *vp = (struct vortex_private *)dev->priv;
+ long ioaddr;
+ int latency, status;
X int work_done = max_interrupt_work;
X
- vp = (struct vortex_private *)dev->priv;
- if (test_and_set_bit(0, (void*)&vp->in_interrupt)) {
+#if defined(__i386__)
+ /* A lock to prevent simultaneous entry bug on Intel SMP machines. */
+ if (test_and_set_bit(0, (void*)&dev->interrupt)) {
+ printk(KERN_ERR"%s: SMP simultaneous entry of an interrupt handler.\n",
+ dev->name);
+ dev->interrupt = 0; /* Avoid halting machine. */
+ return;
+ }
+#else
+ if (dev->interrupt) {
X printk(KERN_ERR "%s: Re-entering the interrupt handler.\n", dev->name);
X return;
X }
+ dev->interrupt = 1;
+#endif
X
X dev->interrupt = 1;
X ioaddr = dev->base_addr;
X latency = inb(ioaddr + Timer);
-
X status = inw(ioaddr + EL3_STATUS);
X
X if (vortex_debug > 4)
@@ -1646,17 +1631,23 @@
X mark_bh(NET_BH);
X }
X }
-#ifdef VORTEX_BUS_MASTER
X if (status & DMADone) {
- outw(0x1000, ioaddr + Wn7_MasterStatus); /* Ack the event. */
- clear_bit(0, (void*)&dev->tbusy);
- DEV_FREE_SKB(vp->tx_skb); /* Release the transfered buffer */
- mark_bh(NET_BH);
+ if (inw(ioaddr + Wn7_MasterStatus) & 0x1000) {
+ outw(0x1000, ioaddr + Wn7_MasterStatus); /* Ack the event. */
+ DEV_FREE_SKB(vp->tx_skb); /* Release the transfered buffer */
+ if (inw(ioaddr + TxFree) > 1536) {
+ clear_bit(0, (void*)&dev->tbusy);
+ mark_bh(NET_BH);
+ } else /* Interrupt when FIFO has room for max-sized packet. */
+ outw(SetTxThreshold + (1536>>2), ioaddr + EL3_CMD);
+ }
X }
-#endif
X /* Check for all uncommon interrupts at once. */
- if (status & (HostError | RxEarly | StatsFull | TxComplete | IntReq))
+ if (status & (HostError | RxEarly | StatsFull | TxComplete | IntReq)) {
+ if (status == 0xffff)
+ break;
X vortex_error(dev, status);
+ }
X
X if (--work_done < 0) {
X if ((status & (0x7fe - (UpComplete | DownComplete))) == 0) {
@@ -1669,13 +1660,14 @@
X /* Disable all pending interrupts. */
X outw(SetStatusEnb | ((~status) & 0x7FE), ioaddr + EL3_CMD);
X outw(AckIntr | 0x7FF, ioaddr + EL3_CMD);
- /* Set a timer to reenable interrupts. */
-
+ /* The timer will reenable interrupts. */
X break;
X }
X }
X /* Acknowledge the IRQ. */
X outw(AckIntr | IntReq | IntLatch, ioaddr + EL3_CMD);
+ if (vp->cb_fn_base) /* The PCMCIA people are idiots. */
+ writel(0x8000, vp->cb_fn_base + 4);
X
X } while ((status = inw(ioaddr + EL3_STATUS)) & (IntLatch | RxComplete));
X
@@ -1683,16 +1675,18 @@
X printk(KERN_DEBUG "%s: exiting interrupt, status %4.4x.\n",
X dev->name, status);
X
+#if defined(__i386__)
+ clear_bit(0, (void*)&dev->interrupt);
+#else
X dev->interrupt = 0;
- clear_bit(0, (void*)&vp->in_interrupt);
+#endif
X return;
X }
X
-static int
-vortex_rx(struct device *dev)
+static int vortex_rx(struct device *dev)
X {
X struct vortex_private *vp = (struct vortex_private *)dev->priv;
- int ioaddr = dev->base_addr;
+ long ioaddr = dev->base_addr;
X int i;
X short rx_status;
X
@@ -1715,25 +1709,28 @@
X int pkt_len = rx_status & 0x1fff;
X struct sk_buff *skb;
X
- skb = DEV_ALLOC_SKB(pkt_len + 5);
+ skb = dev_alloc_skb(pkt_len + 5);
X if (vortex_debug > 4)
X printk(KERN_DEBUG "Receiving packet size %d status %4.4x.\n",
X pkt_len, rx_status);
X if (skb != NULL) {
X skb->dev = dev;
-#if LINUX_VERSION_CODE >= 0x10300
X skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
X /* 'skb_put()' points to the start of sk_buff data area. */
- insl(ioaddr + RX_FIFO, skb_put(skb, pkt_len),
- (pkt_len + 3) >> 2);
+ if (vp->bus_master &&
+ ! (inw(ioaddr + Wn7_MasterStatus) & 0x8000)) {
+ outl(virt_to_bus(skb_put(skb, pkt_len)),
+ ioaddr + Wn7_MasterAddr);
+ outw((skb->len + 3) & ~3, ioaddr + Wn7_MasterLen);
+ outw(StartDMAUp, ioaddr + EL3_CMD);
+ while (inw(ioaddr + Wn7_MasterStatus) & 0x8000)
+ ;
+ } else {
+ insl(ioaddr + RX_FIFO, skb_put(skb, pkt_len),
+ (pkt_len + 3) >> 2);
+ }
X outw(RxDiscard, ioaddr + EL3_CMD); /* Pop top Rx packet. */
X skb->protocol = eth_type_trans(skb, dev);
-#else
- skb->len = pkt_len;
- /* 'skb->data' points to the start of sk_buff data area. */
- insl(ioaddr + RX_FIFO, skb->data, (pkt_len + 3) >> 2);
- outw(RxDiscard, ioaddr + EL3_CMD); /* Pop top Rx packet. */
-#endif /* KERNEL_1_3_0 */
X netif_rx(skb);
X dev->last_rx = jiffies;
X vp->stats.rx_packets++;
@@ -1762,7 +1759,7 @@
X {
X struct vortex_private *vp = (struct vortex_private *)dev->priv;
X int entry = vp->cur_rx % RX_RING_SIZE;
- int ioaddr = dev->base_addr;
+ long ioaddr = dev->base_addr;
X int rx_status;
X int rx_work_limit = vp->dirty_rx + RX_RING_SIZE - vp->cur_rx;
X
@@ -1770,8 +1767,9 @@
X printk(KERN_DEBUG " In boomerang_rx(), status %4.4x, rx_status "
X "%4.4x.\n",
X inw(ioaddr+EL3_STATUS), inw(ioaddr+RxStatus));
- while ((--rx_work_limit >= 0) &&
- ((rx_status = vp->rx_ring[entry].status) & RxDComplete)) {
+ while ((rx_status = le32_to_cpu(vp->rx_ring[entry].status)) & RxDComplete){
+ if (--rx_work_limit < 0)
+ break;
X if (rx_status & RxDError) { /* Error, update stats. */
X unsigned char rx_error = rx_status >> 16;
X if (vortex_debug > 2)
@@ -1794,41 +1792,28 @@
X /* Check if the packet is long enough to just accept without
X copying to a properly sized skbuff. */
X if (pkt_len < rx_copybreak
- && (skb = DEV_ALLOC_SKB(pkt_len + 2)) != 0) {
+ && (skb = dev_alloc_skb(pkt_len + 2)) != 0) {
X skb->dev = dev;
-#if LINUX_VERSION_CODE >= 0x10300
X skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
X /* 'skb_put()' points to the start of sk_buff data area. */
X memcpy(skb_put(skb, pkt_len),
- bus_to_virt(vp->rx_ring[entry].addr),
+ bus_to_virt(le32_to_cpu(vp->rx_ring[entry].addr)),
X pkt_len);
-#else
- memcpy(skb->data, bus_to_virt(vp->rx_ring[entry].addr), pkt_len);
- skb->len = pkt_len;
-#endif
X rx_copy++;
- } else{
+ } else {
X void *temp;
X /* Pass up the skbuff already on the Rx ring. */
X skb = vp->rx_skbuff[entry];
- if (skb == NULL) {
- printk(KERN_WARNING "%s: in boomerang_rx -- attempt to use NULL skb caught\n", dev->name);
- break;
- }
X vp->rx_skbuff[entry] = NULL;
-#if LINUX_VERSION_CODE >= 0x10300
X temp = skb_put(skb, pkt_len);
-#else
- temp = skb->data;
-#endif
X /* Remove this checking code for final release. */
- if (bus_to_virt(vp->rx_ring[entry].addr) != temp)
+ if (bus_to_virt(le32_to_cpu(vp->rx_ring[entry].addr)) != temp)
X printk(KERN_ERR "%s: Warning -- the skbuff addresses do not match"
X " in boomerang_rx: %p vs. %p.\n", dev->name,
- bus_to_virt(vp->rx_ring[entry].addr), temp);
+ bus_to_virt(le32_to_cpu(vp->rx_ring[entry].addr)),
+ temp);
X rx_nocopy++;
X }
-#if LINUX_VERSION_CODE > 0x10300
X skb->protocol = eth_type_trans(skb, dev);
X { /* Use hardware checksum info. */
X int csum_bits = rx_status & 0xee000000;
@@ -1839,9 +1824,6 @@
X rx_csumhits++;
X }
X }
-#else
- skb->len = pkt_len;
-#endif
X netif_rx(skb);
X dev->last_rx = jiffies;
X vp->stats.rx_packets++;
@@ -1853,29 +1835,17 @@
X struct sk_buff *skb;
X entry = vp->dirty_rx % RX_RING_SIZE;
X if (vp->rx_skbuff[entry] == NULL) {
- skb = DEV_ALLOC_SKB(PKT_BUF_SZ);
- if (skb == NULL) {
- printk(KERN_DEBUG "%s: in boomerang_rx -- could not allocate skbuff\n", dev->name);
+ skb = dev_alloc_skb(PKT_BUF_SZ);
+ if (skb == NULL)
X break; /* Bad news! */
- }
X skb->dev = dev; /* Mark as being used by this device. */
-#if LINUX_VERSION_CODE > 0x10300
X skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
- vp->rx_ring[entry].addr = virt_to_bus(skb->tail);
-#else
- vp->rx_ring[entry].addr = virt_to_bus(skb->data);
-#endif
+ vp->rx_ring[entry].addr = cpu_to_le32(virt_to_bus(skb->tail));
X vp->rx_skbuff[entry] = skb;
X }
X vp->rx_ring[entry].status = 0; /* Clear complete bit. */
X outw(UpUnstall, ioaddr + EL3_CMD);
X }
-
- if (vp->dirty_rx >= RX_RING_SIZE ) {
- vp->cur_rx -= RX_RING_SIZE;
- vp->dirty_rx -= RX_RING_SIZE;
- }
-


X return 0;
X }
X

@@ -1883,7 +1853,7 @@
X vortex_close(struct device *dev)
X {
X struct vortex_private *vp = (struct vortex_private *)dev->priv;
- int ioaddr = dev->base_addr;
+ long ioaddr = dev->base_addr;
X int i;
X
X dev->start = 0;
@@ -1910,12 +1880,7 @@
X /* Turn off thinnet power. Green! */
X outw(StopCoax, ioaddr + EL3_CMD);
X
-#ifdef SA_SHIRQ
X free_irq(dev->irq, dev);
-#else
- free_irq(dev->irq);
- irq2dev_map[dev->irq] = 0;
-#endif
X
X outw(SetIntrEnb | 0x0000, ioaddr + EL3_CMD);
X
@@ -1945,8 +1910,7 @@


X return 0;
X }
X

-static struct enet_statistics *
-vortex_get_stats(struct device *dev)
+static struct net_device_stats *vortex_get_stats(struct device *dev)
X {
X struct vortex_private *vp = (struct vortex_private *)dev->priv;
X unsigned long flags;
@@ -1967,7 +1931,7 @@
X table. This is done by checking that the ASM (!) code generated uses
X atomic updates with '+='.
X */
-static void update_stats(int ioaddr, struct device *dev)
+static void update_stats(long ioaddr, struct device *dev)
X {
X struct vortex_private *vp = (struct vortex_private *)dev->priv;
X
@@ -1998,20 +1962,14 @@
X return;
X }
X
-#ifdef HAVE_PRIVATE_IOCTL
X static int vortex_ioctl(struct device *dev, struct ifreq *rq, int cmd)
X {
X struct vortex_private *vp = (struct vortex_private *)dev->priv;
- int ioaddr = dev->base_addr;
+ long ioaddr = dev->base_addr;
X u16 *data = (u16 *)&rq->ifr_data;
X int phy = vp->phys[0] & 0x1f;
X
- if (vortex_debug > 2)
- printk(KERN_DEBUG "%s: In ioct(%-.6s, %#4.4x) %4.4x %4.4x %4.4x %4.4x.\n",
- dev->name, rq->ifr_ifrn.ifrn_name, cmd,
- data[0], data[1], data[2], data[3]);
-
- switch(cmd) {
+ switch(cmd) {
X case SIOCDEVPRIVATE: /* Get the address of the PHY in use. */
X data[0] = phy;
X case SIOCDEVPRIVATE+1: /* Read the specified MII register. */
@@ -2021,22 +1979,20 @@
X case SIOCDEVPRIVATE+2: /* Write the specified MII register */
X if (!suser())
X return -EPERM;
+ EL3WINDOW(4);
X mdio_write(ioaddr, data[0] & 0x1f, data[1] & 0x1f, data[2]);
X return 0;
X default:
X return -EOPNOTSUPP;
X }
X }
-#endif /* HAVE_PRIVATE_IOCTL */
X
-/* This new version of set_rx_mode() supports v1.4 kernels.
- The Vortex chip has no documented multicast filter, so the only
+/* Pre-Cyclone chips have no documented multicast filter, so the only
X multicast setting is to receive all multicast frames. At least
X the chip has a very clean way to set the mode, unlike many others. */
-static void
-set_rx_mode(struct device *dev)
+static void set_rx_mode(struct device *dev)
X {
- int ioaddr = dev->base_addr;
+ long ioaddr = dev->base_addr;
X int new_mode;
X
X if (dev->flags & IFF_PROMISC) {
@@ -2050,14 +2006,6 @@
X
X outw(new_mode, ioaddr + EL3_CMD);
X }
-#ifndef NEW_MULTICAST
-/* The old interface to set the Rx mode. */
-static void
-set_multicast_list(struct device *dev, int num_addrs, void *addrs)
-{
- set_rx_mode(dev);
-}
-#endif
X
X
X /* MII transceiver control section.
@@ -2068,7 +2016,7 @@
X /* The maximum data clock rate is 2.5 Mhz. The minimum timing is usually
X met by back-to-back PCI I/O cycles, but we insert a delay to avoid
X "overclocking" issues. */
-#define mdio_delay() udelay(1)
+#define mdio_delay() inl(mdio_addr)
X
X #define MDIO_SHIFT_CLK 0x01
X #define MDIO_DIR_WRITE 0x04
@@ -2079,11 +2027,11 @@
X
X /* Generate the preamble required for initial synchronization and
X a few older transceivers. */
-static void mdio_sync(int ioaddr, int bits)
+static void mdio_sync(long ioaddr, int bits)
X {
- int mdio_addr = ioaddr + Wn4_PhysicalMgmt;
+ long mdio_addr = ioaddr + Wn4_PhysicalMgmt;
X
- /* Establish sync by sending at least 32 logic ones. */
+ /* Establish sync by sending at least 32 logic ones. */
X while (-- bits >= 0) {
X outw(MDIO_DATA_WRITE1, mdio_addr);
X mdio_delay();
@@ -2092,12 +2040,12 @@
X }
X }
X
-static int mdio_read(int ioaddr, int phy_id, int location)
+static int mdio_read(long ioaddr, int phy_id, int location)
X {
X int i;
X int read_cmd = (0xf6 << 10) | (phy_id << 5) | location;
X unsigned int retval = 0;
- int mdio_addr = ioaddr + Wn4_PhysicalMgmt;
+ long mdio_addr = ioaddr + Wn4_PhysicalMgmt;
X
X if (mii_preamble_required)
X mdio_sync(ioaddr, 32);
@@ -2118,13 +2066,17 @@
X outw(MDIO_ENB_IN | MDIO_SHIFT_CLK, mdio_addr);
X mdio_delay();
X }
- return retval>>1 & 0xffff;
+#if 0
+ return (retval>>1) & 0x1ffff;
+#else
+ return retval & 0x20000 ? 0xffff : retval>>1 & 0xffff;
+#endif
X }
X
-static void mdio_write(int ioaddr, int phy_id, int location, int value)
+static void mdio_write(long ioaddr, int phy_id, int location, int value)
X {
X int write_cmd = 0x50020000 | (phy_id << 23) | (location << 18) | value;
- int mdio_addr = ioaddr + Wn4_PhysicalMgmt;
+ long mdio_addr = ioaddr + Wn4_PhysicalMgmt;
X int i;
X
X if (mii_preamble_required)
@@ -2151,8 +2103,7 @@
X
X
X #ifdef MODULE
-void
-cleanup_module(void)
+void cleanup_module(void)
X {
X struct device *next_dev;
X
@@ -2162,11 +2113,14 @@
X
X /* No need to check MOD_IN_USE, as sys_delete_module() checks. */
X while (root_vortex_dev) {
- next_dev = ((struct vortex_private *)root_vortex_dev->priv)->next_module;
+ struct vortex_private *vp=(void *)(root_vortex_dev->priv);
+ next_dev = vp->next_module;
X unregister_netdev(root_vortex_dev);
X outw(TotalReset, root_vortex_dev->base_addr + EL3_CMD);
- release_region(root_vortex_dev->base_addr, VORTEX_TOTAL_SIZE);
+ release_region(root_vortex_dev->base_addr,
+ pci_tbl[vp->chip_id].io_size);
X kfree(root_vortex_dev);
+ kfree(vp->priv_addr);
X root_vortex_dev = next_dev;
X }
X }
@@ -2177,7 +2131,7 @@
X * Local variables:
X * compile-command: "gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c 3c59x.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`"
X * SMP-compile-command: "gcc -D__SMP__ -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c 3c59x.c"
- * compile-command-alt1: "gcc -DCARDBUS -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c 3c59x.c -o 3c59x_cb.o"
+ * cardbus-compile-command: "gcc -DCARDBUS -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c 3c59x.c -o 3c575_cb.o -I/usr/src/pcmcia-cs-3.0.5/include/"
X * c-indent-level: 4
X * c-basic-offset: 4
X * tab-width: 4
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/net/82596.c linux/drivers/net/82596.c
--- v2.2.0-pre5/linux/drivers/net/82596.c Thu Sep 17 17:53:36 1998
+++ linux/drivers/net/82596.c Thu Jan 7 08:46:59 1999
@@ -67,7 +67,7 @@
X #endif
X
X /*
- * Define various macros for Channel Attention, word swapping etc., dependant
+ * Define various macros for Channel Attention, word swapping etc., dependent
X * on architecture. MVME and BVME are 680x0 based, otherwise it is Intel.
X */
X
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/net/8390.c linux/drivers/net/8390.c
--- v2.2.0-pre5/linux/drivers/net/8390.c Mon Dec 28 15:00:52 1998
+++ linux/drivers/net/8390.c Thu Jan 7 08:47:54 1999
@@ -1107,6 +1107,12 @@
X
X #ifdef MODULE
X
+EXPORT_SYMBOL(ei_open);
+EXPORT_SYMBOL(ei_close);
+EXPORT_SYMBOL(ei_interrupt);
+EXPORT_SYMBOL(ethdev_init);
+EXPORT_SYMBOL(NS8390_init);
+
X struct module *NS8390_module = NULL;
X
X int init_module(void)
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/net/Makefile linux/drivers/net/Makefile
--- v2.2.0-pre5/linux/drivers/net/Makefile Thu Dec 31 10:29:00 1998
+++ linux/drivers/net/Makefile Thu Jan 7 08:47:54 1999
@@ -826,7 +826,7 @@
X L_OBJS += 8390.o
X else
X ifdef CONFIG_8390_MODULE
- M_OBJS += 8390.o
+ MX_OBJS += 8390.o
X endif
X endif
X
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/net/acenic.c linux/drivers/net/acenic.c
--- v2.2.0-pre5/linux/drivers/net/acenic.c Tue Dec 22 14:16:55 1998
+++ linux/drivers/net/acenic.c Thu Jan 7 12:25:09 1999
@@ -7,6 +7,11 @@
X * Thanks to Alteon and 3Com for providing hardware and documentation
X * enabling me to write this driver.
X *
+ * A mailing list for discussing the use of this driver has been
+ * setup, please subscribe to the lists if you have any questions
+ * about the driver. Send mail to linux-ac...@sunsite.auc.dk to
+ * see how to subscribe.
+ *
X * This program is free software; you can redistribute it and/or modify
X * it under the terms of the GNU General Public License as published by
X * the Free Software Foundation; either version 2 of the License, or
@@ -57,10 +62,6 @@
X * firmware. Also the programming interface is quite neat, except for
X * the parts dealing with the i2c eeprom on the card ;-)
X *
- * A number of standard Ethernet receive skb's are now allocated at
- * init time and not released before the driver is unloaded. This
- * makes it possible to do ifconfig down/up.
- *
X * Using jumbo frames:
X *
X * To enable jumbo frames, simply specify an mtu between 1500 and 9000
@@ -132,7 +133,7 @@
X static int max_tx_desc[8] = {0, };
X static int max_rx_desc[8] = {0, };
X
-static const char *version = "acenic.c: v0.19 12/17/98 Jes Sorensen (Jes.So...@cern.ch)\n";
+static const char *version = "acenic.c: v0.22 01/07/99 Jes Sorensen (Jes.So...@cern.ch)\n";
X
X static struct device *root_dev = NULL;
X
@@ -143,37 +144,28 @@
X static int i = 0;
X int boards_found = 0;
X int version_disp;
- u32 tmp;
X struct ace_private *ap;
+ u8 pci_latency;
+#if 0
X u16 vendor, device;
X u8 pci_bus;
X u8 pci_dev_fun;
- u8 pci_latency;
X u8 irq;
+#endif
+ struct pci_dev *pdev = NULL;
X
X if (!pci_present()) /* is PCI support present? */
X return -ENODEV;
X
X version_disp = 0;
X
- for (; i < 255; i++)
+ while((pdev = pci_find_class(PCI_CLASS_NETWORK_ETHERNET << 8, pdev)))
X {
X dev = NULL;
X
- if (pcibios_find_class(PCI_CLASS_NETWORK_ETHERNET << 8,
- i, &pci_bus, &pci_dev_fun) !=
- PCIBIOS_SUCCESSFUL)
- break;
-
- pcibios_read_config_word(pci_bus, pci_dev_fun,
- PCI_VENDOR_ID, &vendor);
-
- pcibios_read_config_word(pci_bus, pci_dev_fun,
- PCI_DEVICE_ID, &device);
-
- if ((vendor != PCI_VENDOR_ID_ALTEON) &&
- !((vendor == PCI_VENDOR_ID_3COM) &&
- (device == PCI_DEVICE_ID_3COM_3C985)))
+ if ((pdev->vendor != PCI_VENDOR_ID_ALTEON) &&
+ !((pdev->vendor == PCI_VENDOR_ID_3COM) &&
+ (pdev->device == PCI_DEVICE_ID_3COM_3C985)))
X continue;
X
X dev = init_etherdev(dev, sizeof(struct ace_private));
@@ -188,37 +180,12 @@
X dev->priv = kmalloc(sizeof(*ap), GFP_KERNEL);
X
X ap = dev->priv;
- ap->vendor = vendor;
-
- /* Read register base address from
- PCI Configuration Space */
+ ap->pdev = pdev;
+ ap->vendor = pdev->vendor;
X
- pcibios_read_config_dword(pci_bus, pci_dev_fun,
- PCI_BASE_ADDRESS_0, &tmp);
+ pci_set_master(pdev);
X
- pcibios_read_config_byte(pci_bus, pci_dev_fun,
- PCI_INTERRUPT_LINE, &irq);
-
- pcibios_read_config_word(pci_bus, pci_dev_fun,
- PCI_COMMAND, &ap->pci_command);
-
- if (!(ap->pci_command & PCI_COMMAND_MASTER)){
- ap->pci_command |= PCI_COMMAND_MASTER;
-
- pcibios_write_config_word(pci_bus, pci_dev_fun,
- PCI_COMMAND,
- ap->pci_command);
- }
-
- if (!(ap->pci_command & PCI_COMMAND_MEMORY)){
- printk(KERN_ERR "Shared mem not enabled - "
- "unable to configure AceNIC\n");
- break;
- }
-
- dev->irq = irq;
- ap->pci_bus = pci_bus;
- ap->pci_dev_fun = pci_dev_fun;
+ dev->irq = pdev->irq;
X #ifdef __SMP__
X spin_lock_init(&ap->lock);
X #endif
@@ -245,13 +212,13 @@
X printk(version);
X }
X
- pcibios_read_config_byte(pci_bus, pci_dev_fun,
- PCI_LATENCY_TIMER, &pci_latency);
+ pci_read_config_word(pdev, PCI_COMMAND, &ap->pci_command);
+
+ pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &pci_latency);
X if (pci_latency <= 0x40){
X pci_latency = 0x40;
- pcibios_write_config_byte(pci_bus, pci_dev_fun,
- PCI_LATENCY_TIMER,
- pci_latency);
+ pci_write_config_byte(pdev, PCI_LATENCY_TIMER,
+ pci_latency);
X }
X
X switch(ap->vendor){
@@ -268,14 +235,15 @@
X printk(KERN_INFO "%s: Unknown AceNIC ", dev->name);
X break;
X }
- printk("Gigabit Ethernet at 0x%08x, irq %i, PCI latency %i "
- "clks\n", tmp, dev->irq, pci_latency);
+ printk("Gigabit Ethernet at 0x%08lx, irq %i, PCI latency %i "
+ "clks\n", pdev->base_address[0], dev->irq, pci_latency);
X
X /*
X * Remap the regs into kernel space.
X */
X
- ap->regs = (struct ace_regs *)ioremap(tmp, 0x4000);
+ ap->regs = (struct ace_regs *)ioremap(pdev->base_address[0],
+ 0x4000);
X if (!ap->regs){
X printk(KERN_ERR "%s: Unable to map I/O register, "
X "AceNIC %i will be disabled.\n", dev->name, i);
@@ -404,7 +372,7 @@
X struct ace_private *ap;
X struct ace_regs *regs;
X struct ace_info *info;
- u32 tig_ver, mac1 = 0, mac2 = 0, tmp;
+ u32 tig_ver, mac1, mac2, tmp;
X unsigned long tmp_ptr, myjif;
X short i;
X
@@ -471,10 +439,12 @@
X return -ENODEV;
X }
X
+ mac1 = 0;
X for(i = 0; i < 4; i++){
X mac1 = mac1 << 8;
X mac1 |= read_eeprom_byte(regs, 0x8c+i);
X }
+ mac2 = 0;
X for(i = 4; i < 8; i++){
X mac2 = mac2 << 8;
X mac2 |= read_eeprom_byte(regs, 0x8c+i);
@@ -527,10 +497,8 @@
X "supported, PCI write and invalidate "
X "disabled\n", L1_CACHE_BYTES);
X ap->pci_command &= ~PCI_COMMAND_INVALIDATE;
- pcibios_write_config_word(ap->pci_bus,
- ap->pci_dev_fun,
- PCI_COMMAND,
- ap->pci_command);
+ pci_write_config_word(ap->pdev, PCI_COMMAND,
+ ap->pci_command);
X }
X }
X }
@@ -646,10 +614,6 @@
X #if 0
X {
X u32 tmp;
- tmp = regs->AssistState;
- tmp &= ~2;
- tmp |= 1;
- regs->AssistState = tmp;
X
X tmp = regs->MacRxState;
X tmp &= ~4;
@@ -659,35 +623,43 @@
X
X regs->TuneStatTicks = 2 * TICKS_PER_SEC;
X
- if ((board_idx < 8) && tx_coal_tick[board_idx])
- regs->TuneTxCoalTicks = tx_coal_tick[board_idx] *
- TICKS_PER_SEC / 1000;
- else
+ if (board_idx >= 0) {
+ if ((board_idx < 8) && tx_coal_tick[board_idx])
+ regs->TuneTxCoalTicks = tx_coal_tick[board_idx] *
+ TICKS_PER_SEC / 1000;
+ else
+ regs->TuneTxCoalTicks = TICKS_PER_SEC / 500;
+ if ((board_idx < 8) && max_tx_desc[board_idx])
+ regs->TuneMaxTxDesc = max_tx_desc[board_idx];
+ else
+ regs->TuneMaxTxDesc = 7;
+
+ if ((board_idx < 8) && rx_coal_tick[board_idx])
+ regs->TuneRxCoalTicks = rx_coal_tick[board_idx] *
+ TICKS_PER_SEC / 1000;
+ else
+ regs->TuneRxCoalTicks = TICKS_PER_SEC / 10000;
+ if ((board_idx < 8) && max_rx_desc[board_idx])
+ regs->TuneMaxRxDesc = max_rx_desc[board_idx];
+ else
+ regs->TuneMaxRxDesc = 2;
+
+ if (board_idx < 8)
+ regs->TuneTrace = trace[board_idx];
+ else
+ regs->TuneTrace = 0;
+ }else{
X regs->TuneTxCoalTicks = TICKS_PER_SEC / 500;
- if ((board_idx < 8) && max_tx_desc[board_idx])
- regs->TuneMaxTxDesc = max_tx_desc[board_idx];
- else
X regs->TuneMaxTxDesc = 7;
-
- if ((board_idx < 8) && rx_coal_tick[board_idx])
- regs->TuneRxCoalTicks = rx_coal_tick[board_idx] *
- TICKS_PER_SEC / 1000;
- else
X regs->TuneRxCoalTicks = TICKS_PER_SEC / 10000;
- if ((board_idx < 8) && max_rx_desc[board_idx])
- regs->TuneMaxRxDesc = max_rx_desc[board_idx];
- else
X regs->TuneMaxRxDesc = 2;
-
- if (board_idx < 8)
- regs->TuneTrace = trace[board_idx];
- else
X regs->TuneTrace = 0;
+ }
X
X tmp = LNK_ENABLE;
X
- if ((board_idx > 7) || !(link[board_idx])){
- if (board_idx > 8)
+ if ((board_idx > 7) || (board_idx < 0) || !(link[board_idx])){
+ if (board_idx > 7)
X printk(KERN_WARNING "%s: more then 8 NICs detected, "
X "ignoring link options!\n", dev->name);
X /*
@@ -700,6 +672,7 @@
X tmp |= LNK_TX_FLOW_CTL_Y;
X } else {
X int option = link[board_idx];
+
X if (option & 0x01){
X printk(KERN_INFO "%s: Setting half duplex link\n",
X dev->name);
@@ -756,7 +729,7 @@
X myjif = jiffies + 3 * HZ;
X while (time_before(jiffies, myjif) && !ap->fw_running);
X if (!ap->fw_running){
- printk(KERN_ERR "%s: firmware NOT running!\n", dev->name);
+ printk(KERN_ERR "%s: Firmware NOT running!\n", dev->name);
X ace_dump_trace(ap);
X regs->CpuCtrl |= CPU_HALT;
X return -EBUSY;
@@ -1501,11 +1474,14 @@
X }
X
X
-__initfunc(int ace_copy(struct ace_regs *regs, void *src, u32 dest, int size))
+__initfunc(void ace_copy(struct ace_regs *regs, void *src, u32 dest, int size))
X {
X int tsize;
X u32 tdest;
X
+ if (size <= 0)
+ return;
+
X while(size > 0){
X tsize = min(((~dest & (ACE_WINDOW_SIZE - 1)) + 1),
X min(size, ACE_WINDOW_SIZE));
@@ -1524,15 +1500,18 @@
X size -= tsize;
X }
X
- return 0;
+ return;
X }
X
X
-__initfunc(int ace_clear(struct ace_regs *regs, u32 dest, int size))
+__initfunc(void ace_clear(struct ace_regs *regs, u32 dest, int size))
X {
- int tsize;
+ int tsize = 0;
X u32 tdest;
X
+ if (size <= 0)
+ return;
+
X while(size > 0){
X tsize = min(((~dest & (ACE_WINDOW_SIZE - 1)) + 1),
X min(size, ACE_WINDOW_SIZE));
@@ -1545,7 +1524,7 @@
X size -= tsize;
X }
X
- return 0;
+ return;
X }
X
X
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/net/acenic.h linux/drivers/net/acenic.h
--- v2.2.0-pre5/linux/drivers/net/acenic.h Tue Dec 22 14:16:55 1998
+++ linux/drivers/net/acenic.h Thu Jan 7 12:25:09 1999
@@ -581,8 +581,11 @@
X int flags;
X u16 vendor;
X u16 pci_command;
+ struct pci_dev *pdev;
+#if 0
X u8 pci_bus;
X u8 pci_dev_fun;
+#endif
X char name[24];
X struct net_device_stats stats;
X };
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/net/acenic_firmware.h linux/drivers/net/acenic_firmware.h
--- v2.2.0-pre5/linux/drivers/net/acenic_firmware.h Thu Jan 7 15:11:37 1999
+++ linux/drivers/net/acenic_firmware.h Thu Jan 7 12:25:09 1999
@@ -2799,7 +2799,7 @@
X 0x3c010001, 0x220821, 0xac317120, 0x8fbf0024, 0x8fb40020, 0x8fb3001c,
X 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x3e00008, 0x27bd0028, 0x0,
X 0x0 };
-u32 tigonFwData[(MAX_DATA_LEN/4) + 1] __init = {
+u32 tigonFwData[(MAX_DATA_LEN/4) + 1] __initdata = {
X 0x416c7465, 0x6f6e2041, 0x63654e49, 0x43205600, 0x416c7465, 0x6f6e2041,
X 0x63654e49, 0x43205600, 0x42424242, 0x0, 0x0, 0x0,
X 0x135430, 0x13e7fc, 0x0, 0x0, 0x0, 0x0,
@@ -2814,7 +2814,7 @@
X 0x12000060, 0x12000180, 0x120001e0, 0x0, 0x0, 0x0,
X 0x0, 0x0, 0x0, 0x0, 0x30001, 0x1,
X 0x30201, 0x0, 0x0 };
-u32 tigonFwRodata[(MAX_RODATA_LEN/4) + 1] __init = {
+u32 tigonFwRodata[(MAX_RODATA_LEN/4) + 1] __initdata = {
X 0x24486561, 0x6465723a, 0x202f7072, 0x6f6a6563, 0x74732f72, 0x63732f73,
X 0x772f6765, 0x2f6e6963, 0x2f66772f, 0x636f6d6d, 0x6f6e2f66, 0x776d6169,
X 0x6e2e632c, 0x7620312e, 0x312e322e, 0x31312031, 0x3939382f, 0x30342f32,
@@ -2939,7 +2939,7 @@
X int tigon2FwBssLen = 0x20c0;
X u32 tigon2FwSbssAddr = 0x134a0;
X int tigon2FwSbssLen = 0xa8;
-u32 tigon2FwText[(MAX_TEXT_LEN/4) + 1] __init = {
+u32 tigon2FwText[(MAX_TEXT_LEN/4) + 1] __initdata = {
X 0x0, 0x10000003, 0x0, 0xd, 0xd, 0x3c1d0001,
X 0x8fbd3380, 0x3a0f021, 0x3c100000, 0x26104000, 0xc0010c0, 0x0,
X 0xd, 0x3c1d0001, 0x8fbd3384, 0x3a0f021, 0x3c100000, 0x26104000,
@@ -5391,7 +5391,7 @@
X 0xaf820044, 0x8f820044, 0x451024, 0xaf820044, 0x24630001, 0x28620008,
X 0x5440ffee, 0x641007, 0x3e00008, 0x0, 0x0, 0x0,
X 0x0 };
-u32 tigon2FwData[(MAX_DATA_LEN/4) + 1] __init = {
+u32 tigon2FwData[(MAX_DATA_LEN/4) + 1] __initdata = {
X 0x1, 0x1, 0x1, 0xc001fc, 0x3ffc, 0xc00000,
X 0x416c7465, 0x6f6e2041, 0x63654e49, 0x43205600, 0x0, 0x0,
X 0x416c7465, 0x6f6e2041, 0x63654e49, 0x43205600, 0x42424242, 0x0,
@@ -5408,7 +5408,7 @@
X 0x12000060, 0x12000180, 0x120001e0, 0x0, 0x0, 0x0,
X 0x0, 0x0, 0x0, 0x0, 0x30001, 0x1,
X 0x30201, 0x0, 0x0 };
-u32 tigon2FwRodata[(MAX_RODATA_LEN/4) + 1] __init = {
+u32 tigon2FwRodata[(MAX_RODATA_LEN/4) + 1] __initdata = {
X 0x24486561, 0x6465723a, 0x202f7072, 0x6f6a6563, 0x74732f72, 0x63732f73,
X 0x772f6765, 0x2f6e6963, 0x2f667732, 0x2f636f6d, 0x6d6f6e2f, 0x66776d61,
X 0x696e2e63, 0x2c762031, 0x2e312e34, 0x372e3420, 0x31393938, 0x2f31302f,
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/net/ariadne2.c linux/drivers/net/ariadne2.c
--- v2.2.0-pre5/linux/drivers/net/ariadne2.c Tue Dec 22 14:16:55 1998
+++ linux/drivers/net/ariadne2.c Thu Jan 7 08:41:54 1999
@@ -33,6 +33,7 @@
X #include <asm/io.h>
X #include <asm/irq.h>
X #include <asm/amigaints.h>
+#include <asm/amigahw.h>
X
X #include "8390.h"
X
@@ -417,7 +418,7 @@
X unsigned int key = ((struct ei_device *)ariadne2_dev.priv)->priv;
X free_irq(IRQ_AMIGA_PORTS, &ariadne2_dev);
X unregister_netdev(&ariadne2_dev);
- zorro_config_board(key, 0);
+ zorro_unconfig_board(key, 0);
X unlock_8390_module();
X }
X
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/net/at1700.c linux/drivers/net/at1700.c
--- v2.2.0-pre5/linux/drivers/net/at1700.c Fri Nov 27 13:09:23 1998
+++ linux/drivers/net/at1700.c Thu Jan 7 08:47:54 1999
@@ -838,10 +838,12 @@
X {
X struct net_local *lp = dev_at1700.priv;
X unregister_netdev(&dev_at1700);
+#ifdef CONFIG_MCA
X if(lp->mca_slot)
X {
X mca_mark_as_unused(lp->mca_slot);
X }
+#endif
X kfree(dev_at1700.priv);
X dev_at1700.priv = NULL;
X
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/net/cops.h linux/drivers/net/cops.h
--- v2.2.0-pre5/linux/drivers/net/cops.h Thu Jun 26 12:33:39 1997
+++ linux/drivers/net/cops.h Thu Jan 7 08:46:59 1999
@@ -34,7 +34,7 @@
X /* Same on both card types */
X #define COPS_CLEAR_INT 1
X
-/* LAP response codes recieved from the cards. */
+/* LAP response codes received from the cards. */
X #define LAP_INIT 1 /* Init cmd */
X #define LAP_INIT_RSP 2 /* Init response */
X #define LAP_WRITE 3 /* Write cmd */
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/net/dgrs_i82596.h linux/drivers/net/dgrs_i82596.h
--- v2.2.0-pre5/linux/drivers/net/dgrs_i82596.h Sat Dec 21 07:23:21 1996
+++ linux/drivers/net/dgrs_i82596.h Thu Jan 7 08:46:59 1999
@@ -393,7 +393,7 @@
X /* cmd halfword values */
X #define I596_SCB_ACK 0xF000 /* ACKNOWLEDGMENTS */
X #define I596_SCB_ACK_CX 0x8000 /* Ack command completion */
-#define I596_SCB_ACK_FR 0x4000 /* Ack recieved frame */
+#define I596_SCB_ACK_FR 0x4000 /* Ack received frame */
X #define I596_SCB_ACK_CNA 0x2000 /* Ack command unit not active */
X #define I596_SCB_ACK_RNR 0x1000 /* Ack rcv unit not ready */
X #define I596_SCB_ACK_ALL 0xF000 /* Ack everything */
@@ -419,7 +419,7 @@
X /* status halfword values */
X #define I596_SCB_STAT 0xF000 /* STATUS */
X #define I596_SCB_CX 0x8000 /* command completion */
-#define I596_SCB_FR 0x4000 /* recieved frame */
+#define I596_SCB_FR 0x4000 /* received frame */
X #define I596_SCB_CNA 0x2000 /* command unit not active */
X #define I596_SCB_RNR 0x1000 /* rcv unit not ready */
X
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/net/eepro.c linux/drivers/net/eepro.c
--- v2.2.0-pre5/linux/drivers/net/eepro.c Thu Dec 31 10:29:00 1998
+++ linux/drivers/net/eepro.c Thu Jan 7 08:47:54 1999
@@ -23,10 +23,15 @@
X This is a compatibility hardware problem.
X
X Versions:
- 0.11b Pascal Dupuis : works as a module under 2.1.xx
- debug messages are flagged as KERN_DEBUG to avoid console
- flooding
- added locking at critical parts
+ 0.11d added __initdata, __initfunc stuff; call spin_lock_init
+ in eepro_probe1. Replaced "eepro" by dev->name. Augmented
+ the code protected by spin_lock in interrupt routine
+ (PdP, 12/12/1998)
+ 0.11c minor cleanup (PdP, RMC, 09/12/1998)
+ 0.11b Pascal Dupuis (dup...@lei.ucl.ac.be): works as a module
+ under 2.1.xx. Debug messages are flagged as KERN_DEBUG to
+ avoid console flooding. Added locking at critical parts. Now
+ the dawn thing is SMP safe.
X 0.11a Attempt to get 2.1.xx support up (RMC)
X 0.11 Brian Candler added support for multiple cards. Tested as
X a module, no idea if it works when compiled into kernel.
@@ -87,7 +92,7 @@
X */
X
X static const char *version =
- "eepro.c: v0.11b 08/12/1998 dup...@lei.ucl.ac.be\n";
+ "eepro.c: v0.11d 08/12/1998 dup...@lei.ucl.ac.be\n";
X
X #include <linux/module.h>
X
@@ -127,9 +132,6 @@
X #include <asm/bitops.h>
X #include <asm/io.h>
X #include <asm/dma.h>
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x20155
-#include <asm/spinlock.h>
-#endif
X #include <linux/errno.h>
X
X #include <linux/netdevice.h>
@@ -147,6 +149,7 @@
X /* For linux 2.1.xx */
X #if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x20155
X
+#include <asm/spinlock.h>
X #include <linux/init.h>
X #include <linux/delay.h>
X
@@ -154,6 +157,8 @@
X /* I had reports of looong delays with SLOW_DOWN defined as udelay(2) */
X #define SLOW_DOWN inb(0x80)
X /* udelay(2) */
+#define compat_init_func(X) __initfunc(X)
+#define compat_init_data __initdata
X
X #else
X /* for 2.x */
@@ -161,13 +166,15 @@
X #define compat_dev_kfree_skb( skb, mode ) dev_kfree_skb( (skb), (mode) )
X #define test_and_set_bit(a,b) set_bit((a),(b))
X #define SLOW_DOWN SLOW_DOWN_IO
+#define compat_init_func(X) X
+#define compat_init_data
X
X #endif
X
X
X /* First, a few definitions that the brave might change. */
X /* A zero-terminated list of I/O addresses to be probed. */
-static unsigned int eepro_portlist[] =
+static unsigned int eepro_portlist[] compat_init_data =
X { 0x300, 0x210, 0x240, 0x280, 0x2C0, 0x200, 0x320, 0x340, 0x360, 0};
X /* note: 0x300 is default, the 595FX supports ALL IO Ports
X from 0x000 to 0x3F0, some of which are reserved in PCs */
@@ -205,7 +212,7 @@
X version of the 82595 chip. */
X int stepping;
X #if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x20155
- spinlock_t lock; /* to prevent interrupt within interrupts */
+ spinlock_t lock; /* Serializing lock */
X #endif
X };
X
@@ -313,7 +320,7 @@
X static int eepro_grab_irq(struct device *dev);
X
X /*
- Details of the i82595.
+ Details of the i82595.
X
X You will need either the datasheet or the user manual to understand what
X is going on here. The 82595 is very different from the 82586, 82593.
@@ -344,7 +351,7 @@
X */
X #define RAM_SIZE 0x8000
X #define RCV_HEADER 8
-#define RCV_RAM 0x6000 /* 24KB default for RCV buffer */
+#define RCV_RAM 0x6000 /* 24KB default for RCV buffer */
X #define RCV_LOWER_LIMIT 0x00 /* 0x0000 */
X /* #define RCV_UPPER_LIMIT ((RCV_RAM - 2) >> 8) */ /* 0x5ffe */
X #define RCV_UPPER_LIMIT (((rcv_ram) - 2) >> 8)
@@ -454,8 +461,7 @@
X struct netdev_entry netcard_drv =
X {"eepro", eepro_probe1, EEPRO_IO_EXTENT, eepro_portlist};
X #else
-int
-eepro_probe(struct device *dev)
+compat_init_func(int eepro_probe(struct device *dev))
X {
X int i;
X int base_addr = dev ? dev->base_addr : 0;
@@ -467,9 +473,9 @@
X /* Wakeup: */
X #define WakeupPort 0x279
X #define WakeupSeq {0x6A, 0xB5, 0xDA, 0xED, 0xF6, 0xFB, 0x7D, 0xBE,\
- 0xDF, 0x6F, 0x37, 0x1B, 0x0D, 0x86, 0xC3, 0x61,\
- 0xB0, 0x58, 0x2C, 0x16, 0x8B, 0x45, 0xA2, 0xD1,\
- 0xE8, 0x74, 0x3A, 0x9D, 0xCE, 0xE7, 0x73, 0x43}
+ 0xDF, 0x6F, 0x37, 0x1B, 0x0D, 0x86, 0xC3, 0x61,\
+ 0xB0, 0x58, 0x2C, 0x16, 0x8B, 0x45, 0xA2, 0xD1,\
+ 0xE8, 0x74, 0x3A, 0x9D, 0xCE, 0xE7, 0x73, 0x43}
X
X {
X unsigned short int WS[32]=WakeupSeq;
@@ -485,19 +491,21 @@
X outb_p(WS[i],WakeupPort);
X if (net_debug>5) printk(KERN_DEBUG ": %#x ",WS[i]);
X }
- } else printk("Checkregion Failed!\n");
+ } else printk(KERN_WARNING "Checkregion Failed!\n");
X }
X #endif
X
X
X if (base_addr > 0x1ff) /* Check a single specified location. */
X return eepro_probe1(dev, base_addr);
+
X else if (base_addr != 0) /* Don't probe at all. */
X return ENXIO;
X
X
X for (i = 0; eepro_portlist[i]; i++) {
X int ioaddr = eepro_portlist[i];
+
X if (check_region(ioaddr, EEPRO_IO_EXTENT))
X continue;
X if (eepro_probe1(dev, ioaddr) == 0)
@@ -512,11 +520,11 @@
X {
X unsigned short Word;
X int i,j;
-
+
X for (i=0, j=ee_Checksum; i<ee_SIZE; i++)
X j+=read_eeprom(ioaddr,i);
X printk("Checksum: %#x\n",j&0xffff);
-
+
X Word=read_eeprom(ioaddr, 0);
X printk(KERN_DEBUG "Word0:\n");
X printk(KERN_DEBUG " Plug 'n Pray: %d\n",GetBit(Word,ee_PnP));
@@ -533,10 +541,10 @@
X printk(KERN_DEBUG " TPE/AUI: %d\n", GetBit(Word,ee_TPE_AUI));
X printk(KERN_DEBUG " Jabber: %d\n", GetBit(Word,ee_Jabber));
X printk(KERN_DEBUG " AutoPort: %d\n", GetBit(!Word,ee_Jabber));
- printk(KERN_DEBUG " Duplex: %d\n", GetBit(Word,ee_Duplex));
+ printk(KERN_DEBUG " Duplex: %d\n", GetBit(Word,ee_Duplex));
X }
X
- Word=read_eeprom(ioaddr, 5);
+ Word=read_eeprom(ioaddr, 5);
X printk(KERN_DEBUG "Word5:\n");
X printk(KERN_DEBUG " BNC: %d\n",GetBit(Word,ee_BNC_TPE));
X printk(KERN_DEBUG " NumConnectors: %d\n",GetBit(Word,ee_NumConn));
@@ -546,18 +554,19 @@
X if (GetBit(Word,ee_PortAUI)) printk("AUI ");
X printk("port(s) \n");
X
- Word=read_eeprom(ioaddr, 6);
+ Word=read_eeprom(ioaddr, 6);
X printk(KERN_DEBUG "Word6:\n");
X printk(KERN_DEBUG " Stepping: %d\n",Word & ee_StepMask);
X printk(KERN_DEBUG " BoardID: %d\n",Word>>ee_BoardID);
X
- Word=read_eeprom(ioaddr, 7);
+ Word=read_eeprom(ioaddr, 7);
X printk(KERN_DEBUG "Word7:\n");
X printk(KERN_DEBUG " INT to IRQ:\n");
X
X printk(KERN_DEBUG);
- for (i=0, j=0; i<15; i++)
- if (GetBit(Word,i)) printk(" INT%d -> IRQ %d;",j++,i);
+
+ for (i=0, j=0; i<15; i++)
+ if (GetBit(Word,i)) printk(" INT%d -> IRQ %d;",j++,i);
X
X printk("\n");
X }
@@ -577,11 +586,10 @@
X /* Now, we are going to check for the signature of the
X ID_REG (register 2 of bank 0) */
X
-
- id=inb(ioaddr + ID_REG);
+ id=inb(ioaddr + ID_REG);
X
- printk(KERN_DEBUG " id: %#x ",id);
- printk(" io: %#x ",ioaddr);
+ printk(KERN_DEBUG " id: %#x ",id);
+ printk(" io: %#x ",ioaddr);
X
X if (((id) & ID_REG_MASK) == ID_REG_SIG) {
X
@@ -606,7 +614,7 @@
X if (net_debug>3)
X printEEPROMInfo(ioaddr);
X
- if (read_eeprom(ioaddr,7)== ee_FX_INT2IRQ) { /* int to IRQ Mask */
+ if (read_eeprom(ioaddr,7)== ee_FX_INT2IRQ) { /* int to IRQ Mask */
X eepro = 2;
X printk("%s: Intel EtherExpress Pro/10+ ISA\n at %#x,",
X dev->name, ioaddr);
@@ -622,7 +630,7 @@
X dev->name, ioaddr);
X }
X
- /* Fill in the 'dev' fields. */
+ /* Fill in the 'dev' fields. */
X dev->base_addr = ioaddr;
X
X for (i=0; i < 6; i++) {
@@ -641,24 +649,13 @@
X printk(", %dK RCV buffer", (int)(dev->mem_end)/1024);
X
X
-// outb(BANK2_SELECT, ioaddr); /* be CAREFUL, BANK 2 now */
-// id = inb(ioaddr + REG3);
-// if (id & TPE_BIT)
-// dev->if_port = TPE;
-// else dev->if_port = BNC;
-
-
X /* ............... */
X
- if (GetBit( read_eeprom(ioaddr, 5),ee_BNC_TPE))
+ if (GetBit( read_eeprom(ioaddr, 5),ee_BNC_TPE))
X dev->if_port = BNC;
X else dev->if_port = TPE;
-
-
- /* ............... */
X
-// if (net_debug>3)
-// printk("id: %x\n", id);
+ /* ............... */
X
X
X if ((dev->irq < 2) && (eepro!=0)) {
@@ -668,14 +665,14 @@
X
X for (j=0; ((j<16) && (i>=0)); j++) {
X if ((irqMask & (1<<j))!=0) {
- if (i==0) {
- dev->irq = j;
- break; /* found bit corresponding to irq */
- }
+ if (i==0) {
+ dev->irq = j;
+ break; /* found bit corresponding to irq */
+ }
X i--; /* count bits set in irqMask */
- }
- }
- if (dev -> irq<2) {
+ }
+ }
+ if (dev -> irq<2) {
X printk(" Duh! illegal interrupt vector stored in EEPROM.\n");
X return ENODEV;
X } else
@@ -685,14 +682,10 @@
X else if (dev->irq == 2)
X dev->irq = 9;
X }
-
+
X if (dev->irq > 2) {
X printk(", IRQ %d, %s.\n", dev->irq,
X ifmap[dev->if_port]);
- /*if (request_irq(dev->irq, &eepro_interrupt, 0, "eepro", dev)) {
- printk("%s: unable to get IRQ %d.\n", dev->name, dev->irq);
- return -EAGAIN;
- }*/
X }
X else printk(", %s.\n", ifmap[dev->if_port]);
X
@@ -702,7 +695,7 @@
X if (net_debug > 3) {
X i = read_eeprom(ioaddr, 5);
X if (i & 0x2000) /* bit 13 of EEPROM word 5 */
- printk(KERN_DEBUG "%s: Concurrent Processing is enabled but not used!\n",
+ printk(KERN_DEBUG "%s: Concurrent Processing is enabled but not used!\n",
X dev->name);
X }
X
@@ -710,7 +703,7 @@
X printk(version);
X
X /* Grab the region so we can find another board if autoIRQ fails. */
- request_region(ioaddr, EEPRO_IO_EXTENT, "eepro");
+ request_region(ioaddr, EEPRO_IO_EXTENT, dev->name);
X
X /* Initialize the device structure */
X dev->priv = kmalloc(sizeof(struct eepro_local), GFP_KERNEL);
@@ -718,6 +711,9 @@
X return -ENOMEM;
X memset(dev->priv, 0, sizeof(struct eepro_local));
X
+#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x20155
+ spin_lock_init(&(((struct eepro_local *)dev->priv)->lock));
+#endif
X dev->open = eepro_open;
X dev->stop = eepro_close;
X dev->hard_start_xmit = eepro_send_packet;
@@ -754,11 +750,8 @@
X {
X int irqlist[] = { 3, 4, 5, 7, 9, 10, 11, 12 };
X int *irqp = irqlist, temp_reg, ioaddr = dev->base_addr;
-
- outb(BANK1_SELECT, ioaddr); /* be CAREFUL, BANK 1 now */
X
- /* Set the spinlock before activating IRQ! */
- ((struct eepro_local *)dev->priv)->lock = (spinlock_t) SPIN_LOCK_UNLOCKED;
+ outb(BANK1_SELECT, ioaddr); /* be CAREFUL, BANK 1 now */
X
X /* Enable the interrupt line. */
X temp_reg = inb(ioaddr + REG1);
@@ -768,6 +761,7 @@
X
X /* clear all interrupts */
X outb(ALL_MASK, ioaddr + STATUS_REG);
+
X /* Let EXEC event to interrupt */
X outb(ALL_MASK & ~(EXEC_MASK), ioaddr + INT_MASK_REG);
X
@@ -785,11 +779,8 @@
X
X outb(DIAGNOSE_CMD, ioaddr); /* RESET the 82595 */
X
- if (*irqp == autoirq_report(2) )//&& /* It's a good IRQ line */
- /* We don't take irqs on detection anymore.
- only when actually turning on the driver (ifconfig) */
- /* //(request_irq(dev->irq = *irqp, &eepro_interrupt, 0, "eepro", dev) == 0)) */
- break;
+ if (*irqp == autoirq_report(2)) /* It's a good IRQ line */
+ break;
X
X /* clear all interrupts */
X outb(ALL_MASK, ioaddr + STATUS_REG);
@@ -821,14 +812,14 @@
X struct eepro_local *lp = (struct eepro_local *)dev->priv;
X
X if (net_debug > 3)
- printk(KERN_DEBUG "eepro: entering eepro_open routine.\n");
+ printk(KERN_DEBUG "%s: entering eepro_open routine.\n", dev->name);
X
X if ((irqMask=read_eeprom(ioaddr,7))== ee_FX_INT2IRQ) /* INT to IRQ Mask */
X {
- lp->eepro = 2; /* Yes, an Intel EtherExpress Pro/10+ */
- if (net_debug > 3) printk(KERN_DEBUG "p->eepro = 2;\n");
+ lp->eepro = 2; /* Yes, an Intel EtherExpress Pro/10+ */
+ if (net_debug > 3) printk(KERN_DEBUG "p->eepro = 2;\n");
X }
-
+
X else if ((dev->dev_addr[0] == SA_ADDR0 &&
X dev->dev_addr[1] == SA_ADDR1 &&
X dev->dev_addr[2] == SA_ADDR2))
@@ -845,7 +836,7 @@
X return -EAGAIN;
X }
X
- if (request_irq(dev->irq , &eepro_interrupt, 0, "eepro", dev)) {
+ if (request_irq(dev->irq , &eepro_interrupt, 0, dev->name, dev)) {
X printk("%s: unable to get IRQ %d.\n", dev->name, dev->irq);
X return -EAGAIN;
X }
@@ -854,8 +845,8 @@
X if (((irq2dev_map[dev->irq] != 0)
X || (irq2dev_map[dev->irq] = dev) == 0) &&
X (irq2dev_map[dev->irq]!=dev)) {
- /* printk("%s: IRQ map wrong\n", dev->name); */
- return -EAGAIN;
+ /* printk("%s: IRQ map wrong\n", dev->name); */
+ return -EAGAIN;
X }
X #endif
X
@@ -894,15 +885,14 @@
X else outb((temp_reg & 0xf8) | irqrmap[dev->irq], ioaddr + INT_NO_REG);
X
X
- temp_reg = inb(ioaddr + INT_NO_REG);
- if (lp->eepro == 2)
- outb((temp_reg & 0xf0) | irqrmap2[dev->irq] | 0x08,ioaddr+INT_NO_REG);
- else outb((temp_reg & 0xf8) | irqrmap[dev->irq], ioaddr + INT_NO_REG);
-
- if (net_debug > 3)
- printk(KERN_DEBUG "eepro_open: content of INT Reg is %x\n", temp_reg);
-
-
+ temp_reg = inb(ioaddr + INT_NO_REG);
+ if (lp->eepro == 2)
+ outb((temp_reg & 0xf0) | irqrmap2[dev->irq] | 0x08,ioaddr+INT_NO_REG);
+ else outb((temp_reg & 0xf8) | irqrmap[dev->irq], ioaddr + INT_NO_REG);
+
+ if (net_debug > 3)
+ printk(KERN_DEBUG "eepro_open: content of INT Reg is %x\n", temp_reg);
+
X
X /* Initialize the RCV and XMT upper and lower limits */
X outb(RCV_LOWER_LIMIT, ioaddr + RCV_LOWER_LIMIT_REG);
@@ -918,6 +908,7 @@
X
X /* Let RX and TX events to interrupt */
X outb(ALL_MASK & ~(RX_MASK | TX_MASK), ioaddr + INT_MASK_REG);
+
X /* clear all interrupts */
X outb(ALL_MASK, ioaddr + STATUS_REG);
X
@@ -932,6 +923,7 @@
X /* Check for the i82595TX and i82595FX */
X old8 = inb(ioaddr + 8);
X outb(~old8, ioaddr + 8);
+
X if ((temp_reg = inb(ioaddr + 8)) == old8) {
X if (net_debug > 3)
X printk(KERN_DEBUG "i82595 detected!\n");
@@ -965,25 +957,26 @@
X }
X }
X else if (net_debug > 3) {
- printk(KERN_DEBUG "temp_reg: %#x ~old9: %#x\n",temp_reg,((~old9)&0xff));
+ printk(KERN_DEBUG "temp_reg: %#x ~old9: %#x\n",temp_reg,((~old9)&0xff));
X printk(KERN_DEBUG "i82595TX detected!\n");
X }
X }
X
X outb(SEL_RESET_CMD, ioaddr);
+
X /* We are supposed to wait for 2 us after a SEL_RESET */
X SLOW_DOWN;
X SLOW_DOWN;
X
X lp->tx_start = lp->tx_end = XMT_LOWER_LIMIT << 8; /* or = RCV_RAM */
- lp->tx_last = 0;
+ lp->tx_last = 0;
X
X dev->tbusy = 0;
X dev->interrupt = 0;
X dev->start = 1;
X
X if (net_debug > 3)
- printk(KERN_DEBUG "eepro: exiting eepro_open routine.\n");
+ printk(KERN_DEBUG "%s: exiting eepro_open routine.\n", dev->name);
X
X outb(RCV_ENABLE_CMD, ioaddr);
X
@@ -997,39 +990,43 @@
X int ioaddr = dev->base_addr;
X int rcv_ram = dev->mem_end;
X
+#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x20155
+ unsigned long flags;
+#endif
+
X if (net_debug > 5)
- printk(KERN_DEBUG "eepro: entering eepro_send_packet routine.\n");
+ printk(KERN_DEBUG "%s: entering eepro_send_packet routine.\n", dev->name);
X
X if (dev->tbusy) {
- /* If we get here, some higher level has decided we are broken.
- There should really be a "kick me" function call instead. */
- int tickssofar = jiffies - dev->trans_start;
- if (tickssofar < 40)
- return 1;
-
- /* if (net_debug > 1) */
- printk("%s: transmit timed out, %s?\n", dev->name,
- "network cable problem");


SHAR_EOF
true || echo 'restore of patch-2.2.0-pre6 failed'
fi

echo 'End of part 3'
echo 'File patch-2.2.0-pre6 is continued in part 4'
echo 4 > _shar_seq_.tmp
exit 0

Thomas...@ciw.uni-karlsruhe.de

unread,
Jan 10, 1999, 3:00:00 AM1/10/99
to
Archive-name: v2.1/patch-2.2.0-pre6/part5

#!/bin/sh
# this is part 5 of a 8 - part archive


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

if test "$Scheck" != 5; 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.2.0-pre6'
else
echo 'x - continuing with patch-2.2.0-pre6'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.2.0-pre6' &&

+ ess_change (devc, 0xb8, 0x05, 0x05); /* Go */
X devc->intr_active = 1;
X }
X
@@ -798,8 +797,8 @@
X
X ess_write(devc, 0xa4, (unsigned char) ((unsigned short) c & 0xff));
X ess_write(devc, 0xa5, (unsigned char) (((unsigned short) c >> 8) & 0xff));
-
- ess_write(devc, 0xb8, ess_read(devc, 0xb8) | 0x0f); /* Go */
+
+ ess_change (devc, 0xb8, 0x0f, 0x0f); /* Go */
X devc->intr_active = 1;
X }
X
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/sound/sb_common.c linux/drivers/sound/sb_common.c
--- v2.2.0-pre5/linux/drivers/sound/sb_common.c Thu Jan 7 15:11:38 1999
+++ linux/drivers/sound/sb_common.c Thu Jan 7 09:24:00 1999
@@ -13,7 +13,7 @@
X /*
X * Daniel J. Rodriksson: Modified sbintr to handle 8 and 16 bit interrupts
X * for full duplex support ( only sb16 by now )
- * Rolf Fokkens: Added (BETA?) support for ES188x chips.
+ * Rolf Fokkens: Added (BETA?) support for ES1887 chips.
X * (fokk...@vertis.nl) Which means: You can adjust the recording levels.
X */
X #include <linux/config.h>
@@ -554,6 +554,15 @@
X /*
X * This the detection heuristic of ESS technology, though somewhat
X * changed to actually make it work.
+ * This results in the following detection steps:
+ * - distinct between ES688 and ES1688+ (as always done in this driver)
+ * if ES688 we're ready
+ * - try to detect ES1868, ES1869 or ES1878 (ess_identify)
+ * if successful we're ready
+ * - try to detect ES1888, ES1887 or ES1788 (aim: detect ES1887)
+ * if successful we're ready
+ * - Dunno. Must be 1688. Will do in general
+ *
X * This is the most BETA part of the software: Will the detection
X * always work?
X */
@@ -568,7 +577,7 @@
X chip = "ES688";
X };
X if (chip == NULL) {
- int type, dummy;
+ int type;
X
X type = ess_identify (devc);
X
@@ -587,12 +596,18 @@
X break;
X };
X };
- if (chip == NULL) {
- if ( !ess_probe (devc, 0x64, (1 << 3))
- && ess_probe (devc, 0x70, 0x7f)) {
- chip = "ES188x";
+ if (chip == NULL && !ess_probe(devc, 0x64, (1 << 3))) {
+ if (ess_probe (devc, 0x70, 0x7f)) {
+ if (ess_probe (devc, 0x64, (1 << 5))) {
+ chip = "ES1887";
+ } else {
+ chip = "ES1888";
+ }
X devc->submodel = SUBMDL_ES188X;
- };
+ } else {
+ chip = "ES1788";
+ devc->submodel = SUBMDL_ES1788;
+ }
X };
X if (chip == NULL) {
X chip = "ES1688";
@@ -1066,7 +1081,7 @@
X /*
X * Mixer access routines
X *
- * ES188x modifications: some mixer registers reside in the
+ * ES1887 modifications: some mixer registers reside in the
X * range above 0xa0. These must be accessed in another way.
X */
X
@@ -1107,7 +1122,10 @@
X
X return val;
X }
-
+/*
+ * Some PnP chips can be identified by repeatedly reading mixer register 0x40.
+ * This is done by ess_identify
+ */
X static unsigned int ess_identify (sb_devc * devc)
X {
X unsigned int val;
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/sound/sb_mixer.c linux/drivers/sound/sb_mixer.c
--- v2.2.0-pre5/linux/drivers/sound/sb_mixer.c Thu Jan 7 15:11:38 1999
+++ linux/drivers/sound/sb_mixer.c Thu Jan 7 09:24:00 1999
@@ -14,31 +14,82 @@
X *
X * Thomas Sailer : ioctl code reworked (vmalloc/vfree removed)
X * Rolf Fokkens (Dec 20 1998) : ES188x recording level support on a per
- * input basis
- * (Dec 24 1998) : Recognition of ES188x (?), ES1868, ES1869
- * and ES1878. Could be used for specific
- * handling in the future. All except ES188x
- * and ES688 are handled like ES1688
- * (Dec 27 1998) : RECLEV for all (?) ES1688+ chips, see
- * ess_mixer_reload for more info. ES188x now
- * has the "Dec 20" support + RECLEV
+ * input basis.
+ * (Dec 24 1998) : Recognition of ES1788, ES1887, ES1888,
+ * ES1868, ES1869 and ES1878. Could be used for
+ * specific handling in the future. All except
+ * ES1887 and ES1888 and ES688 are handled like
+ * ES1688.
+ * (Dec 27 1998) : RECLEV for all (?) ES1688+ chips. ES188x now
+ * have the "Dec 20" support + RECLEV
X */
X
X /*
- * About ES188x support:
+ * About the documentation
+ *
+ * I don't know if the chips all are OK, but the documentation is buggy. 'cause
+ * I don't have all the cips myself, there's a lot I cannot verify. I'll try to
+ * keep track of my latest insights about his here. If you have additional info,
+ * please enlighten me (fokk...@vertis.nl)!
X *
- * The standard ES1688 support doesn't take care of the ES188x recording
- * levels very well. Whenever a device is selected (recmask) for recording
- * it's recording level is loud, and it cannot be changed.
+ * I had the impression that ES1688 also has 6 bit master volume control. The
+ * documentation about ES1888 (rev C, october '95) claims that ES1888 has
+ * the following features ES1688 doesn't have:
+ * - 6 bit master volume
+ * - Full Duplex
+ * So ES1688 apparently doesn't have 6 bit master volume control, but the
+ * ES1688 does have RECLEV control. Makes me wonder: does ES688 have it too?
+ * Without RECLEV ES688 won't be much fun I guess.
X *
- * The ES188x has separate registers to control the recording levels. The
- * ES188x specific software makes these level the same as their corresponding
- * playback levels, unless recmask says they aren't recorded. In the latter
- * case the recording volumes are 0.
+ * From the ES1888 (rev C, october '95) documentation I got the impression
+ * that registers 0x68 to 0x6e don't exist which means: no recording volume
+ * controls. To my surprise the ES888 documentation (1/14/96) claims that
+ * ES888 does have these record mixer registers, but that ES1888 doesn't have
+ * 0x69 and 0x6b. So the rest should be there.
+ *
+ */
+
+/*
+ * About recognition of ESS chips
+ *
+ * The distinction of ES688, ES1688, ES1788, ES1887 and ES1888 is described in
+ * a (preliminary ??) datasheet on ES1887. It's aim is to identify ES1887, but
+ * during detection the text claims that "this chip may be ..." when a step
+ * fails. This scheme is used to distinct between the above chips.
+ * It appears however that some PnP chips like ES1868 are recognized as ES1788
+ * by the ES1887 detection scheme. These PnP chips can be detected in another
+ * way however: ES1868, ES1869 and ES1878 can be recognized (full proof I think)
+ * by repeatedly reading mixer register 0x40. This is done by ess_identify in
+ * sb_common.c.
+ * This results in the following detection steps:
+ * - distinct between ES688 and ES1688+ (as always done in this driver)
+ * if ES688 we're ready
+ * - try to detect ES1868, ES1869 or ES1878
+ * if successful we're ready
+ * - try to detect ES1888, ES1887 or ES1788
+ * if successful we're ready
+ * - Dunno. Must be 1688. Will do in general
+ *
+ * About RECLEV support:
+ *
+ * The existing ES1688 support didn't take care of the ES1688+ recording
+ * levels very well. Whenever a device was selected (recmask) for recording
+ * it's recording level was loud, and it couldn't be changed. The fact that
+ * internal register 0xb4 could take care of RECLEV, didn't work meaning until
+ * it's value was restored every time the chip was reset; this reset the
+ * value of 0xb4 too. I guess that's what 4front also had (have?) trouble with.
+ *
+ * About ES188x support:
X *
+ * The ES188x has separate registers to control the recording levels, for all
+ * inputs. The ES188x specific software makes these levels the same as their
+ * corresponding playback levels, unless recmask says they aren't recorded. In
+ * the latter case the recording volumes are 0.
X * Now recording levels of inputs can be controlled, by changing the playback
X * levels. Futhermore several devices can be recorded together (which is not
X * possible with the ES1688.
+ * Besides the separate recording level control for each input, the common
+ * recordig level can also be controlled by RECLEV as described above.
X */
X
X #include <linux/config.h>
@@ -50,6 +101,77 @@
X #include "sb.h"
X #include "sb_mixer.h"
X
+#define SBPRO_RECORDING_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD)
+
+/* Same as SB Pro, unless I find otherwise */
+#define SGNXPRO_RECORDING_DEVICES SBPRO_RECORDING_DEVICES
+
+#define SBPRO_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_LINE | SOUND_MASK_MIC | \
+ SOUND_MASK_CD | SOUND_MASK_VOLUME)
+
+/* SG NX Pro has treble and bass settings on the mixer. The 'speaker'
+ * channel is the COVOX/DisneySoundSource emulation volume control
+ * on the mixer. It does NOT control speaker volume. Should have own
+ * mask eventually?
+ */
+#define SGNXPRO_MIXER_DEVICES (SBPRO_MIXER_DEVICES|SOUND_MASK_BASS| \
+ SOUND_MASK_TREBLE|SOUND_MASK_SPEAKER )
+
+#define SB16_RECORDING_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_LINE | SOUND_MASK_MIC | \
+ SOUND_MASK_CD)
+
+#define SB16_OUTFILTER_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | \
+ SOUND_MASK_CD)
+
+#define ES688_RECORDING_DEVICES SBPRO_RECORDING_DEVICES
+#define ES688_MIXER_DEVICES (SBPRO_MIXER_DEVICES|SOUND_MASK_LINE2|SOUND_MASK_SPEAKER)
+
+#define ES1688_RECORDING_DEVICES ES688_RECORDING_DEVICES
+#define ES1688_MIXER_DEVICES (ES688_MIXER_DEVICES|SOUND_MASK_RECLEV)
+
+#define ES188X_RECORDING_DEVICES (ES1688_RECORDING_DEVICES | SOUND_MASK_LINE2 \
+ |SOUND_MASK_SYNTH)
+#define ES188X_MIXER_DEVICES (ES1688_MIXER_DEVICES)
+
+#define SB16_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_SPEAKER | SOUND_MASK_LINE | SOUND_MASK_MIC | \
+ SOUND_MASK_CD | \
+ SOUND_MASK_IGAIN | SOUND_MASK_OGAIN | \
+ SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE | \
+ SOUND_MASK_IMIX)
+
+/* These are the only devices that are working at the moment. Others could
+ * be added once they are identified and a method is found to control them.
+ */
+#define ALS007_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_LINE | \
+ SOUND_MASK_PCM | SOUND_MASK_MIC | \
+ SOUND_MASK_CD | \
+ SOUND_MASK_VOLUME)
+
+/*
+ * Mixer registers of ES188x
+ *
+ * These registers specifically take care of recording levels. To make the
+ * mapping from playback devices to recording devices every recording
+ * devices = playback device + ES188X_MIXER_RECDIFF
+ */
+#define ES188X_MIXER_RECBASE (SOUND_MIXER_LINE3 + 1)
+#define ES188X_MIXER_RECDIFF (ES188X_MIXER_RECBASE - SOUND_MIXER_SYNTH)
+
+#define ES188X_MIXER_RECSYNTH (SOUND_MIXER_SYNTH + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECPCM (SOUND_MIXER_PCM + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECSPEAKER (SOUND_MIXER_SPEAKER + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECLINE (SOUND_MIXER_LINE + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECMIC (SOUND_MIXER_MIC + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECCD (SOUND_MIXER_CD + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECIMIX (SOUND_MIXER_IMIX + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECALTPCM (SOUND_MIXER_ALTPCM + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECRECLEV (SOUND_MIXER_RECLEV + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECIGAIN (SOUND_MIXER_IGAIN + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECOGAIN (SOUND_MIXER_OGAIN + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECLINE1 (SOUND_MIXER_LINE1 + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECLINE2 (SOUND_MIXER_LINE2 + ES188X_MIXER_RECDIFF)
+#define ES188X_MIXER_RECLINE3 (SOUND_MIXER_LINE3 + ES188X_MIXER_RECDIFF)
+
X static mixer_tab sbpro_mix = {
X MIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4),
X MIX_ENT(SOUND_MIXER_BASS, 0x00, 0, 0, 0x00, 0, 0),
@@ -88,11 +210,12 @@
X /*
X * The ES1688 specifics... hopefully correct...
X * - 6 bit master volume
+ * I was wrong, ES1888 docs say ES1688 didn't have it.
X * - RECLEV control
X * These may apply to ES688 too. I have no idea.
X */
X static mixer_tab es1688_mix = {
-MIX_ENT(SOUND_MIXER_VOLUME, 0x60, 5, 6, 0x62, 5, 6),
+MIX_ENT(SOUND_MIXER_VOLUME, 0x32, 7, 4, 0x32, 3, 4),
X MIX_ENT(SOUND_MIXER_BASS, 0x00, 0, 0, 0x00, 0, 0),
X MIX_ENT(SOUND_MIXER_TREBLE, 0x00, 0, 0, 0x00, 0, 0),
X MIX_ENT(SOUND_MIXER_SYNTH, 0x36, 7, 4, 0x36, 3, 4),
@@ -111,11 +234,30 @@
X MIX_ENT(SOUND_MIXER_LINE3, 0x00, 0, 0, 0x00, 0, 0)
X };
X
+static mixer_tab es1688later_mix = {
+MIX_ENT(SOUND_MIXER_VOLUME, 0x60, 5, 6, 0x62, 5, 6),
+MIX_ENT(SOUND_MIXER_BASS, 0x00, 0, 0, 0x00, 0, 0),
+MIX_ENT(SOUND_MIXER_TREBLE, 0x00, 0, 0, 0x00, 0, 0),
+MIX_ENT(SOUND_MIXER_SYNTH, 0x36, 7, 4, 0x36, 3, 4),
+MIX_ENT(SOUND_MIXER_PCM, 0x14, 7, 4, 0x14, 3, 4),
+MIX_ENT(SOUND_MIXER_SPEAKER, 0x3c, 2, 3, 0x00, 0, 0),
+MIX_ENT(SOUND_MIXER_LINE, 0x3e, 7, 4, 0x3e, 3, 4),
+MIX_ENT(SOUND_MIXER_MIC, 0x1a, 7, 4, 0x1a, 3, 4),
+MIX_ENT(SOUND_MIXER_CD, 0x38, 7, 4, 0x38, 3, 4),
+MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
+MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
+MIX_ENT(SOUND_MIXER_RECLEV, 0xb4, 7, 4, 0xb4, 3, 4),
+MIX_ENT(SOUND_MIXER_IGAIN, 0x00, 0, 0, 0x00, 0, 0),
+MIX_ENT(SOUND_MIXER_OGAIN, 0x00, 0, 0, 0x00, 0, 0),
+MIX_ENT(SOUND_MIXER_LINE1, 0x00, 0, 0, 0x00, 0, 0),
+MIX_ENT(SOUND_MIXER_LINE2, 0x3a, 7, 4, 0x3a, 3, 4),
+MIX_ENT(SOUND_MIXER_LINE3, 0x00, 0, 0, 0x00, 0, 0)
+};
+
X /*
X * The ES188x specifics.
X * Note that de master volume unlike ES688 is now controlled by two 6 bit
- * registers. These seem to work OK on 1868 too, but I have no idea if it's
- * compatible to 688 or 1688....
+ * registers. These seem to work OK on 1868 too.
X * Also Note that the recording levels (ES188X_MIXER_REC...) have own
X * entries as if they were playback devices. They are used internally in the
X * driver only!
@@ -314,78 +456,6 @@
X 0x00 /* SOUND_MIXER_LINE3 */
X };
X
-#define SBPRO_RECORDING_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD)
-
-/* Same as SB Pro, unless I find otherwise */
-#define SGNXPRO_RECORDING_DEVICES SBPRO_RECORDING_DEVICES
-
-#define SBPRO_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_LINE | SOUND_MASK_MIC | \
- SOUND_MASK_CD | SOUND_MASK_VOLUME)
-
-/* SG NX Pro has treble and bass settings on the mixer. The 'speaker'
- * channel is the COVOX/DisneySoundSource emulation volume control
- * on the mixer. It does NOT control speaker volume. Should have own
- * mask eventually?
- */
-#define SGNXPRO_MIXER_DEVICES (SBPRO_MIXER_DEVICES|SOUND_MASK_BASS| \
- SOUND_MASK_TREBLE|SOUND_MASK_SPEAKER )
-
-#define SB16_RECORDING_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_LINE | SOUND_MASK_MIC | \
- SOUND_MASK_CD)
-
-#define SB16_OUTFILTER_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | \
- SOUND_MASK_CD)
-
-#define ES688_RECORDING_DEVICES SBPRO_RECORDING_DEVICES
-#define ES688_MIXER_DEVICES (SBPRO_MIXER_DEVICES|SOUND_MASK_LINE2|SOUND_MASK_SPEAKER)
-
-#define ES1688_RECORDING_DEVICES ES688_RECORDING_DEVICES
-#define ES1688_MIXER_DEVICES (ES688_MIXER_DEVICES|SOUND_MASK_RECLEV)
-
-#define ES188X_RECORDING_DEVICES (ES1688_RECORDING_DEVICES | SOUND_MASK_LINE2 \
- |SOUND_MASK_SYNTH)
-#define ES188X_MIXER_DEVICES (ES1688_MIXER_DEVICES)
-
-#define SB16_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_SPEAKER | SOUND_MASK_LINE | SOUND_MASK_MIC | \
- SOUND_MASK_CD | \
- SOUND_MASK_IGAIN | SOUND_MASK_OGAIN | \
- SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE | \
- SOUND_MASK_IMIX)
-
-/* These are the only devices that are working at the moment. Others could
- * be added once they are identified and a method is found to control them.
- */
-#define ALS007_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_LINE | \
- SOUND_MASK_PCM | SOUND_MASK_MIC | \
- SOUND_MASK_CD | \
- SOUND_MASK_VOLUME)
-
-/*
- * Mixer registers of ES188x
- *
- * These registers specifically take care of recording levels. To make the
- * mapping from playback devices to recording devices every recording
- * devices = playback device + ES188X_MIXER_RECDIFF
- */
-#define ES188X_MIXER_RECBASE (SOUND_MIXER_LINE3 + 1)
-#define ES188X_MIXER_RECDIFF (ES188X_MIXER_RECBASE - SOUND_MIXER_SYNTH)
-
-#define ES188X_MIXER_RECSYNTH (SOUND_MIXER_SYNTH + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECPCM (SOUND_MIXER_PCM + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECSPEAKER (SOUND_MIXER_SPEAKER + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECLINE (SOUND_MIXER_LINE + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECMIC (SOUND_MIXER_MIC + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECCD (SOUND_MIXER_CD + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECIMIX (SOUND_MIXER_IMIX + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECALTPCM (SOUND_MIXER_ALTPCM + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECRECLEV (SOUND_MIXER_RECLEV + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECIGAIN (SOUND_MIXER_IGAIN + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECOGAIN (SOUND_MIXER_OGAIN + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECLINE1 (SOUND_MIXER_LINE1 + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECLINE2 (SOUND_MIXER_LINE2 + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECLINE3 (SOUND_MIXER_LINE3 + ES188X_MIXER_RECDIFF)
-
-
X static int sbmixnum = 1;
X
X static void sb_mixer_reset(sb_devc * devc);
@@ -944,11 +1014,19 @@
X = ES688_RECORDING_DEVICES;
X devc->iomap = &es688_mix;
X } else {
+ /*
+ * es1688 has 4 bits master vol.
+ * later chips have 6 bits (?)
+ */
X devc->supported_devices
X = ES1688_MIXER_DEVICES;
X devc->supported_rec_devices
X = ES1688_RECORDING_DEVICES;
- devc->iomap = &es1688_mix;
+ if (devc->submodel < 0x10) {
+ devc->iomap = &es1688_mix;
+ } else {
+ devc->iomap = &es1688later_mix;
+ }
X }
X }
X
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/sound/sb_mixer.h linux/drivers/sound/sb_mixer.h
--- v2.2.0-pre5/linux/drivers/sound/sb_mixer.h Thu Jan 7 15:11:38 1999
+++ linux/drivers/sound/sb_mixer.h Thu Jan 7 09:24:00 1999
@@ -28,51 +28,6 @@
X
X #ifdef CONFIG_SBDSP
X
-#define SBPRO_RECORDING_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD)
-
-/* Same as SB Pro, unless I find otherwise */
-#define SGNXPRO_RECORDING_DEVICES SBPRO_RECORDING_DEVICES
-
-#define SBPRO_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_LINE | SOUND_MASK_MIC | \
- SOUND_MASK_CD | SOUND_MASK_VOLUME)
-
-/* SG NX Pro has treble and bass settings on the mixer. The 'speaker'
- * channel is the COVOX/DisneySoundSource emulation volume control
- * on the mixer. It does NOT control speaker volume. Should have own
- * mask eventually?
- */
-#define SGNXPRO_MIXER_DEVICES (SBPRO_MIXER_DEVICES|SOUND_MASK_BASS| \
- SOUND_MASK_TREBLE|SOUND_MASK_SPEAKER )
-
-#define SB16_RECORDING_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_LINE | SOUND_MASK_MIC | \
- SOUND_MASK_CD)
-
-#define SB16_OUTFILTER_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | \
- SOUND_MASK_CD)
-
-#define ES688_RECORDING_DEVICES SBPRO_RECORDING_DEVICES
-#define ES688_MIXER_DEVICES (SBPRO_MIXER_DEVICES|SOUND_MASK_LINE2|SOUND_MASK_SPEAKER)
-
-#define ES1688_RECORDING_DEVICES ES688_RECORDING_DEVICES
-#define ES1688_MIXER_DEVICES (ES688_MIXER_DEVICES|SOUND_MASK_RECLEV)
-
-#define ES188X_RECORDING_DEVICES (ES1688_RECORDING_DEVICES | SOUND_MASK_LINE2 \
- |SOUND_MASK_SYNTH)
-#define ES188X_MIXER_DEVICES (ES1688_MIXER_DEVICES)
-
-#define SB16_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_SPEAKER | SOUND_MASK_LINE | SOUND_MASK_MIC | \
- SOUND_MASK_CD | \
- SOUND_MASK_IGAIN | SOUND_MASK_OGAIN | \
- SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE | \
- SOUND_MASK_IMIX)
-
-/* These are the only devices that are working at the moment. Others could
- * be added once they are identified and a method is found to control them.
- */
-#define ALS007_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_LINE | \
- SOUND_MASK_PCM | SOUND_MASK_MIC | \
- SOUND_MASK_CD | \
- SOUND_MASK_VOLUME)
X /*
X * Mixer registers
X *
@@ -123,31 +78,6 @@
X #define RIGHT_CHN 1
X
X /*
- * Mixer registers of ES188x
- *
- * These registers specifically take care of recording levels. To make the
- * mapping from playback devices to recording devices every recording
- * devices = playback device + ES188X_MIXER_RECDIFF
- */
-#define ES188X_MIXER_RECBASE (SOUND_MIXER_LINE3 + 1)
-#define ES188X_MIXER_RECDIFF (ES188X_MIXER_RECBASE - SOUND_MIXER_SYNTH)
-
-#define ES188X_MIXER_RECSYNTH (SOUND_MIXER_SYNTH + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECPCM (SOUND_MIXER_PCM + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECSPEAKER (SOUND_MIXER_SPEAKER + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECLINE (SOUND_MIXER_LINE + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECMIC (SOUND_MIXER_MIC + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECCD (SOUND_MIXER_CD + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECIMIX (SOUND_MIXER_IMIX + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECALTPCM (SOUND_MIXER_ALTPCM + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECRECLEV (SOUND_MIXER_RECLEV + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECIGAIN (SOUND_MIXER_IGAIN + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECOGAIN (SOUND_MIXER_OGAIN + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECLINE1 (SOUND_MIXER_LINE1 + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECLINE2 (SOUND_MIXER_LINE2 + ES188X_MIXER_RECDIFF)
-#define ES188X_MIXER_RECLINE3 (SOUND_MIXER_LINE3 + ES188X_MIXER_RECDIFF)
-
-/*
X * Mixer registers of ALS007
X */
X #define ALS007_RECORD_SRC 0x6c
@@ -175,3 +105,4 @@
X #define ALS007_SYNTH 7
X
X #endif
+
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/sound/sonicvibes.c linux/drivers/sound/sonicvibes.c
--- v2.2.0-pre5/linux/drivers/sound/sonicvibes.c Thu Jan 7 15:11:38 1999
+++ linux/drivers/sound/sonicvibes.c Thu Jan 7 09:24:00 1999
@@ -49,6 +49,8 @@
X * 31.08.98 0.7 Fix realplayer problems - dac.count issues
X * 10.12.98 0.8 Fix drain_dac trying to wait on not yet initialized DMA
X * 16.12.98 0.9 Fix a few f_file & FMODE_ bugs
+ * 06.01.99 0.10 remove the silly SA_INTERRUPT flag.
+ * hopefully killed the egcs section type conflict
X *
X */
X
@@ -2243,7 +2245,7 @@
X
X /* --------------------------------------------------------------------- */
X
-static const struct initvol {
+static struct initvol {
X int mixch;
X int vol;
X } initvol[] __initdata = {
@@ -2271,7 +2273,7 @@
X
X if (!pci_present()) /* No PCI bus in this machine! */
X return -ENODEV;
- printk(KERN_INFO "sv: version v0.9 time " __TIME__ " " __DATE__ "\n");
+ printk(KERN_INFO "sv: version v0.10 time " __TIME__ " " __DATE__ "\n");
X #if 0
X if (!(wavetable_mem = __get_free_pages(GFP_KERNEL, 20-PAGE_SHIFT)))
X printk(KERN_INFO "sv: cannot allocate 1MB of contiguous nonpageable memory for wavetable data\n");
@@ -2382,7 +2384,7 @@
X wrindir(s, SV_CIPCMSR1, ((8000 * 65536 / FULLRATE) >> 8) & 0xff);
X wrindir(s, SV_CIADCOUTPUT, 0);
X /* request irq */
- if (request_irq(s->irq, sv_interrupt, SA_INTERRUPT|SA_SHIRQ, "S3 SonicVibes", s)) {
+ if (request_irq(s->irq, sv_interrupt, SA_SHIRQ, "S3 SonicVibes", s)) {
X printk(KERN_ERR "sv: irq %u in use\n", s->irq);
X goto err_irq;
X }
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/sound/sound_core.c linux/drivers/sound/sound_core.c
--- v2.2.0-pre5/linux/drivers/sound/sound_core.c Thu Jan 7 15:11:38 1999
+++ linux/drivers/sound/sound_core.c Thu Jan 7 09:24:00 1999
@@ -349,14 +349,13 @@


X return -ENODEV;
X }
X

+extern int mod_firmware_load(const char *, char **);
+EXPORT_SYMBOL(mod_firmware_load);
+
X #ifdef MODULE
X
X MODULE_DESCRIPTION("Core sound module");
X MODULE_AUTHOR("Alan Cox");
-
-extern int mod_firmware_load(const char *, char **);
-EXPORT_SYMBOL(mod_firmware_load);
-
X
X void cleanup_module(void)
X {
diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/sound/waveartist.c linux/drivers/sound/waveartist.c
--- v2.2.0-pre5/linux/drivers/sound/waveartist.c Wed Dec 31 16:00:00 1969
+++ linux/drivers/sound/waveartist.c Thu Jan 7 09:24:00 1999
@@ -0,0 +1,1956 @@
+/*
+ * drivers/sound/waveartist.c
+ *
+ * The low level driver for the RWA010 Rockwell Wave Artist
+ * codec chip used in the Corel Computer NetWinder.
+ *
+ * Cleaned up and integrated into 2.1 by Russell King (r...@arm.linux.org.uk)
+ */
+
+/*
+ * Copyright (C) by Corel Computer 1998
+ *
+ * RWA010 specs received under NDA from Rockwell
+ *
+ * Copyright (C) by Hannu Savolainen 1993-1997
+ *
+ * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
+ * Version 2 (June 1991). See the "COPYING" file distributed with this software
+ * for more info.
+ */
+
+/* Debugging */
+#define DEBUG_CMD 1
+#define DEBUG_OUT 2
+#define DEBUG_IN 4
+#define DEBUG_INTR 8
+#define DEBUG_MIXER 16
+#define DEBUG_TRIGGER 32
+
+#define debug_flg (0)
+
+#define DEB(x)
+#define DDB(x)
+#define DEB1(x)
+
+#include <linux/module.h>
+#include <linux/config.h>
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/delay.h>
+#include <linux/smp.h>
+
+#include <asm/hardware.h>
+
+#include "soundmodule.h"
+#include "sound_config.h"
+#include "waveartist.h"
+
+#define VNC_TIMER_PERIOD (HZ/4) //check slider 4 times/sec
+
+#define MIXER_PRIVATE3_RESET 0x53570000
+#define MIXER_PRIVATE3_READ 0x53570001
+#define MIXER_PRIVATE3_WRITE 0x53570002
+
+#define VNC_INTERNAL_SPKR 0x01 //the sw mute on/off control bit
+#define VNC_INTERNAL_MIC 0x10 //the hw internal/handset mic bit
+
+/* Use RECSRC = speaker to mark the internal microphone
+ *
+ * Some cheating involved here: there is no way to relay
+ * to the system, which microphone in in use
+ * (left = handset, or right = internal)
+ *
+ * So while I do not flag SPEAKER in the Recording Devices
+ * Mask, when on internal
+ *
+ * mike - I set the speaker bit hi. Some mixers can be
+ * confused a bit...
+ */
+
+#define POSSIBLE_RECORDING_DEVICES (SOUND_MASK_LINE |\
+ SOUND_MASK_MIC |\
+ SOUND_MASK_LINE1) //Line1 = analog phone
+
+#define SUPPORTED_MIXER_DEVICES (SOUND_MASK_SYNTH |\
+ SOUND_MASK_PCM |\
+ SOUND_MASK_LINE |\
+ SOUND_MASK_MIC | \
+ SOUND_MASK_LINE1 |\
+ SOUND_MASK_RECLEV |\
+ SOUND_MASK_VOLUME)
+
+static unsigned short levels[SOUND_MIXER_NRDEVICES] = {
+ 0x5555, /* Master Volume */
+ 0x0000, /* Bass */
+ 0x0000, /* Treble */
+ 0x5555, /* Synth (FM) */
+ 0x4b4b, /* PCM */
+ 0x0000, /* PC Speaker */
+ 0x0000, /* Ext Line */
+ 0x0000, /* Mic */
+ 0x0000, /* CD */
+ 0x0000, /* Recording monitor */
+ 0x0000, /* SB PCM (ALT PCM) */
+ 0x0000, /* Recording level */
+ 0x0000, /* Input gain */
+ 0x0000, /* Output gain */
+ 0x0000, /* Line1 (Aux1) */
+ 0x0000, /* Line2 (Aux2) */
+ 0x0000, /* Line3 (Aux3) */
+ 0x0000, /* Digital1 */
+ 0x0000, /* Digital2 */
+ 0x0000, /* Digital3 */
+ 0x0000, /* Phone In */
+ 0x0000, /* Phone Out */
+ 0x0000, /* Video */
+ 0x0000, /* Radio */
+ 0x0000 /* Monitor */
+};
+
+typedef struct {
+ struct address_info hw; /* hardware */
+ char *chip_name;
+
+ int xfer_count;
+ int audio_mode;
+ int open_mode;
+ int audio_flags;
+ int record_dev;
+ int playback_dev;
+ int dev_no;
+
+ /* Mixer parameters */
+ unsigned short *levels;
+ int handset_state;
+ signed int slider_vol; /* hardware slider volume */
+ int recmask; /* currently enabled recording device! */
+ int supported_devices; /* SUPPORTED_MIXER_DEVICES */
+ int rec_devices; /* POSSIBLE_RECORDING_DEVICES */
+ int handset_mute_sw :1;/* 1 - handset controlled in sw */
+ int use_slider :1;/* use slider setting for o/p vol */
+ int mute_state :1;
+} wavnc_info;
+
+typedef struct wavnc_port_info {
+ int open_mode;
+ int speed;
+ int channels;
+ int audio_format;
+} wavnc_port_info;
+
+static int nr_waveartist_devs;
+static wavnc_info adev_info[MAX_AUDIO_DEV];
+static struct timer_list vnc_timer;
+
+
+static inline void
+waveartist_set_ctlr(struct address_info *hw, unsigned char clear, unsigned char set)
+{
+ unsigned int ctlr_port = hw->io_base + CTLR;
+
+ clear = ~clear & inb(ctlr_port);
+
+ outb(clear | set, ctlr_port);
+}
+
+/* Toggle IRQ acknowledge line
+ */
+static inline void
+waveartist_iack(wavnc_info *devc)
+{
+ unsigned int ctlr_port = devc->hw.io_base + CTLR;
+ int old_ctlr;
+
+ old_ctlr = inb(ctlr_port) & ~IRQ_ACK;
+
+ outb(old_ctlr | IRQ_ACK, ctlr_port);
+ outb(old_ctlr, ctlr_port);
+}
+
+static inline int
+waveartist_sleep(int timeout_ms)
+{
+ unsigned int timeout = timeout_ms * 10 * HZ / 100;
+
+ do {
+ current->state = TASK_INTERRUPTIBLE;
+ timeout = schedule_timeout(timeout);
+ } while (timeout);
+
+ return 0;
+}
+
+static int
+waveartist_reset(wavnc_info *devc)
+{
+ struct address_info *hw = &devc->hw;
+ unsigned int timeout, res = -1;
+
+ waveartist_set_ctlr(hw, -1, RESET);
+ waveartist_sleep(2);
+ waveartist_set_ctlr(hw, RESET, 0);
+
+ timeout = 500;
+ do {
+ mdelay(2);
+
+ if (inb(hw->io_base + STATR) & CMD_RF) {
+ res = inw(hw->io_base + CMDR);
+ if (res == 0x55aa)
+ break;
+ }
+ } while (timeout--);
+
+ if (timeout == 0) {
+ printk("WaveArtist: reset timeout ");
+ if (res != (unsigned int)-1)
+ printk("(res=%04X)", res);
+ printk("\n");
+ return 1;
+ }
+ return 0;
+}
+
+static int
+waveartist_cmd(wavnc_info *devc,
+ int nr_cmd, unsigned int *cmd,
+ int nr_resp, unsigned int *resp)
+{
+ unsigned int io_base = devc->hw.io_base;
+ unsigned int timed_out = 0;
+ unsigned int i;
+
+ if (debug_flg & DEBUG_CMD) {
+ printk("waveartist_cmd: cmd=");
+
+ for (i = 0; i < nr_cmd; i++)
+ printk("%04X ", cmd[i]);
+
+ printk("\n");
+ }
+
+ if (inb(io_base + STATR) & CMD_RF) {
+ int old_data;
+
+ /* flush the port
+ */
+
+ old_data = inw(io_base + CMDR);
+
+ if (debug_flg & DEBUG_CMD)
+ printk("flushed %04X...", old_data);
+
+ udelay(10);
+ }
+
+ for (i = 0; !timed_out && i < nr_cmd; i++) {
+ int count;
+
+ for (count = 5000; count; count--)
+ if (inb(io_base + STATR) & CMD_WE)
+ break;
+
+ if (!count)
+ timed_out = 1;
+ else
+ outw(cmd[i], io_base + CMDR);
+ }
+
+ for (i = 0; !timed_out && i < nr_resp; i++) {
+ int count;
+
+ for (count = 5000; count; count--)
+ if (inb(io_base + STATR) & CMD_RF)
+ break;
+
+ if (!count)
+ timed_out = 1;
+ else
+ resp[i] = inw(io_base + CMDR);
+ }
+
+ if (debug_flg & DEBUG_CMD) {
+ if (!timed_out) {
+ printk("waveartist_cmd: resp=");
+
+ for (i = 0; i < nr_resp; i++)
+ printk("%04X ", resp[i]);
+
+ printk("\n");
+ } else
+ printk("waveartist_cmd: timed out\n");
+ }
+
+ return timed_out ? 1 : 0;
+}
+
+static inline int
+waveartist_cmd2(wavnc_info *devc, unsigned int cmd, unsigned int arg)
+{
+ unsigned int vals[2];
+
+ vals[0] = cmd;
+ vals[1] = arg;
+
+ waveartist_cmd(devc, 2, vals, 1, vals);
+
+ return 0;
+}
+
+static inline int
+waveartist_cmd3(wavnc_info *devc, unsigned int cmd,
+ unsigned int arg1, unsigned int arg2)
+{
+ unsigned int vals[3];
+
+ vals[0] = cmd;
+ vals[1] = arg1;
+ vals[2] = arg2;
+
+ return waveartist_cmd(devc, 3, vals, 0, NULL);
+}
+
+static int
+waveartist_sendcmd(struct address_info *hw, unsigned int cmd)
+{
+ int count;
+
+ if (debug_flg & DEBUG_CMD)
+ printk("waveartist_sendcmd: cmd=0x%04X...", cmd);
+
+ udelay(10);
+
+ if (inb(hw->io_base + STATR) & CMD_RF) {
+ /*
+ * flush the port
+ */
+ count = inw(hw->io_base + CMDR);
+
+ udelay(10);
+
+ if (debug_flg & DEBUG_CMD)
+ printk(" flushed %04X...", count);
+ }
+
+ /*
+ * preset timeout at 5000 loops
+ */
+ count = 5000;
+
+ while (count --)
+ if (inb(hw->io_base + STATR) & CMD_WE) {
+ /* wait till CMD_WE is high
+ * then output the command
+ */
+ outw(cmd, hw->io_base + CMDR);
+ break;
+ }
+
+ /* ready BEFORE timeout?
+ */
+ if (debug_flg & DEBUG_CMD)
+ printk(" %s\n", count ? "Done OK." : "Error!");
+
+ udelay(10);
+
+ return count ? 0 : 1;
+}
+
+static int
+waveartist_getrev(struct address_info *hw, char *rev)
+{
+ int temp;
+
+ waveartist_sendcmd(hw, 0);
+ udelay(20);
+ temp = inw(hw->io_base + CMDR);
+ udelay(20);
+ inw(hw->io_base + CMDR); // discard second word == 0
+
+ rev[0] = temp >> 8;
+ rev[1] = temp & 255;
+ rev[2] = '\0';
+
+ return temp;
+}
+
+inline void
+waveartist_mute(wavnc_info *devc, int mute)
+{
+}
+
+static void waveartist_halt_output(int dev);
+static void waveartist_halt_input(int dev);
+static void waveartist_halt(int dev);
+static void waveartist_trigger(int dev, int state);
+
+static int
+waveartist_open(int dev, int mode)
+{
+ wavnc_info *devc;
+ wavnc_port_info *portc;
+ unsigned long flags;
+
+ if (dev < 0 || dev >= num_audiodevs)
+ return -ENXIO;
+
+ devc = (wavnc_info *) audio_devs[dev]->devc;
+ portc = (wavnc_port_info *) audio_devs[dev]->portc;
+
+ save_flags(flags);
+ cli();
+ if (portc->open_mode || (devc->open_mode & mode)) {
+ restore_flags(flags);
+ return -EBUSY;
+ }
+
+ devc->audio_mode = 0;
+ devc->open_mode |= mode;
+ portc->open_mode = mode;
+ waveartist_trigger(dev, 0);
+
+ if (mode & OPEN_READ)
+ devc->record_dev = dev;
+ if (mode & OPEN_WRITE)
+ devc->playback_dev = dev;
+ restore_flags(flags);
+
+ /*
+ * Mute output until the playback really starts. This
+ * decreases clicking (hope so).
+ */
+ waveartist_mute(devc, 1);
+
+ return 0;
+}
+
+static void
+waveartist_close(int dev)
+{
+ wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
+ wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
+ unsigned long flags;
+
+ save_flags(flags);
+ cli();
+
+ waveartist_halt(dev);
+
+ devc->audio_mode = 0;
+ devc->open_mode &= ~portc->open_mode;
+ portc->open_mode = 0;
+
+ waveartist_mute(devc, 1);
+
+ restore_flags(flags);
+}
+
+static void
+waveartist_output_block(int dev, unsigned long buf, int __count, int intrflag)
+{
+ wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
+ wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
+ unsigned long flags;
+ unsigned int count = __count;
+
+ if (debug_flg & DEBUG_OUT)
+ printk("waveartist: output block, buf=0x%lx, count=0x%x...\n",
+ buf, count);
+ /*
+ * 16 bit data
+ */
+ if (portc->audio_format & (AFMT_S16_LE | AFMT_S16_BE))
+ count >>= 1;
+
+ if (portc->channels > 1)
+ count >>= 1;
+
+ count -= 1;
+
+ if (devc->audio_mode & PCM_ENABLE_OUTPUT &&
+ audio_devs[dev]->flags & DMA_AUTOMODE &&
+ intrflag &&
+ count == devc->xfer_count) {
+ devc->audio_mode |= PCM_ENABLE_OUTPUT;
+ return; /*
+ * Auto DMA mode on. No need to react
+ */
+ }
+
+ save_flags(flags);
+ cli();
+
+ /*
+ * set sample count
+ */
+ waveartist_cmd2(devc, 0x0024, count);
+
+ devc->xfer_count = count;
+ devc->audio_mode |= PCM_ENABLE_OUTPUT;
+
+ restore_flags(flags);
+}
+
+static void
+waveartist_start_input(int dev, unsigned long buf, int __count, int intrflag)
+{
+ wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
+ wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
+ unsigned long flags;
+ unsigned int count = __count;
+
+ if (debug_flg & DEBUG_IN)
+ printk("waveartist: start input, buf=0x%lx, count=0x%x...\n",
+ buf, count);
+
+ if (portc->audio_format & (AFMT_S16_LE | AFMT_S16_BE)) /* 16 bit data */
+ count >>= 1;
+
+ if (portc->channels > 1)
+ count >>= 1;
+
+ count -= 1;
+
+ if (devc->audio_mode & PCM_ENABLE_INPUT &&
+ audio_devs[dev]->flags & DMA_AUTOMODE &&
+ intrflag &&
+ count == devc->xfer_count) {
+ devc->audio_mode |= PCM_ENABLE_INPUT;
+ return; /*
+ * Auto DMA mode on. No need to react
+ */
+ }
+
+ save_flags(flags);
+ cli();
+
+ /*
+ * set sample count
+ */
+ waveartist_cmd2(devc, 0x0014, count);
+ waveartist_mute(devc, 0);
+
+ devc->xfer_count = count;
+ devc->audio_mode |= PCM_ENABLE_INPUT;
+
+ restore_flags(flags);
+}
+
+static int
+waveartist_ioctl(int dev, unsigned int cmd, caddr_t arg)
+{
+ return -EINVAL;
+}
+
+static unsigned int
+waveartist_get_speed(wavnc_port_info *portc)
+{
+ unsigned int speed;
+
+ /*
+ * program the speed, channels, bits
+ */
+ if (portc->speed == 8000)
+ speed = 0x2E71;
+ else if (portc->speed == 11025)
+ speed = 0x4000;
+ else if (portc->speed == 22050)
+ speed = 0x8000;
+ else if (portc->speed == 44100)
+ speed = 0x0;
+ else {
+ /*
+ * non-standard - just calculate
+ */
+ speed = portc->speed << 16;
+
+ speed = (speed / 44100) & 65535;
+ }
+
+ return speed;
+}
+
+static unsigned int
+waveartist_get_bits(wavnc_port_info *portc)
+{
+ unsigned int bits;
+
+ if (portc->audio_format == AFMT_S16_LE)
+ bits = 1;
+ else if (portc->audio_format == AFMT_S8)
+ bits = 0;
+ else
+ bits = 2; //default AFMT_U8
+
+ return bits;
+}
+
+static int
+waveartist_prepare_for_input(int dev, int bsize, int bcount)
+{
+ unsigned long flags;
+ wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
+ wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
+ unsigned int speed, bits;
+
+ if (devc->audio_mode)
+ return 0;
+
+ speed = waveartist_get_speed(portc);
+ bits = waveartist_get_bits(portc);
+
+ save_flags(flags);
+ cli();
+
+ if (waveartist_cmd2(devc, WACMD_INPUTFORMAT, bits))
+ printk("waveartist: error setting the record format to %d\n",
+ portc->audio_format);
+
+ if (waveartist_cmd2(devc, WACMD_INPUTCHANNELS, portc->channels))
+ printk("waveartist: error setting record to %d channels\n",
+ portc->channels);
+
+ /*
+ * write cmd SetSampleSpeedTimeConstant
+ */
+ if (waveartist_cmd2(devc, WACMD_INPUTSPEED, speed))
+ printk("waveartist: error setting the record speed "
+ "to %dHz.\n", portc->speed);
+
+ if (waveartist_cmd2(devc, WACMD_INPUTDMA, 1))
+ printk("waveartist: error setting the record data path "
+ "to 0x%X\n", 1);
+
+ if (waveartist_cmd2(devc, WACMD_INPUTFORMAT, bits))
+ printk("waveartist: error setting the record format to %d\n",
+ portc->audio_format);
+
+ devc->xfer_count = 0;
+ restore_flags(flags);
+ waveartist_halt_input(dev);
+
+ if (debug_flg & DEBUG_INTR) {
+ printk("WA CTLR reg: 0x%02X.\n",inb(devc->hw.io_base + CTLR));
+ printk("WA STAT reg: 0x%02X.\n",inb(devc->hw.io_base + STATR));
+ printk("WA IRQS reg: 0x%02X.\n",inb(devc->hw.io_base + IRQSTAT));
+ }
+
+ return 0;
+}
+
+static int
+waveartist_prepare_for_output(int dev, int bsize, int bcount)
+{
+ unsigned long flags;
+ wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
+ wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
+ unsigned int speed, bits;
+
+ /*
+ * program the speed, channels, bits
+ */
+ speed = waveartist_get_speed(portc);
+ bits = waveartist_get_bits(portc);
+
+ save_flags(flags);
+ cli();
+
+ if (waveartist_cmd2(devc, WACMD_OUTPUTSPEED, speed) &&
+ waveartist_cmd2(devc, WACMD_OUTPUTSPEED, speed))
+ printk("waveartist: error setting the playback speed "
+ "to %dHz.\n", portc->speed);
+
+ if (waveartist_cmd2(devc, WACMD_OUTPUTCHANNELS, portc->channels))
+ printk("waveartist: error setting the playback to"
+ " %d channels\n", portc->channels);
+
+ if (waveartist_cmd2(devc, WACMD_OUTPUTDMA, 0))
+ printk("waveartist: error setting the playback data path "
+ "to 0x%X\n", 0);
+
+ if (waveartist_cmd2(devc, WACMD_OUTPUTFORMAT, bits))
+ printk("waveartist: error setting the playback format to %d\n",
+ portc->audio_format);
+
+ devc->xfer_count = 0;
+ restore_flags(flags);
+ waveartist_halt_output(dev);
+
+ if (debug_flg & DEBUG_INTR) {
+ printk("WA CTLR reg: 0x%02X.\n",inb(devc->hw.io_base + CTLR));
+ printk("WA STAT reg: 0x%02X.\n",inb(devc->hw.io_base + STATR));
+ printk("WA IRQS reg: 0x%02X.\n",inb(devc->hw.io_base + IRQSTAT));
+ }
+
+ return 0;
+}
+
+static void
+waveartist_halt(int dev)
+{
+ wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
+ wavnc_info *devc;
+
+
+ if (portc->open_mode & OPEN_WRITE)
+ waveartist_halt_output(dev);
+
+ if (portc->open_mode & OPEN_READ)
+ waveartist_halt_input(dev);
+
+ devc = (wavnc_info *) audio_devs[dev]->devc;
+ devc->audio_mode = 0;
+}
+
+static void
+waveartist_halt_input(int dev)
+{
+ wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
+ unsigned long flags;
+
+ save_flags(flags);
+ cli();
+
+ waveartist_mute(devc, 1);
+
+//RMK disable_dma(audio_devs[dev]->dmap_in->dma);
+
+ /*
+ * Stop capture
+ */
+ waveartist_sendcmd(&devc->hw, 0x17);
+
+//RMK enable_dma(audio_devs[dev]->dmap_in->dma);
+ devc->audio_mode &= ~PCM_ENABLE_INPUT;
+
+ /*
+ * Clear interrupt by toggling
+ * the IRQ_ACK bit in CTRL
+ */
+ if (inb(devc->hw.io_base + STATR) & IRQ_REQ)
+ waveartist_iack(devc);
+
+// devc->audio_mode &= ~PCM_ENABLE_INPUT;
+
+ restore_flags(flags);
+}
+
+static void
+waveartist_halt_output(int dev)
+{
+ wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
+ unsigned long flags;
+
+ save_flags(flags);
+ cli();
+
+ waveartist_mute(devc, 1);
+
+//RMK disable_dma(audio_devs[dev]->dmap_out->dma);
+
+ waveartist_sendcmd(&devc->hw, 0x27);
+
+//RMK enable_dma(audio_devs[dev]->dmap_out->dma);
+
+ devc->audio_mode &= ~PCM_ENABLE_OUTPUT;
+
+ /*
+ * Clear interrupt by toggling
+ * the IRQ_ACK bit in CTRL
+ */
+ if (inb(devc->hw.io_base + STATR) & IRQ_REQ)
+ waveartist_iack(devc);
+
+// devc->audio_mode &= ~PCM_ENABLE_OUTPUT;
+
+ restore_flags(flags);
+}
+
+static void
+waveartist_trigger(int dev, int state)
+{
+ wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc;
+ wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
+ unsigned long flags;
+
+ if (debug_flg & DEBUG_TRIGGER) {
+ printk("wavnc: audio trigger ");
+ if (state & PCM_ENABLE_INPUT)
+ printk("in ");
+ if (state & PCM_ENABLE_OUTPUT)
+ printk("out");
+ printk("\n");
+ }
+
+ save_flags(flags);
+ cli();
+
+ state &= devc->audio_mode;
+
+ if (portc->open_mode & OPEN_READ &&
+ state & PCM_ENABLE_INPUT)
+ /*
+ * enable ADC Data Transfer to PC
+ */
+ waveartist_sendcmd(&devc->hw, 0x15);
+
+ if (portc->open_mode & OPEN_WRITE &&
+ state & PCM_ENABLE_OUTPUT)
+ /*
+ * enable DAC data transfer from PC
+ */
+ waveartist_sendcmd(&devc->hw, 0x25);
+
+ waveartist_mute(devc, 0);
+
+ restore_flags(flags);
+}
+
+static int
+waveartist_set_speed(int dev, int arg)
+{
+ wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
+
+ if (arg <= 0)
+ return portc->speed;
+
+ if (arg < 5000)
+ arg = 5000;
+ if (arg > 44100)
+ arg = 44100;
+
+ portc->speed = arg;
+ return portc->speed;
+
+}
+
+static short
+waveartist_set_channels(int dev, short arg)
+{
+ wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
+
+ if (arg != 1 && arg != 2)
+ return portc->channels;
+
+ portc->channels = arg;
+ return arg;
+}
+
+static unsigned int
+waveartist_set_bits(int dev, unsigned int arg)
+{
+ wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc;
+
+ if (arg == 0)
+ return portc->audio_format;
+
+ if ((arg != AFMT_U8) && (arg != AFMT_S16_LE) && (arg != AFMT_S8))
+ arg = AFMT_U8;
+
+ portc->audio_format = arg;
+
+ return arg;
+}
+
+static struct audio_driver waveartist_audio_driver = {
+ waveartist_open,
+ waveartist_close,
+ waveartist_output_block,
+ waveartist_start_input,
+ waveartist_ioctl,
+ waveartist_prepare_for_input,
+ waveartist_prepare_for_output,
+ waveartist_halt,
+ NULL,
+ NULL,
+ waveartist_halt_input,
+ waveartist_halt_output,
+ waveartist_trigger,
+ waveartist_set_speed,
+ waveartist_set_bits,
+ waveartist_set_channels
+};
+
+
+static void
+waveartist_intr(int irq, void *dev_id, struct pt_regs *regs)
+{
+ wavnc_info *devc = (wavnc_info *)dev_id;
+ int irqstatus, status;
+
+ irqstatus = inb(devc->hw.io_base + IRQSTAT);
+ status = inb(devc->hw.io_base + STATR);
+
+ if (debug_flg & DEBUG_INTR)
+ printk("waveartist_intr: stat=%02x, irqstat=%02x\n",
+ status, irqstatus);
+
+ if (status & IRQ_REQ) /* Clear interrupt */
+ waveartist_iack(devc);
+ else
+ printk("waveartist: unexpected interrupt\n");
+
+#ifdef CONFIG_AUDIO
+ if (irqstatus & 0x01) {
+ int temp = 1;
+
+ /* PCM buffer done
+ */
+ if ((status & DMA0) && (devc->audio_mode & PCM_ENABLE_OUTPUT)) {
+ DMAbuf_outputintr(devc->playback_dev, 1);
+ temp = 0;
+ }
+ if ((status & DMA1) && (devc->audio_mode & PCM_ENABLE_INPUT)) {
+ DMAbuf_inputintr(devc->record_dev);
+ temp = 0;
+ }
+ if (temp) //default:
+ printk("WaveArtist: Unknown interrupt\n");
+ }
+#endif
+ if (irqstatus & 0x2)
+ // We do not use SB mode natively...
+ printk("WaveArtist: Unexpected SB interrupt...\n");
+}
+
+/* -------------------------------------------------------------------------
+ * Mixer stuff
+ */
+static void
+waveartist_mixer_update(wavnc_info *devc, int whichDev)
+{
+ unsigned int mask, reg_l, reg_r;
+ unsigned int lev_left, lev_right;
+ unsigned int vals[3];
+
+ lev_left = devc->levels[whichDev] & 0xff;
+ lev_right = devc->levels[whichDev] >> 8;
+
+#define SCALE(lev,max) ((lev) * (max) / 100)
+
+ switch(whichDev) {
+ case SOUND_MIXER_VOLUME:
+ mask = 0x000e;
+ reg_l = 0x200;
+ reg_r = 0x600;
+ lev_left = SCALE(lev_left, 7) << 1;
+ lev_right = SCALE(lev_right, 7) << 1;
+ break;
+
+ case SOUND_MIXER_LINE:
+ mask = 0x07c0;
+ reg_l = 0x000;
+ reg_r = 0x400;
+ lev_left = SCALE(lev_left, 31) << 6;
+ lev_right = SCALE(lev_right, 31) << 6;
+ break;
+
+ case SOUND_MIXER_MIC:
+ mask = 0x0030;
+ reg_l = 0x200;
+ reg_r = 0x600;
+ lev_left = SCALE(lev_left, 3) << 4;
+ lev_right = SCALE(lev_right, 3) << 4;
+ break;
+
+ case SOUND_MIXER_RECLEV:
+ mask = 0x000f;
+ reg_l = 0x300;
+ reg_r = 0x700;
+ lev_left = SCALE(lev_left, 10);
+ lev_right = SCALE(lev_right, 10);
+ break;
+
+ case SOUND_MIXER_LINE1:
+ mask = 0x003e;
+ reg_l = 0x000;
+ reg_r = 0x400;
+ lev_left = SCALE(lev_left, 31) << 1;
+ lev_right = SCALE(lev_right, 31) << 1;
+ break;
+
+ case SOUND_MIXER_PCM:
+ waveartist_cmd3(devc, 0x0031, SCALE(lev_left, 32767),
+ SCALE(lev_right, 32767));
+ return;
+
+ case SOUND_MIXER_SYNTH:
+ waveartist_cmd3(devc, 0x0131, SCALE(lev_left, 32767),
+ SCALE(lev_right, 32767));
+ return;
+
+ default:
+ return;
+ }
+
+ /* read left setting */
+ vals[0] = reg_l + 0x30;
+ waveartist_cmd(devc, 1, vals, 1, vals + 1);
+
+ /* read right setting */
+ vals[0] = reg_r + 0x30;
+ waveartist_cmd(devc, 1, vals, 1, vals + 2);
+
+ vals[1] = (vals[1] & ~mask) | (lev_left & mask);
+ vals[2] = (vals[2] & ~mask) | (lev_right & mask);
+
+ /* write left,right back */
+ vals[0] = 0x32;
+ waveartist_cmd(devc, 3, vals, 0, NULL);
+}
+
+static void
+waveartist_select_input(wavnc_info *devc, unsigned int input)
+{
+ unsigned int vals[3];
+#if 1
+ /* New mixer programming - switch recording source
+ * using R/L_ADC_Mux_Select. We are playing with
+ * left/right mux bit fields in reg 9.
+ *
+ * We can not switch Mux_Select while recording, so
+ * for microphones, enable both left and right and
+ * play with levels only!
+ *
+ * Unfortunately, we need to select the src of mono
+ * recording (left or right) before starting the
+ * recording - so can not dynamically switch between
+ * handset amd internal microphones...
+ */
+
+ /*
+ * Get reg 9
+ */
+ vals[0] = 0x0830;
+ waveartist_cmd(devc, 1, vals, 1, vals + 1);
+
+ /*
+ * Get reg 10, only so that we can write it back.
+ */
+ vals[0] = 0x0930;
+ waveartist_cmd(devc, 1, vals, 1, vals + 2);
+
+ if (debug_flg & DEBUG_MIXER)
+ printk("RECSRC: old left: 0x%04X, old right: 0x%04X.\n",
+ vals[1] & 0x07, (vals[1] >> 3) & 0x07);
+
+ vals[1] &= ~0x03F; //kill current left/right mux input select
+
+ switch (input) {
+ /*
+ * Handset or internal MIC
+ */
+ case SOUND_MASK_MIC:
+ /*
+ * handset not plugged in?
+ */
+ if (devc->handset_state & VNC_INTERNAL_MIC) {
+ /*
+ * set mono recording from right mic
+ */
+ waveartist_sendcmd(&devc->hw, 0x0134);
+#if 0
+ /*
+ * right=mic, left=none
+ */
+ vals[1] |= 0x0028;
+ /*
+ * pretend int mic
+ */
+ devc->rec_devices |= SOUND_MASK_SPEAKER;
+#endif
+ } else {
+ /*
+ * set mono rec from left mic
+ */
+ waveartist_sendcmd(&devc->hw, 0x0034);
+#if 0
+ /*
+ * right=none, left=mic
+ */
+ vals[1] |= 0x0005;
+ /*
+ * show no int mic
+ */
+ devc->rec_devices &= ~SOUND_MASK_SPEAKER;
+#endif
+ }
+ /*
+ * right=mic, left=mic
+ */
+ vals[1] |= 0x002D;
+ break;
+
+ case SOUND_MASK_LINE1:
+ /*
+ * set mono rec from left aux1
+ */
+ waveartist_sendcmd(&devc->hw, 0x0034);
+ /*
+ * right=none, left=Aux1;
+ */
+ vals[1] |= 0x0004;
+ break;
+
+ case SOUND_MASK_LINE:
+ /*
+ * set mono rec from left (default)
+ */
+ waveartist_sendcmd(&devc->hw, 0x0034);
+ /*
+ * right=Line, left=Line;
+ */
+ vals[1] |= 0x0012;
+ break;
+ }
+
+ if (debug_flg & DEBUG_MIXER)
+ printk("RECSRC %d: left=0x%04X, right=0x%04X.\n", input,
+ vals[1] & 0x07, (vals[1] >> 3) & 0x07);
+
+#else
+ /* This part is good, if input connected to
+ * a mixer, so can be used for record-only modes...
+ */
+
+ /*
+ * get reg 4
+ */
+ vals[0] = 0x0330;
+ waveartist_cmd(devc, 1, vals, 1, vals + 1);
+
+ /*
+ * get reg 8
+ */
+ vals[0] = 0x0730;
+ waveartist_cmd(devc, 1, vals, 1, vals + 2);
+
+ if (debug_flg & DEBUG_MIXER)
+ printk("RECSRC: old left: 0x%04X, old right: 0x%04X.\n",
+ vals[1], vals[2]);
+
+ /*
+ * kill current left/right mux input select
+ */
+ vals[1] &= ~0x07F8;
+ vals[2] &= ~0x07F8;
+
+ switch (input) {
+ /*
+ * handset or internal mic
+ */
+ case SOUND_MASK_MIC:
+ /*
+ * handset not plugged in?
+ */
+ if (devc->handset_state & VNC_INTERNAL_MIC) {
+ /*
+ * set mono recording from right mic
+ */
+ waveartist_sendcmd(&devc->hw, 0x0134);
+ /*
+ * left = none, right = mic, RX filter gain
+ */
+ vals[1] |= 0x0C00;
+ vals[2] |= 0x0C88;
+ /*
+ * pretend int mic
+ */
+ devc->rec_devices |= SOUND_MASK_SPEAKER;
+ } else {
+ /*
+ * set mono rec from left mic
+ */
+ waveartist_sendcmd(&devc->hw, 0x0034);
+ /*
+ * left = mic, RX filter gain, right = none;
+ */
+ vals[1] |= 0x0C88;
+ vals[2] |= 0x0C00;
+ /*
+ * show no int mic
+ */
+ devc->rec_devices &= ~SOUND_MASK_SPEAKER;
+ }
+ break;
+
+ case SOUND_MASK_LINE1:
+ /*
+ * set mono rec from left aux1
+ */
+ waveartist_sendcmd(&devc->hw, 0x0034);
+ /*
+ * left = Aux1, right = none
+ */
+ vals[1] |= 0x0C40;
+ vals[2] |= 0x0C00;
+ break;
+
+ case SOUND_MASK_LINE:
+ /*
+ * left = Line, right = Line
+ */
+ vals[1] |= 0x0C10;
+ vals[2] |= 0x0C10;
+ break;
+ }
+
+ if (debug_flg & DEBUG_MIXER)
+ printk("RECSRC %d: left(4) 0x%04X, right(8) 0x%04X.\n",
+ level, vals[1], vals[2]);
+#endif
+ /*
+ * and finally - write the reg pair back....
+ */
+ vals[0] = 0x32;
+
+ waveartist_cmd(devc, 3, vals, 0, NULL);
+}
+
+static int
+waveartist_mixer_set(wavnc_info *devc, int whichDev, unsigned int level)
+{
+ unsigned int lev_left = level & 0x007f;
+ unsigned int lev_right = (level & 0x7f00) >> 8;
+
+ int left, right, devmask, changed, i;
+
+ left = level & 0x7f;
+ right = (level & 0x7f00) >> 8;
+
+ if (debug_flg & DEBUG_MIXER)
+ printk("wa_mixer_set(dev=%d, level=%X)\n",
+ whichDev, level);
+
+ switch (whichDev) {
+ /* Master volume (0-7)
+ * We have 3 bits on the Left/Right Mixer Gain,
+ * bits 3,2,1 on 3 and 7
+ */
+ case SOUND_MIXER_VOLUME:
+ devc->levels[whichDev] = lev_left | lev_right << 8;
+ waveartist_mixer_update(devc, whichDev);
+ break;
+
+
+ /* External line (0-31)
+ * use LOUT/ROUT bits 10...6, reg 1 and 5
+ */
+ case SOUND_MIXER_LINE:
+ devc->levels[whichDev] = lev_left | lev_right << 8;
+ waveartist_mixer_update(devc, whichDev);
+ break;
+
+ /* Mono microphone (0-3) mute,
+ * 0db,10db,20db
+ */
+ case SOUND_MIXER_MIC:
+#if 1
+ devc->levels[whichDev] = lev_left | lev_right << 8;
+#else
+ /* we do not need to mute volume of
+ * an unused mic - it is simply unused...
+ */
+ if (devc->handset_state & VNC_INTERNAL_MIC)
+ devc->levels[whichDev] = lev_right << 8;
+ else
+ levels[whichDev] = lev_left;
+#endif
+ waveartist_mixer_update(devc, whichDev);
+ break;
+
+ /* Recording level (0-7)
+ */
+ case SOUND_MIXER_RECLEV:
+ devc->levels[whichDev] = lev_left | lev_right << 8;
+ waveartist_mixer_update(devc, whichDev);
+ break;
+
+ /* Mono External Aux1 (0-31)
+ * use LINE1 bits 5...1, reg 1 and 5
+ */
+ case SOUND_MIXER_LINE1:
+ devc->levels[whichDev] = lev_left | lev_right << 8;
+ waveartist_mixer_update(devc, whichDev);
+ break;
+
+ /* WaveArtist PCM (0-32767)
+ */
+ case SOUND_MIXER_PCM:
+ devc->levels[whichDev] = lev_left | lev_right << 8;
+ waveartist_mixer_update(devc, whichDev);
+ break;
+
+ /* Internal synthesizer (0-31)
+ */
+ case SOUND_MIXER_SYNTH:
+ devc->levels[whichDev] = lev_left | lev_right << 8;
+ waveartist_mixer_update(devc, whichDev);
+ break;
+
+
+ /* Select recording input source
+ */
+ case SOUND_MIXER_RECSRC:
+ devmask = level & POSSIBLE_RECORDING_DEVICES;
+
+ changed = devmask ^ devc->recmask;
+ devc->recmask = devmask;
+
+ for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
+ if (changed & (1 << i))
+ waveartist_mixer_update(devc, i);
+
+ waveartist_select_input(devc, level);
+ /*
+ * do not save in "levels", return current setting
+ */
+ return devc->recmask;
+
+ default:
+ return -EINVAL;
+ }
+
+ return devc->levels[whichDev];
+}
+
+static void
+waveartist_mixer_reset(wavnc_info *devc)


+{
+ int i;
+

+ if (debug_flg & DEBUG_MIXER)
+ printk("%s: mixer_reset\n", devc->hw.name);
+
+ /*
+ * reset mixer cmd
+ */
+ waveartist_sendcmd(&devc->hw, 0x33);
+
+ /*
+ * set input for ADC to come from
+ * a mux (left and right) == reg 9,
+ * initially none
+ */
+ waveartist_cmd3(devc, 0x0032, 0x9800, 0xa836);
+
+ /*
+ * set mixer input select to none, RX filter gains 0 db
+ */
+ waveartist_cmd3(devc, 0x0032, 0x4c00, 0x8c00);
+
+ /*
+ * set bit 0 reg 2 to 1 - unmute MonoOut
+ */
+ waveartist_cmd3(devc, 0x0032, 0x2801, 0x6800);
+
+ for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
+ waveartist_mixer_update(devc, i);
+
+ /* set default input device = internal mic
+ * current recording device = none
+ * no handset
+ */
+ devc->recmask = 0;
+ devc->handset_state = VNC_INTERNAL_MIC;
+// waveartist_mixer_set(devc, SOUND_MIXER_RECSRC, SOUND_MASK_MIC);
+
+ /*
+ * start from enabling the hw setting
+ */
+ devc->handset_mute_sw = 0;
+ devc->supported_devices = SUPPORTED_MIXER_DEVICES;
+ devc->rec_devices = POSSIBLE_RECORDING_DEVICES;
+}
+
+static int
+waveartist_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+{
+ wavnc_info *devc = (wavnc_info *)audio_devs[dev]->devc;
+#if 0
+ //use this call to override the automatic handset behaviour - ignore handset
+ //bit 0x80 = total control over handset - do not react to plug/unplug
+ //bit 0x10 = 1 == internal mic, otherwise handset mic
+ //bit 0x01 = 1 == mute internal speaker, otherwise unmute
+
+ if (cmd == SOUND_MIXER_PRIVATE1) {
+ int val, temp;
+
+ val = *(int *) arg;
+
+// printk("MIXER_PRIVATE1: passed parameter = 0x%X.\n",val);
+ return -EINVAL; //check if parameter is logical...
+
+ devc->soft_mute_flag = val;
+
+ temp = val & VNC_INTERNAL_SPKR;
+ if (temp != devc->mute_state) {
+// printk("MIXER_PRIVATE1: mute_mono(0x%X).\n",temp);
+ vnc_mute(devc, temp);
+ }
+
+// temp = devc->handset_state;
+
+ // do not check if it is not already in
+ // the right setting, since we are
+ // laying about the current state...
+
+// if ((val & VNC_INTERNAL_MIC) != temp) {
+ devc->handset_state = val & VNC_INTERNAL_MIC;
+// printk("MIXER_PRIVATE1: mixer_set(0x%X).\n",devc->handset_state);
+ wa_mixer_set(devc, SOUND_MIXER_RECSRC, SOUND_MASK_MIC);
+// devc->handset_state = temp;
+ }
+ return 0;
+ }
+#if 0
+ if (cmd == SOUND_MIXER_PRIVATE2) {
+#define VNC_SOUND_PAUSE 0x53 //to pause the DSP
+#define VNC_SOUND_RESUME 0x57 //to unpause the DSP
+ int val;
+
+ val = *(int *) arg;
+
+ printk("MIXER_PRIVATE2: passed parameter = 0x%X.\n",val);
+
+ if (val == VNC_SOUND_PAUSE) {
+ wa_sendcmd(0x16); //PAUSE the ADC
+ } else if (val == VNC_SOUND_RESUME) {
+ wa_sendcmd(0x18); //RESUME the ADC
+ } else {
+ return -EINVAL; //invalid parameters...
+ }
+ return 0;
+ }
+#endif
+
+ if (cmd == SOUND_MIXER_PRIVATE3) {
+ long unsigned flags;
+ int mixer_reg[15]; //reg 14 is actually a command: read,write,reset
+
+ int val;
+ int i;
+
+ val = *(int *) arg;
+
+ if (verify_area(VERIFY_READ, (void *) val, sizeof(mixer_reg) == -EFAULT))
+ return (-EFAULT);
+
+ memcpy_fromfs(&mixer_reg, (void *) val, sizeof(mixer_reg));
+
+ if (mixer_reg[0x0E] == MIXER_PRIVATE3_RESET) { //reset command??
+ wavnc_mixer_reset(devc);
+ return (0);
+ } else if (mixer_reg[0x0E] == MIXER_PRIVATE3_WRITE) { //write command??
+// printk("WaveArtist Mixer: Private write command.\n");
+
+ wa_sendcmd(0x32); //Pair1 - word 1 and 5
+ wa_sendcmd(mixer_reg[0]);
+ wa_sendcmd(mixer_reg[4]);
+
+ wa_sendcmd(0x32); //Pair2 - word 2 and 6
+ wa_sendcmd(mixer_reg[1]);
+ wa_sendcmd(mixer_reg[5]);
+
+ wa_sendcmd(0x32); //Pair3 - word 3 and 7
+ wa_sendcmd(mixer_reg[2]);
+ wa_sendcmd(mixer_reg[6]);
+
+ wa_sendcmd(0x32); //Pair4 - word 4 and 8
+ wa_sendcmd(mixer_reg[3]);
+ wa_sendcmd(mixer_reg[7]);
+
+ wa_sendcmd(0x32); //Pair5 - word 9 and 10
+ wa_sendcmd(mixer_reg[8]);
+ wa_sendcmd(mixer_reg[9]);
+
+ wa_sendcmd(0x0031); //set left and right PCM
+ wa_sendcmd(mixer_reg[0x0A]);
+ wa_sendcmd(mixer_reg[0x0B]);
+
+ wa_sendcmd(0x0131); //set left and right FM
+ wa_sendcmd(mixer_reg[0x0C]);
+ wa_sendcmd(mixer_reg[0x0D]);
+
+ return 0;
+ } else if (mixer_reg[0x0E] == MIXER_PRIVATE3_READ) { //read command?
+// printk("WaveArtist Mixer: Private read command.\n");
+
+ //first read all current values...
+ save_flags(flags);
+ cli();
+
+ for (i = 0; i < 14; i++) {
+ wa_sendcmd((i << 8) + 0x30); // get ready for command nn30H
+
+ while (!(inb(STATR) & CMD_RF)) {
+ }; //wait for response ready...
+
+ mixer_reg[i] = inw(CMDR);
+ }
+ restore_flags(flags);
+
+ if (verify_area(VERIFY_WRITE, (void *) val, sizeof(mixer_reg) == -EFAULT))
+ return (-EFAULT);
+
+ memcpy_tofs((void *) val, &mixer_reg, sizeof(mixer_reg));


SHAR_EOF
true || echo 'restore of patch-2.2.0-pre6 failed'
fi

echo 'End of part 5'
echo 'File patch-2.2.0-pre6 is continued in part 6'
echo 6 > _shar_seq_.tmp
exit 0

Thomas...@ciw.uni-karlsruhe.de

unread,
Jan 10, 1999, 3:00:00 AM1/10/99
to
Archive-name: v2.1/patch-2.2.0-pre6/part7

#!/bin/sh
# this is part 7 of a 8 - part archive


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

if test "$Scheck" != 7; 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.2.0-pre6'
else
echo 'x - continuing with patch-2.2.0-pre6'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.2.0-pre6' &&

@@ -4,27 +4,25 @@
X * Copyright (C) 1996,1997,1998 Russell King
X */
X
+#define BASE 0x42000160
+
+static __inline__ void putc(char c)
+{
+ while (*((volatile unsigned int *)(BASE + 0x18)) & 8);
+ *((volatile unsigned int *)(BASE)) = c;
+}
+
X /*
X * This does not append a newline
X */
X static void puts(const char *s)
X {
- __asm__ __volatile__("
- ldrb %0, [%2], #1
- teq %0, #0
- beq 3f
-1: strb %0, [%3]
-2: ldrb %1, [%3, #0x14]
- and %1, %1, #0x60
- teq %1, #0x60
- bne 2b
- teq %0, #'\n'
- moveq %0, #'\r'
- beq 1b
- ldrb %0, [%2], #1
- teq %0, #0
- bne 1b
-3: " : : "r" (0), "r" (0), "r" (s), "r" (0xf0000be0) : "cc");
+ while (*s) {
+ putc(*s);
+ if (*s == '\n')
+ putc('\r');
+ s++;
+ }
X }
X
X /*
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-nexuspci/a.out.h linux/include/asm-arm/arch-nexuspci/a.out.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-nexuspci/a.out.h Fri May 8 23:14:54 1998
+++ linux/include/asm-arm/arch-nexuspci/a.out.h Thu Jan 7 15:51:33 1999
@@ -9,7 +9,6 @@
X
X #ifdef __KERNEL__
X #define STACK_TOP ((current->personality==PER_LINUX_32BIT)? 0xc0000000 : 0x04000000)
-#define LIBRARY_START_TEXT (0x00c00000)
X #endif
X
X #endif
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-nexuspci/dma.h linux/include/asm-arm/arch-nexuspci/dma.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-nexuspci/dma.h Fri May 8 23:14:54 1998
+++ linux/include/asm-arm/arch-nexuspci/dma.h Thu Jan 7 15:51:33 1999
@@ -7,6 +7,3 @@
X * Copyright (C) 1998 Philip Blundell
X */
X
-/* Need this to keep <asm/dma.h> happy. */
-typedef unsigned int dmamode_t;
-
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-nexuspci/hardware.h linux/include/asm-arm/arch-nexuspci/hardware.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-nexuspci/hardware.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/arch-nexuspci/hardware.h Thu Jan 7 15:51:33 1999
@@ -34,6 +34,6 @@
X */
X #define RAM_BASE 0x40000000
X #define KERNTOPHYS(a) ((unsigned long)(&a))
-#define SAFE_ADDR 0x40000000
+#define FLUSH_BASE_PHYS 0x40000000
X
X #endif
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-nexuspci/processor.h linux/include/asm-arm/arch-nexuspci/processor.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-nexuspci/processor.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/arch-nexuspci/processor.h Thu Jan 7 15:51:33 1999
@@ -25,7 +25,6 @@
X * space during mmap's.
X */
X #define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
-#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
X
X #define INIT_MMAP \
X { &init_mm, 0, 0, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-nexuspci/system.h linux/include/asm-arm/arch-nexuspci/system.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-nexuspci/system.h Fri May 8 23:14:54 1998
+++ linux/include/asm-arm/arch-nexuspci/system.h Thu Jan 7 15:51:33 1999
@@ -6,13 +6,12 @@
X #ifndef __ASM_ARCH_SYSTEM_H
X #define __ASM_ARCH_SYSTEM_H
X
-extern __inline__ void arch_hard_reset (void)
+extern __inline__ void arch_reset(char mode)
X {
X /*
X * loop endlessly - the watchdog will reset us if it's enabled.
X */
X cli();
- while (1);
X }
X
X #endif
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-rpc/a.out.h linux/include/asm-arm/arch-rpc/a.out.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-rpc/a.out.h Tue Apr 14 14:29:25 1998
+++ linux/include/asm-arm/arch-rpc/a.out.h Thu Jan 7 15:51:33 1999
@@ -9,7 +9,6 @@
X
X #ifdef __KERNEL__
X #define STACK_TOP ((current->personality==PER_LINUX_32BIT)? 0xc0000000 : 0x04000000)
-#define LIBRARY_START_TEXT (0x00c00000)
X #endif
X
X #endif
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-rpc/dma.h linux/include/asm-arm/arch-rpc/dma.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-rpc/dma.h Tue Apr 14 14:29:25 1998
+++ linux/include/asm-arm/arch-rpc/dma.h Thu Jan 7 15:51:33 1999
@@ -7,15 +7,6 @@
X * bytes of RAM.
X */
X #define MAX_DMA_ADDRESS 0xd0000000
-
-/*
- * DMA modes - we have two, IN and OUT
- */
-typedef enum {
- DMA_MODE_READ,
- DMA_MODE_WRITE
-} dmamode_t;
-
X #define MAX_DMA_CHANNELS 8
X
X #define DMA_0 0
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-rpc/hardware.h linux/include/asm-arm/arch-rpc/hardware.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-rpc/hardware.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/arch-rpc/hardware.h Thu Jan 7 15:51:33 1999
@@ -13,6 +13,7 @@
X * What hardware must be present
X */
X #define HAS_IOMD
+#include <asm/iomd.h>
X #define HAS_VIDC20
X
X /* Hardware addresses of major areas.
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-rpc/io.h linux/include/asm-arm/arch-rpc/io.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-rpc/io.h Tue Apr 14 14:29:25 1998
+++ linux/include/asm-arm/arch-rpc/io.h Thu Jan 7 15:51:33 1999
@@ -36,7 +36,7 @@
X "tst %2, #0x80000000\n\t" \
X "mov %0, %4\n\t" \
X "addeq %0, %0, %3\n\t" \
- "str" ##instr## " %1, [%0, %2, lsl #2]" \
+ "str" ##instr## " %1, [%0, %2, lsl #2] @ out"###fnsuffix \
X : "=&r" (temp) \
X : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
X : "cc"); \
@@ -50,7 +50,7 @@
X "tst %2, #0x80000000\n\t" \
X "mov %0, %4\n\t" \
X "addeq %0, %0, %3\n\t" \
- "ldr" ##instr## " %1, [%0, %2, lsl #2]" \
+ "ldr" ##instr## " %1, [%0, %2, lsl #2] @ in"###fnsuffix \
X : "=&r" (temp), "=r" (value) \
X : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
X : "cc"); \
@@ -87,11 +87,11 @@
X ({ \
X if (__PORT_PCIO((port))) \
X __asm__ __volatile__( \
- "strb %0, [%1, %2]" \
+ "strb %0, [%1, %2] @ outbc" \
X : : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
X else \
X __asm__ __volatile__( \
- "strb %0, [%1, %2]" \
+ "strb %0, [%1, %2] @ outbc" \
X : : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
X })
X
@@ -100,11 +100,11 @@
X unsigned char result; \
X if (__PORT_PCIO((port))) \
X __asm__ __volatile__( \
- "ldrb %0, [%1, %2]" \
+ "ldrb %0, [%1, %2] @ inbc" \
X : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
X else \
X __asm__ __volatile__( \
- "ldrb %0, [%1, %2]" \
+ "ldrb %0, [%1, %2] @ inbc" \
X : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
X result; \
X })
@@ -114,11 +114,11 @@
X unsigned long v = value; \
X if (__PORT_PCIO((port))) \
X __asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outwc" \
X : : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
X else \
X __asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outwc" \
X : : "r" (v|v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
X })
X
@@ -127,11 +127,11 @@
X unsigned short result; \
X if (__PORT_PCIO((port))) \
X __asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inwc" \
X : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
X else \
X __asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inwc" \
X : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
X result & 0xffff; \
X })
@@ -141,11 +141,11 @@
X unsigned long v = value; \
X if (__PORT_PCIO((port))) \
X __asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outlc" \
X : : "r" (v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
X else \
X __asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outlc" \
X : : "r" (v), "r" (IO_BASE), "r" ((port) << 2)); \
X })
X
@@ -154,11 +154,11 @@
X unsigned long result; \
X if (__PORT_PCIO((port))) \
X __asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inlc" \
X : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
X else \
X __asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inlc" \
X : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
X result; \
X })
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-rpc/processor.h linux/include/asm-arm/arch-rpc/processor.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-rpc/processor.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/arch-rpc/processor.h Thu Jan 7 15:51:33 1999
@@ -27,7 +27,6 @@
X * space during mmap's.
X */
X #define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
-#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
X
X #define INIT_MMAP \
X { &init_mm, 0, 0, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-rpc/system.h linux/include/asm-arm/arch-rpc/system.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-rpc/system.h Tue Jan 20 16:39:42 1998
+++ linux/include/asm-arm/arch-rpc/system.h Thu Jan 7 15:51:33 1999
@@ -8,10 +8,10 @@
X
X #include <asm/proc-fns.h>
X
-#define arch_hard_reset() { \
+#define arch_reset(mode) { \
X extern void ecard_reset (int card); \
X outb (0, IOMD_ROMCR0); \
- ecard_reset (-1); \
+ ecard_reset(-1); \
X cli(); \
X __asm__ __volatile__("msr spsr, r1;" \
X "mcr p15, 0, %0, c1, c0, 0;" \
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-vnc/a.out.h linux/include/asm-arm/arch-vnc/a.out.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-vnc/a.out.h Wed Sep 9 14:51:12 1998
+++ linux/include/asm-arm/arch-vnc/a.out.h Thu Jan 7 15:51:33 1999
@@ -9,7 +9,6 @@
X
X #ifdef __KERNEL__
X #define STACK_TOP ((current->personality==PER_LINUX_32BIT)? 0xc0000000 : 0x04000000)
-#define LIBRARY_START_TEXT (0x00c00000)
X #endif
X
X #endif
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-vnc/dma.h linux/include/asm-arm/arch-vnc/dma.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-vnc/dma.h Wed Sep 9 14:51:12 1998
+++ linux/include/asm-arm/arch-vnc/dma.h Thu Jan 7 15:51:33 1999
@@ -14,15 +14,6 @@
X * bytes of RAM.
X */
X #define MAX_DMA_ADDRESS 0xd0000000
-
-/*
- * DMA modes - we have two, IN and OUT
- */
-typedef enum {
- DMA_MODE_READ,
- DMA_MODE_WRITE
-} dmamode_t;
-
X #define MAX_DMA_CHANNELS 8
X
X #endif /* _ASM_ARCH_DMA_H */
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-vnc/hardware.h linux/include/asm-arm/arch-vnc/hardware.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-vnc/hardware.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/arch-vnc/hardware.h Thu Jan 7 15:51:33 1999
@@ -46,4 +46,29 @@
X //#define PARAMS_OFFSET 0x0100
X //#define PARAMS_BASE (PAGE_OFFSET + PARAMS_OFFSET)
X
-#define SAFE_ADDR 0x50000000
+#define FLUSH_BASE_PHYS 0x50000000
+
+/* GPIO pins */
+#define GPIO_CCLK 0x800
+#define GPIO_DSCLK 0x400
+#define GPIO_E2CLK 0x200
+#define GPIO_IOLOAD 0x100
+#define GPIO_RED_LED 0x080
+#define GPIO_WDTIMER 0x040
+#define GPIO_DATA 0x020
+#define GPIO_IOCLK 0x010
+#define GPIO_DONE 0x008
+#define GPIO_FAN 0x004
+#define GPIO_GREEN_LED 0x002
+#define GPIO_RESET 0x001
+
+/* CPLD pins */
+#define CPLD_DSRESET 8
+#define CPLD_UNMUTE 2
+
+#ifndef __ASSEMBLY__
+extern void gpio_modify_op(int mask, int set);
+extern void gpio_modify_io(int mask, int in);
+extern int gpio_read(void);
+extern void cpld_modify(int mask, int set);
+#endif
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-vnc/io.h linux/include/asm-arm/arch-vnc/io.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-vnc/io.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/arch-vnc/io.h Thu Jan 7 15:51:33 1999
@@ -23,7 +23,7 @@
X extern __inline__ void __out##fnsuffix (unsigned int value, unsigned int port) \
X { \
X __asm__ __volatile__( \
- "str" ##instr## " %0, [%1, %2]" \
+ "str%?" ##instr## " %0, [%1, %2] @ out"###fnsuffix \
X : \
X : "r" (value), "r" (PCIO_BASE), typ (port)); \
X }
@@ -33,7 +33,7 @@
X { \
X unsigned long value; \
X __asm__ __volatile__( \
- "ldr" ##instr## " %0, [%1, %2]" \
+ "ldr%?" ##instr## " %0, [%1, %2] @ in"###fnsuffix \
X : "=&r" (value) \
X : "r" (PCIO_BASE), typ (port)); \
X return (unsigned sz)value; \
@@ -65,7 +65,7 @@
X #define __outbc(value,port) \
X ({ \
X __asm__ __volatile__( \
- "strb %0, [%1, %2]" \
+ "strb %0, [%1, %2] @ outbc" \
X : \
X : "r" (value), "r" (PCIO_BASE), "Jr" (port)); \
X })
@@ -74,7 +74,7 @@
X ({ \
X unsigned char result; \
X __asm__ __volatile__( \
- "ldrb %0, [%1, %2]" \
+ "ldrb %0, [%1, %2] @ inbc" \
X : "=r" (result) \
X : "r" (PCIO_BASE), "Jr" (port)); \
X result; \
@@ -83,7 +83,7 @@
X #define __outwc(value,port) \
X ({ \
X __asm__ __volatile__( \
- "strh %0, [%1, %2]" \
+ "strh %0, [%1, %2] @ outwc" \
X : \
X : "r" (value), "r" (PCIO_BASE), "r" (port)); \
X })
@@ -92,7 +92,7 @@
X ({ \
X unsigned short result; \
X __asm__ __volatile__( \
- "ldrh %0, [%1, %2]" \
+ "ldrh %0, [%1, %2] @ inwc" \
X : "=r" (result) \
X : "r" (PCIO_BASE), "r" (port)); \
X result & 0xffff; \
@@ -101,7 +101,7 @@
X #define __outlc(value,port) \
X ({ \
X __asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outlc" \
X : \
X : "r" (value), "r" (PCIO_BASE), "Jr" (port)); \
X })
@@ -110,7 +110,7 @@
X ({ \
X unsigned long result; \
X __asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inlc" \
X : "=r" (result) \
X : "r" (PCIO_BASE), "Jr" (port)); \
X result; \
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-vnc/irqs.h linux/include/asm-arm/arch-vnc/irqs.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-vnc/irqs.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/arch-vnc/irqs.h Thu Jan 7 15:51:33 1999
@@ -39,7 +39,7 @@
X #define IRQ_HARDDISK 30 /* from 553.14 */
X
X /* These defines handle the translation from the above FB #defines
- * into physical buts for the FootBridge IRQ registers
+ * into physical bits for the FootBridge IRQ registers
X */
X #define IRQ_MASK_SOFTIRQ 0x00000002
X #define IRQ_MASK_UART_DEBUG 0x0000000C
@@ -52,11 +52,16 @@
X #define IRQ_MASK_VIDCOMP 0x00000400
X #define IRQ_MASK_EXTERN_IRQ 0x00000800
X #define IRQ_MASK_DMA1 0x00030000
-#define IRQ_MASK_PCI_ERR 0xf0000000
+#define IRQ_MASK_PCI_ERR 0xf8800000
X
X /*
X * Now map them to the Linux interrupts
X */
+#undef IRQ_TIMER
X #define IRQ_TIMER IRQ_TIMER0
+#undef RTC_IRQ
+#define RTC_IRQ IRQ_RTC_ALARM
+#undef AUX_IRQ
+#define AUX_IRQ IRQ_MOUSE
X
X #define irq_cannonicalize(i) (i)
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-vnc/processor.h linux/include/asm-arm/arch-vnc/processor.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-vnc/processor.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/arch-vnc/processor.h Thu Jan 7 15:51:33 1999
@@ -24,7 +24,6 @@
X * space during mmap's.
X */
X #define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
-#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
X
X #define INIT_MMAP \
X { &init_mm, 0, 0, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-vnc/system.h linux/include/asm-arm/arch-vnc/system.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-vnc/system.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/arch-vnc/system.h Thu Jan 7 15:51:33 1999


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

- * linux/include/asm-arm/arch-ebsa285/system.h
+ * linux/include/asm-arm/arch-vnc/system.h
X *
X * Copyright (c) 1996,1997,1998 Russell King.
X * Copyright (c) 1998 Corel Computer Corp.
@@ -9,7 +9,7 @@
X #include <asm/leds.h>
X #include <asm/io.h>
X
-extern __inline__ void arch_hard_reset (void)
+extern __inline__ void arch_reset(char mode)
X {
X cli();
X
@@ -31,11 +31,7 @@
X /* set a RED LED and toggle WD_TIMER for rebooting...
X */
X outb(0xC4, 0x338);
-
- while(1);
X }
-
-#define ARCH_IDLE_OK
X
X #define arch_start_idle() leds_event(led_idle_start)
X #define arch_end_idle() leds_event(led_idle_end)
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/arch-vnc/time.h linux/include/asm-arm/arch-vnc/time.h
--- v2.2.0-pre5/linux/include/asm-arm/arch-vnc/time.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/arch-vnc/time.h Thu Jan 7 15:51:33 1999
@@ -4,20 +4,80 @@
X * Copyright (c) 1997 Corel Computer Corp.
X * Slight modifications to bring in line with ebsa285 port.
X * -- Russell King.
+ * Added LED driver (based on the ebsa285 code) - Alex Holden 28/12/98.
X */
X
+#include <linux/config.h>
X #include <linux/mc146818rtc.h>
X
+#include <asm/leds.h>
+#include <asm/system.h>
+
X #undef IRQ_TIMER
X #define IRQ_TIMER IRQ_TIMER4
X
+#define mSEC_10_from_14 ((14318180 + 100) / 200)
+
X extern __inline__ unsigned long gettimeoffset (void)
X {
- return 0;
+ int count;
+
+ static int count_p = (mSEC_10_from_14/6); /* for the first call after boot */
+ static unsigned long jiffies_p = 0;
+
+ /*
+ * cache volatile jiffies temporarily; we have IRQs turned off.
+ */
+ unsigned long jiffies_t;
+
+ /* timer count may underflow right here */
+ outb_p(0x00, 0x43); /* latch the count ASAP */
+
+ count = inb_p(0x40); /* read the latched count */
+
+ /*
+ * We do this guaranteed double memory access instead of a _p
+ * postfix in the previous port access. Wheee, hackady hack
+ */
+ jiffies_t = jiffies;
+
+ count |= inb_p(0x40) << 8;
+
+ /* Detect timer underflows. If we haven't had a timer tick since
+ the last time we were called, and time is apparently going
+ backwards, the counter must have wrapped during this routine. */
+ if ((jiffies_t == jiffies_p) && (count > count_p))
+ count -= (mSEC_10_from_14/6);
+ else
+ jiffies_p = jiffies_t;
+
+ count_p = count;
+
+ count = (((mSEC_10_from_14/6)-1) - count) * tick;
+ count = (count + (mSEC_10_from_14/6)/2) / (mSEC_10_from_14/6);
+
+ return count;
X }
X
X extern __inline__ int reset_timer (void)
X {
+#ifdef CONFIG_LEDS
+ static unsigned int count = 50;
+ static int last_pid;
+
+ if (current->pid != last_pid) {
+ last_pid = current->pid;
+ if (last_pid)
+ leds_event(led_idle_end);
+ else
+ leds_event(led_idle_start);
+ }
+
+ if (--count == 0) {
+ count = 50;
+ leds_event(led_timer);
+ }
+#endif
X return 1;
X }
X
@@ -137,8 +197,6 @@
X year += 100;
X return mktime(year, mon, day, hour, min, sec);
X }
-
-#define mSEC_10_from_14 ((14318180 + 100) / 200)
X
X /*
X * Set up timer interrupt, and return the current time in seconds.
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/atomic.h linux/include/asm-arm/atomic.h
--- v2.2.0-pre5/linux/include/asm-arm/atomic.h Wed Sep 9 14:51:12 1998
+++ linux/include/asm-arm/atomic.h Thu Jan 7 15:51:33 1999
@@ -12,16 +12,22 @@
X #ifndef __ASM_ARM_ATOMIC_H
X #define __ASM_ARM_ATOMIC_H
X
+#ifdef __SMP__
+#error SMP not supported
+#endif
+
+#include <linux/config.h>
+
+#ifdef CONFIG_ARCH_CO285
+typedef struct { volatile int counter; } atomic_t;
+#else
X typedef struct { int counter; } atomic_t;
+#endif
X
X #define ATOMIC_INIT(i) { (i) }
X
X #ifdef __KERNEL__
X #include <asm/system.h>
-
-#ifdef __SMP__
-#error SMP not supported
-#endif
X
X #define atomic_read(v) ((v)->counter)
X #define atomic_set(v,i) (((v)->counter) = (i))
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/byteorder.h linux/include/asm-arm/byteorder.h
--- v2.2.0-pre5/linux/include/asm-arm/byteorder.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/byteorder.h Thu Jan 7 15:51:33 1999
@@ -3,10 +3,14 @@
X
X #include <asm/types.h>
X
-#if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ < 80
+#if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ < 8
X
-/* Recent versions of GCC can do as well or better than this
- on their own - we shouldn't interfere. */
+/* Recent versions of GCC can open code the swaps at least as well
+ as we can write them by hand, so the "optimisations" here only
+ make sense for older compilers. Worse, some versions of GCC
+ actually go wrong in the presence of the assembler versions.
+ We play it safe and only turn them on for compilers older than
+ GCC 2.8.0. */
X
X static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
X {
@@ -35,6 +39,11 @@
X #define __arch__swab16(x) ___arch__swab16(x)
X
X #endif /* __GNUC__ */
+
+#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+# define __BYTEORDER_HAS_U64__
+# define __SWAB_64_THRU_32__
+#endif
X
X #include <linux/byteorder/little_endian.h>
X
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/dec21285.h linux/include/asm-arm/dec21285.h
--- v2.2.0-pre5/linux/include/asm-arm/dec21285.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/dec21285.h Thu Jan 7 15:51:33 1999
@@ -2,6 +2,8 @@
X * include/asm-arm/dec21285.h
X *
X * Copyright (C) 1998 Russell King
+ *
+ * DC21285 registers
X */
X #define DC21285_PCI_IACK 0x79000000
X #define DC21285_ARMCSR_BASE 0x42000000
@@ -13,109 +15,74 @@
X #define DC21285_PCI_MEM 0x80000000
X
X #ifndef __ASSEMBLY__
-
-/*
- * DEC21285
- */
-#define CSR_SA110_CNTL ((volatile unsigned long *)0xfe00013c)
-#define CSR_PCIADDR_EXTN ((volatile unsigned long *)0xfe000140)
-#define CSR_PREFETCHMEMRANGE ((volatile unsigned long *)0xfe000144)
-#define CSR_XBUS_CYCLE ((volatile unsigned long *)0xfe000148)
-#define CSR_XBUS_IOSTROBE ((volatile unsigned long *)0xfe00014c)
-#define CSR_DOORBELL_PCI ((volatile unsigned long *)0xfe000150)
-#define CSR_DOORBELL_SA110 ((volatile unsigned long *)0xfe000154)
-
-#define CSR_UARTDR ((volatile unsigned long *)0xfe000160)
-#define CSR_RXSTAT ((volatile unsigned long *)0xfe000164)
-#define CSR_H_UBRLCR ((volatile unsigned long *)0xfe000168)
-#define CSR_M_UBRLCR ((volatile unsigned long *)0xfe00016c)
-#define CSR_L_UBRLCR ((volatile unsigned long *)0xfe000170)
-#define CSR_UARTCON ((volatile unsigned long *)0xfe000174)
-#define CSR_UARTFLG ((volatile unsigned long *)0xfe000178)
-
-#define CSR_IRQ_STATUS ((volatile unsigned long *)0xfe000180)
-#define CSR_IRQ_RAWSTATUS ((volatile unsigned long *)0xfe000184)
-#define CSR_IRQ_ENABLE ((volatile unsigned long *)0xfe000188)
-#define CSR_IRQ_DISABLE ((volatile unsigned long *)0xfe00018c)
-#define CSR_IRQ_SOFT ((volatile unsigned long *)0xfe000190)
-
-#define CSR_FIQ_STATUS ((volatile unsigned long *)0xfe000280)
-#define CSR_FIQ_RAWSTATUS ((volatile unsigned long *)0xfe000284)
-#define CSR_FIQ_ENABLE ((volatile unsigned long *)0xfe000288)
-#define CSR_FIQ_DISABLE ((volatile unsigned long *)0xfe00028c)
-#define CSR_FIQ_SOFT ((volatile unsigned long *)0xfe000290)
-
-#define CSR_TIMER1_LOAD ((volatile unsigned long *)0xfe000300)
-#define CSR_TIMER1_VALUE ((volatile unsigned long *)0xfe000304)
-#define CSR_TIMER1_CNTL ((volatile unsigned long *)0xfe000308)
-#define CSR_TIMER1_CLR ((volatile unsigned long *)0xfe00030c)
-
-#define CSR_TIMER2_LOAD ((volatile unsigned long *)0xfe000320)
-#define CSR_TIMER2_VALUE ((volatile unsigned long *)0xfe000324)
-#define CSR_TIMER2_CNTL ((volatile unsigned long *)0xfe000328)
-#define CSR_TIMER2_CLR ((volatile unsigned long *)0xfe00032c)
-
-#define CSR_TIMER3_LOAD ((volatile unsigned long *)0xfe000340)
-#define CSR_TIMER3_VALUE ((volatile unsigned long *)0xfe000344)
-#define CSR_TIMER3_CNTL ((volatile unsigned long *)0xfe000348)
-#define CSR_TIMER3_CLR ((volatile unsigned long *)0xfe00034c)
-
-#define CSR_TIMER4_LOAD ((volatile unsigned long *)0xfe000360)
-#define CSR_TIMER4_VALUE ((volatile unsigned long *)0xfe000364)
-#define CSR_TIMER4_CNTL ((volatile unsigned long *)0xfe000368)
-#define CSR_TIMER4_CLR ((volatile unsigned long *)0xfe00036c)
-
+#define DC21285_IO(x) ((volatile unsigned long *)(0xfe000000+(x)))
X #else
-
-#define CSR_SA110_CNTL 0x13c
-#define CSR_PCIADDR_EXTN 0x140
-#define CSR_PREFETCHMEMRANGE 0x144
-#define CSR_XBUS_CYCLE 0x148
-#define CSR_XBUS_IOSTROBE 0x14c
-#define CSR_DOORBELL_PCI 0x150
-#define CSR_DOORBELL_SA110 0x154
-
-#define CSR_UARTDR 0x160
-#define CSR_RXSTAT 0x164
-#define CSR_H_UBRLCR 0x168
-#define CSR_M_UBRLCR 0x16c
-#define CSR_L_UBRLCR 0x170
-#define CSR_UARTCON 0x174
-#define CSR_UARTFLG 0x178
-
-#define CSR_IRQ_STATUS 0x180
-#define CSR_IRQ_RAWSTATUS 0x184
-#define CSR_IRQ_ENABLE 0x188
-#define CSR_IRQ_DISABLE 0x18c
-#define CSR_IRQ_SOFT 0x190
-
-#define CSR_FIQ_STATUS 0x280
-#define CSR_FIQ_RAWSTATUS 0x284
-#define CSR_FIQ_ENABLE 0x288
-#define CSR_FIQ_DISABLE 0x28c
-#define CSR_FIQ_SOFT 0x290
-
-#define CSR_TIMER1_LOAD 0x300
-#define CSR_TIMER1_VALUE 0x304
-#define CSR_TIMER1_CNTL 0x308
-#define CSR_TIMER1_CLR 0x30c
-
-#define CSR_TIMER2_LOAD 0x320
-#define CSR_TIMER2_VALUE 0x324
-#define CSR_TIMER2_CNTL 0x328
-#define CSR_TIMER2_CLR 0x32c
-
-#define CSR_TIMER3_LOAD 0x340
-#define CSR_TIMER3_VALUE 0x344
-#define CSR_TIMER3_CNTL 0x348
-#define CSR_TIMER3_CLR 0x34c
-
-#define CSR_TIMER4_LOAD 0x360
-#define CSR_TIMER4_VALUE 0x364
-#define CSR_TIMER4_CNTL 0x368
-#define CSR_TIMER4_CLR 0x36c
-
+#define DC21285_IO(x) (x)
X #endif
+
+#define CSR_PCICMD DC21285_IO(0x0004)
+#define CSR_PCICACHELINESIZE DC21285_IO(0x000c)
+#define CSR_PCICSRBASE DC21285_IO(0x0010)
+#define CSR_PCICSRIOBASE DC21285_IO(0x0014)
+#define CSR_PCISDRAMBASE DC21285_IO(0x0018)
+#define CSR_PCIROMBASE DC21285_IO(0x0030)
+#define CSR_CSRBASEMASK DC21285_IO(0x00f8)
+#define CSR_CSRBASEOFFSET DC21285_IO(0x00fc)
+#define CSR_SDRAMBASEMASK DC21285_IO(0x0100)
+#define CSR_SDRAMBASEOFFSET DC21285_IO(0x0104)
+#define CSR_ROMBASEMASK DC21285_IO(0x0108)
+#define CSR_SDRAMTIMING DC21285_IO(0x010c)
+#define CSR_SDRAMADDRSIZE0 DC21285_IO(0x0110)
+#define CSR_SDRAMADDRSIZE1 DC21285_IO(0x0114)
+#define CSR_SDRAMADDRSIZE2 DC21285_IO(0x0118)
+#define CSR_SDRAMADDRSIZE3 DC21285_IO(0x011c)
+#define CSR_I2O_INFREEHEAD DC21285_IO(0x0120)
+#define CSR_I2O_INPOSTTAIL DC21285_IO(0x0124)
+#define CSR_I2O_OUTPOSTHEAD DC21285_IO(0x0128)
+#define CSR_I2O_OUTFREETAIL DC21285_IO(0x012c)
+#define CSR_I2O_INFREECOUNT DC21285_IO(0x0130)
+#define CSR_I2O_OUTPOSTCOUNT DC21285_IO(0x0134)
+#define CSR_I2O_INPOSTCOUNT DC21285_IO(0x0138)
+#define CSR_SA110_CNTL DC21285_IO(0x013c)
+#define CSR_PCIADDR_EXTN DC21285_IO(0x0140)
+#define CSR_PREFETCHMEMRANGE DC21285_IO(0x0144)
+#define CSR_XBUS_CYCLE DC21285_IO(0x0148)
+#define CSR_XBUS_IOSTROBE DC21285_IO(0x014c)
+#define CSR_DOORBELL_PCI DC21285_IO(0x0150)
+#define CSR_DOORBELL_SA110 DC21285_IO(0x0154)
+#define CSR_UARTDR DC21285_IO(0x0160)
+#define CSR_RXSTAT DC21285_IO(0x0164)
+#define CSR_H_UBRLCR DC21285_IO(0x0168)
+#define CSR_M_UBRLCR DC21285_IO(0x016c)
+#define CSR_L_UBRLCR DC21285_IO(0x0170)
+#define CSR_UARTCON DC21285_IO(0x0174)
+#define CSR_UARTFLG DC21285_IO(0x0178)
+#define CSR_IRQ_STATUS DC21285_IO(0x0180)
+#define CSR_IRQ_RAWSTATUS DC21285_IO(0x0184)
+#define CSR_IRQ_ENABLE DC21285_IO(0x0188)
+#define CSR_IRQ_DISABLE DC21285_IO(0x018c)
+#define CSR_IRQ_SOFT DC21285_IO(0x0190)
+#define CSR_FIQ_STATUS DC21285_IO(0x0280)
+#define CSR_FIQ_RAWSTATUS DC21285_IO(0x0284)
+#define CSR_FIQ_ENABLE DC21285_IO(0x0288)
+#define CSR_FIQ_DISABLE DC21285_IO(0x028c)
+#define CSR_FIQ_SOFT DC21285_IO(0x0290)
+#define CSR_TIMER1_LOAD DC21285_IO(0x0300)
+#define CSR_TIMER1_VALUE DC21285_IO(0x0304)
+#define CSR_TIMER1_CNTL DC21285_IO(0x0308)
+#define CSR_TIMER1_CLR DC21285_IO(0x030c)
+#define CSR_TIMER2_LOAD DC21285_IO(0x0320)
+#define CSR_TIMER2_VALUE DC21285_IO(0x0324)
+#define CSR_TIMER2_CNTL DC21285_IO(0x0328)
+#define CSR_TIMER2_CLR DC21285_IO(0x032c)
+#define CSR_TIMER3_LOAD DC21285_IO(0x0340)
+#define CSR_TIMER3_VALUE DC21285_IO(0x0344)
+#define CSR_TIMER3_CNTL DC21285_IO(0x0348)
+#define CSR_TIMER3_CLR DC21285_IO(0x034c)
+#define CSR_TIMER4_LOAD DC21285_IO(0x0360)
+#define CSR_TIMER4_VALUE DC21285_IO(0x0364)
+#define CSR_TIMER4_CNTL DC21285_IO(0x0368)
+#define CSR_TIMER4_CLR DC21285_IO(0x036c)
X
X #define TIMER_CNTL_ENABLE (1 << 7)
X #define TIMER_CNTL_AUTORELOAD (1 << 6)
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/dma.h linux/include/asm-arm/dma.h
--- v2.2.0-pre5/linux/include/asm-arm/dma.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/dma.h Thu Jan 7 15:51:33 1999
@@ -3,10 +3,24 @@
X
X typedef unsigned int dmach_t;
X
+#include <linux/config.h>
+#include <linux/kernel.h>
X #include <asm/irq.h>
+#include <asm/system.h>
X #include <asm/spinlock.h>
X #include <asm/arch/dma.h>
X
+/*
+ * DMA modes - we have two, IN and OUT
+ */
+typedef unsigned int dmamode_t;
+
+#define DMA_MODE_MASK 1
+
+#define DMA_MODE_READ 0
+#define DMA_MODE_WRITE 1
+#define DMA_AUTOINIT 2
+
X typedef struct {
X unsigned long address;
X unsigned long length;
@@ -115,6 +129,12 @@
X
X #ifndef NO_DMA
X #define NO_DMA 255
+#endif
+
+#ifdef CONFIG_PCI_QUIRKS
+extern int isa_dma_bridge_buggy;
+#else
+#define isa_dma_bridge_buggy (0)
X #endif
X
X #endif /* _ARM_DMA_H */
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/hardware.h linux/include/asm-arm/hardware.h
--- v2.2.0-pre5/linux/include/asm-arm/hardware.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/hardware.h Thu Jan 7 15:51:33 1999
@@ -11,257 +11,8 @@
X
X #include <asm/arch/hardware.h>
X
-/*
- * Use these macros to read/write the IOC. All it does is perform the actual
- * read/write.
- */
-#ifdef HAS_IOC
-#ifndef __ASSEMBLER__
-#define __IOC(offset) (IOC_BASE + (offset >> 2))
-#else
-#define __IOC(offset) offset
-#endif
-
-#define IOC_CONTROL __IOC(0x00)
-#define IOC_KARTTX __IOC(0x04)
-#define IOC_KARTRX __IOC(0x04)
-
-#define IOC_IRQSTATA __IOC(0x10)
-#define IOC_IRQREQA __IOC(0x14)
-#define IOC_IRQCLRA __IOC(0x14)
-#define IOC_IRQMASKA __IOC(0x18)
-
-#define IOC_IRQSTATB __IOC(0x20)
-#define IOC_IRQREQB __IOC(0x24)
-#define IOC_IRQMASKB __IOC(0x28)
-
-#define IOC_FIQSTAT __IOC(0x30)
-#define IOC_FIQREQ __IOC(0x34)
-#define IOC_FIQMASK __IOC(0x38)
-
-#define IOC_T0CNTL __IOC(0x40)
-#define IOC_T0LTCHL __IOC(0x40)
-#define IOC_T0CNTH __IOC(0x44)
-#define IOC_T0LTCHH __IOC(0x44)
-#define IOC_T0GO __IOC(0x48)
-#define IOC_T0LATCH __IOC(0x4c)
-
-#define IOC_T1CNTL __IOC(0x50)
-#define IOC_T1LTCHL __IOC(0x50)
-#define IOC_T1CNTH __IOC(0x54)
-#define IOC_T1LTCHH __IOC(0x54)
-#define IOC_T1GO __IOC(0x58)
-#define IOC_T1LATCH __IOC(0x5c)
-
-#define IOC_T2CNTL __IOC(0x60)
-#define IOC_T2LTCHL __IOC(0x60)
-#define IOC_T2CNTH __IOC(0x64)
-#define IOC_T2LTCHH __IOC(0x64)
-#define IOC_T2GO __IOC(0x68)
-#define IOC_T2LATCH __IOC(0x6c)
-
-#define IOC_T3CNTL __IOC(0x70)
-#define IOC_T3LTCHL __IOC(0x70)
-#define IOC_T3CNTH __IOC(0x74)
-#define IOC_T3LTCHH __IOC(0x74)
-#define IOC_T3GO __IOC(0x78)
-#define IOC_T3LATCH __IOC(0x7c)
-#endif
-
-#ifdef HAS_MEMC
-#define VDMA_ALIGNMENT PAGE_SIZE
-#define VDMA_XFERSIZE 16
-#define VDMA_INIT 0
-#define VDMA_START 1
-#define VDMA_END 2
-
-#define video_set_dma(start,end,offset) \
-do { \
- memc_write (VDMA_START, (start >> 2)); \
- memc_write (VDMA_END, (end - VDMA_XFERSIZE) >> 2); \
- memc_write (VDMA_INIT, (offset >> 2)); \
-} while (0)
-#endif
-
-#ifdef HAS_IOMD
-#ifndef __ASSEMBLER__
-#define __IOMD(offset) (IO_IOMD_BASE + (offset >> 2))
-#else
-#define __IOMD(offset) offset
-#endif
-
-#define IOMD_CONTROL __IOMD(0x000)
-#define IOMD_KARTTX __IOMD(0x004)
-#define IOMD_KARTRX __IOMD(0x004)
-#define IOMD_KCTRL __IOMD(0x008)
-
-#define IOMD_IRQSTATA __IOMD(0x010)
-#define IOMD_IRQREQA __IOMD(0x014)
-#define IOMD_IRQCLRA __IOMD(0x014)
-#define IOMD_IRQMASKA __IOMD(0x018)
-
-#define IOMD_IRQSTATB __IOMD(0x020)
-#define IOMD_IRQREQB __IOMD(0x024)
-#define IOMD_IRQMASKB __IOMD(0x028)
-
-#define IOMD_FIQSTAT __IOMD(0x030)
-#define IOMD_FIQREQ __IOMD(0x034)
-#define IOMD_FIQMASK __IOMD(0x038)
-
-#define IOMD_T0CNTL __IOMD(0x040)
-#define IOMD_T0LTCHL __IOMD(0x040)
-#define IOMD_T0CNTH __IOMD(0x044)
-#define IOMD_T0LTCHH __IOMD(0x044)
-#define IOMD_T0GO __IOMD(0x048)
-#define IOMD_T0LATCH __IOMD(0x04c)
-
-#define IOMD_T1CNTL __IOMD(0x050)
-#define IOMD_T1LTCHL __IOMD(0x050)
-#define IOMD_T1CNTH __IOMD(0x054)
-#define IOMD_T1LTCHH __IOMD(0x054)
-#define IOMD_T1GO __IOMD(0x058)
-#define IOMD_T1LATCH __IOMD(0x05c)
-
-#define IOMD_ROMCR0 __IOMD(0x080)
-#define IOMD_ROMCR1 __IOMD(0x084)
-#define IOMD_DRAMCR __IOMD(0x088)
-#define IOMD_VREFCR __IOMD(0x08C)
-
-#define IOMD_FSIZE __IOMD(0x090)
-#define IOMD_ID0 __IOMD(0x094)
-#define IOMD_ID1 __IOMD(0x098)
-#define IOMD_VERSION __IOMD(0x09C)
-
-#define IOMD_MOUSEX __IOMD(0x0A0)
-#define IOMD_MOUSEY __IOMD(0x0A4)
-
-#define IOMD_DMATCR __IOMD(0x0C0)
-#define IOMD_IOTCR __IOMD(0x0C4)
-#define IOMD_ECTCR __IOMD(0x0C8)
-#define IOMD_DMAEXT __IOMD(0x0CC)
-
-#define DMA_EXT_IO0 1
-#define DMA_EXT_IO1 2
-#define DMA_EXT_IO2 4
-#define DMA_EXT_IO3 8
-
-#define IOMD_IO0CURA __IOMD(0x100)
-#define IOMD_IO0ENDA __IOMD(0x104)
-#define IOMD_IO0CURB __IOMD(0x108)
-#define IOMD_IO0ENDB __IOMD(0x10C)
-#define IOMD_IO0CR __IOMD(0x110)
-#define IOMD_IO0ST __IOMD(0x114)
-
-#define IOMD_IO1CURA __IOMD(0x120)
-#define IOMD_IO1ENDA __IOMD(0x124)
-#define IOMD_IO1CURB __IOMD(0x128)
-#define IOMD_IO1ENDB __IOMD(0x12C)
-#define IOMD_IO1CR __IOMD(0x130)
-#define IOMD_IO1ST __IOMD(0x134)
-
-#define IOMD_IO2CURA __IOMD(0x140)
-#define IOMD_IO2ENDA __IOMD(0x144)
-#define IOMD_IO2CURB __IOMD(0x148)
-#define IOMD_IO2ENDB __IOMD(0x14C)
-#define IOMD_IO2CR __IOMD(0x150)
-#define IOMD_IO2ST __IOMD(0x154)
-
-#define IOMD_IO3CURA __IOMD(0x160)
-#define IOMD_IO3ENDA __IOMD(0x164)
-#define IOMD_IO3CURB __IOMD(0x168)
-#define IOMD_IO3ENDB __IOMD(0x16C)
-#define IOMD_IO3CR __IOMD(0x170)
-#define IOMD_IO3ST __IOMD(0x174)
-
-#define IOMD_SD0CURA __IOMD(0x180)
-#define IOMD_SD0ENDA __IOMD(0x184)
-#define IOMD_SD0CURB __IOMD(0x188)
-#define IOMD_SD0ENDB __IOMD(0x18C)
-#define IOMD_SD0CR __IOMD(0x190)
-#define IOMD_SD0ST __IOMD(0x194)
-
-#define IOMD_SD1CURA __IOMD(0x1A0)
-#define IOMD_SD1ENDA __IOMD(0x1A4)
-#define IOMD_SD1CURB __IOMD(0x1A8)
-#define IOMD_SD1ENDB __IOMD(0x1AC)
-#define IOMD_SD1CR __IOMD(0x1B0)
-#define IOMD_SD1ST __IOMD(0x1B4)
-
-#define IOMD_CURSCUR __IOMD(0x1C0)
-#define IOMD_CURSINIT __IOMD(0x1C4)
-
-#define IOMD_VIDCUR __IOMD(0x1D0)
-#define IOMD_VIDEND __IOMD(0x1D4)
-#define IOMD_VIDSTART __IOMD(0x1D8)
-#define IOMD_VIDINIT __IOMD(0x1DC)
-#define IOMD_VIDCR __IOMD(0x1E0)
-
-#define IOMD_DMASTAT __IOMD(0x1F0)
-#define IOMD_DMAREQ __IOMD(0x1F4)
-#define IOMD_DMAMASK __IOMD(0x1F8)
-
-#define DMA_END_S (1 << 31)
-#define DMA_END_L (1 << 30)
-
-#define DMA_CR_C 0x80
-#define DMA_CR_D 0x40
-#define DMA_CR_E 0x20
-
-#define DMA_ST_OFL 4
-#define DMA_ST_INT 2
-#define DMA_ST_AB 1
-/*
- * IOC compatability
- */
-#define IOC_CONTROL IOMD_CONTROL
-#define IOC_IRQSTATA IOMD_IRQSTATA
-#define IOC_IRQREQA IOMD_IRQREQA
-#define IOC_IRQCLRA IOMD_IRQCLRA
-#define IOC_IRQMASKA IOMD_IRQMASKA
-
-#define IOC_IRQSTATB IOMD_IRQSTATB
-#define IOC_IRQREQB IOMD_IRQREQB
-#define IOC_IRQMASKB IOMD_IRQMASKB
-
-#define IOC_FIQSTAT IOMD_FIQSTAT
-#define IOC_FIQREQ IOMD_FIQREQ
-#define IOC_FIQMASK IOMD_FIQMASK
-
-#define IOC_T0CNTL IOMD_T0CNTL
-#define IOC_T0LTCHL IOMD_T0LTCHL
-#define IOC_T0CNTH IOMD_T0CNTH
-#define IOC_T0LTCHH IOMD_T0LTCHH
-#define IOC_T0GO IOMD_T0GO
-#define IOC_T0LATCH IOMD_T0LATCH
-
-#define IOC_T1CNTL IOMD_T1CNTL
-#define IOC_T1LTCHL IOMD_T1LTCHL
-#define IOC_T1CNTH IOMD_T1CNTH
-#define IOC_T1LTCHH IOMD_T1LTCHH
-#define IOC_T1GO IOMD_T1GO
-#define IOC_T1LATCH IOMD_T1LATCH
-
-/*
- * DMA (MEMC) compatability
- */
-#define HALF_SAM vram_half_sam
-#define VDMA_ALIGNMENT (HALF_SAM * 2)
-#define VDMA_XFERSIZE (HALF_SAM)
-#define VDMA_INIT IOMD_VIDINIT
-#define VDMA_START IOMD_VIDSTART
-#define VDMA_END IOMD_VIDEND
-
-#ifndef __ASSEMBLER__
-extern unsigned int vram_half_sam;
-#define video_set_dma(start,end,offset) \
-do { \
- outl (SCREEN_START + start, VDMA_START); \
- outl (SCREEN_START + end - VDMA_XFERSIZE, VDMA_END); \
- if (offset >= end - VDMA_XFERSIZE) \
- offset |= 0x40000000; \
- outl (SCREEN_START + offset, VDMA_INIT); \
-} while (0)
-#endif
+#ifndef FLUSH_BASE
+#define FLUSH_BASE 0xdf000000
X #endif
X
X #ifdef HAS_EXPMASK
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/init.h linux/include/asm-arm/init.h
--- v2.2.0-pre5/linux/include/asm-arm/init.h Tue Jul 21 00:15:32 1998
+++ linux/include/asm-arm/init.h Thu Jan 7 15:51:33 1999
@@ -5,7 +5,7 @@
X
X /* C routines */
X
-#ifdef CONFIG_BINUTILS_NEW
+#ifdef CONFIG_TEXT_INIT_SECTION
X
X #define __init __attribute__ ((__section__ (".text.init")))
X #define __initfunc(__arginit) \
@@ -25,5 +25,8 @@
X #define __INIT .section ".text.init",@alloc,@execinstr
X #define __INITDATA .section ".data.init",@alloc,@write
X #define __FINIT .previous
+
+#define __cacheline_aligned __attribute__ \
+ ((__aligned__ (L1_CACHE_BYTES)))
X
X #endif
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/io.h linux/include/asm-arm/io.h
--- v2.2.0-pre5/linux/include/asm-arm/io.h Wed Sep 9 14:51:12 1998
+++ linux/include/asm-arm/io.h Thu Jan 7 15:51:33 1999
@@ -31,7 +31,7 @@
X * to an address that the kernel can use.
X */
X #define virt_to_bus(x) (__virt_to_bus((unsigned long)(x)))
-#define bus_to_virt(x) ((void *)(__bus_to_virt(x)))
+#define bus_to_virt(x) ((void *)(__bus_to_virt((unsigned long)(x))))
X
X /*
X * These macros actually build the multi-value IO function prototypes
@@ -172,6 +172,8 @@
X #undef ARCH_IO_CONSTANT
X
X #ifdef __KERNEL__
+
+extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
X
X /*
X * String version of IO memory access ops:
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/ioc.h linux/include/asm-arm/ioc.h
--- v2.2.0-pre5/linux/include/asm-arm/ioc.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/ioc.h Thu Jan 7 15:51:33 1999


@@ -0,0 +1,56 @@
+/*

+ * Use these macros to read/write the IOC. All it does is perform the actual
+ * read/write.
+ */
+
+#ifndef __ASSEMBLER__
+#define __IOC(offset) (IOC_BASE + (offset >> 2))
+#else
+#define __IOC(offset) offset
+#endif
+
+#define IOC_CONTROL __IOC(0x00)
+#define IOC_KARTTX __IOC(0x04)
+#define IOC_KARTRX __IOC(0x04)
+
+#define IOC_IRQSTATA __IOC(0x10)
+#define IOC_IRQREQA __IOC(0x14)
+#define IOC_IRQCLRA __IOC(0x14)
+#define IOC_IRQMASKA __IOC(0x18)
+
+#define IOC_IRQSTATB __IOC(0x20)
+#define IOC_IRQREQB __IOC(0x24)
+#define IOC_IRQMASKB __IOC(0x28)
+
+#define IOC_FIQSTAT __IOC(0x30)
+#define IOC_FIQREQ __IOC(0x34)
+#define IOC_FIQMASK __IOC(0x38)
+
+#define IOC_T0CNTL __IOC(0x40)
+#define IOC_T0LTCHL __IOC(0x40)
+#define IOC_T0CNTH __IOC(0x44)
+#define IOC_T0LTCHH __IOC(0x44)
+#define IOC_T0GO __IOC(0x48)
+#define IOC_T0LATCH __IOC(0x4c)
+
+#define IOC_T1CNTL __IOC(0x50)
+#define IOC_T1LTCHL __IOC(0x50)
+#define IOC_T1CNTH __IOC(0x54)
+#define IOC_T1LTCHH __IOC(0x54)
+#define IOC_T1GO __IOC(0x58)
+#define IOC_T1LATCH __IOC(0x5c)
+
+#define IOC_T2CNTL __IOC(0x60)
+#define IOC_T2LTCHL __IOC(0x60)
+#define IOC_T2CNTH __IOC(0x64)
+#define IOC_T2LTCHH __IOC(0x64)
+#define IOC_T2GO __IOC(0x68)
+#define IOC_T2LATCH __IOC(0x6c)
+
+#define IOC_T3CNTL __IOC(0x70)
+#define IOC_T3LTCHL __IOC(0x70)
+#define IOC_T3CNTH __IOC(0x74)
+#define IOC_T3LTCHH __IOC(0x74)
+#define IOC_T3GO __IOC(0x78)
+#define IOC_T3LATCH __IOC(0x7c)
+
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/iomd.h linux/include/asm-arm/iomd.h
--- v2.2.0-pre5/linux/include/asm-arm/iomd.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/iomd.h Thu Jan 7 15:51:33 1999
@@ -0,0 +1,180 @@
+
+#ifndef __ASSEMBLER__
+#define __IOMD(offset) (IO_IOMD_BASE + (offset >> 2))
+#else
+#define __IOMD(offset) offset
+#endif
+
+#define IOMD_CONTROL __IOMD(0x000)
+#define IOMD_KARTTX __IOMD(0x004)
+#define IOMD_KARTRX __IOMD(0x004)
+#define IOMD_KCTRL __IOMD(0x008)
+
+#define IOMD_IRQSTATA __IOMD(0x010)
+#define IOMD_IRQREQA __IOMD(0x014)
+#define IOMD_IRQCLRA __IOMD(0x014)
+#define IOMD_IRQMASKA __IOMD(0x018)
+
+#define IOMD_IRQSTATB __IOMD(0x020)
+#define IOMD_IRQREQB __IOMD(0x024)
+#define IOMD_IRQMASKB __IOMD(0x028)
+
+#define IOMD_FIQSTAT __IOMD(0x030)
+#define IOMD_FIQREQ __IOMD(0x034)
+#define IOMD_FIQMASK __IOMD(0x038)
+
+#define IOMD_T0CNTL __IOMD(0x040)
+#define IOMD_T0LTCHL __IOMD(0x040)
+#define IOMD_T0CNTH __IOMD(0x044)
+#define IOMD_T0LTCHH __IOMD(0x044)
+#define IOMD_T0GO __IOMD(0x048)
+#define IOMD_T0LATCH __IOMD(0x04c)
+
+#define IOMD_T1CNTL __IOMD(0x050)
+#define IOMD_T1LTCHL __IOMD(0x050)
+#define IOMD_T1CNTH __IOMD(0x054)
+#define IOMD_T1LTCHH __IOMD(0x054)
+#define IOMD_T1GO __IOMD(0x058)
+#define IOMD_T1LATCH __IOMD(0x05c)
+
+#define IOMD_ROMCR0 __IOMD(0x080)
+#define IOMD_ROMCR1 __IOMD(0x084)
+#define IOMD_DRAMCR __IOMD(0x088)
+#define IOMD_VREFCR __IOMD(0x08C)
+
+#define IOMD_FSIZE __IOMD(0x090)
+#define IOMD_ID0 __IOMD(0x094)
+#define IOMD_ID1 __IOMD(0x098)
+#define IOMD_VERSION __IOMD(0x09C)
+
+#define IOMD_MOUSEX __IOMD(0x0A0)
+#define IOMD_MOUSEY __IOMD(0x0A4)
+
+#define IOMD_DMATCR __IOMD(0x0C0)
+#define IOMD_IOTCR __IOMD(0x0C4)
+#define IOMD_ECTCR __IOMD(0x0C8)
+#define IOMD_DMAEXT __IOMD(0x0CC)
+
+#define DMA_EXT_IO0 1
+#define DMA_EXT_IO1 2
+#define DMA_EXT_IO2 4
+#define DMA_EXT_IO3 8
+
+#define IOMD_IO0CURA __IOMD(0x100)
+#define IOMD_IO0ENDA __IOMD(0x104)
+#define IOMD_IO0CURB __IOMD(0x108)
+#define IOMD_IO0ENDB __IOMD(0x10C)
+#define IOMD_IO0CR __IOMD(0x110)
+#define IOMD_IO0ST __IOMD(0x114)
+
+#define IOMD_IO1CURA __IOMD(0x120)
+#define IOMD_IO1ENDA __IOMD(0x124)
+#define IOMD_IO1CURB __IOMD(0x128)
+#define IOMD_IO1ENDB __IOMD(0x12C)
+#define IOMD_IO1CR __IOMD(0x130)
+#define IOMD_IO1ST __IOMD(0x134)
+
+#define IOMD_IO2CURA __IOMD(0x140)
+#define IOMD_IO2ENDA __IOMD(0x144)
+#define IOMD_IO2CURB __IOMD(0x148)
+#define IOMD_IO2ENDB __IOMD(0x14C)
+#define IOMD_IO2CR __IOMD(0x150)
+#define IOMD_IO2ST __IOMD(0x154)
+
+#define IOMD_IO3CURA __IOMD(0x160)
+#define IOMD_IO3ENDA __IOMD(0x164)
+#define IOMD_IO3CURB __IOMD(0x168)
+#define IOMD_IO3ENDB __IOMD(0x16C)
+#define IOMD_IO3CR __IOMD(0x170)
+#define IOMD_IO3ST __IOMD(0x174)
+
+#define IOMD_SD0CURA __IOMD(0x180)
+#define IOMD_SD0ENDA __IOMD(0x184)
+#define IOMD_SD0CURB __IOMD(0x188)
+#define IOMD_SD0ENDB __IOMD(0x18C)
+#define IOMD_SD0CR __IOMD(0x190)
+#define IOMD_SD0ST __IOMD(0x194)
+
+#define IOMD_SD1CURA __IOMD(0x1A0)
+#define IOMD_SD1ENDA __IOMD(0x1A4)
+#define IOMD_SD1CURB __IOMD(0x1A8)
+#define IOMD_SD1ENDB __IOMD(0x1AC)
+#define IOMD_SD1CR __IOMD(0x1B0)
+#define IOMD_SD1ST __IOMD(0x1B4)
+
+#define IOMD_CURSCUR __IOMD(0x1C0)
+#define IOMD_CURSINIT __IOMD(0x1C4)
+
+#define IOMD_VIDCUR __IOMD(0x1D0)
+#define IOMD_VIDEND __IOMD(0x1D4)
+#define IOMD_VIDSTART __IOMD(0x1D8)
+#define IOMD_VIDINIT __IOMD(0x1DC)
+#define IOMD_VIDCR __IOMD(0x1E0)
+
+#define IOMD_DMASTAT __IOMD(0x1F0)
+#define IOMD_DMAREQ __IOMD(0x1F4)
+#define IOMD_DMAMASK __IOMD(0x1F8)
+
+#define DMA_END_S (1 << 31)
+#define DMA_END_L (1 << 30)
+
+#define DMA_CR_C 0x80
+#define DMA_CR_D 0x40
+#define DMA_CR_E 0x20
+
+#define DMA_ST_OFL 4
+#define DMA_ST_INT 2
+#define DMA_ST_AB 1
+/*
+ * IOC compatability
+ */
+#define IOC_CONTROL IOMD_CONTROL
+#define IOC_IRQSTATA IOMD_IRQSTATA
+#define IOC_IRQREQA IOMD_IRQREQA
+#define IOC_IRQCLRA IOMD_IRQCLRA
+#define IOC_IRQMASKA IOMD_IRQMASKA
+
+#define IOC_IRQSTATB IOMD_IRQSTATB
+#define IOC_IRQREQB IOMD_IRQREQB
+#define IOC_IRQMASKB IOMD_IRQMASKB
+
+#define IOC_FIQSTAT IOMD_FIQSTAT
+#define IOC_FIQREQ IOMD_FIQREQ
+#define IOC_FIQMASK IOMD_FIQMASK
+
+#define IOC_T0CNTL IOMD_T0CNTL
+#define IOC_T0LTCHL IOMD_T0LTCHL
+#define IOC_T0CNTH IOMD_T0CNTH
+#define IOC_T0LTCHH IOMD_T0LTCHH
+#define IOC_T0GO IOMD_T0GO
+#define IOC_T0LATCH IOMD_T0LATCH
+
+#define IOC_T1CNTL IOMD_T1CNTL
+#define IOC_T1LTCHL IOMD_T1LTCHL
+#define IOC_T1CNTH IOMD_T1CNTH
+#define IOC_T1LTCHH IOMD_T1LTCHH
+#define IOC_T1GO IOMD_T1GO
+#define IOC_T1LATCH IOMD_T1LATCH
+
+/*
+ * DMA (MEMC) compatability
+ */
+#define HALF_SAM vram_half_sam
+#define VDMA_ALIGNMENT (HALF_SAM * 2)
+#define VDMA_XFERSIZE (HALF_SAM)
+#define VDMA_INIT IOMD_VIDINIT
+#define VDMA_START IOMD_VIDSTART
+#define VDMA_END IOMD_VIDEND
+
+#ifndef __ASSEMBLER__
+extern unsigned int vram_half_sam;
+#define video_set_dma(start,end,offset) \
+do { \
+ outl (SCREEN_START + start, VDMA_START); \
+ outl (SCREEN_START + end - VDMA_XFERSIZE, VDMA_END); \
+ if (offset >= end - VDMA_XFERSIZE) \
+ offset |= 0x40000000; \
+ outl (SCREEN_START + offset, VDMA_INIT); \
+} while (0)
+#endif
+
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/leds.h linux/include/asm-arm/leds.h
--- v2.2.0-pre5/linux/include/asm-arm/leds.h Tue Apr 14 14:29:25 1998
+++ linux/include/asm-arm/leds.h Thu Jan 7 15:51:33 1999
@@ -4,6 +4,8 @@
X * Copyright (C) 1998 Russell King
X *
X * Event-driven interface for LEDs on machines
+ *
+ * Added led_start and led_stop- Alex Holden, 28th Dec 1998.
X */
X #ifndef ASM_ARM_LEDS_H
X #define ASM_ARM_LEDS_H
@@ -11,7 +13,9 @@
X typedef enum {
X led_idle_start,
X led_idle_end,
- led_timer
+ led_timer,
+ led_start,
+ led_stop
X } led_event_t;
X
X /* Use this routine to handle LEDs */
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/memc.h linux/include/asm-arm/memc.h
--- v2.2.0-pre5/linux/include/asm-arm/memc.h Wed Dec 31 16:00:00 1969
+++ linux/include/asm-arm/memc.h Thu Jan 7 15:51:33 1999
@@ -0,0 +1,13 @@
+#define VDMA_ALIGNMENT PAGE_SIZE
+#define VDMA_XFERSIZE 16
+#define VDMA_INIT 0
+#define VDMA_START 1
+#define VDMA_END 2
+
+#define video_set_dma(start,end,offset) \
+do { \
+ memc_write (VDMA_START, (start >> 2)); \
+ memc_write (VDMA_END, (end - VDMA_XFERSIZE) >> 2); \
+ memc_write (VDMA_INIT, (offset >> 2)); \
+} while (0)
+
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/proc-armo/pgtable.h linux/include/asm-arm/proc-armo/pgtable.h
--- v2.2.0-pre5/linux/include/asm-arm/proc-armo/pgtable.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/proc-armo/pgtable.h Thu Jan 7 15:51:33 1999
@@ -94,10 +94,6 @@
X
X #define __flush_entry_to_ram(entry)
X
-/* Certain architectures need to do special things when pte's
- * within a page table are directly modified. Thus, the following
- * hook is made available.
- */
X /* PMD_SHIFT determines the size of the area a second-level page table can map */
X #define PMD_SHIFT 20
X #define PMD_SIZE (1UL << PMD_SHIFT)
@@ -273,6 +269,10 @@
X return pte;
X }
X
+/* Certain architectures need to do special things when pte's
+ * within a page table are directly modified. Thus, the following
+ * hook is made available.
+ */
X #define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))
X
X extern __inline__ unsigned long pte_page(pte_t pte)
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/proc-armo/system.h linux/include/asm-arm/proc-armo/system.h
--- v2.2.0-pre5/linux/include/asm-arm/proc-armo/system.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/proc-armo/system.h Thu Jan 7 15:51:33 1999
@@ -40,74 +40,74 @@
X /*
X * Save the current interrupt enable state & disable IRQs
X */
-#define __save_flags_cli(x) \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
-" mov %0, pc\n" \
-" orr %1, %0, #0x08000000\n" \
-" and %0, %0, #0x0c000000\n" \
-" teqp %1, #0\n" \
- : "=r" (x), "=r" (temp) \
- : \
- : "memory"); \
+#define __save_flags_cli(x) \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc @ save_flags_cli\n" \
+" orr %1, %0, #0x08000000\n" \
+" and %0, %0, #0x0c000000\n" \
+" teqp %1, #0\n" \
+ : "=r" (x), "=r" (temp) \
+ : \
+ : "memory"); \
X } while (0)
X
X /*
X * Enable IRQs
X */
-#define __sti() \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
-" mov %0, pc\n" \
-" bic %0, %0, #0x08000000\n" \
-" teqp %0, #0\n" \
- : "=r" (temp) \
- : \
- : "memory"); \
+#define __sti() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc @ sti\n" \
+" bic %0, %0, #0x08000000\n" \
+" teqp %0, #0\n" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
X } while(0)
X
X /*
X * Disable IRQs
X */
-#define __cli() \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
-" mov %0, pc\n" \
-" orr %0, %0, #0x08000000\n" \
-" teqp %0, #0\n" \
- : "=r" (temp) \
- : \
- : "memory"); \
+#define __cli() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc @ cli\n" \
+" orr %0, %0, #0x08000000\n" \
+" teqp %0, #0\n" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
X } while(0)
X
X /*
X * save current IRQ & FIQ state
X */
-#define __save_flags(x) \
- do { \
- __asm__ __volatile__( \
-" mov %0, pc\n" \
-" and %0, %0, #0x0c000000\n" \
- : "=r" (x)); \
+#define __save_flags(x) \
+ do { \
+ __asm__ __volatile__( \
+" mov %0, pc @ save_flags\n" \
+" and %0, %0, #0x0c000000\n" \
+ : "=r" (x)); \
X } while (0)
X
X /*
X * restore saved IRQ & FIQ state
X */
-#define __restore_flags(x) \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
-" mov %0, pc\n" \
-" bic %0, %0, #0x0c000000\n" \
-" orr %0, %0, %1\n" \
-" teqp %0, #0\n" \
- : "=r" (temp) \
- : "r" (x) \
- : "memory"); \
+#define __restore_flags(x) \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc @ restore_flags\n" \
+" bic %0, %0, #0x0c000000\n" \
+" orr %0, %0, %1\n" \
+" teqp %0, #0\n" \
+ : "=r" (temp) \
+ : "r" (x) \
+ : "memory"); \
X } while (0)
X
X #ifdef __SMP__
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/proc-armv/mm-init.h linux/include/asm-arm/proc-armv/mm-init.h
--- v2.2.0-pre5/linux/include/asm-arm/proc-armv/mm-init.h Tue Jul 21 00:15:32 1998
+++ linux/include/asm-arm/proc-armv/mm-init.h Thu Jan 7 15:51:33 1999
@@ -136,7 +136,7 @@
X /*
X * An area to invalidate the cache
X */
- alloc_init_section(&start_mem, 0xdf000000, SAFE_ADDR, DOMAIN_KERNEL,
+ alloc_init_section(&start_mem, FLUSH_BASE, FLUSH_BASE_PHYS, DOMAIN_KERNEL,
X PMD_SECT_CACHEABLE | PMD_SECT_AP_READ);
X
X /*
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/proc-armv/page.h linux/include/asm-arm/proc-armv/page.h
--- v2.2.0-pre5/linux/include/asm-arm/proc-armv/page.h Tue Jan 20 16:39:43 1998
+++ linux/include/asm-arm/proc-armv/page.h Thu Jan 7 15:51:33 1999
@@ -7,6 +7,8 @@
X #ifndef __ASM_PROC_PAGE_H
X #define __ASM_PROC_PAGE_H
X
+#include <asm/hardware.h>
+
X /* PAGE_SHIFT determines the page size */
X #define PAGE_SHIFT 12
X #define PAGE_SIZE (1UL << PAGE_SHIFT)
@@ -60,7 +62,10 @@
X #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
X
X /* This handles the memory map.. */
+#ifndef PAGE_OFFSET
X #define PAGE_OFFSET 0xc0000000
+#endif
+
X #define MAP_NR(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> PAGE_SHIFT)
X
X #endif /* __KERNEL__ */
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/proc-armv/semaphore.h linux/include/asm-arm/proc-armv/semaphore.h
--- v2.2.0-pre5/linux/include/asm-arm/proc-armv/semaphore.h Tue Jan 20 16:39:43 1998
+++ linux/include/asm-arm/proc-armv/semaphore.h Thu Jan 7 15:51:33 1999
@@ -10,20 +10,24 @@
X */
X extern inline void down(struct semaphore * sem)
X {
+ unsigned int cpsr, temp;
+
X __asm__ __volatile__ ("
X @ atomic down operation
- mrs r0, cpsr
- orr r1, r0, #128 @ disable IRQs
- bic r0, r0, #0x80000000 @ clear N
- msr cpsr, r1
- ldr r1, [%0]
- subs r1, r1, #1
- str r1, [%0]
- orrmi r0, r0, #0x80000000 @ set N
- msr cpsr, r0
- movmi r0, %0
- blmi " SYMBOL_NAME_STR(__down)
- : : "r" (sem) : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
+ mrs %0, cpsr
+ orr %1, %0, #128 @ disable IRQs
+ bic %0, %0, #0x80000000 @ clear N
+ msr cpsr, %1
+ ldr %1, [%2]
+ subs %1, %1, #1
+ orrmi %0, %0, #0x80000000 @ set N
+ str %1, [%2]
+ msr cpsr, %0
+ movmi r0, %2
+ blmi " SYMBOL_NAME_STR(__down_failed)
+ : "=&r" (cpsr), "=&r" (temp)
+ : "r" (sem)
+ : "r0", "lr", "cc");
X }
X
X /*
@@ -32,26 +36,28 @@
X */
X extern inline int down_interruptible (struct semaphore * sem)
X {
- int result;
+ unsigned int cpsr, temp;
+
X __asm__ __volatile__ ("
- @ atomic down operation
- mrs r0, cpsr
- orr r1, r0, #128 @ disable IRQs
- bic r0, r0, #0x80000000 @ clear N
- msr cpsr, r1
- ldr r1, [%1]
- subs r1, r1, #1
- str r1, [%1]
- orrmi r0, r0, #0x80000000 @ set N
- msr cpsr, r0
- movmi r0, %1
+ @ atomic down interruptible operation
+ mrs %0, cpsr
+ orr %1, %0, #128 @ disable IRQs
+ bic %0, %0, #0x80000000 @ clear N
+ msr cpsr, %1
+ ldr %1, [%2]
+ subs %1, %1, #1
+ orrmi %0, %0, #0x80000000 @ set N
+ str %1, [%2]
+ msr cpsr, %0
+ movmi r0, %2
X movpl r0, #0
- blmi " SYMBOL_NAME_STR(__down_interruptible) "
- mov %0, r0"
- : "=r" (result)
+ blmi " SYMBOL_NAME_STR(__down_interruptible_failed) "
+ mov %1, r0"
+ : "=&r" (cpsr), "=&r" (temp)
X : "r" (sem)
- : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
- return result;
+ : "r0", "lr", "cc");
+
+ return temp;
X }
X
X /*
@@ -62,20 +68,24 @@
X */
X extern inline void up(struct semaphore * sem)
X {
+ unsigned int cpsr, temp;
+
X __asm__ __volatile__ ("
X @ atomic up operation
- mrs r0, cpsr
- orr r1, r0, #128 @ disable IRQs
- bic r0, r0, #0x80000000 @ clear N
- msr cpsr, r1
- ldr r1, [%0]
- adds r1, r1, #1
- str r1, [%0]
- orrls r0, r0, #0x80000000 @ set N
- msr cpsr, r0
- movmi r0, %0
- blmi " SYMBOL_NAME_STR(__up)
- : : "r" (sem) : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
+ mrs %0, cpsr
+ orr %1, %0, #128 @ disable IRQs
+ bic %0, %0, #0x80000000 @ clear N
+ msr cpsr, %1
+ ldr %1, [%2]
+ adds %1, %1, #1
+ orrls %0, %0, #0x80000000 @ set N
+ str %1, [%2]
+ msr cpsr, %0
+ movmi r0, %2
+ blmi " SYMBOL_NAME_STR(__up_wakeup)
+ : "=&r" (cpsr), "=&r" (temp)
+ : "r" (sem)
+ : "r0", "lr", "cc");
X }
X
X #endif
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/proc-armv/system.h linux/include/asm-arm/proc-armv/system.h
--- v2.2.0-pre5/linux/include/asm-arm/proc-armv/system.h Tue Apr 14 14:29:25 1998
+++ linux/include/asm-arm/proc-armv/system.h Thu Jan 7 15:51:33 1999
@@ -22,22 +22,24 @@
X return x;
X }
X
-/*
- * This processor does not need anything special before reset,
- * but RPC may do...
- */
-extern __inline__ void proc_hard_reset(void)
-{
-}
+#define set_cr(x) \
+ do { \
+ __asm__ __volatile__( \
+ "mcr p15, 0, %0, c1, c0 @ set CR" \
+ : : "r" (x)); \
+ } while (0)
+
+extern unsigned long cr_no_alignment; /* defined in entry-armv.S */
+extern unsigned long cr_alignment; /* defined in entry-armv.S */
X
X /*
X * We can wait for an interrupt...
X */
-#define proc_idle() \
- do { \
- __asm__ __volatile__( \
-" mcr p15, 0, %0, c15, c8, 2" \
- : : "r" (0)); \
+#define proc_idle() \
+ do { \
+ __asm__ __volatile__( \
+" mcr p15, 0, %0, c15, c8, 2 @ proc_idle" \
+ : : "r" (0)); \
X } while (0)
X
X /*
@@ -47,75 +49,75 @@
X /*
X * Save the current interrupt enable state & disable IRQs
X */
-#define __save_flags_cli(x) \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
- "mrs %1, cpsr\n" \
-" and %0, %1, #192\n" \
-" orr %1, %1, #128\n" \
-" msr cpsr, %1" \
- : "=r" (x), "=r" (temp) \
- : \
- : "memory"); \
+#define __save_flags_cli(x) \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "mrs %1, cpsr @ save_flags_cli\n" \
+" and %0, %1, #192\n" \
+" orr %1, %1, #128\n" \
+" msr cpsr, %1" \
+ : "=r" (x), "=r" (temp) \
+ : \
+ : "memory"); \
X } while (0)
X
X /*
X * Enable IRQs
X */
-#define __sti() \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
- "mrs %0, cpsr\n" \
-" bic %0, %0, #128\n" \
-" msr cpsr, %0" \
- : "=r" (temp) \
- : \
- : "memory"); \
+#define __sti() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr @ sti\n" \
+" bic %0, %0, #128\n" \
+" msr cpsr, %0" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
X } while(0)
X
X /*
X * Disable IRQs
X */
-#define __cli() \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
- "mrs %0, cpsr\n" \
-" orr %0, %0, #128\n" \
-" msr cpsr, %0" \
- : "=r" (temp) \
- : \
- : "memory"); \
+#define __cli() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr @ cli\n" \
+" orr %0, %0, #128\n" \
+" msr cpsr, %0" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
X } while(0)
X
X /*
X * save current IRQ & FIQ state
X */
-#define __save_flags(x) \
- do { \
- __asm__ __volatile__( \
- "mrs %0, cpsr\n" \
-" and %0, %0, #192" \
- : "=r" (x) \
- : \
- : "memory"); \
+#define __save_flags(x) \
+ do { \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr @ save_flags\n" \
+" and %0, %0, #192" \
+ : "=r" (x) \
+ : \
+ : "memory"); \
X } while (0)
X
X /*
X * restore saved IRQ & FIQ state
X */
-#define __restore_flags(x) \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
- "mrs %0, cpsr\n" \
-" bic %0, %0, #192\n" \
-" orr %0, %0, %1\n" \
-" msr cpsr, %0" \
- : "=r" (temp) \
- : "r" (x) \
+#define __restore_flags(x) \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr @ restore_flags\n" \
+" bic %0, %0, #192\n" \
+" orr %0, %0, %1\n" \
+" msr cpsr, %0" \
+ : "=r" (temp) \
+ : "r" (x) \
X : "memory"); \
X } while (0)
X
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/proc-armv/uaccess.h linux/include/asm-arm/proc-armv/uaccess.h
--- v2.2.0-pre5/linux/include/asm-arm/proc-armv/uaccess.h Tue Dec 22 14:16:58 1998


SHAR_EOF
true || echo 'restore of patch-2.2.0-pre6 failed'
fi

echo 'End of part 7'
echo 'File patch-2.2.0-pre6 is continued in part 8'
echo 8 > _shar_seq_.tmp
exit 0

Thomas...@ciw.uni-karlsruhe.de

unread,
Jan 10, 1999, 3:00:00 AM1/10/99
to
Archive-name: v2.1/patch-2.2.0-pre6/part8

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


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

if test "$Scheck" != 8; 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.2.0-pre6'
else
echo 'x - continuing with patch-2.2.0-pre6'
sed 's/^X//' << 'SHAR_EOF' >> 'patch-2.2.0-pre6' &&

+++ linux/include/asm-arm/proc-armv/uaccess.h Thu Jan 7 15:51:33 1999
@@ -55,7 +55,7 @@
X /* We use 33-bit arithmetic here... */
X #define __range_ok(addr,size) ({ \
X unsigned long flag, sum; \
- __asm__ __volatile__("adds %1, %2, %3; sbccs %1, %1, %0; movcc %0, #0" \
+ __asm__ __volatile__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \
X : "=&r" (flag), "=&r" (sum) \
X : "r" (addr), "Ir" (size), "0" (current->addr_limit) \
X : "cc"); \
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/semaphore.h linux/include/asm-arm/semaphore.h
--- v2.2.0-pre5/linux/include/asm-arm/semaphore.h Tue Jan 20 16:39:43 1998
+++ linux/include/asm-arm/semaphore.h Thu Jan 7 15:51:33 1999
@@ -18,10 +18,11 @@
X #define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), 0, NULL })
X
X asmlinkage void __down_failed (void /* special register calling convention */);
-asmlinkage int __down_failed_interruptible (void /* special register calling convention */);
+asmlinkage int __down_interruptible_failed (void /* special register calling convention */);
X asmlinkage void __up_wakeup (void /* special register calling convention */);
X
X extern void __down(struct semaphore * sem);
+extern int __down_interruptible(struct semaphore * sem);
X extern void __up(struct semaphore * sem);
X
X #define sema_init(sem, val) atomic_set(&((sem)->count), (val))
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/signal.h linux/include/asm-arm/signal.h
--- v2.2.0-pre5/linux/include/asm-arm/signal.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/signal.h Thu Jan 7 15:51:33 1999
@@ -21,7 +21,7 @@
X } sigset_t;
X
X #else
-/* Here we must cater to lics that poke about in kernel headers. */
+/* Here we must cater to libcs that poke about in kernel headers. */
X
X #define NSIG 32
X typedef unsigned long sigset_t;
@@ -69,6 +69,8 @@
X #define SIGRTMIN 32
X #define SIGRTMAX (_NSIG-1)
X
+#define SIGSWI 32
+
X /*
X * SA_FLAGS values:
X *
@@ -96,6 +98,8 @@
X #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
X
X #define SA_RESTORER 0x04000000
+#define SA_THIRTYTWO 0x02000000 /* deliver signal in 32-bit mode even if
+ task is running 26 bits. */
X
X /*
X * sigaltstack controls
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/softirq.h linux/include/asm-arm/softirq.h
--- v2.2.0-pre5/linux/include/asm-arm/softirq.h Tue Apr 14 14:29:25 1998
+++ linux/include/asm-arm/softirq.h Thu Jan 7 15:51:33 1999
@@ -13,7 +13,7 @@
X extern inline void init_bh(int nr, void (*routine)(void))
X {
X bh_base[nr] = routine;
- bh_mask_count[nr] = 0;
+ atomic_set(&bh_mask_count[nr], 0);
X bh_mask |= 1 << nr;
X }
X
@@ -58,13 +58,13 @@
X extern inline void disable_bh(int nr)
X {
X bh_mask &= ~(1 << nr);
- bh_mask_count[nr]++;
+ atomic_inc(&bh_mask_count[nr]);
X synchronize_bh();
X }
X
X extern inline void enable_bh(int nr)
X {
- if (!--bh_mask_count[nr])
+ if (atomic_dec_and_test(&bh_mask_count[nr]))
X bh_mask |= 1 << nr;
X }
X
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/spinlock.h linux/include/asm-arm/spinlock.h
--- v2.2.0-pre5/linux/include/asm-arm/spinlock.h Tue Dec 22 14:16:58 1998
+++ linux/include/asm-arm/spinlock.h Thu Jan 7 15:51:33 1999
@@ -4,11 +4,19 @@
X #ifndef __SMP__
X
X /*
+ * To be safe, we assume the only compiler that can cope with
+ * empty initialisers is EGCS.
+ */
+#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 90))
+#define EMPTY_INIT_OK
+#endif
+
+/*
X * Your basic spinlocks, allowing only a single CPU anywhere
X */
-#if (__GNUC__ > 2) || (__GNUC_MINOR__ >= 8)
+#ifdef EMPTY_INIT_OK
X typedef struct { } spinlock_t;
-# define SPIN_LOCK_UNLOCKED { }
+# define SPIN_LOCK_UNLOCKED (spinlock_t) { }
X #else
X typedef unsigned char spinlock_t;
X # define SPIN_LOCK_UNLOCKED 0
@@ -37,9 +45,9 @@
X * irq-safe write-lock, but readers can get non-irqsafe
X * read-locks.
X */
-#if (__GNUC__ > 2) || (__GNUC_MINOR__ >= 8)
+#ifdef EMPTY_INIT_OK
X typedef struct { } rwlock_t;
-# define RW_LOCK_UNLOCKED { }
+# define RW_LOCK_UNLOCKED (rwlock_t) { }
X #else
X typedef unsigned char rwlock_t;
X # define RW_LOCK_UNLOCKED 0
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/termbits.h linux/include/asm-arm/termbits.h
--- v2.2.0-pre5/linux/include/asm-arm/termbits.h Tue Jan 20 16:39:43 1998
+++ linux/include/asm-arm/termbits.h Fri Jan 8 11:11:45 1999
@@ -117,10 +117,21 @@
X #define HUPCL 0002000
X #define CLOCAL 0004000
X #define CBAUDEX 0010000
-#define B57600 0010001
-#define B115200 0010002
-#define B230400 0010003
-#define B460800 0010004
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
X #define CIBAUD 002003600000 /* input baud rate (not used) */
X #define CMSPAR 010000000000 /* mark or space (stick) parity */
X #define CRTSCTS 020000000000 /* flow control */
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/timex.h linux/include/asm-arm/timex.h
--- v2.2.0-pre5/linux/include/asm-arm/timex.h Tue Jan 20 16:39:43 1998
+++ linux/include/asm-arm/timex.h Thu Jan 7 15:51:33 1999
@@ -10,4 +10,13 @@
X
X #include <asm/arch/timex.h>
X
+typedef unsigned long cycles_t;
+
+extern cycles_t cacheflush_time;
+
+static inline cycles_t get_cycles (void)


+{
+ return 0;
+}
+

X #endif
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-arm/unistd.h linux/include/asm-arm/unistd.h
--- v2.2.0-pre5/linux/include/asm-arm/unistd.h Wed Sep 9 14:51:12 1998
+++ linux/include/asm-arm/unistd.h Thu Jan 7 15:51:33 1999
@@ -23,7 +23,7 @@
X #define __NR_time (__NR_SYSCALL_BASE+ 13)
X #define __NR_mknod (__NR_SYSCALL_BASE+ 14)
X #define __NR_chmod (__NR_SYSCALL_BASE+ 15)
-#define __NR_chown (__NR_SYSCALL_BASE+ 16)
+#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
X #define __NR_break (__NR_SYSCALL_BASE+ 17)
X #define __NR_oldstat (__NR_SYSCALL_BASE+ 18)
X #define __NR_lseek (__NR_SYSCALL_BASE+ 19)
@@ -189,8 +189,12 @@
X #define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
X #define __NR_pread (__NR_SYSCALL_BASE+180)
X #define __NR_pwrite (__NR_SYSCALL_BASE+181)
-#define __NR_xstat (__NR_SYSCALL_BASE+182)
-#define __NR_xmknod (__NR_SYSCALL_BASE+183)
+#define __NR_chown (__NR_SYSCALL_BASE+182)
+#define __NR_getcwd (__NR_SYSCALL_BASE+183)
+#define __NR_capget (__NR_SYSCALL_BASE+184)
+#define __NR_capset (__NR_SYSCALL_BASE+185)
+#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
+#define __NR_sendfile (__NR_SYSCALL_BASE+187)
X
X #define __sys2(x) #x
X #define __sys1(x) __sys2(x)
@@ -299,41 +303,94 @@
X
X #ifdef __KERNEL_SYSCALLS__
X
-/*
- * we need this inline - forking from kernel space will result
- * in NO COPY ON WRITE (!!!), until an execve is executed. This
- * is no problem, but for the stack. This is handled by not letting
- * main() use the stack at all after fork(). Thus, no function
- * calls - which means inline code for fork too, as otherwise we
- * would use the stack upon exit from 'fork()'.
- *
- * Actually only pause and fork are needed inline, so that there
- * won't be any messing with the stack from main(), but we define
- * some others too.
- */
-#define __NR__exit __NR_exit
-static inline _syscall0(int,idle);
-static inline _syscall0(int,pause);
-static inline _syscall1(int,setup,int,magic);
-static inline _syscall0(int,sync);
-static inline _syscall0(pid_t,setsid);
-static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count);
-static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
-static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count);
-static inline _syscall1(int,dup,int,fd);
-static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp);
-static inline _syscall3(int,open,const char *,file,int,flag,int,mode);
-static inline _syscall1(int,close,int,fd);
-static inline _syscall1(int,_exit,int,exitcode);
-static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options);
-static inline _syscall1(int,delete_module,const char *,name)
+static inline int idle(void)
+{
+ extern int sys_idle(void);
+ return sys_idle();
+}
X
-static inline pid_t wait(int * wait_stat)
+static inline int pause(void)
+{
+ extern int sys_pause(void);
+ return sys_pause();
+}
+
+static inline int sync(void)
+{
+ extern int sys_sync(void);
+ return sys_sync();
+}
+
+static inline pid_t setsid(void)
X {
- return waitpid(-1,wait_stat,0);
+ extern int sys_setsid(void);
+ return sys_setsid();
X }
X
+static inline int write(int fd, const char *buf, off_t count)
+{
+ extern int sys_write(int, const char *, int);
+ return sys_write(fd, buf, count);
+}
+
+static inline int read(int fd, char *buf, off_t count)
+{
+ extern int sys_read(int, char *, int);
+ return sys_read(fd, buf, count);
+}
+
+static inline off_t lseek(int fd, off_t offset, int count)
+{
+ extern off_t sys_lseek(int, off_t, int);
+ return sys_lseek(fd, offset, count);
+}
+
+static inline int dup(int fd)
+{
+ extern int sys_dup(int);
+ return sys_dup(fd);
+}
X
+static inline int open(const char *file, int flag, int mode)
+{
+ extern int sys_open(const char *, int, int);
+ return sys_open(file, flag, mode);
+}
+
+static inline int close(int fd)
+{
+ return sys_close(fd);
+}
+
+static inline int _exit(int exitcode)
+{
+ extern int sys_exit(int);
+ return sys_exit(exitcode);
+}
+
+static inline pid_t waitpid(pid_t pid, int *wait_stat, int options)
+{
+ extern int sys_wait4(int, int *, int, struct rusage *);
+ return sys_wait4((int)pid, wait_stat, options, NULL);
+}
+
+static inline int delete_module(const char *name)
+{
+ extern int sys_delete_module(const char *name);
+ return sys_delete_module(name);
+}
+
+static inline pid_t wait(int * wait_stat)
+{
+ extern int sys_wait4(int, int *, int, struct rusage *);
+ return sys_wait4(-1, wait_stat, 0, NULL);
+}
+
+/*
+ * The following two can't be eliminated yet - they rely on
+ * specific conditions.
+ */
+static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp);
X
X /*
X * This is the mechanism for creating a new kernel thread.
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-i386/termbits.h linux/include/asm-i386/termbits.h
--- v2.2.0-pre5/linux/include/asm-i386/termbits.h Fri Jul 31 17:05:52 1998
+++ linux/include/asm-i386/termbits.h Fri Jan 8 11:11:45 1999
@@ -117,10 +117,21 @@
X #define HUPCL 0002000
X #define CLOCAL 0004000
X #define CBAUDEX 0010000
-#define B57600 0010001
-#define B115200 0010002
-#define B230400 0010003
-#define B460800 0010004
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
X #define CIBAUD 002003600000 /* input baud rate (not used) */
X #define CMSPAR 010000000000 /* mark or space (stick) parity */
X #define CRTSCTS 020000000000 /* flow control */
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-i386/unistd.h linux/include/asm-i386/unistd.h
--- v2.2.0-pre5/linux/include/asm-i386/unistd.h Fri Nov 27 13:09:28 1998
+++ linux/include/asm-i386/unistd.h Fri Jan 8 14:01:36 1999
@@ -194,6 +194,7 @@
X #define __NR_sendfile 187
X #define __NR_getpmsg 188 /* some people actually want streams */
X #define __NR_putpmsg 189 /* some people actually want streams */
+#define __NR_vfork 190
X
X /* user-visible error numbers are in the range -1 - -122: see <asm-i386/errno.h> */
X
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-m68k/termbits.h linux/include/asm-m68k/termbits.h
--- v2.2.0-pre5/linux/include/asm-m68k/termbits.h Wed Apr 23 19:01:28 1997
+++ linux/include/asm-m68k/termbits.h Fri Jan 8 11:11:45 1999
@@ -118,10 +118,21 @@
X #define HUPCL 0002000
X #define CLOCAL 0004000
X #define CBAUDEX 0010000
-#define B57600 0010001
-#define B115200 0010002
-#define B230400 0010003
-#define B460800 0010004
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
X #define CIBAUD 002003600000 /* input baud rate (not used) */
X #define CMSPAR 010000000000 /* mark or space (stick) parity */
X #define CRTSCTS 020000000000 /* flow control */
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-mips/termbits.h linux/include/asm-mips/termbits.h
--- v2.2.0-pre5/linux/include/asm-mips/termbits.h Wed Dec 10 10:31:11 1997
+++ linux/include/asm-mips/termbits.h Fri Jan 8 11:11:45 1999
@@ -153,10 +153,21 @@
X #define CLOCAL 0004000 /* Ignore modem status lines. */
X #if defined (__USE_BSD) || defined (__KERNEL__)
X #define CBAUDEX 0010000
-#define B57600 0010001
-#define B115200 0010002
-#define B230400 0010003
-#define B460800 0010004
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
X #define CIBAUD 002003600000 /* input baud rate (not used) */
X #define CMSPAR 010000000000 /* mark or space (stick) parity */
X #define CRTSCTS 020000000000 /* flow control */
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-ppc/bitops.h linux/include/asm-ppc/bitops.h
--- v2.2.0-pre5/linux/include/asm-ppc/bitops.h Mon Oct 5 13:13:43 1998
+++ linux/include/asm-ppc/bitops.h Thu Jan 7 12:06:54 1999


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

- * $Id: bitops.h,v 1.10 1998/08/16 21:56:53 geert Exp $
+ * $Id: bitops.h,v 1.11 1999/01/03 20:16:48 cort Exp $
X * bitops.h: Bit string operations on the ppc
X */
X
@@ -15,6 +15,16 @@
X extern int test_and_set_bit(int nr, volatile void *addr);
X extern int test_and_clear_bit(int nr, volatile void *addr);
X extern int test_and_change_bit(int nr, volatile void *addr);
+
+
+/* Returns the number of 0's to the left of the most significant 1 bit */
+extern __inline__ int cntlzw(int bits)
+{
+ int lz;
+
+ asm ("cntlzw %0,%1" : "=r" (lz) : "r" (bits));
+ return lz;
+}
X
X /*
X * These are if'd out here because using : "cc" as a constraint
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-ppc/dma.h linux/include/asm-ppc/dma.h
--- v2.2.0-pre5/linux/include/asm-ppc/dma.h Thu Nov 19 09:56:29 1998
+++ linux/include/asm-ppc/dma.h Thu Jan 7 12:06:54 1999
@@ -204,6 +204,7 @@
X #define DMA2_EXT_REG 0x4D6
X
X #define DMA_MODE_CASCADE 0xC0 /* pass thru DREQ->HRQ, DACK<-HLDA only */
+#define DMA_AUTOINIT 0x10
X
X extern spinlock_t dma_spin_lock;
X
@@ -392,5 +393,11 @@
X /* These are in kernel/dma.c: */
X extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
X extern void free_dma(unsigned int dmanr); /* release it again */


+
+#ifdef CONFIG_PCI_QUIRKS
+extern int isa_dma_bridge_buggy;
+#else
+#define isa_dma_bridge_buggy (0)

+#endif
X
X #endif /* _ASM_DMA_H */
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-ppc/ide.h linux/include/asm-ppc/ide.h
--- v2.2.0-pre5/linux/include/asm-ppc/ide.h Thu Dec 31 10:29:02 1998
+++ linux/include/asm-ppc/ide.h Thu Jan 7 12:06:54 1999
@@ -80,8 +80,11 @@
X
X static __inline__ int ide_default_irq(ide_ioreg_t base)
X {
- if ( (_machine == _MACH_Pmac) || (_machine == _MACH_mbx) )
+ if ( _machine == _MACH_Pmac )
X return 0;
+ else if ( _machine == _MACH_mbx )
+ /* hardcode IRQ 14 on the MBX */
+ return 14+16;
X else if ( _machine == _MACH_chrp) {
X if (chrp_ide_ports_known == 0)
X chrp_ide_probe();
@@ -142,7 +145,7 @@
X }
X
X /* Convert the shorts/longs in hd_driveid from little to big endian;
- chars are endian independant, of course, but strings need to be flipped.
+ chars are endian independent, of course, but strings need to be flipped.
X (Despite what it says in drivers/block/ide.h, they come up as little endian...)
X Changes to linux/hdreg.h may require changes here. */
X static __inline__ void ide_fix_driveid (struct hd_driveid *id) {
@@ -252,14 +255,14 @@
X }
X }
X
-
X #undef insw
X #define insw(port, buf, ns) do { \
X if ( _machine == _MACH_chrp) {\
X ide_insw((port)+_IO_BASE, (buf), (ns)); \
X }\
X else if ( (_machine == _MACH_Pmac) || (_machine == _MACH_mbx) ) \
- ide_insw((port), (buf), (ns)); \
+ ide_insw((port)+((_machine==_MACH_mbx)? 0x80000000: 0), \
+ (buf), (ns)); \
X else \
X /* this must be the same as insw in io.h!! */ \
X _insw((unsigned short *)((port)+_IO_BASE), (buf), (ns)); \
@@ -270,8 +273,9 @@
X if ( _machine == _MACH_chrp) {\
X ide_outsw((port)+_IO_BASE, (buf), (ns)); \
X }\
- else if ( (_machine == _MACH_Pmac) || (_machine == _MACH_mbx) ) \
- ide_outsw((port), (buf), (ns)); \
+ else if ( (_machine == _MACH_Pmac) || (_machine == _MACH_mbx) ) \
+ ide_outsw((port)+((_machine==_MACH_mbx)? 0x80000000: 0), \
+ (buf), (ns)); \
X else \
X /* this must be the same as outsw in io.h!! */ \
X _outsw((unsigned short *)((port)+_IO_BASE), (buf), (ns)); \
@@ -279,13 +283,17 @@
X
X #undef inb
X #define inb(port) \
- in_8((unsigned char *)((port) + ((_machine==_MACH_Pmac)? 0: _IO_BASE)))
+ in_8((unsigned char *)((port) + \
+ ((_machine==_MACH_Pmac)? 0: _IO_BASE) + \
+ ((_machine==_MACH_mbx)? 0x80000000: 0)) )
X #undef inb_p
X #define inb_p(port) inb(port)
X
X #undef outb
X #define outb(val, port) \
- out_8((unsigned char *)((port) + ((_machine==_MACH_Pmac)? 0: _IO_BASE)), (val))
+ out_8((unsigned char *)((port) + \
+ ((_machine==_MACH_Pmac)? 0: _IO_BASE) + \
+ ((_machine==_MACH_mbx)? 0x80000000: 0)), (val) )
X #undef outb_p
X #define outb_p(val, port) outb(val, port)
X
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-ppc/pgtable.h linux/include/asm-ppc/pgtable.h
--- v2.2.0-pre5/linux/include/asm-ppc/pgtable.h Thu Dec 31 10:29:02 1998
+++ linux/include/asm-ppc/pgtable.h Thu Jan 7 12:06:54 1999
@@ -226,7 +226,7 @@
X do { \
X unsigned long __pgdir = (unsigned long)pgdir; \
X ((tsk)->tss.pg_tables = (unsigned long *)(__pgdir)); \
- asm("mtspr %0,%1 \n\t" :: "i"(M_TWB), "r"(__pa(__pgdir))); \
+ asm("mtspr %0,%1 \n\t" : : "i"(M_TWB), "r"(__pa(__pgdir))); \
X } while (0)


X #endif /* CONFIG_8xx */
X

@@ -637,5 +637,7 @@
X
X /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
X #define PageSkip(page) (0)
+#define kern_addr_valid(addr) (1)
+
X #endif __ASSEMBLY__
X #endif /* _PPC_PGTABLE_H */
diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-ppc/termbits.h linux/include/asm-ppc/termbits.h
--- v2.2.0-pre5/linux/include/asm-ppc/termbits.h Sat Aug 16 09:51:09 1997
+++ linux/include/asm-ppc/termbits.h Fri Jan 8 11:11:45 1999
@@ -126,6 +126,17 @@
X #define B115200 00021
X #define B230400 00022
X #define B460800 00023
+#define B500000 00024
+#define B576000 00025
+#define B921600 00026
+#define B1000000 00027
+#define B1152000 00030
+#define B1500000 00031
+#define B2000000 00032
+#define B2500000 00033
+#define B3000000 00034
+#define B3500000 00035
+#define B4000000 00036
X
X #define CSIZE 00001400
X #define CS5 00000000
diff -u --recursive --new-file v2.2.0-pre5/linux/include/linux/mm.h linux/include/linux/mm.h
--- v2.2.0-pre5/linux/include/linux/mm.h Thu Jan 7 15:11:40 1999
+++ linux/include/linux/mm.h Fri Jan 8 15:54:34 1999
@@ -315,14 +315,15 @@
X #define __GFP_LOW 0x02
X #define __GFP_MED 0x04
X #define __GFP_HIGH 0x08
+#define __GFP_IO 0x10
X
X #define __GFP_DMA 0x80
X
X #define GFP_BUFFER (__GFP_LOW | __GFP_WAIT)
X #define GFP_ATOMIC (__GFP_HIGH)
-#define GFP_USER (__GFP_LOW | __GFP_WAIT)
-#define GFP_KERNEL (__GFP_MED | __GFP_WAIT)
-#define GFP_NFS (__GFP_HIGH | __GFP_WAIT)
+#define GFP_USER (__GFP_LOW | __GFP_WAIT | __GFP_IO)
+#define GFP_KERNEL (__GFP_MED | __GFP_WAIT | __GFP_IO)
+#define GFP_NFS (__GFP_HIGH | __GFP_WAIT | __GFP_IO)
X
X /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some
X platforms, used as appropriate on others */
diff -u --recursive --new-file v2.2.0-pre5/linux/include/linux/nls.h linux/include/linux/nls.h
--- v2.2.0-pre5/linux/include/linux/nls.h Fri Jan 30 11:28:10 1998
+++ linux/include/linux/nls.h Thu Jan 7 09:25:02 1999
@@ -36,6 +36,7 @@
X extern int init_nls_iso8859_7(void);
X extern int init_nls_iso8859_8(void);
X extern int init_nls_iso8859_9(void);
+extern int init_nls_iso8859_15(void);
X extern int init_nls_cp437(void);
X extern int init_nls_cp737(void);
X extern int init_nls_cp775(void);
diff -u --recursive --new-file v2.2.0-pre5/linux/include/linux/sched.h linux/include/linux/sched.h
--- v2.2.0-pre5/linux/include/linux/sched.h Thu Jan 7 15:11:40 1999
+++ linux/include/linux/sched.h Fri Jan 8 15:54:34 1999
@@ -257,7 +257,8 @@
X /* Pointer to task[] array linkage. */
X struct task_struct **tarray_ptr;
X
- struct wait_queue *wait_chldexit; /* for wait4() */
+ struct wait_queue *wait_chldexit, *vfork_sleep; /* for wait4()/vfork */
+
X unsigned long policy, rt_priority;
X unsigned long it_real_value, it_prof_value, it_virt_value;
X unsigned long it_real_incr, it_prof_incr, it_virt_incr;
@@ -298,6 +299,7 @@
X struct files_struct *files;
X /* memory management info */
X struct mm_struct *mm;
+
X /* signal handlers */
X spinlock_t sigmask_lock; /* Protects signal and blocked */
X struct signal_struct *sig;
@@ -348,7 +350,7 @@
X /* proc links*/ &init_task,&init_task,NULL,NULL,NULL, \
X /* pidhash */ NULL, NULL, \
X /* tarray */ &task[0], \
-/* chld wait */ NULL, \
+/* chld wait */ NULL, NULL, \
X /* timeout */ SCHED_OTHER,0,0,0,0,0,0,0, \
X /* timer */ { NULL, NULL, 0, 0, it_real_fn }, \
X /* utime */ {0,0,0,0},0, \
diff -u --recursive --new-file v2.2.0-pre5/linux/include/linux/sunrpc/stats.h linux/include/linux/sunrpc/stats.h
--- v2.2.0-pre5/linux/include/linux/sunrpc/stats.h Mon Jan 4 15:08:18 1999
+++ linux/include/linux/sunrpc/stats.h Fri Jan 8 15:53:15 1999
@@ -9,6 +9,7 @@
X #ifndef _LINUX_SUNRPC_STATS_H
X #define _LINUX_SUNRPC_STATS_H
X
+#include <linux/config.h>
X #include <linux/proc_fs.h>
X
X struct rpc_stat {
diff -u --recursive --new-file v2.2.0-pre5/linux/include/linux/sunrpc/xprt.h linux/include/linux/sunrpc/xprt.h
--- v2.2.0-pre5/linux/include/linux/sunrpc/xprt.h Thu Aug 20 17:05:19 1998
+++ linux/include/linux/sunrpc/xprt.h Fri Jan 8 15:52:45 1999
@@ -158,7 +158,7 @@
X */
X union { /* record marker & XID */
X u32 header[2];
- u8 * data[8];
+ u8 data[8];
X } tcp_recm;
X struct rpc_rqst * tcp_rqstp;
X struct iovec tcp_iovec[MAX_IOVEC];
diff -u --recursive --new-file v2.2.0-pre5/linux/include/linux/tty.h linux/include/linux/tty.h
--- v2.2.0-pre5/linux/include/linux/tty.h Thu Nov 19 09:56:29 1998
+++ linux/include/linux/tty.h Fri Jan 8 15:54:33 1999
@@ -299,6 +299,7 @@
X int canon_data;
X unsigned long canon_head;
X unsigned int canon_column;
+ struct semaphore atomic_read;
X };
X
X /* tty magic number */
@@ -320,6 +321,7 @@
X #define TTY_DO_WRITE_WAKEUP 5
X #define TTY_PUSH 6
X #define TTY_CLOSING 7
+#define TTY_DONT_FLIP 8
X #define TTY_HW_COOK_OUT 14
X #define TTY_HW_COOK_IN 15
X #define TTY_PTY_LOCK 16
diff -u --recursive --new-file v2.2.0-pre5/linux/include/linux/ufs_fs.h linux/include/linux/ufs_fs.h
--- v2.2.0-pre5/linux/include/linux/ufs_fs.h Fri Oct 23 22:01:27 1998
+++ linux/include/linux/ufs_fs.h Thu Jan 7 10:31:07 1999
@@ -110,12 +110,12 @@
X #define UFS_MOUNT_ONERROR_UMOUNT 0x00000004
X #define UFS_MOUNT_ONERROR_REPAIR 0x00000008
X
-#define UFS_MOUNT_UFSTYPE 0x000000F0
+#define UFS_MOUNT_UFSTYPE 0x000001F0
X #define UFS_MOUNT_UFSTYPE_OLD 0x00000010
X #define UFS_MOUNT_UFSTYPE_44BSD 0x00000020
X #define UFS_MOUNT_UFSTYPE_SUN 0x00000040
X #define UFS_MOUNT_UFSTYPE_NEXT 0x00000080
-
+#define UFS_MOUNT_UFSTYPE_OPENSTEP 0x00000100
X
X #define ufs_clear_opt(o,opt) o &= ~UFS_MOUNT_##opt
X #define ufs_set_opt(o,opt) o |= UFS_MOUNT_##opt
diff -u --recursive --new-file v2.2.0-pre5/linux/include/net/br.h linux/include/net/br.h
--- v2.2.0-pre5/linux/include/net/br.h Tue Dec 22 14:16:58 1998
+++ linux/include/net/br.h Thu Jan 7 09:25:02 1999
@@ -299,5 +299,5 @@
X /* externs */
X
X extern struct br_stat br_stats;
-
+extern Port_data port_info[];
X
diff -u --recursive --new-file v2.2.0-pre5/linux/include/net/ip_masq.h linux/include/net/ip_masq.h
--- v2.2.0-pre5/linux/include/net/ip_masq.h Mon Oct 5 13:13:47 1998
+++ linux/include/net/ip_masq.h Fri Jan 8 15:53:46 1999
@@ -48,7 +48,8 @@
X #define IP_MASQ_F_NO_SADDR 0x0004 /* no sport set yet */
X #define IP_MASQ_F_NO_SPORT 0x0008 /* no sport set yet */
X
-#define IP_MASQ_F_NO_REPLY 0x0010 /* no reply yet from outside */
+#define IP_MASQ_F_DLOOSE 0x0010 /* loose dest binding */
+#define IP_MASQ_F_NO_REPLY 0x0080 /* no reply yet from outside */
X
X #define IP_MASQ_F_HASHED 0x0100 /* hashed entry */
X #define IP_MASQ_F_OUT_SEQ 0x0200 /* must do output seq adjust */
diff -u --recursive --new-file v2.2.0-pre5/linux/kernel/exit.c linux/kernel/exit.c
--- v2.2.0-pre5/linux/kernel/exit.c Fri Nov 27 13:09:29 1998
+++ linux/kernel/exit.c Fri Jan 8 14:03:31 1999
@@ -292,6 +292,7 @@
X kill_pg(current->pgrp,SIGHUP,1);
X kill_pg(current->pgrp,SIGCONT,1);
X }
+
X /* Let father know we died */
X notify_parent(current, current->exit_signal);
X
diff -u --recursive --new-file v2.2.0-pre5/linux/kernel/fork.c linux/kernel/fork.c
--- v2.2.0-pre5/linux/kernel/fork.c Fri Jan 1 12:58:21 1999
+++ linux/kernel/fork.c Fri Jan 8 14:03:31 1999
@@ -283,6 +283,9 @@
X */
X void mmput(struct mm_struct *mm)
X {
+ /* notify parent sleeping on vfork() */
+ wake_up(&current->p_opptr->vfork_sleep);
+
X if (atomic_dec_and_test(&mm->count)) {
X release_segments(mm);
X exit_mmap(mm);
@@ -521,6 +524,7 @@
X p->p_pptr = p->p_opptr = current;
X p->p_cptr = NULL;
X init_waitqueue(&p->wait_chldexit);
+ init_waitqueue(&p->vfork_sleep);
X
X p->sigpending = 0;
X sigemptyset(&p->signal);
diff -u --recursive --new-file v2.2.0-pre5/linux/mm/page_alloc.c linux/mm/page_alloc.c
--- v2.2.0-pre5/linux/mm/page_alloc.c Thu Jan 7 15:11:41 1999
+++ linux/mm/page_alloc.c Fri Jan 8 15:34:32 1999
@@ -258,9 +258,6 @@
X * a bad memory situation, we're better off trying
X * to free things up until things are better.
X *
- * Normally we shouldn't ever have to do this, with
- * kswapd doing this in the background.
- *
X * Most notably, this puts most of the onus of
X * freeing up memory on the processes that _use_
X * the most memory, rather than on everybody.
@@ -282,7 +279,7 @@
X {
X int freed;
X current->flags |= PF_MEMALLOC;
- freed = try_to_free_pages(gfp_mask, SWAP_CLUSTER_MAX);
+ freed = try_to_free_pages(gfp_mask, freepages.high - nr_free_pages);
X current->flags &= ~PF_MEMALLOC;
X if (!freed && !(gfp_mask & (__GFP_MED | __GFP_HIGH)))
X goto nopage;
diff -u --recursive --new-file v2.2.0-pre5/linux/mm/vmscan.c linux/mm/vmscan.c
--- v2.2.0-pre5/linux/mm/vmscan.c Thu Jan 7 15:11:41 1999
+++ linux/mm/vmscan.c Thu Jan 7 15:09:46 1999
@@ -76,7 +76,6 @@
X set_pte(page_table, __pte(entry));
X drop_pte:
X vma->vm_mm->rss--;
- tsk->nswap++;
X flush_tlb_page(vma, address);
X __free_page(page_map);
X return 0;
@@ -99,6 +98,14 @@
X pte_clear(page_table);
X goto drop_pte;
X }
+
+ /*
+ * Don't go down into the swap-out stuff if
+ * we cannot do I/O! Avoid recursing on FS
+ * locks etc.
+ */
+ if (!(gfp_mask & __GFP_IO))
+ return 0;
X
X /*
X * Ok, it's really dirty. That means that
diff -u --recursive --new-file v2.2.0-pre5/linux/net/bridge/br.c linux/net/bridge/br.c
--- v2.2.0-pre5/linux/net/bridge/br.c Thu Jan 7 15:11:41 1999
+++ linux/net/bridge/br.c Thu Jan 7 09:25:03 1999
@@ -1197,8 +1197,8 @@
X return NULL;
X }


X skb->dev = dev;

- skb->mac.raw = skb->h.raw = skb_put(skb,size);
- memset(skb->h.raw + 60 - pad_size, 0xa5, pad_size);
+ skb->mac.raw = skb->nh.raw = skb_put(skb,size);
+ memset(skb->nh.raw + 60 - pad_size, 0xa5, pad_size);
X eth = skb->mac.ethernet;
X memcpy(eth->h_dest, bridge_ula, ETH_ALEN);
X memcpy(eth->h_source, dev->dev_addr, ETH_ALEN);
@@ -1221,13 +1221,13 @@
X #endif
X eth->h_proto = htons(pdu_size + BRIDGE_LLC1_HS);
X
- skb->h.raw += skb->dev->hard_header_len;
- llc_buffer = skb->h.raw;
+ skb->nh.raw += skb->dev->hard_header_len;
+ llc_buffer = skb->nh.raw;
X *llc_buffer++ = BRIDGE_LLC1_DSAP;
X *llc_buffer++ = BRIDGE_LLC1_SSAP;
X *llc_buffer++ = BRIDGE_LLC1_CTRL;
- /* set h.raw to where the bpdu starts */
- skb->h.raw += BRIDGE_LLC1_HS;
+ /* set nh.raw to where the bpdu starts */
+ skb->nh.raw += BRIDGE_LLC1_HS;
X
X /* mark that we've been here... */
X skb->pkt_bridged = IS_BRIDGED;
@@ -1248,18 +1248,18 @@
X return(-1);
X
X /* copy fields before "flags" */
- memcpy(skb->h.raw, config_bpdu, BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET);
+ memcpy(skb->nh.raw, config_bpdu, BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET);
X
X /* build the "flags" field */
- *(skb->h.raw+BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET) = 0;
+ *(skb->nh.raw+BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET) = 0;
X if (config_bpdu->top_change_ack)
- *(skb->h.raw+BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET) |= 0x80;
+ *(skb->nh.raw+BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET) |= 0x80;
X if (config_bpdu->top_change)
- *(skb->h.raw+BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET) |= 0x01;
+ *(skb->nh.raw+BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET) |= 0x01;
X
X config_bpdu_hton(config_bpdu);
X /* copy the rest */
- memcpy(skb->h.raw+BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET+1,
+ memcpy(skb->nh.raw+BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET+1,
X (char*)&(config_bpdu->root_id),
X BRIDGE_BPDU_8021_CONFIG_SIZE-1-BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET);
X
@@ -1275,7 +1275,7 @@


X if (skb == NULL)

X return(-1);
X
- memcpy(skb->h.raw, bpdu, sizeof(Tcn_bpdu));
+ memcpy(skb->nh.raw, bpdu, sizeof(Tcn_bpdu));
X
X dev_queue_xmit(skb);
X return(0);
@@ -1376,7 +1376,7 @@
X if(!port)
X return 0;
X
- skb->h.raw = skb->mac.raw;
+ skb->nh.raw = skb->mac.raw;
X eth = skb->mac.ethernet;
X p = &port_info[port];
X
@@ -1480,7 +1480,7 @@
X return(0);
X }
X ++br_stats_cnt.port_not_disable;
- skb->mac.raw = skb->h.raw = skb->data;
+ skb->mac.raw = skb->nh.raw = skb->data;
X eth = skb->mac.ethernet;
X port = 0; /* an impossible port (locally generated) */
X if (br_stats.flags & BR_DEBUG)
@@ -1735,7 +1735,7 @@
X skb->pkt_bridged = IS_BRIDGED;
X
X /* reset the skb->ip pointer */
- skb->h.raw = skb->data + ETH_HLEN;
+ skb->nh.raw = skb->data + ETH_HLEN;
X
X /*
X * Send the buffer out.
@@ -1804,7 +1804,7 @@
X or have a received valid MAC header */
X
X /* printk("Flood to port %d\n",i);*/
- nskb->h.raw = nskb->data + ETH_HLEN;
+ nskb->nh.raw = nskb->data + ETH_HLEN;
X #if LINUX_VERSION_CODE >= 0x20100
X nskb->priority = 1;
X dev_queue_xmit(nskb);
diff -u --recursive --new-file v2.2.0-pre5/linux/net/bridge/br_tree.c linux/net/bridge/br_tree.c
--- v2.2.0-pre5/linux/net/bridge/br_tree.c Tue Dec 22 14:16:59 1998
+++ linux/net/bridge/br_tree.c Thu Jan 7 09:25:03 1999
@@ -7,6 +7,7 @@
X #include <linux/string.h>
X #include <linux/malloc.h>
X #include <linux/skbuff.h>
+#include <linux/netdevice.h>
X
X #include <net/br.h>
X #define _DEBUG_AVL
@@ -28,6 +29,10 @@
X static struct fdb **fhpp = &fhp;
X static int fdb_inited = 0;
X
+#ifdef DEBUG_AVL
+static void printk_avl (struct fdb * tree);
+#endif
+
X static int addr_cmp(unsigned char *a1, unsigned char *a2);
X
X /*
@@ -80,7 +85,7 @@
X addr[4],
X addr[5]);
X #endif /* DEBUG_AVL */
- for (tree = &fdb_head ; ; ) {
+ for (tree = fhp ; ; ) {
X if (tree == avl_br_empty) {
X #if (DEBUG_AVL)
X printk("search failed, returning node 0x%x\n", (unsigned int)result);
@@ -446,10 +451,10 @@
X /* don't write the local device */
X if(tree->port != 0){
X size = sprintf(*pbuffer,
- "%02x:%02x:%02x:%02x:%02x:%02x eth%d %d %d\n",
+ "%02x:%02x:%02x:%02x:%02x:%02x %s %d %ld\n",
X tree->ula[0],tree->ula[1],tree->ula[2],
X tree->ula[3],tree->ula[4],tree->ula[5],
- tree->port-1, tree->flags,CURRENT_TIME-tree->timer);
+ port_info[tree->port].dev->name, tree->flags,CURRENT_TIME-tree->timer);
X
X (*pos)+=size;
X (*len)+=size;
diff -u --recursive --new-file v2.2.0-pre5/linux/net/core/dev.c linux/net/core/dev.c
--- v2.2.0-pre5/linux/net/core/dev.c Tue Dec 22 14:16:59 1998
+++ linux/net/core/dev.c Thu Jan 7 09:26:41 1999
@@ -1841,7 +1841,11 @@
X extern void dlci_setup(void);
X extern int dmascc_init(void);
X extern int sm_init(void);
-extern int baycom_init(void);
+
+extern int baycom_ser_fdx_init(void);
+extern int baycom_ser_hdx_init(void);
+extern int baycom_par_init(void);
+
X extern int lapbeth_init(void);
X extern void arcnet_init(void);
X extern void ip_auto_config(void);
@@ -1912,8 +1916,14 @@
X #if defined(CONFIG_SDLA)
X sdla_setup();
X #endif
-#if defined(CONFIG_BAYCOM)
- baycom_init();
+#if defined(CONFIG_BAYCOM_PAR)
+ baycom_par_init();
+#endif
+#if defined(CONFIG_BAYCOM_SER_FDX)
+ baycom_ser_fdx_init();
+#endif
+#if defined(CONFIG_BAYCOM_SER_HDX)
+ baycom_ser_hdx_init();
X #endif
X #if defined(CONFIG_SOUNDMODEM)
X sm_init();
diff -u --recursive --new-file v2.2.0-pre5/linux/net/ipv4/ip_fw.c linux/net/ipv4/ip_fw.c
--- v2.2.0-pre5/linux/net/ipv4/ip_fw.c Thu Jan 7 15:11:41 1999
+++ linux/net/ipv4/ip_fw.c Thu Jan 7 09:31:16 1999
@@ -29,6 +29,9 @@
X * 1-May-1998: Remove caching of device pointer.
X * 12-May-1998: Allow tiny fragment case for TCP/UDP.
X * 15-May-1998: Treat short packets as fragments, don't just block.
+ * 3-Jan-1999: Fixed serious procfs security hole -- users should never
+ * be allowed to view the chains!
+ * Marc Santoro <ult...@snicker.emoti.com>


X */
X
X /*

@@ -509,7 +512,7 @@
X printk("%s\n",chain->label);
X }
X
-static inline void
+static inline int
X ip_fw_domatch(struct ip_fwkernel *f,
X struct iphdr *ip,
X const char *rif,
@@ -550,9 +553,15 @@
X len-(sizeof(__u32)*2+IFNAMSIZ));
X netlink_broadcast(ipfwsk, outskb, 0, ~0, GFP_KERNEL);
X }
- else duprintf("netlink post failed - alloc_skb failed!\n");
+ else {
+ if (net_ratelimit())
+ printk(KERN_WARNING "ip_fw: packet drop due to "
+ "netlink failure\n");
+ return 0;
+ }
X }
X #endif
+ return 1;
X }
X
X /*
@@ -695,9 +704,13 @@
X for (; f; f = f->next) {
X if (ip_rule_match(f,rif,ip,
X tcpsyn,src_port,dst_port,offset)) {
- if (!testing)
- ip_fw_domatch(f, ip, rif, chain->label, skb,
- slot, src_port,dst_port);
+ if (!testing
+ && !ip_fw_domatch(f, ip, rif, chain->label,
+ skb, slot,
+ src_port, dst_port)) {
+ ret = FW_BLOCK;
+ goto out;
+ }
X break;
X }
X }
@@ -759,6 +772,7 @@
X }
X } while (ret == FW_SKIP+2);
X
+ out:
X if (!testing) FWC_READ_UNLOCK(&ip_fw_lock);
X
X /* Recalculate checksum if not going to reject, and TOS changed. */
@@ -1671,13 +1685,13 @@
X #ifdef CONFIG_PROC_FS
X static struct proc_dir_entry proc_net_ipfwchains_chain = {
X PROC_NET_IPFW_CHAINS, sizeof(IP_FW_PROC_CHAINS)-1,
- IP_FW_PROC_CHAINS, S_IFREG | S_IRUGO | S_IWUSR, 1, 0, 0,
+ IP_FW_PROC_CHAINS, S_IFREG | S_IRUSR | S_IWUSR, 1, 0, 0,
X 0, &proc_net_inode_operations, ip_chain_procinfo
X };
X
X static struct proc_dir_entry proc_net_ipfwchains_chainnames = {
X PROC_NET_IPFW_CHAIN_NAMES, sizeof(IP_FW_PROC_CHAIN_NAMES)-1,
- IP_FW_PROC_CHAIN_NAMES, S_IFREG | S_IRUGO | S_IWUSR, 1, 0, 0,
+ IP_FW_PROC_CHAIN_NAMES, S_IFREG | S_IRUSR | S_IWUSR, 1, 0, 0,
X 0, &proc_net_inode_operations, ip_chain_name_procinfo
X };
X
diff -u --recursive --new-file v2.2.0-pre5/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
--- v2.2.0-pre5/linux/net/ipv4/tcp.c Thu Dec 31 10:29:03 1998
+++ linux/net/ipv4/tcp.c Thu Jan 7 09:26:41 1999
@@ -812,7 +812,7 @@
X * FIXME: the *_user functions should
X * return how much data was
X * copied before the fault
- * occured and then a partial
+ * occurred and then a partial
X * packet with this data should
X * be sent. Unfortunately
X * csum_and_copy_from_user doesn't
diff -u --recursive --new-file v2.2.0-pre5/linux/net/netrom/af_netrom.c linux/net/netrom/af_netrom.c
--- v2.2.0-pre5/linux/net/netrom/af_netrom.c Fri Oct 23 22:01:27 1998
+++ linux/net/netrom/af_netrom.c Thu Jan 7 09:27:47 1999
@@ -892,11 +892,18 @@
X */
X if (frametype != NR_CONNREQ) {
X /*
+ * Here it would be nice to be able to send a reset but
+ * NET/ROM doesn't have one. The following hack would
+ * have been a way to extend the protocol but apparently
+ * it kills BPQ boxes... :-(
+ */
+#if 0
+ /*
X * Never reply to a CONNACK/CHOKE.
X */
X if (frametype != NR_CONNACK || flags != NR_CHOKE_FLAG)
X nr_transmit_refusal(skb, 1);
-
+#endif
X return 0;
X }
X
diff -u --recursive --new-file v2.2.0-pre5/linux/net/netsyms.c linux/net/netsyms.c
--- v2.2.0-pre5/linux/net/netsyms.c Thu Dec 31 10:29:03 1998
+++ linux/net/netsyms.c Thu Jan 7 09:26:42 1999
@@ -67,7 +67,9 @@
X defined(CONFIG_E2100) || defined(CONFIG_HPLAN_PLUS) || \
X defined(CONFIG_HPLAN) || defined(CONFIG_AC3200) || \
X defined(CONFIG_ES3210) || defined(CONFIG_ULTRA32) || \
- defined(CONFIG_LNE390) || defined(CONFIG_NE3210)
+ defined(CONFIG_LNE390) || defined(CONFIG_NE3210) || \
+ defined(CONFIG_NE2K_PCI) || defined(CONFIG_APNE) || \
+ defined(CONFIG_DAYNAPORT)
X #include "../drivers/net/8390.h"
X #endif


X
@@ -392,7 +394,9 @@

X defined(CONFIG_E2100) || defined(CONFIG_HPLAN_PLUS) || \
X defined(CONFIG_HPLAN) || defined(CONFIG_AC3200) || \
X defined(CONFIG_ES3210) || defined(CONFIG_ULTRA32) || \
- defined(CONFIG_LNE390) || defined(CONFIG_NE3210)
+ defined(CONFIG_LNE390) || defined(CONFIG_NE3210) || \
+ defined(CONFIG_NE2K_PCI) || defined(CONFIG_APNE) || \
+ defined(CONFIG_DAYNAPORT)
X /* If 8390 NIC support is built in, we will need these. */
X EXPORT_SYMBOL(ei_open);
X EXPORT_SYMBOL(ei_close);
diff -u --recursive --new-file v2.2.0-pre5/linux/net/sched/sch_api.c linux/net/sched/sch_api.c
--- v2.2.0-pre5/linux/net/sched/sch_api.c Mon Dec 28 15:00:53 1998
+++ linux/net/sched/sch_api.c Thu Jan 7 09:26:42 1999
@@ -94,7 +94,7 @@
X ---enqueue
X
X enqueue returns number of enqueued packets i.e. this number is 1,
- if packet was enqueued sucessfully and <1 if something (not
+ if packet was enqueued successfully and <1 if something (not
X necessary THIS packet) was dropped.
X
X Auxiliary routines:
diff -u --recursive --new-file v2.2.0-pre5/linux/net/sched/sch_csz.c linux/net/sched/sch_csz.c
--- v2.2.0-pre5/linux/net/sched/sch_csz.c Thu May 14 19:47:45 1998
+++ linux/net/sched/sch_csz.c Thu Jan 7 09:26:42 1999
@@ -704,7 +704,7 @@
X }
X #ifdef CSZ_PLUS_TBF
X /* We are about to return no skb.
- Schedule watchdog timer, if it occured because of shaping.
+ Schedule watchdog timer, if it occurred because of shaping.
X */
X if (q->wd_expires) {
X unsigned long delay = PSCHED_US2JIFFIE(q->wd_expires);
diff -u --recursive --new-file v2.2.0-pre5/linux/net/sunrpc/sched.c linux/net/sunrpc/sched.c
--- v2.2.0-pre5/linux/net/sunrpc/sched.c Mon Jan 4 15:08:18 1999
+++ linux/net/sunrpc/sched.c Thu Jan 7 09:25:02 1999
@@ -829,6 +829,10 @@
X }
X save_flags(oldflags); cli();
X if (!schedq.task) {
+ /* following two lines added by air...@linux.ie
+ to make NFS over TCP work 5/1/99 */
+ dprintk("RPC: rpciod running checking dispatch\n");
+ rpciod_tcp_dispatcher();
X dprintk("RPC: rpciod back to sleep\n");
X interruptible_sleep_on(&rpciod_idle);
X dprintk("RPC: switch to rpciod\n");
diff -u --recursive --new-file v2.2.0-pre5/linux/net/sunrpc/sysctl.c linux/net/sunrpc/sysctl.c
--- v2.2.0-pre5/linux/net/sunrpc/sysctl.c Mon Jan 4 15:08:18 1999
+++ linux/net/sunrpc/sysctl.c Thu Jan 7 09:28:47 1999
@@ -7,6 +7,7 @@
X * impossible at the moment.


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

X #include <linux/version.h>
X #include <linux/types.h>
X #include <linux/linkage.h>
diff -u --recursive --new-file v2.2.0-pre5/linux/net/sunrpc/xprt.c linux/net/sunrpc/xprt.c
--- v2.2.0-pre5/linux/net/sunrpc/xprt.c Thu Dec 31 10:29:03 1998
+++ linux/net/sunrpc/xprt.c Thu Jan 7 09:25:02 1999
@@ -821,12 +821,19 @@
X */
X if (!xprt->rx_pending_flag)
X {
- dprintk("RPC: xprt queue\n");
+ int start_queue=0;
+
+ dprintk("RPC: xprt queue %p\n", rpc_xprt_pending);
X if(rpc_xprt_pending==NULL)
- tcp_rpciod_queue();
+ start_queue=1;
X xprt->rx_pending_flag=1;
X xprt->rx_pending=rpc_xprt_pending;
X rpc_xprt_pending=xprt;
+ if (start_queue)
+ {
+ tcp_rpciod_queue();
+ start_queue=0;
+ }
X }
X else
X dprintk("RPC: xprt queued already %p\n", xprt);
diff -u --recursive --new-file v2.2.0-pre5/linux/net/wanrouter/patchlevel linux/net/wanrouter/patchlevel
--- v2.2.0-pre5/linux/net/wanrouter/patchlevel Wed Jul 16 19:22:51 1997
+++ linux/net/wanrouter/patchlevel Thu Jan 7 09:25:02 1999
@@ -1,2 +1 @@
-1.0.3-modified
-
+2.0.3
diff -u --recursive --new-file v2.2.0-pre5/linux/scripts/header.tk linux/scripts/header.tk
--- v2.2.0-pre5/linux/scripts/header.tk Mon Jan 4 15:08:18 1999
+++ linux/scripts/header.tk Thu Jan 7 15:40:02 1999
@@ -207,7 +207,7 @@
X eval $cmd
X }
X if [regexp {([0-9A-Za-z_]+)="([^"]*)"} $line foo var value] {
- set cmd "global $var; set $var $value"
+ set cmd "global $var; set $var \"$value\""
X eval $cmd
X }
X }
diff -u --recursive --new-file v2.2.0-pre5/linux/scripts/mkdep.c linux/scripts/mkdep.c
--- v2.2.0-pre5/linux/scripts/mkdep.c Tue Dec 22 14:16:59 1998
+++ linux/scripts/mkdep.c Fri Jan 8 11:10:11 1999
@@ -208,9 +208,9 @@
X #define GETNEXT { \
X next_byte(__buf); \
X if ((unsigned long) next % sizeof(unsigned long) == 0) { \
- __buf = * (unsigned long *) next; \
- if (!__buf) \
+ if (next >= end) \
X break; \
+ __buf = * (unsigned long *) next; \
X } \
X next++; \
X }
@@ -249,7 +249,7 @@
X * per memory read. The MAX6 and MIN6 tests dispose of most
X * input characters with 1 or 2 comparisons.
X */
-void state_machine(const char * map)
+void state_machine(const char * map, const char * end)
X {
X const char * next = map;
X const char * map_dot;
@@ -441,7 +441,7 @@
X return;
X }
X
- mapsize = st.st_size + 2*sizeof(unsigned long);
+ mapsize = st.st_size;
X mapsize = (mapsize+pagesizem1) & ~pagesizem1;
X map = mmap(NULL, mapsize, PROT_READ, MAP_PRIVATE, fd, 0);
X if ((long) map == -1) {


@@ -457,7 +457,7 @@
X

X hasdep = 0;
X clear_config();
- state_machine(map);
+ state_machine(map, map+st.st_size);
X if (hasdep)
X puts(command);
X
diff -u --recursive --new-file v2.2.0-pre5/linux/scripts/tkgen.c linux/scripts/tkgen.c
--- v2.2.0-pre5/linux/scripts/tkgen.c Thu Jan 7 15:11:42 1999
+++ linux/scripts/tkgen.c Thu Jan 7 15:40:02 1999
@@ -905,6 +905,7 @@
X * Generate the code to close out the last menu.
X */
X end_proc(menu_num);
+ clear_globalflags(config);
X
X /*
X * The top level menu also needs an update function. When we exit a
diff -u --recursive --new-file v2.2.0-pre5/linux/scripts/ver_linux linux/scripts/ver_linux
--- v2.2.0-pre5/linux/scripts/ver_linux Wed Dec 31 16:00:00 1969
+++ linux/scripts/ver_linux Thu Jan 7 09:27:47 1999
@@ -0,0 +1,29 @@
+#!/bin/sh
+# Before running this script please ensure that your PATH is
+# typical as you use for compilation/istallation. I use
+# /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may
+# differs on your system.
+#
+echo '-- Versions installed: (if some fields are empty or looks'
+echo '-- unusual then possibly you have very old versions)'
+uname -a
+insmod -V 1>/tmp/ver_linux.tmp 2>>/tmp/ver_linux.tmp
+awk 'NR==1{print "Kernel modules ",$NF}' /tmp/ver_linux.tmp
+rm -f /tmp/ver_linux.tmp
+echo "Gnu C " `gcc --version`
+ld -v 2>&1 | awk -F\) '{print $1}' | awk \
+ '/BFD/{print "Binutils ",$NF}'
+ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed -e 's/\.so$//' \
+ | awk -F'[.-]' '{print "Linux C Library " $(NF-2)"."$(NF-1)"."$NF}'
+echo -n "Dynamic linker "
+ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -1
+ls -l /usr/lib/lib{g,stdc}++.so 2>/dev/null | awk -F. \
+ '{print "Linux C++ Library " $4"."$5"."$6}'
+ps --version 2>&1 | awk 'NR==1{print "Procps ", $NF}'
+mount --version | awk -F\- '{print "Mount ", $NF}'
+netstat --version | awk \
+'NR==1{if ($5 != "") { n=split($5,buf,"-"); ver=buf[n]; done=1 }}
+ NR==2{if (done != 1) ver=$3 }
+ END{print "Net-tools ",ver}'
+loadkeys -h 2>&1 | awk 'NR==1{print "Kbd ",$3}'
+expr --v | awk '{print "Sh-utils ", $NF}'


SHAR_EOF
true || echo 'restore of patch-2.2.0-pre6 failed'

echo 'File patch-2.2.0-pre6 is complete' &&
chmod 644 patch-2.2.0-pre6 ||


echo 'restore of patch-2.2.0-pre6 failed'

Cksum="`cksum < 'patch-2.2.0-pre6'`"
if ! test "2664347210 447164" = "$Cksum"
then
echo 'patch-2.2.0-pre6: original Checksum 2664347210 447164, current one' "$Cksum"
rm -f _shar_wnt_.tmp
rm -f _shar_seq_.tmp
exit 1
fi
rm -f _shar_wnt_.tmp
fi
rm -f _shar_seq_.tmp
echo 'You have unpacked the last part.'

0 new messages