mac80211: fix resume from WoWLAN
authorJohannes Berg <johannes.berg@intel.com>
Thu, 10 Jan 2013 22:55:33 +0000 (23:55 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 16 Jan 2013 14:18:37 +0000 (15:18 +0100)
My commit 529ba6e9313dbe60dab7e72c6fdf647a012e9f5b
("mac80211: clean up association better in suspend")
introduced a bug when resuming from WoWLAN when a
device reset is desired. This case must not use the
suspend_bss_conf as it hasn't been stored.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/util.c

index 1b9420730d8cf52628d22ff60b97d599ea87e1f2..0ad51e14f3c8b59057e888421557e8de3f876941 100644 (file)
@@ -1358,8 +1358,9 @@ int ieee80211_reconfig(struct ieee80211_local *local)
        struct ieee80211_chanctx *ctx;
        struct sta_info *sta;
        int res, i;
-
 #ifdef CONFIG_PM
+       bool reconfig_due_to_wowlan = false;
+
        if (local->suspended)
                local->resuming = true;
 
@@ -1377,6 +1378,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
                 * res is 1, which means the driver requested
                 * to go through a regular reset on wakeup.
                 */
+               reconfig_due_to_wowlan = true;
        }
 #endif
        /* everything else happens only if HW was up & running */
@@ -1527,7 +1529,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
                          BSS_CHANGED_TXPOWER;
 
 #ifdef CONFIG_PM
-               if (local->resuming)
+               if (local->resuming && !reconfig_due_to_wowlan)
                        sdata->vif.bss_conf = sdata->suspend_bss_conf;
 #endif