of_mdio.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * OF helpers for the MDIO (Ethernet PHY) API
  3. *
  4. * Copyright (c) 2009 Secret Lab Technologies, Ltd.
  5. *
  6. * This file is released under the GPLv2
  7. */
  8. #ifndef __LINUX_OF_MDIO_H
  9. #define __LINUX_OF_MDIO_H
  10. #include <linux/phy.h>
  11. #include <linux/of.h>
  12. #ifdef CONFIG_OF
  13. extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np);
  14. extern struct phy_device *of_phy_find_device(struct device_node *phy_np);
  15. extern struct phy_device *of_phy_connect(struct net_device *dev,
  16. struct device_node *phy_np,
  17. void (*hndlr)(struct net_device *),
  18. u32 flags, phy_interface_t iface);
  19. extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
  20. void (*hndlr)(struct net_device *),
  21. phy_interface_t iface);
  22. extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
  23. #else /* CONFIG_OF */
  24. int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
  25. {
  26. return -ENOSYS;
  27. }
  28. struct phy_device *of_phy_find_device(struct device_node *phy_np)
  29. {
  30. return NULL;
  31. }
  32. struct phy_device *of_phy_connect(struct net_device *dev,
  33. struct device_node *phy_np,
  34. void (*hndlr)(struct net_device *),
  35. u32 flags, phy_interface_t iface)
  36. {
  37. return NULL;
  38. }
  39. struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
  40. void (*hndlr)(struct net_device *),
  41. phy_interface_t iface)
  42. {
  43. return NULL;
  44. }
  45. struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
  46. {
  47. return NULL;
  48. }
  49. #endif /* CONFIG_OF */
  50. #endif /* __LINUX_OF_MDIO_H */