summaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-01-13 19:42:58 +0200
committerJohannes Berg <johannes.berg@intel.com>2014-02-04 21:48:05 +0100
commit0cb4d4dceb4b7a31c6af0159cac2cec5fbe294a2 (patch)
treea08f4ad99025b4cb6948a923eefbaec3d5be6a1f /net/mac80211/cfg.c
parent77d143de75812596a58d126606f42d1214e09dde (diff)
downloadlinux-stable-0cb4d4dceb4b7a31c6af0159cac2cec5fbe294a2.tar.gz
linux-stable-0cb4d4dceb4b7a31c6af0159cac2cec5fbe294a2.tar.bz2
linux-stable-0cb4d4dceb4b7a31c6af0159cac2cec5fbe294a2.zip
mac80211: refactor ieee80211_mesh_process_chanswitch()
Refactor ieee80211_mesh_process_chanswitch() to use ieee80211_channel_switch() and avoid code duplication. Tested-by: Simon Wunderlich <sw@simonwunderlich.de> Acked-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index f9ae9b85d4c1..f111f8df4e65 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3164,15 +3164,18 @@ int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
params->chandef.chan->band)
return -EINVAL;
- ifmsh->chsw_init = true;
if (!ifmsh->pre_value)
ifmsh->pre_value = 1;
else
ifmsh->pre_value++;
- err = ieee80211_mesh_csa_beacon(sdata, params, true);
+ if (ifmsh->csa_role == IEEE80211_MESH_CSA_ROLE_NONE)
+ ifmsh->csa_role = IEEE80211_MESH_CSA_ROLE_INIT;
+
+ err = ieee80211_mesh_csa_beacon(sdata, params,
+ (ifmsh->csa_role == IEEE80211_MESH_CSA_ROLE_INIT));
if (err < 0) {
- ifmsh->chsw_init = false;
+ ifmsh->csa_role = IEEE80211_MESH_CSA_ROLE_NONE;
return err;
}
break;