Lines Matching refs:roc
171 static void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc) in ieee80211_roc_notify_destroy() argument
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()
191 kfree(roc); in ieee80211_roc_notify_destroy()
197 struct ieee80211_roc_work *roc, *tmp; in ieee80211_end_finished_rocs() local
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()
217 ieee80211_roc_notify_destroy(roc); in ieee80211_end_finished_rocs()
237 static void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc, in ieee80211_handle_roc_started() argument
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()
265 struct ieee80211_roc_work *roc; in ieee80211_hw_roc_start() local
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()
292 struct ieee80211_roc_work *roc, *tmp; in _ieee80211_start_next_roc() local
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()
312 if (tmp == roc) in _ieee80211_start_next_roc()
314 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan) in _ieee80211_start_next_roc()
322 int ret = drv_remain_on_channel(local, roc->sdata, roc->chan, 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()
345 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan) in _ieee80211_start_next_roc()
358 roc->on_channel = roc->chan == local->hw.conf.chandef.chan && 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()
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()
388 struct ieee80211_roc_work *roc; in ieee80211_start_next_roc() local
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()
418 struct ieee80211_roc_work *roc, *tmp; in ieee80211_reconfig_roc() local
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()
443 ieee80211_roc_notify_destroy(roc); in ieee80211_reconfig_roc()
451 struct ieee80211_roc_work *roc; in __ieee80211_roc_work() local
459 roc = list_first_entry_or_null(&local->roc_list, in __ieee80211_roc_work()
461 if (!roc) in __ieee80211_roc_work()
464 if (!roc->started) { in __ieee80211_roc_work()
468 on_channel = roc->on_channel; in __ieee80211_roc_work()
568 struct ieee80211_roc_work *roc, *tmp; in ieee80211_start_roc_work() local
582 roc = kzalloc(sizeof(*roc), GFP_KERNEL); in ieee80211_start_roc_work()
583 if (!roc) in ieee80211_start_roc_work()
598 roc->chan = channel; in ieee80211_start_roc_work()
599 roc->duration = duration; in ieee80211_start_roc_work()
600 roc->req_duration = duration; in ieee80211_start_roc_work()
601 roc->frame = txskb; in ieee80211_start_roc_work()
602 roc->type = type; in ieee80211_start_roc_work()
603 roc->sdata = sdata; in ieee80211_start_roc_work()
610 roc->cookie = ieee80211_mgmt_tx_cookie(local); in ieee80211_start_roc_work()
611 *cookie = roc->cookie; in ieee80211_start_roc_work()
613 roc->mgmt_tx_cookie = *cookie; in ieee80211_start_roc_work()
623 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
633 kfree(roc); in ieee80211_start_roc_work()
636 roc->started = true; in ieee80211_start_roc_work()
637 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
654 list_add(&roc->list, &tmp->list); in ieee80211_start_roc_work()
677 if (elapsed + roc->duration > max_roc) { in ieee80211_start_roc_work()
682 list_add(&roc->list, &tmp->list); in ieee80211_start_roc_work()
684 roc->on_channel = tmp->on_channel; in ieee80211_start_roc_work()
685 ieee80211_handle_roc_started(roc, now); in ieee80211_start_roc_work()
690 queued = ieee80211_coalesce_hw_started_roc(local, roc, tmp); in ieee80211_start_roc_work()
702 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
724 struct ieee80211_roc_work *roc, *tmp, *found = NULL; in ieee80211_cancel_roc() local
734 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
735 if (!mgmt_tx && roc->cookie != cookie) in ieee80211_cancel_roc()
737 else if (mgmt_tx && roc->mgmt_tx_cookie != cookie) in ieee80211_cancel_roc()
740 found = roc; in ieee80211_cancel_roc()
754 ret = drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_cancel_roc()
781 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
782 if (!roc->started) in ieee80211_cancel_roc()
784 if (roc == found) in ieee80211_cancel_roc()
786 ieee80211_roc_notify_destroy(roc); in ieee80211_cancel_roc()
1066 struct ieee80211_roc_work *roc, *tmp; in ieee80211_roc_purge() local
1071 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_roc_purge()
1072 if (sdata && roc->sdata != sdata) in ieee80211_roc_purge()
1075 if (roc->started) { in ieee80211_roc_purge()
1078 drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_roc_purge()
1079 ieee80211_roc_notify_destroy(roc); in ieee80211_roc_purge()
1081 roc->abort = true; in ieee80211_roc_purge()
1085 ieee80211_roc_notify_destroy(roc); in ieee80211_roc_purge()