Lines Matching +full:tx +full:- +full:swing +full:- +full:low
1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2 /* Copyright(c) 2018-2019 Realtek Corporation
9 #include "tx.h"
26 ether_addr_copy(efuse->addr, map->e.mac_addr); in rtw8822be_efuse_parsing()
32 ether_addr_copy(efuse->addr, map->u.mac_addr); in rtw8822bu_efuse_parsing()
38 ether_addr_copy(efuse->addr, map->s.mac_addr); in rtw8822bs_efuse_parsing()
43 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw8822b_read_efuse()
49 efuse->rfe_option = map->rfe_option; in rtw8822b_read_efuse()
50 efuse->rf_board_option = map->rf_board_option; in rtw8822b_read_efuse()
51 efuse->crystal_cap = map->xtal_k; in rtw8822b_read_efuse()
52 efuse->pa_type_2g = map->pa_type; in rtw8822b_read_efuse()
53 efuse->pa_type_5g = map->pa_type; in rtw8822b_read_efuse()
54 efuse->lna_type_2g = map->lna_type_2g[0]; in rtw8822b_read_efuse()
55 efuse->lna_type_5g = map->lna_type_5g[0]; in rtw8822b_read_efuse()
56 efuse->channel_plan = map->channel_plan; in rtw8822b_read_efuse()
57 efuse->country_code[0] = map->country_code[0]; in rtw8822b_read_efuse()
58 efuse->country_code[1] = map->country_code[1]; in rtw8822b_read_efuse()
59 efuse->bt_setting = map->rf_bt_setting; in rtw8822b_read_efuse()
60 efuse->regd = map->rf_board_option & 0x7; in rtw8822b_read_efuse()
61 efuse->thermal_meter[RF_PATH_A] = map->thermal_meter; in rtw8822b_read_efuse()
62 efuse->thermal_meter_k = map->thermal_meter; in rtw8822b_read_efuse()
65 efuse->txpwr_idx_table[i] = map->txpwr_idx_table[i]; in rtw8822b_read_efuse()
79 return -ENOTSUPP; in rtw8822b_read_efuse()
112 u32 swing, table_value; in rtw8822b_get_swing_index() local
114 swing = rtw_read32_mask(rtwdev, 0xc1c, 0xffe00000); in rtw8822b_get_swing_index()
117 if (swing == table_value) in rtw8822b_get_swing_index()
126 struct rtw_dm_info *dm_info = &rtwdev->dm_info; in rtw8822b_pwrtrack_init()
131 dm_info->default_ofdm_index = 24; in rtw8822b_pwrtrack_init()
133 dm_info->default_ofdm_index = swing_idx; in rtw8822b_pwrtrack_init()
135 for (path = RF_PATH_A; path < rtwdev->hal.rf_path_num; path++) { in rtw8822b_pwrtrack_init()
136 ewma_thermal_init(&dm_info->avg_thermal[path]); in rtw8822b_pwrtrack_init()
137 dm_info->delta_power_index[path] = 0; in rtw8822b_pwrtrack_init()
139 dm_info->pwr_trk_triggered = false; in rtw8822b_pwrtrack_init()
140 dm_info->pwr_trk_init_trigger = true; in rtw8822b_pwrtrack_init()
141 dm_info->thermal_meter_k = rtwdev->efuse.thermal_meter_k; in rtw8822b_pwrtrack_init()
153 struct rtw_hal *hal = &rtwdev->hal; in rtw8822b_phy_set_param()
169 crystal_cap = rtwdev->efuse.crystal_cap & 0x3F; in rtw8822b_phy_set_param()
177 rtw8822b_config_trx_mode(rtwdev, hal->antenna_tx, hal->antenna_rx, in rtw8822b_phy_set_param()
267 /* Set beacon cotnrol - enable TSF and other related functions */ in rtw8822b_mac_init()
291 struct rtw_hal *hal = &rtwdev->hal; in rtw8822b_set_channel_rfe_efem()
305 if (hal->antenna_rx == BB_PATH_AB || in rtw8822b_set_channel_rfe_efem()
306 hal->antenna_tx == BB_PATH_AB) { in rtw8822b_set_channel_rfe_efem()
307 /* 2TX or 2RX */ in rtw8822b_set_channel_rfe_efem()
309 } else if (hal->antenna_rx == hal->antenna_tx) { in rtw8822b_set_channel_rfe_efem()
320 struct rtw_hal *hal = &rtwdev->hal; in rtw8822b_set_channel_rfe_ifem()
335 if (hal->antenna_rx == BB_PATH_AB || in rtw8822b_set_channel_rfe_ifem()
336 hal->antenna_tx == BB_PATH_AB) { in rtw8822b_set_channel_rfe_ifem()
337 /* 2TX or 2RX */ in rtw8822b_set_channel_rfe_ifem()
339 } else if (hal->antenna_rx == hal->antenna_tx) { in rtw8822b_set_channel_rfe_ifem()
386 *reg82c = cca_ccut->reg82c[col]; in rtw8822b_get_cca_val()
387 *reg830 = cca_ccut->reg830[col]; in rtw8822b_get_cca_val()
388 *reg838 = cca_ccut->reg838[col]; in rtw8822b_get_cca_val()
423 struct rtw_hal *hal = &rtwdev->hal; in rtw8822b_set_channel_cca()
424 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw8822b_set_channel_cca()
431 cca_ccut = rfe_info->cca_ccut_2g; in rtw8822b_set_channel_cca()
433 if (hal->antenna_rx == BB_PATH_A || in rtw8822b_set_channel_cca()
434 hal->antenna_rx == BB_PATH_B) in rtw8822b_set_channel_cca()
439 cca_ccut = rfe_info->cca_ccut_5g; in rtw8822b_set_channel_cca()
441 if (hal->antenna_rx == BB_PATH_A || in rtw8822b_set_channel_cca()
442 hal->antenna_rx == BB_PATH_B) in rtw8822b_set_channel_cca()
450 switch (rfe_info->fem) { in rtw8822b_set_channel_cca()
454 if (rfe_info->ifem_ext) in rtw8822b_set_channel_cca()
469 if ((hal->cut_version == RTW_CHIP_VER_CUT_B && in rtw8822b_set_channel_cca()
474 (efuse->rfe_option == 5 && col == CCUT_IDX_2R_5G)) in rtw8822b_set_channel_cca()
482 if (is_efem_cca && !(hal->cut_version == RTW_CHIP_VER_CUT_B)) in rtw8822b_set_channel_cca()
512 struct rtw_hal *hal = &rtwdev->hal; in rtw8822b_set_channel_rf()
545 rf_reg_be = low_band[(channel - 36) >> 1]; in rtw8822b_set_channel_rf()
547 rf_reg_be = middle_band[(channel - 100) >> 1]; in rtw8822b_set_channel_rf()
549 rf_reg_be = high_band[(channel - 149) >> 1]; in rtw8822b_set_channel_rf()
562 if (hal->rf_type > RF_1T1R) in rtw8822b_set_channel_rf()
576 struct rtw_hal *hal = &rtwdev->hal; in rtw8822b_toggle_igi()
580 rtw_write32_mask(rtwdev, REG_RXIGI_A, 0x7f, igi - 2); in rtw8822b_toggle_igi()
582 rtw_write32_mask(rtwdev, REG_RXIGI_B, 0x7f, igi - 2); in rtw8822b_toggle_igi()
587 hal->antenna_rx | (hal->antenna_rx << 4)); in rtw8822b_toggle_igi()
613 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw8822b_set_channel_bb()
614 u8 rfe_option = efuse->rfe_option; in rtw8822b_set_channel_bb()
719 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw8822b_set_channel()
722 if (WARN(efuse->rfe_option >= ARRAY_SIZE(rtw8822b_rfe_info), in rtw8822b_set_channel()
723 "rfe_option %d is out of boundary\n", efuse->rfe_option)) in rtw8822b_set_channel()
726 rfe_info = &rtw8822b_rfe_info[efuse->rfe_option]; in rtw8822b_set_channel()
734 (*rfe_info->rtw_set_channel_rfe)(rtwdev, channel); in rtw8822b_set_channel()
740 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw8822b_config_trx_mode()
742 u8 ch = rtwdev->hal.current_channel; in rtw8822b_config_trx_mode()
746 if (WARN(efuse->rfe_option >= ARRAY_SIZE(rtw8822b_rfe_info), in rtw8822b_config_trx_mode()
747 "rfe_option %d is out of boundary\n", efuse->rfe_option)) in rtw8822b_config_trx_mode()
750 rfe_info = &rtw8822b_rfe_info[efuse->rfe_option]; in rtw8822b_config_trx_mode()
783 if (is_tx2_path || rtwdev->mp_mode) { in rtw8822b_config_trx_mode()
810 for (counter = 100; counter > 0; counter--) { in rtw8822b_config_trx_mode()
835 (*rfe_info->rtw_set_channel_rfe)(rtwdev, ch); in rtw8822b_config_trx_mode()
841 struct rtw_dm_info *dm_info = &rtwdev->dm_info; in query_phy_status_page0()
842 s8 min_rx_power = -120; in query_phy_status_page0()
846 pkt_stat->rx_power[RF_PATH_A] = pwdb - 110; in query_phy_status_page0()
847 pkt_stat->rssi = rtw_phy_rf_power_2_rssi(pkt_stat->rx_power, 1); in query_phy_status_page0()
848 pkt_stat->bw = RTW_CHANNEL_WIDTH_20; in query_phy_status_page0()
849 pkt_stat->signal_power = max(pkt_stat->rx_power[RF_PATH_A], in query_phy_status_page0()
851 dm_info->rssi[RF_PATH_A] = pkt_stat->rssi; in query_phy_status_page0()
857 struct rtw_dm_info *dm_info = &rtwdev->dm_info; in query_phy_status_page1()
859 s8 min_rx_power = -120; in query_phy_status_page1()
865 if (pkt_stat->rate > DESC_RATE11M && pkt_stat->rate < DESC_RATEMCS0) in query_phy_status_page1()
879 pkt_stat->rx_power[RF_PATH_A] = GET_PHY_STAT_P1_PWDB_A(phy_status) - 110; in query_phy_status_page1()
880 pkt_stat->rx_power[RF_PATH_B] = GET_PHY_STAT_P1_PWDB_B(phy_status) - 110; in query_phy_status_page1()
881 pkt_stat->rssi = rtw_phy_rf_power_2_rssi(pkt_stat->rx_power, 2); in query_phy_status_page1()
882 pkt_stat->bw = bw; in query_phy_status_page1()
883 pkt_stat->signal_power = max3(pkt_stat->rx_power[RF_PATH_A], in query_phy_status_page1()
884 pkt_stat->rx_power[RF_PATH_B], in query_phy_status_page1()
887 dm_info->curr_rx_rate = pkt_stat->rate; in query_phy_status_page1()
889 pkt_stat->rx_evm[RF_PATH_A] = GET_PHY_STAT_P1_RXEVM_A(phy_status); in query_phy_status_page1()
890 pkt_stat->rx_evm[RF_PATH_B] = GET_PHY_STAT_P1_RXEVM_B(phy_status); in query_phy_status_page1()
892 pkt_stat->rx_snr[RF_PATH_A] = GET_PHY_STAT_P1_RXSNR_A(phy_status); in query_phy_status_page1()
893 pkt_stat->rx_snr[RF_PATH_B] = GET_PHY_STAT_P1_RXSNR_B(phy_status); in query_phy_status_page1()
895 pkt_stat->cfo_tail[RF_PATH_A] = GET_PHY_STAT_P1_CFO_TAIL_A(phy_status); in query_phy_status_page1()
896 pkt_stat->cfo_tail[RF_PATH_B] = GET_PHY_STAT_P1_CFO_TAIL_B(phy_status); in query_phy_status_page1()
898 for (path = 0; path <= rtwdev->hal.rf_path_num; path++) { in query_phy_status_page1()
899 rssi = rtw_phy_rf_power_2_rssi(&pkt_stat->rx_power[path], 1); in query_phy_status_page1()
900 dm_info->rssi[path] = rssi; in query_phy_status_page1()
901 dm_info->rx_snr[path] = pkt_stat->rx_snr[path] >> 1; in query_phy_status_page1()
902 dm_info->cfo_tail[path] = (pkt_stat->cfo_tail[path] * 5) >> 1; in query_phy_status_page1()
904 rx_evm = pkt_stat->rx_evm[path]; in query_phy_status_page1()
910 evm_dbm = ((u8)-rx_evm >> 1); in query_phy_status_page1()
912 dm_info->rx_evm_dbm[path] = evm_dbm; in query_phy_status_page1()
941 u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz; in rtw8822b_query_rx_desc()
946 pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc); in rtw8822b_query_rx_desc()
947 pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc); in rtw8822b_query_rx_desc()
948 pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc); in rtw8822b_query_rx_desc()
949 pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) && in rtw8822b_query_rx_desc()
951 pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc); in rtw8822b_query_rx_desc()
952 pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc); in rtw8822b_query_rx_desc()
953 pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc); in rtw8822b_query_rx_desc()
954 pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc); in rtw8822b_query_rx_desc()
955 pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc); in rtw8822b_query_rx_desc()
956 pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc); in rtw8822b_query_rx_desc()
957 pkt_stat->ppdu_cnt = GET_RX_DESC_PPDU_CNT(rx_desc); in rtw8822b_query_rx_desc()
958 pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc); in rtw8822b_query_rx_desc()
960 /* drv_info_sz is in unit of 8-bytes */ in rtw8822b_query_rx_desc()
961 pkt_stat->drv_info_sz *= 8; in rtw8822b_query_rx_desc()
964 if (pkt_stat->is_c2h) in rtw8822b_query_rx_desc()
967 hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift + in rtw8822b_query_rx_desc()
968 pkt_stat->drv_info_sz); in rtw8822b_query_rx_desc()
969 if (pkt_stat->phy_status) { in rtw8822b_query_rx_desc()
970 phy_status = rx_desc + desc_sz + pkt_stat->shift; in rtw8822b_query_rx_desc()
980 struct rtw_hal *hal = &rtwdev->hal; in rtw8822b_set_tx_power_index_by_rate()
988 pwr_index = hal->tx_pwr_tbl[path][rate]; in rtw8822b_set_tx_power_index_by_rate()
1002 struct rtw_hal *hal = &rtwdev->hal; in rtw8822b_set_tx_power_index()
1005 for (path = 0; path < hal->rf_path_num; path++) { in rtw8822b_set_tx_power_index()
1027 struct rtw_hal *hal = &rtwdev->hal; in rtw8822b_set_antenna()
1029 rtw_dbg(rtwdev, RTW_DBG_PHY, "config RF path, tx=0x%x rx=0x%x\n", in rtw8822b_set_antenna()
1033 rtw_warn(rtwdev, "unsupported tx path 0x%x\n", antenna_tx); in rtw8822b_set_antenna()
1034 return -EINVAL; in rtw8822b_set_antenna()
1039 return -EINVAL; in rtw8822b_set_antenna()
1042 hal->antenna_tx = antenna_tx; in rtw8822b_set_antenna()
1043 hal->antenna_rx = antenna_rx; in rtw8822b_set_antenna()
1061 struct rtw_dm_info *dm_info = &rtwdev->dm_info; in rtw8822b_false_alarm_statistics()
1072 dm_info->cck_fa_cnt = cck_fa_cnt; in rtw8822b_false_alarm_statistics()
1073 dm_info->ofdm_fa_cnt = ofdm_fa_cnt; in rtw8822b_false_alarm_statistics()
1074 dm_info->total_fa_cnt = ofdm_fa_cnt; in rtw8822b_false_alarm_statistics()
1075 dm_info->total_fa_cnt += cck_enable ? cck_fa_cnt : 0; in rtw8822b_false_alarm_statistics()
1078 dm_info->cck_ok_cnt = crc32_cnt & 0xffff; in rtw8822b_false_alarm_statistics()
1079 dm_info->cck_err_cnt = (crc32_cnt & 0xffff0000) >> 16; in rtw8822b_false_alarm_statistics()
1081 dm_info->ofdm_ok_cnt = crc32_cnt & 0xffff; in rtw8822b_false_alarm_statistics()
1082 dm_info->ofdm_err_cnt = (crc32_cnt & 0xffff0000) >> 16; in rtw8822b_false_alarm_statistics()
1084 dm_info->ht_ok_cnt = crc32_cnt & 0xffff; in rtw8822b_false_alarm_statistics()
1085 dm_info->ht_err_cnt = (crc32_cnt & 0xffff0000) >> 16; in rtw8822b_false_alarm_statistics()
1087 dm_info->vht_ok_cnt = crc32_cnt & 0xffff; in rtw8822b_false_alarm_statistics()
1088 dm_info->vht_err_cnt = (crc32_cnt & 0xffff0000) >> 16; in rtw8822b_false_alarm_statistics()
1091 dm_info->ofdm_cca_cnt = ((cca32_cnt & 0xffff0000) >> 16); in rtw8822b_false_alarm_statistics()
1092 dm_info->total_cca_cnt = dm_info->ofdm_cca_cnt; in rtw8822b_false_alarm_statistics()
1095 dm_info->cck_cca_cnt = cca32_cnt & 0xffff; in rtw8822b_false_alarm_statistics()
1096 dm_info->total_cca_cnt += dm_info->cck_cca_cnt; in rtw8822b_false_alarm_statistics()
1149 /* enable PTA (3-wire function form BT side) */ in rtw8822b_coex_cfg_init()
1153 /* enable PTA (tx/rx signal form WiFi side) */ in rtw8822b_coex_cfg_init()
1155 /* wl tx signal to PTA not case EDCCA */ in rtw8822b_coex_cfg_init()
1164 struct rtw_coex *coex = &rtwdev->coex; in rtw8822b_coex_cfg_ant_switch()
1165 struct rtw_coex_dm *coex_dm = &coex->dm; in rtw8822b_coex_cfg_ant_switch()
1166 struct rtw_coex_rfe *coex_rfe = &coex->rfe; in rtw8822b_coex_cfg_ant_switch()
1170 if (((ctrl_type << 8) + pos_type) == coex_dm->cur_switch_status) in rtw8822b_coex_cfg_ant_switch()
1173 coex_dm->cur_switch_status = (ctrl_type << 8) + pos_type; in rtw8822b_coex_cfg_ant_switch()
1175 if (coex_rfe->ant_switch_diversity && in rtw8822b_coex_cfg_ant_switch()
1179 polarity_inverse = (coex_rfe->ant_switch_polarity == 1); in rtw8822b_coex_cfg_ant_switch()
1192 if (coex_rfe->rfe_module_type != 0x4 && in rtw8822b_coex_cfg_ant_switch()
1193 coex_rfe->rfe_module_type != 0x2) in rtw8822b_coex_cfg_ant_switch()
1260 struct rtw_coex *coex = &rtwdev->coex; in rtw8822b_coex_cfg_rfe_type()
1261 struct rtw_coex_rfe *coex_rfe = &coex->rfe; in rtw8822b_coex_cfg_rfe_type()
1262 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw8822b_coex_cfg_rfe_type()
1265 coex_rfe->rfe_module_type = rtwdev->efuse.rfe_option; in rtw8822b_coex_cfg_rfe_type()
1266 coex_rfe->ant_switch_polarity = 0; in rtw8822b_coex_cfg_rfe_type()
1267 coex_rfe->ant_switch_diversity = false; in rtw8822b_coex_cfg_rfe_type()
1268 if (coex_rfe->rfe_module_type == 0x12 || in rtw8822b_coex_cfg_rfe_type()
1269 coex_rfe->rfe_module_type == 0x15 || in rtw8822b_coex_cfg_rfe_type()
1270 coex_rfe->rfe_module_type == 0x16) in rtw8822b_coex_cfg_rfe_type()
1271 coex_rfe->ant_switch_exist = false; in rtw8822b_coex_cfg_rfe_type()
1273 coex_rfe->ant_switch_exist = true; in rtw8822b_coex_cfg_rfe_type()
1275 if (coex_rfe->rfe_module_type == 2 || in rtw8822b_coex_cfg_rfe_type()
1276 coex_rfe->rfe_module_type == 4) { in rtw8822b_coex_cfg_rfe_type()
1283 coex_rfe->wlg_at_btg = false; in rtw8822b_coex_cfg_rfe_type()
1285 if (efuse->share_ant && in rtw8822b_coex_cfg_rfe_type()
1286 coex_rfe->ant_switch_exist && !is_ext_fem) in rtw8822b_coex_cfg_rfe_type()
1287 coex_rfe->ant_switch_with_bt = true; in rtw8822b_coex_cfg_rfe_type()
1289 coex_rfe->ant_switch_with_bt = false; in rtw8822b_coex_cfg_rfe_type()
1308 struct rtw_coex *coex = &rtwdev->coex; in rtw8822b_coex_cfg_wl_tx_power()
1309 struct rtw_coex_dm *coex_dm = &coex->dm; in rtw8822b_coex_cfg_wl_tx_power()
1314 if (wl_pwr == coex_dm->cur_wl_pwr_lvl) in rtw8822b_coex_cfg_wl_tx_power()
1317 coex_dm->cur_wl_pwr_lvl = wl_pwr; in rtw8822b_coex_cfg_wl_tx_power()
1319 if (coex_dm->cur_wl_pwr_lvl >= ARRAY_SIZE(wl_tx_power)) in rtw8822b_coex_cfg_wl_tx_power()
1320 coex_dm->cur_wl_pwr_lvl = ARRAY_SIZE(wl_tx_power) - 1; in rtw8822b_coex_cfg_wl_tx_power()
1322 pwr = wl_tx_power[coex_dm->cur_wl_pwr_lvl]; in rtw8822b_coex_cfg_wl_tx_power()
1330 struct rtw_coex *coex = &rtwdev->coex; in rtw8822b_coex_cfg_wl_rx_gain()
1331 struct rtw_coex_dm *coex_dm = &coex->dm; in rtw8822b_coex_cfg_wl_rx_gain()
1332 /* WL Rx Low gain on */ in rtw8822b_coex_cfg_wl_rx_gain()
1345 /* WL Rx Low gain off */ in rtw8822b_coex_cfg_wl_rx_gain()
1359 if (low_gain == coex_dm->cur_wl_rx_low_gain_en) in rtw8822b_coex_cfg_wl_rx_gain()
1362 coex_dm->cur_wl_rx_low_gain_en = low_gain; in rtw8822b_coex_cfg_wl_rx_gain()
1364 if (coex_dm->cur_wl_rx_low_gain_en) { in rtw8822b_coex_cfg_wl_rx_gain()
1365 rtw_dbg(rtwdev, RTW_DBG_COEX, "[BTCoex], Hi-Li Table On!\n"); in rtw8822b_coex_cfg_wl_rx_gain()
1375 rtw_dbg(rtwdev, RTW_DBG_COEX, "[BTCoex], Hi-Li Table Off!\n"); in rtw8822b_coex_cfg_wl_rx_gain()
1391 struct rtw_dm_info *dm_info = &rtwdev->dm_info; in rtw8822b_txagc_swing_offset()
1392 s8 delta_pwr_idx = dm_info->delta_power_index[path]; in rtw8822b_txagc_swing_offset()
1393 u8 swing_upper_bound = dm_info->default_ofdm_index + 10; in rtw8822b_txagc_swing_offset()
1397 u8 swing_index = dm_info->default_ofdm_index; in rtw8822b_txagc_swing_offset()
1404 swing_index = dm_info->default_ofdm_index; in rtw8822b_txagc_swing_offset()
1407 swing_index = dm_info->default_ofdm_index + in rtw8822b_txagc_swing_offset()
1408 delta_pwr_idx - tx_pwr_idx_offset; in rtw8822b_txagc_swing_offset()
1412 if (dm_info->default_ofdm_index > abs(delta_pwr_idx)) in rtw8822b_txagc_swing_offset()
1414 dm_info->default_ofdm_index + delta_pwr_idx; in rtw8822b_txagc_swing_offset()
1423 rtw_warn(rtwdev, "swing index overflow\n"); in rtw8822b_txagc_swing_offset()
1424 swing_index = RTW_TXSCALE_SIZE - 1; in rtw8822b_txagc_swing_offset()
1456 struct rtw_dm_info *dm_info = &rtwdev->dm_info; in rtw8822b_pwrtrack_set()
1458 u8 channel = rtwdev->hal.current_channel; in rtw8822b_pwrtrack_set()
1459 u8 band_width = rtwdev->hal.current_band_width; in rtw8822b_pwrtrack_set()
1461 u8 tx_rate = dm_info->tx_rate; in rtw8822b_pwrtrack_set()
1462 u8 max_pwr_idx = rtwdev->chip->max_power_index; in rtw8822b_pwrtrack_set()
1469 pwr_idx_offset = max_pwr_idx - tx_pwr_idx; in rtw8822b_pwrtrack_set()
1478 struct rtw_dm_info *dm_info = &rtwdev->dm_info; in rtw8822b_phy_pwrtrack_path()
1485 power_idx_last = dm_info->delta_power_index[path]; in rtw8822b_phy_pwrtrack_path()
1493 dm_info->delta_power_index[path] = power_idx_cur; in rtw8822b_phy_pwrtrack_path()
1499 struct rtw_dm_info *dm_info = &rtwdev->dm_info; in rtw8822b_phy_pwrtrack()
1505 if (rtwdev->efuse.thermal_meter[RF_PATH_A] == 0xff) in rtw8822b_phy_pwrtrack()
1512 if (dm_info->pwr_trk_init_trigger) in rtw8822b_phy_pwrtrack()
1513 dm_info->pwr_trk_init_trigger = false; in rtw8822b_phy_pwrtrack()
1518 for (path = 0; path < rtwdev->hal.rf_path_num; path++) in rtw8822b_phy_pwrtrack()
1528 struct rtw_efuse *efuse = &rtwdev->efuse; in rtw8822b_pwr_track()
1529 struct rtw_dm_info *dm_info = &rtwdev->dm_info; in rtw8822b_pwr_track()
1531 if (efuse->power_track_type != 0) in rtw8822b_pwr_track()
1534 if (!dm_info->pwr_trk_triggered) { in rtw8822b_pwr_track()
1537 dm_info->pwr_trk_triggered = true; in rtw8822b_pwr_track()
1542 dm_info->pwr_trk_triggered = false; in rtw8822b_pwr_track()
1568 if (bfee->role == RTW_BFEE_SU) in rtw8822b_bf_config_bfee()
1570 else if (bfee->role == RTW_BFEE_MU) in rtw8822b_bf_config_bfee()
1593 struct rtw_dm_info *dm_info = &rtwdev->dm_info; in rtw8822b_adaptivity()
1597 igi = dm_info->igi_history[0]; in rtw8822b_adaptivity()
1598 if (dm_info->edcca_mode == RTW_EDCCA_NORMAL) { in rtw8822b_adaptivity()
1600 h2l = l2h - EDCCA_L2H_H2L_DIFF_NORMAL; in rtw8822b_adaptivity()
1602 l2h = min_t(s8, igi, dm_info->l2h_th_ini); in rtw8822b_adaptivity()
1603 h2l = l2h - EDCCA_L2H_H2L_DIFF; in rtw8822b_adaptivity()
2204 /* Shared-Antenna Coex Table */
2206 {0xffffffff, 0xffffffff}, /* case-0 */
2211 {0xfafafafa, 0xfafafafa}, /* case-5 */
2216 {0x66555555, 0x6a5a5a5a}, /* case-10 */
2221 {0x66555555, 0xaaaaaaaa}, /* case-15 */
2226 {0xaa5555aa, 0x6a5a5a5a}, /* case-20 */
2231 {0xffffffff, 0x6a5a5aaa}, /* case-25 */
2236 {0x66556aaa, 0x6a5a6aaa}, /* case-30 */
2241 /* Non-Shared-Antenna Coex Table */
2243 {0xffffffff, 0xffffffff}, /* case-100 */
2248 {0xfafafafa, 0xfafafafa}, /* case-105 */
2253 {0x66555555, 0x6a5a5a5a}, /* case-110 */
2258 {0xffff55ff, 0xffff55ff}, /* case-115 */
2263 {0xffffffff, 0xaaaaaaaa}, /* case-120 */
2269 /* Shared-Antenna TDMA */
2271 { {0x00, 0x00, 0x00, 0x00, 0x00} }, /* case-0 */
2276 { {0x61, 0x10, 0x03, 0x11, 0x11} }, /* case-5 */
2281 { {0x61, 0x10, 0x03, 0x11, 0x10} }, /* case-10 */
2286 { {0x51, 0x08, 0x07, 0x10, 0x54} }, /* case-15 */
2291 { {0x51, 0x10, 0x03, 0x10, 0x50} }, /* case-20 */
2296 { {0x51, 0x10, 0x03, 0x10, 0x51} }, /* case-25 */
2301 /* Non-Shared-Antenna TDMA */
2303 { {0x00, 0x00, 0x00, 0x00, 0x00} }, /* case-100 */
2304 { {0x61, 0x45, 0x03, 0x11, 0x11} }, /* case-101 */
2308 { {0x61, 0x10, 0x03, 0x11, 0x11} }, /* case-105 */
2313 { {0x61, 0x10, 0x03, 0x11, 0x10} }, /* case-110 */
2318 { {0x51, 0x08, 0x07, 0x10, 0x54} }, /* case-115 */
2323 { {0x51, 0x10, 0x03, 0x10, 0x50} }, /* case-120 */
2327 /* rssi in percentage % (dbm = % - 100) */
2334 {0, 16, false, 7}, /* for WL-CPT */
2343 {0, 16, false, 7}, /* for WL-CPT */
2579 .l2h_th_ini_ad = -14 + EDCCA_IGI_BASE,