Commit a7d6f8d0 authored by Ching-Te Ku's avatar Ching-Te Ku Committed by Kalle Valo

wifi: rtw89: coex: Add TDMA slot parameter setting version 7

In order to packet up the slots information, the TLV header has updated.
TDMA slot parameters also use the TLV header to packet up to H2C, so
upgrade to version 7.
Signed-off-by: default avatarChing-Te Ku <ku920601@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240312013721.17452-5-pkshih@realtek.com
parent 69cf6050
This diff is collapsed.
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "core.h" #include "core.h"
#define BTC_H2C_MAXLEN 2020 #define BTC_H2C_MAXLEN 2020
#define BTC_TLV_SLOT_ID_LEN_V7 1
enum btc_mode { enum btc_mode {
BTC_MODE_NORMAL, BTC_MODE_NORMAL,
...@@ -285,4 +286,51 @@ static inline u32 rtw89_get_antpath_type(u8 phy_map, u8 type) ...@@ -285,4 +286,51 @@ static inline u32 rtw89_get_antpath_type(u8 phy_map, u8 type)
return ((phy_map << 8) + type); return ((phy_map << 8) + type);
} }
static inline
void _slot_set_le(struct rtw89_btc *btc, u8 sid, __le16 dura, __le32 tbl, __le16 type)
{
if (btc->ver->fcxslots == 1) {
btc->dm.slot.v1[sid].dur = dura;
btc->dm.slot.v1[sid].cxtbl = tbl;
btc->dm.slot.v1[sid].cxtype = type;
} else if (btc->ver->fcxslots == 7) {
btc->dm.slot.v7[sid].dur = dura;
btc->dm.slot.v7[sid].cxtype = type;
btc->dm.slot.v7[sid].cxtbl = tbl;
}
}
static inline
void _slot_set(struct rtw89_btc *btc, u8 sid, u16 dura, u32 tbl, u16 type)
{
_slot_set_le(btc, sid, cpu_to_le16(dura), cpu_to_le32(tbl), cpu_to_le16(type));
}
static inline
void _slot_set_dur(struct rtw89_btc *btc, u8 sid, u16 dura)
{
if (btc->ver->fcxslots == 1)
btc->dm.slot.v1[sid].dur = cpu_to_le16(dura);
else if (btc->ver->fcxslots == 7)
btc->dm.slot.v7[sid].dur = cpu_to_le16(dura);
}
static inline
void _slot_set_type(struct rtw89_btc *btc, u8 sid, u16 type)
{
if (btc->ver->fcxslots == 1)
btc->dm.slot.v1[sid].cxtype = cpu_to_le16(type);
else if (btc->ver->fcxslots == 7)
btc->dm.slot.v7[sid].cxtype = cpu_to_le16(type);
}
static inline
void _slot_set_tbl(struct rtw89_btc *btc, u8 sid, u32 tbl)
{
if (btc->ver->fcxslots == 1)
btc->dm.slot.v1[sid].cxtbl = cpu_to_le32(tbl);
else if (btc->ver->fcxslots == 7)
btc->dm.slot.v7[sid].cxtbl = cpu_to_le32(tbl);
}
#endif #endif
...@@ -2293,6 +2293,40 @@ struct rtw89_btc_fbtc_slots { ...@@ -2293,6 +2293,40 @@ struct rtw89_btc_fbtc_slots {
struct rtw89_btc_fbtc_slot slot[CXST_MAX]; struct rtw89_btc_fbtc_slot slot[CXST_MAX];
} __packed; } __packed;
struct rtw89_btc_fbtc_slot_v7 {
__le16 dur; /* slot duration */
__le16 cxtype;
__le32 cxtbl;
} __packed;
struct rtw89_btc_fbtc_slot_u16 {
__le16 dur; /* slot duration */
__le16 cxtype;
__le16 cxtbl_l16; /* coex table [15:0] */
__le16 cxtbl_h16; /* coex table [31:16] */
} __packed;
struct rtw89_btc_fbtc_1slot_v7 {
u8 fver;
u8 sid; /* slot id */
__le16 rsvd;
struct rtw89_btc_fbtc_slot_v7 slot;
} __packed;
struct rtw89_btc_fbtc_slots_v7 {
u8 fver;
u8 slot_cnt;
u8 rsvd0;
u8 rsvd1;
struct rtw89_btc_fbtc_slot_u16 slot[CXST_MAX];
__le32 update_map;
} __packed;
union rtw89_btc_fbtc_slots_info {
struct rtw89_btc_fbtc_slots v1;
struct rtw89_btc_fbtc_slots_v7 v7;
} __packed;
struct rtw89_btc_fbtc_step { struct rtw89_btc_fbtc_step {
u8 type; u8 type;
u8 val; u8 val;
...@@ -2611,9 +2645,14 @@ struct rtw89_btc_trx_info { ...@@ -2611,9 +2645,14 @@ struct rtw89_btc_trx_info {
u32 rx_err_ratio; u32 rx_err_ratio;
}; };
union rtw89_btc_fbtc_slot_u {
struct rtw89_btc_fbtc_slot v1[CXST_MAX];
struct rtw89_btc_fbtc_slot_v7 v7[CXST_MAX];
};
struct rtw89_btc_dm { struct rtw89_btc_dm {
struct rtw89_btc_fbtc_slot slot[CXST_MAX]; union rtw89_btc_fbtc_slot_u slot;
struct rtw89_btc_fbtc_slot slot_now[CXST_MAX]; union rtw89_btc_fbtc_slot_u slot_now;
struct rtw89_btc_fbtc_tdma tdma; struct rtw89_btc_fbtc_tdma tdma;
struct rtw89_btc_fbtc_tdma tdma_now; struct rtw89_btc_fbtc_tdma tdma_now;
struct rtw89_mac_ax_coex_gnt gnt; struct rtw89_mac_ax_coex_gnt gnt;
...@@ -2754,7 +2793,7 @@ struct rtw89_btc_rpt_fbtc_tdma { ...@@ -2754,7 +2793,7 @@ struct rtw89_btc_rpt_fbtc_tdma {
struct rtw89_btc_rpt_fbtc_slots { struct rtw89_btc_rpt_fbtc_slots {
struct rtw89_btc_rpt_cmn_info cinfo; /* common info, by driver */ struct rtw89_btc_rpt_cmn_info cinfo; /* common info, by driver */
struct rtw89_btc_fbtc_slots finfo; /* info from fw */ union rtw89_btc_fbtc_slots_info finfo; /* info from fw */
}; };
struct rtw89_btc_rpt_fbtc_cysta { struct rtw89_btc_rpt_fbtc_cysta {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment