diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2006-02-22 21:05:14 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2006-02-22 21:05:14 +0000 |
commit | f10d264188094f4ece7a0f18cb3b82a0c0e89d0e (patch) | |
tree | ebea8248ddf4766a81bf40bf13f0359f2e357fb7 /sys/dev/pci | |
parent | 308bd7532dae7f92791d2ab198b80f90c03c1ae5 (diff) |
fix nfe_txeof() to reset the wathdog timeout only when a full tx frame
has been sent.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_nfe.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index 956631a2bae..aaa82398875 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nfe.c,v 1.46 2006/02/22 19:23:44 damien Exp $ */ +/* $OpenBSD: if_nfe.c,v 1.47 2006/02/22 21:05:13 damien Exp $ */ /*- * Copyright (c) 2006 Damien Bergamini <damien.bergamini@free.fr> @@ -788,12 +788,10 @@ nfe_txeof(struct nfe_softc *sc) struct ifnet *ifp = &sc->sc_arpcom.ac_if; struct nfe_desc32 *desc32; struct nfe_desc64 *desc64; - struct nfe_tx_data *data; + struct nfe_tx_data *data = NULL; uint16_t flags; while (sc->txq.next != sc->txq.cur) { - data = &sc->txq.data[sc->txq.next]; - if (sc->sc_flags & NFE_40BIT_ADDR) { desc64 = &sc->txq.desc64[sc->txq.next]; nfe_txdesc64_sync(sc, desc64, BUS_DMASYNC_POSTREAD); @@ -809,6 +807,8 @@ nfe_txeof(struct nfe_softc *sc) if (flags & NFE_TX_VALID) break; + data = &sc->txq.data[sc->txq.next]; + if ((sc->sc_flags & (NFE_JUMBO_SUP | NFE_40BIT_ADDR)) == 0) { if (!(flags & NFE_TX_LASTFRAG_V1)) goto skip; @@ -841,13 +841,16 @@ nfe_txeof(struct nfe_softc *sc) m_freem(data->m); data->m = NULL; + ifp->if_timer = 0; + skip: sc->txq.queued--; sc->txq.next = (sc->txq.next + 1) % NFE_TX_RING_COUNT; } - ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; - nfe_start(ifp); + if (data != NULL) { /* at least one slot freed */ + ifp->if_flags &= ~IFF_OACTIVE; + nfe_start(ifp); + } } int |