summaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-08-01 09:46:54 -0600
committerTom Rini <trini@konsulko.com>2019-08-11 16:43:41 -0400
commit36c8b143c0c113232bcf47d6499a3982fdfaf98a (patch)
treebece8d64b485797ecfbcf1b582da2936d73c6065 /net/net.c
parentb79cf1af0d1cf175c4414ea1b8465747431d77cf (diff)
downloadu-boot-36c8b143c0c113232bcf47d6499a3982fdfaf98a.tar.gz
u-boot-36c8b143c0c113232bcf47d6499a3982fdfaf98a.tar.bz2
u-boot-36c8b143c0c113232bcf47d6499a3982fdfaf98a.zip
env: net: Move eth_parse_enetaddr() to net.c/h
This function fits better with the network subsystem, so move it. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c
index 1a175c4597..f0a3996cd6 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1614,3 +1614,15 @@ ushort env_get_vlan(char *var)
{
return string_to_vlan(env_get(var));
}
+
+void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr)
+{
+ char *end;
+ int i;
+
+ for (i = 0; i < 6; ++i) {
+ enetaddr[i] = addr ? simple_strtoul(addr, &end, 16) : 0;
+ if (addr)
+ addr = (*end) ? end + 1 : end;
+ }
+}