diff options
-rw-r--r-- | sys/dev/cardbus/if_rl_cardbus.c | 31 | ||||
-rw-r--r-- | sys/dev/ic/rtl81x9.c | 29 | ||||
-rw-r--r-- | sys/dev/ic/rtl81x9reg.h | 3 |
3 files changed, 32 insertions, 31 deletions
diff --git a/sys/dev/cardbus/if_rl_cardbus.c b/sys/dev/cardbus/if_rl_cardbus.c index 013ab6c29bd..505106fee15 100644 --- a/sys/dev/cardbus/if_rl_cardbus.c +++ b/sys/dev/cardbus/if_rl_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rl_cardbus.c,v 1.15 2006/10/16 12:30:08 tom Exp $ */ +/* $OpenBSD: if_rl_cardbus.c,v 1.16 2007/05/08 18:49:32 deraadt Exp $ */ /* $NetBSD: if_rl_cardbus.c,v 1.3.8.3 2001/11/14 19:14:02 nathanw Exp $ */ /* @@ -212,6 +212,35 @@ rl_cardbus_attach(parent, self, aux) rl_attach(sc); } +extern int rl_detach(struct rl_softc *); + +int +rl_detach(sc) + struct rl_softc *sc; +{ + struct ifnet *ifp = &sc->sc_arpcom.ac_if; + + /* Unhook our tick handler. */ + timeout_del(&sc->sc_tick_tmo); + + /* Detach any PHYs we might have. */ + if (LIST_FIRST(&sc->sc_mii.mii_phys) != NULL) + mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY); + + /* Delete any remaining media. */ + ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY); + + ether_ifdetach(ifp); + if_detach(ifp); + + if (sc->sc_sdhook != NULL) + shutdownhook_disestablish(sc->sc_sdhook); + if (sc->sc_pwrhook != NULL) + powerhook_disestablish(sc->sc_pwrhook); + + return (0); +} + int rl_cardbus_detach(self, flags) struct device *self; diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index dee5f98c208..e283e876347 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9.c,v 1.55 2007/02/02 04:21:40 jason Exp $ */ +/* $OpenBSD: rtl81x9.c,v 1.56 2007/05/08 18:49:32 deraadt Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1345,33 +1345,6 @@ rl_attach(sc) return (0); } -int -rl_detach(sc) - struct rl_softc *sc; -{ - struct ifnet *ifp = &sc->sc_arpcom.ac_if; - - /* Unhook our tick handler. */ - timeout_del(&sc->sc_tick_tmo); - - /* Detach any PHYs we might have. */ - if (LIST_FIRST(&sc->sc_mii.mii_phys) != NULL) - mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY); - - /* Delete any remaining media. */ - ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY); - - ether_ifdetach(ifp); - if_detach(ifp); - - if (sc->sc_sdhook != NULL) - shutdownhook_disestablish(sc->sc_sdhook); - if (sc->sc_pwrhook != NULL) - powerhook_disestablish(sc->sc_pwrhook); - - return (0); -} - void rl_shutdown(arg) void *arg; diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h index b01be4b1d1b..fb308ac9d9e 100644 --- a/sys/dev/ic/rtl81x9reg.h +++ b/sys/dev/ic/rtl81x9reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9reg.h,v 1.36 2006/12/12 10:24:38 reyk Exp $ */ +/* $OpenBSD: rtl81x9reg.h,v 1.37 2007/05/08 18:49:32 deraadt Exp $ */ /* * Copyright (c) 1997, 1998 @@ -896,6 +896,5 @@ struct rl_softc { #define RL_PME_STATUS 0x8000 extern int rl_attach(struct rl_softc *); -extern int rl_detach(struct rl_softc *); extern int rl_intr(void *); extern void rl_setmulti(struct rl_softc *); |