of_net.h 708 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * OF helpers for network devices.
  3. *
  4. * This file is released under the GPLv2
  5. */
  6. #ifndef __LINUX_OF_NET_H
  7. #define __LINUX_OF_NET_H
  8. #ifdef CONFIG_OF_NET
  9. #include <linux/of.h>
  10. struct net_device;
  11. extern int of_get_phy_mode(struct device_node *np);
  12. extern const void *of_get_mac_address(struct device_node *np);
  13. extern struct net_device *of_find_net_device_by_node(struct device_node *np);
  14. #else
  15. static inline int of_get_phy_mode(struct device_node *np)
  16. {
  17. return -ENODEV;
  18. }
  19. static inline const void *of_get_mac_address(struct device_node *np)
  20. {
  21. return NULL;
  22. }
  23. static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
  24. {
  25. return NULL;
  26. }
  27. #endif
  28. #endif /* __LINUX_OF_NET_H */