diff options
Diffstat (limited to 'net/mac80211/mesh.c')
-rw-r--r-- | net/mac80211/mesh.c | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 35ac38871420..2bf0158c3f82 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -149,6 +149,31 @@ u32 mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata) | |||
149 | return changed; | 149 | return changed; |
150 | } | 150 | } |
151 | 151 | ||
152 | /* | ||
153 | * mesh_sta_cleanup - clean up any mesh sta state | ||
154 | * | ||
155 | * @sta: mesh sta to clean up. | ||
156 | */ | ||
157 | void mesh_sta_cleanup(struct sta_info *sta) | ||
158 | { | ||
159 | struct ieee80211_sub_if_data *sdata = sta->sdata; | ||
160 | u32 changed; | ||
161 | |||
162 | /* | ||
163 | * maybe userspace handles peer allocation and peering, but in either | ||
164 | * case the beacon is still generated by the kernel and we might need | ||
165 | * an update. | ||
166 | */ | ||
167 | changed = mesh_accept_plinks_update(sdata); | ||
168 | if (sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) { | ||
169 | changed |= mesh_plink_deactivate(sta); | ||
170 | del_timer_sync(&sta->plink_timer); | ||
171 | } | ||
172 | |||
173 | if (changed) | ||
174 | ieee80211_bss_info_change_notify(sdata, changed); | ||
175 | } | ||
176 | |||
152 | int mesh_rmc_init(struct ieee80211_sub_if_data *sdata) | 177 | int mesh_rmc_init(struct ieee80211_sub_if_data *sdata) |
153 | { | 178 | { |
154 | int i; | 179 | int i; |
@@ -368,8 +393,6 @@ mesh_add_rsn_ie(struct sk_buff *skb, struct ieee80211_sub_if_data *sdata) | |||
368 | int mesh_add_ds_params_ie(struct sk_buff *skb, | 393 | int mesh_add_ds_params_ie(struct sk_buff *skb, |
369 | struct ieee80211_sub_if_data *sdata) | 394 | struct ieee80211_sub_if_data *sdata) |
370 | { | 395 | { |
371 | struct ieee80211_local *local = sdata->local; | ||
372 | struct ieee80211_supported_band *sband; | ||
373 | struct ieee80211_chanctx_conf *chanctx_conf; | 396 | struct ieee80211_chanctx_conf *chanctx_conf; |
374 | struct ieee80211_channel *chan; | 397 | struct ieee80211_channel *chan; |
375 | u8 *pos; | 398 | u8 *pos; |
@@ -386,13 +409,10 @@ int mesh_add_ds_params_ie(struct sk_buff *skb, | |||
386 | chan = chanctx_conf->def.chan; | 409 | chan = chanctx_conf->def.chan; |
387 | rcu_read_unlock(); | 410 | rcu_read_unlock(); |
388 | 411 | ||
389 | sband = local->hw.wiphy->bands[chan->band]; | 412 | pos = skb_put(skb, 2 + 1); |
390 | if (sband->band == IEEE80211_BAND_2GHZ) { | 413 | *pos++ = WLAN_EID_DS_PARAMS; |
391 | pos = skb_put(skb, 2 + 1); | 414 | *pos++ = 1; |
392 | *pos++ = WLAN_EID_DS_PARAMS; | 415 | *pos++ = ieee80211_frequency_to_channel(chan->center_freq); |
393 | *pos++ = 1; | ||
394 | *pos++ = ieee80211_frequency_to_channel(chan->center_freq); | ||
395 | } | ||
396 | 416 | ||
397 | return 0; | 417 | return 0; |
398 | } | 418 | } |