Lines Matching refs:env

1951 	struct rtw89_env_monitor_info *env = &rtwdev->env_monitor;  in rtw89_phy_ccx_us_to_idx()  local
1953 return time_us >> (ilog2(CCX_US_BASE_RATIO) + env->ccx_unit_idx); in rtw89_phy_ccx_us_to_idx()
1958 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ccx_idx_to_us() local
1960 return idx << (ilog2(CCX_US_BASE_RATIO) + env->ccx_unit_idx); in rtw89_phy_ccx_idx_to_us()
1965 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ccx_top_setting_init() local
1967 env->ccx_manual_ctrl = false; in rtw89_phy_ccx_top_setting_init()
1968 env->ccx_ongoing = false; in rtw89_phy_ccx_top_setting_init()
1969 env->ccx_rac_lv = RTW89_RAC_RELEASE; in rtw89_phy_ccx_top_setting_init()
1970 env->ccx_rpt_stamp = 0; in rtw89_phy_ccx_top_setting_init()
1971 env->ccx_period = 0; in rtw89_phy_ccx_top_setting_init()
1972 env->ccx_unit_idx = RTW89_CCX_32_US; in rtw89_phy_ccx_top_setting_init()
1973 env->ccx_trigger_time = 0; in rtw89_phy_ccx_top_setting_init()
1974 env->ccx_edcca_opt_bw_idx = RTW89_CCX_EDCCA_BW20_0; in rtw89_phy_ccx_top_setting_init()
1986 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ccx_get_report() local
1990 numer = report * score + (env->ccx_period >> 1); in rtw89_phy_ccx_get_report()
1991 if (env->ccx_period) in rtw89_phy_ccx_get_report()
1992 ret = numer / env->ccx_period; in rtw89_phy_ccx_get_report()
2028 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ccx_racing_release() local
2031 "lv:(%d)->(0)\n", env->ccx_rac_lv); in rtw89_phy_ccx_racing_release()
2033 env->ccx_ongoing = false; in rtw89_phy_ccx_racing_release()
2034 env->ccx_rac_lv = RTW89_RAC_RELEASE; in rtw89_phy_ccx_racing_release()
2035 env->ifs_clm_app = RTW89_IFS_CLM_BACKGROUND; in rtw89_phy_ccx_racing_release()
2041 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ifs_clm_th_update_check() local
2042 bool is_update = env->ifs_clm_app != para->ifs_clm_app; in rtw89_phy_ifs_clm_th_update_check()
2044 u16 *ifs_th_l = env->ifs_clm_th_l; in rtw89_phy_ifs_clm_th_update_check()
2045 u16 *ifs_th_h = env->ifs_clm_th_h; in rtw89_phy_ifs_clm_th_update_check()
2094 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ifs_clm_set_th_reg() local
2098 env->ifs_clm_th_l[0]); in rtw89_phy_ifs_clm_set_th_reg()
2100 env->ifs_clm_th_l[1]); in rtw89_phy_ifs_clm_set_th_reg()
2102 env->ifs_clm_th_l[2]); in rtw89_phy_ifs_clm_set_th_reg()
2104 env->ifs_clm_th_l[3]); in rtw89_phy_ifs_clm_set_th_reg()
2107 env->ifs_clm_th_h[0]); in rtw89_phy_ifs_clm_set_th_reg()
2109 env->ifs_clm_th_h[1]); in rtw89_phy_ifs_clm_set_th_reg()
2111 env->ifs_clm_th_h[2]); in rtw89_phy_ifs_clm_set_th_reg()
2113 env->ifs_clm_th_h[3]); in rtw89_phy_ifs_clm_set_th_reg()
2118 i + 1, env->ifs_clm_th_l[i], env->ifs_clm_th_h[i]); in rtw89_phy_ifs_clm_set_th_reg()
2123 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ifs_clm_setting_init() local
2126 env->ifs_clm_app = RTW89_IFS_CLM_BACKGROUND; in rtw89_phy_ifs_clm_setting_init()
2127 env->ifs_clm_mntr_time = 0; in rtw89_phy_ifs_clm_setting_init()
2144 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ccx_racing_ctrl() local
2154 "ccx_ongoing=%d, level:(%d)->(%d)\n", env->ccx_ongoing, in rtw89_phy_ccx_racing_ctrl()
2155 env->ccx_rac_lv, level); in rtw89_phy_ccx_racing_ctrl()
2157 if (env->ccx_ongoing) { in rtw89_phy_ccx_racing_ctrl()
2158 if (level <= env->ccx_rac_lv) in rtw89_phy_ccx_racing_ctrl()
2161 env->ccx_ongoing = false; in rtw89_phy_ccx_racing_ctrl()
2165 env->ccx_rac_lv = level; in rtw89_phy_ccx_racing_ctrl()
2175 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ccx_trigger() local
2182 env->ccx_rpt_stamp++; in rtw89_phy_ccx_trigger()
2183 env->ccx_ongoing = true; in rtw89_phy_ccx_trigger()
2188 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ifs_clm_get_utility() local
2192 env->ifs_clm_tx_ratio = in rtw89_phy_ifs_clm_get_utility()
2193 rtw89_phy_ccx_get_report(rtwdev, env->ifs_clm_tx, PERCENT); in rtw89_phy_ifs_clm_get_utility()
2194 env->ifs_clm_edcca_excl_cca_ratio = in rtw89_phy_ifs_clm_get_utility()
2195 rtw89_phy_ccx_get_report(rtwdev, env->ifs_clm_edcca_excl_cca, in rtw89_phy_ifs_clm_get_utility()
2197 env->ifs_clm_cck_fa_ratio = in rtw89_phy_ifs_clm_get_utility()
2198 rtw89_phy_ccx_get_report(rtwdev, env->ifs_clm_cckfa, PERCENT); in rtw89_phy_ifs_clm_get_utility()
2199 env->ifs_clm_ofdm_fa_ratio = in rtw89_phy_ifs_clm_get_utility()
2200 rtw89_phy_ccx_get_report(rtwdev, env->ifs_clm_ofdmfa, PERCENT); in rtw89_phy_ifs_clm_get_utility()
2201 env->ifs_clm_cck_cca_excl_fa_ratio = in rtw89_phy_ifs_clm_get_utility()
2202 rtw89_phy_ccx_get_report(rtwdev, env->ifs_clm_cckcca_excl_fa, in rtw89_phy_ifs_clm_get_utility()
2204 env->ifs_clm_ofdm_cca_excl_fa_ratio = in rtw89_phy_ifs_clm_get_utility()
2205 rtw89_phy_ccx_get_report(rtwdev, env->ifs_clm_ofdmcca_excl_fa, in rtw89_phy_ifs_clm_get_utility()
2207 env->ifs_clm_cck_fa_permil = in rtw89_phy_ifs_clm_get_utility()
2208 rtw89_phy_ccx_get_report(rtwdev, env->ifs_clm_cckfa, PERMIL); in rtw89_phy_ifs_clm_get_utility()
2209 env->ifs_clm_ofdm_fa_permil = in rtw89_phy_ifs_clm_get_utility()
2210 rtw89_phy_ccx_get_report(rtwdev, env->ifs_clm_ofdmfa, PERMIL); in rtw89_phy_ifs_clm_get_utility()
2213 if (env->ifs_clm_his[i] > ENV_MNTR_IFSCLM_HIS_MAX) { in rtw89_phy_ifs_clm_get_utility()
2214 env->ifs_clm_ifs_avg[i] = ENV_MNTR_FAIL_DWORD; in rtw89_phy_ifs_clm_get_utility()
2216 env->ifs_clm_ifs_avg[i] = in rtw89_phy_ifs_clm_get_utility()
2218 env->ifs_clm_avg[i]); in rtw89_phy_ifs_clm_get_utility()
2221 res = rtw89_phy_ccx_idx_to_us(rtwdev, env->ifs_clm_cca[i]); in rtw89_phy_ifs_clm_get_utility()
2222 res += env->ifs_clm_his[i] >> 1; in rtw89_phy_ifs_clm_get_utility()
2223 if (env->ifs_clm_his[i]) in rtw89_phy_ifs_clm_get_utility()
2224 res /= env->ifs_clm_his[i]; in rtw89_phy_ifs_clm_get_utility()
2227 env->ifs_clm_cca_avg[i] = res; in rtw89_phy_ifs_clm_get_utility()
2232 env->ifs_clm_tx_ratio, env->ifs_clm_edcca_excl_cca_ratio); in rtw89_phy_ifs_clm_get_utility()
2235 env->ifs_clm_cck_fa_ratio, env->ifs_clm_ofdm_fa_ratio); in rtw89_phy_ifs_clm_get_utility()
2238 env->ifs_clm_cck_fa_permil, env->ifs_clm_ofdm_fa_permil); in rtw89_phy_ifs_clm_get_utility()
2241 env->ifs_clm_cck_cca_excl_fa_ratio, in rtw89_phy_ifs_clm_get_utility()
2242 env->ifs_clm_ofdm_cca_excl_fa_ratio); in rtw89_phy_ifs_clm_get_utility()
2247 i + 1, env->ifs_clm_his[i], env->ifs_clm_ifs_avg[i], in rtw89_phy_ifs_clm_get_utility()
2248 env->ifs_clm_cca_avg[i]); in rtw89_phy_ifs_clm_get_utility()
2253 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ifs_clm_get_result() local
2262 env->ifs_clm_tx = in rtw89_phy_ifs_clm_get_result()
2265 env->ifs_clm_edcca_excl_cca = in rtw89_phy_ifs_clm_get_result()
2268 env->ifs_clm_cckcca_excl_fa = in rtw89_phy_ifs_clm_get_result()
2271 env->ifs_clm_ofdmcca_excl_fa = in rtw89_phy_ifs_clm_get_result()
2274 env->ifs_clm_cckfa = in rtw89_phy_ifs_clm_get_result()
2277 env->ifs_clm_ofdmfa = in rtw89_phy_ifs_clm_get_result()
2281 env->ifs_clm_his[0] = in rtw89_phy_ifs_clm_get_result()
2283 env->ifs_clm_his[1] = in rtw89_phy_ifs_clm_get_result()
2285 env->ifs_clm_his[2] = in rtw89_phy_ifs_clm_get_result()
2287 env->ifs_clm_his[3] = in rtw89_phy_ifs_clm_get_result()
2290 env->ifs_clm_avg[0] = in rtw89_phy_ifs_clm_get_result()
2292 env->ifs_clm_avg[1] = in rtw89_phy_ifs_clm_get_result()
2294 env->ifs_clm_avg[2] = in rtw89_phy_ifs_clm_get_result()
2296 env->ifs_clm_avg[3] = in rtw89_phy_ifs_clm_get_result()
2299 env->ifs_clm_cca[0] = in rtw89_phy_ifs_clm_get_result()
2301 env->ifs_clm_cca[1] = in rtw89_phy_ifs_clm_get_result()
2303 env->ifs_clm_cca[2] = in rtw89_phy_ifs_clm_get_result()
2305 env->ifs_clm_cca[3] = in rtw89_phy_ifs_clm_get_result()
2308 env->ifs_clm_total_ifs = in rtw89_phy_ifs_clm_get_result()
2312 env->ifs_clm_total_ifs); in rtw89_phy_ifs_clm_get_result()
2315 env->ifs_clm_tx, env->ifs_clm_edcca_excl_cca); in rtw89_phy_ifs_clm_get_result()
2318 env->ifs_clm_cckfa, env->ifs_clm_ofdmfa); in rtw89_phy_ifs_clm_get_result()
2321 env->ifs_clm_cckcca_excl_fa, env->ifs_clm_ofdmcca_excl_fa); in rtw89_phy_ifs_clm_get_result()
2326 "T%d:[%d, %d, %d]\n", i + 1, env->ifs_clm_his[i], in rtw89_phy_ifs_clm_get_result()
2327 env->ifs_clm_avg[i], env->ifs_clm_cca[i]); in rtw89_phy_ifs_clm_get_result()
2337 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_ifs_clm_set() local
2350 if (para->mntr_time != env->ifs_clm_mntr_time) { in rtw89_phy_ifs_clm_set()
2360 env->ifs_clm_mntr_time, para->mntr_time); in rtw89_phy_ifs_clm_set()
2362 env->ifs_clm_mntr_time = para->mntr_time; in rtw89_phy_ifs_clm_set()
2363 env->ccx_period = (u16)period; in rtw89_phy_ifs_clm_set()
2364 env->ccx_unit_idx = (u8)unit_idx; in rtw89_phy_ifs_clm_set()
2368 env->ifs_clm_app = para->ifs_clm_app; in rtw89_phy_ifs_clm_set()
2377 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_env_monitor_track() local
2381 env->ccx_watchdog_result = RTW89_PHY_ENV_MON_CCX_FAIL; in rtw89_phy_env_monitor_track()
2382 if (env->ccx_manual_ctrl) { in rtw89_phy_env_monitor_track()
2390 env->ccx_watchdog_result |= RTW89_PHY_ENV_MON_IFS_CLM; in rtw89_phy_env_monitor_track()
2404 env->ccx_watchdog_result, chk_result); in rtw89_phy_env_monitor_track()
2624 struct rtw89_env_monitor_info *env = &rtwdev->env_monitor; in rtw89_phy_dig_igi_offset_by_env() local
2629 fa_ratio = env->ifs_clm_cck_fa_permil + env->ifs_clm_ofdm_fa_permil; in rtw89_phy_dig_igi_offset_by_env()
2656 env->ifs_clm_cck_fa_permil, env->ifs_clm_ofdm_fa_permil, in rtw89_phy_dig_igi_offset_by_env()
2657 env->ifs_clm_cck_fa_permil + env->ifs_clm_ofdm_fa_permil, in rtw89_phy_dig_igi_offset_by_env()