mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-25 18:06:19 +08:00
if_dwc: Move interrupt handler install
This commit is contained in:
parent
46f0b8bd51
commit
e392c98990
@ -1227,14 +1227,6 @@ dwc_attach(device_t dev)
|
|||||||
|
|
||||||
callout_init_mtx(&sc->dwc_callout, &sc->mtx, 0);
|
callout_init_mtx(&sc->dwc_callout, &sc->mtx, 0);
|
||||||
|
|
||||||
/* Setup interrupt handler. */
|
|
||||||
error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_NET | INTR_MPSAFE,
|
|
||||||
NULL, dwc_intr, sc, &sc->intr_cookie);
|
|
||||||
if (error != 0) {
|
|
||||||
device_printf(dev, "could not setup interrupt handler.\n");
|
|
||||||
return (ENXIO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set up the ethernet interface. */
|
/* Set up the ethernet interface. */
|
||||||
sc->ifp = ifp = if_alloc(IFT_ETHER);
|
sc->ifp = ifp = if_alloc(IFT_ETHER);
|
||||||
|
|
||||||
@ -1261,6 +1253,14 @@ dwc_attach(device_t dev)
|
|||||||
}
|
}
|
||||||
sc->mii_softc = device_get_softc(sc->miibus);
|
sc->mii_softc = device_get_softc(sc->miibus);
|
||||||
|
|
||||||
|
/* Setup interrupt handler. */
|
||||||
|
error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_NET | INTR_MPSAFE,
|
||||||
|
NULL, dwc_intr, sc, &sc->intr_cookie);
|
||||||
|
if (error != 0) {
|
||||||
|
device_printf(dev, "could not setup interrupt handler.\n");
|
||||||
|
return (ENXIO);
|
||||||
|
}
|
||||||
|
|
||||||
/* All ready to run, attach the ethernet interface. */
|
/* All ready to run, attach the ethernet interface. */
|
||||||
ether_ifattach(ifp, macaddr);
|
ether_ifattach(ifp, macaddr);
|
||||||
sc->is_attached = true;
|
sc->is_attached = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user