blob: 90d81ee9e6a04112168a12723e43b95c59b190f1 [file] [log] [blame]
David Daney4b6ba8a2010-10-26 15:07:13 -07001/*
2 * OF helpers for network devices.
3 *
4 * This file is released under the GPLv2
5 */
6
7#ifndef __LINUX_OF_NET_H
8#define __LINUX_OF_NET_H
9
10#ifdef CONFIG_OF_NET
11#include <linux/of.h>
Florian Fainelliaa836df2015-03-09 14:31:20 -070012
13struct net_device;
Geert Uytterhoeven7e0bdf12013-08-18 13:01:30 +020014extern int of_get_phy_mode(struct device_node *np);
David Daney4b6ba8a2010-10-26 15:07:13 -070015extern const void *of_get_mac_address(struct device_node *np);
Mike Looijmans9217e562018-03-29 07:29:48 +020016extern int of_get_nvmem_mac_address(struct device_node *np, void *addr);
Florian Fainelliaa836df2015-03-09 14:31:20 -070017extern struct net_device *of_find_net_device_by_node(struct device_node *np);
Guenter Roeck65b3841b2013-04-02 09:35:07 +000018#else
Geert Uytterhoeven7e0bdf12013-08-18 13:01:30 +020019static inline int of_get_phy_mode(struct device_node *np)
Guenter Roeck65b3841b2013-04-02 09:35:07 +000020{
21 return -ENODEV;
22}
23
24static inline const void *of_get_mac_address(struct device_node *np)
25{
26 return NULL;
27}
Florian Fainelliaa836df2015-03-09 14:31:20 -070028
Mike Looijmans9217e562018-03-29 07:29:48 +020029static inline int of_get_nvmem_mac_address(struct device_node *np, void *addr)
30{
31 return -ENODEV;
32}
33
Florian Fainelliaa836df2015-03-09 14:31:20 -070034static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
35{
36 return NULL;
37}
David Daney4b6ba8a2010-10-26 15:07:13 -070038#endif
39
40#endif /* __LINUX_OF_NET_H */