summaryrefslogtreecommitdiff
path: root/net/mac80211/ieee80211.c
diff options
context:
space:
mode:
authorMichael Wu <flamingice@sourmilk.net>2007-07-27 17:43:23 +0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-11 03:47:37 +0400
commitbe8755e1804d6f60e6a96a46ac6bc46ce6dfca53 (patch)
treea3038a924114f49aa2372ab7c9417d4e072c4b20 /net/mac80211/ieee80211.c
parentc2d1560ad8c2f6e0dd0d34102d022f3709325c26 (diff)
downloadlinux-be8755e1804d6f60e6a96a46ac6bc46ce6dfca53.tar.xz
[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.c')
-rw-r--r--net/mac80211/ieee80211.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 1981058907b7..566bdca32b86 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -628,8 +628,8 @@ int ieee80211_if_update_wds(struct net_device *dev, u8 *remote_addr)
/* Remove STA entry for the old peer */
sta = sta_info_get(local, sdata->u.wds.remote_addr);
if (sta) {
+ sta_info_free(sta);
sta_info_put(sta);
- sta_info_free(sta, 0);
} else {
printk(KERN_DEBUG "%s: could not find STA entry for WDS link "
"peer " MAC_FMT "\n",
@@ -776,13 +776,13 @@ static void ieee80211_stat_refresh(unsigned long data)
return;
/* go through all stations */
- spin_lock_bh(&local->sta_lock);
+ read_lock_bh(&local->sta_lock);
list_for_each_entry(sta, &local->sta_list, list) {
sta->channel_use = (sta->channel_use_raw / local->stat_time) /
CHAN_UTIL_PER_10MS;
sta->channel_use_raw = 0;
}
- spin_unlock_bh(&local->sta_lock);
+ read_unlock_bh(&local->sta_lock);
/* go through all subinterfaces */
read_lock(&local->sub_if_lock);