of_net.h 882 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 int of_get_nvmem_mac_address(struct device_node *np, void *addr);
  14. extern struct net_device *of_find_net_device_by_node(struct device_node *np);
  15. #else
  16. static inline int of_get_phy_mode(struct device_node *np)
  17. {
  18. return -ENODEV;
  19. }
  20. static inline const void *of_get_mac_address(struct device_node *np)
  21. {
  22. return NULL;
  23. }
  24. static inline int of_get_nvmem_mac_address(struct device_node *np, void *addr)
  25. {
  26. return -ENODEV;
  27. }
  28. static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
  29. {
  30. return NULL;
  31. }
  32. #endif
  33. #endif /* __LINUX_OF_NET_H */