Parse the IFLA_DPLL_PIN nested attribute and display the associated DPLL pin ID in 'ip link show' detail output. This allows users to see which DPLL recovered clock pin is associated with a network interface without having to cross-reference with 'dpll pin show'. Example output: $ ip -d link show eth0 ... parentbus pci parentdev 0000:51:00.0 dpll-pin 4 Signed-off-by: Ivan Vecera --- ip/ipaddress.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 6017bc8370cb..bf470961182e 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "rt_names.h" #include "utils.h" @@ -1294,6 +1295,18 @@ int print_linkinfo(struct nlmsghdr *n, void *arg) "parentdev %s ", rta_getattr_str(tb[IFLA_PARENT_DEV_NAME])); } + + if (tb[IFLA_DPLL_PIN]) { + struct rtattr *dp[DPLL_A_PIN_MAX + 1]; + + parse_rtattr_nested(dp, DPLL_A_PIN_MAX, + tb[IFLA_DPLL_PIN]); + if (dp[DPLL_A_PIN_ID]) + print_uint(PRINT_ANY, + "dpll_pin", + "dpll-pin %u ", + rta_getattr_u32(dp[DPLL_A_PIN_ID])); + } } if ((do_link || show_details) && tb[IFLA_IFALIAS]) { -- 2.53.0