Module Name:    src
Committed By:   skrll
Date:           Tue Feb  4 07:36:36 UTC 2020

Modified Files:
        src/sys/arch/macppc/dev: am79c950.c if_bm.c if_gm.c

Log Message:
Adopt <net/if_stats.h>


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/macppc/dev/am79c950.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/macppc/dev/if_bm.c
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/macppc/dev/if_gm.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/arch/macppc/dev/am79c950.c
diff -u src/sys/arch/macppc/dev/am79c950.c:1.47 src/sys/arch/macppc/dev/am79c950.c:1.48
--- src/sys/arch/macppc/dev/am79c950.c:1.47	Fri Dec 27 09:32:10 2019
+++ src/sys/arch/macppc/dev/am79c950.c	Tue Feb  4 07:36:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: am79c950.c,v 1.47 2019/12/27 09:32:10 msaitoh Exp $	*/
+/*	$NetBSD: am79c950.c,v 1.48 2020/02/04 07:36:36 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1997 David Huang <k...@bga.com>
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: am79c950.c,v 1.47 2019/12/27 09:32:10 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am79c950.c,v 1.48 2020/02/04 07:36:36 skrll Exp $");
 
 #include "opt_inet.h"
 
@@ -271,7 +271,7 @@ mcstart(struct ifnet *ifp)
 		ifp->if_flags |= IFF_OACTIVE;
 		maceput(sc, m);
 
-		ifp->if_opackets++;		/* # of pkts */
+		if_statinc(ifp, if_opackets);		/* # of pkts */
 	}
 }
 
@@ -570,13 +570,13 @@ mace_read(struct mc_softc *sc, uint8_t *
 		printf("%s: invalid packet size %d; dropping\n",
 		    device_xname(sc->sc_dev), len);
 #endif
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		return;
 	}
 
 	m = mace_get(sc, pkt, len);
 	if (m == NULL) {
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		return;
 	}
 

Index: src/sys/arch/macppc/dev/if_bm.c
diff -u src/sys/arch/macppc/dev/if_bm.c:1.61 src/sys/arch/macppc/dev/if_bm.c:1.62
--- src/sys/arch/macppc/dev/if_bm.c:1.61	Sun Nov 10 21:16:29 2019
+++ src/sys/arch/macppc/dev/if_bm.c	Tue Feb  4 07:36:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bm.c,v 1.61 2019/11/10 21:16:29 chs Exp $	*/
+/*	$NetBSD: if_bm.c,v 1.62 2020/02/04 07:36:36 skrll Exp $	*/
 
 /*-
  * Copyright (C) 1998, 1999, 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.61 2019/11/10 21:16:29 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.62 2020/02/04 07:36:36 skrll Exp $");
 
 #include "opt_inet.h"
 
@@ -490,7 +490,7 @@ bmac_rint(void *v)
 
 		m = bmac_get(sc, data, datalen);
 		if (m == NULL) {
-			ifp->if_ierrors++;
+			if_statinc(ifp, if_ierrors);
 			goto next;
 		}
 
@@ -576,7 +576,7 @@ bmac_start(struct ifnet *ifp)
 
 		/* 5 seconds to watch for failing to transmit */
 		ifp->if_timer = 5;
-		ifp->if_opackets++;		/* # of pkts */
+		if_statinc(ifp, if_opackets);		/* # of pkts */
 
 		bmac_transmit_packet(sc, sc->sc_txbuf, tlen);
 	}
@@ -680,7 +680,7 @@ bmac_watchdog(struct ifnet *ifp)
 	bmac_reset_bits(sc, TXCFG, TxMACEnable);
 
 	printf("%s: device timeout\n", ifp->if_xname);
-	ifp->if_oerrors++;
+	if_statinc(ifp, if_oerrors);
 
 	bmac_reset(sc);
 }

Index: src/sys/arch/macppc/dev/if_gm.c
diff -u src/sys/arch/macppc/dev/if_gm.c:1.56 src/sys/arch/macppc/dev/if_gm.c:1.57
--- src/sys/arch/macppc/dev/if_gm.c:1.56	Sun Nov 10 21:16:29 2019
+++ src/sys/arch/macppc/dev/if_gm.c	Tue Feb  4 07:36:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gm.c,v 1.56 2019/11/10 21:16:29 chs Exp $	*/
+/*	$NetBSD: if_gm.c,v 1.57 2020/02/04 07:36:36 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.56 2019/11/10 21:16:29 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.57 2020/02/04 07:36:36 skrll Exp $");
 
 #include "opt_inet.h"
 
@@ -362,13 +362,13 @@ gmac_rint(struct gmac_softc *sc)
 		len -= 4;	/* CRC */
 
 		if (le32toh(dp->cmd_hi) & 0x40000000) {
-			ifp->if_ierrors++;
+			if_statinc(ifp, if_ierrors);
 			goto next;
 		}
 
 		m = gmac_get(sc, sc->sc_rxbuf[i], len);
 		if (m == NULL) {
-			ifp->if_ierrors++;
+			if_statinc(ifp, if_ierrors);
 			goto next;
 		}
 
@@ -458,7 +458,7 @@ gmac_start(struct ifnet *ifp)
 
 		/* 5 seconds to watch for failing to transmit */
 		ifp->if_timer = 5;
-		ifp->if_opackets++;		/* # of pkts */
+		if_statinc(ifp, if_opackets);		/* # of pkts */
 
 		i = sc->sc_txnext;
 		buff = sc->sc_txbuf[i];
@@ -823,7 +823,7 @@ gmac_watchdog(struct ifnet *ifp)
 	struct gmac_softc *sc = ifp->if_softc;
 
 	printf("%s: device timeout\n", ifp->if_xname);
-	ifp->if_oerrors++;
+	if_statinc(ifp, if_oerrors);
 
 	gmac_reset(sc);
 	gmac_init(sc);

Reply via email to