]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: disable EHT protocol by chip capabilities
authorPing-Ke Shih <pkshih@realtek.com>
Sat, 10 Jan 2026 02:20:15 +0000 (10:20 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Thu, 15 Jan 2026 01:15:50 +0000 (09:15 +0800)
For certain chip models, EHT protocol is disabled, and driver must follow
the capabilities. Otherwise, chips become unusable.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260110022019.2254969-5-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/fw.h
drivers/net/wireless/realtek/rtw89/mac.c

index 4cc5e32d778cd5f10435bad96afa52178a91e5f1..6e77522bcd8f15833b1bc61244e86033a7af7fb9 100644 (file)
@@ -5395,7 +5395,7 @@ static void rtw89_init_eht_cap(struct rtw89_dev *rtwdev,
        u8 val, val_mcs13;
        int sts = 8;
 
-       if (chip->chip_gen == RTW89_CHIP_AX)
+       if (chip->chip_gen == RTW89_CHIP_AX || hal->no_eht)
                return;
 
        if (hal->no_mcs_12_13)
index 8d5655138ded82ce069705b55a60276d5e70e988..29625c4fe4e95caccab64da1a3c866f965423266 100644 (file)
@@ -5130,6 +5130,7 @@ struct rtw89_hal {
        bool support_cckpd;
        bool support_igi;
        bool no_mcs_12_13;
+       bool no_eht;
 
        atomic_t roc_chanctx_idx;
        u8 roc_link_index;
index 1542634f0146f69ebc624359d6229b533d4dbd5f..018b3bed57d21c3964a48212d330dbef860eb33a 100644 (file)
@@ -42,6 +42,10 @@ struct rtw89_c2hreg_phycap {
 #define RTW89_C2HREG_PHYCAP_W0_BW GENMASK(31, 24)
 #define RTW89_C2HREG_PHYCAP_W1_TX_NSS GENMASK(7, 0)
 #define RTW89_C2HREG_PHYCAP_W1_PROT GENMASK(15, 8)
+#define RTW89_C2HREG_PHYCAP_W1_PROT_11N 1
+#define RTW89_C2HREG_PHYCAP_W1_PROT_11AC 2
+#define RTW89_C2HREG_PHYCAP_W1_PROT_11AX 3
+#define RTW89_C2HREG_PHYCAP_W1_PROT_11BE 4
 #define RTW89_C2HREG_PHYCAP_W1_NIC GENMASK(23, 16)
 #define RTW89_C2HREG_PHYCAP_W1_WL_FUNC GENMASK(31, 24)
 #define RTW89_C2HREG_PHYCAP_W2_HW_TYPE GENMASK(7, 0)
index 3b9c6f9b7f5a22eff079b2a41571b078d15ea0ee..1435e4c664b6891264f73431f9597d145ad5bc2f 100644 (file)
@@ -3116,6 +3116,7 @@ static int rtw89_mac_setup_phycap_part0(struct rtw89_dev *rtwdev)
        struct rtw89_efuse *efuse = &rtwdev->efuse;
        struct rtw89_mac_c2h_info c2h_info = {};
        struct rtw89_hal *hal = &rtwdev->hal;
+       u8 protocol;
        u8 tx_nss;
        u8 rx_nss;
        u8 tx_ant;
@@ -3163,6 +3164,10 @@ static int rtw89_mac_setup_phycap_part0(struct rtw89_dev *rtwdev)
        rtw89_debug(rtwdev, RTW89_DBG_FW, "TX path diversity=%d\n", hal->tx_path_diversity);
        rtw89_debug(rtwdev, RTW89_DBG_FW, "Antenna diversity=%d\n", hal->ant_diversity);
 
+       protocol = u32_get_bits(phycap->w1, RTW89_C2HREG_PHYCAP_W1_PROT);
+       if (protocol < RTW89_C2HREG_PHYCAP_W1_PROT_11BE)
+               hal->no_eht = true;
+
        return 0;
 }