• Home
  • Raw
  • Download

Lines Matching full: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()
34 /* FIXME: what to do when local->pspolling is true? */ 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()
151 mutex_unlock(&local->iflist_mtx); in ieee80211_offchannel_stop_vifs()
154 void ieee80211_offchannel_return(struct ieee80211_local *local) in ieee80211_offchannel_return() argument
158 if (WARN_ON(local->use_chanctx)) in ieee80211_offchannel_return()
161 mutex_lock(&local->iflist_mtx); in ieee80211_offchannel_return()
162 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_offchannel_return()
184 mutex_unlock(&local->iflist_mtx); in ieee80211_offchannel_return()
186 ieee80211_wake_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_offchannel_return()
198 ieee80211_free_txskb(&roc->sdata->local->hw, roc->frame); in ieee80211_roc_notify_destroy()
210 static unsigned long ieee80211_end_finished_rocs(struct ieee80211_local *local, in ieee80211_end_finished_rocs() argument
216 lockdep_assert_held(&local->mtx); in ieee80211_end_finished_rocs()
218 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_end_finished_rocs()
241 static bool ieee80211_recalc_sw_work(struct ieee80211_local *local, in ieee80211_recalc_sw_work() argument
244 long dur = ieee80211_end_finished_rocs(local, now); in ieee80211_recalc_sw_work()
249 mod_delayed_work(local->workqueue, &local->roc_work, dur); in ieee80211_recalc_sw_work()
279 struct ieee80211_local *local = in ieee80211_hw_roc_start() local
283 mutex_lock(&local->mtx); in ieee80211_hw_roc_start()
285 list_for_each_entry(roc, &local->roc_list, list) { in ieee80211_hw_roc_start()
290 ieee80211_handle_roc_started(roc, local->hw_roc_start_time); in ieee80211_hw_roc_start()
293 mutex_unlock(&local->mtx); in ieee80211_hw_roc_start()
298 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_ready_on_channel() local
300 local->hw_roc_start_time = jiffies; in ieee80211_ready_on_channel()
302 trace_api_ready_on_channel(local); in ieee80211_ready_on_channel()
304 ieee80211_queue_work(hw, &local->hw_roc_start); in ieee80211_ready_on_channel()
308 static void _ieee80211_start_next_roc(struct ieee80211_local *local) in _ieee80211_start_next_roc() argument
314 lockdep_assert_held(&local->mtx); in _ieee80211_start_next_roc()
316 if (WARN_ON(list_empty(&local->roc_list))) in _ieee80211_start_next_roc()
319 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in _ieee80211_start_next_roc()
329 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
339 if (local->ops->remain_on_channel) { in _ieee80211_start_next_roc()
340 int ret = drv_remain_on_channel(local, roc->sdata, roc->chan, in _ieee80211_start_next_roc()
344 wiphy_warn(local->hw.wiphy, in _ieee80211_start_next_roc()
350 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
357 ieee80211_queue_work(&local->hw, &local->hw_roc_done); in _ieee80211_start_next_roc()
362 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
373 roc->on_channel = roc->chan == local->_oper_chandef.chan && in _ieee80211_start_next_roc()
374 local->_oper_chandef.width != NL80211_CHAN_WIDTH_5 && in _ieee80211_start_next_roc()
375 local->_oper_chandef.width != NL80211_CHAN_WIDTH_10; in _ieee80211_start_next_roc()
378 ieee80211_recalc_idle(local); in _ieee80211_start_next_roc()
381 ieee80211_offchannel_stop_vifs(local); in _ieee80211_start_next_roc()
383 local->tmp_channel = roc->chan; in _ieee80211_start_next_roc()
384 ieee80211_hw_config(local, 0); in _ieee80211_start_next_roc()
387 ieee80211_queue_delayed_work(&local->hw, &local->roc_work, in _ieee80211_start_next_roc()
391 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
401 void ieee80211_start_next_roc(struct ieee80211_local *local) in ieee80211_start_next_roc() argument
405 lockdep_assert_held(&local->mtx); in ieee80211_start_next_roc()
407 if (list_empty(&local->roc_list)) { in ieee80211_start_next_roc()
408 ieee80211_run_deferred_scan(local); in ieee80211_start_next_roc()
413 if (local->in_reconfig) in ieee80211_start_next_roc()
416 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in ieee80211_start_next_roc()
422 if (local->ops->remain_on_channel) { in ieee80211_start_next_roc()
423 _ieee80211_start_next_roc(local); in ieee80211_start_next_roc()
426 ieee80211_queue_delayed_work(&local->hw, &local->roc_work, in ieee80211_start_next_roc()
431 static void __ieee80211_roc_work(struct ieee80211_local *local) in __ieee80211_roc_work() argument
436 lockdep_assert_held(&local->mtx); in __ieee80211_roc_work()
438 if (WARN_ON(local->ops->remain_on_channel)) in __ieee80211_roc_work()
441 roc = list_first_entry_or_null(&local->roc_list, in __ieee80211_roc_work()
447 WARN_ON(local->use_chanctx); in __ieee80211_roc_work()
448 _ieee80211_start_next_roc(local); in __ieee80211_roc_work()
451 if (ieee80211_recalc_sw_work(local, jiffies)) in __ieee80211_roc_work()
457 ieee80211_flush_queues(local, NULL, false); in __ieee80211_roc_work()
459 local->tmp_channel = NULL; in __ieee80211_roc_work()
460 ieee80211_hw_config(local, 0); in __ieee80211_roc_work()
462 ieee80211_offchannel_return(local); in __ieee80211_roc_work()
465 ieee80211_recalc_idle(local); in __ieee80211_roc_work()
466 ieee80211_start_next_roc(local); in __ieee80211_roc_work()
472 struct ieee80211_local *local = in ieee80211_roc_work() local
475 mutex_lock(&local->mtx); in ieee80211_roc_work()
476 __ieee80211_roc_work(local); in ieee80211_roc_work()
477 mutex_unlock(&local->mtx); in ieee80211_roc_work()
482 struct ieee80211_local *local = in ieee80211_hw_roc_done() local
485 mutex_lock(&local->mtx); in ieee80211_hw_roc_done()
487 ieee80211_end_finished_rocs(local, jiffies); in ieee80211_hw_roc_done()
490 ieee80211_start_next_roc(local); in ieee80211_hw_roc_done()
492 mutex_unlock(&local->mtx); in ieee80211_hw_roc_done()
497 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_remain_on_channel_expired() local
499 trace_api_remain_on_channel_expired(local); in ieee80211_remain_on_channel_expired()
501 ieee80211_queue_work(hw, &local->hw_roc_done); in ieee80211_remain_on_channel_expired()
506 ieee80211_coalesce_hw_started_roc(struct ieee80211_local *local, in ieee80211_coalesce_hw_started_roc() argument
545 static int ieee80211_start_roc_work(struct ieee80211_local *local, in ieee80211_start_roc_work() argument
556 lockdep_assert_held(&local->mtx); in ieee80211_start_roc_work()
558 if (local->use_chanctx && !local->ops->remain_on_channel) in ieee80211_start_roc_work()
589 roc->cookie = ieee80211_mgmt_tx_cookie(local); in ieee80211_start_roc_work()
596 if (list_empty(&local->roc_list) && in ieee80211_start_roc_work()
597 !local->scanning && !ieee80211_is_radar_required(local)) { in ieee80211_start_roc_work()
599 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
600 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
601 ieee80211_queue_delayed_work(&local->hw, in ieee80211_start_roc_work()
602 &local->roc_work, 0); in ieee80211_start_roc_work()
607 ret = drv_remain_on_channel(local, sdata, channel, in ieee80211_start_roc_work()
614 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
622 list_for_each_entry(tmp, &local->roc_list, list) { in ieee80211_start_roc_work()
639 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
651 struct wiphy *wiphy = local->hw.wiphy; in ieee80211_start_roc_work()
663 ieee80211_recalc_sw_work(local, now); in ieee80211_start_roc_work()
667 queued = ieee80211_coalesce_hw_started_roc(local, roc, tmp); in ieee80211_start_roc_work()
679 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
689 struct ieee80211_local *local = sdata->local; in ieee80211_remain_on_channel() local
692 mutex_lock(&local->mtx); in ieee80211_remain_on_channel()
693 ret = ieee80211_start_roc_work(local, sdata, chan, in ieee80211_remain_on_channel()
696 mutex_unlock(&local->mtx); in ieee80211_remain_on_channel()
701 static int ieee80211_cancel_roc(struct ieee80211_local *local, in ieee80211_cancel_roc() argument
710 flush_work(&local->hw_roc_start); in ieee80211_cancel_roc()
712 mutex_lock(&local->mtx); in ieee80211_cancel_roc()
713 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
724 mutex_unlock(&local->mtx); in ieee80211_cancel_roc()
733 if (local->ops->remain_on_channel) { in ieee80211_cancel_roc()
734 ret = drv_cancel_remain_on_channel(local); in ieee80211_cancel_roc()
736 mutex_unlock(&local->mtx); in ieee80211_cancel_roc()
745 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
756 ieee80211_start_next_roc(local); in ieee80211_cancel_roc()
760 mod_delayed_work(local->workqueue, &local->roc_work, 0); in ieee80211_cancel_roc()
764 mutex_unlock(&local->mtx); in ieee80211_cancel_roc()
773 struct ieee80211_local *local = sdata->local; in ieee80211_cancel_remain_on_channel() local
775 return ieee80211_cancel_roc(local, cookie, false); in ieee80211_cancel_remain_on_channel()
782 struct ieee80211_local *local = sdata->local; in ieee80211_mgmt_tx() local
835 local->ops->remain_on_channel && in ieee80211_mgmt_tx()
855 mutex_lock(&local->mtx); in ieee80211_mgmt_tx()
883 skb = dev_alloc_skb(local->hw.extra_tx_headroom + params->len); in ieee80211_mgmt_tx()
888 skb_reserve(skb, local->hw.extra_tx_headroom); in ieee80211_mgmt_tx()
926 ret = ieee80211_attach_ack_skb(local, skb, cookie, GFP_KERNEL); in ieee80211_mgmt_tx()
948 if (ieee80211_hw_check(&local->hw, QUEUE_CONTROL)) in ieee80211_mgmt_tx()
950 local->hw.offchannel_tx_hw_queue; in ieee80211_mgmt_tx()
953 ret = ieee80211_start_roc_work(local, sdata, params->chan, in ieee80211_mgmt_tx()
957 ieee80211_free_txskb(&local->hw, skb); in ieee80211_mgmt_tx()
959 mutex_unlock(&local->mtx); in ieee80211_mgmt_tx()
966 struct ieee80211_local *local = wiphy_priv(wiphy); in ieee80211_mgmt_tx_cancel_wait() local
968 return ieee80211_cancel_roc(local, cookie, true); in ieee80211_mgmt_tx_cancel_wait()
971 void ieee80211_roc_setup(struct ieee80211_local *local) in ieee80211_roc_setup() argument
973 INIT_WORK(&local->hw_roc_start, ieee80211_hw_roc_start); in ieee80211_roc_setup()
974 INIT_WORK(&local->hw_roc_done, ieee80211_hw_roc_done); in ieee80211_roc_setup()
975 INIT_DELAYED_WORK(&local->roc_work, ieee80211_roc_work); in ieee80211_roc_setup()
976 INIT_LIST_HEAD(&local->roc_list); in ieee80211_roc_setup()
979 void ieee80211_roc_purge(struct ieee80211_local *local, in ieee80211_roc_purge() argument
985 mutex_lock(&local->mtx); in ieee80211_roc_purge()
986 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_roc_purge()
991 if (local->ops->remain_on_channel) { in ieee80211_roc_purge()
993 drv_cancel_remain_on_channel(local); in ieee80211_roc_purge()
1004 __ieee80211_roc_work(local); in ieee80211_roc_purge()
1005 mutex_unlock(&local->mtx); in ieee80211_roc_purge()