Lines Matching refs:dm
723 memset(&btc->dm, 0, sizeof(btc->dm)); in _reset_btc_var()
731 btc->dm.tdma_now = t_def[CXTD_OFF]; in _reset_btc_var()
732 btc->dm.tdma = t_def[CXTD_OFF]; in _reset_btc_var()
733 memcpy(&btc->dm.slot_now, s_def, sizeof(btc->dm.slot_now)); in _reset_btc_var()
734 memcpy(&btc->dm.slot, s_def, sizeof(btc->dm.slot)); in _reset_btc_var()
739 btc->dm.coex_info_map = BTC_COEX_INFO_ALL; in _reset_btc_var()
740 btc->dm.wl_tx_limit.tx_time = BTC_MAX_TX_TIME_DEF; in _reset_btc_var()
741 btc->dm.wl_tx_limit.tx_retry = BTC_MAX_TX_RETRY_DEF; in _reset_btc_var()
757 struct rtw89_btc_dm *dm = &btc->dm; in _chk_btc_err() local
766 if (dm->cnt_dm[BTC_DCNT_RPT] == cnt && btc->fwinfo.rpt_en_map) in _chk_btc_err()
767 dm->cnt_dm[BTC_DCNT_RPT_HANG]++; in _chk_btc_err()
769 dm->cnt_dm[BTC_DCNT_RPT_HANG] = 0; in _chk_btc_err()
771 if (dm->cnt_dm[BTC_DCNT_RPT_HANG] >= BTC_CHK_HANG_MAX) in _chk_btc_err()
772 dm->error.map.wl_fw_hang = true; in _chk_btc_err()
774 dm->error.map.wl_fw_hang = false; in _chk_btc_err()
776 dm->cnt_dm[BTC_DCNT_RPT] = cnt; in _chk_btc_err()
779 if (dm->cnt_dm[BTC_DCNT_CYCLE] == cnt && in _chk_btc_err()
780 (dm->tdma_now.type != CXTDMA_OFF || in _chk_btc_err()
781 dm->tdma_now.ext_ctrl == CXECTL_EXT)) in _chk_btc_err()
782 dm->cnt_dm[BTC_DCNT_CYCLE_HANG]++; in _chk_btc_err()
784 dm->cnt_dm[BTC_DCNT_CYCLE_HANG] = 0; in _chk_btc_err()
786 if (dm->cnt_dm[BTC_DCNT_CYCLE_HANG] >= BTC_CHK_HANG_MAX) in _chk_btc_err()
787 dm->error.map.cycle_hang = true; in _chk_btc_err()
789 dm->error.map.cycle_hang = false; in _chk_btc_err()
791 dm->cnt_dm[BTC_DCNT_CYCLE] = cnt; in _chk_btc_err()
794 if (dm->cnt_dm[BTC_DCNT_W1] == cnt && in _chk_btc_err()
795 dm->tdma_now.type != CXTDMA_OFF) in _chk_btc_err()
796 dm->cnt_dm[BTC_DCNT_W1_HANG]++; in _chk_btc_err()
798 dm->cnt_dm[BTC_DCNT_W1_HANG] = 0; in _chk_btc_err()
800 if (dm->cnt_dm[BTC_DCNT_W1_HANG] >= BTC_CHK_HANG_MAX) in _chk_btc_err()
801 dm->error.map.w1_hang = true; in _chk_btc_err()
803 dm->error.map.w1_hang = false; in _chk_btc_err()
805 dm->cnt_dm[BTC_DCNT_W1] = cnt; in _chk_btc_err()
808 if (dm->cnt_dm[BTC_DCNT_B1] == cnt && in _chk_btc_err()
809 dm->tdma_now.type != CXTDMA_OFF) in _chk_btc_err()
810 dm->cnt_dm[BTC_DCNT_B1_HANG]++; in _chk_btc_err()
812 dm->cnt_dm[BTC_DCNT_B1_HANG] = 0; in _chk_btc_err()
814 if (dm->cnt_dm[BTC_DCNT_B1_HANG] >= BTC_CHK_HANG_MAX) in _chk_btc_err()
815 dm->error.map.b1_hang = true; in _chk_btc_err()
817 dm->error.map.b1_hang = false; in _chk_btc_err()
819 dm->cnt_dm[BTC_DCNT_B1] = cnt; in _chk_btc_err()
822 if (dm->cnt_dm[BTC_DCNT_E2G] == cnt && in _chk_btc_err()
823 dm->tdma_now.ext_ctrl == CXECTL_EXT) in _chk_btc_err()
824 dm->cnt_dm[BTC_DCNT_E2G_HANG]++; in _chk_btc_err()
826 dm->cnt_dm[BTC_DCNT_E2G_HANG] = 0; in _chk_btc_err()
828 if (dm->cnt_dm[BTC_DCNT_E2G_HANG] >= BTC_CHK_HANG_MAX) in _chk_btc_err()
829 dm->error.map.wl_e2g_hang = true; in _chk_btc_err()
831 dm->error.map.wl_e2g_hang = false; in _chk_btc_err()
833 dm->cnt_dm[BTC_DCNT_E2G] = cnt; in _chk_btc_err()
837 dm->cnt_dm[BTC_DCNT_TDMA_NONSYNC]++; in _chk_btc_err()
839 dm->cnt_dm[BTC_DCNT_TDMA_NONSYNC] = 0; in _chk_btc_err()
841 if (dm->cnt_dm[BTC_DCNT_TDMA_NONSYNC] >= BTC_CHK_HANG_MAX) in _chk_btc_err()
842 dm->error.map.tdma_no_sync = true; in _chk_btc_err()
844 dm->error.map.tdma_no_sync = false; in _chk_btc_err()
848 dm->cnt_dm[BTC_DCNT_SLOT_NONSYNC]++; in _chk_btc_err()
850 dm->cnt_dm[BTC_DCNT_SLOT_NONSYNC] = 0; in _chk_btc_err()
852 if (dm->cnt_dm[BTC_DCNT_SLOT_NONSYNC] >= BTC_CHK_HANG_MAX) in _chk_btc_err()
853 dm->error.map.slot_no_sync = true; in _chk_btc_err()
855 dm->error.map.slot_no_sync = false; in _chk_btc_err()
864 dm->cnt_dm[BTC_DCNT_BTCNT_HANG]++; in _chk_btc_err()
866 dm->cnt_dm[BTC_DCNT_BTCNT_HANG] = 0; in _chk_btc_err()
868 if ((dm->cnt_dm[BTC_DCNT_BTCNT_HANG] >= BTC_CHK_HANG_MAX && in _chk_btc_err()
869 bt->enable.now) || (!dm->cnt_dm[BTC_DCNT_BTCNT_HANG] && in _chk_btc_err()
875 dm->cnt_dm[BTC_DCNT_WL_SLOT_DRIFT]++; in _chk_btc_err()
877 dm->cnt_dm[BTC_DCNT_WL_SLOT_DRIFT] = 0; in _chk_btc_err()
879 if (dm->cnt_dm[BTC_DCNT_WL_SLOT_DRIFT] >= BTC_CHK_HANG_MAX) in _chk_btc_err()
880 dm->error.map.wl_slot_drift = true; in _chk_btc_err()
882 dm->error.map.wl_slot_drift = false; in _chk_btc_err()
886 dm->cnt_dm[BTC_DCNT_BT_SLOT_DRIFT]++; in _chk_btc_err()
888 dm->cnt_dm[BTC_DCNT_BT_SLOT_DRIFT] = 0; in _chk_btc_err()
890 if (dm->cnt_dm[BTC_DCNT_BT_SLOT_DRIFT] >= BTC_CHK_HANG_MAX) in _chk_btc_err()
891 dm->error.map.bt_slot_drift = true; in _chk_btc_err()
893 dm->error.map.bt_slot_drift = false; in _chk_btc_err()
994 struct rtw89_btc_dm *dm = &btc->dm; in _chk_btc_report() local
1212 dm->wl_fw_cx_offload = !!prpt->v1.wl_fw_cx_offload; in _chk_btc_report()
1232 dm->wl_fw_cx_offload = !!le32_to_cpu(prpt->v4.wl_fw_info.cx_offload); in _chk_btc_report()
1235 memcpy(&dm->gnt.band[i], &prpt->v4.gnt_val[i], in _chk_btc_report()
1236 sizeof(dm->gnt.band[i])); in _chk_btc_report()
1258 dm->error.map.bt_rfk_timeout = bt->rfk_info.map.timeout; in _chk_btc_report()
1264 dm->wl_fw_cx_offload = 0; in _chk_btc_report()
1267 memcpy(&dm->gnt.band[i], &prpt->v5.gnt_val[i][0], in _chk_btc_report()
1268 sizeof(dm->gnt.band[i])); in _chk_btc_report()
1285 dm->error.map.bt_rfk_timeout = bt->rfk_info.map.timeout; in _chk_btc_report()
1291 dm->wl_fw_cx_offload = 0; in _chk_btc_report()
1294 memcpy(&dm->gnt.band[i], &prpt->v105.gnt_val[i][0], in _chk_btc_report()
1295 sizeof(dm->gnt.band[i])); in _chk_btc_report()
1312 dm->error.map.bt_rfk_timeout = bt->rfk_info.map.timeout; in _chk_btc_report()
1321 sizeof(dm->tdma_now)); in _chk_btc_report()
1324 memcmp(&dm->tdma_now, in _chk_btc_report()
1326 sizeof(dm->tdma_now))); in _chk_btc_report()
1329 memcmp(&dm->tdma_now, in _chk_btc_report()
1331 sizeof(dm->tdma_now))); in _chk_btc_report()
1339 sizeof(dm->slot_now)); in _chk_btc_report()
1341 memcmp(dm->slot_now, in _chk_btc_report()
1343 sizeof(dm->slot_now))); in _chk_btc_report()
1351 le32_to_cpu(pcysta->v2.leakrx_cnt) != 0 && dm->tdma_now.rxflctrl) { in _chk_btc_report()
1354 dm->leak_ap = 1; in _chk_btc_report()
1358 if (dm->tdma_now.type == CXTDMA_OFF && in _chk_btc_report()
1359 dm->tdma_now.ext_ctrl == CXECTL_EXT) in _chk_btc_report()
1360 wl_slot_set = le16_to_cpu(dm->slot_now[CXST_E2G].dur); in _chk_btc_report()
1362 wl_slot_set = le16_to_cpu(dm->slot_now[CXST_W1].dur); in _chk_btc_report()
1385 dm->tdma_now.rxflctrl) { in _chk_btc_report()
1387 dm->leak_ap = 1; in _chk_btc_report()
1391 if (dm->tdma_now.type == CXTDMA_OFF) { in _chk_btc_report()
1392 wl_slot_set = le16_to_cpu(dm->slot_now[CXST_W1].dur); in _chk_btc_report()
1401 if (dm->tdma_now.type == CXTDMA_OFF && in _chk_btc_report()
1402 dm->tdma_now.ext_ctrl == CXECTL_EXT && in _chk_btc_report()
1426 dm->tdma_now.rxflctrl) { in _chk_btc_report()
1428 dm->leak_ap = 1; in _chk_btc_report()
1432 if (dm->tdma_now.type == CXTDMA_OFF) { in _chk_btc_report()
1433 wl_slot_set = le16_to_cpu(dm->slot_now[CXST_W1].dur); in _chk_btc_report()
1442 if (dm->tdma_now.type == CXTDMA_OFF && in _chk_btc_report()
1443 dm->tdma_now.ext_ctrl == CXECTL_EXT && in _chk_btc_report()
1460 if (dm->fddt_train == BTC_FDDT_ENABLE) in _chk_btc_report()
1467 dm->tdma_now.rxflctrl) { in _chk_btc_report()
1470 dm->leak_ap = 1; in _chk_btc_report()
1474 if (dm->tdma_now.type == CXTDMA_OFF) { in _chk_btc_report()
1475 wl_slot_set = le16_to_cpu(dm->slot_now[CXST_W1].dur); in _chk_btc_report()
1489 if (dm->tdma_now.type == CXTDMA_OFF && in _chk_btc_report()
1490 dm->tdma_now.ext_ctrl == CXECTL_EXT && in _chk_btc_report()
1560 struct rtw89_btc_dm *dm = &btc->dm; in _append_tdma() local
1567 !memcmp(&dm->tdma, &dm->tdma_now, sizeof(dm->tdma))) { in _append_tdma()
1579 memcpy(v, &dm->tdma, sizeof(*v)); in _append_tdma()
1585 memcpy(&v3->tdma, &dm->tdma, sizeof(v3->tdma)); in _append_tdma()
1591 __func__, dm->tdma.type, dm->tdma.rxflctrl, in _append_tdma()
1592 dm->tdma.txpause, dm->tdma.wtgle_n, dm->tdma.leak_n, in _append_tdma()
1593 dm->tdma.ext_ctrl); in _append_tdma()
1599 struct rtw89_btc_dm *dm = &btc->dm; in _append_slot() local
1611 !memcmp(&dm->slot[i], &dm->slot_now[i], in _append_slot()
1612 sizeof(dm->slot[i]))) in _append_slot()
1624 v->slot = dm->slot[i]; in _append_slot()
1628 __func__, i, dm->slot[i].dur, dm->slot[i].cxtbl, in _append_slot()
1629 dm->slot[i].cxtype); in _append_slot()
1892 struct rtw89_btc_dm *dm = &btc->dm; in _update_dm_step() local
1895 dm->dm_step.step[dm->dm_step.step_pos] = reason_or_action; in _update_dm_step()
1896 dm->dm_step.step_pos++; in _update_dm_step()
1898 if (dm->dm_step.step_pos >= ARRAY_SIZE(dm->dm_step.step)) { in _update_dm_step()
1899 dm->dm_step.step_pos = 0; in _update_dm_step()
1900 dm->dm_step.step_ov = true; in _update_dm_step()
1908 struct rtw89_btc_dm *dm = &btc->dm; in _fw_set_policy() local
1910 dm->run_action = action; in _fw_set_policy()
1928 if (dm->tdma.rxflctrl == CXFLC_NULLP || in _fw_set_policy()
1929 dm->tdma.rxflctrl == CXFLC_QOSNULL) in _fw_set_policy()
1940 memcpy(&dm->tdma_now, &dm->tdma, sizeof(dm->tdma_now)); in _fw_set_policy()
1941 memcpy(&dm->slot_now, &dm->slot, sizeof(dm->slot_now)); in _fw_set_policy()
1954 struct rtw89_btc_dm *dm = &btc->dm; in _fw_set_drv_info() local
1956 struct rtw89_btc_rf_trx_para rf_para = dm->rf_trx_para; in _fw_set_drv_info()
1974 dm->trx_info.tx_power = u32_get_bits(rf_para.wl_tx_power, in _fw_set_drv_info()
1976 dm->trx_info.rx_gain = u32_get_bits(rf_para.wl_rx_gain, in _fw_set_drv_info()
1978 dm->trx_info.bt_tx_power = u32_get_bits(rf_para.bt_tx_power, in _fw_set_drv_info()
1980 dm->trx_info.bt_rx_gain = u32_get_bits(rf_para.bt_rx_gain, in _fw_set_drv_info()
1982 dm->trx_info.cn = wl->cn_report; in _fw_set_drv_info()
1983 dm->trx_info.nhm = wl->nhm.pwr; in _fw_set_drv_info()
2019 struct rtw89_btc_dm *dm = &btc->dm; in _set_gnt() local
2020 struct rtw89_mac_ax_gnt *g = dm->gnt.band; in _set_gnt()
2061 rtw89_chip_mac_cfg_gnt(rtwdev, &dm->gnt); in _set_gnt()
2094 btc->dm.rf_trx_para.wl_tx_power = level; in _set_wl_tx_power()
2125 btc->dm.rf_trx_para.wl_rx_gain = level; in _set_wl_rx_gain()
2144 btc->dm.rf_trx_para.bt_tx_power = level; in _set_bt_tx_power()
2166 btc->dm.rf_trx_para.bt_rx_gain = level; in _set_bt_rx_gain()
2184 struct rtw89_btc_dm *dm = &btc->dm; in _set_rf_trx_para() local
2192 if (!dm->freerun) { in _set_rf_trx_para()
2194 if ((btc->dm.wl_btg_rx && b->profile_cnt.now != 0) || in _set_rf_trx_para()
2195 dm->bt_only == 1) in _set_rf_trx_para()
2196 dm->trx_para_level = 1; in _set_rf_trx_para()
2198 dm->trx_para_level = 0; in _set_rf_trx_para()
2201 level_id = (u8)dm->trx_para_level; in _set_rf_trx_para()
2231 if (wl_stb_chg != dm->wl_stb_chg) { in _set_rf_trx_para()
2235 dm->wl_stb_chg = wl_stb_chg; in _set_rf_trx_para()
2236 chip->ops->btc_wl_s1_standby(rtwdev, dm->wl_stb_chg); in _set_rf_trx_para()
2410 btc->dm.trx_para_level = 0; in _check_freerun()
2417 btc->dm.trx_para_level = 5; in _check_freerun()
2422 btc->dm.trx_para_level = 5; in _check_freerun()
2427 btc->dm.trx_para_level = 5; in _check_freerun()
2433 btc->dm.trx_para_level = 5; in _check_freerun()
2438 btc->dm.trx_para_level = 5; in _check_freerun()
2441 btc->dm.trx_para_level = 0; in _check_freerun()
2445 btc->dm.trx_para_level = 6; in _check_freerun()
2448 btc->dm.trx_para_level = 7; in _check_freerun()
2451 btc->dm.trx_para_level = 0; in _check_freerun()
2455 btc->dm.trx_para_level = 6; in _check_freerun()
2460 btc->dm.trx_para_level = 0; in _check_freerun()
2464 #define _tdma_set_flctrl(btc, flc) ({(btc)->dm.tdma.rxflctrl = flc; })
2465 #define _tdma_set_flctrl_role(btc, role) ({(btc)->dm.tdma.rxflctrl_role = role; })
2466 #define _tdma_set_tog(btc, wtg) ({(btc)->dm.tdma.wtgle_n = wtg; })
2467 #define _tdma_set_lek(btc, lek) ({(btc)->dm.tdma.leak_n = lek; })
2473 _btc->dm.slot[_sid].dur = cpu_to_le16(dura);\
2474 _btc->dm.slot[_sid].cxtbl = cpu_to_le32(tbl); \
2475 _btc->dm.slot[_sid].cxtype = cpu_to_le16(type); \
2478 #define _slot_set_dur(btc, sid, dura) (btc)->dm.slot[sid].dur = cpu_to_le16(dura)
2479 #define _slot_set_tbl(btc, sid, tbl) (btc)->dm.slot[sid].cxtbl = cpu_to_le32(tbl)
2480 #define _slot_set_type(btc, sid, type) (btc)->dm.slot[sid].cxtype = cpu_to_le16(type)
2554 struct rtw89_btc_dm *dm = &btc->dm; in rtw89_btc_set_policy() local
2555 struct rtw89_btc_fbtc_tdma *t = &dm->tdma; in rtw89_btc_set_policy()
2556 struct rtw89_btc_fbtc_slot *s = dm->slot; in rtw89_btc_set_policy()
2688 _slot_set(btc, CXST_W1, dm->slot_dur[CXST_W1], in rtw89_btc_set_policy()
2690 _slot_set(btc, CXST_B1, dm->slot_dur[CXST_B1], in rtw89_btc_set_policy()
2745 _slot_set(btc, CXST_W1, dm->slot_dur[CXST_W1], in rtw89_btc_set_policy()
2747 _slot_set(btc, CXST_B1, dm->slot_dur[CXST_B1], in rtw89_btc_set_policy()
2769 _slot_set(btc, CXST_W1, dm->slot_dur[CXST_W1], in rtw89_btc_set_policy()
2771 _slot_set(btc, CXST_B1, dm->slot_dur[CXST_B1], in rtw89_btc_set_policy()
2806 _slot_set(btc, CXST_W1, dm->slot_dur[CXST_W1], in rtw89_btc_set_policy()
2808 _slot_set(btc, CXST_B4, dm->slot_dur[CXST_B4], in rtw89_btc_set_policy()
2843 _slot_set(btc, CXST_W1, dm->slot_dur[CXST_W1], in rtw89_btc_set_policy()
2845 _slot_set(btc, CXST_B4, dm->slot_dur[CXST_B4], in rtw89_btc_set_policy()
2857 struct rtw89_btc_dm *dm = &btc->dm; in rtw89_btc_set_policy_v1() local
2858 struct rtw89_btc_fbtc_tdma *t = &dm->tdma; in rtw89_btc_set_policy_v1()
2859 struct rtw89_btc_fbtc_slot *s = dm->slot; in rtw89_btc_set_policy_v1()
2876 if (dm->leak_ap && in rtw89_btc_set_policy_v1()
3029 _slot_set(btc, CXST_W1, dm->slot_dur[CXST_W1], in rtw89_btc_set_policy_v1()
3031 _slot_set(btc, CXST_B1, dm->slot_dur[CXST_B1], in rtw89_btc_set_policy_v1()
3068 _slot_set(btc, CXST_W1, dm->slot_dur[CXST_W1], in rtw89_btc_set_policy_v1()
3070 _slot_set(btc, CXST_B1, dm->slot_dur[CXST_B1], in rtw89_btc_set_policy_v1()
3095 _slot_set(btc, CXST_W1, dm->slot_dur[CXST_W1], in rtw89_btc_set_policy_v1()
3097 _slot_set(btc, CXST_B1, dm->slot_dur[CXST_B1], in rtw89_btc_set_policy_v1()
3122 _slot_set(btc, CXST_W1, dm->slot_dur[CXST_W1], in rtw89_btc_set_policy_v1()
3124 _slot_set(btc, CXST_B1, dm->slot_dur[CXST_B1], in rtw89_btc_set_policy_v1()
3162 _slot_set(btc, CXST_W1, dm->slot_dur[CXST_W1], in rtw89_btc_set_policy_v1()
3164 _slot_set(btc, CXST_B1, dm->slot_dur[CXST_B1], in rtw89_btc_set_policy_v1()
3166 _slot_set(btc, CXST_B4, dm->slot_dur[CXST_B4], in rtw89_btc_set_policy_v1()
3204 _slot_set(btc, CXST_W1, dm->slot_dur[CXST_W1], in rtw89_btc_set_policy_v1()
3206 _slot_set(btc, CXST_B1, dm->slot_dur[CXST_B1], in rtw89_btc_set_policy_v1()
3208 _slot_set(btc, CXST_B4, dm->slot_dur[CXST_B4], in rtw89_btc_set_policy_v1()
3217 if (wl_rinfo->link_mode == BTC_WLINK_2G_SCC && dm->tdma.rxflctrl) { in rtw89_btc_set_policy_v1()
3218 null_role = FIELD_PREP(0x0f, dm->wl_scc.null_role1) | in rtw89_btc_set_policy_v1()
3219 FIELD_PREP(0xf0, dm->wl_scc.null_role2); in rtw89_btc_set_policy_v1()
3224 if (dm->leak_ap && dm->tdma.leak_n > 1) in rtw89_btc_set_policy_v1()
3227 if (dm->tdma_instant_excute) { in rtw89_btc_set_policy_v1()
3228 btc->dm.tdma.option_ctrl |= BIT(0); in rtw89_btc_set_policy_v1()
3258 struct rtw89_btc_dm *dm = &btc->dm; in _set_ant() local
3268 if (btc->dm.run_reason == BTC_RSN_NTFY_POWEROFF || in _set_ant()
3269 btc->dm.run_reason == BTC_RSN_NTFY_RADIO_STATE || in _set_ant()
3270 btc->dm.run_reason == BTC_RSN_CMD_SET_COEX) in _set_ant()
3273 if (!force_exec && ant_path_type == dm->set_ant_path) { in _set_ant()
3282 } else if (btc->dm.run_reason != BTC_RSN_NTFY_WL_RFK && in _set_ant()
3289 dm->set_ant_path = ant_path_type; in _set_ant()
3294 __func__, phy_map, dm->set_ant_path & 0xff); in _set_ant()
3394 if (wl->status.map.rf_off || btc->dm.bt_only) in _action_wl_off()
3409 btc->dm.freerun = true; in _action_freerun()
3535 struct rtw89_btc_dm *dm = &btc->dm; in _action_bt_a2dp() local
3541 if (a2dp.vendor_id == 0x4c || dm->leak_ap) { in _action_bt_a2dp()
3542 dm->slot_dur[CXST_W1] = 40; in _action_bt_a2dp()
3543 dm->slot_dur[CXST_B1] = 200; in _action_bt_a2dp()
3559 if (a2dp.vendor_id == 0x4c || dm->leak_ap) { in _action_bt_a2dp()
3560 dm->slot_dur[CXST_W1] = 40; in _action_bt_a2dp()
3561 dm->slot_dur[CXST_B1] = 200; in _action_bt_a2dp()
3636 struct rtw89_btc_dm *dm = &btc->dm; in _action_bt_a2dp_hid() local
3643 if (a2dp.vendor_id == 0x4c || dm->leak_ap) { in _action_bt_a2dp_hid()
3644 dm->slot_dur[CXST_W1] = 40; in _action_bt_a2dp_hid()
3645 dm->slot_dur[CXST_B1] = 200; in _action_bt_a2dp_hid()
3662 if (a2dp.vendor_id == 0x4c || dm->leak_ap) { in _action_bt_a2dp_hid()
3663 dm->slot_dur[CXST_W1] = 40; in _action_bt_a2dp_hid()
3664 dm->slot_dur[CXST_B1] = 200; in _action_bt_a2dp_hid()
3834 if (btc->dm.run_reason != BTC_RSN_NTFY_INIT && in _set_btg_ctrl()
3835 is_btg == btc->dm.wl_btg_rx) in _set_btg_ctrl()
3838 btc->dm.wl_btg_rx = is_btg; in _set_btg_ctrl()
3916 struct rtw89_btc_dm *dm = &btc->dm; in _set_wl_tx_limit() local
3944 if (btc->dm.freerun || btc->ctrl.igno_bt || b->profile_cnt.now == 0 || in _set_wl_tx_limit()
3963 if (dm->wl_tx_limit.enable == enable && in _set_wl_tx_limit()
3964 dm->wl_tx_limit.tx_time == tx_time && in _set_wl_tx_limit()
3965 dm->wl_tx_limit.tx_retry == tx_retry) in _set_wl_tx_limit()
3968 if (!dm->wl_tx_limit.enable && enable) in _set_wl_tx_limit()
3971 dm->wl_tx_limit.enable = enable; in _set_wl_tx_limit()
3972 dm->wl_tx_limit.tx_time = tx_time; in _set_wl_tx_limit()
3973 dm->wl_tx_limit.tx_retry = tx_retry; in _set_wl_tx_limit()
4006 if (mode != BTC_WLINK_NOLINK && btc->dm.wl_btg_rx) in _set_bt_rx_agc()
4043 btc->dm.tdma_instant_excute = 0; in _action_common()
4220 struct rtw89_btc_dm *dm = &btc->dm; in _action_wl_2g_scc_v1() local
4231 dm->wl_scc.null_role1 = RTW89_WIFI_ROLE_STATION; in _action_wl_2g_scc_v1()
4232 dm->wl_scc.null_role2 = RTW89_WIFI_ROLE_P2P_CLIENT; in _action_wl_2g_scc_v1()
4233 dm->wl_scc.ebt_null = 0; /* no ext-slot-control */ in _action_wl_2g_scc_v1()
4237 dm->wl_scc.null_role1 = RTW89_WIFI_ROLE_STATION; in _action_wl_2g_scc_v1()
4238 dm->wl_scc.null_role2 = RTW89_WIFI_ROLE_STATION; in _action_wl_2g_scc_v1()
4239 dm->wl_scc.ebt_null = 0; /* no ext-slot-control */ in _action_wl_2g_scc_v1()
4245 dm->wl_scc.null_role1 = RTW89_WIFI_ROLE_STATION; in _action_wl_2g_scc_v1()
4246 dm->wl_scc.null_role2 = RTW89_WIFI_ROLE_NONE; in _action_wl_2g_scc_v1()
4250 dm->wl_scc.ebt_null = 0; in _action_wl_2g_scc_v1()
4253 dm->wl_scc.ebt_null = 0; in _action_wl_2g_scc_v1()
4257 dm->wl_scc.ebt_null = 1; /* tx null at EBT */ in _action_wl_2g_scc_v1()
4261 dm->wl_scc.ebt_null = 1; /* tx null at EBT */ in _action_wl_2g_scc_v1()
4264 dm->wl_scc.ebt_null = 0; in _action_wl_2g_scc_v1()
4282 struct rtw89_btc_dm *dm = &btc->dm; in _action_wl_2g_scc_v2() local
4293 dm->wl_scc.null_role1 = RTW89_WIFI_ROLE_STATION; in _action_wl_2g_scc_v2()
4294 dm->wl_scc.null_role2 = RTW89_WIFI_ROLE_P2P_CLIENT; in _action_wl_2g_scc_v2()
4295 dm->wl_scc.ebt_null = 0; /* no ext-slot-control */ in _action_wl_2g_scc_v2()
4299 dm->wl_scc.null_role1 = RTW89_WIFI_ROLE_STATION; in _action_wl_2g_scc_v2()
4300 dm->wl_scc.null_role2 = RTW89_WIFI_ROLE_STATION; in _action_wl_2g_scc_v2()
4301 dm->wl_scc.ebt_null = 0; /* no ext-slot-control */ in _action_wl_2g_scc_v2()
4307 dm->wl_scc.null_role1 = RTW89_WIFI_ROLE_STATION; in _action_wl_2g_scc_v2()
4308 dm->wl_scc.null_role2 = RTW89_WIFI_ROLE_NONE; in _action_wl_2g_scc_v2()
4312 dm->wl_scc.ebt_null = 0; in _action_wl_2g_scc_v2()
4315 dm->wl_scc.ebt_null = 0; in _action_wl_2g_scc_v2()
4319 dm->wl_scc.ebt_null = 1; /* tx null at EBT */ in _action_wl_2g_scc_v2()
4323 dm->wl_scc.ebt_null = 1; /* tx null at EBT */ in _action_wl_2g_scc_v2()
4326 dm->wl_scc.ebt_null = 0; in _action_wl_2g_scc_v2()
4936 struct rtw89_btc_dm *dm = &rtwdev->btc.dm; in rtw89_coex_act1_work() local
4942 dm->cnt_notify[BTC_NCNT_TIMER]++; in rtw89_coex_act1_work()
4957 struct rtw89_btc_dm *dm = &rtwdev->btc.dm; in rtw89_coex_bt_devinfo_work() local
4962 dm->cnt_notify[BTC_NCNT_TIMER]++; in rtw89_coex_bt_devinfo_work()
4973 struct rtw89_btc_dm *dm = &rtwdev->btc.dm; in rtw89_coex_rfk_chk_work() local
4979 dm->cnt_notify[BTC_NCNT_TIMER]++; in rtw89_coex_rfk_chk_work()
4984 dm->error.map.wl_rfk_timeout = true; in rtw89_coex_rfk_chk_work()
5015 btc->dm.cnt_dm[BTC_DCNT_BTCNT_HANG] >= BTC_CHK_HANG_MAX) in _update_bt_scbd()
5080 struct rtw89_btc_dm *dm = &rtwdev->btc.dm; in _run_coex() local
5091 dm->run_reason = reason; in _run_coex()
5107 __func__, dm->wl_only, dm->bt_only); in _run_coex()
5143 dm->cnt_dm[BTC_DCNT_RUN]++; in _run_coex()
5144 dm->fddt_train = BTC_FDDT_DISABLE; in _run_coex()
5152 if (dm->wl_only) { in _run_coex()
5158 if (wl->status.map.rf_off || wl->status.map.lps || dm->bt_only) { in _run_coex()
5165 dm->freerun = false; in _run_coex()
5260 btc->dm.cnt_notify[BTC_NCNT_POWER_ON]++; in rtw89_btc_ntfy_poweron()
5269 btc->dm.cnt_notify[BTC_NCNT_POWER_OFF]++; in rtw89_btc_ntfy_poweroff()
5287 struct rtw89_btc_dm *dm = &btc->dm; in _set_init_info() local
5290 dm->init_info.wl_only = (u8)dm->wl_only; in _set_init_info()
5291 dm->init_info.bt_only = (u8)dm->bt_only; in _set_init_info()
5292 dm->init_info.wl_init_ok = (u8)wl->status.map.init_ok; in _set_init_info()
5293 dm->init_info.dbcc_en = rtwdev->dbcc_en; in _set_init_info()
5294 dm->init_info.cx_other = btc->cx.other.type; in _set_init_info()
5295 dm->init_info.wl_guard_ch = chip->afh_guard_ch; in _set_init_info()
5296 dm->init_info.module = btc->mdinfo; in _set_init_info()
5302 struct rtw89_btc_dm *dm = &rtwdev->btc.dm; in rtw89_btc_ntfy_init() local
5307 btc->dm.run_reason = BTC_RSN_NONE; in rtw89_btc_ntfy_init()
5308 btc->dm.run_action = BTC_ACT_NONE; in rtw89_btc_ntfy_init()
5314 dm->cnt_notify[BTC_NCNT_INIT_COEX]++; in rtw89_btc_ntfy_init()
5315 dm->wl_only = mode == BTC_MODE_WL ? 1 : 0; in rtw89_btc_ntfy_init()
5316 dm->bt_only = mode == BTC_MODE_BT ? 1 : 0; in rtw89_btc_ntfy_init()
5326 dm->error.map.init = true; in rtw89_btc_ntfy_init()
5337 dm->error.map.pta_owner = true; in rtw89_btc_ntfy_init()
5342 rtw89_btc_fw_set_slots(rtwdev, CXST_MAX, dm->slot); in rtw89_btc_ntfy_init()
5358 btc->dm.cnt_notify[BTC_NCNT_SCAN_START]++; in rtw89_btc_ntfy_scan_start()
5380 btc->dm.cnt_notify[BTC_NCNT_SCAN_FINISH]++; in rtw89_btc_ntfy_scan_finish()
5402 btc->dm.cnt_notify[BTC_NCNT_SWITCH_BAND]++; in rtw89_btc_ntfy_switch_band()
5476 btc->dm.cnt_notify[BTC_NCNT_SPECIAL_PACKET]++; in rtw89_btc_ntfy_specific_packet()
5581 btc->dm.trx_info.bt_profile = u32_get_bits(btinfo.val, BT_PROFILE_PROTOCOL_MASK); in _update_bt_info()
5598 btc->dm.trx_info.bt_rssi = b->rssi; in _update_bt_info()
5733 btc->dm.cnt_notify[BTC_NCNT_ROLE_INFO]++; in rtw89_btc_ntfy_role_info()
5747 btc->dm.leak_ap = 0; in rtw89_btc_ntfy_role_info()
5769 btc->dm.cnt_notify[BTC_NCNT_RADIO_STATE]++; in rtw89_btc_ntfy_radio_state()
5809 btc->dm.cnt_dm[BTC_DCNT_BTCNT_HANG] = 0; in rtw89_btc_ntfy_radio_state()
5812 btc->dm.tdma_instant_excute = 1; in rtw89_btc_ntfy_radio_state()
5814 btc->dm.tdma_instant_excute = 0; in rtw89_btc_ntfy_radio_state()
5817 btc->dm.tdma_instant_excute = 0; in rtw89_btc_ntfy_radio_state()
5848 btc->dm.cnt_notify[BTC_NCNT_WL_RFK]++; in _ntfy_wl_rfk()
5885 __func__, btc->dm.cnt_notify[BTC_NCNT_WL_RFK], result); in _ntfy_wl_rfk()
5941 struct rtw89_btc_dm *dm = &btc->dm; in rtw89_btc_ntfy_wl_sta_iter() local
6030 dm->trx_info.tx_rate = link_info_t->tx_rate; in rtw89_btc_ntfy_wl_sta_iter()
6031 dm->trx_info.rx_rate = link_info_t->rx_rate; in rtw89_btc_ntfy_wl_sta_iter()
6047 dm->trx_info.tx_lvl = stats->tx_tfc_lv; in rtw89_btc_ntfy_wl_sta_iter()
6048 dm->trx_info.rx_lvl = stats->rx_tfc_lv; in rtw89_btc_ntfy_wl_sta_iter()
6049 dm->trx_info.tx_rate = rtwsta->ra_report.hw_rate; in rtw89_btc_ntfy_wl_sta_iter()
6050 dm->trx_info.rx_rate = rtwsta->rx_hw_rate; in rtw89_btc_ntfy_wl_sta_iter()
6053 dm->trx_info.tx_tp = link_info_t->tx_throughput; in rtw89_btc_ntfy_wl_sta_iter()
6054 dm->trx_info.rx_tp = link_info_t->rx_throughput; in rtw89_btc_ntfy_wl_sta_iter()
6068 struct rtw89_btc_dm *dm = &btc->dm; in rtw89_btc_ntfy_wl_sta() local
6078 btc->dm.cnt_notify[BTC_NCNT_WL_STA]++; in rtw89_btc_ntfy_wl_sta()
6087 if (dm->trx_info.wl_rssi != wl->rssi_level) in rtw89_btc_ntfy_wl_sta()
6088 dm->trx_info.wl_rssi = wl->rssi_level; in rtw89_btc_ntfy_wl_sta()
6101 } else if (btc->dm.cnt_notify[BTC_NCNT_WL_STA] >= in rtw89_btc_ntfy_wl_sta()
6102 btc->dm.cnt_dm[BTC_DCNT_WL_STA_LAST] + BTC_NHM_CHK_INTVL) { in rtw89_btc_ntfy_wl_sta()
6103 btc->dm.cnt_dm[BTC_DCNT_WL_STA_LAST] = in rtw89_btc_ntfy_wl_sta()
6104 btc->dm.cnt_notify[BTC_NCNT_WL_STA]; in rtw89_btc_ntfy_wl_sta()
6105 } else if (btc->dm.cnt_notify[BTC_NCNT_WL_STA] < in rtw89_btc_ntfy_wl_sta()
6106 btc->dm.cnt_dm[BTC_DCNT_WL_STA_LAST]) { in rtw89_btc_ntfy_wl_sta()
6107 btc->dm.cnt_dm[BTC_DCNT_WL_STA_LAST] = in rtw89_btc_ntfy_wl_sta()
6108 btc->dm.cnt_notify[BTC_NCNT_WL_STA]; in rtw89_btc_ntfy_wl_sta()
6159 btc->dm.cnt_dm[BTC_DCNT_CX_RUNINFO]++; in rtw89_btc_c2h_handle()
6171 struct rtw89_btc_dm *dm = &btc->dm; in _show_cx_info() local
6176 if (!(dm->coex_info_map & BTC_COEX_INFO_CX)) in _show_cx_info()
6179 dm->cnt_notify[BTC_NCNT_SHOW_COEX_INFO]++; in _show_cx_info()
6305 if (!(btc->dm.coex_info_map & BTC_COEX_INFO_WL)) in _show_wl_info()
6406 if (!(btc->dm.coex_info_map & BTC_COEX_INFO_BT)) in _show_bt_info()
6753 struct rtw89_btc_dm *dm = &btc->dm; in _show_dm_step() local
6757 len = dm->dm_step.step_ov ? RTW89_BTC_DM_MAXSTEP : dm->dm_step.step_pos; in _show_dm_step()
6758 start_idx = dm->dm_step.step_ov ? dm->dm_step.step_pos : 0; in _show_dm_step()
6760 seq_print_segment(m, "[dm_steps]", dm->dm_step.step, len, 6, start_idx, in _show_dm_step()
6761 ARRAY_SIZE(dm->dm_step.step)); in _show_dm_step()
6768 struct rtw89_btc_dm *dm = &btc->dm; in _show_dm_info() local
6772 if (!(dm->coex_info_map & BTC_COEX_INFO_DM)) in _show_dm_info()
6782 steps_to_str(dm->run_reason), in _show_dm_info()
6783 steps_to_str(dm->run_action | BTC_ACT_EXT_BIT), in _show_dm_info()
6784 FIELD_GET(GENMASK(7, 0), dm->set_ant_path), in _show_dm_info()
6785 dm->cnt_dm[BTC_DCNT_RUN]); in _show_dm_info()
6790 "[dm_flag]", dm->wl_only, dm->bt_only, btc->ctrl.igno_bt, in _show_dm_info()
6791 dm->freerun, btc->lps, dm->wl_mimo_ps); in _show_dm_info()
6793 seq_printf(m, "leak_ap:%d, fw_offload:%s%s\n", dm->leak_ap, in _show_dm_info()
6795 (dm->wl_fw_cx_offload == BTC_CX_FW_OFFLOAD ? in _show_dm_info()
6798 if (dm->rf_trx_para.wl_tx_power == 0xff) in _show_dm_info()
6801 "[trx_ctrl]", wl->rssi_level, dm->trx_para_level); in _show_dm_info()
6806 "[trx_ctrl]", wl->rssi_level, dm->trx_para_level, in _show_dm_info()
6807 dm->rf_trx_para.wl_tx_power); in _show_dm_info()
6811 dm->rf_trx_para.wl_rx_gain, dm->rf_trx_para.bt_tx_power, in _show_dm_info()
6812 dm->rf_trx_para.bt_rx_gain, in _show_dm_info()
6813 (bt->hi_lna_rx ? "Hi" : "Ori"), dm->wl_btg_rx); in _show_dm_info()
6817 "[dm_ctrl]", dm->wl_tx_limit.enable, dm->wl_tx_limit.tx_time, in _show_dm_info()
6818 dm->wl_tx_limit.tx_retry, btc->bt_req_len, bt->scan_rx_low_pri); in _show_dm_info()
6921 struct rtw89_btc_dm *dm = &btc->dm; in _show_fbtc_slots() local
6926 s = &dm->slot_now[i]; in _show_fbtc_slots()
6948 struct rtw89_btc_dm *dm = &btc->dm; in _show_fbtc_cysta_v2() local
6977 if (dm->tdma_now.rxflctrl) { in _show_fbtc_cysta_v2()
7050 r.val = dm->tdma_now.rxflctrl; in _show_fbtc_cysta_v2()
7077 struct rtw89_btc_dm *dm = &btc->dm; in _show_fbtc_cysta_v3() local
7106 if (dm->tdma_now.rxflctrl) in _show_fbtc_cysta_v3()
7207 struct rtw89_btc_dm *dm = &btc->dm; in _show_fbtc_cysta_v4() local
7236 if (dm->tdma_now.rxflctrl) in _show_fbtc_cysta_v4()
7339 struct rtw89_btc_dm *dm = &btc->dm; in _show_fbtc_cysta_v5() local
7368 if (dm->tdma_now.rxflctrl) in _show_fbtc_cysta_v5()
7474 if (!btc->dm.tdma_now.rxflctrl) in _show_fbtc_nullsta()
7656 if (!(btc->dm.coex_info_map & BTC_COEX_INFO_DM)) in _show_fw_dm_msg()
7738 if (!(btc->dm.coex_info_map & BTC_COEX_INFO_MREG)) in _show_mreg_v1()
7751 btc->dm.pta_owner = rtw89_mac_get_ctrl_path(rtwdev); in _show_mreg_v1()
7759 btc->dm.pta_owner == BTC_CTRL_BY_WL ? "WL" : "BT", in _show_mreg_v1()
7842 if (!(btc->dm.coex_info_map & BTC_COEX_INFO_MREG)) in _show_mreg_v2()
7855 btc->dm.pta_owner = rtw89_mac_get_ctrl_path(rtwdev); in _show_mreg_v2()
7863 btc->dm.pta_owner == BTC_CTRL_BY_WL ? "WL" : "BT", in _show_mreg_v2()
7937 struct rtw89_btc_dm *dm = &btc->dm; in _show_summary_v1() local
7940 u32 cnt_sum = 0, *cnt = btc->dm.cnt_notify; in _show_summary_v1()
7943 if (!(dm->coex_info_map & BTC_COEX_INFO_SUMMARY)) in _show_summary_v1()
7961 prptctrl->rpt_enable, dm->error.val); in _show_summary_v1()
7963 if (dm->error.map.wl_fw_hang) in _show_summary_v1()
7997 dm->error.map.wl_rfk_timeout = bt->rfk_info.map.timeout; in _show_summary_v1()
8009 cnt_sum += dm->cnt_notify[i]; in _show_summary_v1()
8041 struct rtw89_btc_dm *dm = &btc->dm; in _show_summary_v4() local
8044 u32 cnt_sum = 0, *cnt = btc->dm.cnt_notify; in _show_summary_v4()
8047 if (!(dm->coex_info_map & BTC_COEX_INFO_SUMMARY)) in _show_summary_v4()
8069 dm->error.val); in _show_summary_v4()
8071 if (dm->error.map.wl_fw_hang) in _show_summary_v4()
8109 dm->error.map.wl_rfk_timeout = bt->rfk_info.map.timeout; in _show_summary_v4()
8121 cnt_sum += dm->cnt_notify[i]; in _show_summary_v4()
8153 struct rtw89_btc_dm *dm = &btc->dm; in _show_summary_v5() local
8155 u32 cnt_sum = 0, *cnt = btc->dm.cnt_notify; in _show_summary_v5()
8158 if (!(dm->coex_info_map & BTC_COEX_INFO_SUMMARY)) in _show_summary_v5()
8181 if (dm->error.map.wl_fw_hang) in _show_summary_v5()
8233 cnt_sum += dm->cnt_notify[i]; in _show_summary_v5()
8268 struct rtw89_btc_dm *dm = &btc->dm; in _show_summary_v105() local
8270 u32 cnt_sum = 0, *cnt = btc->dm.cnt_notify; in _show_summary_v105()
8273 if (!(dm->coex_info_map & BTC_COEX_INFO_SUMMARY)) in _show_summary_v105()
8296 if (dm->error.map.wl_fw_hang) in _show_summary_v105()
8348 cnt_sum += dm->cnt_notify[i]; in _show_summary_v105()