18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ci#ifndef _ETHTOOL_COMMON_H 48c2ecf20Sopenharmony_ci#define _ETHTOOL_COMMON_H 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#include <linux/netdevice.h> 78c2ecf20Sopenharmony_ci#include <linux/ethtool.h> 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#define ETHTOOL_DEV_FEATURE_WORDS DIV_ROUND_UP(NETDEV_FEATURE_COUNT, 32) 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci/* compose link mode index from speed, type and duplex */ 128c2ecf20Sopenharmony_ci#define ETHTOOL_LINK_MODE(speed, type, duplex) \ 138c2ecf20Sopenharmony_ci ETHTOOL_LINK_MODE_ ## speed ## base ## type ## _ ## duplex ## _BIT 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#define __SOF_TIMESTAMPING_CNT (const_ilog2(SOF_TIMESTAMPING_LAST) + 1) 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ciextern const char 188c2ecf20Sopenharmony_cinetdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN]; 198c2ecf20Sopenharmony_ciextern const char 208c2ecf20Sopenharmony_cirss_hash_func_strings[ETH_RSS_HASH_FUNCS_COUNT][ETH_GSTRING_LEN]; 218c2ecf20Sopenharmony_ciextern const char 228c2ecf20Sopenharmony_citunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN]; 238c2ecf20Sopenharmony_ciextern const char 248c2ecf20Sopenharmony_ciphy_tunable_strings[__ETHTOOL_PHY_TUNABLE_COUNT][ETH_GSTRING_LEN]; 258c2ecf20Sopenharmony_ciextern const char link_mode_names[][ETH_GSTRING_LEN]; 268c2ecf20Sopenharmony_ciextern const char netif_msg_class_names[][ETH_GSTRING_LEN]; 278c2ecf20Sopenharmony_ciextern const char wol_mode_names[][ETH_GSTRING_LEN]; 288c2ecf20Sopenharmony_ciextern const char sof_timestamping_names[][ETH_GSTRING_LEN]; 298c2ecf20Sopenharmony_ciextern const char ts_tx_type_names[][ETH_GSTRING_LEN]; 308c2ecf20Sopenharmony_ciextern const char ts_rx_filter_names[][ETH_GSTRING_LEN]; 318c2ecf20Sopenharmony_ciextern const char udp_tunnel_type_names[][ETH_GSTRING_LEN]; 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ciint __ethtool_get_link(struct net_device *dev); 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_cibool convert_legacy_settings_to_link_ksettings( 368c2ecf20Sopenharmony_ci struct ethtool_link_ksettings *link_ksettings, 378c2ecf20Sopenharmony_ci const struct ethtool_cmd *legacy_settings); 388c2ecf20Sopenharmony_ciint ethtool_get_max_rxfh_channel(struct net_device *dev, u32 *max); 398c2ecf20Sopenharmony_ciint __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info); 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ciextern const struct ethtool_phy_ops *ethtool_phy_ops; 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci#endif /* _ETHTOOL_COMMON_H */ 44