1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-18 00:11:48 +02:00

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>
This commit is contained in:
Joe Hershberger
2015-03-22 17:09:16 -05:00
committed by Simon Glass
parent bfacad7da1
commit e58780dcb7
5 changed files with 74 additions and 11 deletions

View File

@@ -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 */