Skip to content

Commit

Permalink
nrf_wi: Fix TX power issue
Browse files Browse the repository at this point in the history
[SHEL-2533]: The problem of TX output power disparity has been
resolved, which occurs when the default power is set without
utilizing the TX power command, and the power is explicitly set
using the TX power command through the Radio test application.

Signed-off-by: Mahammadyunus Patil <[email protected]>
  • Loading branch information
imapa committed Mar 1, 2024
1 parent 319739c commit 1ff6afa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
7 changes: 1 addition & 6 deletions nrf_wifi/fw_if/umac_if/src/default/fmac_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init(struct nrf_wifi_fmac_dev_ctx *fmac_d
goto out;
}

nrf_wifi_osal_mem_set(fmac_dev_ctx->fpriv->opriv,
&phy_rf_params,
0xFF,
sizeof(phy_rf_params));

status = nrf_wifi_fmac_rf_params_get(fmac_dev_ctx,
&phy_rf_params);
&phy_rf_params);
if (status != NRF_WIFI_STATUS_SUCCESS) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
"%s: RF parameters get failed",
Expand Down
15 changes: 12 additions & 3 deletions nrf_wifi/fw_if/umac_if/src/fmac_api_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,12 @@ enum nrf_wifi_status nrf_wifi_fmac_rf_params_get(
__func__);
goto out;
}


nrf_wifi_osal_mem_set(fmac_dev_ctx->fpriv->opriv,
phy_rf_params,
0x0,
sizeof(phy_rf_params));

ret = nrf_wifi_phy_rf_params_init(fmac_dev_ctx->fpriv->opriv,
phy_rf_params,
package_info,
Expand Down Expand Up @@ -961,7 +966,7 @@ int nrf_wifi_phy_rf_params_init(struct nrf_wifi_osal_priv *opriv,
nrf_wifi_osal_mem_set(opriv,
&prf->reserved,
0x0,
sizeof(prf->reserved));
sizeof(prf->reserved));
/* Initialize PD adjust values for MCS7. Currently these 4 bytes are not being used */
prf->pd_adjust_val.pd_adjt_lb_chan = PD_ADJUST_VAL;
prf->pd_adjust_val.pd_adjt_hb_low_chan = PD_ADJUST_VAL;
Expand All @@ -983,7 +988,7 @@ int nrf_wifi_phy_rf_params_init(struct nrf_wifi_osal_priv *opriv,
nrf_wifi_osal_mem_set(opriv,
&prf->temp_volt_backoff.reserved,
0x0,
sizeof(prf->temp_volt_backoff.reserved));
sizeof(prf->temp_volt_backoff.reserved));

if (package_info == CSP_PACKAGE_INFO) {
prf->xo_offset.xo_freq_offset = CSP_XO_VAL;
Expand All @@ -998,6 +1003,7 @@ int nrf_wifi_phy_rf_params_init(struct nrf_wifi_osal_priv *opriv,
prf->max_pwr_ceil.max_hb_mid_chan_mcs0_pwr = CSP_MAX_TX_PWR_HB_MID_CHAN_MCS0;
prf->max_pwr_ceil.max_hb_high_chan_mcs0_pwr = CSP_MAX_TX_PWR_HB_HIGH_CHAN_MCS0;

#ifndef CONFIG_NRF700X_RADIO_TEST
/* Max-Min chip temperature, VT backoffs configuration */
prf->temp_volt_backoff.max_chip_temp = CSP_MAX_CHIP_TEMP;
prf->temp_volt_backoff.min_chip_temp = CSP_MIN_CHIP_TEMP;
Expand All @@ -1009,6 +1015,7 @@ int nrf_wifi_phy_rf_params_init(struct nrf_wifi_osal_priv *opriv,
prf->temp_volt_backoff.hb_vbt_lt_vlow = CSP_HB_VBT_LT_VLOW;
prf->temp_volt_backoff.lb_vbt_lt_low = CSP_LB_VBT_LT_LOW;
prf->temp_volt_backoff.hb_vbt_lt_low = CSP_HB_VBT_LT_LOW;
#endif
}
else {
/** If nothing is written to OTP field corresponding to package info byte
Expand All @@ -1030,6 +1037,7 @@ int nrf_wifi_phy_rf_params_init(struct nrf_wifi_osal_priv *opriv,
prf->max_pwr_ceil.max_hb_mid_chan_mcs0_pwr = QFN_MAX_TX_PWR_HB_MID_CHAN_MCS0;
prf->max_pwr_ceil.max_hb_high_chan_mcs0_pwr = QFN_MAX_TX_PWR_HB_HIGH_CHAN_MCS0;

#ifndef CONFIG_NRF700X_RADIO_TEST
/* Max-Min chip temperature, VT backoffs configuration */
prf->temp_volt_backoff.max_chip_temp = QFN_MAX_CHIP_TEMP;
prf->temp_volt_backoff.min_chip_temp = QFN_MIN_CHIP_TEMP;
Expand All @@ -1041,6 +1049,7 @@ int nrf_wifi_phy_rf_params_init(struct nrf_wifi_osal_priv *opriv,
prf->temp_volt_backoff.hb_vbt_lt_vlow = QFN_HB_VBT_LT_VLOW;
prf->temp_volt_backoff.lb_vbt_lt_low = QFN_LB_VBT_LT_LOW;
prf->temp_volt_backoff.hb_vbt_lt_low = QFN_HB_VBT_LT_LOW;
#endif
}

ret = nrf_wifi_utils_hex_str_to_val(opriv,
Expand Down
5 changes: 0 additions & 5 deletions nrf_wifi/fw_if/umac_if/src/radio_test/fmac_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,6 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init_rt(struct nrf_wifi_fmac_dev_ctx *fma
goto out;
}

nrf_wifi_osal_mem_set(fmac_dev_ctx->fpriv->opriv,
&phy_rf_params,
0xFF,
sizeof(phy_rf_params));

status = nrf_wifi_fmac_rf_params_get(fmac_dev_ctx,
&phy_rf_params);

Expand Down

0 comments on commit 1ff6afa

Please sign in to comment.