summaryrefslogtreecommitdiffstats
path: root/sys/dev/my
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-09-18 20:59:59 +0000
committerglebius <glebius@FreeBSD.org>2014-09-18 20:59:59 +0000
commitf8546b8f0d327e5228a0275bec79ebd29536c8d9 (patch)
tree860ecc30c97e4e8bf642070ca662e9d1ccf31c57 /sys/dev/my
parent455a87bc4ccb0ebb2a7e7294afacad5d0c64b811 (diff)
downloadFreeBSD-src-f8546b8f0d327e5228a0275bec79ebd29536c8d9.zip
FreeBSD-src-f8546b8f0d327e5228a0275bec79ebd29536c8d9.tar.gz
Mechanically convert to if_inc_counter().
Diffstat (limited to 'sys/dev/my')
-rw-r--r--sys/dev/my/if_my.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c
index f8df059..e94e9ab 100644
--- a/sys/dev/my/if_my.c
+++ b/sys/dev/my/if_my.c
@@ -1121,7 +1121,7 @@ my_rxeof(struct my_softc * sc)
sc->my_cdata.my_rx_head = cur_rx->my_nextdesc;
if (rxstat & MY_ES) { /* error summary: give up this rx pkt */
- ifp->if_ierrors++;
+ if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
cur_rx->my_ptr->my_status = MY_OWNByNIC;
continue;
}
@@ -1134,7 +1134,7 @@ my_rxeof(struct my_softc * sc)
total_len, 0, ifp, NULL);
cur_rx->my_ptr->my_status = MY_OWNByNIC;
if (m == NULL) {
- ifp->if_ierrors++;
+ if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
continue;
}
} else {
@@ -1147,14 +1147,14 @@ my_rxeof(struct my_softc * sc)
* little else we can do in this situation.
*/
if (my_newbuf(sc, cur_rx) == ENOBUFS) {
- ifp->if_ierrors++;
+ if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
cur_rx->my_ptr->my_status = MY_OWNByNIC;
continue;
}
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = total_len;
}
- ifp->if_ipackets++;
+ if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
eh = mtod(m, struct ether_header *);
#if NBPFILTER > 0
/*
@@ -1212,16 +1212,16 @@ my_txeof(struct my_softc * sc)
break;
if (!(CSR_READ_4(sc, MY_TCRRCR) & MY_Enhanced)) {
if (txstat & MY_TXERR) {
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
if (txstat & MY_EC) /* excessive collision */
- ifp->if_collisions++;
+ if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
if (txstat & MY_LC) /* late collision */
- ifp->if_collisions++;
+ if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
}
- ifp->if_collisions += (txstat & MY_NCRMASK) >>
- MY_NCRShift;
+ if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
+ (txstat & MY_NCRMASK) >> MY_NCRShift);
}
- ifp->if_opackets++;
+ if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
m_freem(cur_tx->my_mbuf);
cur_tx->my_mbuf = NULL;
if (sc->my_cdata.my_tx_head == sc->my_cdata.my_tx_tail) {
@@ -1232,7 +1232,7 @@ my_txeof(struct my_softc * sc)
sc->my_cdata.my_tx_head = cur_tx->my_nextdesc;
}
if (CSR_READ_4(sc, MY_TCRRCR) & MY_Enhanced) {
- ifp->if_collisions += (CSR_READ_4(sc, MY_TSR) & MY_NCRMask);
+ if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (CSR_READ_4(sc, MY_TSR) & MY_NCRMask));
}
return;
}
@@ -1293,7 +1293,7 @@ my_intr(void *arg)
if ((status & MY_RBU) || (status & MY_RxErr)) {
/* rx buffer unavailable or rx error */
- ifp->if_ierrors++;
+ if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
#ifdef foo
my_stop(sc);
my_reset(sc);
@@ -1701,7 +1701,7 @@ my_watchdog(void *arg)
return;
ifp = sc->my_ifp;
- ifp->if_oerrors++;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
if_printf(ifp, "watchdog timeout\n");
if (!(my_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
if_printf(ifp, "no carrier - transceiver cable problem?\n");
OpenPOWER on IntegriCloud