mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH ath-next] wifi: ath9k_htc: do not fetch the beacon of a finished countdown
@ 2026-11-02 12:34 Mehmet Fide
  0 siblings, 0 replies; only message in thread
From: Mehmet Fide @ 2026-11-02 12:34 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen
  Cc: Chun-Yeow Yeoh, linux-wireless, linux-kernel, mehmet.fide

From: Mehmet Fide <mehmet.fide@screeningeagle.com>

ath9k_htc_send_beacon() checks the channel switch countdown only after
ieee80211_beacon_get(). mac80211 replaces the CSA beacon only after the
channel change, and ath9k_htc_set_channel() re-enables beaconing before
that, so an SWBA event can fetch the CSA beacon again on the new channel
and mac80211 reports "beacon TX faster than countdown".

Skip the beacon while the countdown is complete and finish the switch
from there, as ath9k does for non-EDMA chips. Finishing from the skip
also covers a count of 2, where the first fetch can complete the
countdown before csa_vif is set.

Tested on 6.12 with an AR9271 AP and hostapd chan_switch: the CSA beacon
was fetched again in 3 of 40 switches with a count of 5 before and in
none after, and all 60 switches with a count of 2 completed.

Fixes: f0e449627e4a ("ath9k_htc: add support of channel switch")
Signed-off-by: Mehmet Fide <mehmet.fide@screeningeagle.com>
---
 drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
index 81fa7cbad892..2b5bf07511bb 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
@@ -214,6 +214,13 @@ static void ath9k_htc_send_beacon(struct ath9k_htc_priv *priv,
 		return;
 	}
 
+	if (vif->bss_conf.csa_active &&
+	    ieee80211_beacon_cntdwn_is_complete(vif, 0)) {
+		spin_unlock_bh(&priv->beacon_lock);
+		ath9k_htc_csa_is_finished(priv);
+		return;
+	}
+
 	/* Get a new beacon */
 	beacon = ieee80211_beacon_get(priv->hw, vif, 0);
 	if (!beacon) {

base-commit: a3ddbb45768717b5c9f923489387cf55c838d1ad
-- 
2.56.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-02 12:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 12:34 [PATCH ath-next] wifi: ath9k_htc: do not fetch the beacon of a finished countdown Mehmet Fide

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®