Merge branch 'address-masking'
[linux-2.6-block.git] / include / linux / of_net.h
CommitLineData
55716d26 1/* SPDX-License-Identifier: GPL-2.0-only */
4b6ba8aa
DD
2/*
3 * OF helpers for network devices.
4b6ba8aa
DD
4 */
5
6#ifndef __LINUX_OF_NET_H
7#define __LINUX_OF_NET_H
8
0c65b2b9
AL
9#include <linux/phy.h>
10
8b017fbe 11#if defined(CONFIG_OF) && defined(CONFIG_NET)
4b6ba8aa 12#include <linux/of.h>
aa836df9
FF
13
14struct net_device;
0c65b2b9 15extern int of_get_phy_mode(struct device_node *np, phy_interface_t *interface);
83216e39 16extern int of_get_mac_address(struct device_node *np, u8 *mac);
4c47867b 17extern int of_get_mac_address_nvmem(struct device_node *np, u8 *mac);
d466effe 18int of_get_ethdev_address(struct device_node *np, struct net_device *dev);
aa836df9 19extern struct net_device *of_find_net_device_by_node(struct device_node *np);
65b3841b 20#else
0c65b2b9
AL
21static inline int of_get_phy_mode(struct device_node *np,
22 phy_interface_t *interface)
65b3841b
GR
23{
24 return -ENODEV;
25}
26
83216e39 27static inline int of_get_mac_address(struct device_node *np, u8 *mac)
65b3841b 28{
83216e39 29 return -ENODEV;
65b3841b 30}
aa836df9 31
4c47867b
MR
32static inline int of_get_mac_address_nvmem(struct device_node *np, u8 *mac)
33{
34 return -ENODEV;
35}
36
d466effe
JK
37static inline int of_get_ethdev_address(struct device_node *np, struct net_device *dev)
38{
39 return -ENODEV;
40}
41
aa836df9
FF
42static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
43{
44 return NULL;
45}
4b6ba8aa
DD
46#endif
47
48#endif /* __LINUX_OF_NET_H */