aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 425f66c70013..358226f63b81 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -478,6 +478,7 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency)
478{ 478{
479 struct ieee80211_sub_if_data *sdata, *found = NULL; 479 struct ieee80211_sub_if_data *sdata, *found = NULL;
480 int count = 0; 480 int count = 0;
481 int timeout;
481 482
482 if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) { 483 if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) {
483 local->ps_sdata = NULL; 484 local->ps_sdata = NULL;
@@ -511,6 +512,26 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency)
511 beaconint_us = ieee80211_tu_to_usec( 512 beaconint_us = ieee80211_tu_to_usec(
512 found->vif.bss_conf.beacon_int); 513 found->vif.bss_conf.beacon_int);
513 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
514 if (beaconint_us > latency) { 535 if (beaconint_us > latency) {
515 local->ps_sdata = NULL; 536 local->ps_sdata = NULL;
516 } else { 537 } else {