Lines Matching refs:local

27 	struct ieee80211_local *local = sdata->local;  in ieee80211_offchannel_ps_enable()  local
33 del_timer_sync(&local->dynamic_ps_timer); in ieee80211_offchannel_ps_enable()
37 cancel_work_sync(&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 if (WARN_ON(local->use_chanctx)) in ieee80211_offchannel_stop_vifs()
99 ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_offchannel_stop_vifs()
102 ieee80211_flush_queues(local, NULL, false); in ieee80211_offchannel_stop_vifs()
104 mutex_lock(&local->iflist_mtx); in ieee80211_offchannel_stop_vifs()
105 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_offchannel_stop_vifs()
130 mutex_unlock(&local->iflist_mtx); in ieee80211_offchannel_stop_vifs()
133 void ieee80211_offchannel_return(struct ieee80211_local *local) in ieee80211_offchannel_return() argument
137 if (WARN_ON(local->use_chanctx)) in ieee80211_offchannel_return()
140 mutex_lock(&local->iflist_mtx); in ieee80211_offchannel_return()
141 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_offchannel_return()
164 mutex_unlock(&local->iflist_mtx); 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_held(&local->mtx); 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 mutex_lock(&local->mtx); 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()
277 mutex_unlock(&local->mtx); in ieee80211_hw_roc_start()
282 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_ready_on_channel() local
284 local->hw_roc_start_time = jiffies; in ieee80211_ready_on_channel()
286 trace_api_ready_on_channel(local); in ieee80211_ready_on_channel()
288 wiphy_work_queue(hw->wiphy, &local->hw_roc_start); in ieee80211_ready_on_channel()
292 static void _ieee80211_start_next_roc(struct ieee80211_local *local) in _ieee80211_start_next_roc() argument
298 lockdep_assert_held(&local->mtx); in _ieee80211_start_next_roc()
300 if (WARN_ON(list_empty(&local->roc_list))) in _ieee80211_start_next_roc()
303 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in _ieee80211_start_next_roc()
313 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
323 if (local->ops->remain_on_channel) { in _ieee80211_start_next_roc()
324 int ret = drv_remain_on_channel(local, roc->sdata, roc->chan, in _ieee80211_start_next_roc()
328 wiphy_warn(local->hw.wiphy, in _ieee80211_start_next_roc()
334 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
341 wiphy_work_queue(local->hw.wiphy, &local->hw_roc_done); in _ieee80211_start_next_roc()
346 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
357 roc->on_channel = roc->chan == local->_oper_chandef.chan && in _ieee80211_start_next_roc()
358 local->_oper_chandef.width != NL80211_CHAN_WIDTH_5 && in _ieee80211_start_next_roc()
359 local->_oper_chandef.width != NL80211_CHAN_WIDTH_10; in _ieee80211_start_next_roc()
362 ieee80211_recalc_idle(local); in _ieee80211_start_next_roc()
365 ieee80211_offchannel_stop_vifs(local); in _ieee80211_start_next_roc()
367 local->tmp_channel = roc->chan; in _ieee80211_start_next_roc()
368 ieee80211_hw_config(local, 0); in _ieee80211_start_next_roc()
371 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, in _ieee80211_start_next_roc()
375 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
385 void ieee80211_start_next_roc(struct ieee80211_local *local) in ieee80211_start_next_roc() argument
389 lockdep_assert_held(&local->mtx); in ieee80211_start_next_roc()
391 if (list_empty(&local->roc_list)) { in ieee80211_start_next_roc()
392 ieee80211_run_deferred_scan(local); in ieee80211_start_next_roc()
397 if (local->in_reconfig) in ieee80211_start_next_roc()
400 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in ieee80211_start_next_roc()
406 if (local->ops->remain_on_channel) { in ieee80211_start_next_roc()
407 _ieee80211_start_next_roc(local); in ieee80211_start_next_roc()
410 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, in ieee80211_start_next_roc()
415 static void __ieee80211_roc_work(struct ieee80211_local *local) in __ieee80211_roc_work() argument
420 lockdep_assert_held(&local->mtx); in __ieee80211_roc_work()
422 if (WARN_ON(local->ops->remain_on_channel)) in __ieee80211_roc_work()
425 roc = list_first_entry_or_null(&local->roc_list, in __ieee80211_roc_work()
431 WARN_ON(local->use_chanctx); in __ieee80211_roc_work()
432 _ieee80211_start_next_roc(local); in __ieee80211_roc_work()
435 if (ieee80211_recalc_sw_work(local, jiffies)) in __ieee80211_roc_work()
441 ieee80211_flush_queues(local, NULL, false); in __ieee80211_roc_work()
443 local->tmp_channel = NULL; in __ieee80211_roc_work()
444 ieee80211_hw_config(local, 0); in __ieee80211_roc_work()
446 ieee80211_offchannel_return(local); in __ieee80211_roc_work()
449 ieee80211_recalc_idle(local); in __ieee80211_roc_work()
450 ieee80211_start_next_roc(local); in __ieee80211_roc_work()
456 struct ieee80211_local *local = in ieee80211_roc_work() local
459 mutex_lock(&local->mtx); in ieee80211_roc_work()
460 __ieee80211_roc_work(local); in ieee80211_roc_work()
461 mutex_unlock(&local->mtx); in ieee80211_roc_work()
466 struct ieee80211_local *local = in ieee80211_hw_roc_done() local
469 mutex_lock(&local->mtx); in ieee80211_hw_roc_done()
471 ieee80211_end_finished_rocs(local, jiffies); in ieee80211_hw_roc_done()
474 ieee80211_start_next_roc(local); in ieee80211_hw_roc_done()
476 mutex_unlock(&local->mtx); in ieee80211_hw_roc_done()
481 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_remain_on_channel_expired() local
483 trace_api_remain_on_channel_expired(local); in ieee80211_remain_on_channel_expired()
485 wiphy_work_queue(hw->wiphy, &local->hw_roc_done); in ieee80211_remain_on_channel_expired()
490 ieee80211_coalesce_hw_started_roc(struct ieee80211_local *local, in ieee80211_coalesce_hw_started_roc() argument
529 static int ieee80211_start_roc_work(struct ieee80211_local *local, in ieee80211_start_roc_work() argument
540 lockdep_assert_held(&local->mtx); in ieee80211_start_roc_work()
546 if (local->use_chanctx && !local->ops->remain_on_channel) in ieee80211_start_roc_work()
577 roc->cookie = ieee80211_mgmt_tx_cookie(local); in ieee80211_start_roc_work()
584 if (list_empty(&local->roc_list) && in ieee80211_start_roc_work()
585 !local->scanning && !ieee80211_is_radar_required(local)) { in ieee80211_start_roc_work()
587 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
588 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
589 wiphy_delayed_work_queue(local->hw.wiphy, in ieee80211_start_roc_work()
590 &local->roc_work, 0); in ieee80211_start_roc_work()
595 ret = drv_remain_on_channel(local, sdata, channel, in ieee80211_start_roc_work()
602 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
610 list_for_each_entry(tmp, &local->roc_list, list) { in ieee80211_start_roc_work()
627 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
639 struct wiphy *wiphy = local->hw.wiphy; in ieee80211_start_roc_work()
651 ieee80211_recalc_sw_work(local, now); in ieee80211_start_roc_work()
655 queued = ieee80211_coalesce_hw_started_roc(local, roc, tmp); in ieee80211_start_roc_work()
667 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
677 struct ieee80211_local *local = sdata->local; in ieee80211_remain_on_channel() local
680 mutex_lock(&local->mtx); in ieee80211_remain_on_channel()
681 ret = ieee80211_start_roc_work(local, sdata, chan, in ieee80211_remain_on_channel()
684 mutex_unlock(&local->mtx); in ieee80211_remain_on_channel()
689 static int ieee80211_cancel_roc(struct ieee80211_local *local, in ieee80211_cancel_roc() argument
698 wiphy_work_flush(local->hw.wiphy, &local->hw_roc_start); in ieee80211_cancel_roc()
700 mutex_lock(&local->mtx); in ieee80211_cancel_roc()
701 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
712 mutex_unlock(&local->mtx); in ieee80211_cancel_roc()
721 if (local->ops->remain_on_channel) { in ieee80211_cancel_roc()
722 ret = drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_cancel_roc()
724 mutex_unlock(&local->mtx); in ieee80211_cancel_roc()
733 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
744 ieee80211_start_next_roc(local); in ieee80211_cancel_roc()
748 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, 0); in ieee80211_cancel_roc()
752 mutex_unlock(&local->mtx); in ieee80211_cancel_roc()
761 struct ieee80211_local *local = sdata->local; in ieee80211_cancel_remain_on_channel() local
763 return ieee80211_cancel_roc(local, cookie, false); in ieee80211_cancel_remain_on_channel()
770 struct ieee80211_local *local = sdata->local; in ieee80211_mgmt_tx() local
839 local->ops->remain_on_channel && in ieee80211_mgmt_tx()
858 mutex_lock(&local->mtx); in ieee80211_mgmt_tx()
907 skb = dev_alloc_skb(local->hw.extra_tx_headroom + params->len); in ieee80211_mgmt_tx()
912 skb_reserve(skb, local->hw.extra_tx_headroom); in ieee80211_mgmt_tx()
950 ret = ieee80211_attach_ack_skb(local, skb, cookie, GFP_KERNEL); in ieee80211_mgmt_tx()
972 if (ieee80211_hw_check(&local->hw, QUEUE_CONTROL)) in ieee80211_mgmt_tx()
974 local->hw.offchannel_tx_hw_queue; in ieee80211_mgmt_tx()
977 ret = ieee80211_start_roc_work(local, sdata, params->chan, in ieee80211_mgmt_tx()
981 ieee80211_free_txskb(&local->hw, skb); in ieee80211_mgmt_tx()
983 mutex_unlock(&local->mtx); in ieee80211_mgmt_tx()
990 struct ieee80211_local *local = wiphy_priv(wiphy); in ieee80211_mgmt_tx_cancel_wait() local
992 return ieee80211_cancel_roc(local, cookie, true); in ieee80211_mgmt_tx_cancel_wait()
995 void ieee80211_roc_setup(struct ieee80211_local *local) in ieee80211_roc_setup() argument
997 wiphy_work_init(&local->hw_roc_start, ieee80211_hw_roc_start); in ieee80211_roc_setup()
998 wiphy_work_init(&local->hw_roc_done, ieee80211_hw_roc_done); in ieee80211_roc_setup()
999 wiphy_delayed_work_init(&local->roc_work, ieee80211_roc_work); in ieee80211_roc_setup()
1000 INIT_LIST_HEAD(&local->roc_list); in ieee80211_roc_setup()
1003 void ieee80211_roc_purge(struct ieee80211_local *local, in ieee80211_roc_purge() argument
1009 mutex_lock(&local->mtx); in ieee80211_roc_purge()
1010 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_roc_purge()
1015 if (local->ops->remain_on_channel) { in ieee80211_roc_purge()
1017 drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_roc_purge()
1028 __ieee80211_roc_work(local); in ieee80211_roc_purge()
1029 mutex_unlock(&local->mtx); in ieee80211_roc_purge()