From: brad Date: Sat, 12 Jul 2014 20:07:34 +0000 (+0000) Subject: Mark the interface down and cancel the watchdog timer in imxenet_stop(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=670c6429ad8f714250b535e99f316b979fe3f9ba;p=openbsd Mark the interface down and cancel the watchdog timer in imxenet_stop(). ok matthieu@ rapha@ --- diff --git a/sys/arch/armv7/imx/imxenet.c b/sys/arch/armv7/imx/imxenet.c index 098e79b45fc..fbf3f2b631d 100644 --- a/sys/arch/armv7/imx/imxenet.c +++ b/sys/arch/armv7/imx/imxenet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imxenet.c,v 1.5 2014/07/02 17:01:07 brad Exp $ */ +/* $OpenBSD: imxenet.c,v 1.6 2014/07/12 20:07:34 brad Exp $ */ /* * Copyright (c) 2012-2013 Patrick Wildt * @@ -547,6 +547,14 @@ imxenet_init(struct imxenet_softc *sc) void imxenet_stop(struct imxenet_softc *sc) { + struct ifnet *ifp = &sc->sc_ac.ac_if; + + /* + * Mark the interface down and cancel the watchdog timer. + */ + ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_timer = 0; + /* reset the controller */ HSET4(sc, ENET_ECR, ENET_ECR_RESET); while(HREAD4(sc, ENET_ECR) & ENET_ECR_RESET);