diff options
| author | Pyun YongHyeon <yongari@FreeBSD.org> | 2011-05-20 17:01:22 +0000 |
|---|---|---|
| committer | Pyun YongHyeon <yongari@FreeBSD.org> | 2011-05-20 17:01:22 +0000 |
| commit | 83242185a3ae33394c241fcaa11301f2748c29da (patch) | |
| tree | 6682d1c5b4f860fd3b789df38bfbdb272e53db63 /sys/dev/gem | |
| parent | 85307c9ed9cfe02c2c19551f41495d97ef5b8ffb (diff) | |
Notes
Diffstat (limited to 'sys/dev/gem')
| -rw-r--r-- | sys/dev/gem/if_gem.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c index 814c9a853f54..9ee43f2e7705 100644 --- a/sys/dev/gem/if_gem.c +++ b/sys/dev/gem/if_gem.c @@ -739,8 +739,10 @@ gem_reset_rxdma(struct gem_softc *sc) { int i; - if (gem_reset_rx(sc) != 0) + if (gem_reset_rx(sc) != 0) { + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; return (gem_init_locked(sc)); + } for (i = 0; i < GEM_NRXDESC; i++) if (sc->sc_rxsoft[i].rxs_mbuf != NULL) GEM_UPDATE_RXDESC(sc, i); @@ -924,6 +926,9 @@ gem_init_locked(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + #ifdef GEM_DEBUG CTR2(KTR_GEM, "%s: %s: calling stop", device_get_name(sc->sc_dev), __func__); @@ -1762,6 +1767,7 @@ gem_intr(void *v) if ((status2 & (GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) != 0) { sc->sc_ifp->if_oerrors++; + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; gem_init_locked(sc); } } @@ -1814,6 +1820,7 @@ gem_watchdog(struct gem_softc *sc) ++ifp->if_oerrors; /* Try to get more packets going. */ + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; gem_init_locked(sc); gem_start_locked(ifp); return (EJUSTRETURN); |
