aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/offchannel.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/offchannel.c')
-rw-r--r--net/mac80211/offchannel.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index abb226dc4753..7f93626ddc61 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -25,8 +25,7 @@
25 * because we *may* be doing work on-operating channel, and want our 25 * because we *may* be doing work on-operating channel, and want our
26 * hardware unconditionally awake, but still let the AP send us normal frames. 26 * hardware unconditionally awake, but still let the AP send us normal frames.
27 */ 27 */
28static void ieee80211_offchannel_ps_enable(struct ieee80211_sub_if_data *sdata, 28static void ieee80211_offchannel_ps_enable(struct ieee80211_sub_if_data *sdata)
29 bool tell_ap)
30{ 29{
31 struct ieee80211_local *local = sdata->local; 30 struct ieee80211_local *local = sdata->local;
32 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 31 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
@@ -47,8 +46,8 @@ static void ieee80211_offchannel_ps_enable(struct ieee80211_sub_if_data *sdata,
47 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); 46 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
48 } 47 }
49 48
50 if (tell_ap && (!local->offchannel_ps_enabled || 49 if (!local->offchannel_ps_enabled ||
51 !(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK))) 50 !(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK))
52 /* 51 /*
53 * If power save was enabled, no need to send a nullfunc 52 * If power save was enabled, no need to send a nullfunc
54 * frame because AP knows that we are sleeping. But if the 53 * frame because AP knows that we are sleeping. But if the
@@ -133,7 +132,7 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
133 if (offchannel_ps_enable && 132 if (offchannel_ps_enable &&
134 (sdata->vif.type == NL80211_IFTYPE_STATION) && 133 (sdata->vif.type == NL80211_IFTYPE_STATION) &&
135 sdata->u.mgd.associated) 134 sdata->u.mgd.associated)
136 ieee80211_offchannel_ps_enable(sdata, true); 135 ieee80211_offchannel_ps_enable(sdata);
137 } 136 }
138 } 137 }
139 mutex_unlock(&local->iflist_mtx); 138 mutex_unlock(&local->iflist_mtx);
@@ -263,6 +262,9 @@ void ieee80211_start_next_roc(struct ieee80211_local *local)
263 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, 262 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work,
264 list); 263 list);
265 264
265 if (WARN_ON_ONCE(roc->started))
266 return;
267
266 if (local->ops->remain_on_channel) { 268 if (local->ops->remain_on_channel) {
267 int ret, duration = roc->duration; 269 int ret, duration = roc->duration;
268 270
@@ -378,8 +380,8 @@ void ieee80211_sw_roc_work(struct work_struct *work)
378 380
379 ieee80211_recalc_idle(local); 381 ieee80211_recalc_idle(local);
380 382
381 ieee80211_start_next_roc(local); 383 if (roc->started)
382 ieee80211_run_deferred_scan(local); 384 ieee80211_start_next_roc(local);
383 } 385 }
384 386
385 out_unlock: 387 out_unlock:
@@ -410,9 +412,6 @@ static void ieee80211_hw_roc_done(struct work_struct *work)
410 /* if there's another roc, start it now */ 412 /* if there's another roc, start it now */
411 ieee80211_start_next_roc(local); 413 ieee80211_start_next_roc(local);
412 414
413 /* or scan maybe */
414 ieee80211_run_deferred_scan(local);
415
416 out_unlock: 415 out_unlock:
417 mutex_unlock(&local->mtx); 416 mutex_unlock(&local->mtx);
418} 417}
@@ -455,7 +454,6 @@ void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata)
455 } 454 }
456 455
457 ieee80211_start_next_roc(local); 456 ieee80211_start_next_roc(local);
458 ieee80211_run_deferred_scan(local);
459 mutex_unlock(&local->mtx); 457 mutex_unlock(&local->mtx);
460 458
461 list_for_each_entry_safe(roc, tmp, &tmp_list, list) { 459 list_for_each_entry_safe(roc, tmp, &tmp_list, list) {