aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDirk Behme <dirk.behme@googlemail.com>2010-01-03 08:33:58 +0100
committerWolfgang Denk <wd@denx.de>2010-01-17 20:14:47 +0100
commit6a45e384955262882375a2785426dc65aeb636c4 (patch)
treea1648daf66d4be1d71427f8e2f35123180f9de04 /include
parent2740544881f652566756815dda4da0bcd946e9de (diff)
Make getenv_IPaddr() global
There are boards out there that do not have network support in U-Boot (CONFIG_CMD_NET not set), but they do so in Linux. This makes it desirable to be able to port network configuration (like the IP address) to the Linux kernel. We should not make the passing of the IP configuration to Linux dependent on U-Boot features / settings. For this, make getenv_IPaddr() global. This fixes build error u-boot/lib_xxx/board.c:360: undefined reference to `getenv_IPaddr' on various architectures. Signed-off-by: Dirk Behme <dirk.behme@googlemail.com> Acked-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/common.h7
-rw-r--r--include/net.h3
2 files changed, 7 insertions, 3 deletions
diff --git a/include/common.h b/include/common.h
index 07897f682..8197508b6 100644
--- a/include/common.h
+++ b/include/common.h
@@ -617,6 +617,13 @@ int gunzip(void *, int, unsigned char *, unsigned long *);
int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,
int stoponerr, int offset);
+/* lib_generic/net_utils.c */
+#include <net.h>
+static inline IPaddr_t getenv_IPaddr (char *var)
+{
+ return (string_to_ip(getenv(var)));
+}
+
/* lib_generic/time.c */
void udelay (unsigned long);
diff --git a/include/net.h b/include/net.h
index 1c8ab1245..3f6a5d149 100644
--- a/include/net.h
+++ b/include/net.h
@@ -508,9 +508,6 @@ extern void VLAN_to_string (ushort x, char *s);
/* Convert a string to a vlan id */
extern ushort string_to_VLAN(char *s);
-/* read an IP address from a environment variable */
-extern IPaddr_t getenv_IPaddr (char *);
-
/* read a VLAN id from an environment variable */
extern ushort getenv_VLAN(char *);