History

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.

Maxime Chevallier committed 2 years ago

Commit 17194be1 parent 9af0e896 files · +384 −1Browse files

Showing the changes to include/uapi (1 of 6 files). Show all

Unified · Split

include/uapi/linux/ethtool_netlink.h+19−0
@@ -58,6 +58,7 @@ enum { · 57 unmodified lines
5858 ETHTOOL_MSG_MM_GET,
5959 ETHTOOL_MSG_MM_SET,
6060 ETHTOOL_MSG_MODULE_FW_FLASH_ACT,
61+ ETHTOOL_MSG_PHY_GET,
6162
6263 /* add new constants above here */
6364 __ETHTOOL_MSG_USER_CNT,
@@ -111,6 +112,8 @@ enum { · 47 unmodified lines
111112 ETHTOOL_MSG_MM_GET_REPLY,
112113 ETHTOOL_MSG_MM_NTF,
113114 ETHTOOL_MSG_MODULE_FW_FLASH_NTF,
115+ ETHTOOL_MSG_PHY_GET_REPLY,
116+ ETHTOOL_MSG_PHY_NTF,
114117
115118 /* add new constants above here */
116119 __ETHTOOL_MSG_KERNEL_CNT,
@@ -1055,6 +1058,22 @@ enum { · 938 unmodified lines
10551058 ETHTOOL_A_MODULE_FW_FLASH_MAX = (__ETHTOOL_A_MODULE_FW_FLASH_CNT - 1)
10561059 };
10571060
1061+enum {
1062+ ETHTOOL_A_PHY_UNSPEC,
1063+ ETHTOOL_A_PHY_HEADER, /* nest - _A_HEADER_* */
1064+ ETHTOOL_A_PHY_INDEX, /* u32 */
1065+ ETHTOOL_A_PHY_DRVNAME, /* string */
1066+ ETHTOOL_A_PHY_NAME, /* string */
1067+ ETHTOOL_A_PHY_UPSTREAM_TYPE, /* u32 */
1068+ ETHTOOL_A_PHY_UPSTREAM_INDEX, /* u32 */
1069+ ETHTOOL_A_PHY_UPSTREAM_SFP_NAME, /* string */
1070+ ETHTOOL_A_PHY_DOWNSTREAM_SFP_NAME, /* string */
1071+
1072+ /* add new constants above here */
1073+ __ETHTOOL_A_PHY_CNT,
1074+ ETHTOOL_A_PHY_MAX = (__ETHTOOL_A_PHY_CNT - 1)
1075+};
1076+
10581077 /* generic netlink info */
10591078 #define ETHTOOL_GENL_NAME "ethtool"
10601079 #define ETHTOOL_GENL_VERSION 1