Lines Matching refs:roc

169 static void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc)  in ieee80211_roc_notify_destroy()  argument
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()
189 kfree(roc); in ieee80211_roc_notify_destroy()
195 struct ieee80211_roc_work *roc, *tmp; in ieee80211_end_finished_rocs() local
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()
215 ieee80211_roc_notify_destroy(roc); in ieee80211_end_finished_rocs()
235 static void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc, in ieee80211_handle_roc_started() argument
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()
263 struct ieee80211_roc_work *roc; in ieee80211_hw_roc_start() local
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()
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()
355 roc->on_channel = roc->chan == local->_oper_chandef.chan && 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()
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()
385 struct ieee80211_roc_work *roc; in ieee80211_start_next_roc() local
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()
415 struct ieee80211_roc_work *roc; in __ieee80211_roc_work() local
423 roc = list_first_entry_or_null(&local->roc_list, in __ieee80211_roc_work()
425 if (!roc) in __ieee80211_roc_work()
428 if (!roc->started) { in __ieee80211_roc_work()
432 on_channel = roc->on_channel; in __ieee80211_roc_work()
534 struct ieee80211_roc_work *roc, *tmp; in ieee80211_start_roc_work() local
547 roc = kzalloc(sizeof(*roc), GFP_KERNEL); in ieee80211_start_roc_work()
548 if (!roc) 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()
586 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
596 kfree(roc); 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()
617 list_add(&roc->list, &tmp->list); 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()
648 ieee80211_handle_roc_started(roc, now); in ieee80211_start_roc_work()
653 queued = ieee80211_coalesce_hw_started_roc(local, roc, tmp); in ieee80211_start_roc_work()
665 list_add_tail(&roc->list, &local->roc_list); in ieee80211_start_roc_work()
690 struct ieee80211_roc_work *roc, *tmp, *found = NULL; in ieee80211_cancel_roc() local
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()
705 found = roc; in ieee80211_cancel_roc()
720 ret = drv_cancel_remain_on_channel(local, roc->sdata); 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()
734 if (roc == found) in ieee80211_cancel_roc()
736 ieee80211_roc_notify_destroy(roc); in ieee80211_cancel_roc()
968 struct ieee80211_roc_work *roc, *tmp; in ieee80211_roc_purge() local
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()
980 ieee80211_roc_notify_destroy(roc); in ieee80211_roc_purge()
982 roc->abort = true; in ieee80211_roc_purge()
986 ieee80211_roc_notify_destroy(roc); in ieee80211_roc_purge()