[PATCH 7/10] net: remove cli()/sti() from drivers/net/oaknet.c

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

 



Signed-off-by: James Nelson <james4765@xxxxxxxxx>

diff -urN --exclude='*~' linux-2.6.10-mm2-original/drivers/net/oaknet.c linux-2.6.10-mm2/drivers/net/oaknet.c
--- linux-2.6.10-mm2-original/drivers/net/oaknet.c	2005-01-08 12:16:35.000000000 -0500
+++ linux-2.6.10-mm2/drivers/net/oaknet.c	2005-01-11 18:27:16.891867541 -0500
@@ -44,7 +44,6 @@
 
 /* Experimenting with some fixes for a broken driver... */
 
-#define	OAKNET_DISINT
 #define	OAKNET_HEADCHECK
 #define	OAKNET_RWFIX
 
@@ -55,6 +54,8 @@
 
 static struct net_device *oaknet_devs;
 
+static spinlock_t oaknet_lock = SPIN_LOCK_UNLOCKED;
+
 
 /* Function Prototypes */
 
@@ -380,10 +381,7 @@
 		return;
 	}
 
-#ifdef OAKNET_DISINT
-	save_flags(flags);
-	cli();
-#endif
+	spin_lock_irqsave(&oaknet_lock, flags);
 
 	ei_status.dmaing |= 0x01;
 	ei_obp(E8390_NODMA + E8390_PAGE0 + E8390_START, base + E8390_CMD);
@@ -432,9 +430,7 @@
 	ei_obp(ENISR_RDC, base + EN0_ISR);	/* ACK Remote DMA interrupt */
 	ei_status.dmaing &= ~0x01;
 
-#ifdef OAKNET_DISINT
-	restore_flags(flags);
-#endif
+	spin_unlock_irqrestore(&oaknet_lock, flags);
 }
 
 /*
@@ -465,9 +461,7 @@
 	int bug;
 #endif
 	unsigned long start;
-#ifdef OAKNET_DISINT
 	unsigned long flags;
-#endif
 #ifdef OAKNET_HEADCHECK
 	int retries = 0;
 #endif
@@ -487,10 +481,7 @@
 		return;
 	}
 
-#ifdef OAKNET_DISINT
-	save_flags(flags);
-	cli();
-#endif
+	spin_lock_irqsave(&oaknet_lock, flags);
 
 	ei_status.dmaing |= 0x01;
 
@@ -572,9 +563,7 @@
 		ei_osb(E8390_BASE + E8390_DATA, buf, count);
 	}
 
-#ifdef OAKNET_DISINT
-	restore_flags(flags);
-#endif
+	spin_unlock_irqrestore(&oaknet_lock, flags);
 
 	start = jiffies;
 
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
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