Lines Matching refs:coex_stat

40 	struct rtw_coex_stat *coex_stat = &coex->stat;  in rtw_coex_limited_tx()  local
47 if (coex_stat->wl_tx_limit_en == tx_limit_en && in rtw_coex_limited_tx()
48 coex_stat->wl_ampdu_limit_en == ampdu_limit_en) in rtw_coex_limited_tx()
51 if (!coex_stat->wl_tx_limit_en) { in rtw_coex_limited_tx()
52 coex_stat->darfrc = rtw_read32(rtwdev, REG_DARFRC); in rtw_coex_limited_tx()
53 coex_stat->darfrch = rtw_read32(rtwdev, REG_DARFRCH); in rtw_coex_limited_tx()
54 coex_stat->retry_limit = rtw_read16(rtwdev, REG_RETRY_LIMIT); in rtw_coex_limited_tx()
57 if (!coex_stat->wl_ampdu_limit_en) in rtw_coex_limited_tx()
58 coex_stat->ampdu_max_time = in rtw_coex_limited_tx()
61 coex_stat->wl_tx_limit_en = tx_limit_en; in rtw_coex_limited_tx()
62 coex_stat->wl_ampdu_limit_en = ampdu_limit_en; in rtw_coex_limited_tx()
88 rtw_write16(rtwdev, REG_RETRY_LIMIT, coex_stat->retry_limit); in rtw_coex_limited_tx()
89 rtw_write32(rtwdev, REG_DARFRC, coex_stat->darfrc); in rtw_coex_limited_tx()
90 rtw_write32(rtwdev, REG_DARFRCH, coex_stat->darfrch); in rtw_coex_limited_tx()
97 coex_stat->ampdu_max_time); in rtw_coex_limited_tx()
104 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_limited_wl() local
113 if (coex_stat->bt_hid_exist || coex_stat->bt_hfp_exist || in rtw_coex_limited_wl()
114 coex_stat->bt_hid_pair_num > 0) in rtw_coex_limited_wl()
124 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_wl_ccklock_action() local
132 if (coex_stat->tdma_timer_base == 3 && coex_stat->wl_slot_extend) { in rtw_coex_wl_ccklock_action()
135 coex_stat->wl_slot_extend = false; in rtw_coex_wl_ccklock_action()
136 coex_stat->cnt_wl[COEX_CNT_WL_5MS_NOEXTEND] = 0; in rtw_coex_wl_ccklock_action()
140 if (coex_stat->wl_slot_extend && coex_stat->wl_force_lps_ctrl && in rtw_coex_wl_ccklock_action()
141 !coex_stat->wl_cck_lock_ever) { in rtw_coex_wl_ccklock_action()
142 if (coex_stat->wl_fw_dbg_info[7] <= 5) in rtw_coex_wl_ccklock_action()
143 coex_stat->cnt_wl[COEX_CNT_WL_5MS_NOEXTEND]++; in rtw_coex_wl_ccklock_action()
145 coex_stat->cnt_wl[COEX_CNT_WL_5MS_NOEXTEND] = 0; in rtw_coex_wl_ccklock_action()
147 if (coex_stat->cnt_wl[COEX_CNT_WL_5MS_NOEXTEND] == 7) { in rtw_coex_wl_ccklock_action()
150 coex_stat->wl_slot_extend = false; in rtw_coex_wl_ccklock_action()
151 coex_stat->cnt_wl[COEX_CNT_WL_5MS_NOEXTEND] = 0; in rtw_coex_wl_ccklock_action()
153 } else if (!coex_stat->wl_slot_extend && coex_stat->wl_cck_lock) { in rtw_coex_wl_ccklock_action()
156 coex_stat->wl_slot_extend = true; in rtw_coex_wl_ccklock_action()
163 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_wl_ccklock_detect() local
166 coex_stat->wl_cck_lock = false; in rtw_coex_wl_ccklock_detect()
167 coex_stat->wl_cck_lock_pre = false; in rtw_coex_wl_ccklock_detect()
168 coex_stat->wl_cck_lock_ever = false; in rtw_coex_wl_ccklock_detect()
174 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_wl_noisy_detect() local
181 if (!coex_stat->wl_gl_busy) { in rtw_coex_wl_noisy_detect()
183 if (coex_stat->cnt_wl[COEX_CNT_WL_NOISY2] < 5) in rtw_coex_wl_noisy_detect()
184 coex_stat->cnt_wl[COEX_CNT_WL_NOISY2]++; in rtw_coex_wl_noisy_detect()
186 if (coex_stat->cnt_wl[COEX_CNT_WL_NOISY2] == 5) { in rtw_coex_wl_noisy_detect()
187 coex_stat->cnt_wl[COEX_CNT_WL_NOISY0] = 0; in rtw_coex_wl_noisy_detect()
188 coex_stat->cnt_wl[COEX_CNT_WL_NOISY1] = 0; in rtw_coex_wl_noisy_detect()
191 if (coex_stat->cnt_wl[COEX_CNT_WL_NOISY0] < 5) in rtw_coex_wl_noisy_detect()
192 coex_stat->cnt_wl[COEX_CNT_WL_NOISY0]++; in rtw_coex_wl_noisy_detect()
194 if (coex_stat->cnt_wl[COEX_CNT_WL_NOISY0] == 5) { in rtw_coex_wl_noisy_detect()
195 coex_stat->cnt_wl[COEX_CNT_WL_NOISY1] = 0; in rtw_coex_wl_noisy_detect()
196 coex_stat->cnt_wl[COEX_CNT_WL_NOISY2] = 0; in rtw_coex_wl_noisy_detect()
199 if (coex_stat->cnt_wl[COEX_CNT_WL_NOISY1] < 5) in rtw_coex_wl_noisy_detect()
200 coex_stat->cnt_wl[COEX_CNT_WL_NOISY1]++; in rtw_coex_wl_noisy_detect()
202 if (coex_stat->cnt_wl[COEX_CNT_WL_NOISY1] == 5) { in rtw_coex_wl_noisy_detect()
203 coex_stat->cnt_wl[COEX_CNT_WL_NOISY0] = 0; in rtw_coex_wl_noisy_detect()
204 coex_stat->cnt_wl[COEX_CNT_WL_NOISY2] = 0; in rtw_coex_wl_noisy_detect()
208 if (coex_stat->cnt_wl[COEX_CNT_WL_NOISY2] == 5) in rtw_coex_wl_noisy_detect()
209 coex_stat->wl_noisy_level = 2; in rtw_coex_wl_noisy_detect()
210 else if (coex_stat->cnt_wl[COEX_CNT_WL_NOISY1] == 5) in rtw_coex_wl_noisy_detect()
211 coex_stat->wl_noisy_level = 1; in rtw_coex_wl_noisy_detect()
213 coex_stat->wl_noisy_level = 0; in rtw_coex_wl_noisy_detect()
220 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_tdma_timer_base() local
223 if (coex_stat->tdma_timer_base == type) in rtw_coex_tdma_timer_base()
226 coex_stat->tdma_timer_base = type; in rtw_coex_tdma_timer_base()
238 if (coex_stat->tdma_timer_base == 3) in rtw_coex_tdma_timer_base()
257 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_write_scbd() local
263 val |= coex_stat->score_board; in rtw_coex_write_scbd()
280 if (val != coex_stat->score_board) { in rtw_coex_write_scbd()
281 coex_stat->score_board = val; in rtw_coex_write_scbd()
301 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_check_rfk() local
308 coex_stat->bt_iqk_state != 0xff) { in rtw_coex_check_rfk()
324 coex_stat->bt_iqk_state = 0xff; in rtw_coex_check_rfk()
331 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_query_bt_info() local
333 if (coex_stat->bt_disabled) in rtw_coex_query_bt_info()
343 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_monitor_bt_enable() local
353 if (coex_stat->bt_disabled != bt_disabled) { in rtw_coex_monitor_bt_enable()
355 coex_stat->bt_disabled, bt_disabled); in rtw_coex_monitor_bt_enable()
357 coex_stat->bt_disabled = bt_disabled; in rtw_coex_monitor_bt_enable()
358 coex_stat->bt_ble_scan_type = 0; in rtw_coex_monitor_bt_enable()
362 if (!coex_stat->bt_disabled) { in rtw_coex_monitor_bt_enable()
363 coex_stat->bt_reenable = true; in rtw_coex_monitor_bt_enable()
367 coex_stat->bt_mailbox_reply = false; in rtw_coex_monitor_bt_enable()
368 coex_stat->bt_reenable = false; in rtw_coex_monitor_bt_enable()
375 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_update_wl_link_info() local
387 coex_stat->wl_connected = !!rtwdev->sta_cnt; in rtw_coex_update_wl_link_info()
388 coex_stat->wl_gl_busy = rtw_flag_check(rtwdev, RTW_FLAG_BUSY_TRAFFIC); in rtw_coex_update_wl_link_info()
391 coex_stat->wl_tput_dir = COEX_WL_TPUT_TX; in rtw_coex_update_wl_link_info()
393 coex_stat->wl_tput_dir = COEX_WL_TPUT_RX; in rtw_coex_update_wl_link_info()
397 coex_stat->wl_linkscan_proc = true; in rtw_coex_update_wl_link_info()
399 coex_stat->wl_linkscan_proc = false; in rtw_coex_update_wl_link_info()
530 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_update_bt_link_info() local
542 rssi = coex_stat->bt_rssi; in rtw_coex_update_bt_link_info()
557 if (coex_stat->bt_ble_scan_en && in rtw_coex_update_bt_link_info()
558 coex_stat->cnt_bt[COEX_CNT_BT_INFOUPDATE] % 3 == 0) { in rtw_coex_update_bt_link_info()
562 coex_stat->bt_ble_scan_type = scan_type; in rtw_coex_update_bt_link_info()
563 if ((coex_stat->bt_ble_scan_type & 0x1) == 0x1) in rtw_coex_update_bt_link_info()
564 coex_stat->bt_init_scan = true; in rtw_coex_update_bt_link_info()
566 coex_stat->bt_init_scan = false; in rtw_coex_update_bt_link_info()
570 coex_stat->bt_profile_num = 0; in rtw_coex_update_bt_link_info()
573 if (!(coex_stat->bt_info_lb2 & COEX_INFO_CONNECTION)) { in rtw_coex_update_bt_link_info()
574 coex_stat->bt_link_exist = false; in rtw_coex_update_bt_link_info()
575 coex_stat->bt_pan_exist = false; in rtw_coex_update_bt_link_info()
576 coex_stat->bt_a2dp_exist = false; in rtw_coex_update_bt_link_info()
577 coex_stat->bt_hid_exist = false; in rtw_coex_update_bt_link_info()
578 coex_stat->bt_hfp_exist = false; in rtw_coex_update_bt_link_info()
581 coex_stat->bt_link_exist = true; in rtw_coex_update_bt_link_info()
582 if (coex_stat->bt_info_lb2 & COEX_INFO_FTP) { in rtw_coex_update_bt_link_info()
583 coex_stat->bt_pan_exist = true; in rtw_coex_update_bt_link_info()
584 coex_stat->bt_profile_num++; in rtw_coex_update_bt_link_info()
586 coex_stat->bt_pan_exist = false; in rtw_coex_update_bt_link_info()
589 if (coex_stat->bt_info_lb2 & COEX_INFO_A2DP) { in rtw_coex_update_bt_link_info()
590 coex_stat->bt_a2dp_exist = true; in rtw_coex_update_bt_link_info()
591 coex_stat->bt_profile_num++; in rtw_coex_update_bt_link_info()
593 coex_stat->bt_a2dp_exist = false; in rtw_coex_update_bt_link_info()
596 if (coex_stat->bt_info_lb2 & COEX_INFO_HID) { in rtw_coex_update_bt_link_info()
597 coex_stat->bt_hid_exist = true; in rtw_coex_update_bt_link_info()
598 coex_stat->bt_profile_num++; in rtw_coex_update_bt_link_info()
600 coex_stat->bt_hid_exist = false; in rtw_coex_update_bt_link_info()
603 if (coex_stat->bt_info_lb2 & COEX_INFO_SCO_ESCO) { in rtw_coex_update_bt_link_info()
604 coex_stat->bt_hfp_exist = true; in rtw_coex_update_bt_link_info()
605 coex_stat->bt_profile_num++; in rtw_coex_update_bt_link_info()
607 coex_stat->bt_hfp_exist = false; in rtw_coex_update_bt_link_info()
611 if (coex_stat->bt_info_lb2 & COEX_INFO_INQ_PAGE) { in rtw_coex_update_bt_link_info()
613 } else if (!(coex_stat->bt_info_lb2 & COEX_INFO_CONNECTION)) { in rtw_coex_update_bt_link_info()
615 } else if (coex_stat->bt_info_lb2 == COEX_INFO_CONNECTION) { in rtw_coex_update_bt_link_info()
617 } else if ((coex_stat->bt_info_lb2 & COEX_INFO_SCO_ESCO) || in rtw_coex_update_bt_link_info()
618 (coex_stat->bt_info_lb2 & COEX_INFO_SCO_BUSY)) { in rtw_coex_update_bt_link_info()
619 if (coex_stat->bt_info_lb2 & COEX_INFO_ACL_BUSY) in rtw_coex_update_bt_link_info()
623 } else if (coex_stat->bt_info_lb2 & COEX_INFO_ACL_BUSY) { in rtw_coex_update_bt_link_info()
629 coex_stat->cnt_bt[COEX_CNT_BT_INFOUPDATE]++; in rtw_coex_update_bt_link_info()
712 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_set_rf_para() local
715 if (coex->freerun && coex_stat->wl_noisy_level <= 1) in rtw_coex_set_rf_para()
816 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_power_save_state() local
824 coex_stat->wl_force_lps_ctrl = false; in rtw_coex_power_save_state()
831 coex_stat->wl_force_lps_ctrl = true; in rtw_coex_power_save_state()
944 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_set_ant_path() local
960 if (coex_stat->bt_disabled) in rtw_coex_set_ant_path()
969 if (coex_stat->bt_disabled) { in rtw_coex_set_ant_path()
1073 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_algorithm() local
1077 if (coex_stat->bt_hfp_exist) in rtw_coex_algorithm()
1079 if (coex_stat->bt_hid_exist) in rtw_coex_algorithm()
1081 if (coex_stat->bt_a2dp_exist) in rtw_coex_algorithm()
1083 if (coex_stat->bt_pan_exist) in rtw_coex_algorithm()
1116 if (coex_stat->bt_multi_link) { in rtw_coex_algorithm()
1117 if (coex_stat->bt_hid_pair_num > 0) in rtw_coex_algorithm()
1157 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_freerun() local
1168 if (coex_stat->wl_connected) in rtw_coex_action_freerun()
1187 if (coex_stat->wl_tput_dir == COEX_WL_TPUT_TX) in rtw_coex_action_freerun()
1243 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_bt_idle() local
1273 if (!coex_stat->wl_gl_busy) { in rtw_coex_action_bt_idle()
1285 if (!coex_stat->wl_gl_busy) { in rtw_coex_action_bt_idle()
1288 } else if ((coex_stat->bt_ble_scan_type & 0x2) && in rtw_coex_action_bt_idle()
1306 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_bt_inquiry() local
1312 if (coex_stat->wl_linkscan_proc || coex_stat->wl_hi_pri_task1 || in rtw_coex_action_bt_inquiry()
1313 coex_stat->wl_hi_pri_task2) in rtw_coex_action_bt_inquiry()
1320 if (coex_stat->bt_a2dp_exist && in rtw_coex_action_bt_inquiry()
1321 !coex_stat->bt_pan_exist) in rtw_coex_action_bt_inquiry()
1323 else if (coex_stat->wl_hi_pri_task1) in rtw_coex_action_bt_inquiry()
1325 else if (!coex_stat->bt_page) in rtw_coex_action_bt_inquiry()
1329 } else if (coex_stat->wl_connected) { in rtw_coex_action_bt_inquiry()
1340 if (coex_stat->bt_a2dp_exist && in rtw_coex_action_bt_inquiry()
1341 !coex_stat->bt_pan_exist) in rtw_coex_action_bt_inquiry()
1343 else if (coex_stat->wl_hi_pri_task1) in rtw_coex_action_bt_inquiry()
1345 else if (!coex_stat->bt_page) in rtw_coex_action_bt_inquiry()
1349 } else if (coex_stat->wl_connected) { in rtw_coex_action_bt_inquiry()
1359 wl_hi_pri, coex_stat->bt_page); in rtw_coex_action_bt_inquiry()
1370 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_bt_hfp() local
1377 if (coex_stat->bt_multi_link) { in rtw_coex_action_bt_hfp()
1386 if (coex_stat->bt_multi_link) { in rtw_coex_action_bt_hfp()
1404 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_bt_hid() local
1414 if (coex_stat->bt_ble_exist) { in rtw_coex_action_bt_hid()
1416 if (!coex_stat->wl_gl_busy) in rtw_coex_action_bt_hid()
1421 if (coex_stat->bt_a2dp_active || wl_bw == 0) in rtw_coex_action_bt_hid()
1423 else if (coex_stat->wl_gl_busy) in rtw_coex_action_bt_hid()
1428 if (coex_stat->bt_a2dp_active || wl_bw == 0) { in rtw_coex_action_bt_hid()
1433 if (coex_stat->bt_418_hid_exist && in rtw_coex_action_bt_hid()
1434 coex_stat->wl_gl_busy) in rtw_coex_action_bt_hid()
1443 if (coex_stat->bt_a2dp_active) { in rtw_coex_action_bt_hid()
1446 } else if (coex_stat->bt_ble_exist) { in rtw_coex_action_bt_hid()
1450 if (coex_stat->wl_gl_busy) in rtw_coex_action_bt_hid()
1469 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_bt_a2dp() local
1478 if (coex_stat->wl_gl_busy && coex_stat->wl_noisy_level == 0) in rtw_coex_action_bt_a2dp()
1485 if (coex_stat->wl_gl_busy) in rtw_coex_action_bt_a2dp()
1508 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_bt_a2dpsink() local
1518 } else if (coex_stat->wl_gl_busy) { in rtw_coex_action_bt_a2dpsink()
1544 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_bt_pan() local
1551 if (coex_stat->wl_gl_busy && coex_stat->wl_noisy_level == 0) in rtw_coex_action_bt_pan()
1556 if (coex_stat->wl_gl_busy) in rtw_coex_action_bt_pan()
1564 if (coex_stat->wl_gl_busy) in rtw_coex_action_bt_pan()
1579 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_bt_a2dp_hid() local
1588 if (coex_stat->bt_ble_exist) in rtw_coex_action_bt_a2dp_hid()
1593 if (coex_stat->wl_gl_busy) { in rtw_coex_action_bt_a2dp_hid()
1601 if (coex_stat->bt_ble_exist) in rtw_coex_action_bt_a2dp_hid()
1621 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_bt_a2dp_pan() local
1628 if (coex_stat->wl_gl_busy && in rtw_coex_action_bt_a2dp_pan()
1629 coex_stat->wl_noisy_level == 0) in rtw_coex_action_bt_a2dp_pan()
1634 if (coex_stat->wl_gl_busy) in rtw_coex_action_bt_a2dp_pan()
1642 if (coex_stat->wl_gl_busy) in rtw_coex_action_bt_a2dp_pan()
1657 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_bt_pan_hid() local
1666 if (coex_stat->wl_gl_busy) in rtw_coex_action_bt_pan_hid()
1674 if (coex_stat->wl_gl_busy) in rtw_coex_action_bt_pan_hid()
1689 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_bt_a2dp_pan_hid() local
1698 if (coex_stat->wl_gl_busy) in rtw_coex_action_bt_a2dp_pan_hid()
1706 if (coex_stat->wl_gl_busy) in rtw_coex_action_bt_a2dp_pan_hid()
1793 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_wl_linkscan() local
1800 if (coex_stat->bt_a2dp_exist) { in rtw_coex_action_wl_linkscan()
1809 if (coex_stat->bt_a2dp_exist) { in rtw_coex_action_wl_linkscan()
1849 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_action_wl_connected() local
1855 if (!efuse->share_ant && coex_stat->wl_gl_busy && in rtw_coex_action_wl_connected()
1872 if (coex_stat->bt_a2dp_sink) in rtw_coex_action_wl_connected()
1903 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_run_coex() local
1917 if (coex_stat->wl_under_ips) in rtw_coex_run_coex()
1920 if (coex->freeze && !coex_stat->bt_setup_link) in rtw_coex_run_coex()
1923 coex_stat->cnt_wl[COEX_CNT_WL_COEXRUN]++; in rtw_coex_run_coex()
1928 coex_stat->wl_coex_mode = COEX_WLINK_5G; in rtw_coex_run_coex()
1933 coex_stat->wl_coex_mode = COEX_WLINK_2G1PORT; in rtw_coex_run_coex()
1935 if (coex_stat->bt_disabled) { in rtw_coex_run_coex()
1940 if (coex_stat->wl_under_lps && !coex_stat->wl_force_lps_ctrl) { in rtw_coex_run_coex()
1945 if (coex_stat->bt_whck_test) { in rtw_coex_run_coex()
1950 if (coex_stat->bt_setup_link) { in rtw_coex_run_coex()
1955 if (coex_stat->bt_inq_page) { in rtw_coex_run_coex()
1962 coex_stat->wl_connected) { in rtw_coex_run_coex()
1967 if (coex_stat->wl_linkscan_proc) { in rtw_coex_run_coex()
1972 if (coex_stat->wl_connected) in rtw_coex_run_coex()
1985 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_init_coex_var() local
1990 memset(coex_stat, 0, sizeof(*coex_stat)); in rtw_coex_init_coex_var()
1993 coex_stat->cnt_wl[i] = 0; in rtw_coex_init_coex_var()
1996 coex_stat->cnt_bt[i] = 0; in rtw_coex_init_coex_var()
2004 coex_stat->wl_coex_mode = COEX_WLINK_MAX; in rtw_coex_init_coex_var()
2077 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_ips_notify() local
2083 coex_stat->wl_under_ips = true; in rtw_coex_ips_notify()
2097 coex_stat->wl_under_ips = false; in rtw_coex_ips_notify()
2104 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_lps_notify() local
2110 coex_stat->wl_under_lps = true; in rtw_coex_lps_notify()
2112 if (coex_stat->wl_force_lps_ctrl) { in rtw_coex_lps_notify()
2122 coex_stat->wl_under_lps = false; in rtw_coex_lps_notify()
2127 if (!coex_stat->wl_force_lps_ctrl) in rtw_coex_lps_notify()
2135 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_scan_notify() local
2150 coex_stat->wl_hi_pri_task2 = true; in rtw_coex_scan_notify()
2156 coex_stat->wl_hi_pri_task2 = false; in rtw_coex_scan_notify()
2179 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_connect_notify() local
2194 coex_stat->wl_hi_pri_task1 = true; in rtw_coex_connect_notify()
2195 coex_stat->cnt_wl[COEX_CNT_WL_CONNPKT] = 2; in rtw_coex_connect_notify()
2209 coex_stat->wl_hi_pri_task1 = false; in rtw_coex_connect_notify()
2219 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_media_status_notify() local
2243 coex_stat->wl_slot_extend = true; in rtw_coex_media_status_notify()
2259 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_bt_info_notify() local
2269 coex_stat->bt_iqk_state = buf[1]; in rtw_coex_bt_info_notify()
2270 if (coex_stat->bt_iqk_state == 1) in rtw_coex_bt_info_notify()
2271 coex_stat->cnt_bt[COEX_CNT_BT_IQK]++; in rtw_coex_bt_info_notify()
2272 else if (coex_stat->bt_iqk_state == 2) in rtw_coex_bt_info_notify()
2273 coex_stat->cnt_bt[COEX_CNT_BT_IQKFAIL]++; in rtw_coex_bt_info_notify()
2280 if (coex_stat->bt_disabled != coex_stat->bt_disabled_pre) { in rtw_coex_bt_info_notify()
2281 coex_stat->bt_disabled_pre = coex_stat->bt_disabled; in rtw_coex_bt_info_notify()
2289 if (coex_stat->bt_disabled) { in rtw_coex_bt_info_notify()
2290 coex_stat->bt_disabled = false; in rtw_coex_bt_info_notify()
2291 coex_stat->bt_reenable = true; in rtw_coex_bt_info_notify()
2300 coex_stat->bt_info_c2h[rsp_source][i] = buf[i]; in rtw_coex_bt_info_notify()
2312 if (coex_stat->bt_info_c2h[rsp_source][1] == coex_stat->bt_info_lb2 && in rtw_coex_bt_info_notify()
2313 coex_stat->bt_info_c2h[rsp_source][2] == coex_stat->bt_info_lb3 && in rtw_coex_bt_info_notify()
2314 coex_stat->bt_info_c2h[rsp_source][3] == coex_stat->bt_info_hb0 && in rtw_coex_bt_info_notify()
2315 coex_stat->bt_info_c2h[rsp_source][4] == coex_stat->bt_info_hb1 && in rtw_coex_bt_info_notify()
2316 coex_stat->bt_info_c2h[rsp_source][5] == coex_stat->bt_info_hb2 && in rtw_coex_bt_info_notify()
2317 coex_stat->bt_info_c2h[rsp_source][6] == coex_stat->bt_info_hb3) in rtw_coex_bt_info_notify()
2320 coex_stat->bt_info_lb2 = coex_stat->bt_info_c2h[rsp_source][1]; in rtw_coex_bt_info_notify()
2321 coex_stat->bt_info_lb3 = coex_stat->bt_info_c2h[rsp_source][2]; in rtw_coex_bt_info_notify()
2322 coex_stat->bt_info_hb0 = coex_stat->bt_info_c2h[rsp_source][3]; in rtw_coex_bt_info_notify()
2323 coex_stat->bt_info_hb1 = coex_stat->bt_info_c2h[rsp_source][4]; in rtw_coex_bt_info_notify()
2324 coex_stat->bt_info_hb2 = coex_stat->bt_info_c2h[rsp_source][5]; in rtw_coex_bt_info_notify()
2325 coex_stat->bt_info_hb3 = coex_stat->bt_info_c2h[rsp_source][6]; in rtw_coex_bt_info_notify()
2328 coex_stat->bt_whck_test = (coex_stat->bt_info_lb2 == 0xff); in rtw_coex_bt_info_notify()
2329 coex_stat->bt_inq_page = ((coex_stat->bt_info_lb2 & BIT(2)) == BIT(2)); in rtw_coex_bt_info_notify()
2330 coex_stat->bt_acl_busy = ((coex_stat->bt_info_lb2 & BIT(3)) == BIT(3)); in rtw_coex_bt_info_notify()
2331 coex_stat->cnt_bt[COEX_CNT_BT_RETRY] = coex_stat->bt_info_lb3 & 0xf; in rtw_coex_bt_info_notify()
2332 if (coex_stat->cnt_bt[COEX_CNT_BT_RETRY] >= 1) in rtw_coex_bt_info_notify()
2333 coex_stat->cnt_bt[COEX_CNT_BT_POPEVENT]++; in rtw_coex_bt_info_notify()
2335 coex_stat->bt_fix_2M = ((coex_stat->bt_info_lb3 & BIT(4)) == BIT(4)); in rtw_coex_bt_info_notify()
2336 coex_stat->bt_inq = ((coex_stat->bt_info_lb3 & BIT(5)) == BIT(5)); in rtw_coex_bt_info_notify()
2337 if (coex_stat->bt_inq) in rtw_coex_bt_info_notify()
2338 coex_stat->cnt_bt[COEX_CNT_BT_INQ]++; in rtw_coex_bt_info_notify()
2340 coex_stat->bt_page = ((coex_stat->bt_info_lb3 & BIT(7)) == BIT(7)); in rtw_coex_bt_info_notify()
2341 if (coex_stat->bt_page) { in rtw_coex_bt_info_notify()
2342 coex_stat->cnt_bt[COEX_CNT_BT_PAGE]++; in rtw_coex_bt_info_notify()
2343 if (coex_stat->wl_linkscan_proc || in rtw_coex_bt_info_notify()
2344 coex_stat->wl_hi_pri_task1 || in rtw_coex_bt_info_notify()
2345 coex_stat->wl_hi_pri_task2 || coex_stat->wl_gl_busy) in rtw_coex_bt_info_notify()
2355 coex_stat->bt_rssi = coex_stat->bt_info_hb0 * 2 + 10; in rtw_coex_bt_info_notify()
2357 if (coex_stat->bt_info_hb0 <= 127) in rtw_coex_bt_info_notify()
2358 coex_stat->bt_rssi = 100; in rtw_coex_bt_info_notify()
2359 else if (256 - coex_stat->bt_info_hb0 <= 100) in rtw_coex_bt_info_notify()
2360 coex_stat->bt_rssi = 100 - (256 - coex_stat->bt_info_hb0); in rtw_coex_bt_info_notify()
2362 coex_stat->bt_rssi = 0; in rtw_coex_bt_info_notify()
2365 coex_stat->bt_ble_exist = ((coex_stat->bt_info_hb1 & BIT(0)) == BIT(0)); in rtw_coex_bt_info_notify()
2366 if (coex_stat->bt_info_hb1 & BIT(1)) in rtw_coex_bt_info_notify()
2367 coex_stat->cnt_bt[COEX_CNT_BT_REINIT]++; in rtw_coex_bt_info_notify()
2369 if (coex_stat->bt_info_hb1 & BIT(2)) { in rtw_coex_bt_info_notify()
2370 coex_stat->cnt_bt[COEX_CNT_BT_SETUPLINK]++; in rtw_coex_bt_info_notify()
2371 coex_stat->bt_setup_link = true; in rtw_coex_bt_info_notify()
2372 if (coex_stat->bt_reenable) in rtw_coex_bt_info_notify()
2382 if (coex_stat->bt_info_hb1 & BIT(3)) in rtw_coex_bt_info_notify()
2383 coex_stat->cnt_bt[COEX_CNT_BT_IGNWLANACT]++; in rtw_coex_bt_info_notify()
2385 coex_stat->bt_ble_voice = ((coex_stat->bt_info_hb1 & BIT(4)) == BIT(4)); in rtw_coex_bt_info_notify()
2386 coex_stat->bt_ble_scan_en = ((coex_stat->bt_info_hb1 & BIT(5)) == BIT(5)); in rtw_coex_bt_info_notify()
2387 if (coex_stat->bt_info_hb1 & BIT(6)) in rtw_coex_bt_info_notify()
2388 coex_stat->cnt_bt[COEX_CNT_BT_ROLESWITCH]++; in rtw_coex_bt_info_notify()
2390 coex_stat->bt_multi_link = ((coex_stat->bt_info_hb1 & BIT(7)) == BIT(7)); in rtw_coex_bt_info_notify()
2392 if ((coex_stat->bt_info_hb1 & BIT(1))) { in rtw_coex_bt_info_notify()
2393 if (coex_stat->wl_connected) in rtw_coex_bt_info_notify()
2401 if ((coex_stat->bt_info_hb1 & BIT(3)) && in rtw_coex_bt_info_notify()
2402 (!(coex_stat->bt_info_hb1 & BIT(2)))) in rtw_coex_bt_info_notify()
2405 coex_stat->bt_opp_exist = ((coex_stat->bt_info_hb2 & BIT(0)) == BIT(0)); in rtw_coex_bt_info_notify()
2406 if (coex_stat->bt_info_hb2 & BIT(1)) in rtw_coex_bt_info_notify()
2407 coex_stat->cnt_bt[COEX_CNT_BT_AFHUPDATE]++; in rtw_coex_bt_info_notify()
2409 coex_stat->bt_a2dp_active = (coex_stat->bt_info_hb2 & BIT(2)) == BIT(2); in rtw_coex_bt_info_notify()
2410 coex_stat->bt_slave = ((coex_stat->bt_info_hb2 & BIT(3)) == BIT(3)); in rtw_coex_bt_info_notify()
2411 coex_stat->bt_hid_slot = (coex_stat->bt_info_hb2 & 0x30) >> 4; in rtw_coex_bt_info_notify()
2412 coex_stat->bt_hid_pair_num = (coex_stat->bt_info_hb2 & 0xc0) >> 6; in rtw_coex_bt_info_notify()
2413 if (coex_stat->bt_hid_pair_num > 0 && coex_stat->bt_hid_slot >= 2) in rtw_coex_bt_info_notify()
2414 coex_stat->bt_418_hid_exist = true; in rtw_coex_bt_info_notify()
2415 else if (coex_stat->bt_hid_pair_num == 0) in rtw_coex_bt_info_notify()
2416 coex_stat->bt_418_hid_exist = false; in rtw_coex_bt_info_notify()
2418 if ((coex_stat->bt_info_lb2 & 0x49) == 0x49) in rtw_coex_bt_info_notify()
2419 coex_stat->bt_a2dp_bitpool = (coex_stat->bt_info_hb3 & 0x7f); in rtw_coex_bt_info_notify()
2421 coex_stat->bt_a2dp_bitpool = 0; in rtw_coex_bt_info_notify()
2423 coex_stat->bt_a2dp_sink = ((coex_stat->bt_info_hb3 & BIT(7)) == BIT(7)); in rtw_coex_bt_info_notify()
2432 struct rtw_coex_stat *coex_stat = &coex->stat; in rtw_coex_wl_fwdbginfo_notify() local
2443 val = coex_stat->wl_fw_dbg_info_pre[i]; in rtw_coex_wl_fwdbginfo_notify()
2445 coex_stat->wl_fw_dbg_info[i] = buf[i] - val; in rtw_coex_wl_fwdbginfo_notify()
2447 coex_stat->wl_fw_dbg_info[i] = val - buf[i]; in rtw_coex_wl_fwdbginfo_notify()
2449 coex_stat->wl_fw_dbg_info_pre[i] = buf[i]; in rtw_coex_wl_fwdbginfo_notify()
2452 coex_stat->cnt_wl[COEX_CNT_WL_FW_NOTIFY]++; in rtw_coex_wl_fwdbginfo_notify()
2471 struct rtw_coex_stat *coex_stat = &rtwdev->coex.stat; in rtw_coex_bt_relink_work() local
2474 coex_stat->bt_setup_link = false; in rtw_coex_bt_relink_work()
2483 struct rtw_coex_stat *coex_stat = &rtwdev->coex.stat; in rtw_coex_bt_reenable_work() local
2486 coex_stat->bt_reenable = false; in rtw_coex_bt_reenable_work()
2495 struct rtw_coex_stat *coex_stat = &rtwdev->coex.stat; in rtw_coex_defreeze_work() local
2499 coex_stat->wl_hi_pri_task1 = false; in rtw_coex_defreeze_work()