Skip to content

Commit

Permalink
drivers: wifi: Add support for keepalive
Browse files Browse the repository at this point in the history
To handle interoperability issue with few APs, add a feature to keep
sending keepalive frames periodically to avoid AP disconnecting the STA.

This is disabled by default to avoid unnecessary power consumption as
it's only seen with few old APs.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 authored and karun2796 committed Aug 7, 2024
1 parent 2dc2270 commit eb73df6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions drivers/wifi/nrf700x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -511,3 +511,21 @@ config NET_MGMT_EVENT_QUEUE_SIZE
# Doing interface down and up even with delay puts a lot of events in the queue
default 16
endif

config NRF_WIFI_FEAT_KEEPALIVE
bool "Enable Wi-Fi keepalive feature"
depends on NRF700X_STA_MODE
help
Enable Wi-Fi keepalive feature to keep the connection alive by sending
keepalive packets to the AP. Primarily intended to interoperate with APs
that disconnect idle clients without any explicit checks. Slightly increases
power consumption.

if NRF_WIFI_FEAT_KEEPALIVE
config NRF_WIFI_KEEPALIVE_PERIOD_S
int "Keepalive period in seconds"
range 30 3600
default 60
help
Keepalive period in seconds to send keepalive packets to the AP.
endif
8 changes: 8 additions & 0 deletions drivers/wifi/nrf700x/osal/fw_if/umac_if/src/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ enum nrf_wifi_status umac_cmd_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx,
nrf_wifi_osal_log_info(fmac_dev_ctx->fpriv->opriv,
"Management buffer offload enabled\n");
#endif /* CONFIG_NRF_WIFI_MGMT_BUFF_OFFLOAD */
#ifdef CONFIG_NRF_WIFI_FEAT_KEEPALIVE
umac_cmd_data->keep_alive_enable = KEEP_ALIVE_ENABLED;
umac_cmd_data->keep_alive_period = CONFIG_NRF_WIFI_KEEPALIVE_PERIOD_S;
nrf_wifi_osal_log_dbg(fmac_dev_ctx->fpriv->opriv,
"Keepalive enabled with period %d\n",
umac_cmd_data->keepalive_period);
#endif /* CONFIG_NRF_WIFI_FEAT_KEEPALIVE */

#ifndef CONFIG_NRF700X_RADIO_TEST
nrf_wifi_osal_mem_cpy(fmac_dev_ctx->fpriv->opriv,
umac_cmd_data->rx_buf_pools,
Expand Down

0 comments on commit eb73df6

Please sign in to comment.