Lines Matching +full:re +full:- +full:started
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Off-channel operation helpers
8 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
11 * Copyright (C) 2019, 2022-2024 Intel Corporation
16 #include "driver-ops.h"
21 * the frames while we are doing off-channel work. This is optional
22 * because we *may* be doing work on-operating channel, and want our
27 struct ieee80211_local *local = sdata->local; in ieee80211_offchannel_ps_enable()
28 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; in ieee80211_offchannel_ps_enable()
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()
34 del_timer_sync(&ifmgd->bcn_mon_timer); in ieee80211_offchannel_ps_enable()
35 del_timer_sync(&ifmgd->conn_mon_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()
46 !ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK)) in ieee80211_offchannel_ps_enable()
63 struct ieee80211_local *local = sdata->local; in ieee80211_offchannel_ps_disable()
65 if (!local->ps_sdata) in ieee80211_offchannel_ps_disable()
67 else if (local->hw.conf.dynamic_ps_timeout > 0) { 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()
87 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_offchannel_stop_vifs()
89 if (WARN_ON(!local->emulate_chanctx)) in ieee80211_offchannel_stop_vifs()
101 ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_offchannel_stop_vifs()
106 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_offchannel_stop_vifs()
110 if (sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE || in ieee80211_offchannel_stop_vifs()
111 sdata->vif.type == NL80211_IFTYPE_NAN) in ieee80211_offchannel_stop_vifs()
114 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) in ieee80211_offchannel_stop_vifs()
115 set_bit(SDATA_STATE_OFFCHANNEL, &sdata->state); in ieee80211_offchannel_stop_vifs()
118 if (sdata->vif.bss_conf.enable_beacon) { in ieee80211_offchannel_stop_vifs()
120 &sdata->state); in ieee80211_offchannel_stop_vifs()
121 sdata->vif.bss_conf.enable_beacon = false; in ieee80211_offchannel_stop_vifs()
123 sdata, &sdata->deflink, in ieee80211_offchannel_stop_vifs()
127 if (sdata->vif.type == NL80211_IFTYPE_STATION && in ieee80211_offchannel_stop_vifs()
128 sdata->u.mgd.associated) in ieee80211_offchannel_stop_vifs()
137 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_offchannel_return()
139 if (WARN_ON(!local->emulate_chanctx)) in ieee80211_offchannel_return()
142 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_offchannel_return()
143 if (sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE) in ieee80211_offchannel_return()
146 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) in ieee80211_offchannel_return()
147 clear_bit(SDATA_STATE_OFFCHANNEL, &sdata->state); in ieee80211_offchannel_return()
152 /* Tell AP we're back */ in ieee80211_offchannel_return()
153 if (sdata->vif.type == NL80211_IFTYPE_STATION && in ieee80211_offchannel_return()
154 sdata->u.mgd.associated) in ieee80211_offchannel_return()
158 &sdata->state)) { in ieee80211_offchannel_return()
159 sdata->vif.bss_conf.enable_beacon = true; in ieee80211_offchannel_return()
161 sdata, &sdata->deflink, in ieee80211_offchannel_return()
166 ieee80211_wake_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_offchannel_return()
174 if (roc->frame) { in ieee80211_roc_notify_destroy()
175 cfg80211_mgmt_tx_status(&roc->sdata->wdev, roc->mgmt_tx_cookie, in ieee80211_roc_notify_destroy()
176 roc->frame->data, roc->frame->len, in ieee80211_roc_notify_destroy()
178 ieee80211_free_txskb(&roc->sdata->local->hw, roc->frame); in ieee80211_roc_notify_destroy()
181 if (!roc->mgmt_tx_cookie) in ieee80211_roc_notify_destroy()
182 cfg80211_remain_on_channel_expired(&roc->sdata->wdev, in ieee80211_roc_notify_destroy()
183 roc->cookie, roc->chan, in ieee80211_roc_notify_destroy()
186 cfg80211_tx_mgmt_expired(&roc->sdata->wdev, in ieee80211_roc_notify_destroy()
187 roc->mgmt_tx_cookie, in ieee80211_roc_notify_destroy()
188 roc->chan, GFP_KERNEL); in ieee80211_roc_notify_destroy()
190 list_del(&roc->list); in ieee80211_roc_notify_destroy()
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()
205 if (!roc->started) in ieee80211_end_finished_rocs()
208 remaining = roc->start_time + in ieee80211_end_finished_rocs()
209 msecs_to_jiffies(roc->duration) - in ieee80211_end_finished_rocs()
216 if (roc->abort || roc->hw_begun || remaining <= 0) in ieee80211_end_finished_rocs()
233 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, dur); in ieee80211_recalc_sw_work()
240 if (WARN_ON(roc->notified)) in ieee80211_handle_roc_started()
243 roc->start_time = start_time; in ieee80211_handle_roc_started()
244 roc->started = true; in ieee80211_handle_roc_started()
246 if (roc->mgmt_tx_cookie) { in ieee80211_handle_roc_started()
247 if (!WARN_ON(!roc->frame)) { in ieee80211_handle_roc_started()
248 ieee80211_tx_skb_tid_band(roc->sdata, roc->frame, 7, in ieee80211_handle_roc_started()
249 roc->chan->band); in ieee80211_handle_roc_started()
250 roc->frame = NULL; in ieee80211_handle_roc_started()
253 cfg80211_ready_on_channel(&roc->sdata->wdev, roc->cookie, in ieee80211_handle_roc_started()
254 roc->chan, roc->req_duration, in ieee80211_handle_roc_started()
258 roc->notified = true; in ieee80211_handle_roc_started()
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()
270 if (!roc->started) in ieee80211_hw_roc_start()
273 roc->hw_begun = true; in ieee80211_hw_roc_start()
274 ieee80211_handle_roc_started(roc, local->hw_roc_start_time); in ieee80211_hw_roc_start()
282 local->hw_roc_start_time = jiffies; in ieee80211_ready_on_channel()
286 wiphy_work_queue(hw->wiphy, &local->hw_roc_start); in ieee80211_ready_on_channel()
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()
304 if (WARN_ON(roc->started)) in _ieee80211_start_next_roc()
307 min_dur = roc->duration; in _ieee80211_start_next_roc()
308 max_dur = roc->duration; in _ieee80211_start_next_roc()
309 type = roc->type; in _ieee80211_start_next_roc()
311 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
314 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan) in _ieee80211_start_next_roc()
316 max_dur = max(tmp->duration, max_dur); in _ieee80211_start_next_roc()
317 min_dur = min(tmp->duration, min_dur); in _ieee80211_start_next_roc()
318 type = max(tmp->type, type); 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()
333 if (tmp->sdata != roc->sdata || in _ieee80211_start_next_roc()
334 tmp->chan != roc->chan) in _ieee80211_start_next_roc()
336 tmp->started = true; in _ieee80211_start_next_roc()
337 tmp->abort = true; 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()
345 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan) in _ieee80211_start_next_roc()
347 tmp->started = true; in _ieee80211_start_next_roc()
352 * treat it as though the ROC operation started properly, so in _ieee80211_start_next_roc()
358 roc->on_channel = roc->chan == local->hw.conf.chandef.chan && in _ieee80211_start_next_roc()
359 local->hw.conf.chandef.width != NL80211_CHAN_WIDTH_5 && in _ieee80211_start_next_roc()
360 local->hw.conf.chandef.width != NL80211_CHAN_WIDTH_10; in _ieee80211_start_next_roc()
365 if (!roc->on_channel) { in _ieee80211_start_next_roc()
368 local->tmp_channel = roc->chan; in _ieee80211_start_next_roc()
372 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, in _ieee80211_start_next_roc()
376 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
377 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan) in _ieee80211_start_next_roc()
380 tmp->on_channel = roc->on_channel; in _ieee80211_start_next_roc()
390 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_start_next_roc()
392 if (list_empty(&local->roc_list)) { in ieee80211_start_next_roc()
397 /* defer roc if driver is not started (i.e. during reconfig) */ in ieee80211_start_next_roc()
398 if (local->in_reconfig) in ieee80211_start_next_roc()
401 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in ieee80211_start_next_roc()
404 if (WARN_ON_ONCE(roc->started)) in ieee80211_start_next_roc()
407 if (local->ops->remain_on_channel) { in ieee80211_start_next_roc()
411 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, in ieee80211_start_next_roc()
425 if (!local->ops->remain_on_channel) in ieee80211_reconfig_roc()
429 wiphy_work_flush(local->hw.wiphy, &local->hw_roc_start); in ieee80211_reconfig_roc()
430 wiphy_work_flush(local->hw.wiphy, &local->hw_roc_done); in ieee80211_reconfig_roc()
432 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_reconfig_roc()
433 if (!roc->started) in ieee80211_reconfig_roc()
436 if (!roc->hw_begun) { in ieee80211_reconfig_roc()
438 roc->started = false; in ieee80211_reconfig_roc()
454 lockdep_assert_wiphy(local->hw.wiphy); in __ieee80211_roc_work()
456 if (WARN_ON(local->ops->remain_on_channel)) in __ieee80211_roc_work()
459 roc = list_first_entry_or_null(&local->roc_list, in __ieee80211_roc_work()
464 if (!roc->started) { in __ieee80211_roc_work()
465 WARN_ON(!local->emulate_chanctx); in __ieee80211_roc_work()
468 on_channel = roc->on_channel; in __ieee80211_roc_work()
472 /* careful - roc pointer became invalid during recalc */ in __ieee80211_roc_work()
477 local->tmp_channel = NULL; in __ieee80211_roc_work()
493 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_roc_work()
503 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_hw_roc_done()
517 wiphy_work_queue(hw->wiphy, &local->hw_roc_done); in ieee80211_remain_on_channel_expired()
529 if (WARN_ON(!cur_roc->started)) in ieee80211_coalesce_hw_started_roc()
532 /* if it was scheduled in the hardware, but not started yet, in ieee80211_coalesce_hw_started_roc()
535 if (!cur_roc->hw_begun && new_roc->duration > cur_roc->duration) in ieee80211_coalesce_hw_started_roc()
538 remaining = cur_roc->start_time + in ieee80211_coalesce_hw_started_roc()
539 msecs_to_jiffies(cur_roc->duration) - in ieee80211_coalesce_hw_started_roc()
543 if (new_roc->duration > jiffies_to_msecs(remaining)) in ieee80211_coalesce_hw_started_roc()
547 list_add(&new_roc->list, &cur_roc->list); in ieee80211_coalesce_hw_started_roc()
553 if (cur_roc->hw_begun) { in ieee80211_coalesce_hw_started_roc()
554 new_roc->hw_begun = true; in ieee80211_coalesce_hw_started_roc()
572 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_start_roc_work()
574 if (channel->freq_offset) in ieee80211_start_roc_work()
576 return -EOPNOTSUPP; in ieee80211_start_roc_work()
578 if (!local->emulate_chanctx && !local->ops->remain_on_channel) in ieee80211_start_roc_work()
579 return -EOPNOTSUPP; in ieee80211_start_roc_work()
583 return -ENOMEM; in ieee80211_start_roc_work()
590 * TODO: cancel the off-channel operation in ieee80211_start_roc_work()
597 roc->chan = channel; in ieee80211_start_roc_work()
598 roc->duration = duration; in ieee80211_start_roc_work()
599 roc->req_duration = duration; in ieee80211_start_roc_work()
600 roc->frame = txskb; in ieee80211_start_roc_work()
601 roc->type = type; in ieee80211_start_roc_work()
602 roc->sdata = sdata; in ieee80211_start_roc_work()
609 roc->cookie = ieee80211_mgmt_tx_cookie(local); in ieee80211_start_roc_work()
610 *cookie = roc->cookie; in ieee80211_start_roc_work()
612 roc->mgmt_tx_cookie = *cookie; in ieee80211_start_roc_work()
616 if (list_empty(&local->roc_list) && in ieee80211_start_roc_work()
617 !local->scanning && !ieee80211_is_radar_required(local)) { in ieee80211_start_roc_work()
619 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
620 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
621 wiphy_delayed_work_queue(local->hw.wiphy, in ieee80211_start_roc_work()
622 &local->roc_work, 0); in ieee80211_start_roc_work()
633 roc->started = true; in ieee80211_start_roc_work()
634 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
642 list_for_each_entry(tmp, &local->roc_list, list) { in ieee80211_start_roc_work()
643 if (tmp->chan != channel || tmp->sdata != sdata) in ieee80211_start_roc_work()
647 * Extend this ROC if possible: If it hasn't started, add in ieee80211_start_roc_work()
650 if (!tmp->started) { in ieee80211_start_roc_work()
651 list_add(&roc->list, &tmp->list); in ieee80211_start_roc_work()
659 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
660 /* If there's no hardware remain-on-channel, and in ieee80211_start_roc_work()
661 * doing so won't push us over the maximum r-o-c in ieee80211_start_roc_work()
663 * the list and mark it as having started now. in ieee80211_start_roc_work()
665 * combine with other started ones (that haven't in ieee80211_start_roc_work()
670 u32 elapsed = jiffies_to_msecs(now - tmp->start_time); in ieee80211_start_roc_work()
671 struct wiphy *wiphy = local->hw.wiphy; in ieee80211_start_roc_work()
672 u32 max_roc = wiphy->max_remain_on_channel_duration; in ieee80211_start_roc_work()
674 if (elapsed + roc->duration > max_roc) { in ieee80211_start_roc_work()
679 list_add(&roc->list, &tmp->list); in ieee80211_start_roc_work()
681 roc->on_channel = tmp->on_channel; in ieee80211_start_roc_work()
692 * but no need to check for already started ones, since in ieee80211_start_roc_work()
699 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
709 struct ieee80211_local *local = sdata->local; in ieee80211_remain_on_channel()
711 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_remain_on_channel()
724 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_cancel_roc()
727 return -ENOENT; in ieee80211_cancel_roc()
729 wiphy_work_flush(local->hw.wiphy, &local->hw_roc_start); in ieee80211_cancel_roc()
731 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
732 if (!mgmt_tx && roc->cookie != cookie) in ieee80211_cancel_roc()
734 else if (mgmt_tx && roc->mgmt_tx_cookie != cookie) in ieee80211_cancel_roc()
742 return -ENOENT; in ieee80211_cancel_roc()
745 if (!found->started) { in ieee80211_cancel_roc()
750 if (local->ops->remain_on_channel) { in ieee80211_cancel_roc()
751 ret = drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_cancel_roc()
771 wiphy_work_cancel(local->hw.wiphy, &local->hw_roc_done); in ieee80211_cancel_roc()
775 * cancel them all - we should wait for as much time as needed in ieee80211_cancel_roc()
778 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
779 if (!roc->started) in ieee80211_cancel_roc()
786 /* that really must not happen - it was started */ in ieee80211_cancel_roc()
792 found->abort = true; in ieee80211_cancel_roc()
793 wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, 0); in ieee80211_cancel_roc()
805 struct ieee80211_local *local = sdata->local; in ieee80211_cancel_remain_on_channel()
814 struct ieee80211_local *local = sdata->local; in ieee80211_mgmt_tx()
817 const struct ieee80211_mgmt *mgmt = (void *)params->buf; in ieee80211_mgmt_tx()
820 int link_id = -1; in ieee80211_mgmt_tx()
825 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_mgmt_tx()
827 if (params->dont_wait_for_ack) in ieee80211_mgmt_tx()
833 if (params->no_cck) in ieee80211_mgmt_tx()
836 switch (sdata->vif.type) { in ieee80211_mgmt_tx()
838 if (!sdata->vif.cfg.ibss_joined) in ieee80211_mgmt_tx()
843 if (ieee80211_vif_is_mesh(&sdata->vif) && in ieee80211_mgmt_tx()
844 !sdata->u.mesh.mesh_id_len) in ieee80211_mgmt_tx()
851 if (sdata->vif.type != NL80211_IFTYPE_ADHOC && in ieee80211_mgmt_tx()
852 !ieee80211_vif_is_mesh(&sdata->vif) && in ieee80211_mgmt_tx()
853 !sdata->bss->active) in ieee80211_mgmt_tx()
857 sta = sta_info_get_bss(sdata, mgmt->da); in ieee80211_mgmt_tx()
858 mlo_sta = sta && sta->sta.mlo; in ieee80211_mgmt_tx()
860 if (!ieee80211_is_action(mgmt->frame_control) || in ieee80211_mgmt_tx()
861 mgmt->u.action.category == WLAN_CATEGORY_PUBLIC || in ieee80211_mgmt_tx()
862 mgmt->u.action.category == WLAN_CATEGORY_SELF_PROTECTED || in ieee80211_mgmt_tx()
863 mgmt->u.action.category == WLAN_CATEGORY_SPECTRUM_MGMT) { in ieee80211_mgmt_tx()
870 return -ENOLINK; in ieee80211_mgmt_tx()
872 if (params->link_id >= 0 && in ieee80211_mgmt_tx()
873 !(sta->sta.valid_links & BIT(params->link_id))) { in ieee80211_mgmt_tx()
875 return -ENOLINK; in ieee80211_mgmt_tx()
877 link_id = params->link_id; in ieee80211_mgmt_tx()
882 if (!sdata->u.mgd.associated || in ieee80211_mgmt_tx()
883 (params->offchan && params->wait && in ieee80211_mgmt_tx()
884 local->ops->remain_on_channel && in ieee80211_mgmt_tx()
885 memcmp(sdata->vif.cfg.ap_addr, mgmt->bssid, ETH_ALEN))) { in ieee80211_mgmt_tx()
887 } else if (sdata->u.mgd.associated && in ieee80211_mgmt_tx()
888 ether_addr_equal(sdata->vif.cfg.ap_addr, mgmt->da)) { in ieee80211_mgmt_tx()
889 sta = sta_info_get_bss(sdata, mgmt->da); in ieee80211_mgmt_tx()
890 mlo_sta = sta && sta->sta.mlo; in ieee80211_mgmt_tx()
898 return -EOPNOTSUPP; in ieee80211_mgmt_tx()
904 if (need_offchan && !params->chan) in ieee80211_mgmt_tx()
905 return -EINVAL; in ieee80211_mgmt_tx()
908 if (!params->chan && mlo_sta) { in ieee80211_mgmt_tx()
916 for (i = 0; i < ARRAY_SIZE(sdata->vif.link_conf); i++) { in ieee80211_mgmt_tx()
919 conf = rcu_dereference(sdata->vif.link_conf[i]); in ieee80211_mgmt_tx()
923 chanctx_conf = rcu_dereference(conf->chanctx_conf); in ieee80211_mgmt_tx()
927 if (mlo_sta && params->chan == chanctx_conf->def.chan && in ieee80211_mgmt_tx()
928 ether_addr_equal(sdata->vif.addr, mgmt->sa)) { in ieee80211_mgmt_tx()
933 if (ether_addr_equal(conf->addr, mgmt->sa)) { in ieee80211_mgmt_tx()
938 if (sdata->vif.valid_links && in ieee80211_mgmt_tx()
939 params->link_id >= 0 && params->link_id == i && in ieee80211_mgmt_tx()
940 params->chan == chanctx_conf->def.chan) in ieee80211_mgmt_tx()
950 need_offchan = params->chan && in ieee80211_mgmt_tx()
951 (params->chan != in ieee80211_mgmt_tx()
952 chanctx_conf->def.chan); in ieee80211_mgmt_tx()
959 if (need_offchan && !params->offchan) { in ieee80211_mgmt_tx()
960 ret = -EBUSY; in ieee80211_mgmt_tx()
964 skb = dev_alloc_skb(local->hw.extra_tx_headroom + params->len); in ieee80211_mgmt_tx()
966 ret = -ENOMEM; in ieee80211_mgmt_tx()
969 skb_reserve(skb, local->hw.extra_tx_headroom); in ieee80211_mgmt_tx()
971 data = skb_put_data(skb, params->buf, params->len); in ieee80211_mgmt_tx()
974 if (sdata->vif.bss_conf.csa_active && in ieee80211_mgmt_tx()
975 (sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_mgmt_tx()
976 sdata->vif.type == NL80211_IFTYPE_MESH_POINT || in ieee80211_mgmt_tx()
977 sdata->vif.type == NL80211_IFTYPE_ADHOC) && in ieee80211_mgmt_tx()
978 params->n_csa_offsets) { in ieee80211_mgmt_tx()
984 if (sdata->vif.type == NL80211_IFTYPE_AP) in ieee80211_mgmt_tx()
985 beacon = rcu_dereference(sdata->deflink.u.ap.beacon); in ieee80211_mgmt_tx()
986 else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) in ieee80211_mgmt_tx()
987 beacon = rcu_dereference(sdata->u.ibss.presp); in ieee80211_mgmt_tx()
988 else if (ieee80211_vif_is_mesh(&sdata->vif)) in ieee80211_mgmt_tx()
989 beacon = rcu_dereference(sdata->u.mesh.beacon); in ieee80211_mgmt_tx()
992 for (i = 0; i < params->n_csa_offsets; i++) in ieee80211_mgmt_tx()
993 data[params->csa_offsets[i]] = in ieee80211_mgmt_tx()
994 beacon->cntdwn_current_counter; in ieee80211_mgmt_tx()
999 IEEE80211_SKB_CB(skb)->flags = flags; in ieee80211_mgmt_tx()
1000 IEEE80211_SKB_CB(skb)->control.flags |= IEEE80211_TX_CTRL_DONT_USE_RATE_MASK; in ieee80211_mgmt_tx()
1002 skb->dev = sdata->dev; in ieee80211_mgmt_tx()
1004 if (!params->dont_wait_for_ack) { in ieee80211_mgmt_tx()
1014 /* Assign a dummy non-zero cookie, it's not sent to in ieee80211_mgmt_tx()
1017 * mgmt-tx from remain-on-channel. in ieee80211_mgmt_tx()
1028 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_TX_OFFCHAN | in ieee80211_mgmt_tx()
1030 if (ieee80211_hw_check(&local->hw, QUEUE_CONTROL)) in ieee80211_mgmt_tx()
1031 IEEE80211_SKB_CB(skb)->hw_queue = in ieee80211_mgmt_tx()
1032 local->hw.offchannel_tx_hw_queue; in ieee80211_mgmt_tx()
1035 ret = ieee80211_start_roc_work(local, sdata, params->chan, in ieee80211_mgmt_tx()
1036 params->wait, cookie, skb, in ieee80211_mgmt_tx()
1039 ieee80211_free_txskb(&local->hw, skb); in ieee80211_mgmt_tx()
1054 wiphy_work_init(&local->hw_roc_start, ieee80211_hw_roc_start); in ieee80211_roc_setup()
1055 wiphy_work_init(&local->hw_roc_done, ieee80211_hw_roc_done); in ieee80211_roc_setup()
1056 wiphy_delayed_work_init(&local->roc_work, ieee80211_roc_work); in ieee80211_roc_setup()
1057 INIT_LIST_HEAD(&local->roc_list); in ieee80211_roc_setup()
1066 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_roc_purge()
1068 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_roc_purge()
1069 if (sdata && roc->sdata != sdata) in ieee80211_roc_purge()
1072 if (roc->started) { in ieee80211_roc_purge()
1073 if (local->ops->remain_on_channel) { in ieee80211_roc_purge()
1075 drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_roc_purge()
1078 roc->abort = true; in ieee80211_roc_purge()