]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: mcc: reset probe counter when receiving beacon
authorChih-Kang Chang <gary.chang@realtek.com>
Tue, 23 Dec 2025 03:06:51 +0000 (11:06 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Fri, 26 Dec 2025 03:03:27 +0000 (11:03 +0800)
For BE chips, needs to transmit QoS null data periodically to ensure
the connection with AP in GC+STA mode. However, in environments
with interference, the Qos null data might fail to transmit
successfully. Therefore, when receive the beacon from AP will
reset the QoS null data failure counter to avoid unnecessary
disconnection.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251223030651.480633-13-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/chan.c
drivers/net/wireless/realtek/rtw89/mac80211.c

index 86f1b39a967fea81060d7387dc190e5659d5e1f2..8fe6a7ef738f7ddd2bf41b65c023e0061e7f18ac 100644 (file)
@@ -2608,17 +2608,20 @@ bool rtw89_mcc_detect_go_bcn(struct rtw89_dev *rtwdev,
 static void rtw89_mcc_detect_connection(struct rtw89_dev *rtwdev,
                                        struct rtw89_mcc_role *role)
 {
+       struct rtw89_vif_link *rtwvif_link = role->rtwvif_link;
        struct ieee80211_vif *vif;
        bool start_detect;
        int ret;
 
        ret = rtw89_core_send_nullfunc(rtwdev, role->rtwvif_link, true, false,
                                       RTW89_MCC_PROBE_TIMEOUT);
-       if (ret)
+       if (ret &&
+           READ_ONCE(rtwvif_link->sync_bcn_tsf) == rtwvif_link->last_sync_bcn_tsf)
                role->probe_count++;
        else
                role->probe_count = 0;
 
+       rtwvif_link->last_sync_bcn_tsf = READ_ONCE(rtwvif_link->sync_bcn_tsf);
        if (role->probe_count < RTW89_MCC_PROBE_MAX_TRIES)
                return;
 
index e4fc513aa158c3ae7321feece254843e09b43bc4..f80c847d1741be662fc294070128eb2ecc31db40 100644 (file)
@@ -127,6 +127,7 @@ static int __rtw89_ops_add_iface_link(struct rtw89_dev *rtwdev,
        rtwvif_link->reg_6ghz_power = RTW89_REG_6GHZ_POWER_DFLT;
        rtwvif_link->rand_tsf_done = false;
        rtwvif_link->detect_bcn_count = 0;
+       rtwvif_link->last_sync_bcn_tsf = 0;
 
        rcu_read_lock();