Module Name:    src
Committed By:   thorpej
Date:           Wed Jan 29 06:24:10 UTC 2020

Modified Files:
        src/sys/dev/usb: if_athn_usb.c if_atu.c if_aue.c if_axe.c if_axen.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/usb/if_athn_usb.c
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/usb/if_atu.c src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.162 -r1.163 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.121 -r1.122 src/sys/dev/usb/if_axe.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/usb/if_athn_usb.c
diff -u src/sys/dev/usb/if_athn_usb.c:1.35 src/sys/dev/usb/if_athn_usb.c:1.36
--- src/sys/dev/usb/if_athn_usb.c:1.35	Sat Sep 14 12:36:35 2019
+++ src/sys/dev/usb/if_athn_usb.c	Wed Jan 29 06:24:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_usb.c,v 1.35 2019/09/14 12:36:35 maxv Exp $	*/
+/*	$NetBSD: if_athn_usb.c,v 1.36 2020/01/29 06:24:10 thorpej Exp $	*/
 /*	$OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.35 2019/09/14 12:36:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.36 2020/01/29 06:24:10 thorpej Exp $");
 
 #ifdef	_KERNEL_OPT
 #include "opt_inet.h"
@@ -2429,13 +2429,13 @@ athn_usb_txeof(struct usbd_xfer *xfer, v
 		DPRINTFN(DBG_TX, sc, "TX status=%d\n", status);
 		if (status == USBD_STALLED)
 			usbd_clear_endpoint_stall_async(usc->usc_tx_data_pipe);
-		ifp->if_oerrors++;
+		if_statinc(ifp, if_oerrors);
 		splx(s);
 		/* XXX Why return? */
 		return;
 	}
 	sc->sc_tx_timer = 0;
-	ifp->if_opackets++;
+	if_statinc(ifp, if_opackets);
 
 	/* We just released a Tx buffer, notify Tx. */
 	if (ifp->if_flags & IFF_OACTIVE) {
@@ -2608,14 +2608,14 @@ athn_usb_start(struct ifnet *ifp)
 
 		if (m->m_len < (int)sizeof(*eh) &&
 		    (m = m_pullup(m, sizeof(*eh))) == NULL) {
-			ifp->if_oerrors++;
+			if_statinc(ifp, if_oerrors);
 			continue;
 		}
 		eh = mtod(m, struct ether_header *);
 		ni = ieee80211_find_txnode(ic, eh->ether_dhost);
 		if (ni == NULL) {
 			m_freem(m);
-			ifp->if_oerrors++;
+			if_statinc(ifp, if_oerrors);
 			continue;
 		}
 
@@ -2623,7 +2623,7 @@ athn_usb_start(struct ifnet *ifp)
 
 		if ((m = ieee80211_encap(ic, m, ni)) == NULL) {
 			ieee80211_free_node(ni);
-			ifp->if_oerrors++;
+			if_statinc(ifp, if_oerrors);
 			continue;
 		}
  sendit:
@@ -2632,7 +2632,7 @@ athn_usb_start(struct ifnet *ifp)
 		if (athn_usb_tx(sc, m, ni, data) != 0) {
 			m_freem(m);
 			ieee80211_free_node(ni);
-			ifp->if_oerrors++;
+			if_statinc(ifp, if_oerrors);
 			continue;
 		}
 		data = NULL;
@@ -2661,7 +2661,7 @@ athn_usb_watchdog(struct ifnet *ifp)
 		if (--sc->sc_tx_timer == 0) {
 			aprint_error_dev(sc->sc_dev, "device timeout\n");
 			/* athn_usb_init(ifp); XXX needs a process context! */
-			ifp->if_oerrors++;
+			if_statinc(ifp, if_oerrors);
 			return;
 		}
 		ifp->if_timer = 1;

Index: src/sys/dev/usb/if_atu.c
diff -u src/sys/dev/usb/if_atu.c:1.69 src/sys/dev/usb/if_atu.c:1.70
--- src/sys/dev/usb/if_atu.c:1.69	Fri Dec 27 09:41:51 2019
+++ src/sys/dev/usb/if_atu.c	Wed Jan 29 06:24:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_atu.c,v 1.69 2019/12/27 09:41:51 msaitoh Exp $ */
+/*	$NetBSD: if_atu.c,v 1.70 2020/01/29 06:24:10 thorpej Exp $ */
 /*	$OpenBSD: if_atu.c,v 1.48 2004/12/30 01:53:21 dlg Exp $ */
 /*
  * Copyright (c) 2003, 2004
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.69 2019/12/27 09:41:51 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.70 2020/01/29 06:24:10 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1689,12 +1689,12 @@ atu_rxeof(struct usbd_xfer *xfer, void *
 	wh = mtod(m, struct ieee80211_frame_min *);
 	ni = ieee80211_find_rxnode(ic, wh);
 
-	ifp->if_ipackets++;
+	if_statinc(ifp, if_ipackets);
 
 	s = splnet();
 
 	if (atu_newbuf(sc, c, NULL) == ENOBUFS) {
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		goto done1; /* XXX if we can't allocate, why restart it? */
 	}
 
@@ -1754,9 +1754,9 @@ atu_txeof(struct usbd_xfer *xfer, void *
 	usbd_get_xfer_status(c->atu_xfer, NULL, NULL, NULL, &err);
 
 	if (err)
-		ifp->if_oerrors++;
+		if_statinc(ifp, if_oerrors);
 	else
-		ifp->if_opackets++;
+		if_statinc(ifp, if_opackets);
 
 	s = splnet();
 	SLIST_INSERT_HEAD(&sc->atu_cdata.atu_tx_free, c, atu_list);
@@ -1945,7 +1945,7 @@ bad:
 			    atu_list);
 			cd->atu_tx_inuse--;
 			splx(s);
-			/* ifp_if_oerrors++; */
+			/* if_statinc(ifp, if_oerrors); */
 			if (ni != NULL)
 				ieee80211_free_node(ni);
 			continue;
@@ -2183,7 +2183,7 @@ atu_watchdog(struct ifnet *ifp)
 
 	sc = ifp->if_softc;
 	s = splnet();
-	ifp->if_oerrors++;
+	if_statinc(ifp, if_oerrors);
 	DPRINTF(("%s: watchdog timeout\n", device_xname(sc->atu_dev)));
 
 	/*
Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.69 src/sys/dev/usb/if_axen.c:1.70
--- src/sys/dev/usb/if_axen.c:1.69	Wed Jan 15 08:02:53 2020
+++ src/sys/dev/usb/if_axen.c	Wed Jan 29 06:24:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.69 2020/01/15 08:02:53 skrll Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.70 2020/01/29 06:24:10 thorpej Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.69 2020/01/15 08:02:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.70 2020/01/29 06:24:10 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -778,7 +778,7 @@ axen_rx_loop(struct usbnet *un, struct u
 
 	if (total_len < sizeof(pkt_hdr)) {
 		aprint_error_dev(un->un_dev, "rxeof: too short transfer\n");
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		return;
 	}
 
@@ -797,7 +797,7 @@ axen_rx_loop(struct usbnet *un, struct u
 		aprint_error_dev(un->un_dev,
 		    "rxeof: invalid hdr offset (%u > %u)\n",
 		    hdr_offset, total_len);
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		usbd_delay_ms(un->un_udev, 100);
 		return;
 	}
@@ -826,7 +826,7 @@ axen_rx_loop(struct usbnet *un, struct u
 		if ((buf[0] != 0xee) || (buf[1] != 0xee)) {
 			aprint_error_dev(un->un_dev,
 			    "invalid buffer(pkt#%d), continue\n", pkt_count);
-			ifp->if_ierrors += pkt_count;
+			if_statadd(ifp, if_ierrors, pkt_count);
 			return;
 		}
 
@@ -837,7 +837,7 @@ axen_rx_loop(struct usbnet *un, struct u
 		   device_xname(un->un_dev), pkt_count, pkt_hdr, pkt_len));
 
 		if (pkt_hdr & (AXEN_RXHDR_CRC_ERR | AXEN_RXHDR_DROP_ERR)) {
-			ifp->if_ierrors++;
+			if_statinc(ifp, if_ierrors);
 			/* move to next pkt header */
 			DPRINTF(("%s: %s err (pkt#%d)\n",
 			    device_xname(un->un_dev),

Index: src/sys/dev/usb/if_aue.c
diff -u src/sys/dev/usb/if_aue.c:1.162 src/sys/dev/usb/if_aue.c:1.163
--- src/sys/dev/usb/if_aue.c:1.162	Tue Jan  7 06:42:26 2020
+++ src/sys/dev/usb/if_aue.c	Wed Jan 29 06:24:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aue.c,v 1.162 2020/01/07 06:42:26 maxv Exp $	*/
+/*	$NetBSD: if_aue.c,v 1.163 2020/01/29 06:24:10 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.162 2020/01/07 06:42:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.163 2020/01/29 06:24:10 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -888,10 +888,10 @@ aue_intr(struct usbnet *un, usbd_status 
 	    device_unit(un->un_dev), p->aue_txstat0, 0, 0);
 
 	if (p->aue_txstat0)
-		ifp->if_oerrors++;
+		if_statinc(ifp, if_oerrors);
 
 	if (p->aue_txstat0 & (AUE_TXSTAT0_LATECOLL | AUE_TXSTAT0_EXCESSCOLL))
-		ifp->if_collisions++;
+		if_statinc(ifp, if_collisions);
 }
 
 static void
@@ -909,7 +909,7 @@ aue_rx_loop(struct usbnet *un, struct us
 	usbnet_isowned_rx(un);
 
 	if (total_len <= 4 + ETHER_CRC_LEN) {
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		return;
 	}
 
@@ -918,7 +918,7 @@ aue_rx_loop(struct usbnet *un, struct us
 	/* Turn off all the non-error bits in the rx status word. */
 	r.aue_rxstat &= AUE_RXSTAT_MASK;
 	if (r.aue_rxstat) {
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		return;
 	}
 

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.121 src/sys/dev/usb/if_axe.c:1.122
--- src/sys/dev/usb/if_axe.c:1.121	Tue Jan  7 06:42:26 2020
+++ src/sys/dev/usb/if_axe.c	Wed Jan 29 06:24:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.121 2020/01/07 06:42:26 maxv Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.122 2020/01/29 06:24:10 thorpej Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.121 2020/01/07 06:42:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.122 2020/01/29 06:24:10 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1034,7 +1034,7 @@ axe_rx_loop(struct usbnet * un, struct u
 			struct axe_sframe_hdr hdr;
 
 			if (total_len < sizeof(hdr)) {
-				ifp->if_ierrors++;
+				if_statinc(ifp, if_ierrors);
 				break;
 			}
 
@@ -1051,7 +1051,7 @@ axe_rx_loop(struct usbnet * un, struct u
 			if (((le16toh(hdr.len) & AXE_RH1M_RXLEN_MASK) ^
 			    (le16toh(hdr.ilen) & AXE_RH1M_RXLEN_MASK)) !=
 			    AXE_RH1M_RXLEN_MASK) {
-				ifp->if_ierrors++;
+				if_statinc(ifp, if_ierrors);
 				break;
 			}
 
@@ -1069,7 +1069,7 @@ axe_rx_loop(struct usbnet * un, struct u
 			struct axe_csum_hdr csum_hdr;
 
 			if (total_len <	sizeof(csum_hdr)) {
-				ifp->if_ierrors++;
+				if_statinc(ifp, if_ierrors);
 				break;
 			}
 
@@ -1087,7 +1087,7 @@ axe_rx_loop(struct usbnet * un, struct u
 			    AXE_CSUM_RXBYTES(csum_hdr.ilen)) !=
 			    sc->sc_lenmask) {
 				/* we lost sync */
-				ifp->if_ierrors++;
+				if_statinc(ifp, if_ierrors);
 				DPRINTFN(20, "len %#jx ilen %#jx lenmask %#jx "
 				    "err",
 				    AXE_CSUM_RXBYTES(csum_hdr.len),
@@ -1107,7 +1107,7 @@ axe_rx_loop(struct usbnet * un, struct u
 				DPRINTFN(20, "total_len %#jx < len %#jx",
 				    total_len, len, 0, 0);
 				/* invalid length */
-				ifp->if_ierrors++;
+				if_statinc(ifp, if_ierrors);
 				break;
 			}
 			buf += sizeof(csum_hdr);

Reply via email to