## Automatically generated incremental diff
## From:   linux-2.2.10-pre2
## To:     linux-2.2.10-pre3
## Robot:  $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp hpa $

diff -urN linux-2.2.10-pre2/arch/i386/kernel/smp.c linux-2.2.10-pre3/arch/i386/kernel/smp.c
--- linux-2.2.10-pre2/arch/i386/kernel/smp.c	1999-05-10 10:32:45.000000000 -0700
+++ linux-2.2.10-pre3/arch/i386/kernel/smp.c	2003-08-15 15:06:27.000000000 -0700
@@ -2,7 +2,7 @@
  *	Intel MP v1.1/v1.4 specification support routines for multi-pentium
  *	hosts.
  *
- *	(c) 1995 Alan Cox, CymruNET Ltd  <alan@cymru.net>
+ *	(c) 1995 Alan Cox, Building #3 <alan@redhat.com>
  *	(c) 1998 Ingo Molnar
  *
  *	Supported by Caldera http://www.caldera.com.
diff -urN linux-2.2.10-pre2/arch/ppc/boot/Makefile linux-2.2.10-pre3/arch/ppc/boot/Makefile
--- linux-2.2.10-pre2/arch/ppc/boot/Makefile	1999-04-29 12:39:01.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/boot/Makefile	2003-08-15 15:06:27.000000000 -0700
@@ -26,9 +26,15 @@
 ISZ = 0
 
 ifeq ($(CONFIG_SMP),y)
-TFTPIMAGE=/tftpboot/zImage.prep.smp
+TFTPIMAGE=/tftpboot/zImage.prep.smp$(MSIZE)
 else
-TFTPIMAGE=/tftpboot/zImage.prep
+TFTPIMAGE=/tftpboot/zImage.prep$(MSIZE)
+endif
+
+ifeq ($(CONFIG_PPC64),y)
+MSIZE=.64
+else
+MSIZE=
 endif
 
 ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00800000
diff -urN linux-2.2.10-pre2/arch/ppc/boot/misc.c linux-2.2.10-pre3/arch/ppc/boot/misc.c
--- linux-2.2.10-pre2/arch/ppc/boot/misc.c	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/boot/misc.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,7 +1,7 @@
 /*
  * misc.c
  *
- * $Id: misc.c,v 1.64 1999/04/30 05:52:46 cort Exp $
+ * $Id: misc.c,v 1.64.2.2 1999/05/29 19:09:29 cort Exp $
  * 
  * Adapted for PowerPC by Gary Thomas
  *
@@ -363,7 +363,7 @@
 			if (board_type == 0xe0) {	
 				base_mod = inb(0x803);
 				/* if a MVME2300/2400 or a Sitka then no keyboard */
-				if((base_mod == 0x9) || (base_mod == 0xF9) ||
+				if((base_mod == 0xFA) || (base_mod == 0xF9) ||
 				   (base_mod == 0xE1)) {
 					keyb_present = 0;	/* no keyboard */
 				}
diff -urN linux-2.2.10-pre2/arch/ppc/chrpboot/main.c linux-2.2.10-pre3/arch/ppc/chrpboot/main.c
--- linux-2.2.10-pre2/arch/ppc/chrpboot/main.c	1998-09-30 10:14:16.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/chrpboot/main.c	2003-08-15 15:06:27.000000000 -0700
@@ -17,9 +17,9 @@
 #define get_32be(x)	(*(unsigned *)(x))
 
 #define RAM_START	0x00000000
-#define RAM_END		0x00800000	/* only 8M mapped with BATs */
+#define RAM_END		(8<<20)
 
-#define RAM_FREE	0x00540000	/* after image of chrpboot */
+#define RAM_FREE	(6<<20)		/* after image of chrpboot */
 #define PROG_START	0x00010000
 
 char *avail_ram;
@@ -38,16 +38,16 @@
     void *dst;
     unsigned char *im;
     unsigned initrd_start, initrd_size;
+    extern char _start;
     
-    printf("chrpboot starting\n\r");
-    /* setup_bats(); */
+    printf("chrpboot starting: loaded at 0x%x\n\r", &_start);
 
     if (initrd_len) {
 	initrd_size = initrd_len;
 	initrd_start = (RAM_END - initrd_size) & ~0xFFF;
 	a1 = initrd_start;
 	a2 = initrd_size;
-	printf("initial ramdisk at %x (%u bytes)\n\r", initrd_start,
+	printf("initial ramdisk at 0x%x (%u bytes)\n\r", initrd_start,
 	       initrd_size);
 	memcpy((char *)initrd_start, initrd_data, initrd_size);
 	end_avail = (char *)initrd_start;
@@ -58,25 +58,19 @@
     dst = (void *) PROG_START;
 
     if (im[0] == 0x1f && im[1] == 0x8b) {
-	void *cp = (void *) RAM_FREE;
-	avail_ram = (void *) (RAM_FREE + ((len + 7) & -8));
-	memcpy(cp, im, len);
-	printf("gunzipping... ");
-	gunzip(dst, 0x400000, cp, &len);
-	printf("done\n\r");
-
+	avail_ram = (char *)RAM_FREE;
+	printf("gunzipping (0x%x <- 0x%x:0x%0x)...", dst, im, im+len);
+	gunzip(dst, 0x400000, im, &len);
+	printf("done %u bytes\n\r", len);
     } else {
 	memmove(dst, im, len);
     }
 
     flush_cache(dst, len);
-
-    sa = PROG_START+12;
+    
+    sa = *(unsigned long *)PROG_START+PROG_START;
     printf("start address = 0x%x\n\r", sa);
 
-#if 0
-    pause();
-#endif
     (*(void (*)())sa)(a1, a2, prom, 0, 0);
 
     printf("returned?\n\r");
@@ -150,7 +144,7 @@
     s.avail_out = dstlen;
     r = inflate(&s, Z_FINISH);
     if (r != Z_OK && r != Z_STREAM_END) {
-	printf("inflate returned %d\n\r", r);
+	printf("inflate returned %d msg: %s\n\r", r, s.msg);
 	exit();
     }
     *lenp = s.next_out - (unsigned char *) dst;
diff -urN linux-2.2.10-pre2/arch/ppc/chrpboot/Makefile linux-2.2.10-pre3/arch/ppc/chrpboot/Makefile
--- linux-2.2.10-pre2/arch/ppc/chrpboot/Makefile	1999-03-19 10:50:03.000000000 -0800
+++ linux-2.2.10-pre3/arch/ppc/chrpboot/Makefile	2003-08-15 15:06:27.000000000 -0700
@@ -17,21 +17,27 @@
 	$(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $<
 
 CFLAGS	= -O -fno-builtin -DSTDC_HEADERS -I$(TOPDIR)/include
-LD_ARGS = -T ../vmlinux.lds -Ttext 0x00800000
+LD_ARGS = -Ttext 0x00400000
 OBJCOPY = $(CROSS_COMPILE)objcopy
 
 OBJS = crt0.o start.o main.o misc.o ../coffboot/string.o ../coffboot/zlib.o image.o # initrd.o
 LIBS = $(TOPDIR)/lib/lib.a
 
+ifeq ($(CONFIG_PPC64),y)
+MSIZE=.64
+else
+MSIZE=
+endif
+
 ifeq ($(CONFIG_ALL_PPC),y)
 # yes, we want to build chrp stuff
 CONFIG_CHRP = y
 endif
 
 ifeq ($(CONFIG_SMP),y)
-TFTPIMAGE=/tftpboot/zImage.chrp.smp
+TFTPIMAGE=/tftpboot/zImage.chrp.smp$(MSIZE)
 else
-TFTPIMAGE=/tftpboot/zImage.chrp
+TFTPIMAGE=/tftpboot/zImage.chrp$(MSIZE)
 endif
 
 all:	$(TOPDIR)/zImage
@@ -59,9 +65,10 @@
 initrd.o: ramdisk.image.gz piggyback
 	./piggyback initrd < ramdisk.image.gz | $(AS) -o initrd.o
 
-zImage: $(OBJS) no_initrd.o
+zImage: $(OBJS) no_initrd.o mknote
 	$(LD) $(LD_ARGS) -o $@ $(OBJS) no_initrd.o $(LIBS)
-	objcopy zImage zImage
+	./mknote > note
+	$(OBJCOPY) $@ $@ --add-section=.note=note -R .comment
 
 zImage.initrd: $(OBJS) initrd.o
 	$(LD) $(LD_ARGS) -o $@ $(OBJS) initrd.o $(LIBS)
@@ -86,8 +93,7 @@
 
 
 clean:
-	rm -f piggyback
-	rm -f $(OBJS) zImage
+	rm -f piggyback note mknote $(OBJS) zImage
 
 fastdep:
 	$(TOPDIR)/scripts/mkdep *.[Sch] > .depend
diff -urN linux-2.2.10-pre2/arch/ppc/coffboot/Makefile linux-2.2.10-pre3/arch/ppc/coffboot/Makefile
--- linux-2.2.10-pre2/arch/ppc/coffboot/Makefile	1999-03-19 10:50:03.000000000 -0800
+++ linux-2.2.10-pre3/arch/ppc/coffboot/Makefile	2003-08-15 15:06:27.000000000 -0700
@@ -23,10 +23,16 @@
 CONFIG_PMAC = y
 endif
 
+ifeq ($(CONFIG_PPC64),y)
+MSIZE=.64
+else
+MSIZE=
+endif
+
 ifeq ($(CONFIG_SMP),y)
-TFTPIMAGE=/tftpboot/zImage.pmac.smp
+TFTPIMAGE=/tftpboot/zImage.pmac.smp$(MSIZE)
 else
-TFTPIMAGE=/tftpboot/zImage.pmac
+TFTPIMAGE=/tftpboot/zImage.pmac$(MSIZE)
 endif
 
 ifeq ($(CONFIG_PMAC),y)
diff -urN linux-2.2.10-pre2/arch/ppc/coffboot/zlib.c linux-2.2.10-pre3/arch/ppc/coffboot/zlib.c
--- linux-2.2.10-pre2/arch/ppc/coffboot/zlib.c	1998-09-30 10:14:16.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/coffboot/zlib.c	2003-08-15 15:06:27.000000000 -0700
@@ -11,7 +11,7 @@
  * - added Z_PACKET_FLUSH (see zlib.h for details)
  * - added inflateIncomp
  *
- * $Id: zlib.c,v 1.2 1998/09/03 17:40:53 cort Exp $
+ * $Id: zlib.c,v 1.2.2.1 1999/05/29 19:09:42 cort Exp $
  */
 
 /*+++++*/
@@ -649,6 +649,11 @@
 /*   load local pointers */
 #define LOAD {LOADIN LOADOUT}
 
+/*
+ * The IBM 150 firmware munges the data right after _etext[].  This
+ * protects it. -- Cort
+ */
+local uInt protect_mask[] = {0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0 ,0};
 /* And'ing with mask[n] masks the lower n bits */
 local uInt inflate_mask[] = {
     0x0000,
diff -urN linux-2.2.10-pre2/arch/ppc/common_defconfig linux-2.2.10-pre3/arch/ppc/common_defconfig
--- linux-2.2.10-pre2/arch/ppc/common_defconfig	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/common_defconfig	2003-08-15 15:06:27.000000000 -0700
@@ -7,6 +7,7 @@
 #
 CONFIG_PPC=y
 CONFIG_6xx=y
+# CONFIG_PPC64 is not set
 # CONFIG_8xx is not set
 # CONFIG_PMAC is not set
 # CONFIG_PREP is not set
@@ -15,13 +16,14 @@
 # CONFIG_APUS is not set
 # CONFIG_MBX is not set
 # CONFIG_SMP is not set
+CONFIG_6xx=y
 
 #
 # General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
+CONFIG_MODVERSIONS=y
 CONFIG_KMOD=y
 CONFIG_PCI=y
 # CONFIG_PCI_QUIRKS is not set
@@ -32,7 +34,7 @@
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_KERNEL_ELF=y
-CONFIG_BINFMT_MISC=m
+# CONFIG_BINFMT_MISC is not set
 # CONFIG_BINFMT_JAVA is not set
 # CONFIG_PARPORT is not set
 CONFIG_VGA_CONSOLE=y
@@ -58,7 +60,7 @@
 #
 # Block devices
 #
-# CONFIG_BLK_DEV_FD is not set
+CONFIG_BLK_DEV_FD=y
 CONFIG_BLK_DEV_IDE=y
 
 #
@@ -73,15 +75,17 @@
 # CONFIG_BLK_DEV_CMD640 is not set
 # CONFIG_BLK_DEV_RZ1000 is not set
 # CONFIG_BLK_DEV_IDEPCI is not set
-# CONFIG_BLK_DEV_SL82C105 is not set
+CONFIG_BLK_DEV_SL82C105=y
 CONFIG_BLK_DEV_IDE_PMAC=y
-# CONFIG_BLK_DEV_IDEDMA_PMAC is not set
+CONFIG_BLK_DEV_IDEDMA_PMAC=y
+CONFIG_BLK_DEV_IDEDMA=y
+CONFIG_PMAC_IDEDMA_AUTO=y
 # CONFIG_IDE_CHIPSETS is not set
 
 #
 # Additional Block Devices
 #
-CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_MD is not set
 CONFIG_BLK_DEV_RAM=y
@@ -110,7 +114,7 @@
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 CONFIG_IP_ALIAS=y
-# CONFIG_SYN_COOKIES is not set
+CONFIG_SYN_COOKIES=y
 
 #
 # (it is safe to leave these untouched)
@@ -151,12 +155,12 @@
 CONFIG_CHR_DEV_ST=y
 CONFIG_BLK_DEV_SR=y
 CONFIG_BLK_DEV_SR_VENDOR=y
-CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SG is not set
 
 #
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
-CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_MULTI_LUN is not set
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
@@ -191,13 +195,14 @@
 # CONFIG_SCSI_NCR53C406A is not set
 # CONFIG_SCSI_SYM53C416 is not set
 # CONFIG_SCSI_NCR53C7xx is not set
-CONFIG_SCSI_NCR53C8XX=y
-# CONFIG_SCSI_SYM53C8XX is not set
+# CONFIG_SCSI_NCR53C8XX is not set
+CONFIG_SCSI_SYM53C8XX=y
 CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
 CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32
 CONFIG_SCSI_NCR53C8XX_SYNC=20
 # CONFIG_SCSI_NCR53C8XX_PROFILE is not set
 # CONFIG_SCSI_NCR53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_NCR53C8XX_PQS_PDS is not set
 # CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PCI2000 is not set
@@ -301,27 +306,17 @@
 CONFIG_FB_CT65550=y
 # CONFIG_FB_S3TRIO is not set
 CONFIG_FB_MATROX=y
-CONFIG_FB_MATROX_MILLENIUM=y
+# CONFIG_FB_MATROX_MILLENIUM is not set
 CONFIG_FB_MATROX_MYSTIQUE=y
-CONFIG_FB_MATROX_G100=y
+# CONFIG_FB_MATROX_G100 is not set
 # CONFIG_FB_MATROX_MULTIHEAD is not set
 # CONFIG_FB_ATY is not set
 # CONFIG_FB_VIRTUAL is not set
-CONFIG_FBCON_ADVANCED=y
-# CONFIG_FBCON_MFB is not set
-# CONFIG_FBCON_CFB2 is not set
-# CONFIG_FBCON_CFB4 is not set
+# CONFIG_FBCON_ADVANCED is not set
 CONFIG_FBCON_CFB8=y
 CONFIG_FBCON_CFB16=y
 CONFIG_FBCON_CFB24=y
 CONFIG_FBCON_CFB32=y
-# CONFIG_FBCON_AFB is not set
-# CONFIG_FBCON_ILBM is not set
-# CONFIG_FBCON_IPLAN2P2 is not set
-# CONFIG_FBCON_IPLAN2P4 is not set
-# CONFIG_FBCON_IPLAN2P8 is not set
-# CONFIG_FBCON_MAC is not set
-# CONFIG_FBCON_VGA is not set
 # CONFIG_FBCON_FONTWIDTH8_ONLY is not set
 CONFIG_FBCON_FONTS=y
 # CONFIG_FONT_8x8 is not set
@@ -355,7 +350,7 @@
 # CONFIG_PC110_PAD is not set
 # CONFIG_QIC02_TAPE is not set
 # CONFIG_WATCHDOG is not set
-# CONFIG_NVRAM is not set
+CONFIG_NVRAM=y
 # CONFIG_RTC is not set
 
 #
@@ -390,10 +385,10 @@
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 CONFIG_HFS_FS=y
-CONFIG_FAT_FS=m
-CONFIG_MSDOS_FS=m
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
 # CONFIG_UMSDOS_FS is not set
-CONFIG_VFAT_FS=m
+CONFIG_VFAT_FS=y
 CONFIG_ISO9660_FS=y
 # CONFIG_JOLIET is not set
 # CONFIG_MINIX_FS is not set
@@ -470,7 +465,34 @@
 # CONFIG_SOUND_SONICVIBES is not set
 # CONFIG_SOUND_MSNDCLAS is not set
 # CONFIG_SOUND_MSNDPIN is not set
-# CONFIG_SOUND_OSS is not set
+CONFIG_SOUND_OSS=y
+# CONFIG_SOUND_DMAP is not set
+# CONFIG_SOUND_PAS is not set
+# CONFIG_SOUND_SB is not set
+# CONFIG_SOUND_ADLIB is not set
+# CONFIG_SOUND_GUS is not set
+# CONFIG_SOUND_MPU401 is not set
+# CONFIG_SOUND_PSS is not set
+# CONFIG_SOUND_MSS is not set
+# CONFIG_SOUND_SSCAPE is not set
+# CONFIG_SOUND_TRIX is not set
+# CONFIG_SOUND_MAD16 is not set
+# CONFIG_SOUND_WAVEFRONT is not set
+CONFIG_SOUND_CS4232=m
+# CONFIG_SOUND_OPL3SA2 is not set
+# CONFIG_SOUND_MAUI is not set
+# CONFIG_SOUND_SGALAXY is not set
+# CONFIG_SOUND_AD1816 is not set
+# CONFIG_SOUND_OPL3SA1 is not set
+# CONFIG_SOUND_SOFTOSS is not set
+# CONFIG_SOUND_YM3812 is not set
+# CONFIG_SOUND_VMIDI is not set
+# CONFIG_SOUND_UART6850 is not set
+
+#
+# Additional low level sound drivers
+#
+# CONFIG_LOWLEVEL_SOUND is not set
 
 #
 # Kernel hacking
diff -urN linux-2.2.10-pre2/arch/ppc/config.in linux-2.2.10-pre3/arch/ppc/config.in
--- linux-2.2.10-pre2/arch/ppc/config.in	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/config.in	2003-08-15 15:06:27.000000000 -0700
@@ -1,4 +1,4 @@
-# $Id: config.in,v 1.92 1999/04/30 05:41:43 cort Exp $
+# $Id: config.in,v 1.92.2.1 1999/05/29 19:09:16 cort Exp $
 # For a description of the syntax of this configuration file,
 # see the Configure script.
 #
@@ -8,8 +8,9 @@
 comment 'Platform support'
 define_bool CONFIG_PPC y
 choice 'Processor type' \
-	"6xx/7xx	CONFIG_6xx \
-	 860/821	CONFIG_8xx" 6xx/7xx
+	"6xx/7xx		CONFIG_6xx \
+	 630/Power3(64-Bit) 	CONFIG_PPC64 \
+	 860/821		CONFIG_8xx" 6xx/7xx
 
 choice 'Machine Type' \
 	"PowerMac	CONFIG_PMAC \
@@ -23,6 +24,10 @@
 if [ "$CONFIG_ALL_PPC" != "y" ];then
   define_bool CONFIG_MACH_SPECIFIC y
 fi
+
+if [ "$CONFIG_PPC64" != "y" ];then
+  define_bool CONFIG_6xx y
+fi
 endmenu
 
 if [ "$CONFIG_MBX" = "y" ];then
diff -urN linux-2.2.10-pre2/arch/ppc/defconfig linux-2.2.10-pre3/arch/ppc/defconfig
--- linux-2.2.10-pre2/arch/ppc/defconfig	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/defconfig	2003-08-15 15:06:27.000000000 -0700
@@ -8,12 +8,13 @@
 CONFIG_PPC=y
 CONFIG_6xx=y
 # CONFIG_8xx is not set
-# CONFIG_PMAC is not set
+CONFIG_PMAC=y
 # CONFIG_PREP is not set
 # CONFIG_CHRP is not set
-CONFIG_ALL_PPC=y
+# CONFIG_ALL_PPC is not set
 # CONFIG_APUS is not set
 # CONFIG_MBX is not set
+CONFIG_MACH_SPECIFIC=y
 # CONFIG_SMP is not set
 
 #
@@ -35,20 +36,20 @@
 CONFIG_BINFMT_MISC=m
 # CONFIG_BINFMT_JAVA is not set
 # CONFIG_PARPORT is not set
-CONFIG_VGA_CONSOLE=y
+# CONFIG_VGA_CONSOLE is not set
 CONFIG_FB=y
 CONFIG_FB_COMPAT_XPMAC=y
 CONFIG_PMAC_PBOOK=y
 CONFIG_MAC_KEYBOARD=y
 CONFIG_MAC_FLOPPY=y
 CONFIG_MAC_SERIAL=y
-# CONFIG_SERIAL_CONSOLE is not set
 CONFIG_ADBMOUSE=y
+CONFIG_BLK_DEV_IDE_PMAC=y
 CONFIG_PROC_DEVICETREE=y
+# CONFIG_KGDB is not set
+# CONFIG_XMON is not set
 # CONFIG_TOTALMP is not set
 CONFIG_BOOTX_TEXT=y
-# CONFIG_MOTOROLA_HOTSWAP is not set
-# CONFIG_CMDLINE_BOOL is not set
 
 #
 # Plug and Play support
@@ -75,13 +76,15 @@
 # CONFIG_BLK_DEV_IDEPCI is not set
 # CONFIG_BLK_DEV_SL82C105 is not set
 CONFIG_BLK_DEV_IDE_PMAC=y
-# CONFIG_BLK_DEV_IDEDMA_PMAC is not set
+CONFIG_BLK_DEV_IDEDMA_PMAC=y
+CONFIG_BLK_DEV_IDEDMA=y
+CONFIG_PMAC_IDEDMA_AUTO=y
 # CONFIG_IDE_CHIPSETS is not set
 
 #
 # Additional Block Devices
 #
-CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_MD is not set
 CONFIG_BLK_DEV_RAM=y
@@ -116,6 +119,7 @@
 # (it is safe to leave these untouched)
 #
 CONFIG_INET_RARP=y
+CONFIG_IP_NOSR=y
 CONFIG_SKB_LARGE=y
 # CONFIG_IPV6 is not set
 
@@ -151,12 +155,12 @@
 CONFIG_CHR_DEV_ST=y
 CONFIG_BLK_DEV_SR=y
 CONFIG_BLK_DEV_SR_VENDOR=y
-CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SG is not set
 
 #
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
-CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_MULTI_LUN is not set
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
@@ -184,28 +188,16 @@
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
 # CONFIG_SCSI_GDTH is not set
 # CONFIG_SCSI_GENERIC_NCR5380 is not set
-# CONFIG_SCSI_G_NCR5380_PORT is not set
-# CONFIG_SCSI_G_NCR5380_MEM is not set
 # CONFIG_SCSI_INITIO is not set
-# CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_NCR53C406A is not set
-# CONFIG_SCSI_SYM53C416 is not set
 # CONFIG_SCSI_NCR53C7xx is not set
-CONFIG_SCSI_NCR53C8XX=y
-# CONFIG_SCSI_SYM53C8XX is not set
-CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
-CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32
-CONFIG_SCSI_NCR53C8XX_SYNC=20
-# CONFIG_SCSI_NCR53C8XX_PROFILE is not set
-# CONFIG_SCSI_NCR53C8XX_IOMAPPED is not set
-# CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set
+# CONFIG_SCSI_NCR53C8XX is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PCI2000 is not set
 # CONFIG_SCSI_PCI2220I is not set
 # CONFIG_SCSI_PSI240I is not set
 # CONFIG_SCSI_QLOGIC_FAS is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
-# CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_SEAGATE is not set
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_T128 is not set
@@ -236,7 +228,7 @@
 # CONFIG_ACENIC is not set
 # CONFIG_NET_ISA is not set
 CONFIG_NET_EISA=y
-CONFIG_PCNET32=y
+# CONFIG_PCNET32 is not set
 # CONFIG_AC3200 is not set
 # CONFIG_APRICOT is not set
 # CONFIG_CS89x0 is not set
@@ -283,7 +275,7 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
+# CD-ROM drivers (not for SCSI or IDE/ATAPI drives)
 #
 # CONFIG_CD_NO_IDESCSI is not set
 
@@ -291,37 +283,22 @@
 # Console drivers
 #
 CONFIG_DUMMY_CONSOLE=y
-# CONFIG_FB_PM2 is not set
 CONFIG_FB_OF=y
 CONFIG_FB_CONTROL=y
 CONFIG_FB_PLATINUM=y
 CONFIG_FB_VALKYRIE=y
-# CONFIG_FB_ATY is not set
+CONFIG_FB_ATY=y
 CONFIG_FB_IMSTT=y
 CONFIG_FB_CT65550=y
 # CONFIG_FB_S3TRIO is not set
-CONFIG_FB_MATROX=y
-CONFIG_FB_MATROX_MILLENIUM=y
-CONFIG_FB_MATROX_MYSTIQUE=y
-CONFIG_FB_MATROX_G100=y
-# CONFIG_FB_MATROX_MULTIHEAD is not set
-# CONFIG_FB_ATY is not set
+# CONFIG_FB_MATROX is not set
+CONFIG_FB_ATY=y
 # CONFIG_FB_VIRTUAL is not set
-CONFIG_FBCON_ADVANCED=y
-# CONFIG_FBCON_MFB is not set
-# CONFIG_FBCON_CFB2 is not set
-# CONFIG_FBCON_CFB4 is not set
+# CONFIG_FBCON_ADVANCED is not set
 CONFIG_FBCON_CFB8=y
 CONFIG_FBCON_CFB16=y
 CONFIG_FBCON_CFB24=y
 CONFIG_FBCON_CFB32=y
-# CONFIG_FBCON_AFB is not set
-# CONFIG_FBCON_ILBM is not set
-# CONFIG_FBCON_IPLAN2P2 is not set
-# CONFIG_FBCON_IPLAN2P4 is not set
-# CONFIG_FBCON_IPLAN2P8 is not set
-# CONFIG_FBCON_MAC is not set
-# CONFIG_FBCON_VGA is not set
 # CONFIG_FBCON_FONTWIDTH8_ONLY is not set
 CONFIG_FBCON_FONTS=y
 # CONFIG_FONT_8x8 is not set
@@ -337,25 +314,15 @@
 #
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
-CONFIG_SERIAL=m
+# CONFIG_SERIAL is not set
 # CONFIG_SERIAL_EXTENDED is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 CONFIG_UNIX98_PTYS=y
 CONFIG_UNIX98_PTY_COUNT=256
-CONFIG_MOUSE=y
-
-#
-# Mice
-#
-# CONFIG_ATIXL_BUSMOUSE is not set
-# CONFIG_BUSMOUSE is not set
-# CONFIG_MS_BUSMOUSE is not set
-CONFIG_PSMOUSE=y
-# CONFIG_82C710_MOUSE is not set
-# CONFIG_PC110_PAD is not set
+# CONFIG_MOUSE is not set
 # CONFIG_QIC02_TAPE is not set
 # CONFIG_WATCHDOG is not set
-# CONFIG_NVRAM is not set
+CONFIG_NVRAM=y
 # CONFIG_RTC is not set
 
 #
@@ -367,20 +334,11 @@
 # Joystick support
 #
 # CONFIG_JOYSTICK is not set
-# CONFIG_DTLK is not set
 
 #
 # Ftape, the floppy tape device driver
 #
 # CONFIG_FTAPE is not set
-# CONFIG_FT_NORMAL_DEBUG is not set
-# CONFIG_FT_FULL_DEBUG is not set
-# CONFIG_FT_NO_TRACE is not set
-# CONFIG_FT_NO_TRACE_AT_ALL is not set
-# CONFIG_FT_STD_FDC is not set
-# CONFIG_FT_MACH2 is not set
-# CONFIG_FT_PROBE_FC10 is not set
-# CONFIG_FT_ALT_FDC is not set
 
 #
 # Filesystems
@@ -471,10 +429,3 @@
 # CONFIG_SOUND_MSNDCLAS is not set
 # CONFIG_SOUND_MSNDPIN is not set
 # CONFIG_SOUND_OSS is not set
-
-#
-# Kernel hacking
-#
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_KGDB is not set
-# CONFIG_XMON is not set
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/checks.c linux-2.2.10-pre3/arch/ppc/kernel/checks.c
--- linux-2.2.10-pre2/arch/ppc/kernel/checks.c	1998-08-04 16:06:36.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/checks.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,3 +1,4 @@
+#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/chrp_pci.c linux-2.2.10-pre3/arch/ppc/kernel/chrp_pci.c
--- linux-2.2.10-pre2/arch/ppc/kernel/chrp_pci.c	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/chrp_pci.c	2003-08-15 15:06:27.000000000 -0700
@@ -166,6 +166,62 @@
 	return PCIBIOS_SUCCESSFUL;
 }
 
+
+int rtas_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn,
+				    unsigned char offset, unsigned char *val)
+{
+	unsigned long addr = (offset&0xff) | ((dev_fn&0xff)<<8) | ((bus & 0xff)<<16);
+	if ( call_rtas( "read-pci-config", 2, 2, (ulong *)&val, addr, 1 ) != 0 )
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	return PCIBIOS_SUCCESSFUL;
+}
+
+int rtas_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn,
+				    unsigned char offset, unsigned short *val)
+{
+	unsigned long addr = (offset&0xff) | ((dev_fn&0xff)<<8) | ((bus & 0xff)<<16);
+	if ( call_rtas( "read-pci-config", 2, 2, (ulong *)&val, addr, 2 ) != 0 )
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	return PCIBIOS_SUCCESSFUL;
+}
+
+
+int rtas_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn,
+				     unsigned char offset, unsigned int *val)
+{
+	unsigned long addr = (offset&0xff) | ((dev_fn&0xff)<<8) | ((bus & 0xff)<<16);
+	if ( call_rtas( "read-pci-config", 2, 2, (ulong *)&val, addr, 4 ) != 0 )
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	return PCIBIOS_SUCCESSFUL;
+}
+
+int rtas_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn,
+				     unsigned char offset, unsigned char val)
+{
+	unsigned long addr = (offset&0xff) | ((dev_fn&0xff)<<8) | ((bus & 0xff)<<16);
+	if ( call_rtas( "write-pci-config", 3, 1, NULL, addr, 1, (ulong)val ) != 0 )
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	return PCIBIOS_SUCCESSFUL;
+}
+
+int rtas_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn,
+				     unsigned char offset, unsigned short val)
+{
+	unsigned long addr = (offset&0xff) | ((dev_fn&0xff)<<8) | ((bus & 0xff)<<16);
+	if ( call_rtas( "write-pci-config", 3, 1, NULL, addr, 2, (ulong)val ) != 0 )
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	return PCIBIOS_SUCCESSFUL;
+}
+
+int rtas_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn,
+				      unsigned char offset, unsigned int val)
+{
+	unsigned long addr = (offset&0xff) | ((dev_fn&0xff)<<8) | ((bus & 0xff)<<16);
+	if ( call_rtas( "write-pci-config", 3, 1, NULL, addr, 4, (ulong)val ) != 0 )
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	return PCIBIOS_SUCCESSFUL;
+}
+
     /*
      *  Temporary fixes for PCI devices. These should be replaced by OF query
      *  code -- Geert
@@ -255,6 +311,7 @@
 
 decl_config_access_method(grackle);
 decl_config_access_method(indirect);
+decl_config_access_method(rtas);
 
 void __init
 chrp_setup_pci_ptrs(void)
@@ -275,7 +332,7 @@
 		{
 			/* find out how many pythons */
 			while ( (py = py->next) ) python_busnr++;
-                        set_config_access_method(python);
+			set_config_access_method(python);
 			/*
 			 * We base these values on the machine type but should
 			 * try to read them from the python controller itself.
@@ -296,10 +353,22 @@
                 }
                 else
                 {
-			pci_dram_offset = 0;
-			isa_mem_base = 0xf7000000;
-			isa_io_base = 0xf8000000;
-			set_config_access_method(gg2);
+			if ( !strncmp("IBM,7043-150", get_property(find_path_device("/"), "name", NULL),12) )
+			{
+				pci_dram_offset = 0;
+				isa_mem_base = 0x80000000;
+				isa_io_base = 0xfe000000;
+				pci_config_address = (unsigned int *)0xfec00000;
+				pci_config_data = (unsigned char *)0xfee00000;
+				set_config_access_method(indirect);
+			}
+			else
+			{
+				pci_dram_offset = 0;
+				isa_mem_base = 0xf7000000;
+				isa_io_base = 0xf8000000;
+				set_config_access_method(gg2);
+			}
                 }
         }
 	
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/chrp_setup.c linux-2.2.10-pre3/arch/ppc/kernel/chrp_setup.c
--- linux-2.2.10-pre2/arch/ppc/kernel/chrp_setup.c	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/chrp_setup.c	2003-08-15 15:06:27.000000000 -0700
@@ -32,6 +32,7 @@
 #include <linux/console.h>
 #include <linux/pci.h>
 #include <linux/openpic.h>
+#include <linux/version.h>
 
 #include <asm/mmu.h>
 #include <asm/processor.h>
@@ -64,6 +65,7 @@
 
 unsigned long chrp_get_rtc_time(void);
 int chrp_set_rtc_time(unsigned long nowtime);
+unsigned long rtas_event_scan_rate = 0, rtas_event_scan_ct = 0;
 void chrp_calibrate_decr(void);
 void chrp_time_init(void);
 
@@ -179,6 +181,7 @@
 	return len;
 }
 
+#if 0
 /*
      *  Fixes for the National Semiconductor PC78308VUL SuperI/O
      *
@@ -228,12 +231,13 @@
 	/* select logical device 1 (KBC/Mouse) */
 	sio_fixup_irq("mouse", 1, 12, 2);
 }
-
+#endif
 
 __initfunc(void
 	   chrp_setup_arch(unsigned long * memory_start_p, unsigned long * memory_end_p))
 {
 	extern char cmd_line[];
+	struct device_node *device;
 
 	/* init to some ~sane value until calibrate_delay() runs */
 	loops_per_sec = 50000000;
@@ -273,80 +277,73 @@
 			find_path_device("/"), "platform-open-pic", NULL);
 		OpenPIC = ioremap((unsigned long)OpenPIC, sizeof(struct OpenPIC));
 	}
-	
+
 	/*
 	 *  Fix the Super I/O configuration
 	 */
-	sio_init();
+	/*sio_init();*/
 #ifdef CONFIG_DUMMY_CONSOLE
 	conswitchp = &dummy_con;
 #endif
-	/* my starmax 6000 needs this but the longtrail shouldn't do it -- Cort */
-	if ( !strncmp("MOT", get_property(find_path_device("/"),
-					  "model", NULL),3) )
-		*memory_start_p = pmac_find_bridges(*memory_start_p, *memory_end_p);
-	/*
-	 * The f50 has a lot of IO space - we need to map some in that
-	 * isn't covered by the BAT mappings in MMU_init() -- Cort
+	*memory_start_p = pmac_find_bridges(*memory_start_p, *memory_end_p);
+
+	/* Get the event scan rate for the rtas so we know how
+	 * often it expects a heartbeat. -- Cort
 	 */
-	if ( !strncmp("F5", get_property(find_path_device("/"),
-					 "ibm,model-class", NULL),2) )
+	if ( rtas_data )
 	{
-#if 0		
-		/*
-		 * This ugly hack allows us to force ioremap() to
-		 * create a 1-to-1 mapping for us, even though
-		 * the address is < ioremap_base.  This is necessary
-		 * since we want our PCI IO space to have contiguous
-		 * virtual addresses and I think it's worse to have
-		 * calls to map_page() here.
-		 * -- Cort
-		 */
-		unsigned long hold = ioremap_base;
-		ioremap_base = 0;
-		__ioremap(0x90000000, 0x10000000, _PAGE_NO_CACHE);
-		ioremap_base = hold;
-#endif		
+		struct property *p;
+		device = find_devices("rtas");
+		for ( p = device->properties;
+		      strncmp(p->name, "rtas-event-scan-rate", 20) && p ;
+		      p = p->next )
+			/* nothing */ ;
+		if ( p && *(unsigned long *)p->value )
+		{
+			rtas_event_scan_rate = (HZ/(*(unsigned long *)p->value)*30)-1;
+			rtas_event_scan_ct = 1;
+			printk("RTAS Event Scan Rate: %lu (%lu jiffies)\n",
+			       *(unsigned long *)p->value, rtas_event_scan_rate );
+		}
 	}
 }
 
 void
+chrp_event_scan(void)
+{
+	unsigned char log[1024];
+	if ( rtas_event_scan_rate && (rtas_event_scan_ct-- <= 0) )
+	{
+		call_rtas( "event-scan", 4, 1, NULL, 0x0, 1, __pa(log), 1024 );
+		rtas_event_scan_ct = rtas_event_scan_rate;
+	}
+}
+	
+void
 chrp_restart(char *cmd)
 {
-#if 0
-	extern unsigned int rtas_entry, rtas_data, rtas_size;
 	printk("RTAS system-reboot returned %d\n",
 	       call_rtas("system-reboot", 0, 1, NULL));
-	printk("rtas_entry: %08lx rtas_data: %08lx rtas_size: %08lx\n",
-	       rtas_entry,rtas_data,rtas_size);
 	for (;;);
-#else
-	printk("System Halted\n");
-	while(1);
-#endif
 }
 
 void
 chrp_power_off(void)
 {
-	/* RTAS doesn't seem to work on Longtrail.
-	   For now, do it the same way as the PReP. */
-#if 0
-	extern unsigned int rtas_entry, rtas_data, rtas_size;
+	/* allow power on only with power button press */
+#define	PWR_FIELD(x) (0x8000000000000000 >> ((x)-96))
 	printk("RTAS power-off returned %d\n",
-	       call_rtas("power-off", 2, 1, NULL, 0, 0));
-	printk("rtas_entry: %08lx rtas_data: %08lx rtas_size: %08lx\n",
-	       rtas_entry,rtas_data,rtas_size);
+	       call_rtas("power-off", 2, 1, NULL,
+			 ((PWR_FIELD(96)|PWR_FIELD(97))>>32)&0xffffffff,
+			 (PWR_FIELD(96)|PWR_FIELD(97))&0xffffffff));
+#undef PWR_FIELD	
 	for (;;);
-#else
-	chrp_restart(NULL);
-#endif
 }
 
 void
 chrp_halt(void)
 {
-	chrp_restart(NULL);
+	chrp_power_off();
 }
 
 u_int
@@ -668,5 +665,21 @@
         ppc_ide_md.ide_init_hwif = chrp_ide_init_hwif_ports;
 
         ppc_ide_md.io_base = _IO_BASE;
-#endif		
+#endif
+	/*
+	 * Print the banner, then scroll down so boot progress
+	 * can be printed.  -- Cort 
+	 */
+	chrp_progress("Linux/PPC "UTS_RELEASE"\n");
+}
+
+void chrp_progress(char *s)
+{
+	extern unsigned int rtas_data;
+	
+	if ( (_machine != _MACH_chrp) || !rtas_data )
+		return;
+	call_rtas( "display-character", 1, 1, NULL, '\r' );
+	while ( *s )
+		call_rtas( "display-character", 1, 1, NULL, *s++ );
 }
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/head.S linux-2.2.10-pre3/arch/ppc/kernel/head.S
--- linux-2.2.10-pre2/arch/ppc/kernel/head.S	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/head.S	2003-08-15 15:06:27.000000000 -0700
@@ -1,7 +1,7 @@
 /*
  *  arch/ppc/kernel/head.S
  *
- *  $Id: head.S,v 1.130 1999/05/09 19:16:43 cort Exp $
+ *  $Id: head.S,v 1.130.2.1 1999/05/29 19:09:59 cort Exp $
  *
  *  PowerPC version 
  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
@@ -97,18 +97,32 @@
 	bdnz	0b
 #endif
 
+#ifdef CONFIG_PPC64
+#define LOAD_BAT(n, offset, reg, RA, RB) \
+	ld	RA,offset+0(reg);	\
+	ld	RB,offset+8(reg);	\
+	mtspr	IBAT##n##U,RA;		\
+	mtspr	IBAT##n##L,RB;		\
+	ld	RA,offset+16(reg);	\
+	ld	RB,offset+24(reg);	\
+	mtspr	DBAT##n##U,RA;		\
+	mtspr	DBAT##n##L,RB;		\
+	
+#else /* CONFIG_PPC64 */
+	
 /* 601 only have IBAT cr0.eq is set on 601 when using this macro */ 
 #define LOAD_BAT(n, offset, reg, RA, RB) \
-	lwz	RA,offset+0(reg); \
+	lwz	RA,offset+0(reg);	\
 	lwz	RB,offset+4(reg);	\
-	mtspr	IBAT##n##U,RA;	\
-	mtspr	IBAT##n##L,RB;	\
-	beq	1f;		\
+	mtspr	IBAT##n##U,RA;		\
+	mtspr	IBAT##n##L,RB;		\
+	beq	1f;			\
 	lwz	RA,offset+8(reg);	\
 	lwz	RB,offset+12(reg);	\
-	mtspr	DBAT##n##U,RA;	\
-	mtspr	DBAT##n##L,RB;	\
-1:	 
+	mtspr	DBAT##n##U,RA;		\
+	mtspr	DBAT##n##L,RB;		\
+1:	
+#endif /* CONFIG_PPC64 */	 
 
 #ifndef CONFIG_APUS
 #define tophys(rd,rs,rt)	addis	rd,rs,-KERNELBASE@h
@@ -206,6 +220,16 @@
 	
 	.globl	__start
 __start:
+#ifdef CONFIG_PPC64
+/* 
+ * Go into 32-bit mode to boot.  OF should do this for
+ * us already but just in case...
+ * -- Cort 
+ */
+	mfmsr	r10
+	clrldi	r10,r10,3
+	mtmsr	r10
+#endif	
 /*
  * We have to do any OF calls before we map ourselves to KERNELBASE,
  * because OF may have I/O devices mapped in in that area
@@ -226,10 +250,11 @@
  * of RAM to KERNELBASE.  From this point on we can't safely
  * call OF any more.
  */
+	lis	r11,KERNELBASE@h
+#ifndef CONFIG_PPC64
 	mfspr	r9,PVR
 	rlwinm	r9,r9,16,16,31		/* r9 = 1 for 601, 4 for 604 */
 	cmpi	0,r9,1
-	lis	r11,KERNELBASE@h
 	bne	4f
 	ori	r11,r11,4		/* set up BAT registers for 601 */
 	li	r8,0x7f			/* valid, block length = 8MB */
@@ -240,6 +265,7 @@
 	mtspr	IBAT1U,r9
 	mtspr	IBAT1L,r10
 	b	5f
+#endif /* CONFIG_PPC64 */
 4:
 #ifdef CONFIG_APUS
 	ori	r11,r11,BL_8M<<2|0x2	/* set up an 8MB mapping */
@@ -248,9 +274,17 @@
 	lwz	r8,0(r8)
 	addis	r8,r8,KERNELBASE@h
 	addi	r8,r8,2
-#else
+#else	
 	ori	r11,r11,BL_256M<<2|0x2	/* set up BAT registers for 604 */
 	li	r8,2			/* R/W access */
+#ifdef CONFIG_PPC64
+	/* clear out the high 32 bits in the BAT */
+	clrldi	r11,r11,32
+	clrldi	r8,r8,32
+	/* turn off the pagetable mappings just in case */
+	clrldi	r16,r16,63
+	mtsdr1	r16
+#else /* CONFIG_PPC64 */
 	/* 
 	 * allow secondary cpus to get at all of ram in early bootup
 	 * since their init_task may be up there -- Cort
@@ -268,6 +302,7 @@
 	mtspr	DBAT2U,r21		/* bit in upper BAT register */
 	mtspr	IBAT2L,r28
 	mtspr	IBAT2U,r21
+#endif /* CONFIG_PPC64 */
 #endif
 	mtspr	DBAT0L,r8		/* N.B. 6xx (not 601) have valid */
 	mtspr	DBAT0U,r11		/* bit in upper BAT register */
@@ -1246,7 +1281,7 @@
 	eieio
 	lis	r2,hash_table_lock@h
 	ori	r2,r2,hash_table_lock@l
-	tophys(r2,r2,r6)
+ 	tophys(r2,r2,r6)
 	lis	r6,100000000@h
 	mtctr	r6
 	lwz	r0,PROCESSOR-TSS(r5)
@@ -1294,6 +1329,11 @@
 	stw	r6,0(r2)		/* update PTE (accessed/dirty bits) */
 
 	/* Convert linux-style PTE to low word of PPC-style PTE */
+#ifdef CONFIG_PPC64
+	/* clear the high 32 bits just in case */
+	clrldi	r6,r6,32
+	clrldi	r4,r4,32
+#endif /* CONFIG_PPC64 */
 	rlwinm	r4,r6,32-9,31,31	/* _PAGE_HWWRITE -> PP lsb */
 	rlwimi	r6,r6,32-1,31,31	/* _PAGE_USER -> PP (both bits now) */
 	ori	r4,r4,0xe04		/* clear out reserved bits */
@@ -1301,16 +1341,34 @@
 
 	/* Construct the high word of the PPC-style PTE */
 	mfsrin	r5,r3			/* get segment reg for segment */
+#ifdef CONFIG_PPC64
+	sldi	r5,r5,12
+#else /* CONFIG_PPC64 */
 	rlwinm	r5,r5,7,1,24		/* put VSID in 0x7fffff80 bits */
+#endif /* CONFIG_PPC64 */
+	
 #ifndef __SMP__				/* do this later for SMP */
+#ifdef CONFIG_PPC64
+	ori	r5,r5,1			/* set V (valid) bit */
+#else /* CONFIG_PPC64 */
 	oris	r5,r5,0x8000		/* set V (valid) bit */
+#endif /* CONFIG_PPC64 */
 #endif
+	
+#ifdef CONFIG_PPC64
+/* XXX:	 does this insert the api correctly? -- Cort */
+	rlwimi	r5,r3,17,21,25		/* put in API (abbrev page index) */
+#else /* CONFIG_PPC64 */
 	rlwimi	r5,r3,10,26,31		/* put in API (abbrev page index) */
-
+#endif /* CONFIG_PPC64 */
 	/* Get the address of the primary PTE group in the hash table */
 	.globl	hash_page_patch_A
 hash_page_patch_A:
 	lis	r4,Hash_base@h		/* base address of hash table */
+#ifdef CONFIG_PPC64
+	/* just in case */
+	clrldi	r4,r4,32
+#endif	
 	rlwimi	r4,r5,32-1,26-Hash_bits,25	/* (VSID & hash_mask) << 6 */
 	rlwinm	r0,r3,32-6,26-Hash_bits,25	/* (PI & hash_mask) << 6 */
 	xor	r4,r4,r0		/* make primary hash */
@@ -1799,7 +1857,11 @@
  */
 #ifndef CONFIG_8xx
 	lis	r6,_SDR1@ha
+#ifdef CONFIG_PPC64	
+	ld	r6,_SDR1@l(r6)
+#else
 	lwz	r6,_SDR1@l(r6)
+#endif		
 #else
 	/* The right way to do this would be to track it down through
 	 * init's TSS like the context switch code does, but this is
@@ -1828,6 +1890,14 @@
 #endif
 #ifndef CONFIG_8xx
 	mtspr	SDR1,r6
+#ifdef CONFIG_PPC64
+	/* clear the v bit in the ASR so we can
+	 * behave as if we have segment registers 
+	 * -- Cort
+	 */
+	clrldi	r6,r6,63
+	mtasr	r6
+#endif /* CONFIG_PPC64 */
 	li	r0,16		/* load up segment register values */
 	mtctr	r0		/* for context 0 */
 	lis	r3,0x2000	/* Ku = 1, VSID = 0 */
@@ -1844,10 +1914,17 @@
 	lis	r3,BATS@ha
 	addi	r3,r3,BATS@l
 	tophys(r3,r3,r4)
+#ifdef CONFIG_PPC64
+	LOAD_BAT(0,0,r3,r4,r5)
+	LOAD_BAT(1,32,r3,r4,r5)
+	LOAD_BAT(2,64,r3,r4,r5)
+	LOAD_BAT(3,96,r3,r4,r5)
+#else /* CONFIG_PPC64 */
 	LOAD_BAT(0,0,r3,r4,r5)
 	LOAD_BAT(1,16,r3,r4,r5)
 	LOAD_BAT(2,32,r3,r4,r5)
 	LOAD_BAT(3,48,r3,r4,r5)
+#endif /* CONFIG_PPC64 */
 #endif /* CONFIG_8xx */
 /* Set up for using our exception vectors */
 	/* ptr to phys current tss */
@@ -2538,7 +2615,6 @@
  */
 	.globl	enter_rtas
 enter_rtas:
-	stwu	r1,-16(r1)
 	mflr	r0
 	stw	r0,20(r1)
 	lis	r4,rtas_data@ha
@@ -2559,7 +2635,6 @@
 	andi.	r9,r9,MSR_ME|MSR_RI
 	sync			/* disable interrupts so SRR0/1 */
 	mtmsr	r0		/* don't get trashed */
-	li	r6,0	
 	mtlr	r6
 	mtspr	SPRG2,r7
 	mtspr	SRR0,r8
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/idle.c linux-2.2.10-pre3/arch/ppc/kernel/idle.c
--- linux-2.2.10-pre2/arch/ppc/kernel/idle.c	1999-04-29 12:39:01.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/idle.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- * $Id: idle.c,v 1.61 1999/03/18 04:15:45 cort Exp $
+ * $Id: idle.c,v 1.61.2.1 1999/05/29 19:10:02 cort Exp $
  *
  * Idle daemon for PowerPC.  Idle daemon will handle any action
  * that needs to be taken when the system becomes idle.
@@ -50,6 +50,7 @@
 	/* endless loop with no priority at all */
 	current->priority = 0;
 	current->counter = -100;
+	init_idle();	
 	for (;;)
 	{
 		__sti();
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/irq.c linux-2.2.10-pre3/arch/ppc/kernel/irq.c
--- linux-2.2.10-pre2/arch/ppc/kernel/irq.c	1999-04-29 12:39:01.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/irq.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- * $Id: irq.c,v 1.105 1999/03/25 19:51:51 cort Exp $
+ * $Id: irq.c,v 1.105.2.1 1999/05/29 19:10:05 cort Exp $
  *
  *  arch/ppc/kernel/irq.c
  *
@@ -65,7 +65,6 @@
 void enable_irq(unsigned int irq_nr);
 void disable_irq(unsigned int irq_nr);
 
-/* Fixme - Need to figure out a way to get rid of this - Corey */
 volatile unsigned char *chrp_int_ack_special;
 
 #ifdef CONFIG_APUS
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/Makefile linux-2.2.10-pre3/arch/ppc/kernel/Makefile
--- linux-2.2.10-pre2/arch/ppc/kernel/Makefile	1999-04-29 12:39:01.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/Makefile	2003-08-15 15:06:27.000000000 -0700
@@ -65,7 +65,7 @@
 	$(HOSTCC) -o find_name find_name.c
 
 checks: checks.c
-	$(HOSTCC) -fno-builtin -I$(TOPDIR)/include -D__KERNEL__ -o checks checks.c
+	$(HOSTCC) ${CFLAGS} -D__KERNEL__ -o checks checks.c
 	./checks
 
 include $(TOPDIR)/Rules.make
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/misc.S linux-2.2.10-pre3/arch/ppc/kernel/misc.S
--- linux-2.2.10-pre2/arch/ppc/kernel/misc.S	1999-04-29 12:39:01.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/misc.S	2003-08-15 15:06:27.000000000 -0700
@@ -649,15 +649,6 @@
         blr
 
 /*
- * Fetch the current SR register
- *   get_SR(int index)
- */
-_GLOBAL(get_SR)
-	mfsrin	r4,r3
-	mr	r3,r4
-	blr
-
-/*
  * Create a kernel thread
  *   __kernel_thread(flags, fn, arg)
  */
@@ -875,7 +866,11 @@
 	.long sys_getresuid	/* 165 */
 	.long sys_query_module
 	.long sys_poll
+#ifdef CONFIG_NFS	
 	.long sys_nfsservctl
+#else
+	.long sys_ni_syscall
+#endif		
 	.long sys_setresgid
 	.long sys_getresgid	/* 170 */
 	.long sys_prctl
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/prep_pci.c linux-2.2.10-pre3/arch/ppc/kernel/prep_pci.c
--- linux-2.2.10-pre2/arch/ppc/kernel/prep_pci.c	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/prep_pci.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- * $Id: prep_pci.c,v 1.33 1999/05/09 20:15:54 cort Exp $
+ * $Id: prep_pci.c,v 1.35 1999/05/10 23:31:03 cort Exp $
  * PReP pci functions.
  * Originally by Gary Thomas
  * rewritten and updated by Cort Dougan (cort@cs.nmt.edu)
@@ -38,6 +38,8 @@
 /* Used for Motorola to store system config register */
 static unsigned long	*ProcInfo;
 
+extern void chrp_do_IRQ(struct pt_regs *,int , int);
+
 /* Tables for known hardware */   
 
 /* Motorola PowerStackII - Utah */
@@ -731,6 +733,8 @@
 	OpenPIC_InitSenses = mvme2600_openpic_initsenses;
 	OpenPIC_NumInitSenses = sizeof(mvme2600_openpic_initsenses);
 
+	ppc_md.do_IRQ = chrp_do_IRQ;
+	
 	/* If raven is present on Motorola store the system config register
 	 * for later use.
 	 */
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/prep_setup.c linux-2.2.10-pre3/arch/ppc/kernel/prep_setup.c
--- linux-2.2.10-pre2/arch/ppc/kernel/prep_setup.c	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/prep_setup.c	2003-08-15 15:06:27.000000000 -0700
@@ -249,7 +249,7 @@
 		ROOT_DEV = to_kdev_t(0x0801); /* sda1 */
 		break;
 	case _PREP_Radstone:
-		ROOT_DEV = to_kdev_t(0x0801); /* sda1 */
+		ROOT_DEV = to_kdev_t(0x0802); /* sda2 */
 
 		/*
 		 * Determine system type
@@ -767,10 +767,8 @@
 	ppc_md.get_cpuinfo    = prep_get_cpuinfo;
 	ppc_md.irq_cannonicalize = prep_irq_cannonicalize;
 	ppc_md.init_IRQ       = prep_init_IRQ;
-	if ( !OpenPIC )
-		ppc_md.do_IRQ         = prep_do_IRQ;
-	else
-		ppc_md.do_IRQ         = chrp_do_IRQ;
+	/* this gets changed later on if we have an OpenPIC -- Cort */
+	ppc_md.do_IRQ         = prep_do_IRQ;
 	ppc_md.init           = NULL;
 
 	ppc_md.restart        = prep_restart;
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/prom.c linux-2.2.10-pre3/arch/ppc/kernel/prom.c
--- linux-2.2.10-pre2/arch/ppc/kernel/prom.c	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/prom.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- * $Id: prom.c,v 1.54 1999/05/10 04:43:46 cort Exp $
+ * $Id: prom.c,v 1.54.2.1 1999/05/29 19:10:12 cort Exp $
  *
  * Procedures for interfacing to the Open Firmware PROM on
  * Power Macintosh computers.
@@ -24,6 +24,7 @@
 #include <asm/io.h>
 #include <asm/smp.h>
 #include <asm/bootx.h>
+#include <asm/system.h>
 
 /*
  * Properties whose value is longer than this get excluded from our
@@ -412,6 +413,9 @@
 	mem = copy_device_tree(mem, mem + (1<<20));
 	prom_print(RELOC("done\n"));
 
+
+	RELOC(klimit) = (char *) (mem - offset);
+	
 	prom_rtas = call_prom(RELOC("finddevice"), 1, 1, RELOC("/rtas"));
 	if (prom_rtas != (void *) -1) {
 		RELOC(rtas_size) = 0;
@@ -421,9 +425,19 @@
 		if (RELOC(rtas_size) == 0) {
 			RELOC(rtas_data) = 0;
 		} else {
-			mem = (mem + 4095) & -4096; /* round to page bdry */
+			/*
+			 * We do _not_ want the rtas_data inside the klimit
+			 * boundry since it'll be squashed when we do the
+			 * relocate of the kernel on chrp right after prom_init()
+			 * in head.S.  So, we just pick a spot in memory.
+			 * -- Cort
+			 */
+#if 0
+			mem = (mem + 4095) & -4096;
 			RELOC(rtas_data) = mem + KERNELBASE;
 			mem += RELOC(rtas_size);
+#endif
+			RELOC(rtas_data) = (6<<20) + KERNELBASE;
 		}
 		prom_rtas = call_prom(RELOC("open"), 1, 1, RELOC("/rtas"));
 		{
@@ -448,7 +462,7 @@
 		else
 			prom_print(RELOC(" done\n"));
 	}
-	RELOC(klimit) = (char *) (mem - offset);
+
 #ifdef CONFIG_SMP
 	/*
 	 * With CHRP SMP we need to use the OF to start the other
@@ -1289,7 +1303,7 @@
 	  unsigned long *outputs, ...)
 {
 	va_list list;
-	int i;
+	int i, s;
 	struct device_node *rtas;
 	int *tokp;
 	union {
@@ -1305,16 +1319,19 @@
 		printk(KERN_ERR "No RTAS service called %s\n", service);
 		return -1;
 	}
-	u.words[0] = __pa(*tokp);
+	u.words[0] = *tokp;
 	u.words[1] = nargs;
 	u.words[2] = nret;
 	va_start(list, outputs);
 	for (i = 0; i < nargs; ++i)
 		u.words[i+3] = va_arg(list, unsigned long);
 	va_end(list);
+	
+	s = _disable_interrupts();
 	spin_lock(&rtas_lock);
 	enter_rtas((void *)__pa(&u));
 	spin_unlock(&rtas_lock);
+	_enable_interrupts(s);
 	if (nret > 1 && outputs != NULL)
 		for (i = 0; i < nret-1; ++i)
 			outputs[i] = u.words[i+nargs+4];
@@ -1326,8 +1343,7 @@
 abort()
 {
 #ifdef CONFIG_XMON
-	extern void xmon(void *);
-	xmon(0);
+	xmon(NULL);
 #endif
 	prom_exit();
 }
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/ptrace.c linux-2.2.10-pre3/arch/ppc/kernel/ptrace.c
--- linux-2.2.10-pre2/arch/ppc/kernel/ptrace.c	1999-04-29 12:39:01.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/ptrace.c	2003-08-15 15:06:27.000000000 -0700
@@ -330,8 +330,12 @@
 		if ((!child->dumpable ||
 		    (current->uid != child->euid) ||
 		    (current->uid != child->uid) ||
+		    (current->uid != child->suid) ||
 	 	    (current->gid != child->egid) ||
-	 	    (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
+	 	    (current->gid != child->gid) ||
+		    (current->gid != child->sgid) ||
+		    (!cap_issubset(child->cap_permitted, current->cap_permitted)))
+		    && !capable(CAP_SYS_PTRACE))
 			goto out;
 		/* the same process cannot be attached many times */
 		if (child->flags & PF_PTRACED)
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/residual.c linux-2.2.10-pre3/arch/ppc/kernel/residual.c
--- linux-2.2.10-pre2/arch/ppc/kernel/residual.c	1998-11-15 10:51:44.000000000 -0800
+++ linux-2.2.10-pre3/arch/ppc/kernel/residual.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- * $Id: residual.c,v 1.14 1998/10/11 17:38:10 cort Exp $
+ * $Id: residual.c,v 1.14.2.1 1999/05/29 19:10:17 cort Exp $
  *
  * Code to deal with the PReP residual data.
  *
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/setup.c linux-2.2.10-pre3/arch/ppc/kernel/setup.c
--- linux-2.2.10-pre2/arch/ppc/kernel/setup.c	1999-04-29 12:39:01.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/setup.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- * $Id: setup.c,v 1.132 1999/03/24 00:32:19 cort Exp $
+ * $Id: setup.c,v 1.132.2.1 1999/06/03 03:03:45 paulus Exp $
  * Common prep/pmac/chrp boot and setup code.
  */
 
@@ -375,7 +375,6 @@
 			else
 			{
 				_machine = _MACH_Pmac;
-				is_prep = 1;
 			}
 		}
 
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/smp.c linux-2.2.10-pre3/arch/ppc/kernel/smp.c
--- linux-2.2.10-pre2/arch/ppc/kernel/smp.c	1999-04-29 12:39:01.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/smp.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- * $Id: smp.c,v 1.49 1999/03/18 04:16:31 cort Exp $
+ * $Id: smp.c,v 1.49.2.1 1999/05/29 19:10:20 cort Exp $
  *
  * Smp support for ppc.
  *
@@ -388,9 +388,12 @@
 
 void __init smp_callin(void)
 {
+	int i;
+	
 	printk("SMP %d: smp_callin()\n",current->processor);
         smp_store_cpu_info(current->processor);
 	set_dec(decrementer_count);
+	
 #if 0
 	current->mm->mmap->vm_page_prot = PAGE_SHARED;
 	current->mm->mmap->vm_start = PAGE_OFFSET;
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/softemu8xx.c linux-2.2.10-pre3/arch/ppc/kernel/softemu8xx.c
--- linux-2.2.10-pre2/arch/ppc/kernel/softemu8xx.c	1999-03-10 21:30:32.000000000 -0800
+++ linux-2.2.10-pre3/arch/ppc/kernel/softemu8xx.c	2003-08-15 15:06:27.000000000 -0700
@@ -34,6 +34,7 @@
 
 /* Eventually we may need a look-up table, but this works for now.
 */
+#define LFS	48
 #define LFD	50
 #define LFDU	51
 #define STFD	54
@@ -83,6 +84,12 @@
 		else
 			regs->gpr[idxreg] = (uint)ea;
 		break;
+	case LFS:
+		sdisp = (instword & 0xffff);
+		ea = (uint *)(regs->gpr[idxreg] + sdisp);
+		if (copy_from_user(ip, ea, sizeof(float)))
+			retval = EFAULT;
+		break;
 	case STFD:
 		/* this is a 16 bit quantity that is sign extended
 		 * so use a signed short here -- Cort
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/syscalls.c linux-2.2.10-pre3/arch/ppc/kernel/syscalls.c
--- linux-2.2.10-pre2/arch/ppc/kernel/syscalls.c	1999-05-08 11:14:01.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/syscalls.c	2003-08-15 15:06:27.000000000 -0700
@@ -182,18 +182,14 @@
 	int fd[2];
 	int error;
 
-	error = verify_area(VERIFY_WRITE, fildes, 8);
-	if (error)
-		return error;
 	lock_kernel();
 	error = do_pipe(fd);
 	unlock_kernel();
-	if (error)
-		return error;
-	if (__put_user(fd[0],0+fildes)
-	    || __put_user(fd[1],1+fildes))
-		return -EFAULT;	/* should we close the fds? */
-	return 0;
+	if (!error) {
+		if (copy_to_user(fildes, fd, 2*sizeof(int)))
+			error = -EFAULT;
+	}
+	return error;
 }
 
 asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
@@ -205,15 +201,12 @@
 
 	lock_kernel();
 	if (!(flags & MAP_ANONYMOUS)) {
-		file = fget(fd);
-		if (!file)
+		if (fd >= NR_OPEN || !(file = current->files->fd[fd]))
 			goto out;
 	}
 	
 	flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
 	ret = do_mmap(file, addr, len, prot, flags, offset);
-	if (file)
-		fput(file);
 out:
 	unlock_kernel();
 	return ret;
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/time.c linux-2.2.10-pre3/arch/ppc/kernel/time.c
--- linux-2.2.10-pre2/arch/ppc/kernel/time.c	1999-04-29 12:39:01.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/time.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- * $Id: time.c,v 1.47 1999/03/18 05:11:11 cort Exp $
+ * $Id: time.c,v 1.47.2.1 1999/05/29 19:10:23 cort Exp $
  * Common time routines among all ppc machines.
  *
  * Written by Cort Dougan (cort@cs.nmt.edu) to merge
@@ -126,13 +126,17 @@
 	smp_local_timer_interrupt(regs);
 #endif		
 
-	/* Fixme - make this more generic - Corey */
 #ifdef CONFIG_APUS
 	{
 		extern void apus_heartbeat (void);
 		apus_heartbeat ();
 	}
 #endif
+#if defined(CONFIG_ALL_PPC) || defined(CONFIG_CHRP)
+	if ( _machine == _MACH_chrp )
+		chrp_event_scan();
+#endif	
+
 	hardirq_exit(cpu);
 }
 
diff -urN linux-2.2.10-pre2/arch/ppc/kernel/traps.c linux-2.2.10-pre3/arch/ppc/kernel/traps.c
--- linux-2.2.10-pre2/arch/ppc/kernel/traps.c	1999-04-29 12:39:01.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/kernel/traps.c	2003-08-15 15:06:27.000000000 -0700
@@ -79,7 +79,6 @@
 		debugger(regs);
 #endif
 		print_backtrace((unsigned long *)regs->gpr[1]);
-		instruction_dump((unsigned long *)regs->nip);
 		panic("Exception in kernel pc %lx signal %d",regs->nip,signr);
 	}
 	force_sig(signr, current);
@@ -127,7 +126,6 @@
 		debugger(regs);
 #endif
 		print_backtrace((unsigned long *)regs->gpr[1]);
-		instruction_dump((unsigned long *)regs->nip);
 		panic("machine check");
 	}
 	_exception(SIGSEGV, regs);	
@@ -216,7 +214,6 @@
 #endif
 	show_regs(regs);
 	print_backtrace((unsigned long *)regs->gpr[1]);
-	instruction_dump((unsigned long *)regs->nip);
 	panic("kernel stack overflow");
 }
 
diff -urN linux-2.2.10-pre2/arch/ppc/Makefile linux-2.2.10-pre3/arch/ppc/Makefile
--- linux-2.2.10-pre2/arch/ppc/Makefile	1999-03-19 10:50:03.000000000 -0800
+++ linux-2.2.10-pre3/arch/ppc/Makefile	2003-08-15 15:06:27.000000000 -0700
@@ -29,6 +29,10 @@
 CFLAGS := $(CFLAGS) -mcpu=860
 endif
 
+ifdef CONFIG_PPC64
+CFLAGS := $(CFLAGS) -Wa,-mppc64bridge #-Wa,-mppc64
+#CFLAGS := $(CFLAGS) -Wa,-mppc64 -mpowerpc64
+endif
 
 HEAD := arch/ppc/kernel/head.o
 
diff -urN linux-2.2.10-pre2/arch/ppc/mm/fault.c linux-2.2.10-pre3/arch/ppc/mm/fault.c
--- linux-2.2.10-pre2/arch/ppc/mm/fault.c	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/mm/fault.c	2003-08-15 15:06:27.000000000 -0700
@@ -89,7 +89,6 @@
 			printk("page fault in interrupt handler, addr=%lx\n",
 			       address);
 			show_regs(regs);
-			instruction_dump((unsigned long *)regs->nip);
 #if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
 			if (debugger_kernel_faults)
 				debugger(regs);
@@ -176,7 +175,6 @@
 	/* kernel has accessed a bad area */
 	show_regs(regs);
 	print_backtrace( (unsigned long *)regs->gpr[1] );
-	instruction_dump((unsigned long *)regs->nip);
 #if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
 	if (debugger_kernel_faults)
 		debugger(regs);
diff -urN linux-2.2.10-pre2/arch/ppc/mm/init.c linux-2.2.10-pre3/arch/ppc/mm/init.c
--- linux-2.2.10-pre2/arch/ppc/mm/init.c	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/arch/ppc/mm/init.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- *  $Id: init.c,v 1.164 1999/05/05 17:33:55 cort Exp $
+ *  $Id: init.c,v 1.164.2.2 1999/06/03 03:03:53 paulus Exp $
  *
  *  PowerPC version 
  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
@@ -371,7 +371,7 @@
 	 * same virt address (and this is contiguous).
 	 *  -- Cort
 	 */
-	if ( (v = p_mapped_by_bats(addr)) /*&& p_mapped_by_bats(addr+(size-1))*/ )
+	if ( (v = p_mapped_by_bats(p)) /*&& p_mapped_by_bats(p+size-1)*/ )
 		goto out;
 #endif /* CONFIG_8xx */
 	
@@ -402,7 +402,7 @@
 	for (i = 0; i < size; i += PAGE_SIZE)
 		map_page(&init_task, v+i, p+i, flags);
 out:	
-	return (void *) (v + (p & ~PAGE_MASK));
+	return (void *) (v + (addr & ~PAGE_MASK));
 }
 
 void iounmap(void *addr)
@@ -1510,7 +1510,7 @@
 	for (h = 256<<10; h < ramsize / 256 && h < 4<<20; h *= 2, Hash_mask++)
 		;
 	Hash_size = h;
-	Hash_mask << 10;  /* so setting _SDR1 works the same -- Cort */
+	Hash_mask <<= 10;  /* so setting _SDR1 works the same -- Cort */
 #else
 	for (h = 64<<10; h < ramsize / 256 && h < 2<<20; h *= 2)
 		;
diff -urN linux-2.2.10-pre2/arch/sparc/defconfig linux-2.2.10-pre3/arch/sparc/defconfig
--- linux-2.2.10-pre2/arch/sparc/defconfig	1999-04-22 19:24:51.000000000 -0700
+++ linux-2.2.10-pre3/arch/sparc/defconfig	2003-08-15 15:06:27.000000000 -0700
@@ -62,6 +62,7 @@
 CONFIG_SUN_MOSTEK_RTC=y
 # CONFIG_SUN_BPP is not set
 # CONFIG_SUN_VIDEOPIX is not set
+CONFIG_SUN_AURORA=m
 
 #
 # Linux/SPARC audio subsystem (EXPERIMENTAL)
diff -urN linux-2.2.10-pre2/arch/sparc/kernel/sys_sunos.c linux-2.2.10-pre3/arch/sparc/kernel/sys_sunos.c
--- linux-2.2.10-pre2/arch/sparc/kernel/sys_sunos.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/arch/sparc/kernel/sys_sunos.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: sys_sunos.c,v 1.97 1999/05/24 19:40:39 davem Exp $
+/* $Id: sys_sunos.c,v 1.94.2.1 1999/05/24 19:42:30 davem Exp $
  * sys_sunos.c: SunOS specific syscall compatibility support.
  *
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
diff -urN linux-2.2.10-pre2/arch/sparc64/defconfig linux-2.2.10-pre3/arch/sparc64/defconfig
--- linux-2.2.10-pre2/arch/sparc64/defconfig	1999-04-22 19:24:51.000000000 -0700
+++ linux-2.2.10-pre3/arch/sparc64/defconfig	2003-08-15 15:06:27.000000000 -0700
@@ -68,6 +68,7 @@
 CONFIG_OBP_FLASH=m
 # CONFIG_SUN_BPP is not set
 # CONFIG_SUN_VIDEOPIX is not set
+CONFIG_SUN_AURORA=m
 
 #
 # Linux/SPARC audio subsystem (EXPERIMENTAL)
diff -urN linux-2.2.10-pre2/arch/sparc64/kernel/sys_sparc32.c linux-2.2.10-pre3/arch/sparc64/kernel/sys_sparc32.c
--- linux-2.2.10-pre2/arch/sparc64/kernel/sys_sparc32.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/arch/sparc64/kernel/sys_sparc32.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc32.c,v 1.108 1999/05/16 10:50:32 davem Exp $
+/* $Id: sys_sparc32.c,v 1.107.2.1 1999/05/16 10:48:44 davem Exp $
  * sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
  *
  * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
diff -urN linux-2.2.10-pre2/arch/sparc64/kernel/sys_sunos32.c linux-2.2.10-pre3/arch/sparc64/kernel/sys_sunos32.c
--- linux-2.2.10-pre2/arch/sparc64/kernel/sys_sunos32.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/arch/sparc64/kernel/sys_sunos32.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: sys_sunos32.c,v 1.25 1999/05/24 19:40:44 davem Exp $
+/* $Id: sys_sunos32.c,v 1.22.2.1 1999/05/24 19:42:36 davem Exp $
  * sys_sunos32.c: SunOS binary compatability layer on sparc64.
  *
  * Copyright (C) 1995, 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
diff -urN linux-2.2.10-pre2/arch/sparc64/solaris/fs.c linux-2.2.10-pre3/arch/sparc64/solaris/fs.c
--- linux-2.2.10-pre2/arch/sparc64/solaris/fs.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/arch/sparc64/solaris/fs.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: fs.c,v 1.12 1999/01/02 16:46:06 davem Exp $
+/* $Id: fs.c,v 1.12.2.1 1999/05/29 04:03:23 davem Exp $
  * fs.c: fs related syscall emulation for Solaris
  *
  * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
diff -urN linux-2.2.10-pre2/Documentation/isdn/CREDITS linux-2.2.10-pre3/Documentation/isdn/CREDITS
--- linux-2.2.10-pre2/Documentation/isdn/CREDITS	1998-04-01 16:20:56.000000000 -0800
+++ linux-2.2.10-pre3/Documentation/isdn/CREDITS	2003-08-15 15:06:27.000000000 -0700
@@ -5,7 +5,7 @@
 Thomas Bogendörfer (tsbogend@bigbug.franken.de)
   Tester, lots of bugfixes and hints.
 
-Alan Cox (alan@cymru.net)
+Alan Cox (alan@redhat.com)
   For help getting into standard-kernel.
 
 Henner Eisen (eis@baty.hanse.de)
diff -urN linux-2.2.10-pre2/Documentation/kernel-parameters.txt linux-2.2.10-pre3/Documentation/kernel-parameters.txt
--- linux-2.2.10-pre2/Documentation/kernel-parameters.txt	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.2.10-pre3/Documentation/kernel-parameters.txt	2003-08-15 15:06:27.000000000 -0700
@@ -0,0 +1,336 @@
+June 1999		  Kernel Parameters			v2.2.9
+			  ~~~~~~~~~~~~~~~~~
+
+The following is a consolidated list of the kernel parameters as defined
+in the file init/main.c and sorted into English Dictionary order (defined
+as ignoring all punctuation and sorting digits before letters in a case
+insensitive manner), and with descriptions where known.
+
+The text in square brackets at the beginning of the description state the
+restrictions on the kernel for the said kernel parameter to be valid. The
+restrictions referred to are that the relevant option is valid if:
+
+    APIC	APIC support is enabled.
+    APM 	Automatic Power Management support is enabled.
+    AX25	Appropriate AX.25 support is enabled.
+    CD		Appropriate CD support is enabled.
+    EIDE	EIDE/ATAPI support is enabled.
+    FB		The frame buffer device is enabled.
+    HW		Appropriate hardware is enabled.
+    ISDN	Appropriate ISDN support is enabled.
+    JOY 	Appropriate joystick support is enabled.
+    LPT 	Printer support is enabled.
+    MCA 	MCA bus support is enabled.
+    MDA 	The MDA console is enabled.
+    MOUSE	Appropriate mouse support is enabled.
+    NET 	Appropriate network support is enabled.
+    NFS 	Appropriate NFS support is enabled.
+    PARIDE	The ParIDE subsystem is enabled.
+    PCI 	PCI bus support is enabled.
+    PCMCIA	The PCMCIA subsystem is enabled.
+    PNP 	Plug & Play support is enabled.
+    PS2 	Appropriate PS/2 support is enabled.
+    RAM 	RAMdisc support is enabled.
+    SCSI	Appropriate SCSI support is enabled.
+    SERIAL	Serial support is enabled.
+    SMP 	The kernel is an SMP kernel.
+    SOUND	Appropriate sound system support is enabled.
+    VGA 	The VGA console has been enabled.
+    VT		Virtual terminal support is enabled.
+    XT		IBM PC/XT support is enabled.
+
+In addition, the following text indicates that the option:
+
+    BUGS=	Relates to possible processor bugs on the said processor.
+    KNL 	Is a kernel start-up parameter.
+
+Note that ALL kernel parameters listed below are CASE SENSITIVE, and that
+a trailing = on the name of any parameter states that that parameter will
+be entered as an environment variable, whereas its absence indicates that
+it will appear as a kernel argument readable via /proc/cmdline by programs
+running once the system is up.
+
+    53c7xx=		[HW,SCSI]
+
+    adb_buttons=	[HW,MOUSE]
+
+    advansys=		[HW,SCSI]
+
+    aha152x=		[HW,SCSI]
+
+    aha1542=		[HW,SCSI]
+
+    aic7xxx=		[HW,SCSI]
+
+    AM53C974=		[HW,SCSI]
+
+    apm=		[APM] Automatic Power Management.
+
+    arcrimi=		[HW,NET]
+
+    atamouse=		[HW,MOUSE] Atari Mouse.
+
+    atascsi=		[HW,SCSI] Atari SCSI.
+
+    aztcd=		[HW,CD] Aztec CD driver.
+
+    baycom_par= 	[HW,AX25] BayCom Parallel Port AX.25 Modem.
+
+    baycom_ser_fdx=	[HW,AX25] BayCom Serial Port AX.25 Modem in Full
+			Duplex Mode.
+
+    baycom_ser_hdx=	[HW,AX25] BayCom Serial Port AX.25 Modem in Half
+			Duplex Mode.
+
+    bmouse=		[HW,MOUSE,PS2] Bus mouse.
+
+    BusLogic=		[HW,SCSI]
+
+    cdu31a=		[HW,CD]
+
+    cm206=		[HW,CD]
+
+    com20020=		[HW,NET]
+
+    com90io=		[HW,NET]
+
+    com90xx=		[HW,NET]
+
+    console=		
+
+    cyclades=		[HW,SERIAL] Cyclades multi-serial port adapter.
+
+    debug		[KNL] Enable kernel debugging.
+
+    decnet=		[HW,NET]
+
+    digi=		[HW,SERIAL]
+
+    digiepca=		[HW,SERIAL]
+
+    dmascc=		[HW,AX25,SERIAL] AX.25 Z80SCC driver with DMA
+			support available.
+
+    dmasound=		[HW,SOUND]
+
+    dtc3181e=		[HW,SCSI]
+
+    eata=		[HW,SCSI]
+
+    eda=		[HW,PS2]
+
+    edb=		[HW,PS2]
+
+    ether=		[HW,NET] Ethernet.
+
+    fd_mcs=		[HW,SCSI]
+
+    fdomain=		[HW,SCSI]
+
+    floppy=		[HW]
+
+    ftape=		[HW] Floppy Tape subsystem.
+
+    gdth=		[HW,SCSI]
+
+    gscd=		[HW,CD]
+
+    gvp11=		[HW,SCSI]
+
+    hd= 		[EIDE] IDE and EIDE hard drive subsystem.
+
+    hfmodem=		[HW,AX25]
+
+    HiSax=		[HW,ISDN]
+
+    hisax=		[HW,ISDN]
+
+    ibmmcascsi= 	[HW,MCA,SCSI] IBM MicroChannel SCSI adapter.
+
+    icn=		[HW,ISDN]
+
+    in2000=		[HW,SCSI]
+
+    init=		[KNL]
+
+    ip= 		[PNP]
+
+    isp16=		[HW,CD]
+
+    js_14=		[HW,JOY]
+
+    js_am=		[HW,JOY]
+
+    js_an=		[HW,JOY]
+
+    js_as=		[HW.JOY]
+
+    js_console= 	[HW,JOY]
+
+    js_console2=	[HW,JOY]
+
+    js_console3=	[HW,JOY]
+
+    js_db9=		[HW,JOY]
+
+    js_db9_2=		[HW,JOY]
+
+    js_db9_3=		[HW,JOY]
+
+    js_tg=		[HW,JOY]
+
+    js_tg_2=		[HW,JOY]
+
+    js_tg_3=		[HW,JOY]
+
+    kbd-reset		[VT]
+
+    load_ramdisk=	[RAM]
+
+    lp= 		[LPT] Parallel Printer.
+
+    ltpc=		[HW]
+
+    mac5380=		[HW,SCSI]
+
+    maxcpus=		[SMP] States the maximum number of processors that
+			an SMP kernel should make use of.
+
+    max_scsi_luns=	[SCSI]
+
+    mca-pentium 	[BUGS=ix86]
+
+    mcd=		[HW,CD]
+
+    mcdx=		[HW,CD]
+
+    md= 		[HW]
+
+    mdacon=		[MDA]
+
+    msmouse=		[HW,MOUSE] Microsoft Mouse.
+
+    ncr5380=		[HW,SCSI]
+
+    ncr53c400=		[HW,SCSI]
+
+    ncr53c400a= 	[HW,SCSI]
+
+    ncr53c406a= 	[HW,SCSI]
+
+    ncr53c8xx=		[HW,SCSI]
+
+    nfsaddrs=		[NFS]
+
+    nfsroot=		[NFS]
+
+    no387		[BUGS=ix86] Tells the kernel to use the 387 maths
+			emulation library even if a 387 maths coprocessor
+			is present.
+
+    noapic		[SMP,APIC] Tells the kernel not to make use of any
+			APIC that may be present on the system.
+
+    no-halt		[BUGS=ix86]
+
+    noinitrd		[RAM] Tells the kernel not to load any configured
+			initial ramdisc.
+
+    no-scroll		[VGA]
+
+    nosmp		[SMP] Tells an SMP kernel to act as a UP kernel.
+
+    optcd=		[HW,CD]
+
+    panic=		
+
+    parport=		[HW,LP]
+
+    pas16=		[HW,SCSI]
+
+    pcbit=		[HW,ISDN]
+
+    pcd.		[PARIDE]
+
+    pci=		[PCI]
+
+    pd. 		[PARIDE]
+
+    pf. 		[PARIDE]
+
+    pg. 		[PARIDE]
+
+    pirq=		[SMP,APIC]
+
+    plip=		[LP,NET] Parallel port network link.
+
+    profile=
+
+    prompt_ramdisk=	[RAM] Whether to prompt for ramdisk before loading
+			its contents into memory.
+
+    pt. 		[PARIDE]
+
+    ramdisk=		[RAM]
+
+    ramdisk_size=	[RAM]
+
+    ramdisk_start=	[RAM]
+
+    reboot=		[BUGS=ix86]
+
+    reserve=
+
+    riscom8=		[HW,SERIAL]
+
+    ro			[KNL] Mount root device read-only on boot.
+
+    root=		
+
+    rw			[KNL] Mount root device read-write on boot.
+
+    sbpcd=		[HW,CD] Soundblaster CD adapter.
+
+    scsi_logging=	[SCSI]
+
+    sjcd=		[HW,CD]
+
+    sonycd535=		[HW,CD]
+
+    sound=		[SOUND]
+
+    soundmodem= 	[HW,AX25,SOUND] Sound cards used as AX.25 modems.
+
+    specialix=		[HW,SERIAL] Specialix multi-serial port adapter.
+
+    st= 		[HW]
+
+    st0x=		[HW,SCSI]
+
+    stram_swap= 	[HW]
+
+    sym53c416=		[HW,SCSI]
+
+    sym53c8xx=		[HW,SCSI]
+
+    t128=		[HW,SCSI]
+
+    tmc8xx=		[HW,SCSI]
+
+    tmscsim=		[HW,SCSI]
+
+    tp720=		[HW,PS2]
+
+    u14-34f=		[HW,SCSI]
+
+    video=		[FB]
+
+    wd33c93=		[HW,SCSI]
+
+    wd7000=		[HW,SCSI]
+
+    wdt=		[HW]
+
+    xd= 		[HW,XT]
+
+    xd_geo=		[HW,XT]
diff -urN linux-2.2.10-pre2/Documentation/video4linux/bttv/CONTRIBUTORS linux-2.2.10-pre3/Documentation/video4linux/bttv/CONTRIBUTORS
--- linux-2.2.10-pre2/Documentation/video4linux/bttv/CONTRIBUTORS	1998-08-23 13:32:25.000000000 -0700
+++ linux-2.2.10-pre3/Documentation/video4linux/bttv/CONTRIBUTORS	2003-08-15 15:06:27.000000000 -0700
@@ -3,7 +3,7 @@
 Michael Chu <mmchu@pobox.com>
   AverMedia fix and more flexible card recognition
 
-Alan Cox <alan@cymru.net>
+Alan Cox <alan@redhat.com>
   Video4Linux interface and 2.1.x kernel adaptation
 
 Chris Kleitsch
diff -urN linux-2.2.10-pre2/drivers/char/acquirewdt.c linux-2.2.10-pre3/drivers/char/acquirewdt.c
--- linux-2.2.10-pre2/drivers/char/acquirewdt.c	1998-08-24 13:02:43.000000000 -0700
+++ linux-2.2.10-pre3/drivers/char/acquirewdt.c	2003-08-15 15:06:27.000000000 -0700
@@ -3,8 +3,8 @@
  *
  *      Based on wdt.c. Original copyright messages:
  *
- *	(c) Copyright 1996 Alan Cox <alan@cymru.net>, All Rights Reserved.
- *				http://www.cymru.net
+ *	(c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *				http://www.redhat.com
  *
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License
@@ -15,7 +15,7 @@
  *	warranty for any of this software. This material is provided 
  *	"AS-IS" and at no charge.	
  *
- *	(c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
+ *	(c) Copyright 1995    Alan Cox <alan@redhat.com>
  *
  */
 
diff -urN linux-2.2.10-pre2/drivers/char/pc110pad.c linux-2.2.10-pre3/drivers/char/pc110pad.c
--- linux-2.2.10-pre2/drivers/char/pc110pad.c	1998-09-05 17:01:45.000000000 -0700
+++ linux-2.2.10-pre3/drivers/char/pc110pad.c	2003-08-15 15:06:27.000000000 -0700
@@ -9,11 +9,11 @@
  *	This is read internally and used to synthesize a stream of
  *	triples in the form expected from a PS/2 device.
  *
- *	0.0 1997-05-16 Alan Cox <alan@cymru.net> - Pad reader
+ *	0.0 1997-05-16 Alan Cox <alan@redhat.com> - Pad reader
  *	0.1 1997-05-19 Robin O'Leary <robin@acm.org> - PS/2 emulation
  *	0.2 1997-06-03 Robin O'Leary <robin@acm.org> - tap gesture
- *	0.3 1997-06-27 Alan Cox <alan@cymru.net> - 2.1 commit
- *	0.4 1997-11-09 Alan Cox <alan@cymru.net> - Single Unix VFS API changes
+ *	0.3 1997-06-27 Alan Cox <alan@redhat.com> - 2.1 commit
+ *	0.4 1997-11-09 Alan Cox <alan@redhat.com> - Single Unix VFS API changes
  */
 
 #include <linux/module.h>
diff -urN linux-2.2.10-pre2/drivers/char/pms.c linux-2.2.10-pre3/drivers/char/pms.c
--- linux-2.2.10-pre2/drivers/char/pms.c	1998-12-31 17:07:10.000000000 -0800
+++ linux-2.2.10-pre3/drivers/char/pms.c	2003-08-15 15:06:27.000000000 -0700
@@ -10,7 +10,7 @@
  *	14478 Potsdam, Germany
  *
  *	Most of this code is directly derived from his userspace driver.
- *	His driver works so send any reports to alan@cymru.net unless the
+ *	His driver works so send any reports to alan@redhat.com unless the
  *	userspace driver also doesnt work for you...
  */
 
diff -urN linux-2.2.10-pre2/drivers/char/softdog.c linux-2.2.10-pre3/drivers/char/softdog.c
--- linux-2.2.10-pre2/drivers/char/softdog.c	1999-04-24 17:49:37.000000000 -0700
+++ linux-2.2.10-pre3/drivers/char/softdog.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,8 +1,8 @@
 /*
  *	SoftDog	0.05:	A Software Watchdog Device
  *
- *	(c) Copyright 1996 Alan Cox <alan@cymru.net>, All Rights Reserved.
- *				http://www.cymru.net
+ *	(c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *				http://www.redhat.com
  *
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License
diff -urN linux-2.2.10-pre2/drivers/char/videodev.c linux-2.2.10-pre3/drivers/char/videodev.c
--- linux-2.2.10-pre2/drivers/char/videodev.c	1999-04-15 05:42:40.000000000 -0700
+++ linux-2.2.10-pre3/drivers/char/videodev.c	2003-08-15 15:06:27.000000000 -0700
@@ -9,7 +9,7 @@
  *		as published by the Free Software Foundation; either version
  *		2 of the License, or (at your option) any later version.
  *
- * Author:	Alan Cox, <alan@cymru.net>
+ * Author:	Alan Cox, <alan@redhat.com>
  *
  * Fixes:
  */
diff -urN linux-2.2.10-pre2/drivers/char/wdt.c linux-2.2.10-pre3/drivers/char/wdt.c
--- linux-2.2.10-pre2/drivers/char/wdt.c	1998-10-17 15:52:18.000000000 -0700
+++ linux-2.2.10-pre3/drivers/char/wdt.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,8 +1,8 @@
 /*
  *	Industrial Computer Source WDT500/501 driver for Linux 2.1.x
  *
- *	(c) Copyright 1996-1997 Alan Cox <alan@cymru.net>, All Rights Reserved.
- *				http://www.cymru.net
+ *	(c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *				http://www.redhat.com
  *
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License
@@ -15,7 +15,7 @@
  *
  *	(c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
  *
- *	Release 0.07.
+ *	Release 0.08.
  *
  *	Fixes
  *		Dave Gregorich	:	Modularisation and minor bugs
@@ -24,6 +24,8 @@
  *					Matt Crocker).
  *		Alan Cox	:	Added wdt= boot option
  *		Alan Cox	:	Cleaned up copy/user stuff
+ *		Tim Hockin	:	Added insmod parameters, comment cleanup
+ *					Parameterized timeout
  */
 
 #include <linux/config.h>
diff -urN linux-2.2.10-pre2/drivers/net/irda/irtty.c linux-2.2.10-pre3/drivers/net/irda/irtty.c
--- linux-2.2.10-pre2/drivers/net/irda/irtty.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/drivers/net/irda/irtty.c	2003-08-15 15:06:27.000000000 -0700
@@ -24,7 +24,6 @@
  *     
  ********************************************************************/    
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <linux/kernel.h>
diff -urN linux-2.2.10-pre2/drivers/net/shaper.c linux-2.2.10-pre3/drivers/net/shaper.c
--- linux-2.2.10-pre2/drivers/net/shaper.c	1999-03-10 16:51:35.000000000 -0800
+++ linux-2.2.10-pre3/drivers/net/shaper.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,8 +1,8 @@
 /*
  *			Simple traffic shaper for Linux NET3.
  *
- *	(c) Copyright 1996 Alan Cox <alan@cymru.net>, All Rights Reserved.
- *				http://www.cymru.net
+ *	(c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *				http://www.redhat.com
  *
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License
diff -urN linux-2.2.10-pre2/drivers/pci/oldproc.c linux-2.2.10-pre3/drivers/pci/oldproc.c
--- linux-2.2.10-pre2/drivers/pci/oldproc.c	1999-04-21 09:28:49.000000000 -0700
+++ linux-2.2.10-pre3/drivers/pci/oldproc.c	2003-08-15 15:06:27.000000000 -0700
@@ -102,6 +102,7 @@
 	DEVICE( DEC,		DEC_21150,	"DC21150"),
 	DEVICE( DEC,		DEC_21152,	"DC21152"),
 	DEVICE( DEC,		DEC_21153,	"DC21153"),
+	DEVICE( DEC,		DEC_21154,	"DC21154"),
 	DEVICE( CIRRUS,		CIRRUS_7548,	"GD 7548"),
 	DEVICE( CIRRUS,		CIRRUS_5430,	"GD 5430"),
 	DEVICE( CIRRUS,		CIRRUS_5434_4,	"GD 5434"),
@@ -202,6 +203,8 @@
 	DEVICE( MOTOROLA,	MOTOROLA_MPC105,"MPC105 Eagle"),
 	DEVICE( MOTOROLA,	MOTOROLA_MPC106,"MPC106 Grackle"),
 	DEVICE( MOTOROLA,	MOTOROLA_RAVEN,	"Raven"),
+	DEVICE( MOTOROLA,	MOTOROLA_FALCON,"Falcon"),
+	DEVICE( MOTOROLA,	MOTOROLA_CPX8216,"CPX8216"),
 	DEVICE( PROMISE,        PROMISE_20246,	"IDE UltraDMA/33"),
 	DEVICE( PROMISE,	PROMISE_5300,	"DC5030"),
 	DEVICE( N9,		N9_I128,	"Imagine 128"),
@@ -462,6 +465,7 @@
 	DEVICE( PICTUREL,	PICTUREL_PCIVST,"PCIVST"),
 	DEVICE( NVIDIA_SGS,	NVIDIA_SGS_RIVA128,	"Riva 128"),
 	DEVICE( CBOARDS,	CBOARDS_DAS1602_16,"DAS1602/16"),
+	DEVICE( MOTOROLA_OOPS,	MOTOROLA_FALCON,"Falcon"),
 	DEVICE( SYMPHONY,	SYMPHONY_101,	"82C101"),
 	DEVICE( TEKRAM,		TEKRAM_DC290,	"DC-290"),
 	DEVICE( 3DLABS,		3DLABS_300SX,	"GLINT 300SX"),
@@ -671,6 +675,8 @@
 	      case PCI_CLASS_SERIAL_USB:		return "USB Controller";
 	      case PCI_CLASS_SERIAL_FIBER:		return "Fiber Channel";
 
+	      case PCI_CLASS_HOT_SWAP_CONTROLLER:	return "Hot Swap Controller";
+
 	      default:					return "Unknown class";
 	}
 }
@@ -710,6 +716,7 @@
 	      case PCI_VENDOR_ID_OAK: 		return "OAK";
 	      case PCI_VENDOR_ID_WINBOND2:	return "Winbond";
 	      case PCI_VENDOR_ID_MOTOROLA:	return "Motorola";
+	      case PCI_VENDOR_ID_MOTOROLA_OOPS:	return "Motorola";
 	      case PCI_VENDOR_ID_PROMISE:	return "Promise Technology";
 	      case PCI_VENDOR_ID_N9:		return "Number Nine";
 	      case PCI_VENDOR_ID_UMC:		return "UMC";
diff -urN linux-2.2.10-pre2/drivers/sbus/char/aurora.c linux-2.2.10-pre3/drivers/sbus/char/aurora.c
--- linux-2.2.10-pre2/drivers/sbus/char/aurora.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.2.10-pre3/drivers/sbus/char/aurora.c	2003-08-15 15:06:27.000000000 -0700
@@ -0,0 +1,2371 @@
+/*
+ *	linux/drivers/sbus/char/aurora.c -- Aurora multiport driver
+ *
+ *	Copyright (c) 1999 by Oliver Aldulea (oli@bv.ro)
+ *
+ *	This code is based on the RISCom/8 multiport serial driver written
+ *	by Dmitry Gorodchanin (pgmdsg@ibi.com), based on the Linux serial
+ *	driver, written by Linus Torvalds, Theodore T'so and others.
+ *	The Aurora multiport programming info was obtained mainly from the
+ *	Cirrus Logic CD180 documentation (available on the web), and by
+ *	doing heavy tests on the board. Many thanks to Eddie C. Dost for the
+ *	help on the sbus interface.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU General Public License as published by
+ *	the Free Software Foundation; either version 2 of the License, or
+ *	(at your option) any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU General Public License for more details.
+ *
+ *	You should have received a copy of the GNU General Public License
+ *	along with this program; if not, write to the Free Software
+ *	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *	Revision 1.0
+ *
+ *	This is the first public release.
+ *
+ *	Most of the information you need is in the aurora.h file. Please
+ *	read that file before reading this one.
+ *
+ *	Several parts of the code do not have comments yet.
+ */
+
+#include <linux/module.h>
+
+#include <linux/errno.h>
+#include <linux/sched.h>
+#ifdef AURORA_INT_DEBUG
+#include <linux/timer.h>
+#endif
+#include <linux/interrupt.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
+#include <linux/config.h>
+#include <linux/major.h>
+#include <linux/string.h>
+#include <linux/fcntl.h>
+#include <linux/mm.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/tqueue.h>
+#include <linux/delay.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/oplib.h>
+#include <asm/system.h>
+#include <asm/segment.h>
+#include <asm/bitops.h>
+#include <asm/kdebug.h>
+#include <asm/sbus.h>
+#include <asm/uaccess.h>
+
+#include "aurora.h"
+#include "cd180.h"
+
+unsigned char irqs[4] = {
+	0, 0, 0, 0
+	};
+
+#ifdef AURORA_INT_DEBUG
+int irqhit=0;
+#endif
+
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
+#define AURORA_TYPE_NORMAL	1
+
+static struct tty_driver aurora_driver;
+static struct Aurora_board aurora_board[AURORA_NBOARD] = {
+	{0,},
+};
+
+static struct Aurora_port aurora_port[AURORA_TNPORTS] =  {
+	{ 0, },
+};
+
+/* no longer used. static struct Aurora_board * IRQ_to_board[16] = { NULL, } ;*/
+static unsigned char * tmp_buf = NULL;
+static struct semaphore tmp_buf_sem = MUTEX;
+static int    aurora_refcount = 0;
+static struct tty_struct * aurora_table[AURORA_TNPORTS] = { NULL, };
+static struct termios * aurora_termios[AURORA_TNPORTS] = { NULL, };
+static struct termios * aurora_termios_locked[AURORA_TNPORTS] = { NULL, };
+
+DECLARE_TASK_QUEUE(tq_aurora);
+
+/* Yes, the board can support 115.2 bit rates, but only on a few ports. The
+ * total badwidth of one chip (ports 0-7 or 8-15) is equal to OSC_FREQ div
+ * 16. In case of my board, each chip can take 6 channels of 115.2 kbaud.
+ * This information is not well-tested.
+ */
+static unsigned long baud_table[] =  {
+        0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
+        9600, 19200, 38400, 57600, 115200, 0,
+        };
+
+static inline int aurora_paranoia_check(struct Aurora_port const * port,
+				    kdev_t device, const char *routine)
+{
+#ifdef AURORA_PARANOIA_CHECK
+	static const char *badmagic =
+		KERN_DEBUG "aurora: Warning: bad aurora port magic number for device %s in %s\n";
+	static const char *badinfo =
+		KERN_DEBUG "aurora: Warning: null aurora port for device %s in %s\n";
+
+	if (!port) {
+		printk(badinfo, kdevname(device), routine);
+		return 1;
+	}
+	if (port->magic != AURORA_MAGIC) {
+		printk(badmagic, kdevname(device), routine);
+		return 1;
+	}
+#endif
+	return 0;
+}
+
+/*
+ * 
+ *  Service functions for aurora driver.
+ * 
+ */
+
+/* Get board number from pointer */
+extern inline int board_No (struct Aurora_board const * bp)
+{
+	return bp - aurora_board;
+}
+
+/* Get port number from pointer */
+extern inline int port_No (struct Aurora_port const * port)
+{
+	return AURORA_PORT(port - aurora_port); 
+}
+
+/* Get pointer to board from pointer to port */
+extern inline struct Aurora_board * port_Board(struct Aurora_port const * port)
+{
+	return &aurora_board[AURORA_BOARD(port - aurora_port)];
+}
+
+/* Wait for Channel Command Register ready */
+extern inline void aurora_wait_CCR(struct aurora_reg128 * r)
+{
+	unsigned long delay;
+
+#ifdef AURORA_DEBUG
+printk("aurora_wait_CCR\n");
+#endif
+	/* FIXME: need something more descriptive than 100000 :) */
+	for (delay = 100000; delay; delay--) 
+		if (!r->r[CD180_CCR])
+			return;
+	printk(KERN_DEBUG "aurora: Timeout waiting for CCR.\n");
+}
+
+/*
+ *  aurora probe functions.
+ */
+
+/* Must be called with enabled interrupts */
+extern inline void aurora_long_delay(unsigned long delay)
+{
+	unsigned long i;
+#ifdef AURORA_DEBUG
+printk("aurora_long_delay: start\n");
+#endif
+	for (i = jiffies + delay; i > jiffies; ) ;
+#ifdef AURORA_DEBUG
+printk("aurora_long_delay: end\n");
+#endif
+}
+
+/* Reset and setup CD180 chip */
+static int aurora_init_CD180(struct Aurora_board * bp, int chip)
+{
+	unsigned long flags;
+	int id;
+	
+#ifdef AURORA_DEBUG
+printk("aurora_init_CD180: start %d:%d\n",board_No(bp),chip);
+#endif
+	save_flags(flags); cli();
+	bp->r[chip]->r[CD180_CAR]=0;
+	bp->r[chip]->r[CD180_GSVR]=0;
+	aurora_wait_CCR(bp->r[chip]);			/* Wait for CCR ready        */
+	bp->r[chip]->r[CD180_CCR]=CCR_HARDRESET;      /* Reset CD180 chip          */
+	udelay(1);
+	sti();
+	id=1000;
+	while((--id)&&(bp->r[chip]->r[CD180_GSVR]!=0xff))udelay(100);
+	if(!id) {
+		printk(KERN_ERR "aurora%d: Chip %d failed init.\n",board_No(bp),chip);
+		restore_flags(flags);
+		return(-1);
+		}
+	cli();
+	bp->r[chip]->r[CD180_GSVR]=(board_No(bp)<<5)|((chip+1)<<3); /* Set ID for this chip      */
+	bp->r[chip]->r[CD180_MSMR]=0x80|bp->ACK_MINT;      /* Prio for modem intr       */
+	bp->r[chip]->r[CD180_TSMR]=0x80|bp->ACK_TINT;      /* Prio for transmitter intr */
+	bp->r[chip]->r[CD180_RSMR]=0x80|bp->ACK_RINT;      /* Prio for receiver intr    */
+	/* Setting up prescaler. We need 4 tick per 1 ms */
+	bp->r[chip]->r[CD180_PPRH]=(bp->oscfreq/(1000000/AURORA_TPS)) >> 8;
+	bp->r[chip]->r[CD180_PPRL]=(bp->oscfreq/(1000000/AURORA_TPS)) & 0xff;
+
+	bp->r[chip]->r[CD180_SRCR]=SRCR_AUTOPRI|SRCR_GLOBPRI;
+
+	id=bp->r[chip]->r[CD180_GFRCR];
+	printk(KERN_INFO "aurora%d: Chip %d id %02x: ",board_No(bp),chip,id);
+	if(bp->r[chip]->r[CD180_SRCR]&128)
+		switch(id){
+			case 0x82:printk("CL-CD1864 rev A\n");break;
+			case 0x83:printk("CL-CD1865 rev A\n");break;
+			case 0x84:printk("CL-CD1865 rev B\n");break;
+			case 0x85:printk("CL-CD1865 rev C\n");break;
+			default:printk("Unknown.\n");
+		}else
+		switch(id){
+			case 0x81:printk("CL-CD180 rev B\n");break;
+			case 0x82:printk("CL-CD180 rev C\n");break;
+			default:printk("Unknown.\n");
+		};
+	restore_flags(flags);
+#ifdef AURORA_DEBUG
+printk("aurora_init_CD180: end\n");
+#endif
+	return 0;
+}
+
+static int valid_irq(unsigned char irq)
+{
+int i;
+for(i=0;i<TYPE_1_IRQS;i++)
+	if (type_1_irq[i]==irq) return 1;
+return 0;
+}
+
+static void aurora_interrupt(int irq, void * dev_id, struct pt_regs * regs);
+
+/* Main probing routine, also sets irq. */
+static int aurora_probe(void) {
+	struct linux_sbus *sbus;
+	struct linux_sbus_device *sdev;
+	int grrr;
+	char buf[30];
+	int bn=0;
+	struct Aurora_board *bp;
+
+	for_each_sbus(sbus) {
+		for_each_sbusdev(sdev, sbus) {
+/*			printk("Try: %x %s\n",sdev,sdev->prom_name);*/
+			if (!strcmp(sdev->prom_name, "sio16")) {
+				#ifdef AURORA_DEBUG
+				printk(KERN_INFO "aurora: sio16 at %p\n",sdev);
+				#endif
+				prom_apply_sbus_ranges(sdev->my_bus, sdev->reg_addrs, sdev->num_registers, sdev);
+				if((sdev->reg_addrs[0].reg_size!=1)&&(sdev->reg_addrs[1].reg_size!=128)&&
+				   (sdev->reg_addrs[2].reg_size!=128)&&(sdev->reg_addrs[3].reg_size!=4)){
+				   	printk(KERN_ERR "aurora%d: registers' sizes do not match.\n",bn);
+				   	break;
+				   	}
+				bp=&aurora_board[bn];
+				bp->r0 = (struct aurora_reg1 *) sparc_alloc_io(sdev->reg_addrs[0].phys_addr, 0,
+					sdev->reg_addrs[0].reg_size, "sio16",sdev->reg_addrs[0].which_io, 0x0);
+				if (!bp->r0) {
+					printk(KERN_ERR "aurora%d: can't map reg_addrs[0]\n",bn);
+					break;
+				}
+				#ifdef AURORA_DEBUG
+				printk("Map reg 0: %x\n",bp->r0);
+				#endif
+				bp->r[0] = (struct aurora_reg128 *) sparc_alloc_io(sdev->reg_addrs[1].phys_addr, 0,
+					sdev->reg_addrs[1].reg_size, "sio16", sdev->reg_addrs[1].which_io, 0x0);
+				if (!bp->r[0]) {
+					printk(KERN_ERR "aurora%d: can't map reg_addrs[1]\n",bn);
+					break;
+				}
+				#ifdef AURORA_DEBUG
+				printk("Map reg 1: %x\n",bp->r[0]);
+				#endif
+				bp->r[1] = (struct aurora_reg128 *) sparc_alloc_io(sdev->reg_addrs[2].phys_addr, 0,
+					sdev->reg_addrs[2].reg_size, "sio16", sdev->reg_addrs[2].which_io, 0x0);
+				if (!bp->r[1]) {
+					printk(KERN_ERR "aurora%d: can't map reg_addrs[2]\n",bn);
+					break;
+				}
+				#ifdef AURORA_DEBUG
+				printk("Map reg 2: %x\n",bp->r[1]);
+				#endif
+				bp->r3 = (struct aurora_reg4 *) sparc_alloc_io(sdev->reg_addrs[3].phys_addr, 0,
+					sdev->reg_addrs[3].reg_size, "sio16", sdev->reg_addrs[3].which_io, 0x0);
+				if (!bp->r3) {
+					printk(KERN_ERR "aurora%d: can't map reg_addrs[3]\n",bn);
+					break;
+				}
+				#ifdef AURORA_DEBUG
+				printk("Map reg 3: %x\n",bp->r3);
+				#endif
+				/* Variables setup */
+				bp->flags = 0;
+				#ifdef AURORA_DEBUG
+				grrr=prom_getint(sdev->prom_node,"intr");
+				printk("intr pri %d\n",grrr);
+				#endif
+				if ((bp->irq=irqs[bn]) && valid_irq(bp->irq) &&
+				    !request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) {
+					free_irq(bp->irq|0x30, bp);
+				} else
+				if ((bp->irq=prom_getint(sdev->prom_node, "bintr")) && valid_irq(bp->irq) &&
+				    !request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) {
+					free_irq(bp->irq|0x30, bp);
+				} else
+				if ((bp->irq=prom_getint(sdev->prom_node, "intr")) && valid_irq(bp->irq) &&
+				    !request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) {
+					free_irq(bp->irq|0x30, bp);
+				} else
+				for(grrr=0;grrr<TYPE_1_IRQS;grrr++) {
+					if ((bp->irq=type_1_irq[grrr])&&!request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp)) {
+						free_irq(bp->irq|0x30, bp);
+						break;
+					} else {
+					printk(KERN_ERR "aurora%d: Could not get an irq for this board !!!\n",bn);
+					bp->flags=0xff;
+					}
+				}
+				if(bp->flags==0xff)break;
+				printk(KERN_INFO "aurora%d: irq %d\n",bn,bp->irq&0x0f);
+				buf[0]=0;
+				grrr=prom_getproperty(sdev->prom_node,"dtr_rts",buf,sizeof(buf));
+				if(!strcmp(buf,"swapped")){
+					printk(KERN_INFO "aurora%d: Swapped DTR and RTS\n",bn);
+					bp->DTR=MSVR_RTS;
+					bp->RTS=MSVR_DTR;
+					bp->MSVDTR=CD180_MSVRTS;
+					bp->MSVRTS=CD180_MSVDTR;
+					bp->flags|=AURORA_BOARD_DTR_FLOW_OK;
+					}else{
+					#ifdef AURORA_FORCE_DTR_FLOW
+					printk(KERN_INFO "aurora%d: Forcing swapped DTR-RTS\n",bn);
+					bp->DTR=MSVR_RTS;
+					bp->RTS=MSVR_DTR;
+					bp->MSVDTR=CD180_MSVRTS;
+					bp->MSVRTS=CD180_MSVDTR;
+					bp->flags|=AURORA_BOARD_DTR_FLOW_OK;
+					#else
+					printk(KERN_INFO "aurora%d: Normal DTR and RTS\n",bn);
+					bp->DTR=MSVR_DTR;
+					bp->RTS=MSVR_RTS;
+					bp->MSVDTR=CD180_MSVDTR;
+					bp->MSVRTS=CD180_MSVRTS;
+					#endif
+				}
+				bp->oscfreq=prom_getint(sdev->prom_node,"clk")*100;
+				printk(KERN_INFO "aurora%d: Oscillator: %d Hz\n",bn,bp->oscfreq);
+				grrr=prom_getproperty(sdev->prom_node,"chip",buf,sizeof(buf));
+				printk(KERN_INFO "aurora%d: Chips: %s\n",bn,buf);
+				grrr=prom_getproperty(sdev->prom_node,"manu",buf,sizeof(buf));
+				printk(KERN_INFO "aurora%d: Manufacturer: %s\n",bn,buf);
+				grrr=prom_getproperty(sdev->prom_node,"model",buf,sizeof(buf));
+				printk(KERN_INFO "aurora%d: Model: %s\n",bn,buf);
+				grrr=prom_getproperty(sdev->prom_node,"rev",buf,sizeof(buf));
+				printk(KERN_INFO "aurora%d: Revision: %s\n",bn,buf);
+				grrr=prom_getproperty(sdev->prom_node,"mode",buf,sizeof(buf));
+				printk(KERN_INFO "aurora%d: Mode: %s\n",bn,buf);
+				#ifdef MODULE
+				bp->count=0;
+				#endif
+				bp->flags = AURORA_BOARD_PRESENT;
+				/* hardware ack */
+				bp->ACK_MINT=1;
+				bp->ACK_TINT=2;
+				bp->ACK_RINT=3;
+				bn++;
+			}
+		}
+	}
+	return bn;
+}
+
+static void aurora_release_io_range(struct Aurora_board *bp)
+{
+sparc_free_io(bp->r0,1);
+sparc_free_io(bp->r[0],128);
+sparc_free_io(bp->r[1],128);
+sparc_free_io(bp->r3,4);
+}
+
+extern inline void aurora_mark_event(struct Aurora_port * port, int event)
+{
+#ifdef AURORA_DEBUG
+printk("aurora_mark_event: start\n");
+#endif
+	set_bit(event, &port->event);
+	queue_task(&port->tqueue, &tq_aurora);
+	mark_bh(AURORA_BH);
+#ifdef AURORA_DEBUG
+printk("aurora_mark_event: end\n");
+#endif
+}
+
+extern inline struct Aurora_port * aurora_get_port(struct Aurora_board const * bp,
+					int chip, unsigned char const * what)
+{
+	unsigned char channel;
+	struct Aurora_port * port;
+
+	channel = (chip<<3)|((bp->r[chip]->r[CD180_GSCR]&GSCR_CHAN)>>GSCR_CHAN_OFF);
+	port = &aurora_port[board_No(bp) * AURORA_NPORT * AURORA_NCD180 + channel];
+	if (port->flags & ASYNC_INITIALIZED)  {
+		return port;
+	}
+	printk(KERN_DEBUG "aurora%d: %s interrupt from invalid port %d\n",
+	       board_No(bp), what, channel);
+	return NULL;
+}
+
+extern inline void aurora_receive_exc(struct Aurora_board const * bp, int chip)
+{
+	struct Aurora_port *port;
+	struct tty_struct *tty;
+	unsigned char status;
+	unsigned char ch;
+	
+	if (!(port = aurora_get_port(bp, chip, "Receive_x")))
+		return;
+
+	tty = port->tty;
+	if (tty->flip.count >= TTY_FLIPBUF_SIZE)  {
+	#ifdef AURORA_INTNORM
+		printk("aurora%d: port %d: Working around flip buffer overflow.\n",
+		       board_No(bp), port_No(port));
+	#endif
+		return;
+	}
+	
+#ifdef AURORA_REPORT_OVERRUN	
+	status = bp->r[chip]->r[CD180_RCSR];
+	if (status & RCSR_OE)  {
+		port->overrun++;
+#if 1
+		printk("aurora%d: port %d: Overrun. Total %ld overruns.\n",
+		       board_No(bp), port_No(port), port->overrun);
+#endif		
+	}
+	status &= port->mark_mask;
+#else	
+	status = bp->r[chip]->r[CD180_RCSR] & port->mark_mask;
+#endif	
+	ch = bp->r[chip]->r[CD180_RDR];
+	if (!status)  {
+		return;
+	}
+	if (status & RCSR_TOUT)  {
+/*		printk("aurora%d: port %d: Receiver timeout. Hardware problems ?\n",
+		       board_No(bp), port_No(port));*/
+		return;
+		
+	} else if (status & RCSR_BREAK)  {
+		printk(KERN_DEBUG "aurora%d: port %d: Handling break...\n",
+		       board_No(bp), port_No(port));
+		*tty->flip.flag_buf_ptr++ = TTY_BREAK;
+		if (port->flags & ASYNC_SAK)
+			do_SAK(tty);
+		
+	} else if (status & RCSR_PE) 
+		*tty->flip.flag_buf_ptr++ = TTY_PARITY;
+	
+	else if (status & RCSR_FE) 
+		*tty->flip.flag_buf_ptr++ = TTY_FRAME;
+	
+        else if (status & RCSR_OE)
+		*tty->flip.flag_buf_ptr++ = TTY_OVERRUN;
+	
+	else
+		*tty->flip.flag_buf_ptr++ = 0;
+	
+	*tty->flip.char_buf_ptr++ = ch;
+	tty->flip.count++;
+	queue_task(&tty->flip.tqueue, &tq_timer);
+}
+
+extern inline void aurora_receive(struct Aurora_board const * bp, int chip)
+{
+	struct Aurora_port *port;
+	struct tty_struct *tty;
+	unsigned char count,cnt;
+
+	if (!(port = aurora_get_port(bp, chip, "Receive")))
+		return;
+	
+	tty = port->tty;
+	
+	count = bp->r[chip]->r[CD180_RDCR];
+
+#ifdef AURORA_REPORT_FIFO
+	port->hits[count > 8 ? 9 : count]++;
+#endif
+
+	while (count--)  {
+		if (tty->flip.count >= TTY_FLIPBUF_SIZE)  {
+		#ifdef AURORA_INTNORM
+			printk("aurora%d: port %d: Working around flip buffer overflow.\n",
+			       board_No(bp), port_No(port));
+		#endif
+			break;
+		}
+		cnt=bp->r[chip]->r[CD180_RDR];
+		*tty->flip.char_buf_ptr++ = cnt;
+		*tty->flip.flag_buf_ptr++ = 0;
+		tty->flip.count++;
+	}
+	queue_task(&tty->flip.tqueue, &tq_timer);
+}
+
+extern inline void aurora_transmit(struct Aurora_board const * bp, int chip)
+{
+	struct Aurora_port *port;
+	struct tty_struct *tty;
+	unsigned char count;
+	
+	
+	if (!(port = aurora_get_port(bp, chip, "Transmit")))
+		return;
+		
+	tty = port->tty;
+	
+	if (port->SRER & SRER_TXEMPTY)  {
+		/* FIFO drained */
+		bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+		udelay(1);
+		port->SRER &= ~SRER_TXEMPTY;
+		bp->r[chip]->r[CD180_SRER]=port->SRER;
+		return;
+	}
+	
+	if ((port->xmit_cnt <= 0 && !port->break_length)
+	    || tty->stopped || tty->hw_stopped)  {
+		bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+		udelay(1);
+		port->SRER &= ~SRER_TXRDY;
+		bp->r[chip]->r[CD180_SRER]=port->SRER;
+		return;
+	}
+	
+	if (port->break_length)  {
+		if (port->break_length > 0)  {
+			if (port->COR2 & COR2_ETC)  {
+				bp->r[chip]->r[CD180_TDR]=CD180_C_ESC;
+				bp->r[chip]->r[CD180_TDR]=CD180_C_SBRK;
+				port->COR2 &= ~COR2_ETC;
+			}
+			count = MIN(port->break_length, 0xff);
+			bp->r[chip]->r[CD180_TDR]=CD180_C_ESC;
+			bp->r[chip]->r[CD180_TDR]=CD180_C_DELAY;
+			bp->r[chip]->r[CD180_TDR]=count;
+			if (!(port->break_length -= count))
+				port->break_length--;
+		} else  {
+			bp->r[chip]->r[CD180_TDR]=CD180_C_ESC;
+			bp->r[chip]->r[CD180_TDR]=CD180_C_EBRK;
+			bp->r[chip]->r[CD180_COR2]=port->COR2;
+			aurora_wait_CCR(bp->r[chip]);
+			bp->r[chip]->r[CD180_CCR]=CCR_CORCHG2;
+			port->break_length = 0;
+		}
+		return;
+	}
+	
+	count = CD180_NFIFO;
+	do {
+		bp->r[chip]->r[CD180_TDR]=port->xmit_buf[port->xmit_tail++];
+		port->xmit_tail = port->xmit_tail & (SERIAL_XMIT_SIZE-1);
+		if (--port->xmit_cnt <= 0)
+			break;
+	} while (--count > 0);
+	
+	if (port->xmit_cnt <= 0)  {
+		bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+		udelay(1);
+		port->SRER &= ~SRER_TXRDY;
+		bp->r[chip]->r[CD180_SRER]=port->SRER;
+	}
+	if (port->xmit_cnt <= port->wakeup_chars)
+		aurora_mark_event(port, RS_EVENT_WRITE_WAKEUP);
+}
+
+extern inline void aurora_check_modem(struct Aurora_board const * bp, int chip)
+{
+	struct Aurora_port *port;
+	struct tty_struct *tty;
+	unsigned char mcr;
+	
+	if (!(port = aurora_get_port(bp, chip, "Modem")))
+		return;
+		
+	tty = port->tty;
+	
+	mcr = bp->r[chip]->r[CD180_MCR];
+	if (mcr & MCR_CDCHG)  {
+		if (bp->r[chip]->r[CD180_MSVR] & MSVR_CD) 
+			wake_up_interruptible(&port->open_wait);
+		else if (!((port->flags & ASYNC_CALLOUT_ACTIVE) &&
+			   (port->flags & ASYNC_CALLOUT_NOHUP)))
+			queue_task(&port->tqueue_hangup,  
+					   &tq_scheduler);      
+	}
+	
+/* We don't have such things yet. My aurora board has DTR and RTS swapped, but that doesn't count in this driver. Let's hope
+ * Aurora didn't made any boards with CTS or DSR broken...
+ */
+/* #ifdef AURORA_BRAIN_DAMAGED_CTS
+	if (mcr & MCR_CTSCHG)  {
+		if (aurora_in(bp, CD180_MSVR) & MSVR_CTS)  {
+			tty->hw_stopped = 0;
+			port->SRER |= SRER_TXRDY;
+			if (port->xmit_cnt <= port->wakeup_chars)
+				aurora_mark_event(port, RS_EVENT_WRITE_WAKEUP);
+		} else  {
+			tty->hw_stopped = 1;
+			port->SRER &= ~SRER_TXRDY;
+		}
+		bp->r[chip]->r[CD180_SRER, port->SRER);
+	}
+	if (mcr & MCR_DSRCHG)  {
+		if (aurora_in(bp, CD180_MSVR) & MSVR_DSR)  {
+			tty->hw_stopped = 0;
+			port->SRER |= SRER_TXRDY;
+			if (port->xmit_cnt <= port->wakeup_chars)
+				aurora_mark_event(port, RS_EVENT_WRITE_WAKEUP);
+		} else  {
+			tty->hw_stopped = 1;
+			port->SRER &= ~SRER_TXRDY;
+		}
+		bp->r[chip]->r[CD180_SRER, port->SRER);
+	}
+#endif AURORA_BRAIN_DAMAGED_CTS */
+	
+	/* Clear change bits */
+	bp->r[chip]->r[CD180_MCR]=0;
+}
+
+/* The main interrupt processing routine */
+static void aurora_interrupt(int irq, void * dev_id, struct pt_regs * regs)
+{
+	unsigned char status;
+	unsigned char ack,chip/*,chip_id*/;
+	struct Aurora_board * bp = (struct Aurora_board *) dev_id;
+	unsigned long loop=0;
+
+	#ifdef AURORA_INT_DEBUG
+	printk("IRQ%d %d\n",irq,++irqhit);
+	#ifdef AURORA_FLOODPRO
+	if (irqhit>=AURORA_FLOODPRO)
+		bp->r0->r=8;
+	#endif
+	#endif
+	
+/* old	bp = IRQ_to_board[irq&0x0f];*/
+	
+	if (!bp || !(bp->flags & AURORA_BOARD_ACTIVE))  {
+		return;
+	}
+
+/*	The while() below takes care of this.
+	status=bp->r[0]->r[CD180_SRSR];
+	#ifdef AURORA_INT_DEBUG
+	printk("mumu: %02x\n",status);
+	#endif
+	if (!(status&SRSR_ANYINT)) return; * Nobody has anything to say, so exit *
+*/
+	while ((loop++ < 48)&&(status=bp->r[0]->r[CD180_SRSR]&SRSR_ANYINT)){
+		#ifdef AURORA_INT_DEBUG
+		printk("SRSR: %02x\n",status);
+		#endif
+		if (status&SRSR_REXT) {
+			ack=bp->r3->r[bp->ACK_RINT];
+			#ifdef AURORA_INT_DEBUG
+			printk("R-ACK %02x\n",ack);
+			#endif
+			if ((ack>>5)==board_No(bp)) {
+				if ((chip=((ack>>3)&3)-1) < AURORA_NCD180) {
+					if ((ack&GSVR_ITMASK)==GSVR_IT_RGD) {
+						aurora_receive(bp,chip);
+						bp->r[chip]->r[CD180_EOSRR]=0;
+					} else
+					if ((ack&GSVR_ITMASK)==GSVR_IT_REXC) {
+						aurora_receive_exc(bp,chip);
+						bp->r[chip]->r[CD180_EOSRR]=0;
+					}
+				}
+			}
+		} else
+		if (status&SRSR_TEXT) {
+			ack=bp->r3->r[bp->ACK_TINT];
+			#ifdef AURORA_INT_DEBUG
+			printk("T-ACK %02x\n",ack);
+			#endif
+			if ((ack>>5)==board_No(bp)) {
+				if ((chip=((ack>>3)&3)-1) < AURORA_NCD180) {
+					if ((ack&GSVR_ITMASK)==GSVR_IT_TX) {
+						aurora_transmit(bp,chip);
+						bp->r[chip]->r[CD180_EOSRR]=0;
+					}
+				}
+			}
+		} else
+		if (status&SRSR_MEXT) {
+			ack=bp->r3->r[bp->ACK_MINT];
+			#ifdef AURORA_INT_DEBUG
+			printk("M-ACK %02x\n",ack);
+			#endif
+			if ((ack>>5)==board_No(bp)) {
+				if ((chip=((ack>>3)&3)-1) < AURORA_NCD180) {
+					if ((ack&GSVR_ITMASK)==GSVR_IT_MDM) {
+						aurora_check_modem(bp,chip);
+						bp->r[chip]->r[CD180_EOSRR]=0;
+					}
+				}
+			}
+		}
+	}
+/* I guess this faster code can be used with CD1865, using AUROPRI and GLOBPRI.
+	while ((loop++ < 48)&&(status=bp->r[0]->r[CD180_SRSR]&SRSR_ANYINT)){
+		#ifdef AURORA_INT_DEBUG
+		printk("SRSR: %02x\n",status);
+		#endif
+		ack=bp->r3->r[0];
+		#ifdef AURORA_INT_DEBUG
+		printk("ACK: %02x\n",ack);
+		#endif
+		if ((ack>>5)==board_No(bp)) {
+			if ((chip=((ack>>3)&3)-1) < AURORA_NCD180) {
+				ack&=GSVR_ITMASK;
+				if (ack==GSVR_IT_RGD) {
+					aurora_receive(bp,chip);
+					bp->r[chip]->r[CD180_EOSRR]=0;
+				} else
+				if (ack==GSVR_IT_REXC) {
+					aurora_receive_exc(bp,chip);
+					bp->r[chip]->r[CD180_EOSRR]=0;
+				} else
+				if (ack==GSVR_IT_TX) {
+					aurora_transmit(bp,chip);
+					bp->r[chip]->r[CD180_EOSRR]=0;
+				} else
+				if (ack==GSVR_IT_MDM) {
+					aurora_check_modem(bp,chip);
+					bp->r[chip]->r[CD180_EOSRR]=0;
+				}
+			}
+		}
+	}
+*/
+/* This is the old handling routine, used in riscom8 for only one CD180. I keep it here for reference.
+for(chip=0;chip<AURORA_NCD180;chip++){
+	chip_id=(board_No(bp)<<5)|((chip+1)<<3);
+	loop=0;
+	while ((loop++ < 1) && ((status = bp->r[chip]->r[CD180_SRSR]) &
+			 (SRSR_TEXT | SRSR_MEXT | SRSR_REXT))) {
+
+		if (status & SRSR_REXT) {
+			ack = bp->r3->r[bp->ACK_RINT];
+			if (ack == (chip_id | GSVR_IT_RGD)){
+				#ifdef AURORA_INTMSG
+				printk("RX ACK\n");
+				#endif
+				aurora_receive(bp,chip);
+				}
+			else if (ack == (chip_id | GSVR_IT_REXC)){
+				#ifdef AURORA_INTMSG
+				printk("RXC ACK\n");
+				#endif
+				aurora_receive_exc(bp,chip);
+				}
+			else
+				#ifdef AURORA_INTNORM
+				printk("aurora%d-%d: Bad receive ack 0x%02x.\n",
+				       board_No(bp), chip, ack)
+				#endif
+				;
+
+		} else if (status & SRSR_TEXT) {
+			ack = bp->r3->r[bp->ACK_TINT];
+			if (ack == (chip_id | GSVR_IT_TX)){
+				#ifdef AURORA_INTMSG
+				printk("TX ACK\n");
+				#endif
+				aurora_transmit(bp,chip);
+				}
+			else{
+				#ifdef AURORA_INTNORM
+				printk("aurora%d-%d: Bad transmit ack 0x%02x.\n",
+				       board_No(bp), chip, ack);
+				#endif
+				       }
+
+		} else  if (status & SRSR_MEXT)  {
+			ack = bp->r3->r[bp->ACK_MINT];
+			if (ack == (chip_id | GSVR_IT_MDM)){
+				#ifdef AURORA_INTMSG
+				printk("MDM ACK\n");
+				#endif
+				aurora_check_modem(bp,chip);
+				}
+			else
+				#ifdef AURORA_INTNORM
+				printk("aurora%d-%d: Bad modem ack 0x%02x.\n",
+				       board_No(bp), chip, ack)
+				#endif
+				;
+		
+		}
+		bp->r[chip]->r[CD180_EOSRR]=0;
+	}
+    }
+*/
+}
+
+
+#ifdef AURORA_INT_DEBUG
+static void aurora_timer (unsigned long ignored);
+
+static struct timer_list
+aurora_poll_timer = { NULL, NULL, 0, 0, aurora_timer };
+
+static void
+aurora_timer (unsigned long ignored)
+{
+	unsigned long flags;
+	int i;
+
+	save_flags(flags); cli();
+
+printk("SRSR: %02x,%02x - ",aurora_board[0].r[0]->r[CD180_SRSR],aurora_board[0].r[1]->r[CD180_SRSR]);
+for(i=0;i<4;i++){
+	udelay(1);
+	printk("%02x ",aurora_board[0].r3->r[i]);
+	}
+printk("\n");
+
+	aurora_poll_timer.expires = jiffies + 300;
+	add_timer (&aurora_poll_timer);
+
+	restore_flags(flags);
+}
+#endif
+
+/*
+ *  Routines for open & close processing.
+ */
+
+/* Called with disabled interrupts */
+extern inline int aurora_setup_board(struct Aurora_board * bp)
+{
+	int error;
+	
+#ifdef AURORA_ALLIRQ
+	int i;
+	for(i=0;i<AURORA_ALLIRQ;i++){
+		error = request_irq(allirq[i]|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp);
+		if (error){
+			printk(KERN_ERR "IRQ%d request error %d\n",allirq[i],error);
+		}
+	}
+#else
+	error = request_irq(bp->irq|0x30, aurora_interrupt, SA_SHIRQ, "sio16", bp);
+	if (error){
+		printk(KERN_ERR "IRQ request error %d\n",error);
+		return error;
+	}
+#endif
+	/* Board reset */
+	bp->r0->r=0;
+	udelay(1);
+	if(bp->flags&AURORA_BOARD_TYPE_2){
+		/* unknown yet */
+	} else {
+		bp->r0->r=AURORA_CFG_ENABLE_IO|AURORA_CFG_ENABLE_IRQ|(((bp->irq)&0x0f)>>2);
+	}
+	udelay(10000);
+
+	if (aurora_init_CD180(bp,0))error=1;error=0;
+	if (aurora_init_CD180(bp,1))error++;
+	if (error==AURORA_NCD180) {
+		printk(KERN_ERR "Both chips failed initialisation.\n");
+		return -EIO;
+		}
+
+#ifdef AURORA_INT_DEBUG
+	aurora_poll_timer.expires=jiffies+1;
+	add_timer(&aurora_poll_timer);
+#endif
+#ifdef AURORA_DEBUG
+printk("aurora_setup_board: end\n");
+#endif
+	return 0;
+}
+
+/* Called with disabled interrupts */
+extern inline void aurora_shutdown_board(struct Aurora_board *bp)
+{
+	int i;
+
+#ifdef AURORA_DEBUG
+printk("aurora_shutdown_board: start\n");
+#endif
+
+#ifdef AURORA_INT_DEBUG
+	del_timer(&aurora_poll_timer);
+#endif
+
+#ifdef AURORA_ALLIRQ
+for(i=0;i<AURORA_ALLIRQ;i++){
+	free_irq(allirq[i]|0x30, bp);
+/*	IRQ_to_board[allirq[i]&0xf] = NULL;*/
+	}
+#else
+	free_irq(bp->irq|0x30, bp);
+/*	IRQ_to_board[bp->irq&0xf] = NULL;*/
+#endif	
+	/* Drop all DTR's */
+	for(i=0;i<16;i++){
+		bp->r[i>>3]->r[CD180_CAR]=i&7;
+		udelay(1);
+		bp->r[i>>3]->r[CD180_MSVR]=0;
+		udelay(1);
+		}
+	/* Board shutdown */
+	bp->r0->r=0;
+
+#ifdef AURORA_DEBUG
+printk("aurora_shutdown_board: end\n");
+#endif
+}
+
+/*
+ * Setting up port characteristics. 
+ * Must be called with disabled interrupts
+ */
+static void aurora_change_speed(struct Aurora_board *bp, struct Aurora_port *port)
+{
+	struct tty_struct *tty;
+	unsigned long baud;
+	long tmp;
+	unsigned char cor1 = 0, cor3 = 0;
+	unsigned char mcor1 = 0, mcor2 = 0,chip;
+	
+#ifdef AURORA_DEBUG
+printk("aurora_change_speed: start\n");
+#endif
+	if (!(tty = port->tty) || !tty->termios)
+		return;
+		
+	chip=AURORA_CD180(port_No(port));
+
+	port->SRER  = 0;
+	port->COR2 = 0;
+	port->MSVR = MSVR_RTS|MSVR_DTR;
+	
+	baud = C_BAUD(tty);
+	
+	if (baud & CBAUDEX) {
+		baud &= ~CBAUDEX;
+		if (baud < 1 || baud > 2) 
+			port->tty->termios->c_cflag &= ~CBAUDEX;
+		else
+			baud += 15;
+	}
+	if (baud == 15)  {
+		if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
+			baud ++;
+		if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
+			baud += 2;
+	}
+	
+	/* Select port on the board */
+	bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+	udelay(1);
+	
+	if (!baud_table[baud])  {
+		/* Drop DTR & exit */
+		port->MSVR &= ~(bp->DTR|bp->RTS);
+		bp->r[chip]->r[CD180_MSVR]=port->MSVR;
+		return;
+	} else  {
+		/* Set DTR on */
+		port->MSVR |= bp->DTR;
+		bp->r[chip]->r[CD180_MSVR]=port->MSVR;
+	}
+	
+	/*
+	 * Now we must calculate some speed depended things 
+	 */
+	
+	/* Set baud rate for port */
+	tmp = (((bp->oscfreq + baud_table[baud]/2) / baud_table[baud] +
+		CD180_TPC/2) / CD180_TPC);
+
+/*	tmp = (bp->oscfreq/7)/baud_table[baud];
+	if((tmp%10)>4)tmp=tmp/10+1;else tmp=tmp/10;*/
+/*	printk("Prescaler period: %d\n",tmp);*/
+
+	bp->r[chip]->r[CD180_RBPRH]=(tmp >> 8) & 0xff;
+	bp->r[chip]->r[CD180_TBPRH]=(tmp >> 8) & 0xff;
+	bp->r[chip]->r[CD180_RBPRL]=tmp & 0xff;
+	bp->r[chip]->r[CD180_TBPRL]=tmp & 0xff;
+	
+	baud = (baud_table[baud] + 5) / 10;   /* Estimated CPS */
+	
+	/* Two timer ticks seems enough to wakeup something like SLIP driver */
+	tmp = ((baud + HZ/2) / HZ) * 2 - CD180_NFIFO;		
+	port->wakeup_chars = (tmp < 0) ? 0 : ((tmp >= SERIAL_XMIT_SIZE) ?
+					      SERIAL_XMIT_SIZE - 1 : tmp);
+	
+	/* Receiver timeout will be transmission time for 1.5 chars */
+	tmp = (AURORA_TPS + AURORA_TPS/2 + baud/2) / baud;
+	tmp = (tmp > 0xff) ? 0xff : tmp;
+	bp->r[chip]->r[CD180_RTPR]=tmp;
+	
+	switch (C_CSIZE(tty))  {
+	 case CS5:
+		cor1 |= COR1_5BITS;
+		break;
+	 case CS6:
+		cor1 |= COR1_6BITS;
+		break;
+	 case CS7:
+		cor1 |= COR1_7BITS;
+		break;
+	 case CS8:
+		cor1 |= COR1_8BITS;
+		break;
+	}
+	
+	if (C_CSTOPB(tty)) 
+		cor1 |= COR1_2SB;
+	
+	cor1 |= COR1_IGNORE;
+	if (C_PARENB(tty))  {
+		cor1 |= COR1_NORMPAR;
+		if (C_PARODD(tty)) 
+			cor1 |= COR1_ODDP;
+		if (I_INPCK(tty)) 
+			cor1 &= ~COR1_IGNORE;
+	}
+	/* Set marking of some errors */
+	port->mark_mask = RCSR_OE | RCSR_TOUT;
+	if (I_INPCK(tty)) 
+		port->mark_mask |= RCSR_FE | RCSR_PE;
+	if (I_BRKINT(tty) || I_PARMRK(tty)) 
+		port->mark_mask |= RCSR_BREAK;
+	if (I_IGNPAR(tty)) 
+		port->mark_mask &= ~(RCSR_FE | RCSR_PE);
+	if (I_IGNBRK(tty))  {
+		port->mark_mask &= ~RCSR_BREAK;
+		if (I_IGNPAR(tty)) 
+			/* Real raw mode. Ignore all */
+			port->mark_mask &= ~RCSR_OE;
+	}
+	/* Enable Hardware Flow Control */
+	if (C_CRTSCTS(tty))  {
+/*#ifdef AURORA_BRAIN_DAMAGED_CTS
+		port->SRER |= SRER_DSR | SRER_CTS;
+		mcor1 |= MCOR1_DSRZD | MCOR1_CTSZD;
+		mcor2 |= MCOR2_DSROD | MCOR2_CTSOD;
+		tty->hw_stopped = !(aurora_in(bp, CD180_MSVR) & (MSVR_CTS|MSVR_DSR));
+#else*/
+		port->COR2 |= COR2_CTSAE;
+/*#endif*/
+		if (bp->flags&AURORA_BOARD_DTR_FLOW_OK) {
+			mcor1 |= AURORA_RXTH;
+		}
+	}
+	/* Enable Software Flow Control. FIXME: I'm not sure about this */
+	/* Some people reported that it works, but I still doubt */
+	if (I_IXON(tty))  {
+		port->COR2 |= COR2_TXIBE;
+		cor3 |= (COR3_FCT | COR3_SCDE);
+		if (I_IXANY(tty))
+			port->COR2 |= COR2_IXM;
+		bp->r[chip]->r[CD180_SCHR1]=START_CHAR(tty);
+		bp->r[chip]->r[CD180_SCHR2]=STOP_CHAR(tty);
+		bp->r[chip]->r[CD180_SCHR3]=START_CHAR(tty);
+		bp->r[chip]->r[CD180_SCHR4]=STOP_CHAR(tty);
+	}
+	if (!C_CLOCAL(tty))  {
+		/* Enable CD check */
+		port->SRER |= SRER_CD;
+		mcor1 |= MCOR1_CDZD;
+		mcor2 |= MCOR2_CDOD;
+	}
+	
+	if (C_CREAD(tty)) 
+		/* Enable receiver */
+		port->SRER |= SRER_RXD;
+	
+	/* Set input FIFO size (1-8 bytes) */
+	cor3 |= AURORA_RXFIFO; 
+	/* Setting up CD180 channel registers */
+	bp->r[chip]->r[CD180_COR1]=cor1;
+	bp->r[chip]->r[CD180_COR2]=port->COR2;
+	bp->r[chip]->r[CD180_COR3]=cor3;
+	/* Make CD180 know about registers change */
+	aurora_wait_CCR(bp->r[chip]);
+	bp->r[chip]->r[CD180_CCR]=CCR_CORCHG1 | CCR_CORCHG2 | CCR_CORCHG3;
+	/* Setting up modem option registers */
+	bp->r[chip]->r[CD180_MCOR1]=mcor1;
+	bp->r[chip]->r[CD180_MCOR2]=mcor2;
+	/* Enable CD180 transmitter & receiver */
+	aurora_wait_CCR(bp->r[chip]);
+	bp->r[chip]->r[CD180_CCR]=CCR_TXEN | CCR_RXEN;
+	/* Enable interrupts */
+	bp->r[chip]->r[CD180_SRER]=port->SRER;
+	/* And finally set RTS on */
+	bp->r[chip]->r[CD180_MSVR]=port->MSVR;
+#ifdef AURORA_DEBUG
+printk("aurora_change_speed: end\n");
+#endif
+}
+
+/* Must be called with interrupts enabled */
+static int aurora_setup_port(struct Aurora_board *bp, struct Aurora_port *port)
+{
+	unsigned long flags;
+	
+#ifdef AURORA_DEBUG
+printk("aurora_setup_port: start %d\n",port_No(port));
+#endif
+	if (port->flags & ASYNC_INITIALIZED)
+		return 0;
+		
+	if (!port->xmit_buf) {
+		/* We may sleep in get_free_page() */
+		unsigned long tmp;
+		
+		if (!(tmp = get_free_page(GFP_KERNEL)))
+			return -ENOMEM;
+		    
+		if (port->xmit_buf) {
+			free_page(tmp);
+			return -ERESTARTSYS;
+		}
+		port->xmit_buf = (unsigned char *) tmp;
+	}
+		
+	save_flags(flags); cli();
+		
+	if (port->tty) 
+		clear_bit(TTY_IO_ERROR, &port->tty->flags);
+		
+#ifdef MODULE
+	if (port->count == 1) {
+		MOD_INC_USE_COUNT;
+		if((++bp->count)==1)
+			bp->flags|=AURORA_BOARD_ACTIVE;
+	}
+#endif
+
+	port->xmit_cnt = port->xmit_head = port->xmit_tail = 0;
+	aurora_change_speed(bp, port);
+	port->flags |= ASYNC_INITIALIZED;
+		
+	restore_flags(flags);
+#ifdef AURORA_DEBUG
+printk("aurora_setup_port: end\n");
+#endif
+	return 0;
+}
+
+/* Must be called with interrupts disabled */
+static void aurora_shutdown_port(struct Aurora_board *bp, struct Aurora_port *port)
+{
+	struct tty_struct *tty;
+	unsigned char chip;
+
+#ifdef AURORA_DEBUG
+printk("aurora_shutdown_port: start\n");
+#endif
+	if (!(port->flags & ASYNC_INITIALIZED)) 
+		return;
+	
+	chip=AURORA_CD180(port_No(port));
+	
+#ifdef AURORA_REPORT_OVERRUN
+	printk("aurora%d: port %d: Total %ld overruns were detected.\n",
+	       board_No(bp), port_No(port), port->overrun);
+#endif	
+#ifdef AURORA_REPORT_FIFO
+	{
+		int i;
+		
+		printk("aurora%d: port %d: FIFO hits [ ",
+		       board_No(bp), port_No(port));
+		for (i = 0; i < 10; i++)  {
+			printk("%ld ", port->hits[i]);
+		}
+		printk("].\n");
+	}
+#endif	
+	if (port->xmit_buf)  {
+		free_page((unsigned long) port->xmit_buf);
+		port->xmit_buf = NULL;
+	}
+
+	if (!(tty = port->tty) || C_HUPCL(tty))  {
+		/* Drop DTR */
+		port->MSVR &= ~(bp->DTR|bp->RTS);
+		bp->r[chip]->r[CD180_MSVR]=port->MSVR;
+	}
+	
+        /* Select port */
+	bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+	udelay(1);
+	/* Reset port */
+	aurora_wait_CCR(bp->r[chip]);
+	bp->r[chip]->r[CD180_CCR]=CCR_SOFTRESET;
+	/* Disable all interrupts from this port */
+	port->SRER = 0;
+	bp->r[chip]->r[CD180_SRER]=port->SRER;
+	
+	if (tty)  
+		set_bit(TTY_IO_ERROR, &tty->flags);
+	port->flags &= ~ASYNC_INITIALIZED;
+
+#ifdef MODULE
+	if (--bp->count < 0)  {
+		printk(KERN_DEBUG "aurora%d: aurora_shutdown_port: bad board count: %d\n",
+		       board_No(bp), bp->count);
+		bp->count = 0;
+	}
+	
+	MOD_DEC_USE_COUNT;
+	if (!bp->count)
+		bp->flags&=~AURORA_BOARD_ACTIVE;
+#endif
+
+#ifdef AURORA_DEBUG
+printk("aurora_shutdown_port: end\n");
+#endif
+}
+
+	
+static int block_til_ready(struct tty_struct *tty, struct file * filp,
+			   struct Aurora_port *port)
+{
+	struct wait_queue wait = { current, NULL };
+	struct Aurora_board *bp = port_Board(port);
+	int    retval;
+	int    do_clocal = 0;
+	int    CD;
+	unsigned char chip;
+	
+#ifdef AURORA_DEBUG
+printk("block_til_ready: start\n");
+#endif
+	chip=AURORA_CD180(port_No(port));
+
+	/*
+	 * If the device is in the middle of being closed, then block
+	 * until it's done, and then try again.
+	 */
+	if (tty_hung_up_p(filp) || port->flags & ASYNC_CLOSING) {
+		interruptible_sleep_on(&port->close_wait);
+		if (port->flags & ASYNC_HUP_NOTIFY)
+			return -EAGAIN;
+		else
+			return -ERESTARTSYS;
+	}
+
+	/*
+	 * If non-blocking mode is set, or the port is not enabled,
+	 * then make the check up front and then exit.
+	 */
+	if ((filp->f_flags & O_NONBLOCK) ||
+	    (tty->flags & (1 << TTY_IO_ERROR))) {
+		if (port->flags & ASYNC_CALLOUT_ACTIVE)
+			return -EBUSY;
+		port->flags |= ASYNC_NORMAL_ACTIVE;
+		return 0;
+	}
+
+	if (port->flags & ASYNC_CALLOUT_ACTIVE) {
+		if (port->normal_termios.c_cflag & CLOCAL) 
+			do_clocal = 1;
+	} else {
+		if (C_CLOCAL(tty))  
+			do_clocal = 1;
+	}
+	
+	/*
+	 * Block waiting for the carrier detect and the line to become
+	 * free (i.e., not in use by the callout).  While we are in
+	 * this loop, info->count is dropped by one, so that
+	 * rs_close() knows when to free things.  We restore it upon
+	 * exit, either normal or abnormal.
+	 */
+	retval = 0;
+	add_wait_queue(&port->open_wait, &wait);
+	cli();
+	if (!tty_hung_up_p(filp))
+		port->count--;
+	sti();
+	port->blocked_open++;
+	while (1) {
+		cli();
+		bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+		udelay(1);
+		CD = bp->r[chip]->r[CD180_MSVR] & MSVR_CD;
+		if (!(port->flags & ASYNC_CALLOUT_ACTIVE))  {
+			port->MSVR=bp->RTS;
+			bp->r[chip]->r[CD180_MSVR]=port->MSVR;/* auto drops DTR */
+		}
+		sti();
+		current->state = TASK_INTERRUPTIBLE;
+		if (tty_hung_up_p(filp) ||
+		    !(port->flags & ASYNC_INITIALIZED)) {
+			if (port->flags & ASYNC_HUP_NOTIFY)
+				retval = -EAGAIN;
+			else
+				retval = -ERESTARTSYS;	
+			break;
+		}
+		if (/*!(port->flags & ASYNC_CALLOUT_ACTIVE) &&*/
+		    !(port->flags & ASYNC_CLOSING) &&
+		    (do_clocal || CD))
+			break;
+		if (signal_pending(current)) {
+			retval = -ERESTARTSYS;
+			break;
+		}
+		schedule();
+	}
+	current->state = TASK_RUNNING;
+	remove_wait_queue(&port->open_wait, &wait);
+	if (!tty_hung_up_p(filp))
+		port->count++;
+	port->blocked_open--;
+	if (retval)
+		return retval;
+	
+	port->flags |= ASYNC_NORMAL_ACTIVE;
+#ifdef AURORA_DEBUG
+printk("block_til_ready: end\n");
+#endif
+	return 0;
+}	
+
+static int aurora_open(struct tty_struct * tty, struct file * filp)
+{
+	int board;
+	int error;
+	struct Aurora_port * port;
+	struct Aurora_board * bp;
+	unsigned long flags;
+	
+	#ifdef AURORA_DEBUG
+	printk("aurora_open: start\n");
+	#endif
+	
+	board = AURORA_BOARD(MINOR(tty->device));
+	if (board > AURORA_NBOARD || !(aurora_board[board].flags & AURORA_BOARD_PRESENT)){
+		#ifdef AURORA_DEBUG
+		printk("aurora_open: error board %d present %d\n",board,aurora_board[board].flags &AURORA_BOARD_PRESENT);
+		#endif
+		return -ENODEV;
+		}
+	
+	bp = &aurora_board[board];
+	port = aurora_port + board * AURORA_NPORT * AURORA_NCD180 + AURORA_PORT(MINOR(tty->device));
+	if (aurora_paranoia_check(port, tty->device, "aurora_open")){
+		#ifdef AURORA_DEBUG
+		printk("aurora_open: error paranoia check\n");
+		#endif
+		return -ENODEV;
+		}
+	
+	port->count++;
+	tty->driver_data = port;
+	port->tty = tty;
+	
+	if ((error = aurora_setup_port(bp, port))) {
+		#ifdef AURORA_DEBUG
+		printk("aurora_open: error aurora_setup_port ret %d\n",error);
+		#endif
+		return error;
+		}
+
+	if ((error = block_til_ready(tty, filp, port))){
+		#ifdef AURORA_DEBUG
+		printk("aurora_open: error block_til_ready ret %d\n",error);
+		#endif
+		return error;
+		}
+	
+	if ((port->count == 1) && (port->flags & ASYNC_SPLIT_TERMIOS)) {
+		*tty->termios = port->normal_termios;
+		save_flags(flags); cli();
+		aurora_change_speed(bp, port);
+		restore_flags(flags);
+	}
+
+	port->session = current->session;
+	port->pgrp = current->pgrp;
+	#ifdef AURORA_DEBUG
+	printk("aurora_open: end\n");
+	#endif
+	return 0;
+}
+
+static void aurora_close(struct tty_struct * tty, struct file * filp)
+{
+	struct Aurora_port *port = (struct Aurora_port *) tty->driver_data;
+	struct Aurora_board *bp;
+	unsigned long flags;
+	unsigned long timeout;
+	unsigned char chip;
+	
+	#ifdef AURORA_DEBUG
+	printk("aurora_close: start\n");
+	#endif
+	
+	if (!port || aurora_paranoia_check(port, tty->device, "close"))
+		return;
+	
+	chip=AURORA_CD180(port_No(port));
+
+	save_flags(flags); cli();
+	if (tty_hung_up_p(filp))  {
+		restore_flags(flags);
+		return;
+	}
+	
+	bp = port_Board(port);
+	if ((tty->count == 1) && (port->count != 1))  {
+		printk(KERN_DEBUG "aurora%d: aurora_close: bad port count; tty->count is 1, port count is %d\n",
+		       board_No(bp), port->count);
+		port->count = 1;
+	}
+	if (--port->count < 0)  {
+		printk(KERN_DEBUG "aurora%d: aurora_close: bad port count for tty%d: %d\n",
+		       board_No(bp), port_No(port), port->count);
+		port->count = 0;
+	}
+	if (port->count)  {
+		restore_flags(flags);
+		return;
+	}
+	port->flags |= ASYNC_CLOSING;
+	/*
+	 * Save the termios structure, since this port may have
+	 * separate termios for callout and dialin.
+	 */
+	if (port->flags & ASYNC_NORMAL_ACTIVE)
+		port->normal_termios = *tty->termios;
+/*	if (port->flags & ASYNC_CALLOUT_ACTIVE)
+		port->callout_termios = *tty->termios;*/
+	/*
+	 * Now we wait for the transmit buffer to clear; and we notify 
+	 * the line discipline to only process XON/XOFF characters.
+	 */
+	tty->closing = 1;
+	if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE){
+		#ifdef AURORA_DEBUG
+		printk("aurora_close: waiting to flush...\n");
+		#endif
+		tty_wait_until_sent(tty, port->closing_wait);
+		}
+	/*
+	 * At this point we stop accepting input.  To do this, we
+	 * disable the receive line status interrupts, and tell the
+	 * interrupt driver to stop checking the data ready bit in the
+	 * line status register.
+	 */
+	port->SRER &= ~SRER_RXD;
+	if (port->flags & ASYNC_INITIALIZED) {
+		port->SRER &= ~SRER_TXRDY;
+		port->SRER |= SRER_TXEMPTY;
+		bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+		udelay(1);
+		bp->r[chip]->r[CD180_SRER]=port->SRER;
+		/*
+		 * Before we drop DTR, make sure the UART transmitter
+		 * has completely drained; this is especially
+		 * important if there is a transmit FIFO!
+		 */
+		timeout = jiffies+HZ;
+		while(port->SRER & SRER_TXEMPTY)  {
+			current->state = TASK_INTERRUPTIBLE;
+			schedule_timeout(port->timeout);
+			if (time_after(jiffies, timeout))
+				break;
+		}
+	}
+	#ifdef AURORA_DEBUG
+	printk("aurora_close: shutdown_port\n");
+	#endif
+	aurora_shutdown_port(bp, port);
+	if (tty->driver.flush_buffer)
+		tty->driver.flush_buffer(tty);
+	if (tty->ldisc.flush_buffer)
+		tty->ldisc.flush_buffer(tty);
+	tty->closing = 0;
+	port->event = 0;
+	port->tty = 0;
+	if (port->blocked_open) {
+		if (port->close_delay) {
+			current->state = TASK_INTERRUPTIBLE;
+			schedule_timeout(port->close_delay);
+		}
+		wake_up_interruptible(&port->open_wait);
+	}
+	port->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE|
+			 ASYNC_CLOSING);
+	wake_up_interruptible(&port->close_wait);
+	restore_flags(flags);
+	#ifdef AURORA_DEBUG
+	printk("aurora_close: end\n");
+	#endif
+}
+
+static int aurora_write(struct tty_struct * tty, int from_user, 
+		    const unsigned char *buf, int count)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	struct Aurora_board *bp;
+	int c, total = 0;
+	unsigned long flags;
+	unsigned char chip;
+
+#ifdef AURORA_DEBUG
+printk("aurora_write: start %d\n",count);
+#endif
+	if (aurora_paranoia_check(port, tty->device, "aurora_write"))
+		return 0;
+		
+	chip=AURORA_CD180(port_No(port));
+	
+	bp = port_Board(port);
+
+	if (!tty || !port->xmit_buf || !tmp_buf)
+		return 0;
+
+	if (from_user)
+		down(&tmp_buf_sem);
+
+	save_flags(flags);
+	while (1) {
+		cli();		
+		c = MIN(count, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
+				   SERIAL_XMIT_SIZE - port->xmit_head));
+		if (c <= 0)
+			break;
+
+		if (from_user) {
+			copy_from_user(tmp_buf, buf, c);
+			c = MIN(c, MIN(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
+				       SERIAL_XMIT_SIZE - port->xmit_head));
+			memcpy(port->xmit_buf + port->xmit_head, tmp_buf, c);
+		} else
+			memcpy(port->xmit_buf + port->xmit_head, buf, c);
+		port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1);
+		port->xmit_cnt += c;
+		restore_flags(flags);
+		buf += c;
+		count -= c;
+		total += c;
+	}
+	if (from_user)
+		up(&tmp_buf_sem);
+	if (port->xmit_cnt && !tty->stopped && !tty->hw_stopped &&
+	    !(port->SRER & SRER_TXRDY)) {
+		port->SRER |= SRER_TXRDY;
+		bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+		udelay(1);
+		bp->r[chip]->r[CD180_SRER]=port->SRER;
+	}
+	restore_flags(flags);
+#ifdef AURORA_DEBUG
+printk("aurora_write: end %d\n",total);
+#endif
+	return total;
+}
+
+static void aurora_put_char(struct tty_struct * tty, unsigned char ch)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	unsigned long flags;
+
+#ifdef AURORA_DEBUG
+printk("aurora_put_char: start %c\n",ch);
+#endif
+	if (aurora_paranoia_check(port, tty->device, "aurora_put_char"))
+		return;
+
+	if (!tty || !port->xmit_buf)
+		return;
+
+	save_flags(flags); cli();
+	
+	if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1) {
+		restore_flags(flags);
+		return;
+	}
+
+	port->xmit_buf[port->xmit_head++] = ch;
+	port->xmit_head &= SERIAL_XMIT_SIZE - 1;
+	port->xmit_cnt++;
+	restore_flags(flags);
+#ifdef AURORA_DEBUG
+printk("aurora_put_char: end\n");
+#endif
+}
+
+static void aurora_flush_chars(struct tty_struct * tty)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	unsigned long flags;
+	unsigned char chip;
+
+/*#ifdef AURORA_DEBUG
+printk("aurora_flush_chars: start\n");
+#endif*/
+	if (aurora_paranoia_check(port, tty->device, "aurora_flush_chars"))
+		return;
+		
+	chip=AURORA_CD180(port_No(port));
+	
+	if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
+	    !port->xmit_buf)
+		return;
+
+	save_flags(flags); cli();
+	port->SRER |= SRER_TXRDY;
+	port_Board(port)->r[chip]->r[CD180_CAR]=port_No(port)&7;
+	udelay(1);
+	port_Board(port)->r[chip]->r[CD180_SRER]=port->SRER;
+	restore_flags(flags);
+/*#ifdef AURORA_DEBUG
+printk("aurora_flush_chars: end\n");
+#endif*/
+}
+
+static int aurora_write_room(struct tty_struct * tty)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	int	ret;
+
+#ifdef AURORA_DEBUG
+printk("aurora_write_room: start\n");
+#endif
+	if (aurora_paranoia_check(port, tty->device, "aurora_write_room"))
+		return 0;
+
+	ret = SERIAL_XMIT_SIZE - port->xmit_cnt - 1;
+	if (ret < 0)
+		ret = 0;
+#ifdef AURORA_DEBUG
+printk("aurora_write_room: end\n");
+#endif
+	return ret;
+}
+
+static int aurora_chars_in_buffer(struct tty_struct *tty)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+				
+	if (aurora_paranoia_check(port, tty->device, "aurora_chars_in_buffer"))
+		return 0;
+	
+	return port->xmit_cnt;
+}
+
+static void aurora_flush_buffer(struct tty_struct *tty)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	unsigned long flags;
+
+#ifdef AURORA_DEBUG
+printk("aurora_flush_buffer: start\n");
+#endif
+	if (aurora_paranoia_check(port, tty->device, "aurora_flush_buffer"))
+		return;
+
+	save_flags(flags); cli();
+	port->xmit_cnt = port->xmit_head = port->xmit_tail = 0;
+	restore_flags(flags);
+	
+	wake_up_interruptible(&tty->write_wait);
+	if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
+	    tty->ldisc.write_wakeup)
+		(tty->ldisc.write_wakeup)(tty);
+#ifdef AURORA_DEBUG
+printk("aurora_flush_buffer: end\n");
+#endif
+}
+
+static int aurora_get_modem_info(struct Aurora_port * port, unsigned int *value)
+{
+	struct Aurora_board * bp;
+	unsigned char status,chip;
+	unsigned int result;
+	unsigned long flags;
+
+#ifdef AURORA_DEBUG
+printk("aurora_get_modem_info: start\n");
+#endif
+	chip=AURORA_CD180(port_No(port));
+
+	bp = port_Board(port);
+	save_flags(flags); cli();
+	bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+	udelay(1);
+	status = bp->r[chip]->r[CD180_MSVR];
+	result = 0/*bp->r[chip]->r[AURORA_RI] & (1u << port_No(port)) ? 0 : TIOCM_RNG*/;
+	restore_flags(flags);
+	result |= ((status & bp->RTS) ? TIOCM_RTS : 0)
+		| ((status & bp->DTR) ? TIOCM_DTR : 0)
+		| ((status & MSVR_CD)  ? TIOCM_CAR : 0)
+		| ((status & MSVR_DSR) ? TIOCM_DSR : 0)
+		| ((status & MSVR_CTS) ? TIOCM_CTS : 0);
+	put_user(result,(unsigned long *) value);
+#ifdef AURORA_DEBUG
+printk("aurora_get_modem_info: end\n");
+#endif
+	return 0;
+}
+
+static int aurora_set_modem_info(struct Aurora_port * port, unsigned int cmd,
+			     unsigned int *value)
+{
+	int error;
+	unsigned int arg;
+	unsigned long flags;
+	struct Aurora_board *bp = port_Board(port);
+	unsigned char chip;
+
+#ifdef AURORA_DEBUG
+printk("aurora_set_modem_info: start\n");
+#endif
+	error = get_user(arg, value);
+	if (error) 
+		return error;
+	chip=AURORA_CD180(port_No(port));
+	switch (cmd) {
+	 case TIOCMBIS: 
+		if (arg & TIOCM_RTS) 
+			port->MSVR |= bp->RTS;
+		if (arg & TIOCM_DTR)
+			port->MSVR |= bp->DTR;
+		break;
+	case TIOCMBIC:
+		if (arg & TIOCM_RTS)
+			port->MSVR &= ~bp->RTS;
+		if (arg & TIOCM_DTR)
+			port->MSVR &= ~bp->DTR;
+		break;
+	case TIOCMSET:
+		port->MSVR = (arg & TIOCM_RTS) ? (port->MSVR | bp->RTS) : 
+					         (port->MSVR & ~bp->RTS);
+		port->MSVR = (arg & TIOCM_DTR) ? (port->MSVR | bp->RTS) :
+						 (port->MSVR & ~bp->RTS);
+		break;
+	 default:
+		return -EINVAL;
+	}
+	save_flags(flags); cli();
+	bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+	udelay(1);
+	bp->r[chip]->r[CD180_MSVR]=port->MSVR;
+	restore_flags(flags);
+#ifdef AURORA_DEBUG
+printk("aurora_set_modem_info: end\n");
+#endif
+	return 0;
+}
+
+extern inline void aurora_send_break(struct Aurora_port * port, unsigned long length)
+{
+	struct Aurora_board *bp = port_Board(port);
+	unsigned long flags;
+	unsigned char chip;
+	
+#ifdef AURORA_DEBUG
+printk("aurora_send_break: start\n");
+#endif
+	chip=AURORA_CD180(port_No(port));
+	
+	save_flags(flags); cli();
+	port->break_length = AURORA_TPS / HZ * length;
+	port->COR2 |= COR2_ETC;
+	port->SRER  |= SRER_TXRDY;
+	bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+	udelay(1);
+	bp->r[chip]->r[CD180_COR2]=port->COR2;
+	bp->r[chip]->r[CD180_SRER]=port->SRER;
+	aurora_wait_CCR(bp->r[chip]);
+	bp->r[chip]->r[CD180_CCR]=CCR_CORCHG2;
+	aurora_wait_CCR(bp->r[chip]);
+	restore_flags(flags);
+#ifdef AURORA_DEBUG
+printk("aurora_send_break: end\n");
+#endif
+}
+
+extern inline int aurora_set_serial_info(struct Aurora_port * port,
+				     struct serial_struct * newinfo)
+{
+	struct serial_struct tmp;
+	struct Aurora_board *bp = port_Board(port);
+	int change_speed;
+	unsigned long flags;
+	int error;
+
+#ifdef AURORA_DEBUG
+printk("aurora_set_serial_info: start\n");
+#endif
+	error = verify_area(VERIFY_READ, (void *) newinfo, sizeof(tmp));
+	if (error)
+		return error;
+	copy_from_user(&tmp, newinfo, sizeof(tmp));
+	
+#if 0	
+	if ((tmp.irq != bp->irq) ||
+	    (tmp.port != bp->base) ||
+	    (tmp.type != PORT_CIRRUS) ||
+	    (tmp.baud_base != (bp->oscfreq + CD180_TPC/2) / CD180_TPC) ||
+	    (tmp.custom_divisor != 0) ||
+	    (tmp.xmit_fifo_size != CD180_NFIFO) ||
+	    (tmp.flags & ~AURORA_LEGAL_FLAGS))
+		return -EINVAL;
+#endif	
+	
+	change_speed = ((port->flags & ASYNC_SPD_MASK) !=
+			(tmp.flags & ASYNC_SPD_MASK));
+	
+	if (!suser()) {
+		if ((tmp.close_delay != port->close_delay) ||
+		    (tmp.closing_wait != port->closing_wait) ||
+		    ((tmp.flags & ~ASYNC_USR_MASK) !=
+		     (port->flags & ~ASYNC_USR_MASK)))  
+			return -EPERM;
+		port->flags = ((port->flags & ~ASYNC_USR_MASK) |
+			       (tmp.flags & ASYNC_USR_MASK));
+	} else  {
+		port->flags = ((port->flags & ~ASYNC_FLAGS) |
+			       (tmp.flags & ASYNC_FLAGS));
+		port->close_delay = tmp.close_delay;
+		port->closing_wait = tmp.closing_wait;
+	}
+	if (change_speed)  {
+		save_flags(flags); cli();
+		aurora_change_speed(bp, port);
+		restore_flags(flags);
+	}
+#ifdef AURORA_DEBUG
+printk("aurora_set_serial_info: end\n");
+#endif
+	return 0;
+}
+
+extern inline int aurora_get_serial_info(struct Aurora_port * port,
+				     struct serial_struct * retinfo)
+{
+	struct serial_struct tmp;
+	struct Aurora_board *bp = port_Board(port);
+	int error;
+	
+#ifdef AURORA_DEBUG
+printk("aurora_get_serial_info: start\n");
+#endif
+	error = verify_area(VERIFY_WRITE, (void *) retinfo, sizeof(tmp));
+	if (error)
+		return error;
+	
+	memset(&tmp, 0, sizeof(tmp));
+	tmp.type = PORT_CIRRUS;
+	tmp.line = port - aurora_port;
+	tmp.port = 0;
+	tmp.irq  = bp->irq;
+	tmp.flags = port->flags;
+	tmp.baud_base = (bp->oscfreq + CD180_TPC/2) / CD180_TPC;
+	tmp.close_delay = port->close_delay * HZ/100;
+	tmp.closing_wait = port->closing_wait * HZ/100;
+	tmp.xmit_fifo_size = CD180_NFIFO;
+	copy_to_user(retinfo, &tmp, sizeof(tmp));
+#ifdef AURORA_DEBUG
+printk("aurora_get_serial_info: end\n");
+#endif
+	return 0;
+}
+
+static int aurora_ioctl(struct tty_struct * tty, struct file * filp, 
+		    unsigned int cmd, unsigned long arg)
+		    
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	int error;
+	int retval;
+
+#ifdef AURORA_DEBUG
+printk("aurora_ioctl: start\n");
+#endif
+	if (aurora_paranoia_check(port, tty->device, "aurora_ioctl"))
+		return -ENODEV;
+	
+	switch (cmd) {
+	 case TCSBRK:	/* SVID version: non-zero arg --> no break */
+		retval = tty_check_change(tty);
+		if (retval)
+			return retval;
+		tty_wait_until_sent(tty, 0);
+		if (!arg)
+			aurora_send_break(port, HZ/4);	/* 1/4 second */
+		return 0;
+	 case TCSBRKP:	/* support for POSIX tcsendbreak() */
+		retval = tty_check_change(tty);
+		if (retval)
+			return retval;
+		tty_wait_until_sent(tty, 0);
+		aurora_send_break(port, arg ? arg*(HZ/10) : HZ/4);
+		return 0;
+	 case TIOCGSOFTCAR:
+		error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(long));
+		if (error)
+			return error;
+		put_user(C_CLOCAL(tty) ? 1 : 0,
+			    (unsigned long *) arg);
+		return 0;
+	 case TIOCSSOFTCAR:
+		retval = get_user(arg,(unsigned long *) arg);
+		if (retval)
+			return retval;
+		tty->termios->c_cflag =
+			((tty->termios->c_cflag & ~CLOCAL) |
+			(arg ? CLOCAL : 0));
+		return 0;
+	 case TIOCMGET:
+		error = verify_area(VERIFY_WRITE, (void *) arg,
+				    sizeof(unsigned int));
+		if (error)
+			return error;
+		return aurora_get_modem_info(port, (unsigned int *) arg);
+	 case TIOCMBIS:
+	 case TIOCMBIC:
+	 case TIOCMSET:
+		return aurora_set_modem_info(port, cmd, (unsigned int *) arg);
+	 case TIOCGSERIAL:	
+		return aurora_get_serial_info(port, (struct serial_struct *) arg);
+	 case TIOCSSERIAL:	
+		return aurora_set_serial_info(port, (struct serial_struct *) arg);
+	 default:
+		return -ENOIOCTLCMD;
+	}
+#ifdef AURORA_DEBUG
+printk("aurora_ioctl: end\n");
+#endif
+	return 0;
+}
+
+static void aurora_throttle(struct tty_struct * tty)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	struct Aurora_board *bp;
+	unsigned long flags;
+	unsigned char chip;
+
+#ifdef AURORA_DEBUG
+printk("aurora_throttle: start\n");
+#endif
+	if (aurora_paranoia_check(port, tty->device, "aurora_throttle"))
+		return;
+	
+	bp = port_Board(port);
+	chip=AURORA_CD180(port_No(port));
+	
+	save_flags(flags); cli();
+	port->MSVR &= ~bp->RTS;
+	bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+	udelay(1);
+	if (I_IXOFF(tty))  {
+		aurora_wait_CCR(bp->r[chip]);
+		bp->r[chip]->r[CD180_CCR]=CCR_SSCH2;
+		aurora_wait_CCR(bp->r[chip]);
+	}
+	bp->r[chip]->r[CD180_MSVR]=port->MSVR;
+	restore_flags(flags);
+#ifdef AURORA_DEBUG
+printk("aurora_throttle: end\n");
+#endif
+}
+
+static void aurora_unthrottle(struct tty_struct * tty)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	struct Aurora_board *bp;
+	unsigned long flags;
+	unsigned char chip;
+
+#ifdef AURORA_DEBUG
+printk("aurora_unthrottle: start\n");
+#endif
+	if (aurora_paranoia_check(port, tty->device, "aurora_unthrottle"))
+		return;
+	
+	bp = port_Board(port);
+	
+	chip=AURORA_CD180(port_No(port));
+	
+	save_flags(flags); cli();
+	port->MSVR |= bp->RTS;
+	bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+	udelay(1);
+	if (I_IXOFF(tty))  {
+		aurora_wait_CCR(bp->r[chip]);
+		bp->r[chip]->r[CD180_CCR]=CCR_SSCH1;
+		aurora_wait_CCR(bp->r[chip]);
+	}
+	bp->r[chip]->r[CD180_MSVR]=port->MSVR;
+	restore_flags(flags);
+#ifdef AURORA_DEBUG
+printk("aurora_unthrottle: end\n");
+#endif
+}
+
+static void aurora_stop(struct tty_struct * tty)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	struct Aurora_board *bp;
+	unsigned long flags;
+	unsigned char chip;
+
+#ifdef AURORA_DEBUG
+printk("aurora_stop: start\n");
+#endif
+	if (aurora_paranoia_check(port, tty->device, "aurora_stop"))
+		return;
+	
+	bp = port_Board(port);
+	
+	chip=AURORA_CD180(port_No(port));
+	
+	save_flags(flags); cli();
+	port->SRER &= ~SRER_TXRDY;
+	bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+	udelay(1);
+	bp->r[chip]->r[CD180_SRER]=port->SRER;
+	restore_flags(flags);
+#ifdef AURORA_DEBUG
+printk("aurora_stop: end\n");
+#endif
+}
+
+static void aurora_start(struct tty_struct * tty)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	struct Aurora_board *bp;
+	unsigned long flags;
+	unsigned char chip;
+
+#ifdef AURORA_DEBUG
+printk("aurora_start: start\n");
+#endif
+	if (aurora_paranoia_check(port, tty->device, "aurora_start"))
+		return;
+	
+	bp = port_Board(port);
+	
+	chip=AURORA_CD180(port_No(port));
+	
+	save_flags(flags); cli();
+	if (port->xmit_cnt && port->xmit_buf && !(port->SRER & SRER_TXRDY))  {
+		port->SRER |= SRER_TXRDY;
+		bp->r[chip]->r[CD180_CAR]=port_No(port)&7;
+		udelay(1);
+		bp->r[chip]->r[CD180_SRER]=port->SRER;
+	}
+	restore_flags(flags);
+#ifdef AURORA_DEBUG
+printk("aurora_start: end\n");
+#endif
+}
+
+/*
+ * This routine is called from the scheduler tqueue when the interrupt
+ * routine has signalled that a hangup has occurred.  The path of
+ * hangup processing is:
+ *
+ * 	serial interrupt routine -> (scheduler tqueue) ->
+ * 	do_aurora_hangup() -> tty->hangup() -> aurora_hangup()
+ * 
+ */
+static void do_aurora_hangup(void *private_)
+{
+	struct Aurora_port	*port = (struct Aurora_port *) private_;
+	struct tty_struct	*tty;
+
+#ifdef AURORA_DEBUG
+printk("do_aurora_hangup: start\n");
+#endif
+	tty = port->tty;
+	if (!tty)
+		return;
+
+	tty_hangup(tty);
+#ifdef AURORA_DEBUG
+printk("do_aurora_hangup: end\n");
+#endif
+}
+
+static void aurora_hangup(struct tty_struct * tty)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	struct Aurora_board *bp;
+				
+#ifdef AURORA_DEBUG
+printk("aurora_hangup: start\n");
+#endif
+	if (aurora_paranoia_check(port, tty->device, "aurora_hangup"))
+		return;
+	
+	bp = port_Board(port);
+	
+	aurora_shutdown_port(bp, port);
+	port->event = 0;
+	port->count = 0;
+	port->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE);
+	port->tty = 0;
+	wake_up_interruptible(&port->open_wait);
+#ifdef AURORA_DEBUG
+printk("aurora_hangup: end\n");
+#endif
+}
+
+static void aurora_set_termios(struct tty_struct * tty, struct termios * old_termios)
+{
+	struct Aurora_port *port = (struct Aurora_port *)tty->driver_data;
+	unsigned long flags;
+
+#ifdef AURORA_DEBUG
+printk("aurora_set_termios: start\n");
+#endif
+	if (aurora_paranoia_check(port, tty->device, "aurora_set_termios"))
+		return;
+	
+	if (tty->termios->c_cflag == old_termios->c_cflag &&
+	    tty->termios->c_iflag == old_termios->c_iflag)
+		return;
+
+	save_flags(flags); cli();
+	aurora_change_speed(port_Board(port), port);
+	restore_flags(flags);
+
+	if ((old_termios->c_cflag & CRTSCTS) &&
+	    !(tty->termios->c_cflag & CRTSCTS)) {
+		tty->hw_stopped = 0;
+		aurora_start(tty);
+	}
+#ifdef AURORA_DEBUG
+printk("aurora_set_termios: end\n");
+#endif
+}
+
+static void do_aurora_bh(void)
+{
+	 run_task_queue(&tq_aurora);
+}
+
+static void do_softint(void *private_)
+{
+	struct Aurora_port	*port = (struct Aurora_port *) private_;
+	struct tty_struct	*tty;
+
+#ifdef AURORA_DEBUG
+printk("do_softint: start\n");
+#endif
+	if(!(tty = port->tty)) 
+		return;
+
+	if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &port->event)) {
+		if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
+		    tty->ldisc.write_wakeup)
+			(tty->ldisc.write_wakeup)(tty);
+		wake_up_interruptible(&tty->write_wait);
+	}
+#ifdef AURORA_DEBUG
+printk("do_softint: end\n");
+#endif
+}
+
+static int aurora_init_drivers(void)
+{
+	int error;
+	int i;
+
+#ifdef AURORA_DEBUG
+printk("aurora_init_drivers: start\n");
+#endif
+	if (!(tmp_buf = (unsigned char *) get_free_page(GFP_KERNEL))) {
+		printk(KERN_ERR "aurora: Couldn't get free page.\n");
+		return 1;
+	}
+	init_bh(AURORA_BH, do_aurora_bh);
+/*	memset(IRQ_to_board, 0, sizeof(IRQ_to_board));*/
+	memset(&aurora_driver, 0, sizeof(aurora_driver));
+	aurora_driver.magic = TTY_DRIVER_MAGIC;
+	aurora_driver.name = "ttyA";
+	aurora_driver.major = AURORA_MAJOR;
+	aurora_driver.num = AURORA_TNPORTS;
+	aurora_driver.type = TTY_DRIVER_TYPE_SERIAL;
+	aurora_driver.subtype = AURORA_TYPE_NORMAL;
+	aurora_driver.init_termios = tty_std_termios;
+	aurora_driver.init_termios.c_cflag =
+		B9600 | CS8 | CREAD | HUPCL | CLOCAL;
+	aurora_driver.flags = TTY_DRIVER_REAL_RAW;
+	aurora_driver.refcount = &aurora_refcount;
+	aurora_driver.table = aurora_table;
+	aurora_driver.termios = aurora_termios;
+	aurora_driver.termios_locked = aurora_termios_locked;
+
+	aurora_driver.open  = aurora_open;
+	aurora_driver.close = aurora_close;
+	aurora_driver.write = aurora_write;
+	aurora_driver.put_char = aurora_put_char;
+	aurora_driver.flush_chars = aurora_flush_chars;
+	aurora_driver.write_room = aurora_write_room;
+	aurora_driver.chars_in_buffer = aurora_chars_in_buffer;
+	aurora_driver.flush_buffer = aurora_flush_buffer;
+	aurora_driver.ioctl = aurora_ioctl;
+	aurora_driver.throttle = aurora_throttle;
+	aurora_driver.unthrottle = aurora_unthrottle;
+	aurora_driver.set_termios = aurora_set_termios;
+	aurora_driver.stop = aurora_stop;
+	aurora_driver.start = aurora_start;
+	aurora_driver.hangup = aurora_hangup;
+
+	if ((error = tty_register_driver(&aurora_driver)))  {
+		free_page((unsigned long)tmp_buf);
+		printk(KERN_ERR "aurora: Couldn't register aurora driver, error = %d\n",
+		       error);
+		return 1;
+	}
+	
+	memset(aurora_port, 0, sizeof(aurora_port));
+	for (i = 0; i < AURORA_TNPORTS; i++)  {
+		aurora_port[i].normal_termios  = aurora_driver.init_termios;
+		aurora_port[i].magic = AURORA_MAGIC;
+		aurora_port[i].tqueue.routine = do_softint;
+		aurora_port[i].tqueue.data = &aurora_port[i];
+		aurora_port[i].tqueue_hangup.routine = do_aurora_hangup;
+		aurora_port[i].tqueue_hangup.data = &aurora_port[i];
+		aurora_port[i].close_delay = 50 * HZ/100;
+		aurora_port[i].closing_wait = 3000 * HZ/100;
+	}
+#ifdef AURORA_DEBUG
+printk("aurora_init_drivers: end\n");
+#endif
+	return 0;
+}
+
+static void aurora_release_drivers(void)
+{
+#ifdef AURORA_DEBUG
+printk("aurora_release_drivers: start\n");
+#endif
+	free_page((unsigned long)tmp_buf);
+	tty_unregister_driver(&aurora_driver);
+#ifdef AURORA_DEBUG
+printk("aurora_release_drivers: end\n");
+#endif
+}
+
+#ifndef MODULE
+/*
+ * Called at boot time.
+ *
+ * You can specify IO base for up to RC_NBOARD cards,
+ * using line "riscom8=0xiobase1,0xiobase2,.." at LILO prompt.
+ * Note that there will be no probing at default
+ * addresses in this case.
+ *
+ */
+__init_func(void aurora_setup(char *str, int *ints))
+{
+	int i;
+
+	for(i=0;(i<ints[0])&&(i<4);i++) {
+		if (ints[i+1]) irqs[i]=ints[i+1];
+		}
+}
+
+__init_func(int aurora_init(void))
+#else
+int aurora_init(void)
+#endif
+{
+int found;
+int grrr,i;
+
+printk(KERN_INFO "aurora: Driver starting.\n");
+if(aurora_init_drivers())return -EIO;
+found=aurora_probe();
+if(!found){
+  aurora_release_drivers();
+  printk(KERN_INFO "aurora: No Aurora Multiport boards detected.\n");
+  return -EIO;
+  } else {
+  printk(KERN_INFO "aurora: %d boards found.\n",found);
+  }
+for(i=0;i<found;i++){
+	if ((grrr = aurora_setup_board(&aurora_board[i]))) {
+		#ifdef AURORA_DEBUG
+		printk(KERN_ERR "aurora_init: error aurora_setup_board ret %d\n",grrr);
+		#endif
+		return grrr;
+	}
+}
+return 0;
+}
+
+#ifdef MODULE
+int irq  = 0;
+int irq1 = 0;
+int irq2 = 0;
+int irq3 = 0;
+MODULE_PARM(irq , "i");
+MODULE_PARM(irq1, "i");
+MODULE_PARM(irq2, "i");
+MODULE_PARM(irq3, "i");
+
+int init_module(void) 
+{
+	if (irq ) irqs[0]=irq ;
+	if (irq1) irqs[1]=irq1;
+	if (irq2) irqs[2]=irq2;
+	if (irq3) irqs[3]=irq3;
+	return aurora_init();
+}
+	
+void cleanup_module(void)
+{
+	int i;
+	
+#ifdef AURORA_DEBUG
+printk("cleanup_module: aurora_release_drivers\n");
+#endif;
+
+	aurora_release_drivers();
+	for (i = 0; i < AURORA_NBOARD; i++)
+		if (aurora_board[i].flags & AURORA_BOARD_PRESENT) {
+			aurora_shutdown_board(&aurora_board[i]);
+			aurora_release_io_range(&aurora_board[i]);
+		}
+}
+#endif /* MODULE */
diff -urN linux-2.2.10-pre2/drivers/sbus/char/aurora.h linux-2.2.10-pre3/drivers/sbus/char/aurora.h
--- linux-2.2.10-pre2/drivers/sbus/char/aurora.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.2.10-pre3/drivers/sbus/char/aurora.h	2003-08-15 15:06:27.000000000 -0700
@@ -0,0 +1,278 @@
+/*
+ *	linux/drivers/sbus/char/aurora.h -- Aurora multiport driver
+ *
+ *	Copyright (c) 1999 by Oliver Aldulea (oli@bv.ro)
+ *
+ *	This code is based on the RISCom/8 multiport serial driver written
+ *	by Dmitry Gorodchanin (pgmdsg@ibi.com), based on the Linux serial
+ *	driver, written by Linus Torvalds, Theodore T'so and others.
+ *	The Aurora multiport programming info was obtained mainly from the
+ *	Cirrus Logic CD180 documentation (available on the web), and by
+ *	doing heavy tests on the board. Many thanks to Eddie C. Dost for the
+ *	help on the sbus interface.
+ *
+ *	This program is free software; you can redistribute it and/or modify
+ *	it under the terms of the GNU General Public License as published by
+ *	the Free Software Foundation; either version 2 of the License, or
+ *	(at your option) any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU General Public License for more details.
+ *
+ *	You should have received a copy of the GNU General Public License
+ *	along with this program; if not, write to the Free Software
+ *	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *	Revision 1.0
+ *
+ *	This is the first public release.
+ *
+ *	This version needs a lot of feedback. This is the version that works
+ *	with _my_ board. My board is model 1600se, revision '@(#)1600se.fth
+ *	1.2 3/28/95 1'. The driver might work with your board, but I do not
+ *	guarantee it. If you have _any_ type of board, I need to know if the
+ *	driver works or not, I need to know exactly your board parameters
+ *	(get them with 'cd /proc/openprom/iommu/sbus/sio16/; ls *; cat *')
+ *	Also, I need your board revision code, which is written on the board.
+ *	Send me the output of my driver too (it outputs through klogd).
+ *
+ *	If the driver does not work, you can try enabling the debug options
+ *	to see what's wrong or what should be done.
+ *
+ *	I'm sorry about the alignment of the code. It was written in a
+ *	128x48 environment.
+ *
+ *	I must say that I do not like Aurora Technologies' policy. I asked
+ *	them to help me do this driver faster, but they ended by something
+ *	like "don't call us, we'll call you", and I never heard anything
+ *	from them. They told me "knowing the way the board works, I don't
+ *	doubt you and others on the net will make the driver."
+ *	The truth about this board is that it has nothing intelligent on it.
+ *	If you want to say to somebody what kind of board you have, say that
+ *	it uses Cirrus Logic processors (CD180). The power of the board is
+ *	in those two chips. The rest of the board is the interface to the
+ *	sbus and to the peripherals. Still, they did something smart: they
+ *	reversed DTR and RTS to make on-board automatic hardware flow
+ *	control usable.
+ *	Thanks to Aurora Technologies for wasting my time, nerves and money.
+ */
+
+#ifndef __LINUX_AURORA_H
+#define __LINUX_AURORA_H
+
+#include <linux/serial.h>
+
+#ifdef __KERNEL__
+
+/* This is the number of boards to support. I've only tested this driver with
+ * one board, so it might not work.
+ */
+#define AURORA_NBOARD 1
+
+/* Useful ? Yes. But you can safely comment the warnings if they annoy you
+ * (let me say that again: the warnings in the code, not this define). 
+ */
+#define AURORA_PARANOIA_CHECK
+
+/* Well, after many lost nights, I found that the IRQ for this board is
+ * selected from four built-in values by writing some bits in the
+ * configuration register. This causes a little problem to occur: which
+ * IRQ to select ? Which one is the best for the user ? Well, I finally
+ * decided for the following algorithm: if the "bintr" value is not acceptable
+ * (not within type_1_irq[], then test the "intr" value, if that fails too,
+ * try each value from type_1_irq until succeded. Hope it's ok.
+ * You can safely reorder the irq's.
+ */
+#define TYPE_1_IRQS 4
+unsigned char type_1_irq[TYPE_1_IRQS] = {
+	3, 5, 9, 13
+	};
+/* I know something about another method of interrupt setting, but not enough.
+ * Also, this is for another type of board, so I first have to learn how to
+ * detect it.
+#define TYPE_2_IRQS 3
+unsigned char type_2_irq[TYPE_2_IRQS] = {
+	0, 0, 0 ** could anyone find these for me ? (see AURORA_ALLIRQ below) **
+	};
+unsigned char type_2_mask[TYPE_2_IRQS] = {
+	32, 64, 128
+	};
+*/
+
+/* The following section should only be modified by those who know what
+ * they're doing (or don't, but want to help with some feedback). Modifying
+ * anything raises a _big_ probability for your system to hang, but the
+ * sacrifice worths. (I sacrificed my ext2fs many, many times...)
+ */
+
+/* This one tries to dump to console the name of almost every function called,
+ * and many other debugging info.
+ */
+#undef AURORA_DEBUG
+
+/* These are the most dangerous and useful defines. They do printk() during
+ * the interrupt processing routine(s), so if you manage to get "flooded" by
+ * irq's, start thinking about the "Power off/on" button...
+ */
+#undef AURORA_INTNORM	/* This one enables the "normal" messages, but some
+			 * of them cause flood, so I preffered putting
+			 * them under a define */
+#undef AURORA_INT_DEBUG /* This one is really bad. */
+
+/* Here's something helpful: after n irq's, the board will be disabled. This
+ * prevents irq flooding during debug (no need to think about power
+ * off/on anymore...)
+ */
+#define AURORA_FLOODPRO	10
+
+/* This one helps finding which irq the board calls, in case of a strange/
+ * unsupported board. AURORA_INT_DEBUG should be enabled, because I don't
+ * think /proc/interrupts or any command will be available in case of an irq
+ * flood... "allirq" is the list of all free irq's.
+ */
+/*
+#define AURORA_ALLIRQ 6
+int allirq[AURORA_ALLIRQ]={
+	2,3,5,7,9,13
+	};
+*/
+
+/* These must not be modified. These values are assumed during the code for
+ * performance optimisations.
+ */
+#define AURORA_NCD180 2 /* two chips per board */
+#define AURORA_NPORT 8  /* 8 ports per chip */
+
+/* several utilities */
+#define AURORA_BOARD(line)	(((line) >> 4) & 0x01)
+#define AURORA_CD180(line)	(((line) >> 3) & 0x01)
+#define AURORA_PORT(line)	((line) & 15)
+
+#define AURORA_TNPORTS (AURORA_NBOARD*AURORA_NCD180*AURORA_NPORT)
+
+/* Ticks per sec. Used for setting receiver timeout and break length */
+#define AURORA_TPS		4000
+
+#define AURORA_MAGIC	0x0A18
+
+/* Yeah, after heavy testing I decided it must be 6.
+ * Sure, You can change it if needed.
+ */
+#define AURORA_RXFIFO		6	/* Max. receiver FIFO size (1-8) */
+
+#define AURORA_RXTH		7
+
+struct aurora_reg1 {
+	__volatile__ unsigned char r;
+	};
+
+struct aurora_reg128 {
+	__volatile__ unsigned char r[128];
+	};
+	
+struct aurora_reg4 {
+	__volatile__ unsigned char r[4];
+	};
+
+struct Aurora_board {
+	unsigned long		flags;
+	struct aurora_reg1	* r0;	/* This is the board configuration
+					 * register (write-only). */
+	struct aurora_reg128	* r[2];	/* These are the registers for the
+					 * two chips. */
+	struct aurora_reg4	* r3;	/* These are used for hardware-based
+					 * acknowledge. Software-based ack is
+					 * not supported by CD180. */
+	unsigned int		oscfreq; /* The on-board oscillator
+					  * frequency, in Hz. */
+	unsigned char		irq;
+#ifdef MODULE
+	signed char		count;	/* counts the use of the board */
+#endif
+	/* Values for the dtr_rts swapped mode. */
+	unsigned char		DTR;
+	unsigned char		RTS;
+	unsigned char		MSVDTR;
+	unsigned char		MSVRTS;
+	/* Values for hardware acknowledge. */
+	unsigned char		ACK_MINT,ACK_TINT,ACK_RINT;
+};
+
+/* Board configuration register */
+#define AURORA_CFG_ENABLE_IO	8
+#define AURORA_CFG_ENABLE_IRQ	4
+
+/* Board flags */
+#define AURORA_BOARD_PRESENT		0x00000001
+#define AURORA_BOARD_ACTIVE		0x00000002
+#define AURORA_BOARD_TYPE_2		0x00000004	/* don't know how to
+							 * detect this yet */
+#define AURORA_BOARD_DTR_FLOW_OK	0x00000008
+
+/* The story goes like this: Cirrus programmed the CD-180 chip to do automatic
+ * hardware flow control, and do it using CTS and DTR. CTS is ok, but, if you
+ * have a modem and the chip drops DTR, then the modem will drop the carrier
+ * (ain't that cute...). Luckily, the guys at Aurora decided to swap DTR and
+ * RTS, which makes the flow control usable. I hope that all the boards made
+ * by Aurora have these two signals swapped. If your's doesn't but you have a
+ * breakout box, you can try to reverse them yourself, then set the following
+ * flag.
+ */
+#undef AURORA_FORCE_DTR_FLOW
+
+/* In fact, a few more words have to be said about hardware flow control.
+ * This driver handles "output" flow control through the on-board facility
+ * CTS Auto Enable. For the "input" flow control there are two cases when
+ * the flow should be controlled. The first case is when the kernel is so
+ * busy that it cannot process IRQ's in time; this flow control can only be
+ * activated by the on-board chip, and if the board has RTS and DTR swapped,
+ * this facility is usable. The second case is when the application is so
+ * busy that it cannot receive bytes from the kernel, and this flow must be
+ * activated by software. This second case is not yet implemented in this
+ * driver. Unfortunately, I estimate that the second case is the one that
+ * occurs the most.
+ */
+
+
+struct Aurora_port {
+	int			magic;
+	int			baud_base;
+	int			flags;
+	struct tty_struct 	* tty;
+	int			count;
+	int			blocked_open;
+	int			event;
+	int			timeout;
+	int			close_delay;
+	long			session;
+	long			pgrp;
+	unsigned char 		* xmit_buf;
+	int			custom_divisor;
+	int			xmit_head;
+	int			xmit_tail;
+	int			xmit_cnt;
+	struct termios          normal_termios;
+	struct wait_queue	*open_wait;
+	struct wait_queue	*close_wait;
+	struct tq_struct	tqueue;
+	struct tq_struct	tqueue_hangup;
+	short			wakeup_chars;
+	short			break_length;
+	unsigned short		closing_wait;
+	unsigned char		mark_mask;
+	unsigned char		SRER;
+	unsigned char		MSVR;
+	unsigned char		COR2;
+#ifdef AURORA_REPORT_OVERRUN
+	unsigned long		overrun;
+#endif	
+#ifdef AURORA_REPORT_FIFO
+	unsigned long		hits[10];
+#endif
+};
+
+#endif
+#endif /*__LINUX_AURORA_H*/
+
diff -urN linux-2.2.10-pre2/drivers/sbus/char/cd180.h linux-2.2.10-pre3/drivers/sbus/char/cd180.h
--- linux-2.2.10-pre2/drivers/sbus/char/cd180.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.2.10-pre3/drivers/sbus/char/cd180.h	2003-08-15 15:06:27.000000000 -0700
@@ -0,0 +1,240 @@
+
+/* Definitions for Cirrus Logic CL-CD180 8-port async mux chip */
+#define CD180_NCH       8       /* Total number of channels                */
+#define CD180_TPC       16      /* Ticks per character                     */
+#define CD180_NFIFO	8	/* TX FIFO size                            */
+
+/* Global registers */
+#define CD180_GFRCR	0x6b	/* Global Firmware Revision Code Register  */
+#define CD180_SRCR	0x66	/* Service Request Configuration Register  */
+#define CD180_PPRH	0x70	/* Prescaler Period Register High	   */
+#define CD180_PPRL	0x71	/* Prescaler Period Register Low	   */
+#define CD180_MSMR	0x61	/* Modem Service Match Register		   */
+#define CD180_TSMR	0x62	/* Transmit Service Match Register	   */
+#define CD180_RSMR	0x63	/* Receive Service Match Register	   */
+#define CD180_GSVR	0x40	/* Global Service Vector Register	   */
+#define CD180_SRSR	0x65	/* Service Request Status Register	   */
+#define CD180_GSCR	0x41	/* Global Service Channel Register	   */
+#define CD180_CAR	0x64	/* Channel Access Register		   */
+
+/* Indexed registers */
+#define CD180_RDCR	0x07	/* Receive Data Count Register		   */
+#define CD180_RDR	0x78	/* Receiver Data Register		   */
+#define CD180_RCSR	0x7a	/* Receiver Character Status Register	   */
+#define CD180_TDR	0x7b	/* Transmit Data Register		   */
+#define CD180_EOSRR	0x7f	/* End of Service Request Register	   */
+
+/* Channel Registers */
+#define CD180_SRER      0x02    /* Service Request Enable Register         */
+#define CD180_CCR       0x01    /* Channel Command Register                */
+#define CD180_COR1      0x03    /* Channel Option Register 1               */
+#define CD180_COR2      0x04    /* Channel Option Register 2               */
+#define CD180_COR3      0x05    /* Channel Option Register 3               */
+#define CD180_CCSR      0x06    /* Channel Control Status Register         */
+#define CD180_RTPR      0x18    /* Receive Timeout Period Register         */
+#define CD180_RBPRH     0x31    /* Receive Bit Rate Period Register High  */
+#define CD180_RBPRL     0x32    /* Receive Bit Rate Period Register Low   */
+#define CD180_TBPRH     0x39    /* Transmit Bit Rate Period Register High */
+#define CD180_TBPRL     0x3a    /* Transmit Bit Rate Period Register Low  */
+#define CD180_SCHR1     0x09    /* Special Character Register 1            */
+#define CD180_SCHR2     0x0a    /* Special Character Register 2            */
+#define CD180_SCHR3     0x0b    /* Special Character Register 3            */
+#define CD180_SCHR4     0x0c    /* Special Character Register 4            */
+#define CD180_MCR       0x12    /* Modem Change Register                   */
+#define CD180_MCOR1     0x10    /* Modem Change Option 1 Register          */
+#define CD180_MCOR2     0x11    /* Modem Change Option 2 Register          */
+#define CD180_MSVR      0x28    /* Modem Signal Value Register             */
+#define CD180_MSVRTS    0x29    /* Modem Signal Value RTS                  */
+#define CD180_MSVDTR    0x2a    /* Modem Signal Value DTR                  */
+
+/* Global Interrupt Vector Register (R/W) */
+
+#define GSVR_ITMASK     0x07     /* Interrupt type mask                     */
+#define  GSVR_IT_MDM     0x01    /* Modem Signal Change Interrupt           */
+#define  GSVR_IT_TX      0x02    /* Transmit Data Interrupt                 */
+#define  GSVR_IT_RGD     0x03    /* Receive Good Data Interrupt             */
+#define  GSVR_IT_REXC    0x07    /* Receive Exception Interrupt             */
+
+
+/* Global Interrupt Channel Register (R/W) */
+ 
+#define GSCR_CHAN       0x1c    /* Channel Number Mask                     */
+#define GSCR_CHAN_OFF   2       /* Channel Number Offset                   */
+
+
+/* Channel Address Register (R/W) */
+
+#define CAR_CHAN        0x07    /* Channel Number Mask                     */
+
+
+/* Receive Character Status Register (R/O) */
+
+#define RCSR_TOUT       0x80    /* Rx Timeout                              */
+#define RCSR_SCDET      0x70    /* Special Character Detected Mask         */
+#define  RCSR_NO_SC      0x00   /* No Special Characters Detected          */
+#define  RCSR_SC_1       0x10   /* Special Char 1 (or 1 & 3) Detected      */
+#define  RCSR_SC_2       0x20   /* Special Char 2 (or 2 & 4) Detected      */
+#define  RCSR_SC_3       0x30   /* Special Char 3 Detected                 */
+#define  RCSR_SC_4       0x40   /* Special Char 4 Detected                 */
+#define RCSR_BREAK      0x08    /* Break has been detected                 */
+#define RCSR_PE         0x04    /* Parity Error                            */
+#define RCSR_FE         0x02    /* Frame Error                             */
+#define RCSR_OE         0x01    /* Overrun Error                           */
+
+
+/* Channel Command Register (R/W) (commands in groups can be OR-ed) */
+
+#define CCR_HARDRESET   0x81    /* Reset the chip                          */
+
+#define CCR_SOFTRESET   0x80    /* Soft Channel Reset                      */
+
+#define CCR_CORCHG1     0x42    /* Channel Option Register 1 Changed       */
+#define CCR_CORCHG2     0x44    /* Channel Option Register 2 Changed       */
+#define CCR_CORCHG3     0x48    /* Channel Option Register 3 Changed       */
+
+#define CCR_SSCH1       0x21    /* Send Special Character 1                */
+
+#define CCR_SSCH2       0x22    /* Send Special Character 2                */
+
+#define CCR_SSCH3       0x23    /* Send Special Character 3                */
+
+#define CCR_SSCH4       0x24    /* Send Special Character 4                */
+
+#define CCR_TXEN        0x18    /* Enable Transmitter                      */
+#define CCR_RXEN        0x12    /* Enable Receiver                         */
+
+#define CCR_TXDIS       0x14    /* Disable Transmitter                     */
+#define CCR_RXDIS       0x11    /* Disable Receiver                        */
+
+
+/* Service Request Enable Register (R/W) */
+
+#define SRER_DSR         0x80    /* Enable interrupt on DSR change          */
+#define SRER_CD          0x40    /* Enable interrupt on CD change           */
+#define SRER_CTS         0x20    /* Enable interrupt on CTS change          */
+#define SRER_RXD         0x10    /* Enable interrupt on Receive Data        */
+#define SRER_RXSC        0x08    /* Enable interrupt on Receive Spec. Char  */
+#define SRER_TXRDY       0x04    /* Enable interrupt on TX FIFO empty       */
+#define SRER_TXEMPTY     0x02    /* Enable interrupt on TX completely empty */
+#define SRER_RET         0x01    /* Enable interrupt on RX Exc. Timeout     */
+
+
+/* Channel Option Register 1 (R/W) */
+
+#define COR1_ODDP       0x80    /* Odd Parity                              */
+#define COR1_PARMODE    0x60    /* Parity Mode mask                        */
+#define  COR1_NOPAR      0x00   /* No Parity                               */
+#define  COR1_FORCEPAR   0x20   /* Force Parity                            */
+#define  COR1_NORMPAR    0x40   /* Normal Parity                           */
+#define COR1_IGNORE     0x10    /* Ignore Parity on RX                     */
+#define COR1_STOPBITS   0x0c    /* Number of Stop Bits                     */
+#define  COR1_1SB        0x00   /* 1 Stop Bit                              */
+#define  COR1_15SB       0x04   /* 1.5 Stop Bits                           */
+#define  COR1_2SB        0x08   /* 2 Stop Bits                             */
+#define COR1_CHARLEN    0x03    /* Character Length                        */
+#define  COR1_5BITS      0x00   /* 5 bits                                  */
+#define  COR1_6BITS      0x01   /* 6 bits                                  */
+#define  COR1_7BITS      0x02   /* 7 bits                                  */
+#define  COR1_8BITS      0x03   /* 8 bits                                  */
+
+
+/* Channel Option Register 2 (R/W) */
+
+#define COR2_IXM        0x80    /* Implied XON mode                        */
+#define COR2_TXIBE      0x40    /* Enable In-Band (XON/XOFF) Flow Control  */
+#define COR2_ETC        0x20    /* Embedded Tx Commands Enable             */
+#define COR2_LLM        0x10    /* Local Loopback Mode                     */
+#define COR2_RLM        0x08    /* Remote Loopback Mode                    */
+#define COR2_RTSAO      0x04    /* RTS Automatic Output Enable             */
+#define COR2_CTSAE      0x02    /* CTS Automatic Enable                    */
+#define COR2_DSRAE      0x01    /* DSR Automatic Enable                    */
+
+
+/* Channel Option Register 3 (R/W) */
+
+#define COR3_XONCH      0x80    /* XON is a pair of characters (1 & 3)     */
+#define COR3_XOFFCH     0x40    /* XOFF is a pair of characters (2 & 4)    */
+#define COR3_FCT        0x20    /* Flow-Control Transparency Mode          */
+#define COR3_SCDE       0x10    /* Special Character Detection Enable      */
+#define COR3_RXTH       0x0f    /* RX FIFO Threshold value (1-8)           */
+
+
+/* Channel Control Status Register (R/O) */
+
+#define CCSR_RXEN       0x80    /* Receiver Enabled                        */
+#define CCSR_RXFLOFF    0x40    /* Receive Flow Off (XOFF was sent)        */
+#define CCSR_RXFLON     0x20    /* Receive Flow On (XON was sent)          */
+#define CCSR_TXEN       0x08    /* Transmitter Enabled                     */
+#define CCSR_TXFLOFF    0x04    /* Transmit Flow Off (got XOFF)            */
+#define CCSR_TXFLON     0x02    /* Transmit Flow On (got XON)              */
+
+
+/* Modem Change Option Register 1 (R/W) */
+
+#define MCOR1_DSRZD     0x80    /* Detect 0->1 transition of DSR           */
+#define MCOR1_CDZD      0x40    /* Detect 0->1 transition of CD            */
+#define MCOR1_CTSZD     0x20    /* Detect 0->1 transition of CTS           */
+#define MCOR1_DTRTH     0x0f    /* Auto DTR flow control Threshold (1-8)   */
+#define  MCOR1_NODTRFC   0x0     /* Automatic DTR flow control disabled     */
+
+
+/* Modem Change Option Register 2 (R/W) */
+
+#define MCOR2_DSROD     0x80    /* Detect 1->0 transition of DSR           */
+#define MCOR2_CDOD      0x40    /* Detect 1->0 transition of CD            */
+#define MCOR2_CTSOD     0x20    /* Detect 1->0 transition of CTS           */
+
+
+/* Modem Change Register (R/W) */
+
+#define MCR_DSRCHG      0x80    /* DSR Changed                             */
+#define MCR_CDCHG       0x40    /* CD Changed                              */
+#define MCR_CTSCHG      0x20    /* CTS Changed                             */
+
+
+/* Modem Signal Value Register (R/W) */
+
+#define MSVR_DSR        0x80    /* Current state of DSR input              */
+#define MSVR_CD         0x40    /* Current state of CD input               */
+#define MSVR_CTS        0x20    /* Current state of CTS input              */
+#define MSVR_DTR        0x02    /* Current state of DTR output             */
+#define MSVR_RTS        0x01    /* Current state of RTS output             */
+
+
+/* Service Request Status Register */
+
+#define SRSR_CMASK	0xC0	/* Current Service Context Mask            */
+#define  SRSR_CNONE	0x00	/* Not in a service context		   */
+#define  SRSR_CRX	0x40	/* Rx Context				   */
+#define  SRSR_CTX	0x80	/* Tx Context				   */
+#define  SRSR_CMDM	0xC0	/* Modem Context			   */
+#define SRSR_ANYINT	0x6F	/* Any interrupt flag			   */
+#define SRSR_RINT	0x10	/* Receive Interrupt			   */
+#define SRSR_TINT	0x04	/* Transmit Interrupt			   */
+#define SRSR_MINT	0x01	/* Modem Interrupt			   */
+#define SRSR_REXT	0x20	/* Receive External Interrupt		   */
+#define SRSR_TEXT	0x08	/* Transmit External Interrupt		   */
+#define SRSR_MEXT	0x02	/* Modem External Interrupt		   */
+
+
+/* Service Request Configuration Register */
+
+#define SRCR_PKGTYPE    0x80
+#define SRCR_REGACKEN   0x40
+#define SRCR_DAISYEN    0x20
+#define SRCR_GLOBPRI    0x10
+#define SRCR_UNFAIR     0x08
+#define SRCR_AUTOPRI    0x02
+#define SRCR_PRISEL     0x01
+
+/* Values for register-based Interrupt ACKs */
+#define CD180_ACK_MINT	0x75	/* goes to MSMR				   */
+#define CD180_ACK_TINT	0x76	/* goes to TSMR				   */
+#define CD180_ACK_RINT	0x77	/* goes to RSMR				   */
+
+/* Escape characters */
+
+#define CD180_C_ESC     0x00    /* Escape character                        */
+#define CD180_C_SBRK    0x81    /* Start sending BREAK                     */
+#define CD180_C_DELAY   0x82    /* Delay output                            */
+#define CD180_C_EBRK    0x83    /* Stop sending BREAK                      */
diff -urN linux-2.2.10-pre2/drivers/sbus/char/Config.in linux-2.2.10-pre3/drivers/sbus/char/Config.in
--- linux-2.2.10-pre2/drivers/sbus/char/Config.in	1998-10-04 10:22:44.000000000 -0700
+++ linux-2.2.10-pre3/drivers/sbus/char/Config.in	2003-08-15 15:06:27.000000000 -0700
@@ -11,4 +11,5 @@
 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
   tristate 'Bidirectional parallel port support (EXPERIMENTAL)' CONFIG_SUN_BPP
   tristate 'Videopix Frame Grabber (EXPERIMENTAL)' CONFIG_SUN_VIDEOPIX
+  tristate 'Aurora Multiboard 1600se (EXPERIMENTAL)' CONFIG_SUN_AURORA
 fi
diff -urN linux-2.2.10-pre2/drivers/sbus/char/Makefile linux-2.2.10-pre3/drivers/sbus/char/Makefile
--- linux-2.2.10-pre2/drivers/sbus/char/Makefile	1998-11-16 10:37:28.000000000 -0800
+++ linux-2.2.10-pre3/drivers/sbus/char/Makefile	2003-08-15 15:06:27.000000000 -0700
@@ -87,6 +87,14 @@
   endif
 endif
 
+ifeq ($(CONFIG_SUN_AURORA),y)
+O_OBJS += aurora.o
+else
+  ifeq ($(CONFIG_SUN_AURORA),m)
+  M_OBJS += aurora.o
+  endif
+endif
+
 include $(TOPDIR)/Rules.make
 
 sunkbdmap.o: sunkeymap.c
diff -urN linux-2.2.10-pre2/drivers/sbus/sbus.c linux-2.2.10-pre3/drivers/sbus/sbus.c
--- linux-2.2.10-pre2/drivers/sbus/sbus.c	1999-03-15 16:11:30.000000000 -0800
+++ linux-2.2.10-pre3/drivers/sbus/sbus.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,4 +1,4 @@
-/* $Id: sbus.c,v 1.76 1998/12/17 11:11:26 davem Exp $
+/* $Id: sbus.c,v 1.76.2.1 1999/05/29 06:17:26 davem Exp $
  * sbus.c:  SBus support routines.
  *
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -207,6 +207,9 @@
 #ifdef CONFIG_OBP_FLASH
 extern int flash_init(void);
 #endif
+#ifdef CONFIG_SUN_AURORA
+extern int aurora_init(void);
+#endif
 
 __initfunc(static void
 sbus_do_child_siblings(int start_node, struct linux_sbus_device *child,
@@ -441,6 +444,9 @@
 #ifdef CONFIG_OBP_FLASH
 	flash_init();
 #endif
+#ifdef CONFIG_SUN_AURORA
+	aurora_init();
+#endif
 #ifdef __sparc_v9__
 	if (sparc_cpu_model == sun4u) {
 		extern void clock_probe(void);
diff -urN linux-2.2.10-pre2/drivers/scsi/scsi.c linux-2.2.10-pre3/drivers/scsi/scsi.c
--- linux-2.2.10-pre2/drivers/scsi/scsi.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/drivers/scsi/scsi.c	2003-08-15 15:06:27.000000000 -0700
@@ -263,6 +263,7 @@
 {"HP", "C1790A", "", BLIST_NOLUN},              /* scanjet iip */
 {"HP", "C2500A", "", BLIST_NOLUN},              /* scanjet iicx */
 {"YAMAHA", "CDR102", "1.00", BLIST_NOLUN},	/* extra reset */
+{"RELISYS", "Scorpio", "*", BLIST_NOLUN},	/* responds to all LUN */
 
 /*
  * Other types of devices that have special flags.
diff -urN linux-2.2.10-pre2/drivers/sound/sound_core.c linux-2.2.10-pre3/drivers/sound/sound_core.c
--- linux-2.2.10-pre2/drivers/sound/sound_core.c	1999-03-07 15:22:06.000000000 -0800
+++ linux-2.2.10-pre3/drivers/sound/sound_core.c	2003-08-15 15:06:27.000000000 -0700
@@ -52,6 +52,22 @@
 	struct sound_unit *next;
 };
 
+#ifdef CONFIG_SOUND_SONICVIBES
+extern int init_sonicvibes(void);
+#endif
+#ifdef CONFIG_SOUND_ES1370
+extern int init_es1370(void);
+#endif
+#ifdef CONFIG_SOUND_ES1371
+extern int init_es1371(void);
+#endif
+#ifdef CONFIG_SOUND_MSNDCLAS
+extern int msnd_classic_init(void);
+#endif
+#ifdef CONFIG_SOUND_MSNDPIN
+extern int msnd_pinnacle_init(void);
+#endif
+
 /*
  *	Low level list operator. Scan the ordered list, find a hole and
  *	join into it. Called with the lock asserted
@@ -132,7 +148,7 @@
  *	This lock guards the sound loader list.
  */
 
-static spinlock_t sound_loader_lock = SPIN_LOCK_UNLOCKED;
+spinlock_t sound_loader_lock = SPIN_LOCK_UNLOCKED;
 
 /*
  *	Allocate the controlling structure and add it to the sound driver
diff -urN linux-2.2.10-pre2/fs/coda/psdev.c linux-2.2.10-pre3/fs/coda/psdev.c
--- linux-2.2.10-pre2/fs/coda/psdev.c	1999-01-07 13:40:57.000000000 -0800
+++ linux-2.2.10-pre3/fs/coda/psdev.c	2003-08-15 15:06:27.000000000 -0700
@@ -2,7 +2,7 @@
  *      	An implementation of a loadable kernel mode driver providing
  *		multiple kernel/user space bidirectional communications links.
  *
- * 		Author: 	Alan Cox <alan@cymru.net>
+ * 		Author: 	Alan Cox <alan@redhat.com>
  *
  *		This program is free software; you can redistribute it and/or
  *		modify it under the terms of the GNU General Public License
diff -urN linux-2.2.10-pre2/fs/ncpfs/file.c linux-2.2.10-pre3/fs/ncpfs/file.c
--- linux-2.2.10-pre2/fs/ncpfs/file.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/fs/ncpfs/file.c	2003-08-15 15:06:27.000000000 -0700
@@ -21,7 +21,7 @@
 #include <linux/ncp_fs.h>
 #include "ncplib_kernel.h"
 
-static inline int min(int a, int b)
+static inline unsigned int min(unsigned int a, unsigned int b)
 {
 	return a < b ? a : b;
 }
@@ -99,9 +99,10 @@
 	struct inode *inode = dentry->d_inode;
 	size_t already_read = 0;
 	off_t pos;
-	int bufsize, error;
+	size_t bufsize;
+	int error;
 	void* freepage;
-	int freelen;
+	size_t freelen;
 
 	DPRINTK(KERN_DEBUG "ncp_file_read: enter %s/%s\n",
 		dentry->d_parent->d_name.name, dentry->d_name.name);
@@ -121,10 +122,12 @@
 		goto out;
 	}
 
-	pos = file->f_pos;
+	pos = *ppos;
+/* leave it out on server ...
 	if (pos + count > inode->i_size) {
 		count = inode->i_size - pos;
 	}
+*/
 	error = 0;
 	if (!count)	/* size_t is never < 0 */
 		goto out;
@@ -146,7 +149,7 @@
 	/* First read in as much as possible for each bufsize. */
 	while (already_read < count) {
 		int read_this_time;
-		int to_read = min(bufsize - (pos % bufsize),
+		size_t to_read = min(bufsize - (pos % bufsize),
 				  count - already_read);
 
 		error = ncp_read_bounce(NCP_SERVER(inode),
@@ -162,13 +165,13 @@
 		buf += read_this_time;
 		already_read += read_this_time;
 
-		if (read_this_time < to_read) {
+		if (read_this_time != to_read) {
 			break;
 		}
 	}
 	kfree(freepage);
 
-	file->f_pos = pos;
+	*ppos = pos;
 
 	if (!IS_RDONLY(inode)) {
 		inode->i_atime = CURRENT_TIME;
@@ -187,7 +190,8 @@
 	struct inode *inode = dentry->d_inode;
 	size_t already_written = 0;
 	off_t pos;
-	int bufsize, errno;
+	size_t bufsize;
+	int errno;
 	void* bouncebuffer;
 
 	DPRINTK(KERN_DEBUG "ncp_file_write: enter %s/%s\n",
@@ -213,7 +217,7 @@
 		printk(KERN_ERR "ncp_file_write: open failed, error=%d\n", errno);
 		return errno;
 	}
-	pos = file->f_pos;
+	pos = *ppos;
 
 	if (file->f_flags & O_APPEND) {
 		pos = inode->i_size;
@@ -227,7 +231,7 @@
 		return -EIO;	/* -ENOMEM */
 	while (already_written < count) {
 		int written_this_time;
-		int to_write = min(bufsize - (pos % bufsize),
+		size_t to_write = min(bufsize - (pos % bufsize),
 				   count - already_written);
 
 		if (copy_from_user(bouncebuffer, buf, to_write)) {
@@ -244,14 +248,14 @@
 		buf += written_this_time;
 		already_written += written_this_time;
 
-		if (written_this_time < to_write) {
+		if (written_this_time != to_write) {
 			break;
 		}
 	}
 	kfree(bouncebuffer);
 	inode->i_mtime = inode->i_atime = CURRENT_TIME;
 	
-	file->f_pos = pos;
+	*ppos = pos;
 
 	if (pos > inode->i_size) {
 		inode->i_size = pos;
diff -urN linux-2.2.10-pre2/include/asm-i386/locks.h linux-2.2.10-pre3/include/asm-i386/locks.h
--- linux-2.2.10-pre2/include/asm-i386/locks.h	1999-01-11 10:11:58.000000000 -0800
+++ linux-2.2.10-pre3/include/asm-i386/locks.h	2003-08-15 15:06:27.000000000 -0700
@@ -2,7 +2,7 @@
  *	SMP locks primitives for building ix86 locks
  *	(not yet used).
  *
- *		Alan Cox, alan@cymru.net, 1995
+ *		Alan Cox, alan@redhat.com, 1995
  */
  
 /*
diff -urN linux-2.2.10-pre2/include/asm-ppc/system.h linux-2.2.10-pre3/include/asm-ppc/system.h
--- linux-2.2.10-pre2/include/asm-ppc/system.h	1999-05-11 08:24:32.000000000 -0700
+++ linux-2.2.10-pre3/include/asm-ppc/system.h	2003-08-15 15:06:27.000000000 -0700
@@ -58,7 +58,6 @@
 extern int _disable_interrupts(void);
 extern void _enable_interrupts(int);
 
-extern void instruction_dump(unsigned long *);
 extern void print_backtrace(unsigned long *);
 extern void show_regs(struct pt_regs * regs);
 extern void flush_instruction_cache(void);
@@ -75,6 +74,9 @@
 extern void enable_kernel_fp(void);
 extern void cvt_fd(float *from, double *to, unsigned long *fpscr);
 extern void cvt_df(double *from, float *to, unsigned long *fpscr);
+extern int call_rtas(const char *, int, int, unsigned long *, ...);
+extern void chrp_progress(char *);
+void chrp_event_scan(void);
 
 struct device_node;
 extern void note_scsi_host(struct device_node *, void *);
@@ -89,6 +91,8 @@
 				     struct thread_struct *next,
 				     unsigned long context);
 
+extern unsigned int rtas_data;
+
 struct pt_regs;
 extern void dump_regs(struct pt_regs *);
 
diff -urN linux-2.2.10-pre2/include/linux/if_ether.h linux-2.2.10-pre3/include/linux/if_ether.h
--- linux-2.2.10-pre2/include/linux/if_ether.h	1998-12-16 13:35:50.000000000 -0800
+++ linux-2.2.10-pre3/include/linux/if_ether.h	2003-08-15 15:06:27.000000000 -0700
@@ -9,7 +9,7 @@
  *
  * Author:	Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  *		Donald Becker, <becker@super.org>
- *		Alan Cox, <alan@cymru.net>
+ *		Alan Cox, <alan@redhat.com>
  *		Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
  *
  *		This program is free software; you can redistribute it and/or
diff -urN linux-2.2.10-pre2/include/linux/if_fddi.h linux-2.2.10-pre3/include/linux/if_fddi.h
--- linux-2.2.10-pre2/include/linux/if_fddi.h	1998-05-08 00:08:02.000000000 -0700
+++ linux-2.2.10-pre3/include/linux/if_fddi.h	2003-08-15 15:06:27.000000000 -0700
@@ -12,7 +12,7 @@
  *		if_fddi.h is based on previous if_ether.h and if_tr.h work by
  *			Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  *			Donald Becker, <becker@super.org>
- *			Alan Cox, <alan@cymru.net>
+ *			Alan Cox, <alan@redhat.com>
  *			Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
  *			Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
  *
diff -urN linux-2.2.10-pre2/include/linux/if_hippi.h linux-2.2.10-pre3/include/linux/if_hippi.h
--- linux-2.2.10-pre2/include/linux/if_hippi.h	1999-05-11 10:35:44.000000000 -0700
+++ linux-2.2.10-pre3/include/linux/if_hippi.h	2003-08-15 15:06:27.000000000 -0700
@@ -9,7 +9,7 @@
  *
  * Author:	Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  *		Donald Becker, <becker@super.org>
- *		Alan Cox, <alan@cymru.net>
+ *		Alan Cox, <alan@redhat.com>
  *		Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
  *		Jes Sorensen, <Jes.Sorensen@cern.ch>
  *
diff -urN linux-2.2.10-pre2/include/linux/interrupt.h linux-2.2.10-pre3/include/linux/interrupt.h
--- linux-2.2.10-pre2/include/linux/interrupt.h	1999-05-11 10:35:45.000000000 -0700
+++ linux-2.2.10-pre3/include/linux/interrupt.h	2003-08-15 15:06:27.000000000 -0700
@@ -35,6 +35,7 @@
 	SERIAL_BH,
 	RISCOM8_BH,
 	SPECIALIX_BH,
+	AURORA_BH,
 	ESP_BH,
 	NET_BH,
 	SCSI_BH,
diff -urN linux-2.2.10-pre2/include/linux/lp.h linux-2.2.10-pre3/include/linux/lp.h
--- linux-2.2.10-pre2/include/linux/lp.h	1998-11-27 10:23:11.000000000 -0800
+++ linux-2.2.10-pre3/include/linux/lp.h	2003-08-15 15:06:27.000000000 -0700
@@ -7,12 +7,6 @@
  * Interrupt support added 1993 Nigel Gamble
  */
 
-/* Magic numbers for defining port-device mappings */
-#define LP_PARPORT_UNSPEC -4
-#define LP_PARPORT_AUTO -3
-#define LP_PARPORT_OFF -2
-#define LP_PARPORT_NONE -1
-
 /*
  * Per POSIX guidelines, this module reserves the LP and lp prefixes
  * These are the lp_table[minor].flags flags...
@@ -87,6 +81,14 @@
 #define LP_TIMEOUT_INTERRUPT	(60 * HZ)
 #define LP_TIMEOUT_POLLED	(10 * HZ)
 
+#ifdef __KERNEL__
+
+/* Magic numbers for defining port-device mappings */
+#define LP_PARPORT_UNSPEC -4
+#define LP_PARPORT_AUTO -3
+#define LP_PARPORT_OFF -2
+#define LP_PARPORT_NONE -1
+
 #define LP_F(minor)	lp_table[(minor)].flags		/* flags for busy, etc. */
 #define LP_CHAR(minor)	lp_table[(minor)].chars		/* busy timeout */
 #define LP_TIME(minor)	lp_table[(minor)].time		/* wait time */
@@ -182,3 +184,5 @@
 extern int lp_init(void);
 
 #endif
+
+#endif
diff -urN linux-2.2.10-pre2/include/linux/major.h linux-2.2.10-pre3/include/linux/major.h
--- linux-2.2.10-pre2/include/linux/major.h	1998-10-14 11:43:14.000000000 -0700
+++ linux-2.2.10-pre3/include/linux/major.h	2003-08-15 15:06:27.000000000 -0700
@@ -92,6 +92,8 @@
 #define SPECIALIX_NORMAL_MAJOR 75
 #define SPECIALIX_CALLOUT_MAJOR 76
 
+#define AURORA_MAJOR 79
+
 #define UNIX98_PTY_MASTER_MAJOR	128
 #define UNIX98_PTY_MAJOR_COUNT	8
 #define UNIX98_PTY_SLAVE_MAJOR	(UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT)
diff -urN linux-2.2.10-pre2/include/linux/pci.h linux-2.2.10-pre3/include/linux/pci.h
--- linux-2.2.10-pre2/include/linux/pci.h	1999-05-11 10:35:44.000000000 -0700
+++ linux-2.2.10-pre3/include/linux/pci.h	2003-08-15 15:06:27.000000000 -0700
@@ -273,6 +273,8 @@
 #define PCI_CLASS_SERIAL_USB		0x0c03
 #define PCI_CLASS_SERIAL_FIBER		0x0c04
 
+#define PCI_CLASS_HOT_SWAP_CONTROLLER	0xff00
+
 #define PCI_CLASS_OTHERS		0xff
 
 /*
@@ -365,6 +367,7 @@
 #define PCI_DEVICE_ID_DEC_21150		0x0022
 #define PCI_DEVICE_ID_DEC_21152		0x0024
 #define PCI_DEVICE_ID_DEC_21153		0x0025
+#define PCI_DEVICE_ID_DEC_21154		0x0026
 
 #define PCI_VENDOR_ID_CIRRUS		0x1013
 #define PCI_DEVICE_ID_CIRRUS_7548	0x0038
@@ -510,9 +513,12 @@
 #define PCI_DEVICE_ID_WINBOND2_89C940	0x0940
 
 #define PCI_VENDOR_ID_MOTOROLA		0x1057
+#define PCI_VENDOR_ID_MOTOROLA_OOPS	0x1507
 #define PCI_DEVICE_ID_MOTOROLA_MPC105	0x0001
 #define PCI_DEVICE_ID_MOTOROLA_MPC106	0x0002
 #define PCI_DEVICE_ID_MOTOROLA_RAVEN	0x4801
+#define PCI_DEVICE_ID_MOTOROLA_FALCON	0x4802
+#define PCI_DEVICE_ID_MOTOROLA_CPX8216	0x4806
 
 #define PCI_VENDOR_ID_PROMISE		0x105a
 #define PCI_DEVICE_ID_PROMISE_20246	0x4d33
diff -urN linux-2.2.10-pre2/include/linux/smp.h linux-2.2.10-pre3/include/linux/smp.h
--- linux-2.2.10-pre2/include/linux/smp.h	1999-05-11 10:35:44.000000000 -0700
+++ linux-2.2.10-pre3/include/linux/smp.h	2003-08-15 15:06:27.000000000 -0700
@@ -3,7 +3,7 @@
 
 /*
  *	Generic SMP support
- *		Alan Cox. <alan@cymru.net>
+ *		Alan Cox. <alan@redhat.com>
  */
 
 #ifdef __SMP__
diff -urN linux-2.2.10-pre2/include/net/tcp.h linux-2.2.10-pre3/include/net/tcp.h
--- linux-2.2.10-pre2/include/net/tcp.h	1999-05-13 10:33:17.000000000 -0700
+++ linux-2.2.10-pre3/include/net/tcp.h	2003-08-15 15:06:27.000000000 -0700
@@ -290,7 +290,7 @@
 #define TCP_PROBEWAIT_LEN (1*HZ)/* time to wait between probes when
 				 * I've got something to write and
 				 * there is no window			*/
-#define TCP_KEEPALIVE_TIME (180*60*HZ)		/* two hours */
+#define TCP_KEEPALIVE_TIME (120*60*HZ)		/* two hours */
 #define TCP_KEEPALIVE_PROBES	9		/* Max of 9 keepalive probes	*/
 #define TCP_KEEPALIVE_PERIOD ((75*HZ)>>2)	/* period of keepalive check	*/
 
diff -urN linux-2.2.10-pre2/MAINTAINERS linux-2.2.10-pre3/MAINTAINERS
--- linux-2.2.10-pre2/MAINTAINERS	1999-05-08 12:49:46.000000000 -0700
+++ linux-2.2.10-pre3/MAINTAINERS	2003-08-15 15:06:27.000000000 -0700
@@ -385,6 +385,11 @@
 W:	http://www.rustcorp.com/linux/ipchains
 S:	Supported
 
+IP MASQUERADING:
+P:	Juanjo Ciarlante
+M:	jjciarla@raiz.uncu.edu.ar
+S:	Maintained
+
 IPX/SPX NETWORK LAYER
 P:	Jay Schulist
 M:	Jay Schulist <Jay.Schulist@spacs.k12.wi.us>
diff -urN linux-2.2.10-pre2/net/core/datagram.c linux-2.2.10-pre3/net/core/datagram.c
--- linux-2.2.10-pre2/net/core/datagram.c	1998-10-04 10:19:39.000000000 -0700
+++ linux-2.2.10-pre3/net/core/datagram.c	2003-08-15 15:06:27.000000000 -0700
@@ -6,7 +6,7 @@
  *	This is used because UDP, RAW, PACKET, DDP, IPX, AX.25 and NetROM layer all have identical poll code and mostly
  *	identical recvmsg() code. So we share it here. The poll was shared before but buried in udp.c so I moved it.
  *
- *	Authors:	Alan Cox <alan@cymru.net>. (datagram_poll() from old udp.c code)
+ *	Authors:	Alan Cox <alan@redhat.com>. (datagram_poll() from old udp.c code)
  *
  *	Fixes:
  *		Alan Cox	:	NULL return from skb_peek_copy() understood
diff -urN linux-2.2.10-pre2/net/ipv4/af_inet.c linux-2.2.10-pre3/net/ipv4/af_inet.c
--- linux-2.2.10-pre2/net/ipv4/af_inet.c	1999-04-22 19:45:19.000000000 -0700
+++ linux-2.2.10-pre3/net/ipv4/af_inet.c	2003-08-15 15:06:27.000000000 -0700
@@ -5,7 +5,7 @@
  *
  *		PF_INET protocol family socket handler.
  *
- * Version:	$Id: af_inet.c,v 1.87 1999/04/22 10:07:33 davem Exp $
+ * Version:	$Id: af_inet.c,v 1.87.2.1 1999/05/29 04:32:01 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -147,14 +147,8 @@
 	struct sk_buff *skb;
 
 	/* First the read buffer. */
-	while((skb = skb_dequeue(&sk->receive_queue)) != NULL) {
-		/* This will take care of closing sockets that were
-		 * listening and didn't accept everything.
-		 */
-		if (skb->sk != NULL && skb->sk != sk)
-			skb->sk->prot->close(skb->sk, 0);
+	while((skb = skb_dequeue(&sk->receive_queue)) != NULL)
 		kfree_skb(skb);
-	}
 
 	/* Next, the error queue. */
 	while((skb = skb_dequeue(&sk->error_queue)) != NULL)
@@ -213,12 +207,6 @@
 
 	kill_sk_queues(sk);
 
-	/* Now if it has a half accepted/ closed socket. */
-	if (sk->pair) {
-		sk->pair->prot->close(sk->pair, 0);
-		sk->pair = NULL;
-  	}
-
 	/* Now if everything is gone we can free the socket
 	 * structure, otherwise we need to keep it around until
 	 * everything is gone.
@@ -684,14 +672,8 @@
 	if (sk1->prot->accept == NULL)
 		goto do_err;
 
-	/* Restore the state if we have been interrupted, and then returned. */
-	if (sk1->pair != NULL) {
-		sk2 = sk1->pair;
-		sk1->pair = NULL;
-	} else {
-		if((sk2 = sk1->prot->accept(sk1,flags)) == NULL)
-			goto do_sk1_err;
-	}
+	if((sk2 = sk1->prot->accept(sk1,flags)) == NULL)
+		goto do_sk1_err;
 
 	/*
 	 *	We've been passed an extra socket.
diff -urN linux-2.2.10-pre2/net/ipv4/icmp.c linux-2.2.10-pre3/net/ipv4/icmp.c
--- linux-2.2.10-pre2/net/ipv4/icmp.c	1999-03-21 07:22:00.000000000 -0800
+++ linux-2.2.10-pre3/net/ipv4/icmp.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,7 +1,7 @@
 /*
  *	NET3:	Implementation of the ICMP protocol layer. 
  *	
- *		Alan Cox, <alan@cymru.net>
+ *		Alan Cox, <alan@redhat.com>
  *
  *	Version: $Id: icmp.c,v 1.52 1999/03/21 12:04:11 davem Exp $
  *
diff -urN linux-2.2.10-pre2/net/ipv4/ip_fw.c linux-2.2.10-pre3/net/ipv4/ip_fw.c
--- linux-2.2.10-pre2/net/ipv4/ip_fw.c	1999-04-22 19:45:19.000000000 -0700
+++ linux-2.2.10-pre3/net/ipv4/ip_fw.c	2003-08-15 15:06:27.000000000 -0700
@@ -34,6 +34,9 @@
  *              Marc Santoro <ultima@snicker.emoti.com>
  * 29-Jan-1999: Locally generated bogus IPs dealt with, rather than crash
  *              during dump_packet. --RR.
+ * 19-May-1999: Star Wars: The Phantom Menace opened.  Rule num
+ *		printed in log (modified from Michael Hasenstein's patch).
+ *		Added SYN in log message. --RR
  */
 
 /*
@@ -400,7 +403,9 @@
 			struct ip_fwkernel *f, 
 			const ip_chainlabel chainlabel,
 			__u16 src_port, 
-			__u16 dst_port)
+			__u16 dst_port,
+			unsigned int count,
+			int syn)
 {
 	__u32 *opt = (__u32 *) (ip + 1);
 	int opti;
@@ -432,7 +437,7 @@
 
 	for (opti = 0; opti < (ip->ihl - sizeof(struct iphdr) / 4); opti++)
 		printk(" O=0x%8.8X", *opt++);
-	printk("\n");
+	printk(" %s(#%d)\n", tcpsyn ? "SYN " : /* "PENANCE" */ "", count);
 }
 
 /* function for checking chain labels for user space. */
@@ -520,12 +525,14 @@
 	      const ip_chainlabel label,
 	      struct sk_buff *skb,
 	      unsigned int slot,
-	      __u16 src_port, __u16 dst_port)
+	      __u16 src_port, __u16 dst_port, 
+	      unsigned int count,
+	      int tcpsyn)
 {
 	f->counters[slot].bcnt+=ntohs(ip->tot_len);
 	f->counters[slot].pcnt++;
 	if (f->ipfw.fw_flg & IP_FW_F_PRN) {
-		dump_packet(ip,rif,f,label,src_port,dst_port);
+		dump_packet(ip,rif,f,label,src_port,dst_port,count,syn);
 	}
 	ip->tos = (ip->tos & f->ipfw.fw_tosand) ^ f->ipfw.fw_tosxor;
 
@@ -590,6 +597,7 @@
 	unsigned char		oldtos;
 	struct ip_fwkernel	*f;	
 	int			ret = FW_SKIP+2;
+	unsigned int		count;
 
 	/* We handle fragments by dealing with the first fragment as
 	 * if it was a normal packet.  All other fragments are treated
@@ -610,7 +618,7 @@
 	if (offset == 1 && ip->protocol == IPPROTO_TCP)	{
 		if (!testing && net_ratelimit()) {
 			printk("Suspect TCP fragment.\n");
-			dump_packet(ip,rif,NULL,NULL,0,0);
+			dump_packet(ip,rif,NULL,NULL,0,0,0,0);
 		}
 		return FW_BLOCK;
 	}
@@ -702,13 +710,16 @@
 
 	f = chain->chain;
 	do {
+		count = 0;
 		for (; f; f = f->next) {
+			count++;
 			if (ip_rule_match(f,rif,ip,
 					  tcpsyn,src_port,dst_port,offset)) {
 				if (!testing
 				    && !ip_fw_domatch(f, ip, rif, chain->label,
 						      skb, slot, 
-						      src_port, dst_port)) {
+						      src_port, dst_port,
+						      count, tcpsyn)) {
 					ret = FW_BLOCK;
 					goto out;
 				}
@@ -1408,8 +1419,10 @@
 		else if ((chain = find_label(new->fwc_label)) == NULL)
 			ret = ENOENT;
 		else if ((ip_fwkern = convert_ipfw(&new->fwc_rule, &ret))
-			 != NULL)
+			 != NULL) {
 			ret = del_rule_from_chain(chain, ip_fwkern);
+			kfree(ip_fwkern);
+		}
 	}
 	break;
 
diff -urN linux-2.2.10-pre2/net/ipv4/ipmr.c linux-2.2.10-pre3/net/ipv4/ipmr.c
--- linux-2.2.10-pre2/net/ipv4/ipmr.c	1999-03-25 09:23:34.000000000 -0800
+++ linux-2.2.10-pre3/net/ipv4/ipmr.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,7 +1,7 @@
 /*
  *	IP multicast routing support for mrouted 3.6/3.8
  *
- *		(c) 1995 Alan Cox, <alan@cymru.net>
+ *		(c) 1995 Alan Cox, <alan@redhat.com>
  *	  Linux Consultancy and Custom Driver Development
  *
  *	This program is free software; you can redistribute it and/or
diff -urN linux-2.2.10-pre2/net/ipv4/ip_options.c linux-2.2.10-pre3/net/ipv4/ip_options.c
--- linux-2.2.10-pre2/net/ipv4/ip_options.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/net/ipv4/ip_options.c	2003-08-15 15:06:27.000000000 -0700
@@ -5,7 +5,7 @@
  *
  *		The options processing module for ip.c
  *
- * Version:	$Id: ip_options.c,v 1.16 1999/03/21 05:22:40 davem Exp $
+ * Version:	$Id: ip_options.c,v 1.16.2.1 1999/06/02 04:06:19 davem Exp $
  *
  * Authors:	A.N.Kuznetsov
  *		
diff -urN linux-2.2.10-pre2/net/ipv4/tcp.c linux-2.2.10-pre3/net/ipv4/tcp.c
--- linux-2.2.10-pre2/net/ipv4/tcp.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/net/ipv4/tcp.c	2003-08-15 15:06:27.000000000 -0700
@@ -5,7 +5,7 @@
  *
  *		Implementation of the Transmission Control Protocol(TCP).
  *
- * Version:	$Id: tcp.c,v 1.140 1999/04/22 10:34:31 davem Exp $
+ * Version:	$Id: tcp.c,v 1.140.2.1 1999/05/29 04:16:48 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
diff -urN linux-2.2.10-pre2/net/ipv4/tcp_input.c linux-2.2.10-pre3/net/ipv4/tcp_input.c
--- linux-2.2.10-pre2/net/ipv4/tcp_input.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/net/ipv4/tcp_input.c	2003-08-15 15:06:27.000000000 -0700
@@ -5,7 +5,7 @@
  *
  *		Implementation of the Transmission Control Protocol(TCP).
  *
- * Version:	$Id: tcp_input.c,v 1.165 1999/05/14 23:10:08 davem Exp $
+ * Version:	$Id: tcp_input.c,v 1.164.2.3 1999/06/02 04:15:06 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -1819,7 +1819,7 @@
 		}
 	}
 
-	flg = *(((u32 *)th) + 3) & ~htonl(0x8 << 16);
+	flg = *(((u32 *)th) + 3) & ~htonl(0xFC8 << 16);
 
 	/*	pred_flags is 0xS?10 << 16 + snd_wnd
 	 *	if header_predition is to be made
@@ -2284,8 +2284,8 @@
 	    !(th->fin && TCP_SKB_CB(skb)->end_seq == tp->rcv_nxt)) {
 		if (!th->rst) {
 			tcp_send_ack(sk);
-			goto discard;
 		}
+		goto discard;
 	}
 
 	/* step 2: check RST bit */
diff -urN linux-2.2.10-pre2/net/ipv4/tcp_ipv4.c linux-2.2.10-pre3/net/ipv4/tcp_ipv4.c
--- linux-2.2.10-pre2/net/ipv4/tcp_ipv4.c	1999-05-10 09:55:25.000000000 -0700
+++ linux-2.2.10-pre3/net/ipv4/tcp_ipv4.c	2003-08-15 15:06:27.000000000 -0700
@@ -5,7 +5,7 @@
  *
  *		Implementation of the Transmission Control Protocol(TCP).
  *
- * Version:	$Id: tcp_ipv4.c,v 1.175 1999/05/08 21:09:54 davem Exp $
+ * Version:	$Id: tcp_ipv4.c,v 1.175.2.2 1999/06/02 04:06:15 davem Exp $
  *
  *		IPv4 specific functions
  *
@@ -1328,7 +1328,6 @@
 
 		newsk->done = 0;
 		newsk->proc = 0;
-		newsk->pair = NULL;
 		skb_queue_head_init(&newsk->back_log);
 		skb_queue_head_init(&newsk->error_queue);
 #ifdef CONFIG_FILTER
@@ -1648,6 +1647,7 @@
 	/* Count it even if it's bad */
 	tcp_statistics.TcpInSegs++;
 
+	len = skb->len;
 	if (len < sizeof(struct tcphdr))
 		goto bad_packet;
 
@@ -1674,6 +1674,10 @@
 		/* CHECKSUM_UNNECESSARY */
 	}
 
+	if((th->doff * 4) < sizeof(struct tcphdr) ||
+	   len < (th->doff * 4))
+		goto bad_packet;
+
 #ifdef CONFIG_IP_TRANSPARENT_PROXY
 	if (IPCB(skb)->redirport)
 		sk = tcp_v4_proxy_lookup(th->dest, skb->nh.iph->saddr, th->source,
diff -urN linux-2.2.10-pre2/net/ipv4/tcp_output.c linux-2.2.10-pre3/net/ipv4/tcp_output.c
--- linux-2.2.10-pre2/net/ipv4/tcp_output.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/net/ipv4/tcp_output.c	2003-08-15 15:06:27.000000000 -0700
@@ -5,7 +5,7 @@
  *
  *		Implementation of the Transmission Control Protocol(TCP).
  *
- * Version:	$Id: tcp_output.c,v 1.109 1999/05/14 23:10:13 davem Exp $
+ * Version:	$Id: tcp_output.c,v 1.108.2.1 1999/05/14 23:07:36 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
diff -urN linux-2.2.10-pre2/net/ipv4/tcp_timer.c linux-2.2.10-pre3/net/ipv4/tcp_timer.c
--- linux-2.2.10-pre2/net/ipv4/tcp_timer.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/net/ipv4/tcp_timer.c	2003-08-15 15:06:27.000000000 -0700
@@ -5,7 +5,7 @@
  *
  *		Implementation of the Transmission Control Protocol(TCP).
  *
- * Version:	$Id: tcp_timer.c,v 1.63 1999/05/15 23:02:21 davem Exp $
+ * Version:	$Id: tcp_timer.c,v 1.62.2.2 1999/06/02 04:06:21 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -537,7 +537,8 @@
 					conn = req;
 					req = req->dl_next;
 
-					if (conn->sk) {
+					if (conn->sk ||
+					    ((long)(now - conn->expires)) <= 0) {
 						prev = conn; 
 						continue; 
 					}
diff -urN linux-2.2.10-pre2/net/ipv6/tcp_ipv6.c linux-2.2.10-pre3/net/ipv6/tcp_ipv6.c
--- linux-2.2.10-pre2/net/ipv6/tcp_ipv6.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/net/ipv6/tcp_ipv6.c	2003-08-15 15:06:27.000000000 -0700
@@ -5,7 +5,7 @@
  *	Authors:
  *	Pedro Roque		<roque@di.fc.ul.pt>	
  *
- *	$Id: tcp_ipv6.c,v 1.104 1999/04/24 00:27:25 davem Exp $
+ *	$Id: tcp_ipv6.c,v 1.104.2.2 1999/06/02 04:06:27 davem Exp $
  *
  *	Based on: 
  *	linux/net/ipv4/tcp.c
@@ -1362,6 +1362,7 @@
 
 	tcp_statistics.TcpInSegs++;
 
+	len = skb->len;
 	if (len < sizeof(struct tcphdr))
 		goto bad_packet;
 
@@ -1383,6 +1384,10 @@
 		/* CHECKSUM_UNNECESSARY */
 	};
 
+	if((th->doff * 4) < sizeof(struct tcphdr) ||
+	   len < (th->doff * 4))
+		goto bad_packet;
+
 	sk = __tcp_v6_lookup(th, saddr, th->source, daddr, th->dest, tcp_v6_iif(skb));
 
 	if (!sk)
diff -urN linux-2.2.10-pre2/net/netlink/af_netlink.c linux-2.2.10-pre3/net/netlink/af_netlink.c
--- linux-2.2.10-pre2/net/netlink/af_netlink.c	2003-08-15 15:06:27.000000000 -0700
+++ linux-2.2.10-pre3/net/netlink/af_netlink.c	2003-08-15 15:06:27.000000000 -0700
@@ -1,7 +1,7 @@
 /*
  * NETLINK      Kernel-user communication protocol.
  *
- * 		Authors:	Alan Cox <alan@cymru.net>
+ * 		Authors:	Alan Cox <alan@redhat.com>
  * 				Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
  *
  *		This program is free software; you can redistribute it and/or
diff -urN linux-2.2.10-pre2/net/netlink/netlink_dev.c linux-2.2.10-pre3/net/netlink/netlink_dev.c
--- linux-2.2.10-pre2/net/netlink/netlink_dev.c	1998-08-27 19:33:09.000000000 -0700
+++ linux-2.2.10-pre3/net/netlink/netlink_dev.c	2003-08-15 15:06:27.000000000 -0700
@@ -2,7 +2,7 @@
  * NETLINK	An implementation of a loadable kernel mode driver providing
  *		multiple kernel/user space bidirectional communications links.
  *
- * 		Author: 	Alan Cox <alan@cymru.net>
+ * 		Author: 	Alan Cox <alan@redhat.com>
  *
  *		This program is free software; you can redistribute it and/or
  *		modify it under the terms of the GNU General Public License
