Skip to contentSkip to conversation

B43 no beacon ?

PATCH In review Matthieu CASTET 3 participants 4 messages May 11, 2009 – May 18, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

Hi,

I have trying to use openwrt head on a router with a 4306 (core rev 5). It use the compat-wireless-2009-05-08 as wireless driver and 4.150.10.5 firmware

I have no problem to associate and transmit data with one wifi card, but with another I got missed beacon errors.

After putting a wifi card in monitor mode, I saw that the 4306 never send beacon frame.

Do you have any idea why the 4306 AP never generate beacon frame ?

Thanks

Matthieu

maintainer
#2 lore raw

PATCH 1/1 b43/legacy: fix beacon change processing

In reply to Matthieu CASTET

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.

---
 drivers/net/wireless/b43/main.c       |   24 +++++++++++-------------
 drivers/net/wireless/b43legacy/main.c |   21 +++++++++------------
 2 files changed, 20 insertions(+), 25 deletions(-)
drivers/net/wireless/b43/main.c +11 -13
@@ -3553,27 +3553,25 @@ static void b43_op_bss_info_changed(stru
 
 	B43_WARN_ON(wl->vif != vif);
 
+	spin_lock_irqsave(&wl->irq_lock, flags);
 	if (changed & BSS_CHANGED_BSSID) {
-		spin_lock_irqsave(&wl->irq_lock, flags);
 		if (conf->bssid)
 			memcpy(wl->bssid, conf->bssid, ETH_ALEN);
 		else
 			memset(wl->bssid, 0, ETH_ALEN);
+	}
 
-		if (b43_status(dev) >= B43_STAT_INITIALIZED) {
-			if (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
-			    b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT)) {
-				B43_WARN_ON(vif->type != wl->if_type);
-				if (changed & BSS_CHANGED_BEACON)
-					b43_update_templates(wl);
-			} else if (b43_is_mode(wl, NL80211_IFTYPE_ADHOC)) {
-				if (changed & BSS_CHANGED_BEACON)
-					b43_update_templates(wl);
-			}
+	if (b43_status(dev) >= B43_STAT_INITIALIZED) {
+		if (changed & BSS_CHANGED_BEACON &&
+		    (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
+		     b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) ||
+		     b43_is_mode(wl, NL80211_IFTYPE_ADHOC)))
+			b43_update_templates(wl);
+
+		if (changed & BSS_CHANGED_BSSID)
 			b43_write_mac_bssid_templates(dev);
-		}
-		spin_unlock_irqrestore(&wl->irq_lock, flags);
 	}
+	spin_unlock_irqrestore(&wl->irq_lock, flags);
 
 	b43_mac_suspend(dev);
 
drivers/net/wireless/b43legacy/main.c +9 -12
@@ -2820,27 +2820,24 @@ static void b43legacy_op_bss_info_change
 	savedirqs = b43legacy_interrupt_disable(dev, B43legacy_IRQ_ALL);
 
 	if (changed & BSS_CHANGED_BSSID) {
-		spin_unlock_irqrestore(&wl->irq_lock, flags);
 		b43legacy_synchronize_irq(dev);
 
 		if (conf->bssid)
 			memcpy(wl->bssid, conf->bssid, ETH_ALEN);
 		else
 			memset(wl->bssid, 0, ETH_ALEN);
+	}
+
+	if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) {
+		if (changed & BSS_CHANGED_BEACON &&
+		    (b43legacy_is_mode(wl, NL80211_IFTYPE_AP) ||
+		     b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)))
+			b43legacy_update_templates(wl);
 
-		if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) {
-			if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP)) {
-				B43legacy_WARN_ON(vif->type != NL80211_IFTYPE_AP);
-				if (changed & BSS_CHANGED_BEACON)
-					b43legacy_update_templates(wl);
-			} else if (b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)) {
-				if (changed & BSS_CHANGED_BEACON)
-					b43legacy_update_templates(wl);
-			}
+		if (changed & BSS_CHANGED_BSSID)
 			b43legacy_write_mac_bssid_templates(dev);
-		}
-		spin_unlock_irqrestore(&wl->irq_lock, flags);
 	}
+	spin_unlock_irqrestore(&wl->irq_lock, flags);
 
 	b43legacy_mac_suspend(dev);
 
#3 lore raw

Re: [PATCH] b43/legacy: fix beacon change processing

Quoted 2 lines · On Monday 18 May 2009 10:53:18 Johannes Berg wrote:

Process beacon change even if the BSSID doesn't
change at the same time. Also fix what I think

ACK.

Quoted 2 lines

is a small locking error in b43legacy, there's
a spin_unlock_irqrestore that looks out of place.

Yeah, I think a patch was already submitted by larry.

Quoted 1 line
Signature · 1 line
Greetings, Michael.