diff options
Diffstat (limited to 'sys/dev/ed/if_ed.c')
| -rw-r--r-- | sys/dev/ed/if_ed.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 132975377a11..10385f4b2708 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -1779,6 +1779,26 @@ ed_attach(dev) } /* + * Detach the driver from the hardware and other systems in the kernel. + */ +int +ed_detach(device_t dev) +{ + struct ed_softc *sc = device_get_softc(dev); + struct ifnet *ifp = &sc->arpcom.ac_if; + + if (sc->gone) + return (0); + ed_stop(sc); + ifp->if_flags &= ~IFF_RUNNING; + ether_ifdetach(ifp); + sc->gone = 1; + bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); + ed_release_resources(dev); + return (0); +} + +/* * Reset interface. */ static void |
