Lines Matching refs:local

29 	struct ieee80211_local *local = sdata->local;  in ieee80211_offchannel_ps_enable()  local
32 local->offchannel_ps_enabled = false; in ieee80211_offchannel_ps_enable()
36 del_timer_sync(&local->dynamic_ps_timer); in ieee80211_offchannel_ps_enable()
40 cancel_work_sync(&local->dynamic_ps_enable_work); in ieee80211_offchannel_ps_enable()
42 if (local->hw.conf.flags & IEEE80211_CONF_PS) { in ieee80211_offchannel_ps_enable()
43 local->offchannel_ps_enabled = true; in ieee80211_offchannel_ps_enable()
44 local->hw.conf.flags &= ~IEEE80211_CONF_PS; in ieee80211_offchannel_ps_enable()
45 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); in ieee80211_offchannel_ps_enable()
48 if (!local->offchannel_ps_enabled || in ieee80211_offchannel_ps_enable()
49 !ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK)) in ieee80211_offchannel_ps_enable()
60 ieee80211_send_nullfunc(local, sdata, true); in ieee80211_offchannel_ps_enable()
66 struct ieee80211_local *local = sdata->local; in ieee80211_offchannel_ps_disable() local
68 if (!local->ps_sdata) in ieee80211_offchannel_ps_disable()
69 ieee80211_send_nullfunc(local, sdata, false); in ieee80211_offchannel_ps_disable()
70 else if (local->offchannel_ps_enabled) { in ieee80211_offchannel_ps_disable()
87 local->hw.conf.flags |= IEEE80211_CONF_PS; in ieee80211_offchannel_ps_disable()
88 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); in ieee80211_offchannel_ps_disable()
89 } else if (local->hw.conf.dynamic_ps_timeout > 0) { in ieee80211_offchannel_ps_disable()
96 ieee80211_send_nullfunc(local, sdata, false); in ieee80211_offchannel_ps_disable()
97 mod_timer(&local->dynamic_ps_timer, jiffies + in ieee80211_offchannel_ps_disable()
98 msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout)); in ieee80211_offchannel_ps_disable()
105 void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local) in ieee80211_offchannel_stop_vifs() argument
109 if (WARN_ON(local->use_chanctx)) in ieee80211_offchannel_stop_vifs()
121 ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_offchannel_stop_vifs()
124 ieee80211_flush_queues(local, NULL, false); in ieee80211_offchannel_stop_vifs()
126 mutex_lock(&local->iflist_mtx); in ieee80211_offchannel_stop_vifs()
127 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_offchannel_stop_vifs()
150 mutex_unlock(&local->iflist_mtx); in ieee80211_offchannel_stop_vifs()
153 void ieee80211_offchannel_return(struct ieee80211_local *local) in ieee80211_offchannel_return() argument
157 if (WARN_ON(local->use_chanctx)) in ieee80211_offchannel_return()
160 mutex_lock(&local->iflist_mtx); in ieee80211_offchannel_return()
161 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_offchannel_return()
183 mutex_unlock(&local->iflist_mtx); in ieee80211_offchannel_return()
185 ieee80211_wake_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_offchannel_return()
212 struct ieee80211_local *local = in ieee80211_hw_roc_start() local
216 mutex_lock(&local->mtx); in ieee80211_hw_roc_start()
218 if (list_empty(&local->roc_list)) in ieee80211_hw_roc_start()
221 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in ieee80211_hw_roc_start()
228 roc->hw_start_time = local->hw_roc_start_time; in ieee80211_hw_roc_start()
242 mutex_unlock(&local->mtx); in ieee80211_hw_roc_start()
247 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_ready_on_channel() local
249 local->hw_roc_start_time = jiffies; in ieee80211_ready_on_channel()
251 trace_api_ready_on_channel(local); in ieee80211_ready_on_channel()
253 ieee80211_queue_work(hw, &local->hw_roc_start); in ieee80211_ready_on_channel()
257 void ieee80211_start_next_roc(struct ieee80211_local *local) in ieee80211_start_next_roc() argument
261 lockdep_assert_held(&local->mtx); in ieee80211_start_next_roc()
263 if (list_empty(&local->roc_list)) { in ieee80211_start_next_roc()
264 ieee80211_run_deferred_scan(local); in ieee80211_start_next_roc()
268 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in ieee80211_start_next_roc()
274 if (local->ops->remain_on_channel) { in ieee80211_start_next_roc()
281 ret = drv_remain_on_channel(local, roc->sdata, roc->chan, in ieee80211_start_next_roc()
287 wiphy_warn(local->hw.wiphy, in ieee80211_start_next_roc()
293 ieee80211_remain_on_channel_expired(&local->hw); in ieee80211_start_next_roc()
297 ieee80211_queue_delayed_work(&local->hw, &roc->work, in ieee80211_start_next_roc()
337 struct ieee80211_local *local = sdata->local; in ieee80211_sw_roc_work() local
340 mutex_lock(&local->mtx); in ieee80211_sw_roc_work()
348 if (WARN_ON(list_empty(&local->roc_list))) in ieee80211_sw_roc_work()
351 if (WARN_ON(roc != list_first_entry(&local->roc_list, in ieee80211_sw_roc_work()
359 WARN_ON(local->use_chanctx); in ieee80211_sw_roc_work()
366 roc->on_channel = roc->chan == local->_oper_chandef.chan && in ieee80211_sw_roc_work()
367 local->_oper_chandef.width != NL80211_CHAN_WIDTH_5 && in ieee80211_sw_roc_work()
368 local->_oper_chandef.width != NL80211_CHAN_WIDTH_10; in ieee80211_sw_roc_work()
371 ieee80211_recalc_idle(local); in ieee80211_sw_roc_work()
374 ieee80211_offchannel_stop_vifs(local); in ieee80211_sw_roc_work()
376 local->tmp_channel = roc->chan; in ieee80211_sw_roc_work()
377 ieee80211_hw_config(local, 0); in ieee80211_sw_roc_work()
390 ieee80211_queue_delayed_work(&local->hw, &roc->work, in ieee80211_sw_roc_work()
401 ieee80211_flush_queues(local, NULL, false); in ieee80211_sw_roc_work()
403 local->tmp_channel = NULL; in ieee80211_sw_roc_work()
404 ieee80211_hw_config(local, 0); in ieee80211_sw_roc_work()
406 ieee80211_offchannel_return(local); in ieee80211_sw_roc_work()
409 ieee80211_recalc_idle(local); in ieee80211_sw_roc_work()
412 ieee80211_start_next_roc(local); in ieee80211_sw_roc_work()
413 else if (list_empty(&local->roc_list)) in ieee80211_sw_roc_work()
414 ieee80211_run_deferred_scan(local); in ieee80211_sw_roc_work()
418 mutex_unlock(&local->mtx); in ieee80211_sw_roc_work()
423 struct ieee80211_local *local = in ieee80211_hw_roc_done() local
427 mutex_lock(&local->mtx); in ieee80211_hw_roc_done()
429 if (list_empty(&local->roc_list)) in ieee80211_hw_roc_done()
432 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in ieee80211_hw_roc_done()
443 ieee80211_start_next_roc(local); in ieee80211_hw_roc_done()
446 mutex_unlock(&local->mtx); in ieee80211_hw_roc_done()
451 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_remain_on_channel_expired() local
453 trace_api_remain_on_channel_expired(local); in ieee80211_remain_on_channel_expired()
455 ieee80211_queue_work(hw, &local->hw_roc_done); in ieee80211_remain_on_channel_expired()
459 void ieee80211_roc_setup(struct ieee80211_local *local) in ieee80211_roc_setup() argument
461 INIT_WORK(&local->hw_roc_start, ieee80211_hw_roc_start); in ieee80211_roc_setup()
462 INIT_WORK(&local->hw_roc_done, ieee80211_hw_roc_done); in ieee80211_roc_setup()
463 INIT_LIST_HEAD(&local->roc_list); in ieee80211_roc_setup()
466 void ieee80211_roc_purge(struct ieee80211_local *local, in ieee80211_roc_purge() argument
472 mutex_lock(&local->mtx); in ieee80211_roc_purge()
473 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_roc_purge()
477 if (roc->started && local->ops->remain_on_channel) { in ieee80211_roc_purge()
479 drv_cancel_remain_on_channel(local); in ieee80211_roc_purge()
485 mutex_unlock(&local->mtx); in ieee80211_roc_purge()
488 if (local->ops->remain_on_channel) { in ieee80211_roc_purge()
492 ieee80211_queue_delayed_work(&local->hw, &roc->work, 0); in ieee80211_roc_purge()