mac80211: fix the beacon csa counter for mesh and ibss
authorChun-Yeow Yeoh <yeohchunyeow@gmail.com>
Tue, 9 Jun 2015 05:35:33 +0000 (13:35 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 9 Jun 2015 20:04:25 +0000 (22:04 +0200)
The csa counter has moved from sdata to beacon/presp but
it is not updated accordingly for mesh and ibss. Fix this.

Fixes: af296bdb8da4 ("mac80211: move csa counters from sdata to beacon/presp")
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/ibss.c
net/mac80211/mesh.c

index 1a17d3208d8f12e0005e86b937a17e492c4ad910..d1c94c6a12e16af9503455d9fce605317ff3daf9 100644 (file)
@@ -3437,6 +3437,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
        /* Update CSA counters */
        if (sdata->vif.csa_active &&
            (sdata->vif.type == NL80211_IFTYPE_AP ||
+            sdata->vif.type == NL80211_IFTYPE_MESH_POINT ||
             sdata->vif.type == NL80211_IFTYPE_ADHOC) &&
            params->n_csa_offsets) {
                int i;
index 21716af8bec32970a7c094b73124f5b5aa8c5d8c..7f72bc9bae2e71470f7bd4bf43b1be04b4622024 100644 (file)
@@ -146,6 +146,7 @@ ieee80211_ibss_build_presp(struct ieee80211_sub_if_data *sdata,
                                csa_settings->chandef.chan->center_freq);
                presp->csa_counter_offsets[0] = (pos - presp->head);
                *pos++ = csa_settings->count;
+               presp->csa_current_counter = csa_settings->count;
        }
 
        /* put the remaining rates in WLAN_EID_EXT_SUPP_RATES */
index d4684242e78bf6de3145f6311dce342af6d47adc..817098add1d6736e1632ba7f142a9b81465cd71f 100644 (file)
@@ -680,6 +680,7 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh)
                *pos++ = 0x0;
                *pos++ = ieee80211_frequency_to_channel(
                                csa->settings.chandef.chan->center_freq);
+               bcn->csa_current_counter = csa->settings.count;
                bcn->csa_counter_offsets[0] = hdr_len + 6;
                *pos++ = csa->settings.count;
                *pos++ = WLAN_EID_CHAN_SWITCH_PARAM;