phy_fixed.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #else
  22. static inline int fixed_phy_add(unsigned int irq, int phy_id,
  23. struct fixed_phy_status *status)
  24. {
  25. return -ENODEV;
  26. }
  27. static inline struct phy_device *fixed_phy_register(unsigned int irq,
  28. struct fixed_phy_status *status,
  29. struct device_node *np)
  30. {
  31. return ERR_PTR(-ENODEV);
  32. }
  33. static inline int fixed_phy_del(int phy_addr)
  34. {
  35. return -ENODEV;
  36. }
  37. static inline int fixed_phy_set_link_update(struct phy_device *phydev,
  38. int (*link_update)(struct net_device *,
  39. struct fixed_phy_status *))
  40. {
  41. return -ENODEV;
  42. }
  43. #endif /* CONFIG_FIXED_PHY */
  44. #endif /* __PHY_FIXED_H */