From e74b298325b3f4bcdaa6c042077d642c381487cb Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 12 Aug 2009 23:33:20 +0200 Subject: [PATCH] --- yaml --- r: 159658 b: refs/heads/master c: 16cb9d42b68b339852e8914f2538ca9a2aec616c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/net/cfg80211.h | 4 ++++ trunk/net/wireless/core.c | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index ec3496f94eb5..250c16aac680 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 36e6fea84905512ea776707e82b5b435220efc17 +refs/heads/master: 16cb9d42b68b339852e8914f2538ca9a2aec616c diff --git a/trunk/include/net/cfg80211.h b/trunk/include/net/cfg80211.h index 223913434e51..0b146bb2dd14 100644 --- a/trunk/include/net/cfg80211.h +++ b/trunk/include/net/cfg80211.h @@ -1108,6 +1108,9 @@ struct cfg80211_ops { * @net: the network namespace this wiphy currently lives in * @netnsok: if set to false, do not allow changing the netns of this * wiphy at all + * @ps_default: default for powersave, will be set depending on the + * kernel's default on wiphy_new(), but can be changed by the + * driver if it has a good reason to override the default */ struct wiphy { /* assign these fields before you register the wiphy */ @@ -1123,6 +1126,7 @@ struct wiphy { bool disable_beacon_hints; bool netnsok; + bool ps_default; enum cfg80211_signal_type signal_type; diff --git a/trunk/net/wireless/core.c b/trunk/net/wireless/core.c index 35d83bedfe5b..bc99e4ec7463 100644 --- a/trunk/net/wireless/core.c +++ b/trunk/net/wireless/core.c @@ -412,6 +412,8 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv) rdev->wiphy.dev.class = &ieee80211_class; rdev->wiphy.dev.platform_data = rdev; + rdev->wiphy.ps_default = CONFIG_CFG80211_DEFAULT_PS_VALUE; + wiphy_net_set(&rdev->wiphy, &init_net); rdev->rfkill_ops.set_block = cfg80211_rfkill_set_block; @@ -674,7 +676,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, wdev->wext.default_key = -1; wdev->wext.default_mgmt_key = -1; wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; - wdev->wext.ps = CONFIG_CFG80211_DEFAULT_PS_VALUE; + wdev->wext.ps = wdev->wiphy->ps_default; wdev->wext.ps_timeout = 100; if (rdev->ops->set_power_mgmt) if (rdev->ops->set_power_mgmt(wdev->wiphy, dev,