From e58780dcb7b8656ebc2dd6ba6d0da728bc65bf40 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Sun, 22 Mar 2015 17:09:16 -0500 Subject: 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 Reviewed-by: Simon Glass --- include/net.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/net.h') diff --git a/include/net.h b/include/net.h index 0a1b3a827ce..942fa4c929e 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 */ -- cgit