xref: /OK3568_Linux_fs/kernel/include/linux/ethtool_netlink.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun 
3*4882a593Smuzhiyun #ifndef _LINUX_ETHTOOL_NETLINK_H_
4*4882a593Smuzhiyun #define _LINUX_ETHTOOL_NETLINK_H_
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun #include <uapi/linux/ethtool_netlink.h>
7*4882a593Smuzhiyun #include <linux/ethtool.h>
8*4882a593Smuzhiyun #include <linux/netdevice.h>
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #define __ETHTOOL_LINK_MODE_MASK_NWORDS \
11*4882a593Smuzhiyun 	DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32)
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #define ETHTOOL_PAUSE_STAT_CNT	(__ETHTOOL_A_PAUSE_STAT_CNT -		\
14*4882a593Smuzhiyun 				 ETHTOOL_A_PAUSE_STAT_TX_FRAMES)
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun enum ethtool_multicast_groups {
17*4882a593Smuzhiyun 	ETHNL_MCGRP_MONITOR,
18*4882a593Smuzhiyun };
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun struct phy_device;
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun #if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
23*4882a593Smuzhiyun int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd);
24*4882a593Smuzhiyun void ethnl_cable_test_free(struct phy_device *phydev);
25*4882a593Smuzhiyun void ethnl_cable_test_finished(struct phy_device *phydev);
26*4882a593Smuzhiyun int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result);
27*4882a593Smuzhiyun int ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm);
28*4882a593Smuzhiyun int ethnl_cable_test_amplitude(struct phy_device *phydev, u8 pair, s16 mV);
29*4882a593Smuzhiyun int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV);
30*4882a593Smuzhiyun int ethnl_cable_test_step(struct phy_device *phydev, u32 first, u32 last,
31*4882a593Smuzhiyun 			  u32 step);
32*4882a593Smuzhiyun #else
ethnl_cable_test_alloc(struct phy_device * phydev,u8 cmd)33*4882a593Smuzhiyun static inline int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd)
34*4882a593Smuzhiyun {
35*4882a593Smuzhiyun 	return -EOPNOTSUPP;
36*4882a593Smuzhiyun }
37*4882a593Smuzhiyun 
ethnl_cable_test_free(struct phy_device * phydev)38*4882a593Smuzhiyun static inline void ethnl_cable_test_free(struct phy_device *phydev)
39*4882a593Smuzhiyun {
40*4882a593Smuzhiyun }
41*4882a593Smuzhiyun 
ethnl_cable_test_finished(struct phy_device * phydev)42*4882a593Smuzhiyun static inline void ethnl_cable_test_finished(struct phy_device *phydev)
43*4882a593Smuzhiyun {
44*4882a593Smuzhiyun }
ethnl_cable_test_result(struct phy_device * phydev,u8 pair,u8 result)45*4882a593Smuzhiyun static inline int ethnl_cable_test_result(struct phy_device *phydev, u8 pair,
46*4882a593Smuzhiyun 					  u8 result)
47*4882a593Smuzhiyun {
48*4882a593Smuzhiyun 	return -EOPNOTSUPP;
49*4882a593Smuzhiyun }
50*4882a593Smuzhiyun 
ethnl_cable_test_fault_length(struct phy_device * phydev,u8 pair,u32 cm)51*4882a593Smuzhiyun static inline int ethnl_cable_test_fault_length(struct phy_device *phydev,
52*4882a593Smuzhiyun 						u8 pair, u32 cm)
53*4882a593Smuzhiyun {
54*4882a593Smuzhiyun 	return -EOPNOTSUPP;
55*4882a593Smuzhiyun }
56*4882a593Smuzhiyun 
ethnl_cable_test_amplitude(struct phy_device * phydev,u8 pair,s16 mV)57*4882a593Smuzhiyun static inline int ethnl_cable_test_amplitude(struct phy_device *phydev,
58*4882a593Smuzhiyun 					     u8 pair, s16 mV)
59*4882a593Smuzhiyun {
60*4882a593Smuzhiyun 	return -EOPNOTSUPP;
61*4882a593Smuzhiyun }
62*4882a593Smuzhiyun 
ethnl_cable_test_pulse(struct phy_device * phydev,u16 mV)63*4882a593Smuzhiyun static inline int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV)
64*4882a593Smuzhiyun {
65*4882a593Smuzhiyun 	return -EOPNOTSUPP;
66*4882a593Smuzhiyun }
67*4882a593Smuzhiyun 
ethnl_cable_test_step(struct phy_device * phydev,u32 first,u32 last,u32 step)68*4882a593Smuzhiyun static inline int ethnl_cable_test_step(struct phy_device *phydev, u32 first,
69*4882a593Smuzhiyun 					u32 last, u32 step)
70*4882a593Smuzhiyun {
71*4882a593Smuzhiyun 	return -EOPNOTSUPP;
72*4882a593Smuzhiyun }
73*4882a593Smuzhiyun #endif /* IS_ENABLED(CONFIG_ETHTOOL_NETLINK) */
74*4882a593Smuzhiyun #endif /* _LINUX_ETHTOOL_NETLINK_H_ */
75