Lines Matching refs:btcoexist

23 static bool halbtc_is_bt_coexist_available(struct btc_coexist *btcoexist)  in halbtc_is_bt_coexist_available()  argument
25 if (!btcoexist->binded || NULL == btcoexist->adapter) in halbtc_is_bt_coexist_available()
46 static bool is_any_client_connect_to_ap(struct btc_coexist *btcoexist) in is_any_client_connect_to_ap() argument
48 struct rtl_priv *rtlpriv = btcoexist->adapter; in is_any_client_connect_to_ap()
86 static u32 halbtc_get_wifi_bw(struct btc_coexist *btcoexist) in halbtc_get_wifi_bw() argument
88 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_get_wifi_bw()
111 static u8 halbtc_get_wifi_central_chnl(struct btc_coexist *btcoexist) in halbtc_get_wifi_central_chnl() argument
113 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_get_wifi_central_chnl()
126 return rtlpriv->btcoexist.btc_info.single_ant_path; in rtl_get_hwpg_single_ant_path()
131 return rtlpriv->btcoexist.btc_info.bt_type; in rtl_get_hwpg_bt_type()
138 if (rtlpriv->btcoexist.btc_info.ant_num == ANT_X2) in rtl_get_hwpg_ant_num()
162 bool halbtc_is_hw_mailbox_exist(struct btc_coexist *btcoexist) in halbtc_is_hw_mailbox_exist() argument
164 if (IS_HARDWARE_TYPE_8812(btcoexist->adapter)) in halbtc_is_hw_mailbox_exist()
171 bool halbtc_send_bt_mp_operation(struct btc_coexist *btcoexist, u8 op_code, in halbtc_send_bt_mp_operation() argument
178 if (!halbtc_is_hw_mailbox_exist(btcoexist)) in halbtc_send_bt_mp_operation()
182 reinit_completion(&btcoexist->bt_mp_comp); in halbtc_send_bt_mp_operation()
184 rtlpriv = btcoexist->adapter; in halbtc_send_bt_mp_operation()
243 if (wait_for_completion_timeout(&btcoexist->bt_mp_comp, in halbtc_send_bt_mp_operation()
254 static void halbtc_leave_lps(struct btc_coexist *btcoexist) in halbtc_leave_lps() argument
259 rtlpriv = btcoexist->adapter; in halbtc_leave_lps()
261 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, in halbtc_leave_lps()
270 btcoexist->bt_info.bt_ctrl_lps = true; in halbtc_leave_lps()
271 btcoexist->bt_info.bt_lps_on = false; in halbtc_leave_lps()
276 static void halbtc_enter_lps(struct btc_coexist *btcoexist) in halbtc_enter_lps() argument
281 rtlpriv = btcoexist->adapter; in halbtc_enter_lps()
283 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, in halbtc_enter_lps()
292 btcoexist->bt_info.bt_ctrl_lps = true; in halbtc_enter_lps()
293 btcoexist->bt_info.bt_lps_on = true; in halbtc_enter_lps()
298 static void halbtc_normal_lps(struct btc_coexist *btcoexist) in halbtc_normal_lps() argument
302 rtlpriv = btcoexist->adapter; in halbtc_normal_lps()
304 if (btcoexist->bt_info.bt_ctrl_lps) { in halbtc_normal_lps()
305 btcoexist->bt_info.bt_lps_on = false; in halbtc_normal_lps()
308 btcoexist->bt_info.bt_ctrl_lps = false; in halbtc_normal_lps()
312 static void halbtc_pre_normal_lps(struct btc_coexist *btcoexist) in halbtc_pre_normal_lps() argument
314 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_pre_normal_lps()
316 if (btcoexist->bt_info.bt_ctrl_lps) { in halbtc_pre_normal_lps()
317 btcoexist->bt_info.bt_lps_on = false; in halbtc_pre_normal_lps()
323 static void halbtc_post_normal_lps(struct btc_coexist *btcoexist) in halbtc_post_normal_lps() argument
325 if (btcoexist->bt_info.bt_ctrl_lps) in halbtc_post_normal_lps()
326 btcoexist->bt_info.bt_ctrl_lps = false; in halbtc_post_normal_lps()
329 static void halbtc_leave_low_power(struct btc_coexist *btcoexist) in halbtc_leave_low_power() argument
333 static void halbtc_normal_low_power(struct btc_coexist *btcoexist) in halbtc_normal_low_power() argument
337 static void halbtc_disable_low_power(struct btc_coexist *btcoexist, in halbtc_disable_low_power() argument
341 btcoexist->bt_info.bt_disable_low_pwr = low_pwr_disable; in halbtc_disable_low_power()
344 static void halbtc_aggregation_check(struct btc_coexist *btcoexist) in halbtc_aggregation_check() argument
349 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_aggregation_check()
363 if (btcoexist->bt_info.reject_agg_pkt) { in halbtc_aggregation_check()
365 btcoexist->bt_info.pre_reject_agg_pkt = in halbtc_aggregation_check()
366 btcoexist->bt_info.reject_agg_pkt; in halbtc_aggregation_check()
368 if (btcoexist->bt_info.pre_reject_agg_pkt) { in halbtc_aggregation_check()
370 btcoexist->bt_info.pre_reject_agg_pkt = in halbtc_aggregation_check()
371 btcoexist->bt_info.reject_agg_pkt; in halbtc_aggregation_check()
374 if (btcoexist->bt_info.pre_bt_ctrl_agg_buf_size != in halbtc_aggregation_check()
375 btcoexist->bt_info.bt_ctrl_agg_buf_size) { in halbtc_aggregation_check()
377 btcoexist->bt_info.pre_bt_ctrl_agg_buf_size = in halbtc_aggregation_check()
378 btcoexist->bt_info.bt_ctrl_agg_buf_size; in halbtc_aggregation_check()
381 if (btcoexist->bt_info.bt_ctrl_agg_buf_size) { in halbtc_aggregation_check()
382 if (btcoexist->bt_info.pre_agg_buf_size != in halbtc_aggregation_check()
383 btcoexist->bt_info.agg_buf_size) { in halbtc_aggregation_check()
386 btcoexist->bt_info.pre_agg_buf_size = in halbtc_aggregation_check()
387 btcoexist->bt_info.agg_buf_size; in halbtc_aggregation_check()
395 static u32 halbtc_get_bt_patch_version(struct btc_coexist *btcoexist) in halbtc_get_bt_patch_version() argument
399 if (btcoexist->bt_info.bt_real_fw_ver) in halbtc_get_bt_patch_version()
403 halbtc_send_bt_mp_operation(btcoexist, BT_OP_GET_BT_VERSION, in halbtc_get_bt_patch_version()
407 return btcoexist->bt_info.bt_real_fw_ver; in halbtc_get_bt_patch_version()
412 struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context; in halbtc_get_bt_coex_supported_feature() local
415 if (btcoexist->bt_info.bt_supported_feature) in halbtc_get_bt_coex_supported_feature()
419 halbtc_send_bt_mp_operation(btcoexist, in halbtc_get_bt_coex_supported_feature()
424 return btcoexist->bt_info.bt_supported_feature; in halbtc_get_bt_coex_supported_feature()
429 struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context; in halbtc_get_bt_coex_supported_version() local
432 if (btcoexist->bt_info.bt_supported_version) in halbtc_get_bt_coex_supported_version()
436 halbtc_send_bt_mp_operation(btcoexist, in halbtc_get_bt_coex_supported_version()
441 return btcoexist->bt_info.bt_supported_version; in halbtc_get_bt_coex_supported_version()
446 struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context; in halbtc_get_bt_device_info() local
450 halbtc_send_bt_mp_operation(btcoexist, in halbtc_get_bt_device_info()
454 return btcoexist->bt_info.bt_device_info; in halbtc_get_bt_device_info()
459 struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context; in halbtc_get_bt_forbidden_slot_val() local
463 halbtc_send_bt_mp_operation(btcoexist, in halbtc_get_bt_forbidden_slot_val()
467 return btcoexist->bt_info.bt_forb_slot_val; in halbtc_get_bt_forbidden_slot_val()
470 static u32 halbtc_get_wifi_link_status(struct btc_coexist *btcoexist) in halbtc_get_wifi_link_status() argument
476 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_get_wifi_link_status()
487 if (is_any_client_connect_to_ap(btcoexist)) { in halbtc_get_wifi_link_status()
505 struct btc_coexist *btcoexist = (struct btc_coexist *)void_btcoexist; in halbtc_get() local
506 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_get()
517 if (!halbtc_is_bt_coexist_available(btcoexist)) in halbtc_get()
533 if (is_any_client_connect_to_ap(btcoexist)) in halbtc_get()
565 *bool_tmp = rtlpriv->btcoexist.btc_info.in_4way; in halbtc_get()
611 *u32_tmp = halbtc_get_wifi_bw(btcoexist); in halbtc_get()
623 *u32_tmp = halbtc_get_wifi_link_status(btcoexist); in halbtc_get()
626 *u32_tmp = halbtc_get_bt_patch_version(btcoexist); in halbtc_get()
632 *u32_tmp = halbtc_get_bt_coex_supported_version(btcoexist); in halbtc_get()
635 *u32_tmp = halbtc_get_bt_coex_supported_feature(btcoexist); in halbtc_get()
638 *u32_tmp = halbtc_get_bt_device_info(btcoexist); in halbtc_get()
641 *u32_tmp = halbtc_get_bt_forbidden_slot_val(btcoexist); in halbtc_get()
645 btcoexist->btc_phydm_query_phy_counter(btcoexist, in halbtc_get()
650 btcoexist->btc_phydm_query_phy_counter(btcoexist, in halbtc_get()
655 btcoexist->btc_phydm_query_phy_counter(btcoexist, in halbtc_get()
662 *u8_tmp = halbtc_get_wifi_central_chnl(btcoexist); in halbtc_get()
669 *u8_tmp = rtlpriv->btcoexist.btc_info.ap_num; in halbtc_get()
680 *u8_tmp = btcoexist->pwr_mode_val[0]; in halbtc_get()
693 struct btc_coexist *btcoexist = (struct btc_coexist *)void_btcoexist; in halbtc_set() local
699 if (!halbtc_is_bt_coexist_available(btcoexist)) in halbtc_set()
705 btcoexist->bt_info.bt_disabled = *bool_tmp; in halbtc_set()
708 btcoexist->bt_info.bt_busy = *bool_tmp; in halbtc_set()
711 btcoexist->bt_info.limited_dig = *bool_tmp; in halbtc_set()
714 btcoexist->bt_info.force_to_roam = *bool_tmp; in halbtc_set()
717 btcoexist->bt_info.reject_agg_pkt = *bool_tmp; in halbtc_set()
720 btcoexist->bt_info.bt_ctrl_agg_buf_size = *bool_tmp; in halbtc_set()
723 btcoexist->bt_info.increase_scan_dev_num = *bool_tmp; in halbtc_set()
726 btcoexist->bt_info.bt_tx_rx_mask = *bool_tmp; in halbtc_set()
729 btcoexist->bt_info.miracast_plus_bt = *bool_tmp; in halbtc_set()
733 btcoexist->bt_info.rssi_adjust_for_agc_table_on = *u8_tmp; in halbtc_set()
736 btcoexist->bt_info.agg_buf_size = *u8_tmp; in halbtc_set()
744 halbtc_aggregation_check(btcoexist); in halbtc_set()
749 btcoexist->bt_info.rssi_adjust_for_1ant_coex_type = *u8_tmp; in halbtc_set()
754 btcoexist->bt_info.lps_val = *u8_tmp; in halbtc_set()
757 btcoexist->bt_info.rpwm_val = *u8_tmp; in halbtc_set()
761 halbtc_leave_lps(btcoexist); in halbtc_set()
764 halbtc_enter_lps(btcoexist); in halbtc_set()
767 halbtc_normal_lps(btcoexist); in halbtc_set()
770 halbtc_pre_normal_lps(btcoexist); in halbtc_set()
773 halbtc_post_normal_lps(btcoexist); in halbtc_set()
776 halbtc_disable_low_power(btcoexist, *bool_tmp); in halbtc_set()
779 btcoexist->bt_info.ra_mask = *u32_tmp; in halbtc_set()
796 static void halbtc_display_coex_statistics(struct btc_coexist *btcoexist, in halbtc_display_coex_statistics() argument
801 static void halbtc_display_bt_link_info(struct btc_coexist *btcoexist, in halbtc_display_bt_link_info() argument
806 static void halbtc_display_wifi_status(struct btc_coexist *btcoexist, in halbtc_display_wifi_status() argument
809 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_display_wifi_status()
823 wifi_link_status = halbtc_get_wifi_link_status(btcoexist); in halbtc_display_wifi_status()
832 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on); in halbtc_display_wifi_status()
833 btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifi_chnl); in halbtc_display_wifi_status()
834 btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl); in halbtc_display_wifi_status()
839 btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); in halbtc_display_wifi_status()
840 btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi); in halbtc_display_wifi_status()
845 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan); in halbtc_display_wifi_status()
846 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link); in halbtc_display_wifi_status()
847 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam); in halbtc_display_wifi_status()
852 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g); in halbtc_display_wifi_status()
853 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw); in halbtc_display_wifi_status()
854 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); in halbtc_display_wifi_status()
855 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, in halbtc_display_wifi_status()
857 btcoexist->btc_get(btcoexist, BTC_GET_U1_AP_NUM, &ap_num); in halbtc_display_wifi_status()
859 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, in halbtc_display_wifi_status()
887 btcoexist->pwr_mode_val, in halbtc_display_wifi_status()
888 btcoexist->bt_info.lps_val, in halbtc_display_wifi_status()
889 btcoexist->bt_info.rpwm_val); in halbtc_display_wifi_status()
897 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_read_1byte() local
898 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_read_1byte()
905 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_read_2byte() local
906 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_read_2byte()
913 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_read_4byte() local
914 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_read_4byte()
921 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_write_1byte() local
922 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_write_1byte()
930 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_bitmask_write_1byte() local
931 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_bitmask_write_1byte()
950 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_write_2byte() local
951 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_write_2byte()
958 struct btc_coexist *btcoexist = in halbtc_write_4byte() local
960 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_write_4byte()
968 struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context; in halbtc_write_local_reg_1byte() local
969 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_write_local_reg_1byte()
971 if (btcoexist->chip_interface == BTC_INTF_SDIO) in halbtc_write_local_reg_1byte()
973 else if (btcoexist->chip_interface == BTC_INTF_PCI) in halbtc_write_local_reg_1byte()
975 else if (btcoexist->chip_interface == BTC_INTF_USB) in halbtc_write_local_reg_1byte()
982 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_set_bbreg() local
983 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_set_bbreg()
990 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_get_bbreg() local
991 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_get_bbreg()
999 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_set_rfreg() local
1000 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_set_rfreg()
1008 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_get_rfreg() local
1009 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_get_rfreg()
1017 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_fill_h2c_cmd() local
1018 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_fill_h2c_cmd()
1026 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_send_wifi_port_id_cmd() local
1027 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_send_wifi_port_id_cmd()
1036 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_set_default_port_id_cmd() local
1037 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_set_default_port_id_cmd()
1049 struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context; in halbtc_set_bt_reg() local
1055 if (!halbtc_send_bt_mp_operation(btcoexist, BT_OP_WRITE_REG_VALUE, in halbtc_set_bt_reg()
1062 halbtc_send_bt_mp_operation(btcoexist, BT_OP_WRITE_REG_ADDR, in halbtc_set_bt_reg()
1069 struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context; in halbtc_display_dbg_msg() local
1073 halbtc_display_coex_statistics(btcoexist, m); in halbtc_display_dbg_msg()
1076 halbtc_display_bt_link_info(btcoexist, m); in halbtc_display_dbg_msg()
1079 halbtc_display_wifi_status(btcoexist, m); in halbtc_display_dbg_msg()
1091 static bool halbtc_under_ips(struct btc_coexist *btcoexist) in halbtc_under_ips() argument
1093 struct rtl_priv *rtlpriv = btcoexist->adapter; in halbtc_under_ips()
1130 struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context; in halbtc_get_ant_det_val_from_bt() local
1134 halbtc_send_bt_mp_operation(btcoexist, BT_OP_GET_BT_ANT_DET_VAL, in halbtc_get_ant_det_val_from_bt()
1139 return btcoexist->bt_info.bt_ant_det_val; in halbtc_get_ant_det_val_from_bt()
1144 struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context; in halbtc_get_ble_scan_type_from_bt() local
1148 halbtc_send_bt_mp_operation(btcoexist, BT_OP_GET_BT_BLE_SCAN_TYPE, in halbtc_get_ble_scan_type_from_bt()
1153 return btcoexist->bt_info.bt_ble_scan_type; in halbtc_get_ble_scan_type_from_bt()
1158 struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context; in halbtc_get_ble_scan_para_from_bt() local
1162 halbtc_send_bt_mp_operation(btcoexist, BT_OP_GET_BT_BLE_SCAN_PARA, in halbtc_get_ble_scan_para_from_bt()
1167 return btcoexist->bt_info.bt_ble_scan_para; in halbtc_get_ble_scan_para_from_bt()
1173 struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context; in halbtc_get_bt_afh_map_from_bt() local
1181 ret = halbtc_send_bt_mp_operation(btcoexist, BT_OP_GET_AFH_MAP_L, in halbtc_get_bt_afh_map_from_bt()
1186 *afh_map_l = btcoexist->bt_info.afh_map_l; in halbtc_get_bt_afh_map_from_bt()
1189 ret = halbtc_send_bt_mp_operation(btcoexist, BT_OP_GET_AFH_MAP_M, in halbtc_get_bt_afh_map_from_bt()
1194 *afh_map_m = btcoexist->bt_info.afh_map_m; in halbtc_get_bt_afh_map_from_bt()
1197 ret = halbtc_send_bt_mp_operation(btcoexist, BT_OP_GET_AFH_MAP_H, in halbtc_get_bt_afh_map_from_bt()
1202 *afh_map_h = btcoexist->bt_info.afh_map_h; in halbtc_get_bt_afh_map_from_bt()
1213 struct btc_coexist *btcoexist = rtl_btc_coexist(rtlpriv); in exhalbtc_initlize_variables() local
1215 if (!btcoexist) in exhalbtc_initlize_variables()
1220 btcoexist->btc_read_1byte = halbtc_read_1byte; in exhalbtc_initlize_variables()
1221 btcoexist->btc_write_1byte = halbtc_write_1byte; in exhalbtc_initlize_variables()
1222 btcoexist->btc_write_1byte_bitmask = halbtc_bitmask_write_1byte; in exhalbtc_initlize_variables()
1223 btcoexist->btc_read_2byte = halbtc_read_2byte; in exhalbtc_initlize_variables()
1224 btcoexist->btc_write_2byte = halbtc_write_2byte; in exhalbtc_initlize_variables()
1225 btcoexist->btc_read_4byte = halbtc_read_4byte; in exhalbtc_initlize_variables()
1226 btcoexist->btc_write_4byte = halbtc_write_4byte; in exhalbtc_initlize_variables()
1227 btcoexist->btc_write_local_reg_1byte = halbtc_write_local_reg_1byte; in exhalbtc_initlize_variables()
1229 btcoexist->btc_set_bb_reg = halbtc_set_bbreg; in exhalbtc_initlize_variables()
1230 btcoexist->btc_get_bb_reg = halbtc_get_bbreg; in exhalbtc_initlize_variables()
1232 btcoexist->btc_set_rf_reg = halbtc_set_rfreg; in exhalbtc_initlize_variables()
1233 btcoexist->btc_get_rf_reg = halbtc_get_rfreg; in exhalbtc_initlize_variables()
1235 btcoexist->btc_fill_h2c = halbtc_fill_h2c_cmd; in exhalbtc_initlize_variables()
1236 btcoexist->btc_disp_dbg_msg = halbtc_display_dbg_msg; in exhalbtc_initlize_variables()
1238 btcoexist->btc_get = halbtc_get; in exhalbtc_initlize_variables()
1239 btcoexist->btc_set = halbtc_set; in exhalbtc_initlize_variables()
1240 btcoexist->btc_set_bt_reg = halbtc_set_bt_reg; in exhalbtc_initlize_variables()
1241 btcoexist->btc_get_bt_reg = halbtc_get_bt_reg; in exhalbtc_initlize_variables()
1243 btcoexist->bt_info.bt_ctrl_buf_size = false; in exhalbtc_initlize_variables()
1244 btcoexist->bt_info.agg_buf_size = 5; in exhalbtc_initlize_variables()
1246 btcoexist->bt_info.increase_scan_dev_num = false; in exhalbtc_initlize_variables()
1248 btcoexist->btc_get_bt_coex_supported_feature = in exhalbtc_initlize_variables()
1250 btcoexist->btc_get_bt_coex_supported_version = in exhalbtc_initlize_variables()
1252 btcoexist->btc_get_bt_phydm_version = halbtc_get_phydm_version; in exhalbtc_initlize_variables()
1253 btcoexist->btc_phydm_modify_ra_pcr_threshold = in exhalbtc_initlize_variables()
1255 btcoexist->btc_phydm_query_phy_counter = halbtc_phydm_query_phy_counter; in exhalbtc_initlize_variables()
1256 btcoexist->btc_get_ant_det_val_from_bt = halbtc_get_ant_det_val_from_bt; in exhalbtc_initlize_variables()
1257 btcoexist->btc_get_ble_scan_type_from_bt = in exhalbtc_initlize_variables()
1259 btcoexist->btc_get_ble_scan_para_from_bt = in exhalbtc_initlize_variables()
1261 btcoexist->btc_get_bt_afh_map_from_bt = in exhalbtc_initlize_variables()
1264 init_completion(&btcoexist->bt_mp_comp); in exhalbtc_initlize_variables()
1306 struct btc_coexist *btcoexist = rtl_btc_coexist(rtlpriv); in exhalbtc_bind_bt_coex_withadapter() local
1309 if (!btcoexist) in exhalbtc_bind_bt_coex_withadapter()
1312 if (btcoexist->binded) in exhalbtc_bind_bt_coex_withadapter()
1317 btcoexist->chip_interface = BTC_INTF_PCI; in exhalbtc_bind_bt_coex_withadapter()
1320 btcoexist->chip_interface = BTC_INTF_USB; in exhalbtc_bind_bt_coex_withadapter()
1323 btcoexist->chip_interface = BTC_INTF_UNKNOWN; in exhalbtc_bind_bt_coex_withadapter()
1327 btcoexist->binded = true; in exhalbtc_bind_bt_coex_withadapter()
1328 btcoexist->statistics.cnt_bind++; in exhalbtc_bind_bt_coex_withadapter()
1330 btcoexist->adapter = adapter; in exhalbtc_bind_bt_coex_withadapter()
1332 btcoexist->stack_info.profile_notified = false; in exhalbtc_bind_bt_coex_withadapter()
1334 btcoexist->bt_info.bt_ctrl_agg_buf_size = false; in exhalbtc_bind_bt_coex_withadapter()
1335 btcoexist->bt_info.agg_buf_size = 5; in exhalbtc_bind_bt_coex_withadapter()
1337 btcoexist->bt_info.increase_scan_dev_num = false; in exhalbtc_bind_bt_coex_withadapter()
1338 btcoexist->bt_info.miracast_plus_bt = false; in exhalbtc_bind_bt_coex_withadapter()
1341 exhalbtc_set_chip_type(btcoexist, chip_type); in exhalbtc_bind_bt_coex_withadapter()
1346 btcoexist->board_info.btdm_ant_pos = BTC_ANTENNA_AT_MAIN_PORT; in exhalbtc_bind_bt_coex_withadapter()
1349 exhalbtc_set_single_ant_path(btcoexist, single_ant_path); in exhalbtc_bind_bt_coex_withadapter()
1352 btcoexist->board_info.tfbga_package = false; in exhalbtc_bind_bt_coex_withadapter()
1354 btcoexist->board_info.tfbga_package = false; in exhalbtc_bind_bt_coex_withadapter()
1356 btcoexist->board_info.tfbga_package = true; in exhalbtc_bind_bt_coex_withadapter()
1358 if (btcoexist->board_info.tfbga_package) in exhalbtc_bind_bt_coex_withadapter()
1365 btcoexist->board_info.rfe_type = rtl_get_hwpg_rfe_type(rtlpriv); in exhalbtc_bind_bt_coex_withadapter()
1366 btcoexist->board_info.ant_div_cfg = 0; in exhalbtc_bind_bt_coex_withadapter()
1371 void exhalbtc_power_on_setting(struct btc_coexist *btcoexist) in exhalbtc_power_on_setting() argument
1373 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_power_on_setting()
1376 btcoexist->statistics.cnt_power_on++; in exhalbtc_power_on_setting()
1378 if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_power_on_setting()
1379 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_power_on_setting()
1380 ex_btc8723b2ant_power_on_setting(btcoexist); in exhalbtc_power_on_setting()
1381 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_power_on_setting()
1382 ex_btc8723b1ant_power_on_setting(btcoexist); in exhalbtc_power_on_setting()
1386 void exhalbtc_pre_load_firmware(struct btc_coexist *btcoexist) in exhalbtc_pre_load_firmware() argument
1388 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_pre_load_firmware()
1391 btcoexist->statistics.cnt_pre_load_firmware++; in exhalbtc_pre_load_firmware()
1393 if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_pre_load_firmware()
1394 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_pre_load_firmware()
1395 ex_btc8723b2ant_pre_load_firmware(btcoexist); in exhalbtc_pre_load_firmware()
1399 void exhalbtc_init_hw_config(struct btc_coexist *btcoexist, bool wifi_only) in exhalbtc_init_hw_config() argument
1401 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_init_hw_config()
1404 btcoexist->statistics.cnt_init_hw_config++; in exhalbtc_init_hw_config()
1406 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_init_hw_config()
1407 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_init_hw_config()
1408 ex_btc8821a2ant_init_hwconfig(btcoexist); in exhalbtc_init_hw_config()
1409 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_init_hw_config()
1410 ex_btc8821a1ant_init_hwconfig(btcoexist, wifi_only); in exhalbtc_init_hw_config()
1411 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_init_hw_config()
1412 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_init_hw_config()
1413 ex_btc8723b2ant_init_hwconfig(btcoexist); in exhalbtc_init_hw_config()
1414 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_init_hw_config()
1415 ex_btc8723b1ant_init_hwconfig(btcoexist, wifi_only); in exhalbtc_init_hw_config()
1416 } else if (IS_HARDWARE_TYPE_8723A(btcoexist->adapter)) { in exhalbtc_init_hw_config()
1418 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_init_hw_config()
1419 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_init_hw_config()
1420 ex_btc8192e2ant_init_hwconfig(btcoexist); in exhalbtc_init_hw_config()
1428 void exhalbtc_init_coex_dm(struct btc_coexist *btcoexist) in exhalbtc_init_coex_dm() argument
1430 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_init_coex_dm()
1433 btcoexist->statistics.cnt_init_coex_dm++; in exhalbtc_init_coex_dm()
1435 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_init_coex_dm()
1436 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_init_coex_dm()
1437 ex_btc8821a2ant_init_coex_dm(btcoexist); in exhalbtc_init_coex_dm()
1438 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_init_coex_dm()
1439 ex_btc8821a1ant_init_coex_dm(btcoexist); in exhalbtc_init_coex_dm()
1440 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_init_coex_dm()
1441 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_init_coex_dm()
1442 ex_btc8723b2ant_init_coex_dm(btcoexist); in exhalbtc_init_coex_dm()
1443 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_init_coex_dm()
1444 ex_btc8723b1ant_init_coex_dm(btcoexist); in exhalbtc_init_coex_dm()
1445 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_init_coex_dm()
1446 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_init_coex_dm()
1447 ex_btc8192e2ant_init_coex_dm(btcoexist); in exhalbtc_init_coex_dm()
1450 btcoexist->initialized = true; in exhalbtc_init_coex_dm()
1453 void exhalbtc_ips_notify(struct btc_coexist *btcoexist, u8 type) in exhalbtc_ips_notify() argument
1457 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_ips_notify()
1459 btcoexist->statistics.cnt_ips_notify++; in exhalbtc_ips_notify()
1460 if (btcoexist->manual_control) in exhalbtc_ips_notify()
1468 halbtc_leave_low_power(btcoexist); in exhalbtc_ips_notify()
1470 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_ips_notify()
1471 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_ips_notify()
1472 ex_btc8821a2ant_ips_notify(btcoexist, ips_type); in exhalbtc_ips_notify()
1473 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_ips_notify()
1474 ex_btc8821a1ant_ips_notify(btcoexist, ips_type); in exhalbtc_ips_notify()
1475 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_ips_notify()
1476 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_ips_notify()
1477 ex_btc8723b2ant_ips_notify(btcoexist, ips_type); in exhalbtc_ips_notify()
1478 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_ips_notify()
1479 ex_btc8723b1ant_ips_notify(btcoexist, ips_type); in exhalbtc_ips_notify()
1480 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_ips_notify()
1481 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_ips_notify()
1482 ex_btc8192e2ant_ips_notify(btcoexist, ips_type); in exhalbtc_ips_notify()
1485 halbtc_normal_low_power(btcoexist); in exhalbtc_ips_notify()
1488 void exhalbtc_lps_notify(struct btc_coexist *btcoexist, u8 type) in exhalbtc_lps_notify() argument
1492 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_lps_notify()
1494 btcoexist->statistics.cnt_lps_notify++; in exhalbtc_lps_notify()
1495 if (btcoexist->manual_control) in exhalbtc_lps_notify()
1503 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_lps_notify()
1504 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_lps_notify()
1505 ex_btc8821a2ant_lps_notify(btcoexist, lps_type); in exhalbtc_lps_notify()
1506 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_lps_notify()
1507 ex_btc8821a1ant_lps_notify(btcoexist, lps_type); in exhalbtc_lps_notify()
1508 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_lps_notify()
1509 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_lps_notify()
1510 ex_btc8723b2ant_lps_notify(btcoexist, lps_type); in exhalbtc_lps_notify()
1511 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_lps_notify()
1512 ex_btc8723b1ant_lps_notify(btcoexist, lps_type); in exhalbtc_lps_notify()
1513 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_lps_notify()
1514 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_lps_notify()
1515 ex_btc8192e2ant_lps_notify(btcoexist, lps_type); in exhalbtc_lps_notify()
1519 void exhalbtc_scan_notify(struct btc_coexist *btcoexist, u8 type) in exhalbtc_scan_notify() argument
1523 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_scan_notify()
1525 btcoexist->statistics.cnt_scan_notify++; in exhalbtc_scan_notify()
1526 if (btcoexist->manual_control) in exhalbtc_scan_notify()
1534 halbtc_leave_low_power(btcoexist); in exhalbtc_scan_notify()
1536 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_scan_notify()
1537 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_scan_notify()
1538 ex_btc8821a2ant_scan_notify(btcoexist, scan_type); in exhalbtc_scan_notify()
1539 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_scan_notify()
1540 ex_btc8821a1ant_scan_notify(btcoexist, scan_type); in exhalbtc_scan_notify()
1541 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_scan_notify()
1542 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_scan_notify()
1543 ex_btc8723b2ant_scan_notify(btcoexist, scan_type); in exhalbtc_scan_notify()
1544 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_scan_notify()
1545 ex_btc8723b1ant_scan_notify(btcoexist, scan_type); in exhalbtc_scan_notify()
1546 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_scan_notify()
1547 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_scan_notify()
1548 ex_btc8192e2ant_scan_notify(btcoexist, scan_type); in exhalbtc_scan_notify()
1551 halbtc_normal_low_power(btcoexist); in exhalbtc_scan_notify()
1559 void exhalbtc_connect_notify(struct btc_coexist *btcoexist, u8 action) in exhalbtc_connect_notify() argument
1564 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_connect_notify()
1566 btcoexist->statistics.cnt_connect_notify++; in exhalbtc_connect_notify()
1567 if (btcoexist->manual_control) in exhalbtc_connect_notify()
1570 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g); in exhalbtc_connect_notify()
1577 halbtc_leave_low_power(btcoexist); in exhalbtc_connect_notify()
1579 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_connect_notify()
1580 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_connect_notify()
1581 ex_btc8821a2ant_connect_notify(btcoexist, asso_type); in exhalbtc_connect_notify()
1582 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_connect_notify()
1583 ex_btc8821a1ant_connect_notify(btcoexist, asso_type); in exhalbtc_connect_notify()
1584 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_connect_notify()
1585 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_connect_notify()
1586 ex_btc8723b2ant_connect_notify(btcoexist, asso_type); in exhalbtc_connect_notify()
1587 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_connect_notify()
1588 ex_btc8723b1ant_connect_notify(btcoexist, asso_type); in exhalbtc_connect_notify()
1589 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_connect_notify()
1590 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_connect_notify()
1591 ex_btc8192e2ant_connect_notify(btcoexist, asso_type); in exhalbtc_connect_notify()
1594 halbtc_normal_low_power(btcoexist); in exhalbtc_connect_notify()
1597 void exhalbtc_mediastatus_notify(struct btc_coexist *btcoexist, in exhalbtc_mediastatus_notify() argument
1602 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_mediastatus_notify()
1604 btcoexist->statistics.cnt_media_status_notify++; in exhalbtc_mediastatus_notify()
1605 if (btcoexist->manual_control) in exhalbtc_mediastatus_notify()
1613 halbtc_leave_low_power(btcoexist); in exhalbtc_mediastatus_notify()
1615 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_mediastatus_notify()
1616 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_mediastatus_notify()
1617 ex_btc8821a2ant_media_status_notify(btcoexist, status); in exhalbtc_mediastatus_notify()
1618 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_mediastatus_notify()
1619 ex_btc8821a1ant_media_status_notify(btcoexist, status); in exhalbtc_mediastatus_notify()
1620 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_mediastatus_notify()
1621 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_mediastatus_notify()
1622 ex_btc8723b2ant_media_status_notify(btcoexist, status); in exhalbtc_mediastatus_notify()
1623 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_mediastatus_notify()
1624 ex_btc8723b1ant_media_status_notify(btcoexist, status); in exhalbtc_mediastatus_notify()
1625 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_mediastatus_notify()
1626 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_mediastatus_notify()
1627 ex_btc8192e2ant_media_status_notify(btcoexist, status); in exhalbtc_mediastatus_notify()
1630 halbtc_normal_low_power(btcoexist); in exhalbtc_mediastatus_notify()
1633 void exhalbtc_special_packet_notify(struct btc_coexist *btcoexist, u8 pkt_type) in exhalbtc_special_packet_notify() argument
1637 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_special_packet_notify()
1639 btcoexist->statistics.cnt_special_packet_notify++; in exhalbtc_special_packet_notify()
1640 if (btcoexist->manual_control) in exhalbtc_special_packet_notify()
1654 halbtc_leave_low_power(btcoexist); in exhalbtc_special_packet_notify()
1656 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_special_packet_notify()
1657 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_special_packet_notify()
1658 ex_btc8821a2ant_special_packet_notify(btcoexist, in exhalbtc_special_packet_notify()
1660 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_special_packet_notify()
1661 ex_btc8821a1ant_special_packet_notify(btcoexist, in exhalbtc_special_packet_notify()
1663 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_special_packet_notify()
1664 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_special_packet_notify()
1665 ex_btc8723b2ant_special_packet_notify(btcoexist, in exhalbtc_special_packet_notify()
1667 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_special_packet_notify()
1668 ex_btc8723b1ant_special_packet_notify(btcoexist, in exhalbtc_special_packet_notify()
1670 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_special_packet_notify()
1671 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_special_packet_notify()
1672 ex_btc8192e2ant_special_packet_notify(btcoexist, in exhalbtc_special_packet_notify()
1676 halbtc_normal_low_power(btcoexist); in exhalbtc_special_packet_notify()
1679 void exhalbtc_bt_info_notify(struct btc_coexist *btcoexist, in exhalbtc_bt_info_notify() argument
1682 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_bt_info_notify()
1684 btcoexist->statistics.cnt_bt_info_notify++; in exhalbtc_bt_info_notify()
1686 halbtc_leave_low_power(btcoexist); in exhalbtc_bt_info_notify()
1688 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_bt_info_notify()
1689 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_bt_info_notify()
1690 ex_btc8821a2ant_bt_info_notify(btcoexist, tmp_buf, in exhalbtc_bt_info_notify()
1692 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_bt_info_notify()
1693 ex_btc8821a1ant_bt_info_notify(btcoexist, tmp_buf, in exhalbtc_bt_info_notify()
1695 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_bt_info_notify()
1696 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_bt_info_notify()
1697 ex_btc8723b2ant_bt_info_notify(btcoexist, tmp_buf, in exhalbtc_bt_info_notify()
1699 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_bt_info_notify()
1700 ex_btc8723b1ant_bt_info_notify(btcoexist, tmp_buf, in exhalbtc_bt_info_notify()
1702 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_bt_info_notify()
1703 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_bt_info_notify()
1704 ex_btc8192e2ant_bt_info_notify(btcoexist, tmp_buf, in exhalbtc_bt_info_notify()
1708 halbtc_normal_low_power(btcoexist); in exhalbtc_bt_info_notify()
1711 void exhalbtc_rf_status_notify(struct btc_coexist *btcoexist, u8 type) in exhalbtc_rf_status_notify() argument
1713 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_rf_status_notify()
1716 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_rf_status_notify()
1717 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_rf_status_notify()
1718 if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_rf_status_notify()
1719 ex_btc8723b1ant_rf_status_notify(btcoexist, type); in exhalbtc_rf_status_notify()
1720 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_rf_status_notify()
1724 void exhalbtc_halt_notify(struct btc_coexist *btcoexist) in exhalbtc_halt_notify() argument
1726 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_halt_notify()
1729 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_halt_notify()
1730 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_halt_notify()
1731 ex_btc8821a2ant_halt_notify(btcoexist); in exhalbtc_halt_notify()
1732 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_halt_notify()
1733 ex_btc8821a1ant_halt_notify(btcoexist); in exhalbtc_halt_notify()
1734 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_halt_notify()
1735 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_halt_notify()
1736 ex_btc8723b2ant_halt_notify(btcoexist); in exhalbtc_halt_notify()
1737 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_halt_notify()
1738 ex_btc8723b1ant_halt_notify(btcoexist); in exhalbtc_halt_notify()
1739 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_halt_notify()
1740 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_halt_notify()
1741 ex_btc8192e2ant_halt_notify(btcoexist); in exhalbtc_halt_notify()
1744 btcoexist->binded = false; in exhalbtc_halt_notify()
1747 void exhalbtc_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state) in exhalbtc_pnp_notify() argument
1749 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_pnp_notify()
1757 if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_pnp_notify()
1758 if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_pnp_notify()
1759 ex_btc8723b1ant_pnp_notify(btcoexist, pnp_state); in exhalbtc_pnp_notify()
1760 else if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_pnp_notify()
1761 ex_btc8723b2ant_pnp_notify(btcoexist, pnp_state); in exhalbtc_pnp_notify()
1762 } else if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_pnp_notify()
1763 if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_pnp_notify()
1764 ex_btc8821a1ant_pnp_notify(btcoexist, pnp_state); in exhalbtc_pnp_notify()
1765 else if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_pnp_notify()
1766 ex_btc8821a2ant_pnp_notify(btcoexist, pnp_state); in exhalbtc_pnp_notify()
1767 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_pnp_notify()
1771 void exhalbtc_coex_dm_switch(struct btc_coexist *btcoexist) in exhalbtc_coex_dm_switch() argument
1773 struct rtl_priv *rtlpriv = btcoexist->adapter; in exhalbtc_coex_dm_switch()
1775 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_coex_dm_switch()
1777 btcoexist->statistics.cnt_coex_dm_switch++; in exhalbtc_coex_dm_switch()
1779 halbtc_leave_low_power(btcoexist); in exhalbtc_coex_dm_switch()
1781 if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_coex_dm_switch()
1782 if (btcoexist->board_info.btdm_ant_num == 1) { in exhalbtc_coex_dm_switch()
1783 btcoexist->stop_coex_dm = true; in exhalbtc_coex_dm_switch()
1784 ex_btc8723b1ant_coex_dm_reset(btcoexist); in exhalbtc_coex_dm_switch()
1787 ex_btc8723b2ant_init_hwconfig(btcoexist); in exhalbtc_coex_dm_switch()
1788 ex_btc8723b2ant_init_coex_dm(btcoexist); in exhalbtc_coex_dm_switch()
1789 btcoexist->stop_coex_dm = false; in exhalbtc_coex_dm_switch()
1793 halbtc_normal_low_power(btcoexist); in exhalbtc_coex_dm_switch()
1796 void exhalbtc_periodical(struct btc_coexist *btcoexist) in exhalbtc_periodical() argument
1798 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_periodical()
1800 btcoexist->statistics.cnt_periodical++; in exhalbtc_periodical()
1802 halbtc_leave_low_power(btcoexist); in exhalbtc_periodical()
1804 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_periodical()
1805 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_periodical()
1806 ex_btc8821a2ant_periodical(btcoexist); in exhalbtc_periodical()
1807 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_periodical()
1808 if (!halbtc_under_ips(btcoexist)) in exhalbtc_periodical()
1809 ex_btc8821a1ant_periodical(btcoexist); in exhalbtc_periodical()
1810 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_periodical()
1811 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_periodical()
1812 ex_btc8723b2ant_periodical(btcoexist); in exhalbtc_periodical()
1813 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_periodical()
1814 ex_btc8723b1ant_periodical(btcoexist); in exhalbtc_periodical()
1815 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_periodical()
1816 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_periodical()
1817 ex_btc8192e2ant_periodical(btcoexist); in exhalbtc_periodical()
1820 halbtc_normal_low_power(btcoexist); in exhalbtc_periodical()
1823 void exhalbtc_dbg_control(struct btc_coexist *btcoexist, in exhalbtc_dbg_control() argument
1826 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_dbg_control()
1828 btcoexist->statistics.cnt_dbg_ctrl++; in exhalbtc_dbg_control()
1830 halbtc_leave_low_power(btcoexist); in exhalbtc_dbg_control()
1832 halbtc_normal_low_power(btcoexist); in exhalbtc_dbg_control()
1835 void exhalbtc_antenna_detection(struct btc_coexist *btcoexist, u32 cent_freq, in exhalbtc_antenna_detection() argument
1838 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_antenna_detection()
1846 void exhalbtc_update_min_bt_rssi(struct btc_coexist *btcoexist, s8 bt_rssi) in exhalbtc_update_min_bt_rssi() argument
1848 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_update_min_bt_rssi()
1851 btcoexist->stack_info.min_bt_rssi = bt_rssi; in exhalbtc_update_min_bt_rssi()
1854 void exhalbtc_set_hci_version(struct btc_coexist *btcoexist, u16 hci_version) in exhalbtc_set_hci_version() argument
1856 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_set_hci_version()
1859 btcoexist->stack_info.hci_version = hci_version; in exhalbtc_set_hci_version()
1862 void exhalbtc_set_bt_patch_version(struct btc_coexist *btcoexist, in exhalbtc_set_bt_patch_version() argument
1865 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_set_bt_patch_version()
1868 btcoexist->bt_info.bt_real_fw_ver = bt_patch_version; in exhalbtc_set_bt_patch_version()
1869 btcoexist->bt_info.bt_hci_ver = bt_hci_version; in exhalbtc_set_bt_patch_version()
1872 void exhalbtc_set_chip_type(struct btc_coexist *btcoexist, u8 chip_type) in exhalbtc_set_chip_type() argument
1880 btcoexist->board_info.bt_chip_type = BTC_CHIP_UNDEF; in exhalbtc_set_chip_type()
1883 btcoexist->board_info.bt_chip_type = BTC_CHIP_CSR_BC4; in exhalbtc_set_chip_type()
1886 btcoexist->board_info.bt_chip_type = BTC_CHIP_CSR_BC8; in exhalbtc_set_chip_type()
1889 btcoexist->board_info.bt_chip_type = BTC_CHIP_RTL8723A; in exhalbtc_set_chip_type()
1892 btcoexist->board_info.bt_chip_type = BTC_CHIP_RTL8821; in exhalbtc_set_chip_type()
1895 btcoexist->board_info.bt_chip_type = BTC_CHIP_RTL8723B; in exhalbtc_set_chip_type()
1902 struct btc_coexist *btcoexist = rtl_btc_coexist(rtlpriv); in exhalbtc_set_ant_num() local
1904 if (!btcoexist) in exhalbtc_set_ant_num()
1908 btcoexist->board_info.pg_ant_num = ant_num; in exhalbtc_set_ant_num()
1909 btcoexist->board_info.btdm_ant_num = ant_num; in exhalbtc_set_ant_num()
1911 btcoexist->board_info.btdm_ant_num = ant_num; in exhalbtc_set_ant_num()
1913 btcoexist->board_info.btdm_ant_num = ant_num; in exhalbtc_set_ant_num()
1915 btcoexist->board_info.btdm_ant_pos = in exhalbtc_set_ant_num()
1918 btcoexist->board_info.btdm_ant_pos = in exhalbtc_set_ant_num()
1924 void exhalbtc_set_single_ant_path(struct btc_coexist *btcoexist, in exhalbtc_set_single_ant_path() argument
1927 btcoexist->board_info.single_ant_path = single_ant_path; in exhalbtc_set_single_ant_path()
1930 void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist, in exhalbtc_display_bt_coex_info() argument
1933 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_display_bt_coex_info()
1936 halbtc_leave_low_power(btcoexist); in exhalbtc_display_bt_coex_info()
1938 if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { in exhalbtc_display_bt_coex_info()
1939 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_display_bt_coex_info()
1940 ex_btc8821a2ant_display_coex_info(btcoexist, m); in exhalbtc_display_bt_coex_info()
1941 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_display_bt_coex_info()
1942 ex_btc8821a1ant_display_coex_info(btcoexist, m); in exhalbtc_display_bt_coex_info()
1943 } else if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { in exhalbtc_display_bt_coex_info()
1944 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_display_bt_coex_info()
1945 ex_btc8723b2ant_display_coex_info(btcoexist, m); in exhalbtc_display_bt_coex_info()
1946 else if (btcoexist->board_info.btdm_ant_num == 1) in exhalbtc_display_bt_coex_info()
1947 ex_btc8723b1ant_display_coex_info(btcoexist, m); in exhalbtc_display_bt_coex_info()
1948 } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { in exhalbtc_display_bt_coex_info()
1949 if (btcoexist->board_info.btdm_ant_num == 2) in exhalbtc_display_bt_coex_info()
1950 ex_btc8192e2ant_display_coex_info(btcoexist, m); in exhalbtc_display_bt_coex_info()
1953 halbtc_normal_low_power(btcoexist); in exhalbtc_display_bt_coex_info()
1956 void exhalbtc_switch_band_notify(struct btc_coexist *btcoexist, u8 type) in exhalbtc_switch_band_notify() argument
1958 if (!halbtc_is_bt_coexist_available(btcoexist)) in exhalbtc_switch_band_notify()
1961 if (btcoexist->manual_control) in exhalbtc_switch_band_notify()
1964 halbtc_leave_low_power(btcoexist); in exhalbtc_switch_band_notify()
1966 halbtc_normal_low_power(btcoexist); in exhalbtc_switch_band_notify()