aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/stge
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2010-10-08 19:32:39 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2010-10-08 19:32:39 +0000
commit69e8da944e77b64cab577e47fb54b2f7dd2473d4 (patch)
tree46984d8ea36aa1628a7f41f2894f9d286a03c9d6 /sys/dev/stge
parentc323e2ee21c610fa8e6d6f0dac8818849f8f7f86 (diff)
Notes
Diffstat (limited to 'sys/dev/stge')
-rw-r--r--sys/dev/stge/if_stge.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/dev/stge/if_stge.c b/sys/dev/stge/if_stge.c
index 271790d3a2da..4fccb1cd77a4 100644
--- a/sys/dev/stge/if_stge.c
+++ b/sys/dev/stge/if_stge.c
@@ -1384,6 +1384,7 @@ stge_watchdog(struct stge_softc *sc)
ifp = sc->sc_ifp;
if_printf(sc->sc_ifp, "device timeout\n");
ifp->if_oerrors++;
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
stge_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
stge_start_locked(ifp);
@@ -1412,7 +1413,10 @@ stge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
else if (ifp->if_mtu != ifr->ifr_mtu) {
ifp->if_mtu = ifr->ifr_mtu;
STGE_LOCK(sc);
- stge_init_locked(sc);
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+ stge_init_locked(sc);
+ }
STGE_UNLOCK(sc);
}
break;
@@ -1646,8 +1650,10 @@ stge_intr(void *arg)
}
force_init:
- if (reinit != 0)
+ if (reinit != 0) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
stge_init_locked(sc);
+ }
/* Re-enable interrupts. */
CSR_WRITE_2(sc, STGE_IntEnable, sc->sc_IntEnable);
@@ -1943,11 +1949,14 @@ stge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
if ((status & IS_HostError) != 0) {
device_printf(sc->sc_dev,
"Host interface error, resetting...\n");
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
stge_init_locked(sc);
}
if ((status & IS_TxComplete) != 0) {
- if (stge_tx_error(sc) != 0)
+ if (stge_tx_error(sc) != 0) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
stge_init_locked(sc);
+ }
}
}
@@ -2128,6 +2137,8 @@ stge_init_locked(struct stge_softc *sc)
STGE_LOCK_ASSERT(sc);
ifp = sc->sc_ifp;
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+ return;
mii = device_get_softc(sc->sc_miibus);
/*