Commit e87278e7 authored by Thomas Pedersen's avatar Thomas Pedersen Committed by John W. Linville

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: default avatarThomas Pedersen <thomas@cozybit.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2e4c14a5
...@@ -102,9 +102,6 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata, ...@@ -102,9 +102,6 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
set_sta_flag(sta, WLAN_STA_WME); set_sta_flag(sta, WLAN_STA_WME);
if (sta_info_insert(sta))
return NULL;
return sta; return sta;
} }
...@@ -281,6 +278,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, ...@@ -281,6 +278,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
u32 rates, basic_rates = 0; u32 rates, basic_rates = 0;
struct sta_info *sta; struct sta_info *sta;
bool insert = false;
sband = local->hw.wiphy->bands[band]; sband = local->hw.wiphy->bands[band];
rates = ieee80211_sta_get_rates(local, elems, band, &basic_rates); 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,6 +288,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
sta = mesh_plink_alloc(sdata, addr); sta = mesh_plink_alloc(sdata, addr);
if (!sta) if (!sta)
return NULL; return NULL;
insert = true;
} }
spin_lock_bh(&sta->lock); spin_lock_bh(&sta->lock);
...@@ -306,6 +305,9 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, ...@@ -306,6 +305,9 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
rate_control_rate_init(sta); rate_control_rate_init(sta);
spin_unlock_bh(&sta->lock); spin_unlock_bh(&sta->lock);
if (insert && sta_info_insert(sta))
return NULL;
return sta; return sta;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment