]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
mac80211: move managed mode station state modification
authorJohannes Berg <johannes.berg@intel.com>
Fri, 20 Jan 2012 12:55:17 +0000 (13:55 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 6 Feb 2012 19:48:23 +0000 (14:48 -0500)
Move the station state modification right before insert,
this just makes the current code more readable (you can
tell that it's before insertion looking at a single
screenful of code) right now, but some upcoming changes
will require this.

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

index 49fd1acd5d15986e1f029a05a55671d11b6d4e23..40b929d57a970d7f6c0415e132323e099312e956 100644 (file)
@@ -1587,20 +1587,6 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
                return false;
        }
 
-       err = sta_info_move_state(sta, IEEE80211_STA_AUTH);
-       if (!err)
-               err = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
-       if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT))
-               err = sta_info_move_state(sta, IEEE80211_STA_AUTHORIZED);
-       if (err) {
-               printk(KERN_DEBUG
-                      "%s: failed to move station %pM to desired state\n",
-                      sdata->name, sta->sta.addr);
-               WARN_ON(__sta_info_destroy(sta));
-               mutex_unlock(&sdata->local->sta_mtx);
-               return false;
-       }
-
        rates = 0;
        basic_rates = 0;
        sband = local->hw.wiphy->bands[wk->chan->band];
@@ -1648,6 +1634,20 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
        if (elems.wmm_param)
                set_sta_flag(sta, WLAN_STA_WME);
 
+       err = sta_info_move_state(sta, IEEE80211_STA_AUTH);
+       if (!err)
+               err = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
+       if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT))
+               err = sta_info_move_state(sta, IEEE80211_STA_AUTHORIZED);
+       if (err) {
+               printk(KERN_DEBUG
+                      "%s: failed to move station %pM to desired state\n",
+                      sdata->name, sta->sta.addr);
+               WARN_ON(__sta_info_destroy(sta));
+               mutex_unlock(&sdata->local->sta_mtx);
+               return false;
+       }
+
        /* sta_info_reinsert will also unlock the mutex lock */
        err = sta_info_reinsert(sta);
        sta = NULL;