diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2005-07-02 23:10:17 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2005-07-02 23:10:17 +0000 |
commit | a12d5644f5c5a2fa21bd66dfc2c3c4f3ac228ad0 (patch) | |
tree | 594442f34d6f7a62ff5af6cdbada393a1d81a464 /sys/dev/ic | |
parent | 5ebc09d84d30a9d39b6610095d69063ffbda69f0 (diff) |
clear IFF_RUNNING & IFF_OACTIVE in foo_stop() before de-allocating resources.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/atw.c | 14 | ||||
-rw-r--r-- | sys/dev/ic/gem.c | 15 | ||||
-rw-r--r-- | sys/dev/ic/smc83c170.c | 14 | ||||
-rw-r--r-- | sys/dev/ic/xl.c | 6 |
4 files changed, 25 insertions, 24 deletions
diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index cbdc3c71fb0..f5a0b637ac1 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atw.c,v 1.32 2005/06/21 05:36:43 kevlo Exp $ */ +/* $OpenBSD: atw.c,v 1.33 2005/07/02 23:10:16 brad Exp $ */ /* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */ /*- @@ -2697,6 +2697,12 @@ atw_stop(struct ifnet *ifp, int disable) ieee80211_new_state(ic, IEEE80211_S_INIT, -1); + /* + * Mark the interface down and cancel the watchdog timer. + */ + ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_timer = 0; + /* Disable interrupts. */ ATW_WRITE(sc, ATW_IER, 0); @@ -2715,12 +2721,6 @@ atw_stop(struct ifnet *ifp, int disable) atw_disable(sc); } - /* - * Mark the interface down and cancel the watchdog timer. - */ - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); - ifp->if_timer = 0; - if (!disable) atw_reset(sc); } diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index 5cfc9ff1806..45968b34c01 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gem.c,v 1.41 2005/06/08 17:02:59 henning Exp $ */ +/* $OpenBSD: gem.c,v 1.42 2005/07/02 23:10:16 brad Exp $ */ /* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */ /* @@ -454,6 +454,13 @@ gem_stop(struct ifnet *ifp, int disable) DPRINTF(sc, ("%s: gem_stop\n", sc->sc_dev.dv_xname)); timeout_del(&sc->sc_tick_ch); + + /* + * Mark the interface down and cancel the watchdog timer. + */ + ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_timer = 0; + mii_down(&sc->sc_mii); gem_reset_rx(sc); @@ -477,12 +484,6 @@ gem_stop(struct ifnet *ifp, int disable) if (disable) { gem_rxdrain(sc); } - - /* - * Mark the interface down and cancel the watchdog timer. - */ - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); - ifp->if_timer = 0; } diff --git a/sys/dev/ic/smc83c170.c b/sys/dev/ic/smc83c170.c index f9182879174..04bc3aa5124 100644 --- a/sys/dev/ic/smc83c170.c +++ b/sys/dev/ic/smc83c170.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smc83c170.c,v 1.4 2005/06/28 03:07:37 brad Exp $ */ +/* $OpenBSD: smc83c170.c,v 1.5 2005/07/02 23:10:16 brad Exp $ */ /* $NetBSD: smc83c170.c,v 1.59 2005/02/27 00:27:02 perry Exp $ */ /*- @@ -1153,6 +1153,12 @@ epic_stop(struct ifnet *ifp, int disable) */ timeout_del(&sc->sc_mii_timeout); + /* + * Mark the interface down and cancel the watchdog timer. + */ + ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_timer = 0; + /* Down the MII. */ mii_down(&sc->sc_mii); @@ -1186,12 +1192,6 @@ epic_stop(struct ifnet *ifp, int disable) if (disable) epic_rxdrain(sc); - - /* - * Mark the interface down and cancel the watchdog timer. - */ - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); - ifp->if_timer = 0; } /* diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c index 38fde3ecbde..aafa07fd4f6 100644 --- a/sys/dev/ic/xl.c +++ b/sys/dev/ic/xl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xl.c,v 1.64 2005/04/25 17:55:51 brad Exp $ */ +/* $OpenBSD: xl.c,v 1.65 2005/07/02 23:10:16 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -2606,10 +2606,10 @@ xl_stop(sc) /* Stop the stats updater. */ timeout_del(&sc->xl_stsup_tmo); - xl_freetxrx(sc); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + xl_freetxrx(sc); + return; } |