summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_txp.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-05-31 02:08:15 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-05-31 02:08:15 +0000
commitdf656cd267a9e8b69a867b70a8ea5beb819300a2 (patch)
treef73f733c9e2d48d23ee25369675105beb0346325 /sys/dev/pci/if_txp.c
parent1934e0b036c4587f2c9e5badc1103bc8c70a331a (diff)
Clear the IFF_RUNNING/IFF_OACTIVE flags and the watchdog timer in
txp_stop(). ok dlg@
Diffstat (limited to 'sys/dev/pci/if_txp.c')
-rw-r--r--sys/dev/pci/if_txp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c
index 37d04b09e7c..7c35b04aaf0 100644
--- a/sys/dev/pci/if_txp.c
+++ b/sys/dev/pci/if_txp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_txp.c,v 1.90 2008/05/22 21:03:41 brad Exp $ */
+/* $OpenBSD: if_txp.c,v 1.91 2008/05/31 02:08:14 brad Exp $ */
/*
* Copyright (c) 2001
@@ -1294,7 +1294,6 @@ txp_init(struct txp_softc *sc)
ifp->if_flags |= IFF_RUNNING;
ifp->if_flags &= ~IFF_OACTIVE;
- ifp->if_timer = 0;
if (!timeout_pending(&sc->sc_tick))
timeout_add(&sc->sc_tick, hz);
@@ -1726,10 +1725,16 @@ txp_cmd_desc_numfree(struct txp_softc *sc)
void
txp_stop(struct txp_softc *sc)
{
- txp_command(sc, TXP_CMD_TX_DISABLE, 0, 0, 0, NULL, NULL, NULL, 1);
- txp_command(sc, TXP_CMD_RX_DISABLE, 0, 0, 0, NULL, NULL, NULL, 1);
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
timeout_del(&sc->sc_tick);
+
+ /* Mark the interface as down and cancel the watchdog timer. */
+ ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+ ifp->if_timer = 0;
+
+ txp_command(sc, TXP_CMD_TX_DISABLE, 0, 0, 0, NULL, NULL, NULL, 1);
+ txp_command(sc, TXP_CMD_RX_DISABLE, 0, 0, 0, NULL, NULL, NULL, 1);
}
void