Lines Matching +full:tx +full:- +full:swing +full:- +full:low
1 // SPDX-License-Identifier: GPL-2.0
35 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_bt_rssi_state()
37 u8 bt_rssi_state = coex_sta->pre_bt_rssi_state; in btc8192e2ant_bt_rssi_state()
39 bt_rssi = coex_sta->bt_rssi; in btc8192e2ant_bt_rssi_state()
42 if ((coex_sta->pre_bt_rssi_state == BTC_RSSI_STATE_LOW) || in btc8192e2ant_bt_rssi_state()
43 (coex_sta->pre_bt_rssi_state == BTC_RSSI_STATE_STAY_LOW)) { in btc8192e2ant_bt_rssi_state()
59 return coex_sta->pre_bt_rssi_state; in btc8192e2ant_bt_rssi_state()
62 if ((coex_sta->pre_bt_rssi_state == BTC_RSSI_STATE_LOW) || in btc8192e2ant_bt_rssi_state()
63 (coex_sta->pre_bt_rssi_state == BTC_RSSI_STATE_STAY_LOW)) { in btc8192e2ant_bt_rssi_state()
69 } else if ((coex_sta->pre_bt_rssi_state == in btc8192e2ant_bt_rssi_state()
71 (coex_sta->pre_bt_rssi_state == in btc8192e2ant_bt_rssi_state()
88 coex_sta->pre_bt_rssi_state = bt_rssi_state; in btc8192e2ant_bt_rssi_state()
97 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_wifi_rssi_state()
99 u8 wifi_rssi_state = coex_sta->pre_wifi_rssi_state[index]; in btc8192e2ant_wifi_rssi_state()
101 btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); in btc8192e2ant_wifi_rssi_state()
104 if ((coex_sta->pre_wifi_rssi_state[index] == in btc8192e2ant_wifi_rssi_state()
106 (coex_sta->pre_wifi_rssi_state[index] == in btc8192e2ant_wifi_rssi_state()
123 return coex_sta->pre_wifi_rssi_state[index]; in btc8192e2ant_wifi_rssi_state()
126 if ((coex_sta->pre_wifi_rssi_state[index] == in btc8192e2ant_wifi_rssi_state()
128 (coex_sta->pre_wifi_rssi_state[index] == in btc8192e2ant_wifi_rssi_state()
135 } else if ((coex_sta->pre_wifi_rssi_state[index] == in btc8192e2ant_wifi_rssi_state()
137 (coex_sta->pre_wifi_rssi_state[index] == in btc8192e2ant_wifi_rssi_state()
154 coex_sta->pre_wifi_rssi_state[index] = wifi_rssi_state; in btc8192e2ant_wifi_rssi_state()
162 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_monitor_bt_enable_disable()
169 if (coex_sta->high_priority_tx == 0 && in btc8192e2ant_monitor_bt_enable_disable()
170 coex_sta->high_priority_rx == 0 && in btc8192e2ant_monitor_bt_enable_disable()
171 coex_sta->low_priority_tx == 0 && in btc8192e2ant_monitor_bt_enable_disable()
172 coex_sta->low_priority_rx == 0) in btc8192e2ant_monitor_bt_enable_disable()
175 if (coex_sta->high_priority_tx == 0xffff && in btc8192e2ant_monitor_bt_enable_disable()
176 coex_sta->high_priority_rx == 0xffff && in btc8192e2ant_monitor_bt_enable_disable()
177 coex_sta->low_priority_tx == 0xffff && in btc8192e2ant_monitor_bt_enable_disable()
178 coex_sta->low_priority_rx == 0xffff) in btc8192e2ant_monitor_bt_enable_disable()
184 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_DISABLE, in btc8192e2ant_monitor_bt_enable_disable()
195 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_DISABLE, in btc8192e2ant_monitor_bt_enable_disable()
244 coex_dm->cur_ra_mask = dis_rate_mask; in btc8192e2ant_update_ra_mask()
246 if (force_exec || (coex_dm->pre_ra_mask != coex_dm->cur_ra_mask)) in btc8192e2ant_update_ra_mask()
247 btcoexist->btc_set(btcoexist, BTC_SET_ACT_UPDATE_RAMASK, in btc8192e2ant_update_ra_mask()
248 &coex_dm->cur_ra_mask); in btc8192e2ant_update_ra_mask()
249 coex_dm->pre_ra_mask = coex_dm->cur_ra_mask; in btc8192e2ant_update_ra_mask()
257 coex_dm->cur_arfr_type = type; in btc8192e2ant_auto_rate_fallback_retry()
259 if (force_exec || (coex_dm->pre_arfr_type != coex_dm->cur_arfr_type)) { in btc8192e2ant_auto_rate_fallback_retry()
260 switch (coex_dm->cur_arfr_type) { in btc8192e2ant_auto_rate_fallback_retry()
262 btcoexist->btc_write_4byte(btcoexist, 0x430, in btc8192e2ant_auto_rate_fallback_retry()
263 coex_dm->backup_arfr_cnt1); in btc8192e2ant_auto_rate_fallback_retry()
264 btcoexist->btc_write_4byte(btcoexist, 0x434, in btc8192e2ant_auto_rate_fallback_retry()
265 coex_dm->backup_arfr_cnt2); in btc8192e2ant_auto_rate_fallback_retry()
268 btcoexist->btc_get(btcoexist, in btc8192e2ant_auto_rate_fallback_retry()
272 btcoexist->btc_write_4byte(btcoexist, 0x430, in btc8192e2ant_auto_rate_fallback_retry()
274 btcoexist->btc_write_4byte(btcoexist, 0x434, in btc8192e2ant_auto_rate_fallback_retry()
277 btcoexist->btc_write_4byte(btcoexist, 0x430, in btc8192e2ant_auto_rate_fallback_retry()
279 btcoexist->btc_write_4byte(btcoexist, 0x434, in btc8192e2ant_auto_rate_fallback_retry()
288 coex_dm->pre_arfr_type = coex_dm->cur_arfr_type; in btc8192e2ant_auto_rate_fallback_retry()
294 coex_dm->cur_retry_limit_type = type; in btc8192e2ant_retry_limit()
296 if (force_exec || (coex_dm->pre_retry_limit_type != in btc8192e2ant_retry_limit()
297 coex_dm->cur_retry_limit_type)) { in btc8192e2ant_retry_limit()
298 switch (coex_dm->cur_retry_limit_type) { in btc8192e2ant_retry_limit()
300 btcoexist->btc_write_2byte(btcoexist, 0x42a, in btc8192e2ant_retry_limit()
301 coex_dm->backup_retry_limit); in btc8192e2ant_retry_limit()
304 btcoexist->btc_write_2byte(btcoexist, 0x42a, 0x0808); in btc8192e2ant_retry_limit()
311 coex_dm->pre_retry_limit_type = coex_dm->cur_retry_limit_type; in btc8192e2ant_retry_limit()
317 coex_dm->cur_ampdu_time_type = type; in btc8192e2ant_ampdu_maxtime()
319 if (force_exec || (coex_dm->pre_ampdu_time_type != in btc8192e2ant_ampdu_maxtime()
320 coex_dm->cur_ampdu_time_type)) { in btc8192e2ant_ampdu_maxtime()
321 switch (coex_dm->cur_ampdu_time_type) { in btc8192e2ant_ampdu_maxtime()
323 btcoexist->btc_write_1byte(btcoexist, 0x456, in btc8192e2ant_ampdu_maxtime()
324 coex_dm->backup_ampdu_maxtime); in btc8192e2ant_ampdu_maxtime()
327 btcoexist->btc_write_1byte(btcoexist, 0x456, 0x38); in btc8192e2ant_ampdu_maxtime()
334 coex_dm->pre_ampdu_time_type = coex_dm->cur_ampdu_time_type; in btc8192e2ant_ampdu_maxtime()
344 coex_dm->cur_ra_mask_type = ra_mask_type; in btc8192e2ant_limited_tx()
346 btc8192e2ant_decide_ra_mask(btcoexist, coex_dm->cur_ss_type, in btc8192e2ant_limited_tx()
366 btcoexist->btc_set(btcoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, in btc8192e2ant_limited_rx()
369 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, in btc8192e2ant_limited_rx()
374 btcoexist->btc_set(btcoexist, BTC_SET_U1_AGG_BUF_SIZE, &rx_agg_size); in btc8192e2ant_limited_rx()
376 btcoexist->btc_set(btcoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL); in btc8192e2ant_limited_rx()
381 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_monitor_bt_ctr()
388 u32tmp = btcoexist->btc_read_4byte(btcoexist, reg_hp_txrx); in btc8192e2ant_monitor_bt_ctr()
392 u32tmp = btcoexist->btc_read_4byte(btcoexist, reg_lp_txrx); in btc8192e2ant_monitor_bt_ctr()
396 coex_sta->high_priority_tx = reg_hp_tx; in btc8192e2ant_monitor_bt_ctr()
397 coex_sta->high_priority_rx = reg_hp_rx; in btc8192e2ant_monitor_bt_ctr()
398 coex_sta->low_priority_tx = reg_lp_tx; in btc8192e2ant_monitor_bt_ctr()
399 coex_sta->low_priority_rx = reg_lp_rx; in btc8192e2ant_monitor_bt_ctr()
402 "[BTCoex] High Priority Tx/Rx (reg 0x%x) = 0x%x(%d)/0x%x(%d)\n", in btc8192e2ant_monitor_bt_ctr()
405 "[BTCoex] Low Priority Tx/Rx (reg 0x%x) = 0x%x(%d)/0x%x(%d)\n", in btc8192e2ant_monitor_bt_ctr()
409 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0xc); in btc8192e2ant_monitor_bt_ctr()
414 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_query_bt_info()
417 coex_sta->c2h_bt_info_req_sent = true; in btc8192e2ant_query_bt_info()
425 btcoexist->btc_fill_h2c(btcoexist, 0x61, 1, h2c_parameter); in btc8192e2ant_query_bt_info()
436 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED, in btc8192e2ant_is_wifi_status_changed()
438 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in btc8192e2ant_is_wifi_status_changed()
439 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in btc8192e2ant_is_wifi_status_changed()
440 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, in btc8192e2ant_is_wifi_status_changed()
463 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in btc8192e2ant_update_bt_link_info()
466 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in btc8192e2ant_update_bt_link_info()
468 bt_link_info->bt_link_exist = coex_sta->bt_link_exist; in btc8192e2ant_update_bt_link_info()
469 bt_link_info->sco_exist = coex_sta->sco_exist; in btc8192e2ant_update_bt_link_info()
470 bt_link_info->a2dp_exist = coex_sta->a2dp_exist; in btc8192e2ant_update_bt_link_info()
471 bt_link_info->pan_exist = coex_sta->pan_exist; in btc8192e2ant_update_bt_link_info()
472 bt_link_info->hid_exist = coex_sta->hid_exist; in btc8192e2ant_update_bt_link_info()
476 bt_link_info->pan_exist = true; in btc8192e2ant_update_bt_link_info()
477 bt_link_info->bt_link_exist = true; in btc8192e2ant_update_bt_link_info()
481 if (bt_link_info->sco_exist && in btc8192e2ant_update_bt_link_info()
482 !bt_link_info->a2dp_exist && in btc8192e2ant_update_bt_link_info()
483 !bt_link_info->pan_exist && in btc8192e2ant_update_bt_link_info()
484 !bt_link_info->hid_exist) in btc8192e2ant_update_bt_link_info()
485 bt_link_info->sco_only = true; in btc8192e2ant_update_bt_link_info()
487 bt_link_info->sco_only = false; in btc8192e2ant_update_bt_link_info()
490 if (!bt_link_info->sco_exist && in btc8192e2ant_update_bt_link_info()
491 bt_link_info->a2dp_exist && in btc8192e2ant_update_bt_link_info()
492 !bt_link_info->pan_exist && in btc8192e2ant_update_bt_link_info()
493 !bt_link_info->hid_exist) in btc8192e2ant_update_bt_link_info()
494 bt_link_info->a2dp_only = true; in btc8192e2ant_update_bt_link_info()
496 bt_link_info->a2dp_only = false; in btc8192e2ant_update_bt_link_info()
499 if (!bt_link_info->sco_exist && in btc8192e2ant_update_bt_link_info()
500 !bt_link_info->a2dp_exist && in btc8192e2ant_update_bt_link_info()
501 bt_link_info->pan_exist && in btc8192e2ant_update_bt_link_info()
502 !bt_link_info->hid_exist) in btc8192e2ant_update_bt_link_info()
503 bt_link_info->pan_only = true; in btc8192e2ant_update_bt_link_info()
505 bt_link_info->pan_only = false; in btc8192e2ant_update_bt_link_info()
508 if (!bt_link_info->sco_exist && in btc8192e2ant_update_bt_link_info()
509 !bt_link_info->a2dp_exist && in btc8192e2ant_update_bt_link_info()
510 !bt_link_info->pan_exist && in btc8192e2ant_update_bt_link_info()
511 bt_link_info->hid_exist) in btc8192e2ant_update_bt_link_info()
512 bt_link_info->hid_only = true; in btc8192e2ant_update_bt_link_info()
514 bt_link_info->hid_only = false; in btc8192e2ant_update_bt_link_info()
519 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_action_algorithm()
520 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in btc8192e2ant_action_algorithm()
521 struct btc_stack_info *stack_info = &btcoexist->stack_info; in btc8192e2ant_action_algorithm()
526 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in btc8192e2ant_action_algorithm()
528 if (!bt_link_info->bt_link_exist) { in btc8192e2ant_action_algorithm()
534 if (bt_link_info->sco_exist) in btc8192e2ant_action_algorithm()
536 if (bt_link_info->hid_exist) in btc8192e2ant_action_algorithm()
538 if (bt_link_info->pan_exist) in btc8192e2ant_action_algorithm()
540 if (bt_link_info->a2dp_exist) in btc8192e2ant_action_algorithm()
544 if (bt_link_info->sco_exist) { in btc8192e2ant_action_algorithm()
549 if (bt_link_info->hid_exist) { in btc8192e2ant_action_algorithm()
553 } else if (bt_link_info->a2dp_exist) { in btc8192e2ant_action_algorithm()
557 } else if (bt_link_info->pan_exist) { in btc8192e2ant_action_algorithm()
574 if (bt_link_info->sco_exist) { in btc8192e2ant_action_algorithm()
575 if (bt_link_info->hid_exist) { in btc8192e2ant_action_algorithm()
579 } else if (bt_link_info->a2dp_exist) { in btc8192e2ant_action_algorithm()
583 } else if (bt_link_info->pan_exist) { in btc8192e2ant_action_algorithm()
598 if (bt_link_info->hid_exist && in btc8192e2ant_action_algorithm()
599 bt_link_info->a2dp_exist) { in btc8192e2ant_action_algorithm()
600 if (stack_info->num_of_hid >= 2) { in btc8192e2ant_action_algorithm()
613 } else if (bt_link_info->hid_exist && in btc8192e2ant_action_algorithm()
614 bt_link_info->pan_exist) { in btc8192e2ant_action_algorithm()
627 } else if (bt_link_info->pan_exist && in btc8192e2ant_action_algorithm()
628 bt_link_info->a2dp_exist) { in btc8192e2ant_action_algorithm()
645 if (bt_link_info->sco_exist) { in btc8192e2ant_action_algorithm()
646 if (bt_link_info->hid_exist && in btc8192e2ant_action_algorithm()
647 bt_link_info->a2dp_exist) { in btc8192e2ant_action_algorithm()
651 } else if (bt_link_info->hid_exist && in btc8192e2ant_action_algorithm()
652 bt_link_info->pan_exist) { in btc8192e2ant_action_algorithm()
665 } else if (bt_link_info->pan_exist && in btc8192e2ant_action_algorithm()
666 bt_link_info->a2dp_exist) { in btc8192e2ant_action_algorithm()
681 if (bt_link_info->hid_exist && in btc8192e2ant_action_algorithm()
682 bt_link_info->pan_exist && in btc8192e2ant_action_algorithm()
683 bt_link_info->a2dp_exist) { in btc8192e2ant_action_algorithm()
700 if (bt_link_info->sco_exist) { in btc8192e2ant_action_algorithm()
701 if (bt_link_info->hid_exist && in btc8192e2ant_action_algorithm()
702 bt_link_info->pan_exist && in btc8192e2ant_action_algorithm()
703 bt_link_info->a2dp_exist) { in btc8192e2ant_action_algorithm()
726 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_set_fw_dac_swing_level()
735 "[BTCoex], Set Dac Swing Level = 0x%x\n", dac_swing_lvl); in btc8192e2ant_set_fw_dac_swing_level()
739 btcoexist->btc_fill_h2c(btcoexist, 0x64, 1, h2c_parameter); in btc8192e2ant_set_fw_dac_swing_level()
745 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_set_fw_dec_bt_pwr()
754 btcoexist->btc_fill_h2c(btcoexist, 0x62, 1, h2c_parameter); in btc8192e2ant_set_fw_dec_bt_pwr()
760 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_dec_bt_pwr()
765 coex_dm->cur_dec_bt_pwr = dec_bt_pwr_lvl; in btc8192e2ant_dec_bt_pwr()
770 coex_dm->pre_dec_bt_pwr, coex_dm->cur_dec_bt_pwr); in btc8192e2ant_dec_bt_pwr()
772 btc8192e2ant_set_fw_dec_bt_pwr(btcoexist, coex_dm->cur_dec_bt_pwr); in btc8192e2ant_dec_bt_pwr()
774 coex_dm->pre_dec_bt_pwr = coex_dm->cur_dec_bt_pwr; in btc8192e2ant_dec_bt_pwr()
780 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_set_bt_auto_report()
793 btcoexist->btc_fill_h2c(btcoexist, 0x68, 1, h2c_parameter); in btc8192e2ant_set_bt_auto_report()
800 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_bt_auto_report()
806 coex_dm->cur_bt_auto_report = enable_auto_report; in btc8192e2ant_bt_auto_report()
811 coex_dm->pre_bt_auto_report, in btc8192e2ant_bt_auto_report()
812 coex_dm->cur_bt_auto_report); in btc8192e2ant_bt_auto_report()
814 if (coex_dm->pre_bt_auto_report == coex_dm->cur_bt_auto_report) in btc8192e2ant_bt_auto_report()
818 coex_dm->cur_bt_auto_report); in btc8192e2ant_bt_auto_report()
820 coex_dm->pre_bt_auto_report = coex_dm->cur_bt_auto_report; in btc8192e2ant_bt_auto_report()
826 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_fw_dac_swing_lvl()
829 "[BTCoex], %s set FW Dac Swing level = %d\n", in btc8192e2ant_fw_dac_swing_lvl()
831 coex_dm->cur_fw_dac_swing_lvl = fw_dac_swing_lvl; in btc8192e2ant_fw_dac_swing_lvl()
836 coex_dm->pre_fw_dac_swing_lvl, in btc8192e2ant_fw_dac_swing_lvl()
837 coex_dm->cur_fw_dac_swing_lvl); in btc8192e2ant_fw_dac_swing_lvl()
839 if (coex_dm->pre_fw_dac_swing_lvl == in btc8192e2ant_fw_dac_swing_lvl()
840 coex_dm->cur_fw_dac_swing_lvl) in btc8192e2ant_fw_dac_swing_lvl()
845 coex_dm->cur_fw_dac_swing_lvl); in btc8192e2ant_fw_dac_swing_lvl()
847 coex_dm->pre_fw_dac_swing_lvl = coex_dm->cur_fw_dac_swing_lvl; in btc8192e2ant_fw_dac_swing_lvl()
853 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_set_sw_rf_rx_lpf_corner()
859 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1e, in btc8192e2ant_set_sw_rf_rx_lpf_corner()
863 * After initialized, we can use coex_dm->btRf0x1eBackup in btc8192e2ant_set_sw_rf_rx_lpf_corner()
865 if (btcoexist->initialized) { in btc8192e2ant_set_sw_rf_rx_lpf_corner()
868 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1e, in btc8192e2ant_set_sw_rf_rx_lpf_corner()
870 coex_dm->bt_rf0x1e_backup); in btc8192e2ant_set_sw_rf_rx_lpf_corner()
878 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_rf_shrink()
884 coex_dm->cur_rf_rx_lpf_shrink = rx_rf_shrink_on; in btc8192e2ant_rf_shrink()
889 coex_dm->pre_rf_rx_lpf_shrink, in btc8192e2ant_rf_shrink()
890 coex_dm->cur_rf_rx_lpf_shrink); in btc8192e2ant_rf_shrink()
892 if (coex_dm->pre_rf_rx_lpf_shrink == in btc8192e2ant_rf_shrink()
893 coex_dm->cur_rf_rx_lpf_shrink) in btc8192e2ant_rf_shrink()
897 coex_dm->cur_rf_rx_lpf_shrink); in btc8192e2ant_rf_shrink()
899 coex_dm->pre_rf_rx_lpf_shrink = coex_dm->cur_rf_rx_lpf_shrink; in btc8192e2ant_rf_shrink()
905 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_set_dac_swing_reg()
910 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x883, 0x3e, val); in btc8192e2ant_set_dac_swing_reg()
927 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_dac_swing()
933 coex_dm->cur_dac_swing_on = dac_swing_on; in btc8192e2ant_dac_swing()
934 coex_dm->cur_dac_swing_lvl = dac_swing_lvl; in btc8192e2ant_dac_swing()
939 coex_dm->pre_dac_swing_on, in btc8192e2ant_dac_swing()
940 coex_dm->pre_dac_swing_lvl); in btc8192e2ant_dac_swing()
943 coex_dm->cur_dac_swing_on, in btc8192e2ant_dac_swing()
944 coex_dm->cur_dac_swing_lvl); in btc8192e2ant_dac_swing()
946 if ((coex_dm->pre_dac_swing_on == coex_dm->cur_dac_swing_on) && in btc8192e2ant_dac_swing()
947 (coex_dm->pre_dac_swing_lvl == coex_dm->cur_dac_swing_lvl)) in btc8192e2ant_dac_swing()
953 coex_dm->pre_dac_swing_on = coex_dm->cur_dac_swing_on; in btc8192e2ant_dac_swing()
954 coex_dm->pre_dac_swing_lvl = coex_dm->cur_dac_swing_lvl; in btc8192e2ant_dac_swing()
960 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_set_agc_table()
966 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x0a1A0001); in btc8192e2ant_set_agc_table()
967 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x091B0001); in btc8192e2ant_set_agc_table()
968 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x081C0001); in btc8192e2ant_set_agc_table()
969 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x071D0001); in btc8192e2ant_set_agc_table()
970 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x061E0001); in btc8192e2ant_set_agc_table()
971 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x051F0001); in btc8192e2ant_set_agc_table()
975 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xaa1A0001); in btc8192e2ant_set_agc_table()
976 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xa91B0001); in btc8192e2ant_set_agc_table()
977 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xa81C0001); in btc8192e2ant_set_agc_table()
978 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xa71D0001); in btc8192e2ant_set_agc_table()
979 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xa61E0001); in btc8192e2ant_set_agc_table()
980 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xa51F0001); in btc8192e2ant_set_agc_table()
987 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_agc_table()
993 coex_dm->cur_agc_table_en = agc_table_en; in btc8192e2ant_agc_table()
998 coex_dm->pre_agc_table_en, in btc8192e2ant_agc_table()
999 coex_dm->cur_agc_table_en); in btc8192e2ant_agc_table()
1001 if (coex_dm->pre_agc_table_en == coex_dm->cur_agc_table_en) in btc8192e2ant_agc_table()
1006 coex_dm->pre_agc_table_en = coex_dm->cur_agc_table_en; in btc8192e2ant_agc_table()
1013 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_set_coex_table()
1017 btcoexist->btc_write_4byte(btcoexist, 0x6c0, val0x6c0); in btc8192e2ant_set_coex_table()
1021 btcoexist->btc_write_4byte(btcoexist, 0x6c4, val0x6c4); in btc8192e2ant_set_coex_table()
1025 btcoexist->btc_write_4byte(btcoexist, 0x6c8, val0x6c8); in btc8192e2ant_set_coex_table()
1029 btcoexist->btc_write_1byte(btcoexist, 0x6cc, val0x6cc); in btc8192e2ant_set_coex_table()
1036 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_coex_table()
1044 coex_dm->cur_val0x6c0 = val0x6c0; in btc8192e2ant_coex_table()
1045 coex_dm->cur_val0x6c4 = val0x6c4; in btc8192e2ant_coex_table()
1046 coex_dm->cur_val0x6c8 = val0x6c8; in btc8192e2ant_coex_table()
1047 coex_dm->cur_val0x6cc = val0x6cc; in btc8192e2ant_coex_table()
1052 coex_dm->pre_val0x6c0, coex_dm->pre_val0x6c4); in btc8192e2ant_coex_table()
1055 coex_dm->pre_val0x6c8, coex_dm->pre_val0x6cc); in btc8192e2ant_coex_table()
1058 coex_dm->cur_val0x6c0, coex_dm->cur_val0x6c4); in btc8192e2ant_coex_table()
1061 coex_dm->cur_val0x6c8, coex_dm->cur_val0x6cc); in btc8192e2ant_coex_table()
1063 if ((coex_dm->pre_val0x6c0 == coex_dm->cur_val0x6c0) && in btc8192e2ant_coex_table()
1064 (coex_dm->pre_val0x6c4 == coex_dm->cur_val0x6c4) && in btc8192e2ant_coex_table()
1065 (coex_dm->pre_val0x6c8 == coex_dm->cur_val0x6c8) && in btc8192e2ant_coex_table()
1066 (coex_dm->pre_val0x6cc == coex_dm->cur_val0x6cc)) in btc8192e2ant_coex_table()
1072 coex_dm->pre_val0x6c0 = coex_dm->cur_val0x6c0; in btc8192e2ant_coex_table()
1073 coex_dm->pre_val0x6c4 = coex_dm->cur_val0x6c4; in btc8192e2ant_coex_table()
1074 coex_dm->pre_val0x6c8 = coex_dm->cur_val0x6c8; in btc8192e2ant_coex_table()
1075 coex_dm->pre_val0x6cc = coex_dm->cur_val0x6cc; in btc8192e2ant_coex_table()
1110 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_set_fw_ignore_wlan_act()
1120 btcoexist->btc_fill_h2c(btcoexist, 0x63, 1, h2c_parameter); in btc8192e2ant_set_fw_ignore_wlan_act()
1126 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_ignore_wlan_act()
1131 coex_dm->cur_ignore_wlan_act = enable; in btc8192e2ant_ignore_wlan_act()
1136 coex_dm->pre_ignore_wlan_act); in btc8192e2ant_ignore_wlan_act()
1139 coex_dm->cur_ignore_wlan_act); in btc8192e2ant_ignore_wlan_act()
1141 if (coex_dm->pre_ignore_wlan_act == in btc8192e2ant_ignore_wlan_act()
1142 coex_dm->cur_ignore_wlan_act) in btc8192e2ant_ignore_wlan_act()
1147 coex_dm->pre_ignore_wlan_act = coex_dm->cur_ignore_wlan_act; in btc8192e2ant_ignore_wlan_act()
1153 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_set_fw_ps_tdma()
1163 coex_dm->ps_tdma_para[0] = byte1; in btc8192e2ant_set_fw_ps_tdma()
1164 coex_dm->ps_tdma_para[1] = byte2; in btc8192e2ant_set_fw_ps_tdma()
1165 coex_dm->ps_tdma_para[2] = byte3; in btc8192e2ant_set_fw_ps_tdma()
1166 coex_dm->ps_tdma_para[3] = byte4; in btc8192e2ant_set_fw_ps_tdma()
1167 coex_dm->ps_tdma_para[4] = byte5; in btc8192e2ant_set_fw_ps_tdma()
1175 btcoexist->btc_fill_h2c(btcoexist, 0x60, 5, h2c_parameter); in btc8192e2ant_set_fw_ps_tdma()
1197 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_ps_tdma()
1203 coex_dm->cur_ps_tdma_on = turn_on; in btc8192e2ant_ps_tdma()
1204 coex_dm->cur_ps_tdma = type; in btc8192e2ant_ps_tdma()
1209 coex_dm->pre_ps_tdma_on, coex_dm->cur_ps_tdma_on); in btc8192e2ant_ps_tdma()
1212 coex_dm->pre_ps_tdma, coex_dm->cur_ps_tdma); in btc8192e2ant_ps_tdma()
1214 if ((coex_dm->pre_ps_tdma_on == coex_dm->cur_ps_tdma_on) && in btc8192e2ant_ps_tdma()
1215 (coex_dm->pre_ps_tdma == coex_dm->cur_ps_tdma)) in btc8192e2ant_ps_tdma()
1317 btcoexist->btc_write_1byte(btcoexist, 0x92c, 0x4); in btc8192e2ant_ps_tdma()
1323 btcoexist->btc_write_1byte(btcoexist, 0x92c, 0x20); in btc8192e2ant_ps_tdma()
1329 coex_dm->pre_ps_tdma_on = coex_dm->cur_ps_tdma_on; in btc8192e2ant_ps_tdma()
1330 coex_dm->pre_ps_tdma = coex_dm->cur_ps_tdma; in btc8192e2ant_ps_tdma()
1336 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_set_switch_ss_type()
1344 coex_dm->cur_ra_mask_type); in btc8192e2ant_set_switch_ss_type()
1350 btcoexist->btc_write_1byte(btcoexist, 0xc04, 0x11); in btc8192e2ant_set_switch_ss_type()
1351 btcoexist->btc_write_1byte(btcoexist, 0xd04, 0x1); in btc8192e2ant_set_switch_ss_type()
1352 btcoexist->btc_write_4byte(btcoexist, 0x90c, 0x81111111); in btc8192e2ant_set_switch_ss_type()
1354 btcoexist->btc_write_1byte_bitmask(btcoexist, 0xe77, 0x4, 0x1); in btc8192e2ant_set_switch_ss_type()
1355 btcoexist->btc_write_1byte(btcoexist, 0xa07, 0x81); in btc8192e2ant_set_switch_ss_type()
1359 btcoexist->btc_write_1byte(btcoexist, 0xc04, 0x33); in btc8192e2ant_set_switch_ss_type()
1360 btcoexist->btc_write_1byte(btcoexist, 0xd04, 0x3); in btc8192e2ant_set_switch_ss_type()
1361 btcoexist->btc_write_4byte(btcoexist, 0x90c, 0x81121313); in btc8192e2ant_set_switch_ss_type()
1362 btcoexist->btc_write_1byte_bitmask(btcoexist, 0xe77, 0x4, 0x0); in btc8192e2ant_set_switch_ss_type()
1363 btcoexist->btc_write_1byte(btcoexist, 0xa07, 0x41); in btc8192e2ant_set_switch_ss_type()
1367 btcoexist->btc_set(btcoexist, BTC_SET_ACT_SEND_MIMO_PS, &mimops); in btc8192e2ant_set_switch_ss_type()
1373 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_switch_ss_type()
1378 coex_dm->cur_ss_type = new_ss_type; in btc8192e2ant_switch_ss_type()
1381 if (coex_dm->pre_ss_type == coex_dm->cur_ss_type) in btc8192e2ant_switch_ss_type()
1384 btc8192e2ant_set_switch_ss_type(btcoexist, coex_dm->cur_ss_type); in btc8192e2ant_switch_ss_type()
1386 coex_dm->pre_ss_type = coex_dm->cur_ss_type; in btc8192e2ant_switch_ss_type()
1423 btcoexist->btc_set(btcoexist, BTC_SET_ACT_DISABLE_LOW_POWER, in btc8192e2ant_action_bt_inquiry()
1439 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_is_common_action()
1440 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; in btc8192e2ant_is_common_action()
1444 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in btc8192e2ant_is_common_action()
1445 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED, in btc8192e2ant_is_common_action()
1447 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in btc8192e2ant_is_common_action()
1449 if (bt_link_info->sco_exist || bt_link_info->hid_exist) in btc8192e2ant_is_common_action()
1456 btcoexist->btc_set(btcoexist, BTC_SET_ACT_DISABLE_LOW_POWER, in btc8192e2ant_is_common_action()
1460 "[BTCoex], Wifi non-connected idle!!\n"); in btc8192e2ant_is_common_action()
1463 coex_dm->bt_status) || in btc8192e2ant_is_common_action()
1465 coex_dm->bt_status)) { in btc8192e2ant_is_common_action()
1488 coex_dm->bt_status) { in btc8192e2ant_is_common_action()
1490 btcoexist->btc_set(btcoexist, in btc8192e2ant_is_common_action()
1495 "Wifi connected + BT non connected-idle!!\n"); in btc8192e2ant_is_common_action()
1512 coex_dm->bt_status) { in btc8192e2ant_is_common_action()
1514 btcoexist->btc_set(btcoexist, in btc8192e2ant_is_common_action()
1521 "Wifi connected + BT connected-idle!!\n"); in btc8192e2ant_is_common_action()
1541 btcoexist->btc_set(btcoexist, in btc8192e2ant_is_common_action()
1547 "Wifi Connected-Busy + BT Busy!!\n"); in btc8192e2ant_is_common_action()
1551 "Wifi Connected-Idle + BT Busy!!\n"); in btc8192e2ant_is_common_action()
1579 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_tdma_duration_adjust()
1586 if (!coex_dm->auto_tdma_adjust) { in btc8192e2ant_tdma_duration_adjust()
1587 coex_dm->auto_tdma_adjust = true; in btc8192e2ant_tdma_duration_adjust()
1596 coex_dm->tdma_adj_type = 13; in btc8192e2ant_tdma_duration_adjust()
1601 coex_dm->tdma_adj_type = 14; in btc8192e2ant_tdma_duration_adjust()
1606 coex_dm->tdma_adj_type = 15; in btc8192e2ant_tdma_duration_adjust()
1613 coex_dm->tdma_adj_type = 9; in btc8192e2ant_tdma_duration_adjust()
1618 coex_dm->tdma_adj_type = 10; in btc8192e2ant_tdma_duration_adjust()
1623 coex_dm->tdma_adj_type = 11; in btc8192e2ant_tdma_duration_adjust()
1632 coex_dm->tdma_adj_type = 5; in btc8192e2ant_tdma_duration_adjust()
1637 coex_dm->tdma_adj_type = 6; in btc8192e2ant_tdma_duration_adjust()
1642 coex_dm->tdma_adj_type = 7; in btc8192e2ant_tdma_duration_adjust()
1649 coex_dm->tdma_adj_type = 1; in btc8192e2ant_tdma_duration_adjust()
1654 coex_dm->tdma_adj_type = 2; in btc8192e2ant_tdma_duration_adjust()
1659 coex_dm->tdma_adj_type = 3; in btc8192e2ant_tdma_duration_adjust()
1671 retry_cnt = coex_sta->bt_retry_cnt; in btc8192e2ant_tdma_duration_adjust()
1678 /* no retry in the last 2-second duration */ in btc8192e2ant_tdma_duration_adjust()
1681 dn--; in btc8192e2ant_tdma_duration_adjust()
1695 up--; in btc8192e2ant_tdma_duration_adjust()
1742 if (coex_dm->cur_ps_tdma != coex_dm->tdma_adj_type) { in btc8192e2ant_tdma_duration_adjust()
1749 coex_dm->cur_ps_tdma, coex_dm->tdma_adj_type); in btc8192e2ant_tdma_duration_adjust()
1751 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan); in btc8192e2ant_tdma_duration_adjust()
1752 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link); in btc8192e2ant_tdma_duration_adjust()
1753 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam); in btc8192e2ant_tdma_duration_adjust()
1757 true, coex_dm->tdma_adj_type); in btc8192e2ant_tdma_duration_adjust()
1795 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in btc8192e2ant_action_sco()
1857 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in btc8192e2ant_action_sco_pan()
1902 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in btc8192e2ant_action_hid()
1953 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_action_a2dp()
1966 "[BTCoex], A2dp, wifi/bt rssi both LOW!!\n"); in btc8192e2ant_action_a2dp()
1988 coex_dm->auto_tdma_adjust = false; in btc8192e2ant_action_a2dp()
2010 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in btc8192e2ant_action_a2dp()
2069 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in btc8192e2ant_action_a2dp_pan_hs()
2129 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in btc8192e2ant_action_pan_edr()
2187 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in btc8192e2ant_action_pan_hs()
2233 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in btc8192e2ant_action_pan_edr_a2dp()
2287 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in btc8192e2ant_action_pan_edr_hid()
2355 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in btc8192e2ant_action_hid_a2dp_pan_edr()
2414 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in btc8192e2ant_action_hid_a2dp()
2464 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_run_coexist_mechanism()
2470 if (btcoexist->manual_control) { in btc8192e2ant_run_coexist_mechanism()
2476 if (coex_sta->under_ips) { in btc8192e2ant_run_coexist_mechanism()
2483 if (coex_sta->c2h_bt_inquiry_page && in btc8192e2ant_run_coexist_mechanism()
2491 coex_dm->cur_algorithm = algorithm; in btc8192e2ant_run_coexist_mechanism()
2493 "[BTCoex], Algorithm = %d\n", coex_dm->cur_algorithm); in btc8192e2ant_run_coexist_mechanism()
2497 "[BTCoex], Action 2-Ant common\n"); in btc8192e2ant_run_coexist_mechanism()
2498 coex_dm->auto_tdma_adjust = false; in btc8192e2ant_run_coexist_mechanism()
2500 if (coex_dm->cur_algorithm != coex_dm->pre_algorithm) { in btc8192e2ant_run_coexist_mechanism()
2503 coex_dm->pre_algorithm, in btc8192e2ant_run_coexist_mechanism()
2504 coex_dm->cur_algorithm); in btc8192e2ant_run_coexist_mechanism()
2505 coex_dm->auto_tdma_adjust = false; in btc8192e2ant_run_coexist_mechanism()
2507 switch (coex_dm->cur_algorithm) { in btc8192e2ant_run_coexist_mechanism()
2510 "Action 2-Ant, algorithm = SCO\n"); in btc8192e2ant_run_coexist_mechanism()
2515 "Action 2-Ant, algorithm = SCO+PAN(EDR)\n"); in btc8192e2ant_run_coexist_mechanism()
2520 "Action 2-Ant, algorithm = HID\n"); in btc8192e2ant_run_coexist_mechanism()
2525 "Action 2-Ant, algorithm = A2DP\n"); in btc8192e2ant_run_coexist_mechanism()
2530 "Action 2-Ant, algorithm = A2DP+PAN(HS)\n"); in btc8192e2ant_run_coexist_mechanism()
2535 "Action 2-Ant, algorithm = PAN(EDR)\n"); in btc8192e2ant_run_coexist_mechanism()
2540 "Action 2-Ant, algorithm = HS mode\n"); in btc8192e2ant_run_coexist_mechanism()
2545 "Action 2-Ant, algorithm = PAN+A2DP\n"); in btc8192e2ant_run_coexist_mechanism()
2550 "Action 2-Ant, algorithm = PAN(EDR)+HID\n"); in btc8192e2ant_run_coexist_mechanism()
2555 "Action 2-Ant, algorithm = HID+A2DP+PAN\n"); in btc8192e2ant_run_coexist_mechanism()
2560 "Action 2-Ant, algorithm = HID+A2DP\n"); in btc8192e2ant_run_coexist_mechanism()
2565 "Action 2-Ant, algorithm = unknown!!\n"); in btc8192e2ant_run_coexist_mechanism()
2569 coex_dm->pre_algorithm = coex_dm->cur_algorithm; in btc8192e2ant_run_coexist_mechanism()
2576 struct rtl_priv *rtlpriv = btcoexist->adapter; in btc8192e2ant_init_hwconfig()
2585 coex_dm->bt_rf0x1e_backup = in btc8192e2ant_init_hwconfig()
2586 btcoexist->btc_get_rf_reg(btcoexist, BTC_RF_A, in btc8192e2ant_init_hwconfig()
2589 coex_dm->backup_arfr_cnt1 = btcoexist->btc_read_4byte(btcoexist, in btc8192e2ant_init_hwconfig()
2591 coex_dm->backup_arfr_cnt2 = btcoexist->btc_read_4byte(btcoexist, in btc8192e2ant_init_hwconfig()
2593 coex_dm->backup_retry_limit = btcoexist->btc_read_2byte( in btc8192e2ant_init_hwconfig()
2596 coex_dm->backup_ampdu_maxtime = btcoexist->btc_read_1byte( in btc8192e2ant_init_hwconfig()
2602 btcoexist->btc_write_1byte(btcoexist, 0x4f, 0x6); in btc8192e2ant_init_hwconfig()
2603 btcoexist->btc_write_1byte(btcoexist, 0x944, 0x24); in btc8192e2ant_init_hwconfig()
2604 btcoexist->btc_write_4byte(btcoexist, 0x930, 0x700700); in btc8192e2ant_init_hwconfig()
2605 btcoexist->btc_write_1byte(btcoexist, 0x92c, 0x20); in btc8192e2ant_init_hwconfig()
2606 if (btcoexist->chip_interface == BTC_INTF_USB) in btc8192e2ant_init_hwconfig()
2607 btcoexist->btc_write_4byte(btcoexist, 0x64, 0x30430004); in btc8192e2ant_init_hwconfig()
2609 btcoexist->btc_write_4byte(btcoexist, 0x64, 0x30030004); in btc8192e2ant_init_hwconfig()
2614 btcoexist->btc_write_4byte(btcoexist, 0x858, 0x55555555); in btc8192e2ant_init_hwconfig()
2617 btcoexist->btc_write_1byte(btcoexist, 0x778, 0x3); in btc8192e2ant_init_hwconfig()
2619 u8tmp = btcoexist->btc_read_1byte(btcoexist, 0x790); in btc8192e2ant_init_hwconfig()
2622 btcoexist->btc_write_1byte(btcoexist, 0x790, u8tmp); in btc8192e2ant_init_hwconfig()
2625 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0x4); in btc8192e2ant_init_hwconfig()
2628 btcoexist->btc_write_1byte(btcoexist, 0x40, 0x20); in btc8192e2ant_init_hwconfig()
2630 u16tmp = btcoexist->btc_read_2byte(btcoexist, 0x40); in btc8192e2ant_init_hwconfig()
2632 btcoexist->btc_write_2byte(btcoexist, 0x40, u16tmp); in btc8192e2ant_init_hwconfig()
2635 u8tmp = btcoexist->btc_read_1byte(btcoexist, 0x101); in btc8192e2ant_init_hwconfig()
2637 btcoexist->btc_write_1byte(btcoexist, 0x101, u8tmp); in btc8192e2ant_init_hwconfig()
2640 u8tmp = btcoexist->btc_read_1byte(btcoexist, 0x93); in btc8192e2ant_init_hwconfig()
2642 btcoexist->btc_write_1byte(btcoexist, 0x93, u8tmp); in btc8192e2ant_init_hwconfig()
2644 u8tmp = btcoexist->btc_read_1byte(btcoexist, 0x7); in btc8192e2ant_init_hwconfig()
2646 btcoexist->btc_write_1byte(btcoexist, 0x7, u8tmp); in btc8192e2ant_init_hwconfig()
2660 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8192e2ant_init_coex_dm()
2670 struct btc_board_info *board_info = &btcoexist->board_info; in ex_btc8192e2ant_display_coex_info()
2671 struct btc_stack_info *stack_info = &btcoexist->stack_info; in ex_btc8192e2ant_display_coex_info()
2684 if (btcoexist->manual_control) { in ex_btc8192e2ant_display_coex_info()
2689 seq_printf(m, "\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", in ex_btc8192e2ant_display_coex_info()
2690 board_info->pg_ant_num, board_info->btdm_ant_num); in ex_btc8192e2ant_display_coex_info()
2692 seq_printf(m, "\n %-35s = %s / %d", "BT stack/ hci ext ver", in ex_btc8192e2ant_display_coex_info()
2693 ((stack_info->profile_notified) ? "Yes" : "No"), in ex_btc8192e2ant_display_coex_info()
2694 stack_info->hci_version); in ex_btc8192e2ant_display_coex_info()
2696 btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver); in ex_btc8192e2ant_display_coex_info()
2697 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver); in ex_btc8192e2ant_display_coex_info()
2698 seq_printf(m, "\n %-35s = %d_%d/ 0x%x/ 0x%x(%d)", in ex_btc8192e2ant_display_coex_info()
2703 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in ex_btc8192e2ant_display_coex_info()
2704 btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_DOT11_CHNL, in ex_btc8192e2ant_display_coex_info()
2706 btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl); in ex_btc8192e2ant_display_coex_info()
2707 seq_printf(m, "\n %-35s = %d / %d(%d)", in ex_btc8192e2ant_display_coex_info()
2711 seq_printf(m, "\n %-35s = %3ph ", in ex_btc8192e2ant_display_coex_info()
2712 "H2C Wifi inform bt chnl Info", coex_dm->wifi_chnl_info); in ex_btc8192e2ant_display_coex_info()
2714 btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); in ex_btc8192e2ant_display_coex_info()
2715 btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi); in ex_btc8192e2ant_display_coex_info()
2716 seq_printf(m, "\n %-35s = %d/ %d", in ex_btc8192e2ant_display_coex_info()
2719 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan); in ex_btc8192e2ant_display_coex_info()
2720 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link); in ex_btc8192e2ant_display_coex_info()
2721 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam); in ex_btc8192e2ant_display_coex_info()
2722 seq_printf(m, "\n %-35s = %d/ %d/ %d ", in ex_btc8192e2ant_display_coex_info()
2725 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g); in ex_btc8192e2ant_display_coex_info()
2726 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in ex_btc8192e2ant_display_coex_info()
2727 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in ex_btc8192e2ant_display_coex_info()
2728 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, in ex_btc8192e2ant_display_coex_info()
2730 seq_printf(m, "\n %-35s = %s / %s/ %s ", in ex_btc8192e2ant_display_coex_info()
2738 seq_printf(m, "\n %-35s = [%s/ %d/ %d] ", in ex_btc8192e2ant_display_coex_info()
2740 ((btcoexist->bt_info.bt_disabled) ? ("disabled") : in ex_btc8192e2ant_display_coex_info()
2741 ((coex_sta->c2h_bt_inquiry_page) ? in ex_btc8192e2ant_display_coex_info()
2744 coex_dm->bt_status) ? "non-connected idle" : in ex_btc8192e2ant_display_coex_info()
2746 coex_dm->bt_status) ? "connected-idle" : "busy")))), in ex_btc8192e2ant_display_coex_info()
2747 coex_sta->bt_rssi, coex_sta->bt_retry_cnt); in ex_btc8192e2ant_display_coex_info()
2749 seq_printf(m, "\n %-35s = %d / %d / %d / %d", in ex_btc8192e2ant_display_coex_info()
2750 "SCO/HID/PAN/A2DP", stack_info->sco_exist, in ex_btc8192e2ant_display_coex_info()
2751 stack_info->hid_exist, stack_info->pan_exist, in ex_btc8192e2ant_display_coex_info()
2752 stack_info->a2dp_exist); in ex_btc8192e2ant_display_coex_info()
2753 btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_BT_LINK_INFO, m); in ex_btc8192e2ant_display_coex_info()
2755 bt_info_ext = coex_sta->bt_info_ext; in ex_btc8192e2ant_display_coex_info()
2756 seq_printf(m, "\n %-35s = %s", in ex_btc8192e2ant_display_coex_info()
2761 if (coex_sta->bt_info_c2h_cnt[i]) { in ex_btc8192e2ant_display_coex_info()
2762 seq_printf(m, "\n %-35s = %7ph(%d)", in ex_btc8192e2ant_display_coex_info()
2764 coex_sta->bt_info_c2h[i], in ex_btc8192e2ant_display_coex_info()
2765 coex_sta->bt_info_c2h_cnt[i]); in ex_btc8192e2ant_display_coex_info()
2769 seq_printf(m, "\n %-35s = %s/%s", in ex_btc8192e2ant_display_coex_info()
2771 ((coex_sta->under_ips ? "IPS ON" : "IPS OFF")), in ex_btc8192e2ant_display_coex_info()
2772 ((coex_sta->under_lps ? "LPS ON" : "LPS OFF"))); in ex_btc8192e2ant_display_coex_info()
2773 btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD, m); in ex_btc8192e2ant_display_coex_info()
2775 seq_printf(m, "\n %-35s = 0x%x ", "SS Type", in ex_btc8192e2ant_display_coex_info()
2776 coex_dm->cur_ss_type); in ex_btc8192e2ant_display_coex_info()
2779 seq_printf(m, "\n %-35s", in ex_btc8192e2ant_display_coex_info()
2781 seq_printf(m, "\n %-35s = %d/ %d/ %d ", in ex_btc8192e2ant_display_coex_info()
2782 "SM1[ShRf/ LpRA/ LimDig]", coex_dm->cur_rf_rx_lpf_shrink, in ex_btc8192e2ant_display_coex_info()
2783 coex_dm->cur_low_penalty_ra, coex_dm->limited_dig); in ex_btc8192e2ant_display_coex_info()
2784 seq_printf(m, "\n %-35s = %d/ %d/ %d(0x%x) ", in ex_btc8192e2ant_display_coex_info()
2786 coex_dm->cur_agc_table_en, coex_dm->cur_adc_back_off, in ex_btc8192e2ant_display_coex_info()
2787 coex_dm->cur_dac_swing_on, coex_dm->cur_dac_swing_lvl); in ex_btc8192e2ant_display_coex_info()
2789 seq_printf(m, "\n %-35s = 0x%x ", "Rate Mask", in ex_btc8192e2ant_display_coex_info()
2790 btcoexist->bt_info.ra_mask); in ex_btc8192e2ant_display_coex_info()
2793 seq_printf(m, "\n %-35s", in ex_btc8192e2ant_display_coex_info()
2796 ps_tdma_case = coex_dm->cur_ps_tdma; in ex_btc8192e2ant_display_coex_info()
2798 "\n %-35s = %5ph case-%d (auto:%d)", in ex_btc8192e2ant_display_coex_info()
2799 "PS TDMA", coex_dm->ps_tdma_para, in ex_btc8192e2ant_display_coex_info()
2800 ps_tdma_case, coex_dm->auto_tdma_adjust); in ex_btc8192e2ant_display_coex_info()
2802 seq_printf(m, "\n %-35s = %d/ %d ", in ex_btc8192e2ant_display_coex_info()
2804 coex_dm->cur_dec_bt_pwr, coex_dm->cur_ignore_wlan_act); in ex_btc8192e2ant_display_coex_info()
2807 seq_printf(m, "\n %-35s", in ex_btc8192e2ant_display_coex_info()
2810 seq_printf(m, "\n %-35s = 0x%x", in ex_btc8192e2ant_display_coex_info()
2811 "RF-A, 0x1e initVal", coex_dm->bt_rf0x1e_backup); in ex_btc8192e2ant_display_coex_info()
2813 seq_printf(m, "\n %-35s = 0x%x/0x%x/0x%x/0x%x", in ex_btc8192e2ant_display_coex_info()
2814 "backup ARFR1/ARFR2/RL/AMaxTime", coex_dm->backup_arfr_cnt1, in ex_btc8192e2ant_display_coex_info()
2815 coex_dm->backup_arfr_cnt2, coex_dm->backup_retry_limit, in ex_btc8192e2ant_display_coex_info()
2816 coex_dm->backup_ampdu_maxtime); in ex_btc8192e2ant_display_coex_info()
2818 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x430); in ex_btc8192e2ant_display_coex_info()
2819 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x434); in ex_btc8192e2ant_display_coex_info()
2820 u16tmp[0] = btcoexist->btc_read_2byte(btcoexist, 0x42a); in ex_btc8192e2ant_display_coex_info()
2821 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x456); in ex_btc8192e2ant_display_coex_info()
2822 seq_printf(m, "\n %-35s = 0x%x/0x%x/0x%x/0x%x", in ex_btc8192e2ant_display_coex_info()
2826 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc04); in ex_btc8192e2ant_display_coex_info()
2827 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0xd04); in ex_btc8192e2ant_display_coex_info()
2828 u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x90c); in ex_btc8192e2ant_display_coex_info()
2829 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x", in ex_btc8192e2ant_display_coex_info()
2832 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778); in ex_btc8192e2ant_display_coex_info()
2833 seq_printf(m, "\n %-35s = 0x%x", "0x778", u8tmp[0]); in ex_btc8192e2ant_display_coex_info()
2835 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x92c); in ex_btc8192e2ant_display_coex_info()
2836 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x930); in ex_btc8192e2ant_display_coex_info()
2837 seq_printf(m, "\n %-35s = 0x%x/ 0x%x", in ex_btc8192e2ant_display_coex_info()
2840 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x40); in ex_btc8192e2ant_display_coex_info()
2841 u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x4f); in ex_btc8192e2ant_display_coex_info()
2842 seq_printf(m, "\n %-35s = 0x%x/ 0x%x", in ex_btc8192e2ant_display_coex_info()
2845 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550); in ex_btc8192e2ant_display_coex_info()
2846 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522); in ex_btc8192e2ant_display_coex_info()
2847 seq_printf(m, "\n %-35s = 0x%x/ 0x%x", in ex_btc8192e2ant_display_coex_info()
2850 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50); in ex_btc8192e2ant_display_coex_info()
2851 seq_printf(m, "\n %-35s = 0x%x", "0xc50(dig)", in ex_btc8192e2ant_display_coex_info()
2854 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0); in ex_btc8192e2ant_display_coex_info()
2855 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4); in ex_btc8192e2ant_display_coex_info()
2856 u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8); in ex_btc8192e2ant_display_coex_info()
2857 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x6cc); in ex_btc8192e2ant_display_coex_info()
2859 "\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", in ex_btc8192e2ant_display_coex_info()
2863 seq_printf(m, "\n %-35s = %d/ %d", in ex_btc8192e2ant_display_coex_info()
2864 "0x770(hp rx[31:16]/tx[15:0])", in ex_btc8192e2ant_display_coex_info()
2865 coex_sta->high_priority_rx, coex_sta->high_priority_tx); in ex_btc8192e2ant_display_coex_info()
2866 seq_printf(m, "\n %-35s = %d/ %d", in ex_btc8192e2ant_display_coex_info()
2867 "0x774(lp rx[31:16]/tx[15:0])", in ex_btc8192e2ant_display_coex_info()
2868 coex_sta->low_priority_rx, coex_sta->low_priority_tx); in ex_btc8192e2ant_display_coex_info()
2869 if (btcoexist->auto_report_2ant) in ex_btc8192e2ant_display_coex_info()
2871 btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS, m); in ex_btc8192e2ant_display_coex_info()
2876 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8192e2ant_ips_notify()
2881 coex_sta->under_ips = true; in ex_btc8192e2ant_ips_notify()
2886 coex_sta->under_ips = false; in ex_btc8192e2ant_ips_notify()
2892 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8192e2ant_lps_notify()
2897 coex_sta->under_lps = true; in ex_btc8192e2ant_lps_notify()
2901 coex_sta->under_lps = false; in ex_btc8192e2ant_lps_notify()
2907 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8192e2ant_scan_notify()
2919 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8192e2ant_connect_notify()
2932 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8192e2ant_media_status_notify()
2937 if (btcoexist->manual_control || in ex_btc8192e2ant_media_status_notify()
2938 btcoexist->stop_coex_dm || in ex_btc8192e2ant_media_status_notify()
2939 btcoexist->bt_info.bt_disabled) in ex_btc8192e2ant_media_status_notify()
2950 btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, in ex_btc8192e2ant_media_status_notify()
2956 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in ex_btc8192e2ant_media_status_notify()
2963 coex_dm->wifi_chnl_info[0] = h2c_parameter[0]; in ex_btc8192e2ant_media_status_notify()
2964 coex_dm->wifi_chnl_info[1] = h2c_parameter[1]; in ex_btc8192e2ant_media_status_notify()
2965 coex_dm->wifi_chnl_info[2] = h2c_parameter[2]; in ex_btc8192e2ant_media_status_notify()
2972 btcoexist->btc_fill_h2c(btcoexist, 0x66, 3, h2c_parameter); in ex_btc8192e2ant_media_status_notify()
2978 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8192e2ant_special_packet_notify()
2988 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8192e2ant_bt_info_notify()
2994 coex_sta->c2h_bt_info_req_sent = false; in ex_btc8192e2ant_bt_info_notify()
2999 coex_sta->bt_info_c2h_cnt[rsp_source]++; in ex_btc8192e2ant_bt_info_notify()
3005 coex_sta->bt_info_c2h[rsp_source][i] = tmp_buf[i]; in ex_btc8192e2ant_bt_info_notify()
3008 if (i == length-1) in ex_btc8192e2ant_bt_info_notify()
3018 coex_sta->bt_retry_cnt = in ex_btc8192e2ant_bt_info_notify()
3019 coex_sta->bt_info_c2h[rsp_source][2] & 0xf; in ex_btc8192e2ant_bt_info_notify()
3021 coex_sta->bt_rssi = in ex_btc8192e2ant_bt_info_notify()
3022 coex_sta->bt_info_c2h[rsp_source][3] * 2 + 10; in ex_btc8192e2ant_bt_info_notify()
3024 coex_sta->bt_info_ext = in ex_btc8192e2ant_bt_info_notify()
3025 coex_sta->bt_info_c2h[rsp_source][4]; in ex_btc8192e2ant_bt_info_notify()
3030 if ((coex_sta->bt_info_ext & BIT1)) { in ex_btc8192e2ant_bt_info_notify()
3033 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED, in ex_btc8192e2ant_bt_info_notify()
3045 if ((coex_sta->bt_info_ext & BIT3)) { in ex_btc8192e2ant_bt_info_notify()
3046 if (!btcoexist->manual_control && in ex_btc8192e2ant_bt_info_notify()
3047 !btcoexist->stop_coex_dm) { in ex_btc8192e2ant_bt_info_notify()
3060 if (!btcoexist->auto_report_2ant) { in ex_btc8192e2ant_bt_info_notify()
3061 if (!(coex_sta->bt_info_ext & BIT4)) in ex_btc8192e2ant_bt_info_notify()
3070 coex_sta->c2h_bt_inquiry_page = true; in ex_btc8192e2ant_bt_info_notify()
3072 coex_sta->c2h_bt_inquiry_page = false; in ex_btc8192e2ant_bt_info_notify()
3076 coex_sta->bt_link_exist = false; in ex_btc8192e2ant_bt_info_notify()
3077 coex_sta->pan_exist = false; in ex_btc8192e2ant_bt_info_notify()
3078 coex_sta->a2dp_exist = false; in ex_btc8192e2ant_bt_info_notify()
3079 coex_sta->hid_exist = false; in ex_btc8192e2ant_bt_info_notify()
3080 coex_sta->sco_exist = false; in ex_btc8192e2ant_bt_info_notify()
3082 coex_sta->bt_link_exist = true; in ex_btc8192e2ant_bt_info_notify()
3084 coex_sta->pan_exist = true; in ex_btc8192e2ant_bt_info_notify()
3086 coex_sta->pan_exist = false; in ex_btc8192e2ant_bt_info_notify()
3088 coex_sta->a2dp_exist = true; in ex_btc8192e2ant_bt_info_notify()
3090 coex_sta->a2dp_exist = false; in ex_btc8192e2ant_bt_info_notify()
3092 coex_sta->hid_exist = true; in ex_btc8192e2ant_bt_info_notify()
3094 coex_sta->hid_exist = false; in ex_btc8192e2ant_bt_info_notify()
3096 coex_sta->sco_exist = true; in ex_btc8192e2ant_bt_info_notify()
3098 coex_sta->sco_exist = false; in ex_btc8192e2ant_bt_info_notify()
3104 coex_dm->bt_status = BT_8192E_2ANT_BT_STATUS_NON_CONNECTED_IDLE; in ex_btc8192e2ant_bt_info_notify()
3106 "[BTCoex], BT Non-Connected idle!!!\n"); in ex_btc8192e2ant_bt_info_notify()
3108 coex_dm->bt_status = BT_8192E_2ANT_BT_STATUS_CONNECTED_IDLE; in ex_btc8192e2ant_bt_info_notify()
3110 "[BTCoex], bt_infoNotify(), BT Connected-idle!!!\n"); in ex_btc8192e2ant_bt_info_notify()
3113 coex_dm->bt_status = BT_8192E_2ANT_BT_STATUS_SCO_BUSY; in ex_btc8192e2ant_bt_info_notify()
3117 coex_dm->bt_status = BT_8192E_2ANT_BT_STATUS_ACL_BUSY; in ex_btc8192e2ant_bt_info_notify()
3121 coex_dm->bt_status = BT_8192E_2ANT_BT_STATUS_MAX; in ex_btc8192e2ant_bt_info_notify()
3123 "[BTCoex]bt_infoNotify(), BT Non-Defined state!!!\n"); in ex_btc8192e2ant_bt_info_notify()
3126 if ((BT_8192E_2ANT_BT_STATUS_ACL_BUSY == coex_dm->bt_status) || in ex_btc8192e2ant_bt_info_notify()
3127 (BT_8192E_2ANT_BT_STATUS_SCO_BUSY == coex_dm->bt_status) || in ex_btc8192e2ant_bt_info_notify()
3128 (BT_8192E_2ANT_BT_STATUS_ACL_SCO_BUSY == coex_dm->bt_status)) { in ex_btc8192e2ant_bt_info_notify()
3136 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bt_busy); in ex_btc8192e2ant_bt_info_notify()
3138 coex_dm->limited_dig = limited_dig; in ex_btc8192e2ant_bt_info_notify()
3139 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_LIMITED_DIG, &limited_dig); in ex_btc8192e2ant_bt_info_notify()
3146 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8192e2ant_halt_notify()
3156 struct rtl_priv *rtlpriv = btcoexist->adapter; in ex_btc8192e2ant_periodical()
3159 struct btc_board_info *board_info = &btcoexist->board_info; in ex_btc8192e2ant_periodical()
3160 struct btc_stack_info *stack_info = &btcoexist->stack_info; in ex_btc8192e2ant_periodical()
3170 board_info->pg_ant_num, board_info->btdm_ant_num, in ex_btc8192e2ant_periodical()
3171 board_info->btdm_ant_pos); in ex_btc8192e2ant_periodical()
3174 ((stack_info->profile_notified) ? "Yes" : "No"), in ex_btc8192e2ant_periodical()
3175 stack_info->hci_version); in ex_btc8192e2ant_periodical()
3176 btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, in ex_btc8192e2ant_periodical()
3178 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver); in ex_btc8192e2ant_periodical()
3187 if (!btcoexist->auto_report_2ant) { in ex_btc8192e2ant_periodical()
3193 coex_dm->auto_tdma_adjust) in ex_btc8192e2ant_periodical()