summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-05-31 02:41:26 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-05-31 02:41:26 +0000
commit2ed7649bd4ead968a8e3519d77a452542204900b (patch)
treed18e2a3c4adf67464f28494f9682cd28a6972502
parentdf656cd267a9e8b69a867b70a8ea5beb819300a2 (diff)
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@
-rw-r--r--sys/dev/ic/gem.c10
1 files changed, 6 insertions, 4 deletions
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;
}