aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sonic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sonic.c')
-rw-r--r--drivers/net/sonic.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/drivers/net/sonic.c b/drivers/net/sonic.c
index c6320c719931..8069f3e32d83 100644
--- a/drivers/net/sonic.c
+++ b/drivers/net/sonic.c
@@ -50,29 +50,6 @@ static int sonic_open(struct net_device *dev)
50 if (sonic_debug > 2) 50 if (sonic_debug > 2)
51 printk("sonic_open: initializing sonic driver.\n"); 51 printk("sonic_open: initializing sonic driver.\n");
52 52
53 /*
54 * We don't need to deal with auto-irq stuff since we
55 * hardwire the sonic interrupt.
56 */
57/*
58 * XXX Horrible work around: We install sonic_interrupt as fast interrupt.
59 * This means that during execution of the handler interrupt are disabled
60 * covering another bug otherwise corrupting data. This doesn't mean
61 * this glue works ok under all situations.
62 *
63 * Note (dhd): this also appears to prevent lockups on the Macintrash
64 * when more than one Ethernet card is installed (knock on wood)
65 *
66 * Note (fthain): whether the above is still true is anyones guess. Certainly
67 * the buffer handling algorithms will not tolerate re-entrance without some
68 * mutual exclusion added. Anyway, the memcpy has now been eliminated from the
69 * rx code to make this a faster "fast interrupt".
70 */
71 if (request_irq(dev->irq, &sonic_interrupt, SONIC_IRQ_FLAG, "sonic", dev)) {
72 printk(KERN_ERR "\n%s: unable to get IRQ %d .\n", dev->name, dev->irq);
73 return -EAGAIN;
74 }
75
76 for (i = 0; i < SONIC_NUM_RRS; i++) { 53 for (i = 0; i < SONIC_NUM_RRS; i++) {
77 struct sk_buff *skb = dev_alloc_skb(SONIC_RBSIZE + 2); 54 struct sk_buff *skb = dev_alloc_skb(SONIC_RBSIZE + 2);
78 if (skb == NULL) { 55 if (skb == NULL) {
@@ -169,8 +146,6 @@ static int sonic_close(struct net_device *dev)
169 } 146 }
170 } 147 }
171 148
172 free_irq(dev->irq, dev); /* release the IRQ */
173
174 return 0; 149 return 0;
175} 150}
176 151
@@ -178,8 +153,13 @@ static void sonic_tx_timeout(struct net_device *dev)
178{ 153{
179 struct sonic_local *lp = netdev_priv(dev); 154 struct sonic_local *lp = netdev_priv(dev);
180 int i; 155 int i;
181 /* Stop the interrupts for this */ 156 /*
157 * put the Sonic into software-reset mode and
158 * disable all interrupts before releasing DMA buffers
159 */
182 SONIC_WRITE(SONIC_IMR, 0); 160 SONIC_WRITE(SONIC_IMR, 0);
161 SONIC_WRITE(SONIC_ISR, 0x7fff);
162 SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
183 /* We could resend the original skbs. Easier to re-initialise. */ 163 /* We could resend the original skbs. Easier to re-initialise. */
184 for (i = 0; i < SONIC_NUM_TDS; i++) { 164 for (i = 0; i < SONIC_NUM_TDS; i++) {
185 if(lp->tx_laddr[i]) { 165 if(lp->tx_laddr[i]) {