]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: mlo: rearrange MLSR link decision flow
authorKuan-Chung Chen <damon.chen@realtek.com>
Wed, 29 Apr 2026 13:26:19 +0000 (21:26 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Wed, 6 May 2026 08:01:39 +0000 (16:01 +0800)
The original MLSR link decision refers to RSSI, but it should be
based on the premise of an existing link. Otherwise, make a link
decision to select a new link from any available band.

Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260429132625.1659182-2-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c

index 7e058c071cc430277994714910358a2936b9f836..03d80d012022a109d90b2dca112f57621f3714ac 100644 (file)
@@ -4746,13 +4746,19 @@ static void rtw89_core_mlsr_link_decision(struct rtw89_dev *rtwdev,
 {
        unsigned int sel_link_id = IEEE80211_MLD_MAX_NUM_LINKS;
        struct ieee80211_vif *vif = rtwvif_to_vif(rtwvif);
+       u8 decided_bands = BIT(RTW89_BAND_NUM) - 1;
        struct rtw89_vif_link *rtwvif_link;
        const struct rtw89_chan *chan;
        unsigned long usable_links;
        unsigned int link_id;
-       u8 decided_bands;
        u8 rssi;
 
+       usable_links = ieee80211_vif_usable_links(vif);
+
+       rtwvif_link = rtw89_get_designated_link(rtwvif);
+       if (unlikely(!rtwvif_link))
+               goto select;
+
        rssi = ewma_rssi_read(&rtwdev->phystat.bcn_rssi);
        if (unlikely(!rssi))
                return;
@@ -4764,12 +4770,6 @@ static void rtw89_core_mlsr_link_decision(struct rtw89_dev *rtwdev,
        else
                return;
 
-       usable_links = ieee80211_vif_usable_links(vif);
-
-       rtwvif_link = rtw89_get_designated_link(rtwvif);
-       if (unlikely(!rtwvif_link))
-               goto select;
-
        chan = rtw89_chan_get(rtwdev, rtwvif_link->chanctx_idx);
        if (decided_bands & BIT(chan->band_type))
                return;