blob: 1e7bf78cb3829cc4059862a1256746d562492116 [file] [log] [blame]
Michal Kubecek2b4a8992019-12-27 15:55:18 +01001/* 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>
Michal Kubecek6b08d6c2019-12-27 15:55:33 +01008#include <linux/netdevice.h>
9
Michal Kubecekf625aa92019-12-27 15:56:08 +010010#define __ETHTOOL_LINK_MODE_MASK_NWORDS \
11 DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32)
12
Michal Kubecek6b08d6c2019-12-27 15:55:33 +010013enum ethtool_multicast_groups {
14 ETHNL_MCGRP_MONITOR,
15};
Michal Kubecek2b4a8992019-12-27 15:55:18 +010016
Andrew Lunn1dd3f212020-05-10 21:12:36 +020017struct phy_device;
18
19#if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
Andrew Lunn1a644de2020-05-27 00:21:38 +020020int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd);
Andrew Lunn1dd3f212020-05-10 21:12:36 +020021void ethnl_cable_test_free(struct phy_device *phydev);
22void ethnl_cable_test_finished(struct phy_device *phydev);
Andrew Lunn1e2dc142020-05-10 21:12:37 +020023int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result);
24int ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm);
Andrew Lunn6b4a0fc2020-05-27 00:21:39 +020025int ethnl_cable_test_amplitude(struct phy_device *phydev, u8 pair, s16 mV);
26int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV);
27int ethnl_cable_test_step(struct phy_device *phydev, u32 first, u32 last,
28 u32 step);
Andrew Lunn1dd3f212020-05-10 21:12:36 +020029#else
Andrew Lunn1a644de2020-05-27 00:21:38 +020030static inline int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd)
Andrew Lunn1dd3f212020-05-10 21:12:36 +020031{
Andrew Lunn1e2dc142020-05-10 21:12:37 +020032 return -EOPNOTSUPP;
Andrew Lunn1dd3f212020-05-10 21:12:36 +020033}
34
35static inline void ethnl_cable_test_free(struct phy_device *phydev)
36{
37}
38
39static inline void ethnl_cable_test_finished(struct phy_device *phydev)
40{
41}
Andrew Lunn1e2dc142020-05-10 21:12:37 +020042static inline int ethnl_cable_test_result(struct phy_device *phydev, u8 pair,
43 u8 result)
44{
45 return -EOPNOTSUPP;
46}
47
48static inline int ethnl_cable_test_fault_length(struct phy_device *phydev,
49 u8 pair, u32 cm)
50{
51 return -EOPNOTSUPP;
52}
Andrew Lunn6b4a0fc2020-05-27 00:21:39 +020053
54static inline int ethnl_cable_test_amplitude(struct phy_device *phydev,
55 u8 pair, s16 mV)
56{
57 return -EOPNOTSUPP;
58}
59
60static inline int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV)
61{
62 return -EOPNOTSUPP;
63}
64
65static inline int ethnl_cable_test_step(struct phy_device *phydev, u32 first,
66 u32 last, u32 step)
67{
68 return -EOPNOTSUPP;
69}
Kees Cook90c56b32020-06-05 07:21:22 -070070#endif /* IS_ENABLED(CONFIG_ETHTOOL_NETLINK) */
Michal Kubecek2b4a8992019-12-27 15:55:18 +010071#endif /* _LINUX_ETHTOOL_NETLINK_H_ */