Merge tag 'xfs-6.4-rc1-fixes' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[linux-block.git] / include / linux / ethtool_netlink.h
CommitLineData
2b4a8990
MK
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>
6b08d6c1
MK
8#include <linux/netdevice.h>
9
f625aa9b
MK
10#define __ETHTOOL_LINK_MODE_MASK_NWORDS \
11 DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32)
12
1aabe578
JK
13#define ETHTOOL_PAUSE_STAT_CNT (__ETHTOOL_A_PAUSE_STAT_CNT - \
14 ETHTOOL_A_PAUSE_STAT_TX_FRAMES)
15
6b08d6c1
MK
16enum ethtool_multicast_groups {
17 ETHNL_MCGRP_MONITOR,
18};
2b4a8990 19
1dd3f212
AL
20struct phy_device;
21
22#if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
1a644de2 23int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd);
1dd3f212
AL
24void ethnl_cable_test_free(struct phy_device *phydev);
25void ethnl_cable_test_finished(struct phy_device *phydev);
1e2dc145
AL
26int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result);
27int ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm);
6b4a0fc1
AL
28int ethnl_cable_test_amplitude(struct phy_device *phydev, u8 pair, s16 mV);
29int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV);
30int ethnl_cable_test_step(struct phy_device *phydev, u32 first, u32 last,
31 u32 step);
9179f5fe
VO
32void ethtool_aggregate_mac_stats(struct net_device *dev,
33 struct ethtool_eth_mac_stats *mac_stats);
34void ethtool_aggregate_phy_stats(struct net_device *dev,
35 struct ethtool_eth_phy_stats *phy_stats);
36void ethtool_aggregate_ctrl_stats(struct net_device *dev,
37 struct ethtool_eth_ctrl_stats *ctrl_stats);
38void ethtool_aggregate_pause_stats(struct net_device *dev,
39 struct ethtool_pause_stats *pause_stats);
40void ethtool_aggregate_rmon_stats(struct net_device *dev,
41 struct ethtool_rmon_stats *rmon_stats);
d54151aa 42bool ethtool_dev_mm_supported(struct net_device *dev);
9179f5fe 43
1dd3f212 44#else
1a644de2 45static inline int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd)
1dd3f212 46{
1e2dc145 47 return -EOPNOTSUPP;
1dd3f212
AL
48}
49
50static inline void ethnl_cable_test_free(struct phy_device *phydev)
51{
52}
53
54static inline void ethnl_cable_test_finished(struct phy_device *phydev)
55{
56}
1e2dc145
AL
57static inline int ethnl_cable_test_result(struct phy_device *phydev, u8 pair,
58 u8 result)
59{
60 return -EOPNOTSUPP;
61}
62
63static inline int ethnl_cable_test_fault_length(struct phy_device *phydev,
64 u8 pair, u32 cm)
65{
66 return -EOPNOTSUPP;
67}
6b4a0fc1
AL
68
69static inline int ethnl_cable_test_amplitude(struct phy_device *phydev,
70 u8 pair, s16 mV)
71{
72 return -EOPNOTSUPP;
73}
74
75static inline int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV)
76{
77 return -EOPNOTSUPP;
78}
79
80static inline int ethnl_cable_test_step(struct phy_device *phydev, u32 first,
81 u32 last, u32 step)
82{
83 return -EOPNOTSUPP;
84}
9179f5fe
VO
85
86static inline void
87ethtool_aggregate_mac_stats(struct net_device *dev,
88 struct ethtool_eth_mac_stats *mac_stats)
89{
90}
91
92static inline void
93ethtool_aggregate_phy_stats(struct net_device *dev,
94 struct ethtool_eth_phy_stats *phy_stats)
95{
96}
97
98static inline void
99ethtool_aggregate_ctrl_stats(struct net_device *dev,
100 struct ethtool_eth_ctrl_stats *ctrl_stats)
101{
102}
103
104static inline void
105ethtool_aggregate_pause_stats(struct net_device *dev,
106 struct ethtool_pause_stats *pause_stats)
107{
108}
109
110static inline void
111ethtool_aggregate_rmon_stats(struct net_device *dev,
112 struct ethtool_rmon_stats *rmon_stats)
113{
114}
115
d54151aa
VO
116static inline bool ethtool_dev_mm_supported(struct net_device *dev)
117{
118 return false;
119}
120
90c56b38 121#endif /* IS_ENABLED(CONFIG_ETHTOOL_NETLINK) */
2b4a8990 122#endif /* _LINUX_ETHTOOL_NETLINK_H_ */