]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
mac80211: re-upload keys only after telling driver about association
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 8 Apr 2009 00:55:34 +0000 (02:55 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Apr 2009 20:54:41 +0000 (16:54 -0400)
In the normal WPA or RSN case keys are only configured after
associating, so we should do that in that order when resuming
as well. It shouldn't really matter since we do not send any
data at either point, but iwlwifi prefers it this way and it
does seem more natural.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/pm.c

index 027302326498a681645e981db118077ecff3707e..2b4c95cd9dafe44346bf10daddb762d33ffbb675 100644 (file)
@@ -127,11 +127,6 @@ int __ieee80211_resume(struct ieee80211_hw *hw)
 
        rcu_read_unlock();
 
-       /* add back keys */
-       list_for_each_entry(sdata, &local->interfaces, list)
-               if (netif_running(sdata->dev))
-                       ieee80211_enable_keys(sdata);
-
        /* setup RTS threshold */
        if (local->ops->set_rts_threshold)
                local->ops->set_rts_threshold(hw, local->rts_threshold);
@@ -172,6 +167,11 @@ int __ieee80211_resume(struct ieee80211_hw *hw)
                }
        }
 
+       /* add back keys */
+       list_for_each_entry(sdata, &local->interfaces, list)
+               if (netif_running(sdata->dev))
+                       ieee80211_enable_keys(sdata);
+
        ieee80211_wake_queues_by_reason(hw,
                        IEEE80211_QUEUE_STOP_REASON_SUSPEND);