Commit Graph

941 Commits (4a8877f9046210291e83d2a939527b2505808c8c)

Author SHA1 Message Date
Richard Cochran c3119807a3 Add utility functions to get the software version string.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-10 15:11:51 +01:00
Richard Cochran 0c49d16244 Add a compile time version string definition.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-10 15:11:51 +01:00
Richard Cochran 02f5b741e7 Add a shell script to generate the version string.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-09 10:16:18 +01:00
Richard Cochran 480f9e7d7a pmc: show the flags from the default data set.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-04 16:03:33 +01:00
Richard Cochran c129d0ec95 pmc: fix missing include.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-04 14:36:01 +01:00
Richard Cochran 3710004596 pmc: reduce the message time out waiting for replies.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-04 14:27:25 +01:00
Richard Cochran 5b099afec7 pmc: show the port state as a string.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-04 14:26:50 +01:00
Richard Cochran 2aaae0854e Distinguish between get and set management requests.
The code previously treated all supported request as 'get' actions and
ignored the actual action field in the message. This commit makes the
code look at the action field when processing the requests.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-04 13:25:50 +01:00
Richard Cochran 502b52163c pmc: correct the integer format string wrt decimal verses hexadecimal.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-04 13:21:53 +01:00
Richard Cochran 2352c05a3b pmc: support getting the port data set.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 21:07:43 +01:00
Richard Cochran 0e244e7f36 Respond to the port data set management query.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 21:06:37 +01:00
Richard Cochran 970bc7f95c Maintain the peer mean path delay field of the port data set.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 20:48:29 +01:00
Richard Cochran 28c08dfac6 Convert the port data set TLV to and from host byte order.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 20:34:44 +01:00
Richard Cochran c101dafb18 pmc: support getting the time properties data set.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 20:13:06 +01:00
Richard Cochran 21840156c3 Respond to the time properties data set management query.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 18:57:38 +01:00
Richard Cochran 49a98c1fcf Convert the time properties data set TLV to and from host byte order.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 15:44:59 +01:00
Richard Cochran aa6708d09a Use the management message memory layout for the timePropertiesDS.
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-12-02 11:24:31 +01:00
Richard Cochran 61e1861e27 pmc: remove trailing spaces from format strings.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-12-02 10:13:15 +01:00
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