rtl8188eu: Remove code for platforms other than Linux in hal/

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2018-10-20 14:52:30 -05:00
parent 85ec7cf9ce
commit 038e7c215b
13 changed files with 4 additions and 2920 deletions

View file

@ -27,7 +27,6 @@ static struct coex_sta_8723b_1ant *coex_sta = &glcoex_sta_8723b_1ant;
static struct psdscan_sta_8723b_1ant gl_psd_scan_8723b_1ant;
static struct psdscan_sta_8723b_1ant *psd_scan = &gl_psd_scan_8723b_1ant;
const char *const glbt_info_src_8723b_1ant[] = {
"BT Info[wifi fw]",
"BT Info[bt rsp]",
@ -192,7 +191,6 @@ void halbtc8723b1ant_limited_rx(IN struct btc_coexist *btcoexist,
/* real update aggregation setting */
btcoexist->btc_set(btcoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL);
}
void halbtc8723b1ant_query_bt_info(IN struct btc_coexist *btcoexist)
@ -273,7 +271,6 @@ void halbtc8723b1ant_monitor_bt_ctr(IN struct btc_coexist *btcoexist)
}
void halbtc8723b1ant_monitor_wifi_ctr(IN struct btc_coexist *btcoexist)
{
s32 wifi_rssi = 0;
@ -364,7 +361,6 @@ void halbtc8723b1ant_monitor_wifi_ctr(IN struct btc_coexist *btcoexist)
coex_sta->pre_ccklock = coex_sta->cck_lock;
}
boolean halbtc8723b1ant_is_wifi_status_changed(IN struct btc_coexist *btcoexist)
@ -395,7 +391,6 @@ boolean halbtc8723b1ant_is_wifi_status_changed(IN struct btc_coexist *btcoexist)
return true;
}
}
return false;
@ -586,8 +581,6 @@ void halbtc8723b1ant_set_coex_table(IN struct btc_coexist *btcoexist,
btcoexist->btc_write_1byte(btcoexist, 0x6cc, val0x6cc);
}
void halbtc8723b1ant_coex_table(IN struct btc_coexist *btcoexist,
IN boolean force_exec, IN u32 val0x6c0, IN u32 val0x6c4,
IN u32 val0x6c8, IN u8 val0x6cc)
@ -967,7 +960,6 @@ void halbtc8723b1ant_set_ant_path(IN struct btc_coexist *btcoexist,
u32tmp |= BIT(24);
btcoexist->btc_write_4byte(btcoexist, 0x4c, u32tmp);
u32tmp_1[0] = btcoexist->btc_read_4byte(btcoexist,
0x948);
if ((u32tmp_1[0] == 0x40) || (u32tmp_1[0] == 0x240))
@ -977,7 +969,6 @@ void halbtc8723b1ant_set_ant_path(IN struct btc_coexist *btcoexist,
btcoexist->btc_write_4byte(btcoexist, 0x948,
0x0);
if (board_info->btdm_ant_pos ==
BTC_ANTENNA_AT_MAIN_PORT) {
/* tell firmware "no antenna inverse" */
@ -1175,7 +1166,6 @@ void halbtc8723b1ant_ps_tdma_check_for_power_save_state(
}
}
void halbtc8723b1ant_power_save_state(IN struct btc_coexist *btcoexist,
IN u8 ps_type, IN u8 lps_val, IN u8 rpwm_val)
{
@ -1219,7 +1209,6 @@ void halbtc8723b1ant_power_save_state(IN struct btc_coexist *btcoexist,
}
}
void halbtc8723b1ant_set_fw_pstdma(IN struct btc_coexist *btcoexist,
IN u8 byte1, IN u8 byte2, IN u8 byte3, IN u8 byte4, IN u8 byte5)
{
@ -1265,7 +1254,6 @@ void halbtc8723b1ant_set_fw_pstdma(IN struct btc_coexist *btcoexist,
btcoexist->btc_fill_h2c(btcoexist, 0x60, 5, h2c_parameter);
}
void halbtc8723b1ant_ps_tdma(IN struct btc_coexist *btcoexist,
IN boolean force_exec, IN boolean turn_on, IN u8 type)
{
@ -1355,11 +1343,6 @@ void halbtc8723b1ant_ps_tdma(IN struct btc_coexist *btcoexist,
ps_tdma_byte3_val = 0x10; /* tx-pause at BT-slot */
ps_tdma_byte4_val =
0x10; /* 0x778 = d/1 toggle, no dynamic slot */
#if 0
if (!wifi_busy)
ps_tdma_byte4_val = ps_tdma_byte4_val |
0x1; /* 0x778 = 0x1 at wifi slot (no blocking BT Low-Pri pkts) */
#endif
} else { /* native power save case */
ps_tdma_byte0_val = 0x61; /* no null-pkt */
ps_tdma_byte3_val = 0x11; /* no tx-pause at BT-slot */
@ -1380,7 +1363,6 @@ void halbtc8723b1ant_ps_tdma(IN struct btc_coexist *btcoexist,
0x60; /* set antenna no toggle, control by antenna diversity */
}
if (turn_on) {
switch (type) {
default:
@ -1839,7 +1821,6 @@ void halbtc8723b1ant_tdma_duration_adjust_for_acl(IN struct btc_coexist
}
}
/* *********************************************
*
* Non-Software Coex Mechanism start
@ -1853,7 +1834,6 @@ void halbtc8723b1ant_action_bt_whck_test(IN struct btc_coexist *btcoexist)
halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0);
}
void halbtc8723b1ant_action_hs(IN struct btc_coexist *btcoexist)
{
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 5);
@ -2189,7 +2169,6 @@ void halbtc8723b1ant_action_wifi_connected(IN struct btc_coexist *btcoexist)
&ap_enable);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
/* tdma and coex table */
if (!wifi_busy) {
if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == coex_dm->bt_status) {
@ -2396,7 +2375,6 @@ void halbtc8723b1ant_run_coexist_mechanism(IN struct btc_coexist *btcoexist)
return;
}
if (!wifi_connected) {
boolean scan = false, link = false, roam = false;
@ -2446,7 +2424,6 @@ void halbtc8723b1ant_init_hw_config(IN struct btc_coexist *btcoexist,
psd_scan->ant_det_is_ant_det_available = false;
/* Give bt_coex_supported_version the default value */
coex_sta->bt_coex_supported_version = 0;
@ -2465,7 +2442,6 @@ void halbtc8723b1ant_init_hw_config(IN struct btc_coexist *btcoexist,
btcoexist->btc_write_1byte(btcoexist, 0x778, 0x1);
btcoexist->btc_write_1byte_bitmask(btcoexist, 0x40, 0x20, 0x1);
/* btcoexist->btc_write_1byte_bitmask(btcoexist, 0x67, 0x20, 0x1); */ /*BT select s0/s1 is controlled by WiFi */
halbtc8723b1ant_ps_tdma(btcoexist, FORCE_EXEC, false, 8);
@ -2493,9 +2469,6 @@ void halbtc8723b1ant_init_hw_config(IN struct btc_coexist *btcoexist,
}
/* Donot remove optimize off flag, otherwise antenna detection would trigger BT collapsed */
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
void halbtc8723b1ant_mechanism_switch(IN struct btc_coexist *btcoexist,
IN boolean bSwitchTo2Antenna)
{
@ -2520,52 +2493,6 @@ void halbtc8723b1ant_mechanism_switch(IN struct btc_coexist *btcoexist,
BTC_TRACE(trace_buf);
}
#if 0
if (bSwitchTo2Antenna) { /* 1-Ant -> 2-Ant */
/* un-lock TRx Mask setup for 8723b f-cut */
btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0xdd, 0x80, 0x1);
btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0xdf, 0x1, 0x1);
/* WiFi TRx Mask on */
btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff,
0x0);
/* BT TRx Mask un-lock 0x2c[0], 0x30[0] = 1 */
btcoexist->btc_set_bt_reg(btcoexist, BTC_BT_REG_RF, 0x2c,
0x7c45);
btcoexist->btc_set_bt_reg(btcoexist, BTC_BT_REG_RF, 0x30,
0x7c45);
/* BT TRx Mask on */
btcoexist->btc_set_bt_reg(btcoexist, BTC_BT_REG_RF, 0x3c, 0x1);
halbtc8723b1ant_set_ant_path(btcoexist, BTC_ANT_PATH_BT,
FORCE_EXEC, false, false);
} else {
/* WiFi TRx Mask on */
btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff,
0x780);
/* lock TRx Mask setup for 8723b f-cut */
btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0xdd, 0x80, 0x0);
btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0xdf, 0x1, 0x0);
/* BT TRx Mask on */
btcoexist->btc_set_bt_reg(btcoexist, BTC_BT_REG_RF, 0x3c, 0x15);
/* BT TRx Mask ock 0x2c[0], 0x30[0] = 0 */
btcoexist->btc_set_bt_reg(btcoexist, BTC_BT_REG_RF, 0x2c,
0x7c44);
btcoexist->btc_set_bt_reg(btcoexist, BTC_BT_REG_RF, 0x30,
0x7c44);
halbtc8723b1ant_set_ant_path(btcoexist, BTC_ANT_PATH_PTA,
FORCE_EXEC, false, false);
}
#endif
}
u32 halbtc8723b1ant_psd_log2base(IN struct btc_coexist *btcoexist, IN u32 val)
@ -2590,7 +2517,6 @@ u32 halbtc8723b1ant_psd_log2base(IN struct btc_coexist *btcoexist, IN u32 val)
shiftcount++;
}
val_integerd_b = shiftcount + 1;
tmp2 = 1;
@ -2609,7 +2535,6 @@ u32 halbtc8723b1ant_psd_log2base(IN struct btc_coexist *btcoexist, IN u32 val)
return result;
}
void halbtc8723b1ant_psd_show_antenna_detect_result(IN struct btc_coexist
@ -2698,7 +2623,6 @@ void halbtc8723b1ant_psd_show_antenna_detect_result(IN struct btc_coexist
}
CL_PRINTF(cli_buf);
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d",
"Ant Detect Total Count", psd_scan->ant_det_try_count);
CL_PRINTF(cli_buf);
@ -2752,7 +2676,6 @@ void halbtc8723b1ant_psd_show_antenna_detect_result(IN struct btc_coexist
"PSD Scan Peak Freq", psd_scan->ant_det_peak_freq);
CL_PRINTF(cli_buf);
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "TFBGA Package",
(board_info->tfbga_package) ? "Yes" : "No");
CL_PRINTF(cli_buf);
@ -2886,7 +2809,6 @@ void halbtc8723b1ant_psd_showdata(IN struct btc_coexist *btcoexist)
} while ((i <= 8) && (m <= psd_scan->psd_stop_point));
do {
psd_rep1 = psd_scan->psd_report_max_hold[n] /
100;
@ -2947,7 +2869,6 @@ void halbtc8723b1ant_psd_showdata(IN struct btc_coexist *btcoexist)
}
}
}
void halbtc8723b1ant_psd_max_holddata(IN struct btc_coexist *btcoexist,
@ -2990,7 +2911,6 @@ void halbtc8723b1ant_psd_max_holddata(IN struct btc_coexist *btcoexist,
}
}
u32 halbtc8723b1ant_psd_getdata(IN struct btc_coexist *btcoexist, IN u32 point)
@ -3024,7 +2944,6 @@ u32 halbtc8723b1ant_psd_getdata(IN struct btc_coexist *btcoexist, IN u32 point)
return psd_report;
}
boolean halbtc8723b1ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN s32 offset, IN u32 span, IN u32 points,
IN u32 avgnum, IN u32 loopcnt)
@ -3056,7 +2975,6 @@ boolean halbtc8723b1ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
psd_scan->real_offset = offset;
psd_scan->real_span = span;
points1 = psd_scan->psd_point;
delta_freq_per_point = psd_scan->psd_band_width /
psd_scan->psd_point;
@ -3141,7 +3059,6 @@ boolean halbtc8723b1ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
0x18, 0x3ff, (cent_freq - 2412) / 5 +
1); /* WiFi TRx Mask on */
/* Set RF Rx filter corner */
btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1e,
0xfffff, 0x3e4);
@ -3214,7 +3131,6 @@ boolean halbtc8723b1ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
n = i - psd_scan->psd_start_base;
psd_scan->psd_report[n] = tmp;
halbtc8723b1ant_psd_max_holddata(
btcoexist, j);
@ -3273,8 +3189,6 @@ boolean halbtc8723b1ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
} while (!outloop);
psd_scan->is_psd_running = false;
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
@ -3640,8 +3554,6 @@ void halbtc8723b1ant_psd_antenna_detection(IN struct btc_coexist *btcoexist,
} while (!outloop);
}
void halbtc8723b1ant_psd_antenna_detection_check(IN struct btc_coexist
@ -3655,7 +3567,6 @@ void halbtc8723b1ant_psd_antenna_detection_check(IN struct btc_coexist
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam);
/* psd_scan->ant_det_bt_tx_time = 20; */
psd_scan->ant_det_bt_tx_time =
BT_8723B_1ANT_ANTDET_BTTXTIME; /* 0.42ms*50 = 20ms (0.42ms = 1 PSD sweep) */
@ -3717,7 +3628,6 @@ void halbtc8723b1ant_psd_antenna_detection_check(IN struct btc_coexist
}
/* ************************************************************
* work around function start with wa_halbtc8723b1ant_
* ************************************************************
@ -3731,7 +3641,6 @@ void ex_halbtc8723b1ant_power_on_setting(IN struct btc_coexist *btcoexist)
u16 u16tmp = 0x0;
u32 value;
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"xxxxxxxxxxxxxxxx Execute 8723b 1-Ant PowerOn Setting xxxxxxxxxxxxxxxx!!\n");
BTC_TRACE(trace_buf);
@ -3742,7 +3651,6 @@ void ex_halbtc8723b1ant_power_on_setting(IN struct btc_coexist *btcoexist)
board_info->btdm_ant_num_by_ant_det);
BTC_TRACE(trace_buf);
btcoexist->stop_coex_dm = true;
btcoexist->btc_write_1byte(btcoexist, 0x67, 0x20);
@ -3997,7 +3905,6 @@ void ex_halbtc8723b1ant_display_coex_info(IN struct btc_coexist *btcoexist)
}
}
if (btcoexist->manual_control)
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s",
"============[mechanisms] (before Manual)============");
@ -4169,7 +4076,6 @@ void ex_halbtc8723b1ant_display_coex_info(IN struct btc_coexist *btcoexist)
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS);
}
void ex_halbtc8723b1ant_ips_notify(IN struct btc_coexist *btcoexist, IN u8 type)
{
if (btcoexist->manual_control || btcoexist->stop_coex_dm)
@ -4246,7 +4152,6 @@ void ex_halbtc8723b1ant_scan_notify(IN struct btc_coexist *btcoexist,
u8tmpa = btcoexist->btc_read_1byte(btcoexist, 0x765);
u8tmpb = btcoexist->btc_read_1byte(btcoexist, 0x67);
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"[BTCoex], 0x948=0x%x, 0x765=0x%x, 0x67=0x%x\n",
u32tmp, u8tmpa, u8tmpb);
@ -4538,9 +4443,6 @@ void ex_halbtc8723b1ant_specific_packet_notify(IN struct btc_coexist *btcoexist,
}
/* Donot remove optimize off flag, otherwise antenna detection would trigger BT collapsed */
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
void ex_halbtc8723b1ant_bt_info_notify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length)
{
@ -4620,7 +4522,6 @@ void ex_halbtc8723b1ant_bt_info_notify(IN struct btc_coexist *btcoexist,
return;
}
#if BT_8723B_1ANT_ANTDET_ENABLE
#if BT_8723B_1ANT_ANTDET_COEXMECHANISMSWITCH_ENABLE
if ((board_info->btdm_ant_det_finish) &&
@ -4633,21 +4534,6 @@ void ex_halbtc8723b1ant_bt_info_notify(IN struct btc_coexist *btcoexist,
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"############# [BTCoex], BT TRx Mask off for BT Info Notify\n");
BTC_TRACE(trace_buf);
#if 0
/* BT into is responded by BT FW and BT RF REG 0x3C != 0x15 => Need to switch BT TRx Mask */
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"[BTCoex], Switch BT TRx Mask since BT RF REG 0x3C != 0x1\n");
BTC_TRACE(trace_buf);
/* BT TRx Mask un-lock 0x2c[0], 0x30[0] = 1 */
btcoexist->btc_set_bt_reg(btcoexist,
BTC_BT_REG_RF, 0x2c, 0x7c45);
btcoexist->btc_set_bt_reg(btcoexist,
BTC_BT_REG_RF, 0x30, 0x7c45);
btcoexist->btc_set_bt_reg(btcoexist,
BTC_BT_REG_RF, 0x3c, 0x1);
#endif
}
} else
#endif
@ -4662,23 +4548,6 @@ void ex_halbtc8723b1ant_bt_info_notify(IN struct btc_coexist *btcoexist,
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"############# [BTCoex], BT TRx Mask on for BT Info Notify\n");
BTC_TRACE(trace_buf);
#if 0
/* BT into is responded by BT FW and BT RF REG 0x3C != 0x15 => Need to switch BT TRx Mask */
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"[BTCoex], Switch BT TRx Mask since BT RF REG 0x3C != 0x15\n");
BTC_TRACE(trace_buf);
btcoexist->btc_set_bt_reg(btcoexist,
BTC_BT_REG_RF,
0x3c, 0x15);
/* BT TRx Mask lock 0x2c[0], 0x30[0] = 0 */
btcoexist->btc_set_bt_reg(btcoexist,
BTC_BT_REG_RF,
0x2c, 0x7c44);
btcoexist->btc_set_bt_reg(btcoexist,
BTC_BT_REG_RF,
0x30, 0x7c44);
#endif
}
}
@ -4852,7 +4721,6 @@ void ex_halbtc8723b1ant_rf_status_notify(IN struct btc_coexist *btcoexist,
u8tmpb = btcoexist->btc_read_1byte(btcoexist, 0x67);
u8tmpc = btcoexist->btc_read_1byte(btcoexist, 0x76e);
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"############# [BTCoex], 0x948=0x%x, 0x765=0x%x, 0x67=0x%x, 0x76e=0x%x\n",
u32tmp, u8tmpa, u8tmpb, u8tmpc);
@ -4932,7 +4800,6 @@ void ex_halbtc8723b1ant_periodical(IN struct btc_coexist *btcoexist)
halbtc8723b1ant_monitor_bt_enable_disable(btcoexist);
if (halbtc8723b1ant_is_wifi_status_changed(btcoexist) ||
coex_dm->auto_tdma_adjust ||
btcoexist->bt_info.bt_enable_disable_change)
@ -4962,9 +4829,6 @@ void ex_halbtc8723b1ant_periodical(IN struct btc_coexist *btcoexist)
}
/* Donot remove optimize off flag, otherwise antenna detection would trigger BT collapsed */
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
void ex_halbtc8723b1ant_antenna_detection(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN u32 offset, IN u32 span, IN u32 seconds)
{
@ -4999,7 +4863,6 @@ void ex_halbtc8723b1ant_antenna_detection(IN struct btc_coexist *btcoexist,
"xxxxxxxxxxxxxxxx AntennaDetect(), Antenna Det Success!!\n");
BTC_TRACE(trace_buf);
#if 1
if (board_info->btdm_ant_num_by_ant_det == 2)
halbtc8723b1ant_mechanism_switch(
@ -5029,12 +4892,10 @@ void ex_halbtc8723b1ant_antenna_detection(IN struct btc_coexist *btcoexist,
}
#endif
/*
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &roam);
psd_scan->ant_det_bt_tx_time = seconds;
psd_scan->ant_det_bt_le_channel = cent_freq;
@ -5087,7 +4948,6 @@ void ex_halbtc8723b1ant_antenna_detection(IN struct btc_coexist *btcoexist,
*/
}
void ex_halbtc8723b1ant_display_ant_detection(IN struct btc_coexist *btcoexist)
{
#if BT_8723B_1ANT_ANTDET_ENABLE
@ -5108,6 +4968,3 @@ void ex_halbtc8723b1ant_display_ant_detection(IN struct btc_coexist *btcoexist)
#endif
#endif /* #if (BT_SUPPORT == 1 && COEX_SUPPORT == 1) */

View file

@ -27,7 +27,6 @@ static struct coex_sta_8723d_1ant *coex_sta = &glcoex_sta_8723d_1ant;
static struct psdscan_sta_8723d_1ant gl_psd_scan_8723d_1ant;
static struct psdscan_sta_8723d_1ant *psd_scan = &gl_psd_scan_8723d_1ant;
const char *const glbt_info_src_8723d_1ant[] = {
"BT Info[wifi fw]",
"BT Info[bt rsp]",
@ -48,7 +47,6 @@ u32 glcoex_ver_date_8723d_1ant = 20161027;
u32 glcoex_ver_8723d_1ant = 0x0f;
u32 glcoex_ver_btdesired_8723d_1ant = 0x0d;
/* ************************************************************
* local function proto type if needed
* ************************************************************
@ -329,7 +327,6 @@ void halbtc8723d1ant_limited_rx(IN struct btc_coexist *btcoexist,
/* real update aggregation setting */
btcoexist->btc_set(btcoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL);
}
void halbtc8723d1ant_query_bt_info(IN struct btc_coexist *btcoexist)
@ -571,8 +568,6 @@ void halbtc8723d1ant_monitor_wifi_ctr(IN struct btc_coexist *btcoexist)
#endif
}
boolean halbtc8723d1ant_is_wifibt_status_changed(IN struct btc_coexist
*btcoexist)
{
@ -653,7 +648,6 @@ void halbtc8723d1ant_update_bt_link_info(IN struct btc_coexist *btcoexist)
boolean bt_hs_on = false;
boolean bt_busy = false;
coex_sta->num_of_profile = 0;
/* set link exist status */
@ -788,7 +782,6 @@ void halbtc8723d1ant_update_bt_link_info(IN struct btc_coexist *btcoexist)
btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bt_busy);
}
void halbtc8723d1ant_update_wifi_channel_info(IN struct btc_coexist *btcoexist,
IN u8 type)
{
@ -1087,16 +1080,7 @@ void halbtc8723d1ant_low_penalty_ra(IN struct btc_coexist *btcoexist,
halbtc8723d1ant_set_fw_low_penalty_ra(btcoexist,
coex_dm->cur_low_penalty_ra);
#if 0
if (low_penalty_ra)
btcoexist->btc_phydm_modify_RA_PCR_threshold(btcoexist, 0, 15);
else
btcoexist->btc_phydm_modify_RA_PCR_threshold(btcoexist, 0, 0);
#endif
coex_dm->pre_low_penalty_ra = coex_dm->cur_low_penalty_ra;
#endif
}
void halbtc8723d1ant_write_score_board(
@ -1113,7 +1097,6 @@ void halbtc8723d1ant_write_score_board(
else
originalval = originalval & (~bitpos);
btcoexist->btc_write_2byte(btcoexist, 0xaa, originalval);
}
@ -1144,29 +1127,11 @@ void halbtc8723d1ant_monitor_bt_enable_disable(IN struct btc_coexist *btcoexist)
u16 u16tmp;
/* This function check if bt is disabled */
#if 0
if (coex_sta->high_priority_tx == 0 &&
coex_sta->high_priority_rx == 0 &&
coex_sta->low_priority_tx == 0 &&
coex_sta->low_priority_rx == 0)
bt_active = false;
if (coex_sta->high_priority_tx == 0xffff &&
coex_sta->high_priority_rx == 0xffff &&
coex_sta->low_priority_tx == 0xffff &&
coex_sta->low_priority_rx == 0xffff)
bt_active = false;
#else
/* Read BT on/off status from scoreboard[1], enable this only if BT patch support this feature */
halbtc8723d1ant_read_score_board(btcoexist, &u16tmp);
bt_active = u16tmp & BIT(1);
#endif
if (bt_active) {
bt_disable_cnt = 0;
bt_disabled = false;
@ -1200,8 +1165,6 @@ void halbtc8723d1ant_monitor_bt_enable_disable(IN struct btc_coexist *btcoexist)
}
void halbtc8723d1ant_enable_gnt_to_gpio(IN struct btc_coexist *btcoexist,
boolean isenable)
{
@ -1246,7 +1209,6 @@ u32 halbtc8723d1ant_ltecoex_indirect_read_reg(IN struct btc_coexist *btcoexist,
{
u32 j = 0;
/* wait for ready bit before access 0x7c0 */
btcoexist->btc_write_4byte(btcoexist, 0x7c0, 0x800F0000 | reg_addr);
@ -1256,7 +1218,6 @@ u32 halbtc8723d1ant_ltecoex_indirect_read_reg(IN struct btc_coexist *btcoexist,
0x7c3)&BIT(5)) == 0) &&
(j < BT_8723D_1ANT_LTECOEX_INDIRECTREG_ACCESS_TIMEOUT));
return btcoexist->btc_read_4byte(btcoexist,
0x7c8); /* get read data */
@ -1268,7 +1229,6 @@ void halbtc8723d1ant_ltecoex_indirect_write_reg(IN struct btc_coexist
{
u32 val, i = 0, j = 0, bitpos = 0;
if (bit_mask == 0x0)
return;
if (bit_mask == 0xffffffff) {
@ -1282,7 +1242,6 @@ void halbtc8723d1ant_ltecoex_indirect_write_reg(IN struct btc_coexist
0x7c3)&BIT(5)) == 0) &&
(j < BT_8723D_1ANT_LTECOEX_INDIRECTREG_ACCESS_TIMEOUT));
btcoexist->btc_write_4byte(btcoexist, 0x7c0,
0xc00F0000 | reg_addr);
} else {
@ -1308,7 +1267,6 @@ void halbtc8723d1ant_ltecoex_indirect_write_reg(IN struct btc_coexist
0x7c3)&BIT(5)) == 0) &&
(j < BT_8723D_1ANT_LTECOEX_INDIRECTREG_ACCESS_TIMEOUT));
btcoexist->btc_write_4byte(btcoexist, 0x7c0,
0xc00F0000 | reg_addr);
@ -1370,7 +1328,6 @@ void halbtc8723d1ant_ltecoex_set_gnt_bt(IN struct btc_coexist *btcoexist,
0x38, 0xffffffff, val);
}
void halbtc8723d1ant_ltecoex_set_gnt_wl(IN struct btc_coexist *btcoexist,
IN u8 control_block, IN boolean sw_control, IN u8 state)
{
@ -1403,7 +1360,6 @@ void halbtc8723d1ant_ltecoex_set_gnt_wl(IN struct btc_coexist *btcoexist,
0xffffffff, val);
}
void halbtc8723d1ant_ltecoex_set_coex_table(IN struct btc_coexist *btcoexist,
IN u8 table_type, IN u16 table_content)
{
@ -1422,10 +1378,8 @@ void halbtc8723d1ant_ltecoex_set_coex_table(IN struct btc_coexist *btcoexist,
halbtc8723d1ant_ltecoex_indirect_write_reg(btcoexist, reg_addr,
0xffff, table_content); /* 0xa0[15:0] or 0xa4[15:0] */
}
void halbtc8723d1ant_ltecoex_set_break_table(IN struct btc_coexist *btcoexist,
IN u8 table_type, IN u8 table_content)
{
@ -1487,7 +1441,6 @@ void halbtc8723d1ant_set_wltoggle_coex_table(IN struct btc_coexist *btcoexist,
btcoexist->btc_fill_h2c(btcoexist, 0x69, 6, cur_h2c_parameter);
}
void halbtc8723d1ant_set_coex_table(IN struct btc_coexist *btcoexist,
IN u32 val0x6c0, IN u32 val0x6c4, IN u32 val0x6c8, IN u8 val0x6cc)
{
@ -1730,7 +1683,6 @@ void halbtc8723d1ant_power_save_state(IN struct btc_coexist *btcoexist,
}
}
void halbtc8723d1ant_set_fw_pstdma(IN struct btc_coexist *btcoexist,
IN u8 byte1, IN u8 byte2, IN u8 byte3, IN u8 byte4, IN u8 byte5)
{
@ -1779,7 +1731,6 @@ void halbtc8723d1ant_set_fw_pstdma(IN struct btc_coexist *btcoexist,
0x0);
}
h2c_parameter[0] = real_byte1;
h2c_parameter[1] = byte2;
h2c_parameter[2] = byte3;
@ -1795,7 +1746,6 @@ void halbtc8723d1ant_set_fw_pstdma(IN struct btc_coexist *btcoexist,
btcoexist->btc_fill_h2c(btcoexist, 0x60, 5, h2c_parameter);
}
void halbtc8723d1ant_ps_tdma(IN struct btc_coexist *btcoexist,
IN boolean force_exec, IN boolean turn_on, IN u8 type)
{
@ -1805,15 +1755,9 @@ void halbtc8723d1ant_ps_tdma(IN struct btc_coexist *btcoexist,
static u8 psTdmaByte4Modify = 0x0, pre_psTdmaByte4Modify = 0x0;
static boolean pre_wifi_busy = false;
#if BT_8723D_1ANT_ANTDET_ENABLE
if (board_info->btdm_ant_num_by_ant_det == 2) {
#if 0
if (turn_on)
type = type +
100;
#endif
}
#endif
@ -1861,7 +1805,6 @@ void halbtc8723d1ant_ps_tdma(IN struct btc_coexist *btcoexist,
BTC_TRACE(trace_buf);
}
if (turn_on) {
switch (type) {
default:
@ -2082,7 +2025,6 @@ void halbtc8723d1ant_ps_tdma(IN struct btc_coexist *btcoexist,
coex_dm->pre_ps_tdma = coex_dm->cur_ps_tdma;
}
void halbtc8723d1ant_set_ant_path(IN struct btc_coexist *btcoexist,
IN u8 ant_pos_type, IN boolean force_exec,
IN u8 phase)
@ -2149,7 +2091,6 @@ void halbtc8723d1ant_set_ant_path(IN struct btc_coexist *btcoexist,
coex_dm->pre_ant_pos_type = coex_dm->cur_ant_pos_type;
switch (phase) {
case BT_8723D_1ANT_PHASE_COEX_POWERON:
/* Set Path control to WL */
@ -2316,7 +2257,6 @@ void halbtc8723d1ant_set_ant_path(IN struct btc_coexist *btcoexist,
}
}
/* Set Path control to WL */
/* btcoexist->btc_write_1byte_bitmask(btcoexist, 0x67, 0x80, 0x1); */
@ -2390,7 +2330,6 @@ void halbtc8723d1ant_set_ant_path(IN struct btc_coexist *btcoexist,
break;
}
is_hw_ant_div_on = board_info->ant_div_cfg;
if ((is_hw_ant_div_on) && (phase != BT_8723D_1ANT_PHASE_ANTENNA_DET))
@ -2442,7 +2381,6 @@ void halbtc8723d1ant_set_ant_path(IN struct btc_coexist *btcoexist,
}
}
#if BT_8723D_1ANT_COEX_DBG
u32tmp1 = halbtc8723d1ant_ltecoex_indirect_read_reg(btcoexist, 0x38);
u32tmp2 = halbtc8723d1ant_ltecoex_indirect_read_reg(btcoexist, 0x54);
@ -2464,7 +2402,6 @@ void halbtc8723d1ant_set_ant_path(IN struct btc_coexist *btcoexist,
}
boolean halbtc8723d1ant_is_common_action(IN struct btc_coexist *btcoexist)
{
boolean common = false, wifi_connected = false, wifi_busy = false;
@ -2525,7 +2462,6 @@ boolean halbtc8723d1ant_is_common_action(IN struct btc_coexist *btcoexist)
return common;
}
/* *********************************************
*
* Non-Software Coex Mechanism start
@ -2592,7 +2528,6 @@ void halbtc8723d1ant_action_bt_inquiry(IN struct btc_coexist *btcoexist)
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_LINK, &wifi_link);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_ROAM, &wifi_roam);
if ((coex_sta->bt_create_connection) && ((wifi_link) || (wifi_roam)
|| (wifi_scan) || (wifi_busy) || (coex_sta->wifi_is_high_pri_task))) {
@ -2634,7 +2569,6 @@ void halbtc8723d1ant_action_bt_inquiry(IN struct btc_coexist *btcoexist)
}
}
void halbtc8723d1ant_action_bt_sco_hid_only_busy(IN struct btc_coexist
*btcoexist)
{
@ -2650,7 +2584,6 @@ void halbtc8723d1ant_action_bt_sco_hid_only_busy(IN struct btc_coexist
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
if (bt_link_info->sco_exist) {
halbtc8723d1ant_ps_tdma(btcoexist, NORMAL_EXEC,
true, 5);
@ -2700,7 +2633,6 @@ void halbtc8723d1ant_action_bt_sco_hid_only_busy(IN struct btc_coexist
}
}
void halbtc8723d1ant_action_wifi_only(IN struct btc_coexist *btcoexist)
{
halbtc8723d1ant_ps_tdma(btcoexist, FORCE_EXEC, false, 8);
@ -2930,7 +2862,6 @@ void halbtc8723d1ant_action_wifi_not_connected(IN struct btc_coexist *btcoexist)
halbtc8723d1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0);
}
void halbtc8723d1ant_action_wifi_connected(IN struct btc_coexist *btcoexist)
{
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
@ -2960,7 +2891,6 @@ void halbtc8723d1ant_action_wifi_connected(IN struct btc_coexist *btcoexist)
halbtc8723d1ant_action_bt_idle(btcoexist);
}
void halbtc8723d1ant_run_sw_coexist_mechanism(IN struct btc_coexist *btcoexist)
{
u8 algorithm = 0;
@ -3032,7 +2962,6 @@ void halbtc8723d1ant_run_sw_coexist_mechanism(IN struct btc_coexist *btcoexist)
}
}
void halbtc8723d1ant_run_coexist_mechanism(IN struct btc_coexist *btcoexist)
{
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
@ -3245,7 +3174,6 @@ void halbtc8723d1ant_run_coexist_mechanism(IN struct btc_coexist *btcoexist)
}
}
void halbtc8723d1ant_init_coex_dm(IN struct btc_coexist *btcoexist)
{
/* force to reset coex mechanism */
@ -3275,7 +3203,6 @@ void halbtc8723d1ant_init_hw_config(IN struct btc_coexist *btcoexist,
struct btc_board_info *board_info = &btcoexist->board_info;
u8 i = 0;
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"[BTCoex], 1Ant Init HW Config!!\n");
BTC_TRACE(trace_buf);
@ -3300,7 +3227,6 @@ void halbtc8723d1ant_init_hw_config(IN struct btc_coexist *btcoexist,
BTC_TRACE(trace_buf);
#endif
coex_sta->bt_coex_supported_feature = 0;
coex_sta->bt_coex_supported_version = 0;
coex_sta->bt_ble_scan_type = 0;
@ -3408,7 +3334,6 @@ u32 halbtc8723d1ant_psd_log2base(IN struct btc_coexist *btcoexist, IN u32 val)
}
}
val_integerd_b = shiftcount + 1;
tmp2 = 1;
@ -3427,7 +3352,6 @@ u32 halbtc8723d1ant_psd_log2base(IN struct btc_coexist *btcoexist, IN u32 val)
return result;
}
void halbtc8723d1ant_psd_show_antenna_detect_result(IN struct btc_coexist
@ -3604,7 +3528,6 @@ void halbtc8723d1ant_psd_show_antenna_detect_result(IN struct btc_coexist
"PSD Scan Peak Freq", psd_scan->ant_det_peak_freq);
CL_PRINTF(cli_buf);
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "TFBGA Package",
(board_info->tfbga_package) ? "Yes" : "No");
CL_PRINTF(cli_buf);
@ -3615,8 +3538,6 @@ void halbtc8723d1ant_psd_show_antenna_detect_result(IN struct btc_coexist
}
void halbtc8723d1ant_psd_showdata(IN struct btc_coexist *btcoexist)
{
u8 *cli_buf = btcoexist->cli_buf;
@ -3743,7 +3664,6 @@ void halbtc8723d1ant_psd_showdata(IN struct btc_coexist *btcoexist)
} while ((i <= 8) && (m <= psd_scan->psd_stop_point));
do {
psd_rep1 = psd_scan->psd_report_max_hold[n] /
100;
@ -3806,13 +3726,8 @@ void halbtc8723d1ant_psd_showdata(IN struct btc_coexist *btcoexist)
}
}
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
void halbtc8723d1ant_psd_maxholddata(IN struct btc_coexist *btcoexist,
IN u32 gen_count)
{
@ -3844,10 +3759,7 @@ void halbtc8723d1ant_psd_maxholddata(IN struct btc_coexist *btcoexist,
psd_scan->psd_loop_max_value[gen_count - 1] = loop_val_max;
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
u32 halbtc8723d1ant_psd_getdata(IN struct btc_coexist *btcoexist, IN u32 point)
32 halbtc8723d1ant_psd_getdata(IN struct btc_coexist *btcoexist, IN u32 point)
{
/* reg 0x808[9:0]: FFT data x */
/* reg 0x808[22]: 0-->1 to get 1 FFT data y */
@ -3878,9 +3790,6 @@ u32 halbtc8723d1ant_psd_getdata(IN struct btc_coexist *btcoexist, IN u32 point)
return psd_report;
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
boolean halbtc8723d1ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN s32 offset, IN u32 span, IN u32 points,
IN u32 avgnum, IN u32 loopcnt)
@ -3913,7 +3822,6 @@ boolean halbtc8723d1ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
psd_scan->real_offset = offset;
psd_scan->real_span = span;
points1 = psd_scan->psd_point;
delta_freq_per_point = psd_scan->psd_band_width /
psd_scan->psd_point;
@ -4013,7 +3921,6 @@ boolean halbtc8723d1ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1d,
0xfffff, 0x2e);
/* Set RF mode = Rx, RF Gain = 0x320a0 */
btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x0,
0xfffff, 0x320a0);
@ -4210,9 +4117,6 @@ boolean halbtc8723d1ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
boolean halbtc8723d1ant_psd_antenna_detection(IN struct btc_coexist
*btcoexist)
{
@ -4271,15 +4175,6 @@ boolean halbtc8723d1ant_psd_antenna_detection(IN struct btc_coexist
break;
}
}
#if 0
wlpsd_sweep_count = bt_tx_time * 238 /
100; /* bt_tx_time/0.42 */
wlpsd_sweep_count = wlpsd_sweep_count / 5;
if (wlpsd_sweep_count % 5 != 0)
wlpsd_sweep_count = (wlpsd_sweep_count /
5 + 1) * 5;
#endif
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"xxxxxxxxxxxxxxxx AntennaDetect(), BT_LETxTime=%d, BT_LECh = %d\n",
bt_tx_time, bt_le_channel);
@ -4424,16 +4319,6 @@ boolean halbtc8723d1ant_psd_antenna_detection(IN struct btc_coexist
#if 1
psd_scan->ant_det_psd_scan_peak_val =
psd_scan->psd_max_value;
#endif
#if 0
psd_scan->ant_det_psd_scan_peak_val =
((psd_scan->psd_max_value - psd_scan->psd_avg_value) <
800) ?
psd_scan->psd_max_value : ((
psd_scan->psd_max_value -
psd_scan->psd_max_value2 <= 300) ?
psd_scan->psd_avg_value :
psd_scan->psd_max_value2);
#endif
psd_scan->ant_det_psd_scan_peak_freq =
psd_scan->psd_max_value_point;
@ -4594,9 +4479,6 @@ boolean halbtc8723d1ant_psd_antenna_detection(IN struct btc_coexist
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
boolean halbtc8723d1ant_psd_antenna_detection_check(IN struct btc_coexist
*btcoexist)
{
@ -4654,8 +4536,6 @@ boolean halbtc8723d1ant_psd_antenna_detection_check(IN struct btc_coexist
}
/* ************************************************************
* work around function start with wa_halbtc8723d1ant_
* ************************************************************
@ -5020,7 +4900,6 @@ void ex_halbtc8723d1ant_display_coex_info(IN struct btc_coexist *btcoexist)
}
}
if (btcoexist->manual_control)
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s",
"============[mechanisms] (before Manual)============");
@ -5244,7 +5123,6 @@ void ex_halbtc8723d1ant_display_coex_info(IN struct btc_coexist *btcoexist)
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS);
}
void ex_halbtc8723d1ant_ips_notify(IN struct btc_coexist *btcoexist, IN u8 type)
{
if (btcoexist->manual_control || btcoexist->stop_coex_dm)
@ -5509,7 +5387,6 @@ void ex_halbtc8723d1ant_specific_packet_notify(IN struct btc_coexist *btcoexist,
btcoexist->stop_coex_dm)
return;
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS,
&under_4way);
@ -5703,7 +5580,6 @@ void ex_halbtc8723d1ant_bt_info_notify(IN struct btc_coexist *btcoexist,
BTC_MEDIA_DISCONNECT);
}
/* If Ignore_WLanAct && not SetUp_Link or Role_Switch */
if ((coex_sta->bt_info_ext & BIT(3)) &&
(!(coex_sta->bt_info_ext & BIT(2))) &&
@ -5748,8 +5624,6 @@ void ex_halbtc8723d1ant_bt_info_notify(IN struct btc_coexist *btcoexist,
halbtc8723d1ant_run_coexist_mechanism(btcoexist);
}
void ex_halbtc8723d1ant_rf_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type)
{
@ -5857,7 +5731,6 @@ void ex_halbtc8723d1ant_pnp_notify(IN struct btc_coexist *btcoexist,
}
}
void ex_halbtc8723d1ant_coex_dm_reset(IN struct btc_coexist *btcoexist)
{
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
@ -5986,15 +5859,6 @@ void ex_halbtc8723d1ant_periodical(IN struct btc_coexist *btcoexist)
board_info->antdetval = psd_scan->ant_det_psd_scan_peak_val/100;
value = board_info->antdetval;
#ifdef PLATFORM_WINDOWS
{
PWCHAR registryName;
registryName = L"antdetval";
PlatformWriteCommonDwordRegistry(registryName, &value);
}
#endif
}
}
@ -6004,7 +5868,6 @@ void ex_halbtc8723d1ant_periodical(IN struct btc_coexist *btcoexist)
if (halbtc8723d1ant_is_wifibt_status_changed(btcoexist))
halbtc8723d1ant_run_coexist_mechanism(btcoexist);
}
void ex_halbtc8723d1ant_set_antenna_notify(IN struct btc_coexist *btcoexist,
@ -6027,9 +5890,6 @@ void ex_halbtc8723d1ant_set_antenna_notify(IN struct btc_coexist *btcoexist,
}
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
void ex_halbtc8723d1ant_antenna_detection(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN u32 offset, IN u32 span, IN u32 seconds)
{
@ -6185,10 +6045,8 @@ void ex_halbtc8723d1ant_antenna_detection(IN struct btc_coexist *btcoexist,
}
#endif
}
void ex_halbtc8723d1ant_display_ant_detection(IN struct btc_coexist *btcoexist)
{
#if BT_8723D_1ANT_ANTDET_ENABLE
@ -6208,17 +6066,14 @@ void ex_halbtc8723d1ant_antenna_isolation(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN u32 offset, IN u32 span, IN u32 seconds)
{
}
void ex_halbtc8723d1ant_psd_scan(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN u32 offset, IN u32 span, IN u32 seconds)
{
}
#endif
#endif /* #if (BT_SUPPORT == 1 && COEX_SUPPORT == 1) */

View file

@ -47,7 +47,6 @@ u32 glcoex_ver_date_8723d_2ant = 20161027;
u32 glcoex_ver_8723d_2ant = 0x0f;
u32 glcoex_ver_btdesired_8723d_2ant = 0x0d;
/* ************************************************************
* local function proto type if needed
* ************************************************************
@ -178,52 +177,18 @@ void halbtc8723d2ant_coex_switch_threshold(IN struct btc_coexist *btcoexist,
{
s8 interference_wl_tx = 0, interference_bt_tx = 0;
interference_wl_tx = BT_8723D_2ANT_WIFI_MAX_TX_POWER -
isolation_measuared;
interference_bt_tx = BT_8723D_2ANT_BT_MAX_TX_POWER -
isolation_measuared;
coex_sta->wifi_coex_thres = BT_8723D_2ANT_WIFI_RSSI_COEXSWITCH_THRES1;
coex_sta->wifi_coex_thres2 = BT_8723D_2ANT_WIFI_RSSI_COEXSWITCH_THRES2;
coex_sta->bt_coex_thres = BT_8723D_2ANT_BT_RSSI_COEXSWITCH_THRES1;
coex_sta->bt_coex_thres2 = BT_8723D_2ANT_BT_RSSI_COEXSWITCH_THRES2;
/*
coex_sta->wifi_coex_thres = interference_wl_tx + BT_8723D_2ANT_WIFI_SIR_THRES1;
coex_sta->wifi_coex_thres2 = interference_wl_tx + BT_8723D_2ANT_WIFI_SIR_THRES2;
coex_sta->bt_coex_thres = interference_bt_tx + BT_8723D_2ANT_BT_SIR_THRES1;
coex_sta->bt_coex_thres2 = interference_bt_tx + BT_8723D_2ANT_BT_SIR_THRES2;
*/
/*
if ( BT_8723D_2ANT_WIFI_RSSI_COEXSWITCH_THRES1 < (isolation_measuared -
BT_8723D_2ANT_DEFAULT_ISOLATION) )
coex_sta->wifi_coex_thres = BT_8723D_2ANT_WIFI_RSSI_COEXSWITCH_THRES1;
else
coex_sta->wifi_coex_thres = BT_8723D_2ANT_WIFI_RSSI_COEXSWITCH_THRES1 - (isolation_measuared -
BT_8723D_2ANT_DEFAULT_ISOLATION);
if ( BT_8723D_2ANT_BT_RSSI_COEXSWITCH_THRES1 < (isolation_measuared -
BT_8723D_2ANT_DEFAULT_ISOLATION) )
coex_sta->bt_coex_thres = BT_8723D_2ANT_BT_RSSI_COEXSWITCH_THRES1;
else
coex_sta->bt_coex_thres = BT_8723D_2ANT_BT_RSSI_COEXSWITCH_THRES1 - (isolation_measuared -
BT_8723D_2ANT_DEFAULT_ISOLATION);
*/
}
void halbtc8723d2ant_limited_rx(IN struct btc_coexist *btcoexist,
IN boolean force_exec, IN boolean rej_ap_agg_pkt,
IN boolean bt_ctrl_agg_buf_size, IN u8 agg_buf_size)
@ -250,7 +215,6 @@ void halbtc8723d2ant_query_bt_info(IN struct btc_coexist *btcoexist)
{
u8 h2c_parameter[1] = {0};
h2c_parameter[0] |= BIT(0); /* trigger */
btcoexist->btc_fill_h2c(btcoexist, 0x61, 1, h2c_parameter);
@ -472,8 +436,6 @@ void halbtc8723d2ant_monitor_wifi_ctr(IN struct btc_coexist *btcoexist)
#endif
}
boolean halbtc8723d2ant_is_wifibt_status_changed(IN struct btc_coexist
*btcoexist)
{
@ -555,7 +517,6 @@ void halbtc8723d2ant_update_bt_link_info(IN struct btc_coexist *btcoexist)
boolean bt_hs_on = false;
boolean bt_busy = false;
coex_sta->num_of_profile = 0;
/* set link exist status */
@ -799,7 +760,6 @@ void halbtc8723d2ant_set_fw_low_penalty_ra(IN struct btc_coexist
void halbtc8723d2ant_low_penalty_ra(IN struct btc_coexist *btcoexist,
IN boolean force_exec, IN boolean low_penalty_ra)
{
#if 1
coex_dm->cur_low_penalty_ra = low_penalty_ra;
if (!force_exec) {
@ -810,15 +770,7 @@ void halbtc8723d2ant_low_penalty_ra(IN struct btc_coexist *btcoexist,
halbtc8723d2ant_set_fw_low_penalty_ra(btcoexist,
coex_dm->cur_low_penalty_ra);
#if 0
if (low_penalty_ra)
btcoexist->btc_phydm_modify_RA_PCR_threshold(btcoexist, 0, 15);
else
btcoexist->btc_phydm_modify_RA_PCR_threshold(btcoexist, 0, 0);
#endif
coex_dm->pre_low_penalty_ra = coex_dm->cur_low_penalty_ra;
#endif
}
void halbtc8723d2ant_set_bt_auto_report(IN struct btc_coexist *btcoexist,
@ -863,7 +815,6 @@ void halbtc8723d2ant_write_score_board(
else
originalval = originalval & (~bitpos);
btcoexist->btc_write_2byte(btcoexist, 0xaa, originalval);
}
@ -878,7 +829,6 @@ void halbtc8723d2ant_read_score_board(
0xaa)) & 0x7fff;
}
void halbtc8723d2ant_post_state_to_bt(
IN struct btc_coexist *btcoexist,
IN u16 type,
@ -897,29 +847,12 @@ void halbtc8723d2ant_monitor_bt_enable_disable(IN struct btc_coexist *btcoexist)
u16 u16tmp;
/* This function check if bt is disabled */
#if 0
if (coex_sta->high_priority_tx == 0 &&
coex_sta->high_priority_rx == 0 &&
coex_sta->low_priority_tx == 0 &&
coex_sta->low_priority_rx == 0)
bt_active = false;
if (coex_sta->high_priority_tx == 0xffff &&
coex_sta->high_priority_rx == 0xffff &&
coex_sta->low_priority_tx == 0xffff &&
coex_sta->low_priority_rx == 0xffff)
bt_active = false;
#else
/* Read BT on/off status from scoreboard[1], enable this only if BT patch support this feature */
halbtc8723d2ant_read_score_board(btcoexist, &u16tmp);
bt_active = u16tmp & BIT(1);
#endif
if (bt_active) {
bt_disable_cnt = 0;
bt_disabled = false;
@ -953,8 +886,6 @@ void halbtc8723d2ant_monitor_bt_enable_disable(IN struct btc_coexist *btcoexist)
}
void halbtc8723d2ant_enable_gnt_to_gpio(IN struct btc_coexist *btcoexist,
boolean isenable)
{
@ -999,7 +930,6 @@ u32 halbtc8723d2ant_ltecoex_indirect_read_reg(IN struct btc_coexist *btcoexist,
{
u32 j = 0;
/* wait for ready bit before access 0x7c0 */
btcoexist->btc_write_4byte(btcoexist, 0x7c0, 0x800F0000 | reg_addr);
@ -1009,7 +939,6 @@ u32 halbtc8723d2ant_ltecoex_indirect_read_reg(IN struct btc_coexist *btcoexist,
0x7c3)&BIT(5)) == 0) &&
(j < BT_8723D_2ANT_LTECOEX_INDIRECTREG_ACCESS_TIMEOUT));
return btcoexist->btc_read_4byte(btcoexist,
0x7c8); /* get read data */
@ -1021,7 +950,6 @@ void halbtc8723d2ant_ltecoex_indirect_write_reg(IN struct btc_coexist
{
u32 val, i = 0, j = 0, bitpos = 0;
if (bit_mask == 0x0)
return;
if (bit_mask == 0xffffffff) {
@ -1035,7 +963,6 @@ void halbtc8723d2ant_ltecoex_indirect_write_reg(IN struct btc_coexist
0x7c3)&BIT(5)) == 0) &&
(j < BT_8723D_2ANT_LTECOEX_INDIRECTREG_ACCESS_TIMEOUT));
btcoexist->btc_write_4byte(btcoexist, 0x7c0,
0xc00F0000 | reg_addr);
} else {
@ -1061,7 +988,6 @@ void halbtc8723d2ant_ltecoex_indirect_write_reg(IN struct btc_coexist
0x7c3)&BIT(5)) == 0) &&
(j < BT_8723D_2ANT_LTECOEX_INDIRECTREG_ACCESS_TIMEOUT));
btcoexist->btc_write_4byte(btcoexist, 0x7c0,
0xc00F0000 | reg_addr);
@ -1123,7 +1049,6 @@ void halbtc8723d2ant_ltecoex_set_gnt_bt(IN struct btc_coexist *btcoexist,
0x38, 0xffffffff, val);
}
void halbtc8723d2ant_ltecoex_set_gnt_wl(IN struct btc_coexist *btcoexist,
IN u8 control_block, IN boolean sw_control, IN u8 state)
{
@ -1174,10 +1099,8 @@ void halbtc8723d2ant_ltecoex_set_coex_table(IN struct btc_coexist *btcoexist,
halbtc8723d2ant_ltecoex_indirect_write_reg(btcoexist, reg_addr,
0xffff, table_content); /* 0xa0[15:0] or 0xa4[15:0] */
}
void halbtc8723d2ant_ltecoex_set_break_table(IN struct btc_coexist *btcoexist,
IN u8 table_type, IN u8 table_content)
{
@ -1202,7 +1125,6 @@ void halbtc8723d2ant_ltecoex_set_break_table(IN struct btc_coexist *btcoexist,
halbtc8723d2ant_ltecoex_indirect_write_reg(btcoexist, reg_addr,
0xff, table_content); /* 0xa8[15:0] or 0xb4[15:0] */
}
void halbtc8723d2ant_set_wltoggle_coex_table(IN struct btc_coexist *btcoexist,
@ -1468,8 +1390,6 @@ void halbtc8723d2ant_power_save_state(IN struct btc_coexist *btcoexist,
}
}
void halbtc8723d2ant_set_fw_pstdma(IN struct btc_coexist *btcoexist,
IN u8 byte1, IN u8 byte2, IN u8 byte3, IN u8 byte4, IN u8 byte5)
{
@ -1518,7 +1438,6 @@ void halbtc8723d2ant_set_fw_pstdma(IN struct btc_coexist *btcoexist,
0x0);
}
h2c_parameter[0] = real_byte1;
h2c_parameter[1] = byte2;
h2c_parameter[2] = byte3;
@ -1541,7 +1460,6 @@ void halbtc8723d2ant_ps_tdma(IN struct btc_coexist *btcoexist,
static u8 psTdmaByte4Modify = 0x0, pre_psTdmaByte4Modify = 0x0;
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
coex_dm->cur_ps_tdma_on = turn_on;
coex_dm->cur_ps_tdma = type;
@ -1578,7 +1496,6 @@ void halbtc8723d2ant_ps_tdma(IN struct btc_coexist *btcoexist,
BTC_TRACE(trace_buf);
}
if (turn_on) {
switch (type) {
case 1:
@ -1774,7 +1691,6 @@ void halbtc8723d2ant_set_ant_path(IN struct btc_coexist *btcoexist,
u32 u32tmp0 = 0, u32tmp1 = 0, u32tmp2 = 0;
u16 u16tmp0 = 0, u16tmp1 = 0;
u32tmp1 = halbtc8723d2ant_ltecoex_indirect_read_reg(btcoexist,
0x38);
@ -1784,7 +1700,6 @@ void halbtc8723d2ant_set_ant_path(IN struct btc_coexist *btcoexist,
coex_sta->gnt_error_cnt++;
}
#if BT_8723D_2ANT_COEX_DBG
u32tmp2 = halbtc8723d2ant_ltecoex_indirect_read_reg(btcoexist, 0x54);
u16tmp0 = btcoexist->btc_read_2byte(btcoexist, 0xaa);
@ -1887,7 +1802,6 @@ void halbtc8723d2ant_set_ant_path(IN struct btc_coexist *btcoexist,
}
}
/* Set Path control to WL */
btcoexist->btc_write_1byte_bitmask(btcoexist,
0x67, 0x80, 0x1);
@ -2024,7 +1938,6 @@ void halbtc8723d2ant_set_ant_path(IN struct btc_coexist *btcoexist,
btcoexist,
BT_8723D_2ANT_PCO_WLSIDE);
halbtc8723d2ant_ltecoex_set_gnt_bt(btcoexist,
BT_8723D_2ANT_GNT_BLOCK_RFC_BB,
BT_8723D_2ANT_GNT_TYPE_CTRL_BY_PTA,
@ -2139,7 +2052,6 @@ void halbtc8723d2ant_set_ant_path(IN struct btc_coexist *btcoexist,
}
}
#if BT_8723D_2ANT_COEX_DBG
u32tmp1 = halbtc8723d2ant_ltecoex_indirect_read_reg(btcoexist, 0x38);
u32tmp2 = halbtc8723d2ant_ltecoex_indirect_read_reg(btcoexist, 0x54);
@ -2377,8 +2289,6 @@ u8 halbtc8723d2ant_action_algorithm(IN struct btc_coexist *btcoexist)
return algorithm;
}
void halbtc8723d2ant_action_coex_all_off(IN struct btc_coexist *btcoexist)
{
@ -2412,7 +2322,6 @@ void halbtc8723d2ant_action_bt_hs(IN struct btc_coexist *btcoexist)
u8 wifi_rssi_state2, bt_rssi_state2;
boolean wifi_busy = false, wifi_turbo = false;
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_get(btcoexist, BTC_GET_U1_AP_NUM,
&coex_sta->scan_ap_num);
@ -2426,7 +2335,6 @@ void halbtc8723d2ant_action_bt_hs(IN struct btc_coexist *btcoexist)
wifi_turbo = true;
#endif
wifi_rssi_state = halbtc8723d2ant_wifi_rssi_state(btcoexist,
&prewifi_rssi_state, 2,
coex_sta->wifi_coex_thres , 0);
@ -2464,7 +2372,6 @@ void halbtc8723d2ant_action_bt_hs(IN struct btc_coexist *btcoexist)
halbtc8723d2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 0);
} else {
halbtc8723d2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 0x18);
@ -2479,7 +2386,6 @@ void halbtc8723d2ant_action_bt_hs(IN struct btc_coexist *btcoexist)
}
void halbtc8723d2ant_action_bt_inquiry(IN struct btc_coexist *btcoexist)
{
@ -2488,7 +2394,6 @@ void halbtc8723d2ant_action_bt_inquiry(IN struct btc_coexist *btcoexist)
boolean wifi_busy = false;
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED,
@ -2549,7 +2454,6 @@ void halbtc8723d2ant_action_bt_inquiry(IN struct btc_coexist *btcoexist)
halbtc8723d2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
}
void halbtc8723d2ant_action_bt_relink(IN struct btc_coexist *btcoexist)
{
halbtc8723d2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 8);
@ -2595,8 +2499,6 @@ void halbtc8723d2ant_action_bt_idle(IN struct btc_coexist *btcoexist)
}
/* SCO only or SCO+PAN(HS) */
void halbtc8723d2ant_action_sco(IN struct btc_coexist *btcoexist)
{
@ -2629,7 +2531,6 @@ void halbtc8723d2ant_action_sco(IN struct btc_coexist *btcoexist)
bt_rssi_state2 = halbtc8723d2ant_bt_rssi_state(&pre_bt_rssi_state2, 2,
coex_sta->bt_coex_thres2 , 0);
if (BTC_RSSI_HIGH(wifi_rssi_state) &&
BTC_RSSI_HIGH(bt_rssi_state)) {
@ -2655,7 +2556,6 @@ void halbtc8723d2ant_action_sco(IN struct btc_coexist *btcoexist)
}
void halbtc8723d2ant_action_hid(IN struct btc_coexist *btcoexist)
{
static u8 prewifi_rssi_state = BTC_RSSI_STATE_LOW;
@ -2668,7 +2568,6 @@ void halbtc8723d2ant_action_hid(IN struct btc_coexist *btcoexist)
boolean wifi_busy = false;
u32 wifi_bw = 1;
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_BW, &wifi_bw);
@ -2686,7 +2585,6 @@ void halbtc8723d2ant_action_hid(IN struct btc_coexist *btcoexist)
bt_rssi_state2 = halbtc8723d2ant_bt_rssi_state(&pre_bt_rssi_state2, 2,
coex_sta->bt_coex_thres2 , 0);
if (BTC_RSSI_HIGH(wifi_rssi_state) &&
BTC_RSSI_HIGH(bt_rssi_state)) {
@ -2747,7 +2645,6 @@ void halbtc8723d2ant_action_hid(IN struct btc_coexist *btcoexist)
}
/* A2DP only / PAN(EDR) only/ A2DP+PAN(HS) */
void halbtc8723d2ant_action_a2dp(IN struct btc_coexist *btcoexist)
{
@ -2760,7 +2657,6 @@ void halbtc8723d2ant_action_a2dp(IN struct btc_coexist *btcoexist)
u8 wifi_rssi_state2, bt_rssi_state2;
boolean wifi_busy = false, wifi_turbo = false;
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_get(btcoexist, BTC_GET_U1_AP_NUM,
&coex_sta->scan_ap_num);
@ -2788,7 +2684,6 @@ void halbtc8723d2ant_action_a2dp(IN struct btc_coexist *btcoexist)
bt_rssi_state2 = halbtc8723d2ant_bt_rssi_state(&pre_bt_rssi_state2, 2,
coex_sta->bt_coex_thres2 , 0);
if (BTC_RSSI_HIGH(wifi_rssi_state) &&
BTC_RSSI_HIGH(bt_rssi_state)) {
@ -2854,7 +2749,6 @@ void halbtc8723d2ant_action_a2dp(IN struct btc_coexist *btcoexist)
}
void halbtc8723d2ant_action_pan_edr(IN struct btc_coexist *btcoexist)
{
static u8 prewifi_rssi_state = BTC_RSSI_STATE_LOW;
@ -2866,7 +2760,6 @@ void halbtc8723d2ant_action_pan_edr(IN struct btc_coexist *btcoexist)
u8 wifi_rssi_state2, bt_rssi_state2;
boolean wifi_busy = false, wifi_turbo = false;
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_get(btcoexist, BTC_GET_U1_AP_NUM,
&coex_sta->scan_ap_num);
@ -2894,19 +2787,6 @@ void halbtc8723d2ant_action_pan_edr(IN struct btc_coexist *btcoexist)
bt_rssi_state2 = halbtc8723d2ant_bt_rssi_state(&pre_bt_rssi_state2, 2,
coex_sta->bt_coex_thres2 , 0);
#if 0
halbtc8723d2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 0x18);
halbtc8723d2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
coex_dm->is_switch_to_1dot5_ant = false;
halbtc8723d2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0);
halbtc8723d2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 0);
#endif
#if 1
if (BTC_RSSI_HIGH(wifi_rssi_state) &&
BTC_RSSI_HIGH(bt_rssi_state)) {
@ -2956,9 +2836,6 @@ void halbtc8723d2ant_action_pan_edr(IN struct btc_coexist *btcoexist)
104);
}
#endif
}
void halbtc8723d2ant_action_hid_a2dp(IN struct btc_coexist *btcoexist)
@ -2991,7 +2868,6 @@ void halbtc8723d2ant_action_hid_a2dp(IN struct btc_coexist *btcoexist)
bt_rssi_state2 = halbtc8723d2ant_bt_rssi_state(&pre_bt_rssi_state2, 2,
coex_sta->bt_coex_thres2 , 0);
if (BTC_RSSI_HIGH(wifi_rssi_state) &&
BTC_RSSI_HIGH(bt_rssi_state)) {
@ -3068,7 +2944,6 @@ void halbtc8723d2ant_action_hid_a2dp(IN struct btc_coexist *btcoexist)
}
void halbtc8723d2ant_action_a2dp_pan_hs(IN struct btc_coexist *btcoexist)
{
static u8 prewifi_rssi_state = BTC_RSSI_STATE_LOW;
@ -3080,7 +2955,6 @@ void halbtc8723d2ant_action_a2dp_pan_hs(IN struct btc_coexist *btcoexist)
u8 wifi_rssi_state2, bt_rssi_state2;
boolean wifi_busy = false, wifi_turbo = false;
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_get(btcoexist, BTC_GET_U1_AP_NUM,
&coex_sta->scan_ap_num);
@ -3094,7 +2968,6 @@ void halbtc8723d2ant_action_a2dp_pan_hs(IN struct btc_coexist *btcoexist)
wifi_turbo = true;
#endif
wifi_rssi_state = halbtc8723d2ant_wifi_rssi_state(btcoexist,
&prewifi_rssi_state, 2,
coex_sta->wifi_coex_thres , 0);
@ -3109,7 +2982,6 @@ void halbtc8723d2ant_action_a2dp_pan_hs(IN struct btc_coexist *btcoexist)
bt_rssi_state2 = halbtc8723d2ant_bt_rssi_state(&pre_bt_rssi_state2, 2,
coex_sta->bt_coex_thres2 , 0);
if (BTC_RSSI_HIGH(wifi_rssi_state) &&
BTC_RSSI_HIGH(bt_rssi_state)) {
@ -3175,7 +3047,6 @@ void halbtc8723d2ant_action_a2dp_pan_hs(IN struct btc_coexist *btcoexist)
}
/* PAN(EDR)+A2DP */
void halbtc8723d2ant_action_pan_edr_a2dp(IN struct btc_coexist *btcoexist)
{
@ -3188,7 +3059,6 @@ void halbtc8723d2ant_action_pan_edr_a2dp(IN struct btc_coexist *btcoexist)
u8 wifi_rssi_state2, bt_rssi_state2;
boolean wifi_busy = false, wifi_turbo = false;
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_get(btcoexist, BTC_GET_U1_AP_NUM,
&coex_sta->scan_ap_num);
@ -3202,7 +3072,6 @@ void halbtc8723d2ant_action_pan_edr_a2dp(IN struct btc_coexist *btcoexist)
wifi_turbo = true;
#endif
wifi_rssi_state = halbtc8723d2ant_wifi_rssi_state(btcoexist,
&prewifi_rssi_state, 2,
coex_sta->wifi_coex_thres , 0);
@ -3284,7 +3153,6 @@ void halbtc8723d2ant_action_pan_edr_a2dp(IN struct btc_coexist *btcoexist)
}
void halbtc8723d2ant_action_pan_edr_hid(IN struct btc_coexist *btcoexist)
{
static u8 prewifi_rssi_state = BTC_RSSI_STATE_LOW;
@ -3316,7 +3184,6 @@ void halbtc8723d2ant_action_pan_edr_hid(IN struct btc_coexist *btcoexist)
bt_rssi_state2 = halbtc8723d2ant_bt_rssi_state(&pre_bt_rssi_state2, 2,
coex_sta->bt_coex_thres2 , 0);
if (BTC_RSSI_HIGH(wifi_rssi_state) &&
BTC_RSSI_HIGH(bt_rssi_state)) {
@ -3384,7 +3251,6 @@ void halbtc8723d2ant_action_pan_edr_hid(IN struct btc_coexist *btcoexist)
}
/* HID+A2DP+PAN(EDR) */
void halbtc8723d2ant_action_hid_a2dp_pan_edr(IN struct btc_coexist *btcoexist)
{
@ -3417,7 +3283,6 @@ void halbtc8723d2ant_action_hid_a2dp_pan_edr(IN struct btc_coexist *btcoexist)
bt_rssi_state2 = halbtc8723d2ant_bt_rssi_state(&pre_bt_rssi_state2, 2,
coex_sta->bt_coex_thres2 , 0);
if (BTC_RSSI_HIGH(wifi_rssi_state) &&
BTC_RSSI_HIGH(bt_rssi_state)) {
@ -3495,7 +3360,6 @@ void halbtc8723d2ant_action_hid_a2dp_pan_edr(IN struct btc_coexist *btcoexist)
}
void halbtc8723d2ant_action_wifi_multi_port(IN struct btc_coexist *btcoexist)
{
halbtc8723d2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 0x18);
@ -3624,7 +3488,6 @@ void halbtc8723d2ant_action_wifi_connected(IN struct btc_coexist *btcoexist)
}
void halbtc8723d2ant_run_coexist_mechanism(IN struct btc_coexist *btcoexist)
{
u8 algorithm = 0;
@ -3807,7 +3670,6 @@ void halbtc8723d2ant_run_coexist_mechanism(IN struct btc_coexist *btcoexist)
}
}
void halbtc8723d2ant_init_coex_dm(IN struct btc_coexist *btcoexist)
{
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
@ -3830,7 +3692,6 @@ void halbtc8723d2ant_init_coex_dm(IN struct btc_coexist *btcoexist)
halbtc8723d2ant_query_bt_info(btcoexist);
}
void halbtc8723d2ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only)
{
@ -3840,7 +3701,6 @@ void halbtc8723d2ant_init_hw_config(IN struct btc_coexist *btcoexist,
u16 u16tmp1 = 0;
u8 i = 0;
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"[BTCoex], 2Ant Init HW Config!!\n");
BTC_TRACE(trace_buf);
@ -3865,7 +3725,6 @@ void halbtc8723d2ant_init_hw_config(IN struct btc_coexist *btcoexist,
BTC_TRACE(trace_buf);
#endif
coex_sta->bt_coex_supported_feature = 0;
coex_sta->bt_coex_supported_version = 0;
coex_sta->bt_ble_scan_type = 0;
@ -3880,13 +3739,6 @@ void halbtc8723d2ant_init_hw_config(IN struct btc_coexist *btcoexist,
for (i = 0; i <= 9; i++)
coex_sta->bt_afh_map[i] = 0;
#if 0
btcoexist->btc_get(btcoexist, BTC_GET_U4_VENDOR, &vendor);
if (vendor == BTC_VENDOR_LENOVO)
coex_dm->switch_thres_offset = 0;
else
coex_dm->switch_thres_offset = 20;
#endif
/* 0xf0[15:12] --> Chip Cut information */
coex_sta->cut_version = (btcoexist->btc_read_1byte(btcoexist,
0xf1) & 0xf0) >> 4;
@ -3963,7 +3815,6 @@ void halbtc8723d2ant_init_hw_config(IN struct btc_coexist *btcoexist,
btcoexist->stop_coex_dm = false;
}
}
u32 halbtc8723d2ant_psd_log2base(IN struct btc_coexist *btcoexist, IN u32 val)
@ -3989,7 +3840,6 @@ u32 halbtc8723d2ant_psd_log2base(IN struct btc_coexist *btcoexist, IN u32 val)
}
}
val_integerd_b = shiftcount + 1;
tmp2 = 1;
@ -4008,7 +3858,6 @@ u32 halbtc8723d2ant_psd_log2base(IN struct btc_coexist *btcoexist, IN u32 val)
return result;
}
void halbtc8723d2ant_psd_show_antenna_detect_result(IN struct btc_coexist
@ -4187,7 +4036,6 @@ void halbtc8723d2ant_psd_show_antenna_detect_result(IN struct btc_coexist
"PSD Scan Peak Freq", psd_scan->ant_det_peak_freq);
CL_PRINTF(cli_buf);
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "TFBGA Package",
(board_info->tfbga_package) ? "Yes" : "No");
CL_PRINTF(cli_buf);
@ -4324,7 +4172,6 @@ void halbtc8723d2ant_psd_showdata(IN struct btc_coexist *btcoexist)
} while ((i <= 8) && (m <= psd_scan->psd_stop_point));
do {
psd_rep1 = psd_scan->psd_report_max_hold[n] /
100;
@ -4387,12 +4234,8 @@ void halbtc8723d2ant_psd_showdata(IN struct btc_coexist *btcoexist)
}
}
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
void halbtc8723d2ant_psd_maxholddata(IN struct btc_coexist *btcoexist,
IN u32 gen_count)
{
@ -4425,10 +4268,6 @@ void halbtc8723d2ant_psd_maxholddata(IN struct btc_coexist *btcoexist,
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
u32 halbtc8723d2ant_psd_getdata(IN struct btc_coexist *btcoexist, IN u32 point)
{
/* reg 0x808[9:0]: FFT data x */
@ -4460,9 +4299,6 @@ u32 halbtc8723d2ant_psd_getdata(IN struct btc_coexist *btcoexist, IN u32 point)
return psd_report;
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
boolean halbtc8723d2ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN s32 offset, IN u32 span, IN u32 points,
IN u32 avgnum, IN u32 loopcnt)
@ -4495,7 +4331,6 @@ boolean halbtc8723d2ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
psd_scan->real_offset = offset;
psd_scan->real_span = span;
points1 = psd_scan->psd_point;
delta_freq_per_point = psd_scan->psd_band_width /
psd_scan->psd_point;
@ -4595,7 +4430,6 @@ boolean halbtc8723d2ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1d,
0xfffff, 0x2e);
/* Set RF mode = Rx, RF Gain = 0x320a0 */
btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x0,
0xfffff, 0x320a0);
@ -4792,9 +4626,6 @@ boolean halbtc8723d2ant_psd_sweep_point(IN struct btc_coexist *btcoexist,
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
boolean halbtc8723d2ant_psd_antenna_detection(IN struct btc_coexist
*btcoexist)
{
@ -4853,15 +4684,6 @@ boolean halbtc8723d2ant_psd_antenna_detection(IN struct btc_coexist
break;
}
}
#if 0
wlpsd_sweep_count = bt_tx_time * 238 /
100; /* bt_tx_time/0.42 */
wlpsd_sweep_count = wlpsd_sweep_count / 5;
if (wlpsd_sweep_count % 5 != 0)
wlpsd_sweep_count = (wlpsd_sweep_count /
5 + 1) * 5;
#endif
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"xxxxxxxxxxxxxxxx AntennaDetect(), BT_LETxTime=%d, BT_LECh = %d\n",
bt_tx_time, bt_le_channel);
@ -5001,21 +4823,8 @@ boolean halbtc8723d2ant_psd_antenna_detection(IN struct btc_coexist
state = 99;
break;
}
#if 1
psd_scan->ant_det_psd_scan_peak_val =
psd_scan->psd_max_value;
#endif
#if 0
psd_scan->ant_det_psd_scan_peak_val =
((psd_scan->psd_max_value - psd_scan->psd_avg_value) <
800) ?
psd_scan->psd_max_value : ((
psd_scan->psd_max_value -
psd_scan->psd_max_value2 <= 300) ?
psd_scan->psd_avg_value :
psd_scan->psd_max_value2);
#endif
psd_scan->ant_det_psd_scan_peak_freq =
psd_scan->psd_max_value_point;
state = 4;
@ -5175,9 +4984,6 @@ boolean halbtc8723d2ant_psd_antenna_detection(IN struct btc_coexist
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
boolean halbtc8723d2ant_psd_antenna_detection_check(IN struct btc_coexist
*btcoexist)
{
@ -5217,7 +5023,6 @@ boolean halbtc8723d2ant_psd_antenna_detection_check(IN struct btc_coexist
delay_ms(psd_scan->ant_det_bt_tx_time);
}
if (!ant_det_finish)
ant_det_fail_count++;
@ -5234,7 +5039,6 @@ boolean halbtc8723d2ant_psd_antenna_detection_check(IN struct btc_coexist
}
/* ************************************************************
* work around function start with wa_halbtc8723d2ant_
* ************************************************************
@ -5258,7 +5062,6 @@ void ex_halbtc8723d2ant_power_on_setting(IN struct btc_coexist *btcoexist)
board_info->btdm_ant_num_by_ant_det);
BTC_TRACE(trace_buf);
btcoexist->stop_coex_dm = true;
psd_scan->ant_det_is_ant_det_available = false;
@ -5266,7 +5069,6 @@ void ex_halbtc8723d2ant_power_on_setting(IN struct btc_coexist *btcoexist)
u16tmp = btcoexist->btc_read_2byte(btcoexist, 0x2);
btcoexist->btc_write_2byte(btcoexist, 0x2, u16tmp | BIT(0) | BIT(1));
/* Local setting bit define */
/* BIT0: "0" for no antenna inverse; "1" for antenna inverse */
/* BIT1: "0" for internal switch; "1" for external switch */
@ -5362,7 +5164,6 @@ void ex_halbtc8723d2ant_pre_load_firmware(IN struct btc_coexist *btcoexist)
}
}
void ex_halbtc8723d2ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only)
{
@ -5446,7 +5247,6 @@ void ex_halbtc8723d2ant_display_coex_info(IN struct btc_coexist *btcoexist)
CL_PRINTF(cli_buf);
}
bt_patch_ver = btcoexist->bt_info.bt_get_fw_ver;
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver);
phyver = btcoexist->btc_get_bt_phydm_version(btcoexist);
@ -5514,7 +5314,6 @@ void ex_halbtc8723d2ant_display_coex_info(IN struct btc_coexist *btcoexist)
pop_report_in_10s = 0;
}
if (coex_sta->num_of_profile != 0)
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE,
"\r\n %-35s = %s%s%s%s%s",
@ -5533,7 +5332,6 @@ void ex_halbtc8723d2ant_display_coex_info(IN struct btc_coexist *btcoexist)
CL_PRINTF(cli_buf);
if (bt_link_info->a2dp_exist) {
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/ %d/ %s",
"A2DP Rate/Bitpool/Auto_Slot",
@ -5645,7 +5443,6 @@ void ex_halbtc8723d2ant_display_coex_info(IN struct btc_coexist *btcoexist)
CL_PRINTF(cli_buf);
ps_tdma_case = coex_dm->cur_ps_tdma;
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE,
@ -5797,7 +5594,6 @@ void ex_halbtc8723d2ant_display_coex_info(IN struct btc_coexist *btcoexist)
(int)((u8tmp[3] & BIT(7)) >> 7));
CL_PRINTF(cli_buf);
u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x4c6);
u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x40);
u8tmp[2] = btcoexist->btc_read_1byte(btcoexist, 0x45e);
@ -5866,7 +5662,6 @@ void ex_halbtc8723d2ant_display_coex_info(IN struct btc_coexist *btcoexist)
btcoexist->btc_disp_dbg_msg(btcoexist, BTC_DBG_DISP_COEX_STATISTICS);
}
void ex_halbtc8723d2ant_ips_notify(IN struct btc_coexist *btcoexist, IN u8 type)
{
if (btcoexist->manual_control || btcoexist->stop_coex_dm)
@ -5932,7 +5727,6 @@ void ex_halbtc8723d2ant_lps_notify(IN struct btc_coexist *btcoexist, IN u8 type)
BT_8723D_2ANT_SCOREBOARD_ACTIVE, false);
}
} else if (BTC_LPS_DISABLE == type) {
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"[BTCoex], LPS DISABLE notify\n");
@ -5951,7 +5745,6 @@ void ex_halbtc8723d2ant_scan_notify(IN struct btc_coexist *btcoexist,
u8 u8tmpa, u8tmpb;
boolean wifi_connected = false;
if (btcoexist->manual_control ||
btcoexist->stop_coex_dm)
return;
@ -6104,7 +5897,6 @@ void ex_halbtc8723d2ant_media_status_notify(IN struct btc_coexist *btcoexist,
BT_8723D_2ANT_SCOREBOARD_ACTIVE, false);
}
halbtc8723d2ant_update_wifi_channel_info(btcoexist, type);
}
@ -6309,7 +6101,6 @@ void ex_halbtc8723d2ant_bt_info_notify(IN struct btc_coexist *btcoexist,
BTC_MEDIA_DISCONNECT);
}
/* If Ignore_WLanAct && not SetUp_Link or Role_Switch */
if ((coex_sta->bt_info_ext & BIT(3)) &&
(!(coex_sta->bt_info_ext & BIT(2))) &&
@ -6428,7 +6219,6 @@ void ex_halbtc8723d2ant_pnp_notify(IN struct btc_coexist *btcoexist,
coex_sta->under_ips = false;
coex_sta->under_lps = false;
halbtc8723d2ant_post_state_to_bt(btcoexist,
BT_8723D_2ANT_SCOREBOARD_ACTIVE, false);
halbtc8723d2ant_post_state_to_bt(btcoexist,
@ -6446,7 +6236,6 @@ void ex_halbtc8723d2ant_pnp_notify(IN struct btc_coexist *btcoexist,
BT_8723D_2ANT_PHASE_WLAN_OFF);
}
} else if (BTC_WIFI_PNP_WAKE_UP == pnp_state) {
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
"[BTCoex], Pnp notify to WAKE UP\n");
@ -6575,7 +6364,6 @@ void ex_halbtc8723d2ant_periodical(IN struct btc_coexist *btcoexist)
#endif
}
if (halbtc8723d2ant_is_wifibt_status_changed(btcoexist))
halbtc8723d2ant_run_coexist_mechanism(btcoexist);
}
@ -6604,9 +6392,6 @@ void ex_halbtc8723d2ant_set_antenna_notify(IN struct btc_coexist *btcoexist,
}
}
#ifdef PLATFORM_WINDOWS
#pragma optimize("", off)
#endif
void ex_halbtc8723d2ant_antenna_detection(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN u32 offset, IN u32 span, IN u32 seconds)
{
@ -6747,10 +6532,8 @@ void ex_halbtc8723d2ant_antenna_detection(IN struct btc_coexist *btcoexist,
}
#endif
}
void ex_halbtc8723d2ant_display_ant_detection(IN struct btc_coexist *btcoexist)
{
@ -6767,7 +6550,6 @@ void ex_halbtc8723d2ant_display_ant_detection(IN struct btc_coexist *btcoexist)
}
#endif
#endif /* #if (RTL8723D_SUPPORT == 1) */

View file

@ -25,11 +25,7 @@
#define BT_TMP_BUF_SIZE 100
#ifdef PLATFORM_LINUX
#define rsprintf snprintf
#elif defined(PLATFORM_WINDOWS)
#define rsprintf sprintf_s
#endif
#define DCMD_Printf DBG_BT_INFO