Skip to contentSkip to conversation

ath9k: Configure beacons for AP vif if this has not happened yet

RFC In review Benjamin Berg 2 participants 2 messages Mar 10, 2015 – Mar 11, 2015 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

RFC 1/1 ath9k: Configure beacons for AP vif if this has not happened yet

Right now there is a bug where beaconing might not be enabled correctly if the user has configuring multiple VIFs.
The issue surfaces if the userspace first creates the AP devices and only then configures the first VIF (ath9k_bss_info_changed is called). In this case the current ath9k_allow_beacon_config implementation will not allow configuration as multiple AP VIFs are already present and beaconing is never configured in the driver.

This issue was probably introduced back in 2012 by commit ef4ad6336 "ath9k: Cleanup beacon logic". The fix in this patch simply checks whether beaconing has been configured yet (or configuration is scheduled) and allows the configuration in that case. This works around the issue here, but I have no idea whether it is a sane solution.

---
 drivers/net/wireless/ath/ath9k/beacon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/beacon.c +2 -1
index e387f0b..b41d778 100644
@@ -504,7 +504,8 @@ static bool ath9k_allow_beacon_config(struct ath_softc *sc,
 
 	if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) {
 		if ((vif->type != NL80211_IFTYPE_AP) ||
-		    (sc->nbcnvifs > 1)) {
+		    test_bit(ATH_OP_BEACONS, &common->op_flags) ||
+		    (sc->ps_flags & PS_BEACON_SYNC)) {
 			ath_dbg(common, CONFIG,
 				"An AP interface is already present !\n");
 			return false;
Signature · 1 line
2.1.4
#1 lore raw
Quoted 8 lines · Benjamin Berg

Right now there is a bug where beaconing might not be enabled correctly if the user has configuring multiple VIFs.
The issue surfaces if the userspace first creates the AP devices and only then configures the first VIF (ath9k_bss_info_changed is called). In this case the current ath9k_allow_beacon_config implementation will not allow configuration as multiple AP VIFs are already present and beaconing is never configured in the driver.

Quoted 5 lines

This issue was probably introduced back in 2012 by commit ef4ad6336 "ath9k: Cleanup beacon logic". The fix in this patch simply checks whether beaconing has been configured yet (or configuration is scheduled) and allows the configuration in that case. This works around the issue here, but I have no idea whether it is a sane solution.

Signed-off-by is missing.

Signature · 1 line
Kalle Valo