From f02c95526ee7a9a239c22f8a5a584f5dd2226fb8 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:43:17 +0000 Subject: [PATCH] Mechanically convert to if_inc_counter(). --- sys/dev/snc/dp83932.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c index 617897780ccd..d4e062ac1f2f 100644 --- a/sys/dev/snc/dp83932.c +++ b/sys/dev/snc/dp83932.c @@ -369,7 +369,7 @@ sncstart_locked(struct ifnet *ifp) sc->mtd_prev = sc->mtd_free; sc->mtd_free = mtd_next; - ifp->if_opackets++; /* # of pkts */ + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* # of pkts */ /* Jump back for possibly more punishment. */ goto outloop; @@ -935,11 +935,12 @@ sonictxint(struct snc_softc *sc) txp_status = SRO(sc, txp, TXP_STATUS); - ifp->if_collisions += (txp_status & TCR_EXC) ? 16 : - ((txp_status & TCR_NC) >> 12); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + (txp_status & TCR_EXC) ? 16 : + ((txp_status & TCR_NC) >> 12)); if ((txp_status & TCR_PTX) == 0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); device_printf(sc->sc_dev, "Tx packet status=0x%x\n", txp_status); @@ -989,11 +990,11 @@ sonicrxint(struct snc_softc *sc) u_int32_t pkt = sc->rbuf[orra & RBAMASK] + (rxpkt_ptr & PAGE_MASK); if (sonic_read(sc, pkt, len)) - sc->sc_ifp->if_ipackets++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IPACKETS, 1); else - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); } else - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); /* * give receive buffer area back to chip.