Lines Matching refs:roc

171 static void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc)
174 if (roc->frame) {
175 cfg80211_mgmt_tx_status(&roc->sdata->wdev, roc->mgmt_tx_cookie,
176 roc->frame->data, roc->frame->len,
178 ieee80211_free_txskb(&roc->sdata->local->hw, roc->frame);
181 if (!roc->mgmt_tx_cookie)
182 cfg80211_remain_on_channel_expired(&roc->sdata->wdev,
183 roc->cookie, roc->chan,
186 cfg80211_tx_mgmt_expired(&roc->sdata->wdev,
187 roc->mgmt_tx_cookie,
188 roc->chan, GFP_KERNEL);
190 list_del(&roc->list);
191 kfree(roc);
197 struct ieee80211_roc_work *roc, *tmp;
202 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
205 if (!roc->started)
208 remaining = roc->start_time +
209 msecs_to_jiffies(roc->duration) -
216 if (roc->abort || roc->hw_begun || remaining <= 0)
217 ieee80211_roc_notify_destroy(roc);
237 static void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc,
240 if (WARN_ON(roc->notified))
243 roc->start_time = start_time;
244 roc->started = true;
246 if (roc->mgmt_tx_cookie) {
247 if (!WARN_ON(!roc->frame)) {
248 ieee80211_tx_skb_tid_band(roc->sdata, roc->frame, 7,
249 roc->chan->band);
250 roc->frame = NULL;
253 cfg80211_ready_on_channel(&roc->sdata->wdev, roc->cookie,
254 roc->chan, roc->req_duration,
258 roc->notified = true;
265 struct ieee80211_roc_work *roc;
269 list_for_each_entry(roc, &local->roc_list, list) {
270 if (!roc->started)
273 roc->hw_begun = true;
274 ieee80211_handle_roc_started(roc, local->hw_roc_start_time);
294 struct ieee80211_roc_work *roc, *tmp;
303 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work,
306 if (WARN_ON(roc->started))
309 min_dur = roc->duration;
310 max_dur = roc->duration;
311 type = roc->type;
314 if (tmp == roc)
316 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan)
324 int ret = drv_remain_on_channel(local, roc->sdata, roc->chan,
335 if (tmp->sdata != roc->sdata ||
336 tmp->chan != roc->chan)
347 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan)
357 roc->on_channel = roc->chan == local->_oper_chandef.chan &&
364 if (!roc->on_channel) {
367 local->tmp_channel = roc->chan;
376 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan)
379 tmp->on_channel = roc->on_channel;
387 struct ieee80211_roc_work *roc;
396 /* defer roc if driver is not started (i.e. during reconfig) */
400 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work,
403 if (WARN_ON_ONCE(roc->started))
417 struct ieee80211_roc_work *roc;
425 roc = list_first_entry_or_null(&local->roc_list,
427 if (!roc)
430 if (!roc->started) {
434 on_channel = roc->on_channel;
438 /* careful - roc pointer became invalid during recalc */
473 /* if there's another roc, start it now */
536 struct ieee80211_roc_work *roc, *tmp;
549 roc = kzalloc(sizeof(*roc), GFP_KERNEL);
550 if (!roc)
565 roc->chan = channel;
566 roc->duration = duration;
567 roc->req_duration = duration;
568 roc->frame = txskb;
569 roc->type = type;
570 roc->sdata = sdata;
573 * cookie is either the roc cookie (for normal roc)
577 roc->cookie = ieee80211_mgmt_tx_cookie(local);
578 *cookie = roc->cookie;
580 roc->mgmt_tx_cookie = *cookie;
588 list_add_tail(&roc->list, &local->roc_list);
598 kfree(roc);
601 roc->started = true;
602 list_add_tail(&roc->list, &local->roc_list);
619 list_add(&roc->list, &tmp->list);
642 if (elapsed + roc->duration > max_roc) {
647 list_add(&roc->list, &tmp->list);
649 roc->on_channel = tmp->on_channel;
650 ieee80211_handle_roc_started(roc, now);
655 queued = ieee80211_coalesce_hw_started_roc(local, roc, tmp);
667 list_add_tail(&roc->list, &local->roc_list);
692 struct ieee80211_roc_work *roc, *tmp, *found = NULL;
701 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
702 if (!mgmt_tx && roc->cookie != cookie)
704 else if (mgmt_tx && roc->mgmt_tx_cookie != cookie)
707 found = roc;
722 ret = drv_cancel_remain_on_channel(local, roc->sdata);
733 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
734 if (!roc->started)
736 if (roc == found)
738 ieee80211_roc_notify_destroy(roc);
1006 struct ieee80211_roc_work *roc, *tmp;
1010 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
1011 if (sdata && roc->sdata != sdata)
1014 if (roc->started) {
1017 drv_cancel_remain_on_channel(local, roc->sdata);
1018 ieee80211_roc_notify_destroy(roc);
1020 roc->abort = true;
1024 ieee80211_roc_notify_destroy(roc);