phy_fixed.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef __PHY_FIXED_H
  2. #define __PHY_FIXED_H
  3. struct fixed_phy_status {
  4. int link;
  5. int speed;
  6. int duplex;
  7. int pause;
  8. int asym_pause;
  9. };
  10. struct device_node;
  11. #if IS_ENABLED(CONFIG_FIXED_PHY)
  12. extern int fixed_phy_add(unsigned int irq, int phy_id,
  13. struct fixed_phy_status *status,
  14. int link_gpio);
  15. extern struct phy_device *fixed_phy_register(unsigned int irq,
  16. struct fixed_phy_status *status,
  17. int link_gpio,
  18. struct device_node *np);
  19. extern void fixed_phy_unregister(struct phy_device *phydev);
  20. extern int fixed_phy_set_link_update(struct phy_device *phydev,
  21. int (*link_update)(struct net_device *,
  22. struct fixed_phy_status *));
  23. extern int fixed_phy_update_state(struct phy_device *phydev,
  24. const struct fixed_phy_status *status,
  25. const struct fixed_phy_status *changed);
  26. #else
  27. static inline int fixed_phy_add(unsigned int irq, int phy_id,
  28. struct fixed_phy_status *status,
  29. int link_gpio)
  30. {
  31. return -ENODEV;
  32. }
  33. static inline struct phy_device *fixed_phy_register(unsigned int irq,
  34. struct fixed_phy_status *status,
  35. int gpio_link,
  36. struct device_node *np)
  37. {
  38. return ERR_PTR(-ENODEV);
  39. }
  40. static inline void fixed_phy_unregister(struct phy_device *phydev)
  41. {
  42. }
  43. static inline int fixed_phy_set_link_update(struct phy_device *phydev,
  44. int (*link_update)(struct net_device *,
  45. struct fixed_phy_status *))
  46. {
  47. return -ENODEV;
  48. }
  49. static inline int fixed_phy_update_state(struct phy_device *phydev,
  50. const struct fixed_phy_status *status,
  51. const struct fixed_phy_status *changed)
  52. {
  53. return -ENODEV;
  54. }
  55. #endif /* CONFIG_FIXED_PHY */
  56. #endif /* __PHY_FIXED_H */