diff -r -u linux-2.1.46-orig/drivers/net/hp100.c linux-2.1.46/drivers/net/hp100.c
--- linux-2.1.46-orig/drivers/net/hp100.c	Sat May 24 18:10:23 1997
+++ linux-2.1.46/drivers/net/hp100.c	Thu Jul 24 12:18:19 1997
@@ -2,7 +2,7 @@
 ** hp100.c 
 ** HP CASCADE Architecture Driver for 100VG-AnyLan Network Adapters
 **
-** $Id: hp100.c,v 1.52 1997/04/21 14:20:20 perex Exp perex $
+** $Id: hp100.c,v 1.54 1997/06/12 10:37:07 perex Exp perex $
 **
 ** Based on the HP100 driver written by Jaroslav Kysela <perex@jcu.cz>
 ** Extended for new busmaster capable chipsets by 
@@ -34,6 +34,16 @@
 ** Free Software Foundation) either version two of this License, or any 
 ** later version.
 **
+** 1.53 -> 1.54
+**   - added hardware multicast filter support (doesn't work)
+**   - little changes in hp100_sense_lan routine 
+**     - added support for Coax and AUI (J2970)
+**   - fix for multiple cards and hp100_mode parameter (insmod)
+**   - fix for shared IRQ 
+**
+** 1.52 -> 1.53
+**   - fixed bug in multicast support
+**
 */
 
 #define HP100_DEFAULT_PRIORITY_TX 0 
@@ -47,6 +57,8 @@
 #undef HP100_DEBUG_IRQ 
 #undef HP100_DEBUG_RX 
 
+#undef HP100_MULTICAST_FILTER  /* Need to be debugged... */
+
 #include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -58,7 +70,6 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/bios32.h>
-#include <linux/init.h>
 #include <asm/bitops.h>
 #include <asm/io.h>
 
@@ -79,6 +90,12 @@
 typedef struct net_device_stats hp100_stats_t;
 #endif
 
+#ifndef __initfunc
+#define __initfunc(__initarg) __initarg
+#else
+#include <linux/init.h>
+#endif
+
 #include "hp100.h"
 
 /*
@@ -142,6 +159,7 @@
   int hub_status;	  /* was login to hub successful? */
   u_char mac1_mode;
   u_char mac2_mode;
+  u_char hash_bytes[ 8 ];
   hp100_stats_t stats;
 
   /* Rings for busmaster mode: */
@@ -234,8 +252,8 @@
 static void hp100_BM_shutdown( struct device *dev );
 static void hp100_mmuinit( struct device *dev );
 static void hp100_init_pdls( struct device *dev );
-static int  hp100_init_rxpdl( register hp100_ring_t *ringptr, register u_int *pdlptr);
-static int  hp100_init_txpdl( register hp100_ring_t *ringptr, register u_int *pdlptr);
+static int  hp100_init_rxpdl( struct device *dev, register hp100_ring_t *ringptr, register u_int *pdlptr);
+static int  hp100_init_txpdl( struct device *dev, register hp100_ring_t *ringptr, register u_int *pdlptr);
 static void hp100_rxfill( struct device *dev );
 static void hp100_hwinit( struct device *dev );
 static void hp100_clean_txring( struct device *dev );
@@ -265,7 +283,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4200, TRACE );
-  printk( "hp100: probe\n" );
+  printk( "hp100: %s: probe\n", dev->name );
 #endif
 
   if ( base_addr > 0xff )	/* Check a single specified location. */
@@ -273,8 +291,14 @@
       if ( check_region( base_addr, HP100_REGION_SIZE ) ) return -EINVAL;
       if ( base_addr < 0x400 )
         return hp100_probe1( dev, base_addr, HP100_BUS_ISA, 0, 0 );
-      else
+      if ( EISA_bus && base_addr >= 0x1c38 && ( (base_addr - 0x1c38) & 0x3ff ) == 0 )
         return hp100_probe1( dev, base_addr, HP100_BUS_EISA, 0, 0 );
+#ifdef CONFIG_PCI
+      printk( "hp100: %s: You may specify card # in i/o address parameter for PCI bus...", dev->name );
+      return hp100_probe1( dev, base_addr, HP100_BUS_PCI, 0, 0 );
+#else
+      return -ENODEV;
+#endif
     }
   else
 #ifdef CONFIG_PCI
@@ -292,7 +316,7 @@
       int pci_index;
 
 #ifdef HP100_DEBUG_PCI
-      printk( "hp100: PCI BIOS is present, checking for devices..\n" );
+      printk( "hp100: %s: PCI BIOS is present, checking for devices..\n", dev->name );
 #endif
       for ( pci_index = pci_start_index & 7; pci_index < 8; pci_index++ )
         {
@@ -321,14 +345,14 @@
           if ( !( pci_command & PCI_COMMAND_MASTER ) )
             {
 #ifdef HP100_DEBUG
-              printk( "hp100: PCI Master Bit has not been set. Setting...\n" );
+              printk( "hp100: %s: PCI Master Bit has not been set. Setting...\n", dev->name );
 #endif
               pci_command |= PCI_COMMAND_MASTER;
               pcibios_write_config_word( pci_bus, pci_device_fn,
                                          PCI_COMMAND, pci_command );
             }
 #ifdef HP100_DEBUG
-          printk( "hp100: PCI adapter found at 0x%x\n", ioaddr );
+          printk( "hp100: %s: PCI adapter found at 0x%x\n", dev->name, ioaddr );
 #endif
 	  if ( hp100_probe1( dev, ioaddr, HP100_BUS_PCI, pci_bus, pci_device_fn ) == 0 )
 	    return 0;
@@ -363,6 +387,7 @@
   u_int eisa_id;
   u_int chip;
   u_int memory_size = 0;
+  u_short local_mode, lsw;
   short mem_mapped;
   u_int *mem_ptr_phys, *mem_ptr_virt;
   struct hp100_private *lp;
@@ -370,13 +395,13 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4201, TRACE );
-  printk("hp100: probe1\n");
+  printk("hp100: %s: probe1\n",dev->name);
 #endif
 
   if ( dev == NULL )
     {
 #ifdef HP100_DEBUG
-      printk( "hp100_probe1: dev == NULL ?\n" );
+      printk( "hp100_probe1: %s: dev == NULL ?\n", dev->name );
 #endif
       return EIO;
     }
@@ -390,13 +415,13 @@
       chip = hp100_inw( PAGING ) & HP100_CHIPID_MASK;
 #ifdef HP100_DEBUG
       if ( chip == HP100_CHIPID_SHASTA )
-        printk("hp100: Shasta Chip detected. (This is a pre 802.12 chip)\n");
+        printk("hp100: %s: Shasta Chip detected. (This is a pre 802.12 chip)\n", dev->name);
       else if ( chip == HP100_CHIPID_RAINIER )
-        printk("hp100: Rainier Chip detected. (This is a pre 802.12 chip)\n");
+        printk("hp100: %s: Rainier Chip detected. (This is a pre 802.12 chip)\n", dev->name);
       else if ( chip == HP100_CHIPID_LASSEN )
-        printk("hp100: Lassen Chip detected.\n");
+        printk("hp100: %s: Lassen Chip detected.\n", dev->name);
       else
-        printk("hp100: Warning: Unknown CASCADE chip (id=0x%.4x).\n",chip);
+        printk("hp100: %s: Warning: Unknown CASCADE chip (id=0x%.4x).\n",dev->name,chip);
 #endif 
     }
 
@@ -414,7 +439,7 @@
 
   if ( uc != 0xff )    /* bad checksum? */
     {
-      printk("hp100_probe: bad EISA ID checksum at base port 0x%x\n", ioaddr );
+      printk("hp100_probe: %s: bad EISA ID checksum at base port 0x%x\n", dev->name, ioaddr );
       return -ENODEV;
     }
 
@@ -423,14 +448,14 @@
       break;
   if ( i >= sizeof( hp100_eisa_ids ) / sizeof( struct hp100_eisa_id ) )
     {
-      printk( "hp100_probe1: card at port 0x%x isn't known (id = 0x%x)\n", ioaddr, eisa_id );
+      printk( "hp100_probe: %s: card at port 0x%x isn't known (id = 0x%x)\n", dev -> name, ioaddr, eisa_id );
       return -ENODEV;
     }
   eid = &hp100_eisa_ids[ i ];
   if ( ( eid->id & 0x0f000000 ) < ( eisa_id & 0x0f000000 ) )
     {
-      printk( "hp100_probe1: newer version of card %s at port 0x%x - unsupported\n",
-	      eid->name, ioaddr );
+      printk( "hp100_probe: %s: newer version of card %s at port 0x%x - unsupported\n",
+	      dev->name, eid->name, ioaddr );
       return -ENODEV;
     }
 
@@ -438,8 +463,8 @@
     uc += hp100_inb( LAN_ADDR + i );
   if ( uc != 0xff )
     {
-      printk("hp100_probe1: bad lan address checksum (card %s at port 0x%x)\n",
-	     eid->name, ioaddr );
+      printk("hp100_probe: %s: bad lan address checksum (card %s at port 0x%x)\n",
+	     dev->name, eid->name, ioaddr );
       return -EIO;
     }
 
@@ -453,21 +478,29 @@
    * hp100_mode=4 -> same as 1, but re-set the enable bit on the card.
    */
 
-  if(hp100_mode==3)
+  /* hp100_mode value maybe used in future by another card */
+  local_mode=hp100_mode;
+  if ( local_mode < 1 || local_mode > 4 )
+    local_mode = 1;		/* default */
+#ifdef HP100_DEBUG
+  printk( "hp100: %s: original LSW = 0x%x\n", dev->name, hp100_inw(OPTION_LSW) );
+#endif
+
+  if(local_mode==3)
     {
       hp100_outw(HP100_MEM_EN|HP100_RESET_LB, OPTION_LSW);
       hp100_outw(HP100_IO_EN|HP100_SET_LB, OPTION_LSW);
       hp100_outw(HP100_BM_WRITE|HP100_BM_READ|HP100_RESET_HB, OPTION_LSW);
-      printk("hp100: IO mapped mode forced.\n");
+      printk("hp100: %s: IO mapped mode forced.\n", dev->name);
     }
-  else	if(hp100_mode==2)
+  else if(local_mode==2)
     {
       hp100_outw(HP100_MEM_EN|HP100_SET_LB, OPTION_LSW);
       hp100_outw(HP100_IO_EN |HP100_SET_LB, OPTION_LSW);
       hp100_outw(HP100_BM_WRITE|HP100_BM_READ|HP100_RESET_HB, OPTION_LSW);
-      printk("hp100: Shared memory mode requested.\n");
+      printk("hp100: %s: Shared memory mode requested.\n", dev->name);
     } 
-  else if(hp100_mode==4)
+  else if(local_mode==4)
     {
       if(chip==HP100_CHIPID_LASSEN)
 	{
@@ -475,42 +508,47 @@
 		     HP100_BM_READ | HP100_SET_HB, OPTION_LSW);
 	  hp100_outw(HP100_IO_EN   | 
 		     HP100_MEM_EN  | HP100_RESET_LB, OPTION_LSW);
-	  printk("hp100: Busmaster mode requested.\n");
+	  printk("hp100: %s: Busmaster mode requested.\n",dev->name);
 	}
-      hp100_mode=1;
+      local_mode=1;
     }
 		
-  if(hp100_mode==1) /* default behaviour */
+  if(local_mode==1) /* default behaviour */
     {
-      if( (hp100_inw(OPTION_LSW)&HP100_IO_EN) &&
-	  (~hp100_inw(OPTION_LSW)&HP100_MEM_EN) &&
-	  (~hp100_inw(OPTION_LSW)&(HP100_BM_WRITE|HP100_BM_READ))
-	  )
+      lsw = hp100_inw(OPTION_LSW);
+    
+      if ( (lsw & HP100_IO_EN) &&
+	   (~lsw & HP100_MEM_EN) &&
+	   (~lsw & (HP100_BM_WRITE|HP100_BM_READ)) )
 	{
 #ifdef HP100_DEBUG
-	  printk("hp100: IO_EN bit is set on card.\n");
+	  printk("hp100: %s: IO_EN bit is set on card.\n",dev->name);
 #endif
-	  hp100_mode=3;
+	  local_mode=3;
 	}
-      else if( ( chip==HP100_CHIPID_LASSEN ) 	&&
-	       (	(hp100_inw(OPTION_LSW)&(HP100_BM_WRITE|HP100_BM_READ) ) == 
-			(HP100_BM_WRITE|HP100_BM_READ) )  )	
+      else if ( chip == HP100_CHIPID_LASSEN &&
+	        ( lsw & (HP100_BM_WRITE|HP100_BM_READ) ) ==
+	                (HP100_BM_WRITE|HP100_BM_READ) )
 	{
-	  printk("hp100: Busmaster mode enabled.\n");
+	  printk("hp100: %s: Busmaster mode enabled.\n",dev->name);
 	  hp100_outw(HP100_MEM_EN|HP100_IO_EN|HP100_RESET_LB, OPTION_LSW);
 	}
       else
 	{
 #ifdef HP100_DEBUG
-	  printk("hp100: Card not configured for BM or BM not supported with this card. Trying shared memory mode.\n");
+	  printk("hp100: %s: Card not configured for BM or BM not supported with this card. Trying shared memory mode.\n", dev->name);
 #endif
 	  /* In this case, try shared memory mode */
-	  hp100_mode=2;
+	  local_mode=2;
 	  hp100_outw(HP100_MEM_EN|HP100_SET_LB, OPTION_LSW);
 	  /* hp100_outw(HP100_IO_EN|HP100_RESET_LB, OPTION_LSW); */
 	}
     }
 
+#ifdef HP100_DEBUG
+  printk( "hp100: %s: new LSW = 0x%x\n", dev->name, hp100_inw(OPTION_LSW) );
+#endif
+
   /* Check for shared memory on the card, eventually remap it */
   hp100_page( HW_MAP );
   mem_mapped = (( hp100_inw( OPTION_LSW ) & ( HP100_MEM_EN ) ) != 0);
@@ -518,7 +556,7 @@
   memory_size = (8192<<( (hp100_inb(SRAM)>>5)&0x07));
 
   /* For memory mapped or busmaster mode, we want the memory address */
-  if ( mem_mapped || (hp100_mode==1))
+  if ( mem_mapped || (local_mode==1))
     {
       mem_ptr_phys = (u_int *)( hp100_inw( MEM_MAP_LSW ) | 
 				( hp100_inw( MEM_MAP_MSW ) << 16 ) );
@@ -526,15 +564,15 @@
 
       if ( bus == HP100_BUS_ISA && ( (u_long)mem_ptr_phys & ~0xfffff ) != 0 )
         {
-	  printk("hp100: Can only use programmed i/o mode.\n");
+	  printk("hp100: %s: Can only use programmed i/o mode.\n", dev->name);
           mem_ptr_phys = NULL;
           mem_mapped = 0;
-	  hp100_mode=3; /* Use programmed i/o */
+	  local_mode=3; /* Use programmed i/o */
         }
 						
       /* We do not need access to shared memory in busmaster mode */
       /* However in slave mode we need to remap high (>1GB) card memory  */
-      if(hp100_mode!=1) /* = not busmaster */
+      if(local_mode!=1) /* = not busmaster */
 	{
 	  if ( bus == HP100_BUS_PCI )
 	    {
@@ -544,13 +582,13 @@
 		  if((mem_ptr_virt=ioremap((u_long)mem_ptr_phys,memory_size))==NULL)
 		    {
 #ifdef HP100_DEBUG
-		      printk( "hp100: ioremap for 0x%x bytes high PCI memory at 0x%lx failed\n", memory_size, (u_long)mem_ptr_phys );														
+		      printk( "hp100: %s: ioremap for 0x%x bytes high PCI memory at 0x%lx failed\n", dev->name, memory_size, (u_long)mem_ptr_phys );
 #endif
 		    }	
 		  else
 		    {
 #ifdef HP100_DEBUG
-		      printk( "hp100: remapped 0x%x bytes high PCI memory at 0x%lx to 0x%lx.\n", memory_size, (u_long)mem_ptr_phys, (u_long)mem_ptr_virt);
+		      printk( "hp100: %s: remapped 0x%x bytes high PCI memory at 0x%lx to 0x%lx.\n", dev->name, memory_size, (u_long)mem_ptr_phys, (u_long)mem_ptr_virt);
 #endif
 		      break;
 		    }
@@ -558,8 +596,8 @@
 														
 	      if(mem_ptr_virt==NULL) /* all ioremap tries failed */
 		{
-		  printk("hp100: Failed to ioremap the PCI card memory. Will have to use i/o mapped mode.\n");
-		  hp100_mode=3;
+		  printk("hp100: %s: Failed to ioremap the PCI card memory. Will have to use i/o mapped mode.\n", dev->name);
+		  local_mode=3;
 		  memory_size = (8192<<( (hp100_inb(SRAM)>>5)&0x07) );
 		}
 	    }
@@ -567,11 +605,11 @@
 						
     }
 
-  if(hp100_mode==3) /* io mapped forced */
+  if(local_mode==3) /* io mapped forced */
     {
       mem_mapped = 0;
       mem_ptr_phys = mem_ptr_virt = NULL;
-      printk("hp100: Using (slow) programmed i/o mode.\n");
+      printk("hp100: %s: Using (slow) programmed i/o mode.\n", dev->name);
     }
 
   /* Initialise the "private" data structure for this card. */
@@ -582,7 +620,7 @@
   lp = (struct hp100_private *)dev->priv;
   lp->id = eid;
   lp->chip = chip;
-  lp->mode = hp100_mode;
+  lp->mode = local_mode;
   lp->pci_bus = pci_bus;
   lp->bus = bus;
   lp->pci_device_fn = pci_device_fn;
@@ -594,6 +632,7 @@
   lp->soft_model = hp100_inb( SOFT_MODEL );
   lp->mac1_mode = HP100_MAC1MODE3;
   lp->mac2_mode = HP100_MAC2MODE3;
+  memset( &lp->hash_bytes, 0x00, 8 );
 
   dev->base_addr = ioaddr;
 
@@ -651,7 +690,8 @@
       memset(lp->page_vaddr, 0, MAX_RINGSIZE+0x0f);
 
 #ifdef HP100_DEBUG_BM
-      printk("hp100: Reserved DMA memory from 0x%x to 0x%x\n",
+      printk("hp100: %s: Reserved DMA memory from 0x%x to 0x%x\n",
+      	     dev->name,
              (u_int)lp->page_vaddr_algn,
              (u_int)lp->page_vaddr_algn+MAX_RINGSIZE);
 #endif
@@ -683,7 +723,7 @@
 
   if ( lp->mode==2 ) /* memory mapped */ 
     {
-      printk( "%s: Memory area at 0x%lx-0x%lx",
+      printk( "hp100: %s: Memory area at 0x%lx-0x%lx",
               dev->name,(u_long)mem_ptr_phys,(u_long)mem_ptr_phys+(u_long)lp->memory_size );
       if ( mem_ptr_virt )
 	printk( " (virtual base 0x%lx)", (u_long)mem_ptr_virt );
@@ -693,7 +733,7 @@
       dev->mem_start = (u_long)mem_ptr_phys;
       dev->mem_end = (u_long)mem_ptr_phys+(u_long)lp->memory_size;
     }
-  printk( "%s: ", dev->name );
+  printk( "hp100: %s: ", dev->name );
   if ( lp->lan_type != HP100_LAN_ERR )
     printk( "Adapter is attached to " );
   switch ( lp->lan_type ) {
@@ -706,6 +746,7 @@
   default:
     printk( "Warning! Link down.\n" );
   }
+
   return 0;
 }
 
@@ -718,7 +759,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4202, TRACE );
-  printk("hp100: hwinit\n");
+  printk("hp100: %s: hwinit\n", dev->name);
 #endif
 
   /* Initialise the card. -------------------------------------------- */
@@ -815,13 +856,13 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4203, TRACE );
-  printk("hp100: mmuinit\n");
+  printk("hp100: %s: mmuinit\n",dev->name);
 #endif
 
 #ifdef HP100_DEBUG
   if( 0!=(hp100_inw(OPTION_LSW)&HP100_HW_RST) )
     {
-      printk("hp100: Not in reset when entering mmuinit. Fix me.\n");
+      printk("hp100: %s: Not in reset when entering mmuinit. Fix me.\n",dev->name);
       return;
     }
 #endif
@@ -923,7 +964,7 @@
           recv_stop = ( xmit_stop * (lp->rx_ratio)/100 ) &~(0x03ff);
           hp100_outw( (pdl_stop>>4)-1, PDL_MEM_STOP );
 #ifdef HP100_DEBUG_BM
-          printk("hp100: PDL_STOP = 0x%x\n", pdl_stop);
+          printk("hp100: %s: PDL_STOP = 0x%x\n", dev->name, pdl_stop);
 #endif
         }
       else /* ETR chip (Lassen) in busmaster mode */
@@ -935,8 +976,8 @@
       hp100_outw( xmit_stop>>4 , TX_MEM_STOP );
       hp100_outw( recv_stop>>4 , RX_MEM_STOP );
 #ifdef HP100_DEBUG_BM
-      printk("hp100: TX_STOP  = 0x%x\n",xmit_stop>>4);
-      printk("hp100: RX_STOP  = 0x%x\n",recv_stop>>4);
+      printk("hp100: %s: TX_STOP  = 0x%x\n",dev->name,xmit_stop>>4);
+      printk("hp100: %s: RX_STOP  = 0x%x\n",dev->name,recv_stop>>4);
 #endif
     }  
   else /* Slave modes (memory mapped and programmed io)  */
@@ -944,8 +985,8 @@
       hp100_outw( (((lp->memory_size*lp->rx_ratio)/100)>>4), RX_MEM_STOP );
       hp100_outw( ((lp->memory_size - 1 )>>4), TX_MEM_STOP );  
 #ifdef HP100_DEBUG
-      printk("hp100: TX_MEM_STOP: 0x%x\n", hp100_inw(TX_MEM_STOP));
-      printk("hp100: RX_MEM_STOP: 0x%x\n", hp100_inw(RX_MEM_STOP));
+      printk("hp100: %s: TX_MEM_STOP: 0x%x\n", dev->name,hp100_inw(TX_MEM_STOP));
+      printk("hp100: %s: RX_MEM_STOP: 0x%x\n", dev->name,hp100_inw(RX_MEM_STOP));
 #endif
     }
 
@@ -1003,33 +1044,24 @@
 static int hp100_open( struct device *dev )
 {
   struct hp100_private *lp = (struct hp100_private *)dev->priv;
-#ifdef HP100_DEBUG_B	
+#ifdef HP100_DEBUG_B
   int ioaddr=dev->base_addr;
 #endif
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4204, TRACE );
-  printk("hp100: open\n");
+  printk("hp100: %s: open\n",dev->name);
 #endif
 		
   /* New: if bus is PCI or EISA, interrupts might be shared interrupts */
-  if((lp->bus==HP100_BUS_PCI)||(lp->bus==HP100_BUS_EISA))
+  if ( request_irq(dev->irq, hp100_interrupt,
+  		   lp->bus==HP100_BUS_PCI||lp->bus==HP100_BUS_EISA?SA_SHIRQ:SA_INTERRUPT,
+  		   lp->id->name, dev))
     {
-      if(request_irq(dev->irq,hp100_interrupt,SA_SHIRQ,lp->id->name,dev))
-	{
-	  printk( "%s: unable to get IRQ %d\n", dev->name, dev->irq );
-	  return -EAGAIN;
-	}
+      printk( "hp100: %s: unable to get IRQ %d\n", dev->name, dev->irq );
+      return -EAGAIN;
     }
-  else
-    if(request_irq(dev->irq, hp100_interrupt, SA_INTERRUPT, lp->id->name, NULL))
-      {
-	printk( "%s: unable to get IRQ %d\n", dev->name, dev->irq );
-	return -EAGAIN;
-      }
 
-  irq2dev_map[ dev->irq ] = dev;
-		
   MOD_INC_USE_COUNT;
 
   dev->tbusy = 0;
@@ -1040,6 +1072,7 @@
   lp->lan_type = hp100_sense_lan( dev );
   lp->mac1_mode = HP100_MAC1MODE3;
   lp->mac2_mode = HP100_MAC2MODE3;
+  memset( &lp->hash_bytes, 0x00, 8 );
 
   hp100_stop_interface( dev );
  
@@ -1059,7 +1092,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4205, TRACE );
-  printk("hp100:close\n");
+  printk("hp100: %s: close\n", dev->name);
 #endif
 
   hp100_page( PERFORMANCE );
@@ -1073,11 +1106,12 @@
   dev->tbusy = 1;
   dev->start = 0;
 
-  if ((lp->bus==HP100_BUS_PCI)||(lp->bus==HP100_BUS_EISA))
-    free_irq( dev->irq, dev );
-  else
-    free_irq( dev->irq, NULL );
-  irq2dev_map[ dev->irq ] = NULL;
+  free_irq( dev->irq, dev );
+
+#ifdef HP100_DEBUG
+  printk( "hp100: %s: close LSW = 0x%x\n", dev->name, hp100_inw(OPTION_LSW) );
+#endif
+
   MOD_DEC_USE_COUNT;
   return 0;
 }
@@ -1099,11 +1133,11 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4206, TRACE );
-  printk("hp100: init pdls\n");
+  printk("hp100: %s: init pdls\n", dev->name);
 #endif
 
   if(0==lp->page_vaddr_algn)
-    printk("hp100: Warning: lp->page_vaddr_algn not initialised!\n");
+    printk("hp100: %s: Warning: lp->page_vaddr_algn not initialised!\n",dev->name);
   else
     {
       /* pageptr shall point into the DMA accessible memory region  */
@@ -1121,7 +1155,7 @@
         {
           lp->rxring[i].next = ringptr;
           ringptr=&(lp->rxring[i]);
-          pageptr+=hp100_init_rxpdl(ringptr, pageptr);
+          pageptr+=hp100_init_rxpdl(dev, ringptr, pageptr);
         }
       
       /* Initialise Tx Ring */
@@ -1131,7 +1165,7 @@
         {
           lp->txring[i].next = ringptr;
           ringptr=&(lp->txring[i]);
-          pageptr+=hp100_init_txpdl(ringptr, pageptr);
+          pageptr+=hp100_init_txpdl(dev, ringptr, pageptr);
         }
     }
 }
@@ -1139,12 +1173,12 @@
 
 /* These functions "format" the entries in the pdl structure   */
 /* They return how much memory the fragments need.            */
-static int hp100_init_rxpdl( register hp100_ring_t *ringptr, register u32 *pdlptr )
+static int hp100_init_rxpdl( struct device *dev, register hp100_ring_t *ringptr, register u32 *pdlptr )
 {
   /* pdlptr is starting adress for this pdl */
 
   if( 0!=( ((unsigned)pdlptr) & 0xf) )
-    printk("hp100: Init rxpdl: Unaligned pdlptr 0x%x.\n",(unsigned)pdlptr);
+    printk("hp100: %s: Init rxpdl: Unaligned pdlptr 0x%x.\n",dev->name,(unsigned)pdlptr);
 
   ringptr->pdl       = pdlptr+1; 
   ringptr->pdl_paddr = virt_to_bus(pdlptr+1);
@@ -1165,10 +1199,10 @@
 }
 
 
-static int hp100_init_txpdl( register hp100_ring_t *ringptr, register u32 *pdlptr )
+static int hp100_init_txpdl( struct device *dev, register hp100_ring_t *ringptr, register u32 *pdlptr )
 {
   if( 0!=( ((unsigned)pdlptr) & 0xf) )
-    printk("hp100: Init txpdl: Unaligned pdlptr 0x%x.\n",(unsigned) pdlptr);
+    printk("hp100: %s: Init txpdl: Unaligned pdlptr 0x%x.\n",dev->name,(unsigned) pdlptr);
 
   ringptr->pdl       = pdlptr; /* +1; */  
   ringptr->pdl_paddr = virt_to_bus(pdlptr); /* +1 */
@@ -1196,7 +1230,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4207, TRACE );
-  printk("hp100: build rx pdl\n");
+  printk("hp100: %s: build rx pdl\n", dev->name);
 #endif
 
   /* Allocate skb buffer of maximum size */
@@ -1225,7 +1259,8 @@
        * directly before the PDL. 
        */
 #ifdef HP100_DEBUG_BM
-      printk("hp100: build_rx_pdl: PDH@0x%x, skb->data (len %d) at 0x%x\n",
+      printk("hp100: %s: build_rx_pdl: PDH@0x%x, skb->data (len %d) at 0x%x\n",
+      	     dev->name,
 	     (u_int) ringptr->pdl,
 	     ((MAX_ETHER_SIZE+2+3)/4)*4,
 	     (unsigned int) ringptr->skb->data);
@@ -1237,7 +1272,7 @@
 						
 #ifdef HP100_DEBUG_BM
       for(p=(ringptr->pdl); p<(ringptr->pdl+5); p++)
-        printk("Adr 0x%.8x = 0x%.8x\n",(u_int) p,(u_int) *p );
+        printk("hp100: %s: Adr 0x%.8x = 0x%.8x\n",dev->name,(u_int) p,(u_int) *p );
 #endif
       return(1);
     }
@@ -1247,7 +1282,8 @@
    * making the PDL only 1 fragment (i.e. the 4 byte packet status)
    */
 #ifdef HP100_DEBUG_BM
-  printk("hp100: build_rx_pdl: PDH@0x%x, No space for skb.\n",
+  printk("hp100: %s: build_rx_pdl: PDH@0x%x, No space for skb.\n",
+  	 dev->name,
 	 (u_int) ringptr->pdl);
 #endif
 
@@ -1276,7 +1312,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4208, TRACE );
-  printk("hp100: rxfill\n");
+  printk("hp100: %s: rxfill\n",dev->name);
 #endif
 		
   hp100_page( PERFORMANCE );
@@ -1295,7 +1331,8 @@
       /* Hand this PDL over to the card */
       /* Note: This needs performance page selected! */
 #ifdef HP100_DEBUG_BM
-      printk("hp100: rxfill: Hand to card: pdl #%d @0x%x phys:0x%x, buffer: 0x%x\n",
+      printk("hp100: %s: rxfill: Hand to card: pdl #%d @0x%x phys:0x%x, buffer: 0x%x\n",
+      	     dev->name,
              lp->rxrcommit,
              (u_int)ringptr->pdl,
              (u_int)ringptr->pdl_paddr,
@@ -1322,7 +1359,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4209, TRACE );
-  printk("hp100: bm shutdown\n");
+  printk("hp100: %s: bm shutdown\n",dev->name);
 #endif
 
   hp100_page( PERFORMANCE );
@@ -1377,7 +1414,7 @@
             }
           
           if(time>=10000)
-            printk("hp100: BM shutdown error.\n");
+            printk("hp100: %s: BM shutdown error.\n", dev->name);
           
           /* To ensure all bus master outloading activity has ceased,
            * wait until the Tx PDA count goes to zero or no more Tx space
@@ -1397,7 +1434,7 @@
       hp100_cascade_reset( dev, TRUE );
     }
   hp100_page( PERFORMANCE );
-  hp100_outw( HP100_BM_READ | HP100_BM_WRITE | HP100_RESET_HB, OPTION_LSW );
+  /* hp100_outw( HP100_BM_READ | HP100_BM_WRITE | HP100_RESET_HB, OPTION_LSW ); */
   /* Busmaster mode should be shut down now. */
 }
 
@@ -1417,7 +1454,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4210, TRACE );
-  printk("hp100: start_xmit_bm\n");
+  printk("hp100: %s: start_xmit_bm\n",dev->name);
 #endif
 
   if ( skb==NULL )
@@ -1433,7 +1470,7 @@
     {
       /* No memory. */
 #ifdef HP100_DEBUG
-      printk("hp100: start_xmit_bm: No TX PDL available.\n");
+      printk("hp100: %s: start_xmit_bm: No TX PDL available.\n", dev->name);
 #endif
       /* not waited long enough since last tx? */
       if ( jiffies - dev->trans_start < HZ/10 ) return -EAGAIN;
@@ -1443,7 +1480,7 @@
 	  hp100_stop_interface( dev );
 	  if ( ( lp->lan_type = hp100_sense_lan( dev ) ) < 0 )
 	    {
-	      printk( "%s: no connection found - check wire\n", dev->name );
+	      printk( "hp100: %s: no connection found - check wire\n", dev->name );
 	      hp100_start_interface( dev );  /* 10Mb/s RX pkts maybe handled */
 	      return -EIO;
 	    }
@@ -1455,7 +1492,7 @@
       if ( lp->lan_type == HP100_LAN_100 && lp->hub_status < 0 )
 	/* we have a 100Mb/s adapter but it isn't connected to hub */
 	{
-	  printk( "%s: login to 100Mb/s hub retry\n", dev->name );
+	  printk( "hp100: %s: login to 100Mb/s hub retry\n", dev->name );
 	  hp100_stop_interface( dev );
 	  lp->hub_status = hp100_login_to_vg_hub( dev, FALSE );
 	  hp100_start_interface( dev );
@@ -1464,15 +1501,14 @@
 	{
 	  hp100_ints_off();
 	  i = hp100_sense_lan( dev );
-	  hp100_page( PERFORMANCE );
 	  hp100_ints_on();
 	  if ( i == HP100_LAN_ERR )
-	    printk( "%s: link down detected\n", dev->name );
+	    printk( "hp100: %s: link down detected\n", dev->name );
 	  else
 	    if ( lp->lan_type != i ) /* cable change! */
 	      {
 		/* it's very hard - all network setting must be changed!!! */
-		printk( "%s: cable change 10Mb/s <-> 100Mb/s detected\n", dev->name );
+		printk( "hp100: %s: cable change 10Mb/s <-> 100Mb/s detected\n", dev->name );
 		lp->lan_type = i;
 		hp100_stop_interface( dev );
 		if ( lp->lan_type == HP100_LAN_100 )
@@ -1481,7 +1517,7 @@
 	      }
 	    else
 	      {
-		printk( "%s: interface reset\n", dev->name );
+		printk( "hp100: %s: interface reset\n", dev->name );
 		hp100_stop_interface( dev );
 		hp100_start_interface( dev );
 	      }
@@ -1549,7 +1585,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4211, TRACE );
-  printk("hp100: clean txring\n");
+  printk("hp100: %s: clean txring\n", dev->name);
 #endif
 
   /* How many PDLs have been transmitted? */
@@ -1557,13 +1593,14 @@
 
 #ifdef HP100_DEBUG
   if(donecount>MAX_TX_PDL)
-    printk("hp100: Warning: More PDLs transmitted than commited to card???\n");
+    printk("hp100: %s: Warning: More PDLs transmitted than commited to card???\n",dev->name);
 #endif
 
   for( ; 0!=donecount; donecount-- )
     {
 #ifdef HP100_DEBUG_BM
-      printk("hp100: Free skb: data @0x%.8x txrcommit=0x%x TXPDL=0x%x, done=0x%x\n",
+      printk("hp100: %s: Free skb: data @0x%.8x txrcommit=0x%x TXPDL=0x%x, done=0x%x\n",
+             dev->name,
 	     (u_int) lp->txrhead->skb->data,
 	     lp->txrcommit,
 	     hp100_inb(TX_PDL),
@@ -1587,7 +1624,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4212, TRACE );
-  printk("hp100: start_xmit\n");
+  printk("hp100: %s: start_xmit\n", dev->name);
 #endif
 
   if ( lp->lan_type < 0 ) /* no LAN type detected yet? */
@@ -1595,7 +1632,7 @@
       hp100_stop_interface( dev );
       if ( ( lp->lan_type = hp100_sense_lan( dev ) ) < 0 )
         {
-          printk( "%s: no connection found - check wire\n", dev->name );
+          printk( "hp100: %s: no connection found - check wire\n", dev->name );
           hp100_start_interface( dev );  /* 10Mb/s RX packets maybe handled */
           return -EIO;
         }
@@ -1609,20 +1646,20 @@
   if ( !(((i/2)-539)>(skb->len+16) && (hp100_inb(TX_PKT_CNT)<255)) )
     {
 #ifdef HP100_DEBUG
-      printk( "hp100_start_xmit: tx free mem = 0x%x\n", i );
+      printk( "hp100: %s: start_xmit: tx free mem = 0x%x\n", dev->name, i );
 #endif
       /* not waited long enough since last failed tx try? */
       if ( jiffies - dev->trans_start < HZ/2 ) 
 	{
 #ifdef HP100_DEBUG
-	  printk("hp100: trans_start timing problem\n");
+	  printk("hp100: %s: trans_start timing problem\n", dev->name);
 #endif
 	  return -EAGAIN;
 	}
       if ( lp->lan_type == HP100_LAN_100 && lp->hub_status < 0 )
 	/* we have a 100Mb/s adapter but it isn't connected to hub */
         {
-          printk( "%s: login to 100Mb/s hub retry\n", dev->name );
+          printk( "hp100: %s: login to 100Mb/s hub retry\n", dev->name );
           hp100_stop_interface( dev );
           lp->hub_status = hp100_login_to_vg_hub( dev, FALSE );
           hp100_start_interface( dev );
@@ -1631,15 +1668,14 @@
         {
           hp100_ints_off();
           i = hp100_sense_lan( dev );
-          hp100_page( PERFORMANCE );
           hp100_ints_on();
           if ( i == HP100_LAN_ERR )
-            printk( "%s: link down detected\n", dev->name );
+            printk( "hp100: %s: link down detected\n", dev->name );
 	  else
 	    if ( lp->lan_type != i ) /* cable change! */
 	      {
 		/* it's very hard - all network setting must be changed!!! */
-		printk( "%s: cable change 10Mb/s <-> 100Mb/s detected\n", dev->name );
+		printk( "hp100: %s: cable change 10Mb/s <-> 100Mb/s detected\n", dev->name );
 		lp->lan_type = i;
 		hp100_stop_interface( dev );
 		if ( lp->lan_type == HP100_LAN_100 )
@@ -1648,7 +1684,7 @@
 	      }
 	    else
 	      {
-		printk( "%s: interface reset\n", dev->name );
+		printk( "hp100: %s: interface reset\n", dev->name );
 		hp100_stop_interface( dev );
 		hp100_start_interface( dev );
 		udelay(1000);
@@ -1661,7 +1697,7 @@
   for ( i=0; i<6000 && ( hp100_inb( OPTION_MSW ) & HP100_TX_CMD ); i++ )
     {
 #ifdef HP100_DEBUG_TX
-      printk( "hp100_start_xmit: busy\n" );
+      printk( "hp100: %s: start_xmit: busy\n", dev->name );
 #endif
     }
 	
@@ -1671,7 +1707,7 @@
    * when the current packet being transmitted on the wire is completed. */
   hp100_outw( HP100_TX_COMPLETE, IRQ_STATUS ); 
 #ifdef HP100_DEBUG_TX
-  printk("hp100_start_xmit: irq_status=0x%.4x, irqmask=0x%.4x, len=%d\n",val,hp100_inw(IRQ_MASK),(int)skb->len );
+  printk("hp100: %s: start_xmit: irq_status=0x%.4x, irqmask=0x%.4x, len=%d\n",dev->name,val,hp100_inw(IRQ_MASK),(int)skb->len );
 #endif
 
   ok_flag = skb->len >= HP100_MIN_PACKET_SIZE;
@@ -1716,7 +1752,7 @@
   dev_kfree_skb( skb, FREE_WRITE );
 	
 #ifdef HP100_DEBUG_TX
-  printk( "hp100_start_xmit: end\n" );
+  printk( "hp100: %s: start_xmit: end\n", dev->name );
 #endif
 	
   return 0;
@@ -1742,7 +1778,7 @@
 
 #ifdef DEBUG_B
   hp100_outw( 0x4213, TRACE );
-  printk("hp100: rx\n");
+  printk("hp100: %s: rx\n", dev->name);
 #endif
 
   /* First get indication of received lan packet */
@@ -1751,7 +1787,7 @@
   packets = hp100_inb( RX_PKT_CNT );
 #ifdef HP100_DEBUG_RX
   if ( packets > 1 )
-    printk( "hp100_rx: waiting packets = %d\n", packets );
+    printk( "hp100: %s: rx: waiting packets = %d\n", dev->name,packets );
 #endif
 
   while ( packets-- > 0 )
@@ -1762,7 +1798,7 @@
 	   pkt_len++ )
         {
 #ifdef HP100_DEBUG_RX
-          printk( "hp100_rx: busy, remaining packets = %d\n", packets );
+          printk( "hp100: %s: rx: busy, remaining packets = %d\n", dev->name, packets );
 #endif    
         }
 
@@ -1781,7 +1817,8 @@
       pkt_len = header & HP100_PKT_LEN_MASK;
 
 #ifdef HP100_DEBUG_RX
-      printk( "hp100_rx: new packet - length=%d, errors=0x%x, dest=0x%x\n",
+      printk( "hp100: %s: rx: new packet - length=%d, errors=0x%x, dest=0x%x\n",
+      	      dev->name,
               header & HP100_PKT_LEN_MASK, (header>>16)&0xfff8,
               (header>>16)&7);
 #endif
@@ -1795,7 +1832,7 @@
       if ( skb == NULL ) /* Not enough memory->drop packet */
 	{
 #ifdef HP100_DEBUG
-	  printk( "hp100_rx: couldn't allocate a sk_buff of size %d\n", pkt_len );
+	  printk( "hp100: %s: rx: couldn't allocate a sk_buff of size %d\n", dev->name, pkt_len );
 #endif
 	  lp->stats.rx_dropped++;
 	}
@@ -1829,7 +1866,8 @@
 #endif
       
 #ifdef HP100_DEBUG_RX
-	  printk( "rx: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
+	  printk( "hp100: %s: rx: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
+	  	  dev->name,
 		  ptr[ 0 ], ptr[ 1 ], ptr[ 2 ], ptr[ 3 ], ptr[ 4 ], ptr[ 5 ],
 		  ptr[ 6 ], ptr[ 7 ], ptr[ 8 ], ptr[ 9 ], ptr[ 10 ], ptr[ 11 ] );
 #endif
@@ -1845,7 +1883,7 @@
       }
     } /* end of while(there are packets) loop */
 #ifdef HP100_DEBUG_RX
-  printk( "hp100_rx: end\n" );
+  printk( "hp100_rx: %s: end\n", dev->name );
 #endif
 }
 
@@ -1863,13 +1901,13 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4214, TRACE );
-  printk("hp100: rx_bm\n");
+  printk("hp100: %s: rx_bm\n", dev->name);
 #endif
 
 #ifdef HP100_DEBUG
   if(0==lp->rxrcommit)
     {
-      printk("hp100: rx_bm called although no PDLs were committed to adapter?\n"); 
+      printk("hp100: %s: rx_bm called although no PDLs were committed to adapter?\n", dev->name); 
       return;
     }
   else
@@ -1878,7 +1916,7 @@
      * the cards BM engine */
     if( (hp100_inw(RX_PKT_CNT)&0x00ff) >= lp->rxrcommit)
       {
-	printk("hp100: More packets received than commited? RX_PKT_CNT=0x%x, commit=0x%x\n", hp100_inw(RX_PKT_CNT)&0x00ff, lp->rxrcommit);
+	printk("hp100: %s: More packets received than commited? RX_PKT_CNT=0x%x, commit=0x%x\n", dev->name, hp100_inw(RX_PKT_CNT)&0x00ff, lp->rxrcommit);
 	return;
       }
 #endif
@@ -1899,12 +1937,14 @@
       pkt_len = (header & HP100_PKT_LEN_MASK);
 
 #ifdef HP100_DEBUG_BM
-      printk( "hp100: rx_bm: header@0x%x=0x%x length=%d, errors=0x%x, dest=0x%x\n",
+      printk( "hp100: %s: rx_bm: header@0x%x=0x%x length=%d, errors=0x%x, dest=0x%x\n",
+      	      dev->name,
               (u_int) (ptr->pdl-1),(u_int) header,
               pkt_len, 
               (header>>16)&0xfff8,
               (header>>16)&7);
-      printk( "hp100: RX_PDL_COUNT:0x%x TX_PDL_COUNT:0x%x, RX_PKT_CNT=0x%x PDH=0x%x, Data@0x%x len=0x%x\n",
+      printk( "hp100: %s: RX_PDL_COUNT:0x%x TX_PDL_COUNT:0x%x, RX_PKT_CNT=0x%x PDH=0x%x, Data@0x%x len=0x%x\n",
+      	      dev->name,
 	      hp100_inb( RX_PDL ),
 	      hp100_inb( TX_PDL ),
 	      hp100_inb( RX_PKT_CNT ),
@@ -1918,7 +1958,7 @@
         {
 	  if(ptr->skb==NULL)
 	    {
-	      printk("hp100: rx_bm: skb null\n");
+	      printk("hp100: %s: rx_bm: skb null\n", dev->name);
 	      /* can happen if we only allocated room for the pdh due to memory shortage. */
 	      lp->stats.rx_dropped++;
 	    }
@@ -1944,7 +1984,7 @@
       else
         {
 #ifdef HP100_DEBUG
-          printk("hp100: rx_bm: Received bad packet (length=%d)\n",pkt_len);
+          printk("hp100: %s: rx_bm: Received bad packet (length=%d)\n",dev->name,pkt_len);
 #endif
 	  if(ptr->skb!=NULL)
 	    dev_kfree_skb( ptr->skb, FREE_READ );					
@@ -1958,7 +1998,7 @@
         {
 	  /* No space for skb, header can still be received. */
 #ifdef HP100_DEBUG
-          printk("hp100: rx_bm: No space for new PDL.\n");
+          printk("hp100: %s: rx_bm: No space for new PDL.\n", dev->name);
 #endif
 	  return;
         } 
@@ -1998,7 +2038,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4216, TRACE );
-  printk("hp100: update-stats\n");
+  printk("hp100: %s: update-stats\n", dev->name);
 #endif
 
   /* Note: Statistics counters clear when read. */
@@ -2019,7 +2059,7 @@
 {
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4217, TRACE );
-  printk("hp100: clear_stats\n");
+  printk("hp100: %s: clear_stats\n", dev->name);
 #endif
 
   cli();
@@ -2038,8 +2078,6 @@
 
 /*
  *  Set or clear the multicast filter for this adapter.
- *  TODO: Currently when in multicast mode, card accepts all multicast packets
- *        for all MC addresses. Should better use the list on the card.
  */
                                                           
 static void hp100_set_multicast_list( struct device *dev)
@@ -2049,7 +2087,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4218, TRACE );
-  printk("hp100: set_mc_list\n");
+  printk("hp100: %s: set_mc_list\n", dev->name);
 #endif
 
   cli();
@@ -2061,32 +2099,123 @@
     {
       lp->mac2_mode = HP100_MAC2MODE6;  /* promiscuous mode = get all good */
       lp->mac1_mode = HP100_MAC1MODE6;  /* packets on the net */
+      memset( &lp->hash_bytes, 0xff, 8 );
     }
   else if ( dev->mc_count || (dev->flags&IFF_ALLMULTI) )
     {
       lp->mac2_mode = HP100_MAC2MODE5;  /* multicast mode = get packets for */
       lp->mac1_mode = HP100_MAC1MODE5;  /* me, broadcasts and all multicasts */
+#ifdef HP100_MULTICAST_FILTER		/* doesn't work!!! */
+      if ( dev -> flags & IFF_ALLMULTI )
+        {
+          /* set hash filter to receive all multicast packets */
+          memset( &lp->hash_bytes, 0xff, 8 );
+        }
+       else
+        {
+          int i, j, idx;
+          u_char *addrs;
+          struct dev_mc_list *dmi;
+
+          memset( &lp->hash_bytes, 0x00, 8 );
+#ifdef HP100_DEBUG
+          printk("hp100: %s: computing hash filter - mc_count = %i\n", dev -> name, dev -> mc_count );
+#endif 
+          for ( i = 0, dmi = dev -> mc_list; i < dev -> mc_count; i++, dmi = dmi -> next )
+            {
+              addrs = dmi -> dmi_addr;
+              if ( ( *addrs & 0x01 ) == 0x01 )	/* multicast address? */
+                {
+#ifdef HP100_DEBUG
+                  printk("hp100: %s: multicast = %02x:%02x:%02x:%02x:%02x:%02x, ",
+                  	dev -> name,
+        		addrs[ 0 ], addrs[ 1 ], addrs[ 2 ],
+        		addrs[ 3 ], addrs[ 4 ], addrs[ 5 ] );
+#endif 
+                  for ( j = idx = 0; j < 6; j++ )
+                    {
+                      idx ^= *addrs++ & 0x3f;
+                      printk( ":%02x:", idx );
+                    }
+#ifdef HP100_DEBUG
+                  printk("idx = %i\n", idx );
+#endif
+		  lp->hash_bytes[ idx >> 3 ] |= ( 1 << ( idx & 7 ) );
+                }
+            }
+        }
+#else
+      memset( &lp->hash_bytes, 0xff, 8 );
+#endif
     }
   else
     {
       lp->mac2_mode = HP100_MAC2MODE3;  /* normal mode = get packets for me */
       lp->mac1_mode = HP100_MAC1MODE3;  /* and broadcasts */
+      memset( &lp->hash_bytes, 0x00, 8 );
     }
 
   if ( ( (hp100_inb(MAC_CFG_1) & 0x0f)!=lp->mac1_mode ) ||
-        ( hp100_inb(MAC_CFG_2)!=lp->mac2_mode ) ) {
-    hp100_outb( lp->mac2_mode, MAC_CFG_2 );
-    hp100_andb( HP100_MAC1MODEMASK, MAC_CFG_1 ); /* clear mac1 mode bits */
-    hp100_orb( lp->mac1_mode, MAC_CFG_1 );       /* and set the new mode */
+        ( hp100_inb(MAC_CFG_2)!=lp->mac2_mode ) ) 
+    {
+      int i;
+    
+      hp100_outb( lp->mac2_mode, MAC_CFG_2 );
+      hp100_andb( HP100_MAC1MODEMASK, MAC_CFG_1 ); /* clear mac1 mode bits */
+      hp100_orb( lp->mac1_mode, MAC_CFG_1 );       /* and set the new mode */
+
+      hp100_page( MAC_ADDRESS );
+      for ( i = 0; i < 8; i++ )
+        hp100_outb( lp->hash_bytes[ i ], HASH_BYTE0 + i );
+#ifdef HP100_DEBUG
+      printk("hp100: %s: mac1 = 0x%x, mac2 = 0x%x, multicast hash = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", 
+      		dev->name, lp->mac1_mode, lp->mac2_mode,
+      		lp->hash_bytes[ 0 ], lp->hash_bytes[ 1 ],
+      		lp->hash_bytes[ 2 ], lp->hash_bytes[ 3 ],
+      		lp->hash_bytes[ 4 ], lp->hash_bytes[ 5 ],
+      		lp->hash_bytes[ 6 ], lp->hash_bytes[ 7 ]
+      		);
+#endif 
 
-    if(lp->lan_type==HP100_LAN_100)
-      {
+      if(lp->lan_type==HP100_LAN_100)
+        {
 #ifdef HP100_DEBUG
-	printk("hp100: 100VG MAC settings have changed - relogin.\n");
-#endif
-	lp->hub_status=hp100_login_to_vg_hub( dev, TRUE );  /* force a relogin to the hub */
-      }
-  }
+  	  printk("hp100: %s: 100VG MAC settings have changed - relogin.\n", dev->name);
+#endif 
+	  lp->hub_status=hp100_login_to_vg_hub( dev, TRUE );  /* force a relogin to the hub */
+        }
+    }
+   else
+    {
+      int i;
+      u_char old_hash_bytes[ 8 ];
+
+      hp100_page( MAC_ADDRESS );
+      for ( i = 0; i < 8; i++ )
+        old_hash_bytes[ i ] = hp100_inb( HASH_BYTE0 + i );
+      if ( memcmp( old_hash_bytes, &lp->hash_bytes, 8 ) )
+        {
+          for ( i = 0; i < 8; i++ )
+            hp100_outb( lp->hash_bytes[ i ], HASH_BYTE0 + i );
+#ifdef HP100_DEBUG
+          printk("hp100: %s: multicast hash = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", 
+          	dev->name,
+      		lp->hash_bytes[ 0 ], lp->hash_bytes[ 1 ],
+      		lp->hash_bytes[ 2 ], lp->hash_bytes[ 3 ],
+      		lp->hash_bytes[ 4 ], lp->hash_bytes[ 5 ],
+      		lp->hash_bytes[ 6 ], lp->hash_bytes[ 7 ]
+      		);
+#endif 
+
+          if(lp->lan_type==HP100_LAN_100)
+            {
+#ifdef HP100_DEBUG
+  	      printk("hp100: %s: 100VG MAC settings have changed - relogin.\n", dev->name);
+#endif 
+   	      lp->hub_status=hp100_login_to_vg_hub( dev, TRUE );  /* force a relogin to the hub */
+            }
+        }
+    }
 
   hp100_page( MAC_CTRL );
   hp100_orb( HP100_RX_EN | HP100_RX_IDLE |              /* enable rx */
@@ -2104,7 +2233,7 @@
 
 static void hp100_interrupt( int irq, void *dev_id, struct pt_regs *regs )
 {
-  struct device *dev = (struct device *)irq2dev_map[ irq ];
+  struct device *dev = (struct device *)dev_id;
   struct hp100_private *lp = (struct hp100_private *)dev->priv;
 
   int ioaddr;
@@ -2114,7 +2243,7 @@
   ioaddr = dev->base_addr;
 
   if ( dev->interrupt )
-    printk( "%s: re-entering the interrupt handler\n", dev->name );
+    printk( "hp100: %s: re-entering the interrupt handler\n", dev->name );
   hp100_ints_off();
   dev->interrupt = 1;          /* mark that we are inside the handler */
 
@@ -2125,7 +2254,8 @@
   /*  hp100_page( PERFORMANCE ); */
   val = hp100_inw( IRQ_STATUS );
 #ifdef HP100_DEBUG_IRQ
-  printk( "hp100: mode=%x,IRQ_STAT=0x%.4x,RXPKTCNT=0x%.2x RXPDL=0x%.2x TXPKTCNT=0x%.2x TXPDL=0x%.2x\n",
+  printk( "hp100: %s: mode=%x,IRQ_STAT=0x%.4x,RXPKTCNT=0x%.2x RXPDL=0x%.2x TXPKTCNT=0x%.2x TXPDL=0x%.2x\n",
+  	  dev->name,
           lp->mode,
 	  (u_int)val,
           hp100_inb( RX_PKT_CNT ),
@@ -2154,7 +2284,9 @@
       if(lp->mode==1)
 	hp100_rx_bm( dev );
       else
-	printk("hp100: rx_pdl_fill_compl interrupt although not busmaster?\n");
+	{
+	  printk("hp100: %s: rx_pdl_fill_compl interrupt although not busmaster?\n", dev->name);
+	}
     }
 		
   /* 
@@ -2193,7 +2325,7 @@
   if ( val & ( HP100_TX_ERROR | HP100_RX_ERROR ) )
     {
 #ifdef HP100_DEBUG_IRQ
-      printk("hp100: TX/RX Error IRQ\n");
+      printk("hp100: %s: TX/RX Error IRQ\n", dev->name);
 #endif
       hp100_update_stats( dev );
       if(lp->mode==1)
@@ -2222,7 +2354,7 @@
    */
   if ( val & HP100_MISC_ERROR ) /* New for J2585B */
     {
-      printk("hp100: Misc. Error Interrupt - Check cabling.\n");
+      printk("hp100: %s: Misc. Error Interrupt - Check cabling.\n", dev->name);
       if(lp->mode==1)
 	{
 	  hp100_clean_txring( dev );
@@ -2246,7 +2378,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4220, TRACE );
-  printk("hp100: hp100_start_interface %s\n",dev->name);
+  printk("hp100: %s: hp100_start_interface\n",dev->name);
 #endif
 
   cli();
@@ -2310,7 +2442,7 @@
   u_int val;
 
 #ifdef HP100_DEBUG_B
-  printk("hp100: hp100_stop_interface %s\n",dev->name);
+  printk("hp100: %s: hp100_stop_interface\n",dev->name);
   hp100_outw( 0x4221, TRACE );
 #endif
 
@@ -2335,7 +2467,7 @@
 	    hp100_page(PERFORMANCE);
 	    return;
 	  }
-      printk( "%s: hp100_stop_interface - timeout\n", dev->name );
+      printk( "hp100: %s: hp100_stop_interface - timeout\n", dev->name );
       hp100_page(PERFORMANCE);
     }
 }
@@ -2355,7 +2487,7 @@
   hp100_orw( HP100_EEPROM_LOAD, EEPROM_CTRL );
   for ( i = 0; i < 10000; i++ )
     if ( !( hp100_inb( OPTION_MSW ) & HP100_EE_LOAD ) ) return;
-  printk( "%s: hp100_load_eeprom - timeout\n", dev->name );
+  printk( "hp100: %s: hp100_load_eeprom - timeout\n", dev->name );
 }
 
 
@@ -2375,35 +2507,32 @@
 #endif
 
   hp100_page( MAC_CTRL );
-  /* Enable Auto Selection */
-  /* hp100_orb( HP100_VG_RESET|HP100_LINK_CMD|HP100_VG_SEL, VG_LAN_CFG_1 ); */
-  /* hp100_orb( HP100_DOT3_MAC,10_LAN_CFG_2); */
-  /* hp100_orb( HP100_AUTO_MODE,MAC_CFG_3); */
-  /* Now we have to wait a while... */
-  /* for(i=0; i<5000; i++) */
-  /* { */
   val_10 = hp100_inb( 10_LAN_CFG_1 );
   val_VG = hp100_inb( VG_LAN_CFG_1 );
-  /* } */
+  hp100_page( PERFORMANCE );
 #ifdef HP100_DEBUG
-  printk( "hp100_sense_lan: val_VG = 0x%04x, val_10 = 0x%04x\n", val_VG, val_10 );
+  printk( "hp100: %s: sense_lan: val_VG = 0x%04x, val_10 = 0x%04x\n", dev->name, val_VG, val_10 );
 #endif
-  if ( val_10 & HP100_LINK_BEAT_ST ) return HP100_LAN_10;
+
+  if ( val_10 & HP100_LINK_BEAT_ST )	/* 10Mb connection is active */
+    return HP100_LAN_10;
+
+  if ( val_10 & HP100_AUI_ST )		/* have we BNC or AUI onboard? */
+    {
+      val_10 |= HP100_AUI_SEL | HP100_LOW_TH;
+      hp100_page( MAC_CTRL );
+      hp100_outb( val_10, 10_LAN_CFG_1 );
+      hp100_page( PERFORMANCE );
+      return HP100_LAN_10;
+    }
+
   if ( (lp->id->id == 0x02019F022) || 
        (lp->id->id == 0x01042103c) ||
        (lp->id->id == 0x01040103c) )
-    { 
-      hp100_page(PERFORMANCE);
-      return HP100_LAN_ERR; /* Those cards don't have a 100 Mbit connector */
-    }
-  /* for ( i = 0; i < 2500; i++ ) */
-  /*     { */
-  val_VG = hp100_inb( VG_LAN_CFG_1 );
-  hp100_page(PERFORMANCE);
+    return HP100_LAN_ERR; /* Those cards don't have a 100 Mbit connector */
 
   if ( val_VG & HP100_LINK_CABLE_ST ) /* Can hear the HUBs tone. */ 
     return HP100_LAN_100;
-  /*   } */
   return HP100_LAN_ERR;
 }
 
@@ -2418,7 +2547,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4224, TRACE );
-  printk("hp100: down_vg_link\n");
+  printk("hp100: %s: down_vg_link\n", dev->name);
 #endif
 
   hp100_page( MAC_CTRL );
@@ -2443,7 +2572,7 @@
 
 #ifdef HP100_DEBUG
   if (jiffies>=time)
-    printk("hp100_down_vg_link: Link does not go down?\n");
+    printk("hp100: %s: down_vg_link: Link does not go down?\n", dev->name);
 #endif
 
   /* To prevent condition where Rev 1 VG MAC and old hubs do not complete */
@@ -2491,7 +2620,7 @@
   if(time<=jiffies)
     {
 #ifdef HP100_DEBUG
-      printk( "hp100_down_vg_link: timeout\n" );
+      printk( "hp100: %s: down_vg_link: timeout\n", dev->name );
 #endif
       return -EIO;
     }
@@ -2513,7 +2642,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4225, TRACE );
-  printk("hp100: login_to_vg_hub\n");
+  printk("hp100: %s: login_to_vg_hub\n", dev->name);
 #endif
 
   /* Initiate a login sequence iff VG MAC is enabled and either Load Address
@@ -2525,7 +2654,7 @@
   if((force_relogin==TRUE)||(hp100_inb( MAC_CFG_4 )&HP100_MAC_SEL_ST))
     {
 #ifdef HP100_DEBUG_TRAINING
-      printk("hp100: Start training\n");
+      printk("hp100: %s: Start training\n", dev->name);
 #endif
 
       /* Ensure VG Reset bit is 1 (i.e., do not reset)*/
@@ -2540,7 +2669,7 @@
       hp100_andb( ~(HP100_LINK_CMD/* |HP100_LOAD_ADDR */), VG_LAN_CFG_1);
 
 #ifdef HP100_DEBUG_TRAINING
-      printk("hp100: Bring down the link\n");
+      printk("hp100: %s: Bring down the link\n", dev->name);
 #endif
 
       /* Wait for link to drop */
@@ -2589,13 +2718,13 @@
       if ( jiffies >= time )
 	{
 #ifdef HP100_DEBUG_TRAINING
-	  printk( "hp100: Link cable status not ok? Training aborted.\n" );
+	  printk( "hp100: %s: Link cable status not ok? Training aborted.\n", dev->name );
 #endif  
 	}
       else
 	{
 #ifdef HP100_DEBUG_TRAINING
-	  printk( "hp100: HUB tones detected. Trying to train.\n");
+	  printk( "hp100: %s: HUB tones detected. Trying to train.\n", dev->name);
 #endif
 
 	  time = jiffies + ( 2*HZ ); /* again a timeout */
@@ -2604,7 +2733,7 @@
 	    if ( (val & ( HP100_LINK_UP_ST )) )
 	      {
 #ifdef HP100_DEBUG_TRAINING
-		printk( "hp100: Passed training.\n");
+		printk( "hp100: %s: Passed training.\n", dev->name);
 #endif
 		break;
 	      }
@@ -2615,35 +2744,35 @@
       if ( (jiffies<=time) && (val & HP100_LINK_UP_ST) )
         {
 #ifdef HP100_DEBUG_TRAINING
-          printk( "hp100: Successfully logged into the HUB.\n");
+          printk( "hp100: %s: Successfully logged into the HUB.\n", dev->name);
           if(lp->chip==HP100_CHIPID_LASSEN)
             {
 	      val = hp100_inw(TRAIN_ALLOW);
-              printk( "hp100: Card supports 100VG MAC Version \"%s\" ",
-                      (hp100_inw(TRAIN_REQUEST)&HP100_CARD_MACVER) ? "802.12" : "Pre");
+              printk( "hp100: %s: Card supports 100VG MAC Version \"%s\" ",
+              	      dev->name,(hp100_inw(TRAIN_REQUEST)&HP100_CARD_MACVER) ? "802.12" : "Pre");
 	      printk( "Driver will use MAC Version \"%s\"\n",
                       ( val & HP100_HUB_MACVER) ? "802.12" : "Pre" ); 
-              printk( "hp100: Frame format is %s.\n",(val&HP100_MALLOW_FRAMEFMT)?"802.5":"802.3");
+              printk( "hp100: %s: Frame format is %s.\n",dev->name,(val&HP100_MALLOW_FRAMEFMT)?"802.5":"802.3");
             }
 #endif
         }
       else
         {
           /* If LINK_UP_ST is not set, login was not successful */
-          printk("hp100/%s: Problem logging into the HUB.\n",dev->name);
+          printk("hp100: %s: Problem logging into the HUB.\n",dev->name);
           if(lp->chip==HP100_CHIPID_LASSEN)
             {
               /* Check allowed Register to find out why there is a problem. */
               val = hp100_inw( TRAIN_ALLOW ); /* wont work on non-ETR card */
 #ifdef HP100_DEBUG_TRAINING
-              printk("hp100: MAC Configuration requested: 0x%04x, HUB allowed: 0x%04x\n", hp100_inw(TRAIN_REQUEST), val);
+              printk("hp100: %s: MAC Configuration requested: 0x%04x, HUB allowed: 0x%04x\n", dev->name, hp100_inw(TRAIN_REQUEST), val);
 #endif
               if ( val & HP100_MALLOW_ACCDENIED )
-                printk("hp100: HUB access denied.\n");
+                printk("hp100: %s: HUB access denied.\n", dev->name);
               if ( val & HP100_MALLOW_CONFIGURE )
-                printk("hp100: MAC Configuration is incompatible with the Network.\n");
+                printk("hp100: %s: MAC Configuration is incompatible with the Network.\n", dev->name);
               if ( val & HP100_MALLOW_DUPADDR )
-                printk("hp100: Duplicate MAC Address on the Network.\n");
+                printk("hp100: %s: Duplicate MAC Address on the Network.\n", dev->name);
             }
         }
       
@@ -2666,7 +2795,7 @@
         return(0); /* login was ok */
       else
         {
-          printk("hp100: Training failed.\n");
+          printk("hp100: %s: Training failed.\n", dev->name);
           hp100_down_vg_link( dev );
           return -EIO;
         }
@@ -2684,7 +2813,7 @@
 
 #ifdef HP100_DEBUG_B
   hp100_outw( 0x4226, TRACE );
-  printk("hp100: cascade_reset\n");
+  printk("hp100: %s: cascade_reset\n", dev->name);
 #endif
 
   if (enable==TRUE) 
@@ -2720,7 +2849,7 @@
   int Register;
 
   /* Dump common registers */
-  printk("hp100: Cascade Register Dump\n");
+  printk("hp100: %s: Cascade Register Dump\n", dev->name);
   printk("hardware id #1: 0x%.2x\n",hp100_inb(HW_ID));
   printk("hardware id #2/paging: 0x%.2x\n",hp100_inb(PAGING));
   printk("option #1: 0x%.4x\n",hp100_inw(OPTION_LSW));
@@ -2790,7 +2919,7 @@
   int	ret = 0;
 
   if (hp100_port == 0 && !EISA_bus && !pcibios_present())
-    printk("HP100: You should not use auto-probing with insmod!\n");
+    printk("hp100: You should not use auto-probing with insmod!\n");
 
   /* Loop on all possible base addresses */
   i = -1;
diff -r -u linux-2.1.46-orig/drivers/pci/pci.c linux-2.1.46/drivers/pci/pci.c
--- linux-2.1.46-orig/drivers/pci/pci.c	Thu Jun 26 21:33:39 1997
+++ linux-2.1.46/drivers/pci/pci.c	Thu Jul 24 12:55:12 1997
@@ -123,7 +123,7 @@
 	DEVICE( SI,		SI_5571,	"5571"),
 	DEVICE( SI,		SI_7001,	"7001"),
 	DEVICE( HP,		HP_J2585A,	"J2585A"),
-	DEVICE( HP,		HP_J2585B,	"J2585B"),
+	DEVICE( HP,		HP_J2585B,	"J2585B (Lassen)"),
 	DEVICE( PCTECH,		PCTECH_RZ1000,  "RZ1000 (buggy)"),
 	DEVICE( PCTECH,		PCTECH_RZ1001,  "RZ1001 (buggy?)"),
 	DEVICE( DPT,		DPT,		"SmartCache/Raid"),
@@ -238,6 +238,7 @@
 	DEVICE( SPECIALIX,	SPECIALIX_XIO,	"XIO/SIO host"),
 	DEVICE( SPECIALIX,	SPECIALIX_RIO,	"RIO host"),
 	DEVICE( ZORAN,		ZORAN_36120,	"ZR36120"),
+	DEVICE( COMPEX,		COMPEX_ENET100VG4, "ReadyLink ENET100-VG4"),
 	DEVICE( COMPEX,		COMPEX_RL2000,	"ReadyLink 2000"),
 	DEVICE( RP,             RP8OCTA,        "RocketPort 8 Oct"),
 	DEVICE( RP,             RP8INTF,        "RocketPort 8 Intf"),
diff -r -u linux-2.1.46-orig/include/linux/pci.h linux-2.1.46/include/linux/pci.h
--- linux-2.1.46-orig/include/linux/pci.h	Thu Jun 26 21:33:40 1997
+++ linux-2.1.46/include/linux/pci.h	Thu Jul 24 12:53:25 1997
@@ -561,6 +561,7 @@
 #define PCI_DEVICE_ID_ZORAN_36120	0x6120
 
 #define PCI_VENDOR_ID_COMPEX		0x11f6
+#define PCI_DEVICE_ID_COMPEX_ENET100VG4	0x0112
 #define PCI_DEVICE_ID_COMPEX_RL2000	0x1401
 
 #define PCI_VENDOR_ID_RP               0x11fe

