aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-07-01 18:02:01 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-05 15:26:56 -0400
commit2b4562dfd6ad3579951de21168cb9d266ed3f1bd (patch)
tree38b43f58644fc02ffeb0930009b979542362ea88
parent304e21bbeab0d208dc7e6142fb75db8a466d5217 (diff)
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>
-rw-r--r--include/net/mac80211.h4
-rw-r--r--net/mac80211/pm.c16
2 files changed, 14 insertions, 6 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c9def42c1286..2858b4d02f5f 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1628,6 +1628,10 @@ enum ieee80211_ampdu_mlme_action {
1628 * ask the device to suspend. This is only invoked when WoWLAN is 1628 * ask the device to suspend. This is only invoked when WoWLAN is
1629 * configured, otherwise the device is deconfigured completely and 1629 * configured, otherwise the device is deconfigured completely and
1630 * reconfigured at resume time. 1630 * reconfigured at resume time.
1631 * The driver may also impose special conditions under which it
1632 * wants to use the "normal" suspend (deconfigure), say if it only
1633 * supports WoWLAN when the device is associated. In this case, it
1634 * must return 1 from this function.
1631 * 1635 *
1632 * @resume: If WoWLAN was configured, this indicates that mac80211 is 1636 * @resume: If WoWLAN was configured, this indicates that mac80211 is
1633 * now resuming its operation, after this the device must be fully 1637 * now resuming its operation, after this the device must be fully
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)
72 local->wowlan = wowlan && local->open_count; 72 local->wowlan = wowlan && local->open_count;
73 if (local->wowlan) { 73 if (local->wowlan) {
74 int err = drv_suspend(local, wowlan); 74 int err = drv_suspend(local, wowlan);
75 if (err) { 75 if (err < 0) {
76 local->quiescing = false; 76 local->quiescing = false;
77 return err; 77 return err;
78 } else if (err > 0) {
79 WARN_ON(err != 1);
80 local->wowlan = false;
81 } else {
82 list_for_each_entry(sdata, &local->interfaces, list) {
83 cancel_work_sync(&sdata->work);
84 ieee80211_quiesce(sdata);
85 }
86 goto suspend;
78 } 87 }
79 list_for_each_entry(sdata, &local->interfaces, list) {
80 cancel_work_sync(&sdata->work);
81 ieee80211_quiesce(sdata);
82 }
83 goto suspend;
84 } 88 }
85 89
86 /* disable keys */ 90 /* disable keys */