|
@@ -2638,6 +2638,24 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
|
|
|
INIT_DELAYED_WORK(&roc->work, ieee80211_sw_roc_work);
|
|
|
INIT_LIST_HEAD(&roc->dependents);
|
|
|
|
|
|
+ /*
|
|
|
+ * cookie is either the roc cookie (for normal roc)
|
|
|
+ * or the SKB (for mgmt TX)
|
|
|
+ */
|
|
|
+ if (!txskb) {
|
|
|
+ /* local->mtx protects this */
|
|
|
+ local->roc_cookie_counter++;
|
|
|
+ roc->cookie = local->roc_cookie_counter;
|
|
|
+ /* wow, you wrapped 64 bits ... more likely a bug */
|
|
|
+ if (WARN_ON(roc->cookie == 0)) {
|
|
|
+ roc->cookie = 1;
|
|
|
+ local->roc_cookie_counter++;
|
|
|
+ }
|
|
|
+ *cookie = roc->cookie;
|
|
|
+ } else {
|
|
|
+ *cookie = (unsigned long)txskb;
|
|
|
+ }
|
|
|
+
|
|
|
/* if there's one pending or we're scanning, queue this one */
|
|
|
if (!list_empty(&local->roc_list) ||
|
|
|
local->scanning || local->radar_detect_enabled)
|
|
@@ -2772,24 +2790,6 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
|
|
|
if (!queued)
|
|
|
list_add_tail(&roc->list, &local->roc_list);
|
|
|
|
|
|
- /*
|
|
|
- * cookie is either the roc cookie (for normal roc)
|
|
|
- * or the SKB (for mgmt TX)
|
|
|
- */
|
|
|
- if (!txskb) {
|
|
|
- /* local->mtx protects this */
|
|
|
- local->roc_cookie_counter++;
|
|
|
- roc->cookie = local->roc_cookie_counter;
|
|
|
- /* wow, you wrapped 64 bits ... more likely a bug */
|
|
|
- if (WARN_ON(roc->cookie == 0)) {
|
|
|
- roc->cookie = 1;
|
|
|
- local->roc_cookie_counter++;
|
|
|
- }
|
|
|
- *cookie = roc->cookie;
|
|
|
- } else {
|
|
|
- *cookie = (unsigned long)txskb;
|
|
|
- }
|
|
|
-
|
|
|
return 0;
|
|
|
}
|
|
|
|