Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrf_wifi: Provide PCB loss information from RF params #1351

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion nrf_wifi/fw_if/umac_if/inc/default/fmac_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init(struct nrf_wifi_fmac_dev_ctx *fmac_d
enum op_band op_band,
bool beamforming,
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params,
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params);
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params,
struct nrf_wifi_board_params *board_params);


/**
Expand Down
3 changes: 2 additions & 1 deletion nrf_wifi/fw_if/umac_if/inc/fmac_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ enum nrf_wifi_status umac_cmd_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx,
unsigned int phy_calib,
enum op_band op_band,
bool beamforming,
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params);
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params,
struct nrf_wifi_board_params *board_params);

enum nrf_wifi_status umac_cmd_deinit(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx);

Expand Down
17 changes: 16 additions & 1 deletion nrf_wifi/fw_if/umac_if/inc/fw/host_rpu_sys_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,21 @@ struct nrf_wifi_tx_pwr_ctrl_params {
unsigned char band_edge_5g_unii_4_hi_he;
} __NRF_WIFI_PKD;

/**
* @brief This structure defines board dependent parameters like PCB loss.
*
*/
struct nrf_wifi_board_params {
/** PCB loss for 2.4 GHz band */
unsigned char pcb_loss_2g;
/** PCB loss for 5 GHz band (5150 MHz - 5350 MHz) */
unsigned char pcb_loss_5g_band1;
/** PCB loss for 5 GHz band (5470 MHz - 5730 MHz) */
unsigned char pcb_loss_5g_band2;
/** PCB loss for 5 GHz band (5730 MHz - 5895 MHz) */
unsigned char pcb_loss_5g_band3;
} __NRF_WIFI_PKD;

/**
* @brief This enum defines different types of operating bands.
*
Expand Down Expand Up @@ -868,7 +883,7 @@ struct nrf_wifi_cmd_sys_init {
* If a user wishes to turn it off, they should set this parameter to 1.
*/
unsigned int disable_beamforming;
/** The RPU uses this value (in seconds) to decide how long to wait
/** The RPU uses this value (in seconds) to decide how long to wait
* without receiving beacons before disconnection.
*/
unsigned int discon_timeout;
Expand Down
3 changes: 2 additions & 1 deletion nrf_wifi/fw_if/umac_if/inc/radio_test/fmac_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init_rt(struct nrf_wifi_fmac_dev_ctx *fma
enum op_band op_band,
bool beamforming,
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl,
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params);
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params,
struct nrf_wifi_board_params *board_params);


/**
Expand Down
8 changes: 7 additions & 1 deletion nrf_wifi/fw_if/umac_if/src/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ enum nrf_wifi_status umac_cmd_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx,
unsigned int phy_calib,
enum op_band op_band,
bool beamforming,
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params)
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params,
struct nrf_wifi_board_params *board_params)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct host_rpu_msg *umac_cmd = NULL;
Expand Down Expand Up @@ -176,6 +177,11 @@ enum nrf_wifi_status umac_cmd_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx,

umac_cmd_data->op_band = op_band;

nrf_wifi_osal_mem_cpy(fmac_dev_ctx->fpriv->opriv,
&umac_cmd_data->sys_params.rf_params[PCB_LOSS_BYTE_2G_OFST],
&board_params->pcb_loss_2g,
NUM_PCB_LOSS_OFFSET);

nrf_wifi_osal_mem_cpy(fmac_dev_ctx->fpriv->opriv,
&umac_cmd_data->sys_params.rf_params[ANT_GAIN_2G_OFST],
&tx_pwr_ctrl_params->ant_gain_2g,
Expand Down
12 changes: 8 additions & 4 deletions nrf_wifi/fw_if/umac_if/src/default/fmac_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ static enum nrf_wifi_status nrf_wifi_fmac_fw_init(struct nrf_wifi_fmac_dev_ctx *
unsigned int phy_calib,
enum op_band op_band,
bool beamforming,
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl)
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl,
struct nrf_wifi_board_params *board_params)
{
unsigned long start_time_us = 0;
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
Expand Down Expand Up @@ -254,7 +255,8 @@ static enum nrf_wifi_status nrf_wifi_fmac_fw_init(struct nrf_wifi_fmac_dev_ctx *
phy_calib,
op_band,
beamforming,
tx_pwr_ctrl);
tx_pwr_ctrl,
board_params);

if (status != NRF_WIFI_STATUS_SUCCESS) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
Expand Down Expand Up @@ -355,7 +357,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init(struct nrf_wifi_fmac_dev_ctx *fmac_d
enum op_band op_band,
bool beamforming,
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params,
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params)
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params,
struct nrf_wifi_board_params *board_params)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct nrf_wifi_fmac_otp_info otp_info;
Expand Down Expand Up @@ -418,7 +421,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init(struct nrf_wifi_fmac_dev_ctx *fmac_d
phy_calib,
op_band,
beamforming,
tx_pwr_ctrl_params);
tx_pwr_ctrl_params,
board_params);

if (status == NRF_WIFI_STATUS_FAIL) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
Expand Down
4 changes: 4 additions & 0 deletions nrf_wifi/fw_if/umac_if/src/fmac_api_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,10 @@ int nrf_wifi_phy_rf_params_init(struct nrf_wifi_osal_priv *opriv,
prf->phy_params[rf_param_offset + 27] = CONFIG_NRF700X_ANT_GAIN_5G_BAND1;
prf->phy_params[rf_param_offset + 28] = CONFIG_NRF700X_ANT_GAIN_5G_BAND2;
prf->phy_params[rf_param_offset + 29] = CONFIG_NRF700X_ANT_GAIN_5G_BAND3;
prf->phy_params[rf_param_offset + 30] = CONFIG_NRF700X_PCB_LOSS_2G;
prf->phy_params[rf_param_offset + 31] = CONFIG_NRF700X_PCB_LOSS_5G_BAND1;
prf->phy_params[rf_param_offset + 32] = CONFIG_NRF700X_PCB_LOSS_5G_BAND2;
prf->phy_params[rf_param_offset + 33] = CONFIG_NRF700X_PCB_LOSS_5G_BAND3;

return(ret);
}
Expand Down
12 changes: 8 additions & 4 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 @@ -37,7 +37,8 @@ static enum nrf_wifi_status nrf_wifi_fmac_fw_init_rt(struct nrf_wifi_fmac_dev_ct
unsigned int phy_calib,
enum op_band op_band,
bool beamforming,
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl)
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl,
struct nrf_wifi_board_params *board_params)
{
unsigned long start_time_us = 0;
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
Expand All @@ -58,7 +59,8 @@ static enum nrf_wifi_status nrf_wifi_fmac_fw_init_rt(struct nrf_wifi_fmac_dev_ct
phy_calib,
op_band,
beamforming,
tx_pwr_ctrl);
tx_pwr_ctrl,
board_params);

if (status != NRF_WIFI_STATUS_SUCCESS) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
Expand Down Expand Up @@ -111,7 +113,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init_rt(struct nrf_wifi_fmac_dev_ctx *fma
enum op_band op_band,
bool beamforming,
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params,
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params)
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params,
struct nrf_wifi_board_params *board_params)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct nrf_wifi_fmac_otp_info otp_info;
Expand Down Expand Up @@ -175,7 +178,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init_rt(struct nrf_wifi_fmac_dev_ctx *fma
phy_calib,
op_band,
beamforming,
tx_pwr_ctrl_params);
tx_pwr_ctrl_params,
board_params);

if (status == NRF_WIFI_STATUS_FAIL) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
Expand Down
11 changes: 11 additions & 0 deletions nrf_wifi/hw_if/hal/inc/fw/phy_rf_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#define NRF_WIFI_RF_PARAMS_SIZE 200
#define NRF_WIFI_RF_PARAMS_CONF_SIZE 42
#define NUM_PCB_LOSS_OFFSET 4

#ifdef CONFIG_NRF700X_RADIO_TEST
#define NRF_WIFI_DEF_RF_PARAMS "007077003F032424001000002800323500000C0008087D8105010071630300EED501001F6F00003B350100F52E0000E35E0000B7B6000066EFFEFFB5F60000896200007A840200E28FFCFF080808080408120100000000A1A10178000000080050003B020726181818181A120A140E0600"
Expand Down Expand Up @@ -338,6 +339,16 @@ enum MAX_POWER_OFFSETS {
NRF_WIFI_MAX_OP_PWR_5GHZ_HI_MCS0
};

/** The byte offsets of RF parameters indicate the start offset
* of PCB loss for 2.4 GHz and 5 GHz bands.
*/
enum PCB_LOSS_BYTE_OFFSETS {
kspraveeen marked this conversation as resolved.
Show resolved Hide resolved
PCB_LOSS_BYTE_2G_OFST = 185,
PCB_LOSS_BYTE_5G_BAND1_OFST,
PCB_LOSS_BYTE_5G_BAND2_OFST,
PCB_LOSS_BYTE_5G_BAND3_OFST
};

/** The byte offsets of RF parameters indicate the start offset
* of antenna gain for 2.4 GHz and 5 GHz bands.
*/
Expand Down
Loading