Don't try calling SIOCETHTOOL on UDS.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Explicitly set default values for all configurable options.

Make it easier to find out the compiled-in defaults in the code
and set all options in default.cfg.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Fix errors found by Coverity Static Analysis.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Pass transport type to time stamping initialization function.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Jiri Benc <jbenc@redhat.com>
Try two different HWTSTAMP options.

Start with the most general HWTSTAMP option. If that fails, fall back
to the option that best fits the interface's transport.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Jiri Benc <jbenc@redhat.com>
Remove useless option selecting layer 2 time stamping.

Now that the code automatically falls back to transport-specific time
stamping, this option is no longer needed.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Jiri Benc <jbenc@redhat.com>
Add man pages.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
phc2sys: add selecting clock by name.

This allows synchronization of a PHC to the system clock.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
phc2sys: update help message.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Add an acknowledgment in the readme for audioscience.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add .gitignore.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
makefile: add install target.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
ptp4l: increase default tx_timestamp_retries to 100.

It seems with some cards the current default of 2 is too small, increase
the number to prevent users from having to investigate the EAGAIN error
messages.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
phc2sys: add option to set slave-master time offset.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
ptp4l: ignore empty lines and comments in config.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
ptp4l: make config parser strict.

- fail on unknown options, bad values and other syntax errors
- fail with more than MAX_PORTS ports
- remove implicit global section
- add error messages

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
sk: change sk_interface_phc to sk_get_ts_info

this patch changes sk_interface_phc to sk_get_ts_info, by allowing the function
to store all the data returned by Ethtool's get_ts_info IOCTL in a struct. A new
struct "sk_ts_info" contains the same data as well as a field for specifying the
structure as valid (in order to support old kernels without the IOCTL). The
valid field should be set only when the IOCTL successfully populates the fields.

A follow-on patch will add new functionality possible because of these
changes. This patch only updates the programs which use the call to perform the
minimum they already do, using the new interface.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
ptp4l: use sk_get_ts_info to check timestamping mode

this patch uses the new sk_get_ts_info data to check whether the selected
timestamping mode is supported on all ports. This check is not run if the port
data isn't valid, so it will only fail if the IOCTL is supported. This allows
for support of old kernels that do not support the IOCTL to still work as expected.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Fixup label defined but not used warning

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Fixup the Doxygen comment for the sk_ts_info struct.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>