diff options
| author | Maxime Chevallier <maxime.chevallier@bootlin.com> | 2024-08-21 17:10:01 +0200 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2024-08-23 13:04:34 +0100 |
| commit | 17194be4c8e1e82d8b484e58cdcb495c0714d1fd (patch) | |
| tree | 0690cfcf8e3797e13ea983f85e53423a804540bc /net/ethtool/netlink.c | |
| parent | 9af0e89d6c2433afd3e5e7cc52c7592ef23526c0 (diff) | |
net: ethtool: Introduce a command to list PHYs on an interface
As we have the ability to track the PHYs connected to a net_device
through the link_topology, we can expose this list to userspace. This
allows userspace to use these identifiers for phy-specific commands and
take the decision of which PHY to target by knowing the link topology.
Add PHY_GET and PHY_DUMP, which can be a filtered DUMP operation to list
devices on only one interface.
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/netlink.c')
| -rw-r--r-- | net/ethtool/netlink.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c index b00061924e80..e3f0ef6b851b 100644 --- a/net/ethtool/netlink.c +++ b/net/ethtool/netlink.c @@ -1234,6 +1234,15 @@ static const struct genl_ops ethtool_genl_ops[] = { .policy = ethnl_module_fw_flash_act_policy, .maxattr = ARRAY_SIZE(ethnl_module_fw_flash_act_policy) - 1, }, + { + .cmd = ETHTOOL_MSG_PHY_GET, + .doit = ethnl_phy_doit, + .start = ethnl_phy_start, + .dumpit = ethnl_phy_dumpit, + .done = ethnl_phy_done, + .policy = ethnl_phy_get_policy, + .maxattr = ARRAY_SIZE(ethnl_phy_get_policy) - 1, + }, }; static const struct genl_multicast_group ethtool_nl_mcgrps[] = { |
