Skip to content

Commit

Permalink
interface: Introduce a method to test supported time stamping modes.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
  • Loading branch information
richardcochran committed Mar 4, 2020
1 parent 605abc4 commit 720c9fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
8 changes: 8 additions & 0 deletions interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

#endif

0 comments on commit 720c9fa

Please sign in to comment.