summaryrefslogtreecommitdiff
path: root/sys/dev/cs
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2005-01-27 04:51:44 +0000
committerWarner Losh <imp@FreeBSD.org>2005-01-27 04:51:44 +0000
commit221db7416de5100ca57e847aac9a949dce35e28d (patch)
treefbafcf5be882bfacebecf9d49426a05b2a944467 /sys/dev/cs
parent118c73087b16ab33e972ab5e7c4584fe0f51b7db (diff)
Notes
Diffstat (limited to 'sys/dev/cs')
-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 a8f058068f53..01f4d7bfbaa4 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 c7b3eca51ef5..29c6d7a85095 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 0222841fcf08..2e2991a118e9 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;