]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: provide link mode names as a string set
authorMichal Kubecek <mkubecek@suse.cz>
Wed, 11 Dec 2019 09:58:34 +0000 (10:58 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Dec 2019 01:07:05 +0000 (17:07 -0800)
commit81e263f22e35fb80e199e33ae0977c83888e1ce7
tree0cf6b6e25364ee86cb5b73677589174f3657f33d
parentf80314f3c3aa1de8ece9728a12f2938482940746
ethtool: provide link mode names as a string set

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>
include/uapi/linux/ethtool.h
net/ethtool/common.c
net/ethtool/common.h
net/ethtool/ioctl.c