wifi: rtw89: rfk: support IQK firmware command v1

Add new IQK firmware command format v1 (with suffix), and rename original
command format to v0 for older firmware.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250606020302.16873-4-pkshih@realtek.com
This commit is contained in:
Ping-Ke Shih 2025-06-06 10:02:59 +08:00
parent 29dc4c5602
commit b9b8828fdf
3 changed files with 41 additions and 3 deletions

View File

@ -4514,6 +4514,7 @@ enum rtw89_fw_feature {
RTW89_FW_FEATURE_RFK_PRE_NOTIFY_V0,
RTW89_FW_FEATURE_RFK_PRE_NOTIFY_V1,
RTW89_FW_FEATURE_RFK_RXDCK_V0,
RTW89_FW_FEATURE_RFK_IQK_V0,
RTW89_FW_FEATURE_NO_WOW_CPU_IO_RX,
RTW89_FW_FEATURE_NOTIFY_AP_INFO,
RTW89_FW_FEATURE_CH_INFO_BE_V0,

View File

@ -845,6 +845,7 @@ static const struct __fw_feat_cfg fw_feat_tbl[] = {
__CFG_FW_FEAT(RTL8922A, lt, 0, 35, 21, 0, SCAN_OFFLOAD_BE_V0),
__CFG_FW_FEAT(RTL8922A, ge, 0, 35, 12, 0, BEACON_FILTER),
__CFG_FW_FEAT(RTL8922A, ge, 0, 35, 22, 0, WOW_REASON_V1),
__CFG_FW_FEAT(RTL8922A, lt, 0, 35, 28, 0, RFK_IQK_V0),
__CFG_FW_FEAT(RTL8922A, lt, 0, 35, 31, 0, RFK_PRE_NOTIFY_V0),
__CFG_FW_FEAT(RTL8922A, lt, 0, 35, 31, 0, LPS_CH_INFO),
__CFG_FW_FEAT(RTL8922A, lt, 0, 35, 42, 0, RFK_RXDCK_V0),
@ -6080,22 +6081,47 @@ int rtw89_fw_h2c_rf_tssi(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy_idx,
int rtw89_fw_h2c_rf_iqk(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy_idx,
const struct rtw89_chan *chan)
{
struct rtw89_hal *hal = &rtwdev->hal;
struct rtw89_h2c_rf_iqk_v0 *h2c_v0;
struct rtw89_h2c_rf_iqk *h2c;
u32 len = sizeof(*h2c);
struct sk_buff *skb;
u8 ver = U8_MAX;
int ret;
if (RTW89_CHK_FW_FEATURE(RFK_IQK_V0, &rtwdev->fw)) {
len = sizeof(*h2c_v0);
ver = 0;
}
skb = rtw89_fw_h2c_alloc_skb_with_hdr(rtwdev, len);
if (!skb) {
rtw89_err(rtwdev, "failed to alloc skb for h2c RF IQK\n");
return -ENOMEM;
}
skb_put(skb, len);
if (ver == 0) {
h2c_v0 = (struct rtw89_h2c_rf_iqk_v0 *)skb->data;
h2c_v0->phy_idx = cpu_to_le32(phy_idx);
h2c_v0->dbcc = cpu_to_le32(rtwdev->dbcc_en);
goto done;
}
h2c = (struct rtw89_h2c_rf_iqk *)skb->data;
h2c->phy_idx = cpu_to_le32(phy_idx);
h2c->dbcc = cpu_to_le32(rtwdev->dbcc_en);
h2c->len = sizeof(*h2c);
h2c->ktype = 0;
h2c->phy = phy_idx;
h2c->kpath = rtw89_phy_get_kpath(rtwdev, phy_idx);
h2c->band = chan->band_type;
h2c->bw = chan->band_width;
h2c->ch = chan->channel;
h2c->cv = hal->cv;
done:
rtw89_h2c_pkt_set_hdr(rtwdev, skb, FWCMD_TYPE_H2C,
H2C_CAT_OUTSRC, H2C_CL_OUTSRC_RF_FW_RFK,
H2C_FUNC_RFK_IQK_OFFLOAD, 0, 0, len);

View File

@ -4438,11 +4438,22 @@ struct rtw89_h2c_rf_tssi {
u8 rfe_type;
} __packed;
struct rtw89_h2c_rf_iqk {
struct rtw89_h2c_rf_iqk_v0 {
__le32 phy_idx;
__le32 dbcc;
} __packed;
struct rtw89_h2c_rf_iqk {
u8 len;
u8 ktype;
u8 phy;
u8 kpath;
u8 band;
u8 bw;
u8 ch;
u8 cv;
} __packed;
struct rtw89_h2c_rf_dpk {
u8 len;
u8 phy;