Vitaly Bordug | 7c32f47 | 2007-08-10 14:05:16 -0700 | [diff] [blame] | 1 | #ifndef __PHY_FIXED_H |
| 2 | #define __PHY_FIXED_H |
| 3 | |
Vitaly Bordug | 7c32f47 | 2007-08-10 14:05:16 -0700 | [diff] [blame] | 4 | struct fixed_phy_status { |
Vitaly Bordug | a79d8e9 | 2007-12-07 01:51:22 +0300 | [diff] [blame] | 5 | int link; |
| 6 | int speed; |
| 7 | int duplex; |
| 8 | int pause; |
| 9 | int asym_pause; |
Vitaly Bordug | 7c32f47 | 2007-08-10 14:05:16 -0700 | [diff] [blame] | 10 | }; |
| 11 | |
Thomas Petazzoni | a759512 | 2014-05-16 16:14:04 +0200 | [diff] [blame] | 12 | struct device_node; |
| 13 | |
Vitaly Bordug | a79d8e9 | 2007-12-07 01:51:22 +0300 | [diff] [blame] | 14 | #ifdef CONFIG_FIXED_PHY |
| 15 | extern int fixed_phy_add(unsigned int irq, int phy_id, |
| 16 | struct fixed_phy_status *status); |
Petri Gynther | fd2ef0b | 2014-10-06 11:38:30 -0700 | [diff] [blame] | 17 | extern struct phy_device *fixed_phy_register(unsigned int irq, |
| 18 | struct fixed_phy_status *status, |
| 19 | struct device_node *np); |
Konrad Zapalowicz | 46cfd6e | 2014-06-05 20:27:42 +0200 | [diff] [blame] | 20 | extern void fixed_phy_del(int phy_addr); |
Florian Fainelli | 464c366 | 2014-08-27 17:04:48 -0700 | [diff] [blame] | 21 | extern int fixed_phy_set_link_update(struct phy_device *phydev, |
| 22 | int (*link_update)(struct net_device *, |
| 23 | struct fixed_phy_status *)); |
Vitaly Bordug | a79d8e9 | 2007-12-07 01:51:22 +0300 | [diff] [blame] | 24 | #else |
| 25 | static inline int fixed_phy_add(unsigned int irq, int phy_id, |
| 26 | struct fixed_phy_status *status) |
| 27 | { |
| 28 | return -ENODEV; |
| 29 | } |
Petri Gynther | fd2ef0b | 2014-10-06 11:38:30 -0700 | [diff] [blame] | 30 | static inline struct phy_device *fixed_phy_register(unsigned int irq, |
| 31 | struct fixed_phy_status *status, |
| 32 | struct device_node *np) |
Thomas Petazzoni | a759512 | 2014-05-16 16:14:04 +0200 | [diff] [blame] | 33 | { |
Petri Gynther | fd2ef0b | 2014-10-06 11:38:30 -0700 | [diff] [blame] | 34 | return ERR_PTR(-ENODEV); |
Thomas Petazzoni | a759512 | 2014-05-16 16:14:04 +0200 | [diff] [blame] | 35 | } |
Konrad Zapalowicz | 46cfd6e | 2014-06-05 20:27:42 +0200 | [diff] [blame] | 36 | static inline int fixed_phy_del(int phy_addr) |
| 37 | { |
| 38 | return -ENODEV; |
| 39 | } |
Florian Fainelli | 464c366 | 2014-08-27 17:04:48 -0700 | [diff] [blame] | 40 | static inline int fixed_phy_set_link_update(struct phy_device *phydev, |
Vitaly Bordug | a79d8e9 | 2007-12-07 01:51:22 +0300 | [diff] [blame] | 41 | int (*link_update)(struct net_device *, |
Florian Fainelli | 464c366 | 2014-08-27 17:04:48 -0700 | [diff] [blame] | 42 | struct fixed_phy_status *)) |
| 43 | { |
| 44 | return -ENODEV; |
| 45 | } |
| 46 | #endif /* CONFIG_FIXED_PHY */ |
Vitaly Bordug | 7c32f47 | 2007-08-10 14:05:16 -0700 | [diff] [blame] | 47 | |
| 48 | #endif /* __PHY_FIXED_H */ |