- Move ex_pccard_detach() to if_ex.c and rename it to ex_detach().

- Add detach method to ISA front end.
This commit is contained in:
Matthew N. Dodd 2003-03-29 15:34:26 +00:00
parent ece0c30b62
commit c0a71ab74a
4 changed files with 22 additions and 15 deletions

View File

@ -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)
{

View File

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

View File

@ -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 @@ ex_pccard_attach(device_t dev)
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);
}

View File

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