phy_fixed.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. extern struct phy_device *fixed_phy_register(unsigned int irq,
  15. struct fixed_phy_status *status,
  16. struct device_node *np);
  17. extern void fixed_phy_del(int phy_addr);
  18. extern int fixed_phy_set_link_update(struct phy_device *phydev,
  19. int (*link_update)(struct net_device *,
  20. struct fixed_phy_status *));
  21. extern int fixed_phy_update_state(struct phy_device *phydev,
  22. const struct fixed_phy_status *status,
  23. const struct fixed_phy_status *changed);
  24. #else
  25. static inline int fixed_phy_add(unsigned int irq, int phy_id,
  26. struct fixed_phy_status *status)
  27. {
  28. return -ENODEV;
  29. }
  30. static inline struct phy_device *fixed_phy_register(unsigned int irq,
  31. struct fixed_phy_status *status,
  32. struct device_node *np)
  33. {
  34. return ERR_PTR(-ENODEV);
  35. }
  36. static inline int fixed_phy_del(int phy_addr)
  37. {
  38. return -ENODEV;
  39. }
  40. static inline int fixed_phy_set_link_update(struct phy_device *phydev,
  41. int (*link_update)(struct net_device *,
  42. struct fixed_phy_status *))
  43. {
  44. return -ENODEV;
  45. }
  46. static inline int fixed_phy_update_state(struct phy_device *phydev,
  47. const struct fixed_phy_status *status,
  48. const struct fixed_phy_status *changed)
  49. {
  50. return -ENODEV;
  51. }
  52. #endif /* CONFIG_FIXED_PHY */
  53. #endif /* __PHY_FIXED_H */