Compare commits

...

2 Commits

Author SHA1 Message Date
Simon Glass
638e5af7da net: Move env_get_ip() out of the header file
This function requires access to env.h but it is a lot to include just
for the env_get() function. It eventually pulls in linux/byteorder which
causes a conflict with exfat which has its own byteorder functions.

Move the function to a C file instead.

Series-to: u-boot
Series-cc: trini
Series-cc: Jerome Forissier <jerome.forissier@linaro.org>

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-30 08:38:15 -06:00
Simon Glass
eb3a1b3ab6 net: Use a forward declaration for cmd_tbl in net-common.h
We don't need to include command.h just for this declaration. It
eventually pulls in linux/byteorder which causes a conflict with exfat
which has its own byteorder functions.

Use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-30 08:37:27 -06:00
2 changed files with 9 additions and 6 deletions

View File

@@ -4,8 +4,6 @@
#define __NET_COMMON_H__
#include <asm/cache.h>
#include <command.h>
#include <env.h>
#include <hexdump.h>
#include <linux/if_ether.h>
#include <linux/sizes.h>
@@ -13,6 +11,8 @@
#include <rand.h>
#include <time.h>
struct cmd_tbl;
#define DEBUG_NET_PKT_TRACE 0 /* Trace all packet data */
/*
@@ -463,10 +463,7 @@ int update_tftp(ulong addr, char *interface, char *devstring);
* 0 to 255
* Return: IP address, or 0 if invalid
*/
static inline struct in_addr env_get_ip(char *var)
{
return string_to_ip(env_get(var));
}
struct in_addr env_get_ip(char *var);
int net_init(void);

View File

@@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include <env.h>
#include <net-common.h>
void copy_filename(char *dst, const char *src, int size)
@@ -25,3 +26,8 @@ int wget_request(ulong dst_addr, char *uri, struct wget_http_info *info)
wget_info = info ? info : &default_wget_info;
return wget_with_dns(dst_addr, uri);
}
struct in_addr env_get_ip(char *var)
{
return string_to_ip(env_get(var));
}