diff options
author | Luciano Coelho <luciano.coelho@intel.com> | 2014-01-13 19:42:58 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-02-04 21:48:05 +0100 |
commit | 0cb4d4dceb4b7a31c6af0159cac2cec5fbe294a2 (patch) | |
tree | a08f4ad99025b4cb6948a923eefbaec3d5be6a1f /net/mac80211/cfg.c | |
parent | 77d143de75812596a58d126606f42d1214e09dde (diff) |
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.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index f9ae9b85d4c..f111f8df4e6 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; |