Commit 4d33960b authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: reduce station management complexity

Now that IBSS no longer needs to insert stations
from atomic context, we can get rid of all the
special cases for that, and even get rid of the
sta_lock (though it needs to stay as tim_lock.)

This makes the station management code much more
straight-forward.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8bf11d8d
...@@ -855,18 +855,15 @@ struct ieee80211_local { ...@@ -855,18 +855,15 @@ struct ieee80211_local {
/* Station data */ /* Station data */
/* /*
* The mutex only protects the list and counter, * The mutex only protects the list, hash table and
* reads are done in RCU. * counter, reads are done with RCU.
* Additionally, the lock protects the hash table,
* the pending list and each BSS's TIM bitmap.
*/ */
struct mutex sta_mtx; struct mutex sta_mtx;
spinlock_t sta_lock; spinlock_t tim_lock;
unsigned long num_sta; unsigned long num_sta;
struct list_head sta_list, sta_pending_list; struct list_head sta_list;
struct sta_info __rcu *sta_hash[STA_HASH_SIZE]; struct sta_info __rcu *sta_hash[STA_HASH_SIZE];
struct timer_list sta_cleanup; struct timer_list sta_cleanup;
struct work_struct sta_finish_work;
int sta_generation; int sta_generation;
struct sk_buff_head pending[IEEE80211_MAX_QUEUES]; struct sk_buff_head pending[IEEE80211_MAX_QUEUES];
......
This diff is collapsed.
...@@ -2333,9 +2333,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, ...@@ -2333,9 +2333,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
} else { } else {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&local->sta_lock, flags); spin_lock_irqsave(&local->tim_lock, flags);
ieee80211_beacon_add_tim(ap, skb, beacon); ieee80211_beacon_add_tim(ap, skb, beacon);
spin_unlock_irqrestore(&local->sta_lock, flags); spin_unlock_irqrestore(&local->tim_lock, flags);
} }
if (tim_offset) if (tim_offset)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment