• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef __PHY_FIXED_H
2 #define __PHY_FIXED_H
3 
4 struct fixed_phy_status {
5 	int link;
6 	int speed;
7 	int duplex;
8 	int pause;
9 	int asym_pause;
10 };
11 
12 struct device_node;
13 
14 #if IS_ENABLED(CONFIG_FIXED_PHY)
15 extern int fixed_phy_add(unsigned int irq, int phy_id,
16 			 struct fixed_phy_status *status,
17 			 int link_gpio);
18 extern struct phy_device *fixed_phy_register(unsigned int irq,
19 					     struct fixed_phy_status *status,
20 					     int link_gpio,
21 					     struct device_node *np);
22 extern void fixed_phy_del(int phy_addr);
23 extern int fixed_phy_set_link_update(struct phy_device *phydev,
24 			int (*link_update)(struct net_device *,
25 					   struct fixed_phy_status *));
26 extern int fixed_phy_update_state(struct phy_device *phydev,
27 			   const struct fixed_phy_status *status,
28 			   const struct fixed_phy_status *changed);
29 #else
fixed_phy_add(unsigned int irq,int phy_id,struct fixed_phy_status * status,int link_gpio)30 static inline int fixed_phy_add(unsigned int irq, int phy_id,
31 				struct fixed_phy_status *status,
32 				int link_gpio)
33 {
34 	return -ENODEV;
35 }
fixed_phy_register(unsigned int irq,struct fixed_phy_status * status,int gpio_link,struct device_node * np)36 static inline struct phy_device *fixed_phy_register(unsigned int irq,
37 						struct fixed_phy_status *status,
38 						int gpio_link,
39 						struct device_node *np)
40 {
41 	return ERR_PTR(-ENODEV);
42 }
fixed_phy_del(int phy_addr)43 static inline int fixed_phy_del(int phy_addr)
44 {
45 	return -ENODEV;
46 }
fixed_phy_set_link_update(struct phy_device * phydev,int (* link_update)(struct net_device *,struct fixed_phy_status *))47 static inline int fixed_phy_set_link_update(struct phy_device *phydev,
48 			int (*link_update)(struct net_device *,
49 					   struct fixed_phy_status *))
50 {
51 	return -ENODEV;
52 }
fixed_phy_update_state(struct phy_device * phydev,const struct fixed_phy_status * status,const struct fixed_phy_status * changed)53 static inline int fixed_phy_update_state(struct phy_device *phydev,
54 			   const struct fixed_phy_status *status,
55 			   const struct fixed_phy_status *changed)
56 {
57 	return -ENODEV;
58 }
59 #endif /* CONFIG_FIXED_PHY */
60 
61 #endif /* __PHY_FIXED_H */
62