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

diff -urN linux-2.2.13-pre10/arch/alpha/config.in linux-2.2.13-pre11/arch/alpha/config.in
--- linux-2.2.13-pre10/arch/alpha/config.in	1999-05-22 13:41:37.000000000 -0700
+++ linux-2.2.13-pre11/arch/alpha/config.in	2003-08-15 15:07:59.000000000 -0700
@@ -33,6 +33,7 @@
 	 EB64+			CONFIG_ALPHA_EB64P		\
 	 EB66			CONFIG_ALPHA_EB66		\
 	 EB66+			CONFIG_ALPHA_EB66P		\
+	 Eiger			CONFIG_ALPHA_EIGER		\
 	 Jensen			CONFIG_ALPHA_JENSEN		\
 	 LX164			CONFIG_ALPHA_LX164		\
 	 Miata			CONFIG_ALPHA_MIATA		\
@@ -117,7 +118,7 @@
 	define_bool CONFIG_ALPHA_EV5 y
 	define_bool CONFIG_ALPHA_PYXIS y
 fi
-if [ "$CONFIG_ALPHA_DP264" = "y" ]
+if [ "$CONFIG_ALPHA_DP264" = "y" -o "$CONFIG_ALPHA_EIGER" = "y" ]
 then
 	define_bool CONFIG_PCI y
 	define_bool CONFIG_ALPHA_EV6 y
@@ -147,7 +148,8 @@
 	-o "$CONFIG_ALPHA_SABLE" = "y" -o "$CONFIG_ALPHA_MIATA" = "y" \
 	-o "$CONFIG_ALPHA_NORITAKE" = "y" -o "$CONFIG_ALPHA_PC164" = "y" \
 	-o "$CONFIG_ALPHA_LX164" = "y" -o "$CONFIG_ALPHA_SX164" = "y" \
-	-o "$CONFIG_ALPHA_DP264" = "y" -o "$CONFIG_ALPHA_RAWHIDE" = "y" ]
+	-o "$CONFIG_ALPHA_DP264" = "y" -o "$CONFIG_ALPHA_RAWHIDE" = "y" \
+	-o "$CONFIG_ALPHA_EIGER" = "y" ]
 then
   bool 'Use SRM as bootloader' CONFIG_ALPHA_SRM
   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
diff -urN linux-2.2.13-pre10/arch/alpha/kernel/alpha_ksyms.c linux-2.2.13-pre11/arch/alpha/kernel/alpha_ksyms.c
--- linux-2.2.13-pre10/arch/alpha/kernel/alpha_ksyms.c	2003-08-15 15:07:59.000000000 -0700
+++ linux-2.2.13-pre11/arch/alpha/kernel/alpha_ksyms.c	2003-08-15 15:07:59.000000000 -0700
@@ -30,6 +30,7 @@
 #include <asm/machvec.h>
 #include <asm/pgtable.h>
 #include <asm/semaphore.h>
+#include <asm/delay.h>
 
 #define __KERNEL_SYSCALLS__
 #include <asm/unistd.h>
@@ -98,6 +99,7 @@
 EXPORT_SYMBOL(__memset);
 EXPORT_SYMBOL(__memsetw);
 EXPORT_SYMBOL(__constant_c_memset);
+EXPORT_SYMBOL(___delay);
 
 EXPORT_SYMBOL(dump_thread);
 EXPORT_SYMBOL(dump_fpu);
diff -urN linux-2.2.13-pre10/arch/alpha/kernel/bios32.c linux-2.2.13-pre11/arch/alpha/kernel/bios32.c
--- linux-2.2.13-pre10/arch/alpha/kernel/bios32.c	1998-12-01 09:33:59.000000000 -0800
+++ linux-2.2.13-pre11/arch/alpha/kernel/bios32.c	2003-08-15 15:07:59.000000000 -0700
@@ -639,11 +639,11 @@
 				/* Bypass hi reg in the loop.  */
 				dev->base_address[++idx] = 0;
 
-				printk("bios32 WARNING: "
-				       "handling 64-bit device in "
-				       "slot %d, function %d: \n",
-				       PCI_SLOT(dev->devfn),
-				       PCI_FUNC(dev->devfn));
+				DBG_DEVS(("bios32 WARNING: "
+					  "handling 64-bit device in "
+					  "slot %d, function %d: \n",
+					  PCI_SLOT(dev->devfn),
+					  PCI_FUNC(dev->devfn)));
 			}
 
 			DBG_DEVS(("layout_dev: dev 0x%x MEM @ 0x%lx (0x%x)\n",
diff -urN linux-2.2.13-pre10/arch/alpha/kernel/head.S linux-2.2.13-pre11/arch/alpha/kernel/head.S
--- linux-2.2.13-pre10/arch/alpha/kernel/head.S	1999-06-12 11:52:52.000000000 -0700
+++ linux-2.2.13-pre11/arch/alpha/kernel/head.S	2003-08-15 15:07:59.000000000 -0700
@@ -95,3 +95,21 @@
 	.prologue 0
 	call_pal PAL_halt
 	.end	halt
+
+	#
+	# Having the delay loop out of line guarantees that we wont
+	# run into weird alignment conditions (on new processors)
+	# that vary the speed of the loop.
+	#
+	.align 5
+	.globl	___delay
+	.ent	___delay
+___delay:
+	.set noat
+	.frame	$30,0,$28,0
+	.prologue 0
+1:	subq	$0,1,$0
+	bge	$0,1b
+	ret	$31,($28),0
+	.set at
+	.end	___delay
diff -urN linux-2.2.13-pre10/arch/alpha/kernel/Makefile linux-2.2.13-pre11/arch/alpha/kernel/Makefile
--- linux-2.2.13-pre10/arch/alpha/kernel/Makefile	1999-08-09 12:04:38.000000000 -0700
+++ linux-2.2.13-pre11/arch/alpha/kernel/Makefile	2003-08-15 15:07:59.000000000 -0700
@@ -64,7 +64,7 @@
 ifneq ($(CONFIG_ALPHA_CABRIOLET)$(CONFIG_ALPHA_EB164)$(CONFIG_ALPHA_EB66P)$(CONFIG_ALPHA_LX164)$(CONFIG_ALPHA_PC164),)
 O_OBJS   += sys_cabriolet.o
 endif
-ifdef CONFIG_ALPHA_DP264
+ifneq ($(CONFIG_ALPHA_DP264)$(CONFIG_ALPHA_EIGER),)
 O_OBJS   += sys_dp264.o
 endif
 ifneq ($(CONFIG_ALPHA_EB64P)$(CONFIG_ALPHA_EB66),)
diff -urN linux-2.2.13-pre10/arch/alpha/kernel/process.c linux-2.2.13-pre11/arch/alpha/kernel/process.c
--- linux-2.2.13-pre10/arch/alpha/kernel/process.c	1999-08-25 17:29:45.000000000 -0700
+++ linux-2.2.13-pre11/arch/alpha/kernel/process.c	2003-08-15 15:07:59.000000000 -0700
@@ -117,58 +117,46 @@
 	}
 }
 
-void
-generic_kill_arch (int mode, char *restart_cmd)
-{
-	/* The following currently only has any effect on SRM.  We should
-	   fix MILO to understand it.  Should be pretty easy.  Also we can
-	   support RESTART2 via the ipc_buffer machinations pictured below,
-	   which SRM ignores.  */
+struct halt_info {
+	int	mode;
+	char *	restart_cmd;
+};
+
+static void
+halt_processor(void * generic_ptr)
+{
+	struct percpu_struct * cpup;
+	struct halt_info * how = (struct halt_info *)generic_ptr;
+	unsigned long *flags, dummy = 0;
+	int cpuid = smp_processor_id();
+
+	/* No point in taking interrupts anymore. */
+	cli();
 
 	if (alpha_using_srm) {
-		struct percpu_struct *cpup;
-		unsigned long flags;
-	
 		cpup = (struct percpu_struct *)
-		  ((unsigned long)hwrpb + hwrpb->processor_offset);
-
-		flags = cpup->flags;
-
-		/* Clear reason to "default"; clear "bootstrap in progress". */
-		flags &= ~0x00ff0001UL;
-
-		if (mode == LINUX_REBOOT_CMD_RESTART) {
-			if (!restart_cmd) {
-				flags |= 0x00020000UL; /* "cold bootstrap" */
-				cpup->ipc_buffer[0] = 0;
-			} else {
-				flags |=  0x00030000UL; /* "warm bootstrap" */
-				strncpy((char *)cpup->ipc_buffer, restart_cmd,
-					sizeof(cpup->ipc_buffer));
-			}
-		} else {
-			flags |=  0x00040000UL; /* "remain halted" */
-		}
-			
-		cpup->flags = flags;					       
-		mb();						
+			((unsigned long)hwrpb + hwrpb->processor_offset
+			 + hwrpb->processor_size * cpuid);
+		flags = &cpup->flags;
+	} else
+		flags = &dummy;
 
-		reset_for_srm();
-		set_hae(srm_hae);
+	/* Clear reason to "default"; clear "bootstrap in progress". */
+	*flags &= ~0x00ff0001UL;
 
-#ifdef CONFIG_DUMMY_CONSOLE
-		/* This has the effect of reseting the VGA video origin.  */
-		take_over_console(&dummy_con, 0, MAX_NR_CONSOLES-1, 1);
-#endif
+#ifdef __SMP__
+	/* Secondaries halt here. */
+	if (cpuid != smp_boot_cpuid) {
+		*flags |= 0x00040000UL;
+		clear_bit(cpuid, &cpu_present_mask);
+		halt();
 	}
-
+#endif /* __SMP__ */
 #ifdef CONFIG_RTC
 	/* Reset rtc to defaults.  */
 	{
 		unsigned char control;
 
-		cli();
-
 		/* Reset periodic interrupt frequency.  */
 		CMOS_WRITE(0x26, RTC_FREQ_SELECT);
 
@@ -177,22 +165,53 @@
 		control |= RTC_PIE;
 		CMOS_WRITE(control, RTC_CONTROL);	
 		CMOS_READ(RTC_INTR_FLAGS);
-
-		sti();
 	}
-#endif
+#endif /* CONFIG_RTC */
+	if (alpha_using_srm) {
+		if (how->mode == LINUX_REBOOT_CMD_RESTART) {
+			if (!how->restart_cmd) {
+				*flags |= 0x00020000UL; /* "cold bootstrap" */
+				cpup->ipc_buffer[0] = 0;
+			} else {
+				*flags |=  0x00030000UL; /* "warm bootstrap" */
+				strncpy((char *)cpup->ipc_buffer,
+					how->restart_cmd,
+					sizeof(cpup->ipc_buffer));
+			}
+		} else
+			*flags |=  0x00040000UL; /* "remain halted" */
 
-	if (!alpha_using_srm && mode != LINUX_REBOOT_CMD_RESTART) {
-		/* Unfortunately, since MILO doesn't currently understand
-		   the hwrpb bits above, we can't reliably halt the 
-		   processor and keep it halted.  So just loop.  */
-		return;
+		reset_for_srm();
+		set_hae(srm_hae);
+
+#ifdef CONFIG_DUMMY_CONSOLE
+		/* This has the effect of reseting the VGA video origin.  */
+		take_over_console(&dummy_con, 0, MAX_NR_CONSOLES-1, 1);
+#endif
+#ifdef __SMP__
+		/* Wait for the secondaries to halt. */
+		clear_bit(smp_boot_cpuid, &cpu_present_mask);
+		while (cpu_present_mask)
+			/* Make sure we sample memory and not a register. */
+			barrier();
+#endif /* __SMP__ */
 	}
+	/* PRIMARY */
+	halt();
+}
 
-	if (alpha_using_srm)
-		srm_paging_stop();
+void
+generic_kill_arch(int mode, char * restart_cmd)
+{
+	struct halt_info copy_of_args;
 
-	halt();
+	copy_of_args.mode = mode;
+	copy_of_args.restart_cmd = restart_cmd;
+#ifdef __SMP__
+	/* A secondary can't wait here for the primary to finish, can it now? */
+	smp_call_function(halt_processor, (void *)&copy_of_args, 1, 0);
+#endif /* __SMP__ */
+	halt_processor(&copy_of_args);
 }
 
 void
diff -urN linux-2.2.13-pre10/arch/alpha/kernel/proto.h linux-2.2.13-pre11/arch/alpha/kernel/proto.h
--- linux-2.2.13-pre10/arch/alpha/kernel/proto.h	1999-08-09 12:05:05.000000000 -0700
+++ linux-2.2.13-pre11/arch/alpha/kernel/proto.h	2003-08-15 15:07:59.000000000 -0700
@@ -153,6 +153,7 @@
 extern void handle_ipi(struct pt_regs *);
 extern void smp_percpu_timer_interrupt(struct pt_regs *);
 extern int smp_boot_cpuid;
+extern unsigned long cpu_present_mask;
 
 /* bios32.c */
 extern void reset_for_srm(void);
diff -urN linux-2.2.13-pre10/arch/alpha/kernel/setup.c linux-2.2.13-pre11/arch/alpha/kernel/setup.c
--- linux-2.2.13-pre10/arch/alpha/kernel/setup.c	1999-08-25 17:29:45.000000000 -0700
+++ linux-2.2.13-pre11/arch/alpha/kernel/setup.c	2003-08-15 15:07:59.000000000 -0700
@@ -112,6 +112,7 @@
 WEAK(eb64p_mv);
 WEAK(eb66_mv);
 WEAK(eb66p_mv);
+WEAK(eiger_mv);
 WEAK(jensen_mv);
 WEAK(lx164_mv);
 WEAK(miata_mv);
@@ -358,7 +359,7 @@
 	"Mikasa", "EB64", "EB66", "EB64+", "AlphaBook1",
 	"Rawhide", "K2", "Lynx", "XL", "EB164", "Noritake",
 	"Cortex", "29", "Miata", "XXM", "Takara", "Yukon",
-	"Tsunami", "Wildfire", "CUSCO"
+	"Tsunami", "Wildfire", "CUSCO", "Eiger"
 };
 
 static char unofficial_names[][8] = {"100", "Ruffian"};
@@ -429,6 +430,7 @@
 		NULL,		/* Tsunami -- see variation.  */
 		NULL,		/* Wildfire */
 		NULL,		/* CUSCO */
+		&eiger_mv,	/* Eiger */
 	};
 
 	static struct alpha_machine_vector *unofficial_vecs[] __initlocaldata =
@@ -558,6 +560,7 @@
 		&eb64p_mv,
 		&eb66_mv,
 		&eb66p_mv,
+		&eiger_mv,
 		&jensen_mv,
 		&lx164_mv,
 		&miata_mv,
diff -urN linux-2.2.13-pre10/arch/alpha/kernel/sys_dp264.c linux-2.2.13-pre11/arch/alpha/kernel/sys_dp264.c
--- linux-2.2.13-pre10/arch/alpha/kernel/sys_dp264.c	1999-08-09 12:04:38.000000000 -0700
+++ linux-2.2.13-pre11/arch/alpha/kernel/sys_dp264.c	2003-08-15 15:07:59.000000000 -0700
@@ -93,6 +93,24 @@
 }
 
 static void
+eiger_update_irq_hw(unsigned long irq, unsigned long mask, int unmask_p)
+{
+	if (irq >= 16) {
+		volatile unsigned long *csr;
+
+		csr = &TSUNAMI_cchip->dim0.csr;
+		
+		*csr = ~mask;
+		mb();
+		*csr;
+	}
+	else if (irq >= 8)
+		outb(mask >> 8, 0xA1);	/* ISA PIC2 */
+	else
+		outb(mask, 0x21);	/* ISA PIC1 */
+}
+
+static void
 dp264_device_interrupt(unsigned long vector, struct pt_regs * regs)
 {
 #if 1
@@ -169,6 +187,21 @@
 	handle_irq(irq, ack, regs);
 }
 
+static void 
+eiger_srm_device_interrupt(unsigned long vector, struct pt_regs * regs)
+{
+	int irq, ack;
+
+	ack = irq = (vector - 0x800) >> 4;
+
+	/* This is just like TAKARA rather than like the other TSUNAMIs. */
+	/* ??? Is this really correct??? */
+	if (irq > 15)     
+		ack = irq = ((vector - 0x800) >> 6) + 12;   
+
+	handle_irq(irq, ack, regs);
+}
+
 static void __init
 dp264_init_irq(void)
 {
@@ -203,6 +236,25 @@
 	enable_irq(2);
 }
 
+static void __init
+eiger_init_irq(void)
+{
+	outb(0, DMA1_RESET_REG);
+	outb(0, DMA2_RESET_REG);
+	outb(DMA_MODE_CASCADE, DMA2_MODE_REG);
+	outb(0, DMA2_MASK_REG);
+
+	if (alpha_using_srm)
+		alpha_mv.device_interrupt = eiger_srm_device_interrupt;
+
+	eiger_update_irq_hw(16, alpha_irq_mask, 0);
+
+#if 0
+        enable_irq(55);     /* Enable ISA interrupt controller.  */
+#endif
+	enable_irq(2);
+}
+
 
 /*
  * PCI Fixup configuration.
@@ -402,7 +454,6 @@
 {
 	layout_all_busses(DEFAULT_IO_BASE, DEFAULT_MEM_BASE);
 	common_pci_fixup(webbrick_map_irq, common_swizzle);
-	SMC669_Init(0);
 }
 
 static void __init
@@ -412,6 +463,13 @@
 	common_pci_fixup(clipper_map_irq, common_swizzle);
 }
 
+static void __init
+eiger_pci_fixup(void)
+{
+	layout_all_busses(DEFAULT_IO_BASE, DEFAULT_MEM_BASE);
+	common_pci_fixup(monet_map_irq, monet_swizzle);
+}
+
 
 /*
  * The System Vectors
@@ -505,6 +563,29 @@
 	pci_fixup:		clipper_pci_fixup,
 	kill_arch:		generic_kill_arch,
 };
-
 /* No alpha_mv alias for webbrick/monet/clipper, since we compile them
    in unconditionally with DP264; setup_arch knows how to cope.  */
+
+struct alpha_machine_vector eiger_mv __initmv = {
+	vector_name:		"Eiger",
+	DO_EV6_MMU,
+	DO_DEFAULT_RTC,
+	DO_TSUNAMI_IO,
+	DO_TSUNAMI_BUS,
+	machine_check:		tsunami_machine_check,
+	max_dma_address:	ALPHA_MAX_DMA_ADDRESS,
+
+	nr_irqs:		64,
+	irq_probe_mask:		_PROBE_MASK(64),
+	update_irq_hw:		eiger_update_irq_hw,
+	ack_irq:		generic_ack_irq,
+	device_interrupt:	dp264_device_interrupt,
+
+	init_arch:		tsunami_init_arch,
+	init_irq:		eiger_init_irq,
+	init_pit:		generic_init_pit,
+	pci_fixup:		eiger_pci_fixup,
+	kill_arch:		generic_kill_arch,
+};
+ALIAS_MV(eiger)
+
diff -urN linux-2.2.13-pre10/arch/alpha/kernel/sys_takara.c linux-2.2.13-pre11/arch/alpha/kernel/sys_takara.c
--- linux-2.2.13-pre10/arch/alpha/kernel/sys_takara.c	1999-06-12 11:52:52.000000000 -0700
+++ linux-2.2.13-pre11/arch/alpha/kernel/sys_takara.c	2003-08-15 15:07:59.000000000 -0700
@@ -42,7 +42,7 @@
 			outb(mask >> 8, 0xA1);	/* ISA PIC2 */
 	} else if (irq <= 31) {
 		regaddr = 0x510 + ((irq - 16) & 0x0c);
-		outl((mask >> ((irq - 16) & 0x0c)) & 0xf0000Ul, regaddr);
+		outl((mask >> ((irq - 16) & 0x0c)) & 0x000f0000UL, regaddr);
 	}
 }
 
@@ -101,8 +101,7 @@
 
 	if (alpha_using_srm)
 		alpha_mv.device_interrupt = takara_srm_device_interrupt;
-
-	if (!alpha_using_srm) {
+	else {
 		unsigned int ctlreg = inl(0x500);
 
 		/* Return to non-accelerated mode.  */
@@ -129,7 +128,7 @@
 static int __init
 takara_map_irq(struct pci_dev *dev, int slot, int pin)
 {
-	static char irq_tab[15][5] __initlocaldata = {
+	static char arc_irq_tab[15][5] __initlocaldata = {
 		{ 16+3, 16+3, 16+3, 16+3, 16+3},   /* slot  6 == device 3 */
 		{ 16+2, 16+2, 16+2, 16+2, 16+2},   /* slot  7 == device 2 */
 		{ 16+1, 16+1, 16+1, 16+1, 16+1},   /* slot  8 == device 1 */
@@ -146,8 +145,32 @@
 		{ 16+2, 16+2, 16+2, 16+2, 16+2},   /* slot 19 == device 2 */
 		{ 16+1, 16+1, 16+1, 16+1, 16+1},   /* slot 20 == device 1 */
 	};
+	static char srm_irq_tab[15][5] __initlocaldata = {
+		{ 16+3, 16+3, 16+3, 16+3, 16+3},   /* slot  6 == device 3 */
+		{ 16+2, 16+2, 16+2, 16+2, 16+2},   /* slot  7 == device 2 */
+		{ 16+1, 16+1, 16+1, 16+1, 16+1},   /* slot  8 == device 1 */
+		{   -1,   -1,   -1,   -1,   -1},   /* slot  9 == nothing */
+		{   -1,   -1,   -1,   -1,   -1},   /* slot 10 == nothing */
+		{   -1,   -1,   -1,   -1,   -1},   /* slot 11 == nothing */
+		{   -1,   -1,   -1,   -1,   -1},   /* slot 12 == nothing */
+		{   -1,   -1,   -1,   -1,   -1},   /* slot 13 == nothing */
+		{   -1,   -1,   -1,   -1,   -1},   /* slot 14 == nothing */
+		{   -1,   -1,   -1,   -1,   -1},   /* slot 15 == nothing */
+		{   -1,   -1,   -1,   -1,   -1},   /* slot 16 == nothing */
+		{16+12,16+12,16+13,16+14,16+15},   /* slot 17= device 4 */
+		{16+ 8, 16+8, 16+9,16+10,16+11},   /* slot 18= device 3 */
+		{16+ 4, 16+4, 16+5, 16+6, 16+7},   /* slot 19= device 2 */
+		{16+ 0, 16+0, 16+1, 16+2, 16+3},   /* slot 20= device 1 */
+	};
 	const long min_idsel = 6, max_idsel = 20, irqs_per_slot = 5;
-	return COMMON_TABLE_LOOKUP;
+
+	if (slot >= min_idsel && slot <= max_idsel && pin < irqs_per_slot) {
+		if (alpha_using_srm)
+			return srm_irq_tab[slot - min_idsel][pin];
+		else
+			return arc_irq_tab[slot - min_idsel][pin];
+	} else
+		return -1;
 }
 
 static int __init
@@ -159,14 +182,18 @@
 	unsigned int busslot = PCI_SLOT(dev->bus->self->devfn);
 
 	/* Check first for built-in bridges.  */
-	if (busslot > 16 && ((1<<(36-busslot)) & ctlreg)) {
+	if (busslot > 16 && ((1U << (36 - busslot)) & ctlreg)) {
 		if (pin == 1)
 			pin += (20 - busslot);
 		else {
-			/* Must be a card-based bridge.  */
-			printk(KERN_WARNING "takara_swizzle: cannot handle "
-			       "card-bridge behind builtin bridge yet.\n");
+			/* Can only handle INTA pins currently.  */
+			printk(KERN_WARNING "takara_swizzle: cannot only "
+			       "handle cards with INTA IRQ pin now.\n");
 		}
+	} else {
+		/* Must be a card-based bridge.  */
+		printk(KERN_WARNING "takara_swizzle: cannot handle "
+		       "card-bridge behind builtin bridge yet.\n");
 	}
 
 	*pinp = pin;
@@ -178,7 +205,7 @@
 {
 	layout_all_busses(DEFAULT_IO_BASE, DEFAULT_MEM_BASE);
 	common_pci_fixup(takara_map_irq, takara_swizzle);
-	/* enable_ide(0x26e); */
+	enable_ide(0x26e);
 }
 
 
@@ -195,8 +222,8 @@
 	machine_check:		cia_machine_check,
 	max_dma_address:	ALPHA_MAX_DMA_ADDRESS,
 
-	nr_irqs:		20,
-	irq_probe_mask:		_PROBE_MASK(20),
+	nr_irqs:		32,
+	irq_probe_mask:		_PROBE_MASK(32),
 	update_irq_hw:		takara_update_irq_hw,
 	ack_irq:		generic_ack_irq,
 	device_interrupt:	takara_device_interrupt,
diff -urN linux-2.2.13-pre10/arch/alpha/math-emu/fp-emul.c linux-2.2.13-pre11/arch/alpha/math-emu/fp-emul.c
--- linux-2.2.13-pre10/arch/alpha/math-emu/fp-emul.c	1999-08-25 17:29:45.000000000 -0700
+++ linux-2.2.13-pre11/arch/alpha/math-emu/fp-emul.c	2003-08-15 15:07:59.000000000 -0700
@@ -85,15 +85,15 @@
 
 /* For 128-bit division.  */
 
-__complex__ unsigned long
+void
 udiv128(unsigned long divisor_f0, unsigned long divisor_f1,
-	unsigned long dividend_f0, unsigned long dividend_f1)
+	unsigned long dividend_f0, unsigned long dividend_f1,
+	unsigned long *quot, unsigned long *remd)
 {
 	_FP_FRAC_DECL_2(quo);
 	_FP_FRAC_DECL_2(rem);
 	_FP_FRAC_DECL_2(tmp);
 	unsigned long i, num_bits, bit;
-	__complex__ unsigned long ret;
 
 	_FP_FRAC_SET_2(rem, _FP_ZEROFRAC_2);
 	_FP_FRAC_SET_2(quo, _FP_ZEROFRAC_2);
@@ -139,9 +139,9 @@
 	}
 
 out:
-	__real__ ret = quo_f1;
-	__imag__ ret = rem_f1;
-	return ret;
+	*quot = quo_f1;
+	*remd = rem_f1;
+	return;
 }
 
 /*
diff -urN linux-2.2.13-pre10/arch/alpha/math-emu/sfp-machine.h linux-2.2.13-pre11/arch/alpha/math-emu/sfp-machine.h
--- linux-2.2.13-pre10/arch/alpha/math-emu/sfp-machine.h	1999-08-25 17:29:45.000000000 -0700
+++ linux-2.2.13-pre11/arch/alpha/math-emu/sfp-machine.h	2003-08-15 15:07:59.000000000 -0700
@@ -552,15 +552,17 @@
 	   : "r" ((UDItype)(u)),		\
 	     "r" ((UDItype)(v)))
 
-extern __complex__ unsigned long udiv128(unsigned long, unsigned long,
-					 unsigned long, unsigned long);
-
-#define udiv_qrnnd(q, r, n1, n0, d)	\
-  do {					\
-    __complex__ unsigned long x_;	\
-    x_ = udiv128((n0), (n1), 0, (d));	\
-    (q) = __real__ x_;			\
-    (r) = __imag__ x_;			\
+extern void udiv128(unsigned long, unsigned long,
+		    unsigned long, unsigned long,
+		    unsigned long *,
+		    unsigned long *);
+
+#define udiv_qrnnd(q, r, n1, n0, d)		\
+  do {						\
+    unsigned long xr, xi;			\
+    udiv128((n0), (n1), 0, (d), &xr, &xi);	\
+    (q) = xr; 					\
+    (r) = xi;					\
   } while (0)
 
 #define UDIV_NEEDS_NORMALIZATION 1  
diff -urN linux-2.2.13-pre10/drivers/char/pcwd.c linux-2.2.13-pre11/drivers/char/pcwd.c
--- linux-2.2.13-pre10/drivers/char/pcwd.c	1999-08-25 17:29:47.000000000 -0700
+++ linux-2.2.13-pre11/drivers/char/pcwd.c	2003-08-15 15:08:00.000000000 -0700
@@ -34,6 +34,8 @@
  * 971222       Changed open/close for temperature handling
  *              Michael Meskes <meskes@debian.org>.
  * 980112       Used minor numbers from include/linux/miscdevice.h
+ * 990403       Clear reset status after reading control status register in 
+ *              pcwd_showprevstate(). [Marc Boucher <marc@mbsi.ca>]
  */
 
 #include <linux/module.h>
@@ -177,8 +179,10 @@
 
 	if (revision == PCWD_REVISION_A)
 		initial_status = card_status = inb(current_readport);
-	else
+	else {
 		initial_status = card_status = inb(current_readport + 1);
+		outb_p(0x00, current_readport + 1); /* clear reset status */
+	}
 
 	if (revision == PCWD_REVISION_A) {
 		if (card_status & WD_WDRST)
diff -urN linux-2.2.13-pre10/drivers/char/random.c linux-2.2.13-pre11/drivers/char/random.c
--- linux-2.2.13-pre10/drivers/char/random.c	1998-12-31 12:03:49.000000000 -0800
+++ linux-2.2.13-pre11/drivers/char/random.c	2003-08-15 15:08:00.000000000 -0700
@@ -1698,7 +1698,7 @@
 	if (!rekey_time || (tv.tv_sec - rekey_time) > REKEY_INTERVAL) {
 		rekey_time = tv.tv_sec;
 		/* First three words are overwritten below. */
-		get_random_bytes(&secret+3, sizeof(secret)-12);
+		get_random_bytes(&secret[3], sizeof(secret)-12);
 		count = (tv.tv_sec/REKEY_INTERVAL) << HASH_BITS;
 	}
 
diff -urN linux-2.2.13-pre10/drivers/char/tty_io.c linux-2.2.13-pre11/drivers/char/tty_io.c
--- linux-2.2.13-pre10/drivers/char/tty_io.c	2003-08-15 15:07:59.000000000 -0700
+++ linux-2.2.13-pre11/drivers/char/tty_io.c	2003-08-15 15:08:00.000000000 -0700
@@ -652,7 +652,7 @@
 	struct inode *inode = file->f_dentry->d_inode;
 	
 	up(&inode->i_sem);
-	if (down_interruptible(&inode->i_atomic_write)) {
+	if (down_interruptible(&tty->atomic_write)) {
 		down(&inode->i_sem);
 		return -ERESTARTSYS;
 	}
@@ -682,7 +682,7 @@
 		file->f_dentry->d_inode->i_mtime = CURRENT_TIME;
 		ret = written;
 	}
-	up(&inode->i_atomic_write);
+	up(&tty->atomic_write);
 	down(&inode->i_sem);
 	return ret;
 }
@@ -1939,6 +1939,7 @@
 	tty->tq_hangup.routine = do_tty_hangup;
 	tty->tq_hangup.data = tty;
 	sema_init(&tty->atomic_read, 1);
+	sema_init(&tty->atomic_write, 1);
 }
 
 /*
diff -urN linux-2.2.13-pre10/drivers/net/dmfe.c linux-2.2.13-pre11/drivers/net/dmfe.c
--- linux-2.2.13-pre10/drivers/net/dmfe.c	2003-08-15 15:07:59.000000000 -0700
+++ linux-2.2.13-pre11/drivers/net/dmfe.c	2003-08-15 15:08:00.000000000 -0700
@@ -47,16 +47,8 @@
  */
 
 #include <linux/config.h>
-#ifdef MODULE
-#ifdef MODVERSIONS
-#include <linux/modversions.h>
-#endif
 #include <linux/module.h>
 #include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -69,10 +61,6 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 
-#if LINUX_VERSION_CODE < 0x20155
-#include <linux/bios32.h>
-#endif
-
 #include <linux/delay.h>
 #include <asm/processor.h>
 #include <asm/bitops.h>
@@ -291,7 +279,7 @@
 };
 
 /* function declaration ------------------------------------- */
-static int dmfe_reg_board(struct device *);
+int dmfe_reg_board(struct device *);
 static int dmfe_open(struct device *);
 static int dmfe_start_xmit(struct sk_buff *, struct device *);
 static int dmfe_stop(struct device *);
diff -urN linux-2.2.13-pre10/drivers/net/ibmtr.c linux-2.2.13-pre11/drivers/net/ibmtr.c
--- linux-2.2.13-pre10/drivers/net/ibmtr.c	1999-06-13 10:48:21.000000000 -0700
+++ linux-2.2.13-pre11/drivers/net/ibmtr.c	2003-08-15 15:08:00.000000000 -0700
@@ -79,6 +79,10 @@
  *
  *	Changes by Tim Hockin (thockin@isunix.it.ilstu.edu) :
  *	+ added spinlocks for SMP sanity (10 March 1999)
+ *
+ *      Changes by Jochen Friedrich to enable RFC1469 Option 2 multicasting
+ *      i.e. using functional address C0 00 00 04 00 00 to transmit and 
+ *      receive multicast packets.
  */
 
 /* change the define of IBMTR_DEBUG_MESSAGES to a nonzero value 
@@ -213,6 +217,7 @@
 static int	tok_close(struct device *dev);
 static int	tok_send_packet(struct sk_buff *skb, struct device *dev);
 static struct net_device_stats * tok_get_stats(struct device *dev);
+static void	tok_set_multicast_list(struct device *dev);
 void		ibmtr_readlog(struct device *dev);
 void		ibmtr_reset_timer(struct timer_list *tmr, struct device *dev);
 int             ibmtr_change_mtu(struct device *dev, int mtu);
@@ -778,7 +783,7 @@
 	dev->stop		= tok_close;
 	dev->hard_start_xmit	= tok_send_packet;
 	dev->get_stats 		= tok_get_stats;
-	dev->set_multicast_list = NULL;
+	dev->set_multicast_list = tok_set_multicast_list;
 	dev->change_mtu         = ibmtr_change_mtu;
 
 #ifndef MODULE
@@ -790,6 +795,43 @@
 }
 
 
+static void tok_set_multicast_list(struct device *dev)
+{
+	struct tok_info *ti=(struct tok_info *)dev->priv;
+	struct dev_mc_list *mclist;
+	unsigned char address[4];
+
+	int i;
+
+	address[0] = address[1] = address[2] = address[3] = 0;
+
+	mclist = dev->mc_list;
+	for (i=0; i< dev->mc_count; i++)
+	{
+		address[0] |= mclist->dmi_addr[2];
+		address[1] |= mclist->dmi_addr[3];
+		address[2] |= mclist->dmi_addr[4];
+		address[3] |= mclist->dmi_addr[5];
+		mclist = mclist->next;
+	}
+	SET_PAGE(ti->srb);
+	for (i=0; i<sizeof(struct srb_set_funct_addr); i++)
+		writeb(0, ti->srb+i);
+
+	writeb(DIR_SET_FUNC_ADDR, 
+               ti->srb + offsetof(struct srb_set_funct_addr, command));
+
+	DPRINTK("Setting functional address: ");
+
+	for (i=0; i<4; i++)
+	{
+		writeb(address[i], 
+		ti->srb + offsetof(struct srb_set_funct_addr, funct_address)+i);
+		printk("%02X ", address[i]);
+	}
+	writeb(CMD_IN_SRB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD);
+	printk("\n");
+}
 
 static int tok_open(struct device *dev)
 {
@@ -1621,12 +1663,10 @@
        	ti->tr_stats.rx_packets++;
 
 	skb->protocol = tr_type_trans(skb,dev);
-
- 	if (IPv4_p){
+ 	if (IPv4_p){ 
 		skb->csum      = chksum;
 		skb->ip_summed = 1;
 	}
-
 	netif_rx(skb);
 }
 
diff -urN linux-2.2.13-pre10/drivers/net/ibmtr.h linux-2.2.13-pre11/drivers/net/ibmtr.h
--- linux-2.2.13-pre10/drivers/net/ibmtr.h	1999-03-16 14:21:52.000000000 -0800
+++ linux-2.2.13-pre11/drivers/net/ibmtr.h	2003-08-15 15:08:00.000000000 -0700
@@ -444,6 +444,6 @@
 	unsigned char reserved1;
 	unsigned char ret_code;
 	unsigned char reserved2[3];
-	__u32 funct_address;
+	unsigned char funct_address[4];
 };
 
diff -urN linux-2.2.13-pre10/drivers/net/net_init.c linux-2.2.13-pre11/drivers/net/net_init.c
--- linux-2.2.13-pre10/drivers/net/net_init.c	1999-08-25 17:29:48.000000000 -0700
+++ linux-2.2.13-pre11/drivers/net/net_init.c	2003-08-15 15:08:00.000000000 -0700
@@ -587,7 +587,7 @@
 	memset(dev->broadcast,0xFF, TR_ALEN);
 
 	/* New-style flags. */
-	dev->flags		= IFF_BROADCAST;
+	dev->flags		= IFF_BROADCAST | IFF_MULTICAST ;
 
 	if (new_device)
 		register_netdevice(dev);
diff -urN linux-2.2.13-pre10/drivers/net/Space.c linux-2.2.13-pre11/drivers/net/Space.c
--- linux-2.2.13-pre10/drivers/net/Space.c	2003-08-15 15:07:59.000000000 -0700
+++ linux-2.2.13-pre11/drivers/net/Space.c	2003-08-15 15:08:00.000000000 -0700
@@ -119,6 +119,7 @@
 extern int tc515_probe(struct device *dev);
 extern int lance_probe(struct device *dev);
 extern int rcpci_probe(struct device *);
+extern int dmfe_reg_board(struct device *);
 
 /* Gigabit Ethernet adapters */
 extern int yellowfin_probe(struct device *dev);
@@ -229,6 +230,9 @@
 #ifdef CONFIG_VIA_RHINE
 	{via_rhine_probe, 0},
 #endif
+#ifdef CONFI_NET_DM9102
+	{dmfe_reg_board, 0},
+#endif	
 	{NULL, 0},
 };
 
diff -urN linux-2.2.13-pre10/drivers/video/dummycon.c linux-2.2.13-pre11/drivers/video/dummycon.c
--- linux-2.2.13-pre10/drivers/video/dummycon.c	1999-05-11 16:30:36.000000000 -0700
+++ linux-2.2.13-pre11/drivers/video/dummycon.c	2003-08-15 15:08:00.000000000 -0700
@@ -25,7 +25,7 @@
 #define DUMMY_ROWS	25
 #endif
 
-__initfunc(static const char *dummycon_startup(void))
+static const char *dummycon_startup(void)
 {
     return "dummy device";
 }
diff -urN linux-2.2.13-pre10/include/asm-alpha/delay.h linux-2.2.13-pre11/include/asm-alpha/delay.h
--- linux-2.2.13-pre10/include/asm-alpha/delay.h	1998-12-29 13:56:15.000000000 -0800
+++ linux-2.2.13-pre11/include/asm-alpha/delay.h	2003-08-15 15:08:00.000000000 -0700
@@ -9,12 +9,22 @@
  * Delay routines, using a pre-computed "loops_per_second" value.
  */
 
+/* We must make the innermost loop external, ie called via "jsr/bsr", so
+   that timings will be consistent accross ALL invocations, which is not
+   the case for a completely inline implementation. */
+
+extern void ___delay(void);
+
 extern __inline__ void
 __delay(unsigned long loops)
 {
-	__asm__ __volatile__(".align 3\n"
-		"1:\tsubq %0,1,%0\n\t"
-		"bge %0,1b": "=r" (loops) : "0" (loops));
+        register unsigned long r0 __asm__("$0") = loops;
+#ifdef MODULE
+        __asm__ __volatile__("lda $28,___delay; jsr $28,($28),0"
+                             : "=r"(r0) : "r"(r0) : "$28");
+#else
+        __asm__ __volatile__("bsr $28,___delay" : "=r"(r0) : "r"(r0) : "$28");
+#endif
 }
 
 /*
diff -urN linux-2.2.13-pre10/include/asm-alpha/hwrpb.h linux-2.2.13-pre11/include/asm-alpha/hwrpb.h
--- linux-2.2.13-pre10/include/asm-alpha/hwrpb.h	1998-10-12 11:40:13.000000000 -0700
+++ linux-2.2.13-pre11/include/asm-alpha/hwrpb.h	2003-08-15 15:08:00.000000000 -0700
@@ -55,6 +55,7 @@
 #define ST_DEC_TSUNAMI		 34	/* Tsunami systype	*/
 #define ST_DEC_WILDFIRE		 35	/* Wildfire systype	*/
 #define ST_DEC_CUSCO		 36	/* CUSCO systype	*/
+#define ST_DEC_EIGER		 37	/* Eiger systype	*/
 
 /* UNOFFICIAL!!! */
 #define ST_UNOFFICIAL_BIAS	100
diff -urN linux-2.2.13-pre10/include/asm-alpha/irq.h linux-2.2.13-pre11/include/asm-alpha/irq.h
--- linux-2.2.13-pre10/include/asm-alpha/irq.h	1999-05-22 13:42:57.000000000 -0700
+++ linux-2.2.13-pre11/include/asm-alpha/irq.h	2003-08-15 15:08:00.000000000 -0700
@@ -27,7 +27,8 @@
 
 #elif defined(CONFIG_ALPHA_EB66)      || \
       defined(CONFIG_ALPHA_EB64P)     || \
-      defined(CONFIG_ALPHA_MIKASA)
+      defined(CONFIG_ALPHA_MIKASA)    || \
+      defined(CONFIG_ALPHA_TAKARA)
 # define NR_IRQS	32
 
 #elif defined(CONFIG_ALPHA_ALCOR)     || \
@@ -42,13 +43,11 @@
       defined(CONFIG_ALPHA_SX164)
 # define NR_IRQS	40
 
-#elif defined(CONFIG_ALPHA_DP264) || \
-      defined(CONFIG_ALPHA_RAWHIDE)
+#elif defined(CONFIG_ALPHA_DP264)     || \
+      defined(CONFIG_ALPHA_RAWHIDE)   || \
+      defined(CONFIG_ALPHA_EIGER)
 # define NR_IRQS	64
 
-#elif defined(CONFIG_ALPHA_TAKARA)
-# define NR_IRQS	20
-
 #else /* everyone else */
 # define NR_IRQS	16
 #endif
diff -urN linux-2.2.13-pre10/include/linux/fs.h linux-2.2.13-pre11/include/linux/fs.h
--- linux-2.2.13-pre10/include/linux/fs.h	2003-08-15 15:07:59.000000000 -0700
+++ linux-2.2.13-pre11/include/linux/fs.h	2003-08-15 15:08:00.000000000 -0700
@@ -22,6 +22,7 @@
 #include <asm/atomic.h>
 #include <linux/bitops.h>
 #include <asm/cache.h>
+#include <linux/stddef.h>	/* just in case the #define NULL previously in here was needed */
 
 struct poll_table_struct;
 
@@ -65,10 +66,6 @@
 #define READA 2		/* read-ahead  - don't block if no resources */
 #define WRITEA 3	/* write-ahead - don't block if no resources */
 
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
 #define NIL_FILP	((struct file *)0)
 #define SEL_IN		1
 #define SEL_OUT		2
diff -urN linux-2.2.13-pre10/include/linux/posix_types.h linux-2.2.13-pre11/include/linux/posix_types.h
--- linux-2.2.13-pre10/include/linux/posix_types.h	1998-12-27 22:18:28.000000000 -0800
+++ linux-2.2.13-pre11/include/linux/posix_types.h	2003-08-15 15:08:00.000000000 -0700
@@ -1,15 +1,7 @@
 #ifndef _LINUX_POSIX_TYPES_H
 #define _LINUX_POSIX_TYPES_H
 
-/*
- * This file is generally used by user-level software, so you need to
- * be a little careful about namespace pollution etc.  Also, we cannot
- * assume GCC is being used.
- */
-
-#ifndef NULL
-# define NULL		((void *) 0)
-#endif
+#include <linux/stddef.h>
 
 /*
  * This allows for 1024 file descriptors: if NR_OPEN is ever grown
diff -urN linux-2.2.13-pre10/include/linux/sched.h linux-2.2.13-pre11/include/linux/sched.h
--- linux-2.2.13-pre10/include/linux/sched.h	1999-08-25 17:29:53.000000000 -0700
+++ linux-2.2.13-pre11/include/linux/sched.h	2003-08-15 15:08:00.000000000 -0700
@@ -97,10 +97,6 @@
 	int sched_priority;
 };
 
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
 #ifdef __KERNEL__
 
 #include <asm/spinlock.h>
diff -urN linux-2.2.13-pre10/include/linux/stddef.h linux-2.2.13-pre11/include/linux/stddef.h
--- linux-2.2.13-pre10/include/linux/stddef.h	1996-11-23 02:29:04.000000000 -0800
+++ linux-2.2.13-pre11/include/linux/stddef.h	2003-08-15 15:08:00.000000000 -0700
@@ -2,7 +2,11 @@
 #define _LINUX_STDDEF_H
 
 #undef NULL
+#if defined(__cplusplus)
+#define NULL 0
+#else
 #define NULL ((void *)0)
+#endif
 
 #undef offsetof
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
diff -urN linux-2.2.13-pre10/include/linux/string.h linux-2.2.13-pre11/include/linux/string.h
--- linux-2.2.13-pre10/include/linux/string.h	1999-04-23 09:36:09.000000000 -0700
+++ linux-2.2.13-pre11/include/linux/string.h	2003-08-15 15:08:00.000000000 -0700
@@ -2,10 +2,7 @@
 #define _LINUX_STRING_H_
 
 #include <linux/types.h>	/* for size_t */
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
+#include <linux/stddef.h>	/* for NULL */
 
 #ifdef __cplusplus
 extern "C" {
diff -urN linux-2.2.13-pre10/include/linux/tty.h linux-2.2.13-pre11/include/linux/tty.h
--- linux-2.2.13-pre10/include/linux/tty.h	2003-08-15 15:07:59.000000000 -0700
+++ linux-2.2.13-pre11/include/linux/tty.h	2003-08-15 15:08:00.000000000 -0700
@@ -303,6 +303,7 @@
 	unsigned long canon_head;
 	unsigned int canon_column;
 	struct semaphore atomic_read;
+	struct semaphore atomic_write;
 };
 
 /* tty magic number */
diff -urN linux-2.2.13-pre10/include/net/ip.h linux-2.2.13-pre11/include/net/ip.h
--- linux-2.2.13-pre10/include/net/ip.h	1999-05-11 10:36:44.000000000 -0700
+++ linux-2.2.13-pre11/include/net/ip.h	2003-08-15 15:08:00.000000000 -0700
@@ -203,6 +203,22 @@
 	buf[3]=addr&0x7F;
 }
 
+/*
+ *	Map a multicast IP onto multicast MAC for type Token Ring.
+ *      This conforms to RFC1469 Option 2 Multicasting i.e.
+ *      using a functional address to transmit / receive 
+ *      multicast packets.
+ */
+
+extern __inline__ void ip_tr_mc_map(u32 addr, char *buf)
+{
+	buf[0]=0xC0;
+	buf[1]=0x00;
+	buf[2]=0x00;
+	buf[3]=0x04;
+	buf[4]=0x00;
+	buf[5]=0x00;
+}
 
 extern int	ip_call_ra_chain(struct sk_buff *skb);
 
diff -urN linux-2.2.13-pre10/Makefile linux-2.2.13-pre11/Makefile
--- linux-2.2.13-pre10/Makefile	2003-08-15 15:07:59.000000000 -0700
+++ linux-2.2.13-pre11/Makefile	2003-08-15 15:07:59.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 13
-EXTRAVERSION = pre10
+EXTRAVERSION = pre11
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
diff -urN linux-2.2.13-pre10/net/802/tr.c linux-2.2.13-pre11/net/802/tr.c
--- linux-2.2.13-pre10/net/802/tr.c	1999-04-24 17:51:48.000000000 -0700
+++ linux-2.2.13-pre11/net/802/tr.c	2003-08-15 15:08:00.000000000 -0700
@@ -189,22 +189,27 @@
 
 	skb_pull(skb,sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen);
 
-	tr_add_rif_info(trh, dev);
-
-	if(*trh->daddr & 1) 
+	if(*trh->daddr & 0x80) 
 	{
 		if(!memcmp(trh->daddr,dev->broadcast,TR_ALEN)) 	
 			skb->pkt_type=PACKET_BROADCAST;
 		else
 			skb->pkt_type=PACKET_MULTICAST;
 	}
-
+	else if ( (trh->daddr[0] & 0x01) && (trh->daddr[1] & 0x00) && (trh->daddr[2] & 0x5E))
+	{
+		skb->pkt_type=PACKET_MULTICAST;
+	}
 	else if(dev->flags & IFF_PROMISC) 
 	{
 		if(memcmp(trh->daddr, dev->dev_addr, TR_ALEN))
 			skb->pkt_type=PACKET_OTHERHOST;
 	}
 
+	if ((skb->pkt_type != PACKET_BROADCAST) &&
+	    (skb->pkt_type != PACKET_MULTICAST))
+		tr_add_rif_info(trh,dev) ; 
+
 	/*
 	 * Strip the SNAP header from ARP packets since we don't 
 	 * pass them through to the 802.2/SNAP layers.
@@ -231,14 +236,18 @@
 	unsigned int hash;
 	rif_cache entry;
 	unsigned char *olddata;
+	unsigned char mcast_func_addr[] = {0xC0,0x00,0x00,0x04,0x00,0x00} ; 
+
 	unsigned long flags;
 	
 	spin_lock_irqsave(&rif_lock, flags);
 
 	/*
 	 *	Broadcasts are single route as stated in RFC 1042 
-	 */
-	if(!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN)) 
+  	 */
+
+	if ( (!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN))  ||
+	     (!memcmp(&(trh->daddr[0]),&(mcast_func_addr[0]), TR_ALEN)) )
 	{
 		trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)  
 			       | TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST);
diff -urN linux-2.2.13-pre10/net/ipv4/arp.c linux-2.2.13-pre11/net/ipv4/arp.c
--- linux-2.2.13-pre10/net/ipv4/arp.c	1999-08-09 12:04:41.000000000 -0700
+++ linux-2.2.13-pre11/net/ipv4/arp.c	2003-08-15 15:08:00.000000000 -0700
@@ -194,9 +194,14 @@
 {
 	switch (dev->type) {
 	case ARPHRD_ETHER:
-	case ARPHRD_IEEE802:
 	case ARPHRD_FDDI:
-		ip_eth_mc_map(addr, haddr);
+		ip_eth_mc_map(addr, haddr) ; 
+		return 0 ; 
+	case ARPHRD_IEEE802:
+		if ( (dev->name[0] == 't') && (dev->name[1] == 'r')) /* Token Ring */
+			ip_tr_mc_map(addr,haddr) ; 
+		else  
+			ip_eth_mc_map(addr, haddr);
 		return 0;
 	default:
 		if (dir) {
