lwip: split cmd/net-lwip.c into one file per command

Move each command in cmd/net-lwip.c into its own file
(cmd/lwip/${cmd}.c).

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
This commit is contained in:
Jerome Forissier 2025-06-25 15:19:12 +02:00
parent d63c4434bf
commit ba814b8b5a
7 changed files with 29 additions and 26 deletions

View File

@ -133,7 +133,7 @@ obj-$(CONFIG_CMD_NAND) += nand.o
ifdef CONFIG_NET
obj-$(CONFIG_CMD_NET) += net.o net-common.o
else ifdef CONFIG_NET_LWIP
obj-$(CONFIG_CMD_NET) += net-lwip.o net-common.o
obj-$(CONFIG_CMD_NET) += net-common.o
obj-y += lwip/
endif
obj-$(CONFIG_ENV_SUPPORT) += nvedit.o

View File

@ -1,2 +1,5 @@
obj-$(CONFIG_CMD_DHCP) += dhcp.o
obj-$(CONFIG_CMD_DNS) += dns.o
obj-$(CONFIG_CMD_PING) += ping.o
obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o
obj-$(CONFIG_CMD_WGET) += wget.o

9
cmd/lwip/dhcp.c Normal file
View File

@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0+
/* Copyright (C) 2024-2025 Linaro Ltd. */
#include <command.h>
#include <net.h>
U_BOOT_CMD(dhcp, 3, 1, do_dhcp,
"boot image via network using DHCP/TFTP protocol",
"[loadAddress] [[hostIPaddr:]bootfilename]");

View File

@ -9,6 +9,9 @@
#include <net.h>
#include <time.h>
U_BOOT_CMD(dns, 3, 1, do_dns, "lookup the IP of a hostname",
"hostname [envvar]");
#define DNS_RESEND_MS 1000
#define DNS_TIMEOUT_MS 10000

View File

@ -13,6 +13,9 @@
#include <net.h>
#include <time.h>
U_BOOT_CMD(ping, 2, 1, do_ping, "send ICMP ECHO_REQUEST to network host",
"pingAddress");
#define PING_DELAY_MS 1000
#define PING_COUNT 5
/* Ping identifier - must fit on a u16_t */

9
cmd/lwip/tftp.c Normal file
View File

@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0+
/* Copyright (C) 2024-2025 Linaro Ltd. */
#include <command.h>
#include <net.h>
U_BOOT_CMD(tftpboot, 3, 0, do_tftpb,
"boot image via network using TFTP protocol",
"[loadAddress] [[hostIPaddr:]bootfilename]");

View File

@ -1,32 +1,9 @@
// SPDX-License-Identifier: GPL-2.0+
/* Copyright (C) 2024 Linaro Ltd. */
/* Copyright (C) 2024-2025 Linaro Ltd. */
#include <command.h>
#include <net.h>
#if defined(CONFIG_CMD_DHCP)
U_BOOT_CMD(dhcp, 3, 1, do_dhcp,
"boot image via network using DHCP/TFTP protocol",
"[loadAddress] [[hostIPaddr:]bootfilename]");
#endif
#if defined(CONFIG_CMD_PING)
U_BOOT_CMD(ping, 2, 1, do_ping, "send ICMP ECHO_REQUEST to network host",
"pingAddress");
#endif
#if defined(CONFIG_CMD_TFTPBOOT)
U_BOOT_CMD(tftpboot, 3, 0, do_tftpb,
"boot image via network using TFTP protocol",
"[loadAddress] [[hostIPaddr:]bootfilename]");
#endif
#if defined(CONFIG_CMD_DNS)
U_BOOT_CMD(dns, 3, 1, do_dns, "lookup the IP of a hostname",
"hostname [envvar]");
#endif
#if defined(CONFIG_CMD_WGET)
U_BOOT_CMD(wget, 4, 1, do_wget,
"boot image via network using HTTP/HTTPS protocol"
#if defined(CONFIG_WGET_CACERT)
@ -47,4 +24,3 @@ U_BOOT_CMD(wget, 4, 1, do_wget,
#endif
#endif
);
#endif