Skip to content

Commit

Permalink
nrf_wifi: Support to configure quiet period
Browse files Browse the repository at this point in the history
[SHEL-2817] Configure user provided quiet period to firmware.

Signed-off-by: Ajay Parida <[email protected]>
  • Loading branch information
ajayparida committed Jun 12, 2024
1 parent d0a4e61 commit 604e634
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
16 changes: 16 additions & 0 deletions nrf_wifi/fw_if/umac_if/inc/default/fmac_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,22 @@ bool nrf_wifi_util_is_rawpktmode_enabled(struct nrf_wifi_fmac_vif_ctx *vif);
*@retval WIFI_NRF_STATUS_FAIL On failure
*/
enum nrf_wifi_status nrf_wifi_check_mode_validity(unsigned char mode);

/**
* @brief Configure WLAN quiet period.
* @param fmac_dev_ctx Pointer to the UMAC IF context for a RPU WLAN device.
* @param if_idx Index of the interface on which power management is to be set.
* @param quite period Quiet period in seconds to be set.
*
* This function is used to send a command (%NRF_WIFI_UMAC_CMD_CONFIG_QUIET_PERIOD to:
* - The RPU firmware to set quiet period.
*
*@retval NRF_WIFI_STATUS_SUCCESS On success
*@retval NRF_WIFI_STATUS_FAIL On failure to execute command
*/
enum nrf_wifi_status nrf_wifi_fmac_set_quiet_period(void *fmac_dev_ctx,
unsigned char if_idx,
unsigned int quiet_period);
/**
* @}
*/
Expand Down
42 changes: 42 additions & 0 deletions nrf_wifi/fw_if/umac_if/src/default/fmac_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -3123,4 +3123,46 @@ enum nrf_wifi_status nrf_wifi_fmac_set_ps_wakeup_mode(void *dev_ctx,

return status;
}

enum nrf_wifi_status nrf_wifi_fmac_set_quiet_period(void *dev_ctx,
unsigned char if_idx,
unsigned int quiet_period)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct nrf_wifi_umac_cmd_config_quiet_period *set_quiet_period_cmd = NULL;
struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL;

fmac_dev_ctx = dev_ctx;

if (!dev_ctx) {
goto out;
}

set_quiet_period_cmd = nrf_wifi_osal_mem_zalloc(fmac_dev_ctx->fpriv->opriv,
sizeof(*set_quiet_period_cmd));

if (!set_quiet_period_cmd) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
"%s: Unable to allocate memory",
__func__);
goto out;
}

set_quiet_period_cmd->umac_hdr.cmd_evnt = NRF_WIFI_UMAC_CMD_CONFIG_QUIET_PERIOD;
set_quiet_period_cmd->umac_hdr.ids.wdev_id = if_idx;
set_quiet_period_cmd->umac_hdr.ids.valid_fields |=
NRF_WIFI_INDEX_IDS_WDEV_ID_VALID;
set_quiet_period_cmd->quiet_period_in_sec = quiet_period;

status = umac_cmd_cfg(fmac_dev_ctx,
set_quiet_period_cmd,
sizeof(*set_quiet_period_cmd));
out:
if (set_quiet_period_cmd) {
nrf_wifi_osal_mem_free(fmac_dev_ctx->fpriv->opriv,
set_quiet_period_cmd);
}

return status;
}
#endif /* CONFIG_NRF700X_STA_MODE */

0 comments on commit 604e634

Please sign in to comment.