David Daney | 4b6ba8a | 2010-10-26 15:07:13 -0700 | [diff] [blame] | 1 | /* |
| 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 Fainelli | aa836df | 2015-03-09 14:31:20 -0700 | [diff] [blame] | 12 | |
| 13 | struct net_device; |
Geert Uytterhoeven | 7e0bdf1 | 2013-08-18 13:01:30 +0200 | [diff] [blame] | 14 | extern int of_get_phy_mode(struct device_node *np); |
David Daney | 4b6ba8a | 2010-10-26 15:07:13 -0700 | [diff] [blame] | 15 | extern const void *of_get_mac_address(struct device_node *np); |
Mike Looijmans | 9217e56 | 2018-03-29 07:29:48 +0200 | [diff] [blame] | 16 | extern int of_get_nvmem_mac_address(struct device_node *np, void *addr); |
Florian Fainelli | aa836df | 2015-03-09 14:31:20 -0700 | [diff] [blame] | 17 | extern struct net_device *of_find_net_device_by_node(struct device_node *np); |
Guenter Roeck | 65b3841b | 2013-04-02 09:35:07 +0000 | [diff] [blame] | 18 | #else |
Geert Uytterhoeven | 7e0bdf1 | 2013-08-18 13:01:30 +0200 | [diff] [blame] | 19 | static inline int of_get_phy_mode(struct device_node *np) |
Guenter Roeck | 65b3841b | 2013-04-02 09:35:07 +0000 | [diff] [blame] | 20 | { |
| 21 | return -ENODEV; |
| 22 | } |
| 23 | |
| 24 | static inline const void *of_get_mac_address(struct device_node *np) |
| 25 | { |
| 26 | return NULL; |
| 27 | } |
Florian Fainelli | aa836df | 2015-03-09 14:31:20 -0700 | [diff] [blame] | 28 | |
Mike Looijmans | 9217e56 | 2018-03-29 07:29:48 +0200 | [diff] [blame] | 29 | static inline int of_get_nvmem_mac_address(struct device_node *np, void *addr) |
| 30 | { |
| 31 | return -ENODEV; |
| 32 | } |
| 33 | |
Florian Fainelli | aa836df | 2015-03-09 14:31:20 -0700 | [diff] [blame] | 34 | static inline struct net_device *of_find_net_device_by_node(struct device_node *np) |
| 35 | { |
| 36 | return NULL; |
| 37 | } |
David Daney | 4b6ba8a | 2010-10-26 15:07:13 -0700 | [diff] [blame] | 38 | #endif |
| 39 | |
| 40 | #endif /* __LINUX_OF_NET_H */ |