Skip to content

Commit 9e736e5

Browse files
[nrf fromlist] drivers: nrf_wifi: Convert utility shell to a sub shell
Convert the utility shell for nRF70 to a sub-shell under a nRF70 specific shell. Upstream PR #: 87823 Signed-off-by: Sachin D Kulkarni <[email protected]>
1 parent 516731b commit 9e736e5

File tree

7 files changed

+20
-16
lines changed

7 files changed

+20
-16
lines changed

drivers/wifi/nrf_wifi/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,17 @@ zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE
5858
zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE
5959
src/wpa_supp_if.c)
6060

61-
zephyr_library_sources_ifdef(CONFIG_NRF70_UTIL
62-
src/wifi_util.c
61+
if(CONFIG_NRF70_UTIL_SHELL OR CONFIG_NRF70_DEBUG_SHELL)
62+
zephyr_library_sources(
63+
src/shell.c
64+
)
65+
endif()
66+
67+
zephyr_library_sources_ifdef(CONFIG_NRF70_UTIL_SHELL
68+
src/util_shell.c
6369
)
6470

6571
zephyr_library_sources_ifdef(CONFIG_NRF70_DEBUG_SHELL
66-
src/shell.c
6772
src/debug_shell.c
6873
)
6974

drivers/wifi/nrf_wifi/Kconfig.nrfwifi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ config NRF70_MAX_TX_PENDING_QLEN
194194
int "Maximum number of pending TX packets"
195195
default 18
196196

197-
config NRF70_UTIL
197+
config NRF70_UTIL_SHELL
198198
depends on SHELL
199199
bool "Utility shell in nRF70 driver"
200200

drivers/wifi/nrf_wifi/inc/fmac_main.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ struct nrf_wifi_ctx_zep {
104104
unsigned char rf_test;
105105
#else /* CONFIG_NRF70_RADIO_TEST */
106106
struct nrf_wifi_vif_ctx_zep vif_ctx_zep[MAX_NUM_VIFS];
107-
#ifdef CONFIG_NRF70_UTIL
107+
#ifdef CONFIG_NRF70_UTIL_SHELL
108108
struct rpu_conf_params conf_params;
109-
#endif /* CONFIG_NRF70_UTIL */
109+
#endif /* CONFIG_NRF70_UTIL_SHELL */
110110
#endif /* CONFIG_NRF70_RADIO_TEST */
111111
unsigned char *extended_capa, *extended_capa_mask;
112112
unsigned int extended_capa_len;

drivers/wifi/nrf_wifi/src/wifi_util.c renamed to drivers/wifi/nrf_wifi/src/util_shell.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024 Nordic Semiconductor ASA
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -12,7 +12,7 @@
1212
#include "common/fmac_util.h"
1313
#include "system/fmac_api.h"
1414
#include "fmac_main.h"
15-
#include "wifi_util.h"
15+
#include "util_shell.h"
1616

1717
extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep;
1818
struct nrf_wifi_ctx_zep *ctx = &rpu_drv_priv_zep.rpu_ctx_zep;
@@ -964,7 +964,7 @@ static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh,
964964
#endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */
965965

966966
SHELL_STATIC_SUBCMD_SET_CREATE(
967-
nrf_wifi_util_subcmds,
967+
nrf70_util,
968968
SHELL_CMD_ARG(he_ltf,
969969
NULL,
970970
"0 - 1x HE LTF\n"
@@ -1069,11 +1069,10 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
10691069
SHELL_SUBCMD_SET_END);
10701070

10711071

1072-
SHELL_CMD_REGISTER(wifi_util,
1073-
&nrf_wifi_util_subcmds,
1074-
"nRF Wi-Fi utility shell commands",
1075-
NULL);
1076-
1072+
SHELL_SUBCMD_ADD((nrf70), util, &nrf70_util,
1073+
"nRF70 utility commands\n",
1074+
NULL,
1075+
0, 0);
10771076

10781077
static int nrf_wifi_util_init(void)
10791078
{
File renamed without changes.

samples/net/wifi/shell/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ tests:
6767
- nucleo_h723zg
6868
sample.net.wifi.nrf7002eb:
6969
extra_args:
70-
- CONFIG_NRF70_UTIL=y
70+
- CONFIG_NRF70_UTIL_SHELL=y
7171
- CONFIG_BUILD_ONLY_NO_BLOBS=y
7272
- SHIELD=nrf7002eb
7373
platform_allow:

samples/net/zperf/boards/nrf7002dk_nrf5340_cpuapp.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ CONFIG_NVS=n
1919
CONFIG_SETTINGS=n
2020

2121
# Debugging
22-
CONFIG_NRF70_UTIL=y
22+
CONFIG_NRF70_UTIL_SHELL=y
2323
CONFIG_SYS_HEAP_RUNTIME_STATS=y
2424
CONFIG_NET_STATISTICS=y
2525
CONFIG_NET_STATISTICS_WIFI=y

0 commit comments

Comments
 (0)