diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-09-15 22:28:53 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-09-15 22:28:53 +0000 |
commit | 1e7fc55183c5f5a90037cd6f1a8414255baa1935 (patch) | |
tree | 7c4ae5e983a8f56fa9ed9fc90fe77dccb7174e85 /sys/dev/ic/elink3.c | |
parent | 21e20a3eb794ad595cdf19801783558003423cb6 (diff) |
Support the ejection of mii ep(4) devices, i.e., the 3c574.
Diffstat (limited to 'sys/dev/ic/elink3.c')
-rw-r--r-- | sys/dev/ic/elink3.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index 4b750403021..7b5c8bc523b 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elink3.c,v 1.41 2000/07/06 00:59:01 todd Exp $ */ +/* $OpenBSD: elink3.c,v 1.42 2000/09/15 22:28:50 aaron Exp $ */ /* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */ /* @@ -446,6 +446,24 @@ epconfig(sc, chipset, enaddr) ep_reset_cmd(sc, EP_COMMAND, TX_RESET); } +int +ep_detach(self) + struct device *self; +{ + struct ep_softc *sc = (struct ep_softc *)self; + struct ifnet *ifp = &sc->sc_arpcom.ac_if; + + if (sc->ep_flags & EP_FLAGS_MII) + mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY); + + ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY); + + ether_ifdetach(ifp); + if_detach(ifp); + + return (0); +} + /* * Find supported media on 3c509-generation hardware that doesn't have * a "reset_options" register in window 3. |