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
58 ETHTOOL_MSG_MM_GET,58 ETHTOOL_MSG_MM_GET,
59 ETHTOOL_MSG_MM_SET,59 ETHTOOL_MSG_MM_SET,
60 ETHTOOL_MSG_MODULE_FW_FLASH_ACT,60 ETHTOOL_MSG_MODULE_FW_FLASH_ACT,
61 ETHTOOL_MSG_PHY_GET,
61 62
62 /* add new constants above here */63 /* add new constants above here */
63 __ETHTOOL_MSG_USER_CNT,64 __ETHTOOL_MSG_USER_CNT,
@@ -111,6 +112,8 @@ enum { · 47 unmodified lines
111 ETHTOOL_MSG_MM_GET_REPLY,112 ETHTOOL_MSG_MM_GET_REPLY,
112 ETHTOOL_MSG_MM_NTF,113 ETHTOOL_MSG_MM_NTF,
113 ETHTOOL_MSG_MODULE_FW_FLASH_NTF,114 ETHTOOL_MSG_MODULE_FW_FLASH_NTF,
115 ETHTOOL_MSG_PHY_GET_REPLY,
116 ETHTOOL_MSG_PHY_NTF,
114 117
115 /* add new constants above here */118 /* add new constants above here */
116 __ETHTOOL_MSG_KERNEL_CNT,119 __ETHTOOL_MSG_KERNEL_CNT,
@@ -1055,6 +1058,22 @@ enum { · 938 unmodified lines
1055 ETHTOOL_A_MODULE_FW_FLASH_MAX = (__ETHTOOL_A_MODULE_FW_FLASH_CNT - 1)1058 ETHTOOL_A_MODULE_FW_FLASH_MAX = (__ETHTOOL_A_MODULE_FW_FLASH_CNT - 1)
1056};1059};
1057 1060
1061enum {
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
1058/* generic netlink info */1077/* generic netlink info */
1059#define ETHTOOL_GENL_NAME "ethtool"1078#define ETHTOOL_GENL_NAME "ethtool"
1060#define ETHTOOL_GENL_VERSION 11079#define ETHTOOL_GENL_VERSION 1