aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-05-18 04:53:18 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-20 14:46:28 -0400
commit3f0d843b5c94be824c2027f01348f360958e5542 (patch)
tree0bfdbf899df143df6b9022b6584516f4f4e16532
parentff561ac84e0bdfe1316ed355669dd73101609f24 (diff)
b43/legacy: fix beacon change processing
Process beacon change even if the BSSID doesn't change at the same time. Also fix what I think is a small locking error in b43legacy, there's a spin_unlock_irqrestore that looks out of place. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/b43/main.c24
-rw-r--r--drivers/net/wireless/b43legacy/main.c21
2 files changed, 20 insertions, 25 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 2615aaf7df6a..ec8516eadc4f 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3553,27 +3553,25 @@ static void b43_op_bss_info_changed(struct ieee80211_hw *hw,
3553 3553
3554 B43_WARN_ON(wl->vif != vif); 3554 B43_WARN_ON(wl->vif != vif);
3555 3555
3556 spin_lock_irqsave(&wl->irq_lock, flags);
3556 if (changed & BSS_CHANGED_BSSID) { 3557 if (changed & BSS_CHANGED_BSSID) {
3557 spin_lock_irqsave(&wl->irq_lock, flags);
3558 if (conf->bssid) 3558 if (conf->bssid)
3559 memcpy(wl->bssid, conf->bssid, ETH_ALEN); 3559 memcpy(wl->bssid, conf->bssid, ETH_ALEN);
3560 else 3560 else
3561 memset(wl->bssid, 0, ETH_ALEN); 3561 memset(wl->bssid, 0, ETH_ALEN);
3562 }
3562 3563
3563 if (b43_status(dev) >= B43_STAT_INITIALIZED) { 3564 if (b43_status(dev) >= B43_STAT_INITIALIZED) {
3564 if (b43_is_mode(wl, NL80211_IFTYPE_AP) || 3565 if (changed & BSS_CHANGED_BEACON &&
3565 b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT)) { 3566 (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
3566 B43_WARN_ON(vif->type != wl->if_type); 3567 b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) ||
3567 if (changed & BSS_CHANGED_BEACON) 3568 b43_is_mode(wl, NL80211_IFTYPE_ADHOC)))
3568 b43_update_templates(wl); 3569 b43_update_templates(wl);
3569 } else if (b43_is_mode(wl, NL80211_IFTYPE_ADHOC)) { 3570
3570 if (changed & BSS_CHANGED_BEACON) 3571 if (changed & BSS_CHANGED_BSSID)
3571 b43_update_templates(wl);
3572 }
3573 b43_write_mac_bssid_templates(dev); 3572 b43_write_mac_bssid_templates(dev);
3574 }
3575 spin_unlock_irqrestore(&wl->irq_lock, flags);
3576 } 3573 }
3574 spin_unlock_irqrestore(&wl->irq_lock, flags);
3577 3575
3578 b43_mac_suspend(dev); 3576 b43_mac_suspend(dev);
3579 3577
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 0062b340d989..f6f3fbf0a2f4 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2787,27 +2787,24 @@ static void b43legacy_op_bss_info_changed(struct ieee80211_hw *hw,
2787 b43legacy_write32(dev, B43legacy_MMIO_GEN_IRQ_MASK, 0); 2787 b43legacy_write32(dev, B43legacy_MMIO_GEN_IRQ_MASK, 0);
2788 2788
2789 if (changed & BSS_CHANGED_BSSID) { 2789 if (changed & BSS_CHANGED_BSSID) {
2790 spin_unlock_irqrestore(&wl->irq_lock, flags);
2791 b43legacy_synchronize_irq(dev); 2790 b43legacy_synchronize_irq(dev);
2792 2791
2793 if (conf->bssid) 2792 if (conf->bssid)
2794 memcpy(wl->bssid, conf->bssid, ETH_ALEN); 2793 memcpy(wl->bssid, conf->bssid, ETH_ALEN);
2795 else 2794 else
2796 memset(wl->bssid, 0, ETH_ALEN); 2795 memset(wl->bssid, 0, ETH_ALEN);
2796 }
2797
2798 if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) {
2799 if (changed & BSS_CHANGED_BEACON &&
2800 (b43legacy_is_mode(wl, NL80211_IFTYPE_AP) ||
2801 b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)))
2802 b43legacy_update_templates(wl);
2797 2803
2798 if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) { 2804 if (changed & BSS_CHANGED_BSSID)
2799 if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP)) {
2800 B43legacy_WARN_ON(vif->type != NL80211_IFTYPE_AP);
2801 if (changed & BSS_CHANGED_BEACON)
2802 b43legacy_update_templates(wl);
2803 } else if (b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)) {
2804 if (changed & BSS_CHANGED_BEACON)
2805 b43legacy_update_templates(wl);
2806 }
2807 b43legacy_write_mac_bssid_templates(dev); 2805 b43legacy_write_mac_bssid_templates(dev);
2808 }
2809 spin_unlock_irqrestore(&wl->irq_lock, flags);
2810 } 2806 }
2807 spin_unlock_irqrestore(&wl->irq_lock, flags);
2811 2808
2812 b43legacy_mac_suspend(dev); 2809 b43legacy_mac_suspend(dev);
2813 2810