summaryrefslogtreecommitdiff
path: root/include/linux/etherdevice.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-11-05 19:34:57 +0300
committerDavid S. Miller <davem@davemloft.net>2016-01-07 00:31:56 +0300
commitc7f5d105495a38ed09e70d825f75d9d7d5407264 (patch)
tree2c111b9bb5bb557400914e31839f0d41b1018da3 /include/linux/etherdevice.h
parentcdba756f5803a2f0a8bbc6605acc166dd817979e (diff)
downloadlinux-c7f5d105495a38ed09e70d825f75d9d7d5407264.tar.xz
net: Add eth_platform_get_mac_address() helper.
A repeating pattern in drivers has become to use OF node information and, if not found, platform specific host information to extract the ethernet address for a given device. Currently this is done with a call to of_get_mac_address() and then some ifdef'd stuff for SPARC. Consolidate this into a portable routine, and provide the arch_get_platform_mac_address() weak function hook for all architectures to implement if they want. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/etherdevice.h')
-rw-r--r--include/linux/etherdevice.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index eb049c622208..37ff4a6faa9a 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -29,6 +29,9 @@
#include <asm/bitsperlong.h>
#ifdef __KERNEL__
+struct device;
+int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr);
+unsigned char *arch_get_platform_get_mac_address(void);
u32 eth_get_headlen(void *data, unsigned int max_len);
__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
extern const struct header_ops eth_header_ops;