Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203054
b: refs/heads/master
c: ff61638
h: refs/heads/master
v: v3
  • Loading branch information
Juuso Oikarinen authored and John W. Linville committed Jun 15, 2010
1 parent d75ba78 commit 4e7b478
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 685429623f88d84f98bd5daffc3c427c408740d4
refs/heads/master: ff61638105db6f5832ef8700436ba6aa6d3a2fda
5 changes: 1 addition & 4 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,6 @@ enum ieee80211_smps_mode {
* @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the
* powersave documentation below. This variable is valid only when
* the CONF_PS flag is set.
* @dynamic_ps_forced_timeout: The dynamic powersave timeout (in ms) configured
* by cfg80211 (essentially, wext) If set, this value overrules the value
* chosen by mac80211 based on ps qos network latency.
*
* @power_level: requested transmit power (in dBm)
*
Expand All @@ -717,7 +714,7 @@ enum ieee80211_smps_mode {
*/
struct ieee80211_conf {
u32 flags;
int power_level, dynamic_ps_timeout, dynamic_ps_forced_timeout;
int power_level, dynamic_ps_timeout;
int max_sleep_period;

u16 listen_interval;
Expand Down
5 changes: 2 additions & 3 deletions trunk/net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,6 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_conf *conf = &local->hw.conf;

if (sdata->vif.type != NL80211_IFTYPE_STATION)
return -EOPNOTSUPP;
Expand All @@ -1455,11 +1454,11 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
return -EOPNOTSUPP;

if (enabled == sdata->u.mgd.powersave &&
timeout == conf->dynamic_ps_forced_timeout)
timeout == local->dynamic_ps_forced_timeout)
return 0;

sdata->u.mgd.powersave = enabled;
conf->dynamic_ps_forced_timeout = timeout;
local->dynamic_ps_forced_timeout = timeout;

/* no change, but if automatic follow powersave */
mutex_lock(&sdata->u.mgd.mtx);
Expand Down
6 changes: 6 additions & 0 deletions trunk/net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,12 @@ struct ieee80211_local {
struct notifier_block network_latency_notifier;
struct notifier_block ifa_notifier;

/*
* The dynamic ps timeout configured from user space via WEXT -
* this will override whatever chosen by mac80211 internally.
*/
int dynamic_ps_forced_timeout;

int user_power_level; /* in dBm */
int power_constr_level; /* in dBm */

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)

local->hw.conf.listen_interval = local->hw.max_listen_interval;

local->hw.conf.dynamic_ps_forced_timeout = -1;
local->dynamic_ps_forced_timeout = -1;

result = sta_info_start(local);
if (result < 0)
Expand Down
16 changes: 6 additions & 10 deletions trunk/net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,23 +561,19 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency)
beaconint_us = ieee80211_tu_to_usec(
found->vif.bss_conf.beacon_int);

timeout = local->hw.conf.dynamic_ps_forced_timeout;
timeout = local->dynamic_ps_forced_timeout;
if (timeout < 0) {
/*
* Go to full PSM if the user configures a very low
* latency requirement.
* The 2 second value is there for compatibility until
* the PM_QOS_NETWORK_LATENCY is configured with real
* values.
*/
if (latency == 2000000000)
timeout = 100;
else if (latency <= 50000)
timeout = 300;
else if (latency <= 100000)
timeout = 100;
else if (latency <= 500000)
timeout = 50;
else
if (latency > 1900000000 && latency != 2000000000)
timeout = 0;
else
timeout = 100;
}
local->hw.conf.dynamic_ps_timeout = timeout;

Expand Down

0 comments on commit 4e7b478

Please sign in to comment.