aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-06-16 04:49:33 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-06-20 15:34:18 -0400
commit77572fd13d7f468216b85e68a006000726a59e89 (patch)
tree4bb3f93ded198ba6770afea08ca75d5967795f91 /net/mac80211
parent6392cb387cb629a5aa488e6a2eab9383b574a7ef (diff)
mac80211: quiesce vif before suspending
Cancel all relevant timers/works before suspending (wowlan). This patch handles the following warning: WARNING: at net/mac80211/util.c:565 queueing ieee80211 work while going to suspend Backtrace: [<bf07b598>] (ieee80211_can_queue_work+0x0/0x4c [mac80211]) [<bf07c28c>] (ieee80211_queue_work+0x0/0x30 [mac80211]) [<bf0690dc>] (ieee80211_sta_timer+0x0/0x3c [mac80211]) [<c00a3008>] (run_timer_softirq+0x0/0x220) [<c009e530>] (__do_softirq+0x0/0x130) [<c009e660>] (irq_exit+0x0/0xb4) [<c004c4a0>] (ipi_timer+0x0/0x4c) [<c0046350>] (do_local_timer+0x0/0x88) [<c00488ec>] (cpu_idle+0x0/0xe0) [<c05294e8>] (rest_init+0x0/0xe0) [<c0008958>] (start_kernel+0x0/0x314) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/pm.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 730778a2c90c..67839eb90cc1 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -6,6 +6,28 @@
6#include "driver-ops.h" 6#include "driver-ops.h"
7#include "led.h" 7#include "led.h"
8 8
9/* return value indicates whether the driver should be further notified */
10static bool ieee80211_quiesce(struct ieee80211_sub_if_data *sdata)
11{
12 switch (sdata->vif.type) {
13 case NL80211_IFTYPE_STATION:
14 ieee80211_sta_quiesce(sdata);
15 return true;
16 case NL80211_IFTYPE_ADHOC:
17 ieee80211_ibss_quiesce(sdata);
18 return true;
19 case NL80211_IFTYPE_MESH_POINT:
20 ieee80211_mesh_quiesce(sdata);
21 return true;
22 case NL80211_IFTYPE_AP_VLAN:
23 case NL80211_IFTYPE_MONITOR:
24 /* don't tell driver about this */
25 return false;
26 default:
27 return true;
28 }
29}
30
9int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) 31int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
10{ 32{
11 struct ieee80211_local *local = hw_to_local(hw); 33 struct ieee80211_local *local = hw_to_local(hw);
@@ -54,6 +76,10 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
54 local->quiescing = false; 76 local->quiescing = false;
55 return err; 77 return err;
56 } 78 }
79 list_for_each_entry(sdata, &local->interfaces, list) {
80 cancel_work_sync(&sdata->work);
81 ieee80211_quiesce(sdata);
82 }
57 goto suspend; 83 goto suspend;
58 } 84 }
59 85
@@ -82,23 +108,8 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
82 list_for_each_entry(sdata, &local->interfaces, list) { 108 list_for_each_entry(sdata, &local->interfaces, list) {
83 cancel_work_sync(&sdata->work); 109 cancel_work_sync(&sdata->work);
84 110
85 switch(sdata->vif.type) { 111 if (!ieee80211_quiesce(sdata))
86 case NL80211_IFTYPE_STATION:
87 ieee80211_sta_quiesce(sdata);
88 break;
89 case NL80211_IFTYPE_ADHOC:
90 ieee80211_ibss_quiesce(sdata);
91 break;
92 case NL80211_IFTYPE_MESH_POINT:
93 ieee80211_mesh_quiesce(sdata);
94 break;
95 case NL80211_IFTYPE_AP_VLAN:
96 case NL80211_IFTYPE_MONITOR:
97 /* don't tell driver about this */
98 continue; 112 continue;
99 default:
100 break;
101 }
102 113
103 if (!ieee80211_sdata_running(sdata)) 114 if (!ieee80211_sdata_running(sdata))
104 continue; 115 continue;