diff options
author | mdodd <mdodd@FreeBSD.org> | 2003-03-29 22:27:41 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2003-03-29 22:27:41 +0000 |
commit | 446c24ca7a6af68dfed415abc309c05b74ba2e28 (patch) | |
tree | be62e62d30921bff99da6055e80e0cf3a53f379b /sys/dev/ep/if_ep.c | |
parent | cdc67e7072fb97bd41f4db2549ff13b3366ae34d (diff) | |
download | FreeBSD-src-446c24ca7a6af68dfed415abc309c05b74ba2e28.zip FreeBSD-src-446c24ca7a6af68dfed415abc309c05b74ba2e28.tar.gz |
- Free interrupt handler in ep_free().
- Move ep_pccard_detach() to if_ep.c and rename to ep_detach()
- Specify detach methods for all bus frontends.
Diffstat (limited to 'sys/dev/ep/if_ep.c')
-rw-r--r-- | sys/dev/ep/if_ep.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c index 7d49e76..fd3d90a 100644 --- a/sys/dev/ep/if_ep.c +++ b/sys/dev/ep/if_ep.c @@ -263,6 +263,8 @@ ep_free(device_t dev) { struct ep_softc * sc = device_get_softc(dev); + if (sc->ep_intrhand) + bus_teardown_intr(dev, sc->irq, sc->ep_intrhand); if (sc->iobase) bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->iobase); if (sc->irq) @@ -351,6 +353,31 @@ ep_attach(sc) return 0; } +int +ep_detach(device_t dev) +{ + struct ep_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + ifp = &sc->arpcom.ac_if; + + if (sc->gone) { + device_printf(dev, "already unloaded\n"); + return (0); + } + + epstop(sc); + + ifp->if_flags &= ~IFF_RUNNING; + ether_ifdetach(ifp); + + sc->gone = 1; + ep_free(dev); + + return (0); +} + /* * The order in here seems important. Otherwise we may not receive * interrupts. ?! |