Module Name:    src
Committed By:   thorpej
Date:           Wed Jan 29 06:46:59 UTC 2020

Modified Files:
        src/sys/dev/pci: if_pcn.c

Log Message:
Adopt <net/if_stats.h>.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/if_pcn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_pcn.c
diff -u src/sys/dev/pci/if_pcn.c:1.72 src/sys/dev/pci/if_pcn.c:1.73
--- src/sys/dev/pci/if_pcn.c:1.72	Fri Oct 11 14:22:46 2019
+++ src/sys/dev/pci/if_pcn.c	Wed Jan 29 06:46:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_pcn.c,v 1.72 2019/10/11 14:22:46 msaitoh Exp $	*/
+/*	$NetBSD: if_pcn.c,v 1.73 2020/01/29 06:46:58 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.72 2019/10/11 14:22:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.73 2020/01/29 06:46:58 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1163,7 +1163,7 @@ pcn_watchdog(struct ifnet *ifp)
 	if (sc->sc_txfree != PCN_NTXDESC) {
 		printf("%s: device timeout (txfree %d txsfree %d)\n",
 		    device_xname(sc->sc_dev), sc->sc_txfree, sc->sc_txsfree);
-		ifp->if_oerrors++;
+		if_statinc(ifp, if_oerrors);
 
 		/* Reset the interface. */
 		(void) pcn_init(ifp);
@@ -1248,11 +1248,11 @@ pcn_intr(void *arg)
 		if (csr0 & LE_C0_ERR) {
 			if (csr0 & LE_C0_BABL) {
 				PCN_EVCNT_INCR(&sc->sc_ev_babl);
-				ifp->if_oerrors++;
+				if_statinc(ifp, if_oerrors);
 			}
 			if (csr0 & LE_C0_MISS) {
 				PCN_EVCNT_INCR(&sc->sc_ev_miss);
-				ifp->if_ierrors++;
+				if_statinc(ifp, if_ierrors);
 			}
 			if (csr0 & LE_C0_MERR) {
 				PCN_EVCNT_INCR(&sc->sc_ev_merr);
@@ -1266,14 +1266,14 @@ pcn_intr(void *arg)
 		if ((csr0 & LE_C0_RXON) == 0) {
 			printf("%s: receiver disabled\n",
 			    device_xname(sc->sc_dev));
-			ifp->if_ierrors++;
+			if_statinc(ifp, if_ierrors);
 			wantinit = 1;
 		}
 
 		if ((csr0 & LE_C0_TXON) == 0) {
 			printf("%s: transmitter disabled\n",
 			    device_xname(sc->sc_dev));
-			ifp->if_oerrors++;
+			if_statinc(ifp, if_oerrors);
 			wantinit = 1;
 		}
 	}
@@ -1349,7 +1349,7 @@ pcn_txintr(struct pcn_softc *sc)
 		for (j = txs->txs_firstdesc;; j = PCN_NEXTTX(j)) {
 			tmd = le32toh(sc->sc_txdescs[j].tmd1);
 			if (tmd & LE_T1_ERR) {
-				ifp->if_oerrors++;
+				if_statinc(ifp, if_oerrors);
 				if (sc->sc_swstyle == LE_B20_SSTYLE_PCNETPCI3)
 					tmd2 = le32toh(sc->sc_txdescs[j].tmd0);
 				else
@@ -1380,21 +1380,21 @@ pcn_txintr(struct pcn_softc *sc)
 					    device_xname(sc->sc_dev));
 				}
 				if (tmd2 & LE_T2_LCOL)
-					ifp->if_collisions++;
+					if_statinc(ifp, if_collisions);
 				if (tmd2 & LE_T2_RTRY)
-					ifp->if_collisions += 16;
+					if_statadd(ifp, if_collisions, 16);
 				goto next_packet;
 			}
 			if (j == txs->txs_lastdesc)
 				break;
 		}
 		if (tmd1 & LE_T1_ONE)
-			ifp->if_collisions++;
+			if_statinc(ifp, if_collisions);
 		else if (tmd & LE_T1_MORE) {
 			/* Real number is unknown. */
-			ifp->if_collisions += 2;
+			if_statadd(ifp, if_collisions, 2);
 		}
-		ifp->if_opackets++;
+		if_statinc(ifp, if_opackets);
  next_packet:
 		sc->sc_txfree += txs->txs_dmamap->dm_nsegs;
 		bus_dmamap_sync(sc->sc_dmat, txs->txs_dmamap,
@@ -1461,7 +1461,7 @@ pcn_rxintr(struct pcn_softc *sc)
 			 * buffer.
 			 */
 			if (rmd1 & LE_R1_ERR) {
-				ifp->if_ierrors++;
+				if_statinc(ifp, if_ierrors);
 				/*
 				 * If we got an overflow error, chances
 				 * are there will be a CRC error.  In
@@ -1530,7 +1530,7 @@ pcn_rxintr(struct pcn_softc *sc)
 			m = rxs->rxs_mbuf;
 			if (pcn_add_rxbuf(sc, i) != 0) {
  dropit:
-				ifp->if_ierrors++;
+				if_statinc(ifp, if_ierrors);
 				PCN_INIT_RXDESC(sc, i);
 				bus_dmamap_sync(sc->sc_dmat,
 				    rxs->rxs_dmamap, 0,

Reply via email to