Lines Matching refs:roc

189 static void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc)  in ieee80211_roc_notify_destroy()  argument
192 if (roc->frame) { in ieee80211_roc_notify_destroy()
193 cfg80211_mgmt_tx_status(&roc->sdata->wdev, roc->mgmt_tx_cookie, in ieee80211_roc_notify_destroy()
194 roc->frame->data, roc->frame->len, in ieee80211_roc_notify_destroy()
196 ieee80211_free_txskb(&roc->sdata->local->hw, roc->frame); in ieee80211_roc_notify_destroy()
199 if (!roc->mgmt_tx_cookie) in ieee80211_roc_notify_destroy()
200 cfg80211_remain_on_channel_expired(&roc->sdata->wdev, in ieee80211_roc_notify_destroy()
201 roc->cookie, roc->chan, in ieee80211_roc_notify_destroy()
204 cfg80211_tx_mgmt_expired(&roc->sdata->wdev, in ieee80211_roc_notify_destroy()
205 roc->mgmt_tx_cookie, in ieee80211_roc_notify_destroy()
206 roc->chan, GFP_KERNEL); in ieee80211_roc_notify_destroy()
208 list_del(&roc->list); in ieee80211_roc_notify_destroy()
209 kfree(roc); in ieee80211_roc_notify_destroy()
215 struct ieee80211_roc_work *roc, *tmp; in ieee80211_end_finished_rocs() local
220 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_end_finished_rocs()
223 if (!roc->started) in ieee80211_end_finished_rocs()
226 remaining = roc->start_time + in ieee80211_end_finished_rocs()
227 msecs_to_jiffies(roc->duration) - in ieee80211_end_finished_rocs()
234 if (roc->abort || roc->hw_begun || remaining <= 0) in ieee80211_end_finished_rocs()
235 ieee80211_roc_notify_destroy(roc); in ieee80211_end_finished_rocs()
255 static void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc, in ieee80211_handle_roc_started() argument
258 if (WARN_ON(roc->notified)) in ieee80211_handle_roc_started()
261 roc->start_time = start_time; in ieee80211_handle_roc_started()
262 roc->started = true; in ieee80211_handle_roc_started()
264 if (roc->mgmt_tx_cookie) { in ieee80211_handle_roc_started()
265 if (!WARN_ON(!roc->frame)) { in ieee80211_handle_roc_started()
266 ieee80211_tx_skb_tid_band(roc->sdata, roc->frame, 7, in ieee80211_handle_roc_started()
267 roc->chan->band, 0); in ieee80211_handle_roc_started()
268 roc->frame = NULL; in ieee80211_handle_roc_started()
271 cfg80211_ready_on_channel(&roc->sdata->wdev, roc->cookie, in ieee80211_handle_roc_started()
272 roc->chan, roc->req_duration, in ieee80211_handle_roc_started()
276 roc->notified = true; in ieee80211_handle_roc_started()
283 struct ieee80211_roc_work *roc; in ieee80211_hw_roc_start() local
287 list_for_each_entry(roc, &local->roc_list, list) { in ieee80211_hw_roc_start()
288 if (!roc->started) in ieee80211_hw_roc_start()
291 roc->hw_begun = true; in ieee80211_hw_roc_start()
292 ieee80211_handle_roc_started(roc, local->hw_roc_start_time); in ieee80211_hw_roc_start()
312 struct ieee80211_roc_work *roc, *tmp; in _ieee80211_start_next_roc() local
321 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in _ieee80211_start_next_roc()
324 if (WARN_ON(roc->started)) in _ieee80211_start_next_roc()
327 min_dur = roc->duration; in _ieee80211_start_next_roc()
328 max_dur = roc->duration; in _ieee80211_start_next_roc()
329 type = roc->type; in _ieee80211_start_next_roc()
332 if (tmp == roc) in _ieee80211_start_next_roc()
334 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan) in _ieee80211_start_next_roc()
342 int ret = drv_remain_on_channel(local, roc->sdata, roc->chan, in _ieee80211_start_next_roc()
353 if (tmp->sdata != roc->sdata || in _ieee80211_start_next_roc()
354 tmp->chan != roc->chan) in _ieee80211_start_next_roc()
365 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan) in _ieee80211_start_next_roc()
375 roc->on_channel = roc->chan == local->_oper_chandef.chan && in _ieee80211_start_next_roc()
382 if (!roc->on_channel) { in _ieee80211_start_next_roc()
385 local->tmp_channel = roc->chan; in _ieee80211_start_next_roc()
394 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan) in _ieee80211_start_next_roc()
397 tmp->on_channel = roc->on_channel; in _ieee80211_start_next_roc()
405 struct ieee80211_roc_work *roc; in ieee80211_start_next_roc() local
418 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, in ieee80211_start_next_roc()
421 if (WARN_ON_ONCE(roc->started)) in ieee80211_start_next_roc()
435 struct ieee80211_roc_work *roc; in __ieee80211_roc_work() local
443 roc = list_first_entry_or_null(&local->roc_list, in __ieee80211_roc_work()
445 if (!roc) in __ieee80211_roc_work()
448 if (!roc->started) { in __ieee80211_roc_work()
452 on_channel = roc->on_channel; in __ieee80211_roc_work()
554 struct ieee80211_roc_work *roc, *tmp; in ieee80211_start_roc_work() local
563 roc = kzalloc(sizeof(*roc), GFP_KERNEL); in ieee80211_start_roc_work()
564 if (!roc) in ieee80211_start_roc_work()
579 roc->chan = channel; in ieee80211_start_roc_work()
580 roc->duration = duration; in ieee80211_start_roc_work()
581 roc->req_duration = duration; in ieee80211_start_roc_work()
582 roc->frame = txskb; in ieee80211_start_roc_work()
583 roc->type = type; in ieee80211_start_roc_work()
584 roc->sdata = sdata; in ieee80211_start_roc_work()
591 roc->cookie = ieee80211_mgmt_tx_cookie(local); in ieee80211_start_roc_work()
592 *cookie = roc->cookie; in ieee80211_start_roc_work()
594 roc->mgmt_tx_cookie = *cookie; in ieee80211_start_roc_work()
602 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
612 kfree(roc); in ieee80211_start_roc_work()
615 roc->started = true; in ieee80211_start_roc_work()
616 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
633 list_add(&roc->list, &tmp->list); in ieee80211_start_roc_work()
656 if (elapsed + roc->duration > max_roc) { in ieee80211_start_roc_work()
661 list_add(&roc->list, &tmp->list); in ieee80211_start_roc_work()
663 roc->on_channel = tmp->on_channel; in ieee80211_start_roc_work()
664 ieee80211_handle_roc_started(roc, now); in ieee80211_start_roc_work()
669 queued = ieee80211_coalesce_hw_started_roc(local, roc, tmp); in ieee80211_start_roc_work()
681 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
706 struct ieee80211_roc_work *roc, *tmp, *found = NULL; in ieee80211_cancel_roc() local
715 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
716 if (!mgmt_tx && roc->cookie != cookie) in ieee80211_cancel_roc()
718 else if (mgmt_tx && roc->mgmt_tx_cookie != cookie) in ieee80211_cancel_roc()
721 found = roc; in ieee80211_cancel_roc()
736 ret = drv_cancel_remain_on_channel(local, roc->sdata); in ieee80211_cancel_roc()
747 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_cancel_roc()
748 if (!roc->started) in ieee80211_cancel_roc()
750 if (roc == found) in ieee80211_cancel_roc()
752 ieee80211_roc_notify_destroy(roc); in ieee80211_cancel_roc()
984 struct ieee80211_roc_work *roc, *tmp; in ieee80211_roc_purge() local
988 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { in ieee80211_roc_purge()
989 if (sdata && roc->sdata != sdata) in ieee80211_roc_purge()
992 if (roc->started) { in ieee80211_roc_purge()
996 ieee80211_roc_notify_destroy(roc); in ieee80211_roc_purge()
998 roc->abort = true; in ieee80211_roc_purge()
1002 ieee80211_roc_notify_destroy(roc); in ieee80211_roc_purge()