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->use_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->use_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()
355 roc->on_channel = roc->chan == local->_oper_chandef.chan && in _ieee80211_start_next_roc()
356 local->_oper_chandef.width != NL80211_CHAN_WIDTH_5 && in _ieee80211_start_next_roc()
357 local->_oper_chandef.width != NL80211_CHAN_WIDTH_10; in _ieee80211_start_next_roc()
360 ieee80211_recalc_idle(local); in _ieee80211_start_next_roc()
363 ieee80211_offchannel_stop_vifs(local); in _ieee80211_start_next_roc()
365 local->tmp_channel = roc->chan; in _ieee80211_start_next_roc()
366 ieee80211_hw_config(local, 0); in _ieee80211_start_next_roc()
369 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, in _ieee80211_start_next_roc()
373 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
383 void ieee80211_start_next_roc(struct ieee80211_local *local) in ieee80211_start_next_roc() argument
387 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_start_next_roc()
389 if (list_empty(&local->roc_list)) { in ieee80211_start_next_roc()
390 ieee80211_run_deferred_scan(local); in ieee80211_start_next_roc()
395 if (local->in_reconfig) in ieee80211_start_next_roc()
398 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in ieee80211_start_next_roc()
404 if (local->ops->remain_on_channel) { in ieee80211_start_next_roc()
405 _ieee80211_start_next_roc(local); in ieee80211_start_next_roc()
408 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, in ieee80211_start_next_roc()
413 static void __ieee80211_roc_work(struct ieee80211_local *local) in __ieee80211_roc_work() argument
418 lockdep_assert_wiphy(local->hw.wiphy); in __ieee80211_roc_work()
420 if (WARN_ON(local->ops->remain_on_channel)) in __ieee80211_roc_work()
423 roc = list_first_entry_or_null(&local->roc_list, in __ieee80211_roc_work()
429 WARN_ON(local->use_chanctx); in __ieee80211_roc_work()
430 _ieee80211_start_next_roc(local); in __ieee80211_roc_work()
433 if (ieee80211_recalc_sw_work(local, jiffies)) in __ieee80211_roc_work()
439 ieee80211_flush_queues(local, NULL, false); in __ieee80211_roc_work()
441 local->tmp_channel = NULL; in __ieee80211_roc_work()
442 ieee80211_hw_config(local, 0); in __ieee80211_roc_work()
444 ieee80211_offchannel_return(local); in __ieee80211_roc_work()
447 ieee80211_recalc_idle(local); in __ieee80211_roc_work()
448 ieee80211_start_next_roc(local); in __ieee80211_roc_work()
454 struct ieee80211_local *local = in ieee80211_roc_work() local
457 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_roc_work()
459 __ieee80211_roc_work(local); in ieee80211_roc_work()
464 struct ieee80211_local *local = in ieee80211_hw_roc_done() local
467 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_hw_roc_done()
469 ieee80211_end_finished_rocs(local, jiffies); in ieee80211_hw_roc_done()
472 ieee80211_start_next_roc(local); in ieee80211_hw_roc_done()
477 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_remain_on_channel_expired() local
479 trace_api_remain_on_channel_expired(local); in ieee80211_remain_on_channel_expired()
481 wiphy_work_queue(hw->wiphy, &local->hw_roc_done); in ieee80211_remain_on_channel_expired()
486 ieee80211_coalesce_hw_started_roc(struct ieee80211_local *local, in ieee80211_coalesce_hw_started_roc() argument
525 static int ieee80211_start_roc_work(struct ieee80211_local *local, in ieee80211_start_roc_work() argument
536 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_start_roc_work()
542 if (local->use_chanctx && !local->ops->remain_on_channel) in ieee80211_start_roc_work()
573 roc->cookie = ieee80211_mgmt_tx_cookie(local); in ieee80211_start_roc_work()
580 if (list_empty(&local->roc_list) && in ieee80211_start_roc_work()
581 !local->scanning && !ieee80211_is_radar_required(local)) { in ieee80211_start_roc_work()
583 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
584 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
585 wiphy_delayed_work_queue(local->hw.wiphy, in ieee80211_start_roc_work()
586 &local->roc_work, 0); in ieee80211_start_roc_work()
591 ret = drv_remain_on_channel(local, sdata, channel, in ieee80211_start_roc_work()
598 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
606 list_for_each_entry(tmp, &local->roc_list, list) { in ieee80211_start_roc_work()
623 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
635 struct wiphy *wiphy = local->hw.wiphy; in ieee80211_start_roc_work()
647 ieee80211_recalc_sw_work(local, now); in ieee80211_start_roc_work()
651 queued = ieee80211_coalesce_hw_started_roc(local, roc, tmp); in ieee80211_start_roc_work()
663 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
673 struct ieee80211_local *local = sdata->local; in ieee80211_remain_on_channel() local
675 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_remain_on_channel()
677 return ieee80211_start_roc_work(local, sdata, chan, in ieee80211_remain_on_channel()
682 static int ieee80211_cancel_roc(struct ieee80211_local *local, in ieee80211_cancel_roc() argument
688 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_cancel_roc()
693 wiphy_work_flush(local->hw.wiphy, &local->hw_roc_start); in ieee80211_cancel_roc()
695 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
714 if (local->ops->remain_on_channel) { in ieee80211_cancel_roc()
715 ret = drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_cancel_roc()
735 wiphy_work_cancel(local->hw.wiphy, &local->hw_roc_done); in ieee80211_cancel_roc()
742 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
753 ieee80211_start_next_roc(local); in ieee80211_cancel_roc()
757 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, 0); in ieee80211_cancel_roc()
769 struct ieee80211_local *local = sdata->local; in ieee80211_cancel_remain_on_channel() local
771 return ieee80211_cancel_roc(local, cookie, false); in ieee80211_cancel_remain_on_channel()
778 struct ieee80211_local *local = sdata->local; in ieee80211_mgmt_tx() local
789 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_mgmt_tx()
848 local->ops->remain_on_channel && in ieee80211_mgmt_tx()
918 skb = dev_alloc_skb(local->hw.extra_tx_headroom + params->len); in ieee80211_mgmt_tx()
923 skb_reserve(skb, local->hw.extra_tx_headroom); in ieee80211_mgmt_tx()
961 ret = ieee80211_attach_ack_skb(local, skb, cookie, GFP_KERNEL); in ieee80211_mgmt_tx()
983 if (ieee80211_hw_check(&local->hw, QUEUE_CONTROL)) in ieee80211_mgmt_tx()
985 local->hw.offchannel_tx_hw_queue; in ieee80211_mgmt_tx()
988 ret = ieee80211_start_roc_work(local, sdata, params->chan, in ieee80211_mgmt_tx()
992 ieee80211_free_txskb(&local->hw, skb); in ieee80211_mgmt_tx()
1000 struct ieee80211_local *local = wiphy_priv(wiphy); in ieee80211_mgmt_tx_cancel_wait() local
1002 return ieee80211_cancel_roc(local, cookie, true); in ieee80211_mgmt_tx_cancel_wait()
1005 void ieee80211_roc_setup(struct ieee80211_local *local) in ieee80211_roc_setup() argument
1007 wiphy_work_init(&local->hw_roc_start, ieee80211_hw_roc_start); in ieee80211_roc_setup()
1008 wiphy_work_init(&local->hw_roc_done, ieee80211_hw_roc_done); in ieee80211_roc_setup()
1009 wiphy_delayed_work_init(&local->roc_work, ieee80211_roc_work); in ieee80211_roc_setup()
1010 INIT_LIST_HEAD(&local->roc_list); in ieee80211_roc_setup()
1013 void ieee80211_roc_purge(struct ieee80211_local *local, in ieee80211_roc_purge() argument
1019 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_roc_purge()
1021 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_roc_purge()
1026 if (local->ops->remain_on_channel) { in ieee80211_roc_purge()
1028 drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_roc_purge()
1039 __ieee80211_roc_work(local); in ieee80211_roc_purge()