Commit Graph

69 Commits (61de819d563157e05d095d52903b8577811f0d79)

Author SHA1 Message Date
Jacob Keller 004b62d22b 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>
2012-11-14 20:22:10 +01:00
Miroslav Lichvar 1a83619b17 phc2sys: add option to set slave-master time offset.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-11-08 18:17:31 +01:00
Miroslav Lichvar 3d599e2d5d phc2sys: update help message.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-11-01 19:35:10 +01:00
Miroslav Lichvar d0714a9fac phc2sys: add selecting clock by name.
This allows synchronization of a PHC to the system clock.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-11-01 19:35:10 +01:00
Jacob Keller a0fc92957f phc2sys: add sk.o to phc2sys for sk_interface_phc
This patch adds support for sk_interface_phc to lookup the /dev/ptpX device
using ethtool's get_ts_info ioctl

-v2-
* set ethdev to null initially
* rebased on top of phc2sys changes

-v3-
* fixed typo regarding slash

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2012-09-28 06:55:14 +02:00
Richard Cochran eb09fe01d7 phc2sys: refactor and rationalize the output messages.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-26 08:42:19 +02:00
Richard Cochran c890a4b935 phc2sys: disentangle the PPS loop from the read_phc loop.
The main loop has become a bit messy, mixing two completely disjunct code
paths. This patch separates the two use cases for the sake of clarity.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-25 20:09:58 +02:00
Richard Cochran 99d7c128a1 phc2sys: remove useless option.
The 'rdelay' option has been obsoleted by the newer read_phc() logic.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-25 20:09:58 +02:00
Richard Cochran 0ff2d47d61 phc2sys: remove unused variable.
The 'src' parameter to the do_servo() function is never used, so
remove it.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-25 19:39:50 +02:00
Miroslav Lichvar ce6533fd75 phc2sys: fix operation without -s option.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-09-20 09:55:27 +02:00
Miroslav Lichvar 6330764538 phc2sys: add options for number of PHC readings and update rate 2012-08-31 17:14:55 +02:00
Miroslav Lichvar bf21c7c6a9 phc2sys: improve servo start up 2012-08-31 17:14:55 +02:00
Miroslav Lichvar d42914c335 Improve stability of PHC reading in phc2sys.
Make five PHC readings in sequence and pick the quickest one.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-08-30 14:48:32 +02:00
Miroslav Lichvar 2fcf5cbb4f Add non-PPS mode to phc2sys.
As some PHC hardware/drivers don't provide PPS, it may be useful to keep the
system clock synchronized to PHC via clock_gettime(). While the precision
of the clock is only in microsecond range, the error seems to be quite stable.

The -d parameter now can be omitted if -s is provided.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-08-30 14:47:01 +02:00
Richard Cochran be87b05f52 Revert "Add non-PPS mode to phc2sys."
This reverts commit 998093b6f7.
Will apply this patch again, with the correct author info.
2012-08-30 14:45:50 +02:00
Richard Cochran 0a5caa8476 Revert "Improve stability of PHC reading in phc2sys."
This reverts commit f08d264e1d.
Will apply this patch again, with the correct author info.
2012-08-30 14:44:46 +02:00
Richard Cochran f08d264e1d Improve stability of PHC reading in phc2sys.
Make five PHC readings in sequence and pick the quickest one.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-08-29 15:29:56 +02:00
Richard Cochran 998093b6f7 Add non-PPS mode to phc2sys.
As some PHC hardware/drivers don't provide PPS, it may be useful to keep the
system clock synchronized to PHC via clock_gettime(). While the precision
of the clock is only in microsecond range, the error seems to be quite stable.

The -d parameter now can be omitted if -s is provided.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-08-29 15:29:43 +02:00
Richard Cochran af3cbb5fbd Add a tool to synchronize the system time from a PTP hardware clock.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-24 19:12:57 +01:00