printf: Remove unused 'bprintf'
[drm/drm-misc.git] / include / linux / ethtool_netlink.h
blobaba91335273af4665427781fc14aa7159df5ad55
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef _LINUX_ETHTOOL_NETLINK_H_
4 #define _LINUX_ETHTOOL_NETLINK_H_
6 #include <uapi/linux/ethtool_netlink.h>
7 #include <linux/ethtool.h>
8 #include <linux/netdevice.h>
10 #define __ETHTOOL_LINK_MODE_MASK_NWORDS \
11 DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32)
13 #define ETHTOOL_PAUSE_STAT_CNT (__ETHTOOL_A_PAUSE_STAT_CNT - \
14 ETHTOOL_A_PAUSE_STAT_TX_FRAMES)
16 enum ethtool_multicast_groups {
17 ETHNL_MCGRP_MONITOR,
20 struct phy_device;
22 #if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
23 int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd);
24 void ethnl_cable_test_free(struct phy_device *phydev);
25 void ethnl_cable_test_finished(struct phy_device *phydev);
26 int ethnl_cable_test_result_with_src(struct phy_device *phydev, u8 pair,
27 u8 result, u32 src);
28 int ethnl_cable_test_fault_length_with_src(struct phy_device *phydev, u8 pair,
29 u32 cm, u32 src);
30 int ethnl_cable_test_amplitude(struct phy_device *phydev, u8 pair, s16 mV);
31 int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV);
32 int ethnl_cable_test_step(struct phy_device *phydev, u32 first, u32 last,
33 u32 step);
34 void ethtool_aggregate_mac_stats(struct net_device *dev,
35 struct ethtool_eth_mac_stats *mac_stats);
36 void ethtool_aggregate_phy_stats(struct net_device *dev,
37 struct ethtool_eth_phy_stats *phy_stats);
38 void ethtool_aggregate_ctrl_stats(struct net_device *dev,
39 struct ethtool_eth_ctrl_stats *ctrl_stats);
40 void ethtool_aggregate_pause_stats(struct net_device *dev,
41 struct ethtool_pause_stats *pause_stats);
42 void ethtool_aggregate_rmon_stats(struct net_device *dev,
43 struct ethtool_rmon_stats *rmon_stats);
44 bool ethtool_dev_mm_supported(struct net_device *dev);
46 #else
47 static inline int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd)
49 return -EOPNOTSUPP;
52 static inline void ethnl_cable_test_free(struct phy_device *phydev)
56 static inline void ethnl_cable_test_finished(struct phy_device *phydev)
59 static inline int ethnl_cable_test_result_with_src(struct phy_device *phydev,
60 u8 pair, u8 result, u32 src)
62 return -EOPNOTSUPP;
65 static inline int ethnl_cable_test_fault_length_with_src(struct phy_device *phydev,
66 u8 pair, u32 cm, u32 src)
68 return -EOPNOTSUPP;
71 static inline int ethnl_cable_test_amplitude(struct phy_device *phydev,
72 u8 pair, s16 mV)
74 return -EOPNOTSUPP;
77 static inline int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV)
79 return -EOPNOTSUPP;
82 static inline int ethnl_cable_test_step(struct phy_device *phydev, u32 first,
83 u32 last, u32 step)
85 return -EOPNOTSUPP;
88 static inline void
89 ethtool_aggregate_mac_stats(struct net_device *dev,
90 struct ethtool_eth_mac_stats *mac_stats)
94 static inline void
95 ethtool_aggregate_phy_stats(struct net_device *dev,
96 struct ethtool_eth_phy_stats *phy_stats)
100 static inline void
101 ethtool_aggregate_ctrl_stats(struct net_device *dev,
102 struct ethtool_eth_ctrl_stats *ctrl_stats)
106 static inline void
107 ethtool_aggregate_pause_stats(struct net_device *dev,
108 struct ethtool_pause_stats *pause_stats)
112 static inline void
113 ethtool_aggregate_rmon_stats(struct net_device *dev,
114 struct ethtool_rmon_stats *rmon_stats)
118 static inline bool ethtool_dev_mm_supported(struct net_device *dev)
120 return false;
123 #endif /* IS_ENABLED(CONFIG_ETHTOOL_NETLINK) */
125 static inline int ethnl_cable_test_result(struct phy_device *phydev, u8 pair,
126 u8 result)
128 return ethnl_cable_test_result_with_src(phydev, pair, result,
129 ETHTOOL_A_CABLE_INF_SRC_TDR);
132 static inline int ethnl_cable_test_fault_length(struct phy_device *phydev,
133 u8 pair, u32 cm)
135 return ethnl_cable_test_fault_length_with_src(phydev, pair, cm,
136 ETHTOOL_A_CABLE_INF_SRC_TDR);
139 #endif /* _LINUX_ETHTOOL_NETLINK_H_ */