diff -u --recursive --new-file v2.1.12/linux/Makefile linux/Makefile
--- v2.1.12/linux/Makefile	Fri Nov 22 18:28:13 1996
+++ linux/Makefile	Fri Nov 22 18:35:17 1996
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 1
-SUBLEVEL = 12
+SUBLEVEL = 13
 
 ARCH = i386
 
diff -u --recursive --new-file v2.1.12/linux/arch/alpha/defconfig linux/arch/alpha/defconfig
--- v2.1.12/linux/arch/alpha/defconfig	Fri Nov 15 23:49:06 1996
+++ linux/arch/alpha/defconfig	Sat Nov 23 12:29:03 1996
@@ -67,6 +67,7 @@
 #
 # Networking options
 #
+# CONFIG_NETLINK is not set
 # CONFIG_FIREWALL is not set
 # CONFIG_NET_ALIAS is not set
 CONFIG_INET=y
@@ -89,7 +90,6 @@
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
 # CONFIG_AX25 is not set
-# CONFIG_NETLINK is not set
 
 #
 # SCSI support
@@ -145,12 +145,9 @@
 # Network device support
 #
 CONFIG_NETDEVICES=y
+# CONFIG_ARCNET is not set
 CONFIG_DUMMY=m
 # CONFIG_EQUALIZER is not set
-# CONFIG_PLIP is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-# CONFIG_NET_RADIO is not set
 CONFIG_NET_ETHERNET=y
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_LANCE is not set
@@ -162,8 +159,12 @@
 # CONFIG_DEC_ELCP is not set
 # CONFIG_DGRS is not set
 # CONFIG_NET_POCKET is not set
+# CONFIG_FDDI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_NET_RADIO is not set
+# CONFIG_SLIP is not set
 # CONFIG_TR is not set
-# CONFIG_ARCNET is not set
 
 #
 # ISDN subsystem
diff -u --recursive --new-file v2.1.12/linux/arch/alpha/kernel/bios32.c linux/arch/alpha/kernel/bios32.c
--- v2.1.12/linux/arch/alpha/kernel/bios32.c	Tue Nov 19 15:53:53 1996
+++ linux/arch/alpha/kernel/bios32.c	Sat Nov 23 12:29:03 1996
@@ -35,15 +35,15 @@
 
 int pcibios_present(void)
 {
-        return 0;
+	return 0;
 }
 asmlinkage int sys_pciconfig_read()
 {
-        return 0;
+	return 0;
 }
 asmlinkage int sys_pciconfig_write()
 {
-        return 0;
+	return 0;
 }
 
 #else /* CONFIG_PCI */
@@ -56,7 +56,7 @@
 
 #include <asm/hwrpb.h>
 #include <asm/io.h>
-#include <asm/segment.h>
+#include <asm/uaccess.h>
 
 
 #define KB		1024
@@ -133,10 +133,10 @@
 	 * HACK: the PCI-to-EISA bridge does not seem to identify
 	 *       itself as a bridge... :-(
 	 */
-        if (dev->vendor == 0x8086 && dev->device == 0x0482) {
-          DBG_DEVS(("disable_dev: ignoring PCEB...\n"));
-          return;
-        }
+	if (dev->vendor == 0x8086 && dev->device == 0x0482) {
+	  DBG_DEVS(("disable_dev: ignoring PCEB...\n"));
+	  return;
+	}
 #endif
 
 	bus = dev->bus;
@@ -165,10 +165,10 @@
 	 * HACK: the PCI-to-EISA bridge does not seem to identify
 	 *       itself as a bridge... :-(
 	 */
-        if (dev->vendor == 0x8086 && dev->device == 0x0482) {
-          DBG_DEVS(("layout_dev: ignoring PCEB...\n"));
-          return;
-        }
+	if (dev->vendor == 0x8086 && dev->device == 0x0482) {
+	  DBG_DEVS(("layout_dev: ignoring PCEB...\n"));
+	  return;
+	}
 #endif
 
 	bus = dev->bus;
@@ -287,7 +287,7 @@
 			pcibios_write_config_dword(bus->number, dev->devfn,
 						   reg, base);
 		}
-        }
+	}
 	/* enable device: */
 	if (dev->class >> 8 == PCI_CLASS_NOT_DEFINED ||
 	    dev->class >> 8 == PCI_CLASS_NOT_DEFINED_VGA ||
@@ -339,7 +339,7 @@
 	 */
 	for (dev = bus->devices; dev; dev = dev->sibling) {
 		if (dev->class >> 16 != PCI_BASE_CLASS_BRIDGE) {
-		        disable_dev(dev) ;
+			disable_dev(dev) ;
 		}
 	}
 
@@ -360,7 +360,7 @@
 
     	for (child = bus->children; child; child = child->next) {
 		layout_bus(child);
-        }
+	}
 	/*
 	 * Align the current bases on 4K and 1MB boundaries:
 	 */
@@ -417,7 +417,7 @@
 			 unsigned short index, unsigned char *bus,
 			 unsigned char *devfn)
 {
-        unsigned int curr = 0;
+	unsigned int curr = 0;
 	struct pci_dev *dev;
 
 	for (dev = pci_devices; dev; dev = dev->next) {
@@ -441,7 +441,7 @@
 int pcibios_find_class (unsigned int class_code, unsigned short index,
 			unsigned char *bus, unsigned char *devfn)
 {
-        unsigned int curr = 0;
+	unsigned int curr = 0;
 	struct pci_dev *dev;
 
 	for (dev = pci_devices; dev; dev = dev->next) {
@@ -460,7 +460,7 @@
 
 int pcibios_present(void)
 {
-        return 1;
+	return 1;
 }
 
 
@@ -537,8 +537,8 @@
  */
 static inline unsigned char bridge_swizzle(unsigned char pin, unsigned int slot) 
 {
-        /* swizzle */
-        return (((pin-1) + slot) % 4) + 1 ;
+	/* swizzle */
+	return (((pin-1) + slot) % 4) + 1 ;
 }
 
 /*
@@ -559,14 +559,14 @@
 	 * Go through all devices, fixing up irqs as we see fit:
 	 */
 	for (dev = pci_devices; dev; dev = dev->next) {
-	        if (dev->class >> 16 != PCI_BASE_CLASS_BRIDGE
+		if (dev->class >> 16 != PCI_BASE_CLASS_BRIDGE
 #if defined(CONFIG_ALPHA_MIKASA) || defined(CONFIG_ALPHA_ALCOR)
 		    /* PCEB (PCI to EISA bridge) does not identify
 		       itself as a bridge... :-( */
 		    && !((dev->vendor==0x8086) && (dev->device==0x482))
 #endif
 		    ) {
-		        dev->irq = 0;
+			dev->irq = 0;
 			/*
 			 * This device is not on the primary bus, we need to figure out which
 			 * interrupt pin it will come in on.   We know which slot it will come
@@ -575,7 +575,7 @@
 			 * (see the inline static routine above).
 			 */
 			if (dev->bus->number != 0) {
-			        struct pci_dev *curr = dev ;
+				struct pci_dev *curr = dev ;
 				/* read the pin and do the PCI-PCI bridge interrupt pin swizzle */
 				pcibios_read_config_byte(dev->bus->number, dev->devfn,
 							 PCI_INTERRUPT_PIN, &pin);
@@ -583,16 +583,16 @@
 				if (pin == 0) pin = 1 ;
 				/* follow the chain of bridges, swizzling as we go */
 				do {
-				        /* swizzle */
-				        pin = bridge_swizzle(pin, PCI_SLOT(curr->devfn)) ;
+					/* swizzle */
+					pin = bridge_swizzle(pin, PCI_SLOT(curr->devfn)) ;
 					/* move up the chain of bridges */
 					curr = curr->bus->self ;
 				} while (curr->bus->self) ;
 				/* The slot is the slot of the last bridge. */
 				slot = PCI_SLOT(curr->devfn) ;
 			} else {
-			        /* work out the slot */
-		                slot = PCI_SLOT(dev->devfn) ;
+				/* work out the slot */
+				slot = PCI_SLOT(dev->devfn) ;
 				/* read the pin */
 				pcibios_read_config_byte(dev->bus->number,
 							 dev->devfn,
@@ -600,7 +600,7 @@
 							 &pin);
 			}
 			if (irq_tab[slot - min_idsel][pin] != -1)
-			        dev->irq = irq_tab[slot - min_idsel][pin];
+				dev->irq = irq_tab[slot - min_idsel][pin];
 #if PCI_MODIFY
 			/* tell the device: */
 			pcibios_write_config_byte(dev->bus->number, dev->devfn,
@@ -1041,7 +1041,7 @@
 	 */
 	level_bits = 0;
 	for (dev = pci_devices; dev; dev = dev->next) {
-	        if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE)
+		if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE)
 			continue;
 		dev->irq = 0;
 		if (dev->bus->number != 0) {
@@ -1169,7 +1169,7 @@
 #endif
 
 #ifdef CONFIG_TGA_CONSOLE
-        tga_console_init();
+	tga_console_init();
 #endif /* CONFIG_TGA_CONSOLE */
 
 	return mem_start;
@@ -1178,28 +1178,28 @@
 
 const char *pcibios_strerror (int error)
 {
-        static char buf[80];
+	static char buf[80];
 
-        switch (error) {
-                case PCIBIOS_SUCCESSFUL:
-                        return "SUCCESSFUL";
+	switch (error) {
+		case PCIBIOS_SUCCESSFUL:
+			return "SUCCESSFUL";
 
-                case PCIBIOS_FUNC_NOT_SUPPORTED:
-                        return "FUNC_NOT_SUPPORTED";
+		case PCIBIOS_FUNC_NOT_SUPPORTED:
+			return "FUNC_NOT_SUPPORTED";
 
-                case PCIBIOS_BAD_VENDOR_ID:
-                        return "SUCCESSFUL";
+		case PCIBIOS_BAD_VENDOR_ID:
+			return "SUCCESSFUL";
 
-                case PCIBIOS_DEVICE_NOT_FOUND:
-                        return "DEVICE_NOT_FOUND";
+		case PCIBIOS_DEVICE_NOT_FOUND:
+			return "DEVICE_NOT_FOUND";
 
-                case PCIBIOS_BAD_REGISTER_NUMBER:
-                        return "BAD_REGISTER_NUMBER";
+		case PCIBIOS_BAD_REGISTER_NUMBER:
+			return "BAD_REGISTER_NUMBER";
 
-                default:
-                        sprintf (buf, "UNKNOWN RETURN 0x%x", error);
-                        return buf;
-        }
+		default:
+			sprintf (buf, "UNKNOWN RETURN 0x%x", error);
+			return buf;
+	}
 }
 
 asmlinkage int sys_pciconfig_read(
@@ -1209,35 +1209,35 @@
 	unsigned long len,
 	unsigned char *buf)
 {
-        unsigned char ubyte;
-        unsigned short ushort;
-        unsigned int uint;
+	unsigned char ubyte;
+	unsigned short ushort;
+	unsigned int uint;
 	long err = 0;
 
 	switch (len) {
 	    case 1:
-	        err = pcibios_read_config_byte(bus, dfn, off, &ubyte);
+		err = pcibios_read_config_byte(bus, dfn, off, &ubyte);
 		if (err != PCIBIOS_SUCCESSFUL)
 		    ubyte = 0xff;
 		put_user(ubyte, buf);
 		break;
 	    case 2:
-	        err = pcibios_read_config_word(bus, dfn, off, &ushort);
+		err = pcibios_read_config_word(bus, dfn, off, &ushort);
 		if (err != PCIBIOS_SUCCESSFUL)
 		    ushort = 0xffff;
 		put_user(ushort, (unsigned short *)buf);
 		break;
 	    case 4:
-	        err = pcibios_read_config_dword(bus, dfn, off, &uint);
+		err = pcibios_read_config_dword(bus, dfn, off, &uint);
 		if (err != PCIBIOS_SUCCESSFUL)
 		    uint = 0xffffffff;
 		put_user(uint, (unsigned int *)buf);
 		break;
 	    default:
-	        err = -EINVAL;
-	        break;
+		err = -EINVAL;
+		break;
 	}
-        return err;
+	return err;
 }
 asmlinkage int sys_pciconfig_write(
 	unsigned long bus,
@@ -1246,37 +1246,43 @@
 	unsigned long len,
 	unsigned char *buf)
 {
-        unsigned char ubyte;
-        unsigned short ushort;
-        unsigned int uint;
-        long err = 0;
+	unsigned char ubyte;
+	unsigned short ushort;
+	unsigned int uint;
+	long err = 0;
 
 	switch (len) {
 	    case 1:
-                ubyte = get_user(buf);
-                err = pcibios_write_config_byte(bus, dfn, off, ubyte);
-                if (err != PCIBIOS_SUCCESSFUL) {
+		err = get_user(ubyte, buf);
+		if (err)
+			break;
+		err = pcibios_write_config_byte(bus, dfn, off, ubyte);
+		if (err != PCIBIOS_SUCCESSFUL) {
 			err = -EFAULT;
 		}
 		break;
 	    case 2:
-                ushort = get_user((unsigned short *)buf);
-                err = pcibios_write_config_word(bus, dfn, off, ushort);
-                if (err != PCIBIOS_SUCCESSFUL) {
+		err = get_user(ushort, (unsigned short *)buf);
+		if (err)
+			break;
+		err = pcibios_write_config_word(bus, dfn, off, ushort);
+		if (err != PCIBIOS_SUCCESSFUL) {
 			err = -EFAULT;
 		}
 		break;
 	    case 4:
-                uint = get_user((unsigned int *)buf);
-                err = pcibios_write_config_dword(bus, dfn, off, uint);
-                if (err != PCIBIOS_SUCCESSFUL) {
+		err = get_user(uint, (unsigned int *)buf);
+		if (err)
+			break;
+		err = pcibios_write_config_dword(bus, dfn, off, uint);
+		if (err != PCIBIOS_SUCCESSFUL) {
 			err = -EFAULT;
 		}
 		break;
 	    default:
-	        err = -EINVAL;
-	        break;
+		err = -EINVAL;
+		break;
 	}
-        return err;
+	return err;
 }
 #endif /* CONFIG_PCI */
diff -u --recursive --new-file v2.1.12/linux/arch/alpha/lib/checksum.c linux/arch/alpha/lib/checksum.c
--- v2.1.12/linux/arch/alpha/lib/checksum.c	Wed Jul 17 14:38:43 1996
+++ linux/arch/alpha/lib/checksum.c	Sat Nov 23 12:29:03 1996
@@ -44,7 +44,7 @@
  * inner loop could be unrolled a bit further, and there are better
  * ways to do the carry, but this is reasonable.
  */
-static inline unsigned long do_csum(unsigned char * buff, int len)
+static inline unsigned long do_csum(const unsigned char * buff, int len)
 {
 	int odd, count;
 	unsigned long result = 0;
@@ -127,7 +127,7 @@
  *
  * it's best to have buff aligned on a 32-bit boundary
  */
-unsigned int csum_partial(unsigned char * buff, int len, unsigned int sum)
+unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
 {
 	unsigned long result = do_csum(buff, len);
 
diff -u --recursive --new-file v2.1.12/linux/drivers/net/ibmtr.c linux/drivers/net/ibmtr.c
--- v2.1.12/linux/drivers/net/ibmtr.c	Wed Oct  9 08:55:19 1996
+++ linux/drivers/net/ibmtr.c	Sat Nov 23 12:29:03 1996
@@ -110,9 +110,6 @@
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/in.h>
-#include <asm/io.h>
-#include <asm/system.h>
-#include <asm/bitops.h>
 #include <linux/ioport.h>
 #include <linux/errno.h>
 #include <linux/string.h>
@@ -121,7 +118,12 @@
 #include <linux/delay.h>
 #include <linux/netdevice.h>
 #include <linux/trdevice.h>
-#include <stddef.h>
+#include <linux/stddef.h>
+
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/bitops.h>
+
 #include "ibmtr.h"
 
 
diff -u --recursive --new-file v2.1.12/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
--- v2.1.12/linux/drivers/scsi/sr.c	Fri Nov 15 23:49:09 1996
+++ linux/drivers/scsi/sr.c	Fri Nov 22 18:27:36 1996
@@ -35,6 +35,7 @@
 #include <linux/interrupt.h>
 #include <linux/config.h>
 #include <asm/system.h>
+#include <asm/io.h>
 
 #define MAJOR_NR SCSI_CDROM_MAJOR
 #include <linux/blk.h>
@@ -617,7 +618,7 @@
 		    if (count+1 != SCpnt->use_sg) panic("Bad sr request list");
 		    break;
 		};
-		if (((long) sgpnt[count].address) + sgpnt[count].length - 1 >
+		if (virt_to_phys(sgpnt[count].address) + sgpnt[count].length - 1 >
 		    ISA_DMA_THRESHOLD && SCpnt->host->unchecked_isa_dma) {
 		    sgpnt[count].alt_address = sgpnt[count].address;
 		    /* We try to avoid exhausting the DMA pool, since it is easier
@@ -681,7 +682,7 @@
 	    {
 	    this_count -= this_count % 4;
 	    buffer = (unsigned char *) SCpnt->request.buffer;
-	    if (((long) buffer) + (this_count << 9) > ISA_DMA_THRESHOLD &&
+	    if (virt_to_phys(buffer) + (this_count << 9) > ISA_DMA_THRESHOLD &&
 		SCpnt->host->unchecked_isa_dma)
 		buffer = (unsigned char *) scsi_malloc(this_count << 9);
 	    }
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/.blurb linux/drivers/sound/.blurb
--- v2.1.12/linux/drivers/sound/.blurb	Sun Jun 30 11:43:44 1996
+++ linux/drivers/sound/.blurb	Fri Nov 15 10:14:57 1996
@@ -1,10 +1,10 @@
 *********************************************************
 * Readme.cards (this directory) contains some card	*
 * specific instructions.				*
-* See http://www.4front-tech.com/usslite for most up    *
+* See http://www.4front-tech.com/ossfree for most up    *
 * to date info.                                         *
 * (European mirror http://personal.eunet.fi/pp/voxware) *
 *							*
-* DON'T USE PROGRAMS FROM SND_UTIL PACKAGE EARLIER THAN *
+* DON'T USE PROGRAMS FROM snd-util PACKAGE EARLIER THAN *
 * snd-util-3.5 WITH THIS SOUND DRIVER VERSION.          *
 *********************************************************
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/.objects linux/drivers/sound/.objects
--- v2.1.12/linux/drivers/sound/.objects	Tue Oct 29 19:58:13 1996
+++ linux/drivers/sound/.objects	Fri Nov 15 10:14:57 1996
@@ -56,10 +56,6 @@
 	OBJS := $(OBJS)  pas2_card.o pas2_midi.o pas2_mixer.o pas2_pcm.o
 endif
 
-ifdef CONFIG_SEQUENCER
-	OBJS := $(OBJS)  patmgr.o
-endif
-
 ifdef CONFIG_PSS
 	OBJS := $(OBJS)  pss.o
 endif
@@ -71,6 +67,7 @@
 ifdef CONFIG_SEQUENCER
 	OBJS := $(OBJS)  sequencer.o
 endif
+
 
 ifdef CONFIG_SEQUENCER
 	OBJS := $(OBJS)  sound_timer.o
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/.version linux/drivers/sound/.version
--- v2.1.12/linux/drivers/sound/.version	Tue Oct 29 19:58:13 1996
+++ linux/drivers/sound/.version	Fri Nov 15 10:14:57 1996
@@ -1,2 +1,2 @@
-3.7-beta6
-0x030701
+3.7-beta12
+0x030707
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/CHANGELOG linux/drivers/sound/CHANGELOG
--- v2.1.12/linux/drivers/sound/CHANGELOG	Tue Oct 29 19:58:13 1996
+++ linux/drivers/sound/CHANGELOG	Fri Nov 15 10:15:00 1996
@@ -1,5 +1,9 @@
-Changelog for version 3.7-beta5
--------------------------------
+Changelog for version 3.7-beta10
+--------------------------------
+
+Since 3.5-beta5
+- Disabled MIDI input with GUS PnP (Interwave). There seems to be constant
+stream of received 0x00 bytes when the MIDI receiver is enabled.
 
 Since 3.5
 - Changes almost everywhere.
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/Makefile linux/drivers/sound/Makefile
--- v2.1.12/linux/drivers/sound/Makefile	Tue Oct 29 19:58:13 1996
+++ linux/drivers/sound/Makefile	Mon Nov 18 00:33:33 1996
@@ -148,10 +148,10 @@
 
 
 lowlevel/lowlevel.o: dummy
-		cd lowlevel;make
+		cd lowlevel;make CC="$(CC)" CFLAGS="$(CFLAGS)"
 
 contrib:
-		cd lowlevel;make clean;make module CFLAGS="$(CFLAGS)"
+		cd lowlevel;make clean;make module "CC=$(CC)" CFLAGS="$(CFLAGS)"
 
 ifdef USE_DEPEND
 #
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/Makefile.old linux/drivers/sound/Makefile.old
--- v2.1.12/linux/drivers/sound/Makefile.old	Thu Jan  1 02:00:00 1970
+++ linux/drivers/sound/Makefile.old	Mon Nov 18 00:33:18 1996
@@ -0,0 +1,164 @@
+# Makefile for the Linux sound card driver
+#
+# Note 2! The CFLAGS definitions are now inherited from the
+# parent makes. (hopefully)
+#
+#
+
+.PHONY: dummy
+SUB_DIRS	= lowlevel
+VERSION		= `head -1 .version`
+TARGET_OS	= linux
+USRINCDIR	= /usr/include
+MODULEDIR	= /lib/modules/misc
+
+FIXEDOBJS	= soundcard.o dev_table.o sound_switch.o
+
+ifndef NO_LOWLEVEL
+	FIXEDOBJS := $(FIXEDOBJS) lowlevel/lowlevel.o
+endif
+
+ifeq (.defines,$(wildcard .defines))
+include .defines
+include .objects
+endif
+
+ifndef TOPDIR
+TOPDIR=/usr/src/linux
+endif
+
+
+ifndef HOSTCC
+build:
+	@echo Compiling modularized sound driver
+	@make sound.o
+	@echo Sound module compiled.
+
+install:	sound.o
+	cp sound.o $(MODULEDIR)
+endif
+
+.c.o:
+	$(CC) $(CFLAGS) -c $<
+
+ifeq ($(CONFIG_SOUND),y)
+
+all:	local.h sound.a
+
+OBJS += $(FIXEDOBJS)
+
+else
+all:
+endif
+
+ifndef HOSTCC
+#
+#	Running outside the kernel build.
+#
+CC	= gcc
+HOSTCC	= gcc
+CFLAGS	= -O2 -D__KERNEL__ -DMODULE -I/usr/src/linux/include -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe -m486
+USE_DEPEND=y
+else
+include $(TOPDIR)/Rules.make
+endif
+
+sound.a: $(OBJS) 
+	-rm -f sound.a
+	$(AR) rcs sound.a $(OBJS)
+	sync
+
+clean:
+	rm -f core core.* *.o *.a tmp_make *~ x y z *%
+	rm -f configure
+	cd lowlevel;make clean
+	cd vivo;make clean
+
+indent:
+	for n in *.c;do echo indent $$n;indent $$n;done
+
+local.h: 
+	$(MAKE) clean
+	$(MAKE) setup
+	$(MAKE) oldconfig
+	$(MAKE) dep
+	@echo
+	@echo
+	@echo
+	@echo NOTE! Object file dependencies may not be up to date. Run
+	@echo make again if kernel/driver doesn''t link properly. Restarting
+	@echo it now may save some time.
+	@echo
+	@echo
+
+config: configure
+	@$(MAKE) setup
+	@./configure > local.h
+	@echo \#define SOUND_CONFIG_DATE \"`date`\" >> local.h
+	@echo \#define SOUND_CONFIG_BY \"`whoami`\" >> local.h
+#	@echo \#define SOUND_CONFIG_HOST \"`hostname`\" >> local.h 2>/dev/null
+#	@echo \#define SOUND_CONFIG_DOMAIN \"`hostname -d`\" >> local.h 2>/dev/null
+	@echo \#define SOUND_UNAME_A \"`uname -a`\" >> local.h
+
+oldconfig: setup configure
+	@./configure -o > local.h
+	@echo \#define SOUND_CONFIG_DATE \"`date`\" >> local.h
+	@echo \#define SOUND_CONFIG_BY \"`whoami`\" >> local.h
+#	@echo \#define SOUND_CONFIG_HOST \"`hostname`\" >> local.h 2>/dev/null
+#	@echo \#define SOUND_CONFIG_DOMAIN \"`hostname -d`\" >> local.h 2>/dev/null
+	@echo \#define SOUND_UNAME_A \"`uname -a`\" >> local.h
+
+kernelconfig: setup
+	rm -f configure
+	$(HOSTCC) -o configure configure.c
+	./configure fixedlocal > local.h
+	./configure fixeddefines > .defines
+	@echo \#define SOUND_CONFIG_DATE \"`date`\" >> local.h
+	@echo \#define SOUND_CONFIG_BY \"`whoami`\" >> local.h
+#	@echo \#define SOUND_CONFIG_HOST \"`hostname`\" >> local.h 2>/dev/null
+#	@echo \#define SOUND_CONFIG_DOMAIN \"`hostname -d`\" >> local.h 2>/dev/null
+	@echo \#define SOUND_UNAME_A \"`uname -a`\" >> local.h
+
+mkscript: setup
+	rm -f configure
+	$(HOSTCC) -o configure configure.c
+	./configure script > Config.in
+	cat lowlevel/Config.tmpl >> Config.in
+	./configure fixedlocal > local.h
+	./configure fixeddefines > .defines
+
+clrconf:
+	rm -f local.h .depend synth-ld.h trix_boot.h smw-midi0001.h maui_boot.h .defines
+
+configure: configure.c
+	$(HOSTCC) -o configure configure.c
+	@cat .blurb
+
+dep:
+	$(CPP) -M $(CFLAGS) -I. *.c > .depend
+
+setup:
+	@echo Compiling Sound Driver v $(VERSION) for Linux
+
+sound.o: local.h $(FIXEDOBJS) sound.a
+	-rm -f sound.o
+	$(LD) -r -o sound.o $(FIXEDOBJS) sound.a
+
+modules: local.h sound.o
+	ln -fs `pwd`/sound.o $(TOPDIR)/modules/sound.o
+
+
+lowlevel/lowlevel.o: dummy
+		cd lowlevel;make CC="$(CC)" CFLAGS="$(CFLAGS)"
+
+contrib:
+		cd lowlevel;make clean;make module "CC=$(CC)" CFLAGS="$(CFLAGS)"
+
+ifdef USE_DEPEND
+#
+# include a dependency file if one exists
+#
+ifeq (.depend,$(wildcard .depend))
+include .depend
+endif
+endif
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/Readme linux/drivers/sound/Readme
--- v2.1.12/linux/drivers/sound/Readme	Tue Oct 29 19:58:13 1996
+++ linux/drivers/sound/Readme	Fri Nov 15 10:14:58 1996
@@ -19,7 +19,7 @@
 -  THIS VERSION ____REQUIRES____ Linux 2.1.5 OR LATER.
    ====================================================
 
-Packages "snd-util-3.5.tar.gz" and "snd-data-0.1.tar.Z"
+Packages "snd-util-3.7.tar.gz" and "snd-data-0.1.tar.Z"
 contain useful utilities to be used with this driver.
 See http://www.4front-tech.com/ossfree/getting.html for
 download instructions.
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/Readme.cards linux/drivers/sound/Readme.cards
--- v2.1.12/linux/drivers/sound/Readme.cards	Tue Oct 29 19:58:13 1996
+++ linux/drivers/sound/Readme.cards	Fri Nov 15 10:14:59 1996
@@ -85,7 +85,9 @@
 versions of isapnptools so at least version 1.6 is required with soundcards.
 
 Yet another way to use PnP cards is to use (commercial) OSS/Linux drivers.
-See http://www.4front-tech.com/linux.html for more info.
+See http://www.4front-tech.com/linux.html for more info. This is the way
+you propably like to do it if you don't waste hours of time in recompiling
+kernel and the required tools.
 
 Read this before trying to configure the driver
 -----------------------------------------------
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/ad1848.c linux/drivers/sound/ad1848.c
--- v2.1.12/linux/drivers/sound/ad1848.c	Tue Oct 29 19:58:13 1996
+++ linux/drivers/sound/ad1848.c	Fri Nov 15 10:15:08 1996
@@ -74,6 +74,7 @@
     int             timer_running;
     int             irq_ok;
     mixer_ents     *mix_devices;
+    int             mixer_output_port;
   }
 
 ad1848_info;
@@ -509,6 +510,11 @@
     if (devc->supported_devices & (1 << i))
       ad1848_mixer_set (devc, i, devc->levels[i]);
   ad1848_set_recmask (devc, SOUND_MASK_MIC);
+  devc->mixer_output_port = devc->levels[31] | AUDIO_HEADPHONE | AUDIO_LINE_OUT;
+  if (devc->mixer_output_port & AUDIO_SPEAKER)
+    ad_write (devc, 26, ad_read (devc, 26) & ~0x40);	/* Unmute mono out */
+  else
+    ad_write (devc, 26, ad_read (devc, 26) | 0x40);	/* Mute mono out */
 }
 
 static int
@@ -516,6 +522,29 @@
 {
   ad1848_info    *devc = mixer_devs[dev]->devc;
 
+  if (cmd == SOUND_MIXER_PRIVATE1)
+    {
+      int             val;
+
+      get_user (val, (int *) arg);
+
+      if (val == 0xffff)
+	return ioctl_out (arg, devc->mixer_output_port);
+
+      val &= (AUDIO_SPEAKER | AUDIO_HEADPHONE | AUDIO_LINE_OUT);
+
+      devc->mixer_output_port = val;
+      val |= AUDIO_HEADPHONE | AUDIO_LINE_OUT;	/* Always on */
+      devc->mixer_output_port = val;
+
+      if (val & AUDIO_SPEAKER)
+	ad_write (devc, 26, ad_read (devc, 26) & ~0x40);	/* Unmute mono out */
+      else
+	ad_write (devc, 26, ad_read (devc, 26) | 0x40);		/* Mute mono out */
+
+      return ioctl_out (arg, devc->mixer_output_port);
+    }
+
   if (((cmd >> 8) & 0xff) == 'M')
     {
       int             val;
@@ -961,25 +990,26 @@
   ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
 
   ad_mute (devc);
-  {
+  if (devc->model != MD_4232)
+    {
 /*
  * This code fragment ensures that the playback FIFO is empty before
  * setting the codec for playback. Enabling playback for a moment should
  * be enough to do that.
  */
-    int             tmout;
+      int             tmout;
 
-    ad_write (devc, 9, ad_read (devc, 9) | 0x01);	/* Enable playback */
-    disable_dma (audio_devs[dev]->dmachan1);
-    for (tmout = 0; tmout < 1000000; tmout++)
-      if (ad_read (devc, 11) & 0x10)	/* DRQ active */
-	if (tmout > 10000)
-	  break;
-    ad_write (devc, 9, ad_read (devc, 9) & ~0x01);	/* Stop playback */
+      ad_write (devc, 9, ad_read (devc, 9) | 0x01);	/* Enable playback */
+      disable_dma (audio_devs[dev]->dmachan1);
+      for (tmout = 0; tmout < 1000000; tmout++)
+	if (ad_read (devc, 11) & 0x10)	/* DRQ active */
+	  if (tmout > 10000)
+	    break;
+      ad_write (devc, 9, ad_read (devc, 9) & ~0x01);	/* Stop playback */
 
-    enable_dma (audio_devs[dev]->dmachan1);
-    devc->audio_mode &= ~PCM_ENABLE_OUTPUT;
-  }
+      enable_dma (audio_devs[dev]->dmachan1);
+      devc->audio_mode &= ~PCM_ENABLE_OUTPUT;
+    }
 
   return ad1848_prepare_for_IO (dev, bsize, bcount);
 }
@@ -1415,7 +1445,7 @@
   for (i = 0; i < 16; i++)
     if ((tmp1 = ad_read (devc, i)) != (tmp2 = ad_read (devc, i + 16)))
       {
-	DDB (printk ("ad1848 detect step F(%d/%x/%x) - OPTi chip?\n", i, tmp1, tmp2));
+	DDB (printk ("ad1848 detect step F(%d/%x/%x) - OPTi chip???\n", i, tmp1, tmp2));
 	if (!ad1847_flag)
 	  optiC930 = 1;
 	break;
@@ -1511,6 +1541,12 @@
 		  devc->model = MD_4232;
 		  break;
 
+		case 0x03:
+		case 0x83:
+		  devc->chip_name = "CS4236";
+		  devc->model = MD_4232;
+		  break;
+
 		case 0x80:
 		  {
 		    /* 
@@ -1539,6 +1575,7 @@
 		  break;
 
 		default:	/* Assume CS4231 or OPTi 82C930 */
+		  DDB (printk ("ad1848: I25 = %02x\n", ad_read (devc, 25)));
 		  if (optiC930)
 		    {
 		      devc->chip_name = "82C930";
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/ad1848_mixer.h linux/drivers/sound/ad1848_mixer.h
--- v2.1.12/linux/drivers/sound/ad1848_mixer.h	Tue Oct 29 19:58:13 1996
+++ linux/drivers/sound/ad1848_mixer.h	Fri Nov 15 10:14:52 1996
@@ -166,3 +166,13 @@
 
 #define LEFT_CHN	0
 #define RIGHT_CHN	1
+
+/*
+ * Channel enable bits for ioctl(SOUND_MIXER_PRIVATE1)
+ */
+
+#ifndef AUDIO_SPEAKER
+#define	AUDIO_SPEAKER		0x01	/* Enable mono output */
+#define	AUDIO_HEADPHONE		0x02	/* Sparc only */
+#define	AUDIO_LINE_OUT		0x04	/* Sparc only */
+#endif
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/dev_table.h linux/drivers/sound/dev_table.h
--- v2.1.12/linux/drivers/sound/dev_table.h	Tue Oct 29 19:58:14 1996
+++ linux/drivers/sound/dev_table.h	Fri Nov 22 21:52:36 1996
@@ -210,7 +210,6 @@
 	void (*controller) (int dev, int voice, int ctrl_num, int value);
 	void (*panning) (int dev, int voice, int value);
 	void (*volume_method) (int dev, int mode);
-	int (*pmgr_interface) (int dev, struct patmgr_info *info);
 	void (*bender) (int dev, int chn, int value);
 	int (*alloc_voice) (int dev, int chn, int note, struct voice_alloc_info *alloc);
 	void (*setup_voice) (int dev, int voice, int chn);
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/dmabuf.c linux/drivers/sound/dmabuf.c
--- v2.1.12/linux/drivers/sound/dmabuf.c	Tue Oct 29 19:58:14 1996
+++ linux/drivers/sound/dmabuf.c	Fri Nov 15 10:15:16 1996
@@ -203,7 +203,10 @@
   }
 
   if (dmap->raw_buf == NULL)
-    return -ENOSPC;		/* Memory allocation failed during boot */
+    {
+      printk ("Sound: DMA buffers not available\n");
+      return -ENOSPC;		/* Memory allocation failed during boot */
+    }
 
   if (sound_open_dma (chan, audio_devs[dev]->name))
     {
@@ -452,6 +455,9 @@
 
   dmap->dma_mode |= DMODE_OUTPUT;
 
+  if (dmap->counts[dmap->qhead] == 0)
+    dmap->counts[dmap->qhead] = dmap->fragment_size;
+
   audio_devs[dev]->d->output_block (dev, dmap->raw_buf_phys +
 				    dmap->qhead * dmap->fragment_size,
 				    dmap->counts[dmap->qhead], 0,
@@ -870,7 +876,7 @@
       pos = get_dma_residue (chan);
       if (chan > 3)		/* Word count */
 	pos *= 2;
-      pos = dmap->bytes_in_use - pos;
+      pos = dmap->bytes_in_use - pos - 1;
       if (pos < 0)
 	pos = 0;
       if (pos > dmap->bytes_in_use)
@@ -1605,6 +1611,9 @@
 
       if (!(audio_devs[dev]->flags & DMA_AUTOMODE))
 	{
+	  if (dmap->counts[dmap->qhead] == 0)
+	    dmap->counts[dmap->qhead] = dmap->fragment_size;
+
 	  audio_devs[dev]->d->output_block (dev, dmap->raw_buf_phys +
 					  dmap->qhead * dmap->fragment_size,
 					    dmap->counts[dmap->qhead], 1,
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/gus_midi.c linux/drivers/sound/gus_midi.c
--- v2.1.12/linux/drivers/sound/gus_midi.c	Tue Oct 29 19:58:15 1996
+++ linux/drivers/sound/gus_midi.c	Fri Nov 15 10:15:16 1996
@@ -27,6 +27,7 @@
 static void     (*midi_input_intr) (int dev, unsigned char data);
 
 static unsigned char tmp_queue[256];
+extern int      gus_pnp_flag;
 static volatile int qlen;
 static volatile unsigned char qhead, qtail;
 extern int      gus_base, gus_irq, gus_dma;
@@ -58,10 +59,11 @@
   input_opened = 0;
 
   if (mode == OPEN_READ || mode == OPEN_READWRITE)
-    {
-      gus_midi_control |= MIDI_ENABLE_RCV;
-      input_opened = 1;
-    }
+    if (!gus_pnp_flag)
+      {
+	gus_midi_control |= MIDI_ENABLE_RCV;
+	input_opened = 1;
+      }
 
 
   outb ((gus_midi_control), u_MidiControl);	/* Enable */
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/gus_wave.c linux/drivers/sound/gus_wave.c
--- v2.1.12/linux/drivers/sound/gus_wave.c	Tue Oct 29 19:58:15 1996
+++ linux/drivers/sound/gus_wave.c	Fri Nov 15 10:15:21 1996
@@ -1749,9 +1749,6 @@
 
   count -= sizeof_patch;
 
-  if (gus_mem_size == 0)
-    return -ENOSPC;
-
   if (free_sample >= MAX_SAMPLE)
     {
       printk ("GUS: Sample table full\n");
@@ -1765,6 +1762,12 @@
 
   copy_from_user (&((char *) &patch)[offs], &(addr)[offs], sizeof_patch - offs);
 
+  if (patch.mode & WAVE_ROM)
+    return -EINVAL;
+  if (gus_mem_size == 0)
+
+    return -ENOSPC;
+
   instr = patch.instr_no;
 
   if (instr < 0 || instr > MAX_PATCH)
@@ -1993,8 +1996,6 @@
 
   free_mem_ptr += patch.len;
 
-  if (!pmgr_flag)
-    pmgr_inform (dev, PM_E_PATCH_LOADED, instr, free_sample, 0, 0);
   free_sample++;
   return 0;
 }
@@ -2275,40 +2276,6 @@
       return ioctl_out (arg, -EINVAL);
       break;
 
-/* This is just a temporary hack used for reading the ROM patch set. */
-
-    case SNDCTL_PMGR_ACCESS:
-      {
-	copr_msg       *buf;
-	int             i, pos;
-
-	buf = (copr_msg *) vmalloc (sizeof (copr_msg));
-	if (buf == NULL)
-	  return -ENOSPC;
-
-	copy_from_user ((char *) buf, &((char *) arg)[0], sizeof (*buf));
-
-	pos = buf->len;
-
-	gus_write8 (0x53, gus_look8 (0x53) | 0x02);	/* Select ROM I/O access */
-
-	for (i = 0; i < 2048; i++)
-	  {
-	    buf->data[i] = gus_peek (pos + i);
-	  }
-	gus_write8 (0x53, gus_look8 (0x53) & ~0x02);	/* Select DRAM I/O access */
-	buf->len = 2048;	/* feed back number of WORDs sent */
-	{
-	  char           *fixit = (char *) buf;
-
-	  copy_to_user (&((char *) arg)[0], fixit, sizeof (*buf));
-	};
-	vfree (buf);
-
-	return 0;
-      }
-      break;
-
     }
   return -EINVAL;
 }
@@ -2811,189 +2778,6 @@
 }
 
 static int
-guswave_patchmgr (int dev, struct patmgr_info *rec)
-{
-  int             i, n;
-
-  switch (rec->command)
-    {
-    case PM_GET_DEVTYPE:
-      rec->parm1 = PMTYPE_WAVE;
-      return 0;
-      break;
-
-    case PM_GET_NRPGM:
-      rec->parm1 = MAX_PATCH;
-      return 0;
-      break;
-
-    case PM_GET_PGMMAP:
-      rec->parm1 = MAX_PATCH;
-
-      for (i = 0; i < MAX_PATCH; i++)
-	{
-	  int             ptr = patch_table[i];
-
-	  rec->data.data8[i] = 0;
-
-	  while (ptr >= 0 && ptr < free_sample && ptr != NOT_SAMPLE)
-	    {
-	      rec->data.data8[i]++;
-	      ptr = samples[ptr].key;	/* Follow link */
-	    }
-	}
-      return 0;
-      break;
-
-    case PM_GET_PGM_PATCHES:
-      {
-	int             ptr = patch_table[rec->parm1];
-
-	n = 0;
-
-	while (ptr >= 0 && ptr < free_sample && ptr != NOT_SAMPLE)
-	  {
-	    rec->data.data32[n++] = ptr;
-	    ptr = samples[ptr].key;	/* Follow link */
-	  }
-      }
-      rec->parm1 = n;
-      return 0;
-      break;
-
-    case PM_GET_PATCH:
-      {
-	int             ptr = rec->parm1;
-	struct patch_info *pat;
-
-	if (ptr < 0 || ptr >= free_sample)
-	  return -EINVAL;
-
-	memcpy (rec->data.data8, (char *) &samples[ptr],
-		sizeof (struct patch_info));
-
-	pat = (struct patch_info *) rec->data.data8;
-
-	pat->key = GUS_PATCH;	/* Restore patch type */
-	rec->parm1 = sample_ptrs[ptr];	/* DRAM location */
-	rec->parm2 = sizeof (struct patch_info);
-      }
-      return 0;
-      break;
-
-    case PM_SET_PATCH:
-      {
-	int             ptr = rec->parm1;
-	struct patch_info *pat;
-
-	if (ptr < 0 || ptr >= free_sample)
-	  return -EINVAL;
-
-	pat = (struct patch_info *) rec->data.data8;
-
-	if (pat->len > samples[ptr].len)	/* Cannot expand sample */
-	  return -EINVAL;
-
-	pat->key = samples[ptr].key;	/* Ensure the link is correct */
-
-	memcpy ((char *) &samples[ptr], rec->data.data8,
-		sizeof (struct patch_info));
-
-	pat->key = GUS_PATCH;
-      }
-      return 0;
-      break;
-
-    case PM_READ_PATCH:	/* Returns a block of wave data from the DRAM */
-      {
-	int             sample = rec->parm1;
-	int             n;
-	long            offs = rec->parm2;
-	int             l = rec->parm3;
-
-	if (sample < 0 || sample >= free_sample)
-	  return -EINVAL;
-
-	if (offs < 0 || offs >= samples[sample].len)
-	  return -EINVAL;	/* Invalid offset */
-
-	n = samples[sample].len - offs;		/* Num of bytes left */
-
-	if (l > n)
-	  l = n;
-
-	if (l > sizeof (rec->data.data8))
-	  l = sizeof (rec->data.data8);
-
-	if (l <= 0)
-	  return -EINVAL;	/*
-				   * Was there a bug?
-				 */
-
-	offs += sample_ptrs[sample];	/*
-					 * Begin offset + offset to DRAM
-					 */
-
-	for (n = 0; n < l; n++)
-	  rec->data.data8[n] = gus_peek (offs++);
-	rec->parm1 = n;		/*
-				 * Nr of bytes copied
-				 */
-      }
-      return 0;
-      break;
-
-    case PM_WRITE_PATCH:	/*
-				 * Writes a block of wave data to the DRAM
-				 */
-      {
-	int             sample = rec->parm1;
-	int             n;
-	long            offs = rec->parm2;
-	int             l = rec->parm3;
-
-	if (sample < 0 || sample >= free_sample)
-	  return -EINVAL;
-
-	if (offs < 0 || offs >= samples[sample].len)
-	  return -EINVAL;	/*
-				   * Invalid offset
-				 */
-
-	n = samples[sample].len - offs;		/*
-						   * Nr of bytes left
-						 */
-
-	if (l > n)
-	  l = n;
-
-	if (l > sizeof (rec->data.data8))
-	  l = sizeof (rec->data.data8);
-
-	if (l <= 0)
-	  return -EINVAL;	/*
-				   * Was there a bug?
-				 */
-
-	offs += sample_ptrs[sample];	/*
-					 * Begin offsets + offset to DRAM
-					 */
-
-	for (n = 0; n < l; n++)
-	  gus_poke (offs++, rec->data.data8[n]);
-	rec->parm1 = n;		/*
-				 * Nr of bytes copied
-				 */
-      }
-      return 0;
-      break;
-
-    default:
-      return -EINVAL;
-    }
-}
-
-static int
 guswave_alloc (int dev, int chn, int note, struct voice_alloc_info *alloc)
 {
   int             i, p, best = -1, best_time = 0x7fffffff;
@@ -3058,7 +2842,6 @@
   guswave_controller,
   guswave_panning,
   guswave_volume_method,
-  guswave_patchmgr,
   guswave_bender,
   guswave_alloc,
   guswave_setup_voice
@@ -3440,8 +3223,8 @@
     }
 
   conf_printf (tmp2, hw_config);
-  strncpy (gus_info.name, tmp2, sizeof (tmp2));
-  gus_info.name[sizeof (tmp2) - 1] = 0;
+  tmp2[sizeof (gus_info.name) - 1] = 0;
+  strncpy (gus_info.name, tmp2, strlen (tmp2));
 
   if (num_synths >= MAX_SYNTH_DEV)
     printk ("GUS Error: Too many synthesizers\n");
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/ics2101.c linux/drivers/sound/ics2101.c
--- v2.1.12/linux/drivers/sound/ics2101.c	Tue Oct 29 19:58:15 1996
+++ linux/drivers/sound/ics2101.c	Fri Nov 15 10:15:22 1996
@@ -121,35 +121,41 @@
   if (((cmd >> 8) & 0xff) == 'M')
     {
       if (_IOC_DIR (cmd) & _IOC_WRITE)
-	switch (cmd & 0xff)
-	  {
-	  case SOUND_MIXER_RECSRC:
-	    return gus_default_mixer_ioctl (dev, cmd, arg);
-	    break;
-
-	  case SOUND_MIXER_MIC:
-	    return ioctl_out (arg, set_volumes (DEV_MIC, ioctl_in (arg)));
-	    break;
-
-	  case SOUND_MIXER_CD:
-	    return ioctl_out (arg, set_volumes (DEV_CD, ioctl_in (arg)));
-	    break;
-
-	  case SOUND_MIXER_LINE:
-	    return ioctl_out (arg, set_volumes (DEV_LINE, ioctl_in (arg)));
-	    break;
-
-	  case SOUND_MIXER_SYNTH:
-	    return ioctl_out (arg, set_volumes (DEV_GF1, ioctl_in (arg)));
-	    break;
-
-	  case SOUND_MIXER_VOLUME:
-	    return ioctl_out (arg, set_volumes (DEV_VOL, ioctl_in (arg)));
-	    break;
-
-	  default:
-	    return -EINVAL;
-	  }
+	{
+	  int             val;
+
+	  get_user (val, (int *) arg);
+
+	  switch (cmd & 0xff)
+	    {
+	    case SOUND_MIXER_RECSRC:
+	      return gus_default_mixer_ioctl (dev, cmd, arg);
+	      break;
+
+	    case SOUND_MIXER_MIC:
+	      return ioctl_out (arg, set_volumes (DEV_MIC, val));
+	      break;
+
+	    case SOUND_MIXER_CD:
+	      return ioctl_out (arg, set_volumes (DEV_CD, val));
+	      break;
+
+	    case SOUND_MIXER_LINE:
+	      return ioctl_out (arg, set_volumes (DEV_LINE, val));
+	      break;
+
+	    case SOUND_MIXER_SYNTH:
+	      return ioctl_out (arg, set_volumes (DEV_GF1, val));
+	      break;
+
+	    case SOUND_MIXER_VOLUME:
+	      return ioctl_out (arg, set_volumes (DEV_VOL, val));
+	      break;
+
+	    default:
+	      return -EINVAL;
+	    }
+	}
       else
 	switch (cmd & 0xff)	/*
 				 * Return parameters
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/lowlevel/awe_wave.c linux/drivers/sound/lowlevel/awe_wave.c
--- v2.1.12/linux/drivers/sound/lowlevel/awe_wave.c	Tue Oct 29 19:58:15 1996
+++ linux/drivers/sound/lowlevel/awe_wave.c	Thu Oct 31 07:17:02 1996
@@ -245,7 +245,6 @@
 static void awe_controller(int dev, int voice, int ctrl_num, int value);
 static void awe_panning(int dev, int voice, int value);
 static void awe_volume_method(int dev, int mode);
-static int awe_patchmgr(int dev, struct patmgr_info *rec);
 static void awe_bender(int dev, int voice, int value);
 static int awe_alloc(int dev, int chn, int note, struct voice_alloc_info *alloc);
 static void awe_setup_voice(int dev, int voice, int chn);
@@ -374,7 +373,6 @@
 	awe_controller,
 	awe_panning,
 	awe_volume_method,
-	awe_patchmgr,
 	awe_bender,
 	awe_alloc,
 	awe_setup_voice
@@ -2541,15 +2539,6 @@
 {
 	/* not impremented */
 	DEBUG(0,printk("AWE32: [volmethod mode=%d]\n", mode));
-}
-
-
-/* patch manager */
-static int
-awe_patchmgr(int dev, struct patmgr_info *rec)
-{
-	FATALERR(printk("AWE32 Warning: patch manager control not supported\n"));
-	return 0;
 }
 
 
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/midi_synth.c linux/drivers/sound/midi_synth.c
--- v2.1.12/linux/drivers/sound/midi_synth.c	Tue Oct 29 19:58:15 1996
+++ linux/drivers/sound/midi_synth.c	Fri Nov 15 10:15:24 1996
@@ -652,12 +652,6 @@
   midi_outc (orig_dev, value & 0x7f);
 }
 
-int
-midi_synth_patchmgr (int dev, struct patmgr_info *rec)
-{
-  return -EINVAL;
-}
-
 void
 midi_synth_bender (int dev, int channel, int value)
 {
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/midi_synth.h linux/drivers/sound/midi_synth.h
--- v2.1.12/linux/drivers/sound/midi_synth.h	Sun Jun 30 11:43:38 1996
+++ linux/drivers/sound/midi_synth.h	Fri Nov 15 10:14:54 1996
@@ -12,7 +12,6 @@
 void midi_synth_panning (int dev, int channel, int pressure);
 void midi_synth_aftertouch (int dev, int channel, int pressure);
 void midi_synth_controller (int dev, int channel, int ctrl_num, int value);
-int midi_synth_patchmgr (int dev, struct patmgr_info *rec);
 void midi_synth_bender (int dev, int chn, int value);
 void midi_synth_setup_voice (int dev, int voice, int chn);
 int midi_synth_send_sysex(int dev, unsigned char *bytes,int len);
@@ -40,7 +39,6 @@
   midi_synth_controller,
   midi_synth_panning,
   NULL,
-  midi_synth_patchmgr,
   midi_synth_bender,
   NULL,	/* alloc_voice */
   midi_synth_setup_voice,
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/mpu401.c linux/drivers/sound/mpu401.c
--- v2.1.12/linux/drivers/sound/mpu401.c	Tue Oct 29 19:58:15 1996
+++ linux/drivers/sound/mpu401.c	Fri Nov 15 10:15:27 1996
@@ -21,8 +21,6 @@
 #if (defined(CONFIG_MPU401) || defined(CONFIG_MPU_EMU)) && defined(CONFIG_MIDI)
 #include "coproc.h"
 
-static int      init_sequence[20];	/* NOTE! pos 0 = len, start pos 1. */
-
 
 #ifdef CONFIG_SEQUENCER
 static int      timer_mode = TMR_INTERNAL, timer_caps = TMR_INTERNAL;
@@ -775,23 +773,20 @@
 mpu401_ioctl (int dev, unsigned cmd, caddr_t arg)
 {
   struct mpu_config *devc;
+  int             val;
 
   devc = &dev_conf[dev];
 
   switch (cmd)
     {
-    case 1:
-      copy_from_user ((char *) init_sequence, &((char *) arg)[0], sizeof (init_sequence));
-      return 0;
-      break;
-
     case SNDCTL_MIDI_MPUMODE:
       if (!(devc->capabilities & MPU_CAP_INTLG))	/* No intelligent mode */
 	{
 	  printk ("MPU-401: Intelligent mode not supported by the HW\n");
 	  return -EINVAL;
 	}
-      set_uart_mode (dev, devc, !ioctl_in (arg));
+      get_user (val, (int *) arg);
+      set_uart_mode (dev, devc, !val);
       return 0;
       break;
 
@@ -976,7 +971,6 @@
   midi_synth_controller,
   midi_synth_panning,
   NULL,
-  midi_synth_patchmgr,
   midi_synth_bender,
   NULL,				/* alloc */
   midi_synth_setup_voice,
@@ -1639,8 +1633,9 @@
 
     case SNDCTL_TMR_TIMEBASE:
       {
-	int             val = (int) ioctl_in (arg);
+	int             val;
 
+	get_user (val, (int *) arg);
 	if (val)
 	  set_timebase (midi_dev, val);
 
@@ -1650,9 +1645,11 @@
 
     case SNDCTL_TMR_TEMPO:
       {
-	int             val = (int) ioctl_in (arg);
+	int             val;
 	int             ret;
 
+	get_user (val, (int *) arg);
+
 	if (val)
 	  {
 	    if (val < 8)
@@ -1673,10 +1670,15 @@
       break;
 
     case SNDCTL_SEQ_CTRLRATE:
-      if (ioctl_in (arg) != 0)	/* Can't change */
-	return -EINVAL;
+      {
+	int             val;
+
+	get_user (val, (int *) arg);
+	if (val != 0)		/* Can't change */
+	  return -EINVAL;
 
-      return ioctl_out (arg, ((curr_tempo * curr_timebase) + 30) / 60);
+	return ioctl_out (arg, ((curr_tempo * curr_timebase) + 30) / 60);
+      }
       break;
 
     case SNDCTL_SEQ_GETTIME:
@@ -1684,7 +1686,7 @@
       break;
 
     case SNDCTL_TMR_METRONOME:
-      metronome_mode = (int) ioctl_in (arg);
+      get_user (metronome_mode, (int *) arg);
       setup_metronome (midi_dev);
       return 0;
       break;
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/opl3.c linux/drivers/sound/opl3.c
--- v2.1.12/linux/drivers/sound/opl3.c	Tue Oct 29 19:58:15 1996
+++ linux/drivers/sound/opl3.c	Fri Nov 15 10:15:28 1996
@@ -127,7 +127,6 @@
 	    return -EINVAL;
 	  }
 
-	pmgr_inform (dev, PM_E_PATCH_LOADED, ins.channel, 0, 0, 0);
 	return store_instr (ins.channel, &ins);
       }
       break;
@@ -1015,12 +1014,6 @@
     }
 }
 
-static int
-opl3_patchmgr (int dev, struct patmgr_info *rec)
-{
-  return -EINVAL;
-}
-
 static void
 opl3_bender (int dev, int voice, int value)
 {
@@ -1131,7 +1124,6 @@
   opl3_controller,
   opl3_panning,
   opl3_volume_method,
-  opl3_patchmgr,
   opl3_bender,
   opl3_alloc_voice,
   opl3_setup_voice
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/os.h linux/drivers/sound/os.h
--- v2.1.12/linux/drivers/sound/os.h	Tue Oct 29 19:58:15 1996
+++ linux/drivers/sound/os.h	Fri Nov 15 10:14:57 1996
@@ -1,3 +1,9 @@
+
+#define ALLOW_SELECT
+#undef NO_INLINE_ASM
+#define SHORT_BANNERS
+#define MANUAL_PNP
+
 #ifdef MODULE
 #define __NO_VERSION__
 #include <linux/module.h>
@@ -6,6 +12,9 @@
 #include <linux/modversions.h>
 #endif
 #endif
+#if LINUX_VERSION_CODE > 131328
+#define LINUX21X
+#endif
 
 #include <linux/param.h>
 #include <linux/types.h>
@@ -15,12 +24,13 @@
 #include <linux/sched.h>
 #include <linux/ctype.h>
 #include <asm/io.h>
-#include <asm/uaccess.h>
+#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/dma.h>
 #include <linux/wait.h>
 #include <linux/malloc.h>
 #include <linux/vmalloc.h>
+#include <asm/uaccess.h>
 #include <linux/string.h>
 #include <linux/ioport.h>
 #include <linux/utsname.h>
@@ -32,6 +42,8 @@
 #define FALSE	0
 #define TRUE	1
 
+
+
 struct snd_wait {
 	  int opts;
 	};
@@ -41,5 +53,11 @@
 extern void sound_free_dma(int chn);
 extern void sound_close_dma(int chn);
 
+#define RUNTIME_DMA_ALLOC
+
 extern caddr_t sound_mem_blocks[1024];
 extern int sound_nblocks;
+
+#undef PSEUDO_DMA_AUTOINIT
+#define ALLOW_BUFFER_MAPPING
+
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/pas2_midi.c linux/drivers/sound/pas2_midi.c
--- v2.1.12/linux/drivers/sound/pas2_midi.c	Tue Oct 29 19:58:16 1996
+++ linux/drivers/sound/pas2_midi.c	Fri Nov 15 10:15:29 1996
@@ -3,9 +3,17 @@
  *
  * The low level driver for the PAS Midi Interface.
  */
+/*
+ * Copyright (C) by Hannu Savolainen 1993-1996
+ *
+ * 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.
+ */
+#include <linux/config.h>
+
 
 #include "sound_config.h"
-#include <linux/config.h>
 
 #if defined(CONFIG_PAS) && defined(CONFIG_MIDI)
 
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/pas2_mixer.c linux/drivers/sound/pas2_mixer.c
--- v2.1.12/linux/drivers/sound/pas2_mixer.c	Tue Oct 29 19:58:16 1996
+++ linux/drivers/sound/pas2_mixer.c	Fri Nov 15 10:15:30 1996
@@ -6,7 +6,15 @@
  * Mixer routines for the Pro Audio Spectrum cards.
  */
 
+/*
+ * Copyright (C) by Hannu Savolainen 1993-1996
+ *
+ * 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.
+ */
 #include <linux/config.h>
+
 #include "sound_config.h"
 
 #if defined(CONFIG_PAS)
@@ -296,8 +304,12 @@
 
   if (((cmd >> 8) & 0xff) == 'M')
     {
+      int             v;
+
+      get_user (v, (int *) arg);
+
       if (_IOC_DIR (cmd) & _IOC_WRITE)
-	return ioctl_out (arg, pas_mixer_set (cmd & 0xff, ioctl_in (arg)));
+	return ioctl_out (arg, pas_mixer_set (cmd & 0xff, v));
       else
 	{			/*
 				 * Read parameters
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/pas2_pcm.c linux/drivers/sound/pas2_pcm.c
--- v2.1.12/linux/drivers/sound/pas2_pcm.c	Tue Oct 29 19:58:16 1996
+++ linux/drivers/sound/pas2_pcm.c	Fri Nov 15 10:15:30 1996
@@ -148,6 +148,8 @@
 static int
 pas_audio_ioctl (int dev, unsigned int cmd, caddr_t arg, int local)
 {
+  int             val;
+
   DEB (printk ("pas2_pcm.c: static int pas_audio_ioctl(unsigned int cmd = %X, unsigned int arg = %X)\n", cmd, arg));
 
   switch (cmd)
@@ -155,7 +157,8 @@
     case SOUND_PCM_WRITE_RATE:
       if (local)
 	return pcm_set_speed ((int) arg);
-      return ioctl_out (arg, pcm_set_speed (ioctl_in (arg)));
+      get_user (val, (int *) arg);
+      return ioctl_out (arg, pcm_set_speed (val));
       break;
 
     case SOUND_PCM_READ_RATE:
@@ -167,13 +170,15 @@
     case SNDCTL_DSP_STEREO:
       if (local)
 	return pcm_set_channels ((int) arg + 1) - 1;
-      return ioctl_out (arg, pcm_set_channels (ioctl_in (arg) + 1) - 1);
+      get_user (val, (int *) arg);
+      return ioctl_out (arg, pcm_set_channels (val + 1) - 1);
       break;
 
     case SOUND_PCM_WRITE_CHANNELS:
       if (local)
 	return pcm_set_channels ((int) arg);
-      return ioctl_out (arg, pcm_set_channels (ioctl_in (arg)));
+      get_user (val, (int *) arg);
+      return ioctl_out (arg, pcm_set_channels (val));
       break;
 
     case SOUND_PCM_READ_CHANNELS:
@@ -185,7 +190,8 @@
     case SNDCTL_DSP_SETFMT:
       if (local)
 	return pcm_set_bits ((int) arg);
-      return ioctl_out (arg, pcm_set_bits (ioctl_in (arg)));
+      get_user (val, (int *) arg);
+      return ioctl_out (arg, pcm_set_bits (val));
       break;
 
     case SOUND_PCM_READ_BITS:
@@ -196,9 +202,10 @@
     case SOUND_PCM_WRITE_FILTER:	/*
 					 * NOT YET IMPLEMENTED
 					 */
-      if (ioctl_in (arg) > 1)
+      get_user (val, (int *) arg);
+      if (val > 1)
 	return -EINVAL;
-      pcm_filter = ioctl_in (arg);
+      pcm_filter = val;
       break;
 
     case SOUND_PCM_READ_FILTER:
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/patmgr.c linux/drivers/sound/patmgr.c
--- v2.1.12/linux/drivers/sound/patmgr.c	Tue Oct 29 19:58:16 1996
+++ linux/drivers/sound/patmgr.c	Thu Jan  1 02:00:00 1970
@@ -1,292 +0,0 @@
-/*
- * sound/patmgr.c
- *
- * The patch manager interface for the /dev/sequencer
- */
-/*
- * Copyright (C) by Hannu Savolainen 1993-1996
- *
- * 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.
- */
-#include <linux/config.h>
-
-
-#define PATMGR_C
-#include "sound_config.h"
-
-#if defined(CONFIG_SEQUENCER)
-
-static struct wait_queue *server_procs[MAX_SYNTH_DEV] =
-{NULL};
-static volatile struct snd_wait server_wait_flag[MAX_SYNTH_DEV] =
-{
-  {0}};
-
-static struct patmgr_info *mbox[MAX_SYNTH_DEV] =
-{NULL};
-static volatile int msg_direction[MAX_SYNTH_DEV] =
-{0};
-
-static int      pmgr_opened[MAX_SYNTH_DEV] =
-{0};
-
-#define A_TO_S	1
-#define S_TO_A 	2
-
-static struct wait_queue *appl_proc = NULL;
-static volatile struct snd_wait appl_wait_flag =
-{0};
-
-int
-pmgr_open (int dev)
-{
-  if (dev < 0 || dev >= num_synths)
-    return -ENXIO;
-
-  if (pmgr_opened[dev])
-    return -EBUSY;
-  pmgr_opened[dev] = 1;
-
-  server_wait_flag[dev].opts = WK_NONE;
-
-  return 0;
-}
-
-void
-pmgr_release (int dev)
-{
-
-  if (mbox[dev])		/*
-				 * Killed in action. Inform the client
-				 */
-    {
-
-      mbox[dev]->key = PM_ERROR;
-      mbox[dev]->parm1 = -EIO;
-
-      if ((appl_wait_flag.opts & WK_SLEEP))
-	{
-	  appl_wait_flag.opts = WK_WAKEUP;
-	  wake_up (&appl_proc);
-	};
-    }
-
-  pmgr_opened[dev] = 0;
-}
-
-int
-pmgr_read (int dev, struct fileinfo *file, char *buf, int count)
-{
-  unsigned long   flags;
-  int             ok = 0;
-
-  if (count != sizeof (struct patmgr_info))
-    {
-      printk ("PATMGR%d: Invalid read count\n", dev);
-      return -EIO;
-    }
-
-  while (!ok && !(current->signal & ~current->blocked))
-    {
-      save_flags (flags);
-      cli ();
-
-      while (!(mbox[dev] && msg_direction[dev] == A_TO_S) &&
-	     !(current->signal & ~current->blocked))
-	{
-
-	  server_wait_flag[dev].opts = WK_SLEEP;
-	  interruptible_sleep_on (&server_procs[dev]);
-	  server_wait_flag[dev].opts &= ~WK_SLEEP;;
-	}
-
-      if (mbox[dev] && msg_direction[dev] == A_TO_S)
-	{
-	  {
-	    char           *fixit = (char *) mbox[dev];
-
-	    copy_to_user (&(buf)[0], fixit, count);
-	  };
-	  msg_direction[dev] = 0;
-	  ok = 1;
-	}
-
-      restore_flags (flags);
-
-    }
-
-  if (!ok)
-    return -EINTR;
-  return count;
-}
-
-int
-pmgr_write (int dev, struct fileinfo *file, const char *buf, int count)
-{
-  unsigned long   flags;
-
-  if (count < 4)
-    {
-      printk ("PATMGR%d: Write count < 4\n", dev);
-      return -EIO;
-    }
-
-  copy_from_user ((char *) mbox[dev], &(buf)[0], 4);
-
-  if (*(unsigned char *) mbox[dev] == SEQ_FULLSIZE)
-    {
-      int             tmp_dev;
-
-      tmp_dev = ((unsigned short *) mbox[dev])[2];
-      if (tmp_dev != dev)
-	return -ENXIO;
-
-      return synth_devs[dev]->load_patch (dev, *(unsigned short *) mbox[dev],
-					  buf, 4, count, 1);
-    }
-
-  if (count != sizeof (struct patmgr_info))
-    {
-      printk ("PATMGR%d: Invalid write count\n", dev);
-      return -EIO;
-    }
-
-  /*
-   * If everything went OK, there should be a preallocated buffer in the
-   * mailbox and a client waiting.
-   */
-
-  save_flags (flags);
-  cli ();
-
-  if (mbox[dev] && !msg_direction[dev])
-    {
-      copy_from_user (&((char *) mbox[dev])[4], &(buf)[4], count - 4);
-      msg_direction[dev] = S_TO_A;
-
-      if ((appl_wait_flag.opts & WK_SLEEP))
-	{
-	  {
-	    appl_wait_flag.opts = WK_WAKEUP;
-	    wake_up (&appl_proc);
-	  };
-	}
-    }
-
-  restore_flags (flags);
-
-  return count;
-}
-
-int
-pmgr_access (int dev, struct patmgr_info *rec)
-{
-  unsigned long   flags;
-  int             err = 0;
-
-  save_flags (flags);
-  cli ();
-
-  if (mbox[dev])
-    printk ("  PATMGR: Server %d mbox full. Why?\n", dev);
-  else
-    {
-      rec->key = PM_K_COMMAND;
-      mbox[dev] = rec;
-      msg_direction[dev] = A_TO_S;
-
-      if ((server_wait_flag[dev].opts & WK_SLEEP))
-	{
-	  {
-	    server_wait_flag[dev].opts = WK_WAKEUP;
-	    wake_up (&server_procs[dev]);
-	  };
-	}
-
-
-      appl_wait_flag.opts = WK_SLEEP;
-      interruptible_sleep_on (&appl_proc);
-      appl_wait_flag.opts &= ~WK_SLEEP;;
-
-      if (msg_direction[dev] != S_TO_A)
-	{
-	  rec->key = PM_ERROR;
-	  rec->parm1 = -EIO;
-	}
-      else if (rec->key == PM_ERROR)
-	{
-	  err = rec->parm1;
-	  if (err > 0)
-	    err = -err;
-	}
-
-      mbox[dev] = NULL;
-      msg_direction[dev] = 0;
-    }
-
-  restore_flags (flags);
-
-  return err;
-}
-
-int
-pmgr_inform (int dev, int event, unsigned long p1, unsigned long p2,
-	     unsigned long p3, unsigned long p4)
-{
-  unsigned long   flags;
-  int             err = 0;
-
-  struct patmgr_info *tmp_mbox;
-
-  if (!pmgr_opened[dev])
-    return 0;
-
-  tmp_mbox = (struct patmgr_info *) vmalloc (sizeof (struct patmgr_info));
-
-  if (tmp_mbox == NULL)
-    {
-      printk ("pmgr: Couldn't allocate memory for a message\n");
-      return 0;
-    }
-
-  save_flags (flags);
-  cli ();
-
-  if (mbox[dev])
-    printk ("  PATMGR: Server %d mbox full. Why?\n", dev);
-  else
-    {
-
-      mbox[dev] = tmp_mbox;
-      mbox[dev]->key = PM_K_EVENT;
-      mbox[dev]->command = event;
-      mbox[dev]->parm1 = p1;
-      mbox[dev]->parm2 = p2;
-      mbox[dev]->parm3 = p3;
-      msg_direction[dev] = A_TO_S;
-
-      if ((server_wait_flag[dev].opts & WK_SLEEP))
-	{
-	  {
-	    server_wait_flag[dev].opts = WK_WAKEUP;
-	    wake_up (&server_procs[dev]);
-	  };
-	}
-
-
-      appl_wait_flag.opts = WK_SLEEP;
-      interruptible_sleep_on (&appl_proc);
-      appl_wait_flag.opts &= ~WK_SLEEP;;
-      mbox[dev] = NULL;
-      msg_direction[dev] = 0;
-    }
-
-  restore_flags (flags);
-  vfree (tmp_mbox);
-
-  return err;
-}
-
-#endif
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/sb_common.c linux/drivers/sound/sb_common.c
--- v2.1.12/linux/drivers/sound/sb_common.c	Tue Oct 29 19:58:18 1996
+++ linux/drivers/sound/sb_common.c	Fri Nov 15 10:15:34 1996
@@ -191,6 +191,8 @@
 {
   int             loopc;
 
+  DDB (printk ("Entered sb_dsp_reset()\n"));
+
   if (devc->model == MDL_ESS)
     outb ((3), DSP_RESET);	/* Reset FIFO too */
   else
@@ -205,11 +207,15 @@
   for (loopc = 0; loopc < 1000 && !(inb (DSP_DATA_AVAIL) & 0x80); loopc++);
 
   if (inb (DSP_READ) != 0xAA)
-    return 0;			/* Sorry */
+    {
+      DDB (printk ("sb: No response to RESET\n"));
+      return 0;			/* Sorry */
+    }
 
   if (devc->model == MDL_ESS)
     sb_dsp_command (devc, 0xc6);	/* Enable extended mode */
 
+  DDB (printk ("sb_dsp_reset() OK\n"));
   return 1;
 }
 
@@ -220,6 +226,7 @@
 
   unsigned long   flags;
 
+  DDB (printk ("Entered dsp_get_vers()\n"));
   save_flags (flags);
   cli ();
   devc->major = devc->minor = 0;
@@ -238,6 +245,7 @@
 	    }
 	}
     }
+  DDB (printk ("DSP version %d.%d\n", devc->major, devc->minor));
   restore_flags (flags);
 }
 
@@ -896,6 +904,7 @@
   tenmicrosec (devc->osp);
   tenmicrosec (devc->osp);
   val = inb (MIXER_DATA);
+  tenmicrosec (devc->osp);
   tenmicrosec (devc->osp);
   restore_flags (flags);
 
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/sb_mixer.c linux/drivers/sound/sb_mixer.c
--- v2.1.12/linux/drivers/sound/sb_mixer.c	Tue Oct 29 19:58:18 1996
+++ linux/drivers/sound/sb_mixer.c	Fri Nov 15 10:15:35 1996
@@ -304,6 +304,19 @@
   sb_devc        *devc = mixer_devs[dev]->devc;
   int             val;
 
+/*
+ * Use ioctl(fd, SOUND_MIXER_PRIVATE1, &mode) to turn AGC off (0) or on (1).
+ */
+  if (cmd == SOUND_MIXER_PRIVATE1 && devc->model == MDL_SB16)
+    {
+      int             tmp;
+
+      get_user (tmp, (int *) arg);
+
+      sb_setmixer (devc, 0x43, (~tmp) & 0x01);
+      return 0;
+    }
+
   if (((cmd >> 8) & 0xff) == 'M')
     {
       if (_IOC_DIR (cmd) & _IOC_WRITE)
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/sequencer.c linux/drivers/sound/sequencer.c
--- v2.1.12/linux/drivers/sound/sequencer.c	Tue Oct 29 19:58:19 1996
+++ linux/drivers/sound/sequencer.c	Fri Nov 15 10:15:37 1996
@@ -77,8 +77,6 @@
 static void     seq_startplay (void);
 static int      seq_sync (void);
 static void     seq_reset (void);
-static int      pmgr_present[MAX_SYNTH_DEV] =
-{0};
 
 #if MAX_SYNTH_DEV > 15
 #error Too many synthesizer devices enabled.
@@ -95,11 +93,6 @@
 
   ev_len = seq_mode == SEQ_1 ? 4 : 8;
 
-  if (dev)			/*
-				 * Patch manager device
-				 */
-    return pmgr_read (dev - 1, file, buf, count);
-
   save_flags (flags);
   cli ();
   if (!iqlen)
@@ -264,9 +257,6 @@
   if (mode == OPEN_READ)
     return -EIO;
 
-  if (dev)
-    return pmgr_write (dev - 1, file, buf, count);
-
   c = count;
 
   while (c >= 4)
@@ -1087,9 +1077,8 @@
       return -ENXIO;
     }
 
-  if (dev)			/* Patch manager device */
+  if (dev)			/* Patch manager device (obsolete) */
     {
-      printk ("Patch manager interface is currently broken. Sorry\n");
       return -ENXIO;
     }
 
@@ -1209,10 +1198,6 @@
   midi_sleep_flag.opts = WK_NONE;
   output_threshold = SEQ_MAX_QUEUE / 2;
 
-  for (i = 0; i < num_synths; i++)
-    if (pmgr_present[i])
-      pmgr_inform (i, PM_E_OPENED, 0, 0, 0, 0);
-
   return 0;
 }
 
@@ -1273,16 +1258,6 @@
 
   DEB (printk ("sequencer_release(dev=%d)\n", dev));
 
-  if (dev)			/*
-				 * Patch manager device
-				 */
-    {
-      dev--;
-      pmgr_release (dev);
-      pmgr_present[dev] = 0;
-      return;
-    }
-
   /*
    * * Wait until the queue is empty (if we don't have nonblock)
    */
@@ -1318,10 +1293,6 @@
 	  }
     }
 
-  for (i = 0; i < num_synths; i++)
-    if (pmgr_present[i])
-      pmgr_inform (i, PM_E_CLOSED, 0, 0, 0, 0);
-
   for (i = 0; i < max_mididev; i++)
     {
       if (midi_opened[i])
@@ -1523,7 +1494,7 @@
 sequencer_ioctl (int dev, struct fileinfo *file,
 		 unsigned int cmd, caddr_t arg)
 {
-  int             midi_dev, orig_dev;
+  int             midi_dev, orig_dev, val;
   int             mode = file->mode & O_ACCMODE;
 
   orig_dev = dev = dev >> 4;
@@ -1537,8 +1508,6 @@
     case SNDCTL_TMR_CONTINUE:
     case SNDCTL_TMR_METRONOME:
     case SNDCTL_TMR_SOURCE:
-      if (dev)			/* Patch manager */
-	return -EIO;
 
       if (seq_mode != SEQ_2)
 	return -EINVAL;
@@ -1546,8 +1515,6 @@
       break;
 
     case SNDCTL_TMR_SELECT:
-      if (dev)			/* Patch manager */
-	return -EIO;
 
       if (seq_mode != SEQ_2)
 	return -EINVAL;
@@ -1567,10 +1534,6 @@
       break;
 
     case SNDCTL_SEQ_SYNC:
-      if (dev)			/*
-				 * Patch manager
-				 */
-	return -EIO;
 
       if (mode == OPEN_READ)
 	return 0;
@@ -1583,23 +1546,14 @@
       break;
 
     case SNDCTL_SEQ_RESET:
-      if (dev)			/*
-				 * Patch manager
-				 */
-	return -EIO;
 
       seq_reset ();
       return 0;
       break;
 
     case SNDCTL_SEQ_TESTMIDI:
-      if (dev)			/*
-				 * Patch manager
-				 */
-	return -EIO;
-
       get_user (midi_dev, (int *) arg);
-      if (midi_dev >= max_mididev)
+      if (midi_dev < 0 || midi_dev >= max_mididev)
 	return -ENXIO;
 
       if (!midi_opened[midi_dev])
@@ -1619,11 +1573,6 @@
       break;
 
     case SNDCTL_SEQ_GETINCOUNT:
-      if (dev)			/*
-				 * Patch manager
-				 */
-	return -EIO;
-
       if (mode == OPEN_WRITE)
 	return 0;
       return ioctl_out (arg, iqlen);
@@ -1644,16 +1593,14 @@
       break;
 
     case SNDCTL_SEQ_CTRLRATE:
-      if (dev)			/* Patch manager */
-	return -EIO;
-
       /*
        * If *arg == 0, just return the current rate
        */
       if (seq_mode == SEQ_2)
 	return tmr->ioctl (tmr_no, cmd, arg);
 
-      if (ioctl_in (arg) != 0)
+      get_user (val, (int *) arg);
+      if (val != 0)
 	return -EINVAL;
 
       return ioctl_out (arg, HZ);
@@ -1674,9 +1621,6 @@
 	    return -EBUSY;
 	  }
 
-	if (!orig_dev && pmgr_present[dev])
-	  pmgr_inform (dev, PM_E_PATCH_RESET, 0, 0, 0, 0);
-
 	err = synth_devs[dev]->ioctl (dev, cmd, arg);
 	return err;
       }
@@ -1708,7 +1652,9 @@
 
     case SNDCTL_FM_4OP_ENABLE:
       {
-	int             dev = ioctl_in (arg);
+	int             dev;
+
+	get_user (dev, (int *) arg);
 
 	if (dev < 0 || dev >= num_synths)
 	  return -ENXIO;
@@ -1777,98 +1723,11 @@
       }
       break;
 
-    case SNDCTL_PMGR_IFACE:
-      {
-	struct patmgr_info *inf;
-	int             dev, err;
-
-	if ((inf = (struct patmgr_info *) vmalloc (sizeof (*inf))) == NULL)
-	  {
-	    printk ("patmgr: Can't allocate memory for a message\n");
-	    return -EIO;
-	  }
-
-	copy_from_user ((char *) inf, &((char *) arg)[0], sizeof (*inf));
-	dev = inf->device;
-
-	if (dev < 0 || dev >= num_synths)
-	  {
-	    vfree (inf);
-	    return -ENXIO;
-	  }
-
-	if (!synth_devs[dev]->pmgr_interface)
-	  {
-	    vfree (inf);
-	    return -ENXIO;
-	  }
-
-	if ((err = synth_devs[dev]->pmgr_interface (dev, inf)) == -1)
-	  {
-	    vfree (inf);
-	    return err;
-	  }
-
-	{
-	  char           *fixit = (char *) inf;
-
-	  copy_to_user (&((char *) arg)[0], fixit, sizeof (*inf));
-	};
-	vfree (inf);
-	return 0;
-      }
-      break;
-
-    case SNDCTL_PMGR_ACCESS:
-      {
-	struct patmgr_info *inf;
-	int             dev, err;
-
-	if ((inf = (struct patmgr_info *) vmalloc (sizeof (*inf))) == NULL)
-	  {
-	    printk ("patmgr: Can't allocate memory for a message\n");
-	    return -EIO;
-	  }
-
-	copy_from_user ((char *) inf, &((char *) arg)[0], sizeof (*inf));
-	dev = inf->device;
-
-	if (dev < 0 || dev >= num_synths)
-	  {
-	    vfree (inf);
-	    return -ENXIO;
-	  }
-
-	if (!pmgr_present[dev])
-	  {
-	    vfree (inf);
-	    return -ESRCH;
-	  }
-
-	if ((err = pmgr_access (dev, inf)) < 0)
-	  {
-	    vfree (inf);
-	    return err;
-	  }
-
-	{
-	  char           *fixit = (char *) inf;
-
-	  copy_to_user (&((char *) arg)[0], fixit, sizeof (*inf));
-	};
-	vfree (inf);
-	return 0;
-      }
-      break;
-
     case SNDCTL_SEQ_THRESHOLD:
       {
-	int             tmp = ioctl_in (arg);
+	int             tmp;
 
-	if (dev)		/*
-				 * Patch manager
-				 */
-	  return -EIO;
+	get_user (tmp, (int *) arg);
 
 	if (tmp < 1)
 	  tmp = 1;
@@ -1881,7 +1740,9 @@
 
     case SNDCTL_MIDI_PRETIME:
       {
-	int             val = ioctl_in (arg);
+	int             val;
+
+	get_user (val, (int *) arg);
 
 	if (val < 0)
 	  val = 0;
@@ -1893,11 +1754,6 @@
       break;
 
     default:
-      if (dev)			/*
-				 * Patch manager
-				 */
-	return -EIO;
-
       if (mode == OPEN_READ)
 	return -EIO;
 
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/sound_calls.h linux/drivers/sound/sound_calls.h
--- v2.1.12/linux/drivers/sound/sound_calls.h	Tue Oct 29 19:58:19 1996
+++ linux/drivers/sound/sound_calls.h	Fri Nov 15 10:14:55 1996
@@ -182,15 +182,6 @@
 /*	From opl3.c */
 void enable_opl3_mode(int left, int right, int both);
 
-/*	From patmgr.c */
-int pmgr_open(int dev);
-void pmgr_release(int dev);
-int pmgr_read (int dev, struct fileinfo *file, char * buf, int count);
-int pmgr_write (int dev, struct fileinfo *file, const char * buf, int count);
-int pmgr_access(int dev, struct patmgr_info *rec);
-int pmgr_inform(int dev, int event, unsigned long parm1, unsigned long parm2,
-				    unsigned long parm3, unsigned long parm4);
-
 /* 	From ics2101.c */
 void ics2101_mixer_init(void);
 
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/sound_timer.c linux/drivers/sound/sound_timer.c
--- v2.1.12/linux/drivers/sound/sound_timer.c	Tue Oct 29 19:58:19 1996
+++ linux/drivers/sound/sound_timer.c	Fri Nov 15 10:15:40 1996
@@ -190,6 +190,8 @@
 timer_ioctl (int dev,
 	     unsigned int cmd, caddr_t arg)
 {
+  int             val;
+
   switch (cmd)
     {
     case SNDCTL_TMR_SOURCE:
@@ -213,49 +215,43 @@
       break;
 
     case SNDCTL_TMR_TIMEBASE:
-      {
-	int             val;
-
-	get_user (val, (int *) arg);
+      get_user (val, (int *) arg);
 
-	if (val)
-	  {
-	    if (val < 1)
-	      val = 1;
-	    if (val > 1000)
-	      val = 1000;
-	    curr_timebase = val;
-	  }
+      if (val)
+	{
+	  if (val < 1)
+	    val = 1;
+	  if (val > 1000)
+	    val = 1000;
+	  curr_timebase = val;
+	}
 
-	return ioctl_out (arg, curr_timebase);
-      }
+      return ioctl_out (arg, curr_timebase);
       break;
 
     case SNDCTL_TMR_TEMPO:
-      {
-	int             val;
+      get_user (val, (int *) arg);
 
-	get_user (val, (int *) arg);
+      if (val)
+	{
+	  if (val < 8)
+	    val = 8;
+	  if (val > 250)
+	    val = 250;
+	  tmr_offs = tmr_ctr;
+	  ticks_offs += tmr2ticks (tmr_ctr);
+	  tmr_ctr = 0;
+	  curr_tempo = val;
+	  reprogram_timer ();
+	}
 
-	if (val)
-	  {
-	    if (val < 8)
-	      val = 8;
-	    if (val > 250)
-	      val = 250;
-	    tmr_offs = tmr_ctr;
-	    ticks_offs += tmr2ticks (tmr_ctr);
-	    tmr_ctr = 0;
-	    curr_tempo = val;
-	    reprogram_timer ();
-	  }
-
-	return ioctl_out (arg, curr_tempo);
-      }
+      return ioctl_out (arg, curr_tempo);
       break;
 
     case SNDCTL_SEQ_CTRLRATE:
-      if (ioctl_in (arg) != 0)	/* Can't change */
+      get_user (val, (int *) arg);
+
+      if (val != 0)		/* Can't change */
 	return -EINVAL;
 
       return ioctl_out (arg, ((curr_tempo * curr_timebase) + 30) / 60);
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/soundvers.h linux/drivers/sound/soundvers.h
--- v2.1.12/linux/drivers/sound/soundvers.h	Tue Oct 29 19:58:19 1996
+++ linux/drivers/sound/soundvers.h	Fri Nov 15 10:14:56 1996
@@ -1,2 +1,2 @@
-#define SOUND_VERSION_STRING "3.7-beta6-961029"
-#define SOUND_INTERNAL_VERSION 0x030701
+#define SOUND_VERSION_STRING "3.7-beta12-961115"
+#define SOUND_INTERNAL_VERSION 0x030707
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/sscape.c linux/drivers/sound/sscape.c
--- v2.1.12/linux/drivers/sound/sscape.c	Tue Oct 29 19:58:19 1996
+++ linux/drivers/sound/sscape.c	Fri Nov 15 10:15:42 1996
@@ -813,18 +813,14 @@
   devc->failed = 0;
 }
 
-int
-probe_sscape (struct address_info *hw_config)
+static int
+detect_ga (sscape_info * devc)
 {
   unsigned char   save;
 
-  devc->base = hw_config->io_base;
-  devc->irq = hw_config->irq;
-  devc->dma = hw_config->dma;
-
-  devc->failed = 1;
+  DDB (printk ("Entered Soundscape detect_ga(%x)\n", devc->base));
 
-  if (sscape_detected != 0 && sscape_detected != hw_config->io_base)
+  if (check_region (devc->base, 8))
     return 0;
 
   /*
@@ -876,6 +872,25 @@
       DDB (printk ("soundscape: Detect error F\n"));
       return 0;
     }
+
+  return 1;
+}
+
+int
+probe_sscape (struct address_info *hw_config)
+{
+
+  devc->base = hw_config->io_base;
+  devc->irq = hw_config->irq;
+  devc->dma = hw_config->dma;
+
+  if (sscape_detected != 0 && sscape_detected != hw_config->io_base)
+    return 0;
+
+  devc->failed = 1;
+
+  if (!detect_ga (devc))
+    return 0;
 
 #ifdef SSCAPE_DEBUG1
   /*
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/sys_timer.c linux/drivers/sound/sys_timer.c
--- v2.1.12/linux/drivers/sound/sys_timer.c	Tue Oct 29 19:58:19 1996
+++ linux/drivers/sound/sys_timer.c	Fri Nov 15 10:15:42 1996
@@ -253,10 +253,15 @@
       break;
 
     case SNDCTL_SEQ_CTRLRATE:
-      if (ioctl_in (arg) != 0)	/* Can't change */
-	return -EINVAL;
+      {
+	int             val;
 
-      return ioctl_out (arg, ((curr_tempo * curr_timebase) + 30) / 60);
+	get_user (val, (int *) arg);
+	if (val != 0)		/* Can't change */
+	  return -EINVAL;
+
+	return ioctl_out (arg, ((curr_tempo * curr_timebase) + 30) / 60);
+      }
       break;
 
     case SNDCTL_SEQ_GETTIME:
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/uart6850.c linux/drivers/sound/uart6850.c
--- v2.1.12/linux/drivers/sound/uart6850.c	Tue Oct 29 19:58:19 1996
+++ linux/drivers/sound/uart6850.c	Fri Nov 15 10:15:44 1996
@@ -14,6 +14,7 @@
  *      added 6850 support, used with COVOX SoundMaster II and custom cards.
  */
 
+#include <linux/config.h>
 #include "sound_config.h"
 
 #if defined(CONFIG_UART6850) && defined(CONFIG_MIDI)
diff -u --recursive --new-file v2.1.12/linux/drivers/sound/vivo.c linux/drivers/sound/vivo.c
--- v2.1.12/linux/drivers/sound/vivo.c	Thu Jan  1 02:00:00 1970
+++ linux/drivers/sound/vivo.c	Fri Nov 22 21:52:49 1996
@@ -0,0 +1,19 @@
+
+/*
+ * sound/vivo.c
+ *
+ * Support routines for Ensoniq Soundscape VIVO. The actual driver is
+ * in the vivo subdirectory.
+ */
+/*
+ * Copyright (C) by Hannu Savolainen 1993-1996
+ *
+ * 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.
+ */
+
+#include "sound_config.h"
+
+extern void     otto_init (int options);
+extern void     synth_init (void);
diff -u --recursive --new-file v2.1.12/linux/include/asm-alpha/checksum.h linux/include/asm-alpha/checksum.h
--- v2.1.12/linux/include/asm-alpha/checksum.h	Tue Nov 12 15:56:12 1996
+++ linux/include/asm-alpha/checksum.h	Sat Nov 23 12:29:03 1996
@@ -39,7 +39,7 @@
  * here even more important to align src and dst on a 32-bit (or even
  * better 64-bit) boundary
  */
-unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum);
+unsigned int csum_partial_copy(const char *src, char *dst, int len, unsigned int sum);
 
 /*
  * the same as csum_partial, but copies from user space (but on the alpha
diff -u --recursive --new-file v2.1.12/linux/include/asm-alpha/socket.h linux/include/asm-alpha/socket.h
--- v2.1.12/linux/include/asm-alpha/socket.h	Sun Mar 24 12:09:37 1996
+++ linux/include/asm-alpha/socket.h	Sat Nov 23 12:29:04 1996
@@ -27,6 +27,10 @@
 #define SO_ERROR	0x1007
 #define SO_SNDBUF	0x1001
 #define SO_RCVBUF	0x1002
+#define	SO_RCVLOWAT	0x1010
+#define	SO_SNDLOWAT	0x1011
+#define	SO_RCVTIMEO	0x1012
+#define	SO_SNDTIMEO	0x1013
 
 /* linux-specific, might as well be the same as on i386 */
 #define SO_NO_CHECK	11
diff -u --recursive --new-file v2.1.12/linux/include/linux/ctype.h linux/include/linux/ctype.h
--- v2.1.12/linux/include/linux/ctype.h	Wed Dec  1 14:44:15 1993
+++ linux/include/linux/ctype.h	Sat Nov 23 12:29:04 1996
@@ -1,6 +1,11 @@
 #ifndef _LINUX_CTYPE_H
 #define _LINUX_CTYPE_H
 
+/*
+ * NOTE! This ctype does not handle EOF like the standarc C
+ * library is required to.
+ */
+
 #define _U	0x01	/* upper */
 #define _L	0x02	/* lower */
 #define _D	0x04	/* digit */
@@ -11,24 +16,39 @@
 #define _SP	0x80	/* hard space (0x20) */
 
 extern unsigned char _ctype[];
-extern char _ctmp;
 
-#define isalnum(c) ((_ctype+1)[c]&(_U|_L|_D))
-#define isalpha(c) ((_ctype+1)[c]&(_U|_L))
-#define iscntrl(c) ((_ctype+1)[c]&(_C))
-#define isdigit(c) ((_ctype+1)[c]&(_D))
-#define isgraph(c) ((_ctype+1)[c]&(_P|_U|_L|_D))
-#define islower(c) ((_ctype+1)[c]&(_L))
-#define isprint(c) ((_ctype+1)[c]&(_P|_U|_L|_D|_SP))
-#define ispunct(c) ((_ctype+1)[c]&(_P))
-#define isspace(c) ((_ctype+1)[c]&(_S))
-#define isupper(c) ((_ctype+1)[c]&(_U))
-#define isxdigit(c) ((_ctype+1)[c]&(_D|_X))
+#define __ismask(x) (_ctype[(int)(unsigned char)(x)])
+
+#define isalnum(c)	((__ismask(c)&(_U|_L|_D)) != 0)
+#define isalpha(c)	((__ismask(c)&(_U|_L)) != 0)
+#define iscntrl(c)	((__ismask(c)&(_C)) != 0)
+#define isdigit(c)	((__ismask(c)&(_D)) != 0)
+#define isgraph(c)	((__ismask(c)&(_P|_U|_L|_D)) != 0)
+#define islower(c)	((__ismask(c)&(_L)) != 0)
+#define isprint(c)	((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0)
+#define ispunct(c)	((__ismask(c)&(_P)) != 0)
+#define isspace(c)	((__ismask(c)&(_S)) != 0)
+#define isupper(c)	((__ismask(c)&(_U)) != 0)
+#define isxdigit(c)	((__ismask(c)&(_D|_X)) != 0)
+
+#define isascii(c) (((unsigned char)(c))<=0x7f)
+#define toascii(c) (((unsigned char)(c))&0x7f)
+
+static inline unsigned char __tolower(unsigned char c)
+{
+	if (isupper(c))
+		c -= 'A'-'a';
+	return c;
+}
 
-#define isascii(c) (((unsigned) c)<=0x7f)
-#define toascii(c) (((unsigned) c)&0x7f)
+static inline unsigned char __toupper(unsigned char c)
+{
+	if (islower(c))
+		c -= 'a'-'A';
+	return c;
+}
 
-#define tolower(c) (_ctmp=c,isupper(_ctmp)?_ctmp-('A'-'a'):_ctmp)
-#define toupper(c) (_ctmp=c,islower(_ctmp)?_ctmp-('a'-'A'):_ctmp)
+#define tolower(c) __tolower(c)
+#define toupper(c) __toupper(c)
 
 #endif
diff -u --recursive --new-file v2.1.12/linux/include/linux/kdev_t.h linux/include/linux/kdev_t.h
--- v2.1.12/linux/include/linux/kdev_t.h	Thu Sep 21 08:53:39 1995
+++ linux/include/linux/kdev_t.h	Sat Nov 23 12:29:04 1996
@@ -62,13 +62,13 @@
    However, everything runs fine with an arbitrary kdev_t type. */
 
 #define MINORBITS	8
-#define MINORMASK	((1<<MINORBITS) - 1)
+#define MINORMASK	((1U << MINORBITS) - 1)
 
 typedef unsigned short kdev_t;
 
-#define MAJOR(dev)	((dev) >> MINORBITS)
-#define MINOR(dev)	((dev) & MINORMASK)
-#define HASHDEV(dev)	(dev)
+#define MAJOR(dev)	((unsigned int) ((dev) >> MINORBITS))
+#define MINOR(dev)	((unsigned int) ((dev) & MINORMASK))
+#define HASHDEV(dev)	((unsigned int) (dev))
 #define NODEV		0
 #define MKDEV(ma,mi)	(((ma) << MINORBITS) | (mi))
 #define B_FREE		0xffff		/* yuk */
diff -u --recursive --new-file v2.1.12/linux/include/linux/net.h linux/include/linux/net.h
--- v2.1.12/linux/include/linux/net.h	Tue Nov 19 15:53:57 1996
+++ linux/include/linux/net.h	Sat Nov 23 12:29:04 1996
@@ -92,14 +92,14 @@
   int	(*dup)		(struct socket *newsock, struct socket *oldsock);
   int	(*release)	(struct socket *sock, struct socket *peer);
   int	(*bind)		(struct socket *sock, struct sockaddr *umyaddr,
-			 size_t sockaddr_len);
+			 int sockaddr_len);
   int	(*connect)	(struct socket *sock, struct sockaddr *uservaddr,
-			 size_t sockaddr_len, int flags);
+			 int sockaddr_len, int flags);
   int	(*socketpair)	(struct socket *sock1, struct socket *sock2);
   int	(*accept)	(struct socket *sock, struct socket *newsock,
 			 int flags);
   int	(*getname)	(struct socket *sock, struct sockaddr *uaddr,
-			 size_t *usockaddr_len, int peer);
+			 int *usockaddr_len, int peer);
   int	(*select)	(struct socket *sock, int sel_type,
 			 select_table *wait);
   int	(*ioctl)	(struct socket *sock, unsigned int cmd,
diff -u --recursive --new-file v2.1.12/linux/include/linux/skbuff.h linux/include/linux/skbuff.h
--- v2.1.12/linux/include/linux/skbuff.h	Tue Nov 19 15:53:58 1996
+++ linux/include/linux/skbuff.h	Sat Nov 23 12:29:04 1996
@@ -88,8 +88,8 @@
 
 	struct neighbour *nexthop;
 #endif		
-	unsigned long 	len;			/* Length of actual data			*/
-	unsigned long	csum;			/* Checksum 					*/
+	unsigned int 	len;			/* Length of actual data			*/
+	unsigned int	csum;			/* Checksum 					*/
 	__u32		saddr;			/* IP source address				*/
 	__u32		daddr;			/* IP target address				*/
 	__u32		raddr;			/* IP next hop address				*/
@@ -171,13 +171,13 @@
 extern void			skb_device_unlock(struct sk_buff *skb);
 extern void			dev_kfree_skb(struct sk_buff *skb, int mode);
 extern int			skb_device_locked(struct sk_buff *skb);
-extern unsigned char *		skb_put(struct sk_buff *skb, int len);
-extern unsigned char *		skb_push(struct sk_buff *skb, int len);
-extern unsigned char *		skb_pull(struct sk_buff *skb, int len);
+extern unsigned char *		skb_put(struct sk_buff *skb, unsigned int len);
+extern unsigned char *		skb_push(struct sk_buff *skb, unsigned int len);
+extern unsigned char *		skb_pull(struct sk_buff *skb, unsigned int len);
 extern int			skb_headroom(struct sk_buff *skb);
 extern int			skb_tailroom(struct sk_buff *skb);
-extern void			skb_reserve(struct sk_buff *skb, int len);
-extern void 			skb_trim(struct sk_buff *skb, int len);
+extern void			skb_reserve(struct sk_buff *skb, unsigned int len);
+extern void 			skb_trim(struct sk_buff *skb, unsigned int len);
 
 extern __inline__ int skb_queue_empty(struct sk_buff_head *list)
 {
@@ -410,7 +410,7 @@
  *	Add data to an sk_buff
  */
  
-extern __inline__ unsigned char *skb_put(struct sk_buff *skb, int len)
+extern __inline__ unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
 {
 	extern char *skb_put_errstr;
 	unsigned char *tmp=skb->tail;
@@ -425,7 +425,7 @@
 	return tmp;
 }
 
-extern __inline__ unsigned char *skb_push(struct sk_buff *skb, int len)
+extern __inline__ unsigned char *skb_push(struct sk_buff *skb, unsigned int len)
 {
 	extern char *skb_push_errstr;
 	skb->data-=len;
@@ -439,9 +439,9 @@
 	return skb->data;
 }
 
-extern __inline__ unsigned char * skb_pull(struct sk_buff *skb, int len)
+extern __inline__ unsigned char * skb_pull(struct sk_buff *skb, unsigned int len)
 {
-	if(len > skb->len)
+	if (len > skb->len)
 		return NULL;
 	skb->data+=len;
 	skb->len-=len;
@@ -458,18 +458,17 @@
 	return skb->end-skb->tail;
 }
 
-extern __inline__ void skb_reserve(struct sk_buff *skb, int len)
+extern __inline__ void skb_reserve(struct sk_buff *skb, unsigned int len)
 {
 	skb->data+=len;
 	skb->tail+=len;
 }
 
-extern __inline__ void skb_trim(struct sk_buff *skb, int len)
+extern __inline__ void skb_trim(struct sk_buff *skb, unsigned int len)
 {
-	if(skb->len>len)
-	{
-		skb->len=len;
-		skb->tail=skb->data+len;
+	if (skb->len > len) {
+		skb->len = len;
+		skb->tail = skb->data+len;
 	}
 }
 
diff -u --recursive --new-file v2.1.12/linux/include/linux/socket.h linux/include/linux/socket.h
--- v2.1.12/linux/include/linux/socket.h	Fri Nov 22 18:28:21 1996
+++ linux/include/linux/socket.h	Sat Nov 23 12:29:04 1996
@@ -31,7 +31,7 @@
 struct msghdr 
 {
 	void	*	msg_name;	/* Socket name			*/
-	size_t		msg_namelen;	/* Length of name		*/
+	int		msg_namelen;	/* Length of name		*/
 	struct iovec *	msg_iov;	/* Data blocks			*/
 	size_t 		msg_iovlen;	/* Number of blocks		*/
 	void 	*	msg_control;	/* Per protocol magic (eg BSD file descriptor passing) */
diff -u --recursive --new-file v2.1.12/linux/include/linux/soundcard.h linux/include/linux/soundcard.h
--- v2.1.12/linux/include/linux/soundcard.h	Tue Oct 29 19:58:47 1996
+++ linux/include/linux/soundcard.h	Fri Nov 15 10:14:56 1996
@@ -117,17 +117,15 @@
 #define SNDCTL_SEQ_GETOUTCOUNT		_SIOR ('Q', 4, int)
 #define SNDCTL_SEQ_GETINCOUNT		_SIOR ('Q', 5, int)
 #define SNDCTL_SEQ_PERCMODE		_SIOW ('Q', 6, int)
-#define SNDCTL_FM_LOAD_INSTR		_SIOW ('Q', 7, struct sbi_instrument)	/* Valid for FM only */
+#define SNDCTL_FM_LOAD_INSTR		_SIOW ('Q', 7, struct sbi_instrument)	/* Obsolete */
 #define SNDCTL_SEQ_TESTMIDI		_SIOW ('Q', 8, int)
 #define SNDCTL_SEQ_RESETSAMPLES		_SIOW ('Q', 9, int)
 #define SNDCTL_SEQ_NRSYNTHS		_SIOR ('Q',10, int)
 #define SNDCTL_SEQ_NRMIDIS		_SIOR ('Q',11, int)
 #define SNDCTL_MIDI_INFO		_SIOWR('Q',12, struct midi_info)
 #define SNDCTL_SEQ_THRESHOLD		_SIOW ('Q',13, int)
-#define SNDCTL_SEQ_TRESHOLD		SNDCTL_SEQ_THRESHOLD	/* there was once a typo */
 #define SNDCTL_SYNTH_MEMAVL		_SIOWR('Q',14, int)	/* in=dev#, out=memsize */
 #define SNDCTL_FM_4OP_ENABLE		_SIOW ('Q',15, int)	/* in=dev# */
-#define SNDCTL_PMGR_ACCESS		_SIOWR('Q',16, struct patmgr_info)
 #define SNDCTL_SEQ_PANIC		_SIO  ('Q',17)
 #define SNDCTL_SEQ_OUTOFBAND		_SIOW ('Q',18, struct seq_event_rec)
 #define SNDCTL_SEQ_GETTIME		_SIOR ('Q',19, int)
@@ -197,6 +195,9 @@
 #define WAVE_TREMOLO	0x00020000	/* The tremolo info is valid */
 #define WAVE_SCALE	0x00040000	/* The scaling info is valid */
 #define WAVE_FRACTIONS	0x00080000	/* Fraction information is valid */
+/* Reserved bits */
+#define WAVE_ROM	0x40000000	/* For future use */
+#define WAVE_MULAW	0x20000000	/* For future use */
 /* Other bits must be zeroed */
 
 		int len;	/* Size of the wave data in bytes */
@@ -250,7 +251,8 @@
 	
 	        int		volume;
 		int		fractions;
-	        int		spare[3];
+		int		reserved1;
+	        int		spare[2];
 		char data[1];	/* The waveform data starts here */
 	};
 
@@ -264,90 +266,6 @@
 	};
 
 /*
- * Patch management interface (/dev/sequencer, /dev/patmgr#)
- * Don't use these calls if you want to maintain compatibility with
- * the future versions of the driver.
- */
-
-#define 	PS_NO_PATCHES		0	/* No patch support on device */
-#define		PS_MGR_NOT_OK		1	/* Plain patch support (no mgr) */
-#define		PS_MGR_OK		2	/* Patch manager supported */
-#define		PS_MANAGED		3	/* Patch manager running */
-
-#define SNDCTL_PMGR_IFACE		_SIOWR('P', 1, struct patmgr_info)
-
-/*
- * The patmgr_info is a fixed size structure which is used for two
- * different purposes. The intended use is for communication between
- * the application using /dev/sequencer and the patch manager daemon
- * associated with a synthesizer device (ioctl(SNDCTL_PMGR_ACCESS)).
- *
- * This structure is also used with ioctl(SNDCTL_PGMR_IFACE) which allows
- * a patch manager daemon to read and write device parameters. This
- * ioctl available through /dev/sequencer also. Avoid using it since it's
- * extremely hardware dependent. In addition access trough /dev/sequencer 
- * may confuse the patch manager daemon.
- */
-
-struct patmgr_info {
-	  unsigned int key;	/* Don't worry. Reserved for communication
-	  			   between the patch manager and the driver. */
-#define PM_K_EVENT		1 /* Event from the /dev/sequencer driver */
-#define PM_K_COMMAND		2 /* Request from an application */
-#define PM_K_RESPONSE		3 /* From patmgr to application */
-#define PM_ERROR		4 /* Error returned by the patmgr */
-	  int device;
-	  int command;
-
-/* 
- * Commands 0x000 to 0xfff reserved for patch manager programs 
- */
-#define PM_GET_DEVTYPE	1	/* Returns type of the patch mgr interface of dev */
-#define		PMTYPE_FM2	1	/* 2 OP fm */
-#define		PMTYPE_FM4	2	/* Mixed 4 or 2 op FM (OPL-3) */
-#define		PMTYPE_WAVE	3	/* Wave table synthesizer (GUS) */
-#define PM_GET_NRPGM	2	/* Returns max # of midi programs in parm1 */
-#define PM_GET_PGMMAP	3	/* Returns map of loaded midi programs in data8 */
-#define PM_GET_PGM_PATCHES 4	/* Return list of patches of a program (parm1) */
-#define PM_GET_PATCH	5	/* Return patch header of patch parm1 */
-#define PM_SET_PATCH	6	/* Set patch header of patch parm1 */
-#define PM_READ_PATCH	7	/* Read patch (wave) data */
-#define PM_WRITE_PATCH	8	/* Write patch (wave) data */
-
-/*
- * Commands 0x1000 to 0xffff are for communication between the patch manager
- * and the client
- */
-#define _PM_LOAD_PATCH	0x100
-
-/* 
- * Commands above 0xffff reserved for device specific use
- */
-
-	  int parm1;
-	  int parm2;
-	  int parm3;
-
-	  union {
-		unsigned char data8[4000];
-		unsigned short data16[2000];
-		unsigned int data32[1000];
-		struct patch_info patch;
-	  } data;
-	};
-
-/*
- * When a patch manager daemon is present, it will be informed by the
- * driver when something important happens. For example when the
- * /dev/sequencer is opened or closed. A record with key == PM_K_EVENT is
- * returned. The command field contains the event type:
- */
-#define PM_E_OPENED		1	/* /dev/sequencer opened */
-#define PM_E_CLOSED		2	/* /dev/sequencer closed */
-#define PM_E_PATCH_RESET	3	/* SNDCTL_RESETSAMPLES called */
-#define PM_E_PATCH_LOADED	4	/* A patch has been loaded by appl */
-
-/*
  * /dev/sequencer input events.
  *
  * The data written to the /dev/sequencer is a stream of events. Events
@@ -1036,7 +954,6 @@
 #define SEQ_DEFINEBUF(len)		unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
 #define SEQ_USE_EXTBUF()		extern unsigned char _seqbuf[]; extern int _seqbuflen;extern int _seqbufptr
 #define SEQ_DECLAREBUF()		SEQ_USE_EXTBUF()
-#define SEQ_PM_DEFINES			struct patmgr_info _pm_info
 #define _SEQ_NEEDBUF(len)		if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
 #define _SEQ_ADVBUF(len)		_seqbufptr += len
 #define SEQ_DUMPBUF			seqbuf_dump
@@ -1057,15 +974,6 @@
  */
 #define _SEQ_NEEDBUF(len)	/* empty */
 #endif
-
-#define PM_LOAD_PATCH(dev, bank, pgm)	(SEQ_DUMPBUF(), _pm_info.command = _PM_LOAD_PATCH, \
-					_pm_info.device=dev, _pm_info.data.data8[0]=pgm, \
-					_pm_info.parm1 = bank, _pm_info.parm2 = 1, \
-					ioctl(seqfd, SNDCTL_PMGR_ACCESS, &_pm_info))
-#define PM_LOAD_PATCHES(dev, bank, pgm) (SEQ_DUMPBUF(), _pm_info.command = _PM_LOAD_PATCH, \
-					_pm_info.device=dev, memcpy(_pm_info.data.data8, pgm, 128), \
-					_pm_info.parm1 = bank, _pm_info.parm2 = 128, \
-					ioctl(seqfd, SNDCTL_PMGR_ACCESS, &_pm_info))
 
 #define SEQ_VOLUME_MODE(dev, mode)	{_SEQ_NEEDBUF(8);\
 					_seqbuf[_seqbufptr] = SEQ_EXTENDED;\
diff -u --recursive --new-file v2.1.12/linux/include/linux/stddef.h linux/include/linux/stddef.h
--- v2.1.12/linux/include/linux/stddef.h	Wed Dec  1 14:44:15 1993
+++ linux/include/linux/stddef.h	Sat Nov 23 12:29:04 1996
@@ -1,11 +1,6 @@
 #ifndef _LINUX_STDDEF_H
 #define _LINUX_STDDEF_H
 
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-
 #undef NULL
 #define NULL ((void *)0)
 
diff -u --recursive --new-file v2.1.12/linux/include/linux/swap.h linux/include/linux/swap.h
--- v2.1.12/linux/include/linux/swap.h	Mon Jun  3 15:38:37 1996
+++ linux/include/linux/swap.h	Sat Nov 23 12:29:04 1996
@@ -22,10 +22,10 @@
 	struct inode * swap_file;
 	unsigned char * swap_map;
 	unsigned char * swap_lockmap;
-	int lowest_bit;
-	int highest_bit;
-	int cluster_next;
-	int cluster_nr;
+	unsigned int lowest_bit;
+	unsigned int highest_bit;
+	unsigned int cluster_next;
+	unsigned int cluster_nr;
 	int prio;			/* swap priority */
 	int pages;
 	unsigned long max;
@@ -70,7 +70,7 @@
 extern void swap_duplicate(unsigned long);
 
 /* linux/mm/swapfile.c */
-extern int nr_swapfiles;
+extern unsigned int nr_swapfiles;
 extern struct swap_info_struct swap_info[];
 void si_swapinfo(struct sysinfo *);
 unsigned long get_swap_page(void);
diff -u --recursive --new-file v2.1.12/linux/include/linux/swapctl.h linux/include/linux/swapctl.h
--- v2.1.12/linux/include/linux/swapctl.h	Mon Sep 30 11:19:43 1996
+++ linux/include/linux/swapctl.h	Sat Nov 23 12:29:04 1996
@@ -11,21 +11,21 @@
 
 typedef struct swap_control_v5
 {
-	int	sc_max_page_age;
-	int	sc_page_advance;
-	int	sc_page_decline;
-	int	sc_page_initial_age;
-	int	sc_max_buff_age;
-	int	sc_buff_advance;
-	int	sc_buff_decline;
-	int	sc_buff_initial_age;
-	int	sc_age_cluster_fract;
-	int	sc_age_cluster_min;
-	int	sc_pageout_weight;
-	int	sc_bufferout_weight;
-	int 	sc_buffer_grace;
-	int 	sc_nr_buffs_to_free;
-	int 	sc_nr_pages_to_free;
+	unsigned int	sc_max_page_age;
+	unsigned int	sc_page_advance;
+	unsigned int	sc_page_decline;
+	unsigned int	sc_page_initial_age;
+	unsigned int	sc_max_buff_age;
+	unsigned int	sc_buff_advance;
+	unsigned int	sc_buff_decline;
+	unsigned int	sc_buff_initial_age;
+	unsigned int	sc_age_cluster_fract;
+	unsigned int	sc_age_cluster_min;
+	unsigned int	sc_pageout_weight;
+	unsigned int	sc_bufferout_weight;
+	unsigned int 	sc_buffer_grace;
+	unsigned int 	sc_nr_buffs_to_free;
+	unsigned int 	sc_nr_pages_to_free;
 	enum RCL_POLICY	sc_policy;
 } swap_control_v5;
 typedef struct swap_control_v5 swap_control_t;
@@ -33,22 +33,22 @@
 
 typedef struct kswapd_control_v1
 {
-	int	maxpages;
-	int	pages_buff;
-	int	pages_shm;
-	int	pages_mmap;
-	int	pages_swap;
+	unsigned int	maxpages;
+	unsigned int	pages_buff;
+	unsigned int	pages_shm;
+	unsigned int	pages_mmap;
+	unsigned int	pages_swap;
 } kswapd_control_v1;
 typedef kswapd_control_v1 kswapd_control_t;
 extern kswapd_control_t kswapd_ctl;
 
 typedef struct swapstat_v1
 {
-	int	wakeups;
-	int	pages_reclaimed;
-	int	pages_shm;
-	int	pages_mmap;
-	int	pages_swap;
+	unsigned int	wakeups;
+	unsigned int	pages_reclaimed;
+	unsigned int	pages_shm;
+	unsigned int	pages_mmap;
+	unsigned int	pages_swap;
 } swapstat_v1;
 typedef swapstat_v1 swapstat_t;
 extern swapstat_t swapstats;
@@ -94,7 +94,7 @@
  * scan the resource list. */
 static inline int AGE_CLUSTER_SIZE(int resources)
 {
-	int n = (resources * AGE_CLUSTER_FRACT) >> 10;
+	unsigned int n = (resources * AGE_CLUSTER_FRACT) >> 10;
 	if (n < AGE_CLUSTER_MIN)
 		return AGE_CLUSTER_MIN;
 	else
diff -u --recursive --new-file v2.1.12/linux/include/linux/wait.h linux/include/linux/wait.h
--- v2.1.12/linux/include/linux/wait.h	Mon Sep  9 16:09:16 1996
+++ linux/include/linux/wait.h	Sat Nov 23 12:29:04 1996
@@ -8,6 +8,8 @@
 
 #ifdef __KERNEL__
 
+#include <asm/page.h>
+
 struct wait_queue {
 	struct task_struct * task;
 	struct wait_queue * next;
@@ -32,11 +34,11 @@
 };
 
 typedef struct select_table_struct {
-	int nr;
+	unsigned int nr;
 	struct select_table_entry * entry;
 } select_table;
 
-#define __MAX_SELECT_TABLE_ENTRIES (4096 / sizeof (struct select_table_entry))
+#define __MAX_SELECT_TABLE_ENTRIES (PAGE_SIZE / sizeof (struct select_table_entry))
 
 #endif /* __KERNEL__ */
 
diff -u --recursive --new-file v2.1.12/linux/include/net/inet_common.h linux/include/net/inet_common.h
--- v2.1.12/linux/include/net/inet_common.h	Tue Nov 19 15:53:58 1996
+++ linux/include/net/inet_common.h	Sat Nov 23 12:29:04 1996
@@ -17,7 +17,7 @@
 					     struct socket *peer);
 extern int			inet_connect(struct socket *sock, 
 					     struct sockaddr * uaddr,
-					     size_t addr_len, int flags);
+					     int addr_len, int flags);
 extern int			inet_accept(struct socket *sock, 
 					    struct socket *newsock, int flags);
 extern int			inet_recvmsg(struct socket *sock, 
diff -u --recursive --new-file v2.1.12/linux/include/net/sock.h linux/include/net/sock.h
--- v2.1.12/linux/include/net/sock.h	Fri Nov 22 18:28:21 1996
+++ linux/include/net/sock.h	Sat Nov 23 12:29:04 1996
@@ -517,7 +517,7 @@
 					unsigned long timeout);
 	int			(*connect)(struct sock *sk,
 				        struct sockaddr *uaddr, 
-					size_t addr_len);
+					int addr_len);
 
 	struct sock *		(*accept) (struct sock *sk, int flags);
 	void			(*retransmit)(struct sock *sk, int all);
@@ -543,7 +543,7 @@
 					int len, int noblock, int flags, 
 					int *addr_len);
 	int			(*bind)(struct sock *sk, 
-					struct sockaddr *uaddr, size_t addr_len);
+					struct sockaddr *uaddr, int addr_len);
 
 	int			(*backlog_rcv) (struct sock *sk, 
 						struct sk_buff *skb);
diff -u --recursive --new-file v2.1.12/linux/include/net/tcp.h linux/include/net/tcp.h
--- v2.1.12/linux/include/net/tcp.h	Tue Nov 19 15:53:58 1996
+++ linux/include/net/tcp.h	Sat Nov 23 12:29:04 1996
@@ -316,7 +316,7 @@
 						   struct sk_buff *skb);
 extern int			tcp_v4_connect(struct sock *sk,
 					       struct sockaddr *uaddr,
-					       size_t addr_len);
+					       int addr_len);
 
 
 extern void tcp_read_wakeup(struct sock *);
diff -u --recursive --new-file v2.1.12/linux/include/net/transp_v6.h linux/include/net/transp_v6.h
--- v2.1.12/linux/include/net/transp_v6.h	Fri Nov 22 18:28:21 1996
+++ linux/include/net/transp_v6.h	Sat Nov 23 12:29:04 1996
@@ -19,7 +19,7 @@
 
 extern int				udpv6_connect(struct sock *sk,
 						      struct sockaddr *uaddr,
-						      size_t addr_len);
+						      int addr_len);
 
 extern int			datagram_recv_ctl(struct sock *sk,
 						  struct msghdr *msg,
diff -u --recursive --new-file v2.1.12/linux/include/net/udp.h linux/include/net/udp.h
--- v2.1.12/linux/include/net/udp.h	Tue Nov 19 15:53:58 1996
+++ linux/include/net/udp.h	Sat Nov 23 12:29:04 1996
@@ -37,7 +37,7 @@
 extern void	udp_send_check(struct udphdr *uh, __u32 saddr, 
 			__u32 daddr, int len, struct sock *sk);
 extern int	udp_connect(struct sock *sk,
-			    struct sockaddr *usin, size_t addr_len);
+			    struct sockaddr *usin, int addr_len);
 
 extern int	udp_sendmsg(struct sock *sk, struct msghdr *msg,
 			    int len, int noblock, int flags);
diff -u --recursive --new-file v2.1.12/linux/init/main.c linux/init/main.c
--- v2.1.12/linux/init/main.c	Tue Nov 12 15:56:15 1996
+++ linux/init/main.c	Sat Nov 23 12:29:04 1996
@@ -482,8 +482,7 @@
 
 void calibrate_delay(void)
 {
-	int ticks;
-	int loopbit;
+	unsigned long ticks, loopbit;
 	int lps_precision = LPS_PREC;
 
 	loops_per_sec = (1<<12);
diff -u --recursive --new-file v2.1.12/linux/kernel/fork.c linux/kernel/fork.c
--- v2.1.12/linux/kernel/fork.c	Sun Nov 10 20:12:19 1996
+++ linux/kernel/fork.c	Sat Nov 23 12:29:04 1996
@@ -15,7 +15,6 @@
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
-#include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
 #include <linux/malloc.h>
diff -u --recursive --new-file v2.1.12/linux/lib/ctype.c linux/lib/ctype.c
--- v2.1.12/linux/lib/ctype.c	Tue Jul  2 19:08:43 1996
+++ linux/lib/ctype.c	Sat Nov 23 12:29:04 1996
@@ -6,8 +6,7 @@
 
 #include <linux/ctype.h>
 
-char _ctmp;
-unsigned char _ctype[] = {0x00,			/* EOF */
+unsigned char _ctype[] = {
 _C,_C,_C,_C,_C,_C,_C,_C,			/* 0-7 */
 _C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C,		/* 8-15 */
 _C,_C,_C,_C,_C,_C,_C,_C,			/* 16-23 */
diff -u --recursive --new-file v2.1.12/linux/mm/filemap.c linux/mm/filemap.c
--- v2.1.12/linux/mm/filemap.c	Tue Nov 12 15:56:15 1996
+++ linux/mm/filemap.c	Sat Nov 23 12:29:04 1996
@@ -127,7 +127,7 @@
 
 int shrink_mmap(int priority, int dma)
 {
-	static int clock = 0;
+	static unsigned long clock = 0;
 	struct page * page;
 	unsigned long limit = max_mapnr;
 	struct buffer_head *tmp, *bh;
diff -u --recursive --new-file v2.1.12/linux/mm/swapfile.c linux/mm/swapfile.c
--- v2.1.12/linux/mm/swapfile.c	Tue Nov 19 15:53:59 1996
+++ linux/mm/swapfile.c	Sat Nov 23 12:29:04 1996
@@ -25,7 +25,8 @@
 #include <asm/bitops.h>
 #include <asm/pgtable.h>
 
-int nr_swapfiles = 0;
+unsigned int nr_swapfiles = 0;
+
 static struct {
 	int head;	/* head of priority-ordered swapfile list */
 	int next;	/* swapfile to be used next */
@@ -36,7 +37,7 @@
 
 static inline int scan_swap_map(struct swap_info_struct *si)
 {
-	int offset;
+	unsigned long offset;
 	/* 
 	 * We try to cluster swap pages by allocating them
 	 * sequentially in swap.  Once we've allocated
diff -u --recursive --new-file v2.1.12/linux/net/appletalk/ddp.c linux/net/appletalk/ddp.c
--- v2.1.12/linux/net/appletalk/ddp.c	Tue Nov 19 15:53:59 1996
+++ linux/net/appletalk/ddp.c	Sat Nov 23 12:29:04 1996
@@ -1234,7 +1234,7 @@
  *	Set the address 'our end' of the connection.
  */
  
-static int atalk_bind(struct socket *sock, struct sockaddr *uaddr,size_t addr_len)
+static int atalk_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 {
 	atalk_socket *sk;
 	struct sockaddr_at *addr=(struct sockaddr_at *)uaddr;
@@ -1289,7 +1289,7 @@
  */
  
 static int atalk_connect(struct socket *sock, struct sockaddr *uaddr,
-	size_t addr_len, int flags)
+	int addr_len, int flags)
 {
 	atalk_socket *sk=(atalk_socket *)sock->data;
 	struct sockaddr_at *addr;
@@ -1350,7 +1350,7 @@
  */
  
 static int atalk_getname(struct socket *sock, struct sockaddr *uaddr,
-	size_t *uaddr_len, int peer)
+	int *uaddr_len, int peer)
 {
 	struct sockaddr_at sat;
 	atalk_socket *sk;
diff -u --recursive --new-file v2.1.12/linux/net/ax25/af_ax25.c linux/net/ax25/af_ax25.c
--- v2.1.12/linux/net/ax25/af_ax25.c	Fri Nov 22 18:28:22 1996
+++ linux/net/ax25/af_ax25.c	Sat Nov 23 12:29:04 1996
@@ -1368,7 +1368,7 @@
  *	BSD 4.4 ADDIFADDR type support. It is however small and trivially backward
  *	compatible 8)
  */
-static int ax25_bind(struct socket *sock, struct sockaddr *uaddr,size_t addr_len)
+static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 {
 	struct sock *sk;
 	struct full_sockaddr_ax25 *addr = (struct full_sockaddr_ax25 *)uaddr;
@@ -1431,7 +1431,7 @@
 }
 
 static int ax25_connect(struct socket *sock, struct sockaddr *uaddr,
-	size_t addr_len, int flags)
+	int addr_len, int flags)
 {
 	struct sock *sk = (struct sock *)sock->data;
 	struct sockaddr_ax25 *addr = (struct sockaddr_ax25 *)uaddr;
@@ -1608,7 +1608,7 @@
 }
 
 static int ax25_getname(struct socket *sock, struct sockaddr *uaddr,
-	size_t *uaddr_len, int peer)
+	int *uaddr_len, int peer)
 {
 	struct full_sockaddr_ax25 *sax = (struct full_sockaddr_ax25 *)uaddr;
 	struct sock *sk;
diff -u --recursive --new-file v2.1.12/linux/net/core/skbuff.c linux/net/core/skbuff.c
--- v2.1.12/linux/net/core/skbuff.c	Tue Nov 19 15:54:00 1996
+++ linux/net/core/skbuff.c	Sat Nov 23 12:29:04 1996
@@ -505,7 +505,7 @@
  *	Add data to an sk_buff
  */
  
-unsigned char *skb_put(struct sk_buff *skb, int len)
+unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
 {
 	unsigned char *tmp=skb->tail;
 	IS_SKB(skb);
@@ -517,7 +517,7 @@
 	return tmp;
 }
 
-unsigned char *skb_push(struct sk_buff *skb, int len)
+unsigned char *skb_push(struct sk_buff *skb, unsigned int len)
 {
 	IS_SKB(skb);
 	skb->data-=len;
@@ -528,7 +528,7 @@
 	return skb->data;
 }
 
-unsigned char * skb_pull(struct sk_buff *skb, int len)
+unsigned char * skb_pull(struct sk_buff *skb, unsigned int len)
 {
 	IS_SKB(skb);
 	if(len>skb->len)
@@ -550,7 +550,7 @@
 	return skb->end-skb->tail;
 }
 
-void skb_reserve(struct sk_buff *skb, int len)
+void skb_reserve(struct sk_buff *skb, unsigned int len)
 {
 	IS_SKB(skb);
 	skb->data+=len;
@@ -562,7 +562,7 @@
 	IS_SKB(skb);
 }
 
-void skb_trim(struct sk_buff *skb, int len)
+void skb_trim(struct sk_buff *skb, unsigned int len)
 {
 	IS_SKB(skb);
 	if(skb->len>len)
diff -u --recursive --new-file v2.1.12/linux/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
--- v2.1.12/linux/net/ipv4/af_inet.c	Tue Nov 19 15:54:00 1996
+++ linux/net/ipv4/af_inet.c	Sat Nov 23 12:29:04 1996
@@ -767,7 +767,7 @@
 
 
 static int inet_bind(struct socket *sock, struct sockaddr *uaddr,
-	       size_t addr_len)
+	       int addr_len)
 {
 	struct sockaddr_in *addr=(struct sockaddr_in *)uaddr;
 	struct sock *sk=(struct sock *)sock->data, *sk2;
@@ -923,7 +923,7 @@
  */
  
 int inet_connect(struct socket *sock, struct sockaddr * uaddr,
-		 size_t addr_len, int flags)
+		 int addr_len, int flags)
 {
 	struct sock *sk=(struct sock *)sock->data;
 	int err;
@@ -1090,7 +1090,7 @@
  */
  
 static int inet_getname(struct socket *sock, struct sockaddr *uaddr,
-		 size_t *uaddr_len, int peer)
+		 int *uaddr_len, int peer)
 {
 	struct sockaddr_in *sin=(struct sockaddr_in *)uaddr;
 	struct sock *sk;
diff -u --recursive --new-file v2.1.12/linux/net/ipv4/packet.c linux/net/ipv4/packet.c
--- v2.1.12/linux/net/ipv4/packet.c	Tue Nov 19 15:54:01 1996
+++ linux/net/ipv4/packet.c	Sat Nov 23 12:29:05 1996
@@ -282,7 +282,7 @@
  *	Bind a packet socket to a device
  */
 
-static int packet_bind(struct sock *sk, struct sockaddr *uaddr, size_t addr_len)
+static int packet_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
 {
 	char name[15];
 	struct device *dev;
diff -u --recursive --new-file v2.1.12/linux/net/ipv4/tcp_ipv4.c linux/net/ipv4/tcp_ipv4.c
--- v2.1.12/linux/net/ipv4/tcp_ipv4.c	Tue Nov 19 15:54:01 1996
+++ linux/net/ipv4/tcp_ipv4.c	Sat Nov 23 12:29:05 1996
@@ -127,7 +127,7 @@
  *	This will initiate an outgoing connection. 
  */
  
-int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, size_t addr_len)
+int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
 {
 	struct sk_buff *buff;
 	struct sk_buff *skb1;
diff -u --recursive --new-file v2.1.12/linux/net/ipv4/tcp_output.c linux/net/ipv4/tcp_output.c
--- v2.1.12/linux/net/ipv4/tcp_output.c	Tue Nov 19 15:54:01 1996
+++ linux/net/ipv4/tcp_output.c	Sat Nov 23 12:29:05 1996
@@ -110,7 +110,7 @@
 	 
 	if (size < sizeof(struct tcphdr) || size > skb->len) 
 	{
-		printk("tcp_send_skb: bad skb (skb = %p, data = %p, th = %p, len = %lu)\n",
+		printk("tcp_send_skb: bad skb (skb = %p, data = %p, th = %p, len = %u)\n",
 			skb, skb->data, th, skb->len);
 		kfree_skb(skb, FREE_WRITE);
 		return 0;
diff -u --recursive --new-file v2.1.12/linux/net/ipv4/udp.c linux/net/ipv4/udp.c
--- v2.1.12/linux/net/ipv4/udp.c	Tue Nov 19 15:54:01 1996
+++ linux/net/ipv4/udp.c	Sat Nov 23 12:29:05 1996
@@ -599,7 +599,7 @@
   	return(copied);
 }
 
-int udp_connect(struct sock *sk, struct sockaddr *uaddr, size_t addr_len)
+int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
 {
 	struct sockaddr_in *usin = (struct sockaddr_in *) uaddr;
 	struct rtable *rt;
diff -u --recursive --new-file v2.1.12/linux/net/ipv6/af_inet6.c linux/net/ipv6/af_inet6.c
--- v2.1.12/linux/net/ipv6/af_inet6.c	Tue Nov 19 15:54:02 1996
+++ linux/net/ipv6/af_inet6.c	Sat Nov 23 12:29:05 1996
@@ -254,7 +254,7 @@
  */
 
 static int inet6_bind(struct socket *sock, struct sockaddr *uaddr,
-		      size_t addr_len)
+		      int addr_len)
 {
 	struct sockaddr_in6 *addr=(struct sockaddr_in6 *)uaddr;
 	struct sock *sk=(struct sock *)sock->data, *sk2;
@@ -434,7 +434,7 @@
  */
  
 static int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
-		 size_t *uaddr_len, int peer)
+		 int *uaddr_len, int peer)
 {
 	struct sockaddr_in6 *sin=(struct sockaddr_in6 *)uaddr;
 	struct sock *sk;
diff -u --recursive --new-file v2.1.12/linux/net/ipv6/tcp_ipv6.c linux/net/ipv6/tcp_ipv6.c
--- v2.1.12/linux/net/ipv6/tcp_ipv6.c	Tue Nov 19 15:54:02 1996
+++ linux/net/ipv6/tcp_ipv6.c	Sat Nov 23 12:29:05 1996
@@ -85,7 +85,7 @@
 }
 
 static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, 
-			  size_t addr_len)
+			  int addr_len)
 {
 	struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr;
 	struct ipv6_pinfo *np = &sk->net_pinfo.af_inet6;
diff -u --recursive --new-file v2.1.12/linux/net/ipv6/udp.c linux/net/ipv6/udp.c
--- v2.1.12/linux/net/ipv6/udp.c	Fri Nov 22 18:28:24 1996
+++ linux/net/ipv6/udp.c	Sat Nov 23 12:29:05 1996
@@ -47,7 +47,7 @@
  *
  */
 
-int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, size_t addr_len)
+int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
 {
 	struct sockaddr_in6	*usin = (struct sockaddr_in6 *) uaddr;
 	struct in6_addr		*daddr;
diff -u --recursive --new-file v2.1.12/linux/net/ipx/af_ipx.c linux/net/ipx/af_ipx.c
--- v2.1.12/linux/net/ipx/af_ipx.c	Tue Nov 19 15:54:02 1996
+++ linux/net/ipx/af_ipx.c	Sat Nov 23 12:29:05 1996
@@ -1792,7 +1792,7 @@
 	return	ntohs(socketNum);
 }
 	
-static int ipx_bind(struct socket *sock, struct sockaddr *uaddr,size_t addr_len)
+static int ipx_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 {
 	ipx_socket *sk;
 	ipx_interface *intrfc;
@@ -1893,7 +1893,7 @@
 }
 
 static int ipx_connect(struct socket *sock, struct sockaddr *uaddr,
-	size_t addr_len, int flags)
+	int addr_len, int flags)
 {
 	ipx_socket *sk=(ipx_socket *)sock->data;
 	struct sockaddr_ipx *addr;
@@ -1949,7 +1949,7 @@
 }
 
 static int ipx_getname(struct socket *sock, struct sockaddr *uaddr,
-	size_t *uaddr_len, int peer)
+	int *uaddr_len, int peer)
 {
 	ipx_address *addr;
 	struct sockaddr_ipx sipx;
diff -u --recursive --new-file v2.1.12/linux/net/netrom/af_netrom.c linux/net/netrom/af_netrom.c
--- v2.1.12/linux/net/netrom/af_netrom.c	Fri Nov 22 18:28:24 1996
+++ linux/net/netrom/af_netrom.c	Sat Nov 23 12:29:05 1996
@@ -780,7 +780,7 @@
 	return 0;
 }
 
-static int nr_bind(struct socket *sock, struct sockaddr *uaddr, size_t addr_len)
+static int nr_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 {
 	struct sock *sk;
 	struct full_sockaddr_ax25 *addr = (struct full_sockaddr_ax25 *)uaddr;
@@ -834,7 +834,7 @@
 }
 
 static int nr_connect(struct socket *sock, struct sockaddr *uaddr,
-	size_t addr_len, int flags)
+	int addr_len, int flags)
 {
 	struct sock *sk = (struct sock *)sock->data;
 	struct sockaddr_ax25 *addr = (struct sockaddr_ax25 *)uaddr;
@@ -985,7 +985,7 @@
 }
 
 static int nr_getname(struct socket *sock, struct sockaddr *uaddr,
-	size_t *uaddr_len, int peer)
+	int *uaddr_len, int peer)
 {
 	struct full_sockaddr_ax25 *sax = (struct full_sockaddr_ax25 *)uaddr;
 	struct sock *sk;
diff -u --recursive --new-file v2.1.12/linux/net/rose/af_rose.c linux/net/rose/af_rose.c
--- v2.1.12/linux/net/rose/af_rose.c	Fri Nov 22 18:28:24 1996
+++ linux/net/rose/af_rose.c	Sat Nov 23 12:29:05 1996
@@ -765,7 +765,7 @@
 	return 0;
 }
 
-static int rose_bind(struct socket *sock, struct sockaddr *uaddr, size_t addr_len)
+static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 {
 	struct sock *sk;
 	struct sockaddr_rose *addr = (struct sockaddr_rose *)uaddr;
@@ -813,7 +813,7 @@
 	return 0;
 }
 
-static int rose_connect(struct socket *sock, struct sockaddr *uaddr, size_t addr_len, int flags)
+static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_len, int flags)
 {
 	struct sock *sk = (struct sock *)sock->data;
 	struct sockaddr_rose *addr = (struct sockaddr_rose *)uaddr;
@@ -963,7 +963,7 @@
 }
 
 static int rose_getname(struct socket *sock, struct sockaddr *uaddr,
-	size_t *uaddr_len, int peer)
+	int *uaddr_len, int peer)
 {
 	struct sockaddr_rose *srose = (struct sockaddr_rose *)uaddr;
 	struct sock *sk;
diff -u --recursive --new-file v2.1.12/linux/net/socket.c linux/net/socket.c
--- v2.1.12/linux/net/socket.c	Tue Nov 19 15:54:02 1996
+++ linux/net/socket.c	Sat Nov 23 12:29:05 1996
@@ -806,7 +806,7 @@
  *	include the -EINPROGRESS status for such sockets.
  */
  
-asmlinkage int sys_connect(int fd, struct sockaddr *uservaddr, size_t addrlen)
+asmlinkage int sys_connect(int fd, struct sockaddr *uservaddr, int addrlen)
 {
 	struct socket *sock;
 	struct file *file;
@@ -857,7 +857,7 @@
  *	name to user space.
  */
 
-asmlinkage int sys_getsockname(int fd, struct sockaddr *usockaddr, size_t *usockaddr_len)
+asmlinkage int sys_getsockname(int fd, struct sockaddr *usockaddr, int *usockaddr_len)
 {
 	struct socket *sock;
 	char address[MAX_SOCK_ADDR];
@@ -882,7 +882,7 @@
  *	name to user space.
  */
  
-asmlinkage int sys_getpeername(int fd, struct sockaddr *usockaddr, size_t *usockaddr_len)
+asmlinkage int sys_getpeername(int fd, struct sockaddr *usockaddr, int *usockaddr_len)
 {
 	struct socket *sock;
 	char address[MAX_SOCK_ADDR];
@@ -942,7 +942,7 @@
  */
 
 asmlinkage int sys_sendto(int fd, void * buff, size_t len, unsigned flags,
-	   struct sockaddr *addr, size_t addr_len)
+	   struct sockaddr *addr, int addr_len)
 {
 	struct socket *sock;
 	struct file *file;
@@ -1025,7 +1025,7 @@
  */
 
 asmlinkage int sys_recvfrom(int fd, void * ubuf, size_t size, unsigned flags,
-	     struct sockaddr *addr, size_t *addr_len)
+	     struct sockaddr *addr, int *addr_len)
 {
 	struct socket *sock;
 	struct file *file;
diff -u --recursive --new-file v2.1.12/linux/net/unix/af_unix.c linux/net/unix/af_unix.c
--- v2.1.12/linux/net/unix/af_unix.c	Tue Nov 19 15:54:02 1996
+++ linux/net/unix/af_unix.c	Sat Nov 23 12:29:05 1996
@@ -397,7 +397,7 @@
 }
 
 
-static int unix_bind(struct socket *sock, struct sockaddr *uaddr, size_t addr_len)
+static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 {
 	struct sockaddr_un *sunaddr=(struct sockaddr_un *)uaddr;
 	unix_socket *sk=sock->data;
@@ -444,7 +444,7 @@
 	
 }
 
-static int unix_connect(struct socket *sock, struct sockaddr *uaddr, size_t addr_len, int flags)
+static int unix_connect(struct socket *sock, struct sockaddr *uaddr, int addr_len, int flags)
 {
 	unix_socket *sk=sock->data;
 	struct sockaddr_un *sunaddr=(struct sockaddr_un *)uaddr;
@@ -669,7 +669,7 @@
 	return 0;
 }
 
-static int unix_getname(struct socket *sock, struct sockaddr *uaddr, size_t *uaddr_len, int peer)
+static int unix_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer)
 {
 	unix_socket *sk=sock->data;
 	struct sockaddr_un *sunaddr=(struct sockaddr_un *)uaddr;
