summaryrefslogtreecommitdiff
path: root/include/net.h
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2019-09-13 19:21:16 -0500
committerJoe Hershberger <joe.hershberger@ni.com>2019-12-09 09:47:41 -0600
commitfb8977c5be93f8e967df224fe0a44721d60e34dc (patch)
tree49a2f694f9ba5eee2302570311ec21b00bb659aa /include/net.h
parentb38c3a641fc01fcd4eda5fa107ae3c247baa0196 (diff)
downloadu-boot-fb8977c5be93f8e967df224fe0a44721d60e34dc.tar.gz
u-boot-fb8977c5be93f8e967df224fe0a44721d60e34dc.tar.bz2
u-boot-fb8977c5be93f8e967df224fe0a44721d60e34dc.zip
net: Always build the string_to_enetaddr() helper
Part of the env cleanup moved this out of the environment code and into the net code. However, this helper is sometimes needed even when the net stack isn't included. Move the helper to lib/net_utils.c like it's similarly-purposed string_to_ip(). Also rename the moved function to similar naming. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reported-by: Ondrej Jirman <megous@megous.com>
Diffstat (limited to 'include/net.h')
-rw-r--r--include/net.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/include/net.h b/include/net.h
index 11eca1bc6c..22c83bc213 100644
--- a/include/net.h
+++ b/include/net.h
@@ -826,6 +826,19 @@ static inline void net_random_ethaddr(uchar *addr)
addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
}
+/**
+ * string_to_enetaddr() - Parse a MAC address
+ *
+ * Convert a string MAC address
+ *
+ * Implemented in lib/net_utils.c (built unconditionally)
+ *
+ * @addr: MAC address in aa:bb:cc:dd:ee:ff format, where each part is a 2-digit
+ * hex value
+ * @enetaddr: Place to put MAC address (6 bytes)
+ */
+void string_to_enetaddr(const char *addr, uint8_t *enetaddr);
+
/* Convert an IP address to a string */
void ip_to_string(struct in_addr x, char *s);
@@ -880,19 +893,6 @@ unsigned int random_port(void);
*/
int update_tftp(ulong addr, char *interface, char *devstring);
-/**********************************************************************/
-
-/**
- * eth_parse_enetaddr() - Parse a MAC address
- *
- * Convert a string MAC address
- *
- * @addr: MAC address in aa:bb:cc:dd:ee:ff format, where each part is a 2-digit
- * hex value
- * @enetaddr: Place to put MAC address (6 bytes)
- */
-void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr);
-
/**
* env_get_ip() - Convert an environment value to to an ip address
*
@@ -905,5 +905,4 @@ static inline struct in_addr env_get_ip(char *var)
{
return string_to_ip(env_get(var));
}
-
#endif /* __NET_H__ */