wifi: rtw89: declare MLO support if prerequisites are met
authorZong-Zhe Yang <kevin_yang@realtek.com>
Mon, 5 May 2025 07:24:40 +0000 (15:24 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Sat, 10 May 2025 01:00:46 +0000 (09:00 +0800)
When the following prerequisites are met, driver will enable support_mlo.
It means that driver will declare WIPHY_FLAG_SUPPORTS_MLO, and then deal
with MLO related things.

The main prerequisites are as below.
1. all prerequisites for running with chanctx
2. FW feature NOTIFY_AP_INFO

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250505072440.45113-12-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c

index 22a0c54de716a4344969e11f5fb6a3cdf90dd99b..0b6fb30cbf52c8835b80565102977ebcb88f432e 100644 (file)
@@ -5666,13 +5666,13 @@ struct rtw89_dev *rtw89_alloc_ieee80211_hw(struct device *device,
        if (!hw)
                goto err;
 
-       /* TODO: When driver MLO arch. is done, determine whether to support MLO
-        * according to the following conditions.
-        * 1. run with chanctx_ops
-        * 2. chip->support_link_num != 0
-        * 3. FW feature supports AP_LINK_PS
+       /* Currently, our AP_LINK_PS handling only works for non-MLD softap
+        * or MLD-single-link softap. If RTW89_MLD_NON_STA_LINK_NUM enlarges,
+        * please tweak entire AP_LINKS_PS handling before supporting MLO.
         */
-       support_mlo = false;
+       support_mlo = !no_chanctx && chip->support_link_num &&
+                     RTW89_CHK_FW_FEATURE(NOTIFY_AP_INFO, &early_fw) &&
+                     RTW89_MLD_NON_STA_LINK_NUM == 1;
 
        hw->wiphy->iface_combinations = rtw89_iface_combs;