Lines Matching +full:opp +full:- +full:133 +full:m

1 // SPDX-License-Identifier: GPL-2.0
7 * This file is for RTL8723B Co-exist mechanism
45 coex_dm->curra_mask = dis_rate_mask; in halbtc8723b1ant_updatera_mask()
47 if (force_exec || (coex_dm->prera_mask != coex_dm->curra_mask)) in halbtc8723b1ant_updatera_mask()
48 btcoexist->btc_set(btcoexist, BTC_SET_ACT_UPDATE_RAMASK, in halbtc8723b1ant_updatera_mask()
49 &coex_dm->curra_mask); in halbtc8723b1ant_updatera_mask()
51 coex_dm->prera_mask = coex_dm->curra_mask; in halbtc8723b1ant_updatera_mask()
59 coex_dm->cur_arfr_type = type; in btc8723b1ant_auto_rate_fb_retry()
61 if (force_exec || (coex_dm->pre_arfr_type != coex_dm->cur_arfr_type)) { in btc8723b1ant_auto_rate_fb_retry()
62 switch (coex_dm->cur_arfr_type) { in btc8723b1ant_auto_rate_fb_retry()
64 btcoexist->btc_write_4byte(btcoexist, 0x430, in btc8723b1ant_auto_rate_fb_retry()
65 coex_dm->backup_arfr_cnt1); in btc8723b1ant_auto_rate_fb_retry()
66 btcoexist->btc_write_4byte(btcoexist, 0x434, in btc8723b1ant_auto_rate_fb_retry()
67 coex_dm->backup_arfr_cnt2); in btc8723b1ant_auto_rate_fb_retry()
70 btcoexist->btc_get(btcoexist, in btc8723b1ant_auto_rate_fb_retry()
74 btcoexist->btc_write_4byte(btcoexist, in btc8723b1ant_auto_rate_fb_retry()
76 btcoexist->btc_write_4byte(btcoexist, in btc8723b1ant_auto_rate_fb_retry()
79 btcoexist->btc_write_4byte(btcoexist, in btc8723b1ant_auto_rate_fb_retry()
81 btcoexist->btc_write_4byte(btcoexist, in btc8723b1ant_auto_rate_fb_retry()
90 coex_dm->pre_arfr_type = coex_dm->cur_arfr_type; in btc8723b1ant_auto_rate_fb_retry()
96 coex_dm->cur_retry_limit_type = type; in halbtc8723b1ant_retry_limit()
98 if (force_exec || (coex_dm->pre_retry_limit_type != in halbtc8723b1ant_retry_limit()
99 coex_dm->cur_retry_limit_type)) { in halbtc8723b1ant_retry_limit()
100 switch (coex_dm->cur_retry_limit_type) { in halbtc8723b1ant_retry_limit()
102 btcoexist->btc_write_2byte(btcoexist, 0x42a, in halbtc8723b1ant_retry_limit()
103 coex_dm->backup_retry_limit); in halbtc8723b1ant_retry_limit()
106 btcoexist->btc_write_2byte(btcoexist, 0x42a, 0x0808); in halbtc8723b1ant_retry_limit()
113 coex_dm->pre_retry_limit_type = coex_dm->cur_retry_limit_type; in halbtc8723b1ant_retry_limit()
119 coex_dm->cur_ampdu_time_type = type; in halbtc8723b1ant_ampdu_maxtime()
121 if (force_exec || (coex_dm->pre_ampdu_time_type != in halbtc8723b1ant_ampdu_maxtime()
122 coex_dm->cur_ampdu_time_type)) { in halbtc8723b1ant_ampdu_maxtime()
123 switch (coex_dm->cur_ampdu_time_type) { in halbtc8723b1ant_ampdu_maxtime()
125 btcoexist->btc_write_1byte(btcoexist, 0x456, in halbtc8723b1ant_ampdu_maxtime()
126 coex_dm->backup_ampdu_max_time); in halbtc8723b1ant_ampdu_maxtime()
129 btcoexist->btc_write_1byte(btcoexist, 0x456, 0x38); in halbtc8723b1ant_ampdu_maxtime()
136 coex_dm->pre_ampdu_time_type = coex_dm->cur_ampdu_time_type; in halbtc8723b1ant_ampdu_maxtime()
178 btcoexist->btc_set(btcoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, in halbtc8723b1ant_limited_rx()
181 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, in halbtc8723b1ant_limited_rx()
186 btcoexist->btc_set(btcoexist, BTC_SET_U1_AGG_BUF_SIZE, &rxaggsize); in halbtc8723b1ant_limited_rx()
188 btcoexist->btc_set(btcoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL); in halbtc8723b1ant_limited_rx()
195 coex_sta->c2h_bt_info_req_sent = true; in halbtc8723b1ant_query_bt_info()
200 btcoexist->btc_fill_h2c(btcoexist, 0x61, 1, h2c_parameter); in halbtc8723b1ant_query_bt_info()
213 u32tmp = btcoexist->btc_read_4byte(btcoexist, reg_hp_txrx); in halbtc8723b1ant_monitor_bt_ctr()
217 u32tmp = btcoexist->btc_read_4byte(btcoexist, reg_lp_txrx); in halbtc8723b1ant_monitor_bt_ctr()
221 coex_sta->high_priority_tx = reg_hp_tx; in halbtc8723b1ant_monitor_bt_ctr()
222 coex_sta->high_priority_rx = reg_hp_rx; in halbtc8723b1ant_monitor_bt_ctr()
223 coex_sta->low_priority_tx = reg_lp_tx; in halbtc8723b1ant_monitor_bt_ctr()
224 coex_sta->low_priority_rx = reg_lp_rx; in halbtc8723b1ant_monitor_bt_ctr()
226 if ((coex_sta->low_priority_tx > 1050) && in halbtc8723b1ant_monitor_bt_ctr()
227 (!coex_sta->c2h_bt_inquiry_page)) in halbtc8723b1ant_monitor_bt_ctr()
228 coex_sta->pop_event_cnt++; in halbtc8723b1ant_monitor_bt_ctr()
231 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0xc); in halbtc8723b1ant_monitor_bt_ctr()
261 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in halbtc8723b1ant_monitor_wifi_ctr()
262 btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); in halbtc8723b1ant_monitor_wifi_ctr()
263 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, in halbtc8723b1ant_monitor_wifi_ctr()
266 if (coex_sta->under_ips) { in halbtc8723b1ant_monitor_wifi_ctr()
267 coex_sta->crc_ok_cck = 0; in halbtc8723b1ant_monitor_wifi_ctr()
268 coex_sta->crc_ok_11g = 0; in halbtc8723b1ant_monitor_wifi_ctr()
269 coex_sta->crc_ok_11n = 0; in halbtc8723b1ant_monitor_wifi_ctr()
270 coex_sta->crc_ok_11n_agg = 0; in halbtc8723b1ant_monitor_wifi_ctr()
272 coex_sta->crc_err_cck = 0; in halbtc8723b1ant_monitor_wifi_ctr()
273 coex_sta->crc_err_11g = 0; in halbtc8723b1ant_monitor_wifi_ctr()
274 coex_sta->crc_err_11n = 0; in halbtc8723b1ant_monitor_wifi_ctr()
275 coex_sta->crc_err_11n_agg = 0; in halbtc8723b1ant_monitor_wifi_ctr()
277 coex_sta->crc_ok_cck = in halbtc8723b1ant_monitor_wifi_ctr()
278 btcoexist->btc_read_4byte(btcoexist, 0xf88); in halbtc8723b1ant_monitor_wifi_ctr()
279 coex_sta->crc_ok_11g = in halbtc8723b1ant_monitor_wifi_ctr()
280 btcoexist->btc_read_2byte(btcoexist, 0xf94); in halbtc8723b1ant_monitor_wifi_ctr()
281 coex_sta->crc_ok_11n = in halbtc8723b1ant_monitor_wifi_ctr()
282 btcoexist->btc_read_2byte(btcoexist, 0xf90); in halbtc8723b1ant_monitor_wifi_ctr()
283 coex_sta->crc_ok_11n_agg = in halbtc8723b1ant_monitor_wifi_ctr()
284 btcoexist->btc_read_2byte(btcoexist, 0xfb8); in halbtc8723b1ant_monitor_wifi_ctr()
286 coex_sta->crc_err_cck = in halbtc8723b1ant_monitor_wifi_ctr()
287 btcoexist->btc_read_4byte(btcoexist, 0xf84); in halbtc8723b1ant_monitor_wifi_ctr()
288 coex_sta->crc_err_11g = in halbtc8723b1ant_monitor_wifi_ctr()
289 btcoexist->btc_read_2byte(btcoexist, 0xf96); in halbtc8723b1ant_monitor_wifi_ctr()
290 coex_sta->crc_err_11n = in halbtc8723b1ant_monitor_wifi_ctr()
291 btcoexist->btc_read_2byte(btcoexist, 0xf92); in halbtc8723b1ant_monitor_wifi_ctr()
292 coex_sta->crc_err_11n_agg = in halbtc8723b1ant_monitor_wifi_ctr()
293 btcoexist->btc_read_2byte(btcoexist, 0xfba); in halbtc8723b1ant_monitor_wifi_ctr()
297 btcoexist->btc_write_1byte_bitmask(btcoexist, 0xf16, 0x1, 0x1); in halbtc8723b1ant_monitor_wifi_ctr()
298 btcoexist->btc_write_1byte_bitmask(btcoexist, 0xf16, 0x1, 0x0); in halbtc8723b1ant_monitor_wifi_ctr()
301 total_cnt = coex_sta->crc_ok_cck + coex_sta->crc_ok_11g + in halbtc8723b1ant_monitor_wifi_ctr()
302 coex_sta->crc_ok_11n + coex_sta->crc_ok_11n_agg; in halbtc8723b1ant_monitor_wifi_ctr()
304 if ((coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || in halbtc8723b1ant_monitor_wifi_ctr()
305 (coex_dm->bt_status == in halbtc8723b1ant_monitor_wifi_ctr()
307 (coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_SCO_BUSY)) { in halbtc8723b1ant_monitor_wifi_ctr()
308 if (coex_sta->crc_ok_cck > in halbtc8723b1ant_monitor_wifi_ctr()
309 (total_cnt - coex_sta->crc_ok_cck)) { in halbtc8723b1ant_monitor_wifi_ctr()
314 cck_lock_counter--; in halbtc8723b1ant_monitor_wifi_ctr()
319 cck_lock_counter--; in halbtc8723b1ant_monitor_wifi_ctr()
323 cck_lock_counter--; in halbtc8723b1ant_monitor_wifi_ctr()
326 if (!coex_sta->pre_ccklock) { in halbtc8723b1ant_monitor_wifi_ctr()
328 coex_sta->cck_lock = true; in halbtc8723b1ant_monitor_wifi_ctr()
330 coex_sta->cck_lock = false; in halbtc8723b1ant_monitor_wifi_ctr()
333 coex_sta->cck_lock = false; in halbtc8723b1ant_monitor_wifi_ctr()
335 coex_sta->cck_lock = true; in halbtc8723b1ant_monitor_wifi_ctr()
338 if (coex_sta->cck_lock) in halbtc8723b1ant_monitor_wifi_ctr()
339 coex_sta->cck_ever_lock = true; in halbtc8723b1ant_monitor_wifi_ctr()
341 coex_sta->pre_ccklock = coex_sta->cck_lock; in halbtc8723b1ant_monitor_wifi_ctr()
351 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED, in btc8723b1ant_is_wifi_status_changed()
353 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in btc8723b1ant_is_wifi_status_changed()
354 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in btc8723b1ant_is_wifi_status_changed()
355 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, in btc8723b1ant_is_wifi_status_changed()
378 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in halbtc8723b1ant_update_bt_link_info()
381 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in halbtc8723b1ant_update_bt_link_info()
383 bt_link_info->bt_link_exist = coex_sta->bt_link_exist; in halbtc8723b1ant_update_bt_link_info()
384 bt_link_info->sco_exist = coex_sta->sco_exist; in halbtc8723b1ant_update_bt_link_info()
385 bt_link_info->a2dp_exist = coex_sta->a2dp_exist; in halbtc8723b1ant_update_bt_link_info()
386 bt_link_info->pan_exist = coex_sta->pan_exist; in halbtc8723b1ant_update_bt_link_info()
387 bt_link_info->hid_exist = coex_sta->hid_exist; in halbtc8723b1ant_update_bt_link_info()
388 bt_link_info->bt_hi_pri_link_exist = coex_sta->bt_hi_pri_link_exist; in halbtc8723b1ant_update_bt_link_info()
392 bt_link_info->pan_exist = true; in halbtc8723b1ant_update_bt_link_info()
393 bt_link_info->bt_link_exist = true; in halbtc8723b1ant_update_bt_link_info()
397 if (bt_link_info->sco_exist && !bt_link_info->a2dp_exist && in halbtc8723b1ant_update_bt_link_info()
398 !bt_link_info->pan_exist && !bt_link_info->hid_exist) in halbtc8723b1ant_update_bt_link_info()
399 bt_link_info->sco_only = true; in halbtc8723b1ant_update_bt_link_info()
401 bt_link_info->sco_only = false; in halbtc8723b1ant_update_bt_link_info()
404 if (!bt_link_info->sco_exist && bt_link_info->a2dp_exist && in halbtc8723b1ant_update_bt_link_info()
405 !bt_link_info->pan_exist && !bt_link_info->hid_exist) in halbtc8723b1ant_update_bt_link_info()
406 bt_link_info->a2dp_only = true; in halbtc8723b1ant_update_bt_link_info()
408 bt_link_info->a2dp_only = false; in halbtc8723b1ant_update_bt_link_info()
411 if (!bt_link_info->sco_exist && !bt_link_info->a2dp_exist && in halbtc8723b1ant_update_bt_link_info()
412 bt_link_info->pan_exist && !bt_link_info->hid_exist) in halbtc8723b1ant_update_bt_link_info()
413 bt_link_info->pan_only = true; in halbtc8723b1ant_update_bt_link_info()
415 bt_link_info->pan_only = false; in halbtc8723b1ant_update_bt_link_info()
418 if (!bt_link_info->sco_exist && !bt_link_info->a2dp_exist && in halbtc8723b1ant_update_bt_link_info()
419 !bt_link_info->pan_exist && bt_link_info->hid_exist) in halbtc8723b1ant_update_bt_link_info()
420 bt_link_info->hid_only = true; in halbtc8723b1ant_update_bt_link_info()
422 bt_link_info->hid_only = false; in halbtc8723b1ant_update_bt_link_info()
435 btcoexist->btc_fill_h2c(btcoexist, 0x68, 1, h2c_parameter); in halbtc8723b1ant_set_bt_auto_report()
442 coex_dm->cur_bt_auto_report = enable_auto_report; in halbtc8723b1ant_bt_auto_report()
445 if (coex_dm->pre_bt_auto_report == coex_dm->cur_bt_auto_report) in halbtc8723b1ant_bt_auto_report()
449 coex_dm->cur_bt_auto_report); in halbtc8723b1ant_bt_auto_report()
451 coex_dm->pre_bt_auto_report = coex_dm->cur_bt_auto_report; in halbtc8723b1ant_bt_auto_report()
457 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8723b1ant_set_sw_pen_tx_rate_adapt()
472 "[BTCoex], set WiFi Low-Penalty Retry: %s", in btc8723b1ant_set_sw_pen_tx_rate_adapt()
475 btcoexist->btc_fill_h2c(btcoexist, 0x69, 6, h2c_parameter); in btc8723b1ant_set_sw_pen_tx_rate_adapt()
481 coex_dm->cur_low_penalty_ra = low_penalty_ra; in halbtc8723b1ant_low_penalty_ra()
484 if (coex_dm->pre_low_penalty_ra == coex_dm->cur_low_penalty_ra) in halbtc8723b1ant_low_penalty_ra()
488 coex_dm->cur_low_penalty_ra); in halbtc8723b1ant_low_penalty_ra()
490 coex_dm->pre_low_penalty_ra = coex_dm->cur_low_penalty_ra; in halbtc8723b1ant_low_penalty_ra()
497 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_set_coex_table()
501 btcoexist->btc_write_4byte(btcoexist, 0x6c0, val0x6c0); in halbtc8723b1ant_set_coex_table()
505 btcoexist->btc_write_4byte(btcoexist, 0x6c4, val0x6c4); in halbtc8723b1ant_set_coex_table()
509 btcoexist->btc_write_4byte(btcoexist, 0x6c8, val0x6c8); in halbtc8723b1ant_set_coex_table()
513 btcoexist->btc_write_1byte(btcoexist, 0x6cc, val0x6cc); in halbtc8723b1ant_set_coex_table()
521 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_coex_table()
527 coex_dm->cur_val0x6c0 = val0x6c0; in halbtc8723b1ant_coex_table()
528 coex_dm->cur_val0x6c4 = val0x6c4; in halbtc8723b1ant_coex_table()
529 coex_dm->cur_val0x6c8 = val0x6c8; in halbtc8723b1ant_coex_table()
530 coex_dm->cur_val0x6cc = val0x6cc; in halbtc8723b1ant_coex_table()
533 if ((coex_dm->pre_val0x6c0 == coex_dm->cur_val0x6c0) && in halbtc8723b1ant_coex_table()
534 (coex_dm->pre_val0x6c4 == coex_dm->cur_val0x6c4) && in halbtc8723b1ant_coex_table()
535 (coex_dm->pre_val0x6c8 == coex_dm->cur_val0x6c8) && in halbtc8723b1ant_coex_table()
536 (coex_dm->pre_val0x6cc == coex_dm->cur_val0x6cc)) in halbtc8723b1ant_coex_table()
542 coex_dm->pre_val0x6c0 = coex_dm->cur_val0x6c0; in halbtc8723b1ant_coex_table()
543 coex_dm->pre_val0x6c4 = coex_dm->cur_val0x6c4; in halbtc8723b1ant_coex_table()
544 coex_dm->pre_val0x6c8 = coex_dm->cur_val0x6c8; in halbtc8723b1ant_coex_table()
545 coex_dm->pre_val0x6cc = coex_dm->cur_val0x6cc; in halbtc8723b1ant_coex_table()
551 coex_sta->coex_table_type = type; in halbtc8723b1ant_coex_table_with_type()
571 if ((coex_sta->cck_ever_lock) && (coex_sta->scan_ap_num <= 5)) in halbtc8723b1ant_coex_table_with_type()
633 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_set_fw_ignore_wlan_act()
643 btcoexist->btc_fill_h2c(btcoexist, 0x63, 1, h2c_parameter); in halbtc8723b1ant_set_fw_ignore_wlan_act()
649 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_ignore_wlan_act()
654 coex_dm->cur_ignore_wlan_act = enable; in halbtc8723b1ant_ignore_wlan_act()
659 coex_dm->pre_ignore_wlan_act, in halbtc8723b1ant_ignore_wlan_act()
660 coex_dm->cur_ignore_wlan_act); in halbtc8723b1ant_ignore_wlan_act()
662 if (coex_dm->pre_ignore_wlan_act == in halbtc8723b1ant_ignore_wlan_act()
663 coex_dm->cur_ignore_wlan_act) in halbtc8723b1ant_ignore_wlan_act()
668 coex_dm->pre_ignore_wlan_act = coex_dm->cur_ignore_wlan_act; in halbtc8723b1ant_ignore_wlan_act()
675 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_set_fw_ps_tdma()
680 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, in halbtc8723b1ant_set_fw_ps_tdma()
701 coex_dm->ps_tdma_para[0] = real_byte1; in halbtc8723b1ant_set_fw_ps_tdma()
702 coex_dm->ps_tdma_para[1] = byte2; in halbtc8723b1ant_set_fw_ps_tdma()
703 coex_dm->ps_tdma_para[2] = byte3; in halbtc8723b1ant_set_fw_ps_tdma()
704 coex_dm->ps_tdma_para[3] = byte4; in halbtc8723b1ant_set_fw_ps_tdma()
705 coex_dm->ps_tdma_para[4] = real_byte5; in halbtc8723b1ant_set_fw_ps_tdma()
708 "[BTCoex], PS-TDMA H2C cmd =0x%x%08x\n", in halbtc8723b1ant_set_fw_ps_tdma()
715 btcoexist->btc_fill_h2c(btcoexist, 0x60, 5, h2c_parameter); in halbtc8723b1ant_set_fw_ps_tdma()
724 btcoexist->btc_set(btcoexist, BTC_SET_U1_LPS_VAL, &lps); in halbtc8723b1ant_set_lps_rpwm()
725 btcoexist->btc_set(btcoexist, BTC_SET_U1_RPWM_VAL, &rpwm); in halbtc8723b1ant_set_lps_rpwm()
732 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_lps_rpwm()
737 coex_dm->cur_lps = lps_val; in halbtc8723b1ant_lps_rpwm()
738 coex_dm->cur_rpwm = rpwm_val; in halbtc8723b1ant_lps_rpwm()
742 "[BTCoex], LPS-RxBeaconMode = 0x%x , LPS-RPWM = 0x%x!!\n", in halbtc8723b1ant_lps_rpwm()
743 coex_dm->cur_lps, coex_dm->cur_rpwm); in halbtc8723b1ant_lps_rpwm()
745 if ((coex_dm->pre_lps == coex_dm->cur_lps) && in halbtc8723b1ant_lps_rpwm()
746 (coex_dm->pre_rpwm == coex_dm->cur_rpwm)) { in halbtc8723b1ant_lps_rpwm()
748 "[BTCoex], LPS-RPWM_Last = 0x%x , LPS-RPWM_Now = 0x%x!!\n", in halbtc8723b1ant_lps_rpwm()
749 coex_dm->pre_rpwm, coex_dm->cur_rpwm); in halbtc8723b1ant_lps_rpwm()
756 coex_dm->pre_lps = coex_dm->cur_lps; in halbtc8723b1ant_lps_rpwm()
757 coex_dm->pre_rpwm = coex_dm->cur_rpwm; in halbtc8723b1ant_lps_rpwm()
763 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_sw_mechanism()
775 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_set_ant_path()
776 struct btc_board_info *board_info = &btcoexist->board_info; in halbtc8723b1ant_set_ant_path()
783 coex_dm->cur_ant_pos_type = ant_pos_type; in halbtc8723b1ant_set_ant_path()
785 btcoexist->btc_get(btcoexist, BTC_GET_BL_EXT_SWITCH, &pg_ext_switch); in halbtc8723b1ant_set_ant_path()
787 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver); in halbtc8723b1ant_set_ant_path()
794 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, in halbtc8723b1ant_set_ant_path()
803 btcoexist->btc_fill_h2c(btcoexist, 0x6E, 1, in halbtc8723b1ant_set_ant_path()
807 btcoexist->btc_write_1byte(btcoexist, 0x765, 0x18); in halbtc8723b1ant_set_ant_path()
810 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0x4); in halbtc8723b1ant_set_ant_path()
813 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x67, 0x20, 0x0); in halbtc8723b1ant_set_ant_path()
814 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x39, 0x8, 0x1); in halbtc8723b1ant_set_ant_path()
815 btcoexist->btc_write_1byte(btcoexist, 0x974, 0xff); in halbtc8723b1ant_set_ant_path()
816 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x944, 0x3, 0x3); in halbtc8723b1ant_set_ant_path()
817 btcoexist->btc_write_1byte(btcoexist, 0x930, 0x77); in halbtc8723b1ant_set_ant_path()
822 btcoexist->btc_fill_h2c(btcoexist, 0x6E, 1, in halbtc8723b1ant_set_ant_path()
826 btcoexist->btc_write_1byte(btcoexist, 0x765, 0x18); in halbtc8723b1ant_set_ant_path()
829 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0x4); in halbtc8723b1ant_set_ant_path()
831 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, in halbtc8723b1ant_set_ant_path()
835 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x67, in halbtc8723b1ant_set_ant_path()
839 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x67, in halbtc8723b1ant_set_ant_path()
845 u32tmp = btcoexist->btc_read_4byte(btcoexist, 0x4c); in halbtc8723b1ant_set_ant_path()
848 btcoexist->btc_write_4byte(btcoexist, 0x4c, u32tmp); in halbtc8723b1ant_set_ant_path()
852 if (btcoexist->btc_read_1byte(btcoexist, 0x765) != 0) { in halbtc8723b1ant_set_ant_path()
854 btcoexist->btc_fill_h2c(btcoexist, 0x6E, 1, in halbtc8723b1ant_set_ant_path()
860 u8tmp = btcoexist->btc_read_1byte(btcoexist, in halbtc8723b1ant_set_ant_path()
879 btcoexist->btc_write_1byte(btcoexist, 0x765, 0x0); in halbtc8723b1ant_set_ant_path()
882 if (btcoexist->btc_read_1byte(btcoexist, 0x76e) != 0xc) { in halbtc8723b1ant_set_ant_path()
884 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0xc); in halbtc8723b1ant_set_ant_path()
887 btcoexist->btc_write_1byte_bitmask( in halbtc8723b1ant_set_ant_path()
897 u32tmp = btcoexist->btc_read_4byte(btcoexist, 0x4c); in halbtc8723b1ant_set_ant_path()
900 btcoexist->btc_write_4byte(btcoexist, 0x4c, u32tmp); in halbtc8723b1ant_set_ant_path()
902 /* fixed internal switch S1->WiFi, S0->BT */ in halbtc8723b1ant_set_ant_path()
903 btcoexist->btc_write_4byte(btcoexist, 0x948, 0x0); in halbtc8723b1ant_set_ant_path()
905 if (board_info->btdm_ant_pos == in halbtc8723b1ant_set_ant_path()
911 btcoexist->btc_fill_h2c(btcoexist, 0x65, 2, in halbtc8723b1ant_set_ant_path()
918 btcoexist->btc_fill_h2c(btcoexist, 0x65, 2, in halbtc8723b1ant_set_ant_path()
924 (coex_dm->cur_ant_pos_type != coex_dm->pre_ant_pos_type)) { in halbtc8723b1ant_set_ant_path()
928 if (board_info->btdm_ant_pos == in halbtc8723b1ant_set_ant_path()
930 btcoexist->btc_write_1byte_bitmask( in halbtc8723b1ant_set_ant_path()
933 btcoexist->btc_write_1byte_bitmask( in halbtc8723b1ant_set_ant_path()
937 if (board_info->btdm_ant_pos == in halbtc8723b1ant_set_ant_path()
939 btcoexist->btc_write_1byte_bitmask( in halbtc8723b1ant_set_ant_path()
942 btcoexist->btc_write_1byte_bitmask( in halbtc8723b1ant_set_ant_path()
947 if (board_info->btdm_ant_pos == in halbtc8723b1ant_set_ant_path()
949 btcoexist->btc_write_1byte_bitmask( in halbtc8723b1ant_set_ant_path()
952 btcoexist->btc_write_1byte_bitmask( in halbtc8723b1ant_set_ant_path()
962 u32tmp = btcoexist->btc_read_4byte(btcoexist, 0x4c); in halbtc8723b1ant_set_ant_path()
965 btcoexist->btc_write_4byte(btcoexist, 0x4c, u32tmp); in halbtc8723b1ant_set_ant_path()
967 /* Fix Ext switch Main->S1, Aux->S0 */ in halbtc8723b1ant_set_ant_path()
968 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x64, 0x1, in halbtc8723b1ant_set_ant_path()
971 if (board_info->btdm_ant_pos == in halbtc8723b1ant_set_ant_path()
977 btcoexist->btc_fill_h2c(btcoexist, 0x65, 2, in halbtc8723b1ant_set_ant_path()
984 btcoexist->btc_fill_h2c(btcoexist, 0x65, 2, in halbtc8723b1ant_set_ant_path()
990 (coex_dm->cur_ant_pos_type != coex_dm->pre_ant_pos_type)) { in halbtc8723b1ant_set_ant_path()
994 if (board_info->btdm_ant_pos == in halbtc8723b1ant_set_ant_path()
996 btcoexist->btc_write_4byte(btcoexist, in halbtc8723b1ant_set_ant_path()
999 btcoexist->btc_write_4byte(btcoexist, in halbtc8723b1ant_set_ant_path()
1003 if (board_info->btdm_ant_pos == in halbtc8723b1ant_set_ant_path()
1005 btcoexist->btc_write_4byte(btcoexist, in halbtc8723b1ant_set_ant_path()
1008 btcoexist->btc_write_4byte(btcoexist, in halbtc8723b1ant_set_ant_path()
1013 if (board_info->btdm_ant_pos == in halbtc8723b1ant_set_ant_path()
1015 btcoexist->btc_write_4byte(btcoexist, in halbtc8723b1ant_set_ant_path()
1018 btcoexist->btc_write_4byte(btcoexist, in halbtc8723b1ant_set_ant_path()
1025 coex_dm->pre_ant_pos_type = coex_dm->cur_ant_pos_type; in halbtc8723b1ant_set_ant_path()
1031 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in halbtc8723b1ant_ps_tdma()
1040 coex_dm->cur_ps_tdma_on = turn_on; in halbtc8723b1ant_ps_tdma()
1041 coex_dm->cur_ps_tdma = type; in halbtc8723b1ant_ps_tdma()
1043 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in halbtc8723b1ant_ps_tdma()
1051 if ((coex_dm->pre_ps_tdma_on == coex_dm->cur_ps_tdma_on) && in halbtc8723b1ant_ps_tdma()
1052 (coex_dm->pre_ps_tdma == coex_dm->cur_ps_tdma)) in halbtc8723b1ant_ps_tdma()
1056 if (coex_sta->scan_ap_num <= 5) { in halbtc8723b1ant_ps_tdma()
1059 if (coex_sta->a2dp_bit_pool >= 35) in halbtc8723b1ant_ps_tdma()
1060 wifi_duration_adjust = -10; in halbtc8723b1ant_ps_tdma()
1061 else if (coex_sta->a2dp_bit_pool >= 45) in halbtc8723b1ant_ps_tdma()
1062 wifi_duration_adjust = -15; in halbtc8723b1ant_ps_tdma()
1063 } else if (coex_sta->scan_ap_num >= 40) { in halbtc8723b1ant_ps_tdma()
1064 wifi_duration_adjust = -15; in halbtc8723b1ant_ps_tdma()
1066 if (coex_sta->a2dp_bit_pool < 35) in halbtc8723b1ant_ps_tdma()
1067 wifi_duration_adjust = -5; in halbtc8723b1ant_ps_tdma()
1068 else if (coex_sta->a2dp_bit_pool < 45) in halbtc8723b1ant_ps_tdma()
1069 wifi_duration_adjust = -10; in halbtc8723b1ant_ps_tdma()
1070 } else if (coex_sta->scan_ap_num >= 20) { in halbtc8723b1ant_ps_tdma()
1071 wifi_duration_adjust = -10; in halbtc8723b1ant_ps_tdma()
1073 if (coex_sta->a2dp_bit_pool >= 45) in halbtc8723b1ant_ps_tdma()
1074 wifi_duration_adjust = -15; in halbtc8723b1ant_ps_tdma()
1078 if (coex_sta->a2dp_bit_pool >= 35) in halbtc8723b1ant_ps_tdma()
1079 wifi_duration_adjust = -10; in halbtc8723b1ant_ps_tdma()
1080 else if (coex_sta->a2dp_bit_pool >= 45) in halbtc8723b1ant_ps_tdma()
1081 wifi_duration_adjust = -15; in halbtc8723b1ant_ps_tdma()
1086 if (!coex_sta->force_lps_on) { in halbtc8723b1ant_ps_tdma()
1087 /* Native power save TDMA, only for A2DP-only case in halbtc8723b1ant_ps_tdma()
1091 /* no null-pkt */ in halbtc8723b1ant_ps_tdma()
1093 /* no tx-pause at BT-slot */ in halbtc8723b1ant_ps_tdma()
1098 /* null-pkt */ in halbtc8723b1ant_ps_tdma()
1100 /* tx-pause at BT-slot */ in halbtc8723b1ant_ps_tdma()
1107 /* null-pkt */ in halbtc8723b1ant_ps_tdma()
1109 /* tx-pause at BT-slot */ in halbtc8723b1ant_ps_tdma()
1114 /* no null-pkt */ in halbtc8723b1ant_ps_tdma()
1116 /* no tx-pause at BT-slot */ in halbtc8723b1ant_ps_tdma()
1123 /* if (bt_link_info->slave_role) */ in halbtc8723b1ant_ps_tdma()
1124 if ((bt_link_info->slave_role) && (bt_link_info->a2dp_exist)) in halbtc8723b1ant_ps_tdma()
1125 /* 0x778 = 0x1 at wifi slot (no blocking BT Low-Pri pkts) */ in halbtc8723b1ant_ps_tdma()
1202 if (coex_sta->scan_ap_num <= 3) in halbtc8723b1ant_ps_tdma()
1212 if (coex_sta->scan_ap_num <= 3) in halbtc8723b1ant_ps_tdma()
1308 * here softap mode screen off will cost 70-80mA for in halbtc8723b1ant_ps_tdma()
1316 /* for 1-Ant translate to 2-Ant */ in halbtc8723b1ant_ps_tdma()
1378 case 133: in halbtc8723b1ant_ps_tdma()
1401 case 1: /* 2-Ant, 0x778=3, antenna control by ant diversity */ in halbtc8723b1ant_ps_tdma()
1408 btcoexist->btc_set(btcoexist, in halbtc8723b1ant_ps_tdma()
1413 coex_dm->pre_ps_tdma_on = coex_dm->cur_ps_tdma_on; in halbtc8723b1ant_ps_tdma()
1414 coex_dm->pre_ps_tdma = coex_dm->cur_ps_tdma; in halbtc8723b1ant_ps_tdma()
1421 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8723b1ant_tdma_dur_adj_for_acl()
1422 static s32 up, dn, m, n, wait_count; in btc8723b1ant_tdma_dur_adj_for_acl() local
1424 * -1: decrease WiFi duration in btc8723b1ant_tdma_dur_adj_for_acl()
1436 if (coex_dm->cur_ps_tdma != 1 && coex_dm->cur_ps_tdma != 2 && in btc8723b1ant_tdma_dur_adj_for_acl()
1437 coex_dm->cur_ps_tdma != 3 && coex_dm->cur_ps_tdma != 9) { in btc8723b1ant_tdma_dur_adj_for_acl()
1440 coex_dm->ps_tdma_du_adj_type = 9; in btc8723b1ant_tdma_dur_adj_for_acl()
1444 m = 1; in btc8723b1ant_tdma_dur_adj_for_acl()
1452 if (!coex_dm->auto_tdma_adjust) { in btc8723b1ant_tdma_dur_adj_for_acl()
1453 coex_dm->auto_tdma_adjust = true; in btc8723b1ant_tdma_dur_adj_for_acl()
1458 coex_dm->ps_tdma_du_adj_type = 2; in btc8723b1ant_tdma_dur_adj_for_acl()
1462 m = 1; in btc8723b1ant_tdma_dur_adj_for_acl()
1468 retry_count = coex_sta->bt_retry_cnt; in btc8723b1ant_tdma_dur_adj_for_acl()
1470 if ((coex_sta->low_priority_tx) > 1050 || in btc8723b1ant_tdma_dur_adj_for_acl()
1471 (coex_sta->low_priority_rx) > 1250) in btc8723b1ant_tdma_dur_adj_for_acl()
1476 /* no retry in the last 2-second duration */ in btc8723b1ant_tdma_dur_adj_for_acl()
1479 dn--; in btc8723b1ant_tdma_dur_adj_for_acl()
1497 /* <=3 retry in the last 2-second duration */ in btc8723b1ant_tdma_dur_adj_for_acl()
1498 up--; in btc8723b1ant_tdma_dur_adj_for_acl()
1510 m++; in btc8723b1ant_tdma_dur_adj_for_acl()
1512 m = 1; in btc8723b1ant_tdma_dur_adj_for_acl()
1514 if (m >= 20) in btc8723b1ant_tdma_dur_adj_for_acl()
1515 /* maximum of m = 20 ' will recheck if in btc8723b1ant_tdma_dur_adj_for_acl()
1519 m = 20; in btc8723b1ant_tdma_dur_adj_for_acl()
1521 n = 3 * m; in btc8723b1ant_tdma_dur_adj_for_acl()
1525 result = -1; in btc8723b1ant_tdma_dur_adj_for_acl()
1535 m++; in btc8723b1ant_tdma_dur_adj_for_acl()
1537 m = 1; in btc8723b1ant_tdma_dur_adj_for_acl()
1539 if (m >= 20) in btc8723b1ant_tdma_dur_adj_for_acl()
1540 /* maximum of m = 20 ' will recheck if need to in btc8723b1ant_tdma_dur_adj_for_acl()
1544 m = 20; in btc8723b1ant_tdma_dur_adj_for_acl()
1546 n = 3 * m; in btc8723b1ant_tdma_dur_adj_for_acl()
1550 result = -1; in btc8723b1ant_tdma_dur_adj_for_acl()
1555 if (result == -1) { in btc8723b1ant_tdma_dur_adj_for_acl()
1556 if (coex_dm->cur_ps_tdma == 1) { in btc8723b1ant_tdma_dur_adj_for_acl()
1559 coex_dm->ps_tdma_du_adj_type = 2; in btc8723b1ant_tdma_dur_adj_for_acl()
1560 } else if (coex_dm->cur_ps_tdma == 2) { in btc8723b1ant_tdma_dur_adj_for_acl()
1563 coex_dm->ps_tdma_du_adj_type = 9; in btc8723b1ant_tdma_dur_adj_for_acl()
1564 } else if (coex_dm->cur_ps_tdma == 9) { in btc8723b1ant_tdma_dur_adj_for_acl()
1567 coex_dm->ps_tdma_du_adj_type = 11; in btc8723b1ant_tdma_dur_adj_for_acl()
1570 if (coex_dm->cur_ps_tdma == 11) { in btc8723b1ant_tdma_dur_adj_for_acl()
1573 coex_dm->ps_tdma_du_adj_type = 9; in btc8723b1ant_tdma_dur_adj_for_acl()
1574 } else if (coex_dm->cur_ps_tdma == 9) { in btc8723b1ant_tdma_dur_adj_for_acl()
1577 coex_dm->ps_tdma_du_adj_type = 2; in btc8723b1ant_tdma_dur_adj_for_acl()
1578 } else if (coex_dm->cur_ps_tdma == 2) { in btc8723b1ant_tdma_dur_adj_for_acl()
1581 coex_dm->ps_tdma_du_adj_type = 1; in btc8723b1ant_tdma_dur_adj_for_acl()
1585 if (coex_dm->cur_ps_tdma != 1 && coex_dm->cur_ps_tdma != 2 && in btc8723b1ant_tdma_dur_adj_for_acl()
1586 coex_dm->cur_ps_tdma != 9 && coex_dm->cur_ps_tdma != 11) { in btc8723b1ant_tdma_dur_adj_for_acl()
1589 coex_dm->ps_tdma_du_adj_type); in btc8723b1ant_tdma_dur_adj_for_acl()
1599 btcoexist->btc_get(btcoexist, BTC_GET_U1_LPS_MODE, &lps_mode); in halbtc8723b1ant_ps_tdma_chk_pwr_save()
1632 btcoexist->btc_set(btcoexist, BTC_SET_ACT_DISABLE_LOW_POWER, in halbtc8723b1ant_power_save_state()
1634 btcoexist->btc_set(btcoexist, BTC_SET_ACT_NORMAL_LPS, NULL); in halbtc8723b1ant_power_save_state()
1635 coex_sta->force_lps_on = false; in halbtc8723b1ant_power_save_state()
1643 btcoexist->btc_set(btcoexist, BTC_SET_ACT_DISABLE_LOW_POWER, in halbtc8723b1ant_power_save_state()
1646 btcoexist->btc_set(btcoexist, BTC_SET_ACT_ENTER_LPS, NULL); in halbtc8723b1ant_power_save_state()
1647 coex_sta->force_lps_on = true; in halbtc8723b1ant_power_save_state()
1651 btcoexist->btc_set(btcoexist, BTC_SET_ACT_LEAVE_LPS, NULL); in halbtc8723b1ant_power_save_state()
1652 coex_sta->force_lps_on = false; in halbtc8723b1ant_power_save_state()
1671 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_monitor_bt_enable_disable()
1675 if (coex_sta->high_priority_tx == 0 && in halbtc8723b1ant_monitor_bt_enable_disable()
1676 coex_sta->high_priority_rx == 0 && coex_sta->low_priority_tx == 0 && in halbtc8723b1ant_monitor_bt_enable_disable()
1677 coex_sta->low_priority_rx == 0) in halbtc8723b1ant_monitor_bt_enable_disable()
1679 if (coex_sta->high_priority_tx == 0xffff && in halbtc8723b1ant_monitor_bt_enable_disable()
1680 coex_sta->high_priority_rx == 0xffff && in halbtc8723b1ant_monitor_bt_enable_disable()
1681 coex_sta->low_priority_tx == 0xffff && in halbtc8723b1ant_monitor_bt_enable_disable()
1682 coex_sta->low_priority_rx == 0xffff) in halbtc8723b1ant_monitor_bt_enable_disable()
1692 if (coex_sta->bt_disabled != bt_disabled) { in halbtc8723b1ant_monitor_bt_enable_disable()
1695 (coex_sta->bt_disabled ? "disabled" : "enabled"), in halbtc8723b1ant_monitor_bt_enable_disable()
1698 coex_sta->bt_disabled = bt_disabled; in halbtc8723b1ant_monitor_bt_enable_disable()
1699 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_DISABLE, in halbtc8723b1ant_monitor_bt_enable_disable()
1703 btcoexist->btc_set(btcoexist, BTC_SET_ACT_LEAVE_LPS, in halbtc8723b1ant_monitor_bt_enable_disable()
1705 btcoexist->btc_set(btcoexist, BTC_SET_ACT_NORMAL_LPS, in halbtc8723b1ant_monitor_bt_enable_disable()
1713 * Non-Software Coex Mechanism start
1747 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in halbtc8723b1ant_action_bt_inquiry()
1751 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, in halbtc8723b1ant_action_bt_inquiry()
1753 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED, in halbtc8723b1ant_action_bt_inquiry()
1755 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in halbtc8723b1ant_action_bt_inquiry()
1756 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bt_busy); in halbtc8723b1ant_action_bt_inquiry()
1758 if (coex_sta->bt_abnormal_scan) { in halbtc8723b1ant_action_bt_inquiry()
1761 } else if (!wifi_connected && !coex_sta->wifi_is_high_pri_task) { in halbtc8723b1ant_action_bt_inquiry()
1768 } else if (bt_link_info->sco_exist || bt_link_info->hid_exist || in halbtc8723b1ant_action_bt_inquiry()
1769 bt_link_info->a2dp_exist) { in halbtc8723b1ant_action_bt_inquiry()
1773 if (coex_sta->c2h_bt_remote_name_req) in halbtc8723b1ant_action_bt_inquiry()
1781 } else if (bt_link_info->pan_exist || wifi_busy) { in halbtc8723b1ant_action_bt_inquiry()
1784 if (coex_sta->c2h_bt_remote_name_req) in halbtc8723b1ant_action_bt_inquiry()
1805 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in btc8723b1ant_act_bt_sco_hid_only_busy()
1808 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED, in btc8723b1ant_act_bt_sco_hid_only_busy()
1812 if (bt_link_info->sco_exist) { in btc8723b1ant_act_bt_sco_hid_only_busy()
1826 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1828 if ((coex_sta->low_priority_rx >= 950) && (!coex_sta->under_ips)) in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1829 bt_link_info->slave_role = true; in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1831 bt_link_info->slave_role = false; in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1833 if (bt_link_info->hid_only) { /* HID */ in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1835 coex_dm->auto_tdma_adjust = false; in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1837 } else if (bt_link_info->a2dp_only) { /* A2DP */ in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1843 coex_dm->auto_tdma_adjust = false; in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1849 coex_dm->auto_tdma_adjust = true; in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1851 } else if (((bt_link_info->a2dp_exist) && (bt_link_info->pan_exist)) || in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1852 (bt_link_info->hid_exist && bt_link_info->a2dp_exist && in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1853 bt_link_info->pan_exist)) { in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1854 /* A2DP + PAN(OPP,FTP), HID + A2DP + PAN(OPP,FTP) */ in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1857 coex_dm->auto_tdma_adjust = false; in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1858 } else if (bt_link_info->hid_exist && bt_link_info->a2dp_exist) { in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1861 coex_dm->auto_tdma_adjust = false; in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1864 } else if (bt_link_info->pan_only || in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1865 (bt_link_info->hid_exist && bt_link_info->pan_exist)) { in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1866 /* PAN(OPP,FTP), HID + PAN(OPP,FTP) */ in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1869 coex_dm->auto_tdma_adjust = false; in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1871 /* BT no-profile busy (0x9) */ in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1874 coex_dm->auto_tdma_adjust = false; in halbtc8723b1ant_action_wifi_connected_bt_acl_busy()
1894 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in btc8723b1ant_action_wifi_not_conn_scan()
1900 if (coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { in btc8723b1ant_action_wifi_not_conn_scan()
1901 if (bt_link_info->a2dp_exist) { in btc8723b1ant_action_wifi_not_conn_scan()
1906 } else if (bt_link_info->a2dp_exist) { in btc8723b1ant_action_wifi_not_conn_scan()
1917 } else if (coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_SCO_BUSY || in btc8723b1ant_action_wifi_not_conn_scan()
1918 coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY){ in btc8723b1ant_action_wifi_not_conn_scan()
1932 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in btc8723b1ant_act_wifi_not_conn_asso_auth()
1938 if ((bt_link_info->sco_exist) || (bt_link_info->hid_exist) || in btc8723b1ant_act_wifi_not_conn_asso_auth()
1939 (bt_link_info->a2dp_exist)) { in btc8723b1ant_act_wifi_not_conn_asso_auth()
1942 } else if (bt_link_info->pan_exist) { in btc8723b1ant_act_wifi_not_conn_asso_auth()
1955 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in btc8723b1ant_action_wifi_conn_scan()
1961 if (coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { in btc8723b1ant_action_wifi_conn_scan()
1962 if (bt_link_info->a2dp_exist) { in btc8723b1ant_action_wifi_conn_scan()
1967 } else if (bt_link_info->a2dp_exist && in btc8723b1ant_action_wifi_conn_scan()
1968 bt_link_info->pan_exist) { in btc8723b1ant_action_wifi_conn_scan()
1979 } else if (coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_SCO_BUSY || in btc8723b1ant_action_wifi_conn_scan()
1980 coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) { in btc8723b1ant_action_wifi_conn_scan()
1994 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in halbtc8723b1ant_action_wifi_connected_special_packet()
1997 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in halbtc8723b1ant_action_wifi_connected_special_packet()
2001 ((bt_link_info->pan_exist) || (coex_sta->num_of_profile >= 2))) in halbtc8723b1ant_action_wifi_connected_special_packet()
2008 if ((bt_link_info->sco_exist) || (bt_link_info->hid_exist)) { in halbtc8723b1ant_action_wifi_connected_special_packet()
2011 } else if (bt_link_info->a2dp_exist) { in halbtc8723b1ant_action_wifi_connected_special_packet()
2014 } else if (bt_link_info->pan_exist) { in halbtc8723b1ant_action_wifi_connected_special_packet()
2027 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_action_wifi_connected()
2035 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, in halbtc8723b1ant_action_wifi_connected()
2044 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan); in halbtc8723b1ant_action_wifi_connected()
2045 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link); in halbtc8723b1ant_action_wifi_connected()
2046 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam); in halbtc8723b1ant_action_wifi_connected()
2059 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, in halbtc8723b1ant_action_wifi_connected()
2061 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in halbtc8723b1ant_action_wifi_connected()
2064 coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_BUSY && in halbtc8723b1ant_action_wifi_connected()
2065 !btcoexist->bt_link_info.hid_only) { in halbtc8723b1ant_action_wifi_connected()
2066 if (btcoexist->bt_link_info.a2dp_only) { in halbtc8723b1ant_action_wifi_connected()
2072 if (coex_sta->scan_ap_num >= in halbtc8723b1ant_action_wifi_connected()
2074 /* no force LPS, no PS-TDMA, in halbtc8723b1ant_action_wifi_connected()
2085 } else if ((!coex_sta->pan_exist) && (!coex_sta->a2dp_exist) && in halbtc8723b1ant_action_wifi_connected()
2086 (!coex_sta->hid_exist)) in halbtc8723b1ant_action_wifi_connected()
2099 if (coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { in halbtc8723b1ant_action_wifi_connected()
2103 } else if (coex_dm->bt_status == in halbtc8723b1ant_action_wifi_connected()
2105 coex_dm->bt_status == in halbtc8723b1ant_action_wifi_connected()
2119 if (coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { in halbtc8723b1ant_action_wifi_connected()
2123 } else if (coex_dm->bt_status == in halbtc8723b1ant_action_wifi_connected()
2125 coex_dm->bt_status == in halbtc8723b1ant_action_wifi_connected()
2143 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_run_coexist_mechanism()
2144 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in halbtc8723b1ant_run_coexist_mechanism()
2158 if (btcoexist->manual_control) { in halbtc8723b1ant_run_coexist_mechanism()
2164 if (btcoexist->stop_coex_dm) { in halbtc8723b1ant_run_coexist_mechanism()
2170 if (coex_sta->under_ips) { in halbtc8723b1ant_run_coexist_mechanism()
2176 if (coex_sta->bt_whck_test) { in halbtc8723b1ant_run_coexist_mechanism()
2183 if (coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_BUSY || in halbtc8723b1ant_run_coexist_mechanism()
2184 coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_SCO_BUSY || in halbtc8723b1ant_run_coexist_mechanism()
2185 coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) in halbtc8723b1ant_run_coexist_mechanism()
2188 btcoexist->btc_set(btcoexist, BTC_SET_BL_INC_SCAN_DEV_NUM, in halbtc8723b1ant_run_coexist_mechanism()
2190 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED, in halbtc8723b1ant_run_coexist_mechanism()
2192 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in halbtc8723b1ant_run_coexist_mechanism()
2194 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_LINK_STATUS, in halbtc8723b1ant_run_coexist_mechanism()
2200 if (bt_link_info->bt_link_exist) { in halbtc8723b1ant_run_coexist_mechanism()
2209 btcoexist->btc_set(btcoexist, BTC_SET_BL_MIRACAST_PLUS_BT, in halbtc8723b1ant_run_coexist_mechanism()
2214 if ((bt_link_info->a2dp_exist || wifi_busy) && in halbtc8723b1ant_run_coexist_mechanism()
2215 (coex_sta->c2h_bt_inquiry_page)) in halbtc8723b1ant_run_coexist_mechanism()
2224 btcoexist->btc_set(btcoexist, BTC_SET_BL_MIRACAST_PLUS_BT, in halbtc8723b1ant_run_coexist_mechanism()
2226 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in halbtc8723b1ant_run_coexist_mechanism()
2228 if (bt_link_info->bt_link_exist && wifi_connected) { in halbtc8723b1ant_run_coexist_mechanism()
2231 btcoexist->btc_get(btcoexist, BTC_GET_U1_IOT_PEER, &iot_peer); in halbtc8723b1ant_run_coexist_mechanism()
2235 bool sco_exist = bt_link_info->sco_exist; in halbtc8723b1ant_run_coexist_mechanism()
2241 if (bt_link_info->sco_exist) { in halbtc8723b1ant_run_coexist_mechanism()
2266 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in halbtc8723b1ant_run_coexist_mechanism()
2268 if (coex_sta->c2h_bt_inquiry_page) { in halbtc8723b1ant_run_coexist_mechanism()
2280 "[BTCoex], wifi is non connected-idle !!!\n"); in halbtc8723b1ant_run_coexist_mechanism()
2282 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan); in halbtc8723b1ant_run_coexist_mechanism()
2283 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link); in halbtc8723b1ant_run_coexist_mechanism()
2284 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam); in halbtc8723b1ant_run_coexist_mechanism()
2307 coex_sta->pop_event_cnt = 0; in halbtc8723b1ant_init_coex_dm()
2313 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc8723b1ant_init_hw_config()
2320 /* 0xf0[15:12] --> Chip Cut information */ in halbtc8723b1ant_init_hw_config()
2321 coex_sta->cut_version = in halbtc8723b1ant_init_hw_config()
2322 (btcoexist->btc_read_1byte(btcoexist, 0xf1) & 0xf0) >> 4; in halbtc8723b1ant_init_hw_config()
2324 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x550, 0x8, 0x1); in halbtc8723b1ant_init_hw_config()
2327 btcoexist->btc_write_1byte(btcoexist, 0x790, 0x5); in halbtc8723b1ant_init_hw_config()
2330 btcoexist->btc_write_1byte(btcoexist, 0x778, 0x1); in halbtc8723b1ant_init_hw_config()
2331 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x40, 0x20, 0x1); in halbtc8723b1ant_init_hw_config()
2346 u32tmp = btcoexist->btc_read_4byte(btcoexist, 0x948); in halbtc8723b1ant_init_hw_config()
2347 u8tmpa = btcoexist->btc_read_1byte(btcoexist, 0x765); in halbtc8723b1ant_init_hw_config()
2348 u8tmpb = btcoexist->btc_read_1byte(btcoexist, 0x67); in halbtc8723b1ant_init_hw_config()
2360 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_power_on_setting()
2361 struct btc_board_info *board_info = &btcoexist->board_info; in ex_btc8723b1ant_power_on_setting()
2367 "xxxxxxxxxxxxxxxx Execute 8723b 1-Ant PowerOn Setting xxxxxxxxxxxxxxxx!!\n"); in ex_btc8723b1ant_power_on_setting()
2369 btcoexist->stop_coex_dm = true; in ex_btc8723b1ant_power_on_setting()
2371 btcoexist->btc_write_1byte(btcoexist, 0x67, 0x20); in ex_btc8723b1ant_power_on_setting()
2374 u16tmp = btcoexist->btc_read_2byte(btcoexist, 0x2); in ex_btc8723b1ant_power_on_setting()
2375 btcoexist->btc_write_2byte(btcoexist, 0x2, u16tmp | BIT0 | BIT1); in ex_btc8723b1ant_power_on_setting()
2378 btcoexist->btc_write_1byte(btcoexist, 0x765, 0x18); in ex_btc8723b1ant_power_on_setting()
2380 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0x4); in ex_btc8723b1ant_power_on_setting()
2389 * NOTE: here default all internal switch and 1-antenna ==> BIT1=0 and in ex_btc8723b1ant_power_on_setting()
2392 if (btcoexist->chip_interface == BTC_INTF_USB) { in ex_btc8723b1ant_power_on_setting()
2394 btcoexist->btc_write_4byte(btcoexist, 0x948, 0x0); in ex_btc8723b1ant_power_on_setting()
2397 btcoexist->btc_write_local_reg_1byte(btcoexist, 0xfe08, u8tmp); in ex_btc8723b1ant_power_on_setting()
2399 board_info->btdm_ant_pos = BTC_ANTENNA_AT_AUX_PORT; in ex_btc8723b1ant_power_on_setting()
2402 if (board_info->single_ant_path == 0) { in ex_btc8723b1ant_power_on_setting()
2404 btcoexist->btc_write_4byte(btcoexist, 0x948, 0x280); in ex_btc8723b1ant_power_on_setting()
2405 board_info->btdm_ant_pos = BTC_ANTENNA_AT_MAIN_PORT; in ex_btc8723b1ant_power_on_setting()
2407 } else if (board_info->single_ant_path == 1) { in ex_btc8723b1ant_power_on_setting()
2409 btcoexist->btc_write_4byte(btcoexist, 0x948, 0x0); in ex_btc8723b1ant_power_on_setting()
2411 board_info->btdm_ant_pos = BTC_ANTENNA_AT_AUX_PORT; in ex_btc8723b1ant_power_on_setting()
2415 btcoexist->btc_set(btcoexist, BTC_SET_ACT_ANTPOSREGRISTRY_CTRL, in ex_btc8723b1ant_power_on_setting()
2418 if (btcoexist->chip_interface == BTC_INTF_PCI) in ex_btc8723b1ant_power_on_setting()
2419 btcoexist->btc_write_local_reg_1byte(btcoexist, 0x384, in ex_btc8723b1ant_power_on_setting()
2421 else if (btcoexist->chip_interface == BTC_INTF_SDIO) in ex_btc8723b1ant_power_on_setting()
2422 btcoexist->btc_write_local_reg_1byte(btcoexist, 0x60, in ex_btc8723b1ant_power_on_setting()
2432 btcoexist->stop_coex_dm = false; in ex_btc8723b1ant_init_hwconfig()
2437 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_init_coex_dm()
2442 btcoexist->stop_coex_dm = false; in ex_btc8723b1ant_init_coex_dm()
2450 struct seq_file *m) in ex_btc8723b1ant_display_coex_info() argument
2452 struct btc_board_info *board_info = &btcoexist->board_info; in ex_btc8723b1ant_display_coex_info()
2453 struct btc_stack_info *stack_info = &btcoexist->stack_info; in ex_btc8723b1ant_display_coex_info()
2454 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in ex_btc8723b1ant_display_coex_info()
2466 seq_puts(m, "\n ============[BT Coexist info]============"); in ex_btc8723b1ant_display_coex_info()
2468 if (btcoexist->manual_control) { in ex_btc8723b1ant_display_coex_info()
2469 seq_puts(m, "\n ============[Under Manual Control]=========="); in ex_btc8723b1ant_display_coex_info()
2470 seq_puts(m, "\n =========================================="); in ex_btc8723b1ant_display_coex_info()
2472 if (btcoexist->stop_coex_dm) { in ex_btc8723b1ant_display_coex_info()
2473 seq_puts(m, "\n ============[Coex is STOPPED]============"); in ex_btc8723b1ant_display_coex_info()
2474 seq_puts(m, "\n =========================================="); in ex_btc8723b1ant_display_coex_info()
2477 seq_printf(m, "\n %-35s = %d/ %d/ %d", in ex_btc8723b1ant_display_coex_info()
2479 board_info->pg_ant_num, board_info->btdm_ant_num, in ex_btc8723b1ant_display_coex_info()
2480 board_info->btdm_ant_pos); in ex_btc8723b1ant_display_coex_info()
2482 seq_printf(m, "\n %-35s = %s / %d", in ex_btc8723b1ant_display_coex_info()
2484 ((stack_info->profile_notified) ? "Yes" : "No"), in ex_btc8723b1ant_display_coex_info()
2485 stack_info->hci_version); in ex_btc8723b1ant_display_coex_info()
2487 btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver); in ex_btc8723b1ant_display_coex_info()
2488 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver); in ex_btc8723b1ant_display_coex_info()
2489 seq_printf(m, "\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)", in ex_btc8723b1ant_display_coex_info()
2494 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in ex_btc8723b1ant_display_coex_info()
2495 btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_DOT11_CHNL, in ex_btc8723b1ant_display_coex_info()
2497 btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl); in ex_btc8723b1ant_display_coex_info()
2498 seq_printf(m, "\n %-35s = %d / %d(%d)", in ex_btc8723b1ant_display_coex_info()
2502 seq_printf(m, "\n %-35s = %3ph ", in ex_btc8723b1ant_display_coex_info()
2504 coex_dm->wifi_chnl_info); in ex_btc8723b1ant_display_coex_info()
2506 btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); in ex_btc8723b1ant_display_coex_info()
2507 btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi); in ex_btc8723b1ant_display_coex_info()
2508 seq_printf(m, "\n %-35s = %d/ %d", in ex_btc8723b1ant_display_coex_info()
2511 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan); in ex_btc8723b1ant_display_coex_info()
2512 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link); in ex_btc8723b1ant_display_coex_info()
2513 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam); in ex_btc8723b1ant_display_coex_info()
2514 seq_printf(m, "\n %-35s = %d/ %d/ %d ", in ex_btc8723b1ant_display_coex_info()
2517 btcoexist->btc_get(btcoexist , BTC_GET_BL_WIFI_UNDER_5G, in ex_btc8723b1ant_display_coex_info()
2519 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in ex_btc8723b1ant_display_coex_info()
2520 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in ex_btc8723b1ant_display_coex_info()
2521 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, in ex_btc8723b1ant_display_coex_info()
2524 seq_printf(m, "\n %-35s = %s / %s/ %s ", in ex_btc8723b1ant_display_coex_info()
2532 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_LINK_STATUS, in ex_btc8723b1ant_display_coex_info()
2534 seq_printf(m, "\n %-35s = %d/ %d/ %d/ %d/ %d", in ex_btc8723b1ant_display_coex_info()
2542 seq_printf(m, "\n %-35s = [%s/ %d/ %d] ", in ex_btc8723b1ant_display_coex_info()
2544 ((coex_sta->bt_disabled) ? ("disabled") : in ex_btc8723b1ant_display_coex_info()
2545 ((coex_sta->c2h_bt_inquiry_page) ? ("inquiry/page scan") : in ex_btc8723b1ant_display_coex_info()
2547 coex_dm->bt_status) ? in ex_btc8723b1ant_display_coex_info()
2548 "non-connected idle" : in ex_btc8723b1ant_display_coex_info()
2550 coex_dm->bt_status) ? in ex_btc8723b1ant_display_coex_info()
2551 "connected-idle" : "busy")))), in ex_btc8723b1ant_display_coex_info()
2552 coex_sta->bt_rssi, coex_sta->bt_retry_cnt); in ex_btc8723b1ant_display_coex_info()
2554 seq_printf(m, "\n %-35s = %d / %d / %d / %d", in ex_btc8723b1ant_display_coex_info()
2555 "SCO/HID/PAN/A2DP", bt_link_info->sco_exist, in ex_btc8723b1ant_display_coex_info()
2556 bt_link_info->hid_exist, bt_link_info->pan_exist, in ex_btc8723b1ant_display_coex_info()
2557 bt_link_info->a2dp_exist); in ex_btc8723b1ant_display_coex_info()
2558 btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_BT_LINK_INFO, m); in ex_btc8723b1ant_display_coex_info()
2560 bt_info_ext = coex_sta->bt_info_ext; in ex_btc8723b1ant_display_coex_info()
2561 seq_printf(m, "\n %-35s = %s", in ex_btc8723b1ant_display_coex_info()
2566 if (coex_sta->bt_info_c2h_cnt[i]) { in ex_btc8723b1ant_display_coex_info()
2567 seq_printf(m, "\n %-35s = %7ph(%d)", in ex_btc8723b1ant_display_coex_info()
2569 coex_sta->bt_info_c2h[i], in ex_btc8723b1ant_display_coex_info()
2570 coex_sta->bt_info_c2h_cnt[i]); in ex_btc8723b1ant_display_coex_info()
2573 seq_printf(m, "\n %-35s = %s/%s, (0x%x/0x%x)", in ex_btc8723b1ant_display_coex_info()
2575 ((coex_sta->under_ips ? "IPS ON" : "IPS OFF")), in ex_btc8723b1ant_display_coex_info()
2576 ((coex_sta->under_lps ? "LPS ON" : "LPS OFF")), in ex_btc8723b1ant_display_coex_info()
2577 btcoexist->bt_info.lps_val, in ex_btc8723b1ant_display_coex_info()
2578 btcoexist->bt_info.rpwm_val); in ex_btc8723b1ant_display_coex_info()
2579 btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD, m); in ex_btc8723b1ant_display_coex_info()
2581 if (!btcoexist->manual_control) { in ex_btc8723b1ant_display_coex_info()
2583 seq_printf(m, "\n %-35s", in ex_btc8723b1ant_display_coex_info()
2586 seq_printf(m, "\n %-35s = %d/", in ex_btc8723b1ant_display_coex_info()
2587 "SM[LowPenaltyRA]", coex_dm->cur_low_penalty_ra); in ex_btc8723b1ant_display_coex_info()
2589 seq_printf(m, "\n %-35s = %s/ %s/ %d ", in ex_btc8723b1ant_display_coex_info()
2591 (btcoexist->bt_info.reject_agg_pkt ? "Yes" : "No"), in ex_btc8723b1ant_display_coex_info()
2592 (btcoexist->bt_info.bt_ctrl_buf_size ? "Yes" : "No"), in ex_btc8723b1ant_display_coex_info()
2593 btcoexist->bt_info.agg_buf_size); in ex_btc8723b1ant_display_coex_info()
2595 seq_printf(m, "\n %-35s = 0x%x ", in ex_btc8723b1ant_display_coex_info()
2596 "Rate Mask", btcoexist->bt_info.ra_mask); in ex_btc8723b1ant_display_coex_info()
2599 seq_printf(m, "\n %-35s", in ex_btc8723b1ant_display_coex_info()
2602 pstdmacase = coex_dm->cur_ps_tdma; in ex_btc8723b1ant_display_coex_info()
2603 seq_printf(m, "\n %-35s = %5ph case-%d (auto:%d)", in ex_btc8723b1ant_display_coex_info()
2604 "PS TDMA", coex_dm->ps_tdma_para, in ex_btc8723b1ant_display_coex_info()
2605 pstdmacase, coex_dm->auto_tdma_adjust); in ex_btc8723b1ant_display_coex_info()
2607 seq_printf(m, "\n %-35s = %d ", in ex_btc8723b1ant_display_coex_info()
2608 "IgnWlanAct", coex_dm->cur_ignore_wlan_act); in ex_btc8723b1ant_display_coex_info()
2610 seq_printf(m, "\n %-35s = 0x%x ", in ex_btc8723b1ant_display_coex_info()
2612 coex_dm->error_condition); in ex_btc8723b1ant_display_coex_info()
2615 seq_printf(m, "\n %-35s = %d", in ex_btc8723b1ant_display_coex_info()
2616 "Coex Table Type", coex_sta->coex_table_type); in ex_btc8723b1ant_display_coex_info()
2619 seq_printf(m, "\n %-35s", in ex_btc8723b1ant_display_coex_info()
2622 seq_printf(m, "\n %-35s = 0x%x/0x%x/0x%x/0x%x", in ex_btc8723b1ant_display_coex_info()
2623 "backup ARFR1/ARFR2/RL/AMaxTime", coex_dm->backup_arfr_cnt1, in ex_btc8723b1ant_display_coex_info()
2624 coex_dm->backup_arfr_cnt2, coex_dm->backup_retry_limit, in ex_btc8723b1ant_display_coex_info()
2625 coex_dm->backup_ampdu_max_time); in ex_btc8723b1ant_display_coex_info()
2627 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x430); in ex_btc8723b1ant_display_coex_info()
2628 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x434); in ex_btc8723b1ant_display_coex_info()
2629 u16tmp[0] = btcoexist->btc_read_2byte(btcoexist, 0x42a); in ex_btc8723b1ant_display_coex_info()
2630 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x456); in ex_btc8723b1ant_display_coex_info()
2631 seq_printf(m, "\n %-35s = 0x%x/0x%x/0x%x/0x%x", in ex_btc8723b1ant_display_coex_info()
2635 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778); in ex_btc8723b1ant_display_coex_info()
2636 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6cc); in ex_btc8723b1ant_display_coex_info()
2637 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x880); in ex_btc8723b1ant_display_coex_info()
2638 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x", in ex_btc8723b1ant_display_coex_info()
2642 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x948); in ex_btc8723b1ant_display_coex_info()
2643 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x67); in ex_btc8723b1ant_display_coex_info()
2644 u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x765); in ex_btc8723b1ant_display_coex_info()
2645 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x", in ex_btc8723b1ant_display_coex_info()
2649 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x92c); in ex_btc8723b1ant_display_coex_info()
2650 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x930); in ex_btc8723b1ant_display_coex_info()
2651 u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x944); in ex_btc8723b1ant_display_coex_info()
2652 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x", in ex_btc8723b1ant_display_coex_info()
2656 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x39); in ex_btc8723b1ant_display_coex_info()
2657 u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x40); in ex_btc8723b1ant_display_coex_info()
2658 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x4c); in ex_btc8723b1ant_display_coex_info()
2659 u8tmp[2] = btcoexist->btc_read_1byte(btcoexist, 0x64); in ex_btc8723b1ant_display_coex_info()
2660 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", in ex_btc8723b1ant_display_coex_info()
2665 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550); in ex_btc8723b1ant_display_coex_info()
2666 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522); in ex_btc8723b1ant_display_coex_info()
2667 seq_printf(m, "\n %-35s = 0x%x/ 0x%x", in ex_btc8723b1ant_display_coex_info()
2670 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50); in ex_btc8723b1ant_display_coex_info()
2671 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x49c); in ex_btc8723b1ant_display_coex_info()
2672 seq_printf(m, "\n %-35s = 0x%x/ 0x%x", in ex_btc8723b1ant_display_coex_info()
2673 "0xc50(dig)/0x49c(null-drop)", u32tmp[0] & 0xff, u8tmp[0]); in ex_btc8723b1ant_display_coex_info()
2675 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xda0); in ex_btc8723b1ant_display_coex_info()
2676 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0xda4); in ex_btc8723b1ant_display_coex_info()
2677 u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0xda8); in ex_btc8723b1ant_display_coex_info()
2678 u32tmp[3] = btcoexist->btc_read_4byte(btcoexist, 0xcf0); in ex_btc8723b1ant_display_coex_info()
2680 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0xa5b); in ex_btc8723b1ant_display_coex_info()
2681 u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0xa5c); in ex_btc8723b1ant_display_coex_info()
2691 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x", in ex_btc8723b1ant_display_coex_info()
2692 "OFDM-CCA/OFDM-FA/CCK-FA", in ex_btc8723b1ant_display_coex_info()
2695 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0); in ex_btc8723b1ant_display_coex_info()
2696 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4); in ex_btc8723b1ant_display_coex_info()
2697 u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8); in ex_btc8723b1ant_display_coex_info()
2698 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x", in ex_btc8723b1ant_display_coex_info()
2702 seq_printf(m, "\n %-35s = %d/ %d", in ex_btc8723b1ant_display_coex_info()
2703 "0x770(high-pri rx/tx)", coex_sta->high_priority_rx, in ex_btc8723b1ant_display_coex_info()
2704 coex_sta->high_priority_tx); in ex_btc8723b1ant_display_coex_info()
2705 seq_printf(m, "\n %-35s = %d/ %d", in ex_btc8723b1ant_display_coex_info()
2706 "0x774(low-pri rx/tx)", coex_sta->low_priority_rx, in ex_btc8723b1ant_display_coex_info()
2707 coex_sta->low_priority_tx); in ex_btc8723b1ant_display_coex_info()
2708 if (btcoexist->auto_report_1ant) in ex_btc8723b1ant_display_coex_info()
2710 btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS, m); in ex_btc8723b1ant_display_coex_info()
2715 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_ips_notify()
2717 if (btcoexist->manual_control || btcoexist->stop_coex_dm) in ex_btc8723b1ant_ips_notify()
2723 coex_sta->under_ips = true; in ex_btc8723b1ant_ips_notify()
2734 coex_sta->under_ips = false; in ex_btc8723b1ant_ips_notify()
2744 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_lps_notify()
2746 if (btcoexist->manual_control || btcoexist->stop_coex_dm) in ex_btc8723b1ant_lps_notify()
2752 coex_sta->under_lps = true; in ex_btc8723b1ant_lps_notify()
2756 coex_sta->under_lps = false; in ex_btc8723b1ant_lps_notify()
2762 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_scan_notify()
2771 if (btcoexist->manual_control || btcoexist->stop_coex_dm) in ex_btc8723b1ant_scan_notify()
2775 coex_sta->wifi_is_high_pri_task = true; in ex_btc8723b1ant_scan_notify()
2782 u32tmp = btcoexist->btc_read_4byte(btcoexist, 0x948); in ex_btc8723b1ant_scan_notify()
2783 u8tmpa = btcoexist->btc_read_1byte(btcoexist, 0x765); in ex_btc8723b1ant_scan_notify()
2784 u8tmpb = btcoexist->btc_read_1byte(btcoexist, 0x67); in ex_btc8723b1ant_scan_notify()
2790 coex_sta->wifi_is_high_pri_task = false; in ex_btc8723b1ant_scan_notify()
2794 btcoexist->btc_get(btcoexist, BTC_GET_U1_AP_NUM, in ex_btc8723b1ant_scan_notify()
2795 &coex_sta->scan_ap_num); in ex_btc8723b1ant_scan_notify()
2798 if (coex_sta->bt_disabled) in ex_btc8723b1ant_scan_notify()
2801 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in ex_btc8723b1ant_scan_notify()
2802 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED, in ex_btc8723b1ant_scan_notify()
2807 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_LINK_STATUS, in ex_btc8723b1ant_scan_notify()
2818 if (coex_sta->c2h_bt_inquiry_page) { in ex_btc8723b1ant_scan_notify()
2830 /* non-connected scan */ in ex_btc8723b1ant_scan_notify()
2839 /* non-connected scan */ in ex_btc8723b1ant_scan_notify()
2848 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_connect_notify()
2855 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, in ex_btc8723b1ant_connect_notify()
2858 if (btcoexist->manual_control || btcoexist->stop_coex_dm || in ex_btc8723b1ant_connect_notify()
2859 coex_sta->bt_disabled) in ex_btc8723b1ant_connect_notify()
2863 coex_sta->wifi_is_high_pri_task = true; in ex_btc8723b1ant_connect_notify()
2871 coex_dm->arp_cnt = 0; in ex_btc8723b1ant_connect_notify()
2873 coex_sta->wifi_is_high_pri_task = false; in ex_btc8723b1ant_connect_notify()
2878 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_LINK_STATUS, in ex_btc8723b1ant_connect_notify()
2889 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in ex_btc8723b1ant_connect_notify()
2890 if (coex_sta->c2h_bt_inquiry_page) { in ex_btc8723b1ant_connect_notify()
2906 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED, in ex_btc8723b1ant_connect_notify()
2909 /* non-connected scan */ in ex_btc8723b1ant_connect_notify()
2919 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_media_status_notify()
2925 if (btcoexist->manual_control || btcoexist->stop_coex_dm || in ex_btc8723b1ant_media_status_notify()
2926 coex_sta->bt_disabled) in ex_btc8723b1ant_media_status_notify()
2936 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, in ex_btc8723b1ant_media_status_notify()
2941 btcoexist->btc_write_1byte(btcoexist, 0x6cd, in ex_btc8723b1ant_media_status_notify()
2943 btcoexist->btc_write_1byte(btcoexist, 0x6cf, in ex_btc8723b1ant_media_status_notify()
2946 btcoexist->btc_write_1byte(btcoexist, 0x6cd, in ex_btc8723b1ant_media_status_notify()
2948 btcoexist->btc_write_1byte(btcoexist, 0x6cf, in ex_btc8723b1ant_media_status_notify()
2952 coex_dm->backup_arfr_cnt1 = in ex_btc8723b1ant_media_status_notify()
2953 btcoexist->btc_read_4byte(btcoexist, 0x430); in ex_btc8723b1ant_media_status_notify()
2954 coex_dm->backup_arfr_cnt2 = in ex_btc8723b1ant_media_status_notify()
2955 btcoexist->btc_read_4byte(btcoexist, 0x434); in ex_btc8723b1ant_media_status_notify()
2956 coex_dm->backup_retry_limit = in ex_btc8723b1ant_media_status_notify()
2957 btcoexist->btc_read_2byte(btcoexist, 0x42a); in ex_btc8723b1ant_media_status_notify()
2958 coex_dm->backup_ampdu_max_time = in ex_btc8723b1ant_media_status_notify()
2959 btcoexist->btc_read_1byte(btcoexist, 0x456); in ex_btc8723b1ant_media_status_notify()
2963 coex_dm->arp_cnt = 0; in ex_btc8723b1ant_media_status_notify()
2965 btcoexist->btc_write_1byte(btcoexist, 0x6cd, 0x0); /* CCK Tx */ in ex_btc8723b1ant_media_status_notify()
2966 btcoexist->btc_write_1byte(btcoexist, 0x6cf, 0x0); /* CCK Rx */ in ex_btc8723b1ant_media_status_notify()
2968 coex_sta->cck_ever_lock = false; in ex_btc8723b1ant_media_status_notify()
2972 btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, in ex_btc8723b1ant_media_status_notify()
2978 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in ex_btc8723b1ant_media_status_notify()
2985 coex_dm->wifi_chnl_info[0] = h2c_parameter[0]; in ex_btc8723b1ant_media_status_notify()
2986 coex_dm->wifi_chnl_info[1] = h2c_parameter[1]; in ex_btc8723b1ant_media_status_notify()
2987 coex_dm->wifi_chnl_info[2] = h2c_parameter[2]; in ex_btc8723b1ant_media_status_notify()
2994 btcoexist->btc_fill_h2c(btcoexist, 0x66, 3, h2c_parameter); in ex_btc8723b1ant_media_status_notify()
3000 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_special_packet_notify()
3007 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, in ex_btc8723b1ant_special_packet_notify()
3010 if (btcoexist->manual_control || btcoexist->stop_coex_dm || in ex_btc8723b1ant_special_packet_notify()
3011 coex_sta->bt_disabled) in ex_btc8723b1ant_special_packet_notify()
3020 coex_dm->arp_cnt++; in ex_btc8723b1ant_special_packet_notify()
3023 coex_dm->arp_cnt); in ex_btc8723b1ant_special_packet_notify()
3025 if ((coex_dm->arp_cnt >= 10) && (!under_4way)) in ex_btc8723b1ant_special_packet_notify()
3029 coex_sta->wifi_is_high_pri_task = false; in ex_btc8723b1ant_special_packet_notify()
3031 coex_sta->wifi_is_high_pri_task = true; in ex_btc8723b1ant_special_packet_notify()
3033 coex_sta->wifi_is_high_pri_task = true; in ex_btc8723b1ant_special_packet_notify()
3038 coex_sta->wifi_is_high_pri_task = false; in ex_btc8723b1ant_special_packet_notify()
3044 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_LINK_STATUS, in ex_btc8723b1ant_special_packet_notify()
3055 coex_sta->special_pkt_period_cnt = 0; in ex_btc8723b1ant_special_packet_notify()
3057 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in ex_btc8723b1ant_special_packet_notify()
3058 if (coex_sta->c2h_bt_inquiry_page) { in ex_btc8723b1ant_special_packet_notify()
3077 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_bt_info_notify()
3083 coex_sta->c2h_bt_info_req_sent = false; in ex_btc8723b1ant_bt_info_notify()
3088 coex_sta->bt_info_c2h_cnt[rsp_source]++; in ex_btc8723b1ant_bt_info_notify()
3094 coex_sta->bt_info_c2h[rsp_source][i] = tmp_buf[i]; in ex_btc8723b1ant_bt_info_notify()
3097 if (i == length - 1) in ex_btc8723b1ant_bt_info_notify()
3107 coex_sta->bt_whck_test = true; in ex_btc8723b1ant_bt_info_notify()
3109 coex_sta->bt_whck_test = false; in ex_btc8723b1ant_bt_info_notify()
3112 coex_sta->bt_retry_cnt = /* [3:0] */ in ex_btc8723b1ant_bt_info_notify()
3113 coex_sta->bt_info_c2h[rsp_source][2] & 0xf; in ex_btc8723b1ant_bt_info_notify()
3115 if (coex_sta->bt_retry_cnt >= 1) in ex_btc8723b1ant_bt_info_notify()
3116 coex_sta->pop_event_cnt++; in ex_btc8723b1ant_bt_info_notify()
3118 if (coex_sta->bt_info_c2h[rsp_source][2] & 0x20) in ex_btc8723b1ant_bt_info_notify()
3119 coex_sta->c2h_bt_remote_name_req = true; in ex_btc8723b1ant_bt_info_notify()
3121 coex_sta->c2h_bt_remote_name_req = false; in ex_btc8723b1ant_bt_info_notify()
3123 coex_sta->bt_rssi = in ex_btc8723b1ant_bt_info_notify()
3124 coex_sta->bt_info_c2h[rsp_source][3] * 2 - 90; in ex_btc8723b1ant_bt_info_notify()
3126 coex_sta->bt_info_ext = in ex_btc8723b1ant_bt_info_notify()
3127 coex_sta->bt_info_c2h[rsp_source][4]; in ex_btc8723b1ant_bt_info_notify()
3129 if (coex_sta->bt_info_c2h[rsp_source][1] == 0x49) { in ex_btc8723b1ant_bt_info_notify()
3130 coex_sta->a2dp_bit_pool = in ex_btc8723b1ant_bt_info_notify()
3131 coex_sta->bt_info_c2h[rsp_source][6]; in ex_btc8723b1ant_bt_info_notify()
3133 coex_sta->a2dp_bit_pool = 0; in ex_btc8723b1ant_bt_info_notify()
3136 coex_sta->bt_tx_rx_mask = in ex_btc8723b1ant_bt_info_notify()
3137 (coex_sta->bt_info_c2h[rsp_source][2] & 0x40); in ex_btc8723b1ant_bt_info_notify()
3138 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_TX_RX_MASK, in ex_btc8723b1ant_bt_info_notify()
3139 &coex_sta->bt_tx_rx_mask); in ex_btc8723b1ant_bt_info_notify()
3141 if (!coex_sta->bt_tx_rx_mask) { in ex_btc8723b1ant_bt_info_notify()
3147 btcoexist->btc_set_bt_reg(btcoexist, BTC_BT_REG_RF, in ex_btc8723b1ant_bt_info_notify()
3151 btcoexist->btc_set_bt_reg(btcoexist, BTC_BT_REG_RF, in ex_btc8723b1ant_bt_info_notify()
3153 btcoexist->btc_set_bt_reg(btcoexist, BTC_BT_REG_RF, in ex_btc8723b1ant_bt_info_notify()
3160 if (coex_sta->bt_info_ext & BIT1) { in ex_btc8723b1ant_bt_info_notify()
3163 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED, in ex_btc8723b1ant_bt_info_notify()
3173 if (coex_sta->bt_info_ext & BIT3) { in ex_btc8723b1ant_bt_info_notify()
3174 if (!btcoexist->manual_control && in ex_btc8723b1ant_bt_info_notify()
3175 !btcoexist->stop_coex_dm) { in ex_btc8723b1ant_bt_info_notify()
3185 if (!btcoexist->auto_report_1ant) { in ex_btc8723b1ant_bt_info_notify()
3186 if (coex_sta->bt_info_ext & BIT4) { in ex_btc8723b1ant_bt_info_notify()
3198 coex_sta->c2h_bt_inquiry_page = true; in ex_btc8723b1ant_bt_info_notify()
3200 coex_sta->c2h_bt_inquiry_page = false; in ex_btc8723b1ant_bt_info_notify()
3202 coex_sta->num_of_profile = 0; in ex_btc8723b1ant_bt_info_notify()
3206 coex_sta->bt_link_exist = false; in ex_btc8723b1ant_bt_info_notify()
3207 coex_sta->pan_exist = false; in ex_btc8723b1ant_bt_info_notify()
3208 coex_sta->a2dp_exist = false; in ex_btc8723b1ant_bt_info_notify()
3209 coex_sta->hid_exist = false; in ex_btc8723b1ant_bt_info_notify()
3210 coex_sta->sco_exist = false; in ex_btc8723b1ant_bt_info_notify()
3212 coex_sta->bt_hi_pri_link_exist = false; in ex_btc8723b1ant_bt_info_notify()
3215 coex_sta->bt_link_exist = true; in ex_btc8723b1ant_bt_info_notify()
3217 coex_sta->pan_exist = true; in ex_btc8723b1ant_bt_info_notify()
3218 coex_sta->num_of_profile++; in ex_btc8723b1ant_bt_info_notify()
3220 coex_sta->pan_exist = false; in ex_btc8723b1ant_bt_info_notify()
3223 coex_sta->a2dp_exist = true; in ex_btc8723b1ant_bt_info_notify()
3224 coex_sta->num_of_profile++; in ex_btc8723b1ant_bt_info_notify()
3226 coex_sta->a2dp_exist = false; in ex_btc8723b1ant_bt_info_notify()
3229 coex_sta->hid_exist = true; in ex_btc8723b1ant_bt_info_notify()
3230 coex_sta->num_of_profile++; in ex_btc8723b1ant_bt_info_notify()
3232 coex_sta->hid_exist = false; in ex_btc8723b1ant_bt_info_notify()
3235 coex_sta->sco_exist = true; in ex_btc8723b1ant_bt_info_notify()
3236 coex_sta->num_of_profile++; in ex_btc8723b1ant_bt_info_notify()
3238 coex_sta->sco_exist = false; in ex_btc8723b1ant_bt_info_notify()
3241 if ((!coex_sta->hid_exist) && in ex_btc8723b1ant_bt_info_notify()
3242 (!coex_sta->c2h_bt_inquiry_page) && in ex_btc8723b1ant_bt_info_notify()
3243 (!coex_sta->sco_exist)) { in ex_btc8723b1ant_bt_info_notify()
3244 if (coex_sta->high_priority_tx + in ex_btc8723b1ant_bt_info_notify()
3245 coex_sta->high_priority_rx >= in ex_btc8723b1ant_bt_info_notify()
3247 coex_sta->hid_exist = true; in ex_btc8723b1ant_bt_info_notify()
3248 coex_sta->wrong_profile_notification++; in ex_btc8723b1ant_bt_info_notify()
3249 coex_sta->num_of_profile++; in ex_btc8723b1ant_bt_info_notify()
3254 /* Add Hi-Pri Tx/Rx counter to avoid false detection */ in ex_btc8723b1ant_bt_info_notify()
3255 if (((coex_sta->hid_exist) || (coex_sta->sco_exist)) && in ex_btc8723b1ant_bt_info_notify()
3256 (coex_sta->high_priority_tx + coex_sta->high_priority_rx >= in ex_btc8723b1ant_bt_info_notify()
3258 (!coex_sta->c2h_bt_inquiry_page)) in ex_btc8723b1ant_bt_info_notify()
3259 coex_sta->bt_hi_pri_link_exist = true; in ex_btc8723b1ant_bt_info_notify()
3262 (coex_sta->num_of_profile == 0)) { in ex_btc8723b1ant_bt_info_notify()
3263 if (coex_sta->low_priority_tx + in ex_btc8723b1ant_bt_info_notify()
3264 coex_sta->low_priority_rx >= in ex_btc8723b1ant_bt_info_notify()
3266 coex_sta->pan_exist = true; in ex_btc8723b1ant_bt_info_notify()
3267 coex_sta->num_of_profile++; in ex_btc8723b1ant_bt_info_notify()
3268 coex_sta->wrong_profile_notification++; in ex_btc8723b1ant_bt_info_notify()
3276 /* mask profile bit for connect-ilde identification in ex_btc8723b1ant_bt_info_notify()
3277 * ( for CSR case: A2DP idle --> 0x41) in ex_btc8723b1ant_bt_info_notify()
3282 coex_dm->bt_status = BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE; in ex_btc8723b1ant_bt_info_notify()
3284 "[BTCoex], BtInfoNotify(), BT Non-Connected idle!\n"); in ex_btc8723b1ant_bt_info_notify()
3287 coex_dm->bt_status = BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE; in ex_btc8723b1ant_bt_info_notify()
3289 "[BTCoex], BtInfoNotify(), BT Connected-idle!!!\n"); in ex_btc8723b1ant_bt_info_notify()
3292 coex_dm->bt_status = BT_8723B_1ANT_BT_STATUS_SCO_BUSY; in ex_btc8723b1ant_bt_info_notify()
3296 if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY != coex_dm->bt_status) in ex_btc8723b1ant_bt_info_notify()
3297 coex_dm->auto_tdma_adjust = false; in ex_btc8723b1ant_bt_info_notify()
3299 coex_dm->bt_status = BT_8723B_1ANT_BT_STATUS_ACL_BUSY; in ex_btc8723b1ant_bt_info_notify()
3303 coex_dm->bt_status = BT_8723B_1ANT_BT_STATUS_MAX; in ex_btc8723b1ant_bt_info_notify()
3305 "[BTCoex], BtInfoNotify(), BT Non-Defined state!!\n"); in ex_btc8723b1ant_bt_info_notify()
3308 if ((BT_8723B_1ANT_BT_STATUS_ACL_BUSY == coex_dm->bt_status) || in ex_btc8723b1ant_bt_info_notify()
3309 (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == coex_dm->bt_status) || in ex_btc8723b1ant_bt_info_notify()
3310 (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == coex_dm->bt_status)) in ex_btc8723b1ant_bt_info_notify()
3314 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bt_busy); in ex_btc8723b1ant_bt_info_notify()
3321 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_rf_status_notify()
3331 btcoexist->stop_coex_dm = false; in ex_btc8723b1ant_rf_status_notify()
3343 btcoexist->stop_coex_dm = true; in ex_btc8723b1ant_rf_status_notify()
3345 u32tmp = btcoexist->btc_read_4byte(btcoexist, 0x948); in ex_btc8723b1ant_rf_status_notify()
3346 u8tmpa = btcoexist->btc_read_1byte(btcoexist, 0x765); in ex_btc8723b1ant_rf_status_notify()
3347 u8tmpb = btcoexist->btc_read_1byte(btcoexist, 0x67); in ex_btc8723b1ant_rf_status_notify()
3348 u8tmpc = btcoexist->btc_read_1byte(btcoexist, 0x76e); in ex_btc8723b1ant_rf_status_notify()
3358 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_halt_notify()
3362 btcoexist->stop_coex_dm = true; in ex_btc8723b1ant_halt_notify()
3375 btcoexist->stop_coex_dm = true; in ex_btc8723b1ant_halt_notify()
3380 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_pnp_notify()
3400 coex_sta->under_ips = false; in ex_btc8723b1ant_pnp_notify()
3401 coex_sta->under_lps = false; in ex_btc8723b1ant_pnp_notify()
3402 btcoexist->stop_coex_dm = true; in ex_btc8723b1ant_pnp_notify()
3406 btcoexist->stop_coex_dm = false; in ex_btc8723b1ant_pnp_notify()
3415 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_coex_dm_reset()
3426 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8723b1ant_periodical()
3427 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in ex_btc8723b1ant_periodical()
3432 if (!btcoexist->auto_report_1ant) { in ex_btc8723b1ant_periodical()
3439 if ((coex_sta->high_priority_tx + coex_sta->high_priority_rx < 50) && in ex_btc8723b1ant_periodical()
3440 bt_link_info->hid_exist) in ex_btc8723b1ant_periodical()
3441 bt_link_info->hid_exist = false; in ex_btc8723b1ant_periodical()
3444 coex_dm->auto_tdma_adjust) { in ex_btc8723b1ant_periodical()
3447 coex_sta->special_pkt_period_cnt++; in ex_btc8723b1ant_periodical()