summaryrefslogtreecommitdiff
path: root/include/net.h
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2015-03-22 17:09:16 -0500
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:13 -0600
commite58780dcb7b8656ebc2dd6ba6d0da728bc65bf40 (patch)
tree68b6448131caeaa7d02a88cfbb1116e56f3b679b /include/net.h
parentbfacad7da11711231ca59717c0a8bc7317c5bb28 (diff)
downloadu-boot-e58780dcb7b8656ebc2dd6ba6d0da728bc65bf40.tar.gz
dm: eth: Add support for aliases
Allow network devices to be referred to as "eth0" instead of "eth@12345678" when specified in ethact. Add tests to verify this behavior. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/net.h')
-rw-r--r--include/net.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net.h b/include/net.h
index 0a1b3a827c..942fa4c929 100644
--- a/include/net.h
+++ b/include/net.h
@@ -124,6 +124,11 @@ struct eth_ops {
#define eth_get_ops(dev) ((struct eth_ops *)(dev)->driver->ops)
struct udevice *eth_get_dev(void); /* get the current device */
+/*
+ * The devname can be either an exact name given by the driver or device tree
+ * or it can be an alias of the form "eth%d"
+ */
+struct udevice *eth_get_dev_by_name(const char *devname);
unsigned char *eth_get_ethaddr(void); /* get the current device MAC */
/* Used only when NetConsole is enabled */
int eth_init_state_only(void); /* Set active state */