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
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
Richard Cochran
8f00d29265
Discover and utilize the initial clock frequency adjustment.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-22 11:30:50 +02:00
Richard Cochran
671358b21d
Warn if a slave only node is selected by the bmc.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-22 11:30:50 +02:00
Richard Cochran
6ce135eaac
Merge branch 'as2'
2012-09-20 12:59:27 +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
Delio Brignoli
1e6a169431
Do not expect or open a /dev/ptpX device when in free_running mode
...
Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
2012-09-15 10:59:49 +02:00
Richard Cochran
6c54c31dca
Introduce the time status management message.
...
This non-portable, implementation specific message is designed to inform
external programs about the relationship between the local clock and the
remote master clock.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-12 17:44:20 +02:00
Richard Cochran
f3b0ca69d3
trivial: fix a spelling error in a comment.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-12 17:30:37 +02:00
Richard Cochran
4e09ff8585
Introduce a helper function to convert from tmv to nanoseconds.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-12 17:30:37 +02:00
Richard Cochran
d4e761138e
bugfix: use a sensible test to detect a new master.
...
The code to detect a new master used pointer equality using a stale
pointer within the clock instance. Instead, the clock needs to remember
the identity of the foreign master in order to correctly detect a
change of master.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-12 17:30:36 +02:00
Miroslav Lichvar
9edd319f11
Use clock_adjtime from glibc if available.
...
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2012-09-06 08:23:21 +02:00
Richard Cochran
7a50ead1d0
bugfix: correct wrong type for the cumulativeScaledRateOffset field.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-04 09:21:02 +02:00
Richard Cochran
8f5bd0edda
Guard against divide by zero.
...
If a buggy driver or hardware delivers bogus time stamps, then we might
crash with a divide by zero exception.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-04 08:16:53 +02:00
Richard Cochran
35170cf6e4
Introduce a macro for the constant 2^41.
...
We are going to need this more than once for working with the
cumulativeScaledRateOffset fields.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-04 07:37:10 +02:00
Richard Cochran
8cc3433b8b
Add an implementation specific management code.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:28 +02:00
Richard Cochran
5ca99377b6
Be tolerant of wrong a OUI in the follow up information.
...
Certain AVB bridges send their own OUI instead of the offical one.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:27 +02:00
Richard Cochran
8a4b2ab9b8
Remove unnecessary wait state from frequency estimator.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:27 +02:00
Richard Cochran
843661dfa2
Calculate the master/local rate ratio in two ways.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:07 +02:00
Richard Cochran
e5edeacb9a
Extract the follow up info and pass it to the clock.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:07 +02:00
Richard Cochran
94dd186cdf
Add a clock method to receive the follow up information TLV.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:07 +02:00
Richard Cochran
f38338827b
Provide the clock with the estimated neighbor rate ratio.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:07 +02:00
Richard Cochran
5e40b5ec01
Estimate the neighbor rate ratio from a slaved port.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:07 +02:00
Richard Cochran
f86997185e
Give the frequency estimation interval to the port as well.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:07 +02:00
Richard Cochran
c06f3adc84
Differentiate between the E2E and P2P delay timeout intervals.
...
We have one timer used for both delay request mechanisms, and we ought
to set the message interval accordingly.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:07 +02:00
Richard Cochran
ace0d71a80
Adjust the peer delay request message interval field.
...
IEEE 802.1AS-2011 specifies using the current logMinPdelayReqInterval
for this field.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:06 +02:00
Richard Cochran
db36fb52ca
Reset the master/local frequency estimator when changing masters.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:06 +02:00
Richard Cochran
1bb8ebbdc5
Invert the frequency ratio estimation.
...
In 802.1AS-2011 the ratio is defined as master/local, so we should follow
suit.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-31 17:28:14 +02:00
Richard Cochran
829c785414
Rework the frequency ratio estimator to use the tmv functions.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-31 17:28:14 +02:00
Richard Cochran
95598b4fde
Provide a conversion function from tmv to double.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-31 17:28:14 +02:00
Richard Cochran
845e947bcb
Correct a comment about the frequency ratio estimation.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-31 17:28:14 +02:00
Richard Cochran
1925f07b3f
Fix copy-pasto in config file parsing of the logging level.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-31 17:28:14 +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
Richard Cochran
41ffd8dfb8
Add an acknowledgment in the readme of the hardware donors.
...
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-31 16:55:45 +02:00
Richard Cochran
28ac1cb1b1
Bring the readme up to date.
...
- all of the original goals have been implemented
- add gPTP to the list of supported features
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-30 14:55:35 +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