162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci#ifndef _LINUX_ETHTOOL_NETLINK_H_
462306a36Sopenharmony_ci#define _LINUX_ETHTOOL_NETLINK_H_
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#include <uapi/linux/ethtool_netlink.h>
762306a36Sopenharmony_ci#include <linux/ethtool.h>
862306a36Sopenharmony_ci#include <linux/netdevice.h>
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#define __ETHTOOL_LINK_MODE_MASK_NWORDS \
1162306a36Sopenharmony_ci	DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32)
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#define ETHTOOL_PAUSE_STAT_CNT	(__ETHTOOL_A_PAUSE_STAT_CNT -		\
1462306a36Sopenharmony_ci				 ETHTOOL_A_PAUSE_STAT_TX_FRAMES)
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_cienum ethtool_multicast_groups {
1762306a36Sopenharmony_ci	ETHNL_MCGRP_MONITOR,
1862306a36Sopenharmony_ci};
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_cistruct phy_device;
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci#if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
2362306a36Sopenharmony_ciint ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd);
2462306a36Sopenharmony_civoid ethnl_cable_test_free(struct phy_device *phydev);
2562306a36Sopenharmony_civoid ethnl_cable_test_finished(struct phy_device *phydev);
2662306a36Sopenharmony_ciint ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result);
2762306a36Sopenharmony_ciint ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm);
2862306a36Sopenharmony_ciint ethnl_cable_test_amplitude(struct phy_device *phydev, u8 pair, s16 mV);
2962306a36Sopenharmony_ciint ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV);
3062306a36Sopenharmony_ciint ethnl_cable_test_step(struct phy_device *phydev, u32 first, u32 last,
3162306a36Sopenharmony_ci			  u32 step);
3262306a36Sopenharmony_civoid ethtool_aggregate_mac_stats(struct net_device *dev,
3362306a36Sopenharmony_ci				 struct ethtool_eth_mac_stats *mac_stats);
3462306a36Sopenharmony_civoid ethtool_aggregate_phy_stats(struct net_device *dev,
3562306a36Sopenharmony_ci				 struct ethtool_eth_phy_stats *phy_stats);
3662306a36Sopenharmony_civoid ethtool_aggregate_ctrl_stats(struct net_device *dev,
3762306a36Sopenharmony_ci				  struct ethtool_eth_ctrl_stats *ctrl_stats);
3862306a36Sopenharmony_civoid ethtool_aggregate_pause_stats(struct net_device *dev,
3962306a36Sopenharmony_ci				   struct ethtool_pause_stats *pause_stats);
4062306a36Sopenharmony_civoid ethtool_aggregate_rmon_stats(struct net_device *dev,
4162306a36Sopenharmony_ci				  struct ethtool_rmon_stats *rmon_stats);
4262306a36Sopenharmony_cibool ethtool_dev_mm_supported(struct net_device *dev);
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci#else
4562306a36Sopenharmony_cistatic inline int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd)
4662306a36Sopenharmony_ci{
4762306a36Sopenharmony_ci	return -EOPNOTSUPP;
4862306a36Sopenharmony_ci}
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_cistatic inline void ethnl_cable_test_free(struct phy_device *phydev)
5162306a36Sopenharmony_ci{
5262306a36Sopenharmony_ci}
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_cistatic inline void ethnl_cable_test_finished(struct phy_device *phydev)
5562306a36Sopenharmony_ci{
5662306a36Sopenharmony_ci}
5762306a36Sopenharmony_cistatic inline int ethnl_cable_test_result(struct phy_device *phydev, u8 pair,
5862306a36Sopenharmony_ci					  u8 result)
5962306a36Sopenharmony_ci{
6062306a36Sopenharmony_ci	return -EOPNOTSUPP;
6162306a36Sopenharmony_ci}
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_cistatic inline int ethnl_cable_test_fault_length(struct phy_device *phydev,
6462306a36Sopenharmony_ci						u8 pair, u32 cm)
6562306a36Sopenharmony_ci{
6662306a36Sopenharmony_ci	return -EOPNOTSUPP;
6762306a36Sopenharmony_ci}
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_cistatic inline int ethnl_cable_test_amplitude(struct phy_device *phydev,
7062306a36Sopenharmony_ci					     u8 pair, s16 mV)
7162306a36Sopenharmony_ci{
7262306a36Sopenharmony_ci	return -EOPNOTSUPP;
7362306a36Sopenharmony_ci}
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_cistatic inline int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV)
7662306a36Sopenharmony_ci{
7762306a36Sopenharmony_ci	return -EOPNOTSUPP;
7862306a36Sopenharmony_ci}
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_cistatic inline int ethnl_cable_test_step(struct phy_device *phydev, u32 first,
8162306a36Sopenharmony_ci					u32 last, u32 step)
8262306a36Sopenharmony_ci{
8362306a36Sopenharmony_ci	return -EOPNOTSUPP;
8462306a36Sopenharmony_ci}
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_cistatic inline void
8762306a36Sopenharmony_ciethtool_aggregate_mac_stats(struct net_device *dev,
8862306a36Sopenharmony_ci			    struct ethtool_eth_mac_stats *mac_stats)
8962306a36Sopenharmony_ci{
9062306a36Sopenharmony_ci}
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_cistatic inline void
9362306a36Sopenharmony_ciethtool_aggregate_phy_stats(struct net_device *dev,
9462306a36Sopenharmony_ci			    struct ethtool_eth_phy_stats *phy_stats)
9562306a36Sopenharmony_ci{
9662306a36Sopenharmony_ci}
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_cistatic inline void
9962306a36Sopenharmony_ciethtool_aggregate_ctrl_stats(struct net_device *dev,
10062306a36Sopenharmony_ci			     struct ethtool_eth_ctrl_stats *ctrl_stats)
10162306a36Sopenharmony_ci{
10262306a36Sopenharmony_ci}
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_cistatic inline void
10562306a36Sopenharmony_ciethtool_aggregate_pause_stats(struct net_device *dev,
10662306a36Sopenharmony_ci			      struct ethtool_pause_stats *pause_stats)
10762306a36Sopenharmony_ci{
10862306a36Sopenharmony_ci}
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_cistatic inline void
11162306a36Sopenharmony_ciethtool_aggregate_rmon_stats(struct net_device *dev,
11262306a36Sopenharmony_ci			     struct ethtool_rmon_stats *rmon_stats)
11362306a36Sopenharmony_ci{
11462306a36Sopenharmony_ci}
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_cistatic inline bool ethtool_dev_mm_supported(struct net_device *dev)
11762306a36Sopenharmony_ci{
11862306a36Sopenharmony_ci	return false;
11962306a36Sopenharmony_ci}
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci#endif /* IS_ENABLED(CONFIG_ETHTOOL_NETLINK) */
12262306a36Sopenharmony_ci#endif /* _LINUX_ETHTOOL_NETLINK_H_ */
123