aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/pm.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 79a48f37d409..f3217831d236 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -7,25 +7,23 @@
7#include "led.h" 7#include "led.h"
8 8
9/* return value indicates whether the driver should be further notified */ 9/* return value indicates whether the driver should be further notified */
10static bool ieee80211_quiesce(struct ieee80211_sub_if_data *sdata) 10static void ieee80211_quiesce(struct ieee80211_sub_if_data *sdata)
11{ 11{
12 switch (sdata->vif.type) { 12 switch (sdata->vif.type) {
13 case NL80211_IFTYPE_STATION: 13 case NL80211_IFTYPE_STATION:
14 ieee80211_sta_quiesce(sdata); 14 ieee80211_sta_quiesce(sdata);
15 return true; 15 break;
16 case NL80211_IFTYPE_ADHOC: 16 case NL80211_IFTYPE_ADHOC:
17 ieee80211_ibss_quiesce(sdata); 17 ieee80211_ibss_quiesce(sdata);
18 return true; 18 break;
19 case NL80211_IFTYPE_MESH_POINT: 19 case NL80211_IFTYPE_MESH_POINT:
20 ieee80211_mesh_quiesce(sdata); 20 ieee80211_mesh_quiesce(sdata);
21 return true; 21 break;
22 case NL80211_IFTYPE_AP_VLAN:
23 case NL80211_IFTYPE_MONITOR:
24 /* don't tell driver about this */
25 return false;
26 default: 22 default:
27 return true; 23 break;
28 } 24 }
25
26 cancel_work_sync(&sdata->work);
29} 27}
30 28
31int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) 29int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
@@ -94,10 +92,9 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
94 WARN_ON(err != 1); 92 WARN_ON(err != 1);
95 local->wowlan = false; 93 local->wowlan = false;
96 } else { 94 } else {
97 list_for_each_entry(sdata, &local->interfaces, list) { 95 list_for_each_entry(sdata, &local->interfaces, list)
98 cancel_work_sync(&sdata->work); 96 if (ieee80211_sdata_running(sdata))
99 ieee80211_quiesce(sdata); 97 ieee80211_quiesce(sdata);
100 }
101 goto suspend; 98 goto suspend;
102 } 99 }
103 } 100 }
@@ -124,13 +121,18 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
124 121
125 /* remove all interfaces */ 122 /* remove all interfaces */
126 list_for_each_entry(sdata, &local->interfaces, list) { 123 list_for_each_entry(sdata, &local->interfaces, list) {
127 cancel_work_sync(&sdata->work); 124 if (!ieee80211_sdata_running(sdata))
128
129 if (!ieee80211_quiesce(sdata))
130 continue; 125 continue;
131 126
132 if (!ieee80211_sdata_running(sdata)) 127 switch (sdata->vif.type) {
128 case NL80211_IFTYPE_AP_VLAN:
129 case NL80211_IFTYPE_MONITOR:
130 /* skip these */
133 continue; 131 continue;
132 default:
133 ieee80211_quiesce(sdata);
134 break;
135 }
134 136
135 /* disable beaconing */ 137 /* disable beaconing */
136 ieee80211_bss_info_change_notify(sdata, 138 ieee80211_bss_info_change_notify(sdata,