## Automatically generated incremental diff
## From:   linux-2.2.20-pre3
## To:     linux-2.2.20-pre4
## Robot:  $Id: make-incremental-diff,v 1.8 2001/12/04 06:05:04 hpa Exp $

diff -urN linux-2.2.20-pre3/CREDITS linux/CREDITS
--- linux-2.2.20-pre3/CREDITS	Mon Dec  3 22:18:55 2001
+++ linux/CREDITS	Mon Dec  3 22:19:02 2001
@@ -2398,8 +2398,8 @@
 E: jwoithe@physics.adelaide.edu.au
 W: http://www.physics.adelaide.edu.au/~jwoithe
 D: ALS-007 sound card extensions to Sound Blaster driver
-S: 4/36 Trevelyan St
-S: Wayville SA 5034
+S: 20 Jordan St
+S: Valley View, SA 5093
 S: Australia
 
 N: Clifford Wolf
diff -urN linux-2.2.20-pre3/Documentation/Configure.help linux/Documentation/Configure.help
--- linux-2.2.20-pre3/Documentation/Configure.help	Mon Dec  3 22:18:55 2001
+++ linux/Documentation/Configure.help	Mon Dec  3 22:19:02 2001
@@ -3688,32 +3688,38 @@
 
 Kernel/User network link driver
 CONFIG_NETLINK
-  This driver allows for two-way communication between certain parts
-  of the kernel or modules and user processes; the user processes are
-  able to read from and write to character special files in the /dev
-  directory having major mode 36. So far, the kernel uses it to
-  publish some network related information if you say Y to "Routing
-  messages", below. It is also used by the firewall code to publish
-  information about possible attacks if you say Y to "IP: firewall
-  packet netlink device" further down. You also need to say Y here if
-  you want to use arpd, a daemon that helps keep the internal ARP
-  cache (a mapping between IP addresses and hardware addresses on the
-  local network) small. The ethertap device, which lets user space
-  programs read and write raw Ethernet frames, also needs the network
-  link driver. If unsure, say Y.
+  This driver allows for two-way communication between the kernel and
+  user processes. It does so by creating a new socket family, PF_NETLINK.
+  Over this socket, the kernel can send and receive datagrams carrying
+  information. It is documented on many systems in netlink(7), a HOWTO is
+  provided as well, for example on
+  http://snafu.freedom.org/linux2.2/docs/netlink-HOWTO.html
+
+  So far, the kernel uses this feature to publish some network related
+  information if you say Y to "Routing messages", below. You also need
+  to say Y here if you want to use arpd, a daemon that helps keep the
+  internal ARP cache (a mapping between IP addresses and hardware
+  addresses on the local network) small. The ethertap device, which
+  lets user space programs read and write raw Ethernet frames, also
+  needs the network link driver.
+
+  If unsure, say Y.
 
 Routing messages
 CONFIG_RTNETLINK
-  If you say Y here and create a character special file /dev/route
-  with major number 36 and minor number 0 using mknod ("man mknod"),
-  you (or some user space utility) can read some network related
-  routing information from that file. Everything you write to that
-  file will be discarded.
+  If you say Y here, user space programs can receive some network
+  related routing information over the netlink. 'rtmon', supplied
+  with the iproute2 package (ftp://ftp.inr.ac.ru), can read and
+  interpret this data.  Information sent to the kernel over this link
+  is ignored.
 
 Netlink device emulation
 CONFIG_NETLINK_DEV
+  This option will be removed soon. Any programs that want to use
+  character special nodes like /dev/tap0 or /dev/route (all with major
+  number 36) need this option, and need to be rewritten soon to use
+  the real netlink socket.
   This is a backward compatibility option, choose Y for now.
-  This option will be removed soon.
 
 SCSI support?
 CONFIG_SCSI
diff -urN linux-2.2.20-pre3/Documentation/SubmittingDrivers linux/Documentation/SubmittingDrivers
--- linux-2.2.20-pre3/Documentation/SubmittingDrivers	Sun Mar 25 08:37:29 2001
+++ linux/Documentation/SubmittingDrivers	Mon Dec  3 22:19:02 2001
@@ -34,7 +34,7 @@
 	This kernel tree is under active development. The same rules apply
 	as 2.2 but you may wish to submit your driver via linux-kernel (see
 	resources) and follow that list to track changes in API's. These
-	should no longer be occuring as we are now in a code freeze.
+	should no longer be occurring as we are now in a code freeze.
 	The final contact point for Linux 2.4 submissions is 	
 	<torvalds@transmeta.com>.
 
diff -urN linux-2.2.20-pre3/Documentation/filesystems/vfs.txt linux/Documentation/filesystems/vfs.txt
--- linux-2.2.20-pre3/Documentation/filesystems/vfs.txt	Sun Mar 25 08:31:56 2001
+++ linux/Documentation/filesystems/vfs.txt	Mon Dec  3 22:19:02 2001
@@ -129,7 +129,7 @@
   name: the name of the filesystem type, such as "ext2", "iso9660",
 	"msdos" and so on
 
-  fs_flags: various flags (i.e. FS_REQUIRES_DEV, FS_NO_DCACHE, etc.)
+  fs_flags: various flags (e.g. FS_REQUIRES_DEV, FS_NO_DCACHE, etc.)
 
   read_super: the method to call when a new instance of this
 	filesystem should be mounted
@@ -403,7 +403,7 @@
 
   d_release: called when a dentry is deallocated
 
-  d_iput: called when a dentry looses its inode (just prior to its
+  d_iput: called when a dentry loses its inode (just prior to its
 	being deallocated). The default when this is NULL is that the
 	VFS calls iput(). If you define this method, you must call
 	iput() yourself
@@ -425,11 +425,11 @@
 	unused list just means that if the system needs some RAM, it
 	goes through the unused list of dentries and deallocates them.
 	If the dentry has already been unhashed and the usage count
-	drops to 0, in this case the dentry is deallocated after the
-	"d_delete" method is called
+	drops to 0, the dentry is deallocated after the "d_delete"
+	method is called
 
   d_drop: this unhashes a dentry from its parents hash list. A
-	subsequent call to dput() will dellocate the dentry if its
+	subsequent call to dput() will deallocate the dentry if its
 	usage count drops to 0
 
   d_delete: delete a dentry. If there are no other open references to
diff -urN linux-2.2.20-pre3/Documentation/networking/sk98lin.txt linux/Documentation/networking/sk98lin.txt
--- linux-2.2.20-pre3/Documentation/networking/sk98lin.txt	Mon Dec  3 22:18:55 2001
+++ linux/Documentation/networking/sk98lin.txt	Mon Dec  3 22:19:02 2001
@@ -2,9 +2,9 @@
 All rights reserved
 ===========================================================================
 
-sk98lin.txt created 27-Mar-2001
+sk98lin.txt created 07-Jun-2001
 
-Readme File for sk98lin v4.03
+Readme File for sk98lin v4.07
 SK-NET Gigabit Ethernet PCI driver for LINUX
 
 This file contains
diff -urN linux-2.2.20-pre3/Documentation/s390/cds.txt linux/Documentation/s390/cds.txt
--- linux-2.2.20-pre3/Documentation/s390/cds.txt	Sun Mar 25 08:37:29 2001
+++ linux/Documentation/s390/cds.txt	Mon Dec  3 22:19:02 2001
@@ -317,7 +317,7 @@
       0 - successful completion
 -ENODEV - irq doesn't specify a valid subchannel number
 -EINVAL - an invalid parameter was detected
--EBUSY  - an irrecoverable I/O error occured or the device is not
+-EBUSY  - an irrecoverable I/O error occurred or the device is not
           operational.
 
 Usage Notes :
@@ -549,7 +549,7 @@
 
 typedef struct {
    char            cmd_code; /* command code */
-   char            flags;    /* flags, like IDA adressing, etc. */
+   char            flags;    /* flags, like IDA addressing, etc. */
    unsigned short  count;    /* byte count */
    void           *cda;      /* data address */
 } ccw1_t __attribute__ ((aligned(8)));
diff -urN linux-2.2.20-pre3/Documentation/video4linux/API.html linux/Documentation/video4linux/API.html
--- linux-2.2.20-pre3/Documentation/video4linux/API.html	Sun Mar 25 08:31:59 2001
+++ linux/Documentation/video4linux/API.html	Mon Dec  3 22:19:02 2001
@@ -362,7 +362,7 @@
 <TR><TD>First Octet</TD><TD>Least Siginificant Byte of RDS Block</TD></TR>
 <TR><TD>Second Octet</TD><TD>Most Siginificant Byte of RDS Block
 <TR><TD>Third Octet</TD><TD>Bit 7:</TD><TD>Error bit.  Indicates that
-an uncorrectable error occured during reception of this block.</TD></TR>
+an uncorrectable error occurred during reception of this block.</TD></TR>
 <TR><TD>&nbsp;</TD><TD>Bit 6:</TD><TD>Corrected bit.  Indicates that  
 an error was corrected for this data block.</TD></TR>
 <TR><TD>&nbsp;</TD><TD>Bits 5-3:</TD><TD>Reeived Offset.  Indicates the  
diff -urN linux-2.2.20-pre3/Makefile linux/Makefile
--- linux-2.2.20-pre3/Makefile	Mon Dec  3 22:18:55 2001
+++ linux/Makefile	Mon Dec  3 22:19:02 2001
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 20
-EXTRAVERSION = pre3
+EXTRAVERSION = pre4
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
@@ -423,7 +423,8 @@
 	rm -rf modules
 
 distclean: mrproper
-	rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+	rm -f core `find . \( -not -type d \) -and \
+		\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
 		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
 		-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS
 
diff -urN linux-2.2.20-pre3/arch/alpha/kernel/signal.c linux/arch/alpha/kernel/signal.c
--- linux-2.2.20-pre3/arch/alpha/kernel/signal.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/alpha/kernel/signal.c	Mon Dec  3 22:19:02 2001
@@ -692,12 +692,8 @@
 
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGABRT: case SIGFPE: case SIGSEGV:
-				lock_kernel();
-				if (current->binfmt
-				    && current->binfmt->core_dump
-				    && current->binfmt->core_dump(signr, regs))
+				if (do_coredump(signr, regs))
 					exit_code |= 0x80;
-				unlock_kernel();
 				/* FALLTHRU */
 
 			default:
diff -urN linux-2.2.20-pre3/arch/arm/kernel/signal.c linux/arch/arm/kernel/signal.c
--- linux-2.2.20-pre3/arch/arm/kernel/signal.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/arm/kernel/signal.c	Mon Dec  3 22:19:02 2001
@@ -544,12 +544,8 @@
 
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGABRT: case SIGFPE: case SIGSEGV:
-				lock_kernel();
-				if (current->binfmt
-				    && current->binfmt->core_dump
-				    && current->binfmt->core_dump(signr, regs))
+				if (do_coredump(signr, regs))
 					exit_code |= 0x80;
-				unlock_kernel();
 				/* FALLTHRU */
 
 			default:
diff -urN linux-2.2.20-pre3/arch/i386/boot/compressed/head.S linux/arch/i386/boot/compressed/head.S
--- linux-2.2.20-pre3/arch/i386/boot/compressed/head.S	Sun Mar 25 08:31:45 2001
+++ linux/arch/i386/boot/compressed/head.S	Mon Dec  3 22:19:02 2001
@@ -65,6 +65,7 @@
 	movl %eax,0x000000	# loop forever if it isn't
 	cmpl %eax,0x100000
 	je 1b
+
 /*
  * Initialize eflags.  Some BIOS's leave bits like NT set.  This would
  * confuse the debugger if this code is traced.
@@ -86,10 +87,14 @@
  * Do the decompression, and jump to the new kernel..
  */
 	subl $16,%esp	# place for structure on the stack
-	pushl %esp	# address of structure as first arg
+	movl %esp,%eax
+	pushl %esi	# real mode pointer as second arg
+	pushl %eax	# address of structure as first arg
 	call SYMBOL_NAME(decompress_kernel)
 	orl  %eax,%eax 
 	jnz  3f
+	popl %esi	# discard address
+	popl %esi	# real mode pointer
 	xorl %ebx,%ebx
 	ljmp $(__KERNEL_CS), $0x100000
 
@@ -104,11 +109,14 @@
 	movl $0x1000,%edi
 	movl $move_routine_end,%ecx
 	subl %esi,%ecx
+	addl $3,%ecx
+	shrl $2,%ecx
 	cld
 	rep
-	movsb
+	movsl
 
 	popl %esi	# discard the address
+	popl %ebx	# real mode pointer
 	popl %esi	# low_buffer_start
 	popl %ecx	# lcount
 	popl %edx	# high_buffer_start
@@ -122,18 +130,21 @@
  * if we were high loaded. This _must_ PIC-code !
  */
 move_routine_start:
+	movl %ecx,%ebp
+	shrl $2,%ecx
+	rep
+	movsl
+	movl %ebp,%ecx
+	andl $3,%ecx
 	rep
 	movsb
 	movl %edx,%esi
 	movl %eax,%ecx	# NOTE: rep movsb won't move if %ecx == 0
+	addl $3,%ecx
+	shrl $2,%ecx
 	rep
-	movsb
+	movsl
+	movl %ebx,%esi	# Restore setup pointer
 	xorl %ebx,%ebx
-/*
- * Well, the kernel relies on %esp pointing into low mem,
- * with the decompressor loaded high this is no longer true,
- * so we set esp here.
- */
-	mov  $0x90000,%esp
 	ljmp $(__KERNEL_CS), $0x100000
 move_routine_end:
diff -urN linux-2.2.20-pre3/arch/i386/boot/compressed/misc.c linux/arch/i386/boot/compressed/misc.c
--- linux-2.2.20-pre3/arch/i386/boot/compressed/misc.c	Sun Mar 25 08:31:45 2001
+++ linux/arch/i386/boot/compressed/misc.c	Mon Dec  3 22:19:02 2001
@@ -74,11 +74,13 @@
 /*
  * This is set up by the setup-routine at boot-time
  */
-#define EXT_MEM_K (*(unsigned short *)0x90002)
+static unsigned char *real_mode; /* Pointer to real-mode data */
+
+#define EXT_MEM_K   (*(unsigned short *)(real_mode + 0x2))
 #ifndef STANDARD_MEMORY_BIOS_CALL
-#define ALT_MEM_K (*(unsigned long *) 0x901e0)
+#define ALT_MEM_K   (*(unsigned long *)(real_mode + 0x1e0))
 #endif
-#define SCREEN_INFO (*(struct screen_info *)0x90000)
+#define SCREEN_INFO (*(struct screen_info *)(real_mode+0))
 
 extern char input_data[];
 extern int input_len;
@@ -98,13 +100,13 @@
   
 extern int end;
 static long free_mem_ptr = (long)&end;
-static long free_mem_end_ptr = 0x90000;
+static long free_mem_end_ptr;
  
 #define INPLACE_MOVE_ROUTINE  0x1000
 #define LOW_BUFFER_START      0x2000
-#define LOW_BUFFER_END       0x90000
-#define LOW_BUFFER_SIZE      ( LOW_BUFFER_END - LOW_BUFFER_START )
+#define LOW_BUFFER_MAX       0x90000
 #define HEAP_SIZE             0x2400
+static unsigned int low_buffer_end, low_buffer_size;
 static int high_loaded =0;
 static uch *high_buffer_start /* = (uch *)(((ulg)&end) + HEAP_SIZE)*/;
 
@@ -255,7 +257,7 @@
     in = window;
     for (n = 0; n < outcnt; n++) {
 	ch = *output_data++ = *in++;
-	if ((ulg)output_data == LOW_BUFFER_END) output_data=high_buffer_start;
+	if ((ulg)output_data == low_buffer_end) output_data=high_buffer_start;
 	c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
     }
     crc = c;
@@ -311,10 +313,13 @@
 	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory.\n");
 #endif	
 	mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
+	low_buffer_end = ((unsigned int)real_mode > LOW_BUFFER_MAX
+	  ? LOW_BUFFER_MAX : (unsigned int)real_mode) & ~0xfff;
+	low_buffer_size = low_buffer_end - LOW_BUFFER_START;
 	high_loaded = 1;
 	free_mem_end_ptr = (long)high_buffer_start;
-	if ( (0x100000 + LOW_BUFFER_SIZE) > ((ulg)high_buffer_start)) {
-		high_buffer_start = (uch *)(0x100000 + LOW_BUFFER_SIZE);
+	if ( (0x100000 + low_buffer_size) > ((ulg)high_buffer_start)) {
+		high_buffer_start = (uch *)(0x100000 + low_buffer_size);
 		mv->hcount = 0; /* say: we need not to move high_buffer */
 	}
 	else mv->hcount = -1;
@@ -323,17 +328,21 @@
 
 void close_output_buffer_if_we_run_high(struct moveparams *mv)
 {
-	mv->lcount = bytes_out;
-	if (bytes_out > LOW_BUFFER_SIZE) {
-		mv->lcount = LOW_BUFFER_SIZE;
-		if (mv->hcount) mv->hcount = bytes_out - LOW_BUFFER_SIZE;
+	if (bytes_out > low_buffer_size) {
+		mv->lcount = low_buffer_size;
+		if (mv->hcount)
+			mv->hcount = bytes_out - low_buffer_size;
+	} else {
+		mv->lcount = bytes_out;
+		mv->hcount = 0;
 	}
-	else mv->hcount = 0;
 }
 
 
-int decompress_kernel(struct moveparams *mv)
+int decompress_kernel(struct moveparams *mv, void *rmode)
 {
+	real_mode = rmode;
+
 	if (SCREEN_INFO.orig_video_mode == 7) {
 		vidmem = (char *) 0xb0000;
 		vidport = 0x3b4;
@@ -355,4 +364,3 @@
 	if (high_loaded) close_output_buffer_if_we_run_high(mv);
 	return high_loaded;
 }
-
diff -urN linux-2.2.20-pre3/arch/i386/boot/setup.S linux/arch/i386/boot/setup.S
--- linux-2.2.20-pre3/arch/i386/boot/setup.S	Sun Mar 25 08:37:29 2001
+++ linux/arch/i386/boot/setup.S	Mon Dec  3 22:19:02 2001
@@ -69,7 +69,7 @@
 ! SETUP-header, must start at CS:2 (old 0x9020:2)
 !
 		.ascii	"HdrS"		! Signature for SETUP-header
-		.word	0x0201		! Version number of header format
+		.word	0x0202		! Version number of header format
 					! (must be >= 0x0105
 					! else old loadlin-1.5 will fail)
 realmode_swtch:	.word	0,0		! default_switch,SETUPSEG
@@ -120,9 +120,28 @@
 ramdisk_size:	.long	0	! its size in bytes
 bootsect_kludge:
 		.word   bootsect_helper,SETUPSEG
-heap_end_ptr:	.word	modelist+1024	! space from here (exclusive) down to
-				! end of setup code can be used by setup
-				! for local heap purposes.
+heap_end_ptr:	.word	modelist+1024	! (Header version 0x0201 or later)
+					! space from here (exclusive) down to
+					! end of setup code can be used by setup
+					! for local heap purposes.
+
+pad1:		.word 0			! Reserved for future use
+
+cmd_line_ptr:	.long 0			! (Header version 0x0202 or later)
+					! If nonzero, a 32-bit pointer
+					! to the kernel command line.
+					! The command line should be
+					! located between the start of
+					! setup and the end of low
+					! memory (0xa0000), or it may
+					! get overwritten before it
+					! gets read.  If this field is
+					! used, there is no longer
+					! anything magical about the
+					! 0x90000 segment; the setup
+					! can be located anywhere in
+					! low memory 0x10000 or higher.
+	
 ! ------------------------ end of header ----------------------------------
 
 start_of_setup:
@@ -534,6 +553,13 @@
 	mov	ax,cs ! aka #SETUPSEG	! right, forgot this at first. didn't work :-)
 	mov	ds,ax
 
+! Check whether we need to be downward compatible with version <= 0x0201
+	cmp	dword ptr [cmd_line_ptr],#0
+	jne	end_move_self
+	cmp	byte ptr [type_of_loader],#0x20
+	je	end_move_self
+
+! Boot loader does not support boot protocol version 2.02.
 ! If we have our code not at 0x90000, we need to move it there now.
 ! We also then need to move the parameters behind it (command line)
 ! Because we would overwrite the code on the current IP, we move
@@ -572,9 +598,14 @@
 	mov	ds,ax
 	mov	ss,dx
 			! now we are at the right place
-end_move_self:
 
+end_move_self:
 	lidt	idt_48		! load idt with 0,0
+	xor	eax,eax
+	mov	ax,ds
+	shl	eax,#4
+	add	eax,#gdt
+	mov	[gdt_48+2],eax
 	lgdt	gdt_48		! load gdt with whatever appropriate
 
 ! that was painless, now we enable A20
@@ -679,7 +710,11 @@
 	jmp	flush_instr
 flush_instr:
 	xor	bx,bx		! Flag to indicate a boot
-
+	xor	esi,esi		! Pointer to real-mode code
+	mov	si,cs
+	sub	si,#DELTA_INITSEG
+	shl	esi,#4		! Convert to 32-bit pointer
+	
 ! NOTE: For high loaded big kernels we need a
 !	jmpi    0x100000,__KERNEL_CS
 !
@@ -873,7 +908,7 @@
 
 gdt_48:
 	.word	0x800		! gdt limit=2048, 256 GDT entries
-	.word	512+gdt,0x9	! gdt base = 0X9xxxx
+	.word	0, 0		! gdt base (filled in later)
 
 !
 ! Include video setup & detection code
diff -urN linux-2.2.20-pre3/arch/i386/kernel/head.S linux/arch/i386/kernel/head.S
--- linux-2.2.20-pre3/arch/i386/kernel/head.S	Sun Mar 25 08:31:45 2001
+++ linux/arch/i386/kernel/head.S	Mon Dec  3 22:19:02 2001
@@ -14,11 +14,11 @@
 #include <asm/page.h>
 #include <asm/pgtable.h>
 
-
-#define CL_MAGIC_ADDR	0x90020
-#define CL_MAGIC	0xA33F
-#define CL_BASE_ADDR	0x90000
-#define CL_OFFSET	0x90022
+#define OLD_CL_MAGIC_ADDR	0x90020
+#define OLD_CL_MAGIC		0xA33F
+#define OLD_CL_BASE_ADDR	0x90000
+#define OLD_CL_OFFSET		0x90022
+#define NEW_CL_POINTER		0x228	/* Relative to real mode data */
 
 /*
  * References to members of the boot_cpu_data structure.
@@ -36,6 +36,8 @@
 
 /*
  * swapper_pg_dir is the main page directory, address 0x00101000
+ *
+ * On entry, %esi points to the real-mode code as a 32-bit pointer.
  */
 ENTRY(stext)
 ENTRY(_stext)
@@ -52,6 +54,9 @@
 #ifdef __SMP__
 	orw %bx,%bx
 	jz 1f
+#endif
+
+#ifdef __SMP__
 /*
  *	New page tables may be in 4Mbyte page mode and may
  *	be using the global pages. 
@@ -89,6 +94,7 @@
 	jmp checkCPUtype
 1:
 #endif __SMP__
+
 /*
  * Clear BSS first so that there are no surprises...
  */
@@ -99,6 +105,7 @@
 	cld
 	rep
 	stosb
+
 /*
  * start system 32-bit setup. We need to re-do some of the things done
  * in 16-bit mode for the "real" operations.
@@ -115,8 +122,9 @@
  * Copy bootup parameters out of the way. First 2kB of
  * _empty_zero_page is for boot parameters, second 2kB
  * is for the command line.
+ *
+ * Note: %esi still has the pointer to the real-mode data.
  */
-	movl $0x90000,%esi
 	movl $ SYMBOL_NAME(empty_zero_page),%edi
 	movl $512,%ecx
 	cld
@@ -126,11 +134,15 @@
 	movl $512,%ecx
 	rep
 	stosl
-	cmpw $(CL_MAGIC),CL_MAGIC_ADDR
+	movl SYMBOL_NAME(empty_zero_page)+NEW_CL_POINTER,%esi
+	andl %esi,%esi
+	jnz 2f
+	cmpw $(OLD_CL_MAGIC),OLD_CL_MAGIC_ADDR
 	jne 1f
+	movzwl OLD_CL_OFFSET,%esi
+	addl $(OLD_CL_BASE_ADDR),%esi
+2:
 	movl $ SYMBOL_NAME(empty_zero_page)+2048,%edi
-	movzwl CL_OFFSET,%esi
-	addl $(CL_BASE_ADDR),%esi
 	movl $2048,%ecx
 	rep
 	movsb
diff -urN linux-2.2.20-pre3/arch/i386/kernel/signal.c linux/arch/i386/kernel/signal.c
--- linux-2.2.20-pre3/arch/i386/kernel/signal.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/i386/kernel/signal.c	Mon Dec  3 22:19:02 2001
@@ -697,12 +697,8 @@
 
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGABRT: case SIGFPE: case SIGSEGV:
-				lock_kernel();
-				if (current->binfmt
-				    && current->binfmt->core_dump
-				    && current->binfmt->core_dump(signr, regs))
+				if (do_coredump(signr, regs))
 					exit_code |= 0x80;
-				unlock_kernel();
 				/* FALLTHRU */
 
 			default:
diff -urN linux-2.2.20-pre3/arch/m68k/kernel/signal.c linux/arch/m68k/kernel/signal.c
--- linux-2.2.20-pre3/arch/m68k/kernel/signal.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/m68k/kernel/signal.c	Mon Dec  3 22:19:02 2001
@@ -1093,9 +1093,7 @@
 
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGIOT: case SIGFPE: case SIGSEGV:
-				if (current->binfmt
-				    && current->binfmt->core_dump
-				    && current->binfmt->core_dump(signr, regs))
+				if (do_coredump(signr, regs))
 					exit_code |= 0x80;
 				/* FALLTHRU */
 
diff -urN linux-2.2.20-pre3/arch/mips/baget/irq.c linux/arch/mips/baget/irq.c
--- linux-2.2.20-pre3/arch/mips/baget/irq.c	Sun Mar 25 08:31:48 2001
+++ linux/arch/mips/baget/irq.c	Mon Dec  3 22:19:02 2001
@@ -212,7 +212,7 @@
 			add_interrupt_randomness(irq);
 		__cli();
 	} else {
-		printk("do_IRQ: Unregistered IRQ (0x%X) occured\n", irq);
+		printk("do_IRQ: Unregistered IRQ (0x%X) occurred\n", irq);
 	}
 	unmask_irq(irq);
 	hardirq_exit(cpu);
diff -urN linux-2.2.20-pre3/arch/mips/dec/prom/memory.c linux/arch/mips/dec/prom/memory.c
--- linux-2.2.20-pre3/arch/mips/dec/prom/memory.c	Sun Mar 25 08:31:48 2001
+++ linux/arch/mips/dec/prom/memory.c	Mon Dec  3 22:19:02 2001
@@ -25,7 +25,7 @@
 
 extern unsigned long mips_memory_upper;
 
-volatile unsigned long mem_err = 0;	/* So we know an error occured */
+volatile unsigned long mem_err = 0;	/* So we know an error occurred */
 
 /*
  * Probe memory in 4MB chunks, waiting for an error to tell us we've fallen
diff -urN linux-2.2.20-pre3/arch/mips/kernel/irixelf.c linux/arch/mips/kernel/irixelf.c
--- linux-2.2.20-pre3/arch/mips/kernel/irixelf.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/mips/kernel/irixelf.c	Mon Dec  3 22:19:02 2001
@@ -44,15 +44,15 @@
 
 static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs);
 static int load_irix_library(int fd);
-static int irix_core_dump(long signr, struct pt_regs * regs);
+static int irix_core_dump(long signr, struct pt_regs * regs, struct file *);
 extern int dump_fpu (elf_fpregset_t *);
 
 static struct linux_binfmt irix_format = {
-#ifndef MODULE
-	NULL, NULL, load_irix_binary, load_irix_library, irix_core_dump
-#else
-	NULL, &__this_module.usecount, load_irix_binary, load_irix_library, irix_core_dump
-#endif
+	module:		THIS_MODULE,
+	load_binary:	load_irix_binary,
+	load_shlib:	load_irix_library,
+	core_dump:	irix_core_dump,
+	min_coredump:	PAGE_SIZE,
 };
 
 #ifndef elf_addr_t
@@ -1128,14 +1128,10 @@
  * and then they are actually written out.  If we run out of core limit
  * we just truncate.
  */
-static int irix_core_dump(long signr, struct pt_regs * regs)
+static int irix_core_dump(long signr, struct pt_regs * regs, struct file * file)
 {
 	int has_dumped = 0;
-	struct file *file;
-	struct dentry *dentry;
-	struct inode *inode;
 	mm_segment_t fs;
-	char corefile[6+sizeof(current->comm)];
 	int segs;
 	int i;
 	size_t size;
@@ -1148,14 +1144,6 @@
 	struct elf_prstatus prstatus;	/* NT_PRSTATUS */
 	elf_fpregset_t fpu;		/* NT_PRFPREG */
 	struct elf_prpsinfo psinfo;	/* NT_PRPSINFO */
-	
-	if (!current->dumpable || limit < PAGE_SIZE)
-		return 0;
-	current->dumpable = 0;
-
-#ifndef CONFIG_BINFMT_IRIX
-	MOD_INC_USE_COUNT;
-#endif
 
 	/* Count what's needed to dump, up to the limit of coredump size. */
 	segs = 0;
@@ -1201,27 +1189,6 @@
 	fs = get_fs();
 	set_fs(KERNEL_DS);
 
-	memcpy(corefile,"core.", 5);
-#if 0
-	memcpy(corefile+5,current->comm,sizeof(current->comm));
-#else
-	corefile[4] = '\0';
-#endif
-	file = filp_open(corefile, O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600);
-	if (IS_ERR(file))
-		goto end_coredump;
-	dentry = file->f_dentry;
-	inode = dentry->d_inode;
-	if (inode->i_nlink > 1)
-		goto close_coredump;	/* multiple links - don't dump */
-
-	if (!S_ISREG(inode->i_mode))
-		goto close_coredump;
-	if (!inode->i_op || !inode->i_op->default_file_ops)
-		goto close_coredump;
-	if (!file->f_op->write)
-		goto close_coredump;
-
 	has_dumped = 1;
 	current->flags |= PF_DUMPCORE;
 
@@ -1386,13 +1353,7 @@
 	}
 
  close_coredump:
-	filp_close(file, NULL);
-
- end_coredump:
 	set_fs(fs);
-#ifndef CONFIG_BINFMT_ELF
-	MOD_DEC_USE_COUNT;
-#endif
 	return has_dumped;
 }
 
diff -urN linux-2.2.20-pre3/arch/mips/kernel/irixsig.c linux/arch/mips/kernel/irixsig.c
--- linux-2.2.20-pre3/arch/mips/kernel/irixsig.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/mips/kernel/irixsig.c	Mon Dec  3 22:19:02 2001
@@ -261,12 +261,8 @@
 
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGABRT: case SIGFPE: case SIGSEGV:
-				lock_kernel();
-				if (current->binfmt
-				    && current->binfmt->core_dump
-				    && current->binfmt->core_dump(signr, regs))
+				if (do_coredump(signr, regs))
 					exit_code |= 0x80;
-				unlock_kernel();
 				/* FALLTHRU */
 
 			default:
diff -urN linux-2.2.20-pre3/arch/mips/kernel/signal.c linux/arch/mips/kernel/signal.c
--- linux-2.2.20-pre3/arch/mips/kernel/signal.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/mips/kernel/signal.c	Mon Dec  3 22:19:02 2001
@@ -493,12 +493,8 @@
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGABRT: case SIGFPE: case SIGSEGV:
 			case SIGBUS:
-				lock_kernel();
-				if (current->binfmt
-				    && current->binfmt->core_dump
-				    && current->binfmt->core_dump(signr, regs))
+				if (do_coredump(signr, regs))
 					exit_code |= 0x80;
-				unlock_kernel();
 				/* FALLTHRU */
 
 			default:
diff -urN linux-2.2.20-pre3/arch/ppc/kernel/openpic.c linux/arch/ppc/kernel/openpic.c
--- linux-2.2.20-pre3/arch/ppc/kernel/openpic.c	Sun Mar 25 08:37:30 2001
+++ linux/arch/ppc/kernel/openpic.c	Mon Dec  3 22:19:02 2001
@@ -242,8 +242,8 @@
 			    openpic_mapirq(i, 1<<0);
 			}
 		} else {
-			/* Prevent any interrupt from occuring during initialisation.
-			 * Hum... I beleive this is not necessary, Apple does that in
+			/* Prevent any interrupt from occurring during initialisation.
+			 * Hum... I believe this is not necessary, Apple does that in
 			 * Darwin's PowerExpress code.
 			 */
 			openpic_set_priority(0, 0xf);
@@ -635,4 +635,4 @@
 	for (i=0; i<NumProcessors; i++)
 		openpic_write(&OpenPIC->Processor[i].Current_Task_Priority, save_cpu_task_pri[i]);
 }
-#endif /* CONFIG_PMAC_PBOOK */
\ No newline at end of file
+#endif /* CONFIG_PMAC_PBOOK */
diff -urN linux-2.2.20-pre3/arch/ppc/kernel/pmac_pci.c linux/arch/ppc/kernel/pmac_pci.c
--- linux-2.2.20-pre3/arch/ppc/kernel/pmac_pci.c	Sun Mar 25 08:31:49 2001
+++ linux/arch/ppc/kernel/pmac_pci.c	Mon Dec  3 22:19:02 2001
@@ -109,7 +109,7 @@
 	bridge_node = NULL;
 	node = find_pci_device_OFnode(bus, dev_fn & 0xf8);
 	if (node) {
-	    /* note: we don't stop on the first occurence since we need to go
+	    /* note: we don't stop on the first occurrence since we need to go
              * up to the root bridge */
 	    do {
 		if (node->type && !strcmp(node->type, "pci") 
diff -urN linux-2.2.20-pre3/arch/ppc/kernel/signal.c linux/arch/ppc/kernel/signal.c
--- linux-2.2.20-pre3/arch/ppc/kernel/signal.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/ppc/kernel/signal.c	Mon Dec  3 22:19:02 2001
@@ -626,12 +626,8 @@
 
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGABRT: case SIGFPE: case SIGSEGV:
-				lock_kernel();
-				if (current->binfmt
-				    && current->binfmt->core_dump
-				    && current->binfmt->core_dump(signr, regs))
+				if (do_coredump(signr, regs))
 					exit_code |= 0x80;
-				unlock_kernel();
 				/* FALLTHRU */
 
 			default:
diff -urN linux-2.2.20-pre3/arch/s390/kernel/entry.S linux/arch/s390/kernel/entry.S
--- linux-2.2.20-pre3/arch/s390/kernel/entry.S	Sun Mar 25 08:37:30 2001
+++ linux/arch/s390/kernel/entry.S	Mon Dec  3 22:19:02 2001
@@ -661,7 +661,7 @@
         lr      %r3,%r8
         la      %r0,0x7f
         nr      %r3,%r0           # clear per-event-bit
-        be      BASED(pgm_dn)     # none of Martins exceptions occured bypass
+        be      BASED(pgm_dn)     # none of Martins exceptions occurred bypass
         l       %r9,BASED(.Ljump_table)
         sll     %r3,2
         l       %r9,0(%r3,%r9)    # load address of handler routine
diff -urN linux-2.2.20-pre3/arch/s390/kernel/signal.c linux/arch/s390/kernel/signal.c
--- linux-2.2.20-pre3/arch/s390/kernel/signal.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/s390/kernel/signal.c	Mon Dec  3 22:19:02 2001
@@ -529,12 +529,8 @@
 
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGABRT: case SIGFPE: case SIGSEGV:
-				lock_kernel();
-				if (current->binfmt
-				    && current->binfmt->core_dump
-				    && current->binfmt->core_dump(signr, regs))
+				if (do_coredump(signr, regs))
 					exit_code |= 0x80;
-				unlock_kernel();
 				/* FALLTHRU */
 
 			default:
diff -urN linux-2.2.20-pre3/arch/s390/tools/dasdfmt/dasdfmt.c linux/arch/s390/tools/dasdfmt/dasdfmt.c
--- linux-2.2.20-pre3/arch/s390/tools/dasdfmt/dasdfmt.c	Sun Mar 25 08:37:30 2001
+++ linux/arch/s390/tools/dasdfmt/dasdfmt.c	Mon Dec  3 22:19:02 2001
@@ -479,7 +479,7 @@
 
 	rc=stat(dev_name,&stat_buf);
 	if (rc) {
-		ERRMSG_EXIT(EXIT_FAILURE,"%s: error occured during stat: " \
+		ERRMSG_EXIT(EXIT_FAILURE,"%s: error occurred during stat: " \
 			"%s\n",prog_name,strerror(errno));
 	} else {
 		if (!S_ISBLK(stat_buf.st_mode))
diff -urN linux-2.2.20-pre3/arch/sparc/kernel/entry.S linux/arch/sparc/kernel/entry.S
--- linux-2.2.20-pre3/arch/sparc/kernel/entry.S	Sun Mar 25 08:31:46 2001
+++ linux/arch/sparc/kernel/entry.S	Mon Dec  3 22:19:02 2001
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.159.2.8 2000/10/05 04:17:17 anton Exp $
+/* $Id: entry.S,v 1.159.2.9 2001/06/18 12:26:13 davem Exp $
  * arch/sparc/kernel/entry.S:  Sparc trap low-level entry points.
  *
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -1237,8 +1237,8 @@
 	call	C_LABEL(do_ptrace)
 	 add	%sp, REGWIN_SZ, %o0
 
-	ld	[%curptr + AOFF_task_flags], %l5
-	andcc	%l5, 0x20, %g0
+	ld	[%curptr + AOFF_task_ptrace], %l5
+	andcc	%l5, 0x02, %g0
 	be	1f
 	 nop
 
@@ -1287,8 +1287,8 @@
 	call	C_LABEL(do_sigpause)
 	 add	%sp, REGWIN_SZ, %o1
 
-	ld	[%curptr + AOFF_task_flags], %l5
-	andcc	%l5, 0x20, %g0
+	ld	[%curptr + AOFF_task_ptrace], %l5
+	andcc	%l5, 0x02, %g0
 	be	1f
 	 nop
 
@@ -1305,8 +1305,8 @@
 	call	C_LABEL(do_sigsuspend)
 	 add	%sp, REGWIN_SZ, %o0
 
-	ld	[%curptr + AOFF_task_flags], %l5
-	andcc	%l5, 0x20, %g0
+	ld	[%curptr + AOFF_task_ptrace], %l5
+	andcc	%l5, 0x02, %g0
 	be	1f
 	 nop
 
@@ -1324,8 +1324,8 @@
 	call	C_LABEL(do_rt_sigsuspend)
 	 add	%sp, REGWIN_SZ, %o2
 
-	ld	[%curptr + AOFF_task_flags], %l5
-	andcc	%l5, 0x20, %g0
+	ld	[%curptr + AOFF_task_ptrace], %l5
+	andcc	%l5, 0x02, %g0
 	be	1f
 	 nop
 
@@ -1342,8 +1342,8 @@
 	call	C_LABEL(do_sigreturn)
 	 add	%sp, REGWIN_SZ, %o0
 
-	ld	[%curptr + AOFF_task_flags], %l5
-	andcc	%l5, 0x20, %g0
+	ld	[%curptr + AOFF_task_ptrace], %l5
+	andcc	%l5, 0x02, %g0
 	be	1f
 	 nop
 
@@ -1362,8 +1362,8 @@
 	call	C_LABEL(do_rt_sigreturn)
 	 add	%sp, REGWIN_SZ, %o0
 
-	ld	[%curptr + AOFF_task_flags], %l5
-	andcc	%l5, 0x20, %g0
+	ld	[%curptr + AOFF_task_ptrace], %l5
+	andcc	%l5, 0x02, %g0
 	be	1f
 	 nop
 
@@ -1500,9 +1500,9 @@
 	mov	%i1, %o1
 	mov	%i2, %o2
 
-	ld	[%curptr + AOFF_task_flags], %l5
+	ld	[%curptr + AOFF_task_ptrace], %l5
 	mov	%i3, %o3
-	andcc	%l5, 0x20, %g0
+	andcc	%l5, 0x02, %g0
 	mov	%i4, %o4
 	bne	linux_syscall_trace
 	 mov	%i0, %l5
@@ -1514,12 +1514,12 @@
 
 	.globl	C_LABEL(ret_sys_call)
 C_LABEL(ret_sys_call):
-	ld	[%curptr + AOFF_task_flags], %l6
+	ld	[%curptr + AOFF_task_ptrace], %l6
 	cmp	%o0, -ENOIOCTLCMD
 	ld	[%sp + REGWIN_SZ + PT_PSR], %g3
 	set	PSR_C, %g2
 	bgeu	1f
-	 andcc	%l6, 0x20, %l6	
+	 andcc	%l6, 0x02, %l6
 
 	/* System call success, clear Carry condition code. */
 	andn	%g3, %g2, %g3
diff -urN linux-2.2.20-pre3/arch/sparc/kernel/signal.c linux/arch/sparc/kernel/signal.c
--- linux-2.2.20-pre3/arch/sparc/kernel/signal.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/sparc/kernel/signal.c	Mon Dec  3 22:19:02 2001
@@ -1,4 +1,4 @@
-/*  $Id: signal.c,v 1.91.2.2 2000/05/28 19:13:21 ecd Exp $
+/*  $Id: signal.c,v 1.91.2.3 2001/06/18 12:26:13 davem Exp $
  *  linux/arch/sparc/kernel/signal.c
  *
  *  Copyright (C) 1991, 1992  Linus Torvalds
@@ -1217,14 +1217,8 @@
 
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS:
-				if(current->binfmt && current->binfmt->core_dump) {
-					lock_kernel();
-					if(current->binfmt &&
-					   current->binfmt->core_dump &&
-					   current->binfmt->core_dump(signr, regs))
-						exit_code |= 0x80;
-					unlock_kernel();
-				}
+				if (do_coredump(signr, regs))
+					exit_code |= 0x80;
 #ifdef DEBUG_SIGNALS
 				/* Very useful to debug dynamic linker problems */
 				printk ("Sig %ld going for %s[%d]...\n", signr, current->comm, current->pid);
diff -urN linux-2.2.20-pre3/arch/sparc/lib/memset.S linux/arch/sparc/lib/memset.S
--- linux-2.2.20-pre3/arch/sparc/lib/memset.S	Sun Mar 25 08:31:47 2001
+++ linux/arch/sparc/lib/memset.S	Mon Dec  3 22:19:02 2001
@@ -185,7 +185,7 @@
 	b 30f
 	 add	%o0, %o1, %o0
 30:
-/* %o4 is faulting address, %o5 is %pc where fault occured */
+/* %o4 is faulting address, %o5 is %pc where fault occurred */
 	save	%sp, -104, %sp
 	mov	%i5, %o0
 	mov	%i7, %o1
diff -urN linux-2.2.20-pre3/arch/sparc64/kernel/binfmt_aout32.c linux/arch/sparc64/kernel/binfmt_aout32.c
--- linux-2.2.20-pre3/arch/sparc64/kernel/binfmt_aout32.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/sparc64/kernel/binfmt_aout32.c	Mon Dec  3 22:19:02 2001
@@ -34,12 +34,16 @@
 
 static int load_aout32_binary(struct linux_binprm *, struct pt_regs * regs);
 static int load_aout32_library(int fd);
-static int aout32_core_dump(long signr, struct pt_regs * regs);
+static int aout32_core_dump(long signr, struct pt_regs * regs, struct file *);
 
 extern void dump_thread(struct pt_regs *, struct user *);
 
 static struct linux_binfmt aout32_format = {
-	NULL, NULL, load_aout32_binary, load_aout32_library, aout32_core_dump
+	module:		THIS_MODULE,
+	load_binary:	load_aout32_binary,
+	load_shlib:	load_aout32_library,
+	core_dump:	aout32_core_dump,
+	min_coredump:	PAGE_SIZE,
 };
 
 static void set_brk(unsigned long start, unsigned long end)
@@ -87,46 +91,18 @@
  * dumping of the process results in another error..
  */
 
-static inline int
-do_aout32_core_dump(long signr, struct pt_regs * regs)
+static int
+aout32_core_dump(long signr, struct pt_regs * regs, struct file * file)
 {
-	struct dentry * dentry = NULL;
-	struct inode * inode = NULL;
-	struct file * file;
 	mm_segment_t fs;
 	int has_dumped = 0;
-	char corefile[6+sizeof(current->comm)];
 	unsigned long dump_start, dump_size;
 	struct user dump;
 #       define START_DATA(u)    (u.u_tsize)
 #       define START_STACK(u)   ((regs->u_regs[UREG_FP]) & ~(PAGE_SIZE - 1))
 
-	if (!current->dumpable || atomic_read(&current->mm->count) != 1)
-		return 0;
-	current->dumpable = 0;
-
-/* See if we have enough room to write the upage.  */
-	if (current->rlim[RLIMIT_CORE].rlim_cur < PAGE_SIZE)
-		return 0;
 	fs = get_fs();
 	set_fs(KERNEL_DS);
-	memcpy(corefile,"core.",5);
-#if 0
-	memcpy(corefile+5,current->comm,sizeof(current->comm));
-#else
-	corefile[4] = '\0';
-#endif
-	file = filp_open(corefile,O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600);
-	if (IS_ERR(file))
-		goto end_coredump;
-	dentry = file->f_dentry;
-	inode = dentry->d_inode;
-	if (!S_ISREG(inode->i_mode))
-		goto close_coredump;
-	if (!inode->i_op || !inode->i_op->default_file_ops)
-		goto close_coredump;
-	if (!file->f_op->write)
-		goto close_coredump;
 	has_dumped = 1;
 	current->flags |= PF_DUMPCORE;
        	strncpy(dump.u_comm, current->comm, sizeof(current->comm));
@@ -172,21 +148,8 @@
 	set_fs(KERNEL_DS);
 	DUMP_WRITE(current,sizeof(*current));
 close_coredump:
-	filp_close(file, NULL);
-end_coredump:
 	set_fs(fs);
 	return has_dumped;
-}
-
-static int
-aout32_core_dump(long signr, struct pt_regs * regs)
-{
-	int retval;
-
-	MOD_INC_USE_COUNT;
-	retval = do_aout32_core_dump(signr, regs);
-	MOD_DEC_USE_COUNT;
-	return retval;
 }
 
 /*
diff -urN linux-2.2.20-pre3/arch/sparc64/kernel/entry.S linux/arch/sparc64/kernel/entry.S
--- linux-2.2.20-pre3/arch/sparc64/kernel/entry.S	Sun Mar 25 08:31:53 2001
+++ linux/arch/sparc64/kernel/entry.S	Mon Dec  3 22:19:02 2001
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.103.2.6 2000/09/08 14:00:04 jj Exp $
+/* $Id: entry.S,v 1.103.2.7 2001/06/18 12:26:13 davem Exp $
  * arch/sparc64/kernel/entry.S:  Sparc64 trap low-level entry points.
  *
  * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu)
@@ -880,8 +880,8 @@
 		 add		%o7, 1f-.-4, %o7
 		nop
 		.align		32
-1:		ldx		[%curptr + AOFF_task_flags], %l5
-		andcc		%l5, 0x20, %g0
+1:		ldx		[%curptr + AOFF_task_ptrace], %l5
+		andcc		%l5, 0x02, %g0
 		be,pt		%icc, rtrap
 		 clr		%l6
 		call		syscall_trace
@@ -1015,12 +1015,12 @@
 	mov		%i4, %o4				! IEU1
 	lduw		[%l7 + %l4], %l7			! Load
 	srl		%i1, 0, %o1				! IEU0	Group
-	ldx		[%curptr + AOFF_task_flags], %l0	! Load
+	ldx		[%curptr + AOFF_task_ptrace], %l0	! Load
 
 	mov		%i5, %o5				! IEU1
 	srl		%i2, 0, %o2				! IEU0	Group
 	mov		%i0, %l5				! IEU1
-	andcc		%l0, 0x20, %g0				! IEU1	Group
+	andcc		%l0, 0x02, %g0				! IEU1	Group
 	bne,pn		%icc, linux_syscall_trace32		! CTI
 	 srl		%i3, 0, %o3				! IEU0
 	call		%l7					! CTI	Group brk forced
@@ -1044,11 +1044,11 @@
 	mov		%i1, %o1				! IEU1
 	lduw		[%l7 + %l4], %l7			! Load
 4:	mov		%i2, %o2				! IEU0	Group
-	ldx		[%curptr + AOFF_task_flags], %l0	! Load
+	ldx		[%curptr + AOFF_task_ptrace], %l0	! Load
 
 	mov		%i3, %o3				! IEU1
 	mov		%i4, %o4				! IEU0	Group
-	andcc		%l0, 0x20, %g0				! IEU1	Group+1 bubble
+	andcc		%l0, 0x02, %g0				! IEU1	Group+1 bubble
 	bne,pn		%icc, linux_syscall_trace		! CTI	Group
 	 mov		%i0, %l5				! IEU0
 2:	call		%l7					! CTI	Group brk forced
@@ -1059,14 +1059,14 @@
 	call		syscall_trace_exit
 	 add		%sp, STACK_BIAS + REGWIN_SZ, %o1
 #endif
-	ldx		[%curptr + AOFF_task_flags], %l6
+	ldx		[%curptr + AOFF_task_ptrace], %l6
 	sra		%o0, 0, %o0
 	mov		%ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
 	ldx		[%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3
 	cmp		%o0, -ENOIOCTLCMD
 	sllx		%g2, 32, %g2
 	bgeu,pn		%xcc, 1f
-	 andcc		%l6, 0x20, %l6	
+	 andcc		%l6, 0x02, %l6	
 
 	/* System call success, clear Carry condition code. */
 	andn		%g3, %g2, %g3
diff -urN linux-2.2.20-pre3/arch/sparc64/kernel/ioctl32.c linux/arch/sparc64/kernel/ioctl32.c
--- linux-2.2.20-pre3/arch/sparc64/kernel/ioctl32.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/sparc64/kernel/ioctl32.c	Mon Dec  3 22:19:02 2001
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.62.2.20 2001/05/16 07:28:40 davem Exp $
+/* $Id: ioctl32.c,v 1.62.2.21 2001/06/08 01:34:11 davem Exp $
  * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  *
  * Copyright (C) 1997  Jakub Jelinek  (jj@sunsite.mff.cuni.cz)
@@ -2692,6 +2692,8 @@
 	case /* STOP_ARRAY */		_IO (MD_MAJOR, 0x32):
 	case /* STOP_ARRAY_RO */	_IO (MD_MAJOR, 0x33):
 	case /* RESTART_ARRAY_RW */	_IO (MD_MAJOR, 0x34):
+	case /* PRINT_RAID_DEBUG */	_IO (MD_MAJOR, 0x13):
+	case /* SET_DISK_FAULTY */	_IO (MD_MAJOR, 0x29):
 
 	/* Big K */
 	case PIO_FONT:
diff -urN linux-2.2.20-pre3/arch/sparc64/kernel/signal.c linux/arch/sparc64/kernel/signal.c
--- linux-2.2.20-pre3/arch/sparc64/kernel/signal.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/sparc64/kernel/signal.c	Mon Dec  3 22:19:02 2001
@@ -1,4 +1,4 @@
-/*  $Id: signal.c,v 1.38.2.1 1999/06/14 00:36:21 davem Exp $
+/*  $Id: signal.c,v 1.38.2.2 2001/06/18 12:26:13 davem Exp $
  *  arch/sparc64/kernel/signal.c
  *
  *  Copyright (C) 1991, 1992  Linus Torvalds
@@ -918,12 +918,8 @@
 
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS:
-				if(current->binfmt && current->binfmt->core_dump) {
-					lock_kernel();
-					if(current->binfmt->core_dump(signr, regs))
-						exit_code |= 0x80;
-					unlock_kernel();
-				}
+				if (do_coredump(signr, regs))
+					exit_code |= 0x80;
 #ifdef DEBUG_SIGNALS
 				/* Very useful to debug the dynamic linker */
 				printk ("Sig %d going...\n", (int)signr);
diff -urN linux-2.2.20-pre3/arch/sparc64/kernel/signal32.c linux/arch/sparc64/kernel/signal32.c
--- linux-2.2.20-pre3/arch/sparc64/kernel/signal32.c	Mon Dec  3 22:18:55 2001
+++ linux/arch/sparc64/kernel/signal32.c	Mon Dec  3 22:19:02 2001
@@ -1,4 +1,4 @@
-/*  $Id: signal32.c,v 1.47.2.3 1999/12/20 01:14:06 davem Exp $
+/*  $Id: signal32.c,v 1.47.2.4 2001/06/18 12:26:13 davem Exp $
  *  arch/sparc64/kernel/signal32.c
  *
  *  Copyright (C) 1991, 1992  Linus Torvalds
@@ -1347,14 +1347,8 @@
 
 			case SIGQUIT: case SIGILL: case SIGTRAP:
 			case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS:
-				if(current->binfmt && current->binfmt->core_dump) {
-					lock_kernel();
-					if(current->binfmt &&
-					   current->binfmt->core_dump &&
-					   current->binfmt->core_dump(signr, regs))
-						exit_code |= 0x80;
-					unlock_kernel();
-				}
+				if (do_coredump(signr, regs))
+					exit_code |= 0x80;
 #ifdef DEBUG_SIGNALS
 				/* Very useful to debug dynamic linker problems */
 				printk ("Sig %ld going for %s[%d]...\n", signr, current->comm, current->pid);
diff -urN linux-2.2.20-pre3/arch/sparc64/solaris/entry64.S linux/arch/sparc64/solaris/entry64.S
--- linux-2.2.20-pre3/arch/sparc64/solaris/entry64.S	Sun Mar 25 08:31:53 2001
+++ linux/arch/sparc64/solaris/entry64.S	Mon Dec  3 22:19:02 2001
@@ -1,4 +1,4 @@
-/* $Id: entry64.S,v 1.5 1998/03/26 08:46:15 jj Exp $
+/* $Id: entry64.S,v 1.5.2.1 2001/06/18 12:26:13 davem Exp $
  * entry64.S:  Solaris syscall emulation entry point.
  *
  * Copyright (C) 1996,1997,1998 Jakub Jelinek   (jj@sunsite.mff.cuni.cz)
@@ -83,7 +83,7 @@
 1:	 srl		%i0, 0, %o0
 	lduw		[%l7 + %l4], %l3
 	srl		%i1, 0, %o1
-	ldx		[%g6 + AOFF_task_flags], %l5
+	ldx		[%g6 + AOFF_task_ptrace], %l5
 	cmp		%l3, NR_SYSCALLS
 	bleu,a,pn	%xcc, linux_syscall_for_solaris
 	 sethi		%hi(sys_call_table32), %l6
@@ -93,21 +93,21 @@
 10:	srl		%i2, 0, %o2
 	mov		%i5, %o5
 	andn		%l3, 3, %l7
-	andcc		%l5, 0x20, %g0				
+	andcc		%l5, 0x02, %g0				
 	bne,pn		%icc, solaris_syscall_trace		
 	 mov		%i0, %l5
 2:	call		%l7
 	 srl		%i3, 0, %o3
 ret_from_solaris:
 	stx		%o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0]
-	ldx		[%g6 + AOFF_task_flags], %l6
+	ldx		[%g6 + AOFF_task_ptrace], %l6
 	sra		%o0, 0, %o0
 	mov		%ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
 	ldx		[%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3
 	cmp		%o0, -ENOIOCTLCMD
 	sllx		%g2, 32, %g2
 	bgeu,pn		%xcc, 1f
-	 andcc		%l6, 0x20, %l6	
+	 andcc		%l6, 0x02, %l6
 
 	/* System call success, clear Carry condition code. */
 	andn		%g3, %g2, %g3
diff -urN linux-2.2.20-pre3/drivers/block/cciss.c linux/drivers/block/cciss.c
--- linux-2.2.20-pre3/drivers/block/cciss.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/block/cciss.c	Mon Dec  3 22:19:02 2001
@@ -42,8 +42,8 @@
 #include <linux/genhd.h>
 
 #define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
-#define DRIVER_NAME "Compaq CISS Driver (v 1.0.3)"
-#define DRIVER_VERSION CCISS_DRIVER_VERSION(1,0,3)
+#define DRIVER_NAME "Compaq CISS Driver (v 1.0.4)"
+#define DRIVER_VERSION CCISS_DRIVER_VERSION(1,0,4)
 
 /* Embedded module documentation macros - see modules.h */
 MODULE_AUTHOR("Charles M. White III - Compaq Computer Corporation");
@@ -734,7 +734,7 @@
         max_p = gdev->max_p;
         start = target << gdev->minor_shift;
 
-        for(i=max_p; i>=0; i--) {
+        for(i=max_p-1; i>=0; i--) {
                 int minor = start+i;
                 kdev_t devi = MKDEV(MAJOR_NR + ctlr, minor);
                 struct super_block *sb = get_super(devi);
@@ -1129,7 +1129,7 @@
 	if (timeout)
 		status = 0; 
 	if(cmd->err_info->CommandStatus != 0) 
-	{ /* an error has occured */ 
+	{ /* an error has occurred */ 
 		switch(cmd->err_info->CommandStatus)
 		{
 			case CMD_TARGET_STATUS:
diff -urN linux-2.2.20-pre3/drivers/block/cpqarray.c linux/drivers/block/cpqarray.c
--- linux-2.2.20-pre3/drivers/block/cpqarray.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/block/cpqarray.c	Mon Dec  3 22:19:02 2001
@@ -41,8 +41,8 @@
 
 #define SMART2_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
 
-#define DRIVER_NAME "Compaq SMART2 Driver (v 1.0.11)"
-#define DRIVER_VERSION SMART2_DRIVER_VERSION(1,0,11)
+#define DRIVER_NAME "Compaq SMART2 Driver (v 1.0.12)"
+#define DRIVER_VERSION SMART2_DRIVER_VERSION(1,0,12)
 
 /* Embedded module documentation macros - see modules.h */
 /* Original author Chris Frantz - Compaq Computer Corporation */
@@ -1558,7 +1558,7 @@
 	max_p = gdev->max_p;
 	start = target << gdev->minor_shift;
 
-	for(i=max_p; i>=0; i--) {
+	for(i=max_p-1; i>=0; i--) {
 		int minor = start+i;
 		kdev_t devi = MKDEV(MAJOR_NR + ctlr, minor);
 		struct super_block *sb = get_super(devi);
diff -urN linux-2.2.20-pre3/drivers/block/genhd.c linux/drivers/block/genhd.c
--- linux-2.2.20-pre3/drivers/block/genhd.c	Sun Mar 25 08:37:30 2001
+++ linux/drivers/block/genhd.c	Mon Dec  3 22:19:02 2001
@@ -336,7 +336,8 @@
 			goto done;	 /* nothing left to do */
 
 		hd->part[current_minor].nr_sects = NR_SECTS(p) * sector_size; /* JSt */
-		hd->part[current_minor].start_sect = first_sector + START_SECT(p) * sector_size;
+		hd->part[current_minor].start_sect =
+			first_sector + START_SECT(p) * sector_size;
 		this_sector = first_sector + START_SECT(p) * sector_size;
 		dev = MKDEV(hd->major, current_minor);
 		brelse(bh);
diff -urN linux-2.2.20-pre3/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c
--- linux-2.2.20-pre3/drivers/block/ide-cd.c	Sun Mar 25 08:31:23 2001
+++ linux/drivers/block/ide-cd.c	Mon Dec  3 22:19:02 2001
@@ -254,7 +254,7 @@
  *			  They will disappear later when I get the time to
  *			  do it cleanly.
  *			- Minimize the TOC reading - only do it when we
- *			  know a media change has occured.
+ *			  know a media change has occurred.
  *			- Moved all the CDROMREADx ioctls to the Uniform layer.
  *			- Heiko Eissfeldt <heiko@colossus.escape.de> supplied
  *			  some fixes for CDI.
diff -urN linux-2.2.20-pre3/drivers/block/ide-dma.c linux/drivers/block/ide-dma.c
--- linux-2.2.20-pre3/drivers/block/ide-dma.c	Sun Mar 25 08:31:24 2001
+++ linux/drivers/block/ide-dma.c	Mon Dec  3 22:19:02 2001
@@ -217,6 +217,20 @@
 				xcount = bcount & 0xffff;
 				if (is_trm290_chipset)
 					xcount = ((xcount >> 2) - 1) << 16;
+				if (xcount == 0x0000) {
+					/* 
+					 * Most chipsets correctly interpret a length of 0x0000 as 64KB,
+					 * but at least one (e.g. CS5530) misinterprets it as zero (!).
+					 * So here we break the 64KB entry into two 32KB entries instead.
+					 */
+					if (count++ >= PRD_ENTRIES) {
+						printk("%s: DMA table too small\n", drive->name);
+						return 0; /* revert to PIO for this request */
+					}
+					*table++ = cpu_to_le32(0x8000);
+					*table++ = cpu_to_le32(addr + 0x8000);
+					xcount = 0x8000;
+				}
 				*table++ = cpu_to_le32(xcount);
 				addr += bcount;
 				size -= bcount;
diff -urN linux-2.2.20-pre3/drivers/block/ide-pmac.c linux/drivers/block/ide-pmac.c
--- linux-2.2.20-pre3/drivers/block/ide-pmac.c	Sun Mar 25 08:37:30 2001
+++ linux/drivers/block/ide-pmac.c	Mon Dec  3 22:19:02 2001
@@ -97,7 +97,7 @@
 /* Wait 2s for disk to answer on IDE bus after
  * enable operation.
  * NOTE: There is at least one case I know of a disk that needs about 10sec
- *       before anwering on the bus. I beleive we could add a kernel command
+ *       before anwering on the bus. I believe we could add a kernel command
  *       line arg to override this delay for such cases.
  */
 #define IDE_WAKEUP_DELAY_MS	2000
@@ -192,9 +192,10 @@
 }
 #endif
 
-/* Setup timings for the selected drive (master/slave). I still need to verify if this
- * is enough, I beleive selectproc will be called whenever an IDE command is started,
- * but... */
+/* Setup timings for the selected drive (master/slave). I still need to
+ * verify if this is enough, I believe selectproc will be called whenever
+ * an IDE command is started, but...
+ */
 static void
 pmac_ide_selectproc(ide_drive_t *drive)
 {
diff -urN linux-2.2.20-pre3/drivers/block/ide.c linux/drivers/block/ide.c
--- linux-2.2.20-pre3/drivers/block/ide.c	Sun Mar 25 08:31:24 2001
+++ linux/drivers/block/ide.c	Mon Dec  3 22:19:02 2001
@@ -1298,9 +1298,10 @@
 	del_timer(&hwgroup->timer);
 	if ((handler = hwgroup->handler) == NULL) {
 		/*
-		 * Either a marginal timeout occured (got the interrupt just as timer expired),
-		 * or we were "sleeping" to give other devices a chance.  Either way, we don't
-		 * really want to complain about anything.
+		 * Either a marginal timeout occurred (got the interrupt
+		 * just as timer expired), or we were "sleeping" to give
+		 * other devices a chance.  Either way, we don't really
+		 * want to complain about anything.
 		 */
 		if (hwgroup->sleeping) {
 			hwgroup->sleeping = 0;
diff -urN linux-2.2.20-pre3/drivers/cdrom/cdrom.c linux/drivers/cdrom/cdrom.c
--- linux-2.2.20-pre3/drivers/cdrom/cdrom.c	Sun Mar 25 09:44:42 2001
+++ linux/drivers/cdrom/cdrom.c	Mon Dec  3 22:19:02 2001
@@ -514,12 +514,12 @@
 					couldn't close the tray.  We only care 
 					that there is no disc in the drive, 
 					since that is the _REAL_ problem here.*/
-					ret=-ENOMEDIUM;
+					ret = -ENOMEDIUM;
 					goto clean_up_and_return;
 				}
 			} else {
 				cdinfo(CD_OPEN, "bummer. this drive can't close the tray.\n"); 
-				ret=-ENOMEDIUM;
+				ret = -ENOMEDIUM;
 				goto clean_up_and_return;
 			}
 			/* Ok, the door should be closed now.. Check again */
@@ -527,7 +527,7 @@
 			if ((ret == CDS_NO_DISC) || (ret==CDS_TRAY_OPEN)) {
 				cdinfo(CD_OPEN, "bummer. the tray is still not closed.\n"); 
 				cdinfo(CD_OPEN, "tray might not contain a medium.\n");
-				ret=-ENOMEDIUM;
+				ret = -ENOMEDIUM;
 				goto clean_up_and_return;
 			}
 			cdinfo(CD_OPEN, "the tray is now closed.\n"); 
@@ -540,7 +540,7 @@
 	cdrom_count_tracks(cdi, &tracks);
 	if (tracks.error == CDS_NO_DISC) {
 		cdinfo(CD_OPEN, "bummer. no disc.\n");
-		ret=-ENOMEDIUM;
+		ret = -ENOMEDIUM;
 		goto clean_up_and_return;
 	}
 	/* CD-Players which don't use O_NONBLOCK, workman
@@ -1952,6 +1952,7 @@
 			ra.buf += (CD_FRAMESIZE_RAW * frames);
 			ra.nframes -= frames;
 			lba += frames;
+			if (frames>ra.nframes) frames=ra.nframes;
 		}
 		kfree(cgc.buffer);
 		return ret;
diff -urN linux-2.2.20-pre3/drivers/char/Config.in linux/drivers/char/Config.in
--- linux-2.2.20-pre3/drivers/char/Config.in	Mon Dec  3 22:18:55 2001
+++ linux/drivers/char/Config.in	Mon Dec  3 22:19:02 2001
@@ -53,8 +53,8 @@
      tristate '  Stallion EasyIO or EC8/32 support' CONFIG_STALLION
      tristate '  Stallion EC8/64, ONboard, Brumby support' CONFIG_ISTALLION
    fi
-   dep_tristate 'Microgate SyncLink card support' CONFIG_SYNCLINK m
-   dep_tristate 'HDLC line discipline support' CONFIG_N_HDLC m
+   tristate 'Microgate SyncLink card support' CONFIG_SYNCLINK
+   tristate 'HDLC line discipline support' CONFIG_N_HDLC
 fi
 bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
 if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
diff -urN linux-2.2.20-pre3/drivers/char/Makefile linux/drivers/char/Makefile
--- linux-2.2.20-pre3/drivers/char/Makefile	Mon Dec  3 22:18:55 2001
+++ linux/drivers/char/Makefile	Mon Dec  3 22:19:02 2001
@@ -184,12 +184,20 @@
   endif
 endif
 
-ifeq ($(CONFIG_SYNCLINK),m)
+ifeq ($(CONFIG_SYNCLINK),y)
+O_OBJS += synclink.o
+else
+  ifeq ($(CONFIG_SYNCLINK),m)
   M_OBJS += synclink.o
+  endif
 endif
 
-ifeq ($(CONFIG_N_HDLC),m)
+ifeq ($(CONFIG_N_HDLC),y)
+O_OBJS += n_hdlc.o
+else
+  ifeq ($(CONFIG_N_HDLC),m)
   M_OBJS += n_hdlc.o
+  endif
 endif
 
 ifeq ($(CONFIG_SPECIALIX),y)
diff -urN linux-2.2.20-pre3/drivers/char/atari_SCC.README linux/drivers/char/atari_SCC.README
--- linux-2.2.20-pre3/drivers/char/atari_SCC.README	Sun Mar 25 08:31:28 2001
+++ linux/drivers/char/atari_SCC.README	Mon Dec  3 22:19:02 2001
@@ -96,7 +96,7 @@
 
  If you should see a message like:
 
-Sep 26 10:39:32 zaphod kernel: SCC-A: DMA-INT occured, data lost!
+Sep 26 10:39:32 zaphod kernel: SCC-A: DMA-INT occurred, data lost!
 
  that means that the timer routine itself has been delayed so long that the DMA
 counter went to zero already. There's not very much to do about this, because
diff -urN linux-2.2.20-pre3/drivers/char/atari_SCC.c linux/drivers/char/atari_SCC.c
--- linux-2.2.20-pre3/drivers/char/atari_SCC.c	Sun Mar 25 08:31:28 2001
+++ linux/drivers/char/atari_SCC.c	Mon Dec  3 22:19:02 2001
@@ -1453,11 +1453,11 @@
 }
 
 
-/* DMA finished before timer occured?
+/* DMA finished before timer occurred?
  */
 static void SCC_dma_int (int irq, void *data, struct pt_regs *fp)
 {
-	printk ("SCC-A: DMA-INT occured, data lost!\n");
+	printk ("SCC-A: DMA-INT occurred, data lost!\n");
 #if 0
 	/* is there any reason why we should call this? if the timer INT was
 	 * delayed so long that this happened then this INT was delayed too, so
diff -urN linux-2.2.20-pre3/drivers/char/cyclades.c linux/drivers/char/cyclades.c
--- linux-2.2.20-pre3/drivers/char/cyclades.c	Sun Mar 25 08:31:25 2001
+++ linux/drivers/char/cyclades.c	Mon Dec  3 22:19:02 2001
@@ -149,7 +149,7 @@
  * Revision 2.2.1.4  1998/08/04 11:02:50 ivan
  * /proc/cyclades implementation with great collaboration of 
  * Marc Lewis <marc@blarg.net>;
- * cyy_interrupt was changed to avoid occurence of kernel oopses
+ * cyy_interrupt was changed to avoid occurrence of kernel oopses
  * during PPP operation.
  *
  * Revision 2.2.1.3  1998/06/01 12:09:10 ivan
diff -urN linux-2.2.20-pre3/drivers/char/epca.c linux/drivers/char/epca.c
--- linux-2.2.20-pre3/drivers/char/epca.c	Sun Mar 25 08:31:26 2001
+++ linux/drivers/char/epca.c	Mon Dec  3 22:19:02 2001
@@ -953,7 +953,7 @@
 					Remember copy_from_user WILL generate a page fault if the
 					user memory being accessed has been swapped out.  This can
 					cause this routine to temporarily sleep while this page
-					fault is occuring.
+					fault is occurring.
 				
 				----------------------------------------------------------------- */
 
@@ -3601,7 +3601,7 @@
 /* ------------------------------------------------------------------
 	The below routines pc_throttle and pc_unthrottle are used 
 	to slow (And resume) the receipt of data into the kernels
-	receive buffers.  The exact occurence of this depends on the
+	receive buffers.  The exact occurrence of this depends on the
 	size of the kernels receive buffer and what the 'watermarks'
 	are set to for that buffer.  See the n_ttys.c file for more
 	details. 
diff -urN linux-2.2.20-pre3/drivers/char/hfmodem/refclock.c linux/drivers/char/hfmodem/refclock.c
--- linux-2.2.20-pre3/drivers/char/hfmodem/refclock.c	Sun Mar 25 08:31:26 2001
+++ linux/drivers/char/hfmodem/refclock.c	Mon Dec  3 22:19:02 2001
@@ -133,7 +133,7 @@
 			"subl %2,%%eax\n\t"
 			"sbbl %3,%%edx\n\t" : "=&a" (tmp0), "=&d" (tmp1) 
 			: "m" (dev->clk.starttime_lo), "m" (dev->clk.starttime_hi));
-		__asm__("mull %2" : "=d" (tmp2), "=a" (tmp4) : "m" (scale_rdtsc), "1" (tmp0) : "ax");
+		__asm__("mull %2" : "=d" (tmp2), "=a" (tmp4) : "m" (scale_rdtsc), "1" (tmp0));
 		__asm__("mull %1" : "=a" (tmp3) : "m" (scale_rdtsc), "a" (tmp1) : "dx");
 		curtime = tmp2 + tmp3;
 		goto time_known;
diff -urN linux-2.2.20-pre3/drivers/char/lp.c linux/drivers/char/lp.c
--- linux-2.2.20-pre3/drivers/char/lp.c	Sun Mar 25 08:37:31 2001
+++ linux/drivers/char/lp.c	Mon Dec  3 22:19:02 2001
@@ -306,7 +306,7 @@
 		}
 		/*
 		 * NOTE: if you run with irqs you _must_ use
-		 * `tunelp /dev/lp? -c 1' to be rasonable efficient!
+		 * `tunelp /dev/lp? -c 1' to be reasonably efficient!
 		 *
 		 * ..but beware that data corruption can happen that way. -Tim
 		 */
diff -urN linux-2.2.20-pre3/drivers/char/n_hdlc.c linux/drivers/char/n_hdlc.c
--- linux-2.2.20-pre3/drivers/char/n_hdlc.c	Sun Mar 25 08:37:31 2001
+++ linux/drivers/char/n_hdlc.c	Mon Dec  3 22:19:02 2001
@@ -9,7 +9,7 @@
  *	Al Longyear <longyear@netcom.com>, Paul Mackerras <Paul.Mackerras@cs.anu.edu.au>
  *
  * Original release 01/11/99
- * $Id: n_hdlc.c,v 2.2 2000/11/08 17:08:29 paul Exp $
+ * $Id: n_hdlc.c,v 2.3 2001/05/09 14:42:37 paul Exp $
  *
  * This code is released under the GNU General Public License (GPL)
  *
@@ -78,7 +78,7 @@
  */
 
 #define HDLC_MAGIC 0x239e
-#define HDLC_VERSION "2.2"
+#define HDLC_VERSION "$Revision: 2.3 $"
 
 #include <linux/version.h>
 #include <linux/config.h>
@@ -98,6 +98,7 @@
 #include <linux/malloc.h>
 #include <linux/tty.h>
 #include <linux/errno.h>
+#include <linux/init.h>
 #include <linux/string.h>	/* used in new tty drivers */
 #include <linux/signal.h>	/* used in new tty drivers */
 #include <asm/system.h>
@@ -986,14 +987,7 @@
 	
 }	/* end of n_hdlc_buf_get() */
 
-/* init_module()
- *
- *	called when module is loading to register line discipline
- * 	
- * Arguments:		None
- * Return Value:	0 if success, otherwise error code
- */
-int init_module(void)
+int __init n_hdlc_init()
 {
 	static struct tty_ldisc	n_hdlc_ldisc;
 	int    status;
@@ -1031,16 +1025,14 @@
 	if (status)
 		printk(KERN_INFO"N_HDLC: init failure %d\n", status);
 	return (status);
-	
-}	/* end of init_module() */
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+	return n_hdlc_init();
+}
 
-/* cleanup_module()
- *
- *	called when module is unloading to unregister line discipline
- * 	
- * Arguments:		None
- * Return Value:	None
- */
 void cleanup_module(void)
 {
 	int status;
@@ -1050,3 +1042,4 @@
 	else
 		printk("N_HDLC: line discipline unregistered\n");
 }
+#endif
diff -urN linux-2.2.20-pre3/drivers/char/sbc60xxwdt.c linux/drivers/char/sbc60xxwdt.c
--- linux-2.2.20-pre3/drivers/char/sbc60xxwdt.c	Sun Mar 25 08:31:28 2001
+++ linux/drivers/char/sbc60xxwdt.c	Mon Dec  3 22:19:02 2001
@@ -49,7 +49,7 @@
  *
  *  Why `V' ?  Well, `V' is the character in ASCII for the value 86,
  *  and we all know that 86 is _the_ most random number in the universe.
- *  Therefore it is the letter that has the slightest chance of occuring
+ *  Therefore it is the letter that has the slightest chance of occurring
  *  by chance, when the system becomes corrupted.
  *
  */
diff -urN linux-2.2.20-pre3/drivers/char/synclink.c linux/drivers/char/synclink.c
--- linux-2.2.20-pre3/drivers/char/synclink.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/char/synclink.c	Mon Dec  3 22:19:02 2001
@@ -1,7 +1,7 @@
 /*
  * linux/drivers/char/synclink.c
  *
- * $Id: synclink.c,v 2.8 2001/03/30 17:30:37 ez Exp $
+ * $Id: synclink.c,v 2.12 2001/05/10 20:53:04 paulkf Exp $
  *
  * Device driver for Microgate SyncLink ISA and PCI
  * high speed multiprotocol serial adapters.
@@ -54,7 +54,11 @@
  */
 
 #define VERSION(ver,rel,seq) (((ver)<<16) | ((rel)<<8) | (seq))
-#define BREAKPOINT() asm("   int $3");
+#if defined(__i386__)
+#  define BREAKPOINT() asm("   int $3");
+#else
+#  define BREAKPOINT() { }
+#endif
 
 #define MAX_ISA_DEVICES 10
 #define MAX_PCI_DEVICES 10
@@ -924,7 +928,7 @@
 MODULE_PARM(txholdbufs,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i");
 
 static char *driver_name = "SyncLink serial driver";
-static char *driver_version = "2.8";
+static char *driver_version = "$Revision: 2.12 $";
 
 static struct tty_driver serial_driver, callout_driver;
 static int serial_refcount;
@@ -4486,18 +4490,20 @@
 		info->max_frame_size = 65535;
 	
 	if ( info->bus_type == MGSL_BUS_TYPE_PCI ) {
-		printk( "SyncLink device %s added:PCI bus IO=%04X IRQ=%d Mem=%08X LCR=%08X MaxFrameSize=%u\n",
+		printk( "SyncLink device %s:PCI IO=%04X IRQ=%d Mem=%08X LCR=%08X MaxFrameSize=%u\n",
 			info->device_name, info->io_base, info->irq_level,
 			info->phys_memory_base, info->phys_lcr_base,
 		     	info->max_frame_size );
 	} else {
-		printk( "SyncLink device %s added:ISA bus IO=%04X IRQ=%d DMA=%d MaxFrameSize=%u\n",
+		printk( "SyncLink device %s:ISA IO=%04X IRQ=%d DMA=%d MaxFrameSize=%u\n",
 			info->device_name, info->io_base, info->irq_level, info->dma_level,
 		     	info->max_frame_size );
 	}
 
 #ifdef CONFIG_SYNCLINK_SYNCPPP
+#ifdef MODULE
 	if (info->dosyncppp)
+#endif
 		mgsl_sppp_init(info);
 #endif
 }	/* end of mgsl_add_device() */
@@ -4661,7 +4667,7 @@
 
 	EXPORT_NO_SYMBOLS;
 	
- 	printk("%s version %s\n", driver_name, driver_version);
+ 	printk("%s %s\n", driver_name, driver_version);
 	
 	/* determine how many SyncLink devices are installed */
 	mgsl_enumerate_devices();
@@ -4729,7 +4735,7 @@
 		printk("%s(%d):Couldn't register callout driver\n",
 			__FILE__,__LINE__);
 
- 	printk("%s version %s, tty major#%d callout major#%d\n",
+ 	printk("%s %s, tty major#%d callout major#%d\n",
 		driver_name, driver_version,
 		serial_driver.major, callout_driver.major);
 		
@@ -4746,6 +4752,7 @@
 	
 }	/* end of mgsl_init() */
 
+#ifdef MODULE
 int __init init_module(void)
 {
 /* Uncomment this to kernel debug module.
@@ -4796,6 +4803,7 @@
 	}
 	
 }	/* end of cleanup_module() */
+#endif
 
 /*
  * usc_RTCmd()
@@ -7663,7 +7671,7 @@
 		status = info->rx_buffer_list[0].status;
 
 		if ( status & (BIT8 + BIT3 + BIT1) ) {
-			/* receive error has occured */
+			/* receive error has occurred */
 			rc = FALSE;
 		} else {
 			if ( memcmp( info->tx_buffer_list[0].virt_addr ,
diff -urN linux-2.2.20-pre3/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- linux-2.2.20-pre3/drivers/char/tty_io.c	Sun Mar 25 08:31:24 2001
+++ linux/drivers/char/tty_io.c	Mon Dec  3 22:19:02 2001
@@ -2244,5 +2244,11 @@
 #ifdef CONFIG_VT
 	vcs_init();
 #endif
+#ifdef CONFIG_SYNCLINK
+	mgsl_init();
+#endif
+#ifdef CONFIG_N_HDLC
+	n_hdlc_init();
+#endif
 	return 0;
 }
diff -urN linux-2.2.20-pre3/drivers/char/wdt_pci.c linux/drivers/char/wdt_pci.c
--- linux-2.2.20-pre3/drivers/char/wdt_pci.c	Sun Mar 25 08:31:29 2001
+++ linux/drivers/char/wdt_pci.c	Mon Dec  3 22:19:02 2001
@@ -149,7 +149,7 @@
  *
  *	Handle an interrupt from the board. These are raised when the status
  *	map changes in what the board considers an interesting way. That means
- *	a failure condition occuring.
+ *	a failure condition occurring.
  */
  
 static void wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
diff -urN linux-2.2.20-pre3/drivers/i2o/i2o_scsi.c linux/drivers/i2o/i2o_scsi.c
--- linux-2.2.20-pre3/drivers/i2o/i2o_scsi.c	Sun Mar 25 08:31:44 2001
+++ linux/drivers/i2o/i2o_scsi.c	Mon Dec  3 22:19:02 2001
@@ -266,7 +266,7 @@
 	
 	if(st)
 	{
-		/* An error has occured */
+		/* An error has occurred */
 
 		dprintk((KERN_DEBUG "SCSI error %08X", m[4]));
 			
diff -urN linux-2.2.20-pre3/drivers/isdn/hisax/l3dss1.c linux/drivers/isdn/hisax/l3dss1.c
--- linux-2.2.20-pre3/drivers/isdn/hisax/l3dss1.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/isdn/hisax/l3dss1.c	Mon Dec  3 22:19:02 2001
@@ -1599,7 +1599,7 @@
 	 * Bearer Capabilities
 	 */
 	p = skb->data;
-	/* only the first occurence 'll be detected ! */
+	/* only the first occurrence 'll be detected ! */
 	if ((p = findie(p, skb->len, 0x04, 0))) {
 		if ((p[1] < 2) || (p[1] > 11))
 			err = 1;
diff -urN linux-2.2.20-pre3/drivers/isdn/hisax/l3ni1.c linux/drivers/isdn/hisax/l3ni1.c
--- linux-2.2.20-pre3/drivers/isdn/hisax/l3ni1.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/isdn/hisax/l3ni1.c	Mon Dec  3 22:19:02 2001
@@ -1458,7 +1458,7 @@
 	 * Bearer Capabilities
 	 */
 	p = skb->data;
-	/* only the first occurence 'll be detected ! */
+	/* only the first occurrence 'll be detected ! */
 	if ((p = findie(p, skb->len, 0x04, 0))) {
 		if ((p[1] < 2) || (p[1] > 11))
 			err = 1;
diff -urN linux-2.2.20-pre3/drivers/macintosh/via-pmu.c linux/drivers/macintosh/via-pmu.c
--- linux-2.2.20-pre3/drivers/macintosh/via-pmu.c	Sun Mar 25 08:31:41 2001
+++ linux/drivers/macintosh/via-pmu.c	Mon Dec  3 22:19:02 2001
@@ -1356,7 +1356,7 @@
 
 	/* Make sure the decrementer won't interrupt us */
 	asm volatile("mtdec %0" : : "r" (0x7fffffff));
-	/* Make sure any pending DEC interrupt occuring while we did
+	/* Make sure any pending DEC interrupt occurring while we did
 	 * the above didn't re-enable the DEC */
 	mb();
 	asm volatile("mtdec %0" : : "r" (0x7fffffff));
@@ -1509,7 +1509,7 @@
 
 	/* Make sure the decrementer won't interrupt us */
 	asm volatile("mtdec %0" : : "r" (0x7fffffff));
-	/* Make sure any pending DEC interrupt occuring while we did
+	/* Make sure any pending DEC interrupt occurring while we did
 	 * the above didn't re-enable the DEC */
 	mb();
 	asm volatile("mtdec %0" : : "r" (0x7fffffff));
diff -urN linux-2.2.20-pre3/drivers/net/8139too.c linux/drivers/net/8139too.c
--- linux-2.2.20-pre3/drivers/net/8139too.c	Sun Mar 25 08:37:34 2001
+++ linux/drivers/net/8139too.c	Mon Dec  3 22:19:02 2001
@@ -1603,7 +1603,11 @@
 	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
 	unsigned long timeout;
 
+	lock_kernel();
 	daemonize ();
+	exit_files(current);
+	unlock_kernel();
+	
 	spin_lock_irq(&current->sigmask_lock);
 	sigemptyset(&current->blocked);
 	recalc_sigpending(current);
diff -urN linux-2.2.20-pre3/drivers/net/82596.c linux/drivers/net/82596.c
--- linux-2.2.20-pre3/drivers/net/82596.c	Sun Mar 25 08:31:20 2001
+++ linux/drivers/net/82596.c	Mon Dec  3 22:19:02 2001
@@ -1106,7 +1106,7 @@
 {
 	int i;
 	struct i596_private *lp;
-	char eth_addr[6];
+	char eth_addr[8];
 	static int probed = 0;
 
 	if (probed)
diff -urN linux-2.2.20-pre3/drivers/net/Config.in linux/drivers/net/Config.in
--- linux-2.2.20-pre3/drivers/net/Config.in	Sun Mar 25 08:37:34 2001
+++ linux/drivers/net/Config.in	Mon Dec  3 22:19:02 2001
@@ -301,7 +301,7 @@
 #
 # Microgate Synclink HDLC/SYNCPPP support
 #
-dep_tristate 'SyncLink HDLC/SYNCPPP support' CONFIG_SYNCLINK_SYNCPPP m
+tristate 'SyncLink HDLC/SYNCPPP support' CONFIG_SYNCLINK_SYNCPPP
 
 #
 # Lan Media's board. Currently 1000, 1200, 5200, 5245
@@ -342,6 +342,11 @@
       fi
     fi
   fi
+fi
+
+if [ "$CONFIG_HDLC" = "y" -o "$CONFIG_SYNCLINK_SYNCPPP" = "y" -o \
+     "$CONFIG_LANMEDIA" = "y" ] ; then
+	define_bool CONFIG_SYNCPPP y
 fi
 
 tristate 'Frame relay DLCI support' CONFIG_DLCI
diff -urN linux-2.2.20-pre3/drivers/net/daynaport.c linux/drivers/net/daynaport.c
--- linux-2.2.20-pre3/drivers/net/daynaport.c	Sun Mar 25 08:31:20 2001
+++ linux/drivers/net/daynaport.c	Mon Dec  3 22:19:02 2001
@@ -447,7 +447,7 @@
 	}
 
 	/* We should hopefully not get here */
-	printk(KERN_ERR "Probe unsucessful.\n");
+	printk(KERN_ERR "Probe unsuccessful.\n");
 	return -ENODEV;
 
  membad:
diff -urN linux-2.2.20-pre3/drivers/net/macmace.c linux/drivers/net/macmace.c
--- linux-2.2.20-pre3/drivers/net/macmace.c	Sun Mar 25 08:31:23 2001
+++ linux/drivers/net/macmace.c	Mon Dec  3 22:19:02 2001
@@ -607,7 +607,7 @@
 }
 
 /*
- *	A transmit error has occured. (We kick the transmit side from
+ *	A transmit error has occurred. (We kick the transmit side from
  *	the DMA completion)
  */
  
@@ -636,7 +636,7 @@
 }
 
 /*
- *	A receive interrupt occured.
+ *	A receive interrupt occurred.
  */
  
 static void mace68k_recv_interrupt(struct device *dev)
diff -urN linux-2.2.20-pre3/drivers/net/net_init.c linux/drivers/net/net_init.c
--- linux-2.2.20-pre3/drivers/net/net_init.c	Sun Mar 25 08:31:16 2001
+++ linux/drivers/net/net_init.c	Mon Dec  3 22:19:02 2001
@@ -292,8 +292,8 @@
 void ether_setup(struct device *dev)
 {
 	int i;
-	/* Fill in the fields of the device structure with ethernet-generic values.
-	   This should be in a common file instead of per-driver.  */
+	/* Fill in the fields of the device structure with
+	   ethernet-generic values. */
 	
 	/* register boot-defined "eth" devices */
 	if (dev->name && (strncmp(dev->name, "eth", 3) == 0)) {
diff -urN linux-2.2.20-pre3/drivers/net/ni52.c linux/drivers/net/ni52.c
--- linux-2.2.20-pre3/drivers/net/ni52.c	Sun Mar 25 08:31:16 2001
+++ linux/drivers/net/ni52.c	Mon Dec  3 22:19:02 2001
@@ -33,20 +33,20 @@
  * I have also done a look in the following sources: (mail me if you need them)
  *   crynwr-packet-driver by Russ Nelson
  *   Garret A. Wollman's (fourth) i82586-driver for BSD
- *   (before getting an i82596 (yes 596 not 586) manual, the existing drivers helped
- *    me a lot to understand this tricky chip.)
+ *   (before getting an i82596 (yes 596 not 586) manual, the existing drivers
+ *    helped me a lot to understand this tricky chip.)
  *
  * Known Problems:
  *   The internal sysbus seems to be slow. So we often lose packets because of
  *   overruns while receiving from a fast remote host.
- *   This can slow down TCP connections. Maybe the newer ni5210 cards are better.
- *   my experience is, that if a machine sends with more then about 500-600K/s
- *   the fifo/sysbus overflows.
+ *   This can slow down TCP connections. Maybe the newer ni5210 cards are
+ *   better.  My experience is, that if a machine sends with more than
+ *   about 500-600K/s the fifo/sysbus overflows.
  *
  * IMPORTANT NOTE:
  *   On fast networks, it's a (very) good idea to have 16K shared memory. With
- *   8K, we can store only 4 receive frames, so it can (easily) happen that a remote
- *   machine 'overruns' our system.
+ *   8K, we can store only 4 receive frames, so it can (easily) happen that a
+ *   remote machine 'overruns' our system.
  *
  * Known i82586/card problems (I'm sure, there are many more!):
  *   Running the NOP-mode, the i82586 sometimes seems to forget to report
@@ -60,7 +60,8 @@
  *
  * results from ftp performance tests with Linux 1.2.5
  *   send and receive about 350-400 KByte/s (peak up to 460 kbytes/s)
- *   sending in NOP-mode: peak performance up to 530K/s (but better don't run this mode)
+ *   sending in NOP-mode: peak performance up to 530K/s (but better
+ *   don't run this mode)
  */
 
 /*
diff -urN linux-2.2.20-pre3/drivers/net/sbni.c linux/drivers/net/sbni.c
--- linux-2.2.20-pre3/drivers/net/sbni.c	Sun Mar 25 08:31:21 2001
+++ linux/drivers/net/sbni.c	Mon Dec  3 22:19:02 2001
@@ -758,7 +758,7 @@
 					 */
 					DP( printk("%s: sbni_recv SendComplete\n",dev->name); );
 					/*
-					 *	We sucessfully sent current packet
+					 *	We successfully sent current packet
 					 */
 	      
 					if(lp->waitack)
diff -urN linux-2.2.20-pre3/drivers/net/sdla_fr.c linux/drivers/net/sdla_fr.c
--- linux-2.2.20-pre3/drivers/net/sdla_fr.c	Sun Mar 25 08:31:19 2001
+++ linux/drivers/net/sdla_fr.c	Mon Dec  3 22:19:02 2001
@@ -77,7 +77,7 @@
 *                                  the if clause for it(0,dev->tbusy) 
 *				   forever.
 *				   The code got into this stage due to an 
-*				   interrupt occuring within the if clause for 
+*				   interrupt occurring within the if clause for 
 *				   set_bit(0,dev->tbusy).  Since an interrupt 
 *				   disables furhter transmit interrupt and 
 * 				   makes dev->tbusy = 0, this effect was undone 
@@ -1329,7 +1329,7 @@
 
 
 /*============================================================================
- * Setup so that a frame can be transmitted on the occurence of a transmit
+ * Setup so that a frame can be transmitted on the occurrence of a transmit
  * interrupt.
  */
 static void setup_for_delayed_transmit (struct device* dev, void* buf,
@@ -1647,7 +1647,7 @@
 			++card->statistics.isr_intr_test;
 	    		break;	
 
-                case FR_INTR_DLC: /* Event interrupt occured */
+                case FR_INTR_DLC: /* Event interrupt occurred */
 			mbox->cmd.command = FR_READ_STATUS;
 			mbox->cmd.length = 0;
 			err = sdla_exec(mbox) ? mbox->cmd.result : CMD_TIMEOUT;
@@ -1684,7 +1684,7 @@
 /*============================================================================
  * Receive interrupt handler.
  * When a receive interrupt occurs do the following:
- *	1- Find the structure for the dlci that the interrupt occured on
+ *	1- Find the structure for the dlci that the interrupt occurred on
  *      2- If it doesn't exist then print appropriate msg and goto step 8. 
  * 	3- If it exist then copy data to a skb.
  * 	4- If skb contains Sangoma UDP data then process them
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/h/lm80.h linux/drivers/net/sk98lin/h/lm80.h
--- linux-2.2.20-pre3/drivers/net/sk98lin/h/lm80.h	Sun Mar 25 08:31:22 2001
+++ linux/drivers/net/sk98lin/h/lm80.h	Mon Dec  3 22:19:02 2001
@@ -126,7 +126,7 @@
 #define LM80_IS_BTI		(1<<1)	/* state of BTI# pin */
 #define LM80_IS_FAN1		(1<<2)	/* count limit exceeded for Fan 1 */
 #define LM80_IS_FAN2		(1<<3)	/* count limit exceeded for Fan 2 */
-#define LM80_IS_CI		(1<<4)	/* Chassis Intrusion occured */
+#define LM80_IS_CI		(1<<4)	/* Chassis Intrusion occurred */
 #define LM80_IS_OS		(1<<5)	/* OS temperature limit exceeded */
 	/* bit 6 and 7 are reserved in LM80_ISRC_2 */
 #define LM80_IS_HT_IRQ_MD	(1<<6)	/* Hot temperature interrupt mode */
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/h/skgehw.h linux/drivers/net/sk98lin/h/skgehw.h
--- linux-2.2.20-pre3/drivers/net/sk98lin/h/skgehw.h	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/h/skgehw.h	Mon Dec  3 22:19:02 2001
@@ -986,7 +986,7 @@
 
 /*	B3_RI_TEST	 8 bit	RAM Iface Test Register */
 								/* Bit 15..4:	reserved */
-#define RI_T_EV			(1<<3)	/* Bit	3:	Timeout Event occured */
+#define RI_T_EV			(1<<3)	/* Bit	3:	Timeout Event occurred */
 #define RI_T_ON			(1<<2)	/* Bit	2:	Timeout Timer Test On */
 #define RI_T_OFF		(1<<1)	/* Bit	1:	Timeout Timer Test Off */
 #define RI_T_STEP		(1<<0)	/* Bit	0:	Timeout Timer Step */
@@ -1036,19 +1036,19 @@
 /*	B3_MA_RC_TEST	16 bit	MAC Arbiter Recovery Test Reg */
 /*	B3_PA_TEST	16 bit	Packet Arbiter Test Register */
 /*			Bit 15, 11, 7, and 3 are reserved in B3_PA_TEST */
-#define TX2_T_EV	(1<<15)	/* Bit 15: 	TX2 Timeout/Recv Event occured*/
+#define TX2_T_EV	(1<<15)	/* Bit 15: 	TX2 Timeout/Recv Event occurred*/
 #define TX2_T_ON	(1<<14)	/* Bit 14:	TX2 Timeout/Recv Timer Test On*/
 #define TX2_T_OFF	(1<<13)	/* Bit 13:	TX2 Timeout/Recv Timer Tst Off*/
 #define TX2_T_STEP	(1<<12)	/* Bit 12:	TX2 Timeout/Recv Timer Step */
-#define TX1_T_EV	(1<<11)	/* Bit 11:	TX1 Timeout/Recv Event occured*/
+#define TX1_T_EV	(1<<11)	/* Bit 11:	TX1 Timeout/Recv Event occurred*/
 #define TX1_T_ON	(1<<10)	/* Bit 10:	TX1 Timeout/Recv Timer Test On*/
 #define TX1_T_OFF	(1<<9)	/* Bit	9:	TX1 Timeout/Recv Timer Tst Off*/
 #define TX1_T_STEP	(1<<8)	/* Bit	8:	TX1 Timeout/Recv Timer Step */
-#define RX2_T_EV	(1<<7)	/* Bit	7:	RX2 Timeout/Recv Event occured*/
+#define RX2_T_EV	(1<<7)	/* Bit	7:	RX2 Timeout/Recv Event occurred*/
 #define RX2_T_ON	(1<<6)	/* Bit	6:	RX2 Timeout/Recv Timer Test On*/
 #define RX2_T_OFF	(1<<5)	/* Bit	5:	RX2 Timeout/Recv Timer Tst Off*/
 #define RX2_T_STEP	(1<<4)	/* Bit	4:	RX2 Timeout/Recv Timer Step */
-#define RX1_T_EV	(1<<3)	/* Bit	3:	RX1 Timeout/Recv Event occured*/
+#define RX1_T_EV	(1<<3)	/* Bit	3:	RX1 Timeout/Recv Event occurred*/
 #define RX1_T_ON	(1<<2)	/* Bit	2:	RX1 Timeout/Recv Timer Test On*/
 #define RX1_T_OFF	(1<<1)	/* Bit	1:	RX1 Timeout/Recv Timer Tst Off*/
 #define RX1_T_STEP	(1<<0)	/* Bit	0:	RX1 Timeout/Recv Timer Step */
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/h/skgehwt.h linux/drivers/net/sk98lin/h/skgehwt.h
--- linux-2.2.20-pre3/drivers/net/sk98lin/h/skgehwt.h	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/h/skgehwt.h	Sun Mar 25 08:31:22 2001
@@ -1,32 +1,23 @@
 /******************************************************************************
  *
  * Name:	skhwt.h
- * Project:	Genesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.4 $
- * Date:	$Date: 1998/08/19 09:50:58 $
+ * Project:	GEnesis, PCI Gigabit Ethernet Adapter
+ * Version:	$Revision: 1.5 $
+ * Date:	$Date: 1999/11/22 13:54:24 $
  * Purpose:	Defines for the hardware timer functions
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1989-1998 SysKonnect,
+ *	(C)Copyright 1998,1999 SysKonnect,
  *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
- *	All Rights Reserved
  *
- *	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
- *	The copyright notice above does not evidence any
- *	actual or intended publication of such source code.
- *
- *	This Module contains Proprietary Information of SysKonnect
- *	and should be treated as Confidential.
- *
- *	The information in this file is provided for the exclusive use of
- *	the licensees of SysKonnect.
- *	Such users have the right to use, modify, and incorporate this code
- *	into products for purposes authorized by the license agreement
- *	provided they include this notice and the associated copyright notice
- *	with any such product.
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU General Public License as published by
+ *	the Free Software Foundation; either version 2 of the License, or
+ *	(at your option) any later version.
+ *
  *	The information in this file is provided "AS IS" without warranty.
  *
  ******************************************************************************/
@@ -36,6 +27,9 @@
  * History:
  *
  *	$Log: skgehwt.h,v $
+ *	Revision 1.5  1999/11/22 13:54:24  cgoos
+ *	Changed license header to GPL.
+ *	
  *	Revision 1.4  1998/08/19 09:50:58  gklug
  *	fix: remove struct keyword from c-code (see CCC) add typedefs
  *	
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/h/ski2c.h linux/drivers/net/sk98lin/h/ski2c.h
--- linux-2.2.20-pre3/drivers/net/sk98lin/h/ski2c.h	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/h/ski2c.h	Mon Dec  3 22:19:02 2001
@@ -2,8 +2,8 @@
  *
  * Name:	ski2c.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.29 $
- * Date:	$Date: 2000/08/03 14:28:17 $
+ * Version:	$Revision: 1.30 $
+ * Date:	$Date: 2001/04/05 11:38:09 $
  * Purpose:	Defines to access Voltage and Temperature Sensor
  *		(taken from Monalisa (taken from Concentrator))
  *
@@ -28,6 +28,10 @@
  * History:
  *
  *	$Log: ski2c.h,v $
+ *	Revision 1.30  2001/04/05 11:38:09  rassmann
+ *	Set SenState to idle in SkI2cWaitIrq().
+ *	Changed error message in SkI2cWaitIrq().
+ *	
  *	Revision 1.29  2000/08/03 14:28:17  rassmann
  *	- Added function to wait for I2C being ready before resetting the board.
  *	- Replaced one duplicate "out of range" message with correct one.
@@ -182,24 +186,26 @@
 #define	SKERR_I2C_E014MSG	"WARNING: fan sensor out of range"
 #define	SKERR_I2C_E015		(SKERR_I2C_E014+1)
 #define	SKERR_I2C_E015MSG	"ERROR: fan sensor out of range"
+#define	SKERR_I2C_E016		(SKERR_I2C_E015+1)
+#define	SKERR_I2C_E016MSG	"I2C: active transfer does not complete.\n"
 
 /*
  * Define Timeout values
  */
-#define	SK_I2C_TIM_LONG		2000000L	/* 2 second */
-#define	SK_I2C_TIM_SHORT	100000L		/* 100 milli second */
+#define	SK_I2C_TIM_LONG		2000000L	/* 2 seconds */
+#define	SK_I2C_TIM_SHORT	 100000L	/* 100 milliseconds */
 
 /*
  * Define trap and error log hold times
  */
 #ifndef	SK_SEN_ERR_TR_HOLD
-#define	SK_SEN_ERR_TR_HOLD	(4*SK_TICKS_PER_SEC)
+#define	SK_SEN_ERR_TR_HOLD		(4*SK_TICKS_PER_SEC)
 #endif
 #ifndef	SK_SEN_ERR_LOG_HOLD
-#define	SK_SEN_ERR_LOG_HOLD	(60*SK_TICKS_PER_SEC)
+#define	SK_SEN_ERR_LOG_HOLD		(60*SK_TICKS_PER_SEC)
 #endif
 #ifndef	SK_SEN_WARN_TR_HOLD
-#define	SK_SEN_WARN_TR_HOLD	(15*SK_TICKS_PER_SEC)
+#define	SK_SEN_WARN_TR_HOLD		(15*SK_TICKS_PER_SEC)
 #endif
 #ifndef	SK_SEN_WARN_LOG_HOLD
 #define	SK_SEN_WARN_LOG_HOLD	(15*60*SK_TICKS_PER_SEC)
@@ -268,3 +274,4 @@
 
 #endif
 #endif	/* n_SKI2C_H */
+
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/h/skqueue.h linux/drivers/net/sk98lin/h/skqueue.h
--- linux-2.2.20-pre3/drivers/net/sk98lin/h/skqueue.h	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/h/skqueue.h	Sun Mar 25 08:31:22 2001
@@ -1,32 +1,23 @@
 /******************************************************************************
  *
  * Name:	skqueue.h
- * Project:	Genesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.12 $
- * Date:	$Date: 1998/09/08 08:48:01 $
+ * Project:	GEnesis, PCI Gigabit Ethernet Adapter
+ * Version:	$Revision: 1.13 $
+ * Date:	$Date: 1999/11/22 13:59:05 $
  * Purpose:	Defines for the Event queue
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1989-1998 SysKonnect,
+ *	(C)Copyright 1998,1999 SysKonnect,
  *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
- *	All Rights Reserved
  *
- *	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
- *	The copyright notice above does not evidence any
- *	actual or intended publication of such source code.
- *
- *	This Module contains Proprietary Information of SysKonnect
- *	and should be treated as Confidential.
- *
- *	The information in this file is provided for the exclusive use of
- *	the licensees of SysKonnect.
- *	Such users have the right to use, modify, and incorporate this code
- *	into products for purposes authorized by the license agreement
- *	provided they include this notice and the associated copyright notice
- *	with any such product.
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU General Public License as published by
+ *	the Free Software Foundation; either version 2 of the License, or
+ *	(at your option) any later version.
+ *
  *	The information in this file is provided "AS IS" without warranty.
  *
  ******************************************************************************/
@@ -36,6 +27,9 @@
  * History:
  *
  *	$Log: skqueue.h,v $
+ *	Revision 1.13  1999/11/22 13:59:05  cgoos
+ *	Changed license header to GPL.
+ *	
  *	Revision 1.12  1998/09/08 08:48:01  gklug
  *	add: init level handling
  *	
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/h/sktimer.h linux/drivers/net/sk98lin/h/sktimer.h
--- linux-2.2.20-pre3/drivers/net/sk98lin/h/sktimer.h	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/h/sktimer.h	Sun Mar 25 08:31:22 2001
@@ -1,32 +1,23 @@
 /******************************************************************************
  *
  * Name:	sktimer.h
- * Project:	Genesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.8 $
- * Date:	$Date: 1998/09/08 08:48:02 $
+ * Project:	GEnesis, PCI Gigabit Ethernet Adapter
+ * Version:	$Revision: 1.9 $
+ * Date:	$Date: 1999/11/22 14:00:29 $
  * Purpose:	Defines for the timer functions
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1989-1998 SysKonnect,
+ *	(C)Copyright 1998,1999 SysKonnect,
  *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
- *	All Rights Reserved
  *
- *	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
- *	The copyright notice above does not evidence any
- *	actual or intended publication of such source code.
- *
- *	This Module contains Proprietary Information of SysKonnect
- *	and should be treated as Confidential.
- *
- *	The information in this file is provided for the exclusive use of
- *	the licensees of SysKonnect.
- *	Such users have the right to use, modify, and incorporate this code
- *	into products for purposes authorized by the license agreement
- *	provided they include this notice and the associated copyright notice
- *	with any such product.
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU General Public License as published by
+ *	the Free Software Foundation; either version 2 of the License, or
+ *	(at your option) any later version.
+ *
  *	The information in this file is provided "AS IS" without warranty.
  *
  ******************************************************************************/
@@ -36,6 +27,9 @@
  * History:
  *
  *	$Log: sktimer.h,v $
+ *	Revision 1.9  1999/11/22 14:00:29  cgoos
+ *	Changed license header to GPL.
+ *	
  *	Revision 1.8  1998/09/08 08:48:02  gklug
  *	add: init level handling
  *	
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/h/skversion.h linux/drivers/net/sk98lin/h/skversion.h
--- linux-2.2.20-pre3/drivers/net/sk98lin/h/skversion.h	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/h/skversion.h	Mon Dec  3 22:19:02 2001
@@ -36,11 +36,11 @@
  
 static const char SysKonnectFileId[] = "@(#)" __FILE__ " (C) SysKonnect GmbH.";
 static const char SysKonnectBuildNumber[] =
-	"@(#)SK-BUILD: 4.03 PL: 01"; 
+	"@(#)SK-BUILD: 4.07 PL: 01"; 
 
-#define BOOT_STRING	"sk98lin: Network Device Driver v4.03\n" \
+#define BOOT_STRING	"sk98lin: Network Device Driver v4.07\n" \
 			"Copyright (C) 2000-2001 SysKonnect GmbH."
 
-#define VER_STRING	"4.03"
+#define VER_STRING	"4.07"
 
 
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/h/xmac_ii.h linux/drivers/net/sk98lin/h/xmac_ii.h
--- linux-2.2.20-pre3/drivers/net/sk98lin/h/xmac_ii.h	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/h/xmac_ii.h	Mon Dec  3 22:19:02 2001
@@ -413,7 +413,7 @@
 #define XM_ST_BC		(1L<<7)		/* Bit	7:	Broadcast packet */
 #define XM_ST_MC		(1L<<6)		/* Bit	6:	Multicast packet */
 #define XM_ST_UC		(1L<<5)		/* Bit	5:	Unicast packet */
-#define XM_ST_TX_UR		(1L<<4)		/* Bit	4:	FIFO Underrun occured */
+#define XM_ST_TX_UR		(1L<<4)		/* Bit	4:	FIFO Underrun occurred */
 #define XM_ST_CS_ERR	(1L<<3)		/* Bit	3:	Carrier Sense Error */
 #define XM_ST_LAT_COL	(1L<<2)		/* Bit	2:	Late Collision Error */
 #define XM_ST_MUL_COL	(1L<<1)		/* Bit	1:	Multiple Collisions */
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/skge.c linux/drivers/net/sk98lin/skge.c
--- linux-2.2.20-pre3/drivers/net/sk98lin/skge.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/skge.c	Mon Dec  3 22:19:02 2001
@@ -2,8 +2,8 @@
  *
  * Name:    skge.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.33 $
- * Date:	$Date: 2001/03/20 12:26:08 $
+ * Version:	$Revision: 1.37 $
+ * Date:	$Date: 2001/05/08 11:25:40 $
  * Purpose:	The main driver source module
  *
  ******************************************************************************/
@@ -50,6 +50,18 @@
  * History:
  *
  *	$Log: skge.c,v $
+ *	Revision 1.37  2001/05/08 11:25:40  mlindner
+ *	fix: removed VLAN error message
+ *	
+ *	Revision 1.36  2001/05/04 12:02:25  gklug
+ *	fix: compilation bug
+ *	
+ *	Revision 1.35  2001/05/04 11:42:12  gklug
+ *	fix: receive IRQ can now handle invalid frames correctly
+ *	
+ *	Revision 1.34  2001/05/04 11:13:49  gklug
+ *	fix: do not free meassage if ring is full on entry.
+ *	
  *	Revision 1.33  2001/03/20 12:26:08  mlindner
  *	Fix: Memory problem
  *	Fix: proc_unregister fixed
@@ -1833,7 +1845,8 @@
 				SK_DBGCAT_DRV_TX_PROGRESS,
 				("XmitFrame failed\n"));
 			/* this message can not be sent now */
-			DEV_KFREE_SKB(pMessage);
+			/* Because tbusy seems to be set, the message should not be freed here */
+			/* It will be used by the scheduler of the ethernet handler */
 			return (-1);
 		}
 	}
@@ -2100,33 +2113,71 @@
 
 rx_start:	
 	/* do forever; exit if RX_CTRL_OWN_BMU found */
-	while (pRxPort->RxdRingFree < pAC->RxDescrPerRing) {
-		pRxd = pRxPort->pRxdRingHead;
-		
-		Control = pRxd->RBControl;
+	for ( pRxd = pRxPort->pRxdRingHead ;
+		  pRxPort->RxdRingFree < pAC->RxDescrPerRing ;
+		  pRxd = pRxd->pNextRxd,
+		  pRxPort->pRxdRingHead = pRxd,
+		  pRxPort->RxdRingFree ++) {
 
+		/*
+		 * For a better understanding of this loop 
+		 * Go through every descriptor beginning at the head 
+		 * Please note: the ring might be completely received so the OWN bit
+		 * set is not a good crirteria to leave that loop.
+		 * Therefore the RingFree counter is used.
+		 * On entry of this loop pRxd is a pointer to the Rxd that needs
+		 * to be checked next.
+		 */
 
+		Control = pRxd->RBControl;
 	
 		/* check if this descriptor is ready */
 		if ((Control & RX_CTRL_OWN_BMU) != 0) {
 			/* this descriptor is not yet ready */
+			/* This is the usual end of the loop */
+			/* We don't need to start the ring again */
 			FillRxRing(pAC, pRxPort);
 			return;
 		}
 
 		/* get length of frame and check it */
 		FrameLength = Control & RX_CTRL_LEN_MASK;
-		if (FrameLength > pAC->RxBufSize)
+		if (FrameLength > pAC->RxBufSize) {
 			goto rx_failed;
+		}
 
 		/* check for STF and EOF */
 		if ((Control & (RX_CTRL_STF | RX_CTRL_EOF)) !=
-			(RX_CTRL_STF | RX_CTRL_EOF))
+			(RX_CTRL_STF | RX_CTRL_EOF)) {
 			goto rx_failed;
+		}
 		
 		/* here we have a complete frame in the ring */
 		pMsg = pRxd->pMBuf;
+
+		FrameStat = pRxd->FrameStat;
+		SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 0,
+			("Received frame of length %d on port %d\n",
+			FrameLength, PortIndex));
+		SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 0,
+			("Number of free rx descriptors: %d\n",
+			pRxPort->RxdRingFree));
+/*DumpMsg(pMsg, "Rx");	*/	
 		
+		if ((Control & RX_CTRL_STAT_VALID) != RX_CTRL_STAT_VALID ||
+			(FrameStat & (XMR_FS_ANY_ERR | XMR_FS_2L_VLAN)) != 0) {
+			/* there is a receive error in this frame */
+			SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
+				SK_DBGCAT_DRV_RX_PROGRESS,
+				("skge: Error in received frame, dropped!\n"
+				"Control: %x\nRxStat: %x\n",
+				Control, FrameStat));
+			ReQueueRxBuffer(pAC, pRxPort, pMsg,
+				pRxd->VDataHigh, pRxd->VDataLow);
+
+			continue;
+		}
+
 		/*
 		 * if short frame then copy data to reduce memory waste
 		 */
@@ -2177,114 +2228,85 @@
 			} /* IP frame */
 		} /* frame > SK_COPY_TRESHOLD */
 		
-		FrameStat = pRxd->FrameStat;
-		pRxd = pRxd->pNextRxd;
-		pRxPort->pRxdRingHead = pRxd;
-		pRxPort->RxdRingFree ++;
-		SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 0,
-			("Received frame of length %d on port %d\n",
-			FrameLength, PortIndex));
-		SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 0,
-			("Number of free rx descriptors: %d\n",
-			pRxPort->RxdRingFree));
-/*DumpMsg(pMsg, "Rx");	*/	
-		if ((Control & RX_CTRL_STAT_VALID) == RX_CTRL_STAT_VALID &&
-			(FrameStat & 
-			(XMR_FS_ANY_ERR | XMR_FS_2L_VLAN))
- 			 == 0) {
-			SK_DBG_MSG(NULL, SK_DBGMOD_DRV,	1,("V"));
-			ForRlmt = SK_RLMT_RX_PROTOCOL;
-			IsBc = (FrameStat & XMR_FS_BC)==XMR_FS_BC;
-			SK_RLMT_PRE_LOOKAHEAD(pAC, PortIndex, FrameLength,
-				IsBc, &Offset, &NumBytes);
-			if (NumBytes != 0) {
-				IsMc = (FrameStat & XMR_FS_MC)==XMR_FS_MC;
-				SK_RLMT_LOOKAHEAD(pAC, PortIndex, 
-					&pMsg->data[Offset],
-					IsBc, IsMc, &ForRlmt);
-			}
-			if (ForRlmt == SK_RLMT_RX_PROTOCOL) {
-						SK_DBG_MSG(NULL, SK_DBGMOD_DRV,	1,("W"));
-	/* send up only frames from active port */
-			    if ((PortIndex == pAC->ActivePort) ||
-					(pAC->RlmtNets == 2)) {
-					/* frame for upper layer */
-					SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("U"));
+		SK_DBG_MSG(NULL, SK_DBGMOD_DRV,	1,("V"));
+		ForRlmt = SK_RLMT_RX_PROTOCOL;
+		IsBc = (FrameStat & XMR_FS_BC)==XMR_FS_BC;
+		SK_RLMT_PRE_LOOKAHEAD(pAC, PortIndex, FrameLength,
+			IsBc, &Offset, &NumBytes);
+		if (NumBytes != 0) {
+			IsMc = (FrameStat & XMR_FS_MC)==XMR_FS_MC;
+			SK_RLMT_LOOKAHEAD(pAC, PortIndex, 
+				&pMsg->data[Offset],
+				IsBc, IsMc, &ForRlmt);
+		}
+		if (ForRlmt == SK_RLMT_RX_PROTOCOL) {
+					SK_DBG_MSG(NULL, SK_DBGMOD_DRV,	1,("W"));
+/* send up only frames from active port */
+			if ((PortIndex == pAC->ActivePort) ||
+				(pAC->RlmtNets == 2)) {
+				/* frame for upper layer */
+				SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("U"));
 #ifdef xDEBUG
-					DumpMsg(pMsg, "Rx");
+				DumpMsg(pMsg, "Rx");
 #endif
-					SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC,
-						FrameLength, pRxPort->PortIndex);
+				SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC,
+					FrameLength, pRxPort->PortIndex);
 
-					pMsg->dev = pAC->dev[pRxPort->PortIndex];
-					pMsg->protocol = eth_type_trans(pMsg,
-						pAC->dev[pRxPort->PortIndex]);
-					netif_rx(pMsg);
-					pAC->dev[pRxPort->PortIndex]->last_rx = jiffies;
-				}
-				else {
-					/* drop frame */
-					SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 
-						SK_DBGCAT_DRV_RX_PROGRESS,
-						("D"));
-					DEV_KFREE_SKB(pMsg);
-				}
-				
-			} /* if not for rlmt */
+				pMsg->dev = pAC->dev[pRxPort->PortIndex];
+				pMsg->protocol = eth_type_trans(pMsg,
+					pAC->dev[pRxPort->PortIndex]);
+				netif_rx(pMsg);
+				pAC->dev[pRxPort->PortIndex]->last_rx = jiffies;
+			}
 			else {
-				/* packet for rlmt */
+				/* drop frame */
 				SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 
-					SK_DBGCAT_DRV_RX_PROGRESS, ("R"));
-				pRlmtMbuf = SkDrvAllocRlmtMbuf(pAC,
-					pAC->IoBase, FrameLength);
-				if (pRlmtMbuf != NULL) {
-					pRlmtMbuf->pNext = NULL;
-					pRlmtMbuf->Length = FrameLength;
-					pRlmtMbuf->PortIdx = PortIndex;
-					EvPara.pParaPtr = pRlmtMbuf;
-					memcpy((char*)(pRlmtMbuf->pData),
-					       (char*)(pMsg->data),
-					       FrameLength);
-					SkEventQueue(pAC, SKGE_RLMT,
-						SK_RLMT_PACKET_RECEIVED,
-						EvPara);
-					pAC->CheckQueue = SK_TRUE;
-					SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 
-						SK_DBGCAT_DRV_RX_PROGRESS,
-						("Q"));
-				}
-				if ((pAC->dev[pRxPort->PortIndex]->flags & 
-					(IFF_PROMISC | IFF_ALLMULTI)) != 0 ||
-					(ForRlmt & SK_RLMT_RX_PROTOCOL) == 
-					SK_RLMT_RX_PROTOCOL) { 
-					pMsg->dev = pAC->dev[pRxPort->PortIndex];
-					pMsg->protocol = eth_type_trans(pMsg,
-						pAC->dev[pRxPort->PortIndex]);
-					netif_rx(pMsg);
-					pAC->dev[pRxPort->PortIndex]->last_rx = jiffies;
-				}
-				else {
-					DEV_KFREE_SKB(pMsg);
-				}
-
-			} /* if packet for rlmt */
-		} /* if valid frame */
+					SK_DBGCAT_DRV_RX_PROGRESS,
+					("D"));
+				DEV_KFREE_SKB(pMsg);
+			}
+			
+		} /* if not for rlmt */
 		else {
-			/* there is a receive error in this frame */
-			if ((FrameStat & XMR_FS_2L_VLAN) != 0) {
-				printk("%s: Received frame"
-					" with VLAN Level 2 header, check"
-					" switch configuration\n",
-					pAC->dev[pRxPort->PortIndex]->name);
+			/* packet for rlmt */
+			SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 
+				SK_DBGCAT_DRV_RX_PROGRESS, ("R"));
+			pRlmtMbuf = SkDrvAllocRlmtMbuf(pAC,
+				pAC->IoBase, FrameLength);
+			if (pRlmtMbuf != NULL) {
+				pRlmtMbuf->pNext = NULL;
+				pRlmtMbuf->Length = FrameLength;
+				pRlmtMbuf->PortIdx = PortIndex;
+				EvPara.pParaPtr = pRlmtMbuf;
+				memcpy((char*)(pRlmtMbuf->pData),
+					   (char*)(pMsg->data),
+					   FrameLength);
+				SkEventQueue(pAC, SKGE_RLMT,
+					SK_RLMT_PACKET_RECEIVED,
+					EvPara);
+				pAC->CheckQueue = SK_TRUE;
+				SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 
+					SK_DBGCAT_DRV_RX_PROGRESS,
+					("Q"));
 			}
-			SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
-				SK_DBGCAT_DRV_RX_PROGRESS,
-				("skge: Error in received frame, dropped!\n"
-				"Control: %x\nRxStat: %x\n",
-				Control, FrameStat));
-			DEV_KFREE_SKB(pMsg);
-		}
-	} /* while */
+			if ((pAC->dev[pRxPort->PortIndex]->flags & 
+				(IFF_PROMISC | IFF_ALLMULTI)) != 0 ||
+				(ForRlmt & SK_RLMT_RX_PROTOCOL) == 
+				SK_RLMT_RX_PROTOCOL) { 
+				pMsg->dev = pAC->dev[pRxPort->PortIndex];
+				pMsg->protocol = eth_type_trans(pMsg,
+					pAC->dev[pRxPort->PortIndex]);
+				netif_rx(pMsg);
+				pAC->dev[pRxPort->PortIndex]->last_rx = jiffies;
+			}
+			else {
+				DEV_KFREE_SKB(pMsg);
+			}
+
+		} /* if packet for rlmt */
+	} /* for ... scanning the RXD ring */
+
+	/* RXD ring is empty -> fill and restart */
 	FillRxRing(pAC, pRxPort);
 	/* do not start if called from Close */
 	if (pAC->BoardLevel > 0) {
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/skgehwt.c linux/drivers/net/sk98lin/skgehwt.c
--- linux-2.2.20-pre3/drivers/net/sk98lin/skgehwt.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/skgehwt.c	Sun Mar 25 08:31:22 2001
@@ -1,32 +1,23 @@
 /******************************************************************************
  *
  * Name:	skgehwt.c
- * Project:	PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.12 $
- * Date:	$Date: 1998/10/15 15:11:34 $
+ * Project:	GEnesis, PCI Gigabit Ethernet Adapter
+ * Version:	$Revision: 1.13 $
+ * Date:	$Date: 1999/11/22 13:31:12 $
  * Purpose:	Hardware Timer.
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1989-1998 SysKonnect,
+ *	(C)Copyright 1998,1999 SysKonnect,
  *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
- *	All Rights Reserved
  *
- *	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
- *	The copyright notice above does not evidence any
- *	actual or intended publication of such source code.
- *
- *	This Module contains Proprietary Information of SysKonnect
- *	and should be treated as Confidential.
- *
- *	The information in this file is provided for the exclusive use of
- *	the licensees of SysKonnect.
- *	Such users have the right to use, modify, and incorporate this code
- *	into products for purposes authorized by the license agreement
- *	provided they include this notice and the associated copyright notice
- *	with any such product.
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU General Public License as published by
+ *	the Free Software Foundation; either version 2 of the License, or
+ *	(at your option) any later version.
+ *
  *	The information in this file is provided "AS IS" without warranty.
  *
  ******************************************************************************/
@@ -36,6 +27,9 @@
  * History:
  *
  *	$Log: skgehwt.c,v $
+ *	Revision 1.13  1999/11/22 13:31:12  cgoos
+ *	Changed license header to GPL.
+ *	
  *	Revision 1.12  1998/10/15 15:11:34  gklug
  *	fix: ID_sccs to SysKonnectFileId
  *	
@@ -83,7 +77,7 @@
 	Event queue and dispatcher
 */
 static const char SysKonnectFileId[] =
-	"$Header: /usr56/projects/ge/schedule/skgehwt.c,v 1.12 1998/10/15 15:11:34 gklug Exp $" ;
+	"$Header: /usr56/projects/ge/schedule/skgehwt.c,v 1.13 1999/11/22 13:31:12 cgoos Exp $" ;
 
 #include "h/skdrv1st.h"		/* Driver Specific Definitions */
 #include "h/skdrv2nd.h"		/* Adapter Control- and Driver specific Def. */
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/skgeinit.c linux/drivers/net/sk98lin/skgeinit.c
--- linux-2.2.20-pre3/drivers/net/sk98lin/skgeinit.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/skgeinit.c	Mon Dec  3 22:19:02 2001
@@ -2,8 +2,8 @@
  *
  * Name:	skgeinit.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.62 $
- * Date:	$Date: 2001/02/07 07:54:21 $
+ * Version:	$Revision: 1.63 $
+ * Date:	$Date: 2001/04/05 11:02:09 $
  * Purpose:	Contains functions to initialize the GE HW
  *
  ******************************************************************************/
@@ -26,6 +26,9 @@
  * History:
  *
  *	$Log: skgeinit.c,v $
+ *	Revision 1.63  2001/04/05 11:02:09  rassmann
+ *	Stop Port check of the STOP bit did not take 2/18 sec as wanted.
+ *	
  *	Revision 1.62  2001/02/07 07:54:21  rassmann
  *	Corrected copyright.
  *	
@@ -297,7 +300,7 @@
 /* local variables ************************************************************/
 
 static const char SysKonnectFileId[] =
-	"@(#)$Id: skgeinit.c,v 1.62 2001/02/07 07:54:21 rassmann Exp $ (C) SK ";
+	"@(#)$Id: skgeinit.c,v 1.63 2001/04/05 11:02:09 rassmann Exp $ (C) SK ";
 
 struct s_QOffTab {
 	int	RxQOff;		/* Receive Queue Address Offset */
@@ -1216,10 +1219,10 @@
 	SK_U16	Word;
 	SK_U32	XsCsr;
 	SK_U32	XaCsr;
-	int	i;
+	int		i;
 	SK_BOOL	AllPortsDis;
 	SK_U64	ToutStart;
-	int	ToutCnt;
+	int		ToutCnt;
 
 	pPrt = &pAC->GIni.GP[Port];
 
@@ -1244,7 +1247,7 @@
 		do {
 			/*
 			 * Clear packet arbiter timeout to make sure
-			 * this loop will terminate
+			 * this loop will terminate.
 			 */
 			if (Port == MAC_1) {
 				Word = PA_CLR_TO_TX1;
@@ -1255,9 +1258,8 @@
 			SK_OUT16(IoC, B3_PA_CTRL, Word);
 
 			/*
-			 * If the transfer stucks at the XMAC the STOP command
-			 * will not terminate if we don't flush the XMACs
-			 * transmit FIFO !
+			 * If the transfer stucks at the XMAC the STOP command will not
+			 * terminate if we don't flush the XMAC's transmit FIFO!
 			 */
 			XM_IN32(IoC, Port, XM_MODE, &DWord);
 			DWord |= XM_MD_FTF;
@@ -1266,7 +1268,7 @@
 			XsCsr = TestStopBit(pAC, IoC, pPrt->PXsQOff);
 			XaCsr = TestStopBit(pAC, IoC, pPrt->PXaQOff);
 
-			if (ToutStart + (SK_TICKS_PER_SEC / 18) >= SkOsGetTime(pAC)) {
+			if (SkOsGetTime(pAC) - ToutStart > (SK_TICKS_PER_SEC / 18)) {
 				/*
 				 * Timeout of 1/18 second reached.
 				 * This needs to be checked at 1/18 sec only.
@@ -1275,9 +1277,8 @@
 				switch (ToutCnt) {
 				case 1:
 					/*
-					 * Cache Incoherency workaround:
-					 * Assume a start command has been 
-					 * lost while sending the frame. 
+					 * Cache Incoherency workaround: Assume a start command
+					 * has been lost while sending the frame. 
 					 */
 					ToutStart = SkOsGetTime(pAC);
 					if (XsCsr & CSR_STOP) {
@@ -1293,6 +1294,7 @@
 					 * calls StopPort again.
 					 * XXX.
 					 */
+
 					/* Fatal Error, Loop aborted */
 					/* Create an Error Log Entry */
 					SK_ERR_LOG(
@@ -1308,12 +1310,12 @@
 				}
 			}
 
-		/*
-		 * Because of the ASIC problem report entry from 21.08.1998 it is
-		 * required to wait until CSR_STOP is reset and CSR_SV_IDLE is set.
-		 */
-		} while ((XsCsr & (CSR_STOP|CSR_SV_IDLE)) != CSR_SV_IDLE ||
-			 (XaCsr & (CSR_STOP|CSR_SV_IDLE)) != CSR_SV_IDLE);
+			/*
+			 * Because of the ASIC problem report entry from 21.08.1998 it is
+			 * required to wait until CSR_STOP is reset and CSR_SV_IDLE is set.
+			 */
+		} while ((XsCsr & (CSR_STOP | CSR_SV_IDLE)) != CSR_SV_IDLE ||
+			 (XaCsr & (CSR_STOP | CSR_SV_IDLE)) != CSR_SV_IDLE);
 
 		/* reset the XMAC depending on the RstMode */
 		if (RstMode == SK_SOFT_RST) {
@@ -1380,13 +1382,13 @@
 				i--;
 			}
 
-		/* finish if CSR_STOP is done or CSR_SV_IDLE is true and i==0 */
-		/*
-		 * because of the ASIC problem report entry from 21.08.98
-		 * it is required to wait until CSR_STOP is reset and
-		 * CSR_SV_IDLE is set.
-		 */
-		} while ((DWord & (CSR_STOP|CSR_SV_IDLE)) != CSR_SV_IDLE &&
+			/* finish if CSR_STOP is done or CSR_SV_IDLE is true and i==0 */
+			/*
+			 * because of the ASIC problem report entry from 21.08.98
+			 * it is required to wait until CSR_STOP is reset and
+			 * CSR_SV_IDLE is set.
+			 */
+		} while ((DWord & (CSR_STOP | CSR_SV_IDLE)) != CSR_SV_IDLE &&
 			((DWord & CSR_SV_IDLE) == 0 || i != 0));
 
 		/* The path data transfer activity is fully stopped now. */
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/skgepnmi.c linux/drivers/net/sk98lin/skgepnmi.c
--- linux-2.2.20-pre3/drivers/net/sk98lin/skgepnmi.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/skgepnmi.c	Mon Dec  3 22:19:02 2001
@@ -2,8 +2,8 @@
  *
  * Name:	skgepnmi.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.86 $
- * Date:	$Date: 2001/03/09 09:18:03 $
+ * Version:	$Revision: 1.87 $
+ * Date:	$Date: 2001/04/06 13:35:09 $
  * Purpose:	Private Network Management Interface
  *
  ****************************************************************************/
@@ -26,6 +26,9 @@
  * History:
  *
  *	$Log: skgepnmi.c,v $
+ *	Revision 1.87  2001/04/06 13:35:09  mkunz
+ *	-Bugs fixed in handling of OID_SKGE_MTU and the VPD OID's
+ *	
  *	Revision 1.86  2001/03/09 09:18:03  mkunz
  *	Changes in SK_DBG_MSG
  *	
@@ -359,7 +362,7 @@
 
 
 static const char SysKonnectFileId[] =
-	"@(#) $Id: skgepnmi.c,v 1.86 2001/03/09 09:18:03 mkunz Exp $"
+	"@(#) $Id: skgepnmi.c,v 1.87 2001/04/06 13:35:09 mkunz Exp $"
 	" (C) SysKonnect.";
 
 #include "h/skdrv1st.h"
@@ -1636,7 +1639,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to take
  *	                         the data.
  *	SK_PNMI_ERR_UNKNOWN_OID  The requested OID is unknown
@@ -1675,7 +1678,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -1719,7 +1722,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -1763,7 +1766,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to take
  *	                         the data.
  *	SK_PNMI_ERR_UNKNOWN_NET  The requested NetIndex doesn't exist 
@@ -1862,7 +1865,6 @@
 		TableIndex ++) {
 
 		InstanceNo = IdTable[TableIndex].InstanceNo;
-
 		for (InstanceCnt = 1; InstanceCnt <= InstanceNo;
 			InstanceCnt ++) {
 
@@ -1880,8 +1882,7 @@
 				IdTable[TableIndex].Id == OID_SKGE_VPD_ACCESS ||
 				IdTable[TableIndex].Id == OID_SKGE_VPD_ACTION) {
 
-				SK_PNMI_READ_U32(KeyArr[InstanceCnt - 1],
-					Instance);
+				SK_STRNCPY((char *)&Instance, KeyArr[InstanceCnt - 1], 4);
 			}
 			else {
 				Instance = (SK_U32)InstanceCnt;
@@ -1900,7 +1901,7 @@
 			 */
 			if (Ret == SK_PNMI_ERR_UNKNOWN_INST) {
 
-				break;
+                break;
 			}
 
 			if (Ret != SK_PNMI_ERR_OK) {
@@ -1943,7 +1944,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -1982,7 +1983,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -2933,7 +2934,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3001,7 +3002,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3136,7 +3137,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3279,7 +3280,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3315,32 +3316,26 @@
 	PhysPortMax = pAC->GIni.GIMacsFound;
 	LogPortMax = SK_PNMI_PORT_PHYS2LOG(PhysPortMax);
 
+	if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
+		LogPortMax--;
+	}
+
 	if ((Instance != (SK_U32)(-1))) { /* Only one specific instance is queried */
 		/* Check instance range */
-		if ((Instance < 1) || (Instance > LogPortMax)) { 
+		if ((Instance < 1) || (Instance > LogPortMax)) {
 
 			*pLen = 0;
 			return (SK_PNMI_ERR_UNKNOWN_INST);
 		}
 		LogPortIndex = SK_PNMI_PORT_INST2LOG(Instance);
-
-		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
-			LogPortMax--;
-			if(LogPortIndex >= LogPortMax) {
-				*pLen = 0;
-				return (SK_PNMI_ERR_UNKNOWN_INST);
-			}
-		} 
+		Limit = LogPortIndex + 1;
 	}
 
 	else { /* Instance == (SK_U32)(-1), get all Instances of that OID */
 
 		LogPortIndex = 0;
-		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
-			LogPortMax--;
-		}
+		Limit = LogPortMax;
 	}
-	Limit = LogPortMax;
 
 
 	/*
@@ -3432,7 +3427,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3472,6 +3467,10 @@
 	PhysPortMax = pAC->GIni.GIMacsFound;
 	LogPortMax = SK_PNMI_PORT_PHYS2LOG(PhysPortMax);
 
+	if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
+		LogPortMax--;
+	}
+
 	if ((Instance != (SK_U32)(-1))) { /* Only one specific instance is queried */
 		/* Check instance range */
 		if ((Instance < 1) || (Instance > LogPortMax)) {
@@ -3480,25 +3479,14 @@
 			return (SK_PNMI_ERR_UNKNOWN_INST);
 		}
 		LogPortIndex = SK_PNMI_PORT_INST2LOG(Instance);
-
-		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
-			LogPortMax--;
-			if(LogPortIndex >= LogPortMax) {
-				*pLen = 0;
-				return (SK_PNMI_ERR_UNKNOWN_INST);
-			}
-		}
+		Limit = LogPortIndex + 1;
 	}
 
 	else { /* Instance == (SK_U32)(-1), get all Instances of that OID */
 
 		LogPortIndex = 0;
-		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
-			LogPortMax--;
-		}
+		Limit = LogPortMax;
 	}
-	Limit = LogPortMax;
-
 
 	/*
 	 * Perform Action
@@ -3651,7 +3639,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3770,7 +3758,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -4015,7 +4003,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -4058,7 +4046,6 @@
 	Ret = GetVpdKeyArr(pAC, IoC, &KeyArr[0][0], sizeof(KeyArr),
 		&KeyNo);
 	if (Ret != SK_PNMI_ERR_OK) {
-
 		*pLen = 0;
 		return (Ret);
 	}
@@ -4083,7 +4070,6 @@
 			for (Index = 0; Index < KeyNo; Index ++) {
 
 				if (SK_STRCMP(KeyStr, KeyArr[Index]) == 0) {
-
 					FirstIndex = Index;
 					LastIndex = Index+1;
 					break;
@@ -4496,7 +4482,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -5203,7 +5189,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -5512,7 +5498,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -5712,7 +5698,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -5754,6 +5740,10 @@
 	PhysPortMax = pAC->GIni.GIMacsFound;
 	LogPortMax = SK_PNMI_PORT_PHYS2LOG(PhysPortMax);
 
+	if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
+		LogPortMax--;
+	}
+
 	if ((Instance != (SK_U32)(-1))) { /* Only one specific instance is queried */
 		/* Check instance range */
 		if ((Instance < 1) || (Instance > LogPortMax)) {
@@ -5762,25 +5752,14 @@
 			return (SK_PNMI_ERR_UNKNOWN_INST);
 		}
 		LogPortIndex = SK_PNMI_PORT_INST2LOG(Instance);
-
-		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
-			LogPortMax--;
-			if(LogPortIndex >= LogPortMax) {
-				*pLen = 0;
-				return (SK_PNMI_ERR_UNKNOWN_INST);
-			}
-		}
+		Limit = LogPortIndex + 1;
 	}
 
 	else { /* Instance == (SK_U32)(-1), get all Instances of that OID */
 
 		LogPortIndex = 0;
-		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
-			LogPortMax--;
-		}
+		Limit = LogPortMax;
 	}
-	Limit = LogPortMax;
-
 
 	/*
 	 * Perform action
@@ -6383,7 +6362,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -7385,7 +7364,7 @@
  *
  * Description:
  *	The trap buffer stores various events. A user application somehow
- *	gets notified that an event occured and retrieves the trap buffer
+ *	gets notified that an event occurred and retrieves the trap buffer
  *	contens (or simply polls the buffer). The buffer is organized as
  *	a ring which stores the newest traps at the beginning. The oldest
  *	traps are overwritten by the newest ones. Each trap entry has a
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/skgesirq.c linux/drivers/net/sk98lin/skgesirq.c
--- linux-2.2.20-pre3/drivers/net/sk98lin/skgesirq.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/skgesirq.c	Mon Dec  3 22:19:02 2001
@@ -736,14 +736,14 @@
 	/* Check whether XMACs are correctly initialized */
 	if ((Istatus & (IS_PA_TO_RX1 | IS_PA_TO_TX1)) &&
 		!pAC->GIni.GP[MAC_1].PState) {
-		/* XMAC was not initialized but Packet timeout occured */
+		/* XMAC was not initialized but Packet timeout occurred */
 		SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E004,
 			SKERR_SIRQ_E004MSG);
 	}
 
 	if ((Istatus & (IS_PA_TO_RX2 | IS_PA_TO_TX2)) &&
 	    !pAC->GIni.GP[MAC_2].PState) {
-		/* XMAC was not initialized but Packet timeout occured */
+		/* XMAC was not initialized but Packet timeout occurred */
 		SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E005,
 			SKERR_SIRQ_E005MSG);
 	}
@@ -1111,7 +1111,7 @@
 			 * otherwise the Linux driver will have a problem.
 			 */
 			/*
-			 * We received a bunch of frames or no CRC error occured on the
+			 * We received a bunch of frames or no CRC error occurred on the
 			 * network -> ok.
 			 */
 			pPrt->PPrevRx = RxCts;
@@ -1379,7 +1379,7 @@
 			pPrt->PAutoNegTOCt ++;
 
 			/*
-			 * Timeout occured.
+			 * Timeout occurred.
 			 * What do we need now?
 			 */
 			SK_DBG_MSG(pAC,SK_DBGMOD_HWM,
@@ -1389,7 +1389,7 @@
 			if (pPrt->PLinkModeConf == SK_LMODE_AUTOSENSE &&
 				pPrt->PLipaAutoNeg != SK_LIPA_AUTO) {
 				/*
-				 * Timeout occured
+				 * Timeout occurred
 				 * Set Link manually up.
 				 */
 				SkHWSenseSetNext(pAC, IoC, Port, SK_LMODE_FULL);
@@ -1872,7 +1872,7 @@
 		pPrt->PAutoNegTimeOut ++;
 		if (pPrt->PAutoNegTimeOut >= SK_AND_MAX_TO) {
 			/*
-			 * Timeout occured.
+			 * Timeout occurred.
 			 * What do we need now?
 			 */
 			SK_DBG_MSG(pAC,SK_DBGMOD_HWM,
@@ -1882,7 +1882,7 @@
 			if (pPrt->PLinkModeConf == SK_LMODE_AUTOSENSE &&
 				pPrt->PLipaAutoNeg != SK_LIPA_AUTO) {
 				/*
-				 * Timeout occured
+				 * Timeout occurred
 				 * Set Link manually up.
 				 */
 				SkHWSenseSetNext(pAC, IoC, Port,
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/ski2c.c linux/drivers/net/sk98lin/ski2c.c
--- linux-2.2.20-pre3/drivers/net/sk98lin/ski2c.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/ski2c.c	Mon Dec  3 22:19:02 2001
@@ -2,8 +2,8 @@
  *
  * Name:	ski2c.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.45 $
- * Date:	$Date: 2001/03/21 12:12:49 $
+ * Version:	$Revision: 1.47 $
+ * Date:	$Date: 2001/04/05 11:38:09 $
  * Purpose:	Functions to access Voltage and Temperature Sensor
  *			(taken from Monalisa (taken from Concentrator))
  *
@@ -11,8 +11,7 @@
 
 /******************************************************************************
  *
- *	(C)Copyright 1998-2000 SysKonnect,
- *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ *	(C)Copyright 1998-2001 SysKonnect GmbH.
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
@@ -28,15 +27,22 @@
  * History:
  *
  *	$Log: ski2c.c,v $
+ *	Revision 1.47  2001/04/05 11:38:09  rassmann
+ *	Set SenState to idle in SkI2cWaitIrq().
+ *	Changed error message in SkI2cWaitIrq().
+ *	
+ *	Revision 1.46  2001/04/02 14:03:35  rassmann
+ *	Changed pAC to IoC in SK_IN32().
+ *	
  *	Revision 1.45  2001/03/21 12:12:49  rassmann
  *	Resetting I2C_READY interrupt in SkI2cInit1().
  *	
  *	Revision 1.44  2000/08/07 15:49:03  gklug
- *	fix: SK_INFAST only in NetWare driver
+ *	Fix: SK_INFAST only in NetWare driver.
  *	
  *	Revision 1.43  2000/08/03 14:28:17  rassmann
- *	- Added function to wait for I2C being ready before resetting the board.
- *	- Replaced one duplicate "out of range" message with correct one.
+ *	Added function to wait for I2C being ready before resetting the board.
+ *	Replaced one duplicate "out of range" message with correct one.
  *	
  *	Revision 1.42  1999/11/22 13:35:12  cgoos
  *	Changed license header to GPL.
@@ -183,10 +189,10 @@
 
 
 /*
-	I2C Protocol
-*/
+ *	I2C Protocol
+ */
 static const char SysKonnectFileId[] =
-	"$Id: ski2c.c,v 1.45 2001/03/21 12:12:49 rassmann Exp $";
+	"$Id: ski2c.c,v 1.47 2001/04/05 11:38:09 rassmann Exp $";
 
 #include "h/skdrv1st.h"		/* Driver Specific Definitions */
 #include "h/lm80.h"
@@ -194,7 +200,7 @@
 
 #ifdef __C2MAN__
 /*
-	I2C protocol implemetation.
+	I2C protocol implementation.
 
 	General Description:
 
@@ -604,13 +610,14 @@
 		if (SkOsGetTime(pAC) - StartTime > SK_TICKS_PER_SEC / 8) {
 			SK_I2C_STOP(IoC);
 #ifndef SK_DIAG
-			SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_I2C_E002, SKERR_I2C_E002MSG);
+			SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_I2C_E016, SKERR_I2C_E016MSG);
 #endif	/* !SK_DIAG */
 			return;
 		}
-		SK_IN32(pAC, B0_ISRC, &IrqSrc);
+		SK_IN32(IoC, B0_ISRC, &IrqSrc);
 	} while ((IrqSrc & IS_I2C_READY) == 0);
 
+	pSen->SenState = SK_SEN_IDLE;
 	return;
 }	/* SkI2cWaitIrq */
 
@@ -930,12 +937,13 @@
  * Level 0:
  *	Initialize only the data structures. Do NOT access hardware.
  * Level 1:
- *	Initialize hardware through SK_IN?OUT commands. Do NOT use interrupts.
+ *	Initialize hardware through SK_IN / SK_OUT commands. Do NOT use interrupts.
  * Level 2:
  *	Everything is possible. Interrupts may be used from now on.
  *
- * return:	0 = success
- *		other = error.
+ * return:
+ *	0 = success
+ *	other = error.
  */
 int	SkI2cInit(
 SK_AC	*pAC,	/* Adapter Context */
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/skqueue.c linux/drivers/net/sk98lin/skqueue.c
--- linux-2.2.20-pre3/drivers/net/sk98lin/skqueue.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/skqueue.c	Mon Dec  3 22:19:02 2001
@@ -1,32 +1,23 @@
 /******************************************************************************
  *
  * Name:	skqueue.c
- * Project:	PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.14 $
- * Date:	$Date: 1998/10/15 15:11:35 $
+ * Project:	GEnesis, PCI Gigabit Ethernet Adapter
+ * Version:	$Revision: 1.15 $
+ * Date:	$Date: 1999/11/22 13:36:29 $
  * Purpose:	Management of an event queue.
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1989-1998 SysKonnect,
+ *	(C)Copyright 1998,1999 SysKonnect,
  *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
- *	All Rights Reserved
  *
- *	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
- *	The copyright notice above does not evidence any
- *	actual or intended publication of such source code.
- *
- *	This Module contains Proprietary Information of SysKonnect
- *	and should be treated as Confidential.
- *
- *	The information in this file is provided for the exclusive use of
- *	the licensees of SysKonnect.
- *	Such users have the right to use, modify, and incorporate this code
- *	into products for purposes authorized by the license agreement
- *	provided they include this notice and the associated copyright notice
- *	with any such product.
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU General Public License as published by
+ *	the Free Software Foundation; either version 2 of the License, or
+ *	(at your option) any later version.
+ *
  *	The information in this file is provided "AS IS" without warranty.
  *
  ******************************************************************************/
@@ -36,6 +27,9 @@
  * History:
  *
  *	$Log: skqueue.c,v $
+ *	Revision 1.15  1999/11/22 13:36:29  cgoos
+ *	Changed license header to GPL.
+ *	
  *	Revision 1.14  1998/10/15 15:11:35  gklug
  *	fix: ID_sccs to SysKonnectFileId
  *	
@@ -88,7 +82,7 @@
 	Event queue and dispatcher
 */
 static const char SysKonnectFileId[] =
-	"$Header: /usr56/projects/ge/schedule/skqueue.c,v 1.14 1998/10/15 15:11:35 gklug Exp $" ;
+	"$Header: /usr56/projects/ge/schedule/skqueue.c,v 1.15 1999/11/22 13:36:29 cgoos Exp $" ;
 
 #include "h/skdrv1st.h"		/* Driver Specific Definitions */
 #include "h/skqueue.h"		/* Queue Definitions */
@@ -153,7 +147,7 @@
  *		send command to state machine
  *	end
  *	return error reported by individual Event function
- *		0 if no error occured.
+ *		0 if no error occurred.
  */
 int	SkEventDispatcher(
 SK_AC	*pAC,	/* Adapters Context */
diff -urN linux-2.2.20-pre3/drivers/net/sk98lin/sktimer.c linux/drivers/net/sk98lin/sktimer.c
--- linux-2.2.20-pre3/drivers/net/sk98lin/sktimer.c	Mon Dec  3 22:18:55 2001
+++ linux/drivers/net/sk98lin/sktimer.c	Sun Mar 25 08:31:22 2001
@@ -1,32 +1,23 @@
 /******************************************************************************
  *
  * Name:	sktimer.c
- * Project:	PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.11 $
- * Date:	$Date: 1998/12/17 13:24:13 $
+ * Project:	GEnesis, PCI Gigabit Ethernet Adapter
+ * Version:	$Revision: 1.12 $
+ * Date:	$Date: 1999/11/22 13:38:51 $
  * Purpose:	High level timer functions.
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1989-1998 SysKonnect,
+ *	(C)Copyright 1998,1999 SysKonnect,
  *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
- *	All Rights Reserved
  *
- *	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
- *	The copyright notice above does not evidence any
- *	actual or intended publication of such source code.
- *
- *	This Module contains Proprietary Information of SysKonnect
- *	and should be treated as Confidential.
- *
- *	The information in this file is provided for the exclusive use of
- *	the licensees of SysKonnect.
- *	Such users have the right to use, modify, and incorporate this code
- *	into products for purposes authorized by the license agreement
- *	provided they include this notice and the associated copyright notice
- *	with any such product.
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU General Public License as published by
+ *	the Free Software Foundation; either version 2 of the License, or
+ *	(at your option) any later version.
+ *
  *	The information in this file is provided "AS IS" without warranty.
  *
  ******************************************************************************/
@@ -36,6 +27,9 @@
  * History:
  *
  *	$Log: sktimer.c,v $
+ *	Revision 1.12  1999/11/22 13:38:51  cgoos
+ *	Changed license header to GPL.
+ *	
  *	Revision 1.11  1998/12/17 13:24:13  gklug
  *	fix: restart problem: do NOT destroy timer queue if init 1 is done
  *	
@@ -82,7 +76,7 @@
 	Event queue and dispatcher
 */
 static const char SysKonnectFileId[] =
-	"$Header: /usr56/projects/ge/schedule/sktimer.c,v 1.11 1998/12/17 13:24:13 gklug Exp $" ;
+	"$Header: /usr56/projects/ge/schedule/sktimer.c,v 1.12 1999/11/22 13:38:51 cgoos Exp $" ;
 
 #include "h/skdrv1st.h"		/* Driver Specific Definitions */
 #include "h/skdrv2nd.h"		/* Adapter Control- and Driver specific Def. */
diff -urN linux-2.2.20-pre3/drivers/net/skfp/drvfbi.c linux/drivers/net/skfp/drvfbi.c
--- linux-2.2.20-pre3/drivers/net/skfp/drvfbi.c	Sun Mar 25 08:31:23 2001
+++ linux/drivers/net/skfp/drvfbi.c	Mon Dec  3 22:19:02 2001
@@ -849,7 +849,7 @@
 
 #ifdef	EISA
 
-/*arrays with io adresses of dma controller length and adress registers*/
+/*arrays with io addresses of dma controller length and address registers*/
 static const int cntr[8] = { 0x001,0x003,0x005,0x007,0,0x0c6,0x0ca,0x0ce } ;
 static const int base[8] = { 0x000,0x002,0x004,0x006,0,0x0c4,0x0c8,0x0cc } ;
 static const int page[8] = { 0x087,0x083,0x081,0x082,0,0x08b,0x089,0x08a } ;
diff -urN linux-2.2.20-pre3/drivers/net/skfp/h/smc.h linux/drivers/net/skfp/h/smc.h
--- linux-2.2.20-pre3/drivers/net/skfp/h/smc.h	Sun Mar 25 08:31:23 2001
+++ linux/drivers/net/skfp/h/smc.h	Mon Dec  3 22:19:02 2001
@@ -297,7 +297,7 @@
 #define RS_NORINGOP	(1<< 5)			/* no ring op */
 #define RS_VERSION	(1<< 4)			/* SMT version mismatch */
 #define RS_STUCKBYPASSS	(1<< 3)			/* stuck bypass */
-#define RS_EVENT	(1<< 2)			/* FDDI event occured */
+#define RS_EVENT	(1<< 2)			/* FDDI event occurred */
 #define RS_RINGOPCHANGE	(1<< 1)			/* ring op changed */
 #define RS_RES0		(1<< 0)			/* reserved */
 
@@ -320,7 +320,7 @@
 	u_char	evc_rep_required ;		/* report required */
 	u_short	evc_para ;			/* SMT Para Number */
 	u_char	*evc_cond_state ;		/* condition state */
-	u_char	*evc_multiple ;			/* multiple occurence */
+	u_char	*evc_multiple ;			/* multiple occurrence */
 } ;
 
 /*
diff -urN linux-2.2.20-pre3/drivers/net/skfp/pcmplc.c linux/drivers/net/skfp/pcmplc.c
--- linux-2.2.20-pre3/drivers/net/skfp/pcmplc.c	Sun Mar 25 08:31:23 2001
+++ linux/drivers/net/skfp/pcmplc.c	Mon Dec  3 22:19:02 2001
@@ -1722,7 +1722,7 @@
 	}
 	if (cmd & PL_EBUF_ERR) {	/* elastic buff. det. over-|underflow*/
 		/*
-		 * Check whether the SRF Condition occured.
+		 * Check whether the SRF Condition occurred.
 		 */
 		if (!plc->ebuf_cont && phy->mib->fddiPORTPCMState == PC8_ACTIVE){
 			/*
diff -urN linux-2.2.20-pre3/drivers/net/skfp/srf.c linux/drivers/net/skfp/srf.c
--- linux-2.2.20-pre3/drivers/net/skfp/srf.c	Sun Mar 25 08:31:23 2001
+++ linux/drivers/net/skfp/srf.c	Mon Dec  3 22:19:02 2001
@@ -197,7 +197,7 @@
 	struct s_srf_evc	*evc ;
 	int			cond_asserted = 0 ;
 	int			cond_deasserted = 0 ;
-	int			event_occured = 0 ;
+	int			event_occurred = 0 ;
 	int			tsr ;
 	int			T_Limit = 2*TICKS_PER_SECOND ;
 
@@ -246,7 +246,7 @@
 				*evc->evc_multiple  = FALSE ;
 			}
 			smc->srf.any_report = TRUE ;
-			event_occured = TRUE ;
+			event_occurred = TRUE ;
 		}
 #ifdef	FDDI_MIB
 		snmp_srf_event(smc,evc) ;
@@ -268,7 +268,7 @@
 			break ;
 		}
 		/* SR01c */
-		if (event_occured && tsr < T_Limit) {
+		if (event_occurred && tsr < T_Limit) {
 			smc->srf.sr_state = SR1_HOLDOFF ;
 			break ;
 		}
@@ -286,7 +286,7 @@
 			break ;
 		}
 		/* SR00d */
-		if (event_occured && tsr >= T_Limit) {
+		if (event_occurred && tsr >= T_Limit) {
 			smc->srf.TSR = smt_get_time() ;
 			smt_send_srf(smc) ;
 			break ;
diff -urN linux-2.2.20-pre3/drivers/net/tulip.c linux/drivers/net/tulip.c
--- linux-2.2.20-pre3/drivers/net/tulip.c	Sun Mar 25 08:37:35 2001
+++ linux/drivers/net/tulip.c	Mon Dec  3 22:19:02 2001
@@ -2742,7 +2742,8 @@
 					(tp->link_change)(dev, csr5);
 			}
 			if (csr5 & SytemError) {
-				printk(KERN_ERR "%s: (%lu) System Error occured\n", dev->name, tp->nir);
+				printk(KERN_ERR "%s: (%lu) System Error occurred\n",
+				       dev->name, tp->nir);
 			}
 			/* Clear all error sources, included undocumented ones! */
 			outl(0x0800f7ba, ioaddr + CSR5);
diff -urN linux-2.2.20-pre3/drivers/s390/block/dasd_3990_erp.c linux/drivers/s390/block/dasd_3990_erp.c
--- linux-2.2.20-pre3/drivers/s390/block/dasd_3990_erp.c	Sun Mar 25 08:37:35 2001
+++ linux/drivers/s390/block/dasd_3990_erp.c	Mon Dec  3 22:19:02 2001
@@ -986,7 +986,7 @@
  *
  * RETURN VALUES
  *   erp                erp-pointer to the already defined error recovery procedure OR
- *                      NULL if a 'new' error occured.
+ *                      NULL if a 'new' error occurred.
  */
 ccw_req_t *
 dasd_3990_erp_in_erp (ccw_req_t * cqr)
@@ -1068,7 +1068,7 @@
  * DASD_3990_ERP_HANDLE_MATCH_ERP 
  *
  * DESCRIPTION
- *   An error occured again and an ERP has been detected which is already
+ *   An error occurred again and an ERP has been detected which is already
  *   used to handle this error (e.g. retries). 
  *   All prior ERP's are set to status DONE and the retry counter is
  *   decremented.
diff -urN linux-2.2.20-pre3/drivers/s390/net/ctc.c linux/drivers/s390/net/ctc.c
--- linux-2.2.20-pre3/drivers/s390/net/ctc.c	Sun Mar 25 08:37:35 2001
+++ linux/drivers/s390/net/ctc.c	Mon Dec  3 22:19:02 2001
@@ -1109,7 +1109,7 @@
 		if (sense & 0x01) 
 			printk(KERN_DEBUG "%s: %s: Interface disconnect or Selective reset occurred (remote side)\n", dev->name, caller);
 		else 
-			printk(KERN_DEBUG "%s: %s: System reset occured (remote side)\n", dev->name, caller);
+			printk(KERN_DEBUG "%s: %s: System reset occurred (remote side)\n", dev->name, caller);
 #endif
 	} else if (sense & 0x20) {
 		if (sense & 0x04)
diff -urN linux-2.2.20-pre3/drivers/sbus/char/envctrl.c linux/drivers/sbus/char/envctrl.c
--- linux-2.2.20-pre3/drivers/sbus/char/envctrl.c	Sun Mar 25 08:31:39 2001
+++ linux/drivers/sbus/char/envctrl.c	Mon Dec  3 22:19:02 2001
@@ -239,7 +239,7 @@
 		printk(KERN_INFO "envctrl: Busy bit will not clear.\n");
 }
 
-/* Function Description: Send the adress for a read access.
+/* Function Description: Send the address for a read access.
  * Return : 0 if not acknowledged, otherwise acknowledged.
  */
 static int envctrl_i2c_read_addr(unsigned char addr)
@@ -265,7 +265,7 @@
 	}
 }
 
-/* Function Description: Send the adress for write mode.  
+/* Function Description: Send the address for write mode.  
  * Return : None.
  */
 static void envctrl_i2c_write_addr(unsigned char addr)
diff -urN linux-2.2.20-pre3/drivers/scsi/NCR53C9x.c linux/drivers/scsi/NCR53C9x.c
--- linux-2.2.20-pre3/drivers/scsi/NCR53C9x.c	Sun Mar 25 08:31:33 2001
+++ linux/drivers/scsi/NCR53C9x.c	Mon Dec  3 22:19:02 2001
@@ -2813,7 +2813,7 @@
 /* Target negotiates for synchronous transfers before we do, this
  * is legal although very strange.  What is even funnier is that
  * the SCSI2 standard specifically recommends against targets doing
- * this because so many initiators cannot cope with this occuring.
+ * this because so many initiators cannot cope with this occurring.
  */
 static inline int target_with_ants_in_pants(struct NCR_ESP *esp,
 					    Scsi_Cmnd *SCptr,
diff -urN linux-2.2.20-pre3/drivers/scsi/README.ibmmca linux/drivers/scsi/README.ibmmca
--- linux-2.2.20-pre3/drivers/scsi/README.ibmmca	Sun Mar 25 08:31:33 2001
+++ linux/drivers/scsi/README.ibmmca	Mon Dec  3 22:19:02 2001
@@ -797,9 +797,9 @@
       commandline parameter is added, called 'activity'.
    2) Added the READ_CONTROL bit for test_unit_ready SCSI-command.
    3) Added some suppress_exception bits to read_device_capacity and
-      all device_inquiry occurences in the driver code.
+      all device_inquiry occurrences in the driver code.
    4) Complaints about the various KERNEL_VERSION implementations are
-      taken into account. Every local_LinuxKernelVersion occurence is
+      taken into account. Every local_LinuxKernelVersion occurrence is
       now replaced by KERNEL_VERSION, defined in linux/version.h. 
       Corresponding changes were applied to ibmmca.h, too. This was a
       contribution to all kernel-parts by Philipp Hahn.
diff -urN linux-2.2.20-pre3/drivers/scsi/README.ncr53c8xx linux/drivers/scsi/README.ncr53c8xx
--- linux-2.2.20-pre3/drivers/scsi/README.ncr53c8xx	Sun Mar 25 08:31:32 2001
+++ linux/drivers/scsi/README.ncr53c8xx	Mon Dec  3 22:19:02 2001
@@ -1350,7 +1350,7 @@
   Bit 0x04 : UDC  Undexpected Disconnection
              Indicates that the device released the SCSI BUS when the chip 
              was not expecting this to happen. A device may behave so to 
-             indicate the SCSI initiator that an error condition not reportable              using the SCSI protocol has occured.
+             indicate the SCSI initiator that an error condition not reportable              using the SCSI protocol has occurred.
   Bit 0x02 : RST  SCSI BUS Reset
              Generally SCSI targets donnot reset the SCSI BUS, although any 
              device on the BUS can reset it at any time.
diff -urN linux-2.2.20-pre3/drivers/scsi/cpqfcTScontrol.c linux/drivers/scsi/cpqfcTScontrol.c
--- linux-2.2.20-pre3/drivers/scsi/cpqfcTScontrol.c	Sun Mar 25 08:31:34 2001
+++ linux/drivers/scsi/cpqfcTScontrol.c	Mon Dec  3 22:19:03 2001
@@ -553,7 +553,7 @@
 
 
 
-// This "look ahead" function examines the IMQ for occurence of
+// This "look ahead" function examines the IMQ for occurrence of
 // "type".  Returns 1 if found, 0 if not.
 static int PeekIMQEntry( PTACHYON fcChip, ULONG type)
 {
@@ -1204,7 +1204,7 @@
           // open Login exchanges, in case the LinkDown happened in the
           // middle of logins.  It's possible that some ports already
           // ACCepted login commands which we have not processed before
-          // another LinkDown occured.  Any accepted Login exhanges are
+          // another LinkDown occurred.  Any accepted Login exhanges are
           // invalidated by LinkDown, even before they are acknowledged.
           // It's also possible for a port to have a Queued Reply or Request
           // for login which was interrupted by LinkDown; it may come later,
diff -urN linux-2.2.20-pre3/drivers/scsi/cpqfcTSworker.c linux/drivers/scsi/cpqfcTSworker.c
--- linux-2.2.20-pre3/drivers/scsi/cpqfcTSworker.c	Sun Mar 25 08:37:36 2001
+++ linux/drivers/scsi/cpqfcTSworker.c	Mon Dec  3 22:19:03 2001
@@ -421,7 +421,7 @@
     
 //      printk(" *ELS %Xh* ", fcLQ->Qitem[QconsumerNdx].Type);
       // if PortDiscDone is not set, it means the SendLogins routine
-      // failed to complete -- assume that LDn occured, so login frames
+      // failed to complete -- assume that LDn occurred, so login frames
       // are invalid
       if( !cpqfcHBAdata->PortDiscDone) // cleared by LDn
       {
diff -urN linux-2.2.20-pre3/drivers/scsi/esp.c linux/drivers/scsi/esp.c
--- linux-2.2.20-pre3/drivers/scsi/esp.c	Sun Mar 25 08:31:32 2001
+++ linux/drivers/scsi/esp.c	Mon Dec  3 22:19:03 2001
@@ -3465,7 +3465,7 @@
 /* Target negotiates for synchronous transfers before we do, this
  * is legal although very strange.  What is even funnier is that
  * the SCSI2 standard specifically recommends against targets doing
- * this because so many initiators cannot cope with this occuring.
+ * this because so many initiators cannot cope with this occurring.
  */
 static int target_with_ants_in_pants(struct Sparc_ESP *esp,
 				     Scsi_Cmnd *SCptr,
diff -urN linux-2.2.20-pre3/drivers/scsi/gdth.h linux/drivers/scsi/gdth.h
--- linux-2.2.20-pre3/drivers/scsi/gdth.h	Sun Mar 25 08:37:36 2001
+++ linux/drivers/scsi/gdth.h	Mon Dec  3 22:19:03 2001
@@ -891,7 +891,7 @@
         unchar          ldr_no;                 /* log. drive no. */
         unchar          rw_attribs;             /* r/w attributes */
         unchar          cluster_type;           /* cluster properties */
-        unchar          media_changed;          /* Flag:MOUNT/UNMOUNT occured */
+        unchar          media_changed;          /* Flag:MOUNT/UNMOUNT occurred */
         ulong32         start_sec;              /* start sector */
     } hdr[MAX_LDRIVES];                         /* host drives */
     struct {
diff -urN linux-2.2.20-pre3/drivers/scsi/ips.c linux/drivers/scsi/ips.c
--- linux-2.2.20-pre3/drivers/scsi/ips.c	Sun Mar 25 08:31:34 2001
+++ linux/drivers/scsi/ips.c	Mon Dec  3 22:19:03 2001
@@ -4835,7 +4835,7 @@
       }
 
       if (j >= 45)
-         /* error occured */
+         /* error occurred */
          return (0);
 
       PostByte[i] = inb(ha->io_addr + IPS_REG_ISPR);
@@ -4859,7 +4859,7 @@
       }
 
       if (j >= 240)
-         /* error occured */
+         /* error occurred */
          return (0);
 
       ConfigByte[i] = inb(ha->io_addr + IPS_REG_ISPR);
@@ -4924,7 +4924,7 @@
       }
 
       if (j >= 45)
-         /* error occured */
+         /* error occurred */
          return (0);
 
       PostByte[i] = readb(ha->mem_ptr + IPS_REG_ISPR);
@@ -4948,7 +4948,7 @@
       }
 
       if (j >= 240)
-         /* error occured */
+         /* error occurred */
          return (0);
 
       ConfigByte[i] = readb(ha->mem_ptr + IPS_REG_ISPR);
@@ -4965,7 +4965,7 @@
    }
 
    if (i >= 240)
-      /* error occured */
+      /* error occurred */
       return (0);
 
    /* setup CCCR */
@@ -5015,7 +5015,7 @@
    }
 
    if (i >= 45) {
-      /* error occured */
+      /* error occurred */
       printk(KERN_WARNING "(%s%d) timeout waiting for post.\n",
              ips_name, ha->host_num);
 
@@ -5046,7 +5046,7 @@
    }
 
    if (i >= 240) {
-      /* error occured */
+      /* error occurred */
       printk(KERN_WARNING "(%s%d) timeout waiting for config.\n",
              ips_name, ha->host_num);
 
diff -urN linux-2.2.20-pre3/drivers/scsi/megaraid.c linux/drivers/scsi/megaraid.c
--- linux-2.2.20-pre3/drivers/scsi/megaraid.c	Sun Mar 25 08:31:33 2001
+++ linux/drivers/scsi/megaraid.c	Mon Dec  3 22:19:03 2001
@@ -1609,7 +1609,7 @@
 }
 
 /*--------------------------------------------------------------------
- * Initializes the adress of the controller's mailbox register
+ * Initializes the address of the controller's mailbox register
  *  The mailbox register is used to issue commands to the card.
  *  Format of the mailbox area:
  *   00 01 command
diff -urN linux-2.2.20-pre3/drivers/scsi/sd_ioctl.c linux/drivers/scsi/sd_ioctl.c
--- linux-2.2.20-pre3/drivers/scsi/sd_ioctl.c	Sun Mar 25 08:31:30 2001
+++ linux/drivers/scsi/sd_ioctl.c	Mon Dec  3 22:19:03 2001
@@ -57,6 +57,7 @@
         diskinfo[2] = rscsi_disks[DEVICE_NR(dev)].capacity >> 11;
 
 /* override with calculated, extended default, or driver values */
+/* this is the only call of hostt->bios_param() */
 
 	if(host->hostt->bios_param != NULL)
 	    host->hostt->bios_param(&rscsi_disks[DEVICE_NR(dev)],
diff -urN linux-2.2.20-pre3/drivers/scsi/sym53c8xx.c linux/drivers/scsi/sym53c8xx.c
--- linux-2.2.20-pre3/drivers/scsi/sym53c8xx.c	Sun Mar 25 08:31:33 2001
+++ linux/drivers/scsi/sym53c8xx.c	Mon Dec  3 22:19:03 2001
@@ -3646,7 +3646,7 @@
 	**	some target to reset or some disconnected 
 	**	job to abort. Since error recovery is a serious 
 	**	busyness, we will really reset the SCSI BUS, if 
-	**	case of a SCSI interrupt occuring in this path.
+	**	case of a SCSI interrupt occurring in this path.
 	*/
 
 	/*
@@ -8635,7 +8635,7 @@
 **		si:	sist
 **
 **	SCSI bus lines:
-**		so:	control lines as driver by NCR.
+**		so:	control lines as driven by NCR.
 **		si:	control lines as seen by NCR.
 **		sd:	scsi data lines as seen by NCR.
 **
@@ -8644,7 +8644,7 @@
 **		scntl3:	(see the manual)
 **
 **	current script command:
-**		dsp:	script adress (relative to start of script).
+**		dsp:	script address (relative to start of script).
 **		dbc:	first word of script command.
 **
 **	First 24 register of the chip:
diff -urN linux-2.2.20-pre3/drivers/scsi/sym53c8xx_defs.h linux/drivers/scsi/sym53c8xx_defs.h
--- linux-2.2.20-pre3/drivers/scsi/sym53c8xx_defs.h	Sun Mar 25 08:31:33 2001
+++ linux/drivers/scsi/sym53c8xx_defs.h	Mon Dec  3 22:19:03 2001
@@ -483,7 +483,7 @@
 #endif
 
 /*
- *  If the CPU and the NCR use same endian-ness adressing,
+ *  If the CPU and the NCR use same endian-ness addressing,
  *  no byte reordering is needed for script patching.
  *  Macro cpu_to_scr() is to be used for script patching.
  *  Macro scr_to_cpu() is to be used for getting a DWORD 
@@ -517,7 +517,7 @@
  *  would have been correctly designed for PCI, this 
  *  option would be useless.
  *
- *  If the CPU and the NCR use same endian-ness adressing,
+ *  If the CPU and the NCR use same endian-ness addressing,
  *  no byte reordering is needed for accessing chip io 
  *  registers. Functions suffixed by '_raw' are assumed 
  *  to access the chip over the PCI without doing byte 
diff -urN linux-2.2.20-pre3/drivers/sound/ad1848.c linux/drivers/sound/ad1848.c
--- linux-2.2.20-pre3/drivers/sound/ad1848.c	Sun Mar 25 08:31:34 2001
+++ linux/drivers/sound/ad1848.c	Wed Dec 31 16:00:00 1969
@@ -1,2761 +0,0 @@
-/*
- * sound/ad1848.c
- *
- * The low level driver for the AD1848/CS4248 codec chip which
- * is used for example in the MS Sound System.
- *
- * The CS4231 which is used in the GUS MAX and some other cards is
- * upwards compatible with AD1848 and this driver is able to drive it.
- *
- * CS4231A and AD1845 are upward compatible with CS4231. However
- * the new features of these chips are different.
- *
- * CS4232 is a PnP audio chip which contains a CS4231A (and SB, MPU).
- * CS4232A is an improved version of CS4232.
- *
- *
- *
- * Copyright (C) by Hannu Savolainen 1993-1997
- *
- * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
- * Version 2 (June 1991). See the "COPYING" file distributed with this software
- * for more info.
- *
- *
- * Thomas Sailer   : ioctl code reworked (vmalloc/vfree removed)
- *		     general sleep/wakeup clean up.
- * Alan Cox	   : reformatted. Fixed SMP bugs. Moved to kernel alloc/free
- *		     of irqs. Use dev_id.
- *
- * Status:
- *		Tested. Believed fully functional.
- */
-
-#include <linux/config.h>
-#include <linux/module.h>
-#include <linux/stddef.h>
-
-#include "soundmodule.h"
-
-#define DEB(x)
-#define DEB1(x)
-#include "sound_config.h"
-
-#ifdef CONFIG_AD1848
-
-#include "ad1848_mixer.h"
-
-typedef struct
-{
-	int             base;
-	int             irq;
-	int             dma1, dma2;
-	int             dual_dma;	/* 1, when two DMA channels allocated */
-	unsigned char   MCE_bit;
-	unsigned char   saved_regs[32];
-	int             debug_flag;
-
-	int             audio_flags;
-	int             record_dev, playback_dev;
-
-	int             xfer_count;
-	int             audio_mode;
-	int             open_mode;
-	int             intr_active;
-	char           *chip_name, *name;
-	int             model;
-#define MD_1848		1
-#define MD_4231		2
-#define MD_4231A	3
-#define MD_1845		4
-#define MD_4232		5
-#define MD_C930		6
-#define MD_IWAVE	7
-#define MD_4235         8 /* Crystal Audio CS4235  */
-#define MD_1845_SSCAPE  9 /* Ensoniq Soundscape PNP*/
-
-	/* Mixer parameters */
-	int             recmask;
-	int             supported_devices, orig_devices;
-	int             supported_rec_devices, orig_rec_devices;
-	int            *levels;
-	short           mixer_reroute[32];
-	int             dev_no;
-	volatile unsigned long timer_ticks;
-	int             timer_running;
-	int             irq_ok;
-	mixer_ents     *mix_devices;
-	int             mixer_output_port;
-} ad1848_info;
-
-typedef struct ad1848_port_info
-{
-	int             open_mode;
-	int             speed;
-	unsigned char   speed_bits;
-	int             channels;
-	int             audio_format;
-	unsigned char   format_bits;
-}
-ad1848_port_info;
-
-static int nr_ad1848_devs = 0;
-int deskpro_xl = 0;
-int deskpro_m = 0;
-#ifdef CONFIG_SOUND_SPRO
-int soundpro = 1;
-#else
-int soundpro = 0;
-#endif
-
-static volatile signed char irq2dev[17] = {
-	-1, -1, -1, -1, -1, -1, -1, -1,
-	-1, -1, -1, -1, -1, -1, -1, -1, -1
-};
-
-#if defined(CONFIG_SEQUENCER) && !defined(EXCLUDE_TIMERS) || defined(MODULE)
-
-static int timer_installed = -1;
-
-#endif
-
-static int ad_format_mask[10 /*devc->model */ ] =
-{
-	0,
-	AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW,
-	AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
-	AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
-	AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW,	/* AD1845 */
-	AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
-	AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
-	AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
-	AFMT_U8 | AFMT_S16_LE /* CS4235 */,
-	AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW	/* Ensoniq Soundscape*/
-};
-
-static ad1848_info adev_info[MAX_AUDIO_DEV];
-
-#define io_Index_Addr(d)	((d)->base)
-#define io_Indexed_Data(d)	((d)->base+1)
-#define io_Status(d)		((d)->base+2)
-#define io_Polled_IO(d)		((d)->base+3)
-
-static struct {
-     unsigned char flags;
-#define CAP_F_TIMER 0x01     
-} capabilities [10 /*devc->model */ ] = {
-     {0}
-    ,{0}           /* MD_1848  */
-    ,{CAP_F_TIMER} /* MD_4231  */
-    ,{CAP_F_TIMER} /* MD_4231A */
-    ,{CAP_F_TIMER} /* MD_1845  */
-    ,{CAP_F_TIMER} /* MD_4232  */
-    ,{0}           /* MD_C930  */
-    ,{CAP_F_TIMER} /* MD_IWAVE */
-    ,{0}           /* MD_4235  */
-    ,{CAP_F_TIMER} /* MD_1845_SSCAPE */
-};
-
-static int      ad1848_open(int dev, int mode);
-static void     ad1848_close(int dev);
-static void     ad1848_output_block(int dev, unsigned long buf, int count, int intrflag);
-static void     ad1848_start_input(int dev, unsigned long buf, int count, int intrflag);
-static int      ad1848_prepare_for_output(int dev, int bsize, int bcount);
-static int      ad1848_prepare_for_input(int dev, int bsize, int bcount);
-static void     ad1848_halt(int dev);
-static void     ad1848_halt_input(int dev);
-static void     ad1848_halt_output(int dev);
-static void     ad1848_trigger(int dev, int bits);
-
-#if defined(CONFIG_SEQUENCER) && !defined(EXCLUDE_TIMERS)
-static int ad1848_tmr_install(int dev);
-static void ad1848_tmr_reprogram(int dev);
-
-#endif
-
-static int ad_read(ad1848_info * devc, int reg)
-{
-	unsigned long flags;
-	int x;
-	int timeout = 900000;
-
-	while (timeout > 0 && inb(devc->base) == 0x80)	/*Are we initializing */
-		timeout--;
-
-	save_flags(flags);
-	cli();
-	outb(((unsigned char) (reg & 0xff) | devc->MCE_bit), io_Index_Addr(devc));
-	x = inb(io_Indexed_Data(devc));
-/* printk("(%02x<-%02x) ", reg|devc->MCE_bit, x); */
-	restore_flags(flags);
-
-	return x;
-}
-
-static void ad_write(ad1848_info * devc, int reg, int data)
-{
-	unsigned long flags;
-	int timeout = 900000;
-
-	while (timeout > 0 && inb(devc->base) == 0x80)	/* Are we initializing */
-		timeout--;
-
-	save_flags(flags);
-	cli();
-	outb(((unsigned char) (reg & 0xff) | devc->MCE_bit), io_Index_Addr(devc));
-	outb(((unsigned char) (data & 0xff)), io_Indexed_Data(devc));
-	/* printk("(%02x->%02x) ", reg|devc->MCE_bit, data); */
-	restore_flags(flags);
-}
-
-static void wait_for_calibration(ad1848_info * devc)
-{
-	int timeout = 0;
-
-	/*
-	 * Wait until the auto calibration process has finished.
-	 *
-	 * 1)       Wait until the chip becomes ready (reads don't return 0x80).
-	 * 2)       Wait until the ACI bit of I11 gets on and then off.
-	 */
-
-	timeout = 100000;
-	while (timeout > 0 && inb(devc->base) == 0x80)
-		timeout--;
-	if (inb(devc->base) & 0x80)
-		printk(KERN_WARNING "ad1848: Auto calibration timed out(1).\n");
-
-	timeout = 100;
-	while (timeout > 0 && !(ad_read(devc, 11) & 0x20))
-		timeout--;
-	if (!(ad_read(devc, 11) & 0x20))
-		return;
-
-	timeout = 80000;
-	while (timeout > 0 && (ad_read(devc, 11) & 0x20))
-		timeout--;
-	if (ad_read(devc, 11) & 0x20)
-		if ( (devc->model != MD_1845) || (devc->model != MD_1845_SSCAPE))
-			printk(KERN_WARNING "ad1848: Auto calibration timed out(3).\n");
-}
-
-static void ad_mute(ad1848_info * devc)
-{
-	int i;
-	unsigned char prev;
-
-	/*
-	 * Save old register settings and mute output channels
-	 */
-	 
-	for (i = 6; i < 8; i++)
-	{
-		prev = devc->saved_regs[i] = ad_read(devc, i);
-	}
-
-}
-
-static void ad_unmute(ad1848_info * devc)
-{
-}
-
-static void ad_enter_MCE(ad1848_info * devc)
-{
-	unsigned long flags;
-	int timeout = 1000;
-	unsigned short prev;
-
-	while (timeout > 0 && inb(devc->base) == 0x80)	/*Are we initializing */
-		timeout--;
-
-	save_flags(flags);
-	cli();
-
-	devc->MCE_bit = 0x40;
-	prev = inb(io_Index_Addr(devc));
-	if (prev & 0x40)
-	{
-		restore_flags(flags);
-		return;
-	}
-	outb((devc->MCE_bit), io_Index_Addr(devc));
-	restore_flags(flags);
-}
-
-static void ad_leave_MCE(ad1848_info * devc)
-{
-	unsigned long flags;
-	unsigned char prev, acal;
-	int timeout = 1000;
-
-	while (timeout > 0 && inb(devc->base) == 0x80)	/*Are we initializing */
-		timeout--;
-
-	save_flags(flags);
-	cli();
-
-	acal = ad_read(devc, 9);
-
-	devc->MCE_bit = 0x00;
-	prev = inb(io_Index_Addr(devc));
-	outb((0x00), io_Index_Addr(devc));	/* Clear the MCE bit */
-
-	if ((prev & 0x40) == 0)	/* Not in MCE mode */
-	{
-		restore_flags(flags);
-		return;
-	}
-	outb((0x00), io_Index_Addr(devc));	/* Clear the MCE bit */
-	if (acal & 0x08)	/* Auto calibration is enabled */
-		wait_for_calibration(devc);
-	restore_flags(flags);
-}
-
-static int ad1848_set_recmask(ad1848_info * devc, int mask)
-{
-	unsigned char   recdev;
-	int             i, n;
-
-	mask &= devc->supported_rec_devices;
-
-	/* Rename the mixer bits if necessary */
-	for (i = 0; i < 32; i++)
-	{
-		if (devc->mixer_reroute[i] != i)
-		{
-			if (mask & (1 << i))
-			{
-				mask &= ~(1 << i);
-				mask |= (1 << devc->mixer_reroute[i]);
-			}
-		}
-	}
-	
-	n = 0;
-	for (i = 0; i < 32; i++)	/* Count selected device bits */
-		if (mask & (1 << i))
-			n++;
-
-	if (!soundpro) {
-		if (n == 0)
-			mask = SOUND_MASK_MIC;
-		else if (n != 1) {	/* Too many devices selected */
-			mask &= ~devc->recmask;	/* Filter out active settings */
-
-			n = 0;
-			for (i = 0; i < 32; i++)	/* Count selected device bits */
-				if (mask & (1 << i))
-					n++;
-
-			if (n != 1)
-				mask = SOUND_MASK_MIC;
-		}
-		switch (mask) {
-		case SOUND_MASK_MIC:
-			recdev = 2;
-			break;
-
-		case SOUND_MASK_LINE:
-		case SOUND_MASK_LINE3:
-			recdev = 0;
-			break;
-
-		case SOUND_MASK_CD:
-		case SOUND_MASK_LINE1:
-			recdev = 1;
-			break;
-
-		case SOUND_MASK_IMIX:
-			recdev = 3;
-			break;
-
-		default:
-			mask = SOUND_MASK_MIC;
-			recdev = 2;
-		}
-
-		recdev <<= 6;
-		ad_write(devc, 0, (ad_read(devc, 0) & 0x3f) | recdev);
-		ad_write(devc, 1, (ad_read(devc, 1) & 0x3f) | recdev);
-	} else { /* soundpro */
-		unsigned char val;
-		int set_rec_bit;
-		int j;
-
-		for (i = 0; i < 32; i++) {	/* For each bit */
-			if ((devc->supported_rec_devices & (1 << i)) == 0)
-				continue;	/* Device not supported */
-
-			for (j = LEFT_CHN; j <= RIGHT_CHN; j++) {
-				if (devc->mix_devices[i][j].nbits == 0) /* Inexistent channel */
-					continue;
-
-				/*
-				 * This is tricky:
-				 * set_rec_bit becomes 1 if the corresponding bit in mask is set
-				 * then it gets flipped if the polarity is inverse
-				 */
-				set_rec_bit = ((mask & (1 << i)) != 0) ^ devc->mix_devices[i][j].recpol;
-
-				val = ad_read(devc, devc->mix_devices[i][j].recreg);
-				val &= ~(1 << devc->mix_devices[i][j].recpos);
-				val |= (set_rec_bit << devc->mix_devices[i][j].recpos);
-				ad_write(devc, devc->mix_devices[i][j].recreg, val);
-			}
-		}
-	}
-
-	/* Rename the mixer bits back if necessary */
-	for (i = 0; i < 32; i++)
-	{
-		if (devc->mixer_reroute[i] != i)
-		{
-			if (mask & (1 << devc->mixer_reroute[i]))
-			{
-				mask &= ~(1 << devc->mixer_reroute[i]);
-				mask |= (1 << i);
-			}
-		}
-	}
-	devc->recmask = mask;
-	return mask;
-}
-
-static void change_bits(ad1848_info * devc, unsigned char *regval,
-			unsigned char *muteval, int dev, int chn, int newval)
-{
-	unsigned char mask;
-	int shift;
-	int mute;
-	int mutemask;
-	int set_mute_bit;
-
-	set_mute_bit = (newval == 0) ^ devc->mix_devices[dev][chn].mutepol;
-
-	if (devc->mix_devices[dev][chn].polarity == 1)	/* Reverse */
-		newval = 100 - newval;
-
-	mask = (1 << devc->mix_devices[dev][chn].nbits) - 1;
-	shift = devc->mix_devices[dev][chn].bitpos;
-
-	if (devc->mix_devices[dev][chn].mutepos == 8)
-	{			/* if there is no mute bit */
-		mute = 0;	/* No mute bit; do nothing special */
-		mutemask = ~0;	/* No mute bit; do nothing special */
-	}
-	else
-	{
-		mute = (set_mute_bit << devc->mix_devices[dev][chn].mutepos);
-		mutemask = ~(1 << devc->mix_devices[dev][chn].mutepos);
-	}
-
-	newval = (int) ((newval * mask) + 50) / 100;	/* Scale it */
-	*regval &= ~(mask << shift);			/* Clear bits */
-	*regval |= (newval & mask) << shift;		/* Set new value */
-
-	*muteval &= mutemask;
-	*muteval |= mute;
-}
-
-static int ad1848_mixer_get(ad1848_info * devc, int dev)
-{
-	if (!((1 << dev) & devc->supported_devices))
-		return -EINVAL;
-
-	dev = devc->mixer_reroute[dev];
-
-	return devc->levels[dev];
-}
-
-static void ad1848_mixer_set_channel(ad1848_info *devc, int dev, int value, int channel)
-{
-	int regoffs, muteregoffs;
-	unsigned char val, muteval;
-
-	regoffs = devc->mix_devices[dev][channel].regno;
-	muteregoffs = devc->mix_devices[dev][channel].mutereg;
-	val = ad_read(devc, regoffs);
-
-	if (muteregoffs != regoffs) {
-		muteval = ad_read(devc, muteregoffs);
-		change_bits(devc, &val, &muteval, dev, channel, value);
-	}
-	else
-		change_bits(devc, &val, &val, dev, channel, value);
-
-	ad_write(devc, regoffs, val);
-	devc->saved_regs[regoffs] = val;
-	if (muteregoffs != regoffs) {
-		ad_write(devc, muteregoffs, muteval);
-		devc->saved_regs[muteregoffs] = muteval;
-	}
-}
-
-static int ad1848_mixer_set(ad1848_info * devc, int dev, int value)
-{
-	int left = value & 0x000000ff;
-	int right = (value & 0x0000ff00) >> 8;
-	int retvol;
-
-	if (dev > 31)
-		return -EINVAL;
-
-	if (!(devc->supported_devices & (1 << dev)))
-		return -EINVAL;
-
-	dev = devc->mixer_reroute[dev];
-
-	if (devc->mix_devices[dev][LEFT_CHN].nbits == 0)
-		return -EINVAL;
-
-	if (left > 100)
-		left = 100;
-	if (right > 100)
-		right = 100;
-
-	if (devc->mix_devices[dev][RIGHT_CHN].nbits == 0)	/* Mono control */
-		right = left;
-
-	retvol = left | (right << 8);
-
-	/* Scale volumes */
-	left = mix_cvt[left];
-	right = mix_cvt[right];
-
-	devc->levels[dev] = retvol;
-
-	/*
-	 * Set the left channel
-	 */
-	ad1848_mixer_set_channel(devc, dev, left, LEFT_CHN);
-
-	/*
-	 * Set the right channel
-	 */
-	if (devc->mix_devices[dev][RIGHT_CHN].nbits == 0)
-		goto out;
-	ad1848_mixer_set_channel(devc, dev, right, RIGHT_CHN);
-
- out:
-	return retvol;
-}
-
-static void ad1848_mixer_reset(ad1848_info * devc)
-{
-	int i;
-	char name[32];
-
-	devc->mix_devices = &(ad1848_mix_devices[0]);
-
-	sprintf(name, "%s_%d", devc->chip_name, nr_ad1848_devs);
-
-	for (i = 0; i < 32; i++)
-		devc->mixer_reroute[i] = i;
-
-	devc->supported_rec_devices = MODE1_REC_DEVICES;
-
-	switch (devc->model)
-	{
-		case MD_4231:
-		case MD_4231A:
-		case MD_1845:
-		case MD_1845_SSCAPE:
-			devc->supported_devices = MODE2_MIXER_DEVICES;
-			break;
-
-		case MD_C930:
-			devc->supported_devices = C930_MIXER_DEVICES;
-			devc->mix_devices = &(c930_mix_devices[0]);
-			break;
-
-		case MD_IWAVE:
-			devc->supported_devices = MODE3_MIXER_DEVICES;
-			devc->mix_devices = &(iwave_mix_devices[0]);
-			break;
-
-		case MD_4232:
-			devc->supported_devices = MODE3_MIXER_DEVICES;
-			break;
-
-		case MD_1848:
-			if (soundpro) {
-				devc->supported_devices = SPRO_MIXER_DEVICES;
-				devc->supported_rec_devices = SPRO_REC_DEVICES;
-				devc->mix_devices = &(spro_mix_devices[0]);
-				break;
-			}
-
-		default:
-			devc->supported_devices = MODE1_MIXER_DEVICES;
-	}
-
-	devc->orig_devices = devc->supported_devices;
-	devc->orig_rec_devices = devc->supported_rec_devices;
-
-	devc->levels = load_mixer_volumes(name, default_mixer_levels, 1);
-
-	for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
-	{
-		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 (!soundpro) {
-		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 */
-	} else {
-		/*
-		 * From the "wouldn't it be nice if the mixer API had (better)
-		 * support for custom stuff" category
-		 */
-		/* Enable surround mode and SB16 mixer */
-		ad_write(devc, 16, 0x60);
-	}
-}
-
-static int ad1848_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
-{
-	ad1848_info *devc = mixer_devs[dev]->devc;
-	int val;
-
-	if (cmd == SOUND_MIXER_PRIVATE1) 
-	{
-		if (get_user(val, (int *)arg))
-			return -EFAULT;
-
-		if (val != 0xffff) 
-		{
-			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 */
-		}
-		val = devc->mixer_output_port;
-		return put_user(val, (int *)arg);
-	}
-	if (cmd == SOUND_MIXER_PRIVATE2)
-	{
-		if (get_user(val, (int *)arg))
-			return -EFAULT;
-		return(ad1848_control(AD1848_MIXER_REROUTE, val));
-	}
-	if (((cmd >> 8) & 0xff) == 'M') 
-	{
-		if (_SIOC_DIR(cmd) & _SIOC_WRITE)
-		{
-			switch (cmd & 0xff) 
-			{
-				case SOUND_MIXER_RECSRC:
-					if (get_user(val, (int *)arg))
-						return -EFAULT;
-					val = ad1848_set_recmask(devc, val);
-					break;
-				
-				default:
-					if (get_user(val, (int *)arg))
-					return -EFAULT;
-					val = ad1848_mixer_set(devc, cmd & 0xff, val);
-					break;
-			} 
-			return put_user(val, (int *)arg);
-		}
-		else
-		{
-			switch (cmd & 0xff) 
-			{
-				/*
-				 * Return parameters
-				 */
-			    
-				case SOUND_MIXER_RECSRC:
-					val = devc->recmask;
-					break;
-				
-				case SOUND_MIXER_DEVMASK:
-					val = devc->supported_devices;
-					break;
-				
-				case SOUND_MIXER_STEREODEVS:
-					val = devc->supported_devices;
-					if (devc->model != MD_C930)
-						val &= ~(SOUND_MASK_SPEAKER | SOUND_MASK_IMIX);
-					break;
-				
-				case SOUND_MIXER_RECMASK:
-					val = devc->supported_rec_devices;
-					break;
-
-				case SOUND_MIXER_CAPS:
-					val=SOUND_CAP_EXCL_INPUT;
-					break;
-
-				default:
-					val = ad1848_mixer_get(devc, cmd & 0xff);
-					break;
-			}
-			return put_user(val, (int *)arg);
-		}
-	}
-	else
-		return -EINVAL;
-}
-
-static int ad1848_set_speed(int dev, int arg)
-{
-	ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc;
-	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
-
-	/*
-	 * The sampling speed is encoded in the least significant nibble of I8. The
-	 * LSB selects the clock source (0=24.576 MHz, 1=16.9344 MHz) and other
-	 * three bits select the divisor (indirectly):
-	 *
-	 * The available speeds are in the following table. Keep the speeds in
-	 * the increasing order.
-	 */
-	typedef struct
-	{
-		int             speed;
-		unsigned char   bits;
-	}
-	speed_struct;
-
-	static speed_struct speed_table[] =
-	{
-		{5510, (0 << 1) | 1},
-		{5510, (0 << 1) | 1},
-		{6620, (7 << 1) | 1},
-		{8000, (0 << 1) | 0},
-		{9600, (7 << 1) | 0},
-		{11025, (1 << 1) | 1},
-		{16000, (1 << 1) | 0},
-		{18900, (2 << 1) | 1},
-		{22050, (3 << 1) | 1},
-		{27420, (2 << 1) | 0},
-		{32000, (3 << 1) | 0},
-		{33075, (6 << 1) | 1},
-		{37800, (4 << 1) | 1},
-		{44100, (5 << 1) | 1},
-		{48000, (6 << 1) | 0}
-	};
-
-	int i, n, selected = -1;
-
-	n = sizeof(speed_table) / sizeof(speed_struct);
-
-	if (arg <= 0)
-		return portc->speed;
-
-	if (devc->model == MD_1845 || devc->model == MD_1845_SSCAPE)	/* AD1845 has different timer than others */
-	{
-		if (arg < 4000)
-			arg = 4000;
-		if (arg > 50000)
-			arg = 50000;
-
-		portc->speed = arg;
-		portc->speed_bits = speed_table[3].bits;
-		return portc->speed;
-	}
-	if (arg < speed_table[0].speed)
-		selected = 0;
-	if (arg > speed_table[n - 1].speed)
-		selected = n - 1;
-
-	for (i = 1 /*really */ ; selected == -1 && i < n; i++)
-	{
-		if (speed_table[i].speed == arg)
-			selected = i;
-		else if (speed_table[i].speed > arg)
-		{
-			int diff1, diff2;
-
-			diff1 = arg - speed_table[i - 1].speed;
-			diff2 = speed_table[i].speed - arg;
-
-			if (diff1 < diff2)
-				selected = i - 1;
-			else
-				selected = i;
-		}
-	}
-	if (selected == -1)
-	{
-		printk(KERN_WARNING "ad1848: Can't find speed???\n");
-		selected = 3;
-	}
-	portc->speed = speed_table[selected].speed;
-	portc->speed_bits = speed_table[selected].bits;
-	return portc->speed;
-}
-
-static short ad1848_set_channels(int dev, short arg)
-{
-	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
-
-	if (arg != 1 && arg != 2)
-		return portc->channels;
-
-	portc->channels = arg;
-	return arg;
-}
-
-static unsigned int ad1848_set_bits(int dev, unsigned int arg)
-{
-	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
-	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
-
-	static struct format_tbl
-	{
-		  int             format;
-		  unsigned char   bits;
-	}
-	format2bits[] =
-	{
-		{
-			0, 0
-		}
-		,
-		{
-			AFMT_MU_LAW, 1
-		}
-		,
-		{
-			AFMT_A_LAW, 3
-		}
-		,
-		{
-			AFMT_IMA_ADPCM, 5
-		}
-		,
-		{
-			AFMT_U8, 0
-		}
-		,
-		{
-			AFMT_S16_LE, 2
-		}
-		,
-		{
-			AFMT_S16_BE, 6
-		}
-		,
-		{
-			AFMT_S8, 0
-		}
-		,
-		{
-			AFMT_U16_LE, 0
-		}
-		,
-		{
-			AFMT_U16_BE, 0
-		}
-	};
-	int i, n = sizeof(format2bits) / sizeof(struct format_tbl);
-
-	if (arg == 0)
-		return portc->audio_format;
-
-	if (!(arg & ad_format_mask[devc->model]))
-		arg = AFMT_U8;
-
-	portc->audio_format = arg;
-
-	for (i = 0; i < n; i++)
-		if (format2bits[i].format == arg)
-		{
-			if ((portc->format_bits = format2bits[i].bits) == 0)
-				return portc->audio_format = AFMT_U8;		/* Was not supported */
-
-			return arg;
-		}
-	/* Still hanging here. Something must be terribly wrong */
-	portc->format_bits = 0;
-	return portc->audio_format = AFMT_U8;
-}
-
-static struct audio_driver ad1848_audio_driver =
-{
-	ad1848_open,
-	ad1848_close,
-	ad1848_output_block,
-	ad1848_start_input,
-	NULL,
-	ad1848_prepare_for_input,
-	ad1848_prepare_for_output,
-	ad1848_halt,
-	NULL,
-	NULL,
-	ad1848_halt_input,
-	ad1848_halt_output,
-	ad1848_trigger,
-	ad1848_set_speed,
-	ad1848_set_bits,
-	ad1848_set_channels
-};
-
-static struct mixer_operations ad1848_mixer_operations =
-{
-	"SOUNDPORT",
-	"AD1848/CS4248/CS4231",
-	ad1848_mixer_ioctl
-};
-
-static int ad1848_open(int dev, int mode)
-{
-	ad1848_info    *devc = NULL;
-	ad1848_port_info *portc;
-	unsigned long   flags;
-
-	if (dev < 0 || dev >= num_audiodevs)
-		return -ENXIO;
-
-	devc = (ad1848_info *) audio_devs[dev]->devc;
-	portc = (ad1848_port_info *) audio_devs[dev]->portc;
-
-	save_flags(flags);
-	cli();
-	if (portc->open_mode || (devc->open_mode & mode))
-	{
-		restore_flags(flags);
-		return -EBUSY;
-	}
-	devc->dual_dma = 0;
-
-	if (audio_devs[dev]->flags & DMA_DUPLEX)
-	{
-		devc->dual_dma = 1;
-	}
-	devc->intr_active = 0;
-	devc->audio_mode = 0;
-	devc->open_mode |= mode;
-	portc->open_mode = mode;
-	ad1848_trigger(dev, 0);
-
-	if (mode & OPEN_READ)
-		devc->record_dev = dev;
-	if (mode & OPEN_WRITE)
-		devc->playback_dev = dev;
-	restore_flags(flags);
-/*
- * Mute output until the playback really starts. This decreases clicking (hope so).
- */
-	ad_mute(devc);
-
-	return 0;
-}
-
-static void ad1848_close(int dev)
-{
-	unsigned long   flags;
-	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
-	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
-
-	DEB(printk("ad1848_close(void)\n"));
-
-	save_flags(flags);
-	cli();
-
-	devc->intr_active = 0;
-	ad1848_halt(dev);
-
-	devc->audio_mode = 0;
-	devc->open_mode &= ~portc->open_mode;
-	portc->open_mode = 0;
-
-	ad_unmute(devc);
-	restore_flags(flags);
-}
-
-static void ad1848_output_block(int dev, unsigned long buf, int count, int intrflag)
-{
-	unsigned long   flags, cnt;
-	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
-	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
-
-	cnt = count;
-
-	if (portc->audio_format == AFMT_IMA_ADPCM)
-	{
-		cnt /= 4;
-	}
-	else
-	{
-		if (portc->audio_format & (AFMT_S16_LE | AFMT_S16_BE))	/* 16 bit data */
-			cnt >>= 1;
-	}
-	if (portc->channels > 1)
-		cnt >>= 1;
-	cnt--;
-
-	if ((devc->audio_mode & PCM_ENABLE_OUTPUT) && (audio_devs[dev]->flags & DMA_AUTOMODE) &&
-	    intrflag &&
-	    cnt == devc->xfer_count)
-	{
-		devc->audio_mode |= PCM_ENABLE_OUTPUT;
-		devc->intr_active = 1;
-		return;	/*
-			 * Auto DMA mode on. No need to react
-			 */
-	}
-	save_flags(flags);
-	cli();
-
-	ad_write(devc, 15, (unsigned char) (cnt & 0xff));
-	ad_write(devc, 14, (unsigned char) ((cnt >> 8) & 0xff));
-
-	devc->xfer_count = cnt;
-	devc->audio_mode |= PCM_ENABLE_OUTPUT;
-	devc->intr_active = 1;
-	restore_flags(flags);
-}
-
-static void ad1848_start_input(int dev, unsigned long buf, int count, int intrflag)
-{
-	unsigned long   flags, cnt;
-	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
-	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
-
-	cnt = count;
-	if (portc->audio_format == AFMT_IMA_ADPCM)
-	{
-		cnt /= 4;
-	}
-	else
-	{
-		if (portc->audio_format & (AFMT_S16_LE | AFMT_S16_BE))	/* 16 bit data */
-			cnt >>= 1;
-	}
-	if (portc->channels > 1)
-		cnt >>= 1;
-	cnt--;
-
-	if ((devc->audio_mode & PCM_ENABLE_INPUT) && (audio_devs[dev]->flags & DMA_AUTOMODE) &&
-		intrflag &&
-		cnt == devc->xfer_count)
-	{
-		devc->audio_mode |= PCM_ENABLE_INPUT;
-		devc->intr_active = 1;
-		return;	/*
-			 * Auto DMA mode on. No need to react
-			 */
-	}
-	save_flags(flags);
-	cli();
-
-	if (devc->model == MD_1848)
-	{
-		  ad_write(devc, 15, (unsigned char) (cnt & 0xff));
-		  ad_write(devc, 14, (unsigned char) ((cnt >> 8) & 0xff));
-	}
-	else
-	{
-		  ad_write(devc, 31, (unsigned char) (cnt & 0xff));
-		  ad_write(devc, 30, (unsigned char) ((cnt >> 8) & 0xff));
-	}
-
-	ad_unmute(devc);
-
-	devc->xfer_count = cnt;
-	devc->audio_mode |= PCM_ENABLE_INPUT;
-	devc->intr_active = 1;
-	restore_flags(flags);
-}
-
-static int ad1848_prepare_for_output(int dev, int bsize, int bcount)
-{
-	int             timeout;
-	unsigned char   fs, old_fs, tmp = 0;
-	unsigned long   flags;
-	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
-	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
-
-	ad_mute(devc);
-
-	save_flags(flags);
-	cli();
-	fs = portc->speed_bits | (portc->format_bits << 5);
-
-	if (portc->channels > 1)
-		fs |= 0x10;
-
-	ad_enter_MCE(devc);	/* Enables changes to the format select reg */
-
-	if (devc->model == MD_1845 || devc->model == MD_1845_SSCAPE) /* Use alternate speed select registers */
-	{
-		fs &= 0xf0;	/* Mask off the rate select bits */
-
-		ad_write(devc, 22, (portc->speed >> 8) & 0xff);	/* Speed MSB */
-		ad_write(devc, 23, portc->speed & 0xff);	/* Speed LSB */
-	}
-	old_fs = ad_read(devc, 8);
-
-	if (devc->model == MD_4232)
-	{
-		tmp = ad_read(devc, 16);
-		ad_write(devc, 16, tmp | 0x30);
-	}
-	if (devc->model == MD_IWAVE)
-		ad_write(devc, 17, 0xc2);	/* Disable variable frequency select */
-
-	ad_write(devc, 8, fs);
-
-	/*
-	 * Write to I8 starts resynchronization. Wait until it completes.
-	 */
-
-	timeout = 0;
-	while (timeout < 100 && inb(devc->base) != 0x80)
-		timeout++;
-	timeout = 0;
-	while (timeout < 10000 && inb(devc->base) == 0x80)
-		timeout++;
-
-	if (devc->model == MD_4232)
-		ad_write(devc, 16, tmp & ~0x30);
-
-	ad_leave_MCE(devc);	/*
-				 * Starts the calibration process.
-				 */
-	restore_flags(flags);
-	devc->xfer_count = 0;
-
-#if defined(CONFIG_SEQUENCER) && !defined(EXCLUDE_TIMERS)
-	if (dev == timer_installed && devc->timer_running)
-		if ((fs & 0x01) != (old_fs & 0x01))
-		{
-			ad1848_tmr_reprogram(dev);
-		}
-#endif
-	ad1848_halt_output(dev);
-	return 0;
-}
-
-static int ad1848_prepare_for_input(int dev, int bsize, int bcount)
-{
-	int timeout;
-	unsigned char fs, old_fs, tmp = 0;
-	unsigned long flags;
-	ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc;
-	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
-
-	if (devc->audio_mode)
-		return 0;
-
-	save_flags(flags);
-	cli();
-	fs = portc->speed_bits | (portc->format_bits << 5);
-
-	if (portc->channels > 1)
-		fs |= 0x10;
-
-	ad_enter_MCE(devc);	/* Enables changes to the format select reg */
-
-	if ((devc->model == MD_1845) || (devc->model == MD_1845_SSCAPE))	/* Use alternate speed select registers */
-	{
-		fs &= 0xf0;	/* Mask off the rate select bits */
-
-		ad_write(devc, 22, (portc->speed >> 8) & 0xff);	/* Speed MSB */
-		ad_write(devc, 23, portc->speed & 0xff);	/* Speed LSB */
-	}
-	if (devc->model == MD_4232)
-	{
-		tmp = ad_read(devc, 16);
-		ad_write(devc, 16, tmp | 0x30);
-	}
-	if (devc->model == MD_IWAVE)
-		ad_write(devc, 17, 0xc2);	/* Disable variable frequency select */
-
-	/*
-	 * If mode >= 2 (CS4231), set I28. It's the capture format register.
-	 */
-	
-	if (devc->model != MD_1848)
-	{
-		old_fs = ad_read(devc, 28);
-		ad_write(devc, 28, fs);
-
-		/*
-		 * Write to I28 starts resynchronization. Wait until it completes.
-		 */
-		
-		timeout = 0;
-		while (timeout < 100 && inb(devc->base) != 0x80)
-			timeout++;
-
-		timeout = 0;
-		while (timeout < 10000 && inb(devc->base) == 0x80)
-			timeout++;
-
-		if (devc->model != MD_1848 && devc->model != MD_1845 && devc->model != MD_1845_SSCAPE)
-		{
-			/*
-			 * CS4231 compatible devices don't have separate sampling rate selection
-			 * register for recording an playback. The I8 register is shared so we have to
-			 * set the speed encoding bits of it too.
-			 */
-			unsigned char   tmp = portc->speed_bits | (ad_read(devc, 8) & 0xf0);
-
-			ad_write(devc, 8, tmp);
-			/*
-			 * Write to I8 starts resynchronization. Wait until it completes.
-			 */
-			timeout = 0;
-			while (timeout < 100 && inb(devc->base) != 0x80)
-				timeout++;
-
-			timeout = 0;
-			while (timeout < 10000 && inb(devc->base) == 0x80)
-				timeout++;
-		}
-	}
-	else
-	{			/* For AD1848 set I8. */
-
-		old_fs = ad_read(devc, 8);
-		ad_write(devc, 8, fs);
-		/*
-		 * Write to I8 starts resynchronization. Wait until it completes.
-		 */
-		timeout = 0;
-		while (timeout < 100 && inb(devc->base) != 0x80)
-			timeout++;
-		timeout = 0;
-		while (timeout < 10000 && inb(devc->base) == 0x80)
-			timeout++;
-	}
-
-	if (devc->model == MD_4232)
-		ad_write(devc, 16, tmp & ~0x30);
-
-	ad_leave_MCE(devc);	/*
-				 * Starts the calibration process.
-				 */
-	restore_flags(flags);
-	devc->xfer_count = 0;
-
-#if defined(CONFIG_SEQUENCER) && !defined(EXCLUDE_TIMERS)
-	if (dev == timer_installed && devc->timer_running)
-	{
-		if ((fs & 0x01) != (old_fs & 0x01))
-		{
-			ad1848_tmr_reprogram(dev);
-		}
-	}
-#endif
-	ad1848_halt_input(dev);
-	return 0;
-}
-
-static void ad1848_halt(int dev)
-{
-	ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc;
-	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
-
-	unsigned char   bits = ad_read(devc, 9);
-
-	if (bits & 0x01 && (portc->open_mode & OPEN_WRITE))
-		ad1848_halt_output(dev);
-
-	if (bits & 0x02 && (portc->open_mode & OPEN_READ))
-		ad1848_halt_input(dev);
-	devc->audio_mode = 0;
-}
-
-static void ad1848_halt_input(int dev)
-{
-	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
-	unsigned long   flags;
-
-	if (!(ad_read(devc, 9) & 0x02))
-		return;		/* Capture not enabled */
-
-	save_flags(flags);
-	cli();
-
-	ad_mute(devc);
-
-	{
-		int             tmout;
-		
-		if(!isa_dma_bridge_buggy)
-		        disable_dma(audio_devs[dev]->dmap_in->dma);
-
-		for (tmout = 0; tmout < 100000; tmout++)
-			if (ad_read(devc, 11) & 0x10)
-				break;
-		ad_write(devc, 9, ad_read(devc, 9) & ~0x02);	/* Stop capture */
-
-		if(!isa_dma_bridge_buggy)
-		        enable_dma(audio_devs[dev]->dmap_in->dma);
-		devc->audio_mode &= ~PCM_ENABLE_INPUT;
-	}
-
-	outb(0, io_Status(devc));	/* Clear interrupt status */
-	outb(0, io_Status(devc));	/* Clear interrupt status */
-
-	devc->audio_mode &= ~PCM_ENABLE_INPUT;
-
-	restore_flags(flags);
-}
-
-static void ad1848_halt_output(int dev)
-{
-	ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc;
-	unsigned long flags;
-
-	if (!(ad_read(devc, 9) & 0x01))
-		return;		/* Playback not enabled */
-
-	save_flags(flags);
-	cli();
-
-	ad_mute(devc);
-	{
-		int             tmout;
-
-		if(!isa_dma_bridge_buggy)
-		        disable_dma(audio_devs[dev]->dmap_out->dma);
-
-		for (tmout = 0; tmout < 100000; tmout++)
-			if (ad_read(devc, 11) & 0x10)
-				break;
-		ad_write(devc, 9, ad_read(devc, 9) & ~0x01);	/* Stop playback */
-
-		if(!isa_dma_bridge_buggy)
-		       enable_dma(audio_devs[dev]->dmap_out->dma);
-
-		devc->audio_mode &= ~PCM_ENABLE_OUTPUT;
-	}
-
-	outb((0), io_Status(devc));	/* Clear interrupt status */
-	outb((0), io_Status(devc));	/* Clear interrupt status */
-
-	devc->audio_mode &= ~PCM_ENABLE_OUTPUT;
-
-	restore_flags(flags);
-}
-
-static void ad1848_trigger(int dev, int state)
-{
-	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
-	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
-	unsigned long   flags;
-	unsigned char   tmp, old;
-
-	save_flags(flags);
-	cli();
-	state &= devc->audio_mode;
-
-	tmp = old = ad_read(devc, 9);
-
-	if (portc->open_mode & OPEN_READ)
-	{
-		  if (state & PCM_ENABLE_INPUT)
-			  tmp |= 0x02;
-		  else
-			  tmp &= ~0x02;
-	}
-	if (portc->open_mode & OPEN_WRITE)
-	{
-		if (state & PCM_ENABLE_OUTPUT)
-			tmp |= 0x01;
-		else
-			tmp &= ~0x01;
-	}
-	/* ad_mute(devc); */
-	if (tmp != old)
-	{
-		  ad_write(devc, 9, tmp);
-		  ad_unmute(devc);
-	}
-	restore_flags(flags);
-}
-
-static void ad1848_init_hw(ad1848_info * devc)
-{
-	int i;
-
-	/*
-	 * Initial values for the indirect registers of CS4248/AD1848.
-	 */
-	static int      init_values[] =
-	{
-		0xa8, 0xa8, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
-		0x00, 0x0c, 0x02, 0x00, 0x8a, 0x01, 0x00, 0x00,
-
-	/* Positions 16 to 31 just for CS4231/2 and ad1845 */
-		0x80, 0x00, 0x10, 0x10, 0x00, 0x00, 0x1f, 0x40,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-	};
-
-
-	for (i = 0; i < 16; i++)
-		ad_write(devc, i, init_values[i]);
-
-
-	ad_mute(devc);		/* Initialize some variables */
-	ad_unmute(devc);	/* Leave it unmuted now */
-
-	if (devc->model > MD_1848)
-	{
-		if (devc->model == MD_1845_SSCAPE)
-			ad_write(devc, 12, ad_read(devc, 12) | 0x50);
-		else 
-			ad_write(devc, 12, ad_read(devc, 12) | 0x40);		/* Mode2 = enabled */
-
-		if (devc->model == MD_IWAVE)
-			ad_write(devc, 12, 0x6c);	/* Select codec mode 3 */
-
-		if (devc-> model != MD_1845_SSCAPE)
-			for (i = 16; i < 32; i++)
-				ad_write(devc, i, init_values[i]);
-
-		if (devc->model == MD_IWAVE)
-			ad_write(devc, 16, 0x30);	/* Playback and capture counters enabled */
-	}
-	if (devc->model > MD_1848)
-	{
-		if (devc->audio_flags & DMA_DUPLEX)
-			ad_write(devc, 9, ad_read(devc, 9) & ~0x04);	/* Dual DMA mode */
-		else
-			ad_write(devc, 9, ad_read(devc, 9) | 0x04);	/* Single DMA mode */
-
-		if (devc->model == MD_1845 || devc->model == MD_1845_SSCAPE)
-			ad_write(devc, 27, ad_read(devc, 27) | 0x08);		/* Alternate freq select enabled */
-
-		if (devc->model == MD_IWAVE)
-		{		/* Some magic Interwave specific initialization */
-			ad_write(devc, 12, 0x6c);	/* Select codec mode 3 */
-			ad_write(devc, 16, 0x30);	/* Playback and capture counters enabled */
-			ad_write(devc, 17, 0xc2);	/* Alternate feature enable */
-		}
-	}
-	else
-	{
-		  devc->audio_flags &= ~DMA_DUPLEX;
-		  ad_write(devc, 9, ad_read(devc, 9) | 0x04);	/* Single DMA mode */
-		  if (soundpro)
-			  ad_write(devc, 12, ad_read(devc, 12) | 0x40);	/* Mode2 = enabled */
-	}
-
-	outb((0), io_Status(devc));	/* Clear pending interrupts */
-
-	/*
-	 * Toggle the MCE bit. It completes the initialization phase.
-	 */
-
-	ad_enter_MCE(devc);	/* In case the bit was off */
-	ad_leave_MCE(devc);
-
-	ad1848_mixer_reset(devc);
-}
-
-int ad1848_detect(int io_base, int *ad_flags, int *osp)
-{
-	unsigned char tmp;
-	ad1848_info *devc = &adev_info[nr_ad1848_devs];
-	unsigned char tmp1 = 0xff, tmp2 = 0xff;
-	int optiC930 = 0;	/* OPTi 82C930 flag */
-	int interwave = 0;
-	int ad1847_flag = 0;
-	int cs4248_flag = 0;
-	int sscape_flag = 0;
-
-	int i;
-
-	DDB(printk("ad1848_detect(%x)\n", io_base));
-
-	if (ad_flags)
-	{
-		if (*ad_flags == 0x12345678)
-		{
-			interwave = 1;
-			*ad_flags = 0;
-		}
-		
-		if (*ad_flags == 0x87654321)
-		{
-			sscape_flag = 1;
-			*ad_flags = 0;
-		}
-		
-		if (*ad_flags == 0x12345677)
-		{
-		    cs4248_flag = 1;
-		    *ad_flags = 0;
-		}
-	}
-	if (nr_ad1848_devs >= MAX_AUDIO_DEV)
-	{
-		printk(KERN_ERR "ad1848 - Too many audio devices\n");
-		return 0;
-	}
-	if (check_region(io_base, 4))
-	{
-		printk(KERN_ERR "ad1848.c: Port %x not free.\n", io_base);
-		return 0;
-	}
-	devc->base = io_base;
-	devc->irq_ok = 0;
-	devc->timer_running = 0;
-	devc->MCE_bit = 0x40;
-	devc->irq = 0;
-	devc->open_mode = 0;
-	devc->chip_name = devc->name = "AD1848";
-	devc->model = MD_1848;	/* AD1848 or CS4248 */
-	devc->levels = NULL;
-	devc->debug_flag = 0;
-
-	/*
-	 * Check that the I/O address is in use.
-	 *
-	 * The bit 0x80 of the base I/O port is known to be 0 after the
-	 * chip has performed its power on initialization. Just assume
-	 * this has happened before the OS is starting.
-	 *
-	 * If the I/O address is unused, it typically returns 0xff.
-	 */
-
-	if (inb(devc->base) == 0xff)
-	{
-		DDB(printk("ad1848_detect: The base I/O address appears to be dead\n"));
-	}
-
-	/*
-	 * Wait for the device to stop initialization
-	 */
-	
-	DDB(printk("ad1848_detect() - step 0\n"));
-
-	for (i = 0; i < 10000000; i++)
-	{
-		unsigned char   x = inb(devc->base);
-
-		if (x == 0xff || !(x & 0x80))
-			break;
-	}
-
-	DDB(printk("ad1848_detect() - step A\n"));
-
-	if (inb(devc->base) == 0x80)	/* Not ready. Let's wait */
-		ad_leave_MCE(devc);
-
-	if ((inb(devc->base) & 0x80) != 0x00)	/* Not a AD1848 */
-	{
-		DDB(printk("ad1848 detect error - step A (%02x)\n", (int) inb(devc->base)));
-		return 0;
-	}
-	
-	/*
-	 * Test if it's possible to change contents of the indirect registers.
-	 * Registers 0 and 1 are ADC volume registers. The bit 0x10 is read only
-	 * so try to avoid using it.
-	 */
-
-	DDB(printk("ad1848_detect() - step B\n"));
-	ad_write(devc, 0, 0xaa);
-	ad_write(devc, 1, 0x45);	/* 0x55 with bit 0x10 clear */
-
-	if ((tmp1 = ad_read(devc, 0)) != 0xaa || (tmp2 = ad_read(devc, 1)) != 0x45)
-	{
-		if (tmp2 == 0x65)	/* AD1847 has couple of bits hardcoded to 1 */
-			ad1847_flag = 1;
-		else
-		{
-			DDB(printk("ad1848 detect error - step B (%x/%x)\n", tmp1, tmp2));
-			return 0;
-		}
-	}
-	DDB(printk("ad1848_detect() - step C\n"));
-	ad_write(devc, 0, 0x45);
-	ad_write(devc, 1, 0xaa);
-
-	if ((tmp1 = ad_read(devc, 0)) != 0x45 || (tmp2 = ad_read(devc, 1)) != 0xaa)
-	{
-		if (tmp2 == 0x8a)	/* AD1847 has few bits hardcoded to 1 */
-			ad1847_flag = 1;
-		else
-		{
-			DDB(printk("ad1848 detect error - step C (%x/%x)\n", tmp1, tmp2));
-			return 0;
-		}
-	}
-
-	/*
-	 * The indirect register I12 has some read only bits. Let's
-	 * try to change them.
-	 */
-
-	DDB(printk("ad1848_detect() - step D\n"));
-	tmp = ad_read(devc, 12);
-	ad_write(devc, 12, (~tmp) & 0x0f);
-
-	if ((tmp & 0x0f) != ((tmp1 = ad_read(devc, 12)) & 0x0f))
-	{
-		DDB(printk("ad1848 detect error - step D (%x)\n", tmp1));
-		return 0;
-	}
-	
-	/*
-	 * NOTE! Last 4 bits of the reg I12 tell the chip revision.
-	 *   0x01=RevB and 0x0A=RevC.
-	 */
-
-	/*
-	 * The original AD1848/CS4248 has just 15 indirect registers. This means
-	 * that I0 and I16 should return the same value (etc.).
-	 * However this doesn't work with CS4248. Actually it seems to be impossible
-	 * to detect if the chip is a CS4231 or CS4248.
-	 * Ensure that the Mode2 enable bit of I12 is 0. Otherwise this test fails
-	 * with CS4231.
-	 */
-
-	/*
-	 * OPTi 82C930 has mode2 control bit in another place. This test will fail
-	 * with it. Accept this situation as a possible indication of this chip.
-	 */
-
-	DDB(printk("ad1848_detect() - step F\n"));
-	ad_write(devc, 12, 0);	/* Mode2=disabled */
-
-	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));
-			if (!ad1847_flag)
-				optiC930 = 1;
-			break;
-		}
-	}
-
-	/*
-	 * Try to switch the chip to mode2 (CS4231) by setting the MODE2 bit (0x40).
-	 * The bit 0x80 is always 1 in CS4248 and CS4231.
-	 */
-
-	DDB(printk("ad1848_detect() - step G\n"));
-
-	if (ad_flags && *ad_flags == 400)
-		*ad_flags = 0;
-	else
-		ad_write(devc, 12, 0x40);	/* Set mode2, clear 0x80 */
-
-
-	if (ad_flags)
-		*ad_flags = 0;
-
-	tmp1 = ad_read(devc, 12);
-	if (tmp1 & 0x80)
-	{
-		if (ad_flags)
-			*ad_flags |= AD_F_CS4248;
-
-		devc->chip_name = "CS4248";	/* Our best knowledge just now */
-	}
-	if (optiC930 || (tmp1 & 0xc0) == (0x80 | 0x40))
-	{
-		/*
-		 *      CS4231 detected - is it?
-		 *
-		 *      Verify that setting I0 doesn't change I16.
-		 */
-		
-		DDB(printk("ad1848_detect() - step H\n"));
-		ad_write(devc, 16, 0);	/* Set I16 to known value */
-
-		ad_write(devc, 0, 0x45);
-		if ((tmp1 = ad_read(devc, 16)) != 0x45)	/* No change -> CS4231? */
-		{
-			ad_write(devc, 0, 0xaa);
-			if ((tmp1 = ad_read(devc, 16)) == 0xaa)	/* Rotten bits? */
-			{
-				DDB(printk("ad1848 detect error - step H(%x)\n", tmp1));
-				return 0;
-			}
-			
-			/*
-			 * Verify that some bits of I25 are read only.
-			 */
-
-			DDB(printk("ad1848_detect() - step I\n"));
-			tmp1 = ad_read(devc, 25);	/* Original bits */
-			ad_write(devc, 25, ~tmp1);	/* Invert all bits */
-			if ((ad_read(devc, 25) & 0xe7) == (tmp1 & 0xe7))
-			{
-				int id;
-
-				/*
-				 *      It's at least CS4231
-				 */
-
-				devc->chip_name = "CS4231";
-				devc->model = MD_4231;
-				
-				/*
-				 * It could be an AD1845 or CS4231A as well.
-				 * CS4231 and AD1845 report the same revision info in I25
-				 * while the CS4231A reports different.
-				 */
-
-				id = ad_read(devc, 25);
-				if ((id & 0xe7) == 0x80)	/* Device busy??? */
-					id = ad_read(devc, 25);
-				if ((id & 0xe7) == 0x80)	/* Device still busy??? */
-					id = ad_read(devc, 25);
-				DDB(printk("ad1848_detect() - step J (%02x/%02x)\n", id, ad_read(devc, 25)));
-
-                                if ((id & 0xe7) == 0x80) {
-					/* 
-					 * It must be a CS4231 or AD1845. The register I23 of
-					 * CS4231 is undefined and it appears to be read only.
-					 * AD1845 uses I23 for setting sample rate. Assume
-					 * the chip is AD1845 if I23 is changeable.
-					 */
-
-					unsigned char   tmp = ad_read(devc, 23);
-					ad_write(devc, 23, ~tmp);
-
-					if (interwave)
-					{
-						devc->model = MD_IWAVE;
-						devc->chip_name = "IWave";
-					}
-					else if (ad_read(devc, 23) != tmp)	/* AD1845 ? */
-					{
-						devc->chip_name = "AD1845";
-						devc->model = MD_1845;
-					}
-					else if (cs4248_flag)
-					{
-						if (ad_flags)
-							  *ad_flags |= AD_F_CS4248;
-						devc->chip_name = "CS4248";
-						devc->model = MD_1848;
-						ad_write(devc, 12, ad_read(devc, 12) & ~0x40);	/* Mode2 off */
-					}
-					ad_write(devc, 23, tmp);	/* Restore */
-				}
-				else
-				{
-					switch (id & 0x1f) {
-					case 3: /* CS4236/CS4235 */
-						{
-							int xid;
-							ad_write(devc, 12, ad_read(devc, 12) | 0x60); /* switch to mode 3 */
-							ad_write(devc, 23, 0x9c); /* select extended register 25 */
-							xid = inb(io_Indexed_Data(devc));
-							ad_write(devc, 12, ad_read(devc, 12) & ~0x60); /* back to mode 0 */
-							if ((xid & 0x1f) == 0x1d) {
-								devc->chip_name = "CS4235";
-								devc->model = MD_4235;
-							} else {
-								devc->chip_name = "CS4236";
-								devc->model = MD_4232;
-							}
-						}
-						break;
-
-					case 2: /* CS4232/CS4232A */
-						devc->chip_name = "CS4232";
-						devc->model = MD_4232;
-						break;
-				
-					case 0:
-						if ((id & 0xe0) == 0xa0)
-						{
-							devc->chip_name = "CS4231A";
-							devc->model = MD_4231A;
-						}
-						else
-						{
-							devc->chip_name = "CS4321";
-							devc->model = MD_4231;
-						}
-						break;
-
-					default: /* maybe */
-						DDB(printk("ad1848: I25 = %02x/%02x\n", ad_read(devc, 25), ad_read(devc, 25) & 0xe7));
-                                                if (optiC930)
-                                                {
-                                                        devc->chip_name = "82C930";
-                                                        devc->model = MD_C930;
-                                                }
-						else
-						{
-							devc->chip_name = "CS4231";
-							devc->model = MD_4231;
-						}
-					}
-				}
-			}
-			ad_write(devc, 25, tmp1);	/* Restore bits */
-
-			DDB(printk("ad1848_detect() - step K\n"));
-		}
-	} else if (tmp1 == 0x0a) {
-		/*
-		 * Is it perhaps a SoundPro CMI8330?
-		 * If so, then we should be able to change indirect registers
-		 * greater than I15 after activating MODE2, even though reading
-		 * back I12 does not show it.
-		 */
-
-		/*
-		 * Let's try comparing register values
-		 */
-		for (i = 0; i < 16; i++) {
-			if ((tmp1 = ad_read(devc, i)) != (tmp2 = ad_read(devc, i + 16))) {
-				DDB(printk("ad1848 detect step H(%d/%x/%x) - SoundPro chip?\n", i, tmp1, tmp2));
-				soundpro = 1;
-				devc->chip_name = "SoundPro CMI 8330";
-				break;
-			}
-		}
-	}
-
-	DDB(printk("ad1848_detect() - step L\n"));
-	if (ad_flags)
-	{
-		  if (devc->model != MD_1848)
-			  *ad_flags |= AD_F_CS4231;
-	}
-	DDB(printk("ad1848_detect() - Detected OK\n"));
-
-	if (devc->model == MD_1848 && ad1847_flag)
-		devc->chip_name = "AD1847";
-
-
-	if (sscape_flag == 1)
-		devc->model = MD_1845_SSCAPE;
-
-	return 1;
-}
-
-int ad1848_init(char *name, int io_base, int irq, int dma_playback, int dma_capture, int share_dma, int *osp)
-{
-	/*
-	 * NOTE! If irq < 0, there is another driver which has allocated the IRQ
-	 *   so that this driver doesn't need to allocate/deallocate it.
-	 *   The actually used IRQ is ABS(irq).
-	 */
-
-
-	int my_dev;
-	char dev_name[100];
-	int e;
-
-	ad1848_info  *devc = &adev_info[nr_ad1848_devs];
-
-	ad1848_port_info *portc = NULL;
-
-	devc->irq = (irq > 0) ? irq : 0;
-	devc->open_mode = 0;
-	devc->timer_ticks = 0;
-	devc->dma1 = dma_playback;
-	devc->dma2 = dma_capture;
-	devc->audio_flags = DMA_AUTOMODE;
-	devc->playback_dev = devc->record_dev = 0;
-	if (name != NULL)
-		devc->name = name;
-
-	if (name != NULL && name[0] != 0)
-		sprintf(dev_name,
-			"%s (%s)", name, devc->chip_name);
-	else
-		sprintf(dev_name,
-			"Generic audio codec (%s)", devc->chip_name);
-
-	request_region(devc->base, 4, devc->name);
-
-	conf_printf2(dev_name, devc->base, devc->irq, dma_playback, dma_capture);
-
-	if (devc->model == MD_1848 || devc->model == MD_C930)
-		devc->audio_flags |= DMA_HARDSTOP;
-
-	if (devc->model > MD_1848)
-	{
-		if (devc->dma1 == devc->dma2 || devc->dma2 == -1 || devc->dma1 == -1)
-			devc->audio_flags &= ~DMA_DUPLEX;
-		else
-			devc->audio_flags |= DMA_DUPLEX;
-	}
-
-	portc = (ad1848_port_info *) kmalloc(sizeof(ad1848_port_info), GFP_KERNEL);
-	if(portc==NULL)
-		return -1;
-		
-	if ((my_dev = sound_install_audiodrv(AUDIO_DRIVER_VERSION,
-					     dev_name,
-					     &ad1848_audio_driver,
-					     sizeof(struct audio_driver),
-					     devc->audio_flags,
-					     ad_format_mask[devc->model],
-					     devc,
-					     dma_playback,
-					     dma_capture)) < 0)
-	{
-		kfree(portc);
-		portc=NULL;
-		return -1;
-	}
-	
-	audio_devs[my_dev]->portc = portc;
-	audio_devs[my_dev]->mixer_dev = -1;
-	memset((char *) portc, 0, sizeof(*portc));
-
-	nr_ad1848_devs++;
-
-	ad1848_init_hw(devc);
-
-	if (irq > 0)
-	{
-		devc->dev_no = my_dev;
-		if (request_irq(devc->irq, adintr, 0, devc->name, (void *)my_dev) < 0)
-		{
-			printk(KERN_WARNING "ad1848: Unable to allocate IRQ\n");
-			/* Don't free it either then.. */
-			devc->irq = 0;
-		}
-		if (capabilities[devc->model].flags & CAP_F_TIMER)
-		{
-#ifndef __SMP__
-			int x;
-			unsigned char tmp = ad_read(devc, 16);
-#endif			
-
-			devc->timer_ticks = 0;
-
-			ad_write(devc, 21, 0x00);	/* Timer MSB */
-			ad_write(devc, 20, 0x10);	/* Timer LSB */
-#ifndef __SMP__
-			ad_write(devc, 16, tmp | 0x40);	/* Enable timer */
-			for (x = 0; x < 100000 && devc->timer_ticks == 0; x++);
-			ad_write(devc, 16, tmp & ~0x40);	/* Disable timer */
-
-			if (devc->timer_ticks == 0)
-				printk(KERN_WARNING "ad1848: Interrupt test failed (IRQ%d)\n", irq);
-			else
-			{
-				DDB(printk("Interrupt test OK\n"));
-				devc->irq_ok = 1;
-			}
-#else
-			devc->irq_ok=1;
-#endif			
-		}
-		else
-			devc->irq_ok = 1;	/* Couldn't test. assume it's OK */
-	} else if (irq < 0)
-		irq2dev[-irq] = devc->dev_no = my_dev;
-
-#if defined(CONFIG_SEQUENCER) && !defined(EXCLUDE_TIMERS)
-	if ((capabilities[devc->model].flags & CAP_F_TIMER) &&
-	    devc->irq_ok)
-		ad1848_tmr_install(my_dev);
-#endif
-
-	if (!share_dma)
-	{
-		if (sound_alloc_dma(dma_playback, devc->name))
-			printk(KERN_WARNING "ad1848.c: Can't allocate DMA%d\n", dma_playback);
-
-		if (dma_capture != dma_playback)
-			if (sound_alloc_dma(dma_capture, devc->name))
-				printk(KERN_WARNING "ad1848.c: Can't allocate DMA%d\n", dma_capture);
-	}
-	if ((e = sound_install_mixer(MIXER_DRIVER_VERSION,
-				     dev_name,
-				     &ad1848_mixer_operations,
-				     sizeof(struct mixer_operations),
-				     devc)) >= 0)
-	{
-		audio_devs[my_dev]->mixer_dev = e;
-	}
-	return my_dev;
-}
-
-int ad1848_control(int cmd, int arg)
-{
-	ad1848_info *devc;
-
-	if (nr_ad1848_devs < 1)
-		return -ENODEV;
-
-	devc = &adev_info[nr_ad1848_devs - 1];
-
-	switch (cmd)
-	{
-		case AD1848_SET_XTAL:	/* Change clock frequency of AD1845 (only ) */
-			if (devc->model != MD_1845 || devc->model != MD_1845_SSCAPE)
-				return -EINVAL;
-			ad_enter_MCE(devc);
-			ad_write(devc, 29, (ad_read(devc, 29) & 0x1f) | (arg << 5));
-			ad_leave_MCE(devc);
-			break;
-
-		case AD1848_MIXER_REROUTE:
-		{
-			int o = (arg >> 8) & 0xff;
-			int n = arg & 0xff;
-
-			if (o < 0 || o >= SOUND_MIXER_NRDEVICES)
-				return -EINVAL;
-
-			if (!(devc->supported_devices & (1 << o)) &&
-			    !(devc->supported_rec_devices & (1 << o)))
-				return -EINVAL;
-
-			if (n == SOUND_MIXER_NONE)
-			{	/* Just hide this control */
-				ad1848_mixer_set(devc, o, 0);	/* Shut up it */
-				devc->supported_devices &= ~(1 << o);
-				devc->supported_rec_devices &= ~(1 << o);
-				break;
-			}
-
-			/* Make the mixer control identified by o to appear as n */
-			if (n < 0 || n >= SOUND_MIXER_NRDEVICES)
-				return -EINVAL;
-
-			devc->mixer_reroute[n] = o;	/* Rename the control */
-			if (devc->supported_devices & (1 << o))
-				devc->supported_devices |= (1 << n);
-			if (devc->supported_rec_devices & (1 << o))
-				devc->supported_rec_devices |= (1 << n);
-
-			devc->supported_devices &= ~(1 << o);
-			devc->supported_rec_devices &= ~(1 << o);
-		}
-		break;
-	}
-	return 0;
-}
-
-void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int share_dma)
-{
-	int i, mixer, dev = 0;
-	ad1848_info *devc = NULL;
-
-	for (i = 0; devc == NULL && i < nr_ad1848_devs; i++)
-	{
-		if (adev_info[i].base == io_base)
-		{
-			devc = &adev_info[i];
-			dev = devc->dev_no;
-		}
-	}
-		
-	if (devc != NULL)
-	{
-		if(audio_devs[dev]->portc!=NULL)
-			kfree(audio_devs[dev]->portc);
-		release_region(devc->base, 4);
-
-		if (!share_dma)
-		{
-			if (devc->irq > 0) /* There is no point in freeing irq, if it wasn't allocated */
-				free_irq(devc->irq, (void *)devc->dev_no);
-
-			sound_free_dma(dma_playback);
-
-			if (dma_playback != dma_capture)
-				sound_free_dma(dma_capture);
-
-		}
-		mixer = audio_devs[devc->dev_no]->mixer_dev;
-		if(mixer>=0)
-			sound_unload_mixerdev(mixer);
-
-		nr_ad1848_devs--;
-		for ( ; i < nr_ad1848_devs ; i++)
-			adev_info[i] = adev_info[i+1];
-	}
-	else
-		printk(KERN_ERR "ad1848: Can't find device to be unloaded. Base=%x\n", io_base);
-}
-
-void adintr(int irq, void *dev_id, struct pt_regs *dummy)
-{
-	unsigned char status;
-	ad1848_info *devc;
-	int dev;
-	int alt_stat = 0xff;
-	unsigned char c930_stat = 0;
-	int cnt = 0;
-
-	dev = (int)dev_id;
-	devc = (ad1848_info *) audio_devs[dev]->devc;
-
-interrupt_again:		/* Jump back here if int status doesn't reset */
-
-	status = inb(io_Status(devc));
-
-	if (status == 0x80)
-		printk(KERN_DEBUG "adintr: Why?\n");
-	if (devc->model == MD_1848)
-		outb((0), io_Status(devc));	/* Clear interrupt status */
-
-	if (status & 0x01)
-	{
-		if (devc->model == MD_C930)
-		{		/* 82C930 has interrupt status register in MAD16 register MC11 */
-			unsigned long   flags;
-
-			save_flags(flags);
-			cli();
-
-			/* 0xe0e is C930 address port
-			 * 0xe0f is C930 data port
-			 */
-			outb(11, 0xe0e);
-			c930_stat = inb(0xe0f);
-			outb((~c930_stat), 0xe0f);
-
-			restore_flags(flags);
-
-			alt_stat = (c930_stat << 2) & 0x30;
-		}
-		else if (devc->model != MD_1848)
-		{
-			alt_stat = ad_read(devc, 24);
-			ad_write(devc, 24, ad_read(devc, 24) & ~alt_stat);	/* Selective ack */
-		}
-
-		if ((devc->open_mode & OPEN_READ) && (devc->audio_mode & PCM_ENABLE_INPUT) && (alt_stat & 0x20))
-		{
-			DMAbuf_inputintr(devc->record_dev);
-		}
-		if ((devc->open_mode & OPEN_WRITE) && (devc->audio_mode & PCM_ENABLE_OUTPUT) &&
-		      (alt_stat & 0x10))
-		{
-			DMAbuf_outputintr(devc->playback_dev, 1);
-		}
-		if (devc->model != MD_1848 && (alt_stat & 0x40))	/* Timer interrupt */
-		{
-			devc->timer_ticks++;
-#if defined(CONFIG_SEQUENCER) && !defined(EXCLUDE_TIMERS)
-			if (timer_installed == dev && devc->timer_running)
-				sound_timer_interrupt();
-#endif
-		}
-	}
-/*
- * Sometimes playback or capture interrupts occur while a timer interrupt
- * is being handled. The interrupt will not be retriggered if we don't
- * handle it now. Check if an interrupt is still pending and restart
- * the handler in this case.
- */
-	if (inb(io_Status(devc)) & 0x01 && cnt++ < 4)
-	{
-		  goto interrupt_again;
-	}
-}
-
-/*
- *	Experimental initialization sequence for the integrated sound system
- *	of the Compaq Deskpro M.
- */
-
-static int init_deskpro_m(struct address_info *hw_config)
-{
-	unsigned char   tmp;
-
-	if ((tmp = inb(0xc44)) == 0xff)
-	{
-		DDB(printk("init_deskpro_m: Dead port 0xc44\n"));
-		return 0;
-	}
-
-	outb(0x10, 0xc44);
-	outb(0x40, 0xc45);
-	outb(0x00, 0xc46);
-	outb(0xe8, 0xc47);
-	outb(0x14, 0xc44);
-	outb(0x40, 0xc45);
-	outb(0x00, 0xc46);
-	outb(0xe8, 0xc47);
-	outb(0x10, 0xc44);
-
-	return 1;
-}
-
-/*
- *	Experimental initialization sequence for the integrated sound system
- *	of Compaq Deskpro XL.
- */
-
-static int init_deskpro(struct address_info *hw_config)
-{
-	unsigned char   tmp;
-
-	if ((tmp = inb(0xc44)) == 0xff)
-	{
-		DDB(printk("init_deskpro: Dead port 0xc44\n"));
-		return 0;
-	}
-	outb((tmp | 0x04), 0xc44);	/* Select bank 1 */
-	if (inb(0xc44) != 0x04)
-	{
-		DDB(printk("init_deskpro: Invalid bank1 signature in port 0xc44\n"));
-		return 0;
-	}
-	/*
-	 * OK. It looks like a Deskpro so let's proceed.
-	 */
-
-	/*
-	 * I/O port 0xc44 Audio configuration register.
-	 *
-	 * bits 0xc0:   Audio revision bits
-	 *              0x00 = Compaq Business Audio
-	 *              0x40 = MS Sound System Compatible (reset default)
-	 *              0x80 = Reserved
-	 *              0xc0 = Reserved
-	 * bit 0x20:    No Wait State Enable
-	 *              0x00 = Disabled (reset default, DMA mode)
-	 *              0x20 = Enabled (programmed I/O mode)
-	 * bit 0x10:    MS Sound System Decode Enable
-	 *              0x00 = Decoding disabled (reset default)
-	 *              0x10 = Decoding enabled
-	 * bit 0x08:    FM Synthesis Decode Enable
-	 *              0x00 = Decoding Disabled (reset default)
-	 *              0x08 = Decoding enabled
-	 * bit 0x04     Bank select
-	 *              0x00 = Bank 0
-	 *              0x04 = Bank 1
-	 * bits 0x03    MSS Base address
-	 *              0x00 = 0x530 (reset default)
-	 *              0x01 = 0x604
-	 *              0x02 = 0xf40
-	 *              0x03 = 0xe80
-	 */
-
-#ifdef DEBUGXL
-	/* Debug printing */
-	printk("Port 0xc44 (before): ");
-	outb((tmp & ~0x04), 0xc44);
-	printk("%02x ", inb(0xc44));
-	outb((tmp | 0x04), 0xc44);
-	printk("%02x\n", inb(0xc44));
-#endif
-
-	/* Set bank 1 of the register */
-	tmp = 0x58;		/* MSS Mode, MSS&FM decode enabled */
-
-	switch (hw_config->io_base)
-	{
-		case 0x530:
-			tmp |= 0x00;
-			break;
-		case 0x604:
-			tmp |= 0x01;
-			break;
-		case 0xf40:
-			tmp |= 0x02;
-			break;
-		case 0xe80:
-			tmp |= 0x03;
-			break;
-		default:
-			DDB(printk("init_deskpro: Invalid MSS port %x\n", hw_config->io_base));
-			return 0;
-	}
-	outb((tmp & ~0x04), 0xc44);	/* Write to bank=0 */
-
-#ifdef DEBUGXL
-	/* Debug printing */
-	printk("Port 0xc44 (after): ");
-	outb((tmp & ~0x04), 0xc44);	/* Select bank=0 */
-	printk("%02x ", inb(0xc44));
-	outb((tmp | 0x04), 0xc44);	/* Select bank=1 */
-	printk("%02x\n", inb(0xc44));
-#endif
-
-	/*
-	 * I/O port 0xc45 FM Address Decode/MSS ID Register.
-	 *
-	 * bank=0, bits 0xfe:   FM synthesis Decode Compare bits 7:1 (default=0x88)
-	 * bank=0, bit 0x01:    SBIC Power Control Bit
-	 *                      0x00 = Powered up
-	 *                      0x01 = Powered down
-	 * bank=1, bits 0xfc:   MSS ID (default=0x40)
-	 */
-
-#ifdef DEBUGXL
-	/* Debug printing */
-	printk("Port 0xc45 (before): ");
-	outb((tmp & ~0x04), 0xc44);	/* Select bank=0 */
-	printk("%02x ", inb(0xc45));
-	outb((tmp | 0x04), 0xc44);	/* Select bank=1 */
-	printk("%02x\n", inb(0xc45));
-#endif
-
-	outb((tmp & ~0x04), 0xc44);	/* Select bank=0 */
-	outb((0x88), 0xc45);	/* FM base 7:0 = 0x88 */
-	outb((tmp | 0x04), 0xc44);	/* Select bank=1 */
-	outb((0x10), 0xc45);	/* MSS ID = 0x10 (MSS port returns 0x04) */
-
-#ifdef DEBUGXL
-	/* Debug printing */
-	printk("Port 0xc45 (after): ");
-	outb((tmp & ~0x04), 0xc44);	/* Select bank=0 */
-	printk("%02x ", inb(0xc45));
-	outb((tmp | 0x04), 0xc44);	/* Select bank=1 */
-	printk("%02x\n", inb(0xc45));
-#endif
-
-
-	/*
-	 * I/O port 0xc46 FM Address Decode/Address ASIC Revision Register.
-	 *
-	 * bank=0, bits 0xff:   FM synthesis Decode Compare bits 15:8 (default=0x03)
-	 * bank=1, bits 0xff:   Audio addressing ASIC id
-	 */
-
-#ifdef DEBUGXL
-	/* Debug printing */
-	printk("Port 0xc46 (before): ");
-	outb((tmp & ~0x04), 0xc44);	/* Select bank=0 */
-	printk("%02x ", inb(0xc46));
-	outb((tmp | 0x04), 0xc44);	/* Select bank=1 */
-	printk("%02x\n", inb(0xc46));
-#endif
-
-	outb((tmp & ~0x04), 0xc44);	/* Select bank=0 */
-	outb((0x03), 0xc46);	/* FM base 15:8 = 0x03 */
-	outb((tmp | 0x04), 0xc44);	/* Select bank=1 */
-	outb((0x11), 0xc46);	/* ASIC ID = 0x11 */
-
-#ifdef DEBUGXL
-	/* Debug printing */
-	printk("Port 0xc46 (after): ");
-	outb((tmp & ~0x04), 0xc44);	/* Select bank=0 */
-	printk("%02x ", inb(0xc46));
-	outb((tmp | 0x04), 0xc44);	/* Select bank=1 */
-	printk("%02x\n", inb(0xc46));
-#endif
-
-	/*
-	 * I/O port 0xc47 FM Address Decode Register.
-	 *
-	 * bank=0, bits 0xff:   Decode enable selection for various FM address bits
-	 * bank=1, bits 0xff:   Reserved
-	 */
-
-#ifdef DEBUGXL
-	/* Debug printing */
-	printk("Port 0xc47 (before): ");
-	outb((tmp & ~0x04), 0xc44);	/* Select bank=0 */
-	printk("%02x ", inb(0xc47));
-	outb((tmp | 0x04), 0xc44);	/* Select bank=1 */
-	printk("%02x\n", inb(0xc47));
-#endif
-
-	outb((tmp & ~0x04), 0xc44);	/* Select bank=0 */
-	outb((0x7c), 0xc47);	/* FM decode enable bits = 0x7c */
-	outb((tmp | 0x04), 0xc44);	/* Select bank=1 */
-	outb((0x00), 0xc47);	/* Reserved bank1 = 0x00 */
-
-#ifdef DEBUGXL
-	/* Debug printing */
-	printk("Port 0xc47 (after): ");
-	outb((tmp & ~0x04), 0xc44);	/* Select bank=0 */
-	printk("%02x ", inb(0xc47));
-	outb((tmp | 0x04), 0xc44);	/* Select bank=1 */
-	printk("%02x\n", inb(0xc47));
-#endif
-
-	/*
-	 * I/O port 0xc6f = Audio Disable Function Register
-	 */
-
-#ifdef DEBUGXL
-	printk("Port 0xc6f (before) = %02x\n", inb(0xc6f));
-#endif
-
-	outb((0x80), 0xc6f);
-
-#ifdef DEBUGXL
-	printk("Port 0xc6f (after) = %02x\n", inb(0xc6f));
-#endif
-
-	return 1;
-}
-
-int probe_ms_sound(struct address_info *hw_config)
-{
-	unsigned char   tmp;
-
-	DDB(printk("Entered probe_ms_sound(%x, %d)\n", hw_config->io_base, hw_config->card_subtype));
-
-	if (check_region(hw_config->io_base, 8))
-	{
-		printk(KERN_ERR "MSS: I/O port conflict\n");
-		return 0;
-	}
-	if (hw_config->card_subtype == 1)	/* Has no IRQ/DMA registers */
-	{
-		/* check_opl3(0x388, hw_config); */
-		return ad1848_detect(hw_config->io_base + 4, NULL, hw_config->osp);
-	}
-
-	if (deskpro_xl && hw_config->card_subtype == 2)	/* Compaq Deskpro XL */
-	{
-		if (!init_deskpro(hw_config))
-			return 0;
-	}
-
-	if (deskpro_m)	/* Compaq Deskpro M */
-	{
-		if (!init_deskpro_m(hw_config))
-			return 0;
-	}
-
-	/*
-	   * Check if the IO port returns valid signature. The original MS Sound
-	   * system returns 0x04 while some cards (AudioTrix Pro for example)
-	   * return 0x00 or 0x0f.
-	 */
-
-	if ((tmp = inb(hw_config->io_base + 3)) == 0xff)	/* Bus float */
-	{
-		  int             ret;
-
-		  DDB(printk("I/O address is inactive (%x)\n", tmp));
-		  if (!(ret = ad1848_detect(hw_config->io_base + 4, NULL, hw_config->osp)))
-			  return 0;
-		  return 1;
-	}
-	DDB(printk("MSS signature = %x\n", tmp & 0x3f));
-	if ((tmp & 0x3f) != 0x04 &&
-	    (tmp & 0x3f) != 0x0f &&
-	    (tmp & 0x3f) != 0x00)
-	{
-		int ret;
-
-		MDB(printk(KERN_ERR "No MSS signature detected on port 0x%x (0x%x)\n", hw_config->io_base, (int) inb(hw_config->io_base + 3)));
-		DDB(printk("Trying to detect codec anyway but IRQ/DMA may not work\n"));
-		if (!(ret = ad1848_detect(hw_config->io_base + 4, NULL, hw_config->osp)))
-			return 0;
-
-		hw_config->card_subtype = 1;
-		return 1;
-	}
-	if ((hw_config->irq != 5)  &&
-	    (hw_config->irq != 7)  &&
-	    (hw_config->irq != 9)  &&
-	    (hw_config->irq != 10) &&
-	    (hw_config->irq != 11) &&
-	    (hw_config->irq != 12))
-	{
-		printk(KERN_ERR "MSS: Bad IRQ %d\n", hw_config->irq);
-		return 0;
-	}
-	if (hw_config->dma != 0 && hw_config->dma != 1 && hw_config->dma != 3)
-	{
-		  printk(KERN_ERR "MSS: Bad DMA %d\n", hw_config->dma);
-		  return 0;
-	}
-	/*
-	 * Check that DMA0 is not in use with a 8 bit board.
-	 */
-
-	if (hw_config->dma == 0 && inb(hw_config->io_base + 3) & 0x80)
-	{
-		printk(KERN_ERR "MSS: Can't use DMA0 with a 8 bit card/slot\n");
-		return 0;
-	}
-	if (hw_config->irq > 7 && hw_config->irq != 9 && inb(hw_config->io_base + 3) & 0x80)
-	{
-		printk(KERN_ERR "MSS: Can't use IRQ%d with a 8 bit card/slot\n", hw_config->irq);
-		return 0;
-	}
-	return ad1848_detect(hw_config->io_base + 4, NULL, hw_config->osp);
-}
-
-void attach_ms_sound(struct address_info *hw_config)
-{
-	static signed char interrupt_bits[12] =
-	{
-		-1, -1, -1, -1, -1, 0x00, -1, 0x08, -1, 0x10, 0x18, 0x20
-	};
-	signed char     bits;
-	char            dma2_bit = 0;
-
-	static char     dma_bits[4] =
-	{
-		1, 2, 0, 3
-	};
-
-	int config_port = hw_config->io_base + 0;
-	int version_port = hw_config->io_base + 3;
-	int dma = hw_config->dma;
-	int dma2 = hw_config->dma2;
-
-	if (hw_config->card_subtype == 1)	/* Has no IRQ/DMA registers */
-	{
-		hw_config->slots[0] = ad1848_init("MS Sound System", hw_config->io_base + 4,
-						    hw_config->irq,
-						    hw_config->dma,
-				     hw_config->dma2, 0, hw_config->osp);
-		request_region(hw_config->io_base, 4, "WSS config");
-		return;
-	}
-	/*
-	 * Set the IRQ and DMA addresses.
-	 */
-
-	bits = interrupt_bits[hw_config->irq];
-	if (bits == -1)
-	{
-		printk(KERN_ERR "MSS: Bad IRQ %d\n", hw_config->irq);
-		return;
-	}
-	outb((bits | 0x40), config_port);
-	if ((inb(version_port) & 0x40) == 0)
-		printk(KERN_ERR "[MSS: IRQ Conflict?]\n");
-
-/*
- * Handle the capture DMA channel
- */
-
-	if (dma2 != -1 && dma2 != dma)
-	{
-		if (!((dma == 0 && dma2 == 1) ||
-			(dma == 1 && dma2 == 0) ||
-			(dma == 3 && dma2 == 0)))
-		{	/* Unsupported combination. Try to swap channels */
-			int tmp = dma;
-
-			dma = dma2;
-			dma2 = tmp;
-		}
-		if ((dma == 0 && dma2 == 1) ||
-			(dma == 1 && dma2 == 0) ||
-			(dma == 3 && dma2 == 0))
-		{
-			dma2_bit = 0x04;	/* Enable capture DMA */
-		}
-		else
-		{
-			printk(KERN_WARNING "MSS: Invalid capture DMA\n");
-			dma2 = dma;
-		}
-	}
-	else
-	{
-		dma2 = dma;
-	}
-
-	hw_config->dma = dma;
-	hw_config->dma2 = dma2;
-
-	outb((bits | dma_bits[dma] | dma2_bit), config_port);	/* Write IRQ+DMA setup */
-
-	hw_config->slots[0] = ad1848_init("MSS audio codec", hw_config->io_base + 4,
-					  hw_config->irq,
-					  dma,
-					  dma2, 0,
-					  hw_config->osp);
-	request_region(hw_config->io_base, 4, "WSS config");
-}
-
-void unload_ms_sound(struct address_info *hw_config)
-{
-	ad1848_unload(hw_config->io_base + 4,
-		      hw_config->irq,
-		      hw_config->dma,
-		      hw_config->dma2, 0);
-	sound_unload_audiodev(hw_config->slots[0]);
-	release_region(hw_config->io_base, 4);
-}
-
-#if defined(CONFIG_SEQUENCER) && !defined(EXCLUDE_TIMERS)
-
-/*
- * Timer stuff (for /dev/music).
- */
-
-static unsigned int current_interval = 0;
-
-static unsigned int ad1848_tmr_start(int dev, unsigned int usecs)
-{
-	unsigned long   flags;
-	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
-	unsigned long   xtal_nsecs;	/* nanoseconds per xtal oscillator tick */
-	unsigned long   divider;
-
-	save_flags(flags);
-	cli();
-
-	/*
-	 * Length of the timer interval (in nanoseconds) depends on the
-	 * selected crystal oscillator. Check this from bit 0x01 of I8.
-	 *
-	 * AD1845 has just one oscillator which has cycle time of 10.050 us
-	 * (when a 24.576 MHz xtal oscillator is used).
-	 *
-	 * Convert requested interval to nanoseconds before computing
-	 * the timer divider.
-	 */
-
-	if (devc->model == MD_1845 || devc->model == MD_1845_SSCAPE)
-		xtal_nsecs = 10050;
-	else if (ad_read(devc, 8) & 0x01)
-		xtal_nsecs = 9920;
-	else
-		xtal_nsecs = 9969;
-
-	divider = (usecs * 1000 + xtal_nsecs / 2) / xtal_nsecs;
-
-	if (divider < 100)	/* Don't allow shorter intervals than about 1ms */
-		divider = 100;
-
-	if (divider > 65535)	/* Overflow check */
-		divider = 65535;
-
-	ad_write(devc, 21, (divider >> 8) & 0xff);	/* Set upper bits */
-	ad_write(devc, 20, divider & 0xff);	/* Set lower bits */
-	ad_write(devc, 16, ad_read(devc, 16) | 0x40);	/* Start the timer */
-	devc->timer_running = 1;
-	restore_flags(flags);
-
-	return current_interval = (divider * xtal_nsecs + 500) / 1000;
-}
-
-static void ad1848_tmr_reprogram(int dev)
-{
-	/*
-	 *    Audio driver has changed sampling rate so that a different xtal
-	 *      oscillator was selected. We have to reprogram the timer rate.
-	 */
-
-	ad1848_tmr_start(dev, current_interval);
-	sound_timer_syncinterval(current_interval);
-}
-
-static void ad1848_tmr_disable(int dev)
-{
-	unsigned long   flags;
-	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
-
-	save_flags(flags);
-	cli();
-	ad_write(devc, 16, ad_read(devc, 16) & ~0x40);
-	devc->timer_running = 0;
-	restore_flags(flags);
-}
-
-static void ad1848_tmr_restart(int dev)
-{
-	unsigned long   flags;
-	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
-
-	if (current_interval == 0)
-		return;
-
-	save_flags(flags);
-	cli();
-	ad_write(devc, 16, ad_read(devc, 16) | 0x40);
-	devc->timer_running = 1;
-	restore_flags(flags);
-}
-
-static struct sound_lowlev_timer ad1848_tmr =
-{
-	0,
-	2,
-	ad1848_tmr_start,
-	ad1848_tmr_disable,
-	ad1848_tmr_restart
-};
-
-static int ad1848_tmr_install(int dev)
-{
-	if (timer_installed != -1)
-		return 0;	/* Don't install another timer */
-
-	timer_installed = ad1848_tmr.dev = dev;
-	sound_timer_init(&ad1848_tmr, audio_devs[dev]->name);
-
-	return 1;
-}
-#endif
-
-
-EXPORT_SYMBOL(ad1848_detect);
-EXPORT_SYMBOL(ad1848_init);
-EXPORT_SYMBOL(ad1848_unload);
-EXPORT_SYMBOL(ad1848_control);
-EXPORT_SYMBOL(adintr);
-EXPORT_SYMBOL(probe_ms_sound);
-EXPORT_SYMBOL(attach_ms_sound);
-EXPORT_SYMBOL(unload_ms_sound);
-
-#ifdef MODULE
-
-MODULE_PARM(io, "i");			/* I/O for a raw AD1848 card */
-MODULE_PARM(irq, "i");			/* IRQ to use */
-MODULE_PARM(dma, "i");			/* First DMA channel */
-MODULE_PARM(dma2, "i");			/* Second DMA channel */
-MODULE_PARM(type, "i");			/* Card type */
-MODULE_PARM(deskpro_xl, "i");		/* Special magic for Deskpro XL boxen */
-MODULE_PARM(deskpro_m, "i");		/* Special magic for Deskpro M box */
-MODULE_PARM(soundpro, "i");		/* More special magic for SoundPro chips */
-
-int io = -1;
-int irq = -1;
-int dma = -1;
-int dma2 = -1;
-int type = 0;
-
-static int loaded = 0;
-
-struct address_info hw_config;
-
-int init_module(void)
-{
-	printk(KERN_INFO "ad1848/cs4248 codec driver Copyright (C) by Hannu Savolainen 1993-1996\n");
-	if(io != -1)
-	{
-		if(irq == -1 || dma == -1)
-		{
-			printk(KERN_WARNING "ad1848: must give I/O , IRQ and DMA.\n");
-			return -EINVAL;
-		}
-		hw_config.irq = irq;
-		hw_config.io_base = io;
-		hw_config.dma = dma;
-		hw_config.dma2 = dma2;
-		hw_config.card_subtype = type;
-		if(!probe_ms_sound(&hw_config))
-			return -ENODEV;
-		attach_ms_sound(&hw_config);
-		loaded=1;
-	}
-	SOUND_LOCK;
-	return 0;
-}
-
-void cleanup_module(void)
-{
-	SOUND_LOCK_END;
-	if(loaded)
-		unload_ms_sound(&hw_config);
-}
-
-#endif
-#endif
diff -urN linux-2.2.20-pre3/drivers/usb/printer.c linux/drivers/usb/printer.c
--- linux-2.2.20-pre3/drivers/usb/printer.c	Sun Mar 25 08:37:37 2001
+++ linux/drivers/usb/printer.c	Mon Dec  3 22:19:03 2001
@@ -460,7 +460,7 @@
 	struct usb_endpoint_descriptor *epread, *epwrite;
 	struct usblp *usblp;
 	int minor, i, bidir = 0, quirks;
-	int alts = dev->actconfig->interface[ifnum].act_altsetting;
+	int alts = -1;
 	int length, err;
 	char *buf;
 
@@ -474,12 +474,18 @@
 		   (interface->bInterfaceProtocol > 1 && interface->bNumEndpoints < 2))
 			continue;
 
+		if (alts == -1)
+			alts = i;
+
 		if (interface->bInterfaceProtocol > 1) {
 			bidir = 1;
 			alts = i;
 			break;
 		}
 	}
+
+	if (alts == -1)
+		return NULL;
 
 	interface = &dev->actconfig->interface[ifnum].altsetting[alts];
 	if (usb_set_interface(dev, ifnum, alts))
diff -urN linux-2.2.20-pre3/drivers/usb/usb-uhci.c linux/drivers/usb/usb-uhci.c
--- linux-2.2.20-pre3/drivers/usb/usb-uhci.c	Sun Mar 25 08:31:43 2001
+++ linux/drivers/usb/usb-uhci.c	Mon Dec  3 22:19:03 2001
@@ -2297,7 +2297,7 @@
 			usb_endpoint_halt (urb->dev, usb_pipeendpoint (urb->pipe), usb_pipeout (urb->pipe));
 		}
 
-		// if any error occured: ignore this td, and continue
+		// if any error occurred: ignore this td, and continue
 		if (status != 0) {
 			//uhci_show_td (desc);
 			urb->error_count++;
diff -urN linux-2.2.20-pre3/drivers/video/atyfb.c linux/drivers/video/atyfb.c
--- linux-2.2.20-pre3/drivers/video/atyfb.c	Sun Mar 25 08:31:39 2001
+++ linux/drivers/video/atyfb.c	Mon Dec  3 22:19:03 2001
@@ -3268,7 +3268,7 @@
 	    addr = dp->addrs[1].address;
 	    break;
 	default:
-	    printk("Warning: got %d adresses for ATY:\n", dp->n_addrs);
+	    printk("Warning: got %d addresses for ATY:\n", dp->n_addrs);
 	    for (i = 0; i < dp->n_addrs; i++)
 		printk(" %08x-%08x", dp->addrs[i].address,
 		       dp->addrs[i].address+dp->addrs[i].size-1);
diff -urN linux-2.2.20-pre3/fs/binfmt_aout.c linux/fs/binfmt_aout.c
--- linux-2.2.20-pre3/fs/binfmt_aout.c	Mon Dec  3 22:18:55 2001
+++ linux/fs/binfmt_aout.c	Mon Dec  3 22:19:03 2001
@@ -31,16 +31,16 @@
 
 static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
 static int load_aout_library(int fd);
-static int aout_core_dump(long signr, struct pt_regs * regs);
+static int aout_core_dump(long signr, struct pt_regs * regs, struct file *);
 
 extern void dump_thread(struct pt_regs *, struct user *);
 
 static struct linux_binfmt aout_format = {
-#ifndef MODULE
-	NULL, NULL, load_aout_binary, load_aout_library, aout_core_dump
-#else
-	NULL, &__this_module, load_aout_binary, load_aout_library, aout_core_dump
-#endif
+	module:		THIS_MODULE,
+	load_binary:	load_aout_binary,
+	load_shlib:	load_aout_library,
+	core_dump:	aout_core_dump,
+	min_coredump:	PAGE_SIZE,
 };
 
 static void set_brk(unsigned long start, unsigned long end)
@@ -88,15 +88,11 @@
  * dumping of the process results in another error..
  */
 
-static inline int
-do_aout_core_dump(long signr, struct pt_regs * regs)
+static int
+aout_core_dump(long signr, struct pt_regs * regs, struct file * file)
 {
-	struct dentry * dentry = NULL;
-	struct inode * inode = NULL;
-	struct file * file;
 	mm_segment_t fs;
 	int has_dumped = 0;
-	char corefile[6+sizeof(current->comm)];
 	unsigned long dump_start, dump_size;
 	struct user dump;
 #if defined(__alpha__)
@@ -112,32 +108,8 @@
 #       define START_STACK(u)   (u.start_stack)
 #endif
 
-	if (!current->dumpable || atomic_read(&current->mm->count) != 1)
-		return 0;
-	current->dumpable = 0;
-
-/* See if we have enough room to write the upage.  */
-	if (current->rlim[RLIMIT_CORE].rlim_cur < PAGE_SIZE)
-		return 0;
 	fs = get_fs();
 	set_fs(KERNEL_DS);
-	memcpy(corefile,"core.",5);
-#if 0
-	memcpy(corefile+5,current->comm,sizeof(current->comm));
-#else
-	corefile[4] = '\0';
-#endif
-	file = filp_open(corefile,O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600);
-	if (IS_ERR(file))
-		goto end_coredump;
-	dentry = file->f_dentry;
-	inode = dentry->d_inode;
-	if (!S_ISREG(inode->i_mode))
-		goto close_coredump;
-	if (!inode->i_op || !inode->i_op->default_file_ops)
-		goto close_coredump;
-	if (!file->f_op->write)
-		goto close_coredump;
 	has_dumped = 1;
 	current->flags |= PF_DUMPCORE;
        	strncpy(dump.u_comm, current->comm, sizeof(current->comm));
@@ -217,21 +189,8 @@
 	set_fs(KERNEL_DS);
 	DUMP_WRITE(current,sizeof(*current));
 close_coredump:
-	filp_close(file, NULL);
-end_coredump:
 	set_fs(fs);
 	return has_dumped;
-}
-
-static int
-aout_core_dump(long signr, struct pt_regs * regs)
-{
-	int retval;
-
-	MOD_INC_USE_COUNT;
-	retval = do_aout_core_dump(signr, regs);
-	MOD_DEC_USE_COUNT;
-	return retval;
 }
 
 /*
diff -urN linux-2.2.20-pre3/fs/binfmt_elf.c linux/fs/binfmt_elf.c
--- linux-2.2.20-pre3/fs/binfmt_elf.c	Mon Dec  3 22:18:55 2001
+++ linux/fs/binfmt_elf.c	Mon Dec  3 22:19:03 2001
@@ -54,7 +54,7 @@
  * don't even try.
  */
 #ifdef USE_ELF_CORE_DUMP
-static int elf_core_dump(long signr, struct pt_regs * regs);
+static int elf_core_dump(long signr, struct pt_regs * regs, struct file *);
 #else
 #define elf_core_dump	NULL
 #endif
@@ -64,11 +64,11 @@
 #define ELF_PAGEALIGN(_v) (((_v) + ELF_EXEC_PAGESIZE - 1) & ~(ELF_EXEC_PAGESIZE - 1))
 
 static struct linux_binfmt elf_format = {
-#ifndef MODULE
-	NULL, NULL, load_elf_binary, load_elf_library, elf_core_dump
-#else
-	NULL, &__this_module, load_elf_binary, load_elf_library, elf_core_dump
-#endif
+	module:		THIS_MODULE,
+	load_binary:	load_elf_binary,
+	load_shlib:	load_elf_library,
+	core_dump:	elf_core_dump,
+	min_coredump:	ELF_EXEC_PAGESIZE,
 };
 
 static void set_brk(unsigned long start, unsigned long end)
@@ -1078,14 +1078,10 @@
  * and then they are actually written out.  If we run out of core limit
  * we just truncate.
  */
-static int elf_core_dump(long signr, struct pt_regs * regs)
+static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file)
 {
 	int has_dumped = 0;
-	struct file *file;
-	struct dentry *dentry;
-	struct inode *inode;
 	mm_segment_t fs;
-	char corefile[6+sizeof(current->comm)];
 	int segs;
 	int i;
 	size_t size = 0;
@@ -1099,16 +1095,6 @@
 	elf_fpregset_t fpu;		/* NT_PRFPREG */
 	struct elf_prpsinfo psinfo;	/* NT_PRPSINFO */
 
-	if (!current->dumpable ||
-	    limit < ELF_EXEC_PAGESIZE ||
-	    atomic_read(&current->mm->count) != 1)
-		return 0;
-	current->dumpable = 0;
-
-#ifndef CONFIG_BINFMT_ELF
-	MOD_INC_USE_COUNT;
-#endif
-
 	segs = current->mm->map_count;
 
 #ifdef DEBUG
@@ -1139,27 +1125,6 @@
 	fs = get_fs();
 	set_fs(KERNEL_DS);
 
-	memcpy(corefile,"core.",5);
-#if 0
-	memcpy(corefile+5,current->comm,sizeof(current->comm));
-#else
-	corefile[4] = '\0';
-#endif
-	file = filp_open(corefile, O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600);
-	if (IS_ERR(file))
-		goto end_coredump;
-	dentry = file->f_dentry;
-	inode = dentry->d_inode;
-	if (inode->i_nlink > 1)
-		goto close_coredump;	/* multiple links - don't dump */
-
-	if (!S_ISREG(inode->i_mode))
-		goto close_coredump;
-	if (!inode->i_op || !inode->i_op->default_file_ops)
-		goto close_coredump;
-	if (!file->f_op->write)
-		goto close_coredump;
-
 	has_dumped = 1;
 	current->flags |= PF_DUMPCORE;
 
@@ -1358,13 +1323,8 @@
 	}
 
  close_coredump:
- 	filp_close(file, NULL);
-
  end_coredump:
 	set_fs(fs);
-#ifndef CONFIG_BINFMT_ELF
-	MOD_DEC_USE_COUNT;
-#endif
 	return has_dumped;
 }
 #endif		/* USE_ELF_CORE_DUMP */
diff -urN linux-2.2.20-pre3/fs/binfmt_em86.c linux/fs/binfmt_em86.c
--- linux-2.2.20-pre3/fs/binfmt_em86.c	Sun Mar 25 08:30:59 2001
+++ linux/fs/binfmt_em86.c	Mon Dec  3 22:19:03 2001
@@ -103,11 +103,8 @@
 }
 
 struct linux_binfmt em86_format = {
-#ifndef MODULE
-	NULL, 0, load_em86, NULL, NULL
-#else
-	NULL, &__this_module, load_em86, NULL, NULL
-#endif
+	module:		THIS_MODULE,
+	load_binary:	load_em86,
 };
 
 int __init init_em86_binfmt(void)
diff -urN linux-2.2.20-pre3/fs/binfmt_java.c linux/fs/binfmt_java.c
--- linux-2.2.20-pre3/fs/binfmt_java.c	Sun Mar 25 08:30:59 2001
+++ linux/fs/binfmt_java.c	Mon Dec  3 22:19:03 2001
@@ -150,11 +150,8 @@
 }
 
 static struct linux_binfmt java_format = {
-#ifndef MODULE
-	NULL, 0, load_java, NULL, NULL
-#else
-	NULL, &__this_module, load_java, NULL, NULL
-#endif
+	module:		THIS_MODULE,
+	load_binary:	load_java,
 };
 
 static int load_applet(struct linux_binprm *bprm,struct pt_regs *regs)
@@ -167,11 +164,8 @@
 }
 
 static struct linux_binfmt applet_format = {
-#ifndef MODULE
-	NULL, 0, load_applet, NULL, NULL
-#else
-	NULL, &__this_module, load_applet, NULL, NULL
-#endif
+	module:		THIS_MODULE,
+	load_binary:	load_applet,
 };
 
 int __init init_java_binfmt(void)
diff -urN linux-2.2.20-pre3/fs/binfmt_misc.c linux/fs/binfmt_misc.c
--- linux-2.2.20-pre3/fs/binfmt_misc.c	Mon Dec  3 22:18:55 2001
+++ linux/fs/binfmt_misc.c	Mon Dec  3 22:19:03 2001
@@ -65,11 +65,8 @@
 static int entry_proc_setup(Node *e);
 
 static struct linux_binfmt misc_format = {
-#ifndef MODULE
-	NULL, 0, load_misc_binary, NULL, NULL
-#else
-	NULL, &__this_module, load_misc_binary, NULL, NULL
-#endif
+	module:		THIS_MODULE,
+	load_binary:	load_misc_binary,
 };
 
 static struct proc_dir_entry *bm_dir = NULL;
diff -urN linux-2.2.20-pre3/fs/binfmt_script.c linux/fs/binfmt_script.c
--- linux-2.2.20-pre3/fs/binfmt_script.c	Sun Mar 25 08:30:59 2001
+++ linux/fs/binfmt_script.c	Mon Dec  3 22:19:03 2001
@@ -100,11 +100,8 @@
 }
 
 struct linux_binfmt script_format = {
-#ifndef MODULE
-	NULL, 0, load_script, NULL, NULL
-#else
-	NULL, &__this_module, load_script, NULL, NULL
-#endif
+	module:		THIS_MODULE,
+	load_binary:	load_script,
 };
 
 int __init init_script_binfmt(void)
diff -urN linux-2.2.20-pre3/fs/dcache.c linux/fs/dcache.c
--- linux-2.2.20-pre3/fs/dcache.c	Sun Mar 25 08:37:38 2001
+++ linux/fs/dcache.c	Mon Dec  3 22:19:03 2001
@@ -702,7 +702,7 @@
  * Note that we have to be a lot more careful about getting the hash
  * switched - we have to switch the hash value properly even if it
  * then no longer matches the actual (corrupted) string of the target.
- * The has value has to match the hash queue that the dentry is on..
+ * The hash value has to match the hash queue that the dentry is on..
  */
 static inline void switch_names(struct dentry * dentry, struct dentry * target)
 {
@@ -829,7 +829,7 @@
 	struct dentry *pwd = current->fs->pwd; 
 
 	error = -ENOENT;
-	/* Has the current directory has been unlinked? */
+	/* Has the current directory been unlinked? */
 	if (pwd->d_parent == pwd || !list_empty(&pwd->d_hash)) {
 		char *page = (char *) __get_free_page(GFP_USER);
 		error = -ENOMEM;
diff -urN linux-2.2.20-pre3/fs/exec.c linux/fs/exec.c
--- linux-2.2.20-pre3/fs/exec.c	Mon Dec  3 22:18:55 2001
+++ linux/fs/exec.c	Mon Dec  3 22:19:03 2001
@@ -888,3 +888,56 @@
 
 	return retval;
 }
+
+int do_coredump(long signr, struct pt_regs * regs)
+{
+	struct linux_binfmt *binfmt;
+	char corename[6+sizeof(current->comm)];
+	struct file * file;
+	struct inode * inode;
+
+	lock_kernel();
+	binfmt = current->binfmt;
+	if (!binfmt || !binfmt->core_dump)
+		goto fail;
+	if (!current->dumpable || atomic_read(&current->mm->count) != 1)
+		goto fail;
+	if (current->rlim[RLIMIT_CORE].rlim_cur < binfmt->min_coredump)
+		goto fail;
+	current->dumpable = 0;
+
+	memcpy(corename,"core.", 5);
+#if 0
+	memcpy(corename+5,current->comm,sizeof(current->comm));
+#else
+	corename[4] = '\0';
+#endif
+	file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW, 0600);
+	if (IS_ERR(file))
+		goto fail;
+	inode = file->f_dentry->d_inode;
+	if (inode->i_nlink > 1)
+		goto close_fail;	/* multiple links - don't dump */
+	if (list_empty(&file->f_dentry->d_hash))
+		goto close_fail;
+
+	if (!S_ISREG(inode->i_mode))
+		goto close_fail;
+	if (!file->f_op)
+		goto close_fail;
+	if (!file->f_op->write)
+		goto close_fail;
+	if (do_truncate(file->f_dentry, 0) != 0)
+		goto close_fail;
+	if (!binfmt->core_dump(signr, regs, file))
+		goto close_fail;
+	filp_close(file, NULL);
+	unlock_kernel();
+	return 1;
+
+close_fail:
+	filp_close(file, NULL);
+fail:
+	unlock_kernel();
+	return 0;
+}
diff -urN linux-2.2.20-pre3/fs/nfsd/nfssvc.c linux/fs/nfsd/nfssvc.c
--- linux-2.2.20-pre3/fs/nfsd/nfssvc.c	Sun Mar 25 08:30:59 2001
+++ linux/fs/nfsd/nfssvc.c	Mon Dec  3 22:19:03 2001
@@ -6,6 +6,11 @@
  * Authors:	Olaf Kirch (okir@monad.swb.de)
  *
  * Copyright (C) 1995-1999 Olaf Kirch <okir@monad.swb.de>
+ *
+ * Apr 24, 2001: Added semaphores around nfsd_cache calls
+ * 		 to protect it since it can yeild the processor
+ * 		 in its kmalloc call.
+ * 		 Craig I. Hagan <hagan@cih.com>
  */
 
 #define __NO_VERSION__
@@ -44,6 +49,8 @@
 struct timeval			nfssvc_boot = { 0, 0 };
 static atomic_t			nfsd_active = ATOMIC_INIT(0);
 
+static struct semaphore nfsd_cache_sem = MUTEX;
+
 /*
  * Maximum number of nfsd processes
  */
@@ -81,8 +88,9 @@
 	if (error < 0)
 		goto failure;
 #endif
-
+	down(&nfsd_cache_sem);
 	nfsd_racache_init();	/* Readahead param cache */
+	up(&nfsd_cache_sem);
 
 	while (nrservs--) {
 		error = svc_create_thread(nfsd, serv);
@@ -146,7 +154,6 @@
                 if (err < 0)
                         break;
 
-
 		/* Lock the export hash tables for reading. */
 		exp_readlock();
 
@@ -160,6 +167,7 @@
 		recalc_sigpending(current);
 		spin_unlock_irq(&current->sigmask_lock);
 
+
 		svc_process(serv, rqstp);
 
 		/* Unlock export hash tables */
@@ -180,8 +188,10 @@
 
 	/* Count active threads */
 	if (atomic_dec_and_test(&nfsd_active)) {
+		down(&nfsd_cache_sem);
 		nfsd_export_shutdown();		/* revoke all exports */
 	        nfsd_racache_shutdown();	/* release read-ahead cache */
+		up(&nfsd_cache_sem);
 	}
 
 	/* Release lockd */
@@ -200,13 +210,19 @@
 	struct svc_procedure	*proc;
 	kxdrproc_t		xdr;
 	u32			nfserr;
+	int			res_lookup;
 
 	dprintk("nfsd_dispatch: vers %d proc %d\n",
 				rqstp->rq_vers, rqstp->rq_proc);
 	proc = rqstp->rq_procinfo;
 
 	/* Check whether we have this call in the cache. */
-	switch (nfsd_cache_lookup(rqstp, proc->pc_cachetype)) {
+
+	down(&nfsd_cache_sem);
+	res_lookup = nfsd_cache_lookup(rqstp, proc->pc_cachetype);
+	up(&nfsd_cache_sem);
+
+	switch (res_lookup) {
 	case RC_INTR:
 	case RC_DROPIT:
 		return 0;
@@ -220,7 +236,9 @@
 	xdr = proc->pc_decode;
 	if (xdr && !xdr(rqstp, rqstp->rq_argbuf.buf, rqstp->rq_argp)) {
 		dprintk("nfsd: failed to decode arguments!\n");
+		down(&nfsd_cache_sem);
 		nfsd_cache_update(rqstp, RC_NOCACHE, NULL);
+		up(&nfsd_cache_sem);
 		*statp = rpc_garbage_args;
 		return 1;
 	}
@@ -239,7 +257,9 @@
 		if (xdr && !xdr(rqstp, rqstp->rq_resbuf.buf, rqstp->rq_resp)) {
 			/* Failed to encode result. Release cache entry */
 			dprintk("nfsd: failed to encode result!\n");
+			down(&nfsd_cache_sem);
 			nfsd_cache_update(rqstp, RC_NOCACHE, NULL);
+			up(&nfsd_cache_sem);
 			*statp = rpc_system_err;
 			return 1;
 		}
@@ -250,14 +270,18 @@
 	 && !xdr(rqstp, rqstp->rq_resbuf.buf, rqstp->rq_resp)) {
 		/* Failed to encode result. Release cache entry */
 		dprintk("nfsd: failed to encode result!\n");
+		down(&nfsd_cache_sem);
 		nfsd_cache_update(rqstp, RC_NOCACHE, NULL);
+		up(&nfsd_cache_sem);
 		*statp = rpc_system_err;
 		return 1;
 	}
 #endif /* CONFIG_NFSD_V3 */
 
 	/* Store reply in cache. */
+	down(&nfsd_cache_sem);
 	nfsd_cache_update(rqstp, proc->pc_cachetype, statp + 1);
+	up(&nfsd_cache_sem);
 	return 1;
 }
 
diff -urN linux-2.2.20-pre3/fs/nls/nls_koi8-r.c linux/fs/nls/nls_koi8-r.c
--- linux-2.2.20-pre3/fs/nls/nls_koi8-r.c	Sun Mar 25 08:31:00 2001
+++ linux/fs/nls/nls_koi8-r.c	Mon Dec  3 22:19:03 2001
@@ -5,6 +5,7 @@
  * Generated automatically from the Unicode and charset
  * tables from the Unicode Organization (www.unicode.org).
  * The Unicode to charset table has only exact mappings.
+ * Patched to include KOI8-U and KOI8-RU support
  */
 
 #include <linux/module.h>
@@ -66,14 +67,14 @@
 	{0xb0, 0x00}, {0xb2, 0x00}, {0xb7, 0x00}, {0xf7, 0x00},
 	/* 0xa0*/
 	{0x50, 0x25}, {0x51, 0x25}, {0x52, 0x25}, {0x51, 0x04},
-	{0x53, 0x25}, {0x54, 0x25}, {0x55, 0x25}, {0x56, 0x25},
+	{0x54, 0x04}, {0x54, 0x25}, {0x56, 0x04}, {0x57, 0x04},
 	{0x57, 0x25}, {0x58, 0x25}, {0x59, 0x25}, {0x5a, 0x25},
-	{0x5b, 0x25}, {0x5c, 0x25}, {0x5d, 0x25}, {0x5e, 0x25},
+	{0x5b, 0x25}, {0x91, 0x04}, {0x5e, 0x04}, {0x5e, 0x25},
 	/* 0xb0*/
 	{0x5f, 0x25}, {0x60, 0x25}, {0x61, 0x25}, {0x01, 0x04},
-	{0x62, 0x25}, {0x63, 0x25}, {0x64, 0x25}, {0x65, 0x25},
+	{0x04, 0x04}, {0x63, 0x25}, {0x06, 0x04}, {0x07, 0x04},
 	{0x66, 0x25}, {0x67, 0x25}, {0x68, 0x25}, {0x69, 0x25},
-	{0x6a, 0x25}, {0x6b, 0x25}, {0x6c, 0x25}, {0xa9, 0x00},
+	{0x6a, 0x25}, {0x90, 0x04}, {0x0e, 0x04}, {0xa9, 0x00},
 	/* 0xc0*/
 	{0x4e, 0x04}, {0x30, 0x04}, {0x31, 0x04}, {0x46, 0x04},
 	{0x34, 0x04}, {0x35, 0x04}, {0x44, 0x04}, {0x33, 0x04},
@@ -133,8 +134,8 @@
 };
 
 static unsigned char page04[256] = {
-	0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+	0x00, 0xb3, 0x00, 0x00, 0xb4, 0x00, 0xb6, 0xb7, /* 0x00-0x07 */
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0x00, /* 0x08-0x0f */
 	0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, /* 0x10-0x17 */
 	0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, /* 0x18-0x1f */
 	0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe, /* 0x20-0x27 */
@@ -143,8 +144,8 @@
 	0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, /* 0x38-0x3f */
 	0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde, /* 0x40-0x47 */
 	0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1, /* 0x48-0x4f */
-	0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+	0x00, 0xa3, 0x00, 0x00, 0xa4, 0x00, 0xa6, 0xa7, /* 0x50-0x57 */
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0x00, /* 0x58-0x5f */
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
@@ -152,7 +153,7 @@
 
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+	0xbd, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
@@ -306,8 +307,8 @@
 	0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
 	0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
 	0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
-	0xa0, 0xa1, 0xa2, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
-	0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+	0xa0, 0xa1, 0xa2, 0x00, 0xb4, 0xa5, 0xb6, 0xb7, /* 0xa0-0xa7 */
+	0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xbd, 0xbe, 0xaf, /* 0xa8-0xaf */
 	0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
 	0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
diff -urN linux-2.2.20-pre3/fs/ntfs/support.c linux/fs/ntfs/support.c
--- linux-2.2.20-pre3/fs/ntfs/support.c	Sun Mar 25 08:31:02 2001
+++ linux/fs/ntfs/support.c	Mon Dec  3 22:19:03 2001
@@ -102,7 +102,7 @@
 	memmove(dest, src, n);
 }
 
-/* Warn that an error occured. */
+/* Warn that an error occurred. */
 void ntfs_error(const char *fmt,...)
 {
         va_list ap;
diff -urN linux-2.2.20-pre3/fs/smbfs/proc.c linux/fs/smbfs/proc.c
--- linux-2.2.20-pre3/fs/smbfs/proc.c	Mon Dec  3 22:18:55 2001
+++ linux/fs/smbfs/proc.c	Mon Dec  3 22:19:03 2001
@@ -609,7 +609,7 @@
 	 * Check for a valid connection.
 	 */
 	if (server->state == CONN_VALID) {
-		PARANOIA("sucessful, new pid=%d, generation=%d\n",
+		PARANOIA("successful, new pid=%d, generation=%d\n",
 			 server->conn_pid, server->generation);
 		result = 1;
 	}
diff -urN linux-2.2.20-pre3/include/asm-s390/ccwcache.h linux/include/asm-s390/ccwcache.h
--- linux-2.2.20-pre3/include/asm-s390/ccwcache.h	Sun Mar 25 08:37:39 2001
+++ linux/include/asm-s390/ccwcache.h	Mon Dec  3 22:19:03 2001
@@ -62,7 +62,7 @@
 #define CQR_STATUS_FILLED   0x01	/* request is ready to be preocessed */
 #define CQR_STATUS_QUEUED   0x02	/* request is queued to be processed */
 #define CQR_STATUS_IN_IO    0x04	/* request is currently in IO */
-#define CQR_STATUS_DONE     0x08	/* request is completed sucessfully */
+#define CQR_STATUS_DONE     0x08	/* request is completed successfully */
 #define CQR_STATUS_ERROR    0x10	/* request is completed with error */
 #define CQR_STATUS_FAILED   0x20	/* request is finally failed */
 #define CQR_STATUS_PENDING  0x07        /* request is waiting for interrupt - ERP only */ 
diff -urN linux-2.2.20-pre3/include/asm-s390/irq.h linux/include/asm-s390/irq.h
--- linux-2.2.20-pre3/include/asm-s390/irq.h	Sun Mar 25 08:37:39 2001
+++ linux/include/asm-s390/irq.h	Mon Dec  3 22:19:03 2001
@@ -147,7 +147,7 @@
 
 typedef struct {
       __u8  cmd_code;/* command code */
-      __u8  flags;   /* flags, like IDA adressing, etc. */
+      __u8  flags;   /* flags, like IDA addressing, etc. */
       __u16 count;   /* byte count */
       __u32 cda;     /* data address */
    } __attribute__ ((packed,aligned(8))) ccw1_t;
diff -urN linux-2.2.20-pre3/include/asm-s390/pgtable.h linux/include/asm-s390/pgtable.h
--- linux-2.2.20-pre3/include/asm-s390/pgtable.h	Sun Mar 25 08:37:39 2001
+++ linux/include/asm-s390/pgtable.h	Mon Dec  3 22:19:03 2001
@@ -711,10 +711,10 @@
 }
 
 /*
- * a page-table entry has only 19 bit for offset and 7 bit for type
- * if bits 0, 20 or 23 are set, a translation specification exceptions occures, and it's
- * hard to find out the failing address
- * therefor, we zero out this bits
+ * a page-table entry has only 19 bits for offset and 7 bits for type
+ * if bits 0, 20 or 23 are set, a translation specification exception occurs,
+ * and it's hard to find out the failing address
+ * therefore, we zero out these bits
  */
 
 #define SWP_TYPE(entry) (((entry) >> 1) & 0x3f)
diff -urN linux-2.2.20-pre3/include/asm-sparc/asm_offsets.h linux/include/asm-sparc/asm_offsets.h
--- linux-2.2.20-pre3/include/asm-sparc/asm_offsets.h	Sun Mar 25 08:37:39 2001
+++ linux/include/asm-sparc/asm_offsets.h	Mon Dec  3 22:19:03 2001
@@ -18,147 +18,149 @@
 #define ASIZ_task_exec_domain	0x00000004
 #define AOFF_task_need_resched	0x00000014
 #define ASIZ_task_need_resched	0x00000004
-#define AOFF_task_counter	0x00000018
+#define AOFF_task_ptrace	0x00000018
+#define ASIZ_task_ptrace	0x00000004
+#define AOFF_task_counter	0x0000001c
 #define ASIZ_task_counter	0x00000004
-#define AOFF_task_priority	0x0000001c
+#define AOFF_task_priority	0x00000020
 #define ASIZ_task_priority	0x00000004
-#define AOFF_task_avg_slice	0x00000020
+#define AOFF_task_avg_slice	0x00000024
 #define ASIZ_task_avg_slice	0x00000004
-#define AOFF_task_has_cpu	0x00000024
+#define AOFF_task_has_cpu	0x00000028
 #define ASIZ_task_has_cpu	0x00000004
-#define AOFF_task_processor	0x00000028
+#define AOFF_task_processor	0x0000002c
 #define ASIZ_task_processor	0x00000004
-#define AOFF_task_last_processor	0x0000002c
+#define AOFF_task_last_processor	0x00000030
 #define ASIZ_task_last_processor	0x00000004
-#define AOFF_task_lock_depth	0x00000030
+#define AOFF_task_lock_depth	0x00000034
 #define ASIZ_task_lock_depth	0x00000004
-#define AOFF_task_next_task	0x00000034
+#define AOFF_task_next_task	0x00000038
 #define ASIZ_task_next_task	0x00000004
-#define AOFF_task_prev_task	0x00000038
+#define AOFF_task_prev_task	0x0000003c
 #define ASIZ_task_prev_task	0x00000004
-#define AOFF_task_next_run	0x0000003c
+#define AOFF_task_next_run	0x00000040
 #define ASIZ_task_next_run	0x00000004
-#define AOFF_task_prev_run	0x00000040
+#define AOFF_task_prev_run	0x00000044
 #define ASIZ_task_prev_run	0x00000004
-#define AOFF_task_task_exclusive	0x00000044
+#define AOFF_task_task_exclusive	0x00000048
 #define ASIZ_task_task_exclusive	0x00000004
-#define AOFF_task_binfmt	0x00000048
+#define AOFF_task_binfmt	0x0000004c
 #define ASIZ_task_binfmt	0x00000004
-#define AOFF_task_exit_code	0x0000004c
+#define AOFF_task_exit_code	0x00000050
 #define ASIZ_task_exit_code	0x00000004
-#define AOFF_task_exit_signal	0x00000050
+#define AOFF_task_exit_signal	0x00000054
 #define ASIZ_task_exit_signal	0x00000004
-#define AOFF_task_pdeath_signal	0x00000054
+#define AOFF_task_pdeath_signal	0x00000058
 #define ASIZ_task_pdeath_signal	0x00000004
-#define AOFF_task_personality	0x00000058
+#define AOFF_task_personality	0x0000005c
 #define ASIZ_task_personality	0x00000004
-#define AOFF_task_pid	0x00000060
+#define AOFF_task_pid	0x00000064
 #define ASIZ_task_pid	0x00000004
-#define AOFF_task_pgrp	0x00000064
+#define AOFF_task_pgrp	0x00000068
 #define ASIZ_task_pgrp	0x00000004
-#define AOFF_task_tty_old_pgrp	0x00000068
+#define AOFF_task_tty_old_pgrp	0x0000006c
 #define ASIZ_task_tty_old_pgrp	0x00000004
-#define AOFF_task_session	0x0000006c
+#define AOFF_task_session	0x00000070
 #define ASIZ_task_session	0x00000004
-#define AOFF_task_leader	0x00000070
+#define AOFF_task_leader	0x00000074
 #define ASIZ_task_leader	0x00000004
-#define AOFF_task_p_opptr	0x00000074
+#define AOFF_task_p_opptr	0x00000078
 #define ASIZ_task_p_opptr	0x00000004
-#define AOFF_task_p_pptr	0x00000078
+#define AOFF_task_p_pptr	0x0000007c
 #define ASIZ_task_p_pptr	0x00000004
-#define AOFF_task_p_cptr	0x0000007c
+#define AOFF_task_p_cptr	0x00000080
 #define ASIZ_task_p_cptr	0x00000004
-#define AOFF_task_p_ysptr	0x00000080
+#define AOFF_task_p_ysptr	0x00000084
 #define ASIZ_task_p_ysptr	0x00000004
-#define AOFF_task_p_osptr	0x00000084
+#define AOFF_task_p_osptr	0x00000088
 #define ASIZ_task_p_osptr	0x00000004
-#define AOFF_task_pidhash_next	0x00000088
+#define AOFF_task_pidhash_next	0x0000008c
 #define ASIZ_task_pidhash_next	0x00000004
-#define AOFF_task_pidhash_pprev	0x0000008c
+#define AOFF_task_pidhash_pprev	0x00000090
 #define ASIZ_task_pidhash_pprev	0x00000004
-#define AOFF_task_tarray_ptr	0x00000090
+#define AOFF_task_tarray_ptr	0x00000094
 #define ASIZ_task_tarray_ptr	0x00000004
-#define AOFF_task_wait_chldexit	0x00000094
+#define AOFF_task_wait_chldexit	0x00000098
 #define ASIZ_task_wait_chldexit	0x00000004
-#define AOFF_task_vfork_sem	0x00000098
+#define AOFF_task_vfork_sem	0x0000009c
 #define ASIZ_task_vfork_sem	0x00000004
-#define AOFF_task_policy	0x0000009c
+#define AOFF_task_policy	0x000000a0
 #define ASIZ_task_policy	0x00000004
-#define AOFF_task_rt_priority	0x000000a0
+#define AOFF_task_rt_priority	0x000000a4
 #define ASIZ_task_rt_priority	0x00000004
-#define AOFF_task_it_real_value	0x000000a4
+#define AOFF_task_it_real_value	0x000000a8
 #define ASIZ_task_it_real_value	0x00000004
-#define AOFF_task_it_prof_value	0x000000a8
+#define AOFF_task_it_prof_value	0x000000ac
 #define ASIZ_task_it_prof_value	0x00000004
-#define AOFF_task_it_virt_value	0x000000ac
+#define AOFF_task_it_virt_value	0x000000b0
 #define ASIZ_task_it_virt_value	0x00000004
-#define AOFF_task_it_real_incr	0x000000b0
+#define AOFF_task_it_real_incr	0x000000b4
 #define ASIZ_task_it_real_incr	0x00000004
-#define AOFF_task_it_prof_incr	0x000000b4
+#define AOFF_task_it_prof_incr	0x000000b8
 #define ASIZ_task_it_prof_incr	0x00000004
-#define AOFF_task_it_virt_incr	0x000000b8
+#define AOFF_task_it_virt_incr	0x000000bc
 #define ASIZ_task_it_virt_incr	0x00000004
-#define AOFF_task_real_timer	0x000000bc
+#define AOFF_task_real_timer	0x000000c0
 #define ASIZ_task_real_timer	0x00000014
-#define AOFF_task_times	0x000000d0
+#define AOFF_task_times	0x000000d4
 #define ASIZ_task_times	0x00000010
-#define AOFF_task_start_time	0x000000e0
+#define AOFF_task_start_time	0x000000e4
 #define ASIZ_task_start_time	0x00000004
-#define AOFF_task_per_cpu_utime	0x000000e4
+#define AOFF_task_per_cpu_utime	0x000000e8
 #define ASIZ_task_per_cpu_utime	0x00000004
-#define AOFF_task_min_flt	0x000000ec
+#define AOFF_task_min_flt	0x000000f0
 #define ASIZ_task_min_flt	0x00000004
-#define AOFF_task_maj_flt	0x000000f0
+#define AOFF_task_maj_flt	0x000000f4
 #define ASIZ_task_maj_flt	0x00000004
-#define AOFF_task_nswap	0x000000f4
+#define AOFF_task_nswap	0x000000f8
 #define ASIZ_task_nswap	0x00000004
-#define AOFF_task_cmin_flt	0x000000f8
+#define AOFF_task_cmin_flt	0x000000fc
 #define ASIZ_task_cmin_flt	0x00000004
-#define AOFF_task_cmaj_flt	0x000000fc
+#define AOFF_task_cmaj_flt	0x00000100
 #define ASIZ_task_cmaj_flt	0x00000004
-#define AOFF_task_cnswap	0x00000100
+#define AOFF_task_cnswap	0x00000104
 #define ASIZ_task_cnswap	0x00000004
-#define AOFF_task_uid	0x00000106
+#define AOFF_task_uid	0x0000010a
 #define ASIZ_task_uid	0x00000002
-#define AOFF_task_euid	0x00000108
+#define AOFF_task_euid	0x0000010c
 #define ASIZ_task_euid	0x00000002
-#define AOFF_task_suid	0x0000010a
+#define AOFF_task_suid	0x0000010e
 #define ASIZ_task_suid	0x00000002
-#define AOFF_task_fsuid	0x0000010c
+#define AOFF_task_fsuid	0x00000110
 #define ASIZ_task_fsuid	0x00000002
-#define AOFF_task_gid	0x0000010e
+#define AOFF_task_gid	0x00000112
 #define ASIZ_task_gid	0x00000002
-#define AOFF_task_egid	0x00000110
+#define AOFF_task_egid	0x00000114
 #define ASIZ_task_egid	0x00000002
-#define AOFF_task_sgid	0x00000112
+#define AOFF_task_sgid	0x00000116
 #define ASIZ_task_sgid	0x00000002
-#define AOFF_task_fsgid	0x00000114
+#define AOFF_task_fsgid	0x00000118
 #define ASIZ_task_fsgid	0x00000002
-#define AOFF_task_ngroups	0x00000118
+#define AOFF_task_ngroups	0x0000011c
 #define ASIZ_task_ngroups	0x00000004
-#define AOFF_task_groups	0x0000011c
+#define AOFF_task_groups	0x00000120
 #define ASIZ_task_groups	0x00000040
-#define AOFF_task_cap_effective	0x0000015c
+#define AOFF_task_cap_effective	0x00000160
 #define ASIZ_task_cap_effective	0x00000004
-#define AOFF_task_cap_inheritable	0x00000160
+#define AOFF_task_cap_inheritable	0x00000164
 #define ASIZ_task_cap_inheritable	0x00000004
-#define AOFF_task_cap_permitted	0x00000164
+#define AOFF_task_cap_permitted	0x00000168
 #define ASIZ_task_cap_permitted	0x00000004
-#define AOFF_task_user	0x0000016c
+#define AOFF_task_user	0x00000170
 #define ASIZ_task_user	0x00000004
-#define AOFF_task_rlim	0x00000170
+#define AOFF_task_rlim	0x00000174
 #define ASIZ_task_rlim	0x00000050
-#define AOFF_task_used_math	0x000001c0
+#define AOFF_task_used_math	0x000001c4
 #define ASIZ_task_used_math	0x00000002
-#define AOFF_task_comm	0x000001c2
+#define AOFF_task_comm	0x000001c6
 #define ASIZ_task_comm	0x00000010
-#define AOFF_task_link_count	0x000001d4
+#define AOFF_task_link_count	0x000001d8
 #define ASIZ_task_link_count	0x00000004
-#define AOFF_task_tty	0x000001d8
+#define AOFF_task_tty	0x000001dc
 #define ASIZ_task_tty	0x00000004
-#define AOFF_task_semundo	0x000001dc
+#define AOFF_task_semundo	0x000001e0
 #define ASIZ_task_semundo	0x00000004
-#define AOFF_task_semsleeping	0x000001e0
+#define AOFF_task_semsleeping	0x000001e4
 #define ASIZ_task_semsleeping	0x00000004
 #define AOFF_task_tss	0x000001e8
 #define ASIZ_task_tss	0x00000388
@@ -309,147 +311,149 @@
 #define ASIZ_task_exec_domain	0x00000004
 #define AOFF_task_need_resched	0x00000014
 #define ASIZ_task_need_resched	0x00000004
-#define AOFF_task_counter	0x00000018
+#define AOFF_task_ptrace	0x00000018
+#define ASIZ_task_ptrace	0x00000004
+#define AOFF_task_counter	0x0000001c
 #define ASIZ_task_counter	0x00000004
-#define AOFF_task_priority	0x0000001c
+#define AOFF_task_priority	0x00000020
 #define ASIZ_task_priority	0x00000004
-#define AOFF_task_avg_slice	0x00000020
+#define AOFF_task_avg_slice	0x00000024
 #define ASIZ_task_avg_slice	0x00000004
-#define AOFF_task_has_cpu	0x00000024
+#define AOFF_task_has_cpu	0x00000028
 #define ASIZ_task_has_cpu	0x00000004
-#define AOFF_task_processor	0x00000028
+#define AOFF_task_processor	0x0000002c
 #define ASIZ_task_processor	0x00000004
-#define AOFF_task_last_processor	0x0000002c
+#define AOFF_task_last_processor	0x00000030
 #define ASIZ_task_last_processor	0x00000004
-#define AOFF_task_lock_depth	0x00000030
+#define AOFF_task_lock_depth	0x00000034
 #define ASIZ_task_lock_depth	0x00000004
-#define AOFF_task_next_task	0x00000034
+#define AOFF_task_next_task	0x00000038
 #define ASIZ_task_next_task	0x00000004
-#define AOFF_task_prev_task	0x00000038
+#define AOFF_task_prev_task	0x0000003c
 #define ASIZ_task_prev_task	0x00000004
-#define AOFF_task_next_run	0x0000003c
+#define AOFF_task_next_run	0x00000040
 #define ASIZ_task_next_run	0x00000004
-#define AOFF_task_prev_run	0x00000040
+#define AOFF_task_prev_run	0x00000044
 #define ASIZ_task_prev_run	0x00000004
-#define AOFF_task_task_exclusive	0x00000044
+#define AOFF_task_task_exclusive	0x00000048
 #define ASIZ_task_task_exclusive	0x00000004
-#define AOFF_task_binfmt	0x00000048
+#define AOFF_task_binfmt	0x0000004c
 #define ASIZ_task_binfmt	0x00000004
-#define AOFF_task_exit_code	0x0000004c
+#define AOFF_task_exit_code	0x00000050
 #define ASIZ_task_exit_code	0x00000004
-#define AOFF_task_exit_signal	0x00000050
+#define AOFF_task_exit_signal	0x00000054
 #define ASIZ_task_exit_signal	0x00000004
-#define AOFF_task_pdeath_signal	0x00000054
+#define AOFF_task_pdeath_signal	0x00000058
 #define ASIZ_task_pdeath_signal	0x00000004
-#define AOFF_task_personality	0x00000058
+#define AOFF_task_personality	0x0000005c
 #define ASIZ_task_personality	0x00000004
-#define AOFF_task_pid	0x00000060
+#define AOFF_task_pid	0x00000064
 #define ASIZ_task_pid	0x00000004
-#define AOFF_task_pgrp	0x00000064
+#define AOFF_task_pgrp	0x00000068
 #define ASIZ_task_pgrp	0x00000004
-#define AOFF_task_tty_old_pgrp	0x00000068
+#define AOFF_task_tty_old_pgrp	0x0000006c
 #define ASIZ_task_tty_old_pgrp	0x00000004
-#define AOFF_task_session	0x0000006c
+#define AOFF_task_session	0x00000070
 #define ASIZ_task_session	0x00000004
-#define AOFF_task_leader	0x00000070
+#define AOFF_task_leader	0x00000074
 #define ASIZ_task_leader	0x00000004
-#define AOFF_task_p_opptr	0x00000074
+#define AOFF_task_p_opptr	0x00000078
 #define ASIZ_task_p_opptr	0x00000004
-#define AOFF_task_p_pptr	0x00000078
+#define AOFF_task_p_pptr	0x0000007c
 #define ASIZ_task_p_pptr	0x00000004
-#define AOFF_task_p_cptr	0x0000007c
+#define AOFF_task_p_cptr	0x00000080
 #define ASIZ_task_p_cptr	0x00000004
-#define AOFF_task_p_ysptr	0x00000080
+#define AOFF_task_p_ysptr	0x00000084
 #define ASIZ_task_p_ysptr	0x00000004
-#define AOFF_task_p_osptr	0x00000084
+#define AOFF_task_p_osptr	0x00000088
 #define ASIZ_task_p_osptr	0x00000004
-#define AOFF_task_pidhash_next	0x00000088
+#define AOFF_task_pidhash_next	0x0000008c
 #define ASIZ_task_pidhash_next	0x00000004
-#define AOFF_task_pidhash_pprev	0x0000008c
+#define AOFF_task_pidhash_pprev	0x00000090
 #define ASIZ_task_pidhash_pprev	0x00000004
-#define AOFF_task_tarray_ptr	0x00000090
+#define AOFF_task_tarray_ptr	0x00000094
 #define ASIZ_task_tarray_ptr	0x00000004
-#define AOFF_task_wait_chldexit	0x00000094
+#define AOFF_task_wait_chldexit	0x00000098
 #define ASIZ_task_wait_chldexit	0x00000004
-#define AOFF_task_vfork_sem	0x00000098
+#define AOFF_task_vfork_sem	0x0000009c
 #define ASIZ_task_vfork_sem	0x00000004
-#define AOFF_task_policy	0x0000009c
+#define AOFF_task_policy	0x000000a0
 #define ASIZ_task_policy	0x00000004
-#define AOFF_task_rt_priority	0x000000a0
+#define AOFF_task_rt_priority	0x000000a4
 #define ASIZ_task_rt_priority	0x00000004
-#define AOFF_task_it_real_value	0x000000a4
+#define AOFF_task_it_real_value	0x000000a8
 #define ASIZ_task_it_real_value	0x00000004
-#define AOFF_task_it_prof_value	0x000000a8
+#define AOFF_task_it_prof_value	0x000000ac
 #define ASIZ_task_it_prof_value	0x00000004
-#define AOFF_task_it_virt_value	0x000000ac
+#define AOFF_task_it_virt_value	0x000000b0
 #define ASIZ_task_it_virt_value	0x00000004
-#define AOFF_task_it_real_incr	0x000000b0
+#define AOFF_task_it_real_incr	0x000000b4
 #define ASIZ_task_it_real_incr	0x00000004
-#define AOFF_task_it_prof_incr	0x000000b4
+#define AOFF_task_it_prof_incr	0x000000b8
 #define ASIZ_task_it_prof_incr	0x00000004
-#define AOFF_task_it_virt_incr	0x000000b8
+#define AOFF_task_it_virt_incr	0x000000bc
 #define ASIZ_task_it_virt_incr	0x00000004
-#define AOFF_task_real_timer	0x000000bc
+#define AOFF_task_real_timer	0x000000c0
 #define ASIZ_task_real_timer	0x00000014
-#define AOFF_task_times	0x000000d0
+#define AOFF_task_times	0x000000d4
 #define ASIZ_task_times	0x00000010
-#define AOFF_task_start_time	0x000000e0
+#define AOFF_task_start_time	0x000000e4
 #define ASIZ_task_start_time	0x00000004
-#define AOFF_task_per_cpu_utime	0x000000e4
+#define AOFF_task_per_cpu_utime	0x000000e8
 #define ASIZ_task_per_cpu_utime	0x00000080
-#define AOFF_task_min_flt	0x000001e4
+#define AOFF_task_min_flt	0x000001e8
 #define ASIZ_task_min_flt	0x00000004
-#define AOFF_task_maj_flt	0x000001e8
+#define AOFF_task_maj_flt	0x000001ec
 #define ASIZ_task_maj_flt	0x00000004
-#define AOFF_task_nswap	0x000001ec
+#define AOFF_task_nswap	0x000001f0
 #define ASIZ_task_nswap	0x00000004
-#define AOFF_task_cmin_flt	0x000001f0
+#define AOFF_task_cmin_flt	0x000001f4
 #define ASIZ_task_cmin_flt	0x00000004
-#define AOFF_task_cmaj_flt	0x000001f4
+#define AOFF_task_cmaj_flt	0x000001f8
 #define ASIZ_task_cmaj_flt	0x00000004
-#define AOFF_task_cnswap	0x000001f8
+#define AOFF_task_cnswap	0x000001fc
 #define ASIZ_task_cnswap	0x00000004
-#define AOFF_task_uid	0x000001fe
+#define AOFF_task_uid	0x00000202
 #define ASIZ_task_uid	0x00000002
-#define AOFF_task_euid	0x00000200
+#define AOFF_task_euid	0x00000204
 #define ASIZ_task_euid	0x00000002
-#define AOFF_task_suid	0x00000202
+#define AOFF_task_suid	0x00000206
 #define ASIZ_task_suid	0x00000002
-#define AOFF_task_fsuid	0x00000204
+#define AOFF_task_fsuid	0x00000208
 #define ASIZ_task_fsuid	0x00000002
-#define AOFF_task_gid	0x00000206
+#define AOFF_task_gid	0x0000020a
 #define ASIZ_task_gid	0x00000002
-#define AOFF_task_egid	0x00000208
+#define AOFF_task_egid	0x0000020c
 #define ASIZ_task_egid	0x00000002
-#define AOFF_task_sgid	0x0000020a
+#define AOFF_task_sgid	0x0000020e
 #define ASIZ_task_sgid	0x00000002
-#define AOFF_task_fsgid	0x0000020c
+#define AOFF_task_fsgid	0x00000210
 #define ASIZ_task_fsgid	0x00000002
-#define AOFF_task_ngroups	0x00000210
+#define AOFF_task_ngroups	0x00000214
 #define ASIZ_task_ngroups	0x00000004
-#define AOFF_task_groups	0x00000214
+#define AOFF_task_groups	0x00000218
 #define ASIZ_task_groups	0x00000040
-#define AOFF_task_cap_effective	0x00000254
+#define AOFF_task_cap_effective	0x00000258
 #define ASIZ_task_cap_effective	0x00000004
-#define AOFF_task_cap_inheritable	0x00000258
+#define AOFF_task_cap_inheritable	0x0000025c
 #define ASIZ_task_cap_inheritable	0x00000004
-#define AOFF_task_cap_permitted	0x0000025c
+#define AOFF_task_cap_permitted	0x00000260
 #define ASIZ_task_cap_permitted	0x00000004
-#define AOFF_task_user	0x00000264
+#define AOFF_task_user	0x00000268
 #define ASIZ_task_user	0x00000004
-#define AOFF_task_rlim	0x00000268
+#define AOFF_task_rlim	0x0000026c
 #define ASIZ_task_rlim	0x00000050
-#define AOFF_task_used_math	0x000002b8
+#define AOFF_task_used_math	0x000002bc
 #define ASIZ_task_used_math	0x00000002
-#define AOFF_task_comm	0x000002ba
+#define AOFF_task_comm	0x000002be
 #define ASIZ_task_comm	0x00000010
-#define AOFF_task_link_count	0x000002cc
+#define AOFF_task_link_count	0x000002d0
 #define ASIZ_task_link_count	0x00000004
-#define AOFF_task_tty	0x000002d0
+#define AOFF_task_tty	0x000002d4
 #define ASIZ_task_tty	0x00000004
-#define AOFF_task_semundo	0x000002d4
+#define AOFF_task_semundo	0x000002d8
 #define ASIZ_task_semundo	0x00000004
-#define AOFF_task_semsleeping	0x000002d8
+#define AOFF_task_semsleeping	0x000002dc
 #define ASIZ_task_semsleeping	0x00000004
 #define AOFF_task_tss	0x000002e0
 #define ASIZ_task_tss	0x00000388
diff -urN linux-2.2.20-pre3/include/asm-sparc64/asm_offsets.h linux/include/asm-sparc64/asm_offsets.h
--- linux-2.2.20-pre3/include/asm-sparc64/asm_offsets.h	Sun Mar 25 08:37:39 2001
+++ linux/include/asm-sparc64/asm_offsets.h	Mon Dec  3 22:19:03 2001
@@ -18,147 +18,149 @@
 #define ASIZ_task_exec_domain	0x00000008
 #define AOFF_task_need_resched	0x00000028
 #define ASIZ_task_need_resched	0x00000008
-#define AOFF_task_counter	0x00000030
+#define AOFF_task_ptrace	0x00000030
+#define ASIZ_task_ptrace	0x00000008
+#define AOFF_task_counter	0x00000038
 #define ASIZ_task_counter	0x00000008
-#define AOFF_task_priority	0x00000038
+#define AOFF_task_priority	0x00000040
 #define ASIZ_task_priority	0x00000008
-#define AOFF_task_avg_slice	0x00000040
+#define AOFF_task_avg_slice	0x00000048
 #define ASIZ_task_avg_slice	0x00000008
-#define AOFF_task_has_cpu	0x00000048
+#define AOFF_task_has_cpu	0x00000050
 #define ASIZ_task_has_cpu	0x00000004
-#define AOFF_task_processor	0x0000004c
+#define AOFF_task_processor	0x00000054
 #define ASIZ_task_processor	0x00000004
-#define AOFF_task_last_processor	0x00000050
+#define AOFF_task_last_processor	0x00000058
 #define ASIZ_task_last_processor	0x00000004
-#define AOFF_task_lock_depth	0x00000054
+#define AOFF_task_lock_depth	0x0000005c
 #define ASIZ_task_lock_depth	0x00000004
-#define AOFF_task_next_task	0x00000058
+#define AOFF_task_next_task	0x00000060
 #define ASIZ_task_next_task	0x00000008
-#define AOFF_task_prev_task	0x00000060
+#define AOFF_task_prev_task	0x00000068
 #define ASIZ_task_prev_task	0x00000008
-#define AOFF_task_next_run	0x00000068
+#define AOFF_task_next_run	0x00000070
 #define ASIZ_task_next_run	0x00000008
-#define AOFF_task_prev_run	0x00000070
+#define AOFF_task_prev_run	0x00000078
 #define ASIZ_task_prev_run	0x00000008
-#define AOFF_task_task_exclusive	0x00000078
+#define AOFF_task_task_exclusive	0x00000080
 #define ASIZ_task_task_exclusive	0x00000004
-#define AOFF_task_binfmt	0x00000080
+#define AOFF_task_binfmt	0x00000088
 #define ASIZ_task_binfmt	0x00000008
-#define AOFF_task_exit_code	0x00000088
+#define AOFF_task_exit_code	0x00000090
 #define ASIZ_task_exit_code	0x00000004
-#define AOFF_task_exit_signal	0x0000008c
+#define AOFF_task_exit_signal	0x00000094
 #define ASIZ_task_exit_signal	0x00000004
-#define AOFF_task_pdeath_signal	0x00000090
+#define AOFF_task_pdeath_signal	0x00000098
 #define ASIZ_task_pdeath_signal	0x00000004
-#define AOFF_task_personality	0x00000098
+#define AOFF_task_personality	0x000000a0
 #define ASIZ_task_personality	0x00000008
-#define AOFF_task_pid	0x000000a4
+#define AOFF_task_pid	0x000000ac
 #define ASIZ_task_pid	0x00000004
-#define AOFF_task_pgrp	0x000000a8
+#define AOFF_task_pgrp	0x000000b0
 #define ASIZ_task_pgrp	0x00000004
-#define AOFF_task_tty_old_pgrp	0x000000ac
+#define AOFF_task_tty_old_pgrp	0x000000b4
 #define ASIZ_task_tty_old_pgrp	0x00000004
-#define AOFF_task_session	0x000000b0
+#define AOFF_task_session	0x000000b8
 #define ASIZ_task_session	0x00000004
-#define AOFF_task_leader	0x000000b4
+#define AOFF_task_leader	0x000000bc
 #define ASIZ_task_leader	0x00000004
-#define AOFF_task_p_opptr	0x000000b8
+#define AOFF_task_p_opptr	0x000000c0
 #define ASIZ_task_p_opptr	0x00000008
-#define AOFF_task_p_pptr	0x000000c0
+#define AOFF_task_p_pptr	0x000000c8
 #define ASIZ_task_p_pptr	0x00000008
-#define AOFF_task_p_cptr	0x000000c8
+#define AOFF_task_p_cptr	0x000000d0
 #define ASIZ_task_p_cptr	0x00000008
-#define AOFF_task_p_ysptr	0x000000d0
+#define AOFF_task_p_ysptr	0x000000d8
 #define ASIZ_task_p_ysptr	0x00000008
-#define AOFF_task_p_osptr	0x000000d8
+#define AOFF_task_p_osptr	0x000000e0
 #define ASIZ_task_p_osptr	0x00000008
-#define AOFF_task_pidhash_next	0x000000e0
+#define AOFF_task_pidhash_next	0x000000e8
 #define ASIZ_task_pidhash_next	0x00000008
-#define AOFF_task_pidhash_pprev	0x000000e8
+#define AOFF_task_pidhash_pprev	0x000000f0
 #define ASIZ_task_pidhash_pprev	0x00000008
-#define AOFF_task_tarray_ptr	0x000000f0
+#define AOFF_task_tarray_ptr	0x000000f8
 #define ASIZ_task_tarray_ptr	0x00000008
-#define AOFF_task_wait_chldexit	0x000000f8
+#define AOFF_task_wait_chldexit	0x00000100
 #define ASIZ_task_wait_chldexit	0x00000008
-#define AOFF_task_vfork_sem	0x00000100
+#define AOFF_task_vfork_sem	0x00000108
 #define ASIZ_task_vfork_sem	0x00000008
-#define AOFF_task_policy	0x00000108
+#define AOFF_task_policy	0x00000110
 #define ASIZ_task_policy	0x00000008
-#define AOFF_task_rt_priority	0x00000110
+#define AOFF_task_rt_priority	0x00000118
 #define ASIZ_task_rt_priority	0x00000008
-#define AOFF_task_it_real_value	0x00000118
+#define AOFF_task_it_real_value	0x00000120
 #define ASIZ_task_it_real_value	0x00000008
-#define AOFF_task_it_prof_value	0x00000120
+#define AOFF_task_it_prof_value	0x00000128
 #define ASIZ_task_it_prof_value	0x00000008
-#define AOFF_task_it_virt_value	0x00000128
+#define AOFF_task_it_virt_value	0x00000130
 #define ASIZ_task_it_virt_value	0x00000008
-#define AOFF_task_it_real_incr	0x00000130
+#define AOFF_task_it_real_incr	0x00000138
 #define ASIZ_task_it_real_incr	0x00000008
-#define AOFF_task_it_prof_incr	0x00000138
+#define AOFF_task_it_prof_incr	0x00000140
 #define ASIZ_task_it_prof_incr	0x00000008
-#define AOFF_task_it_virt_incr	0x00000140
+#define AOFF_task_it_virt_incr	0x00000148
 #define ASIZ_task_it_virt_incr	0x00000008
-#define AOFF_task_real_timer	0x00000148
+#define AOFF_task_real_timer	0x00000150
 #define ASIZ_task_real_timer	0x00000028
-#define AOFF_task_times	0x00000170
+#define AOFF_task_times	0x00000178
 #define ASIZ_task_times	0x00000020
-#define AOFF_task_start_time	0x00000190
+#define AOFF_task_start_time	0x00000198
 #define ASIZ_task_start_time	0x00000008
-#define AOFF_task_per_cpu_utime	0x00000198
+#define AOFF_task_per_cpu_utime	0x000001a0
 #define ASIZ_task_per_cpu_utime	0x00000008
-#define AOFF_task_min_flt	0x000001a8
+#define AOFF_task_min_flt	0x000001b0
 #define ASIZ_task_min_flt	0x00000008
-#define AOFF_task_maj_flt	0x000001b0
+#define AOFF_task_maj_flt	0x000001b8
 #define ASIZ_task_maj_flt	0x00000008
-#define AOFF_task_nswap	0x000001b8
+#define AOFF_task_nswap	0x000001c0
 #define ASIZ_task_nswap	0x00000008
-#define AOFF_task_cmin_flt	0x000001c0
+#define AOFF_task_cmin_flt	0x000001c8
 #define ASIZ_task_cmin_flt	0x00000008
-#define AOFF_task_cmaj_flt	0x000001c8
+#define AOFF_task_cmaj_flt	0x000001d0
 #define ASIZ_task_cmaj_flt	0x00000008
-#define AOFF_task_cnswap	0x000001d0
+#define AOFF_task_cnswap	0x000001d8
 #define ASIZ_task_cnswap	0x00000008
-#define AOFF_task_uid	0x000001dc
+#define AOFF_task_uid	0x000001e4
 #define ASIZ_task_uid	0x00000004
-#define AOFF_task_euid	0x000001e0
+#define AOFF_task_euid	0x000001e8
 #define ASIZ_task_euid	0x00000004
-#define AOFF_task_suid	0x000001e4
+#define AOFF_task_suid	0x000001ec
 #define ASIZ_task_suid	0x00000004
-#define AOFF_task_fsuid	0x000001e8
+#define AOFF_task_fsuid	0x000001f0
 #define ASIZ_task_fsuid	0x00000004
-#define AOFF_task_gid	0x000001ec
+#define AOFF_task_gid	0x000001f4
 #define ASIZ_task_gid	0x00000004
-#define AOFF_task_egid	0x000001f0
+#define AOFF_task_egid	0x000001f8
 #define ASIZ_task_egid	0x00000004
-#define AOFF_task_sgid	0x000001f4
+#define AOFF_task_sgid	0x000001fc
 #define ASIZ_task_sgid	0x00000004
-#define AOFF_task_fsgid	0x000001f8
+#define AOFF_task_fsgid	0x00000200
 #define ASIZ_task_fsgid	0x00000004
-#define AOFF_task_ngroups	0x000001fc
+#define AOFF_task_ngroups	0x00000204
 #define ASIZ_task_ngroups	0x00000004
-#define AOFF_task_groups	0x00000200
+#define AOFF_task_groups	0x00000208
 #define ASIZ_task_groups	0x00000080
-#define AOFF_task_cap_effective	0x00000280
+#define AOFF_task_cap_effective	0x00000288
 #define ASIZ_task_cap_effective	0x00000004
-#define AOFF_task_cap_inheritable	0x00000284
+#define AOFF_task_cap_inheritable	0x0000028c
 #define ASIZ_task_cap_inheritable	0x00000004
-#define AOFF_task_cap_permitted	0x00000288
+#define AOFF_task_cap_permitted	0x00000290
 #define ASIZ_task_cap_permitted	0x00000004
-#define AOFF_task_user	0x00000290
+#define AOFF_task_user	0x00000298
 #define ASIZ_task_user	0x00000008
-#define AOFF_task_rlim	0x00000298
+#define AOFF_task_rlim	0x000002a0
 #define ASIZ_task_rlim	0x000000a0
-#define AOFF_task_used_math	0x00000338
+#define AOFF_task_used_math	0x00000340
 #define ASIZ_task_used_math	0x00000002
-#define AOFF_task_comm	0x0000033a
+#define AOFF_task_comm	0x00000342
 #define ASIZ_task_comm	0x00000010
-#define AOFF_task_link_count	0x0000034c
+#define AOFF_task_link_count	0x00000354
 #define ASIZ_task_link_count	0x00000004
-#define AOFF_task_tty	0x00000350
+#define AOFF_task_tty	0x00000358
 #define ASIZ_task_tty	0x00000008
-#define AOFF_task_semundo	0x00000358
+#define AOFF_task_semundo	0x00000360
 #define ASIZ_task_semundo	0x00000008
-#define AOFF_task_semsleeping	0x00000360
+#define AOFF_task_semsleeping	0x00000368
 #define ASIZ_task_semsleeping	0x00000008
 #define AOFF_task_tss	0x00000370
 #define ASIZ_task_tss	0x00000470
@@ -320,147 +322,149 @@
 #define ASIZ_task_exec_domain	0x00000008
 #define AOFF_task_need_resched	0x00000028
 #define ASIZ_task_need_resched	0x00000008
-#define AOFF_task_counter	0x00000030
+#define AOFF_task_ptrace	0x00000030
+#define ASIZ_task_ptrace	0x00000008
+#define AOFF_task_counter	0x00000038
 #define ASIZ_task_counter	0x00000008
-#define AOFF_task_priority	0x00000038
+#define AOFF_task_priority	0x00000040
 #define ASIZ_task_priority	0x00000008
-#define AOFF_task_avg_slice	0x00000040
+#define AOFF_task_avg_slice	0x00000048
 #define ASIZ_task_avg_slice	0x00000008
-#define AOFF_task_has_cpu	0x00000048
+#define AOFF_task_has_cpu	0x00000050
 #define ASIZ_task_has_cpu	0x00000004
-#define AOFF_task_processor	0x0000004c
+#define AOFF_task_processor	0x00000054
 #define ASIZ_task_processor	0x00000004
-#define AOFF_task_last_processor	0x00000050
+#define AOFF_task_last_processor	0x00000058
 #define ASIZ_task_last_processor	0x00000004
-#define AOFF_task_lock_depth	0x00000054
+#define AOFF_task_lock_depth	0x0000005c
 #define ASIZ_task_lock_depth	0x00000004
-#define AOFF_task_next_task	0x00000058
+#define AOFF_task_next_task	0x00000060
 #define ASIZ_task_next_task	0x00000008
-#define AOFF_task_prev_task	0x00000060
+#define AOFF_task_prev_task	0x00000068
 #define ASIZ_task_prev_task	0x00000008
-#define AOFF_task_next_run	0x00000068
+#define AOFF_task_next_run	0x00000070
 #define ASIZ_task_next_run	0x00000008
-#define AOFF_task_prev_run	0x00000070
+#define AOFF_task_prev_run	0x00000078
 #define ASIZ_task_prev_run	0x00000008
-#define AOFF_task_task_exclusive	0x00000078
+#define AOFF_task_task_exclusive	0x00000080
 #define ASIZ_task_task_exclusive	0x00000004
-#define AOFF_task_binfmt	0x00000080
+#define AOFF_task_binfmt	0x00000088
 #define ASIZ_task_binfmt	0x00000008
-#define AOFF_task_exit_code	0x00000088
+#define AOFF_task_exit_code	0x00000090
 #define ASIZ_task_exit_code	0x00000004
-#define AOFF_task_exit_signal	0x0000008c
+#define AOFF_task_exit_signal	0x00000094
 #define ASIZ_task_exit_signal	0x00000004
-#define AOFF_task_pdeath_signal	0x00000090
+#define AOFF_task_pdeath_signal	0x00000098
 #define ASIZ_task_pdeath_signal	0x00000004
-#define AOFF_task_personality	0x00000098
+#define AOFF_task_personality	0x000000a0
 #define ASIZ_task_personality	0x00000008
-#define AOFF_task_pid	0x000000a4
+#define AOFF_task_pid	0x000000ac
 #define ASIZ_task_pid	0x00000004
-#define AOFF_task_pgrp	0x000000a8
+#define AOFF_task_pgrp	0x000000b0
 #define ASIZ_task_pgrp	0x00000004
-#define AOFF_task_tty_old_pgrp	0x000000ac
+#define AOFF_task_tty_old_pgrp	0x000000b4
 #define ASIZ_task_tty_old_pgrp	0x00000004
-#define AOFF_task_session	0x000000b0
+#define AOFF_task_session	0x000000b8
 #define ASIZ_task_session	0x00000004
-#define AOFF_task_leader	0x000000b4
+#define AOFF_task_leader	0x000000bc
 #define ASIZ_task_leader	0x00000004
-#define AOFF_task_p_opptr	0x000000b8
+#define AOFF_task_p_opptr	0x000000c0
 #define ASIZ_task_p_opptr	0x00000008
-#define AOFF_task_p_pptr	0x000000c0
+#define AOFF_task_p_pptr	0x000000c8
 #define ASIZ_task_p_pptr	0x00000008
-#define AOFF_task_p_cptr	0x000000c8
+#define AOFF_task_p_cptr	0x000000d0
 #define ASIZ_task_p_cptr	0x00000008
-#define AOFF_task_p_ysptr	0x000000d0
+#define AOFF_task_p_ysptr	0x000000d8
 #define ASIZ_task_p_ysptr	0x00000008
-#define AOFF_task_p_osptr	0x000000d8
+#define AOFF_task_p_osptr	0x000000e0
 #define ASIZ_task_p_osptr	0x00000008
-#define AOFF_task_pidhash_next	0x000000e0
+#define AOFF_task_pidhash_next	0x000000e8
 #define ASIZ_task_pidhash_next	0x00000008
-#define AOFF_task_pidhash_pprev	0x000000e8
+#define AOFF_task_pidhash_pprev	0x000000f0
 #define ASIZ_task_pidhash_pprev	0x00000008
-#define AOFF_task_tarray_ptr	0x000000f0
+#define AOFF_task_tarray_ptr	0x000000f8
 #define ASIZ_task_tarray_ptr	0x00000008
-#define AOFF_task_wait_chldexit	0x000000f8
+#define AOFF_task_wait_chldexit	0x00000100
 #define ASIZ_task_wait_chldexit	0x00000008
-#define AOFF_task_vfork_sem	0x00000100
+#define AOFF_task_vfork_sem	0x00000108
 #define ASIZ_task_vfork_sem	0x00000008
-#define AOFF_task_policy	0x00000108
+#define AOFF_task_policy	0x00000110
 #define ASIZ_task_policy	0x00000008
-#define AOFF_task_rt_priority	0x00000110
+#define AOFF_task_rt_priority	0x00000118
 #define ASIZ_task_rt_priority	0x00000008
-#define AOFF_task_it_real_value	0x00000118
+#define AOFF_task_it_real_value	0x00000120
 #define ASIZ_task_it_real_value	0x00000008
-#define AOFF_task_it_prof_value	0x00000120
+#define AOFF_task_it_prof_value	0x00000128
 #define ASIZ_task_it_prof_value	0x00000008
-#define AOFF_task_it_virt_value	0x00000128
+#define AOFF_task_it_virt_value	0x00000130
 #define ASIZ_task_it_virt_value	0x00000008
-#define AOFF_task_it_real_incr	0x00000130
+#define AOFF_task_it_real_incr	0x00000138
 #define ASIZ_task_it_real_incr	0x00000008
-#define AOFF_task_it_prof_incr	0x00000138
+#define AOFF_task_it_prof_incr	0x00000140
 #define ASIZ_task_it_prof_incr	0x00000008
-#define AOFF_task_it_virt_incr	0x00000140
+#define AOFF_task_it_virt_incr	0x00000148
 #define ASIZ_task_it_virt_incr	0x00000008
-#define AOFF_task_real_timer	0x00000148
+#define AOFF_task_real_timer	0x00000150
 #define ASIZ_task_real_timer	0x00000028
-#define AOFF_task_times	0x00000170
+#define AOFF_task_times	0x00000178
 #define ASIZ_task_times	0x00000020
-#define AOFF_task_start_time	0x00000190
+#define AOFF_task_start_time	0x00000198
 #define ASIZ_task_start_time	0x00000008
-#define AOFF_task_per_cpu_utime	0x00000198
+#define AOFF_task_per_cpu_utime	0x000001a0
 #define ASIZ_task_per_cpu_utime	0x00000100
-#define AOFF_task_min_flt	0x00000398
+#define AOFF_task_min_flt	0x000003a0
 #define ASIZ_task_min_flt	0x00000008
-#define AOFF_task_maj_flt	0x000003a0
+#define AOFF_task_maj_flt	0x000003a8
 #define ASIZ_task_maj_flt	0x00000008
-#define AOFF_task_nswap	0x000003a8
+#define AOFF_task_nswap	0x000003b0
 #define ASIZ_task_nswap	0x00000008
-#define AOFF_task_cmin_flt	0x000003b0
+#define AOFF_task_cmin_flt	0x000003b8
 #define ASIZ_task_cmin_flt	0x00000008
-#define AOFF_task_cmaj_flt	0x000003b8
+#define AOFF_task_cmaj_flt	0x000003c0
 #define ASIZ_task_cmaj_flt	0x00000008
-#define AOFF_task_cnswap	0x000003c0
+#define AOFF_task_cnswap	0x000003c8
 #define ASIZ_task_cnswap	0x00000008
-#define AOFF_task_uid	0x000003cc
+#define AOFF_task_uid	0x000003d4
 #define ASIZ_task_uid	0x00000004
-#define AOFF_task_euid	0x000003d0
+#define AOFF_task_euid	0x000003d8
 #define ASIZ_task_euid	0x00000004
-#define AOFF_task_suid	0x000003d4
+#define AOFF_task_suid	0x000003dc
 #define ASIZ_task_suid	0x00000004
-#define AOFF_task_fsuid	0x000003d8
+#define AOFF_task_fsuid	0x000003e0
 #define ASIZ_task_fsuid	0x00000004
-#define AOFF_task_gid	0x000003dc
+#define AOFF_task_gid	0x000003e4
 #define ASIZ_task_gid	0x00000004
-#define AOFF_task_egid	0x000003e0
+#define AOFF_task_egid	0x000003e8
 #define ASIZ_task_egid	0x00000004
-#define AOFF_task_sgid	0x000003e4
+#define AOFF_task_sgid	0x000003ec
 #define ASIZ_task_sgid	0x00000004
-#define AOFF_task_fsgid	0x000003e8
+#define AOFF_task_fsgid	0x000003f0
 #define ASIZ_task_fsgid	0x00000004
-#define AOFF_task_ngroups	0x000003ec
+#define AOFF_task_ngroups	0x000003f4
 #define ASIZ_task_ngroups	0x00000004
-#define AOFF_task_groups	0x000003f0
+#define AOFF_task_groups	0x000003f8
 #define ASIZ_task_groups	0x00000080
-#define AOFF_task_cap_effective	0x00000470
+#define AOFF_task_cap_effective	0x00000478
 #define ASIZ_task_cap_effective	0x00000004
-#define AOFF_task_cap_inheritable	0x00000474
+#define AOFF_task_cap_inheritable	0x0000047c
 #define ASIZ_task_cap_inheritable	0x00000004
-#define AOFF_task_cap_permitted	0x00000478
+#define AOFF_task_cap_permitted	0x00000480
 #define ASIZ_task_cap_permitted	0x00000004
-#define AOFF_task_user	0x00000480
+#define AOFF_task_user	0x00000488
 #define ASIZ_task_user	0x00000008
-#define AOFF_task_rlim	0x00000488
+#define AOFF_task_rlim	0x00000490
 #define ASIZ_task_rlim	0x000000a0
-#define AOFF_task_used_math	0x00000528
+#define AOFF_task_used_math	0x00000530
 #define ASIZ_task_used_math	0x00000002
-#define AOFF_task_comm	0x0000052a
+#define AOFF_task_comm	0x00000532
 #define ASIZ_task_comm	0x00000010
-#define AOFF_task_link_count	0x0000053c
+#define AOFF_task_link_count	0x00000544
 #define ASIZ_task_link_count	0x00000004
-#define AOFF_task_tty	0x00000540
+#define AOFF_task_tty	0x00000548
 #define ASIZ_task_tty	0x00000008
-#define AOFF_task_semundo	0x00000548
+#define AOFF_task_semundo	0x00000550
 #define ASIZ_task_semundo	0x00000008
-#define AOFF_task_semsleeping	0x00000550
+#define AOFF_task_semsleeping	0x00000558
 #define ASIZ_task_semsleeping	0x00000008
 #define AOFF_task_tss	0x00000560
 #define ASIZ_task_tss	0x00000470
@@ -620,147 +624,149 @@
 #define ASIZ_task_exec_domain	0x00000008
 #define AOFF_task_need_resched	0x00000028
 #define ASIZ_task_need_resched	0x00000008
-#define AOFF_task_counter	0x00000030
+#define AOFF_task_ptrace	0x00000030
+#define ASIZ_task_ptrace	0x00000008
+#define AOFF_task_counter	0x00000038
 #define ASIZ_task_counter	0x00000008
-#define AOFF_task_priority	0x00000038
+#define AOFF_task_priority	0x00000040
 #define ASIZ_task_priority	0x00000008
-#define AOFF_task_avg_slice	0x00000040
+#define AOFF_task_avg_slice	0x00000048
 #define ASIZ_task_avg_slice	0x00000008
-#define AOFF_task_has_cpu	0x00000048
+#define AOFF_task_has_cpu	0x00000050
 #define ASIZ_task_has_cpu	0x00000004
-#define AOFF_task_processor	0x0000004c
+#define AOFF_task_processor	0x00000054
 #define ASIZ_task_processor	0x00000004
-#define AOFF_task_last_processor	0x00000050
+#define AOFF_task_last_processor	0x00000058
 #define ASIZ_task_last_processor	0x00000004
-#define AOFF_task_lock_depth	0x00000054
+#define AOFF_task_lock_depth	0x0000005c
 #define ASIZ_task_lock_depth	0x00000004
-#define AOFF_task_next_task	0x00000058
+#define AOFF_task_next_task	0x00000060
 #define ASIZ_task_next_task	0x00000008
-#define AOFF_task_prev_task	0x00000060
+#define AOFF_task_prev_task	0x00000068
 #define ASIZ_task_prev_task	0x00000008
-#define AOFF_task_next_run	0x00000068
+#define AOFF_task_next_run	0x00000070
 #define ASIZ_task_next_run	0x00000008
-#define AOFF_task_prev_run	0x00000070
+#define AOFF_task_prev_run	0x00000078
 #define ASIZ_task_prev_run	0x00000008
-#define AOFF_task_task_exclusive	0x00000078
+#define AOFF_task_task_exclusive	0x00000080
 #define ASIZ_task_task_exclusive	0x00000004
-#define AOFF_task_binfmt	0x00000080
+#define AOFF_task_binfmt	0x00000088
 #define ASIZ_task_binfmt	0x00000008
-#define AOFF_task_exit_code	0x00000088
+#define AOFF_task_exit_code	0x00000090
 #define ASIZ_task_exit_code	0x00000004
-#define AOFF_task_exit_signal	0x0000008c
+#define AOFF_task_exit_signal	0x00000094
 #define ASIZ_task_exit_signal	0x00000004
-#define AOFF_task_pdeath_signal	0x00000090
+#define AOFF_task_pdeath_signal	0x00000098
 #define ASIZ_task_pdeath_signal	0x00000004
-#define AOFF_task_personality	0x00000098
+#define AOFF_task_personality	0x000000a0
 #define ASIZ_task_personality	0x00000008
-#define AOFF_task_pid	0x000000a4
+#define AOFF_task_pid	0x000000ac
 #define ASIZ_task_pid	0x00000004
-#define AOFF_task_pgrp	0x000000a8
+#define AOFF_task_pgrp	0x000000b0
 #define ASIZ_task_pgrp	0x00000004
-#define AOFF_task_tty_old_pgrp	0x000000ac
+#define AOFF_task_tty_old_pgrp	0x000000b4
 #define ASIZ_task_tty_old_pgrp	0x00000004
-#define AOFF_task_session	0x000000b0
+#define AOFF_task_session	0x000000b8
 #define ASIZ_task_session	0x00000004
-#define AOFF_task_leader	0x000000b4
+#define AOFF_task_leader	0x000000bc
 #define ASIZ_task_leader	0x00000004
-#define AOFF_task_p_opptr	0x000000b8
+#define AOFF_task_p_opptr	0x000000c0
 #define ASIZ_task_p_opptr	0x00000008
-#define AOFF_task_p_pptr	0x000000c0
+#define AOFF_task_p_pptr	0x000000c8
 #define ASIZ_task_p_pptr	0x00000008
-#define AOFF_task_p_cptr	0x000000c8
+#define AOFF_task_p_cptr	0x000000d0
 #define ASIZ_task_p_cptr	0x00000008
-#define AOFF_task_p_ysptr	0x000000d0
+#define AOFF_task_p_ysptr	0x000000d8
 #define ASIZ_task_p_ysptr	0x00000008
-#define AOFF_task_p_osptr	0x000000d8
+#define AOFF_task_p_osptr	0x000000e0
 #define ASIZ_task_p_osptr	0x00000008
-#define AOFF_task_pidhash_next	0x000000e0
+#define AOFF_task_pidhash_next	0x000000e8
 #define ASIZ_task_pidhash_next	0x00000008
-#define AOFF_task_pidhash_pprev	0x000000e8
+#define AOFF_task_pidhash_pprev	0x000000f0
 #define ASIZ_task_pidhash_pprev	0x00000008
-#define AOFF_task_tarray_ptr	0x000000f0
+#define AOFF_task_tarray_ptr	0x000000f8
 #define ASIZ_task_tarray_ptr	0x00000008
-#define AOFF_task_wait_chldexit	0x000000f8
+#define AOFF_task_wait_chldexit	0x00000100
 #define ASIZ_task_wait_chldexit	0x00000008
-#define AOFF_task_vfork_sem	0x00000100
+#define AOFF_task_vfork_sem	0x00000108
 #define ASIZ_task_vfork_sem	0x00000008
-#define AOFF_task_policy	0x00000108
+#define AOFF_task_policy	0x00000110
 #define ASIZ_task_policy	0x00000008
-#define AOFF_task_rt_priority	0x00000110
+#define AOFF_task_rt_priority	0x00000118
 #define ASIZ_task_rt_priority	0x00000008
-#define AOFF_task_it_real_value	0x00000118
+#define AOFF_task_it_real_value	0x00000120
 #define ASIZ_task_it_real_value	0x00000008
-#define AOFF_task_it_prof_value	0x00000120
+#define AOFF_task_it_prof_value	0x00000128
 #define ASIZ_task_it_prof_value	0x00000008
-#define AOFF_task_it_virt_value	0x00000128
+#define AOFF_task_it_virt_value	0x00000130
 #define ASIZ_task_it_virt_value	0x00000008
-#define AOFF_task_it_real_incr	0x00000130
+#define AOFF_task_it_real_incr	0x00000138
 #define ASIZ_task_it_real_incr	0x00000008
-#define AOFF_task_it_prof_incr	0x00000138
+#define AOFF_task_it_prof_incr	0x00000140
 #define ASIZ_task_it_prof_incr	0x00000008
-#define AOFF_task_it_virt_incr	0x00000140
+#define AOFF_task_it_virt_incr	0x00000148
 #define ASIZ_task_it_virt_incr	0x00000008
-#define AOFF_task_real_timer	0x00000148
+#define AOFF_task_real_timer	0x00000150
 #define ASIZ_task_real_timer	0x00000028
-#define AOFF_task_times	0x00000170
+#define AOFF_task_times	0x00000178
 #define ASIZ_task_times	0x00000020
-#define AOFF_task_start_time	0x00000190
+#define AOFF_task_start_time	0x00000198
 #define ASIZ_task_start_time	0x00000008
-#define AOFF_task_per_cpu_utime	0x00000198
+#define AOFF_task_per_cpu_utime	0x000001a0
 #define ASIZ_task_per_cpu_utime	0x00000100
-#define AOFF_task_min_flt	0x00000398
+#define AOFF_task_min_flt	0x000003a0
 #define ASIZ_task_min_flt	0x00000008
-#define AOFF_task_maj_flt	0x000003a0
+#define AOFF_task_maj_flt	0x000003a8
 #define ASIZ_task_maj_flt	0x00000008
-#define AOFF_task_nswap	0x000003a8
+#define AOFF_task_nswap	0x000003b0
 #define ASIZ_task_nswap	0x00000008
-#define AOFF_task_cmin_flt	0x000003b0
+#define AOFF_task_cmin_flt	0x000003b8
 #define ASIZ_task_cmin_flt	0x00000008
-#define AOFF_task_cmaj_flt	0x000003b8
+#define AOFF_task_cmaj_flt	0x000003c0
 #define ASIZ_task_cmaj_flt	0x00000008
-#define AOFF_task_cnswap	0x000003c0
+#define AOFF_task_cnswap	0x000003c8
 #define ASIZ_task_cnswap	0x00000008
-#define AOFF_task_uid	0x000003cc
+#define AOFF_task_uid	0x000003d4
 #define ASIZ_task_uid	0x00000004
-#define AOFF_task_euid	0x000003d0
+#define AOFF_task_euid	0x000003d8
 #define ASIZ_task_euid	0x00000004
-#define AOFF_task_suid	0x000003d4
+#define AOFF_task_suid	0x000003dc
 #define ASIZ_task_suid	0x00000004
-#define AOFF_task_fsuid	0x000003d8
+#define AOFF_task_fsuid	0x000003e0
 #define ASIZ_task_fsuid	0x00000004
-#define AOFF_task_gid	0x000003dc
+#define AOFF_task_gid	0x000003e4
 #define ASIZ_task_gid	0x00000004
-#define AOFF_task_egid	0x000003e0
+#define AOFF_task_egid	0x000003e8
 #define ASIZ_task_egid	0x00000004
-#define AOFF_task_sgid	0x000003e4
+#define AOFF_task_sgid	0x000003ec
 #define ASIZ_task_sgid	0x00000004
-#define AOFF_task_fsgid	0x000003e8
+#define AOFF_task_fsgid	0x000003f0
 #define ASIZ_task_fsgid	0x00000004
-#define AOFF_task_ngroups	0x000003ec
+#define AOFF_task_ngroups	0x000003f4
 #define ASIZ_task_ngroups	0x00000004
-#define AOFF_task_groups	0x000003f0
+#define AOFF_task_groups	0x000003f8
 #define ASIZ_task_groups	0x00000080
-#define AOFF_task_cap_effective	0x00000470
+#define AOFF_task_cap_effective	0x00000478
 #define ASIZ_task_cap_effective	0x00000004
-#define AOFF_task_cap_inheritable	0x00000474
+#define AOFF_task_cap_inheritable	0x0000047c
 #define ASIZ_task_cap_inheritable	0x00000004
-#define AOFF_task_cap_permitted	0x00000478
+#define AOFF_task_cap_permitted	0x00000480
 #define ASIZ_task_cap_permitted	0x00000004
-#define AOFF_task_user	0x00000480
+#define AOFF_task_user	0x00000488
 #define ASIZ_task_user	0x00000008
-#define AOFF_task_rlim	0x00000488
+#define AOFF_task_rlim	0x00000490
 #define ASIZ_task_rlim	0x000000a0
-#define AOFF_task_used_math	0x00000528
+#define AOFF_task_used_math	0x00000530
 #define ASIZ_task_used_math	0x00000002
-#define AOFF_task_comm	0x0000052a
+#define AOFF_task_comm	0x00000532
 #define ASIZ_task_comm	0x00000010
-#define AOFF_task_link_count	0x0000053c
+#define AOFF_task_link_count	0x00000544
 #define ASIZ_task_link_count	0x00000004
-#define AOFF_task_tty	0x00000540
+#define AOFF_task_tty	0x00000548
 #define ASIZ_task_tty	0x00000008
-#define AOFF_task_semundo	0x00000548
+#define AOFF_task_semundo	0x00000550
 #define ASIZ_task_semundo	0x00000008
-#define AOFF_task_semsleeping	0x00000550
+#define AOFF_task_semsleeping	0x00000558
 #define ASIZ_task_semsleeping	0x00000008
 #define AOFF_task_tss	0x00000560
 #define ASIZ_task_tss	0x00000470
diff -urN linux-2.2.20-pre3/include/linux/binfmts.h linux/include/linux/binfmts.h
--- linux-2.2.20-pre3/include/linux/binfmts.h	Sun Mar 25 08:37:40 2001
+++ linux/include/linux/binfmts.h	Mon Dec  3 22:19:03 2001
@@ -32,6 +32,8 @@
 	int priv_change;
 };
 
+struct file;
+
 /*
  * This structure defines the functions that are used to load the binary formats that
  * linux accepts.
@@ -41,9 +43,11 @@
 	struct module *module;
 	int (*load_binary)(struct linux_binprm *, struct  pt_regs * regs);
 	int (*load_shlib)(int fd);
-	int (*core_dump)(long signr, struct pt_regs * regs);
+	int (*core_dump)(long signr, struct pt_regs * regs, struct file *file);
+	unsigned long min_coredump;
 };
 
+extern int do_coredump(long, struct pt_regs *);
 extern int register_binfmt(struct linux_binfmt *);
 extern int unregister_binfmt(struct linux_binfmt *);
 
diff -urN linux-2.2.20-pre3/include/linux/fd.h linux/include/linux/fd.h
--- linux-2.2.20-pre3/include/linux/fd.h	Sun Mar 25 08:31:03 2001
+++ linux/include/linux/fd.h	Mon Dec  3 22:19:03 2001
@@ -216,8 +216,8 @@
 	/* Prevent "aliased" accesses. */
 	int fd_ref;
 	int fd_device;
-	unsigned long last_checked; /* when was the drive last checked for a disk 
-			   * change? */
+	unsigned long last_checked; /* when was the drive last checked
+				     * for a disk change? */
 	
 	char *dmabuf;
 	int bufblocks;
diff -urN linux-2.2.20-pre3/include/linux/tty.h linux/include/linux/tty.h
--- linux-2.2.20-pre3/include/linux/tty.h	Sun Mar 25 08:31:03 2001
+++ linux/include/linux/tty.h	Mon Dec  3 22:19:03 2001
@@ -364,6 +364,8 @@
 extern int specialix_init(void);
 extern int espserial_init(void);
 extern int macserial_init(void);
+extern int mgsl_init(void);
+extern int n_hdlc_init(void);
 
 extern int tty_paranoia_check(struct tty_struct *tty, kdev_t device,
 			      const char *routine);
diff -urN linux-2.2.20-pre3/mm/swapfile.c linux/mm/swapfile.c
--- linux-2.2.20-pre3/mm/swapfile.c	Sun Mar 25 08:31:03 2001
+++ linux/mm/swapfile.c	Mon Dec  3 22:19:03 2001
@@ -448,7 +448,7 @@
 
 	len += sprintf(buf, "Filename\t\t\tType\t\tSize\tUsed\tPriority\n");
 	for (i = 0 ; i < nr_swapfiles ; i++, ptr++) {
-		if (ptr->flags & SWP_USED) {
+		if ((ptr->flags & SWP_USED) && ptr->swap_map) {
 			char * path = d_path(ptr->swap_file, page, PAGE_SIZE);
 
 			len += sprintf(buf + len, "%-31s ", path);
diff -urN linux-2.2.20-pre3/net/core/dev.c linux/net/core/dev.c
--- linux-2.2.20-pre3/net/core/dev.c	Sun Mar 25 08:37:41 2001
+++ linux/net/core/dev.c	Mon Dec  3 22:19:03 2001
@@ -2105,7 +2105,7 @@
 #ifdef CONFIG_PC300
 	cpc_init();
 #endif
-#ifdef CONFIG_HDLC
+#ifdef CONFIG_SYNCPPP
 	sync_ppp_init();
 #endif
 
diff -urN linux-2.2.20-pre3/net/core/sock.c linux/net/core/sock.c
--- linux-2.2.20-pre3/net/core/sock.c	Mon Dec  3 22:18:55 2001
+++ linux/net/core/sock.c	Mon Dec  3 22:19:03 2001
@@ -7,7 +7,7 @@
  *		handler for protocols to use and generic option handler.
  *
  *
- * Version:	$Id: sock.c,v 1.80.2.4 2001/02/20 04:21:46 davem Exp $
+ * Version:	$Id: sock.c,v 1.80.2.5 2001/05/11 02:07:23 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -752,9 +752,11 @@
 				break;
 			try_size = fallback;
 		}
-		skb = sock_wmalloc(sk, try_size, 0, sk->allocation);
+		skb = sock_wmalloc_err(sk, try_size, 0, sk->allocation, &err);
 		if (skb)
 			break;
+		if (err)
+			goto failure;
 
 		/*
 		 *	This means we have too many buffers for this socket already.
diff -urN linux-2.2.20-pre3/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
--- linux-2.2.20-pre3/net/ipv4/af_inet.c	Sun Mar 25 08:31:12 2001
+++ linux/net/ipv4/af_inet.c	Mon Dec  3 22:19:03 2001
@@ -877,7 +877,8 @@
 		case SIOCGSTAMP:
 			if(sk->stamp.tv_sec==0)
 				return -ENOENT;
-			err = copy_to_user((void *)arg,&sk->stamp,sizeof(struct timeval));
+			err = copy_to_user((void *)arg, &sk->stamp,
+					   sizeof(struct timeval));
 			if (err)
 				err = -EFAULT;
 			return err;
diff -urN linux-2.2.20-pre3/net/ipv4/ip_masq_vdolive.c linux/net/ipv4/ip_masq_vdolive.c
--- linux-2.2.20-pre3/net/ipv4/ip_masq_vdolive.c	Sun Mar 25 08:31:12 2001
+++ linux/net/ipv4/ip_masq_vdolive.c	Mon Dec  3 22:19:03 2001
@@ -242,7 +242,7 @@
 						      ports[i]))) {
 				return j;
 			}
-			IP_MASQ_DEBUG(1-debug, "RealAudio: loaded support on port[%d] = %d\n", i, ports[i]);
+			IP_MASQ_DEBUG(1-debug, "VDOlive: loaded support on port[%d] = %d\n", i, ports[i]);
 		} else {
 			/* To be safe, force the incarnation table entry to NULL */
 			masq_incarnations[i] = NULL;
diff -urN linux-2.2.20-pre3/net/ipv4/tcp_input.c linux/net/ipv4/tcp_input.c
--- linux-2.2.20-pre3/net/ipv4/tcp_input.c	Mon Dec  3 22:18:56 2001
+++ linux/net/ipv4/tcp_input.c	Mon Dec  3 22:19:03 2001
@@ -5,7 +5,7 @@
  *
  *		Implementation of the Transmission Control Protocol(TCP).
  *
- * Version:	$Id: tcp_input.c,v 1.164.2.22 2001/04/10 19:58:43 davem Exp $
+ * Version:	$Id: tcp_input.c,v 1.164.2.25 2001/05/24 22:33:21 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -1441,8 +1441,8 @@
 	if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) {
 		/* A retransmit, 2nd most common case.  Force an imediate ack. */
 		SOCK_DEBUG(sk, "retransmit received: seq %X\n", TCP_SKB_CB(skb)->seq);
-		tcp_enter_quickack_mode(tp);
 out_of_window:
+		tcp_enter_quickack_mode(tp);
 		tp->delayed_acks++;
 		kfree_skb(skb);
 		return;
@@ -1538,7 +1538,7 @@
 	skb_pull(skb, th->doff*4);
 	skb_trim(skb, len - (th->doff*4));
 
-        if (skb->len == 0 && !th->fin)
+	if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq)
 		return(0);
 
 	/* 
@@ -1961,7 +1961,7 @@
 	 * Dave!!! Phrase above (and all about rcv_mss) has 
 	 * nothing to do with reality. rcv_mss must measure TOTAL
 	 * size, including sacks, IP options etc. Hence, measure_rcv_mss
-	 * must occure before pulling etc, otherwise it will flap
+	 * must occur before pulling etc, otherwise it will flap
 	 * like hell. Even putting it before tcp_data is wrong,
 	 * it should use skb->tail - skb->nh.raw instead.
 	 *					--ANK (980805)
@@ -2280,10 +2280,8 @@
 		tcp_sync_mss(sk, tp->pmtu_cookie);
 		tp->rcv_mss = tp->mss_cache;
 
-		if (sk->state == TCP_SYN_RECV)
-			goto discard;
-		
-		goto step6; 
+		/* Discard data/urg received with SYN. Safety is the first. */
+		goto discard;
 	}
 
 	/*   Parse the tcp_options present on this header.
@@ -2418,7 +2416,6 @@
 	} else
 		goto discard;
 
-step6:
 	/* step 6: check the URG bit */
 	tcp_urg(sk, th, len);
 
diff -urN linux-2.2.20-pre3/net/ipv6/ndisc.c linux/net/ipv6/ndisc.c
--- linux-2.2.20-pre3/net/ipv6/ndisc.c	Sun Mar 25 08:31:13 2001
+++ linux/net/ipv6/ndisc.c	Mon Dec  3 22:19:03 2001
@@ -364,9 +364,23 @@
         struct nd_msg *msg;
         int len;
 	int err;
+	int send_llinfo;
+
+	if (saddr == NULL) {
+		struct inet6_ifaddr *ifa;
+
+		/* use link local address */
+		ifa = ipv6_get_lladdr(dev);
+
+		if (ifa)
+			saddr = &ifa->addr;
+		else
+			return;
+	}
 
 	len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
-	if (dev->addr_len)
+	send_llinfo = dev->addr_len && ipv6_addr_type(saddr) != IPV6_ADDR_ANY;
+	if (send_llinfo)
 		len += NDISC_OPT_SPACE(dev->addr_len);
 
 	skb = sock_alloc_send_skb(sk, MAX_HEADER + len + dev->hard_header_len + 15,
@@ -376,15 +390,6 @@
 		return;
 	}
 
-	if (saddr == NULL) {
-		struct inet6_ifaddr *ifa;
-
-		/* use link local address */
-		ifa = ipv6_get_lladdr(dev);
-
-		if (ifa)
-			saddr = &ifa->addr;
-	}
 
 	if (ndisc_build_ll_hdr(skb, dev, daddr, neigh, len) == 0) {
 		kfree_skb(skb);
@@ -402,7 +407,7 @@
 	/* Set the target address. */
 	ipv6_addr_copy(&msg->target, solicit);
 
-	if (dev->addr_len)
+	if (send_llinfo)
 		ndisc_fill_option((void*)&msg->opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, dev->addr_len);
 
 	/* checksum */
