Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __PHY_FIXED_H
3#define __PHY_FIXED_H
4
5struct fixed_phy_status {
6 int link;
7 int speed;
8 int duplex;
9 int pause;
10 int asym_pause;
11};
12
13struct device_node;
14
15#if IS_ENABLED(CONFIG_FIXED_PHY)
16extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier);
17extern int fixed_phy_add(unsigned int irq, int phy_id,
18 struct fixed_phy_status *status,
19 int link_gpio);
20extern struct phy_device *fixed_phy_register(unsigned int irq,
21 struct fixed_phy_status *status,
22 int link_gpio,
23 struct device_node *np);
24extern void fixed_phy_unregister(struct phy_device *phydev);
25extern int fixed_phy_set_link_update(struct phy_device *phydev,
26 int (*link_update)(struct net_device *,
27 struct fixed_phy_status *));
28#else
29static inline int fixed_phy_add(unsigned int irq, int phy_id,
30 struct fixed_phy_status *status,
31 int link_gpio)
32{
33 return -ENODEV;
34}
35static inline struct phy_device *fixed_phy_register(unsigned int irq,
36 struct fixed_phy_status *status,
37 int gpio_link,
38 struct device_node *np)
39{
40 return ERR_PTR(-ENODEV);
41}
42static inline void fixed_phy_unregister(struct phy_device *phydev)
43{
44}
45static inline int fixed_phy_set_link_update(struct phy_device *phydev,
46 int (*link_update)(struct net_device *,
47 struct fixed_phy_status *))
48{
49 return -ENODEV;
50}
51static inline int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier)
52{
53 return -EINVAL;
54}
55#endif /* CONFIG_FIXED_PHY */
56
57#endif /* __PHY_FIXED_H */