mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 12:52:29 -04:00
wifi: rtw89: coex: Add Wi-Fi MLO info version 2 H2C command
The info included MLO status, hardware status, firmware will set corresponding register control to do coexistence (PTA slot priority, RF switch etc.) Signed-off-by: Ching-Te Ku <ku920601@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20260724135640.3195044-3-pkshih@realtek.com
This commit is contained in:
committed by
Ping-Ke Shih
parent
6f24d22a31
commit
04852fcad5
@@ -3274,6 +3274,9 @@ static void _fw_set_drv_info(struct rtw89_dev *rtwdev, u8 index)
|
||||
else
|
||||
return;
|
||||
|
||||
if (ver->fcxmlo == 2)
|
||||
rtw89_fw_h2c_cxdrv_mlo_v2(rtwdev, index);
|
||||
|
||||
break;
|
||||
case CXDRVINFO_OSI:
|
||||
if (!ver->fcxosi || ver->drvinfo_ver == 103)
|
||||
|
||||
@@ -1783,6 +1783,25 @@ struct rtw89_btc_wl_dbcc_info {
|
||||
u8 role[RTW89_PHY_NUM]; /* role in each phy */
|
||||
};
|
||||
|
||||
struct rtw89_btc_wl_mlo_info_v2 {
|
||||
u8 wmode[RTW89_PHY_NUM];
|
||||
u8 ch_type[RTW89_PHY_NUM];
|
||||
u8 hwb_rf_band[RTW89_PHY_NUM];
|
||||
u8 path_rf_band[RTW89_PHY_NUM];
|
||||
|
||||
u8 wtype;
|
||||
u8 mrcx_mode;
|
||||
u8 mrcx_act_hwb_map;
|
||||
u8 mrcx_bt_slot_rsp;
|
||||
|
||||
u8 rf_combination;
|
||||
u8 mlo_en;
|
||||
u8 mlo_adie;
|
||||
u8 dual_hw_band_en;
|
||||
|
||||
__le32 link_status;
|
||||
} __packed;
|
||||
|
||||
struct rtw89_btc_wl_mlo_info {
|
||||
u8 wmode[RTW89_PHY_NUM]; /* enum phl_mr_wmode */
|
||||
u8 ch_type[RTW89_PHY_NUM]; /* enum phl_mr_ch_type */
|
||||
|
||||
@@ -6616,6 +6616,64 @@ int rtw89_fw_h2c_cxdrv_role_v10(struct rtw89_dev *rtwdev, u8 type)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rtw89_fw_h2c_cxdrv_mlo_v2(struct rtw89_dev *rtwdev, u8 type)
|
||||
{
|
||||
struct rtw89_btc_wl_mlo_info *mlo = &rtwdev->btc.cx.wl.mlo_info;
|
||||
struct rtw89_h2c_cxmlo_v2 *h2c;
|
||||
u32 len = sizeof(*h2c);
|
||||
struct sk_buff *skb;
|
||||
int ret;
|
||||
|
||||
skb = rtw89_fw_h2c_alloc_skb_with_hdr(rtwdev, len);
|
||||
if (!skb) {
|
||||
rtw89_err(rtwdev, "failed to alloc skb for h2c cxdrv_mlo_v2\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
skb_put(skb, len);
|
||||
h2c = (struct rtw89_h2c_cxmlo_v2 *)skb->data;
|
||||
|
||||
h2c->hdr.type = type;
|
||||
h2c->hdr.ver = 2;
|
||||
h2c->hdr.len = len - H2C_LEN_CXDRVHDR_V7;
|
||||
|
||||
memcpy(h2c->mlo.wmode, mlo->wmode,
|
||||
sizeof(h2c->mlo.wmode));
|
||||
memcpy(h2c->mlo.ch_type, mlo->ch_type,
|
||||
sizeof(h2c->mlo.ch_type));
|
||||
memcpy(h2c->mlo.hwb_rf_band, mlo->hwb_rf_band,
|
||||
sizeof(h2c->mlo.hwb_rf_band));
|
||||
memcpy(h2c->mlo.path_rf_band, mlo->path_rf_band,
|
||||
sizeof(h2c->mlo.path_rf_band));
|
||||
|
||||
h2c->mlo.wtype = mlo->wtype;
|
||||
h2c->mlo.mrcx_mode = mlo->mrcx_mode;
|
||||
h2c->mlo.mrcx_act_hwb_map = mlo->mrcx_act_hwb_map;
|
||||
h2c->mlo.mrcx_bt_slot_rsp = mlo->mrcx_bt_slot_rsp;
|
||||
|
||||
h2c->mlo.rf_combination = mlo->rf_combination;
|
||||
h2c->mlo.mlo_en = mlo->mlo_en;
|
||||
h2c->mlo.mlo_adie = mlo->mlo_adie;
|
||||
h2c->mlo.dual_hw_band_en = mlo->dual_hw_band_en;
|
||||
h2c->mlo.link_status = cpu_to_le32(mlo->link_status);
|
||||
|
||||
rtw89_h2c_pkt_set_hdr(rtwdev, skb, FWCMD_TYPE_H2C,
|
||||
H2C_CAT_OUTSRC, BTFC_SET,
|
||||
SET_DRV_INFO, 0, 0,
|
||||
len);
|
||||
|
||||
ret = rtw89_h2c_tx(rtwdev, skb, false);
|
||||
if (ret) {
|
||||
rtw89_err(rtwdev, "failed to send h2c\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
dev_kfree_skb_any(skb);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rtw89_fw_h2c_cxdrv_osi_info(struct rtw89_dev *rtwdev, u8 type)
|
||||
{
|
||||
struct rtw89_btc *btc = &rtwdev->btc;
|
||||
|
||||
@@ -2453,6 +2453,11 @@ struct rtw89_h2c_cxrole_v10 {
|
||||
struct rtw89_btc_wl_role_info_v10 r;
|
||||
} __packed;
|
||||
|
||||
struct rtw89_h2c_cxmlo_v2 {
|
||||
struct rtw89_h2c_cxhdr_v7 hdr;
|
||||
struct rtw89_btc_wl_mlo_info_v2 mlo;
|
||||
} __packed;
|
||||
|
||||
struct rtw89_h2c_cxosi {
|
||||
struct rtw89_h2c_cxhdr_v7 hdr;
|
||||
struct rtw89_btc_fbtc_outsrc_set_info_v1 osi;
|
||||
@@ -5462,6 +5467,7 @@ int rtw89_fw_h2c_cxdrv_role_v7(struct rtw89_dev *rtwdev, u8 type);
|
||||
int rtw89_fw_h2c_cxdrv_role_v8(struct rtw89_dev *rtwdev, u8 type);
|
||||
int rtw89_fw_h2c_cxdrv_role_v10(struct rtw89_dev *rtwdev, u8 type);
|
||||
int rtw89_fw_h2c_cxdrv_init_v11(struct rtw89_dev *rtwdev, u8 type);
|
||||
int rtw89_fw_h2c_cxdrv_mlo_v2(struct rtw89_dev *rtwdev, u8 type);
|
||||
int rtw89_fw_h2c_cxdrv_osi_info(struct rtw89_dev *rtwdev, u8 type);
|
||||
int rtw89_fw_h2c_cxdrv_osi_info_v6(struct rtw89_dev *rtwdev, u8 type);
|
||||
int rtw89_fw_h2c_cxdrv_ctrl(struct rtw89_dev *rtwdev, u8 type);
|
||||
|
||||
Reference in New Issue
Block a user