Skip to content

Commit

Permalink
drivers: wifi: Option for Qos NULL frame based power save
Browse files Browse the repository at this point in the history
[SHEL-2947] Provides an option to use Qos null frame based power save.
When set, RPU uses QoS null frames to retrieve buffered frames from the AP,
otherwise, it initially uses PS-POLL frames.

Signed-off-by: Ajay Parida <[email protected]>
  • Loading branch information
ajayparida committed Jul 15, 2024
1 parent bf54b52 commit 5e17dfc
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
4 changes: 4 additions & 0 deletions drivers/wifi/nrf700x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,7 @@ config NRF_WIFI_AP_DEAD_DETECT_TIMEOUT
help
The number of seconds after which AP is declared dead if no beacons
are received from the AP. Used to detect AP silently going down e.g., power off.

config NRF_WIFI_QOS_NULLFRAME_PS
bool "Enable Wi-Fi QoS null frame based PS. RPU uses QoS null frames to retrieve buffered frames from the AP."
default n
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ void nrf_wifi_fmac_dev_rem(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx);
* @param beamforming Enable/disable Wi-Fi beamforming.
* @param tx_pwr_ctrl_params TX power control parameters to be passed to the RPU.
* @param tx_pwr_ceil_params TX power ceil parameters for both frequency bands.
* @param qos_nullframe_ps Qos Null frame based power save.
*
* This function initializes the firmware of an RPU instance. The following is addressed
* - BAL layer device initialization
Expand All @@ -937,7 +938,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,
bool qos_nullframe_ps);


/**
Expand Down
6 changes: 5 additions & 1 deletion drivers/wifi/nrf700x/osal/fw_if/umac_if/inc/fmac_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ 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,
#ifndef CONFIG_NRF700X_RADIO_TEST
bool qos_nullframe_ps
#endif /* !CONFIG_NRF700X_RADIO_TEST */
);

enum nrf_wifi_status umac_cmd_deinit(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx);

Expand Down
12 changes: 11 additions & 1 deletion drivers/wifi/nrf700x/osal/fw_if/umac_if/src/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ 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,
#ifndef CONFIG_NRF700X_RADIO_TEST
bool qos_nullframe_ps
#endif /* !CONFIG_NRF700X_RADIO_TEST */
)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct host_rpu_msg *umac_cmd = NULL;
Expand Down Expand Up @@ -193,6 +197,12 @@ enum nrf_wifi_status umac_cmd_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx,
umac_cmd_data->disable_beamforming = 1;
}

#ifndef CONFIG_NRF700X_RADIO_TEST
if (qos_nullframe_ps) {
umac_cmd_data->nullframe_pwrsave = 1;
}
#endif /* !CONFIG_NRF700X_RADIO_TEST */

status = nrf_wifi_hal_ctrl_cmd_send(fmac_dev_ctx->hal_dev_ctx,
umac_cmd,
(sizeof(*umac_cmd) + len));
Expand Down
12 changes: 8 additions & 4 deletions drivers/wifi/nrf700x/osal/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,
bool qos_nullframe_ps)
{
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,
qos_nullframe_ps);

if (status != NRF_WIFI_STATUS_SUCCESS) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
Expand Down Expand Up @@ -356,7 +358,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,
bool qos_nullframe_ps)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct nrf_wifi_fmac_otp_info otp_info;
Expand Down Expand Up @@ -435,7 +438,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,
qos_nullframe_ps);

if (status == NRF_WIFI_STATUS_FAIL) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
Expand Down
4 changes: 3 additions & 1 deletion drivers/wifi/nrf700x/zephyr/src/zephyr_fmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,9 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
op_band,
IS_ENABLED(CONFIG_NRF_WIFI_BEAMFORMING),
&tx_pwr_ctrl_params,
&tx_pwr_ceil_params);
&tx_pwr_ceil_params,
IS_ENABLED(CONFIG_NRF_WIFI_QOS_NULLFRAME_PS)
);
#endif /* CONFIG_NRF700X_RADIO_TEST */


Expand Down

0 comments on commit 5e17dfc

Please sign in to comment.