Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2014 20:43:18 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271821 - head/sys/dev/snc
Message-ID:  <201409182043.s8IKhInl053698@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Thu Sep 18 20:43:17 2014
New Revision: 271821
URL: http://svnweb.freebsd.org/changeset/base/271821

Log:
  Mechanically convert to if_inc_counter().

Modified:
  head/sys/dev/snc/dp83932.c

Modified: head/sys/dev/snc/dp83932.c
==============================================================================
--- head/sys/dev/snc/dp83932.c	Thu Sep 18 20:39:23 2014	(r271820)
+++ head/sys/dev/snc/dp83932.c	Thu Sep 18 20:43:17 2014	(r271821)
@@ -369,7 +369,7 @@ outloop:
 	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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409182043.s8IKhInl053698>