2017-11-01 15:07:57 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2007-08-10 14:05:16 -07:00
|
|
|
#ifndef __PHY_FIXED_H
|
|
|
|
|
#define __PHY_FIXED_H
|
|
|
|
|
|
|
|
|
|
struct fixed_phy_status {
|
2007-12-07 01:51:22 +03:00
|
|
|
int link;
|
|
|
|
|
int speed;
|
|
|
|
|
int duplex;
|
|
|
|
|
int pause;
|
|
|
|
|
int asym_pause;
|
2007-08-10 14:05:16 -07:00
|
|
|
};
|
|
|
|
|
|
2014-05-16 16:14:04 +02:00
|
|
|
struct device_node;
|
2019-09-03 11:46:52 -07:00
|
|
|
struct gpio_desc;
|
2014-05-16 16:14:04 +02:00
|
|
|
|
2014-12-16 14:30:09 -05:00
|
|
|
#if IS_ENABLED(CONFIG_FIXED_PHY)
|
2018-12-14 15:17:05 +01:00
|
|
|
extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier);
|
2007-12-07 01:51:22 +03:00
|
|
|
extern int fixed_phy_add(unsigned int irq, int phy_id,
|
2019-02-04 11:26:18 +01:00
|
|
|
struct fixed_phy_status *status);
|
2014-10-06 11:38:30 -07:00
|
|
|
extern struct phy_device *fixed_phy_register(unsigned int irq,
|
|
|
|
|
struct fixed_phy_status *status,
|
|
|
|
|
struct device_node *np);
|
2019-02-07 09:52:10 -08:00
|
|
|
|
|
|
|
|
extern struct phy_device *
|
|
|
|
|
fixed_phy_register_with_gpiod(unsigned int irq,
|
|
|
|
|
struct fixed_phy_status *status,
|
|
|
|
|
struct gpio_desc *gpiod);
|
|
|
|
|
|
2016-03-12 00:01:40 +01:00
|
|
|
extern void fixed_phy_unregister(struct phy_device *phydev);
|
2014-08-27 17:04:48 -07:00
|
|
|
extern int fixed_phy_set_link_update(struct phy_device *phydev,
|
|
|
|
|
int (*link_update)(struct net_device *,
|
|
|
|
|
struct fixed_phy_status *));
|
2007-12-07 01:51:22 +03:00
|
|
|
#else
|
|
|
|
|
static inline int fixed_phy_add(unsigned int irq, int phy_id,
|
2019-02-04 11:26:18 +01:00
|
|
|
struct fixed_phy_status *status)
|
2007-12-07 01:51:22 +03:00
|
|
|
{
|
|
|
|
|
return -ENODEV;
|
|
|
|
|
}
|
2014-10-06 11:38:30 -07:00
|
|
|
static inline struct phy_device *fixed_phy_register(unsigned int irq,
|
|
|
|
|
struct fixed_phy_status *status,
|
|
|
|
|
struct device_node *np)
|
2014-05-16 16:14:04 +02:00
|
|
|
{
|
2014-10-06 11:38:30 -07:00
|
|
|
return ERR_PTR(-ENODEV);
|
2014-05-16 16:14:04 +02:00
|
|
|
}
|
2019-02-07 09:52:10 -08:00
|
|
|
|
|
|
|
|
static inline struct phy_device *
|
|
|
|
|
fixed_phy_register_with_gpiod(unsigned int irq,
|
|
|
|
|
struct fixed_phy_status *status,
|
|
|
|
|
struct gpio_desc *gpiod)
|
|
|
|
|
{
|
|
|
|
|
return ERR_PTR(-ENODEV);
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-12 00:01:40 +01:00
|
|
|
static inline void fixed_phy_unregister(struct phy_device *phydev)
|
2014-06-05 20:27:42 +02:00
|
|
|
{
|
|
|
|
|
}
|
2014-08-27 17:04:48 -07:00
|
|
|
static inline int fixed_phy_set_link_update(struct phy_device *phydev,
|
|
|
|
|
int (*link_update)(struct net_device *,
|
|
|
|
|
struct fixed_phy_status *))
|
|
|
|
|
{
|
|
|
|
|
return -ENODEV;
|
|
|
|
|
}
|
2018-12-14 15:17:05 +01:00
|
|
|
static inline int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier)
|
|
|
|
|
{
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
2007-12-07 01:51:22 +03:00
|
|
|
#endif /* CONFIG_FIXED_PHY */
|
2007-08-10 14:05:16 -07:00
|
|
|
|
|
|
|
|
#endif /* __PHY_FIXED_H */
|