Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
7c32f470 VB |
2 | #ifndef __PHY_FIXED_H |
3 | #define __PHY_FIXED_H | |
4 | ||
5f10376b JK |
5 | #include <linux/types.h> |
6 | ||
7c32f470 | 7 | struct fixed_phy_status { |
a79d8e93 VB |
8 | int link; |
9 | int speed; | |
10 | int duplex; | |
11 | int pause; | |
12 | int asym_pause; | |
7c32f470 VB |
13 | }; |
14 | ||
a7595121 | 15 | struct device_node; |
5f10376b | 16 | struct net_device; |
a7595121 | 17 | |
6539c44d | 18 | #if IS_ENABLED(CONFIG_FIXED_PHY) |
b3e5464e | 19 | extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier); |
4ba1c5bb HK |
20 | int fixed_phy_add(int phy_id, const struct fixed_phy_status *status); |
21 | struct phy_device *fixed_phy_register(const struct fixed_phy_status *status, | |
d23b4af5 | 22 | struct device_node *np); |
71bd106d | 23 | |
5bcbe0f3 | 24 | extern void fixed_phy_unregister(struct phy_device *phydev); |
464c3668 FF |
25 | extern int fixed_phy_set_link_update(struct phy_device *phydev, |
26 | int (*link_update)(struct net_device *, | |
27 | struct fixed_phy_status *)); | |
a79d8e93 | 28 | #else |
3f1716ee | 29 | static inline int fixed_phy_add(int phy_id, |
4ba1c5bb | 30 | const struct fixed_phy_status *status) |
a79d8e93 VB |
31 | { |
32 | return -ENODEV; | |
33 | } | |
d23b4af5 | 34 | static inline struct phy_device * |
4ba1c5bb | 35 | fixed_phy_register(const struct fixed_phy_status *status, |
d23b4af5 | 36 | struct device_node *np) |
a7595121 | 37 | { |
fd2ef0ba | 38 | return ERR_PTR(-ENODEV); |
a7595121 | 39 | } |
71bd106d | 40 | |
5bcbe0f3 | 41 | static inline void fixed_phy_unregister(struct phy_device *phydev) |
46cfd6ea | 42 | { |
46cfd6ea | 43 | } |
464c3668 | 44 | static inline int fixed_phy_set_link_update(struct phy_device *phydev, |
a79d8e93 | 45 | int (*link_update)(struct net_device *, |
464c3668 FF |
46 | struct fixed_phy_status *)) |
47 | { | |
48 | return -ENODEV; | |
49 | } | |
b3e5464e JT |
50 | static inline int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier) |
51 | { | |
52 | return -EINVAL; | |
53 | } | |
464c3668 | 54 | #endif /* CONFIG_FIXED_PHY */ |
7c32f470 VB |
55 | |
56 | #endif /* __PHY_FIXED_H */ |