All of lore.kernel.org
 help / color / mirror / Atom feed
* [ath9k-devel] [PATCH] ath9k: Configure beacons for AP vif if this has not happened yet
@ 2015-03-13 13:33 Benjamin Berg
  2015-03-13 14:14 ` Kalle Valo
  2015-03-13 14:27 ` Felix Fietkau
  0 siblings, 2 replies; 5+ messages in thread
From: Benjamin Berg @ 2015-03-13 13:33 UTC (permalink / raw)
  To: ath9k-devel

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.

Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
---
 drivers/net/wireless/ath/ath9k/beacon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index cb366ad..0eb83b8 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -522,7 +522,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;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-13 15:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-13 13:33 [ath9k-devel] [PATCH] ath9k: Configure beacons for AP vif if this has not happened yet Benjamin Berg
2015-03-13 14:14 ` Kalle Valo
2015-03-13 14:27 ` Felix Fietkau
2015-03-13 15:37   ` Benjamin Berg
2015-03-13 15:51   ` Ben Greear

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.