summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2014-11-24 03:47:56 +0000
committerBrad Smith <brad@cvs.openbsd.org>2014-11-24 03:47:56 +0000
commit607c7275a7895bada3763a9ac63a627a399273fa (patch)
tree0f27a40ad7e9ed1b6b88f5e842ac6d367dc6f056 /sys
parent9c9f4e2f0c8fd6e8493b5095bf55b498908d5973 (diff)
- Check IFF_RUNNING in xl_intr().
From FreeBSD - Clear IFF_RUNNING at the top of xl_stop() before freeing resources. Tested with 3c905C.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/xl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c
index ee125e24f82..6eee41d13e9 100644
--- a/sys/dev/ic/xl.c
+++ b/sys/dev/ic/xl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xl.c,v 1.116 2014/09/14 14:17:25 jsg Exp $ */
+/* $OpenBSD: xl.c,v 1.117 2014/11/24 03:47:55 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1488,6 +1488,9 @@ xl_intr(void *arg)
if (sc->intr_ack)
(*sc->intr_ack)(sc);
+ if (!(ifp->if_flags & IFF_RUNNING))
+ return (claimed);
+
if (status & XL_STAT_UP_COMPLETE)
xl_rxeof(sc);
@@ -2339,6 +2342,8 @@ xl_stop(struct xl_softc *sc)
timeout_del(&sc->xl_stsup_tmo);
ifp = &sc->sc_arpcom.ac_if;
+
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
ifp->if_timer = 0;
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_DISABLE);
@@ -2364,8 +2369,6 @@ xl_stop(struct xl_softc *sc)
if (sc->intr_ack)
(*sc->intr_ack)(sc);
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
xl_freetxrx(sc);
}