Commit Graph

9 Commits (master)

Author SHA1 Message Date
Jacob Keller 226c285ec4 phc_ctl: display all capability information
The capability command for phc_ctl does not display the number of pins
or the cross timestamping support. Add this as output so that the user
can see the complete device capabilities.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2020-08-05 18:48:33 -07:00
Christian Eggers 7de73fefc3 Fix printf if time_t is long long
On some platforms, time_t has recently switched from "long" to "long
long" [1]. For these platforms it is necessary to use "%lld" as printf
format specifier because the ABI differs between "long" and "long long".

I found no way for creating something similar to PRId64 for time_t. No
idea how to determine whether it's "long" or "long long". So I cast
everything to "long long" instead.

[1] https://git.musl-libc.org/cgit/musl/commit/?id=38143339646a4ccce8afe298c34467767c899f51

Signed-off-by: Christian Eggers <ceggers@arri.de>
2020-06-02 07:36:21 -07:00
Richard Cochran dde0bf2e28 Balance the posix clock open function with a close method.
The one user of the function, posix_clock_open(), simply open codes
the closing call to phc_close().  This patch provides a method to
balance closing and opening of a posix clock.  In addition, the
phc_ctl program never explicitly closed the opened clock, and so this
patch adds the missing call.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2020-03-21 04:36:10 -07:00
Richard Cochran d32758aa09 phc2sys, phc_ctl: Re-factor common code.
The two programs, phc2sys and phc_ctl, use nearly identical subroutines to
open an instance of a dynamic posix clock.  In anticipation of yet a third
program with similar needs, this patch refactors the common code into the
utilities.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2019-08-25 12:19:36 -07:00
Miroslav Lichvar 93baf34adb sysoff: Extend API for different sysoff methods.
The kernel supports different PTP_SYS_OFFSET* ioctls. Use the sysoff
enum to allow selecting between them in sysoff_measure().

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2019-01-06 20:50:40 -08:00
Miroslav Lichvar d08bee2771 Fix -Wformat-overflow warnings.
Two warnings were observed with gcc-8.1.1.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2018-08-12 13:29:39 -07:00
Miroslav Lichvar d513ecac9c phc_ctl: fix adj command to accept negative offset.
When parsing the argument, the minimum value should be -DBL_MAX instead
of DBL_MIN, which is the smallest positive value.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2017-10-14 05:51:43 -07:00
Miroslav Lichvar 48046e593e Don't include config.h in util.h
The config module is used by ptp4l only, but util is shared with other
programs.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2014-10-03 14:25:19 +02:00
Jacob Keller bdb6a35883 linuxptp: add phc_ctl program to help debug PHC devices
This is an updated version of a script I wrote a couple years ago for
debugging the PHC when writing a new driver. I figured that it might be
handy for the LinuxPTP project to include, as it can give some insight
into the PHC directly. I have updated it to make use of the shared code
here, in order to reduce duplication. Hopefully this is of some use to
everyone.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2014-07-19 07:15:24 +02:00