0001
0002
0003 #ifndef _LINUX_ETHTOOL_NETLINK_H_
0004 #define _LINUX_ETHTOOL_NETLINK_H_
0005
0006 #include <uapi/linux/ethtool_netlink.h>
0007 #include <linux/ethtool.h>
0008 #include <linux/netdevice.h>
0009
0010 #define __ETHTOOL_LINK_MODE_MASK_NWORDS \
0011 DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32)
0012
0013 #define ETHTOOL_PAUSE_STAT_CNT (__ETHTOOL_A_PAUSE_STAT_CNT - \
0014 ETHTOOL_A_PAUSE_STAT_TX_FRAMES)
0015
0016 enum ethtool_multicast_groups {
0017 ETHNL_MCGRP_MONITOR,
0018 };
0019
0020 struct phy_device;
0021
0022 #if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
0023 int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd);
0024 void ethnl_cable_test_free(struct phy_device *phydev);
0025 void ethnl_cable_test_finished(struct phy_device *phydev);
0026 int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result);
0027 int ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm);
0028 int ethnl_cable_test_amplitude(struct phy_device *phydev, u8 pair, s16 mV);
0029 int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV);
0030 int ethnl_cable_test_step(struct phy_device *phydev, u32 first, u32 last,
0031 u32 step);
0032 #else
0033 static inline int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd)
0034 {
0035 return -EOPNOTSUPP;
0036 }
0037
0038 static inline void ethnl_cable_test_free(struct phy_device *phydev)
0039 {
0040 }
0041
0042 static inline void ethnl_cable_test_finished(struct phy_device *phydev)
0043 {
0044 }
0045 static inline int ethnl_cable_test_result(struct phy_device *phydev, u8 pair,
0046 u8 result)
0047 {
0048 return -EOPNOTSUPP;
0049 }
0050
0051 static inline int ethnl_cable_test_fault_length(struct phy_device *phydev,
0052 u8 pair, u32 cm)
0053 {
0054 return -EOPNOTSUPP;
0055 }
0056
0057 static inline int ethnl_cable_test_amplitude(struct phy_device *phydev,
0058 u8 pair, s16 mV)
0059 {
0060 return -EOPNOTSUPP;
0061 }
0062
0063 static inline int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV)
0064 {
0065 return -EOPNOTSUPP;
0066 }
0067
0068 static inline int ethnl_cable_test_step(struct phy_device *phydev, u32 first,
0069 u32 last, u32 step)
0070 {
0071 return -EOPNOTSUPP;
0072 }
0073 #endif
0074 #endif