diff options
author | Michael Wu <flamingice@sourmilk.net> | 2007-07-27 09:43:23 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:47:37 -0400 |
commit | be8755e1804d6f60e6a96a46ac6bc46ce6dfca53 (patch) | |
tree | a3038a924114f49aa2372ab7c9417d4e072c4b20 /net/mac80211/sta_info.h | |
parent | c2d1560ad8c2f6e0dd0d34102d022f3709325c26 (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/sta_info.h')
-rw-r--r-- | net/mac80211/sta_info.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index b5591d2f60a4..b5ef72379add 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -98,9 +98,6 @@ struct sta_info { | |||
98 | * filtering; used only if sta->key is not | 98 | * filtering; used only if sta->key is not |
99 | * set */ | 99 | * set */ |
100 | 100 | ||
101 | #ifdef CONFIG_MAC80211_DEBUGFS | ||
102 | int debugfs_registered; | ||
103 | #endif | ||
104 | int assoc_ap; /* whether this is an AP that we are | 101 | int assoc_ap; /* whether this is an AP that we are |
105 | * associated with as a client */ | 102 | * associated with as a client */ |
106 | 103 | ||
@@ -149,12 +146,18 @@ struct sta_info { | |||
149 | */ | 146 | */ |
150 | #define STA_INFO_CLEANUP_INTERVAL (10 * HZ) | 147 | #define STA_INFO_CLEANUP_INTERVAL (10 * HZ) |
151 | 148 | ||
149 | static inline void __sta_info_get(struct sta_info *sta) | ||
150 | { | ||
151 | kref_get(&sta->kref); | ||
152 | } | ||
153 | |||
152 | struct sta_info * sta_info_get(struct ieee80211_local *local, u8 *addr); | 154 | struct sta_info * sta_info_get(struct ieee80211_local *local, u8 *addr); |
153 | int sta_info_min_txrate_get(struct ieee80211_local *local); | 155 | int sta_info_min_txrate_get(struct ieee80211_local *local); |
154 | void sta_info_put(struct sta_info *sta); | 156 | void sta_info_put(struct sta_info *sta); |
155 | struct sta_info * sta_info_add(struct ieee80211_local *local, | 157 | struct sta_info * sta_info_add(struct ieee80211_local *local, |
156 | struct net_device *dev, u8 *addr, gfp_t gfp); | 158 | struct net_device *dev, u8 *addr, gfp_t gfp); |
157 | void sta_info_free(struct sta_info *sta, int locked); | 159 | void sta_info_remove(struct sta_info *sta); |
160 | void sta_info_free(struct sta_info *sta); | ||
158 | void sta_info_init(struct ieee80211_local *local); | 161 | void sta_info_init(struct ieee80211_local *local); |
159 | int sta_info_start(struct ieee80211_local *local); | 162 | int sta_info_start(struct ieee80211_local *local); |
160 | void sta_info_stop(struct ieee80211_local *local); | 163 | void sta_info_stop(struct ieee80211_local *local); |