Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Adopt <net/if_stats.h>.
details: https://anonhg.NetBSD.org/src/rev/6d4583f2bfb6
branches: trunk
changeset: 744300:6d4583f2bfb6
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Jan 29 06:46:58 2020 +0000
description:
Adopt <net/if_stats.h>.
diffstat:
sys/dev/pci/if_pcn.c | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diffs (112 lines):
diff -r 7308cbe2dd7f -r 6d4583f2bfb6 sys/dev/pci/if_pcn.c
--- a/sys/dev/pci/if_pcn.c Wed Jan 29 06:35:28 2020 +0000
+++ b/sys/dev/pci/if_pcn.c Wed Jan 29 06:46:58 2020 +0000
@@ -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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
* 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 @@
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,
Home |
Main Index |
Thread Index |
Old Index