Commit Graph

323 Commits (04fe330e8125b0db4fc738085cc6a126232e78d9)

Author SHA1 Message Date
Richard Cochran 04fe330e81 pmc: support getting the parent data set.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 10:09:30 +01:00
Richard Cochran b9a6767b3d Respond to the parent data set management query.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 09:13:55 +01:00
Richard Cochran e21280ef77 Convert the parent data set TLV to and from host byte order.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 08:53:54 +01:00
Richard Cochran b30c841cde pmc: support getting the default data set.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 08:32:00 +01:00
Richard Cochran cc7c724eb0 Respond to the default data set management query.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 07:51:19 +01:00
Richard Cochran 2722b8587d Convert the default data set TLV to and from host byte order.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-01 08:27:45 +01:00
Richard Cochran 71c4bf203c Use the management message memory layout for the parentDS.
Reforming the data structure in this way will greatly simplify the
implementation of the management message for this data set.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-30 22:35:26 +01:00
Richard Cochran d60ccc7484 Use the management message memory layout for the defaultDS.
Reforming the data structure in this way will greatly simplify the
implementation of the management message for this data set.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-30 21:52:37 +01:00
Richard Cochran b26a36d493 Implement the NULL management message.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-30 20:26:22 +01:00
Richard Cochran 1516be04e2 Ignore management response messages.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-30 11:39:21 +01:00
Richard Cochran ae41fa0f68 udp: work around phyter quirk.
The phyter offers one step sync transmission, but it alters the UDP
checksum by changing the last two bytes, after the PTP payload. While this
is only standardized for IPv6, we will go with it for IPv4 as well, since
the phyter is the only hardware out there.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-30 11:34:29 +01:00
Richard Cochran b96e73994b Support one step sync operation.
The Linux kernel supports a hardware time stamping mode that allows
sending a one step sync message. This commit adds support for this mode
by expanding the time stamp type enumeration. In order to enable this
mode, the configuration must specify both hardware time stamping and set
the twoStepFlag to false.

We still do not support the one step peer delay request mechanism since
there is neither kernel nor hardware support for it at this time.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-30 11:34:29 +01:00
Richard Cochran 24385005b8 Enumerate the event codes for the transport layer transmission methods.
We add a new event code that indicates a one step event message.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-30 11:34:29 +01:00
Richard Cochran 4ef70c3d2e phc2sys: use the system offset method if available
We use the PTP_SYS_OFFSET ioctl method in preference to doing
clock_gettime from user space, the assumption being that the kernel space
measurement will always be more accurate.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-29 17:43:51 +01:00
Richard Cochran 36a5224b5a Add a method to estimate the PHC to system offset using the new ioctl.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-29 17:43:51 +01:00
Richard Cochran 60ca52a3fc readme: correct blackfin entry in the driver support matrix.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-28 08:32:40 +01:00
Richard Cochran 7662c450fc Document the udp6_scope configuration option in the man page.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-26 10:34:19 +01:00
Richard Cochran d83cd7283c udp6: add an option to set the multicast scope.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-25 20:30:14 +01:00
Richard Cochran f92f09f563 udp6: set the scope id when sending to link local addresses.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-25 19:24:27 +01:00
Richard Cochran 8e7a6da80c udp6: remember the interface index.
In order to set the scope id, we will need to know the interface index
before sending, in some cases.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-25 18:01:12 +01:00
Richard Cochran 87313fd05d Initialize the socket address structure to zero.
It is safer and more correct to clear the addresses before use. The IPv6
fields flowinfo and scope_id in particular should not be set to random
values from the stack.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-25 17:45:37 +01:00
Richard Cochran b8b96dd606 Tell about the make install target in the readme file.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-25 16:34:21 +01:00
Richard Cochran da2a26a4ca Update the readme for Linux kernel version 3.7.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-25 16:33:08 +01:00
Richard Cochran e6bbbb27e1 Fixup the Doxygen comment for the sk_ts_info struct.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-14 20:22:39 +01:00
Richard Cochran 72fd5b523d Fixup label defined but not used warning
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-14 20:22:25 +01:00
Jacob Keller a1b492aba9 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>
2012-11-14 20:22:17 +01:00
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 4e81072589 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>
2012-11-08 18:28:33 +01:00
Miroslav Lichvar ff547aeebb ptp4l: ignore empty lines and comments in config.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-11-08 18:21:26 +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 a373805b6d 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>
2012-11-08 18:17:31 +01:00
Miroslav Lichvar 022f203b11 makefile: add install target.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-11-08 18:17:30 +01:00
Miroslav Lichvar 23ebe82816 Add .gitignore.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-11-08 18:17:30 +01:00
Richard Cochran d1c65394c6 Add an acknowledgment in the readme for audioscience.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-11-01 19:44:13 +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
Miroslav Lichvar 2f3b9f718f Add man pages.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-11-01 19:35:09 +01:00
Richard Cochran ebe6a24bd7 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>
2012-10-29 20:10:02 +01:00
Richard Cochran 870873c7a7 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>
2012-10-29 20:09:54 +01:00
Richard Cochran 8dde0d31b6 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>
2012-10-29 20:06:00 +01:00
Miroslav Lichvar 7894339cdd Fix errors found by Coverity Static Analysis.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-10-18 19:58:40 +02:00
Miroslav Lichvar e3a9535dff 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>
2012-10-18 19:58:40 +02:00
Miroslav Lichvar 937f3aec5b Don't try calling SIOCETHTOOL on UDS.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-10-11 20:35:11 +02:00
Richard Cochran c6bb965f3d Remove obsolete links from the readme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-29 11:33:33 +02:00
Richard Cochran 675df82a29 Allow zero as a configured value for pi_offset_const.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-29 10:39:26 +02:00
Jacob Keller a15a0a0221 ptp4l: update the configuration files
this patch updates the default.cfg and gPTP.cfg to show the new defaults

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2012-09-29 06:24:44 +02:00
Jacob Keller b8160f2760 ptp4l: add maximum offset to pi servo
this patch modifies the pi servo to add a configurable max offset (default
infinity). When ever the detected offset is larger than this value, the clock
will jump and reset the servo state. The value of this feature is for decreasing
time to stabalize when clock is off by a large ammount during late running. This
can occur when the upstream master changes, or when the clock is reset due to
outside forces. The method used to reset clock is simply to reset the pi servo
to the unlocked state.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2012-09-29 06:24:44 +02:00
Jacob Keller 3464c9cfb4 ptp4l: add servo selection to the configuration file
this patch adds the servo selection to the configuration file

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2012-09-29 06:24:43 +02:00
Jacob Keller d951ba421f ptp4l: modify clock_create to take servo as argument
this patch modifies the clock_create to take the servo type as an argument

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2012-09-29 06:24:43 +02:00
Jacob Keller d67892abd7 ptp4l: modify servo setup to take an enum rather than string
passing a string as the servo type seems ugly when there are only a few
choices. This patch modifies the servo_create to take an enum instead.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2012-09-29 06:24:43 +02:00