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

wifi: rtw89: coex: Record down Wi-Fi initial mode information

This information will use as judgment about how to set RF/HW parameters.
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/20231218061341.51255-3-pkshih@realtek.com
parent acc55d7d
...@@ -5308,6 +5308,7 @@ void rtw89_btc_ntfy_init(struct rtw89_dev *rtwdev, u8 mode) ...@@ -5308,6 +5308,7 @@ void rtw89_btc_ntfy_init(struct rtw89_dev *rtwdev, u8 mode)
rtw89_debug(rtwdev, RTW89_DBG_BTC, rtw89_debug(rtwdev, RTW89_DBG_BTC,
"[BTC], %s(): mode=%d\n", __func__, mode); "[BTC], %s(): mode=%d\n", __func__, mode);
wl->coex_mode = mode;
dm->cnt_notify[BTC_NCNT_INIT_COEX]++; dm->cnt_notify[BTC_NCNT_INIT_COEX]++;
dm->wl_only = mode == BTC_MODE_WL ? 1 : 0; dm->wl_only = mode == BTC_MODE_WL ? 1 : 0;
dm->bt_only = mode == BTC_MODE_BT ? 1 : 0; dm->bt_only = mode == BTC_MODE_BT ? 1 : 0;
...@@ -6553,6 +6554,7 @@ static void _show_bt_info(struct rtw89_dev *rtwdev, struct seq_file *m) ...@@ -6553,6 +6554,7 @@ static void _show_bt_info(struct rtw89_dev *rtwdev, struct seq_file *m)
case BTC_CXP_ ## e | BTC_POLICY_EXT_BIT: return #e case BTC_CXP_ ## e | BTC_POLICY_EXT_BIT: return #e
#define CASE_BTC_SLOT_STR(e) case CXST_ ## e: return #e #define CASE_BTC_SLOT_STR(e) case CXST_ ## e: return #e
#define CASE_BTC_EVT_STR(e) case CXEVNT_## e: return #e #define CASE_BTC_EVT_STR(e) case CXEVNT_## e: return #e
#define CASE_BTC_INIT(e) case BTC_MODE_## e: return #e
static const char *steps_to_str(u16 step) static const char *steps_to_str(u16 step)
{ {
...@@ -6727,6 +6729,18 @@ static const char *id_to_evt(u32 id) ...@@ -6727,6 +6729,18 @@ static const char *id_to_evt(u32 id)
} }
} }
static const char *id_to_mode(u8 id)
{
switch (id) {
CASE_BTC_INIT(NORMAL);
CASE_BTC_INIT(WL);
CASE_BTC_INIT(BT);
CASE_BTC_INIT(WLOFF);
default:
return "unknown";
}
}
static static
void seq_print_segment(struct seq_file *m, const char *prefix, u16 *data, void seq_print_segment(struct seq_file *m, const char *prefix, u16 *data,
u8 len, u8 seg_len, u8 start_idx, u8 ring_len) u8 len, u8 seg_len, u8 start_idx, u8 ring_len)
...@@ -6781,12 +6795,13 @@ static void _show_dm_info(struct rtw89_dev *rtwdev, struct seq_file *m) ...@@ -6781,12 +6795,13 @@ static void _show_dm_info(struct rtw89_dev *rtwdev, struct seq_file *m)
(btc->ctrl.manual ? "(Manual)" : "(Auto)")); (btc->ctrl.manual ? "(Manual)" : "(Auto)"));
seq_printf(m, seq_printf(m,
" %-15s : type:%s, reason:%s(), action:%s(), ant_path:%ld, run_cnt:%d\n", " %-15s : type:%s, reason:%s(), action:%s(), ant_path:%ld, init_mode:%s, run_cnt:%d\n",
"[status]", "[status]",
module->ant.type == BTC_ANT_SHARED ? "shared" : "dedicated", module->ant.type == BTC_ANT_SHARED ? "shared" : "dedicated",
steps_to_str(dm->run_reason), steps_to_str(dm->run_reason),
steps_to_str(dm->run_action | BTC_ACT_EXT_BIT), steps_to_str(dm->run_action | BTC_ACT_EXT_BIT),
FIELD_GET(GENMASK(7, 0), dm->set_ant_path), FIELD_GET(GENMASK(7, 0), dm->set_ant_path),
id_to_mode(wl->coex_mode),
dm->cnt_dm[BTC_DCNT_RUN]); dm->cnt_dm[BTC_DCNT_RUN]);
_show_dm_step(rtwdev, m); _show_dm_step(rtwdev, m);
......
...@@ -1706,6 +1706,7 @@ struct rtw89_btc_wl_info { ...@@ -1706,6 +1706,7 @@ struct rtw89_btc_wl_info {
u8 port_id[RTW89_WIFI_ROLE_MLME_MAX]; u8 port_id[RTW89_WIFI_ROLE_MLME_MAX];
u8 rssi_level; u8 rssi_level;
u8 cn_report; u8 cn_report;
u8 coex_mode;
bool scbd_change; bool scbd_change;
u32 scbd; u32 scbd;
......
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