summaryrefslogtreecommitdiffstats
path: root/sys/dev/gem
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-09-18 20:21:46 +0000
committerglebius <glebius@FreeBSD.org>2014-09-18 20:21:46 +0000
commitead2bbbf2719341989321519885d08a2bf5fe873 (patch)
tree46c172f21c2e2fa7d498ec8ddd64a025fdcabb34 /sys/dev/gem
parent85f8d768dad386a56c8bf83ce6d9a119997560da (diff)
downloadFreeBSD-src-ead2bbbf2719341989321519885d08a2bf5fe873.zip
FreeBSD-src-ead2bbbf2719341989321519885d08a2bf5fe873.tar.gz
Mechanically convert to if_inc_counter().
Diffstat (limited to 'sys/dev/gem')
-rw-r--r--sys/dev/gem/if_gem.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c
index ce83f2f..b2a828d 100644
--- a/sys/dev/gem/if_gem.c
+++ b/sys/dev/gem/if_gem.c
@@ -568,18 +568,18 @@ gem_tick(void *arg)
/*
* Unload collision and error counters.
*/
- ifp->if_collisions +=
+ if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
GEM_BANK1_READ_4(sc, GEM_MAC_NORM_COLL_CNT) +
- GEM_BANK1_READ_4(sc, GEM_MAC_FIRST_COLL_CNT);
+ GEM_BANK1_READ_4(sc, GEM_MAC_FIRST_COLL_CNT));
v = GEM_BANK1_READ_4(sc, GEM_MAC_EXCESS_COLL_CNT) +
GEM_BANK1_READ_4(sc, GEM_MAC_LATE_COLL_CNT);
- ifp->if_collisions += v;
- ifp->if_oerrors += v;
- ifp->if_ierrors +=
+ if_inc_counter(ifp, IFCOUNTER_COLLISIONS, v);
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, v);
+ if_inc_counter(ifp, IFCOUNTER_IERRORS,
GEM_BANK1_READ_4(sc, GEM_MAC_RX_LEN_ERR_CNT) +
GEM_BANK1_READ_4(sc, GEM_MAC_RX_ALIGN_ERR) +
GEM_BANK1_READ_4(sc, GEM_MAC_RX_CRC_ERR_CNT) +
- GEM_BANK1_READ_4(sc, GEM_MAC_RX_CODE_VIOL);
+ GEM_BANK1_READ_4(sc, GEM_MAC_RX_CODE_VIOL));
/*
* Then clear the hardware counters.
@@ -1485,7 +1485,7 @@ gem_tint(struct gem_softc *sc)
STAILQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q);
- ifp->if_opackets++;
+ if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
progress = 1;
}
@@ -1580,7 +1580,7 @@ gem_rint(struct gem_softc *sc)
}
if (rxstat & GEM_RD_BAD_CRC) {
- ifp->if_ierrors++;
+ if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
device_printf(sc->sc_dev, "receive error: CRC error\n");
GEM_INIT_RXDESC(sc, sc->sc_rxptr);
m = NULL;
@@ -1606,7 +1606,7 @@ gem_rint(struct gem_softc *sc)
* the buffer that's already attached to this descriptor.
*/
if (gem_add_rxbuf(sc, sc->sc_rxptr) != 0) {
- ifp->if_iqdrops++;
+ if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
GEM_INIT_RXDESC(sc, sc->sc_rxptr);
m = NULL;
}
@@ -1634,7 +1634,7 @@ gem_rint(struct gem_softc *sc)
continue;
}
- ifp->if_ipackets++;
+ if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
m->m_data += ETHER_ALIGN; /* first byte offset */
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = GEM_RD_BUFLEN(rxstat);
@@ -1706,7 +1706,7 @@ static void
gem_eint(struct gem_softc *sc, u_int status)
{
- sc->sc_ifp->if_ierrors++;
+ if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1);
if ((status & GEM_INTR_RX_TAG_ERR) != 0) {
gem_reset_rxdma(sc);
return;
@@ -1784,7 +1784,7 @@ gem_intr(void *v)
"MAC TX fault, status %x\n", status2);
if ((status2 &
(GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) != 0) {
- sc->sc_ifp->if_oerrors++;
+ if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
gem_init_locked(sc);
}
@@ -1798,7 +1798,7 @@ gem_intr(void *v)
* likely that the receiver has hung so we reset it.
*/
if ((status2 & GEM_MAC_RX_OVERFLOW) != 0) {
- sc->sc_ifp->if_ierrors++;
+ if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1);
gem_reset_rxdma(sc);
} else if ((status2 &
~(GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT)) != 0)
@@ -1835,7 +1835,7 @@ gem_watchdog(struct gem_softc *sc)
device_printf(sc->sc_dev, "device timeout\n");
else if (bootverbose)
device_printf(sc->sc_dev, "device timeout (no link)\n");
- ++ifp->if_oerrors;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
/* Try to get more packets going. */
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
OpenPOWER on IntegriCloud