]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
lwip: split cmd/net-lwip.c into one file per command
authorJerome Forissier <jerome.forissier@linaro.org>
Wed, 25 Jun 2025 13:19:12 +0000 (15:19 +0200)
committerJerome Forissier <jerome.forissier@linaro.org>
Tue, 8 Jul 2025 09:07:37 +0000 (11:07 +0200)
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>
cmd/Makefile
cmd/lwip/Makefile
cmd/lwip/dhcp.c [new file with mode: 0644]
cmd/lwip/dns.c
cmd/lwip/ping.c
cmd/lwip/tftp.c [new file with mode: 0644]
cmd/lwip/wget.c [moved from cmd/net-lwip.c with 51% similarity]

index 9c5bfc91659c9db46fbfbd44e00bc360b8b26da4..34fa73d64fcc9ba71bb6745cdc610e3b65849282 100644 (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
index da79b64b5c25e274272222c30fed8bf5d88c5e45..4c28d2b28e5bc5edb986a3ecf568378aba0f64c4 100644 (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
diff --git a/cmd/lwip/dhcp.c b/cmd/lwip/dhcp.c
new file mode 100644 (file)
index 0000000..3894d71
--- /dev/null
@@ -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]");
index fe70bdb48289001842568835b985476c7bc81be9..0af538e18f511e4cab473b84294287ba73cfc9c7 100644 (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
 
index 1390b914f7d8ad9d5a5e85131d05e214faa0d16c..6996931fa4045d7ee805c5b424da66a717bc5ac8 100644 (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 */
diff --git a/cmd/lwip/tftp.c b/cmd/lwip/tftp.c
new file mode 100644 (file)
index 0000000..6bb7a37
--- /dev/null
@@ -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]");
similarity index 51%
rename from cmd/net-lwip.c
rename to cmd/lwip/wget.c
index cecf8d02555ede5b9c1f067a287a600f7c197846..3f5b9952c93d0d57bf8e5ebd9e15ba25a2af3aa0 100644 (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