]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rtw89: fw: load TX compensation element by RFE type
authorPing-Ke Shih <pkshih@realtek.com>
Wed, 20 May 2026 12:38:20 +0000 (20:38 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Wed, 27 May 2026 08:28:23 +0000 (16:28 +0800)
Originally driver uses TX compensation element by AID, and now tables are
by RFE type. Add the logic accordingly.

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

index 3e6161743015803d470ce25ee7dc17ddff722959..d6a594b75ab20232b27f9b1a6c5f07cfa6c869ff 100644 (file)
@@ -1423,12 +1423,18 @@ int rtw89_build_tx_comp_from_elm(struct rtw89_dev *rtwdev,
                                 const union rtw89_fw_element_arg arg)
 {
        struct rtw89_fw_elm_info *elm_info = &rtwdev->fw.elm_info;
+       struct rtw89_efuse *efuse = &rtwdev->efuse;
        struct rtw89_hal *hal = &rtwdev->hal;
+       u8 rfe_type;
        u16 aid;
 
        aid = le16_to_cpu(elm->aid);
+       rfe_type = elm->u.tx_comp.rfe_type;
+
        if (aid && aid != hal->aid)
                return 1; /* ignore if aid not matched */
+       else if (rfe_type && rfe_type != efuse->rfe_type)
+               return 1; /* ignore if rfe_type not matched */
        else if (elm_info->tx_comp)
                return 1; /* ignore if an element is existing */
 
index cde8fd34723b96476f84c4c6ec273f012c0f7a8b..20721d5209aa3a1149ebe691bd41e008781cedfd 100644 (file)
@@ -4548,6 +4548,11 @@ struct rtw89_fw_element_hdr {
                        u8 rsvd[4];
                        u8 rules_and_msgs[];
                } __packed diag_mac;
+               struct {
+                       u8 rfe_type;
+                       u8 priv[7];
+                       u8 contents[];
+               } __packed tx_comp;
                struct __rtw89_fw_txpwr_element txpwr;
                struct __rtw89_fw_regd_element regd;
        } __packed u;