Lines Matching +full:0 +full:x01010000

32 static u32 glcoex_ver_8723b_2ant = 0x3f;
45 s32 bt_rssi = 0; in btc8723b2ant_bt_rssi_state()
134 s32 wifi_rssi = 0; in btc8723b2ant_wifi_rssi_state()
250 u32 reg_hp_tx = 0, reg_hp_rx = 0; in btc8723b2ant_monitor_bt_ctr()
251 u32 reg_lp_tx = 0, reg_lp_rx = 0; in btc8723b2ant_monitor_bt_ctr()
253 reg_hp_txrx = 0x770; in btc8723b2ant_monitor_bt_ctr()
254 reg_lp_txrx = 0x774; in btc8723b2ant_monitor_bt_ctr()
281 "[BTCoex], High Priority Tx/Rx(reg 0x%x)=0x%x(%d)/0x%x(%d)\n", in btc8723b2ant_monitor_bt_ctr()
284 "[BTCoex], Low Priority Tx/Rx(reg 0x%x)=0x%x(%d)/0x%x(%d)\n", in btc8723b2ant_monitor_bt_ctr()
288 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0xc); in btc8723b2ant_monitor_bt_ctr()
294 coex_sta->crc_ok_cck = 0; in btc8723b2ant_monitor_wifi_ctr()
295 coex_sta->crc_ok_11g = 0; in btc8723b2ant_monitor_wifi_ctr()
296 coex_sta->crc_ok_11n = 0; in btc8723b2ant_monitor_wifi_ctr()
297 coex_sta->crc_ok_11n_agg = 0; in btc8723b2ant_monitor_wifi_ctr()
299 coex_sta->crc_err_cck = 0; in btc8723b2ant_monitor_wifi_ctr()
300 coex_sta->crc_err_11g = 0; in btc8723b2ant_monitor_wifi_ctr()
301 coex_sta->crc_err_11n = 0; in btc8723b2ant_monitor_wifi_ctr()
302 coex_sta->crc_err_11n_agg = 0; in btc8723b2ant_monitor_wifi_ctr()
305 btcoexist->btc_read_4byte(btcoexist, 0xf88); in btc8723b2ant_monitor_wifi_ctr()
307 btcoexist->btc_read_2byte(btcoexist, 0xf94); in btc8723b2ant_monitor_wifi_ctr()
309 btcoexist->btc_read_2byte(btcoexist, 0xf90); in btc8723b2ant_monitor_wifi_ctr()
311 btcoexist->btc_read_2byte(btcoexist, 0xfb8); in btc8723b2ant_monitor_wifi_ctr()
314 btcoexist->btc_read_4byte(btcoexist, 0xf84); in btc8723b2ant_monitor_wifi_ctr()
316 btcoexist->btc_read_2byte(btcoexist, 0xf96); in btc8723b2ant_monitor_wifi_ctr()
318 btcoexist->btc_read_2byte(btcoexist, 0xf92); in btc8723b2ant_monitor_wifi_ctr()
320 btcoexist->btc_read_2byte(btcoexist, 0xfba); in btc8723b2ant_monitor_wifi_ctr()
324 btcoexist->btc_write_1byte_bitmask(btcoexist, 0xf16, 0x1, 0x1); in btc8723b2ant_monitor_wifi_ctr()
325 btcoexist->btc_write_1byte_bitmask(btcoexist, 0xf16, 0x1, 0x0); in btc8723b2ant_monitor_wifi_ctr()
331 u8 h2c_parameter[1] = {0}; in btc8723b2ant_query_bt_info()
335 h2c_parameter[0] |= BIT0; /* trigger */ in btc8723b2ant_query_bt_info()
338 "[BTCoex], Query Bt Info, FW write 0x61 = 0x%x\n", in btc8723b2ant_query_bt_info()
339 h2c_parameter[0]); in btc8723b2ant_query_bt_info()
341 btcoexist->btc_fill_h2c(btcoexist, 0x61, 1, h2c_parameter); in btc8723b2ant_query_bt_info()
380 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, tmp, 0); in btc8723b2ant_is_wifi_status_changed()
444 u8 num_of_diff_profile = 0; in btc8723b2ant_action_algorithm()
637 u8 h2c_parameter[1] = {0}; in btc8723b2ant_set_fw_dac_swing_level()
640 * 0x18/ 0x10/ 0xc/ 0x8/ 0x4/ 0x6 in btc8723b2ant_set_fw_dac_swing_level()
642 h2c_parameter[0] = dac_swing_lvl; in btc8723b2ant_set_fw_dac_swing_level()
645 "[BTCoex], Set Dac Swing Level=0x%x\n", dac_swing_lvl); in btc8723b2ant_set_fw_dac_swing_level()
647 "[BTCoex], FW write 0x64=0x%x\n", h2c_parameter[0]); in btc8723b2ant_set_fw_dac_swing_level()
649 btcoexist->btc_fill_h2c(btcoexist, 0x64, 1, h2c_parameter); in btc8723b2ant_set_fw_dac_swing_level()
656 u8 h2c_parameter[1] = {0}; in btc8723b2ant_set_fw_dec_bt_pwr()
658 h2c_parameter[0] = dec_bt_pwr_lvl; in btc8723b2ant_set_fw_dec_bt_pwr()
663 btcoexist->btc_fill_h2c(btcoexist, 0x62, 1, h2c_parameter); in btc8723b2ant_set_fw_dec_bt_pwr()
693 u8 h2c_parameter[1] = {0}; in halbtc8723b2ant_set_bt_auto_report()
695 h2c_parameter[0] = 0; in halbtc8723b2ant_set_bt_auto_report()
698 h2c_parameter[0] |= BIT(0); in halbtc8723b2ant_set_bt_auto_report()
700 btcoexist->btc_fill_h2c(btcoexist, 0x68, 1, h2c_parameter); in halbtc8723b2ant_set_bt_auto_report()
749 u8 h2c_parameter[6] = {0}; in btc8723b_set_penalty_txrate()
751 h2c_parameter[0] = 0x6; /* op_code, 0x6 = Retry_Penalty */ in btc8723b_set_penalty_txrate()
756 h2c_parameter[2] = 0x00; in btc8723b_set_penalty_txrate()
757 h2c_parameter[3] = 0xf4; /* MCS7 or OFDM54 */ in btc8723b_set_penalty_txrate()
758 h2c_parameter[4] = 0xf5; /* MCS6 or OFDM48 */ in btc8723b_set_penalty_txrate()
759 h2c_parameter[5] = 0xf6; /* MCS5 or OFDM36 */ in btc8723b_set_penalty_txrate()
766 btcoexist->btc_fill_h2c(btcoexist, 0x69, 6, h2c_parameter); in btc8723b_set_penalty_txrate()
801 "[BTCoex], Write SwDacSwing = 0x%x\n", level); in btc8723b2ant_set_dac_swing_reg()
802 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x883, 0x3e, val); in btc8723b2ant_set_dac_swing_reg()
812 btc8723b2ant_set_dac_swing_reg(btcoex, 0x18); in btc8723b2ant_set_sw_fulltime_dac_swing()
822 "[BTCoex], %s turn DacSwing=%s, dac_swing_lvl=0x%x\n", in btc8723b2ant_dac_swing()
830 "[BTCoex], bPreDacSwingOn=%d, preDacSwingLvl=0x%x, bCurDacSwingOn=%d, curDacSwingLvl=0x%x\n", in btc8723b2ant_dac_swing()
855 "[BTCoex], set coex table, set 0x6c0=0x%x\n", val0x6c0); in btc8723b2ant_set_coex_table()
856 btcoexist->btc_write_4byte(btcoexist, 0x6c0, val0x6c0); in btc8723b2ant_set_coex_table()
859 "[BTCoex], set coex table, set 0x6c4=0x%x\n", val0x6c4); in btc8723b2ant_set_coex_table()
860 btcoexist->btc_write_4byte(btcoexist, 0x6c4, val0x6c4); in btc8723b2ant_set_coex_table()
863 "[BTCoex], set coex table, set 0x6c8=0x%x\n", val0x6c8); in btc8723b2ant_set_coex_table()
864 btcoexist->btc_write_4byte(btcoexist, 0x6c8, val0x6c8); in btc8723b2ant_set_coex_table()
867 "[BTCoex], set coex table, set 0x6cc=0x%x\n", val0x6cc); in btc8723b2ant_set_coex_table()
868 btcoexist->btc_write_1byte(btcoexist, 0x6cc, val0x6cc); in btc8723b2ant_set_coex_table()
879 "[BTCoex], %s write Coex Table 0x6c0=0x%x, 0x6c4=0x%x, 0x6c8=0x%x, 0x6cc=0x%x\n", in btc8723b2ant_coex_table()
889 "[BTCoex], preVal0x6c0=0x%x, preVal0x6c4=0x%x, preVal0x6c8=0x%x, preVal0x6cc=0x%x !!\n", in btc8723b2ant_coex_table()
893 "[BTCoex], curVal0x6c0=0x%x, curVal0x6c4=0x%x, curVal0x6c8=0x%x, curVal0x6cc=0x%x !!\n", in btc8723b2ant_coex_table()
916 case 0: in btc8723b2ant_coex_table_with_type()
917 btc8723b2ant_coex_table(btcoexist, force_exec, 0x55555555, in btc8723b2ant_coex_table_with_type()
918 0x55555555, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
921 btc8723b2ant_coex_table(btcoexist, force_exec, 0x55555555, in btc8723b2ant_coex_table_with_type()
922 0x5afa5afa, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
925 btc8723b2ant_coex_table(btcoexist, force_exec, 0x5ada5ada, in btc8723b2ant_coex_table_with_type()
926 0x5ada5ada, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
929 btc8723b2ant_coex_table(btcoexist, force_exec, 0xaaaaaaaa, in btc8723b2ant_coex_table_with_type()
930 0xaaaaaaaa, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
933 btc8723b2ant_coex_table(btcoexist, force_exec, 0xffffffff, in btc8723b2ant_coex_table_with_type()
934 0xffffffff, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
937 btc8723b2ant_coex_table(btcoexist, force_exec, 0x5fff5fff, in btc8723b2ant_coex_table_with_type()
938 0x5fff5fff, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
941 btc8723b2ant_coex_table(btcoexist, force_exec, 0x55ff55ff, in btc8723b2ant_coex_table_with_type()
942 0x5a5a5a5a, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
945 btc8723b2ant_coex_table(btcoexist, force_exec, 0x55dd55dd, in btc8723b2ant_coex_table_with_type()
946 0x5ada5ada, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
949 btc8723b2ant_coex_table(btcoexist, force_exec, 0x55dd55dd, in btc8723b2ant_coex_table_with_type()
950 0x5ada5ada, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
953 btc8723b2ant_coex_table(btcoexist, force_exec, 0x55dd55dd, in btc8723b2ant_coex_table_with_type()
954 0x5ada5ada, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
957 btc8723b2ant_coex_table(btcoexist, force_exec, 0x55dd55dd, in btc8723b2ant_coex_table_with_type()
958 0x5ada5ada, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
961 btc8723b2ant_coex_table(btcoexist, force_exec, 0x55dd55dd, in btc8723b2ant_coex_table_with_type()
962 0x5ada5ada, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
965 btc8723b2ant_coex_table(btcoexist, force_exec, 0x55dd55dd, in btc8723b2ant_coex_table_with_type()
966 0x5ada5ada, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
969 btc8723b2ant_coex_table(btcoexist, force_exec, 0x5fff5fff, in btc8723b2ant_coex_table_with_type()
970 0xaaaaaaaa, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
973 btc8723b2ant_coex_table(btcoexist, force_exec, 0x5fff5fff, in btc8723b2ant_coex_table_with_type()
974 0x5ada5ada, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
977 btc8723b2ant_coex_table(btcoexist, force_exec, 0x55dd55dd, in btc8723b2ant_coex_table_with_type()
978 0xaaaaaaaa, 0xffffff, 0x3); in btc8723b2ant_coex_table_with_type()
989 u8 h2c_parameter[1] = {0}; in btc8723b2ant_set_fw_ignore_wlan_act()
992 h2c_parameter[0] |= BIT0; /* function enable */ in btc8723b2ant_set_fw_ignore_wlan_act()
995 "[BTCoex], set FW for BT Ignore Wlan_Act, FW write 0x63=0x%x\n", in btc8723b2ant_set_fw_ignore_wlan_act()
996 h2c_parameter[0]); in btc8723b2ant_set_fw_ignore_wlan_act()
998 btcoexist->btc_fill_h2c(btcoexist, 0x63, 1, h2c_parameter); in btc8723b2ant_set_fw_ignore_wlan_act()
1059 byte5 = byte5 | 0x1; in btc8723b2ant_set_fw_ps_tdma()
1061 h2c_parameter[0] = byte1; in btc8723b2ant_set_fw_ps_tdma()
1067 coex_dm->ps_tdma_para[0] = byte1; in btc8723b2ant_set_fw_ps_tdma()
1074 "[BTCoex], FW write 0x60(5bytes)=0x%x%08x\n", in btc8723b2ant_set_fw_ps_tdma()
1075 h2c_parameter[0], in btc8723b2ant_set_fw_ps_tdma()
1079 btcoexist->btc_fill_h2c(btcoexist, 0x60, 5, h2c_parameter); in btc8723b2ant_set_fw_ps_tdma()
1094 u32 fw_ver = 0, u32tmp = 0; in btc8723b2ant_set_ant_path()
1097 u8 h2c_parameter[2] = {0}; in btc8723b2ant_set_ant_path()
1102 if ((fw_ver < 0xc0000) || pg_ext_switch) in btc8723b2ant_set_ant_path()
1106 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x39, 0x8, 0x1); in btc8723b2ant_set_ant_path()
1107 btcoexist->btc_write_1byte(btcoexist, 0x974, 0xff); in btc8723b2ant_set_ant_path()
1108 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x944, 0x3, 0x3); in btc8723b2ant_set_ant_path()
1109 btcoexist->btc_write_1byte(btcoexist, 0x930, 0x77); in btc8723b2ant_set_ant_path()
1110 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x67, 0x20, 0x1); in btc8723b2ant_set_ant_path()
1112 if (fw_ver >= 0x180000) { in btc8723b2ant_set_ant_path()
1114 h2c_parameter[0] = 1; in btc8723b2ant_set_ant_path()
1115 btcoexist->btc_fill_h2c(btcoexist, 0x6E, 1, in btc8723b2ant_set_ant_path()
1118 btcoexist->btc_write_1byte(btcoexist, 0x765, 0x18); in btc8723b2ant_set_ant_path()
1121 btcoexist->btc_write_4byte(btcoexist, 0x948, 0x0); in btc8723b2ant_set_ant_path()
1125 0x1, 0xfffff, 0x0); in btc8723b2ant_set_ant_path()
1129 h2c_parameter[0] = 0; in btc8723b2ant_set_ant_path()
1132 h2c_parameter[0] = 1; in btc8723b2ant_set_ant_path()
1140 h2c_parameter[1] = 0; in btc8723b2ant_set_ant_path()
1142 btcoexist->btc_fill_h2c(btcoexist, 0x65, 2, h2c_parameter); in btc8723b2ant_set_ant_path()
1144 if (fw_ver >= 0x180000) { in btc8723b2ant_set_ant_path()
1146 h2c_parameter[0] = 0; in btc8723b2ant_set_ant_path()
1147 btcoexist->btc_fill_h2c(btcoexist, 0x6E, 1, in btc8723b2ant_set_ant_path()
1150 btcoexist->btc_write_1byte(btcoexist, 0x765, 0x0); in btc8723b2ant_set_ant_path()
1157 /* 0x4c[23] = 0, 0x4c[24] = 1 Ant controlled by WL/BT */ in btc8723b2ant_set_ant_path()
1158 u32tmp = btcoexist->btc_read_4byte(btcoexist, 0x4c); in btc8723b2ant_set_ant_path()
1161 btcoexist->btc_write_4byte(btcoexist, 0x4c, u32tmp); in btc8723b2ant_set_ant_path()
1166 btcoexist->btc_write_2byte(btcoexist, 0x948, 0x0); in btc8723b2ant_set_ant_path()
1168 btcoexist->btc_write_2byte(btcoexist, 0x948, 0x280); in btc8723b2ant_set_ant_path()
1173 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x92c, in btc8723b2ant_set_ant_path()
1174 0x3, 0x1); in btc8723b2ant_set_ant_path()
1179 0x92c, 0x3, 0x2); in btc8723b2ant_set_ant_path()
1185 /* 0x4c[23] = 0, 0x4c[24] = 1 Ant controlled by WL/BT */ in btc8723b2ant_set_ant_path()
1186 u32tmp = btcoexist->btc_read_4byte(btcoexist, 0x4c); in btc8723b2ant_set_ant_path()
1189 btcoexist->btc_write_4byte(btcoexist, 0x4c, u32tmp); in btc8723b2ant_set_ant_path()
1193 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x64, 0x1, 0x0); in btc8723b2ant_set_ant_path()
1197 btcoexist->btc_write_2byte(btcoexist, 0x948, 0x0); in btc8723b2ant_set_ant_path()
1201 btcoexist->btc_write_2byte(btcoexist, 0x948, 0x280); in btc8723b2ant_set_ant_path()
1213 s8 wifi_duration_adjust = 0x0; in btc8723b2ant_ps_tdma()
1214 u8 tdma_byte4_modify = 0x0; in btc8723b2ant_ps_tdma()
1218 wifi_rssi_state = btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, tmp, 0); in btc8723b2ant_ps_tdma()
1221 bt_rssi_state = btc8723b2ant_bt_rssi_state(btcoexist, 2, tmp, 0); in btc8723b2ant_ps_tdma()
1265 wifi_duration_adjust = 0; in btc8723b2ant_ps_tdma()
1283 /* 0x778 = 0x1 at wifi slot (no blocking BT Low-Pri pkts) */ in btc8723b2ant_ps_tdma()
1284 tdma_byte4_modify = 0x1; in btc8723b2ant_ps_tdma()
1291 btcoexist, 0xe3, 0x3c, in btc8723b2ant_ps_tdma()
1292 0x03, 0xf1, 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1296 btcoexist, 0xe3, 0x2d, in btc8723b2ant_ps_tdma()
1297 0x03, 0xf1, 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1300 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1c, in btc8723b2ant_ps_tdma()
1301 0x3, 0xf1, in btc8723b2ant_ps_tdma()
1302 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1305 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x10, in btc8723b2ant_ps_tdma()
1306 0x03, 0xf1, in btc8723b2ant_ps_tdma()
1307 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1311 btcoexist, 0xe3, 0x3c, in btc8723b2ant_ps_tdma()
1312 0x3, 0x70, 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1316 btcoexist, 0xe3, 0x2d, in btc8723b2ant_ps_tdma()
1317 0x3, 0x70, 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1320 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1c, in btc8723b2ant_ps_tdma()
1321 0x3, 0x70, in btc8723b2ant_ps_tdma()
1322 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1325 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xa3, 0x10, in btc8723b2ant_ps_tdma()
1326 0x3, 0x70, in btc8723b2ant_ps_tdma()
1327 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1331 btcoexist, 0xe3, 0x3c + wifi_duration_adjust, in btc8723b2ant_ps_tdma()
1332 0x03, 0xf1, 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1336 btcoexist, 0xe3, 0x2d, in btc8723b2ant_ps_tdma()
1337 0x03, 0xf1, 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1340 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1c, in btc8723b2ant_ps_tdma()
1341 0x3, 0xf1, in btc8723b2ant_ps_tdma()
1342 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1345 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x10, in btc8723b2ant_ps_tdma()
1346 0x3, 0xf1, in btc8723b2ant_ps_tdma()
1347 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1351 btcoexist, 0xe3, 0x3c, in btc8723b2ant_ps_tdma()
1352 0x3, 0x70, 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1356 btcoexist, 0xe3, 0x2d, in btc8723b2ant_ps_tdma()
1357 0x3, 0x70, 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1360 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1c, in btc8723b2ant_ps_tdma()
1361 0x3, 0x70, in btc8723b2ant_ps_tdma()
1362 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1365 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x10, in btc8723b2ant_ps_tdma()
1366 0x3, 0x70, in btc8723b2ant_ps_tdma()
1367 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1370 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xa3, 0x2f, in btc8723b2ant_ps_tdma()
1371 0x2f, 0x60, 0x90); in btc8723b2ant_ps_tdma()
1374 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x5, 0x5, in btc8723b2ant_ps_tdma()
1375 0xe1, 0x90); in btc8723b2ant_ps_tdma()
1378 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x25, in btc8723b2ant_ps_tdma()
1379 0x25, 0xe1, 0x90); in btc8723b2ant_ps_tdma()
1382 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x25, in btc8723b2ant_ps_tdma()
1383 0x25, 0x60, 0x90); in btc8723b2ant_ps_tdma()
1386 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x15, in btc8723b2ant_ps_tdma()
1387 0x03, 0x70, 0x90); in btc8723b2ant_ps_tdma()
1392 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x35, in btc8723b2ant_ps_tdma()
1393 0x03, 0x71, 0x10); in btc8723b2ant_ps_tdma()
1397 btcoexist, 0xe3, 0x3c + wifi_duration_adjust, in btc8723b2ant_ps_tdma()
1398 0x03, 0xf1, 0x90); in btc8723b2ant_ps_tdma()
1405 btcoexist, 0xd3, 0x3a + wifi_duration_adjust, in btc8723b2ant_ps_tdma()
1406 0x03, 0x70, 0x50 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1413 btcoexist, 0xd3, 0x2d + wifi_duration_adjust, in btc8723b2ant_ps_tdma()
1414 0x03, 0x70, 0x50 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1420 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xd3, 0x1c, in btc8723b2ant_ps_tdma()
1421 0x03, 0x70, in btc8723b2ant_ps_tdma()
1422 0x50 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1428 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xd3, 0x10, in btc8723b2ant_ps_tdma()
1429 0x03, 0x70, in btc8723b2ant_ps_tdma()
1430 0x50 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1433 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x3c, in btc8723b2ant_ps_tdma()
1434 0x03, 0xf1, in btc8723b2ant_ps_tdma()
1435 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1438 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x15, in btc8723b2ant_ps_tdma()
1439 0x03, 0x70, in btc8723b2ant_ps_tdma()
1440 0x90 | tdma_byte4_modify); in btc8723b2ant_ps_tdma()
1444 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x35, in btc8723b2ant_ps_tdma()
1445 0x03, 0x71, 0x11); in btc8723b2ant_ps_tdma()
1451 case 0: in btc8723b2ant_ps_tdma()
1452 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0x0, 0x0, 0x0, in btc8723b2ant_ps_tdma()
1453 0x40, 0x0); in btc8723b2ant_ps_tdma()
1456 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0x0, 0x0, 0x0, in btc8723b2ant_ps_tdma()
1457 0x48, 0x0); in btc8723b2ant_ps_tdma()
1460 btc8723b2ant_set_fw_ps_tdma(btcoexist, 0x0, 0x0, 0x0, in btc8723b2ant_ps_tdma()
1461 0x40, 0x0); in btc8723b2ant_ps_tdma()
1474 u8 lps_mode = 0x0; in btc8723b2ant_ps_tdma_check_for_power_save_state()
1538 btc8723b2ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); in btc8723b2ant_coex_alloff()
1541 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_coex_alloff()
1547 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); in btc8723b2ant_coex_alloff()
1548 btc8723b2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_coex_alloff()
1554 btc8723b2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_init_coex_dm()
1555 btc8723b2ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); in btc8723b2ant_init_coex_dm()
1559 btc8723b2ant_dec_bt_pwr(btcoexist, FORCE_EXEC, 0); in btc8723b2ant_init_coex_dm()
1563 coex_sta->pop_event_cnt = 0; in btc8723b2ant_init_coex_dm()
1582 btc8723b2ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); in btc8723b2ant_action_bt_inquiry()
1598 btc8723b2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_bt_inquiry()
1602 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_bt_inquiry()
1619 u32tmp = btcoexist->btc_read_4byte(btcoexist, 0x948); in btc8723b2ant_action_wifi_link_process()
1620 u8tmpa = btcoexist->btc_read_1byte(btcoexist, 0x765); in btc8723b2ant_action_wifi_link_process()
1621 u8tmpb = btcoexist->btc_read_1byte(btcoexist, 0x76e); in btc8723b2ant_action_wifi_link_process()
1624 "[BTCoex], 0x948 = 0x%x, 0x765 = 0x%x, 0x76e = 0x%x\n", in btc8723b2ant_action_wifi_link_process()
1632 u8 ap_num = 0; in btc8723b2ant_action_wifi_idle_process()
1636 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0); in btc8723b2ant_action_wifi_idle_process()
1638 tmp, 0); in btc8723b2ant_action_wifi_idle_process()
1641 btc8723b2ant_bt_rssi_state(btcoexist, 2, tmp, 0); in btc8723b2ant_action_wifi_idle_process()
1651 btc8723b2ant_dac_swing(btcoexist, NORMAL_EXEC, true, 0x6); in btc8723b2ant_action_wifi_idle_process()
1652 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_wifi_idle_process()
1657 btc8723b2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_wifi_idle_process()
1659 0x0, 0x0); in btc8723b2ant_action_wifi_idle_process()
1665 btc8723b2ant_dac_swing(btcoexist, NORMAL_EXEC, true, 0x18); in btc8723b2ant_action_wifi_idle_process()
1686 false, false, 0x8); in btc8723b2ant_is_common_action()
1691 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, in btc8723b2ant_is_common_action()
1692 0x0); in btc8723b2ant_is_common_action()
1693 btc8723b2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_is_common_action()
1696 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_is_common_action()
1710 false, false, 0x8); in btc8723b2ant_is_common_action()
1715 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, in btc8723b2ant_is_common_action()
1716 0xfffff, 0x0); in btc8723b2ant_is_common_action()
1718 NORMAL_EXEC, 0); in btc8723b2ant_is_common_action()
1721 0xb); in btc8723b2ant_is_common_action()
1722 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_is_common_action()
1740 false, false, 0x8); in btc8723b2ant_is_common_action()
1742 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, in btc8723b2ant_is_common_action()
1743 0xfffff, 0x0); in btc8723b2ant_is_common_action()
1745 NORMAL_EXEC, 0); in btc8723b2ant_is_common_action()
1748 0xb); in btc8723b2ant_is_common_action()
1749 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_is_common_action()
1785 /*0: no change, +1: increase WiFi duration, -1: decrease WiFi duration*/ in btc8723b2ant_tdma_duration_adjust()
1787 u8 retry_count = 0; in btc8723b2ant_tdma_duration_adjust()
1890 up = 0; in btc8723b2ant_tdma_duration_adjust()
1891 dn = 0; in btc8723b2ant_tdma_duration_adjust()
1894 result = 0; in btc8723b2ant_tdma_duration_adjust()
1895 wait_count = 0; in btc8723b2ant_tdma_duration_adjust()
1909 result = 0; in btc8723b2ant_tdma_duration_adjust()
1912 if (retry_count == 0) { in btc8723b2ant_tdma_duration_adjust()
1916 if (dn <= 0) in btc8723b2ant_tdma_duration_adjust()
1917 dn = 0; in btc8723b2ant_tdma_duration_adjust()
1921 * seconds is 0, enlarge WiFi duration in btc8723b2ant_tdma_duration_adjust()
1923 wait_count = 0; in btc8723b2ant_tdma_duration_adjust()
1925 up = 0; in btc8723b2ant_tdma_duration_adjust()
1926 dn = 0; in btc8723b2ant_tdma_duration_adjust()
1935 if (up <= 0) in btc8723b2ant_tdma_duration_adjust()
1936 up = 0; in btc8723b2ant_tdma_duration_adjust()
1940 * seconds) >0 and < 3, reduce WiFi duration in btc8723b2ant_tdma_duration_adjust()
1956 up = 0; in btc8723b2ant_tdma_duration_adjust()
1957 dn = 0; in btc8723b2ant_tdma_duration_adjust()
1958 wait_count = 0; in btc8723b2ant_tdma_duration_adjust()
1981 up = 0; in btc8723b2ant_tdma_duration_adjust()
1982 dn = 0; in btc8723b2ant_tdma_duration_adjust()
1983 wait_count = 0; in btc8723b2ant_tdma_duration_adjust()
2770 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0); in btc8723b2ant_action_sco()
2774 0); in btc8723b2ant_action_sco()
2776 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); in btc8723b2ant_action_sco()
2778 btc8723b2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8); in btc8723b2ant_action_sco()
2784 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_sco()
2796 btc8723b2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 0); in btc8723b2ant_action_sco()
2815 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0); in btc8723b2ant_action_hid()
2816 bt_rssi_state = btc8723b2ant_bt_rssi_state(btcoexist, 2, tmp, 0); in btc8723b2ant_action_hid()
2818 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); in btc8723b2ant_action_hid()
2820 btc8723b2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8); in btc8723b2ant_action_hid()
2826 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_hid()
2837 btc8723b2ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); in btc8723b2ant_action_hid()
2857 u8 ap_num = 0; in btc8723b2ant_action_a2dp()
2861 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0); in btc8723b2ant_action_a2dp()
2862 wifi_rssi_state1 = btc8723b2ant_wifi_rssi_state(btcoexist, 1, 2, 40, 0); in btc8723b2ant_action_a2dp()
2863 bt_rssi_state = btc8723b2ant_bt_rssi_state(btcoexist, 2, tmp, 0); in btc8723b2ant_action_a2dp()
2870 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, in btc8723b2ant_action_a2dp()
2871 0x0); in btc8723b2ant_action_a2dp()
2874 btc8723b2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_a2dp()
2889 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); in btc8723b2ant_action_a2dp()
2890 btc8723b2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8); in btc8723b2ant_action_a2dp()
2897 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_a2dp()
2902 0x0, 0x0); in btc8723b2ant_action_a2dp()
2905 btc8723b2ant_power_save_state(btcoexist, BTC_PS_LPS_ON, 0x50, in btc8723b2ant_action_a2dp()
2906 0x4); in btc8723b2ant_action_a2dp()
2934 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0); in btc8723b2ant_action_a2dp_pan_hs()
2936 tmp, 0); in btc8723b2ant_action_a2dp_pan_hs()
2939 bt_rssi_state = btc8723b2ant_bt_rssi_state(btcoexist, 2, tmp, 0); in btc8723b2ant_action_a2dp_pan_hs()
2941 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); in btc8723b2ant_action_a2dp_pan_hs()
2943 btc8723b2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8); in btc8723b2ant_action_a2dp_pan_hs()
2949 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_a2dp_pan_hs()
2954 0x0, 0x0); in btc8723b2ant_action_a2dp_pan_hs()
2957 btc8723b2ant_power_save_state(btcoexist, BTC_PS_LPS_ON, 0x50, in btc8723b2ant_action_a2dp_pan_hs()
2958 0x4); in btc8723b2ant_action_a2dp_pan_hs()
2981 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0); in btc8723b2ant_action_pan_edr()
2983 tmp, 0); in btc8723b2ant_action_pan_edr()
2986 bt_rssi_state = btc8723b2ant_bt_rssi_state(btcoexist, 2, tmp, 0); in btc8723b2ant_action_pan_edr()
2988 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); in btc8723b2ant_action_pan_edr()
2990 btc8723b2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8); in btc8723b2ant_action_pan_edr()
2996 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_pan_edr()
3001 0x0, 0x0); in btc8723b2ant_action_pan_edr()
3004 btc8723b2ant_power_save_state(btcoexist, BTC_PS_LPS_ON, 0x50, in btc8723b2ant_action_pan_edr()
3005 0x4); in btc8723b2ant_action_pan_edr()
3033 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0); in btc8723b2ant_action_pan_hs()
3035 tmp, 0); in btc8723b2ant_action_pan_hs()
3038 bt_rssi_state = btc8723b2ant_bt_rssi_state(btcoexist, 2, tmp, 0); in btc8723b2ant_action_pan_hs()
3040 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); in btc8723b2ant_action_pan_hs()
3042 btc8723b2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8); in btc8723b2ant_action_pan_hs()
3048 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_pan_hs()
3071 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0); in btc8723b2ant_action_pan_edr_a2dp()
3073 tmp, 0); in btc8723b2ant_action_pan_edr_a2dp()
3076 bt_rssi_state = btc8723b2ant_bt_rssi_state(btcoexist, 2, tmp, 0); in btc8723b2ant_action_pan_edr_a2dp()
3078 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); in btc8723b2ant_action_pan_edr_a2dp()
3085 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_pan_edr_a2dp()
3089 0x0, 0x0); in btc8723b2ant_action_pan_edr_a2dp()
3091 btc8723b2ant_power_save_state(btcoexist, BTC_PS_LPS_ON, 0x50, in btc8723b2ant_action_pan_edr_a2dp()
3092 0x4); in btc8723b2ant_action_pan_edr_a2dp()
3126 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0); in btc8723b2ant_action_pan_edr_hid()
3128 tmp, 0); in btc8723b2ant_action_pan_edr_hid()
3131 bt_rssi_state = btc8723b2ant_bt_rssi_state(btcoexist, 2, tmp, 0); in btc8723b2ant_action_pan_edr_hid()
3134 btc8723b2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8); in btc8723b2ant_action_pan_edr_hid()
3139 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_pan_edr_hid()
3144 0x0, 0x0); in btc8723b2ant_action_pan_edr_hid()
3147 btc8723b2ant_power_save_state(btcoexist, BTC_PS_LPS_ON, 0x50, in btc8723b2ant_action_pan_edr_hid()
3148 0x4); in btc8723b2ant_action_pan_edr_hid()
3156 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, in btc8723b2ant_action_pan_edr_hid()
3157 0xfffff, 0x780); in btc8723b2ant_action_pan_edr_hid()
3161 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, in btc8723b2ant_action_pan_edr_hid()
3162 0xfffff, 0x0); in btc8723b2ant_action_pan_edr_hid()
3167 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, in btc8723b2ant_action_pan_edr_hid()
3168 0x0); in btc8723b2ant_action_pan_edr_hid()
3190 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0); in btc8723b2ant_action_hid_a2dp_pan_edr()
3192 tmp, 0); in btc8723b2ant_action_hid_a2dp_pan_edr()
3195 bt_rssi_state = btc8723b2ant_bt_rssi_state(btcoexist, 2, tmp, 0); in btc8723b2ant_action_hid_a2dp_pan_edr()
3197 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); in btc8723b2ant_action_hid_a2dp_pan_edr()
3199 btc8723b2ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 0x8); in btc8723b2ant_action_hid_a2dp_pan_edr()
3205 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_hid_a2dp_pan_edr()
3210 0x0, 0x0); in btc8723b2ant_action_hid_a2dp_pan_edr()
3213 btc8723b2ant_power_save_state(btcoexist, BTC_PS_LPS_ON, 0x50, in btc8723b2ant_action_hid_a2dp_pan_edr()
3214 0x4); in btc8723b2ant_action_hid_a2dp_pan_edr()
3246 u8 ap_num = 0; in btc8723b2ant_action_hid_a2dp()
3250 btc8723b2ant_wifi_rssi_state(btcoexist, 0, 2, 15, 0); in btc8723b2ant_action_hid_a2dp()
3252 tmp, 0); in btc8723b2ant_action_hid_a2dp()
3257 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); in btc8723b2ant_action_hid_a2dp()
3259 btc8723b2ant_limited_rx(btcoexist, NORMAL_EXEC, false, true, 0x5); in btc8723b2ant_action_hid_a2dp()
3270 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_hid_a2dp()
3284 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_hid_a2dp()
3291 0x0, 0x0); in btc8723b2ant_action_hid_a2dp()
3294 btc8723b2ant_power_save_state(btcoexist, BTC_PS_LPS_ON, 0x50, in btc8723b2ant_action_hid_a2dp()
3295 0x4); in btc8723b2ant_action_hid_a2dp()
3307 btcoexist->btc_write_1byte(btcoexist, 0x456, 0x38); in btc8723b2ant_action_hid_a2dp()
3308 btcoexist->btc_write_2byte(btcoexist, 0x42a, 0x0808); in btc8723b2ant_action_hid_a2dp()
3309 btcoexist->btc_write_4byte(btcoexist, 0x430, 0x0); in btc8723b2ant_action_hid_a2dp()
3310 btcoexist->btc_write_4byte(btcoexist, 0x434, 0x01010000); in btc8723b2ant_action_hid_a2dp()
3333 btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_wifi_multi_port()
3339 btc8723b2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0); in btc8723b2ant_action_wifi_multi_port()
3341 btc8723b2ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); in btc8723b2ant_action_wifi_multi_port()
3348 u8 algorithm = 0; in btc8723b2ant_run_coexist_mechanism()
3349 u32 num_of_wifi_link = 0; in btc8723b2ant_run_coexist_mechanism()
3350 u32 wifi_link_status = 0; in btc8723b2ant_run_coexist_mechanism()
3398 "############# [BTCoex], Multi-Port num_of_wifi_link = %d, wifi_link_status = 0x%x\n", in btc8723b2ant_run_coexist_mechanism()
3498 u8 h2c_parameter[2] = {0}; in btc8723b2ant_wifioff_hwcfg()
3499 u32 fw_ver = 0; in btc8723b2ant_wifioff_hwcfg()
3502 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0x4); in btc8723b2ant_wifioff_hwcfg()
3504 /* WiFi standby while GNT_BT 0 -> 1 */ in btc8723b2ant_wifioff_hwcfg()
3505 btcoexist->btc_set_rf_reg(btcoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); in btc8723b2ant_wifioff_hwcfg()
3508 if (fw_ver >= 0x180000) { in btc8723b2ant_wifioff_hwcfg()
3510 h2c_parameter[0] = 1; in btc8723b2ant_wifioff_hwcfg()
3511 btcoexist->btc_fill_h2c(btcoexist, 0x6E, 1, h2c_parameter); in btc8723b2ant_wifioff_hwcfg()
3513 btcoexist->btc_write_1byte(btcoexist, 0x765, 0x18); in btc8723b2ant_wifioff_hwcfg()
3520 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x67, 0x20, 0x0); in btc8723b2ant_wifioff_hwcfg()
3523 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x67, 0x20, 0x1); in btc8723b2ant_wifioff_hwcfg()
3532 u8 u8tmp = 0; in ex_btc8723b2ant_init_hwconfig()
3537 btcoexist->btc_get_rf_reg(btcoexist, BTC_RF_A, 0x1e, 0xfffff); in ex_btc8723b2ant_init_hwconfig()
3539 /* 0x790[5:0] = 0x5 */ in ex_btc8723b2ant_init_hwconfig()
3540 u8tmp = btcoexist->btc_read_1byte(btcoexist, 0x790); in ex_btc8723b2ant_init_hwconfig()
3541 u8tmp &= 0xc0; in ex_btc8723b2ant_init_hwconfig()
3542 u8tmp |= 0x5; in ex_btc8723b2ant_init_hwconfig()
3543 btcoexist->btc_write_1byte(btcoexist, 0x790, u8tmp); in ex_btc8723b2ant_init_hwconfig()
3548 coex_sta->dis_ver_info_cnt = 0; in ex_btc8723b2ant_init_hwconfig()
3551 btc8723b2ant_coex_table_with_type(btcoexist, FORCE_EXEC, 0); in ex_btc8723b2ant_init_hwconfig()
3554 /* 0x76e[3] = 1, WLAN_ACT controlled by PTA */ in ex_btc8723b2ant_init_hwconfig()
3555 btcoexist->btc_write_1byte(btcoexist, 0x76e, 0x4); in ex_btc8723b2ant_init_hwconfig()
3556 btcoexist->btc_write_1byte(btcoexist, 0x778, 0x3); in ex_btc8723b2ant_init_hwconfig()
3557 btcoexist->btc_write_1byte_bitmask(btcoexist, 0x40, 0x20, 0x1); in ex_btc8723b2ant_init_hwconfig()
3564 u16 u16tmp = 0x0; in ex_btc8723b2ant_power_on_setting()
3565 u32 value = 0; in ex_btc8723b2ant_power_on_setting()
3567 btcoexist->btc_write_1byte(btcoexist, 0x67, 0x20); in ex_btc8723b2ant_power_on_setting()
3569 /* enable BB, REG_SYS_FUNC_EN such that we can write 0x948 correctly */ in ex_btc8723b2ant_power_on_setting()
3570 u16tmp = btcoexist->btc_read_2byte(btcoexist, 0x2); in ex_btc8723b2ant_power_on_setting()
3571 btcoexist->btc_write_2byte(btcoexist, 0x2, u16tmp | BIT0 | BIT1); in ex_btc8723b2ant_power_on_setting()
3573 btcoexist->btc_write_4byte(btcoexist, 0x948, 0x0); in ex_btc8723b2ant_power_on_setting()
3579 /* for PCIE and SDIO interface, we check efuse 0xc3[6] */ in ex_btc8723b2ant_power_on_setting()
3580 if (board_info->single_ant_path == 0) { in ex_btc8723b2ant_power_on_setting()
3595 u8 u8tmp = 0x4; /* Set BIT2 by default since it's 2ant case */ in ex_btc8723b2ant_pre_load_firmware()
3602 * BIT0: "0" : no antenna inverse; "1" : antenna inverse in ex_btc8723b2ant_pre_load_firmware()
3603 * BIT1: "0" : internal switch; "1" : external switch in ex_btc8723b2ant_pre_load_firmware()
3604 * BIT2: "0" : one antenna; "1" : two antennas in ex_btc8723b2ant_pre_load_firmware()
3606 * NOTE: here default all internal switch and 1-antenna ==> BIT1=0 and in ex_btc8723b2ant_pre_load_firmware()
3607 * BIT2 = 0 in ex_btc8723b2ant_pre_load_firmware()
3611 u8tmp |= 0x1; /* antenna inverse */ in ex_btc8723b2ant_pre_load_firmware()
3612 btcoexist->btc_write_local_reg_1byte(btcoexist, 0xfe08, u8tmp); in ex_btc8723b2ant_pre_load_firmware()
3614 /* for PCIE and SDIO interface, we check efuse 0xc3[6] */ in ex_btc8723b2ant_pre_load_firmware()
3615 if (board_info->single_ant_path == 0) { in ex_btc8723b2ant_pre_load_firmware()
3618 u8tmp |= 0x1; /* antenna inverse */ in ex_btc8723b2ant_pre_load_firmware()
3622 btcoexist->btc_write_local_reg_1byte(btcoexist, 0x384, in ex_btc8723b2ant_pre_load_firmware()
3625 btcoexist->btc_write_local_reg_1byte(btcoexist, 0x60, in ex_btc8723b2ant_pre_load_firmware()
3645 u8 u8tmp[4], i, bt_info_ext, ps_tdma_case = 0; in ex_btc8723b2ant_display_coex_info()
3650 s32 wifi_rssi = 0, bt_hs_rssi = 0; in ex_btc8723b2ant_display_coex_info()
3653 u32 fw_ver = 0, bt_patch_ver = 0; in ex_btc8723b2ant_display_coex_info()
3654 u8 ap_num = 0; in ex_btc8723b2ant_display_coex_info()
3674 seq_printf(m, "\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)", in ex_btc8723b2ant_display_coex_info()
3727 for (i = 0; i < BT_INFO_SRC_8723B_2ANT_MAX; i++) { in ex_btc8723b2ant_display_coex_info()
3748 seq_printf(m, "\n %-35s = %d/ %d/ %d(0x%x) ", in ex_btc8723b2ant_display_coex_info()
3770 seq_printf(m, "\n %-35s = 0x%x", in ex_btc8723b2ant_display_coex_info()
3771 "RF-A, 0x1e initVal", coex_dm->bt_rf0x1e_backup); in ex_btc8723b2ant_display_coex_info()
3773 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x778); in ex_btc8723b2ant_display_coex_info()
3774 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x880); in ex_btc8723b2ant_display_coex_info()
3775 seq_printf(m, "\n %-35s = 0x%x/ 0x%x", in ex_btc8723b2ant_display_coex_info()
3776 "0x778/0x880[29:25]", u8tmp[0], in ex_btc8723b2ant_display_coex_info()
3777 (u32tmp[0] & 0x3e000000) >> 25); in ex_btc8723b2ant_display_coex_info()
3779 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x948); in ex_btc8723b2ant_display_coex_info()
3780 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x67); in ex_btc8723b2ant_display_coex_info()
3781 u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x765); in ex_btc8723b2ant_display_coex_info()
3782 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x", in ex_btc8723b2ant_display_coex_info()
3783 "0x948/ 0x67[5] / 0x765", in ex_btc8723b2ant_display_coex_info()
3784 u32tmp[0], ((u8tmp[0] & 0x20) >> 5), u8tmp[1]); in ex_btc8723b2ant_display_coex_info()
3786 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x92c); in ex_btc8723b2ant_display_coex_info()
3787 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x930); in ex_btc8723b2ant_display_coex_info()
3788 u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x944); in ex_btc8723b2ant_display_coex_info()
3789 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x", in ex_btc8723b2ant_display_coex_info()
3790 "0x92c[1:0]/ 0x930[7:0]/0x944[1:0]", in ex_btc8723b2ant_display_coex_info()
3791 u32tmp[0] & 0x3, u32tmp[1] & 0xff, u32tmp[2] & 0x3); in ex_btc8723b2ant_display_coex_info()
3793 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x39); in ex_btc8723b2ant_display_coex_info()
3794 u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0x40); in ex_btc8723b2ant_display_coex_info()
3795 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x4c); in ex_btc8723b2ant_display_coex_info()
3796 u8tmp[2] = btcoexist->btc_read_1byte(btcoexist, 0x64); in ex_btc8723b2ant_display_coex_info()
3797 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", in ex_btc8723b2ant_display_coex_info()
3798 "0x38[11]/0x40/0x4c[24:23]/0x64[0]", in ex_btc8723b2ant_display_coex_info()
3799 ((u8tmp[0] & 0x8) >> 3), u8tmp[1], in ex_btc8723b2ant_display_coex_info()
3800 ((u32tmp[0] & 0x01800000) >> 23), u8tmp[2] & 0x1); in ex_btc8723b2ant_display_coex_info()
3802 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x550); in ex_btc8723b2ant_display_coex_info()
3803 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x522); in ex_btc8723b2ant_display_coex_info()
3804 seq_printf(m, "\n %-35s = 0x%x/ 0x%x", in ex_btc8723b2ant_display_coex_info()
3805 "0x550(bcn ctrl)/0x522", u32tmp[0], u8tmp[0]); in ex_btc8723b2ant_display_coex_info()
3807 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xc50); in ex_btc8723b2ant_display_coex_info()
3808 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x49c); in ex_btc8723b2ant_display_coex_info()
3809 seq_printf(m, "\n %-35s = 0x%x/ 0x%x", in ex_btc8723b2ant_display_coex_info()
3810 "0xc50(dig)/0x49c(null-drop)", u32tmp[0] & 0xff, u8tmp[0]); in ex_btc8723b2ant_display_coex_info()
3812 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0xda0); in ex_btc8723b2ant_display_coex_info()
3813 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0xda4); in ex_btc8723b2ant_display_coex_info()
3814 u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0xda8); in ex_btc8723b2ant_display_coex_info()
3815 u32tmp[3] = btcoexist->btc_read_4byte(btcoexist, 0xcf0); in ex_btc8723b2ant_display_coex_info()
3817 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0xa5b); in ex_btc8723b2ant_display_coex_info()
3818 u8tmp[1] = btcoexist->btc_read_1byte(btcoexist, 0xa5c); in ex_btc8723b2ant_display_coex_info()
3820 fa_ofdm = ((u32tmp[0]&0xffff0000) >> 16) + in ex_btc8723b2ant_display_coex_info()
3821 ((u32tmp[1]&0xffff0000) >> 16) + in ex_btc8723b2ant_display_coex_info()
3822 (u32tmp[1] & 0xffff) + in ex_btc8723b2ant_display_coex_info()
3823 (u32tmp[2] & 0xffff) + in ex_btc8723b2ant_display_coex_info()
3824 ((u32tmp[3]&0xffff0000) >> 16) + in ex_btc8723b2ant_display_coex_info()
3825 (u32tmp[3] & 0xffff); in ex_btc8723b2ant_display_coex_info()
3826 fa_cck = (u8tmp[0] << 8) + u8tmp[1]; in ex_btc8723b2ant_display_coex_info()
3828 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x", in ex_btc8723b2ant_display_coex_info()
3830 u32tmp[0] & 0xffff, fa_ofdm, fa_cck); in ex_btc8723b2ant_display_coex_info()
3832 u32tmp[0] = btcoexist->btc_read_4byte(btcoexist, 0x6c0); in ex_btc8723b2ant_display_coex_info()
3833 u32tmp[1] = btcoexist->btc_read_4byte(btcoexist, 0x6c4); in ex_btc8723b2ant_display_coex_info()
3834 u32tmp[2] = btcoexist->btc_read_4byte(btcoexist, 0x6c8); in ex_btc8723b2ant_display_coex_info()
3835 u8tmp[0] = btcoexist->btc_read_1byte(btcoexist, 0x6cc); in ex_btc8723b2ant_display_coex_info()
3836 seq_printf(m, "\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", in ex_btc8723b2ant_display_coex_info()
3837 "0x6c0/0x6c4/0x6c8/0x6cc(coexTable)", in ex_btc8723b2ant_display_coex_info()
3838 u32tmp[0], u32tmp[1], u32tmp[2], u8tmp[0]); in ex_btc8723b2ant_display_coex_info()
3841 "0x770(high-pri rx/tx)", in ex_btc8723b2ant_display_coex_info()
3844 "0x774(low-pri rx/tx)", coex_sta->low_priority_rx, in ex_btc8723b2ant_display_coex_info()
3893 u32tmp = btcoexist->btc_read_4byte(btcoexist, 0x948); in ex_btc8723b2ant_scan_notify()
3894 u8tmpa = btcoexist->btc_read_1byte(btcoexist, 0x765); in ex_btc8723b2ant_scan_notify()
3895 u8tmpb = btcoexist->btc_read_1byte(btcoexist, 0x76e); in ex_btc8723b2ant_scan_notify()
3907 "############# [BTCoex], 0x948=0x%x, 0x765=0x%x, 0x76e=0x%x\n", in ex_btc8723b2ant_scan_notify()
3927 u8 h2c_parameter[3] = {0}; in ex_btc8723b2ant_media_status_notify()
3930 u8 ap_num = 0; in ex_btc8723b2ant_media_status_notify()
3944 h2c_parameter[0] = 0x1; in ex_btc8723b2ant_media_status_notify()
3949 h2c_parameter[2] = 0x30; in ex_btc8723b2ant_media_status_notify()
3954 h2c_parameter[2] = 0x30; in ex_btc8723b2ant_media_status_notify()
3956 h2c_parameter[2] = 0x20; in ex_btc8723b2ant_media_status_notify()
3960 coex_dm->wifi_chnl_info[0] = h2c_parameter[0]; in ex_btc8723b2ant_media_status_notify()
3965 "[BTCoex], FW write 0x66=0x%x\n", in ex_btc8723b2ant_media_status_notify()
3966 h2c_parameter[0] << 16 | h2c_parameter[1] << 8 | in ex_btc8723b2ant_media_status_notify()
3969 btcoexist->btc_fill_h2c(btcoexist, 0x66, 3, h2c_parameter); in ex_btc8723b2ant_media_status_notify()
3986 u8 bt_info = 0; in ex_btc8723b2ant_bt_info_notify()
3987 u8 i, rsp_source = 0; in ex_btc8723b2ant_bt_info_notify()
3993 rsp_source = tmpbuf[0]&0xf; in ex_btc8723b2ant_bt_info_notify()
4001 for (i = 0; i < length; i++) { in ex_btc8723b2ant_bt_info_notify()
4007 "0x%02x]\n", tmpbuf[i]); in ex_btc8723b2ant_bt_info_notify()
4010 "0x%02x, ", tmpbuf[i]); in ex_btc8723b2ant_bt_info_notify()
4021 coex_sta->bt_info_c2h[rsp_source][2] & 0xf; in ex_btc8723b2ant_bt_info_notify()
4031 if (coex_sta->bt_info_c2h[rsp_source][2] & 0x20) in ex_btc8723b2ant_bt_info_notify()
4036 if (coex_sta->bt_info_c2h[rsp_source][1] == 0x49) in ex_btc8723b2ant_bt_info_notify()
4040 coex_sta->a2dp_bit_pool = 0; in ex_btc8723b2ant_bt_info_notify()
4114 bt_info = bt_info | 0x28; in ex_btc8723b2ant_bt_info_notify()
4212 /* Antenna config to set 0x765 = 0x0 (GNT_BT control by in ex_btc8723b2ant_periodical()