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

diff -urN linux-2.4.3-pre5/Makefile linux/Makefile
--- linux-2.4.3-pre5/Makefile	Mon Dec  3 22:32:28 2001
+++ linux/Makefile	Mon Dec  3 22:32:37 2001
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 3
-EXTRAVERSION =-pre5
+EXTRAVERSION =-pre6
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.4.3-pre5/arch/i386/mm/ioremap.c linux/arch/i386/mm/ioremap.c
--- linux-2.4.3-pre5/arch/i386/mm/ioremap.c	Mon Dec  3 22:32:28 2001
+++ linux/arch/i386/mm/ioremap.c	Mon Dec  3 22:32:38 2001
@@ -62,6 +62,7 @@
 static int remap_area_pages(unsigned long address, unsigned long phys_addr,
 				 unsigned long size, unsigned long flags)
 {
+	int error;
 	pgd_t * dir;
 	unsigned long end = address + size;
 
@@ -70,19 +71,23 @@
 	flush_cache_all();
 	if (address >= end)
 		BUG();
+	spin_lock(&init_mm.page_table_lock);
 	do {
 		pmd_t *pmd;
 		pmd = pmd_alloc(&init_mm, dir, address);
+		error = -ENOMEM;
 		if (!pmd)
-			return -ENOMEM;
+			break;
 		if (remap_area_pmd(pmd, address, end - address,
 					 phys_addr + address, flags))
-			return -ENOMEM;
+			break;
+		error = 0;
 		address = (address + PGDIR_SIZE) & PGDIR_MASK;
 		dir++;
 	} while (address && (address < end));
+	spin_unlock(&init_mm.page_table_lock);
 	flush_tlb_all();
-	return 0;
+	return error;
 }
 
 /*
diff -urN linux-2.4.3-pre5/drivers/char/drm/drmP.h linux/drivers/char/drm/drmP.h
--- linux-2.4.3-pre5/drivers/char/drm/drmP.h	Wed Feb 21 16:10:25 2001
+++ linux/drivers/char/drm/drmP.h	Mon Dec  3 22:32:38 2001
@@ -43,6 +43,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/miscdevice.h>
+#include <linux/major.h>
 #include <linux/fs.h>
 #include <linux/proc_fs.h>
 #include <linux/init.h>
diff -urN linux-2.4.3-pre5/drivers/ieee1394/pcilynx.c linux/drivers/ieee1394/pcilynx.c
--- linux-2.4.3-pre5/drivers/ieee1394/pcilynx.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/ieee1394/pcilynx.c	Mon Dec  3 22:32:38 2001
@@ -470,8 +470,6 @@
         lynx->phy_reg0 = -1;
 
         lynx->async.queue = NULL;
-        spin_lock_init(&lynx->async.queue_lock);
-        spin_lock_init(&lynx->phy_reg_lock);
         
         pcl.next = pcl_bus(lynx, lynx->rcv_pcl);
         put_pcl(lynx, lynx->rcv_pcl_start, &pcl);
@@ -1357,7 +1355,10 @@
         lynx->id = num_of_cards-1;
         lynx->dev = dev;
 
-        if (!pci_dma_supported(dev, 0xffffffff)) {
+	lynx->lock = SPIN_LOCK_UNLOCKED;
+	lynx->phy_reg_lock = SPIN_LOCK_UNLOCKED;
+
+        if (pci_set_dma_mask(dev, 0xffffffff)) {
                 FAIL("DMA address limits not supported for PCILynx hardware %d",
                      lynx->id);
         }
@@ -1456,8 +1457,6 @@
         lynx->iso_rcv.pcl_start = alloc_pcl(lynx);
 
         /* all allocations successful - simple init stuff follows */
-
-        lynx->lock = SPIN_LOCK_UNLOCKED;
 
         reg_write(lynx, PCI_INT_ENABLE, PCI_INT_DMA_ALL);
 
diff -urN linux-2.4.3-pre5/drivers/net/3c505.c linux/drivers/net/3c505.c
--- linux-2.4.3-pre5/drivers/net/3c505.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/3c505.c	Mon Dec  3 22:32:38 2001
@@ -601,15 +601,16 @@
 		printk("%s: memory squeeze, dropping packet\n", dev->name);
 		target = adapter->dma_buffer;
 		adapter->current_dma.target = NULL;
+		return;
+	}
+
+	skb_reserve(skb, 2);
+	target = skb_put(skb, rlen);
+	if (virt_to_bus(target + rlen) >= MAX_DMA_ADDRESS) {
+		adapter->current_dma.target = target;
+		target = adapter->dma_buffer;
 	} else {
-		skb_reserve(skb, 2);
-		target = skb_put(skb, rlen);
-		if (virt_to_bus(target + rlen) >= MAX_DMA_ADDRESS) {
-			adapter->current_dma.target = target;
-			target = adapter->dma_buffer;
-		} else {
-			adapter->current_dma.target = NULL;
-		}
+		adapter->current_dma.target = NULL;
 	}
 
 	/* if this happens, we die */
diff -urN linux-2.4.3-pre5/drivers/net/3c515.c linux/drivers/net/3c515.c
--- linux-2.4.3-pre5/drivers/net/3c515.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/3c515.c	Mon Dec  3 22:32:38 2001
@@ -46,6 +46,7 @@
 #define RX_RING_SIZE	16
 #define PKT_BUF_SZ		1536	/* Size of each temporary Rx buffer. */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/isapnp.h>
@@ -418,7 +419,7 @@
 		printk(version);
 
 	root_corkscrew_dev = NULL;
-	cards_found = corkscrew_scan(0);
+	cards_found = corkscrew_scan(NULL);
 	return cards_found ? 0 : -ENODEV;
 }
 
@@ -589,11 +590,11 @@
 	ether_setup(dev);
 	vp->next_module = root_corkscrew_dev;
 	root_corkscrew_dev = dev;
+	SET_MODULE_OWNER(dev);
 	if (register_netdev(dev) != 0) {
 		kfree(dev);
 		return NULL;
 	}
-	SET_MODULE_OWNER(dev);
 #else				/* not a MODULE */
 	/* Caution: quad-word alignment required for rings! */
 	dev->priv =
diff -urN linux-2.4.3-pre5/drivers/net/appletalk/cops.c linux/drivers/net/appletalk/cops.c
--- linux-2.4.3-pre5/drivers/net/appletalk/cops.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/appletalk/cops.c	Mon Dec  3 22:32:38 2001
@@ -752,8 +752,8 @@
 {
         int pkt_len = 0;
         int rsp_type = 0;
-        struct sk_buff *skb;
-        struct cops_local *lp = (struct cops_local *)dev->priv;
+        struct sk_buff *skb = NULL;
+        struct cops_local *lp = dev->priv;
         int ioaddr = dev->base_addr;
         int boguscount = 0;
         unsigned long flags;
@@ -771,6 +771,7 @@
                 /* Wait for DMA to turn around. */
                 while(++boguscount<1000000)
                 {
+			barrier();
                         if((inb(ioaddr+DAYNA_CARD_STATUS)&0x03)==DAYNA_RX_READY)
                                 break;
                 }
@@ -801,6 +802,7 @@
                 lp->stats.rx_dropped++;
                 while(pkt_len--)        /* Discard packet */
                         inb(ioaddr);
+		restore_flags(flags);
                 return;
         }
         skb->dev = dev;
@@ -820,7 +822,7 @@
 		printk(KERN_WARNING "%s: Bad packet length of %d bytes.\n", 
 			dev->name, pkt_len);
                 lp->stats.tx_errors++;
-                kfree_skb(skb);
+                dev_kfree_skb_any(skb);
                 return;
         }
 
@@ -828,7 +830,7 @@
         if(rsp_type == LAP_INIT_RSP)
         {	/* Nodeid taken from received packet. */
                 lp->node_acquire = skb->data[0];
-                kfree_skb(skb);
+                dev_kfree_skb_any(skb);
                 return;
         }
 
@@ -837,7 +839,7 @@
         {
                 printk(KERN_WARNING "%s: Bad packet type %d.\n", dev->name, rsp_type);
                 lp->stats.tx_errors++;
-                kfree_skb(skb);
+                dev_kfree_skb_any(skb);
                 return;
         }
 
diff -urN linux-2.4.3-pre5/drivers/net/declance.c linux/drivers/net/declance.c
--- linux-2.4.3-pre5/drivers/net/declance.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/declance.c	Mon Dec  3 22:32:38 2001
@@ -554,6 +554,7 @@
 	ib = (struct lance_init_block *) (dev->mem_start);
 
 #ifdef TEST_HITS
+	{
 	int i;
 
 	printk("[");
@@ -566,8 +567,10 @@
 			       ib->brx_ring[i].rmd1_bits & LE_R1_OWN ? "." : "1");
 	}
 	printk("]");
+	}
 #endif
 
+
 	for (rd = &ib->brx_ring[lp->rx_new];
 	     !((bits = rd->rmd1_bits) & LE_R1_OWN);
 	     rd = &ib->brx_ring[lp->rx_new]) {
@@ -608,9 +611,11 @@
 			skb->dev = dev;
 			skb_reserve(skb, 2);	/* 16 byte align */
 			skb_put(skb, len);	/* make room */
+
 			cp_from_buf(skb->data,
 				 (char *) lp->rx_buf_ptr_cpu[lp->rx_new],
 				    len);
+
 			skb->protocol = eth_type_trans(skb, dev);
 			netif_rx(skb);
 			dev->last_rx = jiffies;
@@ -656,7 +661,7 @@
 
 			if (status & LE_T3_CLOS) {
 				lp->stats.tx_carrier_errors++;
-				printk("%s: Carrier Lost", dev->name);
+				printk("%s: Carrier Lost\n", dev->name);
 				/* Stop the lance */
 				writereg(&ll->rap, LE_CSR0);
 				writereg(&ll->rdp, LE_C0_STOP);
@@ -741,7 +746,7 @@
 	if (csr0 & LE_C0_MERR) {
 		volatile unsigned long int_stat = *(unsigned long *) (system_base + IOCTL + SIR);
 
-		printk("%s: Memory error, status %04x", dev->name, csr0);
+		printk("%s: Memory error, status %04x\n", dev->name, csr0);
 
 		if (int_stat & LANCE_DMA_MEMRDERR) {
 			printk("%s: DMA error\n", dev->name);
@@ -759,6 +764,7 @@
 		init_restart_lance(lp);
 		netif_wake_queue(dev);
 	}
+
 	writereg(&ll->rdp, LE_C0_INEA);
 	writereg(&ll->rdp, LE_C0_INEA);
 }
@@ -774,11 +780,6 @@
 
 	last_dev = dev;
 
-	/* Associate IRQ with lance_interrupt */
-	if (request_irq(dev->irq, &lance_interrupt, 0, lp->name, dev)) {
-		printk("Lance: Can't get irq %d\n", dev->irq);
-		return -EAGAIN;
-	}
 	/* Stop the Lance */
 	writereg(&ll->rap, LE_CSR0);
 	writereg(&ll->rdp, LE_C0_STOP);
@@ -798,6 +799,12 @@
 
 	netif_start_queue(dev);
 
+	/* Associate IRQ with lance_interrupt */
+	if (request_irq(dev->irq, &lance_interrupt, 0, lp->name, dev)) {
+		printk("Lance: Can't get irq %d\n", dev->irq);
+		return -EAGAIN;
+	}
+
 	status = init_restart_lance(lp);
 
 	/*
@@ -1036,10 +1043,13 @@
 		/*
 		 * FIXME: ugly hack!
 		 */
-		dev->mem_start = KSEG1ADDR(0x0020000);
+		dev->mem_start = KSEG1ADDR(0x00020000);
 		dev->mem_end = dev->mem_start + 0x00020000;
 		dev->irq = ETHER;
 		esar_base = system_base + ESAR;
+	
+		/* Workaround crash with booting KN04 2.1k from Disk */
+		memset(dev->mem_start, 0, dev->mem_end - dev->mem_start);
 
 		/*
 		 * setup the pointer arrays, this sucks [tm] :-(
@@ -1212,6 +1222,7 @@
 #ifdef MODULE
 	root_lance_dev = NULL;
 #endif
+
 
 #ifdef CONFIG_TC
 	int slot = -1;
diff -urN linux-2.4.3-pre5/drivers/net/defxx.c linux/drivers/net/defxx.c
--- linux-2.4.3-pre5/drivers/net/defxx.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/defxx.c	Mon Dec  3 22:32:38 2001
@@ -2652,28 +2652,6 @@
 	}
 
 /*
- * =================
- * = dfx_alloc_skb =
- * =================
- *
- * Overview:
- *   Allocate an skbuff for sending.
- *
- * Functional Description:
- *  Same as dev_alloc_skb(), but it may sleep.
- */
-
-static inline struct sk_buff *dfx_alloc_skb(unsigned int length)
-{
-	struct sk_buff *skb;
-
-	skb = alloc_skb(length + 16, GFP_BUFFER);
-	if (skb)
-		skb_reserve(skb, 16);
-	return skb;
-}
-
-/*
  *	Align an sk_buff to a boundary power of 2
  *
  */
@@ -2751,7 +2729,7 @@
 	for (i = 0; i < (int)(bp->rcv_bufs_to_post); i++)
 		for (j = 0; (i + j) < (int)PI_RCV_DATA_K_NUM_ENTRIES; j += bp->rcv_bufs_to_post)
 		{
-			struct sk_buff *newskb = dfx_alloc_skb(NEW_SKB_SIZE);
+			struct sk_buff *newskb = __dev_alloc_skb(NEW_SKB_SIZE, GFP_BUFFER);
 			if (!newskb)
 				return -ENOMEM;
 			bp->descr_block_virt->rcv_data[i+j].long_0 = (u32) (PI_RCV_DESCR_M_SOP |
@@ -2761,7 +2739,7 @@
 			 * the old EISA boards.
 			 */
 			 
-			my_skb_align(newskb,128);
+			my_skb_align(newskb, 128);
 			bp->descr_block_virt->rcv_data[i+j].long_1 = virt_to_bus(newskb->data);
 			/*
 			 * p_rcv_buff_va is only used inside the
diff -urN linux-2.4.3-pre5/drivers/net/dmfe.c linux/drivers/net/dmfe.c
--- linux-2.4.3-pre5/drivers/net/dmfe.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/dmfe.c	Mon Dec  3 22:32:38 2001
@@ -130,9 +130,9 @@
 #define DMFE_TIMER_WUT  (HZ)	/* timer wakeup time : 1 second */
 #define DMFE_TX_TIMEOUT ((HZ*3)/2)	/* tx packet time-out time 1.5 s" */
 
-#define DMFE_DBUG(dbug_now, msg, vaule)	\
+#define DMFE_DBUG(dbug_now, msg, value)	\
 	if (dmfe_debug || dbug_now)	\
-		printk("DBUG: %s %x\n", msg, vaule)
+		printk("DBUG: %s %x\n", msg, value)
 
 #define SHOW_MEDIA_TYPE(mode) \
  	printk(KERN_WARNING "dmfe: Change Speed to %sMhz %s duplex\n",	\
@@ -1139,7 +1139,7 @@
 }
 
 /*
-   Update CR6 vaule
+   Update CR6 value
    Firstly stop DM910X , then written value and start
  */
 static void update_cr6(u32 cr6_data, u32 ioaddr)
diff -urN linux-2.4.3-pre5/drivers/net/eexpress.c linux/drivers/net/eexpress.c
--- linux-2.4.3-pre5/drivers/net/eexpress.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/eexpress.c	Mon Dec  3 22:32:38 2001
@@ -592,7 +592,7 @@
 
 	status = scb_status(dev);
 	unstick_cu(dev);
-	printk(KERN_INFO "%s: transmit timed out, %s?", dev->name,
+	printk(KERN_INFO "%s: transmit timed out, %s?\n", dev->name,
 	       (SCB_complete(status)?"lost interrupt":
 		"board on fire"));
 	lp->stats.tx_errors++;
diff -urN linux-2.4.3-pre5/drivers/net/epic100.c linux/drivers/net/epic100.c
--- linux-2.4.3-pre5/drivers/net/epic100.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/epic100.c	Mon Dec  3 22:32:38 2001
@@ -425,7 +425,7 @@
 	outl(0x0008, ioaddr + TEST1);
 
 	/* Turn on the MII transceiver. */
-	outl(0x12, ioaddr + MIICfg);
+	outl(dev->if_port == 1 ? 0x13 : 0x12, ioaddr + MIICfg);
 	if (chip_idx == 1)
 		outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);
 	outl(0x0200, ioaddr + GENCTL);
@@ -638,7 +638,7 @@
 	   required by the details of which bits are reset and the transceiver
 	   wiring on the Ositech CardBus card.
 	*/
-	outl(0x12, ioaddr + MIICfg);
+	outl(dev->if_port == 1 ? 0x13 : 0x12, ioaddr + MIICfg);
 	if (ep->chip_flags & MII_PWRDWN)
 		outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);
 
@@ -666,7 +666,6 @@
 				printk(KERN_INFO "%s: Using the 10base2 transceiver, MII "
 					   "status %4.4x.\n",
 					   dev->name, mdio_read(dev, ep->phys[0], 1));
-			outl(0x13, ioaddr + MIICfg);
 		}
 	} else {
 		int mii_reg5 = mdio_read(dev, ep->phys[0], 5);
@@ -1403,6 +1402,8 @@
 	struct net_device *dev = pci_get_drvdata(pdev);
 	long ioaddr = dev->base_addr;
 
+	if (!netif_running(dev))
+		return;
 	epic_pause(dev);
 	/* Put the chip into low-power mode. */
 	outl(0x0008, ioaddr + GENCTL);
@@ -1414,6 +1415,8 @@
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 
+	if (!netif_running(dev))
+		return;
 	epic_restart(dev);
 	/* pci_power_on(pdev); */
 }
diff -urN linux-2.4.3-pre5/drivers/net/eql.c linux/drivers/net/eql.c
--- linux-2.4.3-pre5/drivers/net/eql.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/eql.c	Mon Dec  3 22:32:38 2001
@@ -197,7 +197,7 @@
 
 static int __init eql_init(struct net_device *dev)
 {
-	static unsigned version_printed = 0;
+	static unsigned version_printed;
 	/* static unsigned num_masters     = 0; */
 	equalizer_t *eql = 0;
 
@@ -721,6 +721,9 @@
 
 static int eql_insert_slave(slave_queue_t *queue, slave_t *slave)
 {
+	unsigned long flags;
+
+	save_flags(flags);
 	cli ();
 
 	if ( ! eql_is_full (queue) )
@@ -736,10 +739,10 @@
 		slave->next = queue->head->next;
 		queue->head->next = slave;
 		queue->num_slaves++;
-		sti ();
+		restore_flags(flags);
 		return 0;
 	}
-	sti ();
+	restore_flags(flags);
 	return 1;
 }
 
@@ -748,7 +751,9 @@
 {
 	slave_t *prev;
 	slave_t *curr;
+	unsigned long flags;
 
+	save_flags(flags);
 	cli ();
 
 	prev = queue->head;
@@ -766,10 +771,10 @@
 		prev->next = curr->next;
 		queue->num_slaves--;
 		curr->dev->flags = curr->dev->flags & ~IFF_SLAVE;
-		sti();
+		restore_flags(flags);
 		return curr;
 	}
-	sti ();
+	restore_flags(flags);
 	return 0;			/* not found */
 }
 
@@ -784,6 +789,9 @@
 
 	if (target != 0)
 	{
+		unsigned long flags;
+
+		save_flags(flags);
 		cli ();
 		prev = queue->head;
 		curr = prev->next;
@@ -794,7 +802,7 @@
 		}
 		prev->next = curr->next;
 		queue->num_slaves--;
-		sti ();
+		restore_flags(flags);
 		eql_delete_slave (curr);
 		return 0;
 	}
@@ -847,8 +855,10 @@
 		 */
 		unsigned long best_load = (unsigned long) ULONG_MAX;
 		slave_t *slave = 0;
+		unsigned long flags;
 		int i;
 
+		save_flags(flags);
 		cli ();
 		for (i = 1, slave = eql_first_slave (queue);
 			i <= eql_number_slaves (queue);
@@ -895,7 +905,7 @@
 				}
 			}
 		} /* for */
-		sti ();
+		restore_flags(flags);
 		eql_set_best_slave (queue, best_slave);
 	} /* else */
 	if (slave_corpse != 0)
@@ -948,9 +958,11 @@
 	slave_t *slave;
 	slave_t *slave_corpse = 0;
 	int i;
+	unsigned long flags;
 	
 	if ( ! eql_is_empty (eql->queue) )
 	{
+		save_flags(flags);
 		cli ();
 		for (i = 1, slave = eql_first_slave (eql->queue);
 			i <= eql_number_slaves (eql->queue);
@@ -968,7 +980,7 @@
 					slave_corpse = slave;
 			}
 		}
-		sti ();
+		restore_flags(flags);
 		if (slave_corpse != 0)
 		{
 			printk ("eql: timer found dead slave, burying...\n");
diff -urN linux-2.4.3-pre5/drivers/net/fc/iph5526.c linux/drivers/net/fc/iph5526.c
--- linux-2.4.3-pre5/drivers/net/fc/iph5526.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/fc/iph5526.c	Mon Dec  3 22:32:38 2001
@@ -1074,11 +1074,11 @@
 			fi->fc_stats.rx_dropped++;
 			fi->g.mfs_buffer_count += no_of_buffers;
 			if (fi->g.mfs_buffer_count >= NO_OF_ENTRIES) {
-			int count = fi->g.mfs_buffer_count / NO_OF_ENTRIES;
+				int count = fi->g.mfs_buffer_count / NO_OF_ENTRIES;
 				fi->g.mfs_buffer_count -= NO_OF_ENTRIES * count;
 				update_MFSBQ_indx(fi, count);
-				return;
 			}
+			return;
 		}
 		if (wrap_around) {
 		int wrap_size = no_of_wrap_buffs * MFS_BUFFER_SIZE;
diff -urN linux-2.4.3-pre5/drivers/net/hamradio/scc.c linux/drivers/net/hamradio/scc.c
--- linux-2.4.3-pre5/drivers/net/hamradio/scc.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/hamradio/scc.c	Mon Dec  3 22:32:38 2001
@@ -582,7 +582,7 @@
 		
 		if (skb != NULL) 
 			dev_kfree_skb_irq(skb);
-		scc->rx_buff = NULL;
+		scc->rx_buff = skb = NULL;
 	}
 
 	if(status & END_FR && skb != NULL)	/* end of frame */
diff -urN linux-2.4.3-pre5/drivers/net/hamradio/soundmodem/gentbl.c linux/drivers/net/hamradio/soundmodem/gentbl.c
--- linux-2.4.3-pre5/drivers/net/hamradio/soundmodem/gentbl.c	Thu Jun 25 12:25:16 1998
+++ linux/drivers/net/hamradio/soundmodem/gentbl.c	Mon Dec  3 22:32:38 2001
@@ -26,6 +26,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <math.h>
 #include <string.h>
 
diff -urN linux-2.4.3-pre5/drivers/net/ioc3-eth.c linux/drivers/net/ioc3-eth.c
--- linux-2.4.3-pre5/drivers/net/ioc3-eth.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/ioc3-eth.c	Mon Dec  3 22:32:38 2001
@@ -67,11 +67,16 @@
 #include <asm/sn/sn0/ip27.h>
 #include <asm/pci/bridge.h>
 
-/* 32 RX buffers.  This is tunable in the range of 16 <= x < 512.  */
+/*
+ * 32 RX buffers.  This is tunable in the range of 16 <= x < 512.  The
+ * value must be a power of two.
+ */
 #define RX_BUFFS 64
 
-/* Private ioctls that de facto are well known and used for examply
-   by mii-tool.  */
+/*
+ * Private ioctls that de facto are well known and used for examply
+ * by mii-tool.
+ */
 #define SIOCGMIIPHY (SIOCDEVPRIVATE)	/* Read from current PHY */
 #define SIOCGMIIREG (SIOCDEVPRIVATE+1)	/* Read any PHY register */
 #define SIOCSMIIREG (SIOCDEVPRIVATE+2)	/* Write any PHY register */
@@ -707,8 +712,10 @@
 
 	if (ip->rxr == NULL) {
 		/* Allocate and initialize rx ring.  4kb = 512 entries  */
-		ip->rxr = (unsigned long *) get_free_page(GFP_KERNEL|GFP_ATOMIC);
+		ip->rxr = (unsigned long *) get_free_page(GFP_ATOMIC);
 		rxr = (unsigned long *) ip->rxr;
+		if (!rxr)
+			printk("ioc3_alloc_rings(): get_free_page() failed!\n");
 
 		/* Now the rx buffers.  The RX ring may be larger but
 		   we only allocate 16 buffers for now.  Need to tune
@@ -738,7 +745,9 @@
 
 	if (ip->txr == NULL) {
 		/* Allocate and initialize tx rings.  16kb = 128 bufs.  */
-		ip->txr = (struct ioc3_etxd *)__get_free_pages(GFP_KERNEL|GFP_ATOMIC, 2);
+		ip->txr = (struct ioc3_etxd *)__get_free_pages(GFP_KERNEL, 2);
+		if (!ip->txr)
+			printk("ioc3_alloc_rings(): get_free_page() failed!\n");
 		ip->tx_pi = 0;
 		ip->tx_ci = 0;
 	}
@@ -880,10 +889,11 @@
 	return 0;
 }
 
-static int ioc3_pci_init(struct pci_dev *pdev)
+static int __devinit ioc3_probe(struct pci_dev *pdev,
+	                        const struct pci_device_id *ent)
 {
 	u16 mii0, mii_status, mii2, mii3, mii4;
-	struct net_device *dev = NULL;	// XXX
+	struct net_device *dev = NULL;
 	struct ioc3_private *ip;
 	struct ioc3 *ioc3;
 	unsigned long ioc3_base, ioc3_size;
@@ -974,32 +984,32 @@
 	return err;
 }
 
-static int __init ioc3_probe(void)
+static void __devexit eepro100_remove_one (struct pci_dev *pdev)
 {
-	static int called;
-	int cards = 0;
-
-	if (called)
-		return -ENODEV;
-	called = 1;
+	/* Later ... */
+}
 
-	if (pci_present()) {
-		struct pci_dev *pdev = NULL;
+static struct pci_device_id ioc3_pci_tbl[] __devinitdata = {
+	{ PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3, PCI_ANY_ID, PCI_ANY_ID },
+	{ 0 }
+};
+MODULE_DEVICE_TABLE(pci, ioc3_pci_tbl);
 
-		while ((pdev = pci_find_device(PCI_VENDOR_ID_SGI,
-		                               PCI_DEVICE_ID_SGI_IOC3, pdev))) {
-			if (ioc3_pci_init(pdev))
-				return -ENOMEM;
-			cards++;
-		}
-	}
+static struct pci_driver ioc3_driver = {
+	name:		"ioc3-eth",
+	id_table:	ioc3_pci_tbl,
+	probe:		ioc3_probe,
+	/* remove:		ioc3_remove_one, */
+};
 
-	return cards ? -ENODEV : 0;
+static int __init ioc3_init_module(void)
+{
+	return pci_module_init(&ioc3_driver);
 }
 
 static void __exit ioc3_cleanup_module(void)
 {
-	/* Later, when we really support modules.  */
+	pci_unregister_driver(&ioc3_driver);
 }
 
 static int
@@ -1200,5 +1210,5 @@
 MODULE_AUTHOR("Ralf Baechle <ralf@oss.sgi.com>");
 MODULE_DESCRIPTION("SGI IOC3 Ethernet driver");
 
-module_init(ioc3_probe);
+module_init(ioc3_init_module);
 module_exit(ioc3_cleanup_module);
diff -urN linux-2.4.3-pre5/drivers/net/irda/irport.c linux/drivers/net/irda/irport.c
--- linux-2.4.3-pre5/drivers/net/irda/irport.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/irda/irport.c	Mon Dec  3 22:32:38 2001
@@ -609,7 +609,7 @@
  *
  *    Transmits the current frame until FIFO is full, then
  *    waits until the next transmitt interrupt, and continues until the
- *    frame is transmited.
+ *    frame is transmitted.
  */
 int irport_hard_xmit(struct sk_buff *skb, struct net_device *dev)
 {
@@ -1008,7 +1008,7 @@
 
 #ifdef MODULE
 MODULE_PARM(io, "1-4i");
-MODULE_PARM_DESC(io, "Base I/O adresses");
+MODULE_PARM_DESC(io, "Base I/O addresses");
 MODULE_PARM(irq, "1-4i");
 MODULE_PARM_DESC(irq, "IRQ lines");
 
diff -urN linux-2.4.3-pre5/drivers/net/irda/irtty.c linux/drivers/net/irda/irtty.c
--- linux-2.4.3-pre5/drivers/net/irda/irtty.c	Thu Feb  8 15:14:08 2001
+++ linux/drivers/net/irda/irtty.c	Mon Dec  3 22:32:38 2001
@@ -824,7 +824,7 @@
 /*
  * Function irtty_raw_read (self, buf, len)
  *
- *    Receive incomming data. This function sleeps, so it must only be
+ *    Receive incoming data. This function sleeps, so it must only be
  *    called with a process context. Timeout is currently defined to be
  *    a multiple of 10 ms.
  */
diff -urN linux-2.4.3-pre5/drivers/net/irda/nsc-ircc.c linux/drivers/net/irda/nsc-ircc.c
--- linux-2.4.3-pre5/drivers/net/irda/nsc-ircc.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/irda/nsc-ircc.c	Mon Dec  3 22:32:38 2001
@@ -1263,7 +1263,7 @@
  * Function nsc_ircc_pio_xmit (self, iobase)
  *
  *    Transmit data using PIO. Returns the number of bytes that actually
- *    got transfered
+ *    got transferred
  *
  */
 static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
diff -urN linux-2.4.3-pre5/drivers/net/irda/smc-ircc.c linux/drivers/net/irda/smc-ircc.c
--- linux-2.4.3-pre5/drivers/net/irda/smc-ircc.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/irda/smc-ircc.c	Mon Dec  3 22:32:38 2001
@@ -560,7 +560,7 @@
 		 */
 		/* outb(UART_MCR_OUT2, self->io.sir_base + UART_MCR); */
 
-		/* Be ready for incomming frames */
+		/* Be ready for incoming frames */
 		ircc_dma_receive(self, iobase);
 	} else {
 		/* Install SIR transmit handler */
diff -urN linux-2.4.3-pre5/drivers/net/irda/w83977af_ir.c linux/drivers/net/irda/w83977af_ir.c
--- linux-2.4.3-pre5/drivers/net/irda/w83977af_ir.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/irda/w83977af_ir.c	Mon Dec  3 22:32:38 2001
@@ -875,7 +875,7 @@
 				self->stats.rx_fifo_errors++;
 			
 		} else {
-			/* Check if we have transfered all data to memory */
+			/* Check if we have transferred all data to memory */
 			switch_bank(iobase, SET0);
 			if (inb(iobase+USR) & USR_RDR) {
 #ifdef CONFIG_USE_INTERNAL_TIMER
diff -urN linux-2.4.3-pre5/drivers/net/mace.c linux/drivers/net/mace.c
--- linux-2.4.3-pre5/drivers/net/mace.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/mace.c	Mon Dec  3 22:32:38 2001
@@ -87,7 +87,7 @@
 /*
  * If we can't get a skbuff when we need it, we use this area for DMA.
  */
-static unsigned char dummy_buf[RX_BUFLEN+2];
+static unsigned char *dummy_buf;
 
 /* Bit-reverse one byte of an ethernet hardware address. */
 static inline int
@@ -106,7 +106,7 @@
 
 	for (mace = find_devices("mace"); mace != NULL; mace = mace->next)
 		mace_probe1(mace);
-	return 0;
+	return mace_devs? 0: -ENODEV;
 }
 
 static void __init mace_probe1(struct device_node *mace)
@@ -132,6 +132,14 @@
 		}
 	}
 
+	if (dummy_buf == NULL) {
+		dummy_buf = kmalloc(RX_BUFLEN+2, GFP_KERNEL);
+		if (dummy_buf == NULL) {
+			printk(KERN_ERR "MACE: couldn't allocate dummy buffer\n");
+			return;
+		}
+	}
+
 	dev = init_etherdev(0, PRIV_BYTES);
 	if (!dev)
 		return;
@@ -897,6 +905,10 @@
 
 	unregister_netdev(dev);
 	kfree(dev);
+    }
+    if (dummy_buf != NULL) {
+	kfree(dummy_buf);
+	dummy_buf = NULL;
     }
 }
 
diff -urN linux-2.4.3-pre5/drivers/net/pci-skeleton.c linux/drivers/net/pci-skeleton.c
--- linux-2.4.3-pre5/drivers/net/pci-skeleton.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/pci-skeleton.c	Mon Dec  3 22:32:38 2001
@@ -812,12 +812,6 @@
 	/* Put the chip into low-power mode. */
 	NETDRV_W8_F (Cfg9346, Cfg9346_Unlock);
 
-	tmp = NETDRV_R8 (Config1) & Config1Clear;
-	tmp |= (tp->chipset == CH_8139B) ? 3 : 1; /* Enable PM/VPD */
-	NETDRV_W8_F (Config1, tmp);
-
-	NETDRV_W8_F (HltClk, 'H');	/* 'R' would leave the clock running. */
-
 	/* The lower four bits are the media type. */
 	option = (board_idx > 7) ? 0 : media[board_idx];
 	if (option > 0) {
@@ -989,7 +983,7 @@
 
 static int mdio_read (struct net_device *dev, int phy_id, int location)
 {
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	void *mdio_addr = tp->mmio_addr + Config4;
 	int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location;
 	int retval = 0;
@@ -1032,7 +1026,7 @@
 static void mdio_write (struct net_device *dev, int phy_id, int location,
 			int value)
 {
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	void *mdio_addr = tp->mmio_addr + Config4;
 	int mii_cmd =
 	    (0x5002 << 16) | (phy_id << 23) | (location << 18) | value;
@@ -1075,7 +1069,7 @@
 
 static int netdrv_open (struct net_device *dev)
 {
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	int retval;
 #ifdef NETDRV_DEBUG
 	void *ioaddr = tp->mmio_addr;
@@ -1136,7 +1130,7 @@
 /* Start the hardware at open or resume. */
 static void netdrv_hw_start (struct net_device *dev)
 {
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	void *ioaddr = tp->mmio_addr;
 	u32 i;
 	u8 tmp;
@@ -1173,27 +1167,6 @@
 
 	tp->cur_rx = 0;
 
-	if (tp->chipset >= CH_8139A) {
-		tmp = NETDRV_R8 (Config1) & Config1Clear;
-		tmp |= Cfg1_Driver_Load;
-		tmp |= (tp->chipset == CH_8139B) ? 3 : 1; /* Enable PM/VPD */
-		NETDRV_W8_F (Config1, tmp);
-	} else {
-		u8 foo = NETDRV_R8 (Config1) & Config1Clear;
-		NETDRV_W8 (Config1, tp->full_duplex ? (foo|0x60) : (foo|0x20));
-	}
-
-	if (tp->chipset >= CH_8139B) {
-		tmp = NETDRV_R8 (Config4) & ~(1<<2);
-		/* chip will clear Rx FIFO overflow automatically */
-		tmp |= (1<<7);
-		NETDRV_W8 (Config4, tmp);
-
-		/* disable magic packet scanning, which is enabled
-		 * when PM is enabled above (Config1) */
-		NETDRV_W8 (Config3, NETDRV_R8 (Config3) & ~(1<<5));
-	}
-
 	/* Lock Config[01234] and BMCR register writes */
 	NETDRV_W8_F (Cfg9346, Cfg9346_Lock);
 	udelay (10);
@@ -1228,7 +1201,7 @@
 /* Initialize the Rx and Tx rings, along with various 'dev' bits. */
 static void netdrv_init_ring (struct net_device *dev)
 {
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	int i;
 
 	DPRINTK ("ENTER\n");
@@ -1247,104 +1220,10 @@
 }
 
 
-#ifndef NETDRV_TUNE_TWISTER
-static inline void netdrv_tune_twister (struct net_device *dev,
-				  struct netdrv_private *tp) {}
-#else
-static void netdrv_tune_twister (struct net_device *dev,
-				  struct netdrv_private *tp)
-{
-	int linkcase;
-
-	DPRINTK ("ENTER\n");
-
-	/* This is a complicated state machine to configure the "twister" for
-	   impedance/echos based on the cable length.
-	   All of this is magic and undocumented.
-	 */
-	switch (tp->twistie) {
-	case 1:
-		if (NETDRV_R16 (CSCR) & CSCR_LinkOKBit) {
-			/* We have link beat, let us tune the twister. */
-			NETDRV_W16 (CSCR, CSCR_LinkDownOffCmd);
-			tp->twistie = 2;	/* Change to state 2. */
-			next_tick = HZ / 10;
-		} else {
-			/* Just put in some reasonable defaults for when beat returns. */
-			NETDRV_W16 (CSCR, CSCR_LinkDownCmd);
-			NETDRV_W32 (FIFOTMS, 0x20);	/* Turn on cable test mode. */
-			NETDRV_W32 (PARA78, PARA78_default);
-			NETDRV_W32 (PARA7c, PARA7c_default);
-			tp->twistie = 0;	/* Bail from future actions. */
-		}
-		break;
-	case 2:
-		/* Read how long it took to hear the echo. */
-		linkcase = NETDRV_R16 (CSCR) & CSCR_LinkStatusBits;
-		if (linkcase == 0x7000)
-			tp->twist_row = 3;
-		else if (linkcase == 0x3000)
-			tp->twist_row = 2;
-		else if (linkcase == 0x1000)
-			tp->twist_row = 1;
-		else
-			tp->twist_row = 0;
-		tp->twist_col = 0;
-		tp->twistie = 3;	/* Change to state 2. */
-		next_tick = HZ / 10;
-		break;
-	case 3:
-		/* Put out four tuning parameters, one per 100msec. */
-		if (tp->twist_col == 0)
-			NETDRV_W16 (FIFOTMS, 0);
-		NETDRV_W32 (PARA7c, param[(int) tp->twist_row]
-			 [(int) tp->twist_col]);
-		next_tick = HZ / 10;
-		if (++tp->twist_col >= 4) {
-			/* For short cables we are done.
-			   For long cables (row == 3) check for mistune. */
-			tp->twistie =
-			    (tp->twist_row == 3) ? 4 : 0;
-		}
-		break;
-	case 4:
-		/* Special case for long cables: check for mistune. */
-		if ((NETDRV_R16 (CSCR) &
-		     CSCR_LinkStatusBits) == 0x7000) {
-			tp->twistie = 0;
-			break;
-		} else {
-			NETDRV_W32 (PARA7c, 0xfb38de03);
-			tp->twistie = 5;
-			next_tick = HZ / 10;
-		}
-		break;
-	case 5:
-		/* Retune for shorter cable (column 2). */
-		NETDRV_W32 (FIFOTMS, 0x20);
-		NETDRV_W32 (PARA78, PARA78_default);
-		NETDRV_W32 (PARA7c, PARA7c_default);
-		NETDRV_W32 (FIFOTMS, 0x00);
-		tp->twist_row = 2;
-		tp->twist_col = 0;
-		tp->twistie = 3;
-		next_tick = HZ / 10;
-		break;
-
-	default:
-		/* do nothing */
-		break;
-	}
-
-	DPRINTK ("EXIT\n");
-}
-#endif /* NETDRV_TUNE_TWISTER */
-
-
 static void netdrv_timer (unsigned long data)
 {
 	struct net_device *dev = (struct net_device *) data;
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	void *ioaddr = tp->mmio_addr;
 	int next_tick = 60 * HZ;
 	int mii_reg5;
@@ -1367,8 +1246,6 @@
 		}
 	}
 
-	netdrv_tune_twister (dev, tp);
-
 	DPRINTK ("%s: Media selection tick, Link partner %4.4x.\n",
 		 dev->name, NETDRV_R16 (NWayLPAR));
 	DPRINTK ("%s:  Other registers are IntMask %4.4x IntStatus %4.4x"
@@ -1411,7 +1288,7 @@
 
 static void netdrv_tx_timeout (struct net_device *dev)
 {
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	void *ioaddr = tp->mmio_addr;
 	int i;
 	u8 tmp8;
@@ -1458,7 +1335,7 @@
 
 static int netdrv_start_xmit (struct sk_buff *skb, struct net_device *dev)
 {
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	void *ioaddr = tp->mmio_addr;
 	int entry;
 
@@ -1799,7 +1676,7 @@
 			       struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_instance;
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	int boguscnt = max_interrupt_work;
 	void *ioaddr = tp->mmio_addr;
 	int status = 0, link_changed = 0; /* avoid bogus "uninit" warning */
@@ -1813,31 +1690,8 @@
 		if (status == 0xFFFF)
 			break;
 
-		/* Acknowledge all of the current interrupt sources ASAP, but
-		   an first get an additional status bit from CSCR. */
-		if (status & RxUnderrun)
-			link_changed = NETDRV_R16 (CSCR) & CSCR_LinkChangeBit;
-
-		/* E. Gill */
-		/* In case of an RxFIFOOver we must also clear the RxOverflow
-		   bit to avoid dropping frames for ever. Believe me, I got a
-		   lot of troubles copying huge data (approximately 2 RxFIFOOver
-		   errors per 1GB data transfer).
-		   The following is written in the 'p-guide.pdf' file (RTL8139(A/B)
-		   Programming guide V0.1, from 1999/1/15) on page 9 from REALTEC.
-		   -----------------------------------------------------------
-		   2. RxFIFOOvw handling:
-		     When RxFIFOOvw occurs, all incoming packets are discarded.
-		     Clear ISR(RxFIFOOvw) doesn't dismiss RxFIFOOvw event. To
-		     dismiss RxFIFOOvw event, the ISR(RxBufOvw) must be written
-		     with a '1'.
-		   -----------------------------------------------------------
-		   Unfortunately I was not able to find any reason for the
-		   RxFIFOOver error (I got the feeling this depends on the
-		   CPU speed, lower CPU speed --> more errors).
-		   After clearing the RxOverflow bit the transfer of the
-		   packet was repeated and all data are error free transfered */
-		NETDRV_W16_F (IntrStatus, (status & RxFIFOOver) ? (status | RxOverflow) : status);
+		/* Acknowledge all of the current interrupt sources ASAP */
+		NETDRV_W16_F (IntrStatus, status);
 
 		DPRINTK ("%s: interrupt  status=%#4.4x new intstat=%#4.4x.\n",
 				dev->name, status,
@@ -1882,7 +1736,7 @@
 
 static int netdrv_close (struct net_device *dev)
 {
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	void *ioaddr = tp->mmio_addr;
 	unsigned long flags;
 
@@ -1924,7 +1778,7 @@
 	/* Green! Put the chip in low-power mode. */
 	NETDRV_W8 (Cfg9346, Cfg9346_Unlock);
 	NETDRV_W8 (Config1, 0x03);
-	NETDRV_W8 (HltClk, 'H');	/* 'R' would leave the clock running. */
+	NETDRV_W8 (Cfg9346, Cfg9346_Lock);
 
 	DPRINTK ("EXIT\n");
 	return 0;
@@ -1933,7 +1787,7 @@
 
 static int mii_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 {
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	u16 *data = (u16 *) & rq->ifr_data;
 	unsigned long flags;
 	int rc = 0;
@@ -1974,7 +1828,7 @@
 
 static struct net_device_stats *netdrv_get_stats (struct net_device *dev)
 {
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	void *ioaddr = tp->mmio_addr;
 
 	DPRINTK ("ENTER\n");
@@ -2022,7 +1876,7 @@
 
 static void netdrv_set_rx_mode (struct net_device *dev)
 {
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	void *ioaddr = tp->mmio_addr;
 	u32 mc_filter[2];	/* Multicast hash filter */
 	int i, rx_mode;
@@ -2078,10 +1932,12 @@
 static void netdrv_suspend (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata (pdev);
-	struct netdrv_private *tp = (struct netdrv_private *) dev->priv;
+	struct netdrv_private *tp = dev->priv;
 	void *ioaddr = tp->mmio_addr;
 	unsigned long flags;
 
+	if (!netif_running(dev))
+		return;
 	netif_device_detach (dev);
 
 	spin_lock_irqsave (&tp->lock, flags);
@@ -2104,6 +1960,8 @@
 {
 	struct net_device *dev = pci_get_drvdata (pdev);
 
+	if (!netif_running(dev))
+		return;
 	pci_power_on (pdev);
 	netif_device_attach (dev);
 	netdrv_hw_start (dev);
diff -urN linux-2.4.3-pre5/drivers/net/pcmcia/aironet4500_cs.c linux/drivers/net/pcmcia/aironet4500_cs.c
--- linux-2.4.3-pre5/drivers/net/pcmcia/aironet4500_cs.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/pcmcia/aironet4500_cs.c	Mon Dec  3 22:32:38 2001
@@ -177,8 +177,14 @@
 
 	/* Create the PC card device object. */
 	link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
-	memset(link, 0, sizeof(struct dev_link_t));
+	if (!link)
+		return NULL;
 	link->dev = kmalloc(sizeof(struct dev_node_t), GFP_KERNEL);
+	if (!link->dev) {
+		kfree(link);
+		return NULL;
+	}
+	memset(link, 0, sizeof(struct dev_link_t));
 	memset(link->dev, 0, sizeof(struct dev_node_t));
 
 	link->release.function = &awc_release;
@@ -199,7 +205,6 @@
 	/* Create the network device object. */
 
 	dev = kmalloc(sizeof(struct net_device ), GFP_KERNEL);
-	memset(dev,0,sizeof(struct net_device));
 //	dev =  init_etherdev(0, sizeof(struct awc_private) );
 	if (!dev ) {
 		printk(KERN_CRIT "out of mem on dev alloc \n");
@@ -207,6 +212,7 @@
 		kfree(link);
 		return NULL;
 	};
+	memset(dev,0,sizeof(struct net_device));
 	dev->priv = kmalloc(sizeof(struct awc_private), GFP_KERNEL);
 	if (!dev->priv ) {printk(KERN_CRIT "out of mem on dev priv alloc \n"); return NULL;};
 	memset(dev->priv,0,sizeof(struct awc_private));
diff -urN linux-2.4.3-pre5/drivers/net/pcmcia/wavelan_cs.c linux/drivers/net/pcmcia/wavelan_cs.c
--- linux-2.4.3-pre5/drivers/net/pcmcia/wavelan_cs.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/pcmcia/wavelan_cs.c	Mon Dec  3 22:32:38 2001
@@ -1404,7 +1404,7 @@
 	  printk("2430.5");
 	  break;
 	default:
-	  printk("???");
+	  printk("unknown");
 	}
     }
 
@@ -1719,7 +1719,7 @@
 	 memcmp(dac, dac_verify, 2 * 2))
 	{
 #ifdef DEBUG_IOCTL_ERROR
-	  printk(KERN_INFO "Wavelan: wv_set_frequency : unable to write new frequency to EEprom (??)\n");
+	  printk(KERN_INFO "Wavelan: wv_set_frequency : unable to write new frequency to EEprom (?)\n");
 #endif
 	  return -EOPNOTSUPP;
 	}
@@ -1968,7 +1968,7 @@
 
     case SIOCGIWFREQ:
       /* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable)
-       * (does it work for everybody ??? - especially old cards...) */
+       * (does it work for everybody XXX - especially old cards...) */
       if(!(mmc_in(base, mmroff(0, mmr_fee_status)) &
 	   (MMR_FEE_STATUS_DWLD | MMR_FEE_STATUS_BUSY)))
 	{
@@ -2530,11 +2530,12 @@
   printk(KERN_DEBUG "%s: ->wavelan_get_wireless_stats()\n", dev->name);
 #endif
 
+  if (lp == NULL) /* XXX will this ever occur? */
+    return NULL;
+
   /* Disable interrupts & save flags */
   spin_lock_irqsave (&lp->lock, flags);
 
-  if(lp == (net_local *) NULL)
-    return (iw_stats *) NULL;
   wstats = &lp->wstats;
 
   /* Get data from the mmc */
@@ -3151,7 +3152,7 @@
    */
 
   /* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable)
-   * (does it work for everybody ??? - especially old cards...) */
+   * (does it work for everybody XXX - especially old cards...) */
   /* Note : WFREQSEL verify that it is able to read from EEprom
    * a sensible frequency (address 0x00) + that MMR_FEE_STATUS_ID
    * is 0xA (Xilinx version) or 0xB (Ariadne version).
@@ -3829,7 +3830,7 @@
       return FALSE;
     }
 
-  /* ???? Could you explain me this, Dave ? */
+  /* XXX Could you explain me this, Dave ? */
   link->dev = &((net_local *) dev->priv)->node;
 
 #ifdef DEBUG_CONFIG_TRACE
@@ -4706,7 +4707,7 @@
 	 * obliged to close nicely the wavelan here. David, could you
 	 * close the device before suspending them ? And, by the way,
 	 * could you, on resume, add a "route add -net ..." after the
-	 * ifconfig up ??? Thanks... */
+	 * ifconfig up XXX Thanks... */
 
 	/* Stop receiving new messages and wait end of transmission */
 	wv_ru_stop(dev);
@@ -4734,7 +4735,7 @@
 	if(link->state & DEV_CONFIG)
 	  {
       	    CardServices(RequestConfiguration, link->handle, &link->conf);
-      	    if(link->open)	/* If RESET -> True, If RESUME -> False ??? */
+      	    if(link->open)	/* If RESET -> True, If RESUME -> False XXX */
 	      {
 		wv_hw_reset(dev);
 		netif_device_attach(dev);
diff -urN linux-2.4.3-pre5/drivers/net/pcmcia/xircom_tulip_cb.c linux/drivers/net/pcmcia/xircom_tulip_cb.c
--- linux-2.4.3-pre5/drivers/net/pcmcia/xircom_tulip_cb.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/pcmcia/xircom_tulip_cb.c	Mon Dec  3 22:32:38 2001
@@ -503,10 +503,11 @@
 }
 
 static struct net_device *tulip_probe1(struct pci_dev *pdev,
-				       struct net_device *dev, long ioaddr, int irq,
+				       long ioaddr, int irq,
 				       int chip_idx, int board_idx)
 {
 	static int did_version;			/* Already printed version info. */
+	struct net_device *dev;
 	struct tulip_private *tp;
 	/* See note below on the multiport cards. */
 	static unsigned char last_phys_addr[6] = {0x00, 'L', 'i', 'n', 'u', 'x'};
@@ -519,7 +520,9 @@
 	if (tulip_debug > 0  &&  did_version++ == 0)
 		printk(KERN_INFO "%s", version);
 
-	dev = init_etherdev(dev, 0);
+	dev = init_etherdev(NULL, 0);
+	if (!dev)
+		return NULL;
 
 	pci_read_config_byte(pdev, PCI_REVISION_ID, &chip_rev);
 	/* Bring the 21143 out of sleep mode.
@@ -3081,8 +3084,7 @@
 	if (pci_enable_device (pdev))
 		return -ENODEV;
 	pci_set_master (pdev);
-	dev = tulip_probe1(pdev, NULL,
-			   pci_resource_start (pdev, 0), pdev->irq,
+	dev = tulip_probe1(pdev, pci_resource_start (pdev, 0), pdev->irq,
 			   id->driver_data, board_idx++);
 	if (dev) {
 		pdev->driver_data = dev;
diff -urN linux-2.4.3-pre5/drivers/net/pcnet32.c linux/drivers/net/pcnet32.c
--- linux-2.4.3-pre5/drivers/net/pcnet32.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/pcnet32.c	Mon Dec  3 22:32:38 2001
@@ -12,6 +12,14 @@
  *
  *	This driver is for PCnet32 and PCnetPCI based ethercards
  */
+/**************************************************************************
+ *  23 Oct, 2000.
+ *  Fixed a few bugs, related to running the controller in 32bit mode.
+ *
+ *  Carsten Langgaard, carstenl@mips.com
+ *  Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ *************************************************************************/
 
 static const char *version = "pcnet32.c:v1.25kf 26.9.1999 tsbogend@alpha.franken.de\n";
 
@@ -421,7 +429,7 @@
 static int pcnet32_dwio_check (unsigned long addr)
 {
     outl (88, addr+PCNET32_DWIO_RAP);
-    return (inl (addr+PCNET32_DWIO_RAP) == 88);
+    return ((inl (addr+PCNET32_DWIO_RAP) & 0xffff) == 88);
 }
 
 static struct pcnet32_access pcnet32_dwio = {
@@ -482,6 +490,12 @@
 
     printk(KERN_INFO "pcnet32_probe_pci: found device %#08x.%#08x\n", ent->vendor, ent->device);
 
+    if ((err = pci_enable_device(pdev)) < 0) {
+	printk(KERN_ERR "pcnet32.c: failed to enable device -- err=%d\n", err);
+	return err;
+    }
+    pci_set_master(pdev);
+
     ioaddr = pci_resource_start (pdev, 0);
     printk(KERN_INFO "    ioaddr=%#08lx  resource_flags=%#08lx\n", ioaddr, pci_resource_flags (pdev, 0));
     if (!ioaddr) {
@@ -494,13 +508,6 @@
 	return -ENODEV;
     }
 
-    if ((err = pci_enable_device(pdev)) < 0) {
-	printk(KERN_ERR "pcnet32.c: failed to enable device -- err=%d\n", err);
-	return err;
-    }
-    
-    pci_set_master(pdev);
-    
     return pcnet32_probe1(ioaddr, pdev->irq, 1, card_idx, pdev);
 }
 
@@ -528,11 +535,13 @@
     pcnet32_dwio_reset(ioaddr);
     pcnet32_wio_reset(ioaddr);
 
-    if (pcnet32_wio_read_csr (ioaddr, 0) == 4 && pcnet32_wio_check (ioaddr)) {
-	a = &pcnet32_wio;
+    /* Important to do the check for dwio mode first. */
+    if (pcnet32_dwio_read_csr(ioaddr, 0) == 4 && pcnet32_dwio_check(ioaddr)) {
+        a = &pcnet32_dwio;
     } else {
-	if (pcnet32_dwio_read_csr (ioaddr, 0) == 4 && pcnet32_dwio_check(ioaddr)) {
-	    a = &pcnet32_dwio;
+        if (pcnet32_wio_read_csr(ioaddr, 0) == 4 && 
+	    pcnet32_wio_check(ioaddr)) {
+	    a = &pcnet32_wio;
 	} else
 	    return -ENODEV;
     }
@@ -624,10 +633,35 @@
 
     printk(KERN_INFO "%s: %s at %#3lx,", dev->name, chipname, ioaddr);
 
-    /* There is a 16 byte station address PROM at the base address.
-       The first six bytes are the station address. */
+    /* In most chips, after a chip reset, the ethernet address is read from the
+     * station address PROM at the base address and programmed into the
+     * "Physical Address Registers" CSR12-14.
+     * As a precautionary measure, we read the PROM values and complain if
+     * they disagree with the CSRs.  Either way, we use the CSR values, and
+     * double check that they are valid.
+     */
+    for (i = 0; i < 3; i++) {
+	unsigned int val;
+	val = a->read_csr(ioaddr, i+12) & 0x0ffff;
+	/* There may be endianness issues here. */
+	dev->dev_addr[2*i] = val & 0x0ff;
+	dev->dev_addr[2*i+1] = (val >> 8) & 0x0ff;
+    }
+    {
+	u8 promaddr[6];
+	for (i = 0; i < 6; i++) {
+	    promaddr[i] = inb(ioaddr + i);
+	}
+	if( memcmp( promaddr, dev->dev_addr, 6) )
+	    printk(" warning: PROM address does not match CSR address");
+    }
+    /* if the ethernet address is not valid, force to 00:00:00:00:00:00 */
+    if( !is_valid_ether_addr(dev->dev_addr) )
+	for (i = 0; i < 6; i++)
+	    dev->dev_addr[i]=0;
+
     for (i = 0; i < 6; i++)
-	printk(" %2.2x", dev->dev_addr[i] = inb(ioaddr + i));
+	printk(" %2.2x", dev->dev_addr[i] );
 
     if (((chip_version + 1) & 0xfffe) == 0x2624) { /* Version 0x2623 or 0x2624 */
 	i = a->read_csr(ioaddr, 80) & 0x0C00;  /* Check tx_start_pt */
@@ -775,6 +809,10 @@
 	return -EAGAIN;
     }
 
+    /* Check for a valid station address */
+    if( !is_valid_ether_addr(dev->dev_addr) )
+	return -EINVAL;
+
     /* Reset the PCNET32 */
     lp->a.reset (ioaddr);
 
@@ -818,6 +856,12 @@
 	if (lp->options & PORT_100)
 	    val |= 0x08;
 	lp->a.write_bcr (ioaddr, 32, val);
+    } else {
+	if (lp->options & PORT_ASEL) {  /* enable auto negotiate, setup, disable fd */
+		val = lp->a.read_bcr(ioaddr, 32) & ~0x98;
+		val |= 0x20;
+		lp->a.write_bcr(ioaddr, 32, val);
+	}
     }
 
 #ifdef DO_DXSUFLO 
diff -urN linux-2.4.3-pre5/drivers/net/rcpci45.c linux/drivers/net/rcpci45.c
--- linux-2.4.3-pre5/drivers/net/rcpci45.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/rcpci45.c	Mon Dec  3 22:32:38 2001
@@ -284,8 +284,8 @@
     dprintk("(rcpci45 driver:) RCopen\n");
 
     /* Request a shared interrupt line. */
-    if ( (error=request_irq(dev->irq, (void *)RCinterrupt,
-                     SA_INTERRUPT|SA_SHIRQ, "RedCreek VPN Adapter", dev)) ) {
+    error=request_irq(dev->irq, RCinterrupt, SA_SHIRQ, dev->name, dev);
+    if (error) {
         printk(KERN_ERR "(rcpci45 driver:) %s: unable to get IRQ %d\n", dev->name, dev->irq );
 	goto err_out;
     }
diff -urN linux-2.4.3-pre5/drivers/net/sis900.c linux/drivers/net/sis900.c
--- linux-2.4.3-pre5/drivers/net/sis900.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/sis900.c	Mon Dec  3 22:32:38 2001
@@ -260,16 +260,17 @@
 	u8 revision;
 	char *card_name = card_names[pci_id->driver_data];
 
-	if (!pci_dma_supported(pci_dev, SIS900_DMA_MASK)) {
-		printk(KERN_ERR "sis900.c: architecture does not support "
-		       "32bit PCI busmaster DMA\n");
-		return -ENODEV;
-	}
-
 	/* setup various bits in PCI command register */
 	ret = pci_enable_device (pci_dev);
 	if (ret) return ret;
 
+	i = pci_set_dma_mask(pci_dev, SIS900_DMA_MASK);
+	if (i) {
+		printk(KERN_ERR "sis900.c: architecture does not support "
+		       "32bit PCI busmaster DMA\n");
+		return i;
+	}
+
 	pci_set_master(pci_dev);
 
 	irq = pci_dev->irq;
@@ -321,7 +322,6 @@
 	}
 
 	pci_set_drvdata(pci_dev, net_dev);
-	pci_dev->dma_mask = SIS900_DMA_MASK;
 
 	/* The SiS900-specific entries in the device structure. */
 	net_dev->open = &sis900_open;
diff -urN linux-2.4.3-pre5/drivers/net/sk98lin/h/lm80.h linux/drivers/net/sk98lin/h/lm80.h
--- linux-2.4.3-pre5/drivers/net/sk98lin/h/lm80.h	Fri Sep 15 14:34:19 2000
+++ linux/drivers/net/sk98lin/h/lm80.h	Mon Dec  3 22:32:38 2001
@@ -126,7 +126,7 @@
 #define LM80_IS_BTI		(1<<1)	/* state of BTI# pin */
 #define LM80_IS_FAN1		(1<<2)	/* count limit exceeded for Fan 1 */
 #define LM80_IS_FAN2		(1<<3)	/* count limit exceeded for Fan 2 */
-#define LM80_IS_CI		(1<<4)	/* Chassis Intrusion occured */
+#define LM80_IS_CI		(1<<4)	/* Chassis Intrusion occurred */
 #define LM80_IS_OS		(1<<5)	/* OS temperature limit exceeded */
 	/* bit 6 and 7 are reserved in LM80_ISRC_2 */
 #define LM80_IS_HT_IRQ_MD	(1<<6)	/* Hot temperature interrupt mode */
diff -urN linux-2.4.3-pre5/drivers/net/sk98lin/h/skgehw.h linux/drivers/net/sk98lin/h/skgehw.h
--- linux-2.4.3-pre5/drivers/net/sk98lin/h/skgehw.h	Fri Sep 15 14:34:19 2000
+++ linux/drivers/net/sk98lin/h/skgehw.h	Mon Dec  3 22:32:38 2001
@@ -499,7 +499,7 @@
 /*
  * The HW-Spec. call this registers Timeout Value 0..11. But this names are
  * not usable in SW. Please notice these are NOT real timeouts, these are
- * the number of qWords transfered continously.
+ * the number of qWords transferred continously.
  */
 #define B3_RI_WTO_R1	0x0190	/* 8 bit RAM Iface WR Timeout Queue R1	(TO0) */
 #define B3_RI_WTO_XA1	0x0191	/* 8 bit RAM Iface WR Timeout Queue XA1	(TO1) */
@@ -984,7 +984,7 @@
 
 /*	B3_RI_TEST	 8 bit	RAM Iface Test Register */
 				/* Bit 15..4:	reserved */
-#define RI_T_EV		(1<<3)	/* Bit	3:	Timeout Event occured */
+#define RI_T_EV		(1<<3)	/* Bit	3:	Timeout Event occurred */
 #define RI_T_ON		(1<<2)	/* Bit	2:	Timeout Timer Test On */
 #define RI_T_OFF	(1<<1)	/* Bit	1:	Timeout Timer Test Off */
 #define RI_T_STEP	(1<<0)	/* Bit	0:	Timeout Timer Step */
@@ -1034,19 +1034,19 @@
 /*	B3_MA_RC_TEST	16 bit	MAC Arbiter Recovery Test Reg */
 /*	B3_PA_TEST	16 bit	Packet Arbiter Test Register */
 /*			Bit 15, 11, 7, and 3 are reserved in B3_PA_TEST */
-#define TX2_T_EV	(1<<15)	/* Bit 15: 	TX2 Timeout/Recv Event occured*/
+#define TX2_T_EV	(1<<15)	/* Bit 15: 	TX2 Timeout/Recv Event occurred*/
 #define TX2_T_ON	(1<<14)	/* Bit 14:	TX2 Timeout/Recv Timer Test On*/
 #define TX2_T_OFF	(1<<13)	/* Bit 13:	TX2 Timeout/Recv Timer Tst Off*/
 #define TX2_T_STEP	(1<<12)	/* Bit 12:	TX2 Timeout/Recv Timer Step */
-#define TX1_T_EV	(1<<11)	/* Bit 11:	TX1 Timeout/Recv Event occured*/
+#define TX1_T_EV	(1<<11)	/* Bit 11:	TX1 Timeout/Recv Event occurred*/
 #define TX1_T_ON	(1<<10)	/* Bit 10:	TX1 Timeout/Recv Timer Test On*/
 #define TX1_T_OFF	(1<<9)	/* Bit	9:	TX1 Timeout/Recv Timer Tst Off*/
 #define TX1_T_STEP	(1<<8)	/* Bit	8:	TX1 Timeout/Recv Timer Step */
-#define RX2_T_EV	(1<<7)	/* Bit	7:	RX2 Timeout/Recv Event occured*/
+#define RX2_T_EV	(1<<7)	/* Bit	7:	RX2 Timeout/Recv Event occurred*/
 #define RX2_T_ON	(1<<6)	/* Bit	6:	RX2 Timeout/Recv Timer Test On*/
 #define RX2_T_OFF	(1<<5)	/* Bit	5:	RX2 Timeout/Recv Timer Tst Off*/
 #define RX2_T_STEP	(1<<4)	/* Bit	4:	RX2 Timeout/Recv Timer Step */
-#define RX1_T_EV	(1<<3)	/* Bit	3:	RX1 Timeout/Recv Event occured*/
+#define RX1_T_EV	(1<<3)	/* Bit	3:	RX1 Timeout/Recv Event occurred*/
 #define RX1_T_ON	(1<<2)	/* Bit	2:	RX1 Timeout/Recv Timer Test On*/
 #define RX1_T_OFF	(1<<1)	/* Bit	1:	RX1 Timeout/Recv Timer Tst Off*/
 #define RX1_T_STEP	(1<<0)	/* Bit	0:	RX1 Timeout/Recv Timer Step */
diff -urN linux-2.4.3-pre5/drivers/net/sk98lin/h/xmac_ii.h linux/drivers/net/sk98lin/h/xmac_ii.h
--- linux-2.4.3-pre5/drivers/net/sk98lin/h/xmac_ii.h	Fri Sep 15 14:34:19 2000
+++ linux/drivers/net/sk98lin/h/xmac_ii.h	Mon Dec  3 22:32:38 2001
@@ -277,7 +277,7 @@
  * XMAC Bit Definitions
  *
  * If the bit access behaviour differs from the register access behaviour
- * (r/w, ro) this is docomented after the bit number. The following bit
+ * (r/w, ro) this is documented after the bit number. The following bit
  * access behaviours are used:
  *	(sc)	self clearing
  *	(ro)	read only
@@ -412,7 +412,7 @@
 #define XM_ST_BC	(1L<<7)		/* Bit	7:	Broadcast packet */
 #define XM_ST_MC	(1L<<6)		/* Bit	6:	Multicast packet */
 #define XM_ST_UC	(1L<<5)		/* Bit	5:	Unicast packet */
-#define XM_ST_TX_UR	(1L<<4)		/* Bit	4:	FIFO Underrun occured */
+#define XM_ST_TX_UR	(1L<<4)		/* Bit	4:	FIFO Underrun occurred */
 #define XM_ST_CS_ERR	(1L<<3)		/* Bit	3:	Carrier Sense Error */
 #define XM_ST_LAT_COL	(1L<<2)		/* Bit	2:	Late Collision Error */
 #define XM_ST_MUL_COL	(1L<<1)		/* Bit	1:	Multiple Collisions */
diff -urN linux-2.4.3-pre5/drivers/net/sk98lin/skgeinit.c linux/drivers/net/sk98lin/skgeinit.c
--- linux-2.4.3-pre5/drivers/net/sk98lin/skgeinit.c	Fri Sep 15 14:34:19 2000
+++ linux/drivers/net/sk98lin/skgeinit.c	Mon Dec  3 22:32:38 2001
@@ -122,7 +122,7 @@
  *	chg: Default is autosensing with AUTOFULL mode
  *
  *	Revision 1.31  1998/11/25 15:36:16  gklug
- *	fix: do NOT stop LED Timer when port should be stoped
+ *	fix: do NOT stop LED Timer when port should be stopped
  *
  *	Revision 1.30  1998/11/24 13:15:28  gklug
  *	add: Init PCkeckPar struct member
@@ -1118,10 +1118,10 @@
  *
  *	Dir =	SK_STOP_TX 	Stops the transmit path only and resets
  *				the XMAC. The receive queue is still and
- *				the pending rx frames may still transfered
+ *				the pending rx frames may still transferred
  *				into the RxD.
  *		SK_STOP_RX	Stop the receive path. The tansmit path
- *				has to be stoped once before.
+ *				has to be stopped once before.
  *		SK_STOP_ALL	SK_STOP_TX + SK_STOP_RX
  *
  *	RstMode=SK_SOFT_RST	Resets the XMAC. The PHY is still alive.
@@ -1129,7 +1129,7 @@
  *
  * Example:
  *	1) A Link Down event was signaled for a port. Therefore the activity
- *	of this port should be stoped and a hardware reset should be issued
+ *	of this port should be stopped and a hardware reset should be issued
  *	to enable the workaround of XMAC errata #2. But the received frames
  *	should not be discarded.
  *		...
diff -urN linux-2.4.3-pre5/drivers/net/sk98lin/skgepnmi.c linux/drivers/net/sk98lin/skgepnmi.c
--- linux-2.4.3-pre5/drivers/net/sk98lin/skgepnmi.c	Fri Sep 15 14:34:19 2000
+++ linux/drivers/net/sk98lin/skgepnmi.c	Mon Dec  3 22:32:38 2001
@@ -149,7 +149,7 @@
  *	Fixed: Couldnot delete VPD keys on UNIX.
  *	
  *	Revision 1.48  1998/12/09 14:11:10  mhaveman
- *	-Add: Debugmessage for XMAC_RESET supressed to minimize output.
+ *	-Add: Debugmessage for XMAC_RESET suppressed to minimize output.
  *	-Fixed: RlmtChangeThreshold will now be initialized.
  *	-Fixed: VPD_ENTRIES_LIST extended value with unnecessary space char.
  *	-Fixed: On VPD key creation an invalid key name could be created
@@ -206,7 +206,7 @@
  *	-Fixed bug for RX counters. On an RX overflow interrupt the high
  *	 words of all RX counters were incremented.
  *	-SET operations on FLOWCTRL_MODE and LINK_MODE accept now the
- *	 value 0, which has no effect. It is usefull for multiple instance
+ *	 value 0, which has no effect. It is useful for multiple instance
  *	 SETs.
  *	
  *	Revision 1.37  1998/11/20 08:02:04  mhaveman
@@ -1600,7 +1600,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to take
  *	                         the data.
  *	SK_PNMI_ERR_UNKNOWN_OID  The requested OID is unknown
@@ -1632,13 +1632,13 @@
  * Description:
  *	Calls a general sub-function for all this stuff. The preset does
  *	the same as a set, but returns just before finally setting the
- *	new value. This is usefull to check if a set might be successfull.
+ *	new value. This is useful to check if a set might be successful.
  *	If as instance a -1 is passed, an array of values is supposed and
  *	all instance of the OID will be set.
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -1674,13 +1674,13 @@
  * Description:
  *	Calls a general sub-function for all this stuff. The preset does
  *	the same as a set, but returns just before finally setting the
- *	new value. This is usefull to check if a set might be successfull.
+ *	new value. This is useful to check if a set might be successful.
  *	If as instance a -1 is passed, an array of values is supposed and
  *	all instance of the OID will be set.
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -1723,7 +1723,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to take
  *	                         the data.
  */
@@ -1884,7 +1884,7 @@
  * Description:
  *	Calls a general sub-function for all this set stuff. The preset does
  *	the same as a set, but returns just before finally setting the
- *	new value. This is usefull to check if a set might be successfull.
+ *	new value. This is useful to check if a set might be successful.
  *	The sub-function runs through the IdTable, checks which OIDs are able
  *	to set, and calls the handler function of the OID to perform the
  *	preset. The return value of the function will also be stored in
@@ -1893,7 +1893,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -1929,7 +1929,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -2816,7 +2816,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -2883,7 +2883,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3017,7 +3017,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3159,7 +3159,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3299,7 +3299,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3509,7 +3509,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3628,7 +3628,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3872,7 +3872,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -4352,7 +4352,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -4956,7 +4956,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -5264,7 +5264,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -5449,7 +5449,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -6052,7 +6052,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -6502,7 +6502,7 @@
  *
  * Description:
  *	The COMMON module only tells us if the mode is half or full duplex.
- *	But in the decade of auto sensing it is usefull for the user to
+ *	But in the decade of auto sensing it is useful for the user to
  *	know if the mode was negotiated or forced. Therefore we have a
  *	look to the mode, which was last used by the negotiation process.
  *
@@ -6764,7 +6764,7 @@
 
 		/*
 		 * It is an auto-clearing register. If the command bits
-		 * went to zero again, the statistics are transfered.
+		 * went to zero again, the statistics are transferred.
 		 * Normally the command should be executed immediately.
 		 * But just to be sure we execute a loop.
 		 */
@@ -7037,7 +7037,7 @@
  *
  * Description:
  *	The trap buffer stores various events. A user application somehow
- *	gets notified that an event occured and retrieves the trap buffer
+ *	gets notified that an event occurred and retrieves the trap buffer
  *	contens (or simply polls the buffer). The buffer is organized as
  *	a ring which stores the newest traps at the beginning. The oldest
  *	traps are overwritten by the newest ones. Each trap entry has a
diff -urN linux-2.4.3-pre5/drivers/net/sk98lin/skgesirq.c linux/drivers/net/sk98lin/skgesirq.c
--- linux-2.4.3-pre5/drivers/net/sk98lin/skgesirq.c	Fri Sep 15 14:34:19 2000
+++ linux/drivers/net/sk98lin/skgesirq.c	Mon Dec  3 22:32:38 2001
@@ -695,14 +695,14 @@
 	/* Check whether XMACs are correctly initialized */
 	if ((Istatus & (IS_PA_TO_RX1 | IS_PA_TO_TX1)) &&
 	    !pAC->GIni.GP[MAC_1].PState) {
-		/* XMAC was not initialized but Packet timeout occured */
+		/* XMAC was not initialized but Packet timeout occurred */
 		SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E004,
 			SKERR_SIRQ_E004MSG) ;
 	}
 
 	if ((Istatus & (IS_PA_TO_RX2 | IS_PA_TO_TX2)) &&
 	    !pAC->GIni.GP[MAC_2].PState) {
-		/* XMAC was not initialized but Packet timeout occured */
+		/* XMAC was not initialized but Packet timeout occurred */
 		SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E005,
 			SKERR_SIRQ_E005MSG) ;
 	}
@@ -1012,7 +1012,7 @@
 			 */
 			/*
 			 * we received a bunch of frames or no
-			 * CRC error occured on the network ->
+			 * CRC error occurred on the network ->
 			 * ok.
 			 */
 			pPrt->PPrevRx = RxCts;
@@ -1255,7 +1255,7 @@
 			SkHWLinkUp(pAC, IoC, Port) ;
 			Done = SkXmAutoNegDone(pAC,IoC,Port);
 			if (Done != SK_AND_OK) {
-				/* Get PHY parameters, for debuging only */
+				/* Get PHY parameters, for debugging only */
 				PHY_READ(IoC, pPrt, Port, PHY_XMAC_AUNE_LP,
 					&LpAb);
 				PHY_READ(IoC, pPrt, Port, PHY_XMAC_RES_ABI,
@@ -1294,7 +1294,7 @@
 		pPrt->PAutoNegTimeOut ++;
 		if (pPrt->PAutoNegTimeOut >= SK_AND_MAX_TO) {
 			/*
-			 * Timeout occured.
+			 * Timeout occurred.
 			 * What do we need now?
 			 */
 			SK_DBG_MSG(pAC,SK_DBGMOD_HWM,
@@ -1304,7 +1304,7 @@
 			if (pPrt->PLinkModeConf == SK_LMODE_AUTOSENSE &&
 				pPrt->PLipaAutoNeg != SK_LIPA_AUTO) {
 				/*
-				 * Timeout occured
+				 * Timeout occurred
 				 * Set Link manually up.
 				 */
 				SkHWSenseSetNext(pAC, IoC, Port,
@@ -1445,7 +1445,7 @@
 			SkHWLinkUp(pAC, IoC, Port);
 			Done = SkXmAutoNegDone(pAC,IoC,Port);
 			if (Done != SK_AND_OK) {
-				/* Get PHY parameters, for debuging only */
+				/* Get PHY parameters, for debugging only */
 				PHY_READ(IoC, pPrt, Port,
 					PHY_BCOM_AUNE_LP,
 					&LpAb);
@@ -1583,7 +1583,7 @@
 			SkHWLinkUp(pAC, IoC, Port) ;
 			Done = SkXmAutoNegDone(pAC,IoC,Port);
 			if (Done != SK_AND_OK) {
-				/* Get PHY parameters, for debuging only */
+				/* Get PHY parameters, for debugging only */
 				PHY_READ(IoC, pPrt, Port,
 					PHY_LONE_AUNE_LP,
 					&LpAb);
@@ -1624,7 +1624,7 @@
 		pPrt->PAutoNegTimeOut ++;
 		if (pPrt->PAutoNegTimeOut >= SK_AND_MAX_TO) {
 			/*
-			 * Timeout occured.
+			 * Timeout occurred.
 			 * What do we need now?
 			 */
 			SK_DBG_MSG(pAC,SK_DBGMOD_HWM,
@@ -1634,7 +1634,7 @@
 			if (pPrt->PLinkModeConf == SK_LMODE_AUTOSENSE &&
 				pPrt->PLipaAutoNeg != SK_LIPA_AUTO) {
 				/*
-				 * Timeout occured
+				 * Timeout occurred
 				 * Set Link manually up.
 				 */
 				SkHWSenseSetNext(pAC, IoC, Port,
diff -urN linux-2.4.3-pre5/drivers/net/sk98lin/ski2c.c linux/drivers/net/sk98lin/ski2c.c
--- linux-2.4.3-pre5/drivers/net/sk98lin/ski2c.c	Fri Sep 15 14:34:19 2000
+++ linux/drivers/net/sk98lin/ski2c.c	Mon Dec  3 22:32:38 2001
@@ -1000,7 +1000,7 @@
 	/* Get the current time */
 	CurrTime = SkOsGetTime(pAC);
 
-	/* Set para to the most usefull setting:
+	/* Set para to the most useful setting:
 	 * The current sensor.
 	 */
 	ParaLocal.Para64 = (SK_U64) pAC->I2c.CurrSens;
diff -urN linux-2.4.3-pre5/drivers/net/sk98lin/skqueue.c linux/drivers/net/sk98lin/skqueue.c
--- linux-2.4.3-pre5/drivers/net/sk98lin/skqueue.c	Fri Sep 15 14:34:19 2000
+++ linux/drivers/net/sk98lin/skqueue.c	Mon Dec  3 22:32:38 2001
@@ -147,7 +147,7 @@
  *		send command to state machine
  *	end
  *	return error reported by individual Event function
- *		0 if no error occured.
+ *		0 if no error occurred.
  */
 int	SkEventDispatcher(
 SK_AC	*pAC,	/* Adapters Context */
diff -urN linux-2.4.3-pre5/drivers/net/sk98lin/skxmac2.c linux/drivers/net/sk98lin/skxmac2.c
--- linux-2.4.3-pre5/drivers/net/sk98lin/skxmac2.c	Fri Sep 15 14:34:19 2000
+++ linux/drivers/net/sk98lin/skxmac2.c	Mon Dec  3 22:32:38 2001
@@ -278,7 +278,7 @@
  *	 o don't set XMR_FS_ERR in frame	SK_BIG_PK_OK_ON/OFF
  *	   status for frames > 1514 bytes
  *
- *	for incomming packets may be enabled/disabled by this function.
+ *	for incoming packets may be enabled/disabled by this function.
  *	Additional modes may be added later.
  *	Multiple modes can be enabled/disabled at the same time.
  *	The new configuration is stored into the HWAC port configuration
@@ -755,8 +755,8 @@
 
 	/*
 	 * configure the XMACs Station Address
-	 * B2_MAC_2 = xx xx xx xx xx x1 is programed to XMAC A
-	 * B2_MAC_3 = xx xx xx xx xx x2 is programed to XMAC B
+	 * B2_MAC_2 = xx xx xx xx xx x1 is programmed to XMAC A
+	 * B2_MAC_3 = xx xx xx xx xx x2 is programmed to XMAC B
 	 */
 	for (i = 0; i < 3; i++) {
 		/*
diff -urN linux-2.4.3-pre5/drivers/net/sk_g16.c linux/drivers/net/sk_g16.c
--- linux-2.4.3-pre5/drivers/net/sk_g16.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/sk_g16.c	Mon Dec  3 22:32:38 2001
@@ -218,9 +218,9 @@
  *
  */ 
 
-#define SK_IOREG        (board->ioreg) /* LANCE data registers.     */ 
-#define SK_PORT         (board->port)  /* Control, Status register  */
-#define SK_IOCOM        (board->iocom) /* I/O Command               */
+#define SK_IOREG        (&board->ioreg) /* LANCE data registers.     */ 
+#define SK_PORT         (&board->port)  /* Control, Status register  */
+#define SK_IOCOM        (&board->iocom) /* I/O Command               */
 
 /* 
  * SK_G16 Status/Control Register bits
@@ -1102,7 +1102,7 @@
 	writel((unsigned long) p->tmdbufs[i], tmdp->u.buffer); /* assign buffer */
 	
 	/* Mark TMD as start and end of packet */
-	writeb(TX_STP | TX_ENP, tmdp->u.s.status);
+	writeb(TX_STP | TX_ENP, &tmdp->u.s.status);
     }
 
 
@@ -1122,32 +1122,32 @@
 	 * receiving packets, set status and release RMD 
 	 */
 
-	writeb(RX_OWN, rmdp->u.s.status);
+	writeb(RX_OWN, &rmdp->u.s.status);
 
-	writew(-PKT_BUF_SZ, rmdp->blen); /* Buffer Size (two's complement) */
+	writew(-PKT_BUF_SZ, &rmdp->blen); /* Buffer Size (two's complement) */
 
-	writeb(0, rmdp->mlen);           /* init message length */       
+	writeb(0, &rmdp->mlen);           /* init message length */       
 	
     }
 
     /* Fill LANCE Initialize Block */
 
-    writew(mode, (p->ram)->ib.mode); /* Set operation mode */
+    writew(mode, (&((p->ram)->ib.mode))); /* Set operation mode */
 
     for (i = 0; i < ETH_ALEN; i++)   /* Set physical address */
     {
-	writeb(dev->dev_addr[i], (p->ram)->ib.paddr[i]); 
+	writeb(dev->dev_addr[i], (&((p->ram)->ib.paddr[i]))); 
     }
 
     for (i = 0; i < 8; i++)          /* Set multicast, logical address */
     {
-	writeb(0, (p->ram)->ib.laddr[i]); /* We do not use logical addressing */
+	writeb(0, (&((p->ram)->ib.laddr[i]))); /* We do not use logical addressing */
     } 
 
     /* Set ring descriptor pointers and set number of descriptors */
 
-    writel((int)p->rmdhead | RMDNUMMASK, (p->ram)->ib.rdrp);
-    writel((int)p->tmdhead | TMDNUMMASK, (p->ram)->ib.tdrp);
+    writel((int)p->rmdhead | RMDNUMMASK, (&((p->ram)->ib.rdrp)));
+    writel((int)p->tmdhead | TMDNUMMASK, (&((p->ram)->ib.tdrp)));
 
     /* Prepare LANCE Control and Status Registers */
 
@@ -1281,7 +1281,7 @@
 
 	memcpy_toio((tmdp->u.buffer & 0x00ffffff), skb->data, skb->len);
 
-	writew(-len, tmdp->blen);            /* set length to transmit */
+	writew(-len, &tmdp->blen);            /* set length to transmit */
 
 	/* 
 	 * Packet start and end is always set because we use the maximum
@@ -1289,7 +1289,7 @@
 	 * Relinquish ownership to LANCE
 	 */
 
-	writeb(TX_OWN | TX_STP | TX_ENP, tmdp->u.s.status);
+	writeb(TX_OWN | TX_STP | TX_ENP, &tmdp->u.s.status);
 	
 	/* Start Demand Transmission */
 	SK_write_reg(CSR0, CSR0_TDMD | CSR0_INEA);
@@ -1301,7 +1301,7 @@
 	p->tmdnum &= TMDNUM-1; 
 
 	/* Do we own the next transmit buffer ? */
-	if (! (readb((p->tmdhead + p->tmdnum)->u.s.status) & TX_OWN) )
+	if (! (readb(&((p->tmdhead + p->tmdnum)->u.s.status)) & TX_OWN) )
 	{
 	   /* 
 	    * We own next buffer and are ready to transmit, so
@@ -1421,7 +1421,7 @@
     p->tmdlast++;
     p->tmdlast &= TMDNUM-1;
 
-    tmdstat = readb(tmdp->u.s.status);
+    tmdstat = readb(&tmdp->u.s.status);
 
     /* 
      * We check status of transmitted packet.
@@ -1429,7 +1429,7 @@
      */
     if (tmdstat & TX_ERR) /* Error occurred */
     {
-	int stat2 = readw(tmdp->status2);
+	int stat2 = readw(&tmdp->status2);
 
 	printk("%s: TX error: %04x %04x\n", dev->name, tmdstat, stat2);
 
@@ -1458,7 +1458,7 @@
 	
 	p->stats.tx_errors++;
 
-	writew(0, tmdp->status2);             /* Clear error flags */
+	writew(0, &tmdp->status2);             /* Clear error flags */
     }
     else if (tmdstat & TX_MORE)        /* Collisions occurred ? */
     {
@@ -1534,7 +1534,7 @@
      * it up to higher layer 
      */
 
-    while (!( (rmdstat = readb(rmdp->u.s.status)) & RX_OWN))
+    while (!( (rmdstat = readb(&rmdp->u.s.status)) & RX_OWN))
     {
 	/* 
          * Start and end of packet must be set, because we use 
@@ -1564,7 +1564,7 @@
 	     * packets. 
 	     */
 
-	    writeb(RX_OWN, rmdp->u.s.status); /* Relinquish ownership to LANCE */ 
+	    writeb(RX_OWN, &rmdp->u.s.status); /* Relinquish ownership to LANCE */ 
 
 	}
 	else if (rmdstat & RX_ERR)          /* Receive Error ? */
@@ -1576,13 +1576,13 @@
 	    if (rmdstat & RX_FRAM) p->stats.rx_frame_errors++;
 	    if (rmdstat & RX_CRC)  p->stats.rx_crc_errors++;
 
-	    writeb(RX_OWN, rmdp->u.s.status); /* Relinquish ownership to LANCE */
+	    writeb(RX_OWN, &rmdp->u.s.status); /* Relinquish ownership to LANCE */
 
 	}
 	else /* We have a packet which can be queued for the upper layers */
 	{
 
-	    int len = readw(rmdp->mlen) & 0x0fff;  /* extract message length from receive buffer */
+	    int len = readw(&rmdp->mlen) & 0x0fff;  /* extract message length from receive buffer */
 	    struct sk_buff *skb;
 
 	    skb = dev_alloc_skb(len+2); /* allocate socket buffer */ 
@@ -1595,7 +1595,7 @@
 		 * to Lance, update statistics and go ahead.
 		 */
 
-		writeb(RX_OWN, rmdp->u.s.status); /* Relinquish ownership to LANCE */
+		writeb(RX_OWN, &rmdp->u.s.status); /* Relinquish ownership to LANCE */
 		printk("%s: Couldn't allocate sk_buff, deferring packet.\n",
 		       dev->name);
 		p->stats.rx_dropped++;
@@ -1633,7 +1633,7 @@
 	     * free our descriptor and update statistics 
 	     */
 
-	    writeb(RX_OWN, rmdp->u.s.status);
+	    writeb(RX_OWN, &rmdp->u.s.status);
 	    dev->last_rx = jiffies;
 	    p->stats.rx_packets++;
 	    p->stats.rx_bytes += len;
diff -urN linux-2.4.3-pre5/drivers/net/skfp/drvfbi.c linux/drivers/net/skfp/drvfbi.c
--- linux-2.4.3-pre5/drivers/net/skfp/drvfbi.c	Sun Mar 12 19:11:17 2000
+++ linux/drivers/net/skfp/drvfbi.c	Mon Dec  3 22:32:38 2001
@@ -849,7 +849,7 @@
 
 #ifdef	EISA
 
-/*arrays with io adresses of dma controller length and adress registers*/
+/*arrays with io addresses of dma controller length and address registers*/
 static const int cntr[8] = { 0x001,0x003,0x005,0x007,0,0x0c6,0x0ca,0x0ce } ;
 static const int base[8] = { 0x000,0x002,0x004,0x006,0,0x0c4,0x0c8,0x0cc } ;
 static const int page[8] = { 0x087,0x083,0x081,0x082,0,0x08b,0x089,0x08a } ;
diff -urN linux-2.4.3-pre5/drivers/net/skfp/fplustm.c linux/drivers/net/skfp/fplustm.c
--- linux-2.4.3-pre5/drivers/net/skfp/fplustm.c	Wed Jul  5 10:56:13 2000
+++ linux/drivers/net/skfp/fplustm.c	Mon Dec  3 22:32:38 2001
@@ -87,7 +87,7 @@
 
 
 /*
- * usefull interrupt bits
+ * useful interrupt bits
  */
 static int mac_imsk1u = FM_STXABRS | FM_STXABRA0 | FM_SXMTABT ;
 static int mac_imsk1l = FM_SQLCKS | FM_SQLCKA0 | FM_SPCEPDS | FM_SPCEPDA0|
@@ -1381,7 +1381,7 @@
 			CHECK_CAM() ;
 
 			/*
-			 * wirte the multicast addres into the CAM
+			 * write the multicast address into the CAM
 			 */
 			outpw(FM_A(FM_AFCOMP2),
 				(u_short)((tb->a.a[0]<<8)+tb->a.a[1])) ;
diff -urN linux-2.4.3-pre5/drivers/net/skfp/h/smc.h linux/drivers/net/skfp/h/smc.h
--- linux-2.4.3-pre5/drivers/net/skfp/h/smc.h	Fri Feb 18 14:55:53 2000
+++ linux/drivers/net/skfp/h/smc.h	Mon Dec  3 22:32:38 2001
@@ -297,7 +297,7 @@
 #define RS_NORINGOP	(1<< 5)			/* no ring op */
 #define RS_VERSION	(1<< 4)			/* SMT version mismatch */
 #define RS_STUCKBYPASSS	(1<< 3)			/* stuck bypass */
-#define RS_EVENT	(1<< 2)			/* FDDI event occured */
+#define RS_EVENT	(1<< 2)			/* FDDI event occurred */
 #define RS_RINGOPCHANGE	(1<< 1)			/* ring op changed */
 #define RS_RES0		(1<< 0)			/* reserved */
 
diff -urN linux-2.4.3-pre5/drivers/net/skfp/pcmplc.c linux/drivers/net/skfp/pcmplc.c
--- linux-2.4.3-pre5/drivers/net/skfp/pcmplc.c	Fri Feb 18 14:55:53 2000
+++ linux/drivers/net/skfp/pcmplc.c	Mon Dec  3 22:32:38 2001
@@ -1722,7 +1722,7 @@
 	}
 	if (cmd & PL_EBUF_ERR) {	/* elastic buff. det. over-|underflow*/
 		/*
-		 * Check whether the SRF Condition occured.
+		 * Check whether the SRF Condition occurred.
 		 */
 		if (!plc->ebuf_cont && phy->mib->fddiPORTPCMState == PC8_ACTIVE){
 			/*
diff -urN linux-2.4.3-pre5/drivers/net/smc-ultra.c linux/drivers/net/smc-ultra.c
--- linux-2.4.3-pre5/drivers/net/smc-ultra.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/smc-ultra.c	Mon Dec  3 22:32:38 2001
@@ -20,6 +20,7 @@
 
 		ultra_probe()	 	Detecting and initializing the card.
 		ultra_probe1()
+		ultra_probe_isapnp()
 
 		ultra_open()		The card-specific details of starting, stopping
 		ultra_reset_8390()	and resetting the 8390 NIC core.
@@ -43,11 +44,19 @@
 	Paul Gortmaker	: multiple card support for module users.
 	Donald Becker	: 4/17/96 PIO support, minor potential problems avoided.
 	Donald Becker	: 6/6/96 correctly set auto-wrap bit.
+	Alexander Sotirov : 1/20/01 Added support for ISAPnP cards
+
+	Note about the ISA PnP support:
+
+	This driver can not autoprobe for more than one SMC EtherEZ PnP card.
+	You have to configure the second card manually through the /proc/isapnp
+	interface and then load the module with an explicit io=0x___ option.
 */
 
 static const char *version =
 	"smc-ultra.c:v2.02 2/3/98 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
+#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -55,6 +64,7 @@
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/isapnp.h>
 #include <asm/io.h>
 #include <asm/system.h>
 
@@ -69,6 +79,10 @@
 int ultra_probe(struct net_device *dev);
 static int ultra_probe1(struct net_device *dev, int ioaddr);
 
+#if defined CONFIG_ISAPNP || defined CONFIG_ISAPNP_MODULE
+static int ultra_probe_isapnp(struct net_device *dev);
+#endif
+
 static int ultra_open(struct net_device *dev);
 static void ultra_reset_8390(struct net_device *dev);
 static void ultra_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
@@ -85,6 +99,17 @@
 							 const unsigned char *buf, const int start_page);
 static int ultra_close_card(struct net_device *dev);
 
+#if defined CONFIG_ISAPNP || defined CONFIG_ISAPNP_MODULE
+static struct isapnp_device_id ultra_device_ids[] __initdata = {
+        {       ISAPNP_VENDOR('S','M','C'), ISAPNP_FUNCTION(0x8416),
+                ISAPNP_VENDOR('S','M','C'), ISAPNP_FUNCTION(0x8416),
+                (long) "SMC EtherEZ (8416)" },
+        { }	/* terminate list */
+};
+
+MODULE_DEVICE_TABLE(isapnp, ultra_device_ids);
+#endif
+
 
 #define START_PG		0x00	/* First page of TX buffer */
 
@@ -114,6 +139,14 @@
 	else if (base_addr != 0)	/* Don't probe at all. */
 		return -ENXIO;
 
+#if defined CONFIG_ISAPNP || defined CONFIG_ISAPNP_MODULE
+	/* Look for any installed ISAPnP cards */
+	if (isapnp_present() && (ultra_probe_isapnp(dev) == 0))
+		return 0;
+
+	printk(KERN_NOTICE "smc-ultra.c: No ISAPnP cards found, trying standard ones...\n");
+#endif
+
 	for (i = 0; ultra_portlist[i]; i++)
 		if (ultra_probe1(dev, ultra_portlist[i]) == 0)
 			return 0;
@@ -245,6 +278,48 @@
 	return retval;
 }
 
+#if defined CONFIG_ISAPNP || defined CONFIG_ISAPNP_MODULE
+static int __init ultra_probe_isapnp(struct net_device *dev)
+{
+        int i;
+
+        for (i = 0; ultra_device_ids[i].vendor != 0; i++) {
+                struct pci_dev *idev = NULL;
+
+                while ((idev = isapnp_find_dev(NULL,
+                                               ultra_device_ids[i].vendor,
+                                               ultra_device_ids[i].function,
+                                               idev))) {
+                        /* Avoid already found cards from previous calls */
+                        if (idev->prepare(idev))
+                                continue;
+                        if (idev->activate(idev))
+                                continue;
+                        /* if no irq, search for next */
+                        if (idev->irq_resource[0].start == 0)
+                                continue;
+                        /* found it */
+                        dev->base_addr = idev->resource[0].start;
+                        dev->irq = idev->irq_resource[0].start;
+                        printk(KERN_INFO "smc-ultra.c: ISAPnP reports %s at i/o %#lx, irq %d.\n",
+                                (char *) ultra_device_ids[i].driver_data,
+
+                                dev->base_addr, dev->irq);
+                        if (ultra_probe1(dev, dev->base_addr) != 0) {      /* Shouldn't happen. */
+                                printk(KERN_ERR "smc-ultra.c: Probe of ISAPnP card at %#lx failed.\n", dev->base_addr);                                return -ENXIO;
+                        }
+                        ei_status.priv = (unsigned long)idev;
+                        break;
+                }
+                if (!idev)
+                        continue;
+                return 0;
+        }
+
+        return -ENODEV;
+}
+#endif
+
 static int
 ultra_open(struct net_device *dev)
 {
@@ -465,6 +540,13 @@
 		if (dev->priv != NULL) {
 			/* NB: ultra_close_card() does free_irq */
 			int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET;
+
+#if defined CONFIG_ISAPNP || defined CONFIG_ISAPNP_MODULE
+			struct pci_dev *idev = (struct pci_dev *)ei_status.priv;
+			if (idev)
+				idev->deactivate(idev);
+#endif
+
 			unregister_netdev(dev);
 			release_region(ioaddr, ULTRA_IO_EXTENT);
 			kfree(dev->priv);
diff -urN linux-2.4.3-pre5/drivers/net/smc9194.c linux/drivers/net/smc9194.c
--- linux-2.4.3-pre5/drivers/net/smc9194.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/smc9194.c	Mon Dec  3 22:32:38 2001
@@ -1400,9 +1400,6 @@
 done:
 	/*  error or good, tell the card to get rid of this packet */
 	outw( MC_RELEASE, ioaddr + MMU_CMD );
-
-
-	return;
 }
 
 
diff -urN linux-2.4.3-pre5/drivers/net/tlan.c linux/drivers/net/tlan.c
--- linux-2.4.3-pre5/drivers/net/tlan.c	Mon Dec 11 13:38:29 2000
+++ linux/drivers/net/tlan.c	Mon Dec  3 22:32:38 2001
@@ -7,10 +7,10 @@
  *
  *  (C) 1997-1998 Caldera, Inc.
  *  (C) 1998 James Banks
- *  (C) 1999, 2000 Torben Mathiasen
+ *  (C) 1999-2001 Torben Mathiasen
  *
  *  This software may be used and distributed according to the terms
- *  of the GNU Public License, incorporated herein by reference.
+ *  of the GNU General Public License, incorporated herein by reference.
  *
  ** This file is best viewed/edited with columns>=132.
  *
@@ -136,6 +136,28 @@
  *
  *	v1.12 Oct 12, 2000   - Minor fixes (memleak, init, etc.)
  *
+ * 	v1.13 Nov 28, 2000   - Stop flooding console with auto-neg issues
+ * 			       when link can't be established.
+ *			     - Added the bbuf option as a kernel parameter.
+ *			     - Fixed ioaddr probe bug.
+ *			     - Fixed stupid deadlock with MII interrupts.
+ *			     - Added support for speed/duplex selection with 
+ *			       multiple nics.
+ *			     - Added partly fix for TX Channel lockup with
+ *			       TLAN v1.0 silicon. This needs to be investigated
+ *			       further.
+ *
+ * 	v1.14 Dec 16, 2000   - Added support for servicing multiple frames per.
+ * 			       interrupt. Thanks goes to
+ * 			       Adam Keys <adam@ti.com>
+ * 			       Denis Beaudoin <dbeaudoin@ti.com>
+ * 			       for providing the patch.
+ * 			     - Fixed auto-neg output when using multiple
+ * 			       adapters.
+ * 			     - Converted to use new taskq interface.
+ *
+ * 	v1.14a Jan 6, 2001   - Minor adjustments (spinlocks, etc.)
+ *
  *******************************************************************************/
 
                                                                                 
@@ -159,17 +181,19 @@
 
 static	int		TLanDevicesInstalled;
 
-/* Force speed, duplex and aui settings */
-static	int		aui;
-static	int		duplex; 
-static	int		speed;
+/* Set speed, duplex and aui settings */
+static  int aui[MAX_TLAN_BOARDS];
+static  int duplex[MAX_TLAN_BOARDS];
+static  int speed[MAX_TLAN_BOARDS];
+static  int boards_found;
 
 MODULE_AUTHOR("Maintainer: Torben Mathiasen <torben.mathiasen@compaq.com>");
 MODULE_DESCRIPTION("Driver for TI ThunderLAN based ethernet PCI adapters");
-MODULE_PARM(aui, "i");
-MODULE_PARM(duplex, "i");
-MODULE_PARM(speed, "i");
+MODULE_PARM(aui, "1-" __MODULE_STRING(MAX_TLAN_BOARDS) "i");
+MODULE_PARM(duplex, "1-" __MODULE_STRING(MAX_TLAN_BOARDS) "i");
+MODULE_PARM(speed, "1-" __MODULE_STRING(MAX_TLAN_BOARDS) "i");
 MODULE_PARM(debug, "i");
+MODULE_PARM(bbuf, "i");
 EXPORT_NO_SYMBOLS;
 
 /* Define this to enable Link beat monitoring */
@@ -181,7 +205,7 @@
 static	int		bbuf;
 static	u8		*TLanPadBuffer;
 static	char		TLanSignature[] = "TLAN";
-static const char *tlan_banner = "ThunderLAN driver v1.12\n";
+static const char *tlan_banner = "ThunderLAN driver v1.14a\n";
 static int tlan_have_pci;
 static int tlan_have_eisa;
 
@@ -324,16 +348,19 @@
 TLan_SetTimer( struct net_device *dev, u32 ticks, u32 type )
 {
 	TLanPrivateInfo *priv = (TLanPrivateInfo *) dev->priv;
-	unsigned long flags;
-
-	spin_lock_irqsave(&priv->lock, flags);
+	unsigned long flags = 0;
+	
+	if (!in_irq())
+		spin_lock_irqsave(&priv->lock, flags);
 	if ( priv->timer.function != NULL &&
 		priv->timerType != TLAN_TIMER_ACTIVITY ) { 
-		spin_unlock_irqrestore(&priv->lock, flags);
+		if (!in_irq())
+			spin_unlock_irqrestore(&priv->lock, flags);
 		return;
 	}
 	priv->timer.function = &TLan_Timer;
-	spin_unlock_irqrestore(&priv->lock, flags);
+	if (!in_irq())
+		spin_unlock_irqrestore(&priv->lock, flags);
 
 	priv->timer.data = (unsigned long) dev;
 	priv->timerSetAt = jiffies;
@@ -375,7 +402,7 @@
 
 static void __devexit tlan_remove_one( struct pci_dev *pdev)
 {
-	struct net_device *dev = pdev->driver_data;
+	struct net_device *dev = pci_get_drvdata( pdev );
 	TLanPrivateInfo	*priv = (TLanPrivateInfo *) dev->priv;
 	
 	unregister_netdev( dev );
@@ -388,6 +415,7 @@
 	
 	kfree( dev );
 		
+	pci_set_drvdata( pdev, NULL );
 } 
 
 static struct pci_driver tlan_driver = {
@@ -404,7 +432,7 @@
 	printk(KERN_INFO "%s", tlan_banner);
 	
 	TLanPadBuffer = (u8 *) kmalloc(TLAN_MIN_FRAME_SIZE, 
-					(GFP_KERNEL | GFP_DMA));
+					GFP_KERNEL);
 
 	if (TLanPadBuffer == NULL) {
 		printk(KERN_ERR "TLAN: Could not allocate memory for pad buffer.\n");
@@ -426,18 +454,19 @@
 	printk(KERN_INFO "TLAN: %d device%s installed, PCI: %d  EISA: %d\n", 
 		 TLanDevicesInstalled, TLanDevicesInstalled == 1 ? "" : "s",
 		 tlan_have_pci, tlan_have_eisa);
-	
-	return ((TLanDevicesInstalled > 0) ? 0 : -ENODEV);
 
+	if (TLanDevicesInstalled == 0) {
+		kfree(TLanPadBuffer);
+		return -ENODEV;
+	}
+	return 0;
 }
 	
 
 static int __devinit tlan_init_one( struct pci_dev *pdev,
 				    const struct pci_device_id *ent)
 {
-	return TLan_probe1( pdev, pci_resource_start(pdev, 0), pdev->irq,
-			0, ent);
-
+	return TLan_probe1( pdev, -1, -1, 0, ent);
 }
 
 
@@ -468,6 +497,10 @@
 	TLanPrivateInfo    *priv;
 	u8		   pci_rev;
 	u16		   device_id;
+	int		   reg;
+
+	if (pdev && pci_enable_device(pdev))
+		return -EIO;
 
 	dev = init_etherdev(NULL, sizeof(TLanPrivateInfo));
 	if (dev == NULL) {
@@ -477,23 +510,35 @@
 	SET_MODULE_OWNER(dev);
 	
 	priv = dev->priv;
-		
-	dev->base_addr = ioaddr;
-	dev->irq = irq;
-	 
 
 	/* Is this a PCI device? */
 	if (pdev) {
+		u32 		   pci_io_base = 0;
+
 		priv->adapter = &board_info[ent->driver_data];
-		if (pci_enable_device(pdev)) {
+
+		pci_read_config_byte ( pdev, PCI_REVISION_ID, &pci_rev);
+
+		for ( reg= 0; reg <= 5; reg ++ ) {
+			if (pci_resource_flags(pdev, reg) & IORESOURCE_IO) {
+				pci_io_base = pci_resource_start(pdev, reg);
+				TLAN_DBG( TLAN_DEBUG_GNRL, "IO mapping is available at %x.\n",
+						pci_io_base);
+				break;
+			}
+		}
+		if (!pci_io_base) {
+			printk(KERN_ERR "TLAN: No IO mappings available\n");
 			unregister_netdev(dev);
 			kfree(dev);
-			return -1;
+			return -ENODEV;
 		}
-		pci_read_config_byte ( pdev, PCI_REVISION_ID, &pci_rev);
+		
+		dev->base_addr = pci_io_base;
+		dev->irq = pdev->irq;
 		priv->adapterRev = pci_rev; 
 		pci_set_master(pdev);
-		pdev->driver_data = dev;
+		pci_set_drvdata(pdev, dev);
 
 	} else	{     /* EISA card */
 		/* This is a hack. We need to know which board structure
@@ -507,6 +552,8 @@
 			priv->adapter = &board_info[14];
 			priv->adapterRev = 10;			/* TLAN 1.0 */
 		}
+		dev->base_addr = ioaddr;
+		dev->irq = irq;
 	}
 
 	/* Kernel parameters */
@@ -522,21 +569,19 @@
 		}
 		debug = priv->debug = dev->mem_end;
 	} else {
-
-		if ( ( duplex != 1 ) && ( duplex != 2 ) ) 
-			duplex = 0;
-		
-		priv->duplex = duplex;
-
-		if ( ( speed != 10 ) && ( speed != 100 ) )
-			speed = 0;
-		
-		priv->aui   = aui;
-		priv->speed = speed;
+		priv->aui    = aui[boards_found];
+		priv->speed  = speed[boards_found];
+		priv->duplex = duplex[boards_found];
 		priv->debug = debug;
-		
 	}
 	
+	/* This will be used when we get an adapter error from
+	 * within our irq handler */
+	INIT_LIST_HEAD(&priv->tlan_tqueue.list);
+	priv->tlan_tqueue.sync = 0;
+	priv->tlan_tqueue.routine = (void *)(void*)TLan_tx_timeout;
+	priv->tlan_tqueue.data = dev;
+
 	spin_lock_init(&priv->lock);
 	
 	if (TLan_Init(dev)) {
@@ -547,6 +592,7 @@
 	} else {
 	
 	TLanDevicesInstalled++;
+	boards_found++;
 	
 	/* pdev is NULL if this is an EISA device */
 	if (pdev)
@@ -752,6 +798,7 @@
 	if ( priv->dmaStorage == NULL ) {
 		printk(KERN_ERR "TLAN:  Could not allocate lists and buffers for %s.\n",
 			dev->name );
+		release_region( dev->base_addr, 0x10 );
 		return -ENOMEM;
 	}
 	memset( priv->dmaStorage, 0, dma_size );
@@ -901,6 +948,7 @@
 	TLAN_DBG( TLAN_DEBUG_GNRL, "%s: Transmit timed out.\n", dev->name);
 	
 	/* Ok so we timed out, lets see what we can do about it...*/
+	TLan_FreeLists( dev );
 	TLan_ResetLists( dev );		
 	TLan_ReadAndClearStats( dev, TLAN_IGNORE );
 	TLan_ResetAdapter( dev );
@@ -947,7 +995,7 @@
 	}
 
 	tail_list = priv->txList + priv->txTail;
-
+	
 	if ( tail_list->cStat != TLAN_CSTAT_UNUSED ) {
 		TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT:  %s is busy (Head=%d Tail=%d)\n", dev->name, priv->txHead, priv->txTail );
 		netif_stop_queue(dev);
@@ -983,10 +1031,9 @@
 	tail_list->cStat = TLAN_CSTAT_READY;
 	if ( ! priv->txInProgress ) {
 		priv->txInProgress = 1;
-		outw( 0x4, dev->base_addr + TLAN_HOST_INT );
 		TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT:  Starting TX on buffer %d\n", priv->txTail );
 		outl( virt_to_bus( tail_list ), dev->base_addr + TLAN_CH_PARM );
-		outl( TLAN_HC_GO | TLAN_HC_ACK, dev->base_addr + TLAN_HOST_CMD );
+		outl( TLAN_HC_GO, dev->base_addr + TLAN_HOST_CMD );
 	} else {
 		TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT:  Adding buffer %d to TX channel\n", priv->txTail );
 		if ( priv->txTail == 0 ) {
@@ -1084,6 +1131,7 @@
 	TLanPrivateInfo *priv = (TLanPrivateInfo *) dev->priv;
 
 	netif_stop_queue(dev);
+	priv->neg_be_verbose = 0;
 
 	TLan_ReadAndClearStats( dev, TLAN_RECORD );
 	outl( TLAN_HC_AD_RST, dev->base_addr + TLAN_HOST_CMD );
@@ -1242,7 +1290,6 @@
 
 u32 TLan_HandleInvalid( struct net_device *dev, u16 host_int )
 {
-	host_int = 0;
 	/* printk( "TLAN:  Invalid interrupt on %s.\n", dev->name ); */
 	return 0;
 
@@ -1278,30 +1325,33 @@
 	TLanPrivateInfo	*priv = (TLanPrivateInfo *) dev->priv;
 	int		eoc = 0;
 	TLanList	*head_list;
-	u32		ack = 1;
-
+	u32		ack = 0;
+	u16		tmpCStat;
+	
 	TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT:  Handling TX EOF (Head=%d Tail=%d)\n", priv->txHead, priv->txTail );
-	host_int = 0;
 	head_list = priv->txList + priv->txHead;
 
-	if ( ! bbuf ) {
-		dev_kfree_skb_irq( (struct sk_buff *) head_list->buffer[9].address );		
-		head_list->buffer[9].address = 0;
-	}
+	while (((tmpCStat = head_list->cStat ) & TLAN_CSTAT_FRM_CMP) && (ack < 255)) {
+		ack++;
+		if ( ! bbuf ) {
+			dev_kfree_skb_any( (struct sk_buff *) head_list->buffer[9].address );
+			head_list->buffer[9].address = 0;
+		}
+	
+		if ( tmpCStat & TLAN_CSTAT_EOC )
+			eoc = 1;
+			
+		priv->stats.tx_bytes += head_list->frameSize;
 
-	if ( head_list->cStat & TLAN_CSTAT_EOC )
-		eoc = 1;
-	if ( ! head_list->cStat & TLAN_CSTAT_FRM_CMP ) {
-		printk( "TLAN:  Received interrupt for uncompleted TX frame.\n" );
+		head_list->cStat = TLAN_CSTAT_UNUSED;
+		netif_start_queue(dev);		
+		CIRC_INC( priv->txHead, TLAN_NUM_TX_LISTS ); 
+		head_list = priv->txList + priv->txHead;
 	}
 
-	priv->stats.tx_bytes += head_list->frameSize;
-
-	head_list->cStat = TLAN_CSTAT_UNUSED;
+	if (!ack)
+		printk(KERN_INFO "TLAN: Received interrupt for uncompleted TX frame.\n");
 	
-	netif_start_queue(dev);
-	
-	CIRC_INC( priv->txHead, TLAN_NUM_TX_LISTS );
 	if ( eoc ) {
 		TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT:  Handling TX EOC (Head=%d Tail=%d)\n", priv->txHead, priv->txTail );
 		head_list = priv->txList + priv->txHead;
@@ -1312,7 +1362,7 @@
 			priv->txInProgress = 0;
 		}
 	}
-
+	
 	if ( priv->adapter->flags & TLAN_ADAPTER_ACTIVITY_LED ) {
 		TLan_DioWrite8( dev->base_addr, TLAN_LED_REG, TLAN_LED_LINK | TLAN_LED_ACT );
 		if ( priv->timer.function == NULL ) {
@@ -1353,7 +1403,6 @@
 
 u32 TLan_HandleStatOverflow( struct net_device *dev, u16 host_int )
 {
-	host_int = 0;
 	TLan_ReadAndClearStats( dev, TLAN_RECORD );
 
 	return 1;
@@ -1384,87 +1433,95 @@
 	 *	of the list.  If the frame was the last in the Rx
 	 *	channel (EOC), the function restarts the receive channel
 	 *	by sending an Rx Go command to the adapter.  Then it
-	 *	activates/continues the the activity LED.
+	 *	activates/continues the activity LED.
 	 *
 	 **************************************************************/
 
 u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
 {
 	TLanPrivateInfo	*priv = (TLanPrivateInfo *) dev->priv;
-	u32		ack = 1;
+	u32		ack = 0;
 	int		eoc = 0;
 	u8		*head_buffer;
 	TLanList	*head_list;
 	struct sk_buff	*skb;
 	TLanList	*tail_list;
 	void		*t;
+	u32		frameSize;
+	u16		tmpCStat;
 
 	TLAN_DBG( TLAN_DEBUG_RX, "RECEIVE:  Handling RX EOF (Head=%d Tail=%d)\n", priv->rxHead, priv->rxTail );
-	host_int = 0;
 	head_list = priv->rxList + priv->rxHead;
-	tail_list = priv->rxList + priv->rxTail;
-
-	if ( head_list->cStat & TLAN_CSTAT_EOC ) {
-		eoc = 1;
-	}
+	
+	while (((tmpCStat = head_list->cStat) & TLAN_CSTAT_FRM_CMP) && (ack < 255)) {
+		frameSize = head_list->frameSize;
+		ack++;
+		if (tmpCStat & TLAN_CSTAT_EOC)
+			eoc = 1;
+		
+		if (bbuf) {
+			skb = dev_alloc_skb(frameSize + 7);
+			if (skb == NULL)
+				printk(KERN_INFO "TLAN: Couldn't allocate memory for received data.\n");
+			else {
+				head_buffer = priv->rxBuffer + (priv->rxHead * TLAN_MAX_FRAME_SIZE);
+				skb->dev = dev;
+				skb_reserve(skb, 2);
+				t = (void *) skb_put(skb, frameSize);
+		
+				priv->stats.rx_bytes += head_list->frameSize;
 
-	if ( ! head_list->cStat & TLAN_CSTAT_FRM_CMP ) {
-		printk( "TLAN:  Received interrupt for uncompleted RX frame.\n" );
-	} else if ( bbuf ) {
-		skb = dev_alloc_skb( head_list->frameSize + 7 );
-		if ( skb == NULL ) { 
-			printk( "TLAN:  Couldn't allocate memory for received data.\n" );
+				memcpy( t, head_buffer, frameSize );
+				skb->protocol = eth_type_trans( skb, dev );
+				netif_rx( skb );
+			}
 		} else {
-			head_buffer = priv->rxBuffer + ( priv->rxHead * TLAN_MAX_FRAME_SIZE );
-			skb->dev = dev;
-			skb_reserve( skb, 2 );
-			t = (void *) skb_put( skb, head_list->frameSize );
-
-			priv->stats.rx_bytes += head_list->frameSize;
-
-			memcpy( t, head_buffer, head_list->frameSize );
-			skb->protocol = eth_type_trans( skb, dev );
-			netif_rx( skb );
-		}
-	} else {
-		struct sk_buff *new_skb;
+			struct sk_buff *new_skb;
 		
-		/*
-		 *	I changed the algorithm here. What we now do
-		 *	is allocate the new frame. If this fails we
-		 *	simply recycle the frame.
-		 */
+			/*
+		 	*	I changed the algorithm here. What we now do
+		 	*	is allocate the new frame. If this fails we
+		 	*	simply recycle the frame.
+		 	*/
 		
-		new_skb = dev_alloc_skb( TLAN_MAX_FRAME_SIZE + 7 );
-		if ( new_skb != NULL ) {
-			/* If this ever happened it would be a problem */
-			/* not any more - ac */
-			skb = (struct sk_buff *) head_list->buffer[9].address;
-			head_list->buffer[9].address = 0;
-			skb_trim( skb, head_list->frameSize );
+			new_skb = dev_alloc_skb( TLAN_MAX_FRAME_SIZE + 7 );
+			
+			if ( new_skb != NULL ) {
+				/* If this ever happened it would be a problem */
+				/* not any more - ac */
+				skb = (struct sk_buff *) head_list->buffer[9].address;
+				skb_trim( skb, frameSize );
+
+				priv->stats.rx_bytes += frameSize;
+
+				skb->protocol = eth_type_trans( skb, dev );
+				netif_rx( skb );
+	
+				new_skb->dev = dev;
+				skb_reserve( new_skb, 2 );
+				t = (void *) skb_put( new_skb, TLAN_MAX_FRAME_SIZE );
+				head_list->buffer[0].address = virt_to_bus( t );
+				head_list->buffer[8].address = (u32) t;
+				head_list->buffer[9].address = (u32) new_skb;
+			} else 
+				printk(KERN_WARNING "TLAN:  Couldn't allocate memory for received data.\n" );
+		}
+
+		head_list->forward = 0;
+		head_list->cStat = 0;
+		tail_list = priv->rxList + priv->rxTail;
+		tail_list->forward = virt_to_bus( head_list );
 
-			priv->stats.rx_bytes += head_list->frameSize;
+		CIRC_INC( priv->rxHead, TLAN_NUM_RX_LISTS );
+		CIRC_INC( priv->rxTail, TLAN_NUM_RX_LISTS );
+		head_list = priv->rxList + priv->rxHead;
+	}
 
-			skb->protocol = eth_type_trans( skb, dev );
-			netif_rx( skb );
+	if (!ack)
+		printk(KERN_INFO "TLAN: Received interrupt for uncompleted RX frame.\n");
 	
-			new_skb->dev = dev;
-			skb_reserve( new_skb, 2 );
-			t = (void *) skb_put( new_skb, TLAN_MAX_FRAME_SIZE );
-			head_list->buffer[0].address = virt_to_bus( t );
-			head_list->buffer[9].address = (u32) new_skb;
-		}
-		else
-			printk(KERN_WARNING "TLAN:  Couldn't allocate memory for received data.\n" );
-	}
 
-	head_list->forward = 0;
-	head_list->frameSize = TLAN_MAX_FRAME_SIZE;
-	head_list->buffer[0].count = TLAN_MAX_FRAME_SIZE | TLAN_LAST_BUFFER;
-	tail_list->forward = virt_to_bus( head_list );
 
-	CIRC_INC( priv->rxHead, TLAN_NUM_RX_LISTS );
-	CIRC_INC( priv->rxTail, TLAN_NUM_RX_LISTS );
 
 	if ( eoc ) { 
 		TLAN_DBG( TLAN_DEBUG_RX, "RECEIVE:  Handling RX EOC (Head=%d Tail=%d)\n", priv->rxHead, priv->rxTail );
@@ -1489,7 +1546,7 @@
 	}
 
 	dev->last_rx = jiffies;
-
+	
 	return ack;
 
 } /* TLan_HandleRxEOF */
@@ -1516,7 +1573,6 @@
 
 u32 TLan_HandleDummy( struct net_device *dev, u16 host_int )
 {
-	host_int = 0;
 	printk( "TLAN:  Test interrupt on %s.\n", dev->name );
 	return 1;
 
@@ -1549,13 +1605,14 @@
 {
 	TLanPrivateInfo	*priv = (TLanPrivateInfo *) dev->priv;
 	TLanList		*head_list;
-	u32				ack = 1;
-
+	u32			ack = 1;
+	
 	host_int = 0;
 	if ( priv->tlanRev < 0x30 ) {
 		TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT:  Handling TX EOC (Head=%d Tail=%d) -- IRQ\n", priv->txHead, priv->txTail );
 		head_list = priv->txList + priv->txHead;
 		if ( ( head_list->cStat & TLAN_CSTAT_READY ) == TLAN_CSTAT_READY ) {
+			netif_stop_queue(dev);
 			outl( virt_to_bus( head_list ), dev->base_addr + TLAN_CH_PARM );
 			ack |= TLAN_HC_GO;
 		} else {
@@ -1602,14 +1659,16 @@
 	
 	ack = 1;
 	if ( host_int & TLAN_HI_IV_MASK ) {
+		netif_stop_queue( dev );
 		error = inl( dev->base_addr + TLAN_CH_PARM );
 		printk( "TLAN:  %s: Adaptor Error = 0x%x\n", dev->name, error );
 		TLan_ReadAndClearStats( dev, TLAN_RECORD );
 		outl( TLAN_HC_AD_RST, dev->base_addr + TLAN_HOST_CMD );
-		TLan_FreeLists( dev );
-		TLan_ResetLists( dev );
-		TLan_ResetAdapter( dev );
-		netif_start_queue(dev);
+		
+		queue_task(&priv->tlan_tqueue, &tq_immediate);
+		mark_bh(IMMEDIATE_BH);
+		
+		netif_wake_queue(dev);
 		ack = 0;
 	} else {
 		TLAN_DBG( TLAN_DEBUG_GNRL, "%s: Status Check\n", dev->name );
@@ -1670,7 +1729,6 @@
 	TLanList	*head_list;
 	u32		ack = 1;
 
-	host_int = 0;
 	if (  priv->tlanRev < 0x30 ) {
 		TLAN_DBG( TLAN_DEBUG_RX, "RECEIVE:  Handling RX EOC (Head=%d Tail=%d) -- IRQ\n", priv->rxHead, priv->rxTail );
 		head_list = priv->rxList + priv->rxHead;
@@ -1826,6 +1884,7 @@
 		}
 		list->buffer[2].count = 0;
 		list->buffer[2].address = 0;
+		list->buffer[9].address = 0;
 	}
 
 	priv->rxHead = 0;
@@ -1848,6 +1907,7 @@
 				t = (void *) skb_put( skb, TLAN_MAX_FRAME_SIZE );
 			}
 			list->buffer[0].address = virt_to_bus( t );
+			list->buffer[8].address = (u32) t;
 			list->buffer[9].address = (u32) skb;
 		}
 		list->buffer[1].count = 0;
@@ -1902,7 +1962,7 @@
 	 *		io_base		Base IO port of the device of
 	 *				which to print DIO registers.
 	 *
-	 *	This function prints out all the the internal (DIO)
+	 *	This function prints out all the internal (DIO)
 	 *	registers of a TLAN chip.
 	 *
 	 **************************************************************/
@@ -2091,8 +2151,8 @@
 
 /*  5.	Load Ld_Tmr and Ld_Thr in HOST_CMD. */
 
- 	outl( TLAN_HC_LD_TMR | 0x0, dev->base_addr + TLAN_HOST_CMD );
- 	outl( TLAN_HC_LD_THR | 0x1, dev->base_addr + TLAN_HOST_CMD );
+ 	outl( TLAN_HC_LD_TMR | 0x3f, dev->base_addr + TLAN_HOST_CMD );
+ 	outl( TLAN_HC_LD_THR | 0x9, dev->base_addr + TLAN_HOST_CMD );
 
 /*  6.	Unreset the MII by setting NMRST (in NetSio) to 1. */
 
@@ -2108,6 +2168,7 @@
 	}
 	TLan_PhyDetect( dev );
 	data = TLAN_NET_CFG_1FRAG | TLAN_NET_CFG_1CHAN;
+	
 	if ( priv->adapter->flags & TLAN_ADAPTER_BIT_RATE_PHY ) {
 		data |= TLAN_NET_CFG_BIT;
 		if ( priv->aui == 1 ) {
@@ -2119,6 +2180,7 @@
 			TLan_DioWrite8( dev->base_addr, TLAN_ACOMMIT, 0x08 );
 		}
 	}
+
 	if ( priv->phyNum == 0 ) {
 		data |= TLAN_NET_CFG_PHY_EN;
 	}
@@ -2161,7 +2223,7 @@
 		data |= TLAN_NET_MASK_MASK7; 
 	}
 	TLan_DioWrite8( dev->base_addr, TLAN_NET_MASK, data );
-	TLan_DioWrite16( dev->base_addr, TLAN_MAX_RX, TLAN_MAX_FRAME_SIZE );
+	TLan_DioWrite16( dev->base_addr, TLAN_MAX_RX, ((1536)+7)&~7 );
 	TLan_MiiReadReg( dev, phy, MII_GEN_ID_HI, &tlphy_id1 );
 	TLan_MiiReadReg( dev, phy, MII_GEN_ID_LO, &tlphy_id2 );
 	
@@ -2576,7 +2638,12 @@
 		/* Wait for 8 sec to give the process
 		 * more time.  Perhaps we should fail after a while.
 		 */
-		printk( "TLAN: Giving autonegotiation more time.\n" );
+		 if (!priv->neg_be_verbose++) {
+			 printk(KERN_INFO "TLAN:  Giving autonegotiation more time.\n");
+		 	 printk(KERN_INFO "TLAN:  Please check that your adapter has\n");
+		 	 printk(KERN_INFO "TLAN:  been properly connected to a HUB or Switch.\n");
+			 printk(KERN_INFO "TLAN:  Trying to establish link in the background...\n");
+		 }
 		TLan_SetTimer( dev, (8*HZ), TLAN_TIMER_PHY_FINISH_AN );
 		return;
 	}
@@ -2720,8 +2787,9 @@
 	err = FALSE;
 	outw(TLAN_NET_SIO, dev->base_addr + TLAN_DIO_ADR);
 	sio = dev->base_addr + TLAN_DIO_DATA + TLAN_NET_SIO;
-
-	spin_lock_irqsave(&priv->lock, flags);
+	
+	if (!in_irq())
+		spin_lock_irqsave(&priv->lock, flags);
 
 	TLan_MiiSync(dev->base_addr);
 
@@ -2767,8 +2835,9 @@
 		TLan_SetBit(TLAN_NET_SIO_MINTEN, sio);
 
 	*val = tmp;
-
-	spin_unlock_irqrestore(&priv->lock, flags);
+	
+	if (!in_irq())
+		spin_unlock_irqrestore(&priv->lock, flags);
 
 	return err;
 
@@ -2885,8 +2954,9 @@
 
 	outw(TLAN_NET_SIO, dev->base_addr + TLAN_DIO_ADR);
 	sio = dev->base_addr + TLAN_DIO_DATA + TLAN_NET_SIO;
-
-	spin_lock_irqsave(&priv->lock, flags);
+	
+	if (!in_irq())
+		spin_lock_irqsave(&priv->lock, flags);
 
 	TLan_MiiSync( dev->base_addr );
 
@@ -2907,8 +2977,9 @@
 
 	if ( minten )
 		TLan_SetBit( TLAN_NET_SIO_MINTEN, sio );
-
-	spin_unlock_irqrestore(&priv->lock, flags);
+	
+	if (!in_irq())
+		spin_unlock_irqrestore(&priv->lock, flags);
 
 } /* TLan_MiiWriteReg */
 
diff -urN linux-2.4.3-pre5/drivers/net/tlan.h linux/drivers/net/tlan.h
--- linux-2.4.3-pre5/drivers/net/tlan.h	Mon Dec 11 13:01:14 2000
+++ linux/drivers/net/tlan.h	Mon Dec  3 22:32:38 2001
@@ -8,10 +8,10 @@
  *  by James Banks
  *
  *  (C) 1997-1998 Caldera, Inc.
- *  (C) 1999-2000 Torben Mathiasen
+ *  (C) 1999-2001 Torben Mathiasen
  * 
  *  This software may be used and distributed according to the terms
- *  of the GNU Public License, incorporated herein by reference.
+ *  of the GNU General Public License, incorporated herein by reference.
  *
  ** This file is best viewed/edited with tabstop=4, colums>=132
  *
@@ -36,11 +36,11 @@
 #define FALSE			0
 #define TRUE			1
 
-#define TLAN_MIN_FRAME_SIZE	60
-#define TLAN_MAX_FRAME_SIZE	1536
+#define TLAN_MIN_FRAME_SIZE	64
+#define TLAN_MAX_FRAME_SIZE	1600
 
-#define TLAN_NUM_RX_LISTS	4
-#define TLAN_NUM_TX_LISTS	8
+#define TLAN_NUM_RX_LISTS	32
+#define TLAN_NUM_TX_LISTS	64
 
 #define TLAN_IGNORE		0
 #define TLAN_RECORD		1
@@ -53,7 +53,7 @@
 #define TLAN_DEBUG_PROBE	0x0010
 
 #define TX_TIMEOUT		(10*HZ)	 /* We need time for auto-neg */
-
+#define MAX_TLAN_BOARDS		8	 /* Max number of boards installed at a time */
 
 
 	/*****************************************************************
@@ -209,6 +209,8 @@
 	spinlock_t		lock;
 	u8			link;
 	u8			is_eisa;
+	struct tq_struct	tlan_tqueue;
+	u8			neg_be_verbose;
 } TLanPrivateInfo;
 
 
diff -urN linux-2.4.3-pre5/drivers/net/tokenring/ibmtr.c linux/drivers/net/tokenring/ibmtr.c
--- linux-2.4.3-pre5/drivers/net/tokenring/ibmtr.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/tokenring/ibmtr.c	Mon Dec  3 22:32:38 2001
@@ -255,12 +255,16 @@
  *
  *	We expect ibmtr_probe to be called once for each device entry
  *	which references it.
+ *
+ *	Argument 'dev' should never be NULL.  If we are built into
+ *	the kernel, Space.c passed up a net_device.  If we are
+ *	-DMODULE, init_module allocates net_devices for us.
  */
  
 int __init ibmtr_probe(struct net_device *dev)
 {
         int i;
-        int base_addr = dev ? dev->base_addr : 0;
+        int base_addr = dev->base_addr;
 
         if (base_addr > 0x1ff) 
         { 
@@ -301,7 +305,7 @@
 
 #ifndef MODULE
 #ifndef PCMCIA
-	dev = init_trdev(dev,0);
+	dev = init_trdev(dev, 0);
 #endif
 #endif
 
@@ -1877,8 +1881,11 @@
 		mem[i] = 0;
 		dev_ibmtr[i] = NULL;
                 dev_ibmtr[i] = init_trdev(dev_ibmtr[i], 0);
-                if (dev_ibmtr[i] == NULL)
-                        return -ENOMEM;
+                if (dev_ibmtr[i] == NULL) {
+			if (i == 0)
+                        	return -ENOMEM;
+			break;
+		}
 
 	        dev_ibmtr[i]->base_addr = io[i];
 	        dev_ibmtr[i]->irq       = irq[i];
diff -urN linux-2.4.3-pre5/drivers/net/tokenring/lanstreamer.c linux/drivers/net/tokenring/lanstreamer.c
--- linux-2.4.3-pre5/drivers/net/tokenring/lanstreamer.c	Fri Feb 16 16:02:36 2001
+++ linux/drivers/net/tokenring/lanstreamer.c	Mon Dec  3 22:32:38 2001
@@ -59,12 +59,10 @@
  *  03/03/00 - Merged to kernel, indented -kr -i8 -bri0, fixed some missing
  *		malloc free checks, reviewed code. <alan@redhat.com>
  *  03/13/00 - Added spinlocks for smp
+ *  03/08/01 - Added support for module_init() and module_exit()
  *  
  *  To Do:
  *
- *  1) Test Network Monitor Mode
- *  2) Add auto reset logic on adapter errors
- *  3) Test with varying options
  *
  *  If Problems do Occur
  *  Most problems can be rectified by either closing and opening the interface
@@ -123,7 +121,14 @@
  * Official releases will only have an a.b.c version number format.
  */
 
-static char *version = "LanStreamer.c v0.3.1 03/13/99 - Mike Sullivan";
+static char *version = "LanStreamer.c v0.4.0 03/08/01 - Mike Sullivan";
+
+static struct pci_device_id streamer_pci_tbl[] __initdata = {
+	{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_TR, PCI_ANY_ID, PCI_ANY_ID,},
+	{}	/* terminating entry */
+};
+MODULE_DEVICE_TABLE(pci,streamer_pci_tbl);
+
 
 static char *open_maj_error[] = {
 	"No error", "Lobe Media Test", "Physical Insertion",
@@ -170,8 +175,7 @@
 MODULE_PARM(message_level,
 	    "1-" __MODULE_STRING(STREAMER_MAX_ADAPTERS) "i");
 
-static int streamer_scan(struct net_device *dev);
-static int streamer_init(struct net_device *dev);
+static int streamer_reset(struct net_device *dev);
 static int streamer_open(struct net_device *dev);
 static int streamer_xmit(struct sk_buff *skb, struct net_device *dev);
 static int streamer_close(struct net_device *dev);
@@ -186,98 +190,190 @@
 static void streamer_asb_bh(struct net_device *dev);
 #if STREAMER_NETWORK_MONITOR
 #ifdef CONFIG_PROC_FS
+static int streamer_proc_info(char *buffer, char **start, off_t offset,
+			      int length, int *eof, void *data);
 static int sprintf_info(char *buffer, struct net_device *dev);
+struct streamer_private *dev_streamer=NULL;
 #endif
 #endif
 
-int __init streamer_probe(struct net_device *dev)
+static int __devinit streamer_init_one(struct pci_dev *pdev,
+				       const struct pci_device_id *ent)
 {
-	int cards_found;
-
-	cards_found = streamer_scan(dev);
-	return cards_found ? 0 : -ENODEV;
-}
-
-static int __init streamer_scan(struct net_device *dev)
-{
-	struct pci_dev *pci_device = NULL;
+  struct net_device *dev=NULL;
 	struct streamer_private *streamer_priv;
-	int card_no = 0;
-	if (pci_present()) 
-	{
-		while ((pci_device = pci_find_device(PCI_VENDOR_ID_IBM,	PCI_DEVICE_ID_IBM_TR, pci_device))) 
-		{
-			if (pci_enable_device(pci_device))
-				continue;
-			pci_set_master(pci_device);
+  __u32 pio_start, pio_end, pio_flags, pio_len;
+  __u32 mmio_start, mmio_end, mmio_flags, mmio_len;
+  int rc=0;
+  static int card_no=-1;
 
-			/* Check to see if io has been allocated, if so, we've already done this card,
-			   so continue on the card discovery loop  */
+#if STREAMER_DEBUG
+  printk("lanstreamer::streamer_init_one, entry pdev %p\n",pdev);
+#endif
 
-			if (check_region(pci_resource_start(pci_device,0), STREAMER_IO_SPACE)) 
-			{
 				card_no++;
-				continue;
-			}
-
-			streamer_priv = kmalloc(sizeof(struct streamer_private), GFP_KERNEL);
-			if(streamer_priv==NULL)
-			{
+  dev=init_trdev(dev, sizeof(*streamer_priv));
+  if(dev==NULL) {
 				printk(KERN_ERR "lanstreamer: out of memory.\n");
-				break;
-			}
-			memset(streamer_priv, 0, sizeof(struct streamer_private));
-			init_waitqueue_head(&streamer_priv->srb_wait);
-			init_waitqueue_head(&streamer_priv->trb_wait);
-#ifndef MODULE
-			dev = init_trdev(dev, 0);
-			if(dev==NULL)
-			{
-				kfree(streamer_priv);
-				printk(KERN_ERR "lanstreamer: out of memory.\n");
-				break;
+    return -ENOMEM;
 			}
 			SET_MODULE_OWNER(dev);
+  streamer_priv=dev->priv;
+
+#if STREAMER_NETWORK_MONITOR
+#ifdef CONFIG_PROC_FS
+  if (!dev_streamer) {
+    create_proc_read_entry("net/streamer_tr",0,0,streamer_proc_info,NULL); 
+  }
+  streamer_priv->next=dev_streamer;
+  dev_streamer=streamer_priv;
 #endif
-			dev->priv = (void *) streamer_priv;
-#if STREAMER_DEBUG
-			printk("pci_device: %p, dev:%p, dev->priv: %p\n",
-			       pci_device, dev, dev->priv);
 #endif
-			dev->irq = pci_device->irq;
-			dev->base_addr = pci_resource_start(pci_device, 0);
-			dev->init = &streamer_init;
-			streamer_priv->streamer_card_name = (char *)pci_device->resource[0].name;
-			streamer_priv->streamer_mmio = 
-				ioremap(pci_resource_start(pci_device, 1), 256);
-
-			if ((pkt_buf_sz[card_no] < 100) || (pkt_buf_sz[card_no] > 18000))
-				streamer_priv->pkt_buf_sz = PKT_BUF_SZ;
-			else
-				streamer_priv->pkt_buf_sz = pkt_buf_sz[card_no];
-
-			streamer_priv->streamer_ring_speed = ringspeed[card_no];
-			streamer_priv->streamer_message_level = message_level[card_no];
-
-			if (streamer_init(dev) == -1) {
-				unregister_netdevice(dev);
-				kfree(dev->priv);
-				return 0;
+  
+  if (pci_enable_device(pdev)) {
+    printk(KERN_ERR "lanstreamer: unable to enable pci device\n");
+    rc=-EIO;
+    goto err_out;
+  }
+  
+  pci_set_master(pdev);
+  
+  pio_start = pci_resource_start(pdev, 0);
+  pio_end = pci_resource_end(pdev, 0);
+  pio_flags = pci_resource_flags(pdev, 0);
+  pio_len = pci_resource_len(pdev, 0);
+  
+  mmio_start = pci_resource_start(pdev, 1);
+  mmio_end = pci_resource_end(pdev, 1);
+  mmio_flags = pci_resource_flags(pdev, 1);
+  mmio_len = pci_resource_len(pdev, 1);
+  
+#if STREAMER_DEBUG
+  printk("lanstreamer: pio_start %x pio_end %x pio_len %x pio_flags %x\n",
+	 pio_start, pio_end, pio_len, pio_flags);
+  printk("lanstreamer: mmio_start %x mmio_end %x mmio_len %x mmio_flags %x\n",
+	 mmio_start, mmio_end, mmio_flags, mmio_len);
+#endif
+
+  if (!request_region(pio_start, pio_len, "lanstreamer")) {
+    printk(KERN_ERR "lanstreamer: unable to get pci io addr %x\n",pio_start);
+    rc= -EBUSY;
+    goto err_out;
+  }
+
+  if (!request_mem_region(mmio_start, mmio_len, "lanstreamer")) {
+    printk(KERN_ERR "lanstreamer: unable to get pci mmio addr %x\n",mmio_start);
+    rc= -EBUSY;
+    goto err_out_free_pio;
+  }
+
+  streamer_priv->streamer_mmio=ioremap(mmio_start, mmio_len);
+  if (streamer_priv->streamer_mmio == NULL) {
+    printk(KERN_ERR "lanstreamer: unable to remap MMIO %x\n",mmio_start);
+    rc= -EIO;
+    goto err_out_free_mmio;
 			}
 
+  init_waitqueue_head(&streamer_priv->srb_wait);
+  init_waitqueue_head(&streamer_priv->trb_wait);
+
 			dev->open = &streamer_open;
 			dev->hard_start_xmit = &streamer_xmit;
 			dev->change_mtu = &streamer_change_mtu;
-
 			dev->stop = &streamer_close;
 			dev->do_ioctl = NULL;
 			dev->set_multicast_list = &streamer_set_rx_mode;
 			dev->get_stats = &streamer_get_stats;
 			dev->set_mac_address = &streamer_set_mac_address;
-			return 1;
+  dev->irq = pdev->irq;
+  dev->base_addr=pio_start;
+  
+  streamer_priv->streamer_card_name = (char *)pdev->resource[0].name;
+  streamer_priv->pci_dev=pdev;
+  
+  if ((pkt_buf_sz[card_no] < 100) || (pkt_buf_sz[card_no] > 18000))
+    streamer_priv->pkt_buf_sz = PKT_BUF_SZ;
+  else
+    streamer_priv->pkt_buf_sz = pkt_buf_sz[card_no];
+  
+  streamer_priv->streamer_ring_speed = ringspeed[card_no];
+  streamer_priv->streamer_message_level = message_level[card_no];
+
+  pdev->driver_data=dev;
+
+  spin_lock_init(&streamer_priv->streamer_lock);
+  
+  printk("%s \n", version);
+  printk("%s: %s. I/O at %hx, MMIO at %p, using irq %d\n",dev->name,
+	 streamer_priv->streamer_card_name,
+	 (unsigned int) dev->base_addr,
+	 streamer_priv->streamer_mmio, 
+	 dev->irq);
+
+  if (!streamer_reset(dev)) {
+    return 0;
+  }
+
+  iounmap(streamer_priv->streamer_mmio);
+err_out_free_mmio:
+  release_mem_region(mmio_start, mmio_len);
+err_out_free_pio:
+  release_region(pio_start, pio_len);
+err_out:
+  unregister_trdev(dev);
+  kfree(dev);
+#if STREAMER_DEBUG
+  printk("lanstreamer: Exit error %x\n",rc);
+#endif
+  return rc;
+}
+
+static void __devexit streamer_remove_one(struct pci_dev *pdev) {
+  struct net_device *dev=pdev->driver_data;
+  struct streamer_private *streamer_priv;
+
+#if STREAMER_DEBUG
+  printk("lanstreamer::streamer_remove_one entry pdev %p\n",pdev);
+#endif
+
+  if (dev == NULL) {
+    printk(KERN_ERR "lanstreamer::streamer_remove_one, ERROR dev is NULL\n");
+    return;
 		}
+
+  streamer_priv=dev->priv;
+  if (streamer_priv == NULL) {
+    printk(KERN_ERR "lanstreamer::streamer_remove_one, ERROR dev->priv is NULL\n");
+    return;
 	}
-	return 0;
+
+#if STREAMER_NETWORK_MONITOR
+#ifdef CONFIG_PROC_FS
+  {
+    struct streamer_private *slast;
+    struct streamer_private *scurrent;
+    if (streamer_priv == dev_streamer) {
+      dev_streamer=dev_streamer->next;
+    } else {
+      for(slast=scurrent=dev_streamer; dev_streamer; slast=scurrent, scurrent=scurrent->next) {
+	if (scurrent == streamer_priv) {
+	  slast->next=scurrent->next;
+	  break;
+	}
+      }
+    }
+    if (!dev_streamer) {
+      remove_proc_entry("net/streamer_tr", NULL);
+    }
+  }
+#endif
+#endif
+
+  unregister_trdev(dev);
+  release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev,0));
+  release_mem_region(pci_resource_start(pdev, 1), pci_resource_len(pdev,1));
+  kfree(dev);
+  pdev->driver_data=NULL;
 }
 
 
@@ -424,32 +520,6 @@
 	return 0;
 }
 
-static int __init streamer_init(struct net_device *dev) 
-{
-        struct streamer_private *streamer_priv;
-	__u8 *streamer_mmio;
-	int rc;
-  
-	streamer_priv=(struct streamer_private *)dev->priv;
-	streamer_mmio=streamer_priv->streamer_mmio;
-
-	spin_lock_init(&streamer_priv->streamer_lock);
-  
-	printk("%s \n", version);
-	printk("%s: %s. I/O at %hx, MMIO at %p, using irq %d\n",dev->name,
-	       streamer_priv->streamer_card_name,
-	       (unsigned int) dev->base_addr,
-	       streamer_priv->streamer_mmio, 
-	       dev->irq);
-
-	request_region(dev->base_addr, STREAMER_IO_SPACE, "streamer");
-
-	rc=streamer_reset(dev);
-	return rc;
-}
-  
-
-
 static int streamer_open(struct net_device *dev)
 {
 	struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv;
@@ -465,7 +535,7 @@
 	        rc=streamer_reset(dev);
 	}
 
-	if (request_irq(dev->irq, &streamer_interrupt, SA_SHIRQ, "streamer", dev)) {
+	if (request_irq(dev->irq, &streamer_interrupt, SA_SHIRQ, "lanstreamer", dev)) {
 		return -EAGAIN;
 	}
 #if STREAMER_DEBUG
@@ -563,7 +633,7 @@
 		 * timed out.
 		 */
 		writew(srb_open + 2, streamer_mmio + LAPA);
-		srb_word = ntohs(readw(streamer_mmio + LAPD)) & 0xFF;
+		srb_word = ntohs(readw(streamer_mmio + LAPD)) >> 8;
 		if (srb_word == STREAMER_CLEAR_RET_CODE) {
 			printk(KERN_WARNING "%s: Adapter Open time out or error.\n",
 			       dev->name);
@@ -1618,27 +1688,24 @@
 static int streamer_proc_info(char *buffer, char **start, off_t offset,
 			      int length, int *eof, void *data)
 {
+  struct streamer_private *sdev=NULL;
 	struct pci_dev *pci_device = NULL;
 	int len = 0;
 	off_t begin = 0;
 	off_t pos = 0;
 	int size;
 
-	struct device *dev;
-
+  struct net_device *dev;
 
 	size = sprintf(buffer, "IBM LanStreamer/MPC Chipset Token Ring Adapters\n");
 
 	pos += size;
 	len += size;
 
-	while ((pci_device = pci_find_device(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_TR, pci_device))) 
-	{
+  for(sdev=dev_streamer; sdev; sdev=sdev->next) {
+    pci_device=sdev->pci_dev;
+    dev=pci_device->driver_data;
 
-		for (dev = dev_base; dev != NULL; dev = dev->next) 
-		{
-		        if (dev->base_addr == pci_device->resource[0].start) 
-			{       /* Yep, a Streamer device */
 				size = sprintf_info(buffer + len, dev);
 				len += size;
 				pos = begin + len;
@@ -1649,9 +1716,7 @@
 				}
 				if (pos > offset + length)
 					break;
-			}	/* if */
 		}		/* for */
-	}			/* While */
 
 	*start = buffer + (offset - begin);	/* Start of wanted data */
 	len -= (offset - begin);	/* Start slop */
@@ -1743,66 +1808,34 @@
 #endif
 #endif
 
-#ifdef MODULE
-
-static struct net_device *dev_streamer[STREAMER_MAX_ADAPTERS];
-
-int init_module(void)
-{
-	int i;
-
-#if STREAMER_NETWORK_MONITOR
-#ifdef CONFIG_PROC_FS
-	create_proc_read_entry("net/streamer_tr",0,0,streamer_proc_info,NULL); 
-#endif
+static void streamer_suspend(struct pci_dev *pdev) {
+#if STREAMER_DEBUG
+  printk("lanstreamer::streamer_suspend entry pdev %p\n",pdev);
 #endif
-	for (i = 0; (i < STREAMER_MAX_ADAPTERS); i++) 
-	{
-		dev_streamer[i] = NULL;
-		dev_streamer[i] = init_trdev(dev_streamer[i], 0);
-		SET_MODULE_OWNER(dev_streamer[i]);
-		if (dev_streamer[i] == NULL)
-			return -ENOMEM;
-
-		dev_streamer[i]->init = &streamer_probe;
-
-		if (register_trdev(dev_streamer[i]) != 0) {
-			kfree(dev_streamer[i]);
-			dev_streamer[i] = NULL;
-			if (i == 0) 
-			{
-				printk(KERN_INFO "Streamer: No IBM LanStreamer PCI Token Ring cards found in system.\n");
-				return -EIO;
-			} else {
-				printk(KERN_INFO "Streamer: %d IBM LanStreamer PCI Token Ring card(s) found in system.\n", i);
-				return 0;
-			}
-		}
-	}
+}
 
-	return 0;
+static void streamer_resume(struct pci_dev *pdev) {
+#if STREAMER_DEBUG
+  printk("lanstreamer::streamer_resume entry pdev %p\n",pdev);
+#endif
 }
 
-void cleanup_module(void)
-{
-	int i;
-	struct streamer_private *streamer_priv;
+static struct pci_driver streamer_pci_driver = {
+  name:       "lanstreamer",
+  id_table:   streamer_pci_tbl,
+  probe:      streamer_init_one,
+  remove:     streamer_remove_one,
+  suspend:    streamer_suspend,
+  resume:     streamer_resume,
+};
 
-	for (i = 0; i < STREAMER_MAX_ADAPTERS; i++)
-		if (dev_streamer[i]) {
-			unregister_trdev(dev_streamer[i]);
-			release_region(dev_streamer[i]->base_addr, STREAMER_IO_SPACE);
-			streamer_priv=(struct streamer_private *)dev_streamer[i]->priv;
-			kfree(streamer_priv->streamer_rx_ring);
-			kfree(streamer_priv->streamer_tx_ring);
-			kfree(dev_streamer[i]->priv);
-			kfree(dev_streamer[i]);
-			dev_streamer[i] = NULL;
-		}
-#if STREAMER_NETWORK_MONITOR
-#ifdef CONFIG_PROC_FS
-	remove_proc_entry("net/streamer_tr", NULL);
-#endif
-#endif
+static int __init streamer_init_module(void) {
+  return pci_module_init(&streamer_pci_driver);
 }
-#endif				/* MODULE */
+
+static void __exit streamer_cleanup_module(void) {
+  pci_unregister_driver(&streamer_pci_driver);
+}
+
+module_init(streamer_init_module);
+module_exit(streamer_cleanup_module);
diff -urN linux-2.4.3-pre5/drivers/net/tokenring/lanstreamer.h linux/drivers/net/tokenring/lanstreamer.h
--- linux-2.4.3-pre5/drivers/net/tokenring/lanstreamer.h	Tue Mar 21 14:43:39 2000
+++ linux/drivers/net/tokenring/lanstreamer.h	Mon Dec  3 22:32:38 2001
@@ -257,6 +257,8 @@
 	__u16 arb;
 	__u16 asb;
 
+        struct streamer_private *next;
+        struct pci_dev *pci_dev;
 	__u8 *streamer_mmio;
         char *streamer_card_name;
  
diff -urN linux-2.4.3-pre5/drivers/net/tokenring/olympic.c linux/drivers/net/tokenring/olympic.c
--- linux-2.4.3-pre5/drivers/net/tokenring/olympic.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/tokenring/olympic.c	Mon Dec  3 22:32:38 2001
@@ -215,7 +215,11 @@
 			init_waitqueue_head(&olympic_priv->srb_wait);
 			init_waitqueue_head(&olympic_priv->trb_wait);
 #ifndef MODULE
-			dev=init_trdev(dev, 0);
+			dev = init_trdev(NULL, 0);
+			if (!dev) {
+				kfree(olympic_priv);
+				return 0;
+			}
 #endif
 			dev->priv=(void *)olympic_priv;
 #if OLYMPIC_DEBUG  
@@ -225,6 +229,7 @@
 			dev->base_addr=pci_resource_start(pci_device, 0);
 			dev->init=&olympic_init;	/* AKPM: Not needed */
 			olympic_priv->olympic_card_name = (char *)pci_device->resource[0].name ; 
+			/* FIXME: check ioremap return val, handle cleanup */
 			olympic_priv->olympic_mmio = 
 				ioremap(pci_resource_start(pci_device,1),256);
 			olympic_priv->olympic_lap = 
@@ -240,6 +245,10 @@
 	
 			if(olympic_init(dev)==-1) {
 				kfree(dev->priv);
+#ifndef MODULE
+				unregister_netdev(dev);
+				kfree(dev);
+#endif
 				return 0;
 			}				
 
@@ -1261,6 +1270,11 @@
 }
 #endif 
 		mac_frame = dev_alloc_skb(frame_len) ; 
+		if (!mac_frame) {
+			printk(KERN_WARNING "%s: Memory squeeze, dropping "
+			       "frame.\n", dev->name);
+			goto drop_frame;
+		}
 
 		/* Walk the buffer chain, creating the frame */
 
@@ -1283,6 +1297,7 @@
 		netif_rx(mac_frame) ; 	
 		dev->last_rx = jiffies ;
 
+drop_frame:
 		/* Now tell the card we have dealt with the received frame */
 
 		/* Set LISR Bit 1 */
@@ -1635,8 +1650,11 @@
         for (i = 0; (i<OLYMPIC_MAX_ADAPTERS); i++) {
 		dev_olympic[i] = NULL;
                 dev_olympic[i] = init_trdev(dev_olympic[i], 0);
-                if (dev_olympic[i] == NULL)
-                        return -ENOMEM;
+                if (dev_olympic[i] == NULL) {
+			if (i == 0)
+                        	return -ENOMEM;
+			break;
+		}
 
 		dev_olympic[i]->init      = &olympic_probe;
 
diff -urN linux-2.4.3-pre5/drivers/net/tokenring/smctr.c linux/drivers/net/tokenring/smctr.c
--- linux-2.4.3-pre5/drivers/net/tokenring/smctr.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/tokenring/smctr.c	Mon Dec  3 22:32:38 2001
@@ -4546,20 +4546,24 @@
                                 struct sk_buff *skb;
 
                                 skb = dev_alloc_skb(rx_size);
-                                skb_put(skb, rx_size);
+				if (skb) {
+                                	skb_put(skb, rx_size);
 
-                                memcpy(skb->data, pbuff, rx_size);
-                                sti();
+                                	memcpy(skb->data, pbuff, rx_size);
+                                	sti();
 
-                                /* Update Counters */
-                                tp->MacStat.rx_packets++;
-                                tp->MacStat.rx_bytes += skb->len;
+                                	/* Update Counters */
+                                	tp->MacStat.rx_packets++;
+                                	tp->MacStat.rx_bytes += skb->len;
 
-                                /* Kick the packet on up. */
-                                skb->dev = dev;
-                                skb->protocol = tr_type_trans(skb, dev);
-                                netif_rx(skb);
-				dev->last_rx = jiffies;
+                                	/* Kick the packet on up. */
+                                	skb->dev = dev;
+                                	skb->protocol = tr_type_trans(skb, dev);
+                                	netif_rx(skb);
+					dev->last_rx = jiffies;
+				} else {
+                                	sti();
+				}
                         }
                         else
                                 smctr_process_rx_packet((MAC_HEADER *)pbuff,
diff -urN linux-2.4.3-pre5/drivers/net/tokenring/tmsisa.c linux/drivers/net/tokenring/tmsisa.c
--- linux-2.4.3-pre5/drivers/net/tokenring/tmsisa.c	Fri Feb 16 16:02:36 2001
+++ linux/drivers/net/tokenring/tmsisa.c	Mon Dec  3 22:32:38 2001
@@ -7,7 +7,7 @@
  *  Dedicated to my girlfriend Steffi Bopp
  *
  *  This software may be used and distributed according to the terms
- *  of the GNU Public License, incorporated herein by reference.
+ *  of the GNU General Public License, incorporated herein by reference.
  *
  *  This driver module supports the following cards:
  *	- SysKonnect TR4/16(+) ISA	(SK-4190)
diff -urN linux-2.4.3-pre5/drivers/net/via-rhine.c linux/drivers/net/via-rhine.c
--- linux-2.4.3-pre5/drivers/net/via-rhine.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/via-rhine.c	Mon Dec  3 22:32:38 2001
@@ -497,7 +497,7 @@
 		goto err_out;
 
 	/* this should always be supported */
-	if (!pci_dma_supported(pdev, 0xffffffff)) {
+	if (pci_set_dma_mask(pdev, 0xffffffff)) {
 		printk(KERN_ERR "32-bit PCI DMA addresses not supported by the card!?\n");
 		goto err_out;
 	}
diff -urN linux-2.4.3-pre5/drivers/net/wan/cycx_x25.c linux/drivers/net/wan/cycx_x25.c
--- linux-2.4.3-pre5/drivers/net/wan/cycx_x25.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/wan/cycx_x25.c	Mon Dec  3 22:32:38 2001
@@ -1460,6 +1460,7 @@
         skb->pkt_type = PACKET_HOST;
 
         netif_rx(skb);
+	dev->last_rx = jiffies;		/* timestamp */
 }
 
 /* Convert line speed in bps to a number used by cyclom 2x code. */
diff -urN linux-2.4.3-pre5/drivers/net/wan/dscc4.c linux/drivers/net/wan/dscc4.c
--- linux-2.4.3-pre5/drivers/net/wan/dscc4.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/wan/dscc4.c	Mon Dec  3 22:32:38 2001
@@ -2,7 +2,7 @@
  * drivers/net/wan/dscc4/dscc4_main.c: a DSCC4 HDLC driver for Linux
  *
  * This software may be used and distributed according to the terms of the 
- * GNU Public License. 
+ * GNU General Public License. 
  *
  * The author may be reached as romieu@cogenit.fr.
  * Specific bug reports/asian food will be welcome.
diff -urN linux-2.4.3-pre5/drivers/net/wan/sbni.c linux/drivers/net/wan/sbni.c
--- linux-2.4.3-pre5/drivers/net/wan/sbni.c	Tue Feb 13 13:15:05 2001
+++ linux/drivers/net/wan/sbni.c	Mon Dec  3 22:32:38 2001
@@ -283,7 +283,7 @@
 	struct net_device *dev = neigh->dev;
   
   
-	if (type == __constant_htons(ETH_P_802_3))
+	if (type == htons(ETH_P_802_3))
 		return -1;
   
 	sbni->h_proto = type;
@@ -742,7 +742,7 @@
 					 */
 					DP( printk("%s: sbni_recv SendComplete\n",dev->name); );
 					/*
-					 *	We sucessfully sent current packet
+					 *	We successfully sent current packet
 					 */
 	      
 					if(lp->waitack)
@@ -1014,6 +1014,8 @@
 
 		skb_pull(skb,SBNI_HH_SZ);
    
+		skb->dev->last_rx = jiffies;
+		lp->stats.rx_bytes += skb->len;
 		netif_rx(skb);
 		lp->stats.rx_packets++;
 	}
@@ -1148,7 +1150,7 @@
 	lp->waitack=0;
 	netif_wake_queue(dev);
 	
-	DP( printk("%s: queue dropping stoped\n",dev->name); );	
+	DP( printk("%s: queue dropping stopped\n",dev->name); );	
 }
 
 /*
diff -urN linux-2.4.3-pre5/drivers/net/winbond-840.c linux/drivers/net/winbond-840.c
--- linux-2.4.3-pre5/drivers/net/winbond-840.c	Mon Dec  3 22:32:29 2001
+++ linux/drivers/net/winbond-840.c	Mon Dec  3 22:32:38 2001
@@ -390,7 +390,7 @@
 
 	irq = pdev->irq;
 
-	if(!pci_dma_supported(pdev,0xFFFFffff)) {
+	if(pci_set_dma_mask(pdev,0xFFFFffff)) {
 		printk(KERN_WARNING "Winbond-840: Device %s disabled due to DMA limitations.\n",
 				pdev->name);
 		return -EIO;
@@ -438,7 +438,7 @@
 	
 	pci_set_drvdata(pdev, dev);
 
-	if (dev->mem_start && dev->mem_start != ~0)
+	if (dev->mem_start)
 		option = dev->mem_start;
 
 	/* The lower four bits are the media type. */
diff -urN linux-2.4.3-pre5/drivers/scsi/qlogicfc.c linux/drivers/scsi/qlogicfc.c
--- linux-2.4.3-pre5/drivers/scsi/qlogicfc.c	Mon Sep 18 13:36:25 2000
+++ linux/drivers/scsi/qlogicfc.c	Mon Dec  3 22:32:39 2001
@@ -732,7 +732,7 @@
 	int wait_time;
 	struct Scsi_Host *host = NULL;
 	struct isp2x00_hostdata *hostdata;
-	struct pci_dev *pdev = NULL;
+	struct pci_dev *pdev;
 	unsigned short device_ids[2];
 	dma64_addr_t busaddr;
 	int i;
@@ -751,6 +751,7 @@
 	}
 
 	for (i=0; i<2; i++){
+		pdev = NULL;
 	        while ((pdev = pci_find_device(PCI_VENDOR_ID_QLOGIC, device_ids[i], pdev))) {
 			if (pci_enable_device(pdev))
 				continue;
@@ -1428,7 +1429,22 @@
 	        for (i = 0; i < QLOGICFC_REQ_QUEUE_LEN; i++){ 
 		        if (hostdata->handle_ptrs[i] && (hostdata->port_db[hostdata->handle_ptrs[i]->target].loop_id > QLOGICFC_MAX_LOOP_ID || hostdata->adapter_state & AS_REDO_LOOP_PORTDB)){
                                 if (hostdata->port_db[hostdata->handle_ptrs[i]->target].loop_id != hostdata->port_db[0].loop_id){
+					Scsi_Cmnd *Cmnd = hostdata->handle_ptrs[i];
+
+					 if (Cmnd->use_sg)
+						 pci64_unmap_sg(hostdata->pci_dev,
+								(struct scatterlist *)Cmnd->buffer,
+								Cmnd->use_sg,
+								scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
+					 else if (Cmnd->request_bufflen &&
+						  Cmnd->sc_data_direction != PCI_DMA_NONE)
+						 pci64_unmap_single(hostdata->pci_dev,
+								    *(dma64_addr_t *)&Cmnd->SCp,
+								    Cmnd->request_bufflen,
+								    scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
+
 					 hostdata->handle_ptrs[i]->result = DID_SOFT_ERROR << 16;
+
 					 if (hostdata->handle_ptrs[i]->scsi_done){
 					   (*hostdata->handle_ptrs[i]->scsi_done) (hostdata->handle_ptrs[i]);
 					 }
@@ -1521,6 +1537,17 @@
 			hostdata->handle_serials[handle] = 0;
 			hostdata->queued--;
 			if (Cmnd != NULL) {
+				if (Cmnd->use_sg)
+					pci64_unmap_sg(hostdata->pci_dev,
+						       (struct scatterlist *)Cmnd->buffer,
+						       Cmnd->use_sg,
+						       scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
+				else if (Cmnd->request_bufflen &&
+					 Cmnd->sc_data_direction != PCI_DMA_NONE)
+					pci64_unmap_single(hostdata->pci_dev,
+							   *(dma64_addr_t *)&Cmnd->SCp,
+							   Cmnd->request_bufflen,
+							   scsi_to_pci_dma_dir(Cmnd->sc_data_direction));
 				Cmnd->result = 0x0;
 				(*Cmnd->scsi_done) (Cmnd);
 			} else
diff -urN linux-2.4.3-pre5/drivers/scsi/sym53c8xx.c linux/drivers/scsi/sym53c8xx.c
--- linux-2.4.3-pre5/drivers/scsi/sym53c8xx.c	Mon Dec  3 22:32:30 2001
+++ linux/drivers/scsi/sym53c8xx.c	Mon Dec  3 22:32:39 2001
@@ -13070,7 +13070,7 @@
 		(int) (PciDeviceFn(pdev) & 7));
 
 #ifdef SCSI_NCR_DYNAMIC_DMA_MAPPING
-	if (!pci_dma_supported(pdev, (dma_addr_t) (0xffffffffUL))) {
+	if (pci_set_dma_mask(pdev, (dma_addr_t) (0xffffffffUL))) {
 		printk(KERN_WARNING NAME53C8XX
 		       "32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n");
 		return -1;
diff -urN linux-2.4.3-pre5/drivers/sound/cs46xx.c linux/drivers/sound/cs46xx.c
--- linux-2.4.3-pre5/drivers/sound/cs46xx.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/sound/cs46xx.c	Mon Dec  3 22:32:39 2001
@@ -4020,8 +4020,8 @@
 	}
 	memset(card, 0, sizeof(*card));
 
-	card->ba0_addr = pci_dev->resource[0].start&PCI_BASE_ADDRESS_MEM_MASK;
-	card->ba1_addr = pci_dev->resource[1].start&PCI_BASE_ADDRESS_MEM_MASK;
+	card->ba0_addr = pci_resource_start(pci_dev, 0);
+	card->ba1_addr = pci_resource_start(pci_dev, 1);
 	card->pci_dev = pci_dev;
 	card->irq = pci_dev->irq;
 	card->magic = CS_CARD_MAGIC;
diff -urN linux-2.4.3-pre5/drivers/sound/emu10k1/main.c linux/drivers/sound/emu10k1/main.c
--- linux-2.4.3-pre5/drivers/sound/emu10k1/main.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/sound/emu10k1/main.c	Mon Dec  3 22:32:39 2001
@@ -619,7 +619,7 @@
 	}
 	memset(card, 0, sizeof(struct emu10k1_card));
 
-	if (!pci_dma_supported(pci_dev, EMU10K1_DMA_MASK)) {
+	if (pci_set_dma_mask(pci_dev, EMU10K1_DMA_MASK)) {
 		printk(KERN_ERR "emu10k1: architecture does not support 32bit PCI busmaster DMA\n");
 		kfree(card);
 		return -ENODEV;
diff -urN linux-2.4.3-pre5/drivers/sound/es1370.c linux/drivers/sound/es1370.c
--- linux-2.4.3-pre5/drivers/sound/es1370.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/sound/es1370.c	Mon Dec  3 22:32:39 2001
@@ -2524,9 +2524,10 @@
 		return -1;
 	if (pcidev->irq == 0) 
 		return -1;
-	if (!pci_dma_supported(pcidev, 0xffffffff)) {
+	i = pci_set_dma_mask(pcidev, 0xffffffff);
+	if (i) {
 		printk(KERN_WARNING "es1370: architecture does not support 32bit PCI busmaster DMA\n");
-		return -1;
+		return i;
 	}
 	if (!(s = kmalloc(sizeof(struct es1370_state), GFP_KERNEL))) {
 		printk(KERN_WARNING "es1370: out of memory\n");
@@ -2608,7 +2609,6 @@
 	set_fs(fs);
 	/* store it in the driver field */
 	pci_set_drvdata(pcidev, s);
-	pcidev->dma_mask = 0xffffffff;
 	/* put it into driver list */
 	list_add_tail(&s->devs, &devs);
 	/* increment devindex */
diff -urN linux-2.4.3-pre5/drivers/sound/es1371.c linux/drivers/sound/es1371.c
--- linux-2.4.3-pre5/drivers/sound/es1371.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/sound/es1371.c	Mon Dec  3 22:32:39 2001
@@ -2737,9 +2737,10 @@
 		return -1;
 	if (pcidev->irq == 0) 
 		return -1;
-	if (!pci_dma_supported(pcidev, 0xffffffff)) {
+	i = pci_set_dma_mask(pcidev, 0xffffffff);
+	if (i) {
 		printk(KERN_WARNING "es1371: architecture does not support 32bit PCI busmaster DMA\n");
-		return -1;
+		return i;
 	}
 	if (!(s = kmalloc(sizeof(struct es1371_state), GFP_KERNEL))) {
 		printk(KERN_WARNING PFX "out of memory\n");
@@ -2874,7 +2875,6 @@
 	outl(cssr, s->io+ES1371_REG_STATUS);
 	/* store it in the driver field */
 	pci_set_drvdata(pcidev, s);
-	pcidev->dma_mask = 0xffffffff;
 	/* put it into driver list */
 	list_add_tail(&s->devs, &devs);
 	/* increment devindex */
diff -urN linux-2.4.3-pre5/drivers/sound/esssolo1.c linux/drivers/sound/esssolo1.c
--- linux-2.4.3-pre5/drivers/sound/esssolo1.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/sound/esssolo1.c	Mon Dec  3 22:32:39 2001
@@ -2244,7 +2244,6 @@
 {
 	struct solo1_state *s;
 	struct pm_dev *pmdev;
-	dma_addr_t dma_mask;
 
 	if (!RSRCISIOREGION(pcidev, 0) ||
 	    !RSRCISIOREGION(pcidev, 1) ||
@@ -2253,14 +2252,16 @@
 		return -1;
 	if (pcidev->irq == 0)
 		return -1;
-	if (pci_dma_supported(pcidev, 0x00ffffff)) {
-		dma_mask = 0x00ffffff; /* this enables playback and recording */
-	} else if (pci_dma_supported(pcidev, 0xffffffff)) {
-		dma_mask = 0xffffffff; /* this enables only playback, as the recording BMDMA can handle only 24bits  */
-	} else {
+
+	/* Recording requires 24-bit DMA, so attempt to set dma mask
+	 * to 24 bits first, then 32 bits (playback only) if that fails.
+	 */
+	if (pci_set_dma_mask(pcidev, 0x00ffffff) &&
+	    pci_set_dma_mask(pcidev, 0xffffffff)) {
 		printk(KERN_WARNING "solo1: architecture does not support 24bit or 32bit PCI busmaster DMA\n");
 		return -1;
 	}
+
 	if (!(s = kmalloc(sizeof(struct solo1_state), GFP_KERNEL))) {
 		printk(KERN_WARNING "solo1: out of memory\n");
 		return -1;
@@ -2318,7 +2319,6 @@
 		goto err;
 	/* store it in the driver field */
 	pci_set_drvdata(pcidev, s);
-	pcidev->dma_mask = dma_mask;
 	/* put it into driver list */
 	list_add_tail(&s->devs, &devs);
 
diff -urN linux-2.4.3-pre5/drivers/sound/sonicvibes.c linux/drivers/sound/sonicvibes.c
--- linux-2.4.3-pre5/drivers/sound/sonicvibes.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/sound/sonicvibes.c	Mon Dec  3 22:32:39 2001
@@ -2478,7 +2478,7 @@
 		return -1;
 	if (pcidev->irq == 0)
 		return -1;
-	if (!pci_dma_supported(pcidev, 0x00ffffff)) {
+	if (pci_set_dma_mask(pcidev, 0x00ffffff)) {
 		printk(KERN_WARNING "sonicvibes: architecture does not support 24bit PCI busmaster DMA\n");
 		return -1;
 	}
@@ -2602,7 +2602,6 @@
 	set_fs(fs);
        /* store it in the driver field */
 	pci_set_drvdata(pcidev, s);
-	pcidev->dma_mask = 0x00ffffff;
 	/* put it into driver list */
 	list_add_tail(&s->devs, &devs);
 	/* increment devindex */
diff -urN linux-2.4.3-pre5/drivers/sound/trident.c linux/drivers/sound/trident.c
--- linux-2.4.3-pre5/drivers/sound/trident.c	Mon Dec  3 22:32:30 2001
+++ linux/drivers/sound/trident.c	Mon Dec  3 22:32:39 2001
@@ -3309,7 +3309,7 @@
 	struct trident_card *card;
 	u8 revision;
 
-	if (!pci_dma_supported(pci_dev, TRIDENT_DMA_MASK)) {
+	if (pci_set_dma_mask(pci_dev, TRIDENT_DMA_MASK)) {
 		printk(KERN_ERR "trident: architecture does not support"
 		       " 30bit PCI busmaster DMA\n");
 		return -ENODEV;
@@ -3429,7 +3429,6 @@
 	}
 
 	pci_set_drvdata(pci_dev, card);
-	pci_dev->dma_mask = TRIDENT_DMA_MASK;
 
 	/* Enable Address Engine Interrupts */
 	trident_enable_loop_interrupts(card);
diff -urN linux-2.4.3-pre5/drivers/usb/serial/belkin_sa.c linux/drivers/usb/serial/belkin_sa.c
--- linux-2.4.3-pre5/drivers/usb/serial/belkin_sa.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/usb/serial/belkin_sa.c	Mon Dec  3 22:32:39 2001
@@ -24,7 +24,11 @@
  * -- Add support for flush commands
  * -- Add everything that is missing :)
  *
- * (11/06/2000) gkh
+ * 12-Mar-2001 gkh
+ *	- Added support for the GoHubs GO-COM232 device which is the same as the
+ *	  Peracom device.
+ *
+ * 06-Nov-2000 gkh
  *	- Added support for the old Belkin and Peracom devices.
  *	- Made the port able to be opened multiple times.
  *	- Added some defaults incase the line settings are things these devices
@@ -90,6 +94,7 @@
 	{ USB_DEVICE(BELKIN_SA_VID, BELKIN_SA_PID) },
 	{ USB_DEVICE(BELKIN_OLD_VID, BELKIN_OLD_PID) },
 	{ USB_DEVICE(PERACOM_VID, PERACOM_PID) },
+	{ USB_DEVICE(GOHUBS_VID, GOHUBS_PID) },
 	{ }							/* Terminating entry */
 };
 
@@ -108,6 +113,11 @@
 	{ }							/* Terminating entry */
 };
 
+static __devinitdata struct usb_device_id gocom232_table [] = {
+	{ USB_DEVICE(GOHUBS_VID, GOHUBS_PID) },
+	{ }							/* Terminating entry */
+};
+
 MODULE_DEVICE_TABLE (usb, id_table_combined);
 
 /* All of the device info needed for the Belkin serial converter */
@@ -174,6 +184,27 @@
 	shutdown:		belkin_sa_shutdown,
 };
 
+/* the GoHubs Go-COM232 device is the same as the Peracom single port adapter */
+struct usb_serial_device_type gocom232_device = {
+	name:			"GO-COM232 USB Serial Converter",
+	id_table:		gocom232_table,			/* the GO-COM232 device */
+	needs_interrupt_in:	MUST_HAVE,			/* this device must have an interrupt in endpoint */
+	needs_bulk_in:		MUST_HAVE,			/* this device must have a bulk in endpoint */
+	needs_bulk_out:		MUST_HAVE,			/* this device must have a bulk out endpoint */
+	num_interrupt_in:	1,
+	num_bulk_in:		1,
+	num_bulk_out:		1,
+	num_ports:		1,
+	open:			belkin_sa_open,
+	close:			belkin_sa_close,
+	read_int_callback:	belkin_sa_read_int_callback,	/* How we get the status info */
+	ioctl:			belkin_sa_ioctl,
+	set_termios:		belkin_sa_set_termios,
+	break_ctl:		belkin_sa_break_ctl,
+	startup:		belkin_sa_startup,
+	shutdown:		belkin_sa_shutdown,
+};
+
 
 struct belkin_sa_private {
 	unsigned long		control_state;
@@ -558,6 +589,7 @@
 	usb_serial_register (&belkin_sa_device);
 	usb_serial_register (&belkin_old_device);
 	usb_serial_register (&peracom_device);
+	usb_serial_register (&gocom232_device);
 	return 0;
 }
 
@@ -567,6 +599,7 @@
 	usb_serial_deregister (&belkin_sa_device);
 	usb_serial_deregister (&belkin_old_device);
 	usb_serial_deregister (&peracom_device);
+	usb_serial_deregister (&gocom232_device);
 }
 
 
diff -urN linux-2.4.3-pre5/drivers/usb/serial/belkin_sa.h linux/drivers/usb/serial/belkin_sa.h
--- linux-2.4.3-pre5/drivers/usb/serial/belkin_sa.h	Sat Nov 11 18:51:18 2000
+++ linux/drivers/usb/serial/belkin_sa.h	Mon Dec  3 22:32:39 2001
@@ -15,7 +15,10 @@
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  *
- * (11/06/2000) gkh
+ * 12-Mar-2001 gkh
+ *	Added GoHubs GO-COM232 device id.
+ *
+ * 06-Nov-2000 gkh
  *	Added old Belkin and Peracom device ids, which this driver supports
  *
  * 12-Oct-2000 William Greathouse
@@ -38,6 +41,9 @@
 
 #define PERACOM_VID	0x0565	/* Peracom's vendor id */
 #define PERACOM_PID	0x0001	/* Peracom's single port serial converter's id */
+
+#define GOHUBS_VID	0x0921	/* GoHubs vendor id */
+#define GOHUBS_PID	0x0100	/* GoHubs single port serial converter's id (identical to the Peracom device) */
 
 /* Vendor Request Interface */
 #define BELKIN_SA_SET_BAUDRATE_REQUEST	0  /* Set baud rate */
diff -urN linux-2.4.3-pre5/drivers/usb/serial/digi_acceleport.c linux/drivers/usb/serial/digi_acceleport.c
--- linux-2.4.3-pre5/drivers/usb/serial/digi_acceleport.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/usb/serial/digi_acceleport.c	Mon Dec  3 22:32:39 2001
@@ -1282,12 +1282,10 @@
 	|| priv->dp_write_urb_in_use ) {
 
 		/* buffer data if count is 1 (probably put_char) if possible */
-		if( count == 1 ) {
-			new_len = MIN( count,
-				DIGI_OUT_BUF_SIZE-priv->dp_out_buf_len );
-			memcpy( priv->dp_out_buf+priv->dp_out_buf_len, buf,
-				new_len );
-			priv->dp_out_buf_len += new_len;
+		if( count == 1 && priv->dp_out_buf_len < DIGI_OUT_BUF_SIZE ) {
+			priv->dp_out_buf[priv->dp_out_buf_len++]
+				= *(from_user ? user_buf : buf);
+			new_len = 1;
 		} else {
 			new_len = 0;
 		}
diff -urN linux-2.4.3-pre5/include/linux/pci.h linux/include/linux/pci.h
--- linux-2.4.3-pre5/include/linux/pci.h	Mon Dec  3 22:32:30 2001
+++ linux/include/linux/pci.h	Mon Dec  3 22:32:39 2001
@@ -540,7 +540,7 @@
 unsigned long pci_bridge_check_io(struct pci_dev *);
 void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
 		    int (*)(struct pci_dev *, u8, u8));
-#define HAVE_PCI_REQ_REGIONS 1
+#define HAVE_PCI_REQ_REGIONS
 int pci_request_regions(struct pci_dev *, char *);
 void pci_release_regions(struct pci_dev *);
 
diff -urN linux-2.4.3-pre5/mm/memory.c linux/mm/memory.c
--- linux-2.4.3-pre5/mm/memory.c	Mon Dec  3 22:32:30 2001
+++ linux/mm/memory.c	Mon Dec  3 22:32:39 2001
@@ -160,6 +160,7 @@
 	src_pgd = pgd_offset(src, address)-1;
 	dst_pgd = pgd_offset(dst, address)-1;
 	
+	spin_lock(&dst->page_table_lock);		
 	for (;;) {
 		pmd_t * src_pmd, * dst_pmd;
 
@@ -178,7 +179,6 @@
 			continue;
 		}
 
-		spin_lock(&dst->page_table_lock);		
 		src_pmd = pmd_offset(src_pgd, address);
 		dst_pmd = pmd_alloc(dst, dst_pgd, address);
 		if (!dst_pmd)
@@ -247,13 +247,10 @@
 cont_copy_pmd_range:	src_pmd++;
 			dst_pmd++;
 		} while ((unsigned long)src_pmd & PMD_TABLE_MASK);
-		spin_unlock(&dst->page_table_lock);
 	}
-out:
-	return 0;
-
 out_unlock:
 	spin_unlock(&src->page_table_lock);
+out:
 	spin_unlock(&dst->page_table_lock);
 	return 0;
 
@@ -878,9 +875,9 @@
 	 */
 	spin_unlock(&mm->page_table_lock);
 	new_page = alloc_page(GFP_HIGHUSER);
+	spin_lock(&mm->page_table_lock);
 	if (!new_page)
 		return -1;
-	spin_lock(&mm->page_table_lock);
 
 	/*
 	 * Re-check the pte - we dropped the lock
diff -urN linux-2.4.3-pre5/mm/page_alloc.c linux/mm/page_alloc.c
--- linux-2.4.3-pre5/mm/page_alloc.c	Mon Jan 15 12:35:12 2001
+++ linux/mm/page_alloc.c	Mon Dec  3 22:32:39 2001
@@ -455,8 +455,7 @@
 			memory_pressure++;
 			try_to_free_pages(gfp_mask);
 			wakeup_bdflush(0);
-			if (!order)
-				goto try_again;
+			goto try_again;
 		}
 	}
 
