diff options
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 35d850223a75..358226f63b81 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -175,6 +175,8 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata, | |||
175 | ht_changed = conf_is_ht(&local->hw.conf) != enable_ht || | 175 | ht_changed = conf_is_ht(&local->hw.conf) != enable_ht || |
176 | channel_type != local->hw.conf.channel_type; | 176 | channel_type != local->hw.conf.channel_type; |
177 | 177 | ||
178 | if (local->tmp_channel) | ||
179 | local->tmp_channel_type = channel_type; | ||
178 | local->oper_channel_type = channel_type; | 180 | local->oper_channel_type = channel_type; |
179 | 181 | ||
180 | if (ht_changed) { | 182 | if (ht_changed) { |
@@ -476,6 +478,7 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency) | |||
476 | { | 478 | { |
477 | struct ieee80211_sub_if_data *sdata, *found = NULL; | 479 | struct ieee80211_sub_if_data *sdata, *found = NULL; |
478 | int count = 0; | 480 | int count = 0; |
481 | int timeout; | ||
479 | 482 | ||
480 | if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) { | 483 | if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) { |
481 | local->ps_sdata = NULL; | 484 | local->ps_sdata = NULL; |
@@ -509,6 +512,26 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency) | |||
509 | beaconint_us = ieee80211_tu_to_usec( | 512 | beaconint_us = ieee80211_tu_to_usec( |
510 | found->vif.bss_conf.beacon_int); | 513 | found->vif.bss_conf.beacon_int); |
511 | 514 | ||
515 | timeout = local->hw.conf.dynamic_ps_forced_timeout; | ||
516 | if (timeout < 0) { | ||
517 | /* | ||
518 | * The 2 second value is there for compatibility until | ||
519 | * the PM_QOS_NETWORK_LATENCY is configured with real | ||
520 | * values. | ||
521 | */ | ||
522 | if (latency == 2000000000) | ||
523 | timeout = 100; | ||
524 | else if (latency <= 50000) | ||
525 | timeout = 300; | ||
526 | else if (latency <= 100000) | ||
527 | timeout = 100; | ||
528 | else if (latency <= 500000) | ||
529 | timeout = 50; | ||
530 | else | ||
531 | timeout = 0; | ||
532 | } | ||
533 | local->hw.conf.dynamic_ps_timeout = timeout; | ||
534 | |||
512 | if (beaconint_us > latency) { | 535 | if (beaconint_us > latency) { |
513 | local->ps_sdata = NULL; | 536 | local->ps_sdata = NULL; |
514 | } else { | 537 | } else { |
@@ -1331,12 +1354,17 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata, | |||
1331 | mutex_lock(&sdata->local->iflist_mtx); | 1354 | mutex_lock(&sdata->local->iflist_mtx); |
1332 | ieee80211_recalc_ps(sdata->local, -1); | 1355 | ieee80211_recalc_ps(sdata->local, -1); |
1333 | mutex_unlock(&sdata->local->iflist_mtx); | 1356 | mutex_unlock(&sdata->local->iflist_mtx); |
1357 | |||
1358 | if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR) | ||
1359 | return; | ||
1360 | |||
1334 | /* | 1361 | /* |
1335 | * We've received a probe response, but are not sure whether | 1362 | * We've received a probe response, but are not sure whether |
1336 | * we have or will be receiving any beacons or data, so let's | 1363 | * we have or will be receiving any beacons or data, so let's |
1337 | * schedule the timers again, just in case. | 1364 | * schedule the timers again, just in case. |
1338 | */ | 1365 | */ |
1339 | mod_beacon_timer(sdata); | 1366 | mod_beacon_timer(sdata); |
1367 | |||
1340 | mod_timer(&ifmgd->conn_mon_timer, | 1368 | mod_timer(&ifmgd->conn_mon_timer, |
1341 | round_jiffies_up(jiffies + | 1369 | round_jiffies_up(jiffies + |
1342 | IEEE80211_CONNECTION_IDLE_TIME)); | 1370 | IEEE80211_CONNECTION_IDLE_TIME)); |