diff options
author | glebius <glebius@FreeBSD.org> | 2014-09-18 21:11:42 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2014-09-18 21:11:42 +0000 |
commit | a9ce204398e5100f39d3a1ac5c0642c162027120 (patch) | |
tree | 87ae035f3383d99eec5ad9eff3426352ce3d18f9 /sys/dev/alc | |
parent | 4ca46ec7951f4cc68b89e628cff8f8cf635e1583 (diff) | |
download | FreeBSD-src-a9ce204398e5100f39d3a1ac5c0642c162027120.zip FreeBSD-src-a9ce204398e5100f39d3a1ac5c0642c162027120.tar.gz |
Mechanically convert to if_inc_counter().
Diffstat (limited to 'sys/dev/alc')
-rw-r--r-- | sys/dev/alc/if_alc.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c index 3f661fd..ecb3b47 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -2323,13 +2323,13 @@ alc_watchdog(struct alc_softc *sc) ifp = sc->alc_ifp; if ((sc->alc_flags & ALC_FLAG_LINK) == 0) { if_printf(sc->alc_ifp, "watchdog timeout (lost link)\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; alc_init_locked(sc); return; } if_printf(sc->alc_ifp, "watchdog timeout -- resetting\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; alc_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -2608,11 +2608,11 @@ alc_stats_update(struct alc_softc *sc) stat->tx_mcast_bytes += smb->tx_mcast_bytes; /* Update counters in ifnet. */ - ifp->if_opackets += smb->tx_frames; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, smb->tx_frames); - ifp->if_collisions += smb->tx_single_colls + + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, smb->tx_single_colls + smb->tx_multi_colls * 2 + smb->tx_late_colls + - smb->tx_abort * HDPX_CFG_RETRY_DEFAULT; + smb->tx_abort * HDPX_CFG_RETRY_DEFAULT); /* * XXX @@ -2621,15 +2621,16 @@ alc_stats_update(struct alc_softc *sc) * the counter name is not correct one so I've removed the * counter in output errors. */ - ifp->if_oerrors += smb->tx_abort + smb->tx_late_colls + - smb->tx_underrun; + if_inc_counter(ifp, IFCOUNTER_OERRORS, + smb->tx_abort + smb->tx_late_colls + smb->tx_underrun); - ifp->if_ipackets += smb->rx_frames; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, smb->rx_frames); - ifp->if_ierrors += smb->rx_crcerrs + smb->rx_lenerrs + + if_inc_counter(ifp, IFCOUNTER_IERRORS, + smb->rx_crcerrs + smb->rx_lenerrs + smb->rx_runts + smb->rx_pkts_truncated + smb->rx_fifo_oflows + smb->rx_rrs_errs + - smb->rx_alignerrs; + smb->rx_alignerrs); if ((sc->alc_flags & ALC_FLAG_SMB_BUG) == 0) { /* Update done, clear. */ @@ -2921,7 +2922,7 @@ alc_fixup_rx(struct ifnet *ifp, struct mbuf *m) */ MGETHDR(n, M_NOWAIT, MT_DATA); if (n == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); m_freem(m); return (NULL); } @@ -2977,7 +2978,7 @@ alc_rxeof(struct alc_softc *sc, struct rx_rdesc *rrd) mp = rxd->rx_m; /* Add a new receive buffer to the ring. */ if (alc_newbuf(sc, rxd) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); /* Reuse Rx buffers. */ if (sc->alc_cdata.alc_rxhead != NULL) m_freem(sc->alc_cdata.alc_rxhead); |