mac80211: another fix for idle handling in monitor mode
authorFelix Fietkau <nbd@openwrt.org>
Sat, 2 Mar 2013 18:05:47 +0000 (19:05 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Sat, 2 Mar 2013 20:24:42 +0000 (21:24 +0100)
When setting a monitor interface up or down, the idle state needs to be
recalculated, otherwise the hardware will just stay in its previous idle
state.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/iface.c

index 640afab304d7a02e50414a16f3df8e22c6ea4c30..baaa8608e52de8d9d504f14a254bb7e6631b5f2e 100644 (file)
@@ -541,6 +541,9 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
 
                ieee80211_adjust_monitor_flags(sdata, 1);
                ieee80211_configure_filter(local);
+               mutex_lock(&local->mtx);
+               ieee80211_recalc_idle(local);
+               mutex_unlock(&local->mtx);
 
                netif_carrier_on(dev);
                break;
@@ -812,6 +815,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 
                ieee80211_adjust_monitor_flags(sdata, -1);
                ieee80211_configure_filter(local);
+               mutex_lock(&local->mtx);
+               ieee80211_recalc_idle(local);
+               mutex_unlock(&local->mtx);
                break;
        case NL80211_IFTYPE_P2P_DEVICE:
                /* relies on synchronize_rcu() below */