428c122f5f
Unlike e.g. netdev features, the ethtool ioctl interface requires link mode table to be in sync between kernel and userspace for userspace to be able to display and set all link modes supported by kernel. The way arbitrary length bitsets are implemented in netlink interface, this will be no longer needed. To allow userspace to access all link modes running kernel supports, add table of ethernet link mode names and make it available as a string set to userspace GET_STRSET requests. Add build time check to make sure names are defined for all modes declared in enum ethtool_link_mode_bit_indices. Once the string set is available, make it also accessible via ioctl. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
23 lines
716 B
C
23 lines
716 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#ifndef _ETHTOOL_COMMON_H
|
|
#define _ETHTOOL_COMMON_H
|
|
|
|
#include <linux/ethtool.h>
|
|
|
|
/* compose link mode index from speed, type and duplex */
|
|
#define ETHTOOL_LINK_MODE(speed, type, duplex) \
|
|
ETHTOOL_LINK_MODE_ ## speed ## base ## type ## _ ## duplex ## _BIT
|
|
|
|
extern const char
|
|
netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN];
|
|
extern const char
|
|
rss_hash_func_strings[ETH_RSS_HASH_FUNCS_COUNT][ETH_GSTRING_LEN];
|
|
extern const char
|
|
tunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN];
|
|
extern const char
|
|
phy_tunable_strings[__ETHTOOL_PHY_TUNABLE_COUNT][ETH_GSTRING_LEN];
|
|
extern const char link_mode_names[][ETH_GSTRING_LEN];
|
|
|
|
#endif /* _ETHTOOL_COMMON_H */
|