On Thu, Jan 13, 2022 at 01:54:51PM +0800, Hangbin Liu wrote:
> diff --git a/sk.c b/sk.c
> index 8be0708..f832d99 100644
> --- a/sk.c
> +++ b/sk.c
> @@ -66,6 +66,13 @@ static int hwts_init(int fd, const char *device, int
> rx_filter,
>
> init_ifreq(&ifreq, &cfg, device);
>
> +#ifdef HWTSTAMP_FLAG_BONDED_PHC_INDEX
Please move this idef to missing.h
If the flag is missing, then define it. That way, the program will
compile with support for the flag, even when the build machine headers
lack it.
> + cfg.flags = HWTSTAMP_FLAG_BONDED_PHC_INDEX;
> + /* Fall back without flag if user run new build on old kernel */
> + if (ioctl(fd, SIOCGHWTSTAMP, &ifreq) == -EINVAL)
> + init_ifreq(&ifreq, &cfg, device);
This test can be done unconditionally, without ifdef.
> +#endif
> +
> switch (sk_hwts_filter_mode) {
> case HWTS_FILTER_CHECK:
> err = ioctl(fd, SIOCGHWTSTAMP, &ifreq);
> --
> 2.31.1
>
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel