aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
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/tx.c
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/tx.c')
-rw-r--r--net/mac80211/tx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index dc128b412eab..2a1a7d457136 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -306,7 +306,7 @@ static void purge_old_ps_buffers(struct ieee80211_local *local)
306 } 306 }
307 read_unlock(&local->sub_if_lock); 307 read_unlock(&local->sub_if_lock);
308 308
309 spin_lock_bh(&local->sta_lock); 309 read_lock_bh(&local->sta_lock);
310 list_for_each_entry(sta, &local->sta_list, list) { 310 list_for_each_entry(sta, &local->sta_list, list) {
311 skb = skb_dequeue(&sta->ps_tx_buf); 311 skb = skb_dequeue(&sta->ps_tx_buf);
312 if (skb) { 312 if (skb) {
@@ -315,7 +315,7 @@ static void purge_old_ps_buffers(struct ieee80211_local *local)
315 } 315 }
316 total += skb_queue_len(&sta->ps_tx_buf); 316 total += skb_queue_len(&sta->ps_tx_buf);
317 } 317 }
318 spin_unlock_bh(&local->sta_lock); 318 read_unlock_bh(&local->sta_lock);
319 319
320 local->total_ps_buffered = total; 320 local->total_ps_buffered = total;
321 printk(KERN_DEBUG "%s: PS buffers full - purged %d frames\n", 321 printk(KERN_DEBUG "%s: PS buffers full - purged %d frames\n",
@@ -1629,7 +1629,7 @@ static void ieee80211_beacon_add_tim(struct ieee80211_local *local,
1629 1629
1630 /* Generate bitmap for TIM only if there are any STAs in power save 1630 /* Generate bitmap for TIM only if there are any STAs in power save
1631 * mode. */ 1631 * mode. */
1632 spin_lock_bh(&local->sta_lock); 1632 read_lock_bh(&local->sta_lock);
1633 if (atomic_read(&bss->num_sta_ps) > 0) 1633 if (atomic_read(&bss->num_sta_ps) > 0)
1634 /* in the hope that this is faster than 1634 /* in the hope that this is faster than
1635 * checking byte-for-byte */ 1635 * checking byte-for-byte */
@@ -1680,7 +1680,7 @@ static void ieee80211_beacon_add_tim(struct ieee80211_local *local,
1680 *pos++ = aid0; /* Bitmap control */ 1680 *pos++ = aid0; /* Bitmap control */
1681 *pos++ = 0; /* Part Virt Bitmap */ 1681 *pos++ = 0; /* Part Virt Bitmap */
1682 } 1682 }
1683 spin_unlock_bh(&local->sta_lock); 1683 read_unlock_bh(&local->sta_lock);
1684} 1684}
1685 1685
1686struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, int if_id, 1686struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, int if_id,