]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: correct VHT TX rate on 20MHz connection
authorDian-Syuan Yang <dian_syuan0116@realtek.com>
Wed, 31 Jul 2024 07:05:06 +0000 (15:05 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Wed, 7 Aug 2024 03:06:24 +0000 (11:06 +0800)
It may get wrong bitrate when connecting to AP set VHT 20MHz,
and thus we fix it to follow Wi-Fi spec.

Signed-off-by: Dian-Syuan Yang <dian_syuan0116@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240731070506.46100-6-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/phy.c

index 118d09b3eaddc581b74c9de2d0feeb8b5d588f00..aa4fc911599555aa65da4fc835e4b3855f71b247 100644 (file)
@@ -341,8 +341,11 @@ static void rtw89_phy_ra_sta_update(struct rtw89_dev *rtwdev,
 
                mode |= RTW89_RA_MODE_VHT;
                csi_mode = RTW89_RA_RPT_MODE_VHT;
-               /* MCS9, MCS8, MCS7 */
-               ra_mask |= get_mcs_ra_mask(mcs_map, 9, 1);
+               /* MCS9 (non-20MHz), MCS8, MCS7 */
+               if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_20)
+                       ra_mask |= get_mcs_ra_mask(mcs_map, 8, 1);
+               else
+                       ra_mask |= get_mcs_ra_mask(mcs_map, 9, 1);
                high_rate_masks = rtw89_ra_mask_vht_rates;
                if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_MASK)
                        stbc_en = 1;