Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Adopt <net/if_stats.h>.
details: https://anonhg.NetBSD.org/src/rev/c5a3fda5629a
branches: trunk
changeset: 744298:c5a3fda5629a
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Jan 29 06:17:07 2020 +0000
description:
Adopt <net/if_stats.h>.
diffstat:
sys/dev/ic/am7990.c | 30 +++++++++++++++---------------
sys/dev/ic/lance.c | 10 +++++-----
sys/dev/ieee1394/if_fwip.c | 24 ++++++++++++------------
sys/dev/isa/cs89x0isa.c | 10 +++++-----
sys/dev/isa/if_eg.c | 22 ++++++++++++----------
sys/dev/isa/if_el.c | 18 +++++++++---------
sys/dev/isa/if_iy.c | 18 +++++++++---------
sys/dev/ofw/ofnet.c | 20 ++++++++++----------
sys/dev/usb/if_athn_usb.c | 18 +++++++++---------
sys/dev/usb/if_atu.c | 16 ++++++++--------
sys/dev/usb/if_aue.c | 12 ++++++------
sys/dev/usb/if_axe.c | 14 +++++++-------
sys/dev/usb/if_axen.c | 12 ++++++------
sys/dev/usb/if_bwfm_usb.c | 8 ++++----
sys/dev/usb/if_cdce.c | 6 +++---
sys/dev/usb/if_cue.c | 19 ++++++++++++-------
sys/dev/usb/if_kue.c | 6 +++---
sys/dev/usb/if_mos.c | 10 +++++-----
sys/dev/usb/if_mue.c | 10 +++++-----
19 files changed, 145 insertions(+), 138 deletions(-)
diffs (truncated from 1133 to 300 lines):
diff -r e643b49d9552 -r c5a3fda5629a sys/dev/ic/am7990.c
--- a/sys/dev/ic/am7990.c Wed Jan 29 06:13:02 2020 +0000
+++ b/sys/dev/ic/am7990.c Wed Jan 29 06:17:07 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: am7990.c,v 1.80 2019/11/28 05:07:27 isaki Exp $ */
+/* $NetBSD: am7990.c,v 1.81 2020/01/29 06:17:07 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.80 2019/11/28 05:07:27 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.81 2020/01/29 06:17:07 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -242,12 +242,12 @@
if (rmd.rmd1_bits & LE_R1_BUFF)
printf("%s: receive buffer error\n",
device_xname(sc->sc_dev));
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
} else if ((rmd.rmd1_bits & (LE_R1_STP | LE_R1_ENP)) !=
(LE_R1_STP | LE_R1_ENP)) {
printf("%s: dropping chained buffer\n",
device_xname(sc->sc_dev));
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
} else {
#ifdef LEDEBUG
if (sc->sc_debug > 1)
@@ -328,23 +328,23 @@
device_xname(sc->sc_dev));
}
if (tmd.tmd3 & LE_T3_LCOL)
- ifp->if_collisions++;
+ if_statinc(ifp, if_collisions);
if (tmd.tmd3 & LE_T3_RTRY) {
#ifdef LEDEBUG
printf("%s: excessive collisions, tdr %d\n",
device_xname(sc->sc_dev),
tmd.tmd3 & LE_T3_TDR_MASK);
#endif
- ifp->if_collisions += 16;
+ if_statadd(ifp, if_collisions, 16);
}
- ifp->if_oerrors++;
+ if_statinc(ifp, if_oerrors);
} else {
if (tmd.tmd1_bits & LE_T1_ONE)
- ifp->if_collisions++;
+ if_statinc(ifp, if_collisions);
else if (tmd.tmd1_bits & LE_T1_MORE)
/* Real number is unknown. */
- ifp->if_collisions += 2;
- ifp->if_opackets++;
+ if_statadd(ifp, if_collisions, 2);
+ if_statinc(ifp, if_opackets);
}
if (++bix == sc->sc_ntbuf)
@@ -398,20 +398,20 @@
#ifdef LEDEBUG
printf("%s: babble\n", device_xname(sc->sc_dev));
#endif
- ifp->if_oerrors++;
+ if_statinc(ifp, if_oerrors);
}
#if 0
if (isr & LE_C0_CERR) {
printf("%s: collision error\n",
device_xname(sc->sc_dev));
- ifp->if_collisions++;
+ if_statinc(ifp, if_collisions);
}
#endif
if (isr & LE_C0_MISS) {
#ifdef LEDEBUG
printf("%s: missed packet\n", device_xname(sc->sc_dev));
#endif
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
}
if (isr & LE_C0_MERR) {
printf("%s: memory error\n", device_xname(sc->sc_dev));
@@ -422,13 +422,13 @@
if ((isr & LE_C0_RXON) == 0) {
printf("%s: receiver disabled\n", device_xname(sc->sc_dev));
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
lance_reset(sc);
return (1);
}
if ((isr & LE_C0_TXON) == 0) {
printf("%s: transmitter disabled\n", device_xname(sc->sc_dev));
- ifp->if_oerrors++;
+ if_statinc(ifp, if_oerrors);
lance_reset(sc);
return (1);
}
diff -r e643b49d9552 -r c5a3fda5629a sys/dev/ic/lance.c
--- a/sys/dev/ic/lance.c Wed Jan 29 06:13:02 2020 +0000
+++ b/sys/dev/ic/lance.c Wed Jan 29 06:17:07 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lance.c,v 1.59 2019/12/27 09:32:10 msaitoh Exp $ */
+/* $NetBSD: lance.c,v 1.60 2020/01/29 06:17:07 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lance.c,v 1.59 2019/12/27 09:32:10 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lance.c,v 1.60 2020/01/29 06:17:07 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -430,14 +430,14 @@
printf("%s: invalid packet size %d; dropping\n",
device_xname(sc->sc_dev), len);
#endif
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
return;
}
/* Pull packet off interface. */
m = lance_get(sc, boff, len);
if (m == 0) {
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
return;
}
@@ -479,7 +479,7 @@
struct lance_softc *sc = ifp->if_softc;
log(LOG_ERR, "%s: device timeout\n", device_xname(sc->sc_dev));
- ++ifp->if_oerrors;
+ if_statinc(ifp, if_oerrors);
lance_reset(sc);
}
diff -r e643b49d9552 -r c5a3fda5629a sys/dev/ieee1394/if_fwip.c
--- a/sys/dev/ieee1394/if_fwip.c Wed Jan 29 06:13:02 2020 +0000
+++ b/sys/dev/ieee1394/if_fwip.c Wed Jan 29 06:17:07 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_fwip.c,v 1.29 2018/11/15 10:23:55 maxv Exp $ */
+/* $NetBSD: if_fwip.c,v 1.30 2020/01/29 06:19:39 thorpej Exp $ */
/*-
* Copyright (c) 2004
* Doug Rabson
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_fwip.c,v 1.29 2018/11/15 10:23:55 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_fwip.c,v 1.30 2020/01/29 06:19:39 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -270,7 +270,7 @@
IF_DEQUEUE(&ifp->if_snd, m);
if (m != NULL)
m_freem(m);
- ifp->if_oerrors++;
+ if_statinc(ifp, if_oerrors);
} while (m != NULL);
return;
@@ -511,7 +511,7 @@
/* XXX error check */
FWIPDEBUG(ifp, "resp = %d\n", xfer->resp);
if (xfer->resp != 0)
- ifp->if_oerrors++;
+ if_statinc(ifp, if_oerrors);
m_freem(xfer->mbuf);
fw_xfer_unload(xfer);
@@ -625,7 +625,7 @@
fd = fw_noderesolve_eui64(fc, &eui);
if (!fd) {
/* error */
- ifp->if_oerrors++;
+ if_statinc(ifp, if_oerrors);
/* XXX set error code */
fwip_output_callback(xfer);
continue;
@@ -668,12 +668,12 @@
}
if (error) {
/* error */
- ifp->if_oerrors++;
+ if_statinc(ifp, if_oerrors);
/* XXX set error code */
fwip_output_callback(xfer);
continue;
} else {
- ifp->if_opackets++;
+ if_statinc(ifp, if_opackets);
i++;
}
}
@@ -726,7 +726,7 @@
if (sxfer->resp != 0 ||
fp->mode.stream.len < 2 * sizeof(uint32_t)) {
m_freem(m);
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
continue;
}
m->m_len = m->m_pkthdr.len = fp->mode.stream.len
@@ -753,7 +753,7 @@
FWIPDEBUG(ifp, "Unrecognised GASP header %#08x %#08x\n",
ntohl(p[1]), ntohl(p[2]));
m_freem(m);
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
continue;
}
@@ -788,7 +788,7 @@
m_adj(m, 3*sizeof(uint32_t));
m_set_rcvif(m, ifp);
ieee1394_input(ifp, m, src);
- ifp->if_ipackets++;
+ if_statinc(ifp, if_ipackets);
}
if (STAILQ_FIRST(&xferq->stfree) != NULL)
sc->sc_fd.fc->irx_enable(sc->sc_fd.fc, sc->sc_dma_ch);
@@ -857,7 +857,7 @@
*/
if (rtcode != FWRCODE_COMPLETE) {
m_freem(m);
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
return;
}
@@ -893,5 +893,5 @@
m->m_len = m->m_pkthdr.len = fp->mode.wreqb.len;
m_set_rcvif(m, ifp);
ieee1394_input(ifp, m, fp->mode.wreqb.src);
- ifp->if_ipackets++;
+ if_statinc(ifp, if_ipackets);
}
diff -r e643b49d9552 -r c5a3fda5629a sys/dev/isa/cs89x0isa.c
--- a/sys/dev/isa/cs89x0isa.c Wed Jan 29 06:13:02 2020 +0000
+++ b/sys/dev/isa/cs89x0isa.c Wed Jan 29 06:17:07 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cs89x0isa.c,v 1.18 2016/06/10 13:27:14 ozaki-r Exp $ */
+/* $NetBSD: cs89x0isa.c,v 1.19 2020/01/29 06:21:40 thorpej Exp $ */
/*
* Copyright 1997
@@ -36,7 +36,7 @@
/* isa DMA routines for cs89x0 */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs89x0isa.c,v 1.18 2016/06/10 13:27:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs89x0isa.c,v 1.19 2020/01/29 06:21:40 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -226,7 +226,7 @@
printf("%s: cs_process_rx_dma: "
"DMA buffer out of sync about to reset\n",
device_xname(sc->sc_dev));
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
/* skip the rest of the DMA buffer */
isa_dmaabort(isc->sc_ic, isc->sc_drq);
@@ -243,7 +243,7 @@
printf("%s: cs_process_rx_dma: "
"unable to allocate mbuf\n",
device_xname(sc->sc_dev));
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
/*
* couldn't allocate an mbuf so
* things are not good, may as well
@@ -352,7 +352,7 @@
else {
/* the frame was not received OK */
/* Increment the input error count */
- ifp->if_ierrors++;
+ if_statinc(ifp, if_ierrors);
/*
* If debugging is enabled then log error
diff -r e643b49d9552 -r c5a3fda5629a sys/dev/isa/if_eg.c
--- a/sys/dev/isa/if_eg.c Wed Jan 29 06:13:02 2020 +0000
+++ b/sys/dev/isa/if_eg.c Wed Jan 29 06:17:07 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_eg.c,v 1.96 2019/02/05 06:17:02 msaitoh Exp $ */
Home |
Main Index |
Thread Index |
Old Index