aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
authorMichael Wu <flamingice@sourmilk.net>2007-07-27 09:43:23 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:47:37 -0400
commitbe8755e1804d6f60e6a96a46ac6bc46ce6dfca53 (patch)
treea3038a924114f49aa2372ab7c9417d4e072c4b20 /net/mac80211/ieee80211_i.h
parentc2d1560ad8c2f6e0dd0d34102d022f3709325c26 (diff)
[MAC80211]: improve locking of sta_info related structures
The sta_info code has some awkward locking which prevents some driver callbacks from being allowed to sleep. This patch makes the locking more focused so code that calls driver callbacks are allowed to sleep. It also converts sta_lock to a rwlock. Signed-off-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: Jiri Benc <jbenc@suse.cz> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index ed00552b3418..e76a58678959 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -417,10 +417,9 @@ struct ieee80211_local {
417 struct sk_buff_head skb_queue_unreliable; 417 struct sk_buff_head skb_queue_unreliable;
418 418
419 /* Station data structures */ 419 /* Station data structures */
420 spinlock_t sta_lock; /* mutex for STA data structures */ 420 rwlock_t sta_lock; /* protects STA data structures */
421 int num_sta; /* number of stations in sta_list */ 421 int num_sta; /* number of stations in sta_list */
422 struct list_head sta_list; 422 struct list_head sta_list;
423 struct list_head deleted_sta_list;
424 struct sta_info *sta_hash[STA_HASH_SIZE]; 423 struct sta_info *sta_hash[STA_HASH_SIZE];
425 struct timer_list sta_cleanup; 424 struct timer_list sta_cleanup;
426 425
@@ -669,9 +668,9 @@ static inline void __bss_tim_set(struct ieee80211_if_ap *bss, int aid)
669static inline void bss_tim_set(struct ieee80211_local *local, 668static inline void bss_tim_set(struct ieee80211_local *local,
670 struct ieee80211_if_ap *bss, int aid) 669 struct ieee80211_if_ap *bss, int aid)
671{ 670{
672 spin_lock_bh(&local->sta_lock); 671 read_lock_bh(&local->sta_lock);
673 __bss_tim_set(bss, aid); 672 __bss_tim_set(bss, aid);
674 spin_unlock_bh(&local->sta_lock); 673 read_unlock_bh(&local->sta_lock);
675} 674}
676 675
677static inline void __bss_tim_clear(struct ieee80211_if_ap *bss, int aid) 676static inline void __bss_tim_clear(struct ieee80211_if_ap *bss, int aid)
@@ -686,9 +685,9 @@ static inline void __bss_tim_clear(struct ieee80211_if_ap *bss, int aid)
686static inline void bss_tim_clear(struct ieee80211_local *local, 685static inline void bss_tim_clear(struct ieee80211_local *local,
687 struct ieee80211_if_ap *bss, int aid) 686 struct ieee80211_if_ap *bss, int aid)
688{ 687{
689 spin_lock_bh(&local->sta_lock); 688 read_lock_bh(&local->sta_lock);
690 __bss_tim_clear(bss, aid); 689 __bss_tim_clear(bss, aid);
691 spin_unlock_bh(&local->sta_lock); 690 read_unlock_bh(&local->sta_lock);
692} 691}
693 692
694/** 693/**