summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/cs/if_cs.c16
-rw-r--r--sys/dev/cs/if_cs_pccard.c2
-rw-r--r--sys/dev/cs/if_csvar.h1
3 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c
index a8f0580..01f4d7b 100644
--- a/sys/dev/cs/if_cs.c
+++ b/sys/dev/cs/if_cs.c
@@ -689,6 +689,22 @@ cs_attach(device_t dev)
return (0);
}
+int
+cs_detach(device_t dev)
+{
+ struct cs_softc *sc;
+ struct ifnet *ifp;
+
+ sc = device_get_softc(dev);
+ ifp = &sc->arpcom.ac_if;
+
+ cs_stop(sc);
+ ifp->if_flags &= ~IFF_RUNNING;
+ ether_ifdetach(ifp);
+ cs_release_resources(dev);
+ return (0);
+}
+
/*
* Initialize the board
*/
diff --git a/sys/dev/cs/if_cs_pccard.c b/sys/dev/cs/if_cs_pccard.c
index c7b3eca5..29c6d7a 100644
--- a/sys/dev/cs/if_cs_pccard.c
+++ b/sys/dev/cs/if_cs_pccard.c
@@ -114,9 +114,7 @@ static device_method_t cs_pccard_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, pccard_compat_probe),
DEVMETHOD(device_attach, pccard_compat_attach),
-#ifdef CS_HAS_DETACH
DEVMETHOD(device_detach, cs_detach),
-#endif
/* Card interface */
DEVMETHOD(card_compat_match, cs_pccard_match),
diff --git a/sys/dev/cs/if_csvar.h b/sys/dev/cs/if_csvar.h
index 0222841..2e2991a 100644
--- a/sys/dev/cs/if_csvar.h
+++ b/sys/dev/cs/if_csvar.h
@@ -72,6 +72,7 @@ int cs_alloc_memory(device_t dev, int rid, int size);
int cs_alloc_irq(device_t dev, int rid, int flags);
int cs_attach(device_t dev);
int cs_cs89x0_probe(device_t dev);
+int cs_detach(device_t dev);
void cs_release_resources(device_t dev);
driver_intr_t csintr;
OpenPOWER on IntegriCloud