On 2/11/2020 6:04 AM, Richard Cochran wrote:
> Signed-off-by: Richard Cochran <richardcoch...@gmail.com>

Reviewed-by: Jacob Keller <jacob.e.kel...@intel.com>

> ---
>  interface.c | 8 ++++++++
>  interface.h | 8 ++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/interface.c b/interface.c
> index 7a3eddc..74a2512 100644
> --- a/interface.c
> +++ b/interface.c
> @@ -47,3 +47,11 @@ bool interface_tsinfo_valid(struct interface *iface)
>  {
>       return iface->ts_info.valid ? true : false;
>  }
> +
> +bool interface_tsmodes_supported(struct interface *iface, int modes)
> +{
> +     if ((iface->ts_info.so_timestamping & modes) == modes) {
> +             return true;
> +     }
> +     return false;
> +}
> diff --git a/interface.h b/interface.h
> index 3526a48..32eec7b 100644
> --- a/interface.h
> +++ b/interface.h
> @@ -82,4 +82,12 @@ void interface_set_name(struct interface *iface, const 
> char *name);
>   */
>  bool interface_tsinfo_valid(struct interface *iface);
>  
> +/**
> + * Tests whether an interface supports a set of given time stamping modes.
> + * @param iface  The interface of interest.
> + * @param modes  Bit mask of SOF_TIMESTAMPING_ flags.
> + * @return       True if the time stamping modes are supported, false 
> otherwise.
> + */
> +bool interface_tsmodes_supported(struct interface *iface, int modes);
> + 

Good, the documentation comment indicates modes is a bitmask. In
otherwords, interface_tsmodes_supported can return true if modes is a
subset of the supported interface modes.

Ok.

>  #endif
> 


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to