Commit | Line | Data |
---|---|---|
7c32f470 VB |
1 | #ifndef __PHY_FIXED_H |
2 | #define __PHY_FIXED_H | |
3 | ||
7c32f470 | 4 | struct fixed_phy_status { |
a79d8e93 VB |
5 | int link; |
6 | int speed; | |
7 | int duplex; | |
8 | int pause; | |
9 | int asym_pause; | |
7c32f470 VB |
10 | }; |
11 | ||
a7595121 TP |
12 | struct device_node; |
13 | ||
6539c44d | 14 | #if IS_ENABLED(CONFIG_FIXED_PHY) |
a79d8e93 | 15 | extern int fixed_phy_add(unsigned int irq, int phy_id, |
a5597008 AL |
16 | struct fixed_phy_status *status, |
17 | int link_gpio); | |
fd2ef0ba PG |
18 | extern struct phy_device *fixed_phy_register(unsigned int irq, |
19 | struct fixed_phy_status *status, | |
a5597008 | 20 | int link_gpio, |
fd2ef0ba | 21 | struct device_node *np); |
46cfd6ea | 22 | extern void fixed_phy_del(int phy_addr); |
464c3668 FF |
23 | extern int fixed_phy_set_link_update(struct phy_device *phydev, |
24 | int (*link_update)(struct net_device *, | |
25 | struct fixed_phy_status *)); | |
a3bebdce SS |
26 | extern int fixed_phy_update_state(struct phy_device *phydev, |
27 | const struct fixed_phy_status *status, | |
28 | const struct fixed_phy_status *changed); | |
a79d8e93 VB |
29 | #else |
30 | static inline int fixed_phy_add(unsigned int irq, int phy_id, | |
a5597008 AL |
31 | struct fixed_phy_status *status, |
32 | int link_gpio) | |
a79d8e93 VB |
33 | { |
34 | return -ENODEV; | |
35 | } | |
fd2ef0ba PG |
36 | static inline struct phy_device *fixed_phy_register(unsigned int irq, |
37 | struct fixed_phy_status *status, | |
a5597008 | 38 | int gpio_link, |
fd2ef0ba | 39 | struct device_node *np) |
a7595121 | 40 | { |
fd2ef0ba | 41 | return ERR_PTR(-ENODEV); |
a7595121 | 42 | } |
46cfd6ea KZ |
43 | static inline int fixed_phy_del(int phy_addr) |
44 | { | |
45 | return -ENODEV; | |
46 | } | |
464c3668 | 47 | static inline int fixed_phy_set_link_update(struct phy_device *phydev, |
a79d8e93 | 48 | int (*link_update)(struct net_device *, |
464c3668 FF |
49 | struct fixed_phy_status *)) |
50 | { | |
51 | return -ENODEV; | |
52 | } | |
a3bebdce SS |
53 | static 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 | } | |
464c3668 | 59 | #endif /* CONFIG_FIXED_PHY */ |
7c32f470 VB |
60 | |
61 | #endif /* __PHY_FIXED_H */ |