Skip to content

Commit

Permalink
drivers: wifi: Support to set quite period
Browse files Browse the repository at this point in the history
[SHEL-2817] Quite period is the period during which STA will stop
all types of TX/RX. Through this command user can configure the quiet period.

Signed-off-by: Ajay Parida <[email protected]>
  • Loading branch information
ajayparida committed Jun 12, 2024
1 parent 1ba794c commit eab5250
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions drivers/wifi/nrf700x/src/wifi_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -982,6 +1020,12 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
1,
1),
#endif /* CONFIG_NRF700X_RADIO_TEST */
SHELL_CMD_ARG(quiet_period,
NULL,
"<val> - Value > 0 seconds",
nrf_wifi_util_set_quiet_period,
2,
0),
SHELL_SUBCMD_SET_END);


Expand Down

0 comments on commit eab5250

Please sign in to comment.