Lines Matching +full:duration +full:- +full:us
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Off-channel operation helpers
8 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
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
23 * hardware unconditionally awake, but still let the AP send us normal frames.
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 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()
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 if (WARN_ON(local->use_chanctx)) in ieee80211_offchannel_stop_vifs()
91 * notify the AP about us leaving the channel and stop all in ieee80211_offchannel_stop_vifs()
99 ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, 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()
109 if (sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE || in ieee80211_offchannel_stop_vifs()
110 sdata->vif.type == NL80211_IFTYPE_NAN) in ieee80211_offchannel_stop_vifs()
113 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) in ieee80211_offchannel_stop_vifs()
114 set_bit(SDATA_STATE_OFFCHANNEL, &sdata->state); in ieee80211_offchannel_stop_vifs()
117 if (sdata->vif.bss_conf.enable_beacon) { in ieee80211_offchannel_stop_vifs()
119 &sdata->state); in ieee80211_offchannel_stop_vifs()
120 sdata->vif.bss_conf.enable_beacon = false; in ieee80211_offchannel_stop_vifs()
125 if (sdata->vif.type == NL80211_IFTYPE_STATION && in ieee80211_offchannel_stop_vifs()
126 sdata->u.mgd.associated) in ieee80211_offchannel_stop_vifs()
129 mutex_unlock(&local->iflist_mtx); in ieee80211_offchannel_stop_vifs()
136 if (WARN_ON(local->use_chanctx)) in ieee80211_offchannel_return()
139 mutex_lock(&local->iflist_mtx); in ieee80211_offchannel_return()
140 list_for_each_entry(sdata, &local->interfaces, list) { in ieee80211_offchannel_return()
141 if (sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE) in ieee80211_offchannel_return()
144 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) in ieee80211_offchannel_return()
145 clear_bit(SDATA_STATE_OFFCHANNEL, &sdata->state); in ieee80211_offchannel_return()
151 if (sdata->vif.type == NL80211_IFTYPE_STATION && in ieee80211_offchannel_return()
152 sdata->u.mgd.associated) in ieee80211_offchannel_return()
156 &sdata->state)) { in ieee80211_offchannel_return()
157 sdata->vif.bss_conf.enable_beacon = true; in ieee80211_offchannel_return()
162 mutex_unlock(&local->iflist_mtx); in ieee80211_offchannel_return()
164 ieee80211_wake_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, in ieee80211_offchannel_return()
172 if (roc->frame) { in ieee80211_roc_notify_destroy()
173 cfg80211_mgmt_tx_status(&roc->sdata->wdev, roc->mgmt_tx_cookie, in ieee80211_roc_notify_destroy()
174 roc->frame->data, roc->frame->len, in ieee80211_roc_notify_destroy()
176 ieee80211_free_txskb(&roc->sdata->local->hw, roc->frame); in ieee80211_roc_notify_destroy()
179 if (!roc->mgmt_tx_cookie) in ieee80211_roc_notify_destroy()
180 cfg80211_remain_on_channel_expired(&roc->sdata->wdev, in ieee80211_roc_notify_destroy()
181 roc->cookie, roc->chan, in ieee80211_roc_notify_destroy()
184 cfg80211_tx_mgmt_expired(&roc->sdata->wdev, in ieee80211_roc_notify_destroy()
185 roc->mgmt_tx_cookie, in ieee80211_roc_notify_destroy()
186 roc->chan, GFP_KERNEL); in ieee80211_roc_notify_destroy()
188 list_del(&roc->list); in ieee80211_roc_notify_destroy()
198 lockdep_assert_held(&local->mtx); in ieee80211_end_finished_rocs()
200 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_end_finished_rocs()
203 if (!roc->started) in ieee80211_end_finished_rocs()
206 remaining = roc->start_time + in ieee80211_end_finished_rocs()
207 msecs_to_jiffies(roc->duration) - in ieee80211_end_finished_rocs()
214 if (roc->abort || roc->hw_begun || remaining <= 0) in ieee80211_end_finished_rocs()
231 mod_delayed_work(local->workqueue, &local->roc_work, dur); in ieee80211_recalc_sw_work()
238 if (WARN_ON(roc->notified)) in ieee80211_handle_roc_started()
241 roc->start_time = start_time; in ieee80211_handle_roc_started()
242 roc->started = true; in ieee80211_handle_roc_started()
244 if (roc->mgmt_tx_cookie) { in ieee80211_handle_roc_started()
245 if (!WARN_ON(!roc->frame)) { in ieee80211_handle_roc_started()
246 ieee80211_tx_skb_tid_band(roc->sdata, roc->frame, 7, in ieee80211_handle_roc_started()
247 roc->chan->band); in ieee80211_handle_roc_started()
248 roc->frame = NULL; in ieee80211_handle_roc_started()
251 cfg80211_ready_on_channel(&roc->sdata->wdev, roc->cookie, in ieee80211_handle_roc_started()
252 roc->chan, roc->req_duration, in ieee80211_handle_roc_started()
256 roc->notified = true; in ieee80211_handle_roc_started()
265 mutex_lock(&local->mtx); in ieee80211_hw_roc_start()
267 list_for_each_entry(roc, &local->roc_list, list) { in ieee80211_hw_roc_start()
268 if (!roc->started) in ieee80211_hw_roc_start()
271 roc->hw_begun = true; in ieee80211_hw_roc_start()
272 ieee80211_handle_roc_started(roc, local->hw_roc_start_time); in ieee80211_hw_roc_start()
275 mutex_unlock(&local->mtx); in ieee80211_hw_roc_start()
282 local->hw_roc_start_time = jiffies; in ieee80211_ready_on_channel()
286 ieee80211_queue_work(hw, &local->hw_roc_start); in ieee80211_ready_on_channel()
296 lockdep_assert_held(&local->mtx); 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 ieee80211_queue_work(&local->hw, &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()
355 roc->on_channel = roc->chan == local->_oper_chandef.chan && in _ieee80211_start_next_roc()
356 local->_oper_chandef.width != NL80211_CHAN_WIDTH_5 && in _ieee80211_start_next_roc()
357 local->_oper_chandef.width != NL80211_CHAN_WIDTH_10; in _ieee80211_start_next_roc()
362 if (!roc->on_channel) { in _ieee80211_start_next_roc()
365 local->tmp_channel = roc->chan; in _ieee80211_start_next_roc()
369 ieee80211_queue_delayed_work(&local->hw, &local->roc_work, in _ieee80211_start_next_roc()
373 list_for_each_entry(tmp, &local->roc_list, list) { in _ieee80211_start_next_roc()
374 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan) in _ieee80211_start_next_roc()
377 tmp->on_channel = roc->on_channel; in _ieee80211_start_next_roc()
387 lockdep_assert_held(&local->mtx); in ieee80211_start_next_roc()
389 if (list_empty(&local->roc_list)) { in ieee80211_start_next_roc()
395 if (local->in_reconfig) in ieee80211_start_next_roc()
398 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in ieee80211_start_next_roc()
401 if (WARN_ON_ONCE(roc->started)) in ieee80211_start_next_roc()
404 if (local->ops->remain_on_channel) { in ieee80211_start_next_roc()
408 ieee80211_queue_delayed_work(&local->hw, &local->roc_work, in ieee80211_start_next_roc()
418 lockdep_assert_held(&local->mtx); in __ieee80211_roc_work()
420 if (WARN_ON(local->ops->remain_on_channel)) in __ieee80211_roc_work()
423 roc = list_first_entry_or_null(&local->roc_list, in __ieee80211_roc_work()
428 if (!roc->started) { in __ieee80211_roc_work()
429 WARN_ON(local->use_chanctx); in __ieee80211_roc_work()
432 on_channel = roc->on_channel; in __ieee80211_roc_work()
436 /* careful - roc pointer became invalid during recalc */ in __ieee80211_roc_work()
441 local->tmp_channel = NULL; in __ieee80211_roc_work()
457 mutex_lock(&local->mtx); in ieee80211_roc_work()
459 mutex_unlock(&local->mtx); in ieee80211_roc_work()
467 mutex_lock(&local->mtx); in ieee80211_hw_roc_done()
474 mutex_unlock(&local->mtx); in ieee80211_hw_roc_done()
483 ieee80211_queue_work(hw, &local->hw_roc_done); in ieee80211_remain_on_channel_expired()
495 if (WARN_ON(!cur_roc->started)) in ieee80211_coalesce_hw_started_roc()
499 * we can only combine if the older one had a longer duration in ieee80211_coalesce_hw_started_roc()
501 if (!cur_roc->hw_begun && new_roc->duration > cur_roc->duration) in ieee80211_coalesce_hw_started_roc()
504 remaining = cur_roc->start_time + in ieee80211_coalesce_hw_started_roc()
505 msecs_to_jiffies(cur_roc->duration) - in ieee80211_coalesce_hw_started_roc()
509 if (new_roc->duration > jiffies_to_msecs(remaining)) in ieee80211_coalesce_hw_started_roc()
513 list_add(&new_roc->list, &cur_roc->list); in ieee80211_coalesce_hw_started_roc()
517 * struct that runs once the driver notifies us of the beginning in ieee80211_coalesce_hw_started_roc()
519 if (cur_roc->hw_begun) { in ieee80211_coalesce_hw_started_roc()
520 new_roc->hw_begun = true; in ieee80211_coalesce_hw_started_roc()
530 unsigned int duration, u64 *cookie, in ieee80211_start_roc_work() argument
538 lockdep_assert_held(&local->mtx); in ieee80211_start_roc_work()
540 if (channel->freq_offset) in ieee80211_start_roc_work()
542 return -EOPNOTSUPP; in ieee80211_start_roc_work()
544 if (local->use_chanctx && !local->ops->remain_on_channel) in ieee80211_start_roc_work()
545 return -EOPNOTSUPP; in ieee80211_start_roc_work()
549 return -ENOMEM; in ieee80211_start_roc_work()
552 * If the duration is zero, then the driver in ieee80211_start_roc_work()
556 * TODO: cancel the off-channel operation in ieee80211_start_roc_work()
560 if (!duration) in ieee80211_start_roc_work()
561 duration = 10; in ieee80211_start_roc_work()
563 roc->chan = channel; in ieee80211_start_roc_work()
564 roc->duration = duration; in ieee80211_start_roc_work()
565 roc->req_duration = duration; in ieee80211_start_roc_work()
566 roc->frame = txskb; in ieee80211_start_roc_work()
567 roc->type = type; in ieee80211_start_roc_work()
568 roc->sdata = sdata; in ieee80211_start_roc_work()
575 roc->cookie = ieee80211_mgmt_tx_cookie(local); in ieee80211_start_roc_work()
576 *cookie = roc->cookie; in ieee80211_start_roc_work()
578 roc->mgmt_tx_cookie = *cookie; in ieee80211_start_roc_work()
582 if (list_empty(&local->roc_list) && in ieee80211_start_roc_work()
583 !local->scanning && !ieee80211_is_radar_required(local)) { in ieee80211_start_roc_work()
585 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
586 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
587 ieee80211_queue_delayed_work(&local->hw, in ieee80211_start_roc_work()
588 &local->roc_work, 0); in ieee80211_start_roc_work()
594 duration, type); in ieee80211_start_roc_work()
599 roc->started = true; in ieee80211_start_roc_work()
600 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
608 list_for_each_entry(tmp, &local->roc_list, list) { in ieee80211_start_roc_work()
609 if (tmp->chan != channel || tmp->sdata != sdata) in ieee80211_start_roc_work()
616 if (!tmp->started) { in ieee80211_start_roc_work()
617 list_add(&roc->list, &tmp->list); in ieee80211_start_roc_work()
625 if (!local->ops->remain_on_channel) { in ieee80211_start_roc_work()
626 /* If there's no hardware remain-on-channel, and in ieee80211_start_roc_work()
627 * doing so won't push us over the maximum r-o-c in ieee80211_start_roc_work()
636 u32 elapsed = jiffies_to_msecs(now - tmp->start_time); in ieee80211_start_roc_work()
637 struct wiphy *wiphy = local->hw.wiphy; in ieee80211_start_roc_work()
638 u32 max_roc = wiphy->max_remain_on_channel_duration; in ieee80211_start_roc_work()
640 if (elapsed + roc->duration > max_roc) { in ieee80211_start_roc_work()
645 list_add(&roc->list, &tmp->list); in ieee80211_start_roc_work()
647 roc->on_channel = tmp->on_channel; in ieee80211_start_roc_work()
665 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
672 unsigned int duration, u64 *cookie) in ieee80211_remain_on_channel() argument
675 struct ieee80211_local *local = sdata->local; in ieee80211_remain_on_channel()
678 mutex_lock(&local->mtx); in ieee80211_remain_on_channel()
680 duration, cookie, NULL, in ieee80211_remain_on_channel()
682 mutex_unlock(&local->mtx); in ieee80211_remain_on_channel()
694 return -ENOENT; in ieee80211_cancel_roc()
696 flush_work(&local->hw_roc_start); in ieee80211_cancel_roc()
698 mutex_lock(&local->mtx); in ieee80211_cancel_roc()
699 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
700 if (!mgmt_tx && roc->cookie != cookie) in ieee80211_cancel_roc()
702 else if (mgmt_tx && roc->mgmt_tx_cookie != cookie) in ieee80211_cancel_roc()
710 mutex_unlock(&local->mtx); in ieee80211_cancel_roc()
711 return -ENOENT; in ieee80211_cancel_roc()
714 if (!found->started) { in ieee80211_cancel_roc()
719 if (local->ops->remain_on_channel) { in ieee80211_cancel_roc()
720 ret = drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_cancel_roc()
722 mutex_unlock(&local->mtx); in ieee80211_cancel_roc()
728 * cancel them all - we should wait for as much time as needed in ieee80211_cancel_roc()
731 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
732 if (!roc->started) in ieee80211_cancel_roc()
739 /* that really must not happen - it was started */ in ieee80211_cancel_roc()
745 found->abort = true; in ieee80211_cancel_roc()
746 mod_delayed_work(local->workqueue, &local->roc_work, 0); in ieee80211_cancel_roc()
750 mutex_unlock(&local->mtx); in ieee80211_cancel_roc()
759 struct ieee80211_local *local = sdata->local; in ieee80211_cancel_remain_on_channel()
768 struct ieee80211_local *local = sdata->local; in ieee80211_mgmt_tx()
771 const struct ieee80211_mgmt *mgmt = (void *)params->buf; in ieee80211_mgmt_tx()
777 if (params->dont_wait_for_ack) in ieee80211_mgmt_tx()
783 if (params->no_cck) in ieee80211_mgmt_tx()
786 switch (sdata->vif.type) { in ieee80211_mgmt_tx()
788 if (!sdata->vif.bss_conf.ibss_joined) in ieee80211_mgmt_tx()
793 if (ieee80211_vif_is_mesh(&sdata->vif) && in ieee80211_mgmt_tx()
794 !sdata->u.mesh.mesh_id_len) in ieee80211_mgmt_tx()
801 if (sdata->vif.type != NL80211_IFTYPE_ADHOC && in ieee80211_mgmt_tx()
802 !ieee80211_vif_is_mesh(&sdata->vif) && in ieee80211_mgmt_tx()
803 !rcu_access_pointer(sdata->bss->beacon)) in ieee80211_mgmt_tx()
805 if (!ieee80211_is_action(mgmt->frame_control) || in ieee80211_mgmt_tx()
806 mgmt->u.action.category == WLAN_CATEGORY_PUBLIC || in ieee80211_mgmt_tx()
807 mgmt->u.action.category == WLAN_CATEGORY_SELF_PROTECTED || in ieee80211_mgmt_tx()
808 mgmt->u.action.category == WLAN_CATEGORY_SPECTRUM_MGMT) in ieee80211_mgmt_tx()
811 sta = sta_info_get_bss(sdata, mgmt->da); in ieee80211_mgmt_tx()
814 return -ENOLINK; in ieee80211_mgmt_tx()
819 if (!sdata->u.mgd.associated || in ieee80211_mgmt_tx()
820 (params->offchan && params->wait && in ieee80211_mgmt_tx()
821 local->ops->remain_on_channel && in ieee80211_mgmt_tx()
822 memcmp(sdata->u.mgd.associated->bssid, in ieee80211_mgmt_tx()
823 mgmt->bssid, ETH_ALEN))) in ieee80211_mgmt_tx()
832 return -EOPNOTSUPP; in ieee80211_mgmt_tx()
838 if (need_offchan && !params->chan) in ieee80211_mgmt_tx()
839 return -EINVAL; in ieee80211_mgmt_tx()
841 mutex_lock(&local->mtx); in ieee80211_mgmt_tx()
848 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); in ieee80211_mgmt_tx()
851 need_offchan = params->chan && in ieee80211_mgmt_tx()
852 (params->chan != in ieee80211_mgmt_tx()
853 chanctx_conf->def.chan); in ieee80211_mgmt_tx()
854 } else if (!params->chan) { in ieee80211_mgmt_tx()
855 ret = -EINVAL; in ieee80211_mgmt_tx()
864 if (need_offchan && !params->offchan) { in ieee80211_mgmt_tx()
865 ret = -EBUSY; in ieee80211_mgmt_tx()
869 skb = dev_alloc_skb(local->hw.extra_tx_headroom + params->len); in ieee80211_mgmt_tx()
871 ret = -ENOMEM; in ieee80211_mgmt_tx()
874 skb_reserve(skb, local->hw.extra_tx_headroom); in ieee80211_mgmt_tx()
876 data = skb_put_data(skb, params->buf, params->len); in ieee80211_mgmt_tx()
879 if (sdata->vif.csa_active && in ieee80211_mgmt_tx()
880 (sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_mgmt_tx()
881 sdata->vif.type == NL80211_IFTYPE_MESH_POINT || in ieee80211_mgmt_tx()
882 sdata->vif.type == NL80211_IFTYPE_ADHOC) && in ieee80211_mgmt_tx()
883 params->n_csa_offsets) { in ieee80211_mgmt_tx()
889 if (sdata->vif.type == NL80211_IFTYPE_AP) in ieee80211_mgmt_tx()
890 beacon = rcu_dereference(sdata->u.ap.beacon); in ieee80211_mgmt_tx()
891 else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) in ieee80211_mgmt_tx()
892 beacon = rcu_dereference(sdata->u.ibss.presp); in ieee80211_mgmt_tx()
893 else if (ieee80211_vif_is_mesh(&sdata->vif)) in ieee80211_mgmt_tx()
894 beacon = rcu_dereference(sdata->u.mesh.beacon); in ieee80211_mgmt_tx()
897 for (i = 0; i < params->n_csa_offsets; i++) in ieee80211_mgmt_tx()
898 data[params->csa_offsets[i]] = in ieee80211_mgmt_tx()
899 beacon->cntdwn_current_counter; in ieee80211_mgmt_tx()
904 IEEE80211_SKB_CB(skb)->flags = flags; in ieee80211_mgmt_tx()
906 skb->dev = sdata->dev; in ieee80211_mgmt_tx()
908 if (!params->dont_wait_for_ack) { in ieee80211_mgmt_tx()
918 /* Assign a dummy non-zero cookie, it's not sent to in ieee80211_mgmt_tx()
921 * mgmt-tx from remain-on-channel. in ieee80211_mgmt_tx()
932 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_TX_OFFCHAN | in ieee80211_mgmt_tx()
934 if (ieee80211_hw_check(&local->hw, QUEUE_CONTROL)) in ieee80211_mgmt_tx()
935 IEEE80211_SKB_CB(skb)->hw_queue = in ieee80211_mgmt_tx()
936 local->hw.offchannel_tx_hw_queue; in ieee80211_mgmt_tx()
939 ret = ieee80211_start_roc_work(local, sdata, params->chan, in ieee80211_mgmt_tx()
940 params->wait, cookie, skb, in ieee80211_mgmt_tx()
943 ieee80211_free_txskb(&local->hw, skb); in ieee80211_mgmt_tx()
945 mutex_unlock(&local->mtx); in ieee80211_mgmt_tx()
959 INIT_WORK(&local->hw_roc_start, ieee80211_hw_roc_start); in ieee80211_roc_setup()
960 INIT_WORK(&local->hw_roc_done, ieee80211_hw_roc_done); in ieee80211_roc_setup()
961 INIT_DELAYED_WORK(&local->roc_work, ieee80211_roc_work); in ieee80211_roc_setup()
962 INIT_LIST_HEAD(&local->roc_list); in ieee80211_roc_setup()
971 mutex_lock(&local->mtx); in ieee80211_roc_purge()
972 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_roc_purge()
973 if (sdata && roc->sdata != sdata) in ieee80211_roc_purge()
976 if (roc->started) { in ieee80211_roc_purge()
977 if (local->ops->remain_on_channel) { in ieee80211_roc_purge()
982 roc->abort = true; in ieee80211_roc_purge()
991 mutex_unlock(&local->mtx); in ieee80211_roc_purge()