summaryrefslogtreecommitdiffstats
path: root/net/mac80211/pm.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-07-02 00:02:01 +0200
committerJohn W. Linville <linville@tuxdriver.com>2011-07-05 15:26:56 -0400
commit2b4562dfd6ad3579951de21168cb9d266ed3f1bd (patch)
tree38b43f58644fc02ffeb0930009b979542362ea88 /net/mac80211/pm.c
parent304e21bbeab0d208dc7e6142fb75db8a466d5217 (diff)
downloadblackbird-op-linux-2b4562dfd6ad3579951de21168cb9d266ed3f1bd.tar.gz
blackbird-op-linux-2b4562dfd6ad3579951de21168cb9d266ed3f1bd.zip
mac80211: allow driver to impose WoWLAN restrictions
If the driver can't support WoWLAN in the current state, this patch allows it to return 1 from the suspend callback to do the normal deconfiguration instead of using suspend/resume calls. Note that if it does this, resume won't be called. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/pm.c')
-rw-r--r--net/mac80211/pm.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 67839eb90cc1..f87e993e713b 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -72,15 +72,19 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
local->wowlan = wowlan && local->open_count;
if (local->wowlan) {
int err = drv_suspend(local, wowlan);
- if (err) {
+ if (err < 0) {
local->quiescing = false;
return err;
+ } else if (err > 0) {
+ WARN_ON(err != 1);
+ local->wowlan = false;
+ } else {
+ list_for_each_entry(sdata, &local->interfaces, list) {
+ cancel_work_sync(&sdata->work);
+ ieee80211_quiesce(sdata);
+ }
+ goto suspend;
}
- list_for_each_entry(sdata, &local->interfaces, list) {
- cancel_work_sync(&sdata->work);
- ieee80211_quiesce(sdata);
- }
- goto suspend;
}
/* disable keys */
OpenPOWER on IntegriCloud