blob: ae612acebb53d2f0bf121226afde877cb4d32f91 [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);
Thomas Petazzonia7595122014-05-16 16:14:04 +020017extern int 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);
Vitaly Borduga79d8e92007-12-07 01:51:22 +030021#else
22static inline int fixed_phy_add(unsigned int irq, int phy_id,
23 struct fixed_phy_status *status)
24{
25 return -ENODEV;
26}
Thomas Petazzonia7595122014-05-16 16:14:04 +020027static inline int fixed_phy_register(unsigned int irq,
28 struct fixed_phy_status *status,
29 struct device_node *np)
30{
31 return -ENODEV;
32}
Konrad Zapalowicz46cfd6e2014-06-05 20:27:42 +020033static inline int fixed_phy_del(int phy_addr)
34{
35 return -ENODEV;
36}
Vitaly Borduga79d8e92007-12-07 01:51:22 +030037#endif /* CONFIG_FIXED_PHY */
Vitaly Bordug7c32f472007-08-10 14:05:16 -070038
Vitaly Borduga79d8e92007-12-07 01:51:22 +030039/*
40 * This function issued only by fixed_phy-aware drivers, no need
41 * protect it with #ifdef
42 */
43extern int fixed_phy_set_link_update(struct phy_device *phydev,
44 int (*link_update)(struct net_device *,
45 struct fixed_phy_status *));
Vitaly Bordug7c32f472007-08-10 14:05:16 -070046
47#endif /* __PHY_FIXED_H */