]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
7c32f470 VB |
2 | #ifndef __PHY_FIXED_H |
3 | #define __PHY_FIXED_H | |
4 | ||
7c32f470 | 5 | struct fixed_phy_status { |
a79d8e93 VB |
6 | int link; |
7 | int speed; | |
8 | int duplex; | |
9 | int pause; | |
10 | int asym_pause; | |
7c32f470 VB |
11 | }; |
12 | ||
a7595121 TP |
13 | struct device_node; |
14 | ||
6539c44d | 15 | #if IS_ENABLED(CONFIG_FIXED_PHY) |
b3e5464e | 16 | extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier); |
a79d8e93 | 17 | extern int fixed_phy_add(unsigned int irq, int phy_id, |
5468e82f | 18 | struct fixed_phy_status *status); |
fd2ef0ba PG |
19 | extern struct phy_device *fixed_phy_register(unsigned int irq, |
20 | struct fixed_phy_status *status, | |
21 | struct device_node *np); | |
71bd106d MF |
22 | |
23 | extern struct phy_device * | |
24 | fixed_phy_register_with_gpiod(unsigned int irq, | |
25 | struct fixed_phy_status *status, | |
26 | struct gpio_desc *gpiod); | |
27 | ||
5bcbe0f3 | 28 | extern void fixed_phy_unregister(struct phy_device *phydev); |
464c3668 FF |
29 | extern int fixed_phy_set_link_update(struct phy_device *phydev, |
30 | int (*link_update)(struct net_device *, | |
31 | struct fixed_phy_status *)); | |
a79d8e93 VB |
32 | #else |
33 | static inline int fixed_phy_add(unsigned int irq, int phy_id, | |
5468e82f | 34 | struct fixed_phy_status *status) |
a79d8e93 VB |
35 | { |
36 | return -ENODEV; | |
37 | } | |
fd2ef0ba PG |
38 | static inline struct phy_device *fixed_phy_register(unsigned int irq, |
39 | struct fixed_phy_status *status, | |
40 | struct device_node *np) | |
a7595121 | 41 | { |
fd2ef0ba | 42 | return ERR_PTR(-ENODEV); |
a7595121 | 43 | } |
71bd106d MF |
44 | |
45 | static inline struct phy_device * | |
46 | fixed_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 | ||
5bcbe0f3 | 53 | static inline void fixed_phy_unregister(struct phy_device *phydev) |
46cfd6ea | 54 | { |
46cfd6ea | 55 | } |
464c3668 | 56 | static inline int fixed_phy_set_link_update(struct phy_device *phydev, |
a79d8e93 | 57 | int (*link_update)(struct net_device *, |
464c3668 FF |
58 | struct fixed_phy_status *)) |
59 | { | |
60 | return -ENODEV; | |
61 | } | |
b3e5464e JT |
62 | static inline int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier) |
63 | { | |
64 | return -EINVAL; | |
65 | } | |
464c3668 | 66 | #endif /* CONFIG_FIXED_PHY */ |
7c32f470 VB |
67 | |
68 | #endif /* __PHY_FIXED_H */ |