blob: f2ca1b459377803094005029cc765ef1f3a9abd6 [file] [log] [blame]
Vitaly Bordug7c32f472007-08-10 14:05:16 -07001#ifndef __PHY_FIXED_H
2#define __PHY_FIXED_H
3
Vitaly Bordug7c32f472007-08-10 14:05:16 -07004struct fixed_phy_status {
Vitaly Borduga79d8e92007-12-07 01:51:22 +03005 int link;
6 int speed;
7 int duplex;
8 int pause;
9 int asym_pause;
Vitaly Bordug7c32f472007-08-10 14:05:16 -070010};
11
Thomas Petazzonia7595122014-05-16 16:14:04 +020012struct device_node;
13
Vitaly Borduga79d8e92007-12-07 01:51:22 +030014#ifdef CONFIG_FIXED_PHY
15extern int fixed_phy_add(unsigned int irq, int phy_id,
16 struct fixed_phy_status *status);
Petri Gyntherfd2ef0b2014-10-06 11:38:30 -070017extern struct phy_device *fixed_phy_register(unsigned int irq,
18 struct fixed_phy_status *status,
19 struct device_node *np);
Konrad Zapalowicz46cfd6e2014-06-05 20:27:42 +020020extern void fixed_phy_del(int phy_addr);
Florian Fainelli464c3662014-08-27 17:04:48 -070021extern int fixed_phy_set_link_update(struct phy_device *phydev,
22 int (*link_update)(struct net_device *,
23 struct fixed_phy_status *));
Vitaly Borduga79d8e92007-12-07 01:51:22 +030024#else
25static inline int fixed_phy_add(unsigned int irq, int phy_id,
26 struct fixed_phy_status *status)
27{
28 return -ENODEV;
29}
Petri Gyntherfd2ef0b2014-10-06 11:38:30 -070030static inline struct phy_device *fixed_phy_register(unsigned int irq,
31 struct fixed_phy_status *status,
32 struct device_node *np)
Thomas Petazzonia7595122014-05-16 16:14:04 +020033{
Petri Gyntherfd2ef0b2014-10-06 11:38:30 -070034 return ERR_PTR(-ENODEV);
Thomas Petazzonia7595122014-05-16 16:14:04 +020035}
Konrad Zapalowicz46cfd6e2014-06-05 20:27:42 +020036static inline int fixed_phy_del(int phy_addr)
37{
38 return -ENODEV;
39}
Florian Fainelli464c3662014-08-27 17:04:48 -070040static inline int fixed_phy_set_link_update(struct phy_device *phydev,
Vitaly Borduga79d8e92007-12-07 01:51:22 +030041 int (*link_update)(struct net_device *,
Florian Fainelli464c3662014-08-27 17:04:48 -070042 struct fixed_phy_status *))
43{
44 return -ENODEV;
45}
46#endif /* CONFIG_FIXED_PHY */
Vitaly Bordug7c32f472007-08-10 14:05:16 -070047
48#endif /* __PHY_FIXED_H */