Module Name:    src
Committed By:   thorpej
Date:           Wed Jan 29 13:54:42 UTC 2020

Modified Files:
        src/sys/dev/pcmcia: if_cnw.c if_malo_pcmcia.c if_ray.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pcmcia/if_cnw.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pcmcia/if_malo_pcmcia.c
cvs rdiff -u -r1.96 -r1.97 src/sys/dev/pcmcia/if_ray.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/pcmcia/if_cnw.c
diff -u src/sys/dev/pcmcia/if_cnw.c:1.67 src/sys/dev/pcmcia/if_cnw.c:1.68
--- src/sys/dev/pcmcia/if_cnw.c:1.67	Fri Dec  6 07:12:39 2019
+++ src/sys/dev/pcmcia/if_cnw.c	Wed Jan 29 13:54:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cnw.c,v 1.67 2019/12/06 07:12:39 maxv Exp $	*/
+/*	$NetBSD: if_cnw.c,v 1.68 2020/01/29 13:54:41 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.67 2019/12/06 07:12:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.68 2020/01/29 13:54:41 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -668,7 +668,7 @@ cnw_start(struct ifnet *ifp)
 		bpf_mtap(ifp, m0, BPF_D_OUT);
 
 		cnw_transmit(sc, m0);
-		++ifp->if_opackets;
+		if_statinc(ifp, if_opackets);
 		ifp->if_timer = 3; /* start watchdog timer */
 
 		microtime(&sc->sc_txlast);
@@ -844,7 +844,7 @@ cnw_recv(struct cnw_softc *sc)
 
 		/* Did we manage to get the packet from the interface? */
 		if (m == 0) {
-			++ifp->if_ierrors;
+			if_statinc(ifp, if_ierrors);
 			return;
 		}
 
@@ -957,7 +957,7 @@ cnw_intr(void *arg)
 			}
 
 			if (tser & CNW_TSER_ERROR) {
-				++ifp->if_oerrors;
+				if_statinc(ifp, if_oerrors);
 				WAIT_WOC(sc);
 				bus_space_write_1(sc->sc_memt, sc->sc_memh,
 				    sc->sc_memoff + CNW_EREG_TSERW,
@@ -1120,7 +1120,7 @@ cnw_watchdog(struct ifnet *ifp)
 	struct cnw_softc *sc = ifp->if_softc;
 
 	printf("%s: device timeout; card reset\n", device_xname(sc->sc_dev));
-	++ifp->if_oerrors;
+	if_statinc(ifp, if_oerrors);
 	cnw_init(sc);
 }
 

Index: src/sys/dev/pcmcia/if_malo_pcmcia.c
diff -u src/sys/dev/pcmcia/if_malo_pcmcia.c:1.24 src/sys/dev/pcmcia/if_malo_pcmcia.c:1.25
--- src/sys/dev/pcmcia/if_malo_pcmcia.c:1.24	Sun Nov 10 21:16:36 2019
+++ src/sys/dev/pcmcia/if_malo_pcmcia.c	Wed Jan 29 13:54:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_malo_pcmcia.c,v 1.24 2019/11/10 21:16:36 chs Exp $	*/
+/*	$NetBSD: if_malo_pcmcia.c,v 1.25 2020/01/29 13:54:41 thorpej Exp $	*/
 /*      $OpenBSD: if_malo.c,v 1.65 2009/03/29 21:53:53 sthen Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_malo_pcmcia.c,v 1.24 2019/11/10 21:16:36 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_malo_pcmcia.c,v 1.25 2020/01/29 13:54:41 thorpej Exp $");
 
 #ifdef _MODULE
 #include <sys/module.h>
@@ -525,7 +525,7 @@ cmalo_start(struct ifnet *ifp)
 	bpf_mtap(ifp, m, BPF_D_OUT);
 
 	if (cmalo_tx(sc, m) != 0)
-		ifp->if_oerrors++;
+		if_statinc(ifp, if_oerrors);
 }
 
 static int
@@ -1046,7 +1046,7 @@ cmalo_rx(struct malo_softc *sc)
 	    rxdesc->pkglen, ETHER_ALIGN, ifp);
 	if (m == NULL) {
 		DPRINTF(1, "RX m_devget failed\n");
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		return;
 	}
 
@@ -1110,7 +1110,7 @@ cmalo_tx_done(struct malo_softc *sc)
 	DPRINTF(2, "%s: TX done\n", device_xname(sc->sc_dev));
 
 	s = splnet();
-	ifp->if_opackets++;
+	if_statinc(ifp, if_opackets);
 	ifp->if_flags &= ~IFF_OACTIVE;
 	ifp->if_timer = 0;
 	cmalo_start(ifp);

Index: src/sys/dev/pcmcia/if_ray.c
diff -u src/sys/dev/pcmcia/if_ray.c:1.96 src/sys/dev/pcmcia/if_ray.c:1.97
--- src/sys/dev/pcmcia/if_ray.c:1.96	Mon Jan  6 07:15:03 2020
+++ src/sys/dev/pcmcia/if_ray.c	Wed Jan 29 13:54:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ray.c,v 1.96 2020/01/06 07:15:03 msaitoh Exp $	*/
+/*	$NetBSD: if_ray.c,v 1.97 2020/01/29 13:54:41 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2000 Christian E. Hopps
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.96 2020/01/06 07:15:03 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ray.c,v 1.97 2020/01/29 13:54:41 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -1113,7 +1113,7 @@ ray_intr_start(struct ray_softc *sc)
 			RAY_DPRINTF((
 			    "%s: mbuf too long %ld\n", ifp->if_xname,
 			    (u_long)pktlen));
-			ifp->if_oerrors++;
+			if_statinc(ifp, if_oerrors);
 			m_freem(m0);
 			continue;
 		}
@@ -1125,7 +1125,7 @@ ray_intr_start(struct ray_softc *sc)
 		if (!m0) {
 			RAY_DPRINTF(( "%s: couldn\'t pullup ether header\n",
 			    ifp->if_xname));
-			ifp->if_oerrors++;
+			if_statinc(ifp, if_oerrors);
 			continue;
 		}
 		RAY_DPRINTF(("%s: got pulled up mbuf 0x%lx\n", ifp->if_xname,
@@ -1138,7 +1138,7 @@ ray_intr_start(struct ray_softc *sc)
 			/* don't support llc for windows compat operation */
 			if (et <= ETHERMTU) {
 				m_freem(m0);
-				ifp->if_oerrors++;
+				if_statinc(ifp, if_oerrors);
 				continue;
 			}
 			tmplen = sizeof(struct ieee80211_frame);
@@ -1156,7 +1156,7 @@ ray_intr_start(struct ray_softc *sc)
 		if (!m0) {
 			RAY_DPRINTF(("%s: couldn\'t prepend header\n",
 			    ifp->if_xname));
-			ifp->if_oerrors++;
+			if_statinc(ifp, if_oerrors);
 			continue;
 		}
 		/* copy the frame into the mbuf for tapping */
@@ -1256,7 +1256,7 @@ ray_intr_start(struct ray_softc *sc)
 		printf("%s: dropping tx packets device busy\n",
 		    device_xname(sc->sc_dev));
 		ray_free_ccs_chain(sc, firsti);
-		ifp->if_oerrors += pcount;
+		if_statadd(ifp, if_oerrors, pcount);
 		return;
 	}
 
@@ -1266,7 +1266,7 @@ ray_intr_start(struct ray_softc *sc)
 	SRAM_WRITE_1(sc, RAY_SCB_CCSI, firsti);
 	RAY_ECF_START_CMD(sc);
 
-	ifp->if_opackets += pcount;
+	if_statadd(ifp, if_opackets, pcount);
 }
 
 /*
@@ -1324,13 +1324,13 @@ ray_recv(struct ray_softc *sc, bus_size_
 	if (pktlen > MCLBYTES || pktlen < sizeof(*frame)) {
 		RAY_DPRINTF(("%s: PKTLEN TOO BIG OR TOO SMALL\n",
 		    device_xname(sc->sc_dev)));
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		goto done;
 	}
 	MGETHDR(m, M_DONTWAIT, MT_DATA);
 	if (!m) {
 		RAY_DPRINTF(("%s: MGETHDR FAILED\n", device_xname(sc->sc_dev)));
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		goto done;
 	}
 	if ((pktlen + fudge) > MHLEN) {
@@ -1339,7 +1339,7 @@ ray_recv(struct ray_softc *sc, bus_size_
 		if ((m->m_flags & M_EXT) == 0) {
 			RAY_DPRINTF(("%s: MCLGET FAILED\n",
 			    device_xname(sc->sc_dev)));
-			ifp->if_ierrors++;
+			if_statinc(ifp, if_ierrors);
 			m_freem(m);
 			m = 0;
 			goto done;
@@ -1373,7 +1373,7 @@ ray_recv(struct ray_softc *sc, bus_size_
 			RAY_DPRINTF(("%s: BAD LEN current 0x%lx pktlen 0x%lx\n",
 			    device_xname(sc->sc_dev), (u_long)(len + lenread),
 			    (u_long)pktlen));
-			ifp->if_ierrors++;
+			if_statinc(ifp, if_ierrors);
 			m_freem(m);
 			m = 0;
 			goto done;

Reply via email to