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