diff options
author | wpaul <wpaul@FreeBSD.org> | 2003-12-23 18:41:34 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2003-12-23 18:41:34 +0000 |
commit | 3e98c4443b33536c19843b4ce002c74bcc87a066 (patch) | |
tree | 0b702cb625cc5398ab0672d9a5b1f95206644e35 | |
parent | 3e7838be9a3cdcf45990570c54da74b3ef004fc3 (diff) | |
download | FreeBSD-src-3e98c4443b33536c19843b4ce002c74bcc87a066.zip FreeBSD-src-3e98c4443b33536c19843b4ce002c74bcc87a066.tar.gz |
Set up the interrupt earlier in ndis_attach(), because calling the
driver's initfunc may cause an interrupt to be generated. This avoids
the occasional 'stray irqXXX' messages on load.
-rw-r--r-- | sys/dev/if_ndis/if_ndis.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index 1634160..cc1ee9c 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -288,6 +288,19 @@ ndis_attach(dev) sc->ndis_rescnt++; + /* + * Hook interrupt early, since calling the driver's + * init routine may trigger an interrupt. + */ + error = bus_setup_intr(dev, sc->ndis_irq, INTR_TYPE_NET, + ndis_intr, sc, &sc->ndis_intrhand); + + if (error) { + printf("ndis%d: couldn't register interrupt\n", unit); + error = ENXIO; + goto fail; + } + /* * Allocate the parent bus DMA tag appropriate for PCI. */ @@ -545,10 +558,6 @@ ndis_attach(dev) ifmedia_set(&sc->ifmedia, IFM_ETHER|IFM_AUTO); } - /* Hook interrupt last to avoid having to lock softc */ - error = bus_setup_intr(dev, sc->ndis_irq, INTR_TYPE_NET, - ndis_intr, sc, &sc->ndis_intrhand); - /* Override the status handler so we can detect link changes. */ sc->ndis_block.nmb_status_func = ndis_linksts; |