diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-12-13 11:16:45 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 07:01:34 -0500 |
commit | 529ba6e9313dbe60dab7e72c6fdf647a012e9f5b (patch) | |
tree | a556b0d18baf4309ebf705715440e702d5acb86b /net | |
parent | 61e8a48cc1283c8e4358b3ce06305d886c55f7ce (diff) |
mac80211: clean up association better in suspend
When suspending, bss_info_changed() is called to
disable beacons, but managed mode interfaces are
simply removed (bss_info_changed() is called with
"no change" only). This can lead to problems.
To fix this and copy the BSS configuration, clear
it during suspend and restore it on resume.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 5 | ||||
-rw-r--r-- | net/mac80211/pm.c | 19 | ||||
-rw-r--r-- | net/mac80211/util.c | 5 |
3 files changed, 26 insertions, 3 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index fa6d43e6197f..38e7883cff23 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -783,6 +783,11 @@ struct ieee80211_sub_if_data { | |||
783 | struct dentry *default_mgmt_key; | 783 | struct dentry *default_mgmt_key; |
784 | } debugfs; | 784 | } debugfs; |
785 | #endif | 785 | #endif |
786 | |||
787 | #ifdef CONFIG_PM | ||
788 | struct ieee80211_bss_conf suspend_bss_conf; | ||
789 | #endif | ||
790 | |||
786 | /* must be last, dynamically sized area in this! */ | 791 | /* must be last, dynamically sized area in this! */ |
787 | struct ieee80211_vif vif; | 792 | struct ieee80211_vif vif; |
788 | }; | 793 | }; |
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c index f3217831d236..712c17ff6e22 100644 --- a/net/mac80211/pm.c +++ b/net/mac80211/pm.c | |||
@@ -121,6 +121,8 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) | |||
121 | 121 | ||
122 | /* remove all interfaces */ | 122 | /* remove all interfaces */ |
123 | list_for_each_entry(sdata, &local->interfaces, list) { | 123 | list_for_each_entry(sdata, &local->interfaces, list) { |
124 | u32 changed = BSS_CHANGED_BEACON_ENABLED; | ||
125 | |||
124 | if (!ieee80211_sdata_running(sdata)) | 126 | if (!ieee80211_sdata_running(sdata)) |
125 | continue; | 127 | continue; |
126 | 128 | ||
@@ -129,14 +131,25 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) | |||
129 | case NL80211_IFTYPE_MONITOR: | 131 | case NL80211_IFTYPE_MONITOR: |
130 | /* skip these */ | 132 | /* skip these */ |
131 | continue; | 133 | continue; |
134 | case NL80211_IFTYPE_STATION: | ||
135 | if (sdata->vif.bss_conf.assoc) | ||
136 | changed = BSS_CHANGED_ASSOC | | ||
137 | BSS_CHANGED_BSSID | | ||
138 | BSS_CHANGED_IDLE; | ||
139 | else | ||
140 | changed = 0; | ||
141 | /* fall through */ | ||
132 | default: | 142 | default: |
133 | ieee80211_quiesce(sdata); | 143 | ieee80211_quiesce(sdata); |
134 | break; | 144 | break; |
135 | } | 145 | } |
136 | 146 | ||
137 | /* disable beaconing */ | 147 | sdata->suspend_bss_conf = sdata->vif.bss_conf; |
138 | ieee80211_bss_info_change_notify(sdata, | 148 | memset(&sdata->vif.bss_conf, 0, sizeof(sdata->vif.bss_conf)); |
139 | BSS_CHANGED_BEACON_ENABLED); | 149 | sdata->vif.bss_conf.idle = true; |
150 | |||
151 | /* disable beaconing or remove association */ | ||
152 | ieee80211_bss_info_change_notify(sdata, changed); | ||
140 | 153 | ||
141 | if (sdata->vif.type == NL80211_IFTYPE_AP && | 154 | if (sdata->vif.type == NL80211_IFTYPE_AP && |
142 | rcu_access_pointer(sdata->u.ap.beacon)) | 155 | rcu_access_pointer(sdata->u.ap.beacon)) |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 051313f0d1c2..2e2e13bf96b2 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -1526,6 +1526,11 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
1526 | BSS_CHANGED_IDLE | | 1526 | BSS_CHANGED_IDLE | |
1527 | BSS_CHANGED_TXPOWER; | 1527 | BSS_CHANGED_TXPOWER; |
1528 | 1528 | ||
1529 | #ifdef CONFIG_PM | ||
1530 | if (local->resuming) | ||
1531 | sdata->vif.bss_conf = sdata->suspend_bss_conf; | ||
1532 | #endif | ||
1533 | |||
1529 | switch (sdata->vif.type) { | 1534 | switch (sdata->vif.type) { |
1530 | case NL80211_IFTYPE_STATION: | 1535 | case NL80211_IFTYPE_STATION: |
1531 | changed |= BSS_CHANGED_ASSOC | | 1536 | changed |= BSS_CHANGED_ASSOC | |