Lines Matching refs:roc
169 static void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc)
172 if (roc->frame) {
173 cfg80211_mgmt_tx_status(&roc->sdata->wdev, roc->mgmt_tx_cookie,
174 roc->frame->data, roc->frame->len,
176 ieee80211_free_txskb(&roc->sdata->local->hw, roc->frame);
179 if (!roc->mgmt_tx_cookie)
180 cfg80211_remain_on_channel_expired(&roc->sdata->wdev,
181 roc->cookie, roc->chan,
184 cfg80211_tx_mgmt_expired(&roc->sdata->wdev,
185 roc->mgmt_tx_cookie,
186 roc->chan, GFP_KERNEL);
188 list_del(&roc->list);
189 kfree(roc);
195 struct ieee80211_roc_work *roc, *tmp;
200 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
203 if (!roc->started)
206 remaining = roc->start_time +
207 msecs_to_jiffies(roc->duration) -
214 if (roc->abort || roc->hw_begun || remaining <= 0)
215 ieee80211_roc_notify_destroy(roc);
235 static void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc,
238 if (WARN_ON(roc->notified))
241 roc->start_time = start_time;
242 roc->started = true;
244 if (roc->mgmt_tx_cookie) {
245 if (!WARN_ON(!roc->frame)) {
246 ieee80211_tx_skb_tid_band(roc->sdata, roc->frame, 7,
247 roc->chan->band);
248 roc->frame = NULL;
251 cfg80211_ready_on_channel(&roc->sdata->wdev, roc->cookie,
252 roc->chan, roc->req_duration,
256 roc->notified = true;
263 struct ieee80211_roc_work *roc;
267 list_for_each_entry(roc, &local->roc_list, list) {
268 if (!roc->started)
271 roc->hw_begun = true;
272 ieee80211_handle_roc_started(roc, local->hw_roc_start_time);
292 struct ieee80211_roc_work *roc, *tmp;
301 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work,
304 if (WARN_ON(roc->started))
307 min_dur = roc->duration;
308 max_dur = roc->duration;
309 type = roc->type;
312 if (tmp == roc)
314 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan)
322 int ret = drv_remain_on_channel(local, roc->sdata, roc->chan,
333 if (tmp->sdata != roc->sdata ||
334 tmp->chan != roc->chan)
345 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan)
355 roc->on_channel = roc->chan == local->_oper_chandef.chan &&
362 if (!roc->on_channel) {
365 local->tmp_channel = roc->chan;
374 if (tmp->sdata != roc->sdata || tmp->chan != roc->chan)
377 tmp->on_channel = roc->on_channel;
385 struct ieee80211_roc_work *roc;
394 /* defer roc if driver is not started (i.e. during reconfig) */
398 roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work,
401 if (WARN_ON_ONCE(roc->started))
415 struct ieee80211_roc_work *roc;
423 roc = list_first_entry_or_null(&local->roc_list,
425 if (!roc)
428 if (!roc->started) {
432 on_channel = roc->on_channel;
436 /* careful - roc pointer became invalid during recalc */
471 /* if there's another roc, start it now */
534 struct ieee80211_roc_work *roc, *tmp;
547 roc = kzalloc(sizeof(*roc), GFP_KERNEL);
548 if (!roc)
563 roc->chan = channel;
564 roc->duration = duration;
565 roc->req_duration = duration;
566 roc->frame = txskb;
567 roc->type = type;
568 roc->sdata = sdata;
571 * cookie is either the roc cookie (for normal roc)
575 roc->cookie = ieee80211_mgmt_tx_cookie(local);
576 *cookie = roc->cookie;
578 roc->mgmt_tx_cookie = *cookie;
586 list_add_tail(&roc->list, &local->roc_list);
596 kfree(roc);
599 roc->started = true;
600 list_add_tail(&roc->list, &local->roc_list);
617 list_add(&roc->list, &tmp->list);
640 if (elapsed + roc->duration > max_roc) {
645 list_add(&roc->list, &tmp->list);
647 roc->on_channel = tmp->on_channel;
648 ieee80211_handle_roc_started(roc, now);
653 queued = ieee80211_coalesce_hw_started_roc(local, roc, tmp);
665 list_add_tail(&roc->list, &local->roc_list);
690 struct ieee80211_roc_work *roc, *tmp, *found = NULL;
699 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
700 if (!mgmt_tx && roc->cookie != cookie)
702 else if (mgmt_tx && roc->mgmt_tx_cookie != cookie)
705 found = roc;
720 ret = drv_cancel_remain_on_channel(local, roc->sdata);
731 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
732 if (!roc->started)
734 if (roc == found)
736 ieee80211_roc_notify_destroy(roc);
968 struct ieee80211_roc_work *roc, *tmp;
972 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
973 if (sdata && roc->sdata != sdata)
976 if (roc->started) {
980 ieee80211_roc_notify_destroy(roc);
982 roc->abort = true;
986 ieee80211_roc_notify_destroy(roc);