diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-05-04 15:37:29 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-05 14:59:20 -0400 |
commit | eecc48000afe2ca6da22122d553b7cad294e42fc (patch) | |
tree | ade8a18351be5ca63b14d24f3f4db47909486fba /net/mac80211/pm.c | |
parent | ff1b6e69ad4f31fb3c9c6da2665655f2e798dd70 (diff) | |
download | linux-eecc48000afe2ca6da22122d553b7cad294e42fc.tar.gz linux-eecc48000afe2ca6da22122d553b7cad294e42fc.tar.bz2 linux-eecc48000afe2ca6da22122d553b7cad294e42fc.zip |
mac80211: add basic support for WoWLAN
This adds basic support for the new WoWLAN
configuration in mac80211. The behaviour is
completely offloaded to the driver though,
with two new callbacks (suspend/resume).
Options for the driver include a complete
reconfiguration after wakeup, and exposing
all the triggers it wants to support.
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.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c index 042461710880..730778a2c90c 100644 --- a/net/mac80211/pm.c +++ b/net/mac80211/pm.c @@ -6,7 +6,7 @@ #include "driver-ops.h" #include "led.h" -int __ieee80211_suspend(struct ieee80211_hw *hw) +int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) { struct ieee80211_local *local = hw_to_local(hw); struct ieee80211_sub_if_data *sdata; @@ -47,6 +47,16 @@ int __ieee80211_suspend(struct ieee80211_hw *hw) cancel_work_sync(&local->dynamic_ps_enable_work); del_timer_sync(&local->dynamic_ps_timer); + local->wowlan = wowlan && local->open_count; + if (local->wowlan) { + int err = drv_suspend(local, wowlan); + if (err) { + local->quiescing = false; + return err; + } + goto suspend; + } + /* disable keys */ list_for_each_entry(sdata, &local->interfaces, list) ieee80211_disable_keys(sdata); @@ -104,6 +114,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw) if (local->open_count) ieee80211_stop_device(local); + suspend: local->suspended = true; /* need suspended to be visible before quiescing is false */ barrier(); |