From d1c0f4acb7b6be8baa3fd007c8fde95a78ab1dab Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Mon, 23 Apr 2007 11:32:45 +0000 Subject: increment opackets and ipackets. clear OACTIVE when tx completes. --- sys/dev/pci/if_tht.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sys/dev/pci/if_tht.c') 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 @@ -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); -- cgit v1.2.3