aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/cfg80211.h4
-rw-r--r--net/wireless/core.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 223913434e51..0b146bb2dd14 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1108,6 +1108,9 @@ struct cfg80211_ops {
1108 * @net: the network namespace this wiphy currently lives in 1108 * @net: the network namespace this wiphy currently lives in
1109 * @netnsok: if set to false, do not allow changing the netns of this 1109 * @netnsok: if set to false, do not allow changing the netns of this
1110 * wiphy at all 1110 * wiphy at all
1111 * @ps_default: default for powersave, will be set depending on the
1112 * kernel's default on wiphy_new(), but can be changed by the
1113 * driver if it has a good reason to override the default
1111 */ 1114 */
1112struct wiphy { 1115struct wiphy {
1113 /* assign these fields before you register the wiphy */ 1116 /* assign these fields before you register the wiphy */
@@ -1123,6 +1126,7 @@ struct wiphy {
1123 bool disable_beacon_hints; 1126 bool disable_beacon_hints;
1124 1127
1125 bool netnsok; 1128 bool netnsok;
1129 bool ps_default;
1126 1130
1127 enum cfg80211_signal_type signal_type; 1131 enum cfg80211_signal_type signal_type;
1128 1132
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 35d83bedfe5b..bc99e4ec7463 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -412,6 +412,8 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
412 rdev->wiphy.dev.class = &ieee80211_class; 412 rdev->wiphy.dev.class = &ieee80211_class;
413 rdev->wiphy.dev.platform_data = rdev; 413 rdev->wiphy.dev.platform_data = rdev;
414 414
415 rdev->wiphy.ps_default = CONFIG_CFG80211_DEFAULT_PS_VALUE;
416
415 wiphy_net_set(&rdev->wiphy, &init_net); 417 wiphy_net_set(&rdev->wiphy, &init_net);
416 418
417 rdev->rfkill_ops.set_block = cfg80211_rfkill_set_block; 419 rdev->rfkill_ops.set_block = cfg80211_rfkill_set_block;
@@ -674,7 +676,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
674 wdev->wext.default_key = -1; 676 wdev->wext.default_key = -1;
675 wdev->wext.default_mgmt_key = -1; 677 wdev->wext.default_mgmt_key = -1;
676 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; 678 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
677 wdev->wext.ps = CONFIG_CFG80211_DEFAULT_PS_VALUE; 679 wdev->wext.ps = wdev->wiphy->ps_default;
678 wdev->wext.ps_timeout = 100; 680 wdev->wext.ps_timeout = 100;
679 if (rdev->ops->set_power_mgmt) 681 if (rdev->ops->set_power_mgmt)
680 if (rdev->ops->set_power_mgmt(wdev->wiphy, dev, 682 if (rdev->ops->set_power_mgmt(wdev->wiphy, dev,