From 5e6f28328746666cb73162498463fd8b76e7b20c Mon Sep 17 00:00:00 2001 From: Maochen Wang Date: Wed, 16 Oct 2024 12:10:01 +0800 Subject: [PATCH] net: l2: wifi: fix AP sets band failed with channel 0 Should support setting band for both STA and SAP mode. Signed-off-by: Maochen Wang --- subsys/net/l2/wifi/wifi_shell.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 48d0dc835ccd1..0131d119932e8 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -587,7 +587,8 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv params->channel = channel; break; case 'b': - if (iface_mode == WIFI_MODE_INFRA) { + if (iface_mode == WIFI_MODE_INFRA || + iface_mode == WIFI_MODE_AP) { switch (atoi(state->optarg)) { case 2: params->band = WIFI_FREQ_BAND_2_4_GHZ;