]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: fw: add RFE type to RF TSSI H2C command
authorZong-Zhe Yang <kevin_yang@realtek.com>
Fri, 6 Jun 2025 02:02:58 +0000 (10:02 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Tue, 10 Jun 2025 02:03:21 +0000 (10:03 +0800)
Append a new field for RFE (RF Front End) type to RF TSSI H2C command.
FW has forward compatibility when handling this H2C command, so just
need to consider backward cases in FW point of view.

              | old FW | new FW
  ------------------------------
   old driver |    O   |    X
  ------------------------------
   new driver |    O   |    O

Currently only RTL8922A uses this RF TSSI H2C command. Increase its FW
format max and will let new FW binary align with it. Then, old driver
won't load new FW.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250606020302.16873-3-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/fw.c
drivers/net/wireless/realtek/rtw89/fw.h
drivers/net/wireless/realtek/rtw89/rtw8922a.c

index 36147040c35b0bf222edde5424e7e4bc90fe2b3f..1d37ea7f1391d40f832eec7c77e0e22d6c3430a7 100644 (file)
@@ -6032,6 +6032,7 @@ fail:
 int rtw89_fw_h2c_rf_tssi(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy_idx,
                         const struct rtw89_chan *chan, enum rtw89_tssi_mode tssi_mode)
 {
+       struct rtw89_efuse *efuse = &rtwdev->efuse;
        struct rtw89_hal *hal = &rtwdev->hal;
        struct rtw89_h2c_rf_tssi *h2c;
        u32 len = sizeof(*h2c);
@@ -6054,6 +6055,7 @@ int rtw89_fw_h2c_rf_tssi(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy_idx,
        h2c->hwtx_en = true;
        h2c->cv = hal->cv;
        h2c->tssi_mode = tssi_mode;
+       h2c->rfe_type = efuse->rfe_type;
 
        rtw89_phy_rfk_tssi_fill_fwcmd_efuse_to_de(rtwdev, phy_idx, chan, h2c);
        rtw89_phy_rfk_tssi_fill_fwcmd_tmeter_tbl(rtwdev, phy_idx, chan, h2c);
index 0fcc824e41be6dc9da9d6698befcc7580d523ab2..2fc2d1d61e299e99cfed8234c95337bbf9a3a654 100644 (file)
@@ -4435,6 +4435,7 @@ struct rtw89_h2c_rf_tssi {
        u8 pg_thermal[2];
        u8 ftable[2][128];
        u8 tssi_mode;
+       u8 rfe_type;
 } __packed;
 
 struct rtw89_h2c_rf_iqk {
index 1d0f6e7df497d609f8d389bffdfd96d6ac5bb124..680168f3146661d36b08bd6a1c16843f576fa844 100644 (file)
@@ -15,7 +15,7 @@
 #include "sar.h"
 #include "util.h"
 
-#define RTW8922A_FW_FORMAT_MAX 3
+#define RTW8922A_FW_FORMAT_MAX 4
 #define RTW8922A_FW_BASENAME "rtw89/rtw8922a_fw"
 #define RTW8922A_MODULE_FIRMWARE \
        RTW8922A_FW_BASENAME "-" __stringify(RTW8922A_FW_FORMAT_MAX) ".bin"