diff options
author | Thomas Pedersen <thomas@cozybit.com> | 2013-02-13 15:14:19 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-15 03:41:09 -0500 |
commit | 39886b618aba3c39e650c191d601e26ec581ce0f (patch) | |
tree | 6a68823a37ba8e3b68293ad78d572653a5e0c72b /net/mac80211/cfg.c | |
parent | de74a1d9032f4d37ea453ad2a647e1aff4cd2591 (diff) |
mac80211: consolidate MBSS change notification
A few mesh utility functions will call
ieee80211_bss_info_change_notify(), and then the caller
might notify the driver of the same change again. Avoid
this redundancy by propagating the BSS changes and
generally calling bss_info_change_notify() once per
change.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 0969978c2d92..f4db30624f67 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1262,9 +1262,8 @@ static int sta_apply_parameters(struct ieee80211_local *local, | |||
1262 | 1262 | ||
1263 | if (ieee80211_vif_is_mesh(&sdata->vif)) { | 1263 | if (ieee80211_vif_is_mesh(&sdata->vif)) { |
1264 | #ifdef CONFIG_MAC80211_MESH | 1264 | #ifdef CONFIG_MAC80211_MESH |
1265 | u32 changed = 0; | ||
1265 | if (sdata->u.mesh.security & IEEE80211_MESH_SEC_SECURED) { | 1266 | if (sdata->u.mesh.security & IEEE80211_MESH_SEC_SECURED) { |
1266 | u32 changed = 0; | ||
1267 | |||
1268 | switch (params->plink_state) { | 1267 | switch (params->plink_state) { |
1269 | case NL80211_PLINK_ESTAB: | 1268 | case NL80211_PLINK_ESTAB: |
1270 | if (sta->plink_state != NL80211_PLINK_ESTAB) | 1269 | if (sta->plink_state != NL80211_PLINK_ESTAB) |
@@ -1273,8 +1272,8 @@ static int sta_apply_parameters(struct ieee80211_local *local, | |||
1273 | sta->plink_state = params->plink_state; | 1272 | sta->plink_state = params->plink_state; |
1274 | 1273 | ||
1275 | ieee80211_mps_sta_status_update(sta); | 1274 | ieee80211_mps_sta_status_update(sta); |
1276 | ieee80211_mps_set_sta_local_pm(sta, | 1275 | changed |= ieee80211_mps_set_sta_local_pm(sta, |
1277 | sdata->u.mesh.mshcfg.power_mode); | 1276 | sdata->u.mesh.mshcfg.power_mode); |
1278 | break; | 1277 | break; |
1279 | case NL80211_PLINK_LISTEN: | 1278 | case NL80211_PLINK_LISTEN: |
1280 | case NL80211_PLINK_BLOCKED: | 1279 | case NL80211_PLINK_BLOCKED: |
@@ -1288,26 +1287,29 @@ static int sta_apply_parameters(struct ieee80211_local *local, | |||
1288 | sta->plink_state = params->plink_state; | 1287 | sta->plink_state = params->plink_state; |
1289 | 1288 | ||
1290 | ieee80211_mps_sta_status_update(sta); | 1289 | ieee80211_mps_sta_status_update(sta); |
1291 | ieee80211_mps_local_status_update(sdata); | 1290 | changed |= |
1291 | ieee80211_mps_local_status_update(sdata); | ||
1292 | break; | 1292 | break; |
1293 | default: | 1293 | default: |
1294 | /* nothing */ | 1294 | /* nothing */ |
1295 | break; | 1295 | break; |
1296 | } | 1296 | } |
1297 | ieee80211_bss_info_change_notify(sdata, changed); | ||
1298 | } else { | 1297 | } else { |
1299 | switch (params->plink_action) { | 1298 | switch (params->plink_action) { |
1300 | case PLINK_ACTION_OPEN: | 1299 | case PLINK_ACTION_OPEN: |
1301 | mesh_plink_open(sta); | 1300 | changed |= mesh_plink_open(sta); |
1302 | break; | 1301 | break; |
1303 | case PLINK_ACTION_BLOCK: | 1302 | case PLINK_ACTION_BLOCK: |
1304 | mesh_plink_block(sta); | 1303 | changed |= mesh_plink_block(sta); |
1305 | break; | 1304 | break; |
1306 | } | 1305 | } |
1307 | } | 1306 | } |
1308 | 1307 | ||
1309 | if (params->local_pm) | 1308 | if (params->local_pm) |
1310 | ieee80211_mps_set_sta_local_pm(sta, params->local_pm); | 1309 | changed |= |
1310 | ieee80211_mps_set_sta_local_pm(sta, | ||
1311 | params->local_pm); | ||
1312 | ieee80211_bss_info_change_notify(sdata, changed); | ||
1311 | #endif | 1313 | #endif |
1312 | } | 1314 | } |
1313 | 1315 | ||