patch-2.1.124 linux/drivers/net/a2065.c

Next file: linux/drivers/net/apne.c
Previous file: linux/drivers/net/Space.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.123/linux/drivers/net/a2065.c linux/drivers/net/a2065.c
@@ -570,6 +570,7 @@
 	int entry, skblen, len;
 	int status = 0;
 	static int outs;
+	unsigned long flags;
 
 	/* Transmitter timeout, serious problems */
 	if (dev->tbusy) {
@@ -586,18 +587,20 @@
 	}
 
 	/* Block a timer-based transmit from overlapping. */
-#ifdef OLD_METHOD
-	dev->tbusy = 1;
-#else
 	if (test_and_set_bit (0, (void *) &dev->tbusy) != 0) {
 		printk ("Transmitter access conflict.\n");
 		return -1;
 	}
-#endif
+
 	skblen = skb->len;
 
-	if (!TX_BUFFS_AVAIL)
+	save_flags(flags);
+	cli();
+
+	if (!TX_BUFFS_AVAIL){
+		restore_flags(flags);
 		return -1;
+	}
 
 #ifdef DEBUG_DRIVER
 	/* dump the packet */
@@ -634,6 +637,7 @@
     
 	if (TX_BUFFS_AVAIL)
 		dev->tbusy = 0;
+	restore_flags(flags);
 
 	return status;
 }

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