Lines Matching refs:local
27 struct ieee80211_local *local = sdata->local;
31 /* FIXME: what to do when local->pspolling is true? */
33 del_timer_sync(&local->dynamic_ps_timer);
37 cancel_work_sync(&local->dynamic_ps_enable_work);
39 if (local->hw.conf.flags & IEEE80211_CONF_PS) {
41 local->hw.conf.flags &= ~IEEE80211_CONF_PS;
42 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
46 !ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK))
57 ieee80211_send_nullfunc(local, sdata, true);
63 struct ieee80211_local *local = sdata->local;
65 if (!local->ps_sdata)
66 ieee80211_send_nullfunc(local, sdata, false);
67 else if (local->hw.conf.dynamic_ps_timeout > 0) {
74 ieee80211_send_nullfunc(local, sdata, false);
75 mod_timer(&local->dynamic_ps_timer, jiffies +
76 msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
83 void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local)
87 if (WARN_ON(local->use_chanctx))
99 ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP,
102 ieee80211_flush_queues(local, NULL, false);
104 mutex_lock(&local->iflist_mtx);
105 list_for_each_entry(sdata, &local->interfaces, list) {
129 mutex_unlock(&local->iflist_mtx);
132 void ieee80211_offchannel_return(struct ieee80211_local *local)
136 if (WARN_ON(local->use_chanctx))
139 mutex_lock(&local->iflist_mtx);
140 list_for_each_entry(sdata, &local->interfaces, list) {
162 mutex_unlock(&local->iflist_mtx);
164 ieee80211_wake_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP,
176 ieee80211_free_txskb(&roc->sdata->local->hw, roc->frame);
192 static unsigned long ieee80211_end_finished_rocs(struct ieee80211_local *local,
198 lockdep_assert_held(&local->mtx);
200 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
223 static bool ieee80211_recalc_sw_work(struct ieee80211_local *local,
226 long dur = ieee80211_end_finished_rocs(local, now);
231 mod_delayed_work(local->workqueue, &local->roc_work, dur);
261 struct ieee80211_local *local =
265 mutex_lock(&local->mtx);
267 list_for_each_entry(roc, &local->roc_list, list) {
272 ieee80211_handle_roc_started(roc, local->hw_roc_start_time);
275 mutex_unlock(&local->mtx);
280 struct ieee80211_local *local = hw_to_local(hw);
282 local->hw_roc_start_time = jiffies;
284 trace_api_ready_on_channel(local);
286 ieee80211_queue_work(hw, &local->hw_roc_start);
290 static void _ieee80211_start_next_roc(struct ieee80211_local *local)
296 lockdep_assert_held(&local->mtx);
298 if (WARN_ON(list_empty(&local->roc_list)))
301 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work,
311 list_for_each_entry(tmp, &local->roc_list, list) {
321 if (local->ops->remain_on_channel) {
322 int ret = drv_remain_on_channel(local, roc->sdata, roc->chan,
326 wiphy_warn(local->hw.wiphy,
332 list_for_each_entry(tmp, &local->roc_list, list) {
339 ieee80211_queue_work(&local->hw, &local->hw_roc_done);
344 list_for_each_entry(tmp, &local->roc_list, list) {
355 roc->on_channel = roc->chan == local->_oper_chandef.chan &&
356 local->_oper_chandef.width != NL80211_CHAN_WIDTH_5 &&
357 local->_oper_chandef.width != NL80211_CHAN_WIDTH_10;
360 ieee80211_recalc_idle(local);
363 ieee80211_offchannel_stop_vifs(local);
365 local->tmp_channel = roc->chan;
366 ieee80211_hw_config(local, 0);
369 ieee80211_queue_delayed_work(&local->hw, &local->roc_work,
373 list_for_each_entry(tmp, &local->roc_list, list) {
383 void ieee80211_start_next_roc(struct ieee80211_local *local)
387 lockdep_assert_held(&local->mtx);
389 if (list_empty(&local->roc_list)) {
390 ieee80211_run_deferred_scan(local);
395 if (local->in_reconfig)
398 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work,
404 if (local->ops->remain_on_channel) {
405 _ieee80211_start_next_roc(local);
408 ieee80211_queue_delayed_work(&local->hw, &local->roc_work,
413 static void __ieee80211_roc_work(struct ieee80211_local *local)
418 lockdep_assert_held(&local->mtx);
420 if (WARN_ON(local->ops->remain_on_channel))
423 roc = list_first_entry_or_null(&local->roc_list,
429 WARN_ON(local->use_chanctx);
430 _ieee80211_start_next_roc(local);
433 if (ieee80211_recalc_sw_work(local, jiffies))
439 ieee80211_flush_queues(local, NULL, false);
441 local->tmp_channel = NULL;
442 ieee80211_hw_config(local, 0);
444 ieee80211_offchannel_return(local);
447 ieee80211_recalc_idle(local);
448 ieee80211_start_next_roc(local);
454 struct ieee80211_local *local =
457 mutex_lock(&local->mtx);
458 __ieee80211_roc_work(local);
459 mutex_unlock(&local->mtx);
464 struct ieee80211_local *local =
467 mutex_lock(&local->mtx);
469 ieee80211_end_finished_rocs(local, jiffies);
472 ieee80211_start_next_roc(local);
474 mutex_unlock(&local->mtx);
479 struct ieee80211_local *local = hw_to_local(hw);
481 trace_api_remain_on_channel_expired(local);
483 ieee80211_queue_work(hw, &local->hw_roc_done);
488 ieee80211_coalesce_hw_started_roc(struct ieee80211_local *local,
527 static int ieee80211_start_roc_work(struct ieee80211_local *local,
538 lockdep_assert_held(&local->mtx);
544 if (local->use_chanctx && !local->ops->remain_on_channel)
575 roc->cookie = ieee80211_mgmt_tx_cookie(local);
582 if (list_empty(&local->roc_list) &&
583 !local->scanning && !ieee80211_is_radar_required(local)) {
585 if (!local->ops->remain_on_channel) {
586 list_add_tail(&roc->list, &local->roc_list);
587 ieee80211_queue_delayed_work(&local->hw,
588 &local->roc_work, 0);
593 ret = drv_remain_on_channel(local, sdata, channel,
600 list_add_tail(&roc->list, &local->roc_list);
608 list_for_each_entry(tmp, &local->roc_list, list) {
625 if (!local->ops->remain_on_channel) {
637 struct wiphy *wiphy = local->hw.wiphy;
649 ieee80211_recalc_sw_work(local, now);
653 queued = ieee80211_coalesce_hw_started_roc(local, roc, tmp);
665 list_add_tail(&roc->list, &local->roc_list);
675 struct ieee80211_local *local = sdata->local;
678 mutex_lock(&local->mtx);
679 ret = ieee80211_start_roc_work(local, sdata, chan,
682 mutex_unlock(&local->mtx);
687 static int ieee80211_cancel_roc(struct ieee80211_local *local,
696 flush_work(&local->hw_roc_start);
698 mutex_lock(&local->mtx);
699 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
710 mutex_unlock(&local->mtx);
719 if (local->ops->remain_on_channel) {
720 ret = drv_cancel_remain_on_channel(local, roc->sdata);
722 mutex_unlock(&local->mtx);
731 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
742 ieee80211_start_next_roc(local);
746 mod_delayed_work(local->workqueue, &local->roc_work, 0);
750 mutex_unlock(&local->mtx);
759 struct ieee80211_local *local = sdata->local;
761 return ieee80211_cancel_roc(local, cookie, false);
768 struct ieee80211_local *local = sdata->local;
821 local->ops->remain_on_channel &&
841 mutex_lock(&local->mtx);
869 skb = dev_alloc_skb(local->hw.extra_tx_headroom + params->len);
874 skb_reserve(skb, local->hw.extra_tx_headroom);
912 ret = ieee80211_attach_ack_skb(local, skb, cookie, GFP_KERNEL);
934 if (ieee80211_hw_check(&local->hw, QUEUE_CONTROL))
936 local->hw.offchannel_tx_hw_queue;
939 ret = ieee80211_start_roc_work(local, sdata, params->chan,
943 ieee80211_free_txskb(&local->hw, skb);
945 mutex_unlock(&local->mtx);
952 struct ieee80211_local *local = wiphy_priv(wiphy);
954 return ieee80211_cancel_roc(local, cookie, true);
957 void ieee80211_roc_setup(struct ieee80211_local *local)
959 INIT_WORK(&local->hw_roc_start, ieee80211_hw_roc_start);
960 INIT_WORK(&local->hw_roc_done, ieee80211_hw_roc_done);
961 INIT_DELAYED_WORK(&local->roc_work, ieee80211_roc_work);
962 INIT_LIST_HEAD(&local->roc_list);
965 void ieee80211_roc_purge(struct ieee80211_local *local,
971 mutex_lock(&local->mtx);
972 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
977 if (local->ops->remain_on_channel) {
979 drv_cancel_remain_on_channel(local, sdata);
990 __ieee80211_roc_work(local);
991 mutex_unlock(&local->mtx);