patch-2.1.122 linux/drivers/net/ariadne.c

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

diff -u --recursive --new-file v2.1.121/linux/drivers/net/ariadne.c linux/drivers/net/ariadne.c
@@ -545,6 +545,7 @@
     struct ariadne_private *priv = (struct ariadne_private *)dev->priv;
     struct AriadneBoard *board = priv->board;
     int entry;
+    unsigned long flags;
 
     /* Transmitter timeout, serious problems. */
     if (dev->tbusy) {
@@ -625,6 +626,9 @@
     printk(" data 0x%08x len %d\n", (int)skb->data, (int)skb->len);
 #endif
 
+    save_flags(flags);
+    cli();
+
     entry = priv->cur_tx % TX_RING_SIZE;
 
     /* Caution: the write order is important here, set the base address with
@@ -675,13 +679,12 @@
 
     dev->trans_start = jiffies;
 
-    cli();
     priv->lock = 0;
     if (lowb(priv->tx_ring[(entry+1) % TX_RING_SIZE]->TMD1) == 0)
 	dev->tbusy = 0;
     else
 	priv->tx_full = 1;
-    sti();
+    restore_flags(flags);
 
     return(0);
 }
@@ -780,13 +783,15 @@
     struct ariadne_private *priv = (struct ariadne_private *)dev->priv;
     struct AriadneBoard *board = priv->board;
     short saved_addr;
+    unsigned long flags;
 
+    save_flags(flags);
     cli();
     saved_addr = board->Lance.RAP;
     board->Lance.RAP = CSR112;	/* Missed Frame Count */
     priv->stats.rx_missed_errors = swapw(board->Lance.RDP);
     board->Lance.RAP = saved_addr;
-    sti();
+    restore_flags(flags);
 
     return(&priv->stats);
 }

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