Commit 3f0d843b authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

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: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ff561ac8
...@@ -3553,27 +3553,25 @@ static void b43_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -3553,27 +3553,25 @@ static void b43_op_bss_info_changed(struct ieee80211_hw *hw,
B43_WARN_ON(wl->vif != vif); B43_WARN_ON(wl->vif != vif);
if (changed & BSS_CHANGED_BSSID) {
spin_lock_irqsave(&wl->irq_lock, flags); spin_lock_irqsave(&wl->irq_lock, flags);
if (changed & BSS_CHANGED_BSSID) {
if (conf->bssid) if (conf->bssid)
memcpy(wl->bssid, conf->bssid, ETH_ALEN); memcpy(wl->bssid, conf->bssid, ETH_ALEN);
else else
memset(wl->bssid, 0, ETH_ALEN); memset(wl->bssid, 0, ETH_ALEN);
}
if (b43_status(dev) >= B43_STAT_INITIALIZED) { if (b43_status(dev) >= B43_STAT_INITIALIZED) {
if (b43_is_mode(wl, NL80211_IFTYPE_AP) || if (changed & BSS_CHANGED_BEACON &&
b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT)) { (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
B43_WARN_ON(vif->type != wl->if_type); b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) ||
if (changed & BSS_CHANGED_BEACON) b43_is_mode(wl, NL80211_IFTYPE_ADHOC)))
b43_update_templates(wl);
} else if (b43_is_mode(wl, NL80211_IFTYPE_ADHOC)) {
if (changed & BSS_CHANGED_BEACON)
b43_update_templates(wl); b43_update_templates(wl);
}
if (changed & BSS_CHANGED_BSSID)
b43_write_mac_bssid_templates(dev); b43_write_mac_bssid_templates(dev);
} }
spin_unlock_irqrestore(&wl->irq_lock, flags); spin_unlock_irqrestore(&wl->irq_lock, flags);
}
b43_mac_suspend(dev); b43_mac_suspend(dev);
......
...@@ -2787,27 +2787,24 @@ static void b43legacy_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -2787,27 +2787,24 @@ static void b43legacy_op_bss_info_changed(struct ieee80211_hw *hw,
b43legacy_write32(dev, B43legacy_MMIO_GEN_IRQ_MASK, 0); b43legacy_write32(dev, B43legacy_MMIO_GEN_IRQ_MASK, 0);
if (changed & BSS_CHANGED_BSSID) { if (changed & BSS_CHANGED_BSSID) {
spin_unlock_irqrestore(&wl->irq_lock, flags);
b43legacy_synchronize_irq(dev); b43legacy_synchronize_irq(dev);
if (conf->bssid) if (conf->bssid)
memcpy(wl->bssid, conf->bssid, ETH_ALEN); memcpy(wl->bssid, conf->bssid, ETH_ALEN);
else else
memset(wl->bssid, 0, ETH_ALEN); memset(wl->bssid, 0, ETH_ALEN);
}
if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) { if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) {
if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP)) { if (changed & BSS_CHANGED_BEACON &&
B43legacy_WARN_ON(vif->type != NL80211_IFTYPE_AP); (b43legacy_is_mode(wl, NL80211_IFTYPE_AP) ||
if (changed & BSS_CHANGED_BEACON) b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)))
b43legacy_update_templates(wl);
} else if (b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)) {
if (changed & BSS_CHANGED_BEACON)
b43legacy_update_templates(wl); b43legacy_update_templates(wl);
}
if (changed & BSS_CHANGED_BSSID)
b43legacy_write_mac_bssid_templates(dev); b43legacy_write_mac_bssid_templates(dev);
} }
spin_unlock_irqrestore(&wl->irq_lock, flags); spin_unlock_irqrestore(&wl->irq_lock, flags);
}
b43legacy_mac_suspend(dev); b43legacy_mac_suspend(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment