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 VB |
15 | extern int fixed_phy_add(unsigned int irq, int phy_id, |
16 | struct fixed_phy_status *status); | |
fd2ef0ba PG |
17 | extern struct phy_device *fixed_phy_register(unsigned int irq, |
18 | struct fixed_phy_status *status, | |
19 | struct device_node *np); | |
46cfd6ea | 20 | extern void fixed_phy_del(int phy_addr); |
464c3668 FF |
21 | extern int fixed_phy_set_link_update(struct phy_device *phydev, |
22 | int (*link_update)(struct net_device *, | |
23 | struct fixed_phy_status *)); | |
a3bebdce SS |
24 | extern int fixed_phy_update_state(struct phy_device *phydev, |
25 | const struct fixed_phy_status *status, | |
26 | const struct fixed_phy_status *changed); | |
a79d8e93 VB |
27 | #else |
28 | static inline int fixed_phy_add(unsigned int irq, int phy_id, | |
29 | struct fixed_phy_status *status) | |
30 | { | |
31 | return -ENODEV; | |
32 | } | |
fd2ef0ba PG |
33 | static inline struct phy_device *fixed_phy_register(unsigned int irq, |
34 | struct fixed_phy_status *status, | |
35 | struct device_node *np) | |
a7595121 | 36 | { |
fd2ef0ba | 37 | return ERR_PTR(-ENODEV); |
a7595121 | 38 | } |
46cfd6ea KZ |
39 | static inline int fixed_phy_del(int phy_addr) |
40 | { | |
41 | return -ENODEV; | |
42 | } | |
464c3668 | 43 | static inline int fixed_phy_set_link_update(struct phy_device *phydev, |
a79d8e93 | 44 | int (*link_update)(struct net_device *, |
464c3668 FF |
45 | struct fixed_phy_status *)) |
46 | { | |
47 | return -ENODEV; | |
48 | } | |
a3bebdce SS |
49 | static inline int fixed_phy_update_state(struct phy_device *phydev, |
50 | const struct fixed_phy_status *status, | |
51 | const struct fixed_phy_status *changed) | |
52 | { | |
53 | return -ENODEV; | |
54 | } | |
464c3668 | 55 | #endif /* CONFIG_FIXED_PHY */ |
7c32f470 VB |
56 | |
57 | #endif /* __PHY_FIXED_H */ |