Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions drivers/wifi/nrf_wifi/Kconfig.nrfwifi
Original file line number Diff line number Diff line change
Expand Up @@ -682,15 +682,6 @@ config NET_MGMT_EVENT_QUEUE_SIZE
# Doing interface down and up even with delay puts a lot of events in the queue
default 16

config NRF_WIFI_RPU_RECOVERY_PROPAGATION_DELAY_MS
int "RPU recovery propagation delay in milliseconds"
default 10
help
Propagation delay in milliseconds to wait after the RPU is powered down
before powering it up. This delay is required to ensure that the recovery
is propagated to all the applications and stack, and has enough time to
clean up the resources.

config NRF_WIFI_RPU_RECOVERY_PS_ACTIVE_TIMEOUT_MS
int "RPU recovery power save active timeout in milliseconds"
default 50000
Expand Down
2 changes: 2 additions & 0 deletions drivers/wifi/nrf_wifi/inc/fmac_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ struct nrf_wifi_ctx_zep {
bool rpu_recovery_in_progress;
unsigned long last_rpu_recovery_time_ms;
unsigned int rpu_recovery_retries;
int rpu_recovery_success;
int rpu_recovery_failure;
#endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */
};

Expand Down
6 changes: 6 additions & 0 deletions drivers/wifi/nrf_wifi/src/net_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static void nrf_wifi_rpu_recovery_work_handler(struct k_work *work)
nrf_wifi_rpu_recovery_work);
struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL;
int ret;
bool recovery_fail = false;

if (!vif_ctx_zep) {
LOG_ERR("%s: vif_ctx_zep is NULL", __func__);
Expand Down Expand Up @@ -143,6 +144,8 @@ static void nrf_wifi_rpu_recovery_work_handler(struct k_work *work)
/* This indirectly does a cold-boot of RPU */
ret = net_if_down(vif_ctx_zep->zep_net_if_ctx);
if (ret) {
rpu_ctx_zep->rpu_recovery_failure++;
recovery_fail = true;
LOG_ERR("%s: net_if_down failed: %d", __func__, ret);
/* Continue with the recovery */
}
Expand All @@ -158,6 +161,9 @@ static void nrf_wifi_rpu_recovery_work_handler(struct k_work *work)
}
rpu_ctx_zep->rpu_recovery_in_progress = false;
rpu_ctx_zep->last_rpu_recovery_time_ms = k_uptime_get();
if (!recovery_fail) {
rpu_ctx_zep->rpu_recovery_success++;
}
k_mutex_unlock(&rpu_ctx_zep->rpu_lock);
#ifdef CONFIG_NRF_WIFI_RPU_RECOVERY_DEBUG
LOG_ERR("%s: RPU recovery done", __func__);
Expand Down
52 changes: 52 additions & 0 deletions drivers/wifi/nrf_wifi/src/wifi_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,52 @@
k_mutex_unlock(&ctx->rpu_lock);
return ret;
}

static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh,
size_t argc,
const char *argv[])
{

Check notice on line 922 in drivers/wifi/nrf_wifi/src/wifi_util.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wifi_util.c:922 -static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh, - size_t argc, - const char *argv[]) +static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh, size_t argc, const char *argv[])
struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL;
struct nrf_wifi_hal_dev_ctx *hal_dev_ctx = NULL;
unsigned long current_time_ms = nrf_wifi_osal_time_get_curr_ms();
int ret;

k_mutex_lock(&ctx->rpu_lock, K_FOREVER);
if (!ctx || !ctx->rpu_ctx) {
shell_fprintf(sh,
SHELL_ERROR,
"RPU context not initialized\n");
ret = -ENOEXEC;

Check notice on line 933 in drivers/wifi/nrf_wifi/src/wifi_util.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wifi_util.c:933 - shell_fprintf(sh, - SHELL_ERROR, - "RPU context not initialized\n"); + shell_fprintf(sh, SHELL_ERROR, "RPU context not initialized\n");
goto unlock;
}

fmac_dev_ctx = ctx->rpu_ctx;
hal_dev_ctx = fmac_dev_ctx->hal_dev_ctx;

shell_fprintf(sh,
SHELL_INFO,
"wdt_irq_received: %d\n"

Check notice on line 942 in drivers/wifi/nrf_wifi/src/wifi_util.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wifi_util.c:942 - shell_fprintf(sh, - SHELL_INFO, + shell_fprintf(sh, SHELL_INFO,
"wdt_irq_ignored: %d\n"
"last_wakeup_now_asserted_time_ms: %lu milliseconds\n"
"last_wakeup_now_deasserted_time_ms: %lu milliseconds\n"
"last_rpu_sleep_opp_time_ms: %lu milliseconds\n"
"current time: %lu milliseconds\n"
"rpu_recovery_success: %d\n"
"rpu_recovery_failure: %d\n\n",
hal_dev_ctx->wdt_irq_received,
hal_dev_ctx->wdt_irq_ignored,
hal_dev_ctx->last_wakeup_now_asserted_time_ms,
hal_dev_ctx->last_wakeup_now_deasserted_time_ms,
hal_dev_ctx->last_rpu_sleep_opp_time_ms,
current_time_ms,
ctx->rpu_recovery_success,
ctx->rpu_recovery_failure);

Check notice on line 958 in drivers/wifi/nrf_wifi/src/wifi_util.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wifi_util.c:958 - hal_dev_ctx->wdt_irq_received, - hal_dev_ctx->wdt_irq_ignored, + hal_dev_ctx->wdt_irq_received, hal_dev_ctx->wdt_irq_ignored, hal_dev_ctx->last_wakeup_now_asserted_time_ms, hal_dev_ctx->last_wakeup_now_deasserted_time_ms, - hal_dev_ctx->last_rpu_sleep_opp_time_ms, - current_time_ms, - ctx->rpu_recovery_success, - ctx->rpu_recovery_failure); + hal_dev_ctx->last_rpu_sleep_opp_time_ms, current_time_ms, + ctx->rpu_recovery_success, ctx->rpu_recovery_failure);
ret = 0;
unlock:
k_mutex_unlock(&ctx->rpu_lock);
return ret;
}
#endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */

SHELL_STATIC_SUBCMD_SET_CREATE(
Expand Down Expand Up @@ -967,7 +1013,7 @@
#endif /* CONFIG_NRF70_STA_MODE */
SHELL_CMD_ARG(tx_rate,
NULL,
"Sets TX data rate to either a fixed value or AUTO\n"

Check notice on line 1016 in drivers/wifi/nrf_wifi/src/wifi_util.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wifi_util.c:1016 - SHELL_CMD_ARG(he_ltf, - NULL, + SHELL_CMD_ARG(he_ltf, NULL, "0 - 1x HE LTF\n" "1 - 2x HE LTF\n" "2 - 4x HE LTF ", - nrf_wifi_util_set_he_ltf, - 2, - 0), - SHELL_CMD_ARG(he_gi, - NULL, + nrf_wifi_util_set_he_ltf, 2, 0), + SHELL_CMD_ARG(he_gi, NULL, "0 - 0.8 us\n" "1 - 1.6 us\n" "2 - 3.2 us ", - nrf_wifi_util_set_he_gi, - 2, - 0), - SHELL_CMD_ARG(set_he_ltf_gi, - NULL, + nrf_wifi_util_set_he_gi, 2, 0), + SHELL_CMD_ARG(set_he_ltf_gi, NULL, "0 - Disable\n" "1 - Enable", - nrf_wifi_util_set_he_ltf_gi, - 2, - 0), + nrf_wifi_util_set_he_ltf_gi, 2, 0), #ifdef CONFIG_NRF70_STA_MODE - SHELL_CMD_ARG(uapsd_queue, - NULL, - "<val> - 0 to 15", - nrf_wifi_util_set_uapsd_queue, - 2, - 0), + SHELL_CMD_ARG(uapsd_queue, NULL, "<val> - 0 to 15", nrf_wifi_util_set_uapsd_queue, 2, 0), #endif /* CONFIG_NRF70_STA_MODE */ - SHELL_CMD_ARG(show_config, - NULL, - "Display the current configuration values", - nrf_wifi_util_show_cfg, - 1, - 0), + SHELL_CMD_ARG(show_config, NULL, "Display the current configuration values", + nrf_wifi_util_show_cfg, 1, 0), #ifdef CONFIG_NRF70_STA_MODE - SHELL_CMD_ARG(tx_stats, - NULL, + SHELL_CMD_ARG(tx_stats, NULL, "Displays transmit statistics\n" - "vif_index: 0 - 1\n", - nrf_wifi_util_tx_stats, - 2, - 0), + "vif_index: 0 - 1\n", + nrf_wifi_util_tx_stats, 2, 0), #endif /* CONFIG_NRF70_STA_MODE */ - SHELL_CMD_ARG(tx_rate, - NULL, + SHELL_CMD_ARG(tx_rate, NULL,
"Parameters:\n"
" <rate_flag> : The TX data rate type to be set, where:\n"
" 0 - LEGACY\n"
Expand Down Expand Up @@ -1013,7 +1059,13 @@
nrf_wifi_util_trigger_rpu_recovery,
1,
0),
SHELL_CMD_ARG(rpu_recovery_info,
NULL,
"Dump RPU recovery information",
nrf_wifi_util_rpu_recovery_info,
1,
0),
#endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */

Check notice on line 1068 in drivers/wifi/nrf_wifi/src/wifi_util.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wifi_util.c:1068 - nrf_wifi_util_tx_rate, - 2, - 1), + nrf_wifi_util_tx_rate, 2, 1), #ifdef CONFIG_NRF_WIFI_LOW_POWER - SHELL_CMD_ARG(sleep_state, - NULL, - "Display current sleep status", - nrf_wifi_util_show_host_rpu_ps_ctrl_state, - 1, - 0), + SHELL_CMD_ARG(sleep_state, NULL, "Display current sleep status", + nrf_wifi_util_show_host_rpu_ps_ctrl_state, 1, 0), #endif /* CONFIG_NRF_WIFI_LOW_POWER */ - SHELL_CMD_ARG(show_vers, - NULL, - "Display the driver and the firmware versions", - nrf_wifi_util_show_vers, - 1, - 0), + SHELL_CMD_ARG(show_vers, NULL, "Display the driver and the firmware versions", + nrf_wifi_util_show_vers, 1, 0), #if !defined(CONFIG_NRF70_RADIO_TEST) && !defined(CONFIG_NRF70_OFFLOADED_RAW_TX) - SHELL_CMD_ARG(rpu_stats, - NULL, + SHELL_CMD_ARG(rpu_stats, NULL, "Display RPU stats " "Parameters: umac or lmac or phy or all (default)", - nrf_wifi_util_dump_rpu_stats, - 1, - 1), + nrf_wifi_util_dump_rpu_stats, 1, 1), #endif /* !CONFIG_NRF70_RADIO_TEST && !CONFIG_NRF70_OFFLOADED_RAW_TX*/ #ifdef CONFIG_NRF_WIFI_RPU_RECOVERY - SHELL_CMD_ARG(rpu_recovery_test, - NULL, - "Trigger RPU recovery", - nrf_wifi_util_trigger_rpu_recovery, - 1, - 0), - SHELL_CMD_ARG(rpu_recovery_info, - NULL, - "Dump RPU recovery information", - nrf_wifi_util_rpu_recovery_info, - 1, - 0), + SHELL_CMD_ARG(rpu_recovery_test, NULL, "Trigger RPU recovery", + nrf_wifi_util_trigger_rpu_recovery, 1, 0), + SHELL_CMD_ARG(rpu_recovery_info, NULL, "Dump RPU recovery information", + nrf_wifi_util_rpu_recovery_info, 1, 0),
SHELL_SUBCMD_SET_END);


Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ manifest:
revision: 3cfca0192ff84da919e9bc7978bcc2239cd6a395
path: modules/bsim_hw_models/nrf_hw_models
- name: nrf_wifi
revision: f9e2abdb70761003912b1b929a37b536f68a91da
revision: 71261e2b719b98500b7741c3398a74a5fb631596
path: modules/lib/nrf_wifi
- name: open-amp
revision: b735edbc739ad59156eb55bb8ce2583d74537719
Expand Down
Loading