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