diff options
author | Luciano Coelho <luciano.coelho@intel.com> | 2014-01-13 12:42:58 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-02-04 15:48:05 -0500 |
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 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, | |||
3164 | params->chandef.chan->band) | 3164 | params->chandef.chan->band) |
3165 | return -EINVAL; | 3165 | return -EINVAL; |
3166 | 3166 | ||
3167 | ifmsh->chsw_init = true; | ||
3168 | if (!ifmsh->pre_value) | 3167 | if (!ifmsh->pre_value) |
3169 | ifmsh->pre_value = 1; | 3168 | ifmsh->pre_value = 1; |
3170 | else | 3169 | else |
3171 | ifmsh->pre_value++; | 3170 | ifmsh->pre_value++; |
3172 | 3171 | ||
3173 | err = ieee80211_mesh_csa_beacon(sdata, params, true); | 3172 | if (ifmsh->csa_role == IEEE80211_MESH_CSA_ROLE_NONE) |
3173 | ifmsh->csa_role = IEEE80211_MESH_CSA_ROLE_INIT; | ||
3174 | |||
3175 | err = ieee80211_mesh_csa_beacon(sdata, params, | ||
3176 | (ifmsh->csa_role == IEEE80211_MESH_CSA_ROLE_INIT)); | ||
3174 | if (err < 0) { | 3177 | if (err < 0) { |
3175 | ifmsh->chsw_init = false; | 3178 | ifmsh->csa_role = IEEE80211_MESH_CSA_ROLE_NONE; |
3176 | return err; | 3179 | return err; |
3177 | } | 3180 | } |
3178 | break; | 3181 | break; |