summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJerome Forissier <jerome.forissier@linaro.org>2024-10-16 12:04:00 +0200
committerTom Rini <trini@konsulko.com>2024-10-16 11:11:56 -0600
commit1d5d292b79415abf3d0214cd2f707b43cf9fdfbf (patch)
tree349a83bb8c17c24b19bbfc918b5076afc300ae8e /net
parent8cb330355bd52852f209cf08c1e79babfbdf1253 (diff)
net: split net into net{,-common,-legacy,-lwip}
Make net.h a wrapper which includes net-common.h and either net-legacy.h or net-lwip.h based on NET_LWIP. The function copy_filename() can be useful when NET_LWIP is enabled, therefore move it out of net/net.c which is built only when networking choice is NET and create a new file net/net-common.c. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'net')
-rw-r--r--net/Makefile2
-rw-r--r--net/net-common.c13
-rw-r--r--net/net.c12
3 files changed, 15 insertions, 12 deletions
diff --git a/net/Makefile b/net/Makefile
index 33c82b5d229..34fe50133a3 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -42,3 +42,5 @@ obj-$(CONFIG_CMD_WGET) += wget.o
CFLAGS_eth_common.o += -Wno-format-extra-args
endif
+
+obj-y += net-common.o
diff --git a/net/net-common.c b/net/net-common.c
new file mode 100644
index 00000000000..a7f767d5e9c
--- /dev/null
+++ b/net/net-common.c
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0
+
+void copy_filename(char *dst, const char *src, int size)
+{
+ if (src && *src && (*src == '"')) {
+ ++src;
+ --size;
+ }
+
+ while ((--size > 0) && src && *src && (*src != '"'))
+ *dst++ = *src++;
+ *dst = '\0';
+}
diff --git a/net/net.c b/net/net.c
index 64bcf69d83f..f47e9fbe33a 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1693,18 +1693,6 @@ void net_set_udp_header(uchar *pkt, struct in_addr dest, int dport, int sport,
ip->udp_xsum = 0;
}
-void copy_filename(char *dst, const char *src, int size)
-{
- if (src && *src && (*src == '"')) {
- ++src;
- --size;
- }
-
- while ((--size > 0) && src && *src && (*src != '"'))
- *dst++ = *src++;
- *dst = '\0';
-}
-
int is_serverip_in_cmd(void)
{
return !!strchr(net_boot_file_name, ':');