Skip to contentSkip to conversation

mac80211: another fix for idle handling in monitor mode

PATCH Applied Felix Fietkau 2 participants 2 messages Mar 2, 2013 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: another fix for idle handling in monitor mode

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.

---
 net/mac80211/iface.c | 6 ++++++
 1 file changed, 6 insertions(+)
net/mac80211/iface.c +6 -0
index 640afab..baaa860 100644
@@ -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 */
Signature · 1 line
1.8.0.2
maintainer Applied
#1 lore raw
Quoted 3 lines · Felix Fietkau

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.

Applied.

johannes