summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2009-06-20 09:40:30 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2009-06-20 09:40:30 +0000
commitea4d72c4d4e6144c5e7ac2d3dbe98ede80a42ee2 (patch)
tree4d540a93e19e5bdcff052eb218bc39bca273e391 /sys/arch
parent149375182984341c60c30e43791dc198497fc916 (diff)
Have hmestop() properly clear the RUNNING/OACTIVE flags and the interface
watchdog timer. Copied over from MI hme(4). Tested by nick@. From Brad.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/dev/hme.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/arch/sparc/dev/hme.c b/sys/arch/sparc/dev/hme.c
index d67279ce6ef..75985ff9724 100644
--- a/sys/arch/sparc/dev/hme.c
+++ b/sys/arch/sparc/dev/hme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hme.c,v 1.58 2008/11/28 02:44:17 brad Exp $ */
+/* $OpenBSD: hme.c,v 1.59 2009/06/20 09:40:29 sthen Exp $ */
/*
* Copyright (c) 1998 Jason L. Wright (jason@thought.net)
@@ -331,8 +331,15 @@ void
hmestop(sc)
struct hme_softc *sc;
{
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
int tries = 0;
+ /*
+ * Mark the interface down and cancel the watchdog timer.
+ */
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+ ifp->if_timer = 0;
+
sc->sc_gr->reset = GR_RESET_ALL;
while (sc->sc_gr->reset && (++tries != MAX_STOP_TRIES))
DELAY(20);
@@ -414,7 +421,6 @@ hmeioctl(ifp, cmd, data)
* stop it.
*/
hmestop(sc);
- ifp->if_flags &= ~IFF_RUNNING;
} else if ((ifp->if_flags & IFF_UP) != 0 &&
(ifp->if_flags & IFF_RUNNING) == 0) {
/*
@@ -600,7 +606,6 @@ hmeinit(sc)
ifp->if_flags |= IFF_RUNNING;
ifp->if_flags &= ~IFF_OACTIVE;
sc->sc_if_flags = ifp->if_flags;
- ifp->if_timer = 0;
}
void