aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-01-20 07:55:17 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-06 14:48:23 -0500
commitc8987876e9bf9b7b83e75b325586bc77ea8ac825 (patch)
tree4d76a97c78142aeb68d19c3ee542f2890aecc5ae /net/mac80211
parent8f0bb5ae3cc3b62a86e4319ee74cea5b602587f1 (diff)
mac80211: move managed mode station state modification
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>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mlme.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 49fd1acd5d1..40b929d57a9 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1587,20 +1587,6 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
1587 return false; 1587 return false;
1588 } 1588 }
1589 1589
1590 err = sta_info_move_state(sta, IEEE80211_STA_AUTH);
1591 if (!err)
1592 err = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
1593 if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT))
1594 err = sta_info_move_state(sta, IEEE80211_STA_AUTHORIZED);
1595 if (err) {
1596 printk(KERN_DEBUG
1597 "%s: failed to move station %pM to desired state\n",
1598 sdata->name, sta->sta.addr);
1599 WARN_ON(__sta_info_destroy(sta));
1600 mutex_unlock(&sdata->local->sta_mtx);
1601 return false;
1602 }
1603
1604 rates = 0; 1590 rates = 0;
1605 basic_rates = 0; 1591 basic_rates = 0;
1606 sband = local->hw.wiphy->bands[wk->chan->band]; 1592 sband = local->hw.wiphy->bands[wk->chan->band];
@@ -1648,6 +1634,20 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
1648 if (elems.wmm_param) 1634 if (elems.wmm_param)
1649 set_sta_flag(sta, WLAN_STA_WME); 1635 set_sta_flag(sta, WLAN_STA_WME);
1650 1636
1637 err = sta_info_move_state(sta, IEEE80211_STA_AUTH);
1638 if (!err)
1639 err = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
1640 if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT))
1641 err = sta_info_move_state(sta, IEEE80211_STA_AUTHORIZED);
1642 if (err) {
1643 printk(KERN_DEBUG
1644 "%s: failed to move station %pM to desired state\n",
1645 sdata->name, sta->sta.addr);
1646 WARN_ON(__sta_info_destroy(sta));
1647 mutex_unlock(&sdata->local->sta_mtx);
1648 return false;
1649 }
1650
1651 /* sta_info_reinsert will also unlock the mutex lock */ 1651 /* sta_info_reinsert will also unlock the mutex lock */
1652 err = sta_info_reinsert(sta); 1652 err = sta_info_reinsert(sta);
1653 sta = NULL; 1653 sta = NULL;