Re: [Linuxptp-devel] [PATCHv1 2/4] rtnl: Add function to detect virtual clocks.
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Richard C. <ric...@gm...> - 2022-02-03 19:36:30
|
On Thu, Feb 03, 2022 at 12:50:06PM +0100, Miroslav Lichvar wrote: > Add a function using ethtool netlink to check whether a PHC is a virtual > clock of an interface. > > Signed-off-by: Miroslav Lichvar <mli...@re...> > Acked-by: Hangbin Liu <liu...@gm...> > --- > rtnl.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > rtnl.h | 9 +++++++ > 2 files changed, 92 insertions(+) > > diff --git a/rtnl.c b/rtnl.c > index f8bdbe6..a0cf494 100644 > --- a/rtnl.c > +++ b/rtnl.c > @@ -19,6 +19,7 @@ > #include <asm/types.h> > #include <sys/socket.h> /* Must come before linux/netlink.h on some systems. */ > #include <linux/netlink.h> > +#include <linux/ethtool_netlink.h> > #include <linux/rtnetlink.h> > #include <linux/genetlink.h> > #include <linux/if_team.h> > @@ -465,3 +466,85 @@ no_info: > nl_close(fd); > return index; > } > + > +static int search_vclocks(struct rtattr *attr, int phc_index) Nit: please prefix with rtnl_ Thanks, Richard |