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