sdata->csa_radar_required = params->radar_required;
sdata->csa_chandef = params->chandef;
sdata->csa_block_tx = params->block_tx;
+ sdata->csa_current_counter = params->count;
sdata->vif.csa_active = true;
if (sdata->csa_block_tx)
bool need_offchan = false;
u32 flags;
int ret;
+ u8 *data;
if (params->dont_wait_for_ack)
flags = IEEE80211_TX_CTL_NO_ACK;
}
skb_reserve(skb, local->hw.extra_tx_headroom);
- memcpy(skb_put(skb, params->len), params->buf, params->len);
+ data = skb_put(skb, params->len);
+ memcpy(data, params->buf, params->len);
+
+ /* Update CSA counters */
+ if (sdata->vif.csa_active &&
+ (sdata->vif.type == NL80211_IFTYPE_AP ||
+ sdata->vif.type == NL80211_IFTYPE_ADHOC) &&
+ params->n_csa_offsets) {
+ int i;
+
+ for (i = 0; i < params->n_csa_offsets; i++)
+ data[params->csa_offsets[i]] =
+ sdata->csa_current_counter;
+ }
IEEE80211_SKB_CB(skb)->flags = flags;
struct ieee80211_chanctx *reserved_chanctx;
struct cfg80211_chan_def reserved_chandef;
bool reserved_radar_required;
+ u8 csa_current_counter;
/* used to reconfigure hardware SM PS */
struct work_struct recalc_smps;
if (WARN_ON(beacon_data[counter_offset_beacon] == 1))
return;
- beacon_data[counter_offset_beacon]--;
+ sdata->csa_current_counter--;
+ beacon_data[counter_offset_beacon] = sdata->csa_current_counter;
if (sdata->vif.type == NL80211_IFTYPE_AP && counter_offset_presp) {
rcu_read_lock();
rcu_read_unlock();
return;
}
- resp->data[counter_offset_presp]--;
+ resp->data[counter_offset_presp] = sdata->csa_current_counter;
rcu_read_unlock();
}
}