Management messages can cause a change in the clock quality. If this
happens, then it is time to run the Best Master Clock algorithm again.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
This patch also replaces the hard coded logic for the UTC offset and the
time property flags with clock variables. This new clock state will be
used for adjusting the grand master attributes at run time.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
When running as grand master, the attributes of the local clock are not
known by the ptp4l program. Since these attributes may change over time,
for example when losing signal from GPS satellites, we need to have a
way to provide updated information at run time. This patch provides a
new TLV intended for local IPC that contains the required settings.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
While the userDescription field is implemented in the code, the same
option is not present in the sample configuration file. This patch
fixes the issue by adding the option with an empty default value.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Reported-by: Rohrer Hansjoerg <hj.rohrer@mobatime.com>
Whenever a port enters the passive state, it should act like a slaved
port in one respect. Incoming announce messages from the grand master
are supposed to reset the announce timer. This patch fixes the port
logic to properly maintain the passive state.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Reported-by: Rohrer Hansjoerg <hj.rohrer@mobatime.com>
This patch removes a redundant initialization of the kernel_leap clock
variable. The field is already set in clock_create a few lines earlier.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
You'd probably expect the body of GET messages to be empty, but
interpretation #29 in
http://standards.ieee.org/findstds/interps/1588-2008.html implies
otherwise. With this change, ptp4l will respond to GETs containing
either an empty dataField or a dataField whose length matches the
managementId. If present, the contents of the dataField are ignored.
Signed-off-by: Geoff Salmon <gsalmon@se-instruments.com>
This patch adds support for using the configured_pi_f_offset servo option to ptp4l.
If "pi_f_offset_const 0.0" is specified in the config file, stepping on the first
update is prevented. If any other positive value is specified, stepping on the
first update occurs when the offset is larger than the specified value.
change since v1
- add the new option to default.cfg and gPTP.cfg
Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
Current pi servo steps clock without any condition on start.
This patch adds a new servo option "configured_pi_f_offset". The option is similar
to configured_pi_offset but only affects in the first clock update. Therefore,
if this option is set as 0.0, we can prevent clock step on start.
The new servo option can be specified from phc2sys by using -F option.
This feature is usefull when we need to restart phc2sys without system
clock jump. Restarting phc2sys is needed to change its configuration.
changes since v2:
- manual page fix.
- also apply max_offset along with max_f_offset in servo step1.
- add a variable to check if first update is done.
changes since v1:(http://sourceforge.net/mailarchive/message.php?msg_id=31039874)
- remake as a new servo option.
Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
Options without parameters are now grouped together at the beginning of line
for better legibility.
Signed-off-by: Libor Pechacek <lpechacek@suse.cz>
Cc: Miroslav Lichvar <mlichvar@redhat.com>
The get_ranged_ and get_arg_ declarations and definitions are just a wee
bit much too long. This patch breaks the overly long lines into two.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Ever since upgrading to Debian 7.0, building linuxptp results in an
annoying error message. This is due to the fact that the directory
/usr/include/bits is no longer present, but our makefile expects it
to exist. This patch fixes the issue by telling grep not to complain
about missing files.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
phc_open() can open any device and return clkid even if the device is not phc
for example /dev/kvm and so on.
As a result, phc2sys keeps running with reading bogus clock as below:
# phc2sys -s /dev/kvm -O 0 -q -m
phc2sys[687019.699]: failed to read clock: Invalid argument
phc2sys[687020.699]: failed to read clock: Invalid argument
phc2sys[687021.699]: failed to read clock: Invalid argument
phc2sys[687022.699]: failed to read clock: Invalid argument
...
This patch fixes that problem.
Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
This patch adds functions to get int, uint, double value from string
with error checking and range specification.
These functions don't allow overflow and outside of the range values.
In addition, it adds parser_result cases "MALFORMED" and "OUT_OF_RANGE" to make
reason of parse error more clear.
Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
The default zero offset can lead to misalignment between system clocks or wrong
time to be broadcast to the domain. Therefore we require setting offset upon
invocation.
Signed-off-by: Libor Pechacek <lpechacek@suse.cz>
When a new master is selected, drop the old path delay and don't
calculate the offset until the delay is measured again with the new
master.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
This patch updates phc2sys usage reporting to give a slightly better indication
of why the program was unable to run.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
This patch modifies phc2sys to enable the use of interface names in clock_open
rather than having to do that by hand. This enables cleaner use of the -s and -c
options as they can accept interface names. This also enables the user to set
the slave clock by network interface as well.
-v2-
* fix clock_open as it used device instead of phc_device in the final call to phc_open
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
[RC: use CLOCK_MONOTONIC as suggested on the list.]
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Fix the check for supported timestamping modes. The device needs
to support all the required modes, not just any subset of them.
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
PPS output from a PHC has to be enabled by PTP_ENABLE_PPS ioctl. Call
the ioctl when both PHC device and PPS device are specified and PPS is
supported by the PHC.
Signed-off-by: Jiri Benc <jbenc@redhat.com>
This patch simplifies some expressions which validate that configuration
variables are within the allowed ranges.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
The option sets an additional limit to the hardware limit. It's disabled
if set to zero. The default is 900000000 ppb.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>