From 2ed7649bd4ead968a8e3519d77a452542204900b Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Sat, 31 May 2008 02:41:26 +0000 Subject: Properly set the IFF_OACTIVE flag if all the descriptrs are in use for the TX ring and clear the flag when some have been freed. ok dlg@ kettenis@ --- sys/dev/ic/gem.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index 62bca4962df..97c5a909e6e 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gem.c,v 1.74 2008/05/09 21:22:44 brad Exp $ */ +/* $OpenBSD: gem.c,v 1.75 2008/05/31 02:41:25 brad Exp $ */ /* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */ /* @@ -1680,11 +1680,13 @@ gem_tint(struct gem_softc *sc, u_int32_t status) } sc->sc_tx_cons = cons; - gem_start(ifp); - + if (sc->sc_tx_cnt < GEM_NTXDESC - 2) + ifp->if_flags &= ~IFF_OACTIVE; if (sc->sc_tx_cnt == 0) ifp->if_timer = 0; + gem_start(ifp); + return (1); } @@ -1718,7 +1720,7 @@ gem_start(struct ifnet *ifp) * or fail... */ if (gem_encap(sc, m, &bix)) { - ifp->if_timer = 2; + ifp->if_flags |= IFF_OACTIVE; break; } -- cgit v1.2.3