aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/phy.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h41
1 files changed, 32 insertions, 9 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index cd6f637cbbfb..3ea87f774a76 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -19,6 +19,7 @@
19#include <linux/compiler.h> 19#include <linux/compiler.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/ethtool.h> 21#include <linux/ethtool.h>
22#include <linux/linkmode.h>
22#include <linux/mdio.h> 23#include <linux/mdio.h>
23#include <linux/mii.h> 24#include <linux/mii.h>
24#include <linux/module.h> 25#include <linux/module.h>
@@ -41,13 +42,21 @@
41#define PHY_1000BT_FEATURES (SUPPORTED_1000baseT_Half | \ 42#define PHY_1000BT_FEATURES (SUPPORTED_1000baseT_Half | \
42 SUPPORTED_1000baseT_Full) 43 SUPPORTED_1000baseT_Full)
43 44
44#define PHY_BASIC_FEATURES (PHY_10BT_FEATURES | \ 45extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_basic_features) __ro_after_init;
45 PHY_100BT_FEATURES | \ 46extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_basic_t1_features) __ro_after_init;
46 PHY_DEFAULT_FEATURES) 47extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_gbit_features) __ro_after_init;
47 48extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_gbit_fibre_features) __ro_after_init;
48#define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \ 49extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_gbit_all_ports_features) __ro_after_init;
49 PHY_1000BT_FEATURES) 50extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_10gbit_features) __ro_after_init;
50 51extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_10gbit_full_features) __ro_after_init;
52
53#define PHY_BASIC_FEATURES ((unsigned long *)&phy_basic_features)
54#define PHY_BASIC_T1_FEATURES ((unsigned long *)&phy_basic_t1_features)
55#define PHY_GBIT_FEATURES ((unsigned long *)&phy_gbit_features)
56#define PHY_GBIT_FIBRE_FEATURES ((unsigned long *)&phy_gbit_fibre_features)
57#define PHY_GBIT_ALL_PORTS_FEATURES ((unsigned long *)&phy_gbit_all_ports_features)
58#define PHY_10GBIT_FEATURES ((unsigned long *)&phy_10gbit_features)
59#define PHY_10GBIT_FULL_FEATURES ((unsigned long *)&phy_10gbit_full_features)
51 60
52/* 61/*
53 * Set phydev->irq to PHY_POLL if interrupts are not supported, 62 * Set phydev->irq to PHY_POLL if interrupts are not supported,
@@ -509,7 +518,7 @@ struct phy_driver {
509 u32 phy_id; 518 u32 phy_id;
510 char *name; 519 char *name;
511 u32 phy_id_mask; 520 u32 phy_id_mask;
512 u32 features; 521 const unsigned long * const features;
513 u32 flags; 522 u32 flags;
514 const void *driver_data; 523 const void *driver_data;
515 524
@@ -967,6 +976,12 @@ static inline void phy_device_reset(struct phy_device *phydev, int value)
967#define phydev_err(_phydev, format, args...) \ 976#define phydev_err(_phydev, format, args...) \
968 dev_err(&_phydev->mdio.dev, format, ##args) 977 dev_err(&_phydev->mdio.dev, format, ##args)
969 978
979#define phydev_info(_phydev, format, args...) \
980 dev_info(&_phydev->mdio.dev, format, ##args)
981
982#define phydev_warn(_phydev, format, args...) \
983 dev_warn(&_phydev->mdio.dev, format, ##args)
984
970#define phydev_dbg(_phydev, format, args...) \ 985#define phydev_dbg(_phydev, format, args...) \
971 dev_dbg(&_phydev->mdio.dev, format, ##args) 986 dev_dbg(&_phydev->mdio.dev, format, ##args)
972 987
@@ -1039,7 +1054,7 @@ void phy_change_work(struct work_struct *work);
1039void phy_mac_interrupt(struct phy_device *phydev); 1054void phy_mac_interrupt(struct phy_device *phydev);
1040void phy_start_machine(struct phy_device *phydev); 1055void phy_start_machine(struct phy_device *phydev);
1041void phy_stop_machine(struct phy_device *phydev); 1056void phy_stop_machine(struct phy_device *phydev);
1042void phy_trigger_machine(struct phy_device *phydev, bool sync); 1057void phy_trigger_machine(struct phy_device *phydev);
1043int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); 1058int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
1044void phy_ethtool_ksettings_get(struct phy_device *phydev, 1059void phy_ethtool_ksettings_get(struct phy_device *phydev,
1045 struct ethtool_link_ksettings *cmd); 1060 struct ethtool_link_ksettings *cmd);
@@ -1049,6 +1064,14 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
1049int phy_start_interrupts(struct phy_device *phydev); 1064int phy_start_interrupts(struct phy_device *phydev);
1050void phy_print_status(struct phy_device *phydev); 1065void phy_print_status(struct phy_device *phydev);
1051int phy_set_max_speed(struct phy_device *phydev, u32 max_speed); 1066int phy_set_max_speed(struct phy_device *phydev, u32 max_speed);
1067void phy_remove_link_mode(struct phy_device *phydev, u32 link_mode);
1068void phy_support_sym_pause(struct phy_device *phydev);
1069void phy_support_asym_pause(struct phy_device *phydev);
1070void phy_set_sym_pause(struct phy_device *phydev, bool rx, bool tx,
1071 bool autoneg);
1072void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx);
1073bool phy_validate_pause(struct phy_device *phydev,
1074 struct ethtool_pauseparam *pp);
1052 1075
1053int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, 1076int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
1054 int (*run)(struct phy_device *)); 1077 int (*run)(struct phy_device *));