aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-10-22 05:41:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:46 -0400
commitddf4ac53fb8a12a027c0486db743ae040f45b56a (patch)
tree08a8841651017e612afb93919340e4972d8df5e3 /net/mac80211/mlme.c
parentcfa3fa405a5eafd5d5c53b18abc00ca998c35eef (diff)
mac80211: insert AP sta entry after filling it
We never clearly defined the semantics of the sta_notify callback and it was originally posted for iwlwifi which still doesn't use it at all. With the recent HT rework ath9k started relying on it, but I made a mistake there in that I made ath9k assume the HT information has already been filled in at sta_notify time. This isn't a hard thing to do, so do it. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 4cfbb9f09ac9..026f07a173b6 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1182,7 +1182,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
1182 u8 *pos; 1182 u8 *pos;
1183 u32 changed = 0; 1183 u32 changed = 0;
1184 int i, j; 1184 int i, j;
1185 bool have_higher_than_11mbit = false; 1185 bool have_higher_than_11mbit = false, newsta = false;
1186 u16 ap_ht_cap_flags; 1186 u16 ap_ht_cap_flags;
1187 1187
1188 /* AssocResp and ReassocResp have identical structure, so process both 1188 /* AssocResp and ReassocResp have identical structure, so process both
@@ -1246,7 +1246,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
1246 sta = sta_info_get(local, ifsta->bssid); 1246 sta = sta_info_get(local, ifsta->bssid);
1247 if (!sta) { 1247 if (!sta) {
1248 struct ieee80211_bss *bss; 1248 struct ieee80211_bss *bss;
1249 int err; 1249
1250 newsta = true;
1250 1251
1251 sta = sta_info_alloc(sdata, ifsta->bssid, GFP_ATOMIC); 1252 sta = sta_info_alloc(sdata, ifsta->bssid, GFP_ATOMIC);
1252 if (!sta) { 1253 if (!sta) {
@@ -1265,13 +1266,6 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
1265 ieee80211_rx_bss_put(local, bss); 1266 ieee80211_rx_bss_put(local, bss);
1266 } 1267 }
1267 1268
1268 err = sta_info_insert(sta);
1269 if (err) {
1270 printk(KERN_DEBUG "%s: failed to insert STA entry for"
1271 " the AP (error %d)\n", sdata->dev->name, err);
1272 rcu_read_unlock();
1273 return;
1274 }
1275 /* update new sta with its last rx activity */ 1269 /* update new sta with its last rx activity */
1276 sta->last_rx = jiffies; 1270 sta->last_rx = jiffies;
1277 } 1271 }
@@ -1339,13 +1333,24 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
1339 1333
1340 rate_control_rate_init(sta); 1334 rate_control_rate_init(sta);
1341 1335
1342 if (elems.wmm_param) { 1336 if (elems.wmm_param)
1343 set_sta_flags(sta, WLAN_STA_WME); 1337 set_sta_flags(sta, WLAN_STA_WME);
1344 rcu_read_unlock(); 1338
1339 if (newsta) {
1340 int err = sta_info_insert(sta);
1341 if (err) {
1342 printk(KERN_DEBUG "%s: failed to insert STA entry for"
1343 " the AP (error %d)\n", sdata->dev->name, err);
1344 rcu_read_unlock();
1345 return;
1346 }
1347 }
1348
1349 rcu_read_unlock();
1350
1351 if (elems.wmm_param)
1345 ieee80211_sta_wmm_params(local, ifsta, elems.wmm_param, 1352 ieee80211_sta_wmm_params(local, ifsta, elems.wmm_param,
1346 elems.wmm_param_len); 1353 elems.wmm_param_len);
1347 } else
1348 rcu_read_unlock();
1349 1354
1350 if (elems.ht_info_elem && elems.wmm_param && 1355 if (elems.ht_info_elem && elems.wmm_param &&
1351 (ifsta->flags & IEEE80211_STA_WMM_ENABLED)) 1356 (ifsta->flags & IEEE80211_STA_WMM_ENABLED))