From d6bdda200e9a340a4d8ad9a77c272f15aad70e6d Mon Sep 17 00:00:00 2001 From: Ajay Parida Date: Mon, 15 Jul 2024 14:57:08 +0530 Subject: [PATCH] drivers: wifi: Option for Qos NULL frame based power save [SHEL-2947] QoS null frame based legacy power save support. Signed-off-by: Ajay Parida --- drivers/wifi/nrf700x/Kconfig | 12 ++++++++++++ .../osal/fw_if/umac_if/inc/fw/host_rpu_sys_if.h | 14 +++++++------- drivers/wifi/nrf700x/osal/fw_if/umac_if/src/cmd.c | 8 +++++++- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/drivers/wifi/nrf700x/Kconfig b/drivers/wifi/nrf700x/Kconfig index 0624eaf9d9de..7dc2195157ef 100644 --- a/drivers/wifi/nrf700x/Kconfig +++ b/drivers/wifi/nrf700x/Kconfig @@ -403,3 +403,15 @@ 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. + +choice NRF_WIFI_PS_DATA_RETRIEVAL_MODE + prompt "Power save data retrieval mode" + default NRF_WIFI_PS_POLL_BASED_RETRIEVAL + help + Select the mechanism to retrieve buffered data from AP. +config NRF_WIFI_PS_POLL_BASED_RETRIEVAL + bool "PS-Poll based mechanism to retrieve buffered data from AP" +config NRF_WIFI_QOS_NULL_BASED_RETRIEVAL + bool "QoS null frame based mechanism to retrieve buffered data from AP" + +endchoice diff --git a/drivers/wifi/nrf700x/osal/fw_if/umac_if/inc/fw/host_rpu_sys_if.h b/drivers/wifi/nrf700x/osal/fw_if/umac_if/inc/fw/host_rpu_sys_if.h index c6bf5fc17509..deb1bf8dfe08 100644 --- a/drivers/wifi/nrf700x/osal/fw_if/umac_if/inc/fw/host_rpu_sys_if.h +++ b/drivers/wifi/nrf700x/osal/fw_if/umac_if/inc/fw/host_rpu_sys_if.h @@ -785,12 +785,12 @@ enum op_band { * from the AP in power save mode. */ enum data_retrieve_frame { - /** Retrieves data from the AP using a PS-Poll frame */ - PS_POLL_FRAME, - /** Retrieves data from the AP using a QoS Null frame */ - QOS_NULL_FRAME, - /** For future implementation. The RPU will decide which frame to use */ - AUTOMATIC + /** Retrieves data from the AP using a PS-Poll frame */ + PS_POLL_FRAME, + /** Retrieves data from the AP using a QoS Null frame */ + QOS_NULL_FRAME, + /** For future implementation. The RPU will decide which frame to use */ + AUTOMATIC }; #define TWT_EXTEND_SP_EDCA 0x1 @@ -839,7 +839,7 @@ struct nrf_wifi_cmd_sys_init { */ unsigned int discon_timeout; /** RPU uses QoS null frame or PS-Poll frame to retrieve buffered frames - * from the AP in power save @ref data_retrieve_frame. + * from the AP in power save @ref data_retrieve_frame. */ unsigned char ps_data_retrieval_mode; } __NRF_WIFI_PKD; diff --git a/drivers/wifi/nrf700x/osal/fw_if/umac_if/src/cmd.c b/drivers/wifi/nrf700x/osal/fw_if/umac_if/src/cmd.c index c05b0b47ecec..0ed269362e63 100644 --- a/drivers/wifi/nrf700x/osal/fw_if/umac_if/src/cmd.c +++ b/drivers/wifi/nrf700x/osal/fw_if/umac_if/src/cmd.c @@ -193,7 +193,13 @@ enum nrf_wifi_status umac_cmd_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, umac_cmd_data->disable_beamforming = 1; } - status = nrf_wifi_hal_ctrl_cmd_send(fmac_dev_ctx->hal_dev_ctx, +#if defined(CONFIG_NRF_WIFI_QOS_NULL_BASED_RETRIEVAL) + umac_cmd_data->ps_data_retrieval_mode = QOS_NULL_FRAME; +#else + umac_cmd_data->ps_data_retrieval_mode = PS_POLL_FRAME; +#endif /* CONFIG_NRF_WIFI_QOS_NULL_BASED_RETRIEVAL */ + + status = nrf_wifi_hal_ctrl_cmd_send(fmac_dev_ctx->hal_dev_ctx, umac_cmd, (sizeof(*umac_cmd) + len));