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.
This commit is contained in:
Bill Paul 2003-12-23 18:41:34 +00:00
parent ffc0badf60
commit 9baaa1f6ed
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=123779

View file

@ -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;