phy_fixed.h 1.6 KB
Newer Older
1 2 3 4
#ifndef __PHY_FIXED_H
#define __PHY_FIXED_H

struct fixed_phy_status {
5 6 7 8 9
	int link;
	int speed;
	int duplex;
	int pause;
	int asym_pause;
10 11
};

12 13
struct device_node;

14
#if IS_ENABLED(CONFIG_FIXED_PHY)
15
extern int fixed_phy_add(unsigned int irq, int phy_id,
16 17
			 struct fixed_phy_status *status,
			 int link_gpio);
18 19
extern struct phy_device *fixed_phy_register(unsigned int irq,
					     struct fixed_phy_status *status,
20
					     int link_gpio,
21
					     struct device_node *np);
A
Andrew Lunn 已提交
22
extern void fixed_phy_unregister(struct phy_device *phydev);
23 24 25
extern int fixed_phy_set_link_update(struct phy_device *phydev,
			int (*link_update)(struct net_device *,
					   struct fixed_phy_status *));
26 27 28
extern int fixed_phy_update_state(struct phy_device *phydev,
			   const struct fixed_phy_status *status,
			   const struct fixed_phy_status *changed);
29 30
#else
static inline int fixed_phy_add(unsigned int irq, int phy_id,
31 32
				struct fixed_phy_status *status,
				int link_gpio)
33 34 35
{
	return -ENODEV;
}
36 37
static inline struct phy_device *fixed_phy_register(unsigned int irq,
						struct fixed_phy_status *status,
38
						int gpio_link,
39
						struct device_node *np)
40
{
41
	return ERR_PTR(-ENODEV);
42
}
A
Andrew Lunn 已提交
43
static inline void fixed_phy_unregister(struct phy_device *phydev)
44 45
{
}
46
static inline int fixed_phy_set_link_update(struct phy_device *phydev,
47
			int (*link_update)(struct net_device *,
48 49 50 51
					   struct fixed_phy_status *))
{
	return -ENODEV;
}
52 53 54 55 56 57
static inline int fixed_phy_update_state(struct phy_device *phydev,
			   const struct fixed_phy_status *status,
			   const struct fixed_phy_status *changed)
{
	return -ENODEV;
}
58
#endif /* CONFIG_FIXED_PHY */
59 60

#endif /* __PHY_FIXED_H */