[PATCH mt76 4/7] wifi: mt76: mt7996: abort CCA when CSA is starting

Shayne Chen
2025-11-25T03:47:36Z

From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>

When CSA countdown is going to start, carry UNI_BSS_INFO_BCN_BCC tag to
abort any CCA countdown.

Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 10 ++++++++++
drivers/net/wireless/mediatek/mt76/mt7996/mcu.h | 11 ++++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index 8f2b3f4f25ab..4e78f8e585d9 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -2796,6 +2796,16 @@ mt7996_mcu_beacon_cntdwn(struct sk_buff *rskb, struct sk_buff *skb,

info = (struct bss_bcn_cntdwn_tlv *)tlv;
info->cnt = skb->data[offs->cntdwn_counter_offs[0]];
+
+ /* abort the CCA countdown when starting CSA countdown */
+ if (csa) {
+ struct bss_bcn_cntdwn_tlv *cca_info;
+
+ tlv = mt7996_mcu_add_uni_tlv(rskb, UNI_BSS_INFO_BCN_BCC,
+ sizeof(*cca_info));
+ cca_info = (struct bss_bcn_cntdwn_tlv *)tlv;
+ cca_info->cca.abort = true;
+ }
}

static void
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
index 5b3597ca79be..1283beb0dc19 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
@@ -412,7 +412,16 @@ struct bss_bcn_cntdwn_tlv {
__le16 tag;
__le16 len;
u8 cnt;
- u8 rsv[3];
+ union {
+ struct {
+ bool static_pp;
+ bool abort;
+ } csa;
+ struct {
+ bool abort;
+ } cca;
+ };
+ u8 rsv;
} __packed;

struct bss_bcn_mbss_tlv {
--
2.51.0