From 330cae0c97c8bd7ad8eb0e0ef4caadb8f2befb86 Mon Sep 17 00:00:00 2001 From: glebius Date: Thu, 18 Sep 2014 20:24:47 +0000 Subject: Mechanically convert to if_inc_counter(). --- sys/dev/pcn/if_pcn.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'sys/dev/pcn') diff --git a/sys/dev/pcn/if_pcn.c b/sys/dev/pcn/if_pcn.c index cd04b38..d3121a1 100644 --- a/sys/dev/pcn/if_pcn.c +++ b/sys/dev/pcn/if_pcn.c @@ -856,7 +856,7 @@ pcn_rxeof(sc) * comes up in the ring. */ if (cur_rx->pcn_rxstat & PCN_RXSTAT_ERR) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); pcn_newbuf(sc, i, m); PCN_INC(i, PCN_RX_LIST_CNT); continue; @@ -865,7 +865,7 @@ pcn_rxeof(sc) if (pcn_newbuf(sc, i, NULL)) { /* Ran out of mbufs; recycle this one. */ pcn_newbuf(sc, i, m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); PCN_INC(i, PCN_RX_LIST_CNT); continue; } @@ -873,7 +873,7 @@ pcn_rxeof(sc) PCN_INC(i, PCN_RX_LIST_CNT); /* No errors; receive the packet. */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_len = m->m_pkthdr.len = cur_rx->pcn_rxlen - ETHER_CRC_LEN; m->m_pkthdr.rcvif = ifp; @@ -921,17 +921,17 @@ pcn_txeof(sc) } if (cur_tx->pcn_txctl & PCN_TXCTL_ERR) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (cur_tx->pcn_txstat & PCN_TXSTAT_EXDEF) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); if (cur_tx->pcn_txstat & PCN_TXSTAT_RTRY) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); } - ifp->if_collisions += - cur_tx->pcn_txstat & PCN_TXSTAT_TRC; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + cur_tx->pcn_txstat & PCN_TXSTAT_TRC); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (sc->pcn_cdata.pcn_tx_chain[idx] != NULL) { m_freem(sc->pcn_cdata.pcn_tx_chain[idx]); sc->pcn_cdata.pcn_tx_chain[idx] = NULL; @@ -1436,7 +1436,7 @@ pcn_watchdog(struct pcn_softc *sc) PCN_LOCK_ASSERT(sc); ifp = sc->pcn_ifp; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if_printf(ifp, "watchdog timeout\n"); pcn_stop(sc); -- cgit v1.1