From 8710512c0436815b02c2c2d47be22c997bd02a94 Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Sat, 13 Feb 2010 18:44:10 +0100 Subject: [PATCH] Do not update AMRR statistic in MONITOR mode --- rt2870.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rt2870.c b/rt2870.c index 74b165f..a885836 100644 --- a/rt2870.c +++ b/rt2870.c @@ -1902,7 +1902,7 @@ static int rt2870_vap_newstate(struct ieee80211vap *vap, /* turn link LED on */ - if (ic->ic_opmode != IEEE80211_M_MONITOR) + if (vap->iv_opmode != IEEE80211_M_MONITOR) { rt2870_led_cmd(sc, RT2870_LED_CMD_RADIO_ON | (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan) ? @@ -4643,6 +4643,7 @@ static void rt2870_periodic_task(void *context, int pending) sc = context; ifp = sc->ifp; ic = ifp->if_l2com; + vap = TAILQ_FIRST(&ic->ic_vaps); RT2870_DPRINTF(sc, RT2870_DEBUG_PERIODIC, "%s: periodic task: round=%lu\n", @@ -4665,8 +4666,7 @@ static void rt2870_periodic_task(void *context, int pending) rt2870_watchdog(sc); - vap = TAILQ_FIRST(&ic->ic_vaps); - if (vap != NULL) + if (vap != NULL && vap->iv_opmode != IEEE80211_M_MONITOR && vap->iv_state == IEEE80211_S_RUN) { if (vap->iv_opmode == IEEE80211_M_STA) rt2870_amrr_update_iter_func(vap, vap->iv_bss); -- 2.11.4.GIT