17c32f470SVitaly Bordug #ifndef __PHY_FIXED_H 27c32f470SVitaly Bordug #define __PHY_FIXED_H 37c32f470SVitaly Bordug 47c32f470SVitaly Bordug struct fixed_phy_status { 5a79d8e93SVitaly Bordug int link; 6a79d8e93SVitaly Bordug int speed; 7a79d8e93SVitaly Bordug int duplex; 8a79d8e93SVitaly Bordug int pause; 9a79d8e93SVitaly Bordug int asym_pause; 107c32f470SVitaly Bordug }; 117c32f470SVitaly Bordug 12a7595121SThomas Petazzoni struct device_node; 13a7595121SThomas Petazzoni 146539c44dSDavid S. Miller #if IS_ENABLED(CONFIG_FIXED_PHY) 15a79d8e93SVitaly Bordug extern int fixed_phy_add(unsigned int irq, int phy_id, 16a79d8e93SVitaly Bordug struct fixed_phy_status *status); 17fd2ef0baSPetri Gynther extern struct phy_device *fixed_phy_register(unsigned int irq, 18a7595121SThomas Petazzoni struct fixed_phy_status *status, 19a7595121SThomas Petazzoni struct device_node *np); 2046cfd6eaSKonrad Zapalowicz extern void fixed_phy_del(int phy_addr); 21464c3668SFlorian Fainelli extern int fixed_phy_set_link_update(struct phy_device *phydev, 22464c3668SFlorian Fainelli int (*link_update)(struct net_device *, 23464c3668SFlorian Fainelli struct fixed_phy_status *)); 24*a3bebdceSStas Sergeev extern int fixed_phy_update_state(struct phy_device *phydev, 25*a3bebdceSStas Sergeev const struct fixed_phy_status *status, 26*a3bebdceSStas Sergeev const struct fixed_phy_status *changed); 27a79d8e93SVitaly Bordug #else 28a79d8e93SVitaly Bordug static inline int fixed_phy_add(unsigned int irq, int phy_id, 29a79d8e93SVitaly Bordug struct fixed_phy_status *status) 30a79d8e93SVitaly Bordug { 31a79d8e93SVitaly Bordug return -ENODEV; 32a79d8e93SVitaly Bordug } 33fd2ef0baSPetri Gynther static inline struct phy_device *fixed_phy_register(unsigned int irq, 34a7595121SThomas Petazzoni struct fixed_phy_status *status, 35a7595121SThomas Petazzoni struct device_node *np) 36a7595121SThomas Petazzoni { 37fd2ef0baSPetri Gynther return ERR_PTR(-ENODEV); 38a7595121SThomas Petazzoni } 3946cfd6eaSKonrad Zapalowicz static inline int fixed_phy_del(int phy_addr) 4046cfd6eaSKonrad Zapalowicz { 4146cfd6eaSKonrad Zapalowicz return -ENODEV; 4246cfd6eaSKonrad Zapalowicz } 43464c3668SFlorian Fainelli static inline int fixed_phy_set_link_update(struct phy_device *phydev, 44a79d8e93SVitaly Bordug int (*link_update)(struct net_device *, 45464c3668SFlorian Fainelli struct fixed_phy_status *)) 46464c3668SFlorian Fainelli { 47464c3668SFlorian Fainelli return -ENODEV; 48464c3668SFlorian Fainelli } 49*a3bebdceSStas Sergeev static inline int fixed_phy_update_state(struct phy_device *phydev, 50*a3bebdceSStas Sergeev const struct fixed_phy_status *status, 51*a3bebdceSStas Sergeev const struct fixed_phy_status *changed) 52*a3bebdceSStas Sergeev { 53*a3bebdceSStas Sergeev return -ENODEV; 54*a3bebdceSStas Sergeev } 55464c3668SFlorian Fainelli #endif /* CONFIG_FIXED_PHY */ 567c32f470SVitaly Bordug 577c32f470SVitaly Bordug #endif /* __PHY_FIXED_H */ 58