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