Lines Matching full:local

27 	struct ieee80211_local *local = sdata->local;  in ieee80211_offchannel_ps_enable()  local
31 /* FIXME: what to do when local->pspolling is true? */ in ieee80211_offchannel_ps_enable()
33 del_timer_sync(&local->dynamic_ps_timer); in ieee80211_offchannel_ps_enable()
37 wiphy_work_cancel(local->hw.wiphy, &local->dynamic_ps_enable_work); in ieee80211_offchannel_ps_enable()
39 if (local->hw.conf.flags & IEEE80211_CONF_PS) { in ieee80211_offchannel_ps_enable()
41 local->hw.conf.flags &= ~IEEE80211_CONF_PS; in ieee80211_offchannel_ps_enable()
42 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); in ieee80211_offchannel_ps_enable()
46 !ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK)) in ieee80211_offchannel_ps_enable()
57 ieee80211_send_nullfunc(local, sdata, true); in ieee80211_offchannel_ps_enable()
63 struct ieee80211_local *local = sdata->local; in ieee80211_offchannel_ps_disable() local
65 if (!local->ps_sdata) in ieee80211_offchannel_ps_disable()
66 ieee80211_send_nullfunc(local, sdata, false); in ieee80211_offchannel_ps_disable()
67 else if (local->hw.conf.dynamic_ps_timeout > 0) { in ieee80211_offchannel_ps_disable()
74 ieee80211_send_nullfunc(local, sdata, false); in ieee80211_offchannel_ps_disable()
75 mod_timer(&local->dynamic_ps_timer, jiffies + in ieee80211_offchannel_ps_disable()
76 msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout)); in ieee80211_offchannel_ps_disable()
83 void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local) in ieee80211_offchannel_stop_vifs() argument
87 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_offchannel_stop_vifs()
89 if (WARN_ON(!local->emulate_chanctx)) in ieee80211_offchannel_stop_vifs()
101 ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_offchannel_stop_vifs()
104 ieee80211_flush_queues(local, NULL, false); in ieee80211_offchannel_stop_vifs()
106 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_offchannel_stop_vifs()
133 void ieee80211_offchannel_return(struct ieee80211_local *local) in ieee80211_offchannel_return() argument
137 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_offchannel_return()
139 if (WARN_ON(!local->emulate_chanctx)) in ieee80211_offchannel_return()
142 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_offchannel_return()
166 ieee80211_wake_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_offchannel_return()
178 ieee80211_free_txskb(&roc->sdata->local->hw, roc->frame); in ieee80211_roc_notify_destroy()
194 static unsigned long ieee80211_end_finished_rocs(struct ieee80211_local *local, in ieee80211_end_finished_rocs() argument
200 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_end_finished_rocs()
202 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_end_finished_rocs()
225 static bool ieee80211_recalc_sw_work(struct ieee80211_local *local, in ieee80211_recalc_sw_work() argument
228 long dur = ieee80211_end_finished_rocs(local, now); in ieee80211_recalc_sw_work()
233 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, dur); in ieee80211_recalc_sw_work()
263 struct ieee80211_local *local = in ieee80211_hw_roc_start() local
267 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_hw_roc_start()
269 list_for_each_entry(roc, &local->roc_list, list) { in ieee80211_hw_roc_start()
274 ieee80211_handle_roc_started(roc, local->hw_roc_start_time); in ieee80211_hw_roc_start()
280 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_ready_on_channel() local
282 local->hw_roc_start_time = jiffies; in ieee80211_ready_on_channel()
284 trace_api_ready_on_channel(local); in ieee80211_ready_on_channel()
286 wiphy_work_queue(hw->wiphy, &local->hw_roc_start); in ieee80211_ready_on_channel()
290 static void _ieee80211_start_next_roc(struct ieee80211_local *local) in _ieee80211_start_next_roc() argument
296 lockdep_assert_wiphy(local->hw.wiphy); in _ieee80211_start_next_roc()
298 if (WARN_ON(list_empty(&local->roc_list))) in _ieee80211_start_next_roc()
301 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in _ieee80211_start_next_roc()
311 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
321 if (local->ops->remain_on_channel) { in _ieee80211_start_next_roc()
322 int ret = drv_remain_on_channel(local, roc->sdata, roc->chan, in _ieee80211_start_next_roc()
326 wiphy_warn(local->hw.wiphy, in _ieee80211_start_next_roc()
332 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
339 wiphy_work_queue(local->hw.wiphy, &local->hw_roc_done); in _ieee80211_start_next_roc()
344 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
358 roc->on_channel = roc->chan == local->hw.conf.chandef.chan && in _ieee80211_start_next_roc()
359 local->hw.conf.chandef.width != NL80211_CHAN_WIDTH_5 && in _ieee80211_start_next_roc()
360 local->hw.conf.chandef.width != NL80211_CHAN_WIDTH_10; in _ieee80211_start_next_roc()
363 ieee80211_recalc_idle(local); in _ieee80211_start_next_roc()
366 ieee80211_offchannel_stop_vifs(local); in _ieee80211_start_next_roc()
368 local->tmp_channel = roc->chan; in _ieee80211_start_next_roc()
369 ieee80211_hw_conf_chan(local); in _ieee80211_start_next_roc()
372 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, in _ieee80211_start_next_roc()
376 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
386 void ieee80211_start_next_roc(struct ieee80211_local *local) in ieee80211_start_next_roc() argument
390 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_start_next_roc()
392 if (list_empty(&local->roc_list)) { in ieee80211_start_next_roc()
393 ieee80211_run_deferred_scan(local); in ieee80211_start_next_roc()
398 if (local->in_reconfig) in ieee80211_start_next_roc()
401 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in ieee80211_start_next_roc()
407 if (local->ops->remain_on_channel) { in ieee80211_start_next_roc()
408 _ieee80211_start_next_roc(local); in ieee80211_start_next_roc()
411 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, in ieee80211_start_next_roc()
416 void ieee80211_reconfig_roc(struct ieee80211_local *local) in ieee80211_reconfig_roc() argument
425 if (!local->ops->remain_on_channel) in ieee80211_reconfig_roc()
429 wiphy_work_flush(local->hw.wiphy, &local->hw_roc_start); in ieee80211_reconfig_roc()
430 wiphy_work_flush(local->hw.wiphy, &local->hw_roc_done); in ieee80211_reconfig_roc()
432 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_reconfig_roc()
446 ieee80211_start_next_roc(local); in ieee80211_reconfig_roc()
449 static void __ieee80211_roc_work(struct ieee80211_local *local) in __ieee80211_roc_work() argument
454 lockdep_assert_wiphy(local->hw.wiphy); in __ieee80211_roc_work()
456 if (WARN_ON(local->ops->remain_on_channel)) in __ieee80211_roc_work()
459 roc = list_first_entry_or_null(&local->roc_list, in __ieee80211_roc_work()
465 WARN_ON(!local->emulate_chanctx); in __ieee80211_roc_work()
466 _ieee80211_start_next_roc(local); in __ieee80211_roc_work()
469 if (ieee80211_recalc_sw_work(local, jiffies)) in __ieee80211_roc_work()
475 ieee80211_flush_queues(local, NULL, false); in __ieee80211_roc_work()
477 local->tmp_channel = NULL; in __ieee80211_roc_work()
478 ieee80211_hw_conf_chan(local); in __ieee80211_roc_work()
480 ieee80211_offchannel_return(local); in __ieee80211_roc_work()
483 ieee80211_recalc_idle(local); in __ieee80211_roc_work()
484 ieee80211_start_next_roc(local); in __ieee80211_roc_work()
490 struct ieee80211_local *local = in ieee80211_roc_work() local
493 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_roc_work()
495 __ieee80211_roc_work(local); in ieee80211_roc_work()
500 struct ieee80211_local *local = in ieee80211_hw_roc_done() local
503 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_hw_roc_done()
505 ieee80211_end_finished_rocs(local, jiffies); in ieee80211_hw_roc_done()
508 ieee80211_start_next_roc(local); in ieee80211_hw_roc_done()
513 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_remain_on_channel_expired() local
515 trace_api_remain_on_channel_expired(local); in ieee80211_remain_on_channel_expired()
517 wiphy_work_queue(hw->wiphy, &local->hw_roc_done); in ieee80211_remain_on_channel_expired()
522 ieee80211_coalesce_hw_started_roc(struct ieee80211_local *local, in ieee80211_coalesce_hw_started_roc() argument
561 static int ieee80211_start_roc_work(struct ieee80211_local *local, in ieee80211_start_roc_work() argument
572 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_start_roc_work()
578 if (!local->emulate_chanctx && !local->ops->remain_on_channel) in ieee80211_start_roc_work()
609 roc->cookie = ieee80211_mgmt_tx_cookie(local); in ieee80211_start_roc_work()
616 if (list_empty(&local->roc_list) && in ieee80211_start_roc_work()
617 !local->scanning && !ieee80211_is_radar_required(local)) { in ieee80211_start_roc_work()
619 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
620 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
621 wiphy_delayed_work_queue(local->hw.wiphy, in ieee80211_start_roc_work()
622 &local->roc_work, 0); in ieee80211_start_roc_work()
627 ret = drv_remain_on_channel(local, sdata, channel, in ieee80211_start_roc_work()
634 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
642 list_for_each_entry(tmp, &local->roc_list, list) { in ieee80211_start_roc_work()
659 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
671 struct wiphy *wiphy = local->hw.wiphy; in ieee80211_start_roc_work()
683 ieee80211_recalc_sw_work(local, now); in ieee80211_start_roc_work()
687 queued = ieee80211_coalesce_hw_started_roc(local, roc, tmp); in ieee80211_start_roc_work()
699 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
709 struct ieee80211_local *local = sdata->local; in ieee80211_remain_on_channel() local
711 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_remain_on_channel()
713 return ieee80211_start_roc_work(local, sdata, chan, in ieee80211_remain_on_channel()
718 static int ieee80211_cancel_roc(struct ieee80211_local *local, in ieee80211_cancel_roc() argument
724 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_cancel_roc()
729 wiphy_work_flush(local->hw.wiphy, &local->hw_roc_start); in ieee80211_cancel_roc()
731 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
750 if (local->ops->remain_on_channel) { in ieee80211_cancel_roc()
751 ret = drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_cancel_roc()
771 wiphy_work_cancel(local->hw.wiphy, &local->hw_roc_done); in ieee80211_cancel_roc()
778 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
789 ieee80211_start_next_roc(local); in ieee80211_cancel_roc()
793 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, 0); in ieee80211_cancel_roc()
805 struct ieee80211_local *local = sdata->local; in ieee80211_cancel_remain_on_channel() local
807 return ieee80211_cancel_roc(local, cookie, false); in ieee80211_cancel_remain_on_channel()
814 struct ieee80211_local *local = sdata->local; in ieee80211_mgmt_tx() local
825 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_mgmt_tx()
884 local->ops->remain_on_channel && in ieee80211_mgmt_tx()
964 skb = dev_alloc_skb(local->hw.extra_tx_headroom + params->len); in ieee80211_mgmt_tx()
969 skb_reserve(skb, local->hw.extra_tx_headroom); in ieee80211_mgmt_tx()
1008 ret = ieee80211_attach_ack_skb(local, skb, cookie, GFP_KERNEL); in ieee80211_mgmt_tx()
1030 if (ieee80211_hw_check(&local->hw, QUEUE_CONTROL)) in ieee80211_mgmt_tx()
1032 local->hw.offchannel_tx_hw_queue; in ieee80211_mgmt_tx()
1035 ret = ieee80211_start_roc_work(local, sdata, params->chan, in ieee80211_mgmt_tx()
1039 ieee80211_free_txskb(&local->hw, skb); in ieee80211_mgmt_tx()
1047 struct ieee80211_local *local = wiphy_priv(wiphy); in ieee80211_mgmt_tx_cancel_wait() local
1049 return ieee80211_cancel_roc(local, cookie, true); in ieee80211_mgmt_tx_cancel_wait()
1052 void ieee80211_roc_setup(struct ieee80211_local *local) in ieee80211_roc_setup() argument
1054 wiphy_work_init(&local->hw_roc_start, ieee80211_hw_roc_start); in ieee80211_roc_setup()
1055 wiphy_work_init(&local->hw_roc_done, ieee80211_hw_roc_done); in ieee80211_roc_setup()
1056 wiphy_delayed_work_init(&local->roc_work, ieee80211_roc_work); in ieee80211_roc_setup()
1057 INIT_LIST_HEAD(&local->roc_list); in ieee80211_roc_setup()
1060 void ieee80211_roc_purge(struct ieee80211_local *local, in ieee80211_roc_purge() argument
1066 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_roc_purge()
1068 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_roc_purge()
1073 if (local->ops->remain_on_channel) { in ieee80211_roc_purge()
1075 drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_roc_purge()
1086 __ieee80211_roc_work(local); in ieee80211_roc_purge()