0001
0002
0003
0004
0005
0006 #ifndef __LINUX_OF_NET_H
0007 #define __LINUX_OF_NET_H
0008
0009 #include <linux/phy.h>
0010
0011 #if defined(CONFIG_OF) && defined(CONFIG_NET)
0012 #include <linux/of.h>
0013
0014 struct net_device;
0015 extern int of_get_phy_mode(struct device_node *np, phy_interface_t *interface);
0016 extern int of_get_mac_address(struct device_node *np, u8 *mac);
0017 int of_get_ethdev_address(struct device_node *np, struct net_device *dev);
0018 extern struct net_device *of_find_net_device_by_node(struct device_node *np);
0019 #else
0020 static inline int of_get_phy_mode(struct device_node *np,
0021 phy_interface_t *interface)
0022 {
0023 return -ENODEV;
0024 }
0025
0026 static inline int of_get_mac_address(struct device_node *np, u8 *mac)
0027 {
0028 return -ENODEV;
0029 }
0030
0031 static inline int of_get_ethdev_address(struct device_node *np, struct net_device *dev)
0032 {
0033 return -ENODEV;
0034 }
0035
0036 static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
0037 {
0038 return NULL;
0039 }
0040 #endif
0041
0042 #endif