[PATCH-2.5.75] sk_mca

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quite similar to the previous patch.

Regards,
Angelo 


diff -Naurp linux-2.5.75/drivers/net/sk_mca.c linux-2.5.75-3C/drivers/net/sk_mca.c
--- linux-2.5.75/drivers/net/sk_mca.c	2003-06-17 06:20:06.000000000 +0200
+++ linux-2.5.75-3C/drivers/net/sk_mca.c	2003-07-15 17:31:41.000000000 +0200
@@ -254,8 +254,7 @@ static void SetLANCE(struct SKMCA_NETDEV
 
 	/* disable interrupts */
 
-	save_flags(flags);
-	cli();
+	spin_lock_irqsave(&priv->lock, flags);
 
 	/* wait until no transfer is pending */
 
@@ -281,7 +280,7 @@ static void SetLANCE(struct SKMCA_NETDEV
 
 	/* reenable interrupts */
 
-	restore_flags(flags);
+	spin_lock_irqrestore(&priv->lock, flags);
 }
 
 /* get LANCE register */
@@ -294,8 +293,7 @@ static u16 GetLANCE(struct SKMCA_NETDEV 
 
 	/* disable interrupts */
 
-	save_flags(flags);
-	cli();
+	spin_lock_irqsave(&priv->lock, flags);
 
 	/* wait until no transfer is pending */
 
@@ -321,7 +319,7 @@ static u16 GetLANCE(struct SKMCA_NETDEV 
 
 	/* reenable interrupts */
 
-	restore_flags(flags);
+	spin_lock_irqrestore(&priv->lock, flags);
 
 	return res;
 }
@@ -968,8 +966,9 @@ static int skmca_tx(struct sk_buff *skb,
 #endif
 
 	/* one more descriptor busy */
-	save_flags(flags);
-	cli();
+
+	spin_lock_irqsave(&priv->lock, flags);
+
 	priv->nexttxput++;
 	if (priv->nexttxput >= TXCOUNT)
 		priv->nexttxput = 0;
@@ -994,7 +993,7 @@ static int skmca_tx(struct sk_buff *skb,
 	if (priv->txbusy == 0)
 		SetLANCE(dev, LANCE_CSR0, CSR0_INEA | CSR0_TDMD);
 
-	restore_flags(flags);
+	spin_lock_irqrestore(&priv->lock, flags);
 
       tx_done:
 
diff -Naurp linux-2.5.75/drivers/net/sk_mca.h linux-2.5.75-3C/drivers/net/sk_mca.h
--- linux-2.5.75/drivers/net/sk_mca.h	2003-06-17 06:20:02.000000000 +0200
+++ linux-2.5.75-3C/drivers/net/sk_mca.h	2003-07-15 17:10:44.000000000 +0200
@@ -53,6 +53,7 @@ typedef struct {
 	int realirq;		/* memorizes actual IRQ, even when 
 				   currently not allocated          */
 	skmca_medium medium;	/* physical cannector               */
+	spinlock_t lock;
 } skmca_priv;
 
 /* card registers: control/status register bits */


-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux