From 9b90bb67663c151c7d59b9fa662f9a62eed5c99d Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Wed, 26 Dec 2007 18:04:14 +0100 Subject: [PATCH] --- yaml --- r: 79407 b: refs/heads/master c: d4df6f1a9edb80c99913548467397617ccee7855 h: refs/heads/master i: 79405: dbf1d06e0ccc2967d7b484434b451b73d2c1654e 79403: 0c02ef00fa072f5e89d5cb61abbeb3e89d056e7e 79399: 83705f191bbc6a854e8e02073e4ca37c4ae72b5e 79391: 81dde38e91bdaca5e59076fe38829f2e169e7f27 v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/b43/main.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index f4032730fac3..0c3a89b32346 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e66fee6aa04b27b6b6f812af0e4123eded5bf8ac +refs/heads/master: d4df6f1a9edb80c99913548467397617ccee7855 diff --git a/trunk/drivers/net/wireless/b43/main.c b/trunk/drivers/net/wireless/b43/main.c index 9f6647ccc6d6..84b291144c37 100644 --- a/trunk/drivers/net/wireless/b43/main.c +++ b/trunk/drivers/net/wireless/b43/main.c @@ -1305,26 +1305,21 @@ static void b43_write_probe_resp_template(struct b43_wldev *dev, kfree(probe_resp_data); } -/* Asynchronously update the packet templates in template RAM. */ +/* Asynchronously update the packet templates in template RAM. + * Locking: Requires wl->irq_lock to be locked. */ static void b43_update_templates(struct b43_wl *wl, struct sk_buff *beacon) { - unsigned long flags; - /* This is the top half of the ansynchronous beacon update. * The bottom half is the beacon IRQ. * Beacon update must be asynchronous to avoid sending an * invalid beacon. This can happen for example, if the firmware * transmits a beacon while we are updating it. */ - spin_lock_irqsave(&wl->irq_lock, flags); - if (wl->current_beacon) dev_kfree_skb_any(wl->current_beacon); wl->current_beacon = beacon; wl->beacon0_uploaded = 0; wl->beacon1_uploaded = 0; - - spin_unlock_irqrestore(&wl->irq_lock, flags); } 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) { struct b43_wl *wl = hw_to_b43_wl(hw); struct sk_buff *beacon; + unsigned long flags; /* We could modify the existing beacon and set the aid bit in * 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) beacon = ieee80211_beacon_get(hw, wl->vif, NULL); if (unlikely(!beacon)) return -ENOMEM; + spin_lock_irqsave(&wl->irq_lock, flags); b43_update_templates(wl, beacon); + spin_unlock_irqrestore(&wl->irq_lock, flags); return 0; } @@ -3616,8 +3614,11 @@ static int b43_op_ibss_beacon_update(struct ieee80211_hw *hw, struct ieee80211_tx_control *ctl) { struct b43_wl *wl = hw_to_b43_wl(hw); + unsigned long flags; + spin_lock_irqsave(&wl->irq_lock, flags); b43_update_templates(wl, beacon); + spin_unlock_irqrestore(&wl->irq_lock, flags); return 0; }