OSDN Git Service

ethtool: wire up get policies to ops
authorJakub Kicinski <kuba@kernel.org>
Mon, 5 Oct 2020 22:07:33 +0000 (15:07 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Oct 2020 13:25:55 +0000 (06:25 -0700)
commit4f30974feb9667f12e224b195b551a170fcc8723
tree83fd7df8ebb7892f52ff9cfa4cf41a386ec06d4e
parent02da0b615b4bd7db747ed77199d5f1a161a0411a
ethtool: wire up get policies to ops

Wire up policies for get commands in struct nla_policy of the ethtool
family. Make use of genetlink code attr validation and parsing, as well
as allow dumping policies to user space.

For every ETHTOOL_MSG_*_GET:
 - add 'ethnl_' prefix to policy name
 - add extern declaration in net/ethtool/netlink.h
 - wire up the policy & attr in ethtool_genl_ops[].
 - remove .request_policy and .max_attr from ethnl_request_ops.

Obviously core only records the first "layer" of parsed attrs
so we still need to parse the sub-attrs of the nested header
attribute.

v2:
 - merge of patches 1 and 2 from v1
 - remove stray empty lines in ops
 - also remove .max_attr

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 files changed:
net/ethtool/channels.c
net/ethtool/coalesce.c
net/ethtool/debug.c
net/ethtool/eee.c
net/ethtool/features.c
net/ethtool/linkinfo.c
net/ethtool/linkmodes.c
net/ethtool/linkstate.c
net/ethtool/netlink.c
net/ethtool/netlink.h
net/ethtool/pause.c
net/ethtool/privflags.c
net/ethtool/rings.c
net/ethtool/strset.c
net/ethtool/tsinfo.c
net/ethtool/tunnels.c
net/ethtool/wol.c