Commit 80879086 authored by Chun-Yeow Yeoh's avatar Chun-Yeow Yeoh Committed by Greg Kroah-Hartman

mac80211: fix the beacon csa counter for mesh and ibss

commit 8df734e8 upstream.

The csa counter has moved from sdata to beacon/presp but
it is not updated accordingly for mesh and ibss. Fix this.

Fixes: af296bdb ("mac80211: move csa counters from sdata to beacon/presp")
Signed-off-by: default avatarChun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ae41bfc6
...@@ -3356,6 +3356,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, ...@@ -3356,6 +3356,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
/* Update CSA counters */ /* Update CSA counters */
if (sdata->vif.csa_active && if (sdata->vif.csa_active &&
(sdata->vif.type == NL80211_IFTYPE_AP || (sdata->vif.type == NL80211_IFTYPE_AP ||
sdata->vif.type == NL80211_IFTYPE_MESH_POINT ||
sdata->vif.type == NL80211_IFTYPE_ADHOC) && sdata->vif.type == NL80211_IFTYPE_ADHOC) &&
params->n_csa_offsets) { params->n_csa_offsets) {
int i; int i;
......
...@@ -146,6 +146,7 @@ ieee80211_ibss_build_presp(struct ieee80211_sub_if_data *sdata, ...@@ -146,6 +146,7 @@ ieee80211_ibss_build_presp(struct ieee80211_sub_if_data *sdata,
csa_settings->chandef.chan->center_freq); csa_settings->chandef.chan->center_freq);
presp->csa_counter_offsets[0] = (pos - presp->head); presp->csa_counter_offsets[0] = (pos - presp->head);
*pos++ = csa_settings->count; *pos++ = csa_settings->count;
presp->csa_current_counter = csa_settings->count;
} }
/* put the remaining rates in WLAN_EID_EXT_SUPP_RATES */ /* put the remaining rates in WLAN_EID_EXT_SUPP_RATES */
......
...@@ -680,6 +680,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh) ...@@ -680,6 +680,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)
*pos++ = 0x0; *pos++ = 0x0;
*pos++ = ieee80211_frequency_to_channel( *pos++ = ieee80211_frequency_to_channel(
csa->settings.chandef.chan->center_freq); csa->settings.chandef.chan->center_freq);
bcn->csa_current_counter = csa->settings.count;
bcn->csa_counter_offsets[0] = hdr_len + 6; bcn->csa_counter_offsets[0] = hdr_len + 6;
*pos++ = csa->settings.count; *pos++ = csa->settings.count;
*pos++ = WLAN_EID_CHAN_SWITCH_PARAM; *pos++ = WLAN_EID_CHAN_SWITCH_PARAM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment