diff options
author | Thomas Pedersen <thomas@cozybit.com> | 2012-04-26 18:01:06 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-05-08 21:53:42 -0400 |
commit | e87278e730b11e9852fe0fe967908ef5a4e6e6a0 (patch) | |
tree | 8dc6693f34ae940e2b399a0c313fca9b4bd3dc0f /net/mac80211/mesh_plink.c | |
parent | 2e4c14a5582addd655e53277861b7ad853bfd6c3 (diff) |
mac80211: insert mesh peer after init
Drivers need the station rate info when inserting a new sta_info. The
patch "mac80211: refactor mesh peer initialization" wrongly assumed the
rate info could be applied after insertion. After further review, this
is clearly not the case.
This fixes a regression where HT parameters were not applied before
inserting the sta_info, causing performance degradation.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh_plink.c')
-rw-r--r-- | net/mac80211/mesh_plink.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 1ff2a5c63e43..f4124d7c556c 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -102,9 +102,6 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata, | |||
102 | 102 | ||
103 | set_sta_flag(sta, WLAN_STA_WME); | 103 | set_sta_flag(sta, WLAN_STA_WME); |
104 | 104 | ||
105 | if (sta_info_insert(sta)) | ||
106 | return NULL; | ||
107 | |||
108 | return sta; | 105 | return sta; |
109 | } | 106 | } |
110 | 107 | ||
@@ -281,6 +278,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, | |||
281 | struct ieee80211_supported_band *sband; | 278 | struct ieee80211_supported_band *sband; |
282 | u32 rates, basic_rates = 0; | 279 | u32 rates, basic_rates = 0; |
283 | struct sta_info *sta; | 280 | struct sta_info *sta; |
281 | bool insert = false; | ||
284 | 282 | ||
285 | sband = local->hw.wiphy->bands[band]; | 283 | sband = local->hw.wiphy->bands[band]; |
286 | rates = ieee80211_sta_get_rates(local, elems, band, &basic_rates); | 284 | rates = ieee80211_sta_get_rates(local, elems, band, &basic_rates); |
@@ -290,6 +288,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, | |||
290 | sta = mesh_plink_alloc(sdata, addr); | 288 | sta = mesh_plink_alloc(sdata, addr); |
291 | if (!sta) | 289 | if (!sta) |
292 | return NULL; | 290 | return NULL; |
291 | insert = true; | ||
293 | } | 292 | } |
294 | 293 | ||
295 | spin_lock_bh(&sta->lock); | 294 | spin_lock_bh(&sta->lock); |
@@ -306,6 +305,9 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, | |||
306 | rate_control_rate_init(sta); | 305 | rate_control_rate_init(sta); |
307 | spin_unlock_bh(&sta->lock); | 306 | spin_unlock_bh(&sta->lock); |
308 | 307 | ||
308 | if (insert && sta_info_insert(sta)) | ||
309 | return NULL; | ||
310 | |||
309 | return sta; | 311 | return sta; |
310 | } | 312 | } |
311 | 313 | ||