diff --git a/drivers/wifi/nrf700x/src/wifi_util.c b/drivers/wifi/nrf700x/src/wifi_util.c index cee09ba60795..3c2911dff086 100644 --- a/drivers/wifi/nrf700x/src/wifi_util.c +++ b/drivers/wifi/nrf700x/src/wifi_util.c @@ -887,6 +887,44 @@ static int nrf_wifi_util_dump_rpu_stats(const struct shell *shell, } #endif /* CONFIG_NRF700X_RADIO_TEST */ +static int nrf_wifi_util_set_quiet_period(const struct shell *shell, + size_t argc, + const char *argv[]) +{ + + enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + char *ptr = NULL; + unsigned long val = 0; + + val = strtoul(argv[1], &ptr, 10); + + if ((val < 0) || (val > UINT_MAX)) { + shell_fprintf(shell, + SHELL_ERROR, + "Invalid value(%lu).\n", + val); + shell_help(shell); + return -ENOEXEC; + } + + if (ctx->conf_params.quiet_period != val) { + status = nrf_wifi_fmac_set_quiet_period(ctx->rpu_ctx, + 0, + (unsigned int)val); + + if (status != NRF_WIFI_STATUS_SUCCESS) { + shell_fprintf(shell, + SHELL_ERROR, + "Programming uapsd_queue failed\n"); + return -ENOEXEC; + } + + ctx->conf_params.quiet_period = val; + } + + return 0; +} + SHELL_STATIC_SUBCMD_SET_CREATE( nrf_wifi_util_subcmds, SHELL_CMD_ARG(he_ltf, @@ -982,6 +1020,12 @@ SHELL_STATIC_SUBCMD_SET_CREATE( 1, 1), #endif /* CONFIG_NRF700X_RADIO_TEST */ + SHELL_CMD_ARG(quiet_period, + NULL, + " - Value > 0 seconds", + nrf_wifi_util_set_quiet_period, + 2, + 0), SHELL_SUBCMD_SET_END);