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

v2.5: drivers: wifi: Add PS exit strategy option #17003

Open
wants to merge 10 commits into
base: v2.5-branch
Choose a base branch
from
30 changes: 15 additions & 15 deletions drivers/wifi/nrf700x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -404,31 +404,31 @@ config NRF_WIFI_AP_DEAD_DETECT_TIMEOUT
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_MECHANISM
prompt "Power save data retrieval mechanism"
default NRF_WIFI_PS_POLL_BASED_RETRIEVAL
choice NRF_WIFI_PS_EXIT_STRATEGY
prompt "Power save exit strategy"
default NRF_WIFI_PS_INT_PS
help
Select the mechanism to retrieve buffered data from AP.
Select the power save exit strategy to retrieve buffered data from AP.

config NRF_WIFI_PS_POLL_BASED_RETRIEVAL
bool "PS-Poll frame based mechanism to retrieve buffered data from AP"
config NRF_WIFI_PS_EXIT_EVERY_TIM
bool "Exit power save every time to retrieve buffered data from AP"
help
When AP notifies about availability of buffered data, the STA stays in power save
and retrieves the frames one-by-one, this conserved more power but adds latency
to the traffic. Ideal for minimum number of frames.
Exit power save every time to retrieve buffered data from AP. Entering back to
power save mode might take some time and power.

config NRF_WIFI_QOS_NULL_BASED_RETRIEVAL
bool "QoS null frame based mechanism to retrieve buffered data from AP"
config NRF_WIFI_PS_INT_PS
bool "Exit power save based on an intelligent algorithm"
help
When AP notifies about availability of buffered data, the STA comes out of
power save and then AP can deliver all buffered frames without any additional
overhead or latency, but STA enters power save after a delay costing more power
depending on the delay. Ideal for heavy buffered traffic.
Exit power save based on an intelligent algorithm to retrieve buffered data from AP.
The algorithm tracks the buffered data at the AP and then dynamically decides
whether to stay in PS (for lower amount of buffered data) or exit PS (for higher
amount of buffered data).

endchoice

config NRF_WIFI_MGMT_BUFF_OFFLOAD
bool "Enable management buffer offload"
default y

config NRF_WIFI_RPU_RECOVERY
bool "Enable RPU recovery mechanism"
Expand Down
17 changes: 17 additions & 0 deletions drivers/wifi/nrf700x/osal/fw_if/umac_if/inc/default/fmac_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,23 @@ enum nrf_wifi_status nrf_wifi_fmac_set_listen_interval(void *fmac_dev_ctx,
enum nrf_wifi_status nrf_wifi_fmac_set_ps_wakeup_mode(void *fmac_dev_ctx,
unsigned char if_idx,
bool ps_wakeup_mode);

/**
* @brief Configure power save exit strategy.
* @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 ps_exit_strategy PS exit strategy to be configured in RPU.
*
* This function is used to send a command to RPU
* to configure PS exit strategy in RPU.
*
* @return Command execution status
*/
enum nrf_wifi_status nrf_wifi_fmac_set_ps_exit_strategy(
void *fmac_dev_ctx,
unsigned char if_idx,
unsigned int ps_exit_strategy);

#if defined(CONFIG_NRF_WIFI_RPU_RECOVERY) || defined(__DOXYGEN__)
/** @cond INTERNAL_HIDDEN */
enum nrf_wifi_status nrf_wifi_fmac_rpu_recovery_callback(void *mac_dev_ctx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ enum nrf_wifi_status nrf_wifi_fmac_get_reg(struct nrf_wifi_fmac_dev_ctx *fmac_de
*/
enum nrf_wifi_status nrf_wifi_fmac_get_power_save_info(void *fmac_dev_ctx,
unsigned char if_idx);

/**
* @}
*/
Expand Down
2 changes: 2 additions & 0 deletions drivers/wifi/nrf700x/osal/fw_if/umac_if/inc/fmac_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,6 @@ enum nrf_wifi_status umac_cmd_prog_stats_get(struct nrf_wifi_fmac_dev_ctx *fmac_
#endif /* CONFIG_NRF700X_RADIO_TEST */
int stat_type);

enum nrf_wifi_status umac_cmd_set_ps_exit_strategy(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx,
enum ps_exit_strategy ps_exit_strategy);
#endif /* __FMAC_CMD_H__ */
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,13 @@ enum nrf_wifi_keep_alive_status {
* @brief This enum specifies the type of frames used to retrieve buffered data
* from the AP in power save mode.
*/
enum data_retrieve_mechanism {
/** 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
enum ps_exit_strategy {
/** Uses an intelligent algo and decide whether to
* stay or exit power save mode to receive buffered frames.
*/
INT_PS = 0,
/** Exits power save mode for every TIM */
EVERY_TIM
};

#define TWT_EXTEND_SP_EDCA 0x1
Expand Down Expand Up @@ -849,9 +849,9 @@ 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_mechanism.
* from the AP in power save @ref ps_exit_strategy.
*/
unsigned char ps_data_retrieval_mech;
unsigned char ps_exit_strategy;
/** The RPU uses this value to configure watchdog timer */
unsigned int watchdog_timer_val;
/** The RPU uses this value to decide whether keep alive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ enum nrf_wifi_umac_commands {
/** Set listen interval @ref nrf_wifi_umac_cmd_set_listen_interval */
NRF_WIFI_UMAC_CMD_SET_LISTEN_INTERVAL,
/** Configure extended power save @ref nrf_wifi_umac_cmd_config_extended_ps */
NRF_WIFI_UMAC_CMD_CONFIG_EXTENDED_PS
NRF_WIFI_UMAC_CMD_CONFIG_EXTENDED_PS,
/** Command to specify power save exit strategy */
NRF_WIFI_UMAC_CMD_PS_EXIT_STRATEGY,
};

/**
Expand Down Expand Up @@ -2907,6 +2909,8 @@ struct nrf_wifi_umac_event_power_save_info {
unsigned int ps_timeout;
/** Listen interval value */
unsigned short listen_interval;
/** Power save exit strategy */
unsigned char ps_exit_strategy;
/** Number TWT flows */
unsigned char num_twt_flows;
/** TWT info of each flow @ref nrf_wifi_umac_config_twt_info */
Expand Down Expand Up @@ -3469,4 +3473,16 @@ struct nrf_wifi_umac_event_cmd_status {
unsigned int cmd_status;
} __NRF_WIFI_PKD;

/**
* @brief This structure defines the command used to configure the power save exit
* strategy for retrieving buffered data from the AP in power save mode.
*
*/
struct nrf_wifi_cmd_ps_exit_strategy {
/** Header @ref nrf_wifi_umac_hdr */
struct nrf_wifi_umac_hdr umac_hdr;
/** Power save exit strategy */
unsigned char ps_exit_strategy;
} __NRF_WIFI_PKD;

#endif /* __HOST_RPU_UMAC_IF_H */
Loading
Loading