aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-04-04 09:05:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-11 16:23:57 -0400
commit6d52563f2bc217cbdccb97068f5b6176352f01f2 (patch)
tree27fb48e360f153129fadb4dd5abdb4d91bb2e7eb /net/wireless/nl80211.c
parentda951c2417ec1020d0d00813da36f38e395994e9 (diff)
cfg80211/mac80211: enable proper device_set_wakeup_enable handling
In WoWLAN, we only get the triggers when we actually get to suspend. As a consequence, drivers currently don't know that the device should enable wakeup. However, the device_set_wakeup_enable() API is intended to be called when the wakeup is enabled, not later when needed. Add a new set_wakeup() call to cfg80211 and mac80211 to allow drivers to properly call device_set_wakeup_enable. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index b12a05243d71..40e5620e5fde 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -6014,6 +6014,7 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info)
6014 struct cfg80211_wowlan new_triggers = {}; 6014 struct cfg80211_wowlan new_triggers = {};
6015 struct wiphy_wowlan_support *wowlan = &rdev->wiphy.wowlan; 6015 struct wiphy_wowlan_support *wowlan = &rdev->wiphy.wowlan;
6016 int err, i; 6016 int err, i;
6017 bool prev_enabled = rdev->wowlan;
6017 6018
6018 if (!rdev->wiphy.wowlan.flags && !rdev->wiphy.wowlan.n_patterns) 6019 if (!rdev->wiphy.wowlan.flags && !rdev->wiphy.wowlan.n_patterns)
6019 return -EOPNOTSUPP; 6020 return -EOPNOTSUPP;
@@ -6146,6 +6147,9 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info)
6146 rdev->wowlan = NULL; 6147 rdev->wowlan = NULL;
6147 } 6148 }
6148 6149
6150 if (rdev->ops->set_wakeup && prev_enabled != !!rdev->wowlan)
6151 rdev->ops->set_wakeup(&rdev->wiphy, rdev->wowlan);
6152
6149 return 0; 6153 return 0;
6150 error: 6154 error:
6151 for (i = 0; i < new_triggers.n_patterns; i++) 6155 for (i = 0; i < new_triggers.n_patterns; i++)