mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
wifi: rtw89: rfk: update RFK pre info V2 for RTL8922D
The H2C command of RFK pre info is to tell current operating channels to firmware, so RF calibrations can rely on these information as arguments to configure hardware. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20251231090647.56407-2-pkshih@realtek.com
This commit is contained in:
parent
6a0b7392a6
commit
8c0ac5791e
|
|
@ -4684,6 +4684,7 @@ enum rtw89_fw_feature {
|
|||
RTW89_FW_FEATURE_WOW_REASON_V1,
|
||||
RTW89_FW_FEATURE_RFK_PRE_NOTIFY_V0,
|
||||
RTW89_FW_FEATURE_RFK_PRE_NOTIFY_V1,
|
||||
RTW89_FW_FEATURE_RFK_PRE_NOTIFY_V2,
|
||||
RTW89_FW_FEATURE_RFK_RXDCK_V0,
|
||||
RTW89_FW_FEATURE_RFK_IQK_V0,
|
||||
RTW89_FW_FEATURE_NO_WOW_CPU_IO_RX,
|
||||
|
|
|
|||
|
|
@ -885,6 +885,7 @@ static const struct __fw_feat_cfg fw_feat_tbl[] = {
|
|||
__CFG_FW_FEAT(RTL8922A, ge, 0, 35, 46, 0, NOTIFY_AP_INFO),
|
||||
__CFG_FW_FEAT(RTL8922A, lt, 0, 35, 47, 0, CH_INFO_BE_V0),
|
||||
__CFG_FW_FEAT(RTL8922A, lt, 0, 35, 49, 0, RFK_PRE_NOTIFY_V1),
|
||||
__CFG_FW_FEAT(RTL8922A, ge, 0, 35, 49, 0, RFK_PRE_NOTIFY_V2),
|
||||
__CFG_FW_FEAT(RTL8922A, lt, 0, 35, 51, 0, NO_PHYCAP_P1),
|
||||
__CFG_FW_FEAT(RTL8922A, lt, 0, 35, 64, 0, NO_POWER_DIFFERENCE),
|
||||
__CFG_FW_FEAT(RTL8922A, ge, 0, 35, 71, 0, BEACON_LOSS_COUNT_V1),
|
||||
|
|
@ -6368,6 +6369,7 @@ int rtw89_fw_h2c_rf_pre_ntfy(struct rtw89_dev *rtwdev,
|
|||
struct rtw89_fw_h2c_rfk_pre_info_common *common;
|
||||
struct rtw89_fw_h2c_rfk_pre_info_v0 *h2c_v0;
|
||||
struct rtw89_fw_h2c_rfk_pre_info_v1 *h2c_v1;
|
||||
struct rtw89_fw_h2c_rfk_pre_info_v2 *h2c_v2;
|
||||
struct rtw89_fw_h2c_rfk_pre_info *h2c;
|
||||
u8 tbl_sel[NUM_OF_RTW89_FW_RFK_PATH];
|
||||
u32 len = sizeof(*h2c);
|
||||
|
|
@ -6377,7 +6379,10 @@ int rtw89_fw_h2c_rf_pre_ntfy(struct rtw89_dev *rtwdev,
|
|||
u32 val32;
|
||||
int ret;
|
||||
|
||||
if (RTW89_CHK_FW_FEATURE(RFK_PRE_NOTIFY_V1, &rtwdev->fw)) {
|
||||
if (RTW89_CHK_FW_FEATURE(RFK_PRE_NOTIFY_V2, &rtwdev->fw)) {
|
||||
len = sizeof(*h2c_v2);
|
||||
ver = 2;
|
||||
} else if (RTW89_CHK_FW_FEATURE(RFK_PRE_NOTIFY_V1, &rtwdev->fw)) {
|
||||
len = sizeof(*h2c_v1);
|
||||
ver = 1;
|
||||
} else if (RTW89_CHK_FW_FEATURE(RFK_PRE_NOTIFY_V0, &rtwdev->fw)) {
|
||||
|
|
@ -6391,8 +6396,21 @@ int rtw89_fw_h2c_rf_pre_ntfy(struct rtw89_dev *rtwdev,
|
|||
return -ENOMEM;
|
||||
}
|
||||
skb_put(skb, len);
|
||||
|
||||
if (ver <= 2)
|
||||
goto old_format;
|
||||
|
||||
h2c = (struct rtw89_fw_h2c_rfk_pre_info *)skb->data;
|
||||
common = &h2c->base_v1.common;
|
||||
|
||||
h2c->mlo_mode = cpu_to_le32(rtwdev->mlo_dbcc_mode);
|
||||
h2c->phy_idx = cpu_to_le32(phy_idx);
|
||||
h2c->mlo_1_1 = cpu_to_le32(rtw89_is_mlo_1_1(rtwdev));
|
||||
|
||||
goto done;
|
||||
|
||||
old_format:
|
||||
h2c_v2 = (struct rtw89_fw_h2c_rfk_pre_info_v2 *)skb->data;
|
||||
common = &h2c_v2->base_v1.common;
|
||||
|
||||
common->mlo_mode = cpu_to_le32(rtwdev->mlo_dbcc_mode);
|
||||
|
||||
|
|
@ -6419,7 +6437,7 @@ int rtw89_fw_h2c_rf_pre_ntfy(struct rtw89_dev *rtwdev,
|
|||
if (ver <= 1)
|
||||
continue;
|
||||
|
||||
h2c->cur_bandwidth[path] =
|
||||
h2c_v2->cur_bandwidth[path] =
|
||||
cpu_to_le32(rfk_mcc->data[path].bw[tbl_sel[path]]);
|
||||
}
|
||||
|
||||
|
|
@ -6450,7 +6468,7 @@ int rtw89_fw_h2c_rf_pre_ntfy(struct rtw89_dev *rtwdev,
|
|||
}
|
||||
|
||||
if (rtw89_is_mlo_1_1(rtwdev)) {
|
||||
h2c_v1 = &h2c->base_v1;
|
||||
h2c_v1 = &h2c_v2->base_v1;
|
||||
h2c_v1->mlo_1_1 = cpu_to_le32(1);
|
||||
}
|
||||
done:
|
||||
|
|
|
|||
|
|
@ -4574,11 +4574,17 @@ struct rtw89_fw_h2c_rfk_pre_info_v1 {
|
|||
__le32 mlo_1_1;
|
||||
} __packed;
|
||||
|
||||
struct rtw89_fw_h2c_rfk_pre_info {
|
||||
struct rtw89_fw_h2c_rfk_pre_info_v2 {
|
||||
struct rtw89_fw_h2c_rfk_pre_info_v1 base_v1;
|
||||
__le32 cur_bandwidth[NUM_OF_RTW89_FW_RFK_PATH];
|
||||
} __packed;
|
||||
|
||||
struct rtw89_fw_h2c_rfk_pre_info {
|
||||
__le32 mlo_mode;
|
||||
__le32 phy_idx;
|
||||
__le32 mlo_1_1;
|
||||
} __packed;
|
||||
|
||||
struct rtw89_h2c_rf_tssi {
|
||||
__le16 len;
|
||||
u8 phy;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user