]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU
authorBitterblue Smith <rtl8821cerfe2@gmail.com>
Mon, 17 Feb 2025 23:30:22 +0000 (01:30 +0200)
committerPing-Ke Shih <pkshih@realtek.com>
Fri, 21 Feb 2025 02:03:02 +0000 (10:03 +0800)
Set the RX mask and the highest RX rate according to the number of
spatial streams the chip can receive. For RTL8814AU that is 3.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/4e786f50-ed1c-4387-8b28-e6ff00e35e81@gmail.com
drivers/net/wireless/realtek/rtw88/main.c

index e4f9b744f24de49958ba002a66da4587b01f0629..3319bb5044c3dd0fac0dff05642d7e177f85858b 100644 (file)
@@ -1565,6 +1565,7 @@ static void rtw_init_ht_cap(struct rtw_dev *rtwdev,
 {
        const struct rtw_chip_info *chip = rtwdev->chip;
        struct rtw_efuse *efuse = &rtwdev->efuse;
+       int i;
 
        ht_cap->ht_supported = true;
        ht_cap->cap = 0;
@@ -1584,17 +1585,11 @@ static void rtw_init_ht_cap(struct rtw_dev *rtwdev,
        ht_cap->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
        ht_cap->ampdu_density = chip->ampdu_density;
        ht_cap->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED;
-       if (efuse->hw_cap.nss > 1) {
-               ht_cap->mcs.rx_mask[0] = 0xFF;
-               ht_cap->mcs.rx_mask[1] = 0xFF;
-               ht_cap->mcs.rx_mask[4] = 0x01;
-               ht_cap->mcs.rx_highest = cpu_to_le16(300);
-       } else {
-               ht_cap->mcs.rx_mask[0] = 0xFF;
-               ht_cap->mcs.rx_mask[1] = 0x00;
-               ht_cap->mcs.rx_mask[4] = 0x01;
-               ht_cap->mcs.rx_highest = cpu_to_le16(150);
-       }
+
+       for (i = 0; i < efuse->hw_cap.nss; i++)
+               ht_cap->mcs.rx_mask[i] = 0xFF;
+       ht_cap->mcs.rx_mask[4] = 0x01;
+       ht_cap->mcs.rx_highest = cpu_to_le16(150 * efuse->hw_cap.nss);
 }
 
 static void rtw_init_vht_cap(struct rtw_dev *rtwdev,