]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw88: station mode only for SDIO chips
authorPing-Ke Shih <pkshih@realtek.com>
Wed, 27 Mar 2024 00:41:55 +0000 (08:41 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Fri, 29 Mar 2024 01:13:32 +0000 (09:13 +0800)
Since only station mode has been tested on SDIO chips, only keep it support
for SDIO chips to reflect correct supported features.

Link: https://lore.kernel.org/linux-wireless/87wmpu1do6.fsf@kernel.org/T/#t
Link: https://lore.kernel.org/linux-wireless/36972ff5-0c48-4bd2-8f9a-9649bfa24225@lexina.in/
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240327004155.7172-1-pkshih@realtek.com
drivers/net/wireless/realtek/rtw88/main.c

index 81ef4717dbf43aa426069314676c6a631eb0bed6..d1f0e7541bfa96f9b77c110ca90baba98abdc4f0 100644 (file)
@@ -2203,6 +2203,7 @@ EXPORT_SYMBOL(rtw_core_deinit);
 
 int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
 {
+       bool sta_mode_only = rtwdev->hci.type == RTW_HCI_TYPE_SDIO;
        struct rtw_hal *hal = &rtwdev->hal;
        int max_tx_headroom = 0;
        int ret;
@@ -2231,10 +2232,13 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
        ieee80211_hw_set(hw, TX_AMSDU);
        ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS);
 
-       hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
-                                    BIT(NL80211_IFTYPE_AP) |
-                                    BIT(NL80211_IFTYPE_ADHOC) |
-                                    BIT(NL80211_IFTYPE_MESH_POINT);
+       if (sta_mode_only)
+               hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
+       else
+               hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
+                                            BIT(NL80211_IFTYPE_AP) |
+                                            BIT(NL80211_IFTYPE_ADHOC) |
+                                            BIT(NL80211_IFTYPE_MESH_POINT);
        hw->wiphy->available_antennas_tx = hal->antenna_tx;
        hw->wiphy->available_antennas_rx = hal->antenna_rx;
 
@@ -2245,7 +2249,7 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
        hw->wiphy->max_scan_ssids = RTW_SCAN_MAX_SSIDS;
        hw->wiphy->max_scan_ie_len = rtw_get_max_scan_ie_len(rtwdev);
 
-       if (rtwdev->chip->id == RTW_CHIP_TYPE_8822C) {
+       if (!sta_mode_only && rtwdev->chip->id == RTW_CHIP_TYPE_8822C) {
                hw->wiphy->iface_combinations = rtw_iface_combs;
                hw->wiphy->n_iface_combinations = ARRAY_SIZE(rtw_iface_combs);
        }