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>
This commit is contained in:
committed by
Simon Glass
parent
0eb25b6196
commit
8b2c9a7157
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user