diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2007-04-23 11:32:45 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2007-04-23 11:32:45 +0000 |
commit | d1c0f4acb7b6be8baa3fd007c8fde95a78ab1dab (patch) | |
tree | e7b4a1d2badc270ef6ddd1643916cd3d671cd1d1 /sys/dev/pci/if_tht.c | |
parent | f5e65ba44239c7275e5940c0801235f47f607526 (diff) |
increment opackets and ipackets. clear OACTIVE when tx completes.
Diffstat (limited to 'sys/dev/pci/if_tht.c')
-rw-r--r-- | sys/dev/pci/if_tht.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c index 960e093c053..2ce5d89aced 100644 --- a/sys/dev/pci/if_tht.c +++ b/sys/dev/pci/if_tht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tht.c,v 1.56 2007/04/23 11:27:32 dlg Exp $ */ +/* $OpenBSD: if_tht.c,v 1.57 2007/04/23 11:32:44 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -911,6 +911,8 @@ tht_start(struct ifnet *ifp) bus_dmamap_sync(sc->sc_thtc->sc_dmat, pkt->tp_dmap, 0, pkt->tp_dmap->dm_mapsize, BUS_DMASYNC_PREWRITE); + ifp->if_opackets++; + } while (sc->sc_txt.tf_ready > THT_FIFO_DESC_LEN); tht_fifo_post(sc, &sc->sc_txt); @@ -960,6 +962,7 @@ tht_load_pkt(struct tht_softc *sc, struct tht_pkt *pkt, struct mbuf *m) void tht_txf(struct tht_softc *sc) { + struct ifnet *ifp = &sc->sc_ac.ac_if; bus_dma_tag_t dmat = sc->sc_thtc->sc_dmat; bus_dmamap_t dmap; struct tht_tx_free txf; @@ -986,6 +989,8 @@ tht_txf(struct tht_softc *sc) } while (sc->sc_txf.tf_ready > sizeof(txf)); + ifp->if_flags &= ~IFF_OACTIVE; + tht_fifo_post(sc, &sc->sc_txf); } @@ -1122,6 +1127,8 @@ tht_rxd(struct tht_softc *sc) bc -= sizeof(pad); } + ifp->if_ipackets++; + } while (sc->sc_rxd.tf_ready >= sizeof(rxd)); tht_fifo_post(sc, &sc->sc_rxd); |