Commit 08431b62 authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo

rtlwifi: btcoex: Use seq_file to dump btcoex status

We use seq_file to replace RT_TRACE to dump status, then we can use 'cat'
to access btcoex's status through debugfs.
(i.e. /sys/kernel/debug/rtlwifi/00-11-22-33-44-55-66/btcoex)
Other related changes are
1. implement btc_disp_dbg_msg() to access btcoex's common status.
2. remove obsolete field bt_exist
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 610247f4
...@@ -2704,11 +2704,11 @@ void ex_btc8192e2ant_init_coex_dm(struct btc_coexist *btcoexist) ...@@ -2704,11 +2704,11 @@ void ex_btc8192e2ant_init_coex_dm(struct btc_coexist *btcoexist)
btc8192e2ant_init_coex_dm(btcoexist); btc8192e2ant_init_coex_dm(btcoexist);
} }
void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist) void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist,
struct seq_file *m)
{ {
struct btc_board_info *board_info = &btcoexist->board_info; struct btc_board_info *board_info = &btcoexist->board_info;
struct btc_stack_info *stack_info = &btcoexist->stack_info; struct btc_stack_info *stack_info = &btcoexist->stack_info;
struct rtl_priv *rtlpriv = btcoexist->adapter;
u8 u8tmp[4], i, bt_info_ext, ps_tdma_case = 0; u8 u8tmp[4], i, bt_info_ext, ps_tdma_case = 0;
u16 u16tmp[4]; u16 u16tmp[4];
u32 u32tmp[4]; u32 u32tmp[4];
...@@ -2719,34 +2719,23 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2719,34 +2719,23 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist)
u8 wifi_dot11_chnl, wifi_hs_chnl; u8 wifi_dot11_chnl, wifi_hs_chnl;
u32 fw_ver = 0, bt_patch_ver = 0; u32 fw_ver = 0, bt_patch_ver = 0;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_puts(m, "\n ============[BT Coexist info]============");
"\r\n ============[BT Coexist info]============");
if (btcoexist->manual_control) { if (btcoexist->manual_control) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_puts(m, "\n ===========[Under Manual Control]===========");
"\r\n ===========[Under Manual Control]==========="); seq_puts(m, "\n ==========================================");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
"\r\n ==========================================");
}
if (!board_info->bt_exist) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n BT not exists !!!");
return;
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:",
"\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:",
board_info->pg_ant_num, board_info->btdm_ant_num); board_info->pg_ant_num, board_info->btdm_ant_num);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s / %d", seq_printf(m, "\n %-35s = %s / %d", "BT stack/ hci ext ver",
"BT stack/ hci ext ver",
((stack_info->profile_notified) ? "Yes" : "No"), ((stack_info->profile_notified) ? "Yes" : "No"),
stack_info->hci_version); stack_info->hci_version);
btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver); btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver);
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver); btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d_%d/ 0x%x/ 0x%x(%d)",
"\r\n %-35s = %d_%d/ 0x%x/ 0x%x(%d)",
"CoexVer/ FwVer/ PatchVer", "CoexVer/ FwVer/ PatchVer",
glcoex_ver_date_8192e_2ant, glcoex_ver_8192e_2ant, glcoex_ver_date_8192e_2ant, glcoex_ver_8192e_2ant,
fw_ver, bt_patch_ver, bt_patch_ver); fw_ver, bt_patch_ver, bt_patch_ver);
...@@ -2755,22 +2744,22 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2755,22 +2744,22 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist)
btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_DOT11_CHNL, btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_DOT11_CHNL,
&wifi_dot11_chnl); &wifi_dot11_chnl);
btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl); btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d / %d(%d)", seq_printf(m, "\n %-35s = %d / %d(%d)",
"Dot11 channel / HsMode(HsChnl)", "Dot11 channel / HsMode(HsChnl)",
wifi_dot11_chnl, bt_hs_on, wifi_hs_chnl); wifi_dot11_chnl, bt_hs_on, wifi_hs_chnl);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %3ph ", seq_printf(m, "\n %-35s = %3ph ",
"H2C Wifi inform bt chnl Info", coex_dm->wifi_chnl_info); "H2C Wifi inform bt chnl Info", coex_dm->wifi_chnl_info);
btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi); btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d", seq_printf(m, "\n %-35s = %d/ %d",
"Wifi rssi/ HS rssi", wifi_rssi, bt_hs_rssi); "Wifi rssi/ HS rssi", wifi_rssi, bt_hs_rssi);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d/ %d ", seq_printf(m, "\n %-35s = %d/ %d/ %d ",
"Wifi link/ roam/ scan", link, roam, scan); "Wifi link/ roam/ scan", link, roam, scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g);
...@@ -2778,7 +2767,7 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2778,7 +2767,7 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist)
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION,
&wifi_traffic_dir); &wifi_traffic_dir);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s / %s/ %s ", seq_printf(m, "\n %-35s = %s / %s/ %s ",
"Wifi status", (wifi_under_5g ? "5G" : "2.4G"), "Wifi status", (wifi_under_5g ? "5G" : "2.4G"),
((BTC_WIFI_BW_LEGACY == wifi_bw) ? "Legacy" : ((BTC_WIFI_BW_LEGACY == wifi_bw) ? "Legacy" :
(((BTC_WIFI_BW_HT40 == wifi_bw) ? "HT40" : "HT20"))), (((BTC_WIFI_BW_HT40 == wifi_bw) ? "HT40" : "HT20"))),
...@@ -2786,7 +2775,7 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2786,7 +2775,7 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist)
((BTC_WIFI_TRAFFIC_TX == wifi_traffic_dir) ? ((BTC_WIFI_TRAFFIC_TX == wifi_traffic_dir) ?
"uplink" : "downlink"))); "uplink" : "downlink")));
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = [%s/ %d/ %d] ", seq_printf(m, "\n %-35s = [%s/ %d/ %d] ",
"BT [status/ rssi/ retryCnt]", "BT [status/ rssi/ retryCnt]",
((btcoexist->bt_info.bt_disabled) ? ("disabled") : ((btcoexist->bt_info.bt_disabled) ? ("disabled") :
((coex_sta->c2h_bt_inquiry_page) ? ((coex_sta->c2h_bt_inquiry_page) ?
...@@ -2797,72 +2786,71 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2797,72 +2786,71 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist)
coex_dm->bt_status) ? "connected-idle" : "busy")))), coex_dm->bt_status) ? "connected-idle" : "busy")))),
coex_sta->bt_rssi, coex_sta->bt_retry_cnt); coex_sta->bt_rssi, coex_sta->bt_retry_cnt);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d / %d / %d / %d", seq_printf(m, "\n %-35s = %d / %d / %d / %d",
"SCO/HID/PAN/A2DP", stack_info->sco_exist, "SCO/HID/PAN/A2DP", stack_info->sco_exist,
stack_info->hid_exist, stack_info->pan_exist, stack_info->hid_exist, stack_info->pan_exist,
stack_info->a2dp_exist); stack_info->a2dp_exist);
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_BT_LINK_INFO); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_BT_LINK_INFO, m);
bt_info_ext = coex_sta->bt_info_ext; bt_info_ext = coex_sta->bt_info_ext;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s", seq_printf(m, "\n %-35s = %s",
"BT Info A2DP rate", "BT Info A2DP rate",
(bt_info_ext&BIT0) ? "Basic rate" : "EDR rate"); (bt_info_ext&BIT0) ? "Basic rate" : "EDR rate");
for (i = 0; i < BT_INFO_SRC_8192E_2ANT_MAX; i++) { for (i = 0; i < BT_INFO_SRC_8192E_2ANT_MAX; i++) {
if (coex_sta->bt_info_c2h_cnt[i]) { if (coex_sta->bt_info_c2h_cnt[i]) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %7ph(%d)",
"\r\n %-35s = %7ph(%d)",
glbt_info_src_8192e_2ant[i], glbt_info_src_8192e_2ant[i],
coex_sta->bt_info_c2h[i], coex_sta->bt_info_c2h[i],
coex_sta->bt_info_c2h_cnt[i]); coex_sta->bt_info_c2h_cnt[i]);
} }
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s/%s", seq_printf(m, "\n %-35s = %s/%s",
"PS state, IPS/LPS", "PS state, IPS/LPS",
((coex_sta->under_ips ? "IPS ON" : "IPS OFF")), ((coex_sta->under_ips ? "IPS ON" : "IPS OFF")),
((coex_sta->under_lps ? "LPS ON" : "LPS OFF"))); ((coex_sta->under_lps ? "LPS ON" : "LPS OFF")));
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD, m);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x ", "SS Type", seq_printf(m, "\n %-35s = 0x%x ", "SS Type",
coex_dm->cur_ss_type); coex_dm->cur_ss_type);
/* Sw mechanism */ /* Sw mechanism */
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s", seq_printf(m, "\n %-35s",
"============[Sw mechanism]============"); "============[Sw mechanism]============");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d/ %d ", seq_printf(m, "\n %-35s = %d/ %d/ %d ",
"SM1[ShRf/ LpRA/ LimDig]", coex_dm->cur_rf_rx_lpf_shrink, "SM1[ShRf/ LpRA/ LimDig]", coex_dm->cur_rf_rx_lpf_shrink,
coex_dm->cur_low_penalty_ra, coex_dm->limited_dig); coex_dm->cur_low_penalty_ra, coex_dm->limited_dig);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d/ %d(0x%x) ", seq_printf(m, "\n %-35s = %d/ %d/ %d(0x%x) ",
"SM2[AgcT/ AdcB/ SwDacSwing(lvl)]", "SM2[AgcT/ AdcB/ SwDacSwing(lvl)]",
coex_dm->cur_agc_table_en, coex_dm->cur_adc_back_off, coex_dm->cur_agc_table_en, coex_dm->cur_adc_back_off,
coex_dm->cur_dac_swing_on, coex_dm->cur_dac_swing_lvl); coex_dm->cur_dac_swing_on, coex_dm->cur_dac_swing_lvl);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x ", "Rate Mask", seq_printf(m, "\n %-35s = 0x%x ", "Rate Mask",
btcoexist->bt_info.ra_mask); btcoexist->bt_info.ra_mask);
/* Fw mechanism */ /* Fw mechanism */
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s", seq_printf(m, "\n %-35s",
"============[Fw mechanism]============"); "============[Fw mechanism]============");
ps_tdma_case = coex_dm->cur_ps_tdma; ps_tdma_case = coex_dm->cur_ps_tdma;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m,
"\r\n %-35s = %5ph case-%d (auto:%d)", "\n %-35s = %5ph case-%d (auto:%d)",
"PS TDMA", coex_dm->ps_tdma_para, "PS TDMA", coex_dm->ps_tdma_para,
ps_tdma_case, coex_dm->auto_tdma_adjust); ps_tdma_case, coex_dm->auto_tdma_adjust);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d ", seq_printf(m, "\n %-35s = %d/ %d ",
"DecBtPwr/ IgnWlanAct", "DecBtPwr/ IgnWlanAct",
coex_dm->cur_dec_bt_pwr, coex_dm->cur_ignore_wlan_act); coex_dm->cur_dec_bt_pwr, coex_dm->cur_ignore_wlan_act);
/* Hw setting */ /* Hw setting */
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s", seq_printf(m, "\n %-35s",
"============[Hw setting]============"); "============[Hw setting]============");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x", seq_printf(m, "\n %-35s = 0x%x",
"RF-A, 0x1e initVal", coex_dm->bt_rf0x1e_backup); "RF-A, 0x1e initVal", coex_dm->bt_rf0x1e_backup);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/0x%x/0x%x/0x%x", seq_printf(m, "\n %-35s = 0x%x/0x%x/0x%x/0x%x",
"backup ARFR1/ARFR2/RL/AMaxTime", coex_dm->backup_arfr_cnt1, "backup ARFR1/ARFR2/RL/AMaxTime", coex_dm->backup_arfr_cnt1,
coex_dm->backup_arfr_cnt2, coex_dm->backup_retry_limit, coex_dm->backup_arfr_cnt2, coex_dm->backup_retry_limit,
coex_dm->backup_ampdu_maxtime); coex_dm->backup_ampdu_maxtime);
...@@ -2871,57 +2859,56 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2871,57 +2859,56 @@ void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist)
u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x434); u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x434);
u16tmp[0] = btcoexist->btc_read_2byte(btcoexist, 0x42a); u16tmp[0] = btcoexist->btc_read_2byte(btcoexist, 0x42a);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x456); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x456);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/0x%x/0x%x/0x%x", seq_printf(m, "\n %-35s = 0x%x/0x%x/0x%x/0x%x",
"0x430/0x434/0x42a/0x456", "0x430/0x434/0x42a/0x456",
u32tmp[0], u32tmp[1], u16tmp[0], u8tmp[0]); u32tmp[0], u32tmp[1], u16tmp[0], u8tmp[0]);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc04); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc04);
u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0xd04); u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0xd04);
u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x90c); u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x90c);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"0xc04/ 0xd04/ 0x90c", u32tmp[0], u32tmp[1], u32tmp[2]); "0xc04/ 0xd04/ 0x90c", u32tmp[0], u32tmp[1], u32tmp[2]);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x", "0x778", seq_printf(m, "\n %-35s = 0x%x", "0x778", u8tmp[0]);
u8tmp[0]);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x92c); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x92c);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x930); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x930);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0x92c/ 0x930", (u8tmp[0]), u32tmp[0]); "0x92c/ 0x930", (u8tmp[0]), u32tmp[0]);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x40); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x40);
u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x4f); u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x4f);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0x40/ 0x4f", u8tmp[0], u8tmp[1]); "0x40/ 0x4f", u8tmp[0], u8tmp[1]);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0x550(bcn ctrl)/0x522", u32tmp[0], u8tmp[0]); "0x550(bcn ctrl)/0x522", u32tmp[0], u8tmp[0]);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x", "0xc50(dig)", seq_printf(m, "\n %-35s = 0x%x", "0xc50(dig)",
u32tmp[0]); u32tmp[0]);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0);
u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4); u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4);
u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8); u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x6cc); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x6cc);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m,
"\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", "\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x",
"0x6c0/0x6c4/0x6c8/0x6cc(coexTable)", "0x6c0/0x6c4/0x6c8/0x6cc(coexTable)",
u32tmp[0], u32tmp[1], u32tmp[2], u8tmp[0]); u32tmp[0], u32tmp[1], u32tmp[2], u8tmp[0]);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d", seq_printf(m, "\n %-35s = %d/ %d",
"0x770(hp rx[31:16]/tx[15:0])", "0x770(hp rx[31:16]/tx[15:0])",
coex_sta->high_priority_rx, coex_sta->high_priority_tx); coex_sta->high_priority_rx, coex_sta->high_priority_tx);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d", seq_printf(m, "\n %-35s = %d/ %d",
"0x774(lp rx[31:16]/tx[15:0])", "0x774(lp rx[31:16]/tx[15:0])",
coex_sta->low_priority_rx, coex_sta->low_priority_tx); coex_sta->low_priority_rx, coex_sta->low_priority_tx);
if (btcoexist->auto_report_2ant) if (btcoexist->auto_report_2ant)
btc8192e2ant_monitor_bt_ctr(btcoexist); btc8192e2ant_monitor_bt_ctr(btcoexist);
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS, m);
} }
void ex_btc8192e2ant_ips_notify(struct btc_coexist *btcoexist, u8 type) void ex_btc8192e2ant_ips_notify(struct btc_coexist *btcoexist, u8 type)
......
...@@ -180,4 +180,5 @@ void ex_btc8192e2ant_stack_operation_notify(struct btc_coexist *btcoexist, ...@@ -180,4 +180,5 @@ void ex_btc8192e2ant_stack_operation_notify(struct btc_coexist *btcoexist,
u8 type); u8 type);
void ex_btc8192e2ant_halt_notify(struct btc_coexist *btcoexist); void ex_btc8192e2ant_halt_notify(struct btc_coexist *btcoexist);
void ex_btc8192e2ant_periodical(struct btc_coexist *btcoexist); void ex_btc8192e2ant_periodical(struct btc_coexist *btcoexist);
void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist); void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist,
struct seq_file *m);
...@@ -2474,12 +2474,12 @@ void ex_btc8723b1ant_init_coex_dm(struct btc_coexist *btcoexist) ...@@ -2474,12 +2474,12 @@ void ex_btc8723b1ant_init_coex_dm(struct btc_coexist *btcoexist)
halbtc8723b1ant_query_bt_info(btcoexist); halbtc8723b1ant_query_bt_info(btcoexist);
} }
void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist) void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist,
struct seq_file *m)
{ {
struct btc_board_info *board_info = &btcoexist->board_info; struct btc_board_info *board_info = &btcoexist->board_info;
struct btc_stack_info *stack_info = &btcoexist->stack_info; struct btc_stack_info *stack_info = &btcoexist->stack_info;
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
struct rtl_priv *rtlpriv = btcoexist->adapter;
u8 u8tmp[4], i, bt_info_ext, pstdmacase = 0; u8 u8tmp[4], i, bt_info_ext, pstdmacase = 0;
u16 u16tmp[4]; u16 u16tmp[4];
u32 u32tmp[4]; u32 u32tmp[4];
...@@ -2491,36 +2491,30 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2491,36 +2491,30 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist)
u8 wifi_dot11_chnl, wifi_hs_chnl; u8 wifi_dot11_chnl, wifi_hs_chnl;
u32 fw_ver = 0, bt_patch_ver = 0; u32 fw_ver = 0, bt_patch_ver = 0;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_puts(m, "\n ============[BT Coexist info]============");
"\r\n ============[BT Coexist info]============");
if (btcoexist->manual_control) { if (btcoexist->manual_control) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_puts(m, "\n ============[Under Manual Control]==========");
"\r\n ============[Under Manual Control]=========="); seq_puts(m, "\n ==========================================");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
"\r\n ==========================================");
} }
if (btcoexist->stop_coex_dm) { if (btcoexist->stop_coex_dm) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_puts(m, "\n ============[Coex is STOPPED]============");
"\r\n ============[Coex is STOPPED]============"); seq_puts(m, "\n ==========================================");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
"\r\n ==========================================");
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d/ %d", seq_printf(m, "\n %-35s = %d/ %d/ %d",
"Ant PG Num/ Ant Mech/ Ant Pos:", "Ant PG Num/ Ant Mech/ Ant Pos:",
board_info->pg_ant_num, board_info->btdm_ant_num, board_info->pg_ant_num, board_info->btdm_ant_num,
board_info->btdm_ant_pos); board_info->btdm_ant_pos);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s / %d", seq_printf(m, "\n %-35s = %s / %d",
"BT stack/ hci ext ver", "BT stack/ hci ext ver",
((stack_info->profile_notified) ? "Yes" : "No"), ((stack_info->profile_notified) ? "Yes" : "No"),
stack_info->hci_version); stack_info->hci_version);
btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver); btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver);
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver); btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)",
"\r\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)",
"CoexVer/ FwVer/ PatchVer", "CoexVer/ FwVer/ PatchVer",
glcoex_ver_date_8723b_1ant, glcoex_ver_8723b_1ant, glcoex_ver_date_8723b_1ant, glcoex_ver_8723b_1ant,
fw_ver, bt_patch_ver, bt_patch_ver); fw_ver, bt_patch_ver, bt_patch_ver);
...@@ -2529,23 +2523,23 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2529,23 +2523,23 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist)
btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_DOT11_CHNL, btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_DOT11_CHNL,
&wifi_dot11_chnl); &wifi_dot11_chnl);
btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl); btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d / %d(%d)", seq_printf(m, "\n %-35s = %d / %d(%d)",
"Dot11 channel / HsChnl(HsMode)", "Dot11 channel / HsChnl(HsMode)",
wifi_dot11_chnl, wifi_hs_chnl, bt_hs_on); wifi_dot11_chnl, wifi_hs_chnl, bt_hs_on);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %3ph ", seq_printf(m, "\n %-35s = %3ph ",
"H2C Wifi inform bt chnl Info", "H2C Wifi inform bt chnl Info",
coex_dm->wifi_chnl_info); coex_dm->wifi_chnl_info);
btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi); btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d", seq_printf(m, "\n %-35s = %d/ %d",
"Wifi rssi/ HS rssi", wifi_rssi, bt_hs_rssi); "Wifi rssi/ HS rssi", wifi_rssi, bt_hs_rssi);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d/ %d ", seq_printf(m, "\n %-35s = %d/ %d/ %d ",
"Wifi link/ roam/ scan", link, roam, scan); "Wifi link/ roam/ scan", link, roam, scan);
btcoexist->btc_get(btcoexist , BTC_GET_BL_WIFI_UNDER_5G, btcoexist->btc_get(btcoexist , BTC_GET_BL_WIFI_UNDER_5G,
...@@ -2555,7 +2549,7 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2555,7 +2549,7 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist)
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION,
&wifi_traffic_dir); &wifi_traffic_dir);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s / %s/ %s ", seq_printf(m, "\n %-35s = %s / %s/ %s ",
"Wifi status", (wifi_under_5g ? "5G" : "2.4G"), "Wifi status", (wifi_under_5g ? "5G" : "2.4G"),
((wifi_bw == BTC_WIFI_BW_LEGACY) ? "Legacy" : ((wifi_bw == BTC_WIFI_BW_LEGACY) ? "Legacy" :
((wifi_bw == BTC_WIFI_BW_HT40) ? "HT40" : "HT20")), ((wifi_bw == BTC_WIFI_BW_HT40) ? "HT40" : "HT20")),
...@@ -2565,7 +2559,7 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2565,7 +2559,7 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist)
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_LINK_STATUS, btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_LINK_STATUS,
&wifi_link_status); &wifi_link_status);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d/ %d/ %d/ %d", seq_printf(m, "\n %-35s = %d/ %d/ %d/ %d/ %d",
"sta/vwifi/hs/p2pGo/p2pGc", "sta/vwifi/hs/p2pGo/p2pGc",
((wifi_link_status & WIFI_STA_CONNECTED) ? 1 : 0), ((wifi_link_status & WIFI_STA_CONNECTED) ? 1 : 0),
((wifi_link_status & WIFI_AP_CONNECTED) ? 1 : 0), ((wifi_link_status & WIFI_AP_CONNECTED) ? 1 : 0),
...@@ -2573,7 +2567,7 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2573,7 +2567,7 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist)
((wifi_link_status & WIFI_P2P_GO_CONNECTED) ? 1 : 0), ((wifi_link_status & WIFI_P2P_GO_CONNECTED) ? 1 : 0),
((wifi_link_status & WIFI_P2P_GC_CONNECTED) ? 1 : 0)); ((wifi_link_status & WIFI_P2P_GC_CONNECTED) ? 1 : 0));
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = [%s/ %d/ %d] ", seq_printf(m, "\n %-35s = [%s/ %d/ %d] ",
"BT [status/ rssi/ retryCnt]", "BT [status/ rssi/ retryCnt]",
((coex_sta->bt_disabled) ? ("disabled") : ((coex_sta->bt_disabled) ? ("disabled") :
((coex_sta->c2h_bt_inquiry_page) ? ("inquiry/page scan") : ((coex_sta->c2h_bt_inquiry_page) ? ("inquiry/page scan") :
...@@ -2585,79 +2579,75 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2585,79 +2579,75 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist)
"connected-idle" : "busy")))), "connected-idle" : "busy")))),
coex_sta->bt_rssi, coex_sta->bt_retry_cnt); coex_sta->bt_rssi, coex_sta->bt_retry_cnt);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d / %d / %d / %d",
"\r\n %-35s = %d / %d / %d / %d",
"SCO/HID/PAN/A2DP", bt_link_info->sco_exist, "SCO/HID/PAN/A2DP", bt_link_info->sco_exist,
bt_link_info->hid_exist, bt_link_info->pan_exist, bt_link_info->hid_exist, bt_link_info->pan_exist,
bt_link_info->a2dp_exist); bt_link_info->a2dp_exist);
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_BT_LINK_INFO); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_BT_LINK_INFO, m);
bt_info_ext = coex_sta->bt_info_ext; bt_info_ext = coex_sta->bt_info_ext;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s", seq_printf(m, "\n %-35s = %s",
"BT Info A2DP rate", "BT Info A2DP rate",
(bt_info_ext & BIT0) ? "Basic rate" : "EDR rate"); (bt_info_ext & BIT0) ? "Basic rate" : "EDR rate");
for (i = 0; i < BT_INFO_SRC_8723B_1ANT_MAX; i++) { for (i = 0; i < BT_INFO_SRC_8723B_1ANT_MAX; i++) {
if (coex_sta->bt_info_c2h_cnt[i]) { if (coex_sta->bt_info_c2h_cnt[i]) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %7ph(%d)",
"\r\n %-35s = %7ph(%d)",
glbt_info_src_8723b_1ant[i], glbt_info_src_8723b_1ant[i],
coex_sta->bt_info_c2h[i], coex_sta->bt_info_c2h[i],
coex_sta->bt_info_c2h_cnt[i]); coex_sta->bt_info_c2h_cnt[i]);
} }
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %s/%s, (0x%x/0x%x)",
"\r\n %-35s = %s/%s, (0x%x/0x%x)",
"PS state, IPS/LPS, (lps/rpwm)", "PS state, IPS/LPS, (lps/rpwm)",
((coex_sta->under_ips ? "IPS ON" : "IPS OFF")), ((coex_sta->under_ips ? "IPS ON" : "IPS OFF")),
((coex_sta->under_lps ? "LPS ON" : "LPS OFF")), ((coex_sta->under_lps ? "LPS ON" : "LPS OFF")),
btcoexist->bt_info.lps_val, btcoexist->bt_info.lps_val,
btcoexist->bt_info.rpwm_val); btcoexist->bt_info.rpwm_val);
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD, m);
if (!btcoexist->manual_control) { if (!btcoexist->manual_control) {
/* Sw mechanism */ /* Sw mechanism */
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s", seq_printf(m, "\n %-35s",
"============[Sw mechanism]============"); "============[Sw mechanism]============");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/", seq_printf(m, "\n %-35s = %d/",
"SM[LowPenaltyRA]", coex_dm->cur_low_penalty_ra); "SM[LowPenaltyRA]", coex_dm->cur_low_penalty_ra);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s/ %s/ %d ", seq_printf(m, "\n %-35s = %s/ %s/ %d ",
"DelBA/ BtCtrlAgg/ AggSize", "DelBA/ BtCtrlAgg/ AggSize",
(btcoexist->bt_info.reject_agg_pkt ? "Yes" : "No"), (btcoexist->bt_info.reject_agg_pkt ? "Yes" : "No"),
(btcoexist->bt_info.bt_ctrl_buf_size ? "Yes" : "No"), (btcoexist->bt_info.bt_ctrl_buf_size ? "Yes" : "No"),
btcoexist->bt_info.agg_buf_size); btcoexist->bt_info.agg_buf_size);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x ", seq_printf(m, "\n %-35s = 0x%x ",
"Rate Mask", btcoexist->bt_info.ra_mask); "Rate Mask", btcoexist->bt_info.ra_mask);
/* Fw mechanism */ /* Fw mechanism */
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s", seq_printf(m, "\n %-35s",
"============[Fw mechanism]============"); "============[Fw mechanism]============");
pstdmacase = coex_dm->cur_ps_tdma; pstdmacase = coex_dm->cur_ps_tdma;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %5ph case-%d (auto:%d)",
"\r\n %-35s = %5ph case-%d (auto:%d)",
"PS TDMA", coex_dm->ps_tdma_para, "PS TDMA", coex_dm->ps_tdma_para,
pstdmacase, coex_dm->auto_tdma_adjust); pstdmacase, coex_dm->auto_tdma_adjust);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d ", seq_printf(m, "\n %-35s = %d ",
"IgnWlanAct", coex_dm->cur_ignore_wlan_act); "IgnWlanAct", coex_dm->cur_ignore_wlan_act);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x ", seq_printf(m, "\n %-35s = 0x%x ",
"Latest error condition(should be 0)", "Latest error condition(should be 0)",
coex_dm->error_condition); coex_dm->error_condition);
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d", seq_printf(m, "\n %-35s = %d",
"Coex Table Type", coex_sta->coex_table_type); "Coex Table Type", coex_sta->coex_table_type);
/* Hw setting */ /* Hw setting */
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s", seq_printf(m, "\n %-35s",
"============[Hw setting]============"); "============[Hw setting]============");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/0x%x/0x%x/0x%x", seq_printf(m, "\n %-35s = 0x%x/0x%x/0x%x/0x%x",
"backup ARFR1/ARFR2/RL/AMaxTime", coex_dm->backup_arfr_cnt1, "backup ARFR1/ARFR2/RL/AMaxTime", coex_dm->backup_arfr_cnt1,
coex_dm->backup_arfr_cnt2, coex_dm->backup_retry_limit, coex_dm->backup_arfr_cnt2, coex_dm->backup_retry_limit,
coex_dm->backup_ampdu_max_time); coex_dm->backup_ampdu_max_time);
...@@ -2666,28 +2656,28 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2666,28 +2656,28 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist)
u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x434); u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x434);
u16tmp[0] = btcoexist->btc_read_2byte(btcoexist, 0x42a); u16tmp[0] = btcoexist->btc_read_2byte(btcoexist, 0x42a);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x456); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x456);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/0x%x/0x%x/0x%x", seq_printf(m, "\n %-35s = 0x%x/0x%x/0x%x/0x%x",
"0x430/0x434/0x42a/0x456", "0x430/0x434/0x42a/0x456",
u32tmp[0], u32tmp[1], u16tmp[0], u8tmp[0]); u32tmp[0], u32tmp[1], u16tmp[0], u8tmp[0]);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6cc); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6cc);
u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x880); u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x880);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"0x778/0x6cc/0x880[29:25]", u8tmp[0], u32tmp[0], "0x778/0x6cc/0x880[29:25]", u8tmp[0], u32tmp[0],
(u32tmp[1] & 0x3e000000) >> 25); (u32tmp[1] & 0x3e000000) >> 25);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x948); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x948);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x67); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x67);
u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x765); u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x765);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"0x948/ 0x67[5] / 0x765", "0x948/ 0x67[5] / 0x765",
u32tmp[0], ((u8tmp[0] & 0x20) >> 5), u8tmp[1]); u32tmp[0], ((u8tmp[0] & 0x20) >> 5), u8tmp[1]);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x92c); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x92c);
u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x930); u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x930);
u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x944); u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x944);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"0x92c[1:0]/ 0x930[7:0]/0x944[1:0]", "0x92c[1:0]/ 0x930[7:0]/0x944[1:0]",
u32tmp[0] & 0x3, u32tmp[1] & 0xff, u32tmp[2] & 0x3); u32tmp[0] & 0x3, u32tmp[1] & 0xff, u32tmp[2] & 0x3);
...@@ -2695,20 +2685,19 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2695,20 +2685,19 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist)
u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x40); u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x40);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x4c); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x4c);
u8tmp[2] = btcoexist->btc_read_1byte(btcoexist, 0x64); u8tmp[2] = btcoexist->btc_read_1byte(btcoexist, 0x64);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x",
"\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x",
"0x38[11]/0x40/0x4c[24:23]/0x64[0]", "0x38[11]/0x40/0x4c[24:23]/0x64[0]",
((u8tmp[0] & 0x8) >> 3), u8tmp[1], ((u8tmp[0] & 0x8) >> 3), u8tmp[1],
((u32tmp[0] & 0x01800000) >> 23), u8tmp[2] & 0x1); ((u32tmp[0] & 0x01800000) >> 23), u8tmp[2] & 0x1);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0x550(bcn ctrl)/0x522", u32tmp[0], u8tmp[0]); "0x550(bcn ctrl)/0x522", u32tmp[0], u8tmp[0]);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x49c); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x49c);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0xc50(dig)/0x49c(null-drop)", u32tmp[0] & 0xff, u8tmp[0]); "0xc50(dig)/0x49c(null-drop)", u32tmp[0] & 0xff, u8tmp[0]);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xda0); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xda0);
...@@ -2727,26 +2716,26 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2727,26 +2716,26 @@ void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist)
(u32tmp[3] & 0xffff); (u32tmp[3] & 0xffff);
fa_cck = (u8tmp[0] << 8) + u8tmp[1]; fa_cck = (u8tmp[0] << 8) + u8tmp[1];
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"OFDM-CCA/OFDM-FA/CCK-FA", "OFDM-CCA/OFDM-FA/CCK-FA",
u32tmp[0] & 0xffff, fa_ofdm, fa_cck); u32tmp[0] & 0xffff, fa_ofdm, fa_cck);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0);
u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4); u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4);
u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8); u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"0x6c0/0x6c4/0x6c8(coexTable)", "0x6c0/0x6c4/0x6c8(coexTable)",
u32tmp[0], u32tmp[1], u32tmp[2]); u32tmp[0], u32tmp[1], u32tmp[2]);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d", seq_printf(m, "\n %-35s = %d/ %d",
"0x770(high-pri rx/tx)", coex_sta->high_priority_rx, "0x770(high-pri rx/tx)", coex_sta->high_priority_rx,
coex_sta->high_priority_tx); coex_sta->high_priority_tx);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d", seq_printf(m, "\n %-35s = %d/ %d",
"0x774(low-pri rx/tx)", coex_sta->low_priority_rx, "0x774(low-pri rx/tx)", coex_sta->low_priority_rx,
coex_sta->low_priority_tx); coex_sta->low_priority_tx);
if (btcoexist->auto_report_1ant) if (btcoexist->auto_report_1ant)
halbtc8723b1ant_monitor_bt_ctr(btcoexist); halbtc8723b1ant_monitor_bt_ctr(btcoexist);
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS, m);
} }
void ex_btc8723b1ant_ips_notify(struct btc_coexist *btcoexist, u8 type) void ex_btc8723b1ant_ips_notify(struct btc_coexist *btcoexist, u8 type)
......
...@@ -220,5 +220,6 @@ void ex_btc8723b1ant_halt_notify(struct btc_coexist *btcoexist); ...@@ -220,5 +220,6 @@ void ex_btc8723b1ant_halt_notify(struct btc_coexist *btcoexist);
void ex_btc8723b1ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnpstate); void ex_btc8723b1ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnpstate);
void ex_btc8723b1ant_coex_dm_reset(struct btc_coexist *btcoexist); void ex_btc8723b1ant_coex_dm_reset(struct btc_coexist *btcoexist);
void ex_btc8723b1ant_periodical(struct btc_coexist *btcoexist); void ex_btc8723b1ant_periodical(struct btc_coexist *btcoexist);
void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist); void ex_btc8723b1ant_display_coex_info(struct btc_coexist *btcoexist,
struct seq_file *m);
void ex_btc8723b1ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state); void ex_btc8723b1ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state);
...@@ -3780,12 +3780,12 @@ void ex_btc8723b2ant_init_coex_dm(struct btc_coexist *btcoexist) ...@@ -3780,12 +3780,12 @@ void ex_btc8723b2ant_init_coex_dm(struct btc_coexist *btcoexist)
btc8723b2ant_init_coex_dm(btcoexist); btc8723b2ant_init_coex_dm(btcoexist);
} }
void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist) void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist,
struct seq_file *m)
{ {
struct btc_board_info *board_info = &btcoexist->board_info; struct btc_board_info *board_info = &btcoexist->board_info;
struct btc_stack_info *stack_info = &btcoexist->stack_info; struct btc_stack_info *stack_info = &btcoexist->stack_info;
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
struct rtl_priv *rtlpriv = btcoexist->adapter;
u8 u8tmp[4], i, bt_info_ext, ps_tdma_case = 0; u8 u8tmp[4], i, bt_info_ext, ps_tdma_case = 0;
u32 u32tmp[4]; u32 u32tmp[4];
bool roam = false, scan = false; bool roam = false, scan = false;
...@@ -3797,34 +3797,25 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -3797,34 +3797,25 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist)
u32 fw_ver = 0, bt_patch_ver = 0; u32 fw_ver = 0, bt_patch_ver = 0;
u8 ap_num = 0; u8 ap_num = 0;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_puts(m, "\n ============[BT Coexist info]============");
"\r\n ============[BT Coexist info]============");
if (btcoexist->manual_control) { if (btcoexist->manual_control) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_puts(m, "\n ==========[Under Manual Control]============");
"\r\n ==========[Under Manual Control]============"); seq_puts(m, "\n ==========================================");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
"\r\n ==========================================");
}
if (!board_info->bt_exist) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n BT not exists !!!");
return;
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d ", seq_printf(m, "\n %-35s = %d/ %d ",
"Ant PG number/ Ant mechanism:", "Ant PG number/ Ant mechanism:",
board_info->pg_ant_num, board_info->btdm_ant_num); board_info->pg_ant_num, board_info->btdm_ant_num);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s / %d", seq_printf(m, "\n %-35s = %s / %d",
"BT stack/ hci ext ver", "BT stack/ hci ext ver",
((stack_info->profile_notified) ? "Yes" : "No"), ((stack_info->profile_notified) ? "Yes" : "No"),
stack_info->hci_version); stack_info->hci_version);
btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver); btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver);
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver); btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)",
"\r\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)",
"CoexVer/ FwVer/ PatchVer", "CoexVer/ FwVer/ PatchVer",
glcoex_ver_date_8723b_2ant, glcoex_ver_8723b_2ant, glcoex_ver_date_8723b_2ant, glcoex_ver_8723b_2ant,
fw_ver, bt_patch_ver, bt_patch_ver); fw_ver, bt_patch_ver, bt_patch_ver);
...@@ -3834,23 +3825,23 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -3834,23 +3825,23 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist)
&wifi_dot11_chnl); &wifi_dot11_chnl);
btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl); btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d / %d(%d)", seq_printf(m, "\n %-35s = %d / %d(%d)",
"Dot11 channel / HsChnl(HsMode)", "Dot11 channel / HsChnl(HsMode)",
wifi_dot11_chnl, wifi_hs_chnl, bt_hs_on); wifi_dot11_chnl, wifi_hs_chnl, bt_hs_on);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %3ph ", seq_printf(m, "\n %-35s = %3ph ",
"H2C Wifi inform bt chnl Info", coex_dm->wifi_chnl_info); "H2C Wifi inform bt chnl Info", coex_dm->wifi_chnl_info);
btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi); btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi);
btcoexist->btc_get(btcoexist, BTC_GET_U1_AP_NUM, &ap_num); btcoexist->btc_get(btcoexist, BTC_GET_U1_AP_NUM, &ap_num);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d/ %d", seq_printf(m, "\n %-35s = %d/ %d/ %d",
"Wifi rssi/ HS rssi/ AP#", wifi_rssi, bt_hs_rssi, ap_num); "Wifi rssi/ HS rssi/ AP#", wifi_rssi, bt_hs_rssi, ap_num);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d/ %d ", seq_printf(m, "\n %-35s = %d/ %d/ %d ",
"Wifi link/ roam/ scan", link, roam, scan); "Wifi link/ roam/ scan", link, roam, scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g);
...@@ -3858,7 +3849,7 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -3858,7 +3849,7 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist)
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION,
&wifi_traffic_dir); &wifi_traffic_dir);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s / %s/ %s ", seq_printf(m, "\n %-35s = %s / %s/ %s ",
"Wifi status", (wifi_under_5g ? "5G" : "2.4G"), "Wifi status", (wifi_under_5g ? "5G" : "2.4G"),
((wifi_bw == BTC_WIFI_BW_LEGACY) ? "Legacy" : ((wifi_bw == BTC_WIFI_BW_LEGACY) ? "Legacy" :
(((wifi_bw == BTC_WIFI_BW_HT40) ? "HT40" : "HT20"))), (((wifi_bw == BTC_WIFI_BW_HT40) ? "HT40" : "HT20"))),
...@@ -3866,82 +3857,80 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -3866,82 +3857,80 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist)
((wifi_traffic_dir == BTC_WIFI_TRAFFIC_TX) ? ((wifi_traffic_dir == BTC_WIFI_TRAFFIC_TX) ?
"uplink" : "downlink"))); "uplink" : "downlink")));
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d / %d / %d / %d", seq_printf(m, "\n %-35s = %d / %d / %d / %d",
"SCO/HID/PAN/A2DP", "SCO/HID/PAN/A2DP",
bt_link_info->sco_exist, bt_link_info->hid_exist, bt_link_info->sco_exist, bt_link_info->hid_exist,
bt_link_info->pan_exist, bt_link_info->a2dp_exist); bt_link_info->pan_exist, bt_link_info->a2dp_exist);
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_BT_LINK_INFO); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_BT_LINK_INFO, m);
bt_info_ext = coex_sta->bt_info_ext; bt_info_ext = coex_sta->bt_info_ext;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s", seq_printf(m, "\n %-35s = %s",
"BT Info A2DP rate", "BT Info A2DP rate",
(bt_info_ext & BIT0) ? "Basic rate" : "EDR rate"); (bt_info_ext & BIT0) ? "Basic rate" : "EDR rate");
for (i = 0; i < BT_INFO_SRC_8723B_2ANT_MAX; i++) { for (i = 0; i < BT_INFO_SRC_8723B_2ANT_MAX; i++) {
if (coex_sta->bt_info_c2h_cnt[i]) { if (coex_sta->bt_info_c2h_cnt[i]) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %7ph(%d)",
"\r\n %-35s = %7ph(%d)",
glbt_info_src_8723b_2ant[i], glbt_info_src_8723b_2ant[i],
coex_sta->bt_info_c2h[i], coex_sta->bt_info_c2h[i],
coex_sta->bt_info_c2h_cnt[i]); coex_sta->bt_info_c2h_cnt[i]);
} }
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s/%s", seq_printf(m, "\n %-35s = %s/%s",
"PS state, IPS/LPS", "PS state, IPS/LPS",
((coex_sta->under_ips ? "IPS ON" : "IPS OFF")), ((coex_sta->under_ips ? "IPS ON" : "IPS OFF")),
((coex_sta->under_lps ? "LPS ON" : "LPS OFF"))); ((coex_sta->under_lps ? "LPS ON" : "LPS OFF")));
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD, m);
/* Sw mechanism */ /* Sw mechanism */
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m,
"\r\n %-35s", "============[Sw mechanism]============"); "\n %-35s", "============[Sw mechanism]============");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d/ %d ", seq_printf(m, "\n %-35s = %d/ %d/ %d ",
"SM1[ShRf/ LpRA/ LimDig]", coex_dm->cur_rf_rx_lpf_shrink, "SM1[ShRf/ LpRA/ LimDig]", coex_dm->cur_rf_rx_lpf_shrink,
coex_dm->cur_low_penalty_ra, coex_dm->limited_dig); coex_dm->cur_low_penalty_ra, coex_dm->limited_dig);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d/ %d(0x%x) ", seq_printf(m, "\n %-35s = %d/ %d/ %d(0x%x) ",
"SM2[AgcT/ AdcB/ SwDacSwing(lvl)]", "SM2[AgcT/ AdcB/ SwDacSwing(lvl)]",
coex_dm->cur_agc_table_en, coex_dm->cur_adc_back_off, coex_dm->cur_agc_table_en, coex_dm->cur_adc_back_off,
coex_dm->cur_dac_swing_on, coex_dm->cur_dac_swing_lvl); coex_dm->cur_dac_swing_on, coex_dm->cur_dac_swing_lvl);
/* Fw mechanism */ /* Fw mechanism */
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s", seq_printf(m, "\n %-35s",
"============[Fw mechanism]============"); "============[Fw mechanism]============");
ps_tdma_case = coex_dm->cur_ps_tdma; ps_tdma_case = coex_dm->cur_ps_tdma;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %5ph case-%d (auto:%d)",
"\r\n %-35s = %5ph case-%d (auto:%d)",
"PS TDMA", coex_dm->ps_tdma_para, "PS TDMA", coex_dm->ps_tdma_para,
ps_tdma_case, coex_dm->auto_tdma_adjust); ps_tdma_case, coex_dm->auto_tdma_adjust);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d ", seq_printf(m, "\n %-35s = %d/ %d ",
"DecBtPwr/ IgnWlanAct", coex_dm->cur_dec_bt_pwr_lvl, "DecBtPwr/ IgnWlanAct", coex_dm->cur_dec_bt_pwr_lvl,
coex_dm->cur_ignore_wlan_act); coex_dm->cur_ignore_wlan_act);
/* Hw setting */ /* Hw setting */
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s", seq_printf(m, "\n %-35s",
"============[Hw setting]============"); "============[Hw setting]============");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x", seq_printf(m, "\n %-35s = 0x%x",
"RF-A, 0x1e initVal", coex_dm->bt_rf0x1e_backup); "RF-A, 0x1e initVal", coex_dm->bt_rf0x1e_backup);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x880); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x880);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0x778/0x880[29:25]", u8tmp[0], "0x778/0x880[29:25]", u8tmp[0],
(u32tmp[0] & 0x3e000000) >> 25); (u32tmp[0] & 0x3e000000) >> 25);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x948); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x948);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x67); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x67);
u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x765); u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x765);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"0x948/ 0x67[5] / 0x765", "0x948/ 0x67[5] / 0x765",
u32tmp[0], ((u8tmp[0] & 0x20) >> 5), u8tmp[1]); u32tmp[0], ((u8tmp[0] & 0x20) >> 5), u8tmp[1]);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x92c); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x92c);
u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x930); u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x930);
u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x944); u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x944);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"0x92c[1:0]/ 0x930[7:0]/0x944[1:0]", "0x92c[1:0]/ 0x930[7:0]/0x944[1:0]",
u32tmp[0] & 0x3, u32tmp[1] & 0xff, u32tmp[2] & 0x3); u32tmp[0] & 0x3, u32tmp[1] & 0xff, u32tmp[2] & 0x3);
...@@ -3949,20 +3938,19 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -3949,20 +3938,19 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist)
u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x40); u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x40);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x4c); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x4c);
u8tmp[2] = btcoexist->btc_read_1byte(btcoexist, 0x64); u8tmp[2] = btcoexist->btc_read_1byte(btcoexist, 0x64);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x",
"\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x",
"0x38[11]/0x40/0x4c[24:23]/0x64[0]", "0x38[11]/0x40/0x4c[24:23]/0x64[0]",
((u8tmp[0] & 0x8) >> 3), u8tmp[1], ((u8tmp[0] & 0x8) >> 3), u8tmp[1],
((u32tmp[0] & 0x01800000) >> 23), u8tmp[2] & 0x1); ((u32tmp[0] & 0x01800000) >> 23), u8tmp[2] & 0x1);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0x550(bcn ctrl)/0x522", u32tmp[0], u8tmp[0]); "0x550(bcn ctrl)/0x522", u32tmp[0], u8tmp[0]);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x49c); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x49c);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0xc50(dig)/0x49c(null-drop)", u32tmp[0] & 0xff, u8tmp[0]); "0xc50(dig)/0x49c(null-drop)", u32tmp[0] & 0xff, u8tmp[0]);
u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xda0); u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xda0);
...@@ -3981,7 +3969,7 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -3981,7 +3969,7 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist)
(u32tmp[3] & 0xffff); (u32tmp[3] & 0xffff);
fa_cck = (u8tmp[0] << 8) + u8tmp[1]; fa_cck = (u8tmp[0] << 8) + u8tmp[1];
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"OFDM-CCA/OFDM-FA/CCK-FA", "OFDM-CCA/OFDM-FA/CCK-FA",
u32tmp[0] & 0xffff, fa_ofdm, fa_cck); u32tmp[0] & 0xffff, fa_ofdm, fa_cck);
...@@ -3989,21 +3977,19 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -3989,21 +3977,19 @@ void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist)
u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4); u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4);
u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8); u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x6cc); u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x6cc);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x",
"\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x",
"0x6c0/0x6c4/0x6c8/0x6cc(coexTable)", "0x6c0/0x6c4/0x6c8/0x6cc(coexTable)",
u32tmp[0], u32tmp[1], u32tmp[2], u8tmp[0]); u32tmp[0], u32tmp[1], u32tmp[2], u8tmp[0]);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d", seq_printf(m, "\n %-35s = %d/ %d",
"0x770(high-pri rx/tx)", "0x770(high-pri rx/tx)",
coex_sta->high_priority_rx, coex_sta->high_priority_tx); coex_sta->high_priority_rx, coex_sta->high_priority_tx);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d", seq_printf(m, "\n %-35s = %d/ %d",
"0x774(low-pri rx/tx)", coex_sta->low_priority_rx, "0x774(low-pri rx/tx)", coex_sta->low_priority_rx,
coex_sta->low_priority_tx); coex_sta->low_priority_tx);
if (btcoexist->auto_report_2ant) if (btcoexist->auto_report_2ant)
btc8723b2ant_monitor_bt_ctr(btcoexist); btc8723b2ant_monitor_bt_ctr(btcoexist);
btcoexist->btc_disp_dbg_msg(btcoexist, btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS, m);
BTC_DBG_DISP_COEX_STATISTICS);
} }
void ex_btc8723b2ant_ips_notify(struct btc_coexist *btcoexist, u8 type) void ex_btc8723b2ant_ips_notify(struct btc_coexist *btcoexist, u8 type)
......
...@@ -195,7 +195,8 @@ void ex_btc8723b2ant_bt_info_notify(struct btc_coexist *btcoexist, ...@@ -195,7 +195,8 @@ void ex_btc8723b2ant_bt_info_notify(struct btc_coexist *btcoexist,
u8 *tmpbuf, u8 length); u8 *tmpbuf, u8 length);
void ex_btc8723b2ant_halt_notify(struct btc_coexist *btcoexist); void ex_btc8723b2ant_halt_notify(struct btc_coexist *btcoexist);
void ex_btc8723b2ant_periodical(struct btc_coexist *btcoexist); void ex_btc8723b2ant_periodical(struct btc_coexist *btcoexist);
void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist); void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist,
struct seq_file *m);
void ex_btc8723b2ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state); void ex_btc8723b2ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state);
void ex_btc8723b2ant_pre_load_firmware(struct btc_coexist *btcoexist); void ex_btc8723b2ant_pre_load_firmware(struct btc_coexist *btcoexist);
void ex_btc8723b2ant_power_on_setting(struct btc_coexist *btcoexist); void ex_btc8723b2ant_power_on_setting(struct btc_coexist *btcoexist);
......
...@@ -2172,12 +2172,12 @@ void ex_btc8821a1ant_init_coex_dm(struct btc_coexist *btcoexist) ...@@ -2172,12 +2172,12 @@ void ex_btc8821a1ant_init_coex_dm(struct btc_coexist *btcoexist)
btc8821a1ant_query_bt_info(btcoexist); btc8821a1ant_query_bt_info(btcoexist);
} }
void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist) void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist,
struct seq_file *m)
{ {
struct btc_board_info *board_info = &btcoexist->board_info; struct btc_board_info *board_info = &btcoexist->board_info;
struct btc_stack_info *stack_info = &btcoexist->stack_info; struct btc_stack_info *stack_info = &btcoexist->stack_info;
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
struct rtl_priv *rtlpriv = btcoexist->adapter;
u8 u1_tmp[4], i, bt_info_ext, ps_tdma_case = 0; u8 u1_tmp[4], i, bt_info_ext, ps_tdma_case = 0;
u16 u2_tmp[4]; u16 u2_tmp[4];
u32 u4_tmp[4]; u32 u4_tmp[4];
...@@ -2188,44 +2188,31 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2188,44 +2188,31 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist)
u8 wifi_dot11_chnl, wifi_hs_chnl; u8 wifi_dot11_chnl, wifi_hs_chnl;
u32 fw_ver = 0, bt_patch_ver = 0; u32 fw_ver = 0, bt_patch_ver = 0;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_puts(m, "\n ============[BT Coexist info]============");
"\r\n ============[BT Coexist info]============");
if (btcoexist->manual_control) { if (btcoexist->manual_control) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_puts(m, "\n ============[Under Manual Control]============");
"\r\n ============[Under Manual Control]============"); seq_puts(m, "\n ==========================================");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
"\r\n ==========================================");
} }
if (btcoexist->stop_coex_dm) { if (btcoexist->stop_coex_dm) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_puts(m, "\n ============[Coex is STOPPED]============");
"\r\n ============[Coex is STOPPED]============"); seq_puts(m, "\n ==========================================");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
"\r\n ==========================================");
}
if (!board_info->bt_exist) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n BT not exists !!!");
return;
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d/ %d/ %d",
"\r\n %-35s = %d/ %d/ %d",
"Ant PG Num/ Ant Mech/ Ant Pos:", "Ant PG Num/ Ant Mech/ Ant Pos:",
board_info->pg_ant_num, board_info->pg_ant_num,
board_info->btdm_ant_num, board_info->btdm_ant_num,
board_info->btdm_ant_pos); board_info->btdm_ant_pos);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %s / %d", "BT stack/ hci ext ver",
"\r\n %-35s = %s / %d", "BT stack/ hci ext ver",
((stack_info->profile_notified) ? "Yes" : "No"), ((stack_info->profile_notified) ? "Yes" : "No"),
stack_info->hci_version); stack_info->hci_version);
btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER,
&bt_patch_ver); &bt_patch_ver);
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver); btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)",
"\r\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)",
"CoexVer/ FwVer/ PatchVer", "CoexVer/ FwVer/ PatchVer",
glcoex_ver_date_8821a_1ant, glcoex_ver_date_8821a_1ant,
glcoex_ver_8821a_1ant, glcoex_ver_8821a_1ant,
...@@ -2238,27 +2225,23 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2238,27 +2225,23 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist)
&wifi_dot11_chnl); &wifi_dot11_chnl);
btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL,
&wifi_hs_chnl); &wifi_hs_chnl);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d / %d(%d)",
"\r\n %-35s = %d / %d(%d)",
"Dot11 channel / HsChnl(HsMode)", "Dot11 channel / HsChnl(HsMode)",
wifi_dot11_chnl, wifi_hs_chnl, bt_hs_on); wifi_dot11_chnl, wifi_hs_chnl, bt_hs_on);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %3ph ",
"\r\n %-35s = %3ph ",
"H2C Wifi inform bt chnl Info", "H2C Wifi inform bt chnl Info",
coex_dm->wifi_chnl_info); coex_dm->wifi_chnl_info);
btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi); btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d/ %d", "Wifi rssi/ HS rssi",
"\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi",
(int)wifi_rssi, (int)bt_hs_rssi); (int)wifi_rssi, (int)bt_hs_rssi);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d/ %d/ %d ", "Wifi link/ roam/ scan",
"\r\n %-35s = %d/ %d/ %d ", "Wifi link/ roam/ scan",
link, roam, scan); link, roam, scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G,
...@@ -2269,16 +2252,15 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2269,16 +2252,15 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist)
&wifi_busy); &wifi_busy);
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION,
&wifi_traffic_dir); &wifi_traffic_dir);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %s / %s/ %s ", "Wifi status",
"\r\n %-35s = %s / %s/ %s ", "Wifi status",
(wifi_under_5g ? "5G" : "2.4G"), (wifi_under_5g ? "5G" : "2.4G"),
((wifi_bw == BTC_WIFI_BW_LEGACY) ? "Legacy" : ((wifi_bw == BTC_WIFI_BW_LEGACY) ? "Legacy" :
(((wifi_bw == BTC_WIFI_BW_HT40) ? "HT40" : "HT20"))), (((wifi_bw == BTC_WIFI_BW_HT40) ? "HT40" : "HT20"))),
((!wifi_busy) ? "idle" : ((!wifi_busy) ? "idle" :
((wifi_traffic_dir == BTC_WIFI_TRAFFIC_TX) ? ((wifi_traffic_dir == BTC_WIFI_TRAFFIC_TX) ?
"uplink" : "downlink"))); "uplink" : "downlink")));
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = [%s/ %d/ %d] ",
"\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", "BT [status/ rssi/ retryCnt]",
((coex_sta->bt_disabled) ? ("disabled") : ((coex_sta->bt_disabled) ? ("disabled") :
((coex_sta->c2h_bt_inquiry_page) ? ("inquiry/page scan") : ((coex_sta->c2h_bt_inquiry_page) ? ("inquiry/page scan") :
((BT_8821A_1ANT_BT_STATUS_NON_CONNECTED_IDLE == ((BT_8821A_1ANT_BT_STATUS_NON_CONNECTED_IDLE ==
...@@ -2289,87 +2271,74 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2289,87 +2271,74 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist)
"connected-idle" : "busy")))), "connected-idle" : "busy")))),
coex_sta->bt_rssi, coex_sta->bt_retry_cnt); coex_sta->bt_rssi, coex_sta->bt_retry_cnt);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP",
"\r\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP",
bt_link_info->sco_exist, bt_link_info->sco_exist,
bt_link_info->hid_exist, bt_link_info->hid_exist,
bt_link_info->pan_exist, bt_link_info->pan_exist,
bt_link_info->a2dp_exist); bt_link_info->a2dp_exist);
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_BT_LINK_INFO); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_BT_LINK_INFO, m);
bt_info_ext = coex_sta->bt_info_ext; bt_info_ext = coex_sta->bt_info_ext;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %s",
"\r\n %-35s = %s",
"BT Info A2DP rate", "BT Info A2DP rate",
(bt_info_ext & BIT0) ? (bt_info_ext & BIT0) ?
"Basic rate" : "EDR rate"); "Basic rate" : "EDR rate");
for (i = 0; i < BT_INFO_SRC_8821A_1ANT_MAX; i++) { for (i = 0; i < BT_INFO_SRC_8821A_1ANT_MAX; i++) {
if (coex_sta->bt_info_c2h_cnt[i]) { if (coex_sta->bt_info_c2h_cnt[i]) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %7ph(%d)",
"\r\n %-35s = %7ph(%d)",
glbt_info_src_8821a_1ant[i], glbt_info_src_8821a_1ant[i],
coex_sta->bt_info_c2h[i], coex_sta->bt_info_c2h[i],
coex_sta->bt_info_c2h_cnt[i]); coex_sta->bt_info_c2h_cnt[i]);
} }
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %s/%s, (0x%x/0x%x)",
"\r\n %-35s = %s/%s, (0x%x/0x%x)",
"PS state, IPS/LPS, (lps/rpwm)", "PS state, IPS/LPS, (lps/rpwm)",
((coex_sta->under_ips ? "IPS ON" : "IPS OFF")), ((coex_sta->under_ips ? "IPS ON" : "IPS OFF")),
((coex_sta->under_lps ? "LPS ON" : "LPS OFF")), ((coex_sta->under_lps ? "LPS ON" : "LPS OFF")),
btcoexist->bt_info.lps_val, btcoexist->bt_info.lps_val,
btcoexist->bt_info.rpwm_val); btcoexist->bt_info.rpwm_val);
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD, m);
if (!btcoexist->manual_control) { if (!btcoexist->manual_control) {
/* Sw mechanism*/ /* Sw mechanism*/
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s",
"\r\n %-35s",
"============[Sw mechanism]============"); "============[Sw mechanism]============");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d", "SM[LowPenaltyRA]",
"\r\n %-35s = %d", "SM[LowPenaltyRA]",
coex_dm->cur_low_penalty_ra); coex_dm->cur_low_penalty_ra);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %s/ %s/ %d ",
"\r\n %-35s = %s/ %s/ %d ",
"DelBA/ BtCtrlAgg/ AggSize", "DelBA/ BtCtrlAgg/ AggSize",
(btcoexist->bt_info.reject_agg_pkt ? "Yes" : "No"), (btcoexist->bt_info.reject_agg_pkt ? "Yes" : "No"),
(btcoexist->bt_info.bt_ctrl_buf_size ? "Yes" : "No"), (btcoexist->bt_info.bt_ctrl_buf_size ? "Yes" : "No"),
btcoexist->bt_info.agg_buf_size); btcoexist->bt_info.agg_buf_size);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x ", "Rate Mask",
"\r\n %-35s = 0x%x ", "Rate Mask",
btcoexist->bt_info.ra_mask); btcoexist->bt_info.ra_mask);
/* Fw mechanism */ /* Fw mechanism */
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s", seq_printf(m, "\n %-35s",
"============[Fw mechanism]============"); "============[Fw mechanism]============");
ps_tdma_case = coex_dm->cur_ps_tdma; ps_tdma_case = coex_dm->cur_ps_tdma;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %5ph case-%d (auto:%d)",
"\r\n %-35s = %5ph case-%d (auto:%d)",
"PS TDMA", "PS TDMA",
coex_dm->ps_tdma_para, coex_dm->ps_tdma_para,
ps_tdma_case, ps_tdma_case,
coex_dm->auto_tdma_adjust); coex_dm->auto_tdma_adjust);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x ",
"\r\n %-35s = 0x%x ",
"Latest error condition(should be 0)", "Latest error condition(should be 0)",
coex_dm->error_condition); coex_dm->error_condition);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d ", "IgnWlanAct",
"\r\n %-35s = %d ", "IgnWlanAct",
coex_dm->cur_ignore_wlan_act); coex_dm->cur_ignore_wlan_act);
} }
/* Hw setting */ /* Hw setting */
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s", "============[Hw setting]============");
"\r\n %-35s", "============[Hw setting]============");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x/0x%x/0x%x/0x%x",
"\r\n %-35s = 0x%x/0x%x/0x%x/0x%x",
"backup ARFR1/ARFR2/RL/AMaxTime", "backup ARFR1/ARFR2/RL/AMaxTime",
coex_dm->backup_arfr_cnt1, coex_dm->backup_arfr_cnt1,
coex_dm->backup_arfr_cnt2, coex_dm->backup_arfr_cnt2,
...@@ -2380,26 +2349,22 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2380,26 +2349,22 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist)
u4_tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x434); u4_tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x434);
u2_tmp[0] = btcoexist->btc_read_2byte(btcoexist, 0x42a); u2_tmp[0] = btcoexist->btc_read_2byte(btcoexist, 0x42a);
u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x456); u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x456);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x/0x%x/0x%x/0x%x",
"\r\n %-35s = 0x%x/0x%x/0x%x/0x%x",
"0x430/0x434/0x42a/0x456", "0x430/0x434/0x42a/0x456",
u4_tmp[0], u4_tmp[1], u2_tmp[0], u1_tmp[0]); u4_tmp[0], u4_tmp[1], u2_tmp[0], u1_tmp[0]);
u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778); u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778);
u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc58); u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc58);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x/ 0x%x", "0x778/ 0xc58[29:25]",
"\r\n %-35s = 0x%x/ 0x%x", "0x778/ 0xc58[29:25]",
u1_tmp[0], (u4_tmp[0] & 0x3e000000) >> 25); u1_tmp[0], (u4_tmp[0] & 0x3e000000) >> 25);
u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x8db); u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x8db);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x", "0x8db[6:5]",
"\r\n %-35s = 0x%x", "0x8db[6:5]",
((u1_tmp[0] & 0x60) >> 5)); ((u1_tmp[0] & 0x60) >> 5));
u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x975); u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x975);
u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xcb4); u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xcb4);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"\r\n %-35s = 0x%x/ 0x%x/ 0x%x",
"0xcb4[29:28]/0xcb4[7:0]/0x974[9:8]", "0xcb4[29:28]/0xcb4[7:0]/0x974[9:8]",
(u4_tmp[0] & 0x30000000) >> 28, (u4_tmp[0] & 0x30000000) >> 28,
u4_tmp[0] & 0xff, u4_tmp[0] & 0xff,
...@@ -2408,47 +2373,41 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -2408,47 +2373,41 @@ void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist)
u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x40); u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x40);
u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x4c); u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x4c);
u1_tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x64); u1_tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x64);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"\r\n %-35s = 0x%x/ 0x%x/ 0x%x",
"0x40/0x4c[24:23]/0x64[0]", "0x40/0x4c[24:23]/0x64[0]",
u1_tmp[0], ((u4_tmp[0] & 0x01800000) >> 23), u1_tmp[1] & 0x1); u1_tmp[0], ((u4_tmp[0] & 0x01800000) >> 23),
u1_tmp[1] & 0x1);
u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550); u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550);
u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522); u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x/ 0x%x", "0x550(bcn ctrl)/0x522",
"\r\n %-35s = 0x%x/ 0x%x", "0x550(bcn ctrl)/0x522",
u4_tmp[0], u1_tmp[0]); u4_tmp[0], u1_tmp[0]);
u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50); u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x", "0xc50(dig)",
"\r\n %-35s = 0x%x", "0xc50(dig)",
u4_tmp[0] & 0xff); u4_tmp[0] & 0xff);
u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xf48); u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xf48);
u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0xa5d); u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0xa5d);
u1_tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0xa5c); u1_tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0xa5c);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x/ 0x%x", "OFDM-FA/ CCK-FA",
"\r\n %-35s = 0x%x/ 0x%x", "OFDM-FA/ CCK-FA",
u4_tmp[0], (u1_tmp[0] << 8) + u1_tmp[1]); u4_tmp[0], (u1_tmp[0] << 8) + u1_tmp[1]);
u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0); u4_tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0);
u4_tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4); u4_tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4);
u4_tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8); u4_tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8);
u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x6cc); u1_tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x6cc);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x",
"\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x",
"0x6c0/0x6c4/0x6c8/0x6cc(coexTable)", "0x6c0/0x6c4/0x6c8/0x6cc(coexTable)",
u4_tmp[0], u4_tmp[1], u4_tmp[2], u1_tmp[0]); u4_tmp[0], u4_tmp[1], u4_tmp[2], u1_tmp[0]);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d/ %d", "0x770(high-pri rx/tx)",
"\r\n %-35s = %d/ %d", "0x770(high-pri rx/tx)",
coex_sta->high_priority_rx, coex_sta->high_priority_tx); coex_sta->high_priority_rx, coex_sta->high_priority_tx);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d/ %d", "0x774(low-pri rx/tx)",
"\r\n %-35s = %d/ %d", "0x774(low-pri rx/tx)",
coex_sta->low_priority_rx, coex_sta->low_priority_tx); coex_sta->low_priority_rx, coex_sta->low_priority_tx);
if (btcoexist->auto_report_1ant) if (btcoexist->auto_report_1ant)
btc8821a1ant_monitor_bt_ctr(btcoexist); btc8821a1ant_monitor_bt_ctr(btcoexist);
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS, m);
} }
void ex_btc8821a1ant_ips_notify(struct btc_coexist *btcoexist, u8 type) void ex_btc8821a1ant_ips_notify(struct btc_coexist *btcoexist, u8 type)
......
...@@ -186,7 +186,8 @@ void ex_btc8821a1ant_bt_info_notify(struct btc_coexist *btcoexist, ...@@ -186,7 +186,8 @@ void ex_btc8821a1ant_bt_info_notify(struct btc_coexist *btcoexist,
void ex_btc8821a1ant_halt_notify(struct btc_coexist *btcoexist); void ex_btc8821a1ant_halt_notify(struct btc_coexist *btcoexist);
void ex_btc8821a1ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnpstate); void ex_btc8821a1ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnpstate);
void ex_btc8821a1ant_periodical(struct btc_coexist *btcoexist); void ex_btc8821a1ant_periodical(struct btc_coexist *btcoexist);
void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist); void ex_btc8821a1ant_display_coex_info(struct btc_coexist *btcoexist,
struct seq_file *m);
void ex_btc8821a1ant_dbg_control(struct btc_coexist *btcoexist, u8 op_code, void ex_btc8821a1ant_dbg_control(struct btc_coexist *btcoexist, u8 op_code,
u8 op_len, u8 *data); u8 op_len, u8 *data);
void ex_btc8821a1ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state); void ex_btc8821a1ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state);
...@@ -3657,11 +3657,11 @@ void ex_btc8821a2ant_init_coex_dm(struct btc_coexist *btcoexist) ...@@ -3657,11 +3657,11 @@ void ex_btc8821a2ant_init_coex_dm(struct btc_coexist *btcoexist)
btc8821a2ant_init_coex_dm(btcoexist); btc8821a2ant_init_coex_dm(btcoexist);
} }
void ex_btc8821a2ant_display_coex_info(struct btc_coexist *btcoexist) void ex_btc8821a2ant_display_coex_info(struct btc_coexist *btcoexist,
struct seq_file *m)
{ {
struct btc_board_info *board_info = &btcoexist->board_info; struct btc_board_info *board_info = &btcoexist->board_info;
struct btc_stack_info *stack_info = &btcoexist->stack_info; struct btc_stack_info *stack_info = &btcoexist->stack_info;
struct rtl_priv *rtlpriv = btcoexist->adapter;
u8 u1tmp[4], i, bt_info_ext, ps_tdma_case = 0; u8 u1tmp[4], i, bt_info_ext, ps_tdma_case = 0;
u32 u4tmp[4]; u32 u4tmp[4];
bool roam = false, scan = false, link = false, wifi_under_5g = false; bool roam = false, scan = false, link = false, wifi_under_5g = false;
...@@ -3671,32 +3671,22 @@ void ex_btc8821a2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -3671,32 +3671,22 @@ void ex_btc8821a2ant_display_coex_info(struct btc_coexist *btcoexist)
u8 wifi_dot_11_chnl, wifi_hs_chnl; u8 wifi_dot_11_chnl, wifi_hs_chnl;
u32 fw_ver = 0, bt_patch_ver = 0; u32 fw_ver = 0, bt_patch_ver = 0;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_puts(m, "\n ============[BT Coexist info]============");
"\r\n ============[BT Coexist info]============");
if (!board_info->bt_exist) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n BT not exists !!!");
return;
}
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:",
"\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:",
board_info->pg_ant_num, board_info->btdm_ant_num); board_info->pg_ant_num, board_info->btdm_ant_num);
if (btcoexist->manual_control) { if (btcoexist->manual_control) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s", "[Action Manual control]!!");
"\r\n %-35s", "[Action Manual control]!!");
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %s / %d", "BT stack/ hci ext ver",
"\r\n %-35s = %s / %d", "BT stack/ hci ext ver",
((stack_info->profile_notified) ? "Yes" : "No"), ((stack_info->profile_notified) ? "Yes" : "No"),
stack_info->hci_version); stack_info->hci_version);
btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver); btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver);
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver); btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d_%d/ 0x%x/ 0x%x(%d)",
"\r\n %-35s = %d_%d/ 0x%x/ 0x%x(%d)",
"CoexVer/ FwVer/ PatchVer", "CoexVer/ FwVer/ PatchVer",
glcoex_ver_date_8821a_2ant, glcoex_ver_8821a_2ant, glcoex_ver_date_8821a_2ant, glcoex_ver_8821a_2ant,
fw_ver, bt_patch_ver, bt_patch_ver); fw_ver, bt_patch_ver, bt_patch_ver);
...@@ -3707,27 +3697,23 @@ void ex_btc8821a2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -3707,27 +3697,23 @@ void ex_btc8821a2ant_display_coex_info(struct btc_coexist *btcoexist)
BTC_GET_U1_WIFI_DOT11_CHNL, &wifi_dot_11_chnl); BTC_GET_U1_WIFI_DOT11_CHNL, &wifi_dot_11_chnl);
btcoexist->btc_get(btcoexist, btcoexist->btc_get(btcoexist,
BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl); BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d / %d(%d)",
"\r\n %-35s = %d / %d(%d)",
"Dot11 channel / HsMode(HsChnl)", "Dot11 channel / HsMode(HsChnl)",
wifi_dot_11_chnl, bt_hs_on, wifi_hs_chnl); wifi_dot_11_chnl, bt_hs_on, wifi_hs_chnl);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %3ph ",
"\r\n %-35s = %3ph ",
"H2C Wifi inform bt chnl Info", "H2C Wifi inform bt chnl Info",
coex_dm->wifi_chnl_info); coex_dm->wifi_chnl_info);
btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi); btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %ld/ %ld", "Wifi rssi/ HS rssi",
"\r\n %-35s = %ld/ %ld", "Wifi rssi/ HS rssi",
wifi_rssi, bt_hs_rssi); wifi_rssi, bt_hs_rssi);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam); btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d/ %d/ %d ", "Wifi link/ roam/ scan",
"\r\n %-35s = %d/ %d/ %d ", "Wifi link/ roam/ scan",
link, roam, scan); link, roam, scan);
btcoexist->btc_get(btcoexist, btcoexist->btc_get(btcoexist,
...@@ -3738,8 +3724,7 @@ void ex_btc8821a2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -3738,8 +3724,7 @@ void ex_btc8821a2ant_display_coex_info(struct btc_coexist *btcoexist)
BTC_GET_BL_WIFI_BUSY, &wifi_busy); BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_get(btcoexist, btcoexist->btc_get(btcoexist,
BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifi_traffic_dir); BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifi_traffic_dir);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %s / %s/ %s ", "Wifi status",
"\r\n %-35s = %s / %s/ %s ", "Wifi status",
(wifi_under_5g ? "5G" : "2.4G"), (wifi_under_5g ? "5G" : "2.4G"),
((BTC_WIFI_BW_LEGACY == wifi_bw) ? "Legacy" : ((BTC_WIFI_BW_LEGACY == wifi_bw) ? "Legacy" :
(((BTC_WIFI_BW_HT40 == wifi_bw) ? "HT40" : "HT20"))), (((BTC_WIFI_BW_HT40 == wifi_bw) ? "HT40" : "HT20"))),
...@@ -3748,134 +3733,128 @@ void ex_btc8821a2ant_display_coex_info(struct btc_coexist *btcoexist) ...@@ -3748,134 +3733,128 @@ void ex_btc8821a2ant_display_coex_info(struct btc_coexist *btcoexist)
"uplink" : "downlink"))); "uplink" : "downlink")));
if (stack_info->profile_notified) { if (stack_info->profile_notified) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d / %d / %d / %d",
"\r\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP", "SCO/HID/PAN/A2DP",
stack_info->sco_exist, stack_info->hid_exist, stack_info->sco_exist, stack_info->hid_exist,
stack_info->pan_exist, stack_info->a2dp_exist); stack_info->pan_exist, stack_info->a2dp_exist);
btcoexist->btc_disp_dbg_msg(btcoexist, btcoexist->btc_disp_dbg_msg(btcoexist,
BTC_DBG_DISP_BT_LINK_INFO); BTC_DBG_DISP_BT_LINK_INFO,
m);
} }
bt_info_ext = coex_sta->bt_info_ext; bt_info_ext = coex_sta->bt_info_ext;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s", seq_printf(m, "\n %-35s = %s", "BT Info A2DP rate",
"BT Info A2DP rate",
(bt_info_ext&BIT0) ? "Basic rate" : "EDR rate"); (bt_info_ext&BIT0) ? "Basic rate" : "EDR rate");
for (i = 0; i < BT_INFO_SRC_8821A_2ANT_MAX; i++) { for (i = 0; i < BT_INFO_SRC_8821A_2ANT_MAX; i++) {
if (coex_sta->bt_info_c2h_cnt[i]) { if (coex_sta->bt_info_c2h_cnt[i]) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %7ph(%d)",
"\r\n %-35s = %7ph(%d)",
glbt_info_src_8821a_2ant[i], glbt_info_src_8821a_2ant[i],
coex_sta->bt_info_c2h[i], coex_sta->bt_info_c2h[i],
coex_sta->bt_info_c2h_cnt[i]); coex_sta->bt_info_c2h_cnt[i]);
} }
} }
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s/%s", seq_printf(m, "\n %-35s = %s/%s",
"PS state, IPS/LPS", "PS state, IPS/LPS",
((coex_sta->under_ips ? "IPS ON" : "IPS OFF")), ((coex_sta->under_ips ? "IPS ON" : "IPS OFF")),
((coex_sta->under_lps ? "LPS ON" : "LPS OFF"))); ((coex_sta->under_lps ? "LPS ON" : "LPS OFF")));
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD, m);
/* Sw mechanism*/ /* Sw mechanism*/
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s", seq_printf(m, "\n %-35s",
"============[Sw mechanism]============"); "============[Sw mechanism]============");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d/ %d/ %d(0x%x) ",
"\r\n %-35s = %d/ %d/ %d(0x%x) ",
"SM2[AgcT/ AdcB/ SwDacSwing(lvl)]", "SM2[AgcT/ AdcB/ SwDacSwing(lvl)]",
coex_dm->cur_agc_table_en, coex_dm->cur_adc_back_off, coex_dm->cur_agc_table_en, coex_dm->cur_adc_back_off,
coex_dm->cur_dac_swing_on, coex_dm->cur_dac_swing_lvl); coex_dm->cur_dac_swing_on, coex_dm->cur_dac_swing_lvl);
/* Fw mechanism*/ /* Fw mechanism*/
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s", seq_printf(m, "\n %-35s",
"============[Fw mechanism]============"); "============[Fw mechanism]============");
if (!btcoexist->manual_control) { if (!btcoexist->manual_control) {
ps_tdma_case = coex_dm->cur_ps_tdma; ps_tdma_case = coex_dm->cur_ps_tdma;
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %5ph case-%d",
"\r\n %-35s = %5ph case-%d",
"PS TDMA", "PS TDMA",
coex_dm->ps_tdma_para, ps_tdma_case); coex_dm->ps_tdma_para, ps_tdma_case);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = %d/ %d ", "DecBtPwr/ IgnWlanAct",
"\r\n %-35s = %d/ %d ", "DecBtPwr/ IgnWlanAct",
coex_dm->cur_dec_bt_pwr_lvl, coex_dm->cur_dec_bt_pwr_lvl,
coex_dm->cur_ignore_wlan_act); coex_dm->cur_ignore_wlan_act);
} }
/* Hw setting*/ /* Hw setting*/
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s", "============[Hw setting]============");
"\r\n %-35s", "============[Hw setting]============");
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, seq_printf(m, "\n %-35s = 0x%x", "RF-A, 0x1e initVal",
"\r\n %-35s = 0x%x", "RF-A, 0x1e initVal",
coex_dm->bt_rf0x1e_backup); coex_dm->bt_rf0x1e_backup);
u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778); u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778);
u1tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x6cc); u1tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x6cc);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x ", seq_printf(m, "\n %-35s = 0x%x/ 0x%x ",
"0x778 (W_Act)/ 0x6cc (CoTab Sel)", "0x778 (W_Act)/ 0x6cc (CoTab Sel)",
u1tmp[0], u1tmp[1]); u1tmp[0], u1tmp[1]);
u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x8db); u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x8db);
u1tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0xc5b); u1tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0xc5b);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0x8db(ADC)/0xc5b[29:25](DAC)", "0x8db(ADC)/0xc5b[29:25](DAC)",
((u1tmp[0] & 0x60) >> 5), ((u1tmp[1] & 0x3e) >> 1)); ((u1tmp[0] & 0x60) >> 5), ((u1tmp[1] & 0x3e) >> 1));
u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xcb4); u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xcb4);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0xcb4[7:0](ctrl)/ 0xcb4[29:28](val)", "0xcb4[7:0](ctrl)/ 0xcb4[29:28](val)",
u4tmp[0] & 0xff, ((u4tmp[0] & 0x30000000) >> 28)); u4tmp[0] & 0xff, ((u4tmp[0] & 0x30000000) >> 28));
u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x40); u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x40);
u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x4c); u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x4c);
u4tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x974); u4tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x974);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"0x40/ 0x4c[24:23]/ 0x974", "0x40/ 0x4c[24:23]/ 0x974",
u1tmp[0], ((u4tmp[0] & 0x01800000) >> 23), u4tmp[1]); u1tmp[0], ((u4tmp[0] & 0x01800000) >> 23), u4tmp[1]);
u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550); u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550);
u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522); u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0x550(bcn ctrl)/0x522", "0x550(bcn ctrl)/0x522",
u4tmp[0], u1tmp[0]); u4tmp[0], u1tmp[0]);
u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50); u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50);
u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0xa0a); u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0xa0a);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"0xc50(DIG)/0xa0a(CCK-TH)", "0xc50(DIG)/0xa0a(CCK-TH)",
u4tmp[0], u1tmp[0]); u4tmp[0], u1tmp[0]);
u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xf48); u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xf48);
u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0xa5b); u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0xa5b);
u1tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0xa5c); u1tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0xa5c);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x",
"OFDM-FA/ CCK-FA", "OFDM-FA/ CCK-FA",
u4tmp[0], (u1tmp[0] << 8) + u1tmp[1]); u4tmp[0], (u1tmp[0] << 8) + u1tmp[1]);
u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0); u4tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0);
u4tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4); u4tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4);
u4tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8); u4tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x",
"0x6c0/0x6c4/0x6c8", "0x6c0/0x6c4/0x6c8",
u4tmp[0], u4tmp[1], u4tmp[2]); u4tmp[0], u4tmp[1], u4tmp[2]);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d", seq_printf(m, "\n %-35s = %d/ %d",
"0x770 (hi-pri Rx/Tx)", "0x770 (hi-pri Rx/Tx)",
coex_sta->high_priority_rx, coex_sta->high_priority_tx); coex_sta->high_priority_rx, coex_sta->high_priority_tx);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d", seq_printf(m, "\n %-35s = %d/ %d",
"0x774(low-pri Rx/Tx)", "0x774(low-pri Rx/Tx)",
coex_sta->low_priority_rx, coex_sta->low_priority_tx); coex_sta->low_priority_rx, coex_sta->low_priority_tx);
/* Tx mgnt queue hang or not, 0x41b should = 0xf, ex: 0xd ==>hang*/ /* Tx mgnt queue hang or not, 0x41b should = 0xf, ex: 0xd ==>hang*/
u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x41b); u1tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x41b);
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = 0x%x", seq_printf(m, "\n %-35s = 0x%x",
"0x41b (mgntQ hang chk == 0xf)", "0x41b (mgntQ hang chk == 0xf)",
u1tmp[0]); u1tmp[0]);
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS); btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS, m);
} }
void ex_btc8821a2ant_ips_notify(struct btc_coexist *btcoexist, u8 type) void ex_btc8821a2ant_ips_notify(struct btc_coexist *btcoexist, u8 type)
......
...@@ -226,7 +226,8 @@ ex_btc8821a2ant_periodical( ...@@ -226,7 +226,8 @@ ex_btc8821a2ant_periodical(
); );
void void
ex_btc8821a2ant_display_coex_info( ex_btc8821a2ant_display_coex_info(
struct btc_coexist *btcoexist struct btc_coexist *btcoexist,
struct seq_file *m
); );
void ex_btc8821a2ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state); void ex_btc8821a2ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state);
void ex_btc8821a2ant_pre_load_firmware(struct btc_coexist *btcoexist); void ex_btc8821a2ant_pre_load_firmware(struct btc_coexist *btcoexist);
...@@ -653,6 +653,105 @@ static bool halbtc_set(void *void_btcoexist, u8 set_type, void *in_buf) ...@@ -653,6 +653,105 @@ static bool halbtc_set(void *void_btcoexist, u8 set_type, void *in_buf)
return ret; return ret;
} }
static void halbtc_display_coex_statistics(struct btc_coexist *btcoexist,
struct seq_file *m)
{
}
static void halbtc_display_bt_link_info(struct btc_coexist *btcoexist,
struct seq_file *m)
{
}
static void halbtc_display_wifi_status(struct btc_coexist *btcoexist,
struct seq_file *m)
{
struct rtl_priv *rtlpriv = btcoexist->adapter;
s32 wifi_rssi = 0, bt_hs_rssi = 0;
bool scan = false, link = false, roam = false, wifi_busy = false;
bool wifi_under_b_mode = false;
bool wifi_under_5g = false;
u32 wifi_bw = BTC_WIFI_BW_HT20;
u32 wifi_traffic_dir = BTC_WIFI_TRAFFIC_TX;
u32 wifi_freq = BTC_FREQ_2_4G;
u32 wifi_link_status = 0x0;
bool bt_hs_on = false, under_ips = false, under_lps = false;
bool low_power = false, dc_mode = false;
u8 wifi_chnl = 0, wifi_hs_chnl = 0, fw_ps_state;
u8 ap_num = 0;
wifi_link_status = halbtc_get_wifi_link_status(btcoexist);
seq_printf(m, "\n %-35s = %d/ %d/ %d/ %d/ %d",
"STA/vWifi/HS/p2pGo/p2pGc",
((wifi_link_status & WIFI_STA_CONNECTED) ? 1 : 0),
((wifi_link_status & WIFI_AP_CONNECTED) ? 1 : 0),
((wifi_link_status & WIFI_HS_CONNECTED) ? 1 : 0),
((wifi_link_status & WIFI_P2P_GO_CONNECTED) ? 1 : 0),
((wifi_link_status & WIFI_P2P_GC_CONNECTED) ? 1 : 0));
btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on);
btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifi_chnl);
btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl);
seq_printf(m, "\n %-35s = %d / %d(%d)",
"Dot11 channel / HsChnl(High Speed)",
wifi_chnl, wifi_hs_chnl, bt_hs_on);
btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi);
seq_printf(m, "\n %-35s = %d/ %d",
"Wifi rssi/ HS rssi",
wifi_rssi - 100, bt_hs_rssi - 100);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam);
seq_printf(m, "\n %-35s = %d/ %d/ %d ",
"Wifi link/ roam/ scan",
link, roam, scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g);
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION,
&wifi_traffic_dir);
btcoexist->btc_get(btcoexist, BTC_GET_U1_AP_NUM, &ap_num);
wifi_freq = (wifi_under_5g ? BTC_FREQ_5G : BTC_FREQ_2_4G);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_B_MODE,
&wifi_under_b_mode);
seq_printf(m, "\n %-35s = %s / %s/ %s/ AP=%d ",
"Wifi freq/ bw/ traffic",
gl_btc_wifi_freq_string[wifi_freq],
((wifi_under_b_mode) ? "11b" :
gl_btc_wifi_bw_string[wifi_bw]),
((!wifi_busy) ? "idle" : ((BTC_WIFI_TRAFFIC_TX ==
wifi_traffic_dir) ? "uplink" :
"downlink")),
ap_num);
/* power status */
dc_mode = true; /*TODO*/
under_ips = rtlpriv->psc.inactive_pwrstate == ERFOFF ? 1 : 0;
under_lps = rtlpriv->psc.dot11_psmode == EACTIVE ? 0 : 1;
fw_ps_state = 0;
low_power = 0; /*TODO*/
seq_printf(m, "\n %-35s = %s%s%s%s",
"Power Status",
(dc_mode ? "DC mode" : "AC mode"),
(under_ips ? ", IPS ON" : ""),
(under_lps ? ", LPS ON" : ""),
(low_power ? ", 32k" : ""));
seq_printf(m,
"\n %-35s = %02x %02x %02x %02x %02x %02x (0x%x/0x%x)",
"Power mode cmd(lps/rpwm)",
btcoexist->pwr_mode_val[0], btcoexist->pwr_mode_val[1],
btcoexist->pwr_mode_val[2], btcoexist->pwr_mode_val[3],
btcoexist->pwr_mode_val[4], btcoexist->pwr_mode_val[5],
btcoexist->bt_info.lps_val,
btcoexist->bt_info.rpwm_val);
}
/************************************************************ /************************************************************
* IO related function * IO related function
************************************************************/ ************************************************************/
...@@ -831,6 +930,26 @@ void halbtc_set_bt_reg(void *btc_context, u8 reg_type, u32 offset, u32 set_val) ...@@ -831,6 +930,26 @@ void halbtc_set_bt_reg(void *btc_context, u8 reg_type, u32 offset, u32 set_val)
} }
} }
static void halbtc_display_dbg_msg(void *bt_context, u8 disp_type,
struct seq_file *m)
{
struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context;
switch (disp_type) {
case BTC_DBG_DISP_COEX_STATISTICS:
halbtc_display_coex_statistics(btcoexist, m);
break;
case BTC_DBG_DISP_BT_LINK_INFO:
halbtc_display_bt_link_info(btcoexist, m);
break;
case BTC_DBG_DISP_WIFI_STATUS:
halbtc_display_wifi_status(btcoexist, m);
break;
default:
break;
}
}
bool halbtc_under_ips(struct btc_coexist *btcoexist) bool halbtc_under_ips(struct btc_coexist *btcoexist)
{ {
struct rtl_priv *rtlpriv = btcoexist->adapter; struct rtl_priv *rtlpriv = btcoexist->adapter;
...@@ -874,6 +993,7 @@ bool exhalbtc_initlize_variables(void) ...@@ -874,6 +993,7 @@ bool exhalbtc_initlize_variables(void)
btcoexist->btc_get_rf_reg = halbtc_get_rfreg; btcoexist->btc_get_rf_reg = halbtc_get_rfreg;
btcoexist->btc_fill_h2c = halbtc_fill_h2c_cmd; btcoexist->btc_fill_h2c = halbtc_fill_h2c_cmd;
btcoexist->btc_disp_dbg_msg = halbtc_display_dbg_msg;
btcoexist->btc_get = halbtc_get; btcoexist->btc_get = halbtc_get;
btcoexist->btc_set = halbtc_set; btcoexist->btc_set = halbtc_set;
...@@ -1523,17 +1643,17 @@ void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist, ...@@ -1523,17 +1643,17 @@ void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist,
if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) {
if (btcoexist->board_info.btdm_ant_num == 2) if (btcoexist->board_info.btdm_ant_num == 2)
ex_btc8821a2ant_display_coex_info(btcoexist); ex_btc8821a2ant_display_coex_info(btcoexist, m);
else if (btcoexist->board_info.btdm_ant_num == 1) else if (btcoexist->board_info.btdm_ant_num == 1)
ex_btc8821a1ant_display_coex_info(btcoexist); ex_btc8821a1ant_display_coex_info(btcoexist, m);
} else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) {
if (btcoexist->board_info.btdm_ant_num == 2) if (btcoexist->board_info.btdm_ant_num == 2)
ex_btc8723b2ant_display_coex_info(btcoexist); ex_btc8723b2ant_display_coex_info(btcoexist, m);
else if (btcoexist->board_info.btdm_ant_num == 1) else if (btcoexist->board_info.btdm_ant_num == 1)
ex_btc8723b1ant_display_coex_info(btcoexist); ex_btc8723b1ant_display_coex_info(btcoexist, m);
} else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) {
if (btcoexist->board_info.btdm_ant_num == 2) if (btcoexist->board_info.btdm_ant_num == 2)
ex_btc8192e2ant_display_coex_info(btcoexist); ex_btc8192e2ant_display_coex_info(btcoexist, m);
} }
halbtc_normal_low_power(btcoexist); halbtc_normal_low_power(btcoexist);
......
...@@ -152,7 +152,6 @@ struct btc_board_info { ...@@ -152,7 +152,6 @@ struct btc_board_info {
u8 btdm_ant_num; /* ant number for btdm */ u8 btdm_ant_num; /* ant number for btdm */
u8 btdm_ant_pos; u8 btdm_ant_pos;
u8 single_ant_path; /* current used for 8723b only, 1=>s0, 0=>s1 */ u8 single_ant_path; /* current used for 8723b only, 1=>s0, 0=>s1 */
bool bt_exist;
bool tfbga_package; bool tfbga_package;
}; };
...@@ -181,6 +180,12 @@ enum btc_wifi_role { ...@@ -181,6 +180,12 @@ enum btc_wifi_role {
BTC_ROLE_MAX BTC_ROLE_MAX
}; };
enum btc_wireless_freq {
BTC_FREQ_2_4G = 0x0,
BTC_FREQ_5G = 0x1,
BTC_FREQ_MAX
};
enum btc_wifi_bw_mode { enum btc_wifi_bw_mode {
BTC_WIFI_BW_LEGACY = 0x0, BTC_WIFI_BW_LEGACY = 0x0,
BTC_WIFI_BW_HT20 = 0x1, BTC_WIFI_BW_HT20 = 0x1,
...@@ -355,6 +360,7 @@ enum btc_dbg_disp_type { ...@@ -355,6 +360,7 @@ enum btc_dbg_disp_type {
BTC_DBG_DISP_BT_LINK_INFO = 0x1, BTC_DBG_DISP_BT_LINK_INFO = 0x1,
BTC_DBG_DISP_BT_FW_VER = 0x2, BTC_DBG_DISP_BT_FW_VER = 0x2,
BTC_DBG_DISP_FW_PWR_MODE_CMD = 0x3, BTC_DBG_DISP_FW_PWR_MODE_CMD = 0x3,
BTC_DBG_DISP_WIFI_STATUS = 0x04,
BTC_DBG_DISP_MAX BTC_DBG_DISP_MAX
}; };
...@@ -458,7 +464,8 @@ typedef bool (*bfp_btc_set)(void *btcoexist, u8 set_type, void *in_buf); ...@@ -458,7 +464,8 @@ typedef bool (*bfp_btc_set)(void *btcoexist, u8 set_type, void *in_buf);
typedef void (*bfp_btc_set_bt_reg)(void *btc_context, u8 reg_type, u32 offset, typedef void (*bfp_btc_set_bt_reg)(void *btc_context, u8 reg_type, u32 offset,
u32 value); u32 value);
typedef void (*bfp_btc_disp_dbg_msg)(void *btcoexist, u8 disp_type); typedef void (*bfp_btc_disp_dbg_msg)(void *btcoexist, u8 disp_type,
struct seq_file *m);
struct btc_bt_info { struct btc_bt_info {
bool bt_disabled; bool bt_disabled;
......
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