at v5.2-rc2 1.8 kB view raw
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef __PHY_FIXED_H 3#define __PHY_FIXED_H 4 5struct fixed_phy_status { 6 int link; 7 int speed; 8 int duplex; 9 int pause; 10 int asym_pause; 11}; 12 13struct device_node; 14 15#if IS_ENABLED(CONFIG_FIXED_PHY) 16extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier); 17extern int fixed_phy_add(unsigned int irq, int phy_id, 18 struct fixed_phy_status *status); 19extern struct phy_device *fixed_phy_register(unsigned int irq, 20 struct fixed_phy_status *status, 21 struct device_node *np); 22 23extern struct phy_device * 24fixed_phy_register_with_gpiod(unsigned int irq, 25 struct fixed_phy_status *status, 26 struct gpio_desc *gpiod); 27 28extern void fixed_phy_unregister(struct phy_device *phydev); 29extern int fixed_phy_set_link_update(struct phy_device *phydev, 30 int (*link_update)(struct net_device *, 31 struct fixed_phy_status *)); 32#else 33static inline int fixed_phy_add(unsigned int irq, int phy_id, 34 struct fixed_phy_status *status) 35{ 36 return -ENODEV; 37} 38static inline struct phy_device *fixed_phy_register(unsigned int irq, 39 struct fixed_phy_status *status, 40 struct device_node *np) 41{ 42 return ERR_PTR(-ENODEV); 43} 44 45static inline struct phy_device * 46fixed_phy_register_with_gpiod(unsigned int irq, 47 struct fixed_phy_status *status, 48 struct gpio_desc *gpiod) 49{ 50 return ERR_PTR(-ENODEV); 51} 52 53static inline void fixed_phy_unregister(struct phy_device *phydev) 54{ 55} 56static inline int fixed_phy_set_link_update(struct phy_device *phydev, 57 int (*link_update)(struct net_device *, 58 struct fixed_phy_status *)) 59{ 60 return -ENODEV; 61} 62static inline int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier) 63{ 64 return -EINVAL; 65} 66#endif /* CONFIG_FIXED_PHY */ 67 68#endif /* __PHY_FIXED_H */