aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-06-03 16:31:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-06 15:20:23 -0400
commit2e8d397eeeb1f5bd932d20d6abc020afe7e63b0b (patch)
tree0624a43e9d334343abb457842be8cde524c4ee3f
parent2b0446c4205fb3e77b205276ecd36d30b82cbb84 (diff)
mac80211: add stations after AP start on reconfig
When performing a HW restart for an AP mode interface, add stations back only after the AP is beaconing. This mimics the normal flow of STA addition on AP. Some devices (wlcore) do not support adding stations before beaconing, so this has the added benefit of making recovery work for them. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/util.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index b007c6861032..1df4019f294b 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1279,14 +1279,19 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1279 /* add STAs back */ 1279 /* add STAs back */
1280 mutex_lock(&local->sta_mtx); 1280 mutex_lock(&local->sta_mtx);
1281 list_for_each_entry(sta, &local->sta_list, list) { 1281 list_for_each_entry(sta, &local->sta_list, list) {
1282 if (sta->uploaded) { 1282 enum ieee80211_sta_state state;
1283 enum ieee80211_sta_state state;
1284 1283
1285 for (state = IEEE80211_STA_NOTEXIST; 1284 if (!sta->uploaded)
1286 state < sta->sta_state; state++) 1285 continue;
1287 WARN_ON(drv_sta_state(local, sta->sdata, sta, 1286
1288 state, state + 1)); 1287 /* AP-mode stations will be added later */
1289 } 1288 if (sta->sdata->vif.type == NL80211_IFTYPE_AP)
1289 continue;
1290
1291 for (state = IEEE80211_STA_NOTEXIST;
1292 state < sta->sta_state; state++)
1293 WARN_ON(drv_sta_state(local, sta->sdata, sta, state,
1294 state + 1));
1290 } 1295 }
1291 mutex_unlock(&local->sta_mtx); 1296 mutex_unlock(&local->sta_mtx);
1292 1297
@@ -1383,6 +1388,24 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1383 } 1388 }
1384 } 1389 }
1385 1390
1391 /* APs are now beaconing, add back stations */
1392 mutex_lock(&local->sta_mtx);
1393 list_for_each_entry(sta, &local->sta_list, list) {
1394 enum ieee80211_sta_state state;
1395
1396 if (!sta->uploaded)
1397 continue;
1398
1399 if (sta->sdata->vif.type != NL80211_IFTYPE_AP)
1400 continue;
1401
1402 for (state = IEEE80211_STA_NOTEXIST;
1403 state < sta->sta_state; state++)
1404 WARN_ON(drv_sta_state(local, sta->sdata, sta, state,
1405 state + 1));
1406 }
1407 mutex_unlock(&local->sta_mtx);
1408
1386 /* add back keys */ 1409 /* add back keys */
1387 list_for_each_entry(sdata, &local->interfaces, list) 1410 list_for_each_entry(sdata, &local->interfaces, list)
1388 if (ieee80211_sdata_running(sdata)) 1411 if (ieee80211_sdata_running(sdata))