[PATCH 2/2] mac80211: initialize rate control after station inserted

Reinette Chatre
2009-08-27T23:34:58Z

From: Reinette Chatre <reinette.chatre@intel.com>

Station information may be needed by rate control algorithms, so call rate
scaling initialization after adding the station.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
net/mac80211/ibss.c | 3 ++-
net/mac80211/mlme.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 920ec87..040d184 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -413,11 +413,12 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
sta->sta.supp_rates[band] = supp_rates |
ieee80211_mandatory_rates(local, band);

- rate_control_rate_init(sta);

if (sta_info_insert(sta))
return NULL;

+ rate_control_rate_init(sta);
+
return sta;
}

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 97a278a..307b33c 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1554,8 +1554,6 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,

ap_ht_cap_flags = sta->sta.ht_cap.cap;

- rate_control_rate_init(sta);
-
if (ifmgd->flags & IEEE80211_STA_MFP_ENABLED)
set_sta_flags(sta, WLAN_STA_MFP);

@@ -1572,6 +1570,8 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
}
}

+ rate_control_rate_init(sta);
+
rcu_read_unlock();

if (elems.wmm_param)
--
1.5.6.3