diff options
author | mdodd <mdodd@FreeBSD.org> | 2003-03-29 15:34:26 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2003-03-29 15:34:26 +0000 |
commit | d9dea5bf86993ae431683f3e5fc9c7431c3f1146 (patch) | |
tree | ac242e11de87bfe07741aa6fd6aa07333d56d7bc /sys/dev/ex | |
parent | e0f533c6572d40deece662489fb2e7520b488619 (diff) | |
download | FreeBSD-src-d9dea5bf86993ae431683f3e5fc9c7431c3f1146.zip FreeBSD-src-d9dea5bf86993ae431683f3e5fc9c7431c3f1146.tar.gz |
- Move ex_pccard_detach() to if_ex.c and rename it to ex_detach().
- Add detach method to ISA front end.
Diffstat (limited to 'sys/dev/ex')
-rw-r--r-- | sys/dev/ex/if_ex.c | 19 | ||||
-rw-r--r-- | sys/dev/ex/if_ex_isa.c | 1 | ||||
-rw-r--r-- | sys/dev/ex/if_ex_pccard.c | 16 | ||||
-rw-r--r-- | sys/dev/ex/if_exvar.h | 1 |
4 files changed, 22 insertions, 15 deletions
diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c index 69f0c16..ac05a38 100644 --- a/sys/dev/ex/if_ex.c +++ b/sys/dev/ex/if_ex.c @@ -275,6 +275,25 @@ ex_attach(device_t dev) return(0); } +int +ex_detach (device_t dev) +{ + struct ex_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + ifp = &sc->arpcom.ac_if; + + ex_stop(sc); + + ifp->if_flags &= ~IFF_RUNNING; + ether_ifdetach(ifp); + + ex_release_resources(dev); + + return (0); +} + static void ex_init(void *xsc) { diff --git a/sys/dev/ex/if_ex_isa.c b/sys/dev/ex/if_ex_isa.c index 8860795..13d9d9b 100644 --- a/sys/dev/ex/if_ex_isa.c +++ b/sys/dev/ex/if_ex_isa.c @@ -65,6 +65,7 @@ static device_method_t ex_methods[] = { DEVMETHOD(device_identify, ex_isa_identify), DEVMETHOD(device_probe, ex_isa_probe), DEVMETHOD(device_attach, ex_isa_attach), + DEVMETHOD(device_detach, ex_detach), { 0, 0 } }; diff --git a/sys/dev/ex/if_ex_pccard.c b/sys/dev/ex/if_ex_pccard.c index 3f88fed..7087cf5 100644 --- a/sys/dev/ex/if_ex_pccard.c +++ b/sys/dev/ex/if_ex_pccard.c @@ -51,13 +51,12 @@ /* Bus Front End Functions */ static int ex_pccard_probe (device_t); static int ex_pccard_attach (device_t); -static int ex_pccard_detach (device_t); static device_method_t ex_pccard_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ex_pccard_probe), DEVMETHOD(device_attach, ex_pccard_attach), - DEVMETHOD(device_detach, ex_pccard_detach), + DEVMETHOD(device_detach, ex_detach), { 0, 0 } }; @@ -147,16 +146,3 @@ bad: ex_release_resources(dev); return (error); } - -static int -ex_pccard_detach(device_t dev) -{ - struct ex_softc *sc = device_get_softc(dev); - struct ifnet *ifp = &sc->arpcom.ac_if; - - ex_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; - if_detach(ifp); - ex_release_resources(dev); - return (0); -} diff --git a/sys/dev/ex/if_exvar.h b/sys/dev/ex/if_exvar.h index 840305d..6539b85 100644 --- a/sys/dev/ex/if_exvar.h +++ b/sys/dev/ex/if_exvar.h @@ -75,6 +75,7 @@ extern u_char plus_ee2irqmap[]; int ex_alloc_resources (device_t); void ex_release_resources (device_t); int ex_attach (device_t); +int ex_detach (device_t); driver_intr_t ex_intr; |