diff options
Diffstat (limited to 'include/linux/phy.h')
| -rw-r--r-- | include/linux/phy.h | 41 |
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 | \ | 45 | extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_basic_features) __ro_after_init; |
| 45 | PHY_100BT_FEATURES | \ | 46 | extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_basic_t1_features) __ro_after_init; |
| 46 | PHY_DEFAULT_FEATURES) | 47 | extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_gbit_features) __ro_after_init; |
| 47 | 48 | extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_gbit_fibre_features) __ro_after_init; | |
| 48 | #define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \ | 49 | extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_gbit_all_ports_features) __ro_after_init; |
| 49 | PHY_1000BT_FEATURES) | 50 | extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_10gbit_features) __ro_after_init; |
| 50 | 51 | extern __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); | |||
| 1039 | void phy_mac_interrupt(struct phy_device *phydev); | 1054 | void phy_mac_interrupt(struct phy_device *phydev); |
| 1040 | void phy_start_machine(struct phy_device *phydev); | 1055 | void phy_start_machine(struct phy_device *phydev); |
| 1041 | void phy_stop_machine(struct phy_device *phydev); | 1056 | void phy_stop_machine(struct phy_device *phydev); |
| 1042 | void phy_trigger_machine(struct phy_device *phydev, bool sync); | 1057 | void phy_trigger_machine(struct phy_device *phydev); |
| 1043 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 1058 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
| 1044 | void phy_ethtool_ksettings_get(struct phy_device *phydev, | 1059 | void 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); | |||
| 1049 | int phy_start_interrupts(struct phy_device *phydev); | 1064 | int phy_start_interrupts(struct phy_device *phydev); |
| 1050 | void phy_print_status(struct phy_device *phydev); | 1065 | void phy_print_status(struct phy_device *phydev); |
| 1051 | int phy_set_max_speed(struct phy_device *phydev, u32 max_speed); | 1066 | int phy_set_max_speed(struct phy_device *phydev, u32 max_speed); |
| 1067 | void phy_remove_link_mode(struct phy_device *phydev, u32 link_mode); | ||
| 1068 | void phy_support_sym_pause(struct phy_device *phydev); | ||
| 1069 | void phy_support_asym_pause(struct phy_device *phydev); | ||
| 1070 | void phy_set_sym_pause(struct phy_device *phydev, bool rx, bool tx, | ||
| 1071 | bool autoneg); | ||
| 1072 | void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx); | ||
| 1073 | bool phy_validate_pause(struct phy_device *phydev, | ||
| 1074 | struct ethtool_pauseparam *pp); | ||
| 1052 | 1075 | ||
| 1053 | int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, | 1076 | int 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 *)); |
