1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef _LINUX_ETHTOOL_NETLINK_H_ 4 #define _LINUX_ETHTOOL_NETLINK_H_ 5 6 #include <uapi/linux/ethtool_netlink.h> 7 #include <linux/ethtool.h> 8 #include <linux/netdevice.h> 9 10 #define __ETHTOOL_LINK_MODE_MASK_NWORDS \ 11 DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32) 12 13 enum ethtool_multicast_groups { 14 ETHNL_MCGRP_MONITOR, 15 }; 16 17 struct phy_device; 18 19 #if IS_ENABLED(CONFIG_ETHTOOL_NETLINK) 20 int ethnl_cable_test_alloc(struct phy_device *phydev); 21 void ethnl_cable_test_free(struct phy_device *phydev); 22 void ethnl_cable_test_finished(struct phy_device *phydev); 23 int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result); 24 int ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm); 25 #else 26 static inline int ethnl_cable_test_alloc(struct phy_device *phydev) 27 { 28 return -EOPNOTSUPP; 29 } 30 31 static inline void ethnl_cable_test_free(struct phy_device *phydev) 32 { 33 } 34 35 static inline void ethnl_cable_test_finished(struct phy_device *phydev) 36 { 37 } 38 static inline int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, 39 u8 result) 40 { 41 return -EOPNOTSUPP; 42 } 43 44 static inline int ethnl_cable_test_fault_length(struct phy_device *phydev, 45 u8 pair, u32 cm) 46 { 47 return -EOPNOTSUPP; 48 } 49 #endif /* IS_ENABLED(ETHTOOL_NETLINK) */ 50 #endif /* _LINUX_ETHTOOL_NETLINK_H_ */ 51