Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122829
b: refs/heads/master
c: e0cb686
h: refs/heads/master
i:
  122827: 9cc2bcc
v: v3
  • Loading branch information
Kalle Valo authored and John W. Linville committed Dec 19, 2008
1 parent 528d8a9 commit 651445b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 9 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: d10d0e5707fb7b8afa7e68a14d69e752604ee294
refs/heads/master: e0cb686ff879dc9ac045ad7258ec687088d4e450
1 change: 1 addition & 0 deletions trunk/net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ struct ieee80211_local {
*/
int wifi_wme_noack_test;
unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */
bool powersave;

#ifdef CONFIG_MAC80211_DEBUGFS
struct local_debugfsdentries {
Expand Down
15 changes: 13 additions & 2 deletions trunk/net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,11 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
bss_info_changed |= BSS_CHANGED_BASIC_RATES;
ieee80211_bss_info_change_notify(sdata, bss_info_changed);

if (local->powersave) {
local->hw.conf.flags |= IEEE80211_CONF_PS;
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
}

netif_tx_start_all_queues(sdata->dev);
netif_carrier_on(sdata->dev);

Expand Down Expand Up @@ -812,7 +817,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
{
struct ieee80211_local *local = sdata->local;
struct sta_info *sta;
u32 changed = 0;
u32 changed = 0, config_changed = 0;

rcu_read_lock();

Expand Down Expand Up @@ -859,8 +864,14 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,

local->hw.conf.ht.enabled = false;
local->oper_channel_type = NL80211_CHAN_NO_HT;
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_HT);
config_changed |= IEEE80211_CONF_CHANGE_HT;

if (local->hw.conf.flags & IEEE80211_CONF_PS) {
local->hw.conf.flags &= ~IEEE80211_CONF_PS;
config_changed |= IEEE80211_CONF_CHANGE_PS;
}

ieee80211_hw_config(local, config_changed);
ieee80211_bss_info_change_notify(sdata, changed);

rcu_read_lock();
Expand Down
32 changes: 26 additions & 6 deletions trunk/net/mac80211/wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,25 +830,46 @@ static int ieee80211_ioctl_siwpower(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
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;
int ret = 0;
bool ps;

if (sdata->vif.type != NL80211_IFTYPE_STATION)
return -EINVAL;

if (wrq->disabled) {
conf->flags &= ~IEEE80211_CONF_PS;
return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
ps = false;
goto set;
}

switch (wrq->flags & IW_POWER_MODE) {
case IW_POWER_ON: /* If not specified */
case IW_POWER_MODE: /* If set all mask */
case IW_POWER_ALL_R: /* If explicitely state all */
conf->flags |= IEEE80211_CONF_PS;
ps = true;
break;
default: /* Otherwise we don't support it */
return -EINVAL;
}

return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
if (ps == local->powersave)
return ret;

set:
local->powersave = ps;

if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
if (local->powersave)
conf->flags |= IEEE80211_CONF_PS;
else
conf->flags &= ~IEEE80211_CONF_PS;

ret = ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
}

return ret;
}

static int ieee80211_ioctl_giwpower(struct net_device *dev,
Expand All @@ -857,9 +878,8 @@ static int ieee80211_ioctl_giwpower(struct net_device *dev,
char *extra)
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_conf *conf = &local->hw.conf;

wrqu->power.disabled = !(conf->flags & IEEE80211_CONF_PS);
wrqu->power.disabled = !local->powersave;

return 0;
}
Expand Down

0 comments on commit 651445b

Please sign in to comment.