diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2015-03-22 17:09:00 -0500 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 11:11:10 -0600 |
commit | 8b2c9a7157c3c737b3bdf640796509eef0a58c52 (patch) | |
tree | f50951a973cf76471e0199bb01b5d69b245c88a6 /include/net.h | |
parent | 0eb25b619699270a8af95c2f76791fd6c4b52972 (diff) | |
download | u-boot-imx-8b2c9a7157c3c737b3bdf640796509eef0a58c52.zip u-boot-imx-8b2c9a7157c3c737b3bdf640796509eef0a58c52.tar.gz u-boot-imx-8b2c9a7157c3c737b3bdf640796509eef0a58c52.tar.bz2 |
net: Provide a function to get the current MAC address
The current implementation exposes the eth_device struct to code that
needs to access the MAC address. Add a wrapper function for this to
abstract away the pointer for this operation.
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.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net.h b/include/net.h index 237c932..ad29aa8 100644 --- a/include/net.h +++ b/include/net.h @@ -111,6 +111,14 @@ struct eth_device *eth_get_dev(void) { return eth_current; } + +static inline unsigned char *eth_get_ethaddr(void) +{ + if (eth_current) + return eth_current->enetaddr; + return NULL; +} + extern struct eth_device *eth_get_dev_by_name(const char *devname); extern struct eth_device *eth_get_dev_by_index(int index); /* get dev @ index */ extern int eth_get_dev_index(void); /* get the device index */ |