diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2007-05-01 22:55:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-04 20:59:08 -0400 |
commit | f4d86754f956ab5ea73aa91759a0d89a2f0e3f2a (patch) | |
tree | 6afaeefe24fa98385a5f3de6557a31689456071a /drivers/net/jazzsonic.c | |
parent | d74472f0b2553e59eafb7feee0ff9558136a17e0 (diff) |
SONIC interrupt handling
Install the built-in macsonic interrupt handler on both IRQs when using
via_alt_mapping. Otherwise the rare interrupt that still comes from the
nubus slot will wedge the nubus.
$ cat /proc/interrupts
auto 2: 89176 via2
auto 3: 744367 sonic
auto 4: 0 scc
auto 6: 318363 via1
auto 7: 0 NMI
mac 9: 119413 framebuffer vbl
mac 10: 1971 ADB
mac 14: 198517 timer
mac 17: 89104 nubus
mac 19: 72 Mac ESP SCSI
mac 56: 629 sonic
mac 62: 1142593 ide0
Version 1 of this patch had a bug where a nubus sonic card would register
two interrupt handlers. Only a built-in sonic needs both.
Versions 2 and 3 needed some cleanups, as Raylynn Knight and Christoph
Hellwig pointed out (thanks).
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/jazzsonic.c')
-rw-r--r-- | drivers/net/jazzsonic.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c index 1a73630fd7d5..75f6f441e876 100644 --- a/drivers/net/jazzsonic.c +++ b/drivers/net/jazzsonic.c | |||
@@ -88,6 +88,23 @@ static unsigned short known_revisions[] = | |||
88 | 0xffff /* end of list */ | 88 | 0xffff /* end of list */ |
89 | }; | 89 | }; |
90 | 90 | ||
91 | static int jazzsonic_open(struct net_device* dev) | ||
92 | { | ||
93 | if (request_irq(dev->irq, &sonic_interrupt, IRQF_DISABLED, "sonic", dev)) { | ||
94 | printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq); | ||
95 | return -EAGAIN; | ||
96 | } | ||
97 | return sonic_open(dev); | ||
98 | } | ||
99 | |||
100 | static int jazzsonic_close(struct net_device* dev) | ||
101 | { | ||
102 | int err; | ||
103 | err = sonic_close(dev); | ||
104 | free_irq(dev->irq, dev); | ||
105 | return err; | ||
106 | } | ||
107 | |||
91 | static int __init sonic_probe1(struct net_device *dev) | 108 | static int __init sonic_probe1(struct net_device *dev) |
92 | { | 109 | { |
93 | static unsigned version_printed; | 110 | static unsigned version_printed; |
@@ -169,8 +186,8 @@ static int __init sonic_probe1(struct net_device *dev) | |||
169 | lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS | 186 | lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS |
170 | * SONIC_BUS_SCALE(lp->dma_bitmode)); | 187 | * SONIC_BUS_SCALE(lp->dma_bitmode)); |
171 | 188 | ||
172 | dev->open = sonic_open; | 189 | dev->open = jazzsonic_open; |
173 | dev->stop = sonic_close; | 190 | dev->stop = jazzsonic_close; |
174 | dev->hard_start_xmit = sonic_send_packet; | 191 | dev->hard_start_xmit = sonic_send_packet; |
175 | dev->get_stats = sonic_get_stats; | 192 | dev->get_stats = sonic_get_stats; |
176 | dev->set_multicast_list = &sonic_multicast_list; | 193 | dev->set_multicast_list = &sonic_multicast_list; |
@@ -260,8 +277,6 @@ MODULE_DESCRIPTION("Jazz SONIC ethernet driver"); | |||
260 | module_param(sonic_debug, int, 0); | 277 | module_param(sonic_debug, int, 0); |
261 | MODULE_PARM_DESC(sonic_debug, "jazzsonic debug level (1-4)"); | 278 | MODULE_PARM_DESC(sonic_debug, "jazzsonic debug level (1-4)"); |
262 | 279 | ||
263 | #define SONIC_IRQ_FLAG IRQF_DISABLED | ||
264 | |||
265 | #include "sonic.c" | 280 | #include "sonic.c" |
266 | 281 | ||
267 | static int __devexit jazz_sonic_device_remove (struct platform_device *pdev) | 282 | static int __devexit jazz_sonic_device_remove (struct platform_device *pdev) |