diff options
author | 2007-04-23 11:32:44 +0000 | |
---|---|---|
committer | 2007-04-23 11:32:44 +0000 | |
commit | 73aefff271ea3c526a3e4551bd1cfa0566ee8e89 (patch) | |
tree | 19af199f374ea26b4cfb83fd4e3f91e58559b706 | |
parent | Clean up some comments. (diff) | |
download | wireguard-openbsd-73aefff271ea3c526a3e4551bd1cfa0566ee8e89.tar.xz wireguard-openbsd-73aefff271ea3c526a3e4551bd1cfa0566ee8e89.zip |
increment opackets and ipackets. clear OACTIVE when tx completes.
-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); |