Author: glebius
Date: Thu Sep 18 20:47:39 2014
New Revision: 271823
URL: http://svnweb.freebsd.org/changeset/base/271823

Log:
  Mechanically convert to if_inc_counter().

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_rx.c
  head/sys/dev/ath/if_ath_tx.c

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c   Thu Sep 18 20:44:53 2014        (r271822)
+++ head/sys/dev/ath/if_ath.c   Thu Sep 18 20:47:39 2014        (r271823)
@@ -3192,7 +3192,7 @@ ath_transmit(struct ifnet *ifp, struct m
                DPRINTF(sc, ATH_DEBUG_XMIT,
                    "%s: out of txfrag buffers\n", __func__);
                sc->sc_stats.ast_tx_nofrag++;
-               ifp->if_oerrors++;
+               if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
                ath_freetx(m);
                goto bad;
        }
@@ -3240,7 +3240,7 @@ ath_transmit(struct ifnet *ifp, struct m
         *
         * XXX should use atomics?
         */
-       ifp->if_opackets++;
+       if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
 nextfrag:
        /*
         * Pass the frame to the h/w for transmission.
@@ -3260,7 +3260,7 @@ nextfrag:
        next = m->m_nextpkt;
        if (ath_tx_start(sc, ni, bf, m)) {
 bad:
-               ifp->if_oerrors++;
+               if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
 reclaim:
                bf->bf_m = NULL;
                bf->bf_node = NULL;
@@ -6346,7 +6346,7 @@ ath_watchdog(void *arg)
                } else
                        if_printf(ifp, "device timeout\n");
                do_reset = 1;
-               ifp->if_oerrors++;
+               if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
                sc->sc_stats.ast_watchdog++;
 
                ATH_LOCK(sc);
@@ -6530,8 +6530,10 @@ ath_ioctl(struct ifnet *ifp, u_long cmd,
                break;
        case SIOCGATHSTATS:
                /* NB: embed these numbers to get a consistent view */
-               sc->sc_stats.ast_tx_packets = ifp->if_opackets;
-               sc->sc_stats.ast_rx_packets = ifp->if_ipackets;
+               sc->sc_stats.ast_tx_packets = ifp->if_get_counter(ifp,
+                   IFCOUNTER_OPACKETS);
+               sc->sc_stats.ast_rx_packets = ifp->if_get_counter(ifp,
+                   IFCOUNTER_IPACKETS);
                sc->sc_stats.ast_tx_rssi = 
ATH_RSSI(sc->sc_halstats.ns_avgtxrssi);
                sc->sc_stats.ast_rx_rssi = ATH_RSSI(sc->sc_halstats.ns_avgrssi);
 #ifdef IEEE80211_SUPPORT_TDMA

Modified: head/sys/dev/ath/if_ath_rx.c
==============================================================================
--- head/sys/dev/ath/if_ath_rx.c        Thu Sep 18 20:44:53 2014        
(r271822)
+++ head/sys/dev/ath/if_ath_rx.c        Thu Sep 18 20:47:39 2014        
(r271823)
@@ -704,7 +704,7 @@ ath_rx_pkt(struct ath_softc *sc, struct 
                                        rs->rs_keyix-32 : rs->rs_keyix);
                        }
                }
-               ifp->if_ierrors++;
+               if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
 rx_error:
                /*
                 * Cleanup any pending partial frame.
@@ -830,7 +830,7 @@ rx_accept:
                        rs->rs_antenna |= 0x4;
        }
 
-       ifp->if_ipackets++;
+       if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
        sc->sc_stats.ast_ant_rx[rs->rs_antenna]++;
 
        /*

Modified: head/sys/dev/ath/if_ath_tx.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx.c        Thu Sep 18 20:44:53 2014        
(r271822)
+++ head/sys/dev/ath/if_ath_tx.c        Thu Sep 18 20:47:39 2014        
(r271823)
@@ -2424,7 +2424,7 @@ ath_raw_xmit(struct ieee80211_node *ni, 
                }
        }
        sc->sc_wd_timer = 5;
-       ifp->if_opackets++;
+       if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
        sc->sc_stats.ast_tx_raw++;
 
        /*
@@ -2473,7 +2473,7 @@ bad:
 badbad:
        ATH_KTR(sc, ATH_KTR_TX, 2, "ath_raw_xmit: bad0: m=%p, params=%p",
            m, params);
-       ifp->if_oerrors++;
+       if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
        sc->sc_stats.ast_tx_raw_fail++;
        ieee80211_free_node(ni);
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to