Lines Matching defs:btcoexist

31 static u8 btc8192e2ant_bt_rssi_state(struct btc_coexist *btcoexist,
35 struct rtl_priv *rtlpriv = btcoexist->adapter;
93 static u8 btc8192e2ant_wifi_rssi_state(struct btc_coexist *btcoexist,
97 struct rtl_priv *rtlpriv = btcoexist->adapter;
101 btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
160 *btcoexist)
162 struct rtl_priv *rtlpriv = btcoexist->adapter;
184 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_DISABLE,
195 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_DISABLE,
210 static u32 btc8192e2ant_decide_ra_mask(struct btc_coexist *btcoexist,
241 static void btc8192e2ant_update_ra_mask(struct btc_coexist *btcoexist,
247 btcoexist->btc_set(btcoexist, BTC_SET_ACT_UPDATE_RAMASK,
252 static void btc8192e2ant_auto_rate_fallback_retry(struct btc_coexist *btcoexist,
262 btcoexist->btc_write_4byte(btcoexist, 0x430,
264 btcoexist->btc_write_4byte(btcoexist, 0x434,
268 btcoexist->btc_get(btcoexist,
272 btcoexist->btc_write_4byte(btcoexist, 0x430,
274 btcoexist->btc_write_4byte(btcoexist, 0x434,
277 btcoexist->btc_write_4byte(btcoexist, 0x430,
279 btcoexist->btc_write_4byte(btcoexist, 0x434,
291 static void btc8192e2ant_retry_limit(struct btc_coexist *btcoexist,
300 btcoexist->btc_write_2byte(btcoexist, 0x42a,
304 btcoexist->btc_write_2byte(btcoexist, 0x42a, 0x0808);
314 static void btc8192e2ant_ampdu_maxtime(struct btc_coexist *btcoexist,
323 btcoexist->btc_write_1byte(btcoexist, 0x456,
327 btcoexist->btc_write_1byte(btcoexist, 0x456, 0x38);
337 static void btc8192e2ant_limited_tx(struct btc_coexist *btcoexist,
346 btc8192e2ant_decide_ra_mask(btcoexist, coex_dm->cur_ss_type,
348 btc8192e2ant_update_ra_mask(btcoexist, force_exec, dis_ra_mask);
349 btc8192e2ant_auto_rate_fallback_retry(btcoexist, force_exec, arfr_type);
350 btc8192e2ant_retry_limit(btcoexist, force_exec, retry_limit_type);
351 btc8192e2ant_ampdu_maxtime(btcoexist, force_exec, ampdu_time_type);
354 static void btc8192e2ant_limited_rx(struct btc_coexist *btcoexist,
366 btcoexist->btc_set(btcoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT,
369 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_CTRL_AGG_SIZE,
374 btcoexist->btc_set(btcoexist, BTC_SET_U1_AGG_BUF_SIZE, &rx_agg_size);
376 btcoexist->btc_set(btcoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL);
379 static void btc8192e2ant_monitor_bt_ctr(struct btc_coexist *btcoexist)
381 struct rtl_priv *rtlpriv = btcoexist->adapter;
388 u32tmp = btcoexist->btc_read_4byte(btcoexist, reg_hp_txrx);
392 u32tmp = btcoexist->btc_read_4byte(btcoexist, reg_lp_txrx);
409 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0xc);
412 static void btc8192e2ant_query_bt_info(struct btc_coexist *btcoexist)
414 struct rtl_priv *rtlpriv = btcoexist->adapter;
425 btcoexist->btc_fill_h2c(btcoexist, 0x61, 1, h2c_parameter);
429 bool btc8192e2ant_is_wifi_status_changed(struct btc_coexist *btcoexist)
436 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED,
438 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
439 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on);
440 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS,
461 static void btc8192e2ant_update_bt_link_info(struct btc_coexist *btcoexist)
463 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
466 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on);
517 static u8 btc8192e2ant_action_algorithm(struct btc_coexist *btcoexist)
519 struct rtl_priv *rtlpriv = btcoexist->adapter;
520 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
521 struct btc_stack_info *stack_info = &btcoexist->stack_info;
526 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on);
723 static void btc8192e2ant_set_fw_dac_swing_level(struct btc_coexist *btcoexist,
726 struct rtl_priv *rtlpriv = btcoexist->adapter;
739 btcoexist->btc_fill_h2c(btcoexist, 0x64, 1, h2c_parameter);
742 static void btc8192e2ant_set_fw_dec_bt_pwr(struct btc_coexist *btcoexist,
745 struct rtl_priv *rtlpriv = btcoexist->adapter;
754 btcoexist->btc_fill_h2c(btcoexist, 0x62, 1, h2c_parameter);
757 static void btc8192e2ant_dec_bt_pwr(struct btc_coexist *btcoexist,
760 struct rtl_priv *rtlpriv = btcoexist->adapter;
772 btc8192e2ant_set_fw_dec_bt_pwr(btcoexist, coex_dm->cur_dec_bt_pwr);
777 static void btc8192e2ant_set_bt_auto_report(struct btc_coexist *btcoexist,
780 struct rtl_priv *rtlpriv = btcoexist->adapter;
793 btcoexist->btc_fill_h2c(btcoexist, 0x68, 1, h2c_parameter);
796 static void btc8192e2ant_bt_auto_report(struct btc_coexist *btcoexist,
800 struct rtl_priv *rtlpriv = btcoexist->adapter;
817 btc8192e2ant_set_bt_auto_report(btcoexist,
823 static void btc8192e2ant_fw_dac_swing_lvl(struct btc_coexist *btcoexist,
826 struct rtl_priv *rtlpriv = btcoexist->adapter;
844 btc8192e2ant_set_fw_dac_swing_level(btcoexist,
850 static void btc8192e2ant_set_sw_rf_rx_lpf_corner(struct btc_coexist *btcoexist,
853 struct rtl_priv *rtlpriv = btcoexist->adapter;
859 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1e,
865 if (btcoexist->initialized) {
868 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1e,
875 static void btc8192e2ant_rf_shrink(struct btc_coexist *btcoexist,
878 struct rtl_priv *rtlpriv = btcoexist->adapter;
896 btc8192e2ant_set_sw_rf_rx_lpf_corner(btcoexist,
902 static void btc8192e2ant_set_dac_swing_reg(struct btc_coexist *btcoexist,
905 struct rtl_priv *rtlpriv = btcoexist->adapter;
910 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x883, 0x3e, val);
913 static void btc8192e2ant_set_sw_full_swing(struct btc_coexist *btcoexist,
918 btc8192e2ant_set_dac_swing_reg(btcoexist, sw_dac_swing_lvl);
920 btc8192e2ant_set_dac_swing_reg(btcoexist, 0x18);
923 static void btc8192e2ant_dac_swing(struct btc_coexist *btcoexist,
927 struct rtl_priv *rtlpriv = btcoexist->adapter;
951 btc8192e2ant_set_sw_full_swing(btcoexist, dac_swing_on, dac_swing_lvl);
957 static void btc8192e2ant_set_agc_table(struct btc_coexist *btcoexist,
960 struct rtl_priv *rtlpriv = btcoexist->adapter;
966 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x0a1A0001);
967 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x091B0001);
968 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x081C0001);
969 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x071D0001);
970 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x061E0001);
971 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0x051F0001);
975 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xaa1A0001);
976 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xa91B0001);
977 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xa81C0001);
978 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xa71D0001);
979 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xa61E0001);
980 btcoexist->btc_write_4byte(btcoexist, 0xc78, 0xa51F0001);
984 static void btc8192e2ant_agc_table(struct btc_coexist *btcoexist,
987 struct rtl_priv *rtlpriv = btcoexist->adapter;
1004 btc8192e2ant_set_agc_table(btcoexist, agc_table_en);
1009 static void btc8192e2ant_set_coex_table(struct btc_coexist *btcoexist,
1013 struct rtl_priv *rtlpriv = btcoexist->adapter;
1017 btcoexist->btc_write_4byte(btcoexist, 0x6c0, val0x6c0);
1021 btcoexist->btc_write_4byte(btcoexist, 0x6c4, val0x6c4);
1025 btcoexist->btc_write_4byte(btcoexist, 0x6c8, val0x6c8);
1029 btcoexist->btc_write_1byte(btcoexist, 0x6cc, val0x6cc);
1032 static void btc8192e2ant_coex_table(struct btc_coexist *btcoexist,
1036 struct rtl_priv *rtlpriv = btcoexist->adapter;
1069 btc8192e2ant_set_coex_table(btcoexist, val0x6c0, val0x6c4, val0x6c8,
1078 static void btc8192e2ant_coex_table_with_type(struct btc_coexist *btcoexist,
1083 btc8192e2ant_coex_table(btcoexist, force_exec, 0x55555555,
1087 btc8192e2ant_coex_table(btcoexist, force_exec, 0x5a5a5a5a,
1091 btc8192e2ant_coex_table(btcoexist, force_exec, 0x55555555,
1095 btc8192e2ant_coex_table(btcoexist, force_exec, 0xdfffdfff,
1099 btc8192e2ant_coex_table(btcoexist, force_exec, 0xdfffdfff,
1107 static void btc8192e2ant_set_fw_ignore_wlan_act(struct btc_coexist *btcoexist,
1110 struct rtl_priv *rtlpriv = btcoexist->adapter;
1120 btcoexist->btc_fill_h2c(btcoexist, 0x63, 1, h2c_parameter);
1123 static void btc8192e2ant_ignore_wlan_act(struct btc_coexist *btcoexist,
1126 struct rtl_priv *rtlpriv = btcoexist->adapter;
1145 btc8192e2ant_set_fw_ignore_wlan_act(btcoexist, enable);
1150 static void btc8192e2ant_set_fw_ps_tdma(struct btc_coexist *btcoexist, u8 byte1,
1153 struct rtl_priv *rtlpriv = btcoexist->adapter;
1175 btcoexist->btc_fill_h2c(btcoexist, 0x60, 5, h2c_parameter);
1178 static void btc8192e2ant_sw_mechanism1(struct btc_coexist *btcoexist,
1182 btc8192e2ant_rf_shrink(btcoexist, NORMAL_EXEC, shrink_rx_lpf);
1185 static void btc8192e2ant_sw_mechanism2(struct btc_coexist *btcoexist,
1189 btc8192e2ant_agc_table(btcoexist, NORMAL_EXEC, agc_table_shift);
1190 btc8192e2ant_dac_swing(btcoexist, NORMAL_EXEC, sw_dac_swing,
1194 static void btc8192e2ant_ps_tdma(struct btc_coexist *btcoexist,
1197 struct rtl_priv *rtlpriv = btcoexist->adapter;
1222 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1a,
1226 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x12,
1230 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1c,
1234 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x10,
1238 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1a,
1242 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x12,
1246 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1c,
1250 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xa3, 0x10,
1254 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1a,
1258 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x12,
1262 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1c,
1266 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x10,
1270 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1a,
1274 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x12,
1278 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1c,
1282 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x12,
1286 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0x61, 0x20,
1290 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x5,
1294 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x25,
1298 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x25,
1302 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x15,
1306 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1a,
1315 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0x8, 0x0, 0x0,
1317 btcoexist->btc_write_1byte(btcoexist, 0x92c, 0x4);
1320 btc8192e2ant_set_fw_ps_tdma(btcoexist, 0x0, 0x0, 0x0,
1323 btcoexist->btc_write_1byte(btcoexist, 0x92c, 0x20);
1333 static void btc8192e2ant_set_switch_ss_type(struct btc_coexist *btcoexist,
1336 struct rtl_priv *rtlpriv = btcoexist->adapter;
1343 dis_ra_mask = btc8192e2ant_decide_ra_mask(btcoexist, ss_type,
1345 btc8192e2ant_update_ra_mask(btcoexist, FORCE_EXEC, dis_ra_mask);
1348 btc8192e2ant_ps_tdma(btcoexist, FORCE_EXEC, false, 1);
1350 btcoexist->btc_write_1byte(btcoexist, 0xc04, 0x11);
1351 btcoexist->btc_write_1byte(btcoexist, 0xd04, 0x1);
1352 btcoexist->btc_write_4byte(btcoexist, 0x90c, 0x81111111);
1354 btcoexist->btc_write_1byte_bitmask(btcoexist, 0xe77, 0x4, 0x1);
1355 btcoexist->btc_write_1byte(btcoexist, 0xa07, 0x81);
1358 btc8192e2ant_ps_tdma(btcoexist, FORCE_EXEC, false, 0);
1359 btcoexist->btc_write_1byte(btcoexist, 0xc04, 0x33);
1360 btcoexist->btc_write_1byte(btcoexist, 0xd04, 0x3);
1361 btcoexist->btc_write_4byte(btcoexist, 0x90c, 0x81121313);
1362 btcoexist->btc_write_1byte_bitmask(btcoexist, 0xe77, 0x4, 0x0);
1363 btcoexist->btc_write_1byte(btcoexist, 0xa07, 0x41);
1367 btcoexist->btc_set(btcoexist, BTC_SET_ACT_SEND_MIMO_PS, &mimops);
1370 static void btc8192e2ant_switch_ss_type(struct btc_coexist *btcoexist,
1373 struct rtl_priv *rtlpriv = btcoexist->adapter;
1384 btc8192e2ant_set_switch_ss_type(btcoexist, coex_dm->cur_ss_type);
1389 static void btc8192e2ant_coex_all_off(struct btc_coexist *btcoexist)
1392 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 1);
1393 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
1394 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
1397 btc8192e2ant_sw_mechanism1(btcoexist, false, false, false, false);
1398 btc8192e2ant_sw_mechanism2(btcoexist, false, false, false, 0x18);
1401 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0);
1404 static void btc8192e2ant_init_coex_dm(struct btc_coexist *btcoexist)
1408 btc8192e2ant_ps_tdma(btcoexist, FORCE_EXEC, false, 1);
1409 btc8192e2ant_fw_dac_swing_lvl(btcoexist, FORCE_EXEC, 6);
1410 btc8192e2ant_dec_bt_pwr(btcoexist, FORCE_EXEC, 0);
1412 btc8192e2ant_coex_table_with_type(btcoexist, FORCE_EXEC, 0);
1413 btc8192e2ant_switch_ss_type(btcoexist, FORCE_EXEC, 2);
1415 btc8192e2ant_sw_mechanism1(btcoexist, false, false, false, false);
1416 btc8192e2ant_sw_mechanism2(btcoexist, false, false, false, 0x18);
1419 static void btc8192e2ant_action_bt_inquiry(struct btc_coexist *btcoexist)
1423 btcoexist->btc_set(btcoexist, BTC_SET_ACT_DISABLE_LOW_POWER,
1426 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
1428 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2);
1429 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 3);
1430 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
1431 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
1433 btc8192e2ant_sw_mechanism1(btcoexist, false, false, false, false);
1434 btc8192e2ant_sw_mechanism2(btcoexist, false, false, false, 0x18);
1437 static bool btc8192e2ant_is_common_action(struct btc_coexist *btcoexist)
1439 struct rtl_priv *rtlpriv = btcoexist->adapter;
1440 struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
1444 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on);
1445 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED,
1447 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
1450 btc8192e2ant_limited_tx(btcoexist, NORMAL_EXEC, 1, 0, 0, 0);
1452 btc8192e2ant_limited_tx(btcoexist, NORMAL_EXEC, 0, 0, 0, 0);
1456 btcoexist->btc_set(btcoexist, BTC_SET_ACT_DISABLE_LOW_POWER,
1466 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 2);
1467 btc8192e2ant_coex_table_with_type(btcoexist,
1469 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 0);
1471 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
1472 btc8192e2ant_coex_table_with_type(btcoexist,
1474 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 1);
1477 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
1478 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
1480 btc8192e2ant_sw_mechanism1(btcoexist, false, false, false,
1482 btc8192e2ant_sw_mechanism2(btcoexist, false, false, false,
1490 btcoexist->btc_set(btcoexist,
1497 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 2);
1498 btc8192e2ant_coex_table_with_type(btcoexist,
1500 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 0);
1501 btc8192e2ant_fw_dac_swing_lvl(btcoexist,
1503 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
1505 btc8192e2ant_sw_mechanism1(btcoexist, false, false,
1507 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
1514 btcoexist->btc_set(btcoexist,
1523 btc8192e2ant_switch_ss_type(btcoexist,
1525 btc8192e2ant_coex_table_with_type(btcoexist,
1527 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
1529 btc8192e2ant_fw_dac_swing_lvl(btcoexist,
1531 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
1533 btc8192e2ant_sw_mechanism1(btcoexist, true, false,
1535 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
1541 btcoexist->btc_set(btcoexist,
1553 btc8192e2ant_switch_ss_type(btcoexist,
1555 btc8192e2ant_coex_table_with_type(btcoexist,
1558 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
1560 btc8192e2ant_fw_dac_swing_lvl(btcoexist,
1562 btc8192e2ant_dec_bt_pwr(btcoexist,
1564 btc8192e2ant_sw_mechanism1(btcoexist, false,
1566 btc8192e2ant_sw_mechanism2(btcoexist, false,
1575 static void btc8192e2ant_tdma_duration_adjust(struct btc_coexist *btcoexist,
1579 struct rtl_priv *rtlpriv = btcoexist->adapter;
1593 btc8192e2ant_ps_tdma(btcoexist,
1598 btc8192e2ant_ps_tdma(btcoexist,
1603 btc8192e2ant_ps_tdma(btcoexist,
1610 btc8192e2ant_ps_tdma(btcoexist,
1615 btc8192e2ant_ps_tdma(btcoexist,
1620 btc8192e2ant_ps_tdma(btcoexist,
1629 btc8192e2ant_ps_tdma(btcoexist,
1634 btc8192e2ant_ps_tdma(btcoexist,
1639 btc8192e2ant_ps_tdma(btcoexist,
1646 btc8192e2ant_ps_tdma(btcoexist,
1651 btc8192e2ant_ps_tdma(btcoexist,
1656 btc8192e2ant_ps_tdma(btcoexist,
1751 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
1752 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link);
1753 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam);
1756 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
1765 static void btc8192e2ant_action_sco(struct btc_coexist *btcoexist)
1770 wifi_rssi_state = btc8192e2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0);
1772 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
1773 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8);
1775 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
1777 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 4);
1779 bt_rssi_state = btc8192e2ant_bt_rssi_state(btcoexist, 3, 34, 42);
1783 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
1784 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 13);
1787 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 2);
1788 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 9);
1791 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 4);
1792 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 9);
1795 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
1801 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
1803 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
1806 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
1808 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
1814 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
1816 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
1819 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
1821 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
1827 static void btc8192e2ant_action_sco_pan(struct btc_coexist *btcoexist)
1832 wifi_rssi_state = btc8192e2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0);
1834 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
1835 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8);
1837 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
1839 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 4);
1841 bt_rssi_state = btc8192e2ant_bt_rssi_state(btcoexist, 3, 34, 42);
1845 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
1846 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 14);
1849 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 2);
1850 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 10);
1853 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 4);
1854 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 10);
1857 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
1863 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
1865 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
1868 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
1870 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
1876 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
1878 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
1881 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
1883 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
1889 static void btc8192e2ant_action_hid(struct btc_coexist *btcoexist)
1894 wifi_rssi_state = btc8192e2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0);
1895 bt_rssi_state = btc8192e2ant_bt_rssi_state(btcoexist, 3, 34, 42);
1897 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
1898 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8);
1900 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
1902 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
1904 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 3);
1908 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
1909 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 13);
1912 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 2);
1913 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 9);
1916 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 4);
1917 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 9);
1924 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
1926 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
1929 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
1931 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
1937 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
1939 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
1942 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
1944 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
1951 static void btc8192e2ant_action_a2dp(struct btc_coexist *btcoexist)
1953 struct rtl_priv *rtlpriv = btcoexist->adapter;
1958 wifi_rssi_state = btc8192e2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0);
1959 bt_rssi_state = btc8192e2ant_bt_rssi_state(btcoexist, 3, 34, 42);
1970 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 2);
1971 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, true,
1974 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
1975 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false,
1979 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
1982 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0);
1984 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2);
1987 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 17);
1989 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
1993 btc8192e2ant_tdma_duration_adjust(btcoexist, false,
1995 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
1998 btc8192e2ant_tdma_duration_adjust(btcoexist, false,
2000 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 2);
2003 btc8192e2ant_tdma_duration_adjust(btcoexist, false,
2005 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 4);
2010 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
2014 btc8192e2ant_sw_mechanism1(btcoexist, true, false,
2016 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2019 btc8192e2ant_sw_mechanism1(btcoexist, true, false,
2021 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2027 btc8192e2ant_sw_mechanism1(btcoexist, false, false,
2029 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2032 btc8192e2ant_sw_mechanism1(btcoexist, false, false,
2034 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2040 static void btc8192e2ant_action_a2dp_pan_hs(struct btc_coexist *btcoexist)
2045 wifi_rssi_state = btc8192e2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0);
2046 bt_rssi_state = btc8192e2ant_bt_rssi_state(btcoexist, 3, 34, 42);
2048 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
2049 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8);
2051 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
2052 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2);
2056 btc8192e2ant_tdma_duration_adjust(btcoexist, false, true, 2);
2057 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
2060 btc8192e2ant_tdma_duration_adjust(btcoexist, false, false, 2);
2061 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 2);
2064 btc8192e2ant_tdma_duration_adjust(btcoexist, false, false, 2);
2065 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 4);
2069 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
2073 btc8192e2ant_sw_mechanism1(btcoexist, true, false,
2075 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2078 btc8192e2ant_sw_mechanism1(btcoexist, true, false,
2080 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2086 btc8192e2ant_sw_mechanism1(btcoexist, false, false,
2088 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2091 btc8192e2ant_sw_mechanism1(btcoexist, false, false,
2093 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2099 static void btc8192e2ant_action_pan_edr(struct btc_coexist *btcoexist)
2104 wifi_rssi_state = btc8192e2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0);
2105 bt_rssi_state = btc8192e2ant_bt_rssi_state(btcoexist, 3, 34, 42);
2107 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
2108 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8);
2110 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
2112 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2);
2116 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
2117 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 5);
2120 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 2);
2121 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 1);
2124 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 4);
2125 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 1);
2129 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
2133 btc8192e2ant_sw_mechanism1(btcoexist, true, false,
2135 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2138 btc8192e2ant_sw_mechanism1(btcoexist, true, false,
2140 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2146 btc8192e2ant_sw_mechanism1(btcoexist, false, false,
2148 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2151 btc8192e2ant_sw_mechanism1(btcoexist, false, false,
2153 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2160 static void btc8192e2ant_action_pan_hs(struct btc_coexist *btcoexist)
2165 wifi_rssi_state = btc8192e2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0);
2166 bt_rssi_state = btc8192e2ant_bt_rssi_state(btcoexist, 3, 34, 42);
2168 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
2169 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8);
2171 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
2173 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2);
2177 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
2180 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 2);
2183 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 4);
2185 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 1);
2187 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
2191 btc8192e2ant_sw_mechanism1(btcoexist, true, false,
2193 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2196 btc8192e2ant_sw_mechanism1(btcoexist, true, false,
2198 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2204 btc8192e2ant_sw_mechanism1(btcoexist, false, false,
2206 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2209 btc8192e2ant_sw_mechanism1(btcoexist, false, false,
2211 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2218 static void btc8192e2ant_action_pan_edr_a2dp(struct btc_coexist *btcoexist)
2223 wifi_rssi_state = btc8192e2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0);
2224 bt_rssi_state = btc8192e2ant_bt_rssi_state(btcoexist, 3, 34, 42);
2226 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
2227 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8);
2229 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
2231 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2);
2233 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
2237 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
2238 btc8192e2ant_tdma_duration_adjust(btcoexist, false, true, 3);
2241 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 2);
2242 btc8192e2ant_tdma_duration_adjust(btcoexist, false, false, 3);
2245 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 4);
2246 btc8192e2ant_tdma_duration_adjust(btcoexist, false, false, 3);
2253 btc8192e2ant_sw_mechanism1(btcoexist, true, false,
2255 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2258 btc8192e2ant_sw_mechanism1(btcoexist, true, false,
2260 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2266 btc8192e2ant_sw_mechanism1(btcoexist, false, false,
2268 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2271 btc8192e2ant_sw_mechanism1(btcoexist, false, false,
2273 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2279 static void btc8192e2ant_action_pan_edr_hid(struct btc_coexist *btcoexist)
2284 wifi_rssi_state = btc8192e2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0);
2285 bt_rssi_state = btc8192e2ant_bt_rssi_state(btcoexist, 3, 34, 42);
2287 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
2289 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
2290 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8);
2292 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
2294 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 3);
2298 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
2299 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 14);
2302 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 2);
2303 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 10);
2306 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 4);
2307 btc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
2315 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
2317 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2320 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
2322 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2328 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
2330 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2333 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
2335 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2342 static void btc8192e2ant_action_hid_a2dp_pan_edr(struct btc_coexist *btcoexist)
2347 wifi_rssi_state = btc8192e2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0);
2348 bt_rssi_state = btc8192e2ant_bt_rssi_state(btcoexist, 3, 34, 42);
2350 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
2351 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8);
2353 btc8192e2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
2355 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
2357 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 3);
2361 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
2362 btc8192e2ant_tdma_duration_adjust(btcoexist, true, true, 3);
2365 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 2);
2366 btc8192e2ant_tdma_duration_adjust(btcoexist, true, false, 3);
2369 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 4);
2370 btc8192e2ant_tdma_duration_adjust(btcoexist, true, false, 3);
2377 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
2379 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2382 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
2384 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2390 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
2392 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2395 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
2397 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2403 static void btc8192e2ant_action_hid_a2dp(struct btc_coexist *btcoexist)
2408 wifi_rssi_state = btc8192e2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0);
2409 bt_rssi_state = btc8192e2ant_bt_rssi_state(btcoexist, 3, 34, 42);
2411 btc8192e2ant_switch_ss_type(btcoexist, NORMAL_EXEC, 1);
2412 btc8192e2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8);
2414 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
2416 btc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 3);
2420 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
2421 btc8192e2ant_tdma_duration_adjust(btcoexist, true, true, 2);
2424 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 2);
2425 btc8192e2ant_tdma_duration_adjust(btcoexist, true, false, 2);
2428 btc8192e2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 4);
2429 btc8192e2ant_tdma_duration_adjust(btcoexist, true, false, 2);
2436 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
2438 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2441 btc8192e2ant_sw_mechanism1(btcoexist, true, true,
2443 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2449 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
2451 btc8192e2ant_sw_mechanism2(btcoexist, true, false,
2454 btc8192e2ant_sw_mechanism1(btcoexist, false, true,
2456 btc8192e2ant_sw_mechanism2(btcoexist, false, false,
2462 static void btc8192e2ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
2464 struct rtl_priv *rtlpriv = btcoexist->adapter;
2470 if (btcoexist->manual_control) {
2482 algorithm = btc8192e2ant_action_algorithm(btcoexist);
2487 btc8192e2ant_action_bt_inquiry(btcoexist);
2495 if (btc8192e2ant_is_common_action(btcoexist)) {
2511 btc8192e2ant_action_sco(btcoexist);
2516 btc8192e2ant_action_sco_pan(btcoexist);
2521 btc8192e2ant_action_hid(btcoexist);
2526 btc8192e2ant_action_a2dp(btcoexist);
2531 btc8192e2ant_action_a2dp_pan_hs(btcoexist);
2536 btc8192e2ant_action_pan_edr(btcoexist);
2541 btc8192e2ant_action_pan_hs(btcoexist);
2546 btc8192e2ant_action_pan_edr_a2dp(btcoexist);
2551 btc8192e2ant_action_pan_edr_hid(btcoexist);
2556 btc8192e2ant_action_hid_a2dp_pan_edr(btcoexist);
2561 btc8192e2ant_action_hid_a2dp(btcoexist);
2566 /* btc8192e2ant_coex_all_off(btcoexist); */
2573 static void btc8192e2ant_init_hwconfig(struct btc_coexist *btcoexist,
2576 struct rtl_priv *rtlpriv = btcoexist->adapter;
2586 btcoexist->btc_get_rf_reg(btcoexist, BTC_RF_A,
2589 coex_dm->backup_arfr_cnt1 = btcoexist->btc_read_4byte(btcoexist,
2591 coex_dm->backup_arfr_cnt2 = btcoexist->btc_read_4byte(btcoexist,
2593 coex_dm->backup_retry_limit = btcoexist->btc_read_2byte(
2594 btcoexist,
2596 coex_dm->backup_ampdu_maxtime = btcoexist->btc_read_1byte(
2597 btcoexist,
2602 btcoexist->btc_write_1byte(btcoexist, 0x4f, 0x6);
2603 btcoexist->btc_write_1byte(btcoexist, 0x944, 0x24);
2604 btcoexist->btc_write_4byte(btcoexist, 0x930, 0x700700);
2605 btcoexist->btc_write_1byte(btcoexist, 0x92c, 0x20);
2606 if (btcoexist->chip_interface == BTC_INTF_USB)
2607 btcoexist->btc_write_4byte(btcoexist, 0x64, 0x30430004);
2609 btcoexist->btc_write_4byte(btcoexist, 0x64, 0x30030004);
2611 btc8192e2ant_coex_table_with_type(btcoexist, FORCE_EXEC, 0);
2614 btcoexist->btc_write_4byte(btcoexist, 0x858, 0x55555555);
2617 btcoexist->btc_write_1byte(btcoexist, 0x778, 0x3);
2619 u8tmp = btcoexist->btc_read_1byte(btcoexist, 0x790);
2622 btcoexist->btc_write_1byte(btcoexist, 0x790, u8tmp);
2625 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0x4);
2628 btcoexist->btc_write_1byte(btcoexist, 0x40, 0x20);
2630 u16tmp = btcoexist->btc_read_2byte(btcoexist, 0x40);
2632 btcoexist->btc_write_2byte(btcoexist, 0x40, u16tmp);
2635 u8tmp = btcoexist->btc_read_1byte(btcoexist, 0x101);
2637 btcoexist->btc_write_1byte(btcoexist, 0x101, u8tmp);
2640 u8tmp = btcoexist->btc_read_1byte(btcoexist, 0x93);
2642 btcoexist->btc_write_1byte(btcoexist, 0x93, u8tmp);
2644 u8tmp = btcoexist->btc_read_1byte(btcoexist, 0x7);
2646 btcoexist->btc_write_1byte(btcoexist, 0x7, u8tmp);
2653 void ex_btc8192e2ant_init_hwconfig(struct btc_coexist *btcoexist)
2655 btc8192e2ant_init_hwconfig(btcoexist, true);
2658 void ex_btc8192e2ant_init_coex_dm(struct btc_coexist *btcoexist)
2660 struct rtl_priv *rtlpriv = btcoexist->adapter;
2664 btc8192e2ant_init_coex_dm(btcoexist);
2667 void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist,
2670 struct btc_board_info *board_info = &btcoexist->board_info;
2671 struct btc_stack_info *stack_info = &btcoexist->stack_info;
2684 if (btcoexist->manual_control) {
2696 btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver);
2697 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver);
2703 btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on);
2704 btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_DOT11_CHNL,
2706 btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl);
2714 btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
2715 btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi);
2719 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
2720 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &link);
2721 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam);
2725 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g);
2726 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
2727 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
2728 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION,
2740 ((btcoexist->bt_info.bt_disabled) ? ("disabled") :
2753 btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_BT_LINK_INFO, m);
2773 btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD, m);
2790 btcoexist->bt_info.ra_mask);
2818 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x430);
2819 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x434);
2820 u16tmp[0] = btcoexist->btc_read_2byte(btcoexist, 0x42a);
2821 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x456);
2826 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc04);
2827 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0xd04);
2828 u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x90c);
2832 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778);
2835 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x92c);
2836 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x930);
2840 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x40);
2841 u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x4f);
2845 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550);
2846 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522);
2850 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50);
2854 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0);
2855 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4);
2856 u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8);
2857 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x6cc);
2869 if (btcoexist->auto_report_2ant)
2870 btc8192e2ant_monitor_bt_ctr(btcoexist);
2871 btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS, m);
2874 void ex_btc8192e2ant_ips_notify(struct btc_coexist *btcoexist, u8 type)
2876 struct rtl_priv *rtlpriv = btcoexist->adapter;
2882 btc8192e2ant_coex_all_off(btcoexist);
2890 void ex_btc8192e2ant_lps_notify(struct btc_coexist *btcoexist, u8 type)
2892 struct rtl_priv *rtlpriv = btcoexist->adapter;
2905 void ex_btc8192e2ant_scan_notify(struct btc_coexist *btcoexist, u8 type)
2907 struct rtl_priv *rtlpriv = btcoexist->adapter;
2917 void ex_btc8192e2ant_connect_notify(struct btc_coexist *btcoexist, u8 type)
2919 struct rtl_priv *rtlpriv = btcoexist->adapter;
2929 void ex_btc8192e2ant_media_status_notify(struct btc_coexist *btcoexist,
2932 struct rtl_priv *rtlpriv = btcoexist->adapter;
2937 if (btcoexist->manual_control ||
2938 btcoexist->stop_coex_dm ||
2939 btcoexist->bt_info.bt_disabled)
2950 btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL,
2956 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
2972 btcoexist->btc_fill_h2c(btcoexist, 0x66, 3, h2c_parameter);
2975 void ex_btc8192e2ant_special_packet_notify(struct btc_coexist *btcoexist,
2978 struct rtl_priv *rtlpriv = btcoexist->adapter;
2985 void ex_btc8192e2ant_bt_info_notify(struct btc_coexist *btcoexist,
2988 struct rtl_priv *rtlpriv = btcoexist->adapter;
3033 btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED,
3037 btcoexist,
3041 btcoexist,
3046 if (!btcoexist->manual_control &&
3047 !btcoexist->stop_coex_dm) {
3050 btc8192e2ant_ignore_wlan_act(btcoexist,
3060 if (!btcoexist->auto_report_2ant) {
3062 btc8192e2ant_bt_auto_report(btcoexist,
3101 btc8192e2ant_update_bt_link_info(btcoexist);
3136 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bt_busy);
3139 btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_LIMITED_DIG, &limited_dig);
3141 btc8192e2ant_run_coexist_mechanism(btcoexist);
3144 void ex_btc8192e2ant_halt_notify(struct btc_coexist *btcoexist)
3146 struct rtl_priv *rtlpriv = btcoexist->adapter;
3150 btc8192e2ant_ignore_wlan_act(btcoexist, FORCE_EXEC, true);
3151 ex_btc8192e2ant_media_status_notify(btcoexist, BTC_MEDIA_DISCONNECT);
3154 void ex_btc8192e2ant_periodical(struct btc_coexist *btcoexist)
3156 struct rtl_priv *rtlpriv = btcoexist->adapter;
3159 struct btc_board_info *board_info = &btcoexist->board_info;
3160 struct btc_stack_info *stack_info = &btcoexist->stack_info;
3176 btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER,
3178 btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver);
3187 if (!btcoexist->auto_report_2ant) {
3188 btc8192e2ant_query_bt_info(btcoexist);
3189 btc8192e2ant_monitor_bt_ctr(btcoexist);
3190 btc8192e2ant_monitor_bt_enable_disable(btcoexist);
3192 if (btc8192e2ant_is_wifi_status_changed(btcoexist) ||
3194 btc8192e2ant_run_coexist_mechanism(btcoexist);