diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-12-14 06:35:30 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-15 14:46:34 -0500 |
commit | d9a7ddb05e5419ca5e4b54f57074dc33c7ea991c (patch) | |
tree | 3de3213e7e79a64254ea778374aeaaffa61b5bab /net/mac80211/ibss.c | |
parent | 87be1e1e00f870567780dec111193426b4c085e8 (diff) |
mac80211: refactor station state transitions
Station entries can have various states, the most
important ones being auth, assoc and authorized.
This patch prepares us for telling the driver about
these states, we don't want to confuse drivers with
strange transitions, so with this we enforce that
they move in the right order between them (back and
forth); some transitions might happen before the
driver even knows about the station, but at least
runtime transitions will be ordered correctly.
As a consequence, IBSS and MESH stations will now
have the ASSOC flag set (so they can transition to
AUTHORIZED), and we can get rid of a special case
in TX processing.
When freeing a station, unwind the state so that
other parts of the code (or drivers later) can rely
on the transitions.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r-- | net/mac80211/ibss.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index fe0e91e0b8bc..47e2db9133cb 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -512,7 +512,10 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | |||
512 | return NULL; | 512 | return NULL; |
513 | 513 | ||
514 | sta->last_rx = jiffies; | 514 | sta->last_rx = jiffies; |
515 | set_sta_flag(sta, WLAN_STA_AUTHORIZED); | 515 | |
516 | sta_info_move_state(sta, IEEE80211_STA_AUTH); | ||
517 | sta_info_move_state(sta, IEEE80211_STA_ASSOC); | ||
518 | sta_info_move_state(sta, IEEE80211_STA_AUTHORIZED); | ||
516 | 519 | ||
517 | /* make sure mandatory rates are always added */ | 520 | /* make sure mandatory rates are always added */ |
518 | sta->sta.supp_rates[band] = supp_rates | | 521 | sta->sta.supp_rates[band] = supp_rates | |