diff mbox series

[4/4] wifi: rtw89: declare EXT NSS BW of VHT capability

Message ID 20240112062640.36922-5-pkshih@realtek.com (mailing list archive)
State Accepted
Commit 4f47e0cf1a84debed285b2b6a4a567a2cfec7e9b
Delegated to: Kalle Valo
Headers show
Series wifi: rtw89: declare EHT capabilities | expand

Commit Message

Ping-Ke Shih Jan. 12, 2024, 6:26 a.m. UTC
According to IEEE Std. 802.11, it defines:
Indicates whether the STA is capable of interpreting the Extended NSS BW
Support subfield of the VHT Capabilities Information field.

Some AP such as TP-LINK BE19000 would check it for bandwidth settings, so
causes 80MHz rate when associating on 160 MHz bandwidth. Declare this
capability to yield expected result.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/core.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index 7f3060898ea8..8522eb0f0ad2 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -3648,6 +3648,10 @@  static void rtw89_init_vht_cap(struct rtw89_dev *rtwdev,
 	vht_cap->vht_mcs.tx_mcs_map = cpu_to_le16(tx_mcs_map);
 	vht_cap->vht_mcs.rx_highest = highest[hal->rx_nss - 1];
 	vht_cap->vht_mcs.tx_highest = highest[hal->tx_nss - 1];
+
+	if (ieee80211_hw_check(rtwdev->hw, SUPPORTS_VHT_EXT_NSS_BW))
+		vht_cap->vht_mcs.tx_highest |=
+			cpu_to_le16(IEEE80211_VHT_EXT_NSS_BW_CAPABLE);
 }
 
 static void rtw89_init_he_cap(struct rtw89_dev *rtwdev,
@@ -4391,6 +4395,7 @@  EXPORT_SYMBOL(rtw89_chip_info_setup);
 
 static int rtw89_core_register_hw(struct rtw89_dev *rtwdev)
 {
+	const struct rtw89_chip_info *chip = rtwdev->chip;
 	struct ieee80211_hw *hw = rtwdev->hw;
 	struct rtw89_efuse *efuse = &rtwdev->efuse;
 	struct rtw89_hal *hal = &rtwdev->hal;
@@ -4428,6 +4433,9 @@  static int rtw89_core_register_hw(struct rtw89_dev *rtwdev)
 	/* ref: description of rtw89_mcc_get_tbtt_ofst() in chan.c */
 	ieee80211_hw_set(hw, TIMING_BEACON_ONLY);
 
+	if (chip->support_bandwidths & BIT(NL80211_CHAN_WIDTH_160))
+		ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW);
+
 	if (RTW89_CHK_FW_FEATURE(BEACON_FILTER, &rtwdev->fw))
 		ieee80211_hw_set(hw, CONNECTION_MONITOR);