From f79db892fc9c53b909e3fd7c430a1fec3a885cfe Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 11 Apr 2025 08:31:19 +0200 Subject: cmd: Remove CMD_NET protection CMD_PXE is already under CMD_NET in Kconfig that's why make no sense to have another ifdef inside source code. Signed-off-by: Michal Simek Reviewed-by: Quentin Schulz --- cmd/pxe.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'cmd') diff --git a/cmd/pxe.c b/cmd/pxe.c index 37b8dea6ad6..0f26b3b4219 100644 --- a/cmd/pxe.c +++ b/cmd/pxe.c @@ -13,7 +13,6 @@ #include "pxe_utils.h" -#ifdef CONFIG_CMD_NET const char *pxe_default_paths[] = { #ifdef CONFIG_SYS_SOC #ifdef CONFIG_SYS_BOARD @@ -331,5 +330,3 @@ U_BOOT_CMD(pxe, 4, 1, do_pxe, "get [" USE_IP6_CMD_PARAM "] - try to retrieve a pxe file using tftp\n" "pxe boot [pxefile_addr_r] [-ipv6] - boot from the pxe file at pxefile_addr_r\n" ); - -#endif /* CONFIG_CMD_NET */ -- cgit v1.3.1 From 1f907e559d5d29f7824115e47c9771595fdf5819 Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Tue, 15 Apr 2025 23:17:42 +0200 Subject: net: ping: make do_ping() available via Make the do_ping() function in cmd/net.c a global one by getting rid of the static qualifier, and move the prototype declaration from net-lwip.h to net-common.h. This makes the function available to other parts of U-Boot when CONFIG_NET=y, as was already the case when CONFIG_NET_LWIP=y. This is a peparation step to make the sandbox tests use a common API between NET and NET_LWIP. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- cmd/net.c | 3 +-- include/net-common.h | 12 ++++++++++++ include/net-lwip.h | 1 - 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/net.c b/cmd/net.c index 79525f73a51..eaa1de5295f 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -456,8 +456,7 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc, } #if defined(CONFIG_CMD_PING) -static int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) +int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { if (argc < 2) return CMD_RET_USAGE; diff --git a/include/net-common.h b/include/net-common.h index 0b7edd7d76b..e536968a92b 100644 --- a/include/net-common.h +++ b/include/net-common.h @@ -493,6 +493,18 @@ int net_loop(enum proto_t protocol); */ int dhcp_run(ulong addr, const char *fname, bool autoload); + +/** + * do_ping - Run the ping command + * + * @cmdtp: Unused + * @flag: Command flags (CMD_FLAG_...) + * @argc: Number of arguments + * @argv: List of arguments + * Return: result (see enum command_ret_t) + */ +int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); + /** * do_tftpb - Run the tftpboot command * diff --git a/include/net-lwip.h b/include/net-lwip.h index 0d3bb8a8bd8..b762956e8fd 100644 --- a/include/net-lwip.h +++ b/include/net-lwip.h @@ -34,7 +34,6 @@ bool wget_validate_uri(char *uri); int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); -int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]); #endif /* __NET_LWIP_H__ */ -- cgit v1.3.1