patch-2.1.80 linux/drivers/net/tulip.c

Next file: linux/drivers/scsi/BusLogic.c
Previous file: linux/drivers/net/strip.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.79/linux/drivers/net/tulip.c linux/drivers/net/tulip.c
@@ -1100,11 +1100,7 @@
 	outl(0x00200000 | 0x4800, ioaddr + CSR0);
 #else
 #ifndef ORIGINAL_TEXT
-#ifndef __SMP__
-#define x86 ((struct cpuinfo_x86*)cpu_data)->x86
-#else
-#error What should we make here?
-#endif
+#define x86 (boot_cpu_data.x86)
 #endif
 	outl(0x00200000 | (x86 <= 4 ? 0x4800 : 0x8000), ioaddr + CSR0);
 	if (x86 <= 4)
@@ -1753,7 +1749,15 @@
 
 #ifdef CONFIG_NET_FASTROUTE
 	cli();
-	dev->tx_semaphore = 0;
+	if (xchg(&dev->tx_semaphore,0) == 0) {
+		sti();
+		/* With new queueing algorithm returning 1 when dev->tbusy == 0
+		   should not result in lockups, but I am still not sure. --ANK
+		 */
+		if (net_ratelimit())
+				printk(KERN_CRIT "Please check: are you still alive?\n");
+		return 1;
+	}
 #endif
 	/* Block a timer-based transmit from overlapping.  This could better be
 	   done with atomic_swap(1, dev->tbusy), but set_bit() works as well. */
@@ -1764,7 +1768,7 @@
 		if (jiffies - dev->trans_start >= TX_TIMEOUT)
 				tulip_tx_timeout(dev);
 #ifdef CONFIG_NET_FASTROUTE
-		dev->tx_semaphore = 0;
+		dev->tx_semaphore = 1;
 #endif
 		return 1;
 	}
@@ -1796,6 +1800,7 @@
 		flag |= 0xe2000000;
 
 	tp->tx_ring[entry].length = skb->len | flag;
+	tp->stats.tx_bytes += skb->len;
 	tp->tx_ring[entry].status = 0x80000000;	/* Pass ownership to the chip. */
 	tp->cur_tx++;
 	/* Trigger an immediate transmit demand. */
@@ -1803,7 +1808,7 @@
 
 	dev->trans_start = jiffies;
 #ifdef CONFIG_NET_FASTROUTE
-	dev->tx_semaphore = 0;
+	dev->tx_semaphore = 1;
 	sti();
 #endif
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov