diff options
author | Michael Buesch <mb@bu3sch.de> | 2007-12-26 12:04:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:44 -0500 |
commit | d4df6f1a9edb80c99913548467397617ccee7855 (patch) | |
tree | a1516d68078d95421ebe931cab94ccbb1dffcc67 /drivers/net/wireless/b43/main.c | |
parent | e66fee6aa04b27b6b6f812af0e4123eded5bf8ac (diff) |
b43: Fix template upload locking.
This fixes the template upload locking.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/main.c')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 9f6647ccc6d6..84b291144c37 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -1305,26 +1305,21 @@ static void b43_write_probe_resp_template(struct b43_wldev *dev, | |||
1305 | kfree(probe_resp_data); | 1305 | kfree(probe_resp_data); |
1306 | } | 1306 | } |
1307 | 1307 | ||
1308 | /* Asynchronously update the packet templates in template RAM. */ | 1308 | /* Asynchronously update the packet templates in template RAM. |
1309 | * Locking: Requires wl->irq_lock to be locked. */ | ||
1309 | static void b43_update_templates(struct b43_wl *wl, struct sk_buff *beacon) | 1310 | static void b43_update_templates(struct b43_wl *wl, struct sk_buff *beacon) |
1310 | { | 1311 | { |
1311 | unsigned long flags; | ||
1312 | |||
1313 | /* This is the top half of the ansynchronous beacon update. | 1312 | /* This is the top half of the ansynchronous beacon update. |
1314 | * The bottom half is the beacon IRQ. | 1313 | * The bottom half is the beacon IRQ. |
1315 | * Beacon update must be asynchronous to avoid sending an | 1314 | * Beacon update must be asynchronous to avoid sending an |
1316 | * invalid beacon. This can happen for example, if the firmware | 1315 | * invalid beacon. This can happen for example, if the firmware |
1317 | * transmits a beacon while we are updating it. */ | 1316 | * transmits a beacon while we are updating it. */ |
1318 | 1317 | ||
1319 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
1320 | |||
1321 | if (wl->current_beacon) | 1318 | if (wl->current_beacon) |
1322 | dev_kfree_skb_any(wl->current_beacon); | 1319 | dev_kfree_skb_any(wl->current_beacon); |
1323 | wl->current_beacon = beacon; | 1320 | wl->current_beacon = beacon; |
1324 | wl->beacon0_uploaded = 0; | 1321 | wl->beacon0_uploaded = 0; |
1325 | wl->beacon1_uploaded = 0; | 1322 | wl->beacon1_uploaded = 0; |
1326 | |||
1327 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
1328 | } | 1323 | } |
1329 | 1324 | ||
1330 | static void b43_set_ssid(struct b43_wldev *dev, const u8 * ssid, u8 ssid_len) | 1325 | static void b43_set_ssid(struct b43_wldev *dev, const u8 * ssid, u8 ssid_len) |
@@ -3598,6 +3593,7 @@ static int b43_op_beacon_set_tim(struct ieee80211_hw *hw, int aid, int set) | |||
3598 | { | 3593 | { |
3599 | struct b43_wl *wl = hw_to_b43_wl(hw); | 3594 | struct b43_wl *wl = hw_to_b43_wl(hw); |
3600 | struct sk_buff *beacon; | 3595 | struct sk_buff *beacon; |
3596 | unsigned long flags; | ||
3601 | 3597 | ||
3602 | /* We could modify the existing beacon and set the aid bit in | 3598 | /* We could modify the existing beacon and set the aid bit in |
3603 | * the TIM field, but that would probably require resizing and | 3599 | * the TIM field, but that would probably require resizing and |
@@ -3606,7 +3602,9 @@ static int b43_op_beacon_set_tim(struct ieee80211_hw *hw, int aid, int set) | |||
3606 | beacon = ieee80211_beacon_get(hw, wl->vif, NULL); | 3602 | beacon = ieee80211_beacon_get(hw, wl->vif, NULL); |
3607 | if (unlikely(!beacon)) | 3603 | if (unlikely(!beacon)) |
3608 | return -ENOMEM; | 3604 | return -ENOMEM; |
3605 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
3609 | b43_update_templates(wl, beacon); | 3606 | b43_update_templates(wl, beacon); |
3607 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
3610 | 3608 | ||
3611 | return 0; | 3609 | return 0; |
3612 | } | 3610 | } |
@@ -3616,8 +3614,11 @@ static int b43_op_ibss_beacon_update(struct ieee80211_hw *hw, | |||
3616 | struct ieee80211_tx_control *ctl) | 3614 | struct ieee80211_tx_control *ctl) |
3617 | { | 3615 | { |
3618 | struct b43_wl *wl = hw_to_b43_wl(hw); | 3616 | struct b43_wl *wl = hw_to_b43_wl(hw); |
3617 | unsigned long flags; | ||
3619 | 3618 | ||
3619 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
3620 | b43_update_templates(wl, beacon); | 3620 | b43_update_templates(wl, beacon); |
3621 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
3621 | 3622 | ||
3622 | return 0; | 3623 | return 0; |
3623 | } | 3624 | } |