- 15 Oct, 2013 4 commits
-
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This is a rewrite of the configuration parser, more based on data structures se we'll soon be able to read more than one configuration file (to add special cases while developing) and protocol extensions will be able to extend the table of allowed options. Both the configuration file format and the layout of the code calling lib/conf.c::pp_config_file() is unchanged in this commit. This means that even if you enable config diagnostics on the command line it won't have effect, because the config file is parsed before the command line. This is fixed by a later commit. The only visible change in this commit is that "port" is allowed as a synonim for "link", to be deprecated soon (but it will not be removed from the parsing of the config file). Thus, pp_instance->link_name is renamed to port_name. The compiled size of this commit is the same as the previous one. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Also, add "config" to the list of diag things, to allow tracing config file errors (used in later commits). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 05 Oct, 2013 7 commits
-
-
Alessandro Rubini authored
This patch adds support for modifying the utc/tai offset. The "set" time operation, when called with a NULL pointer to the time structure, will do the operation in its own arch-specific way. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This adds support for the utc/tai offset. Unix, bare and wrs use UTC in system time and TAI in PTP frames. WR time is TAI as well, and wrpc-sw passes 0 as offset value when run as master. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Some fields are just statically there: avoid malloc and error checking Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This saves a few dozen bytes in wrpc-sw builds. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The 1588 standard talks extensively about "mean path delay" and the meanPathDelay variable. Even if the name is not the best one, we'd better rename the fields and variable. This is a massive change, but the currenct code has been validated at the Lemgo plug fest, and I don't expect any need to revert older patches at this point. I'm sorry for git-blame users, including myself, but this change is a step forward. I should have knonw better when choosing "one way delay" between the two names of the older code. Thanks to Aurelio for noting the problem. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 01 Oct, 2013 1 commit
-
-
Grzegorz Daniluk authored
-
- 24 Sep, 2013 3 commits
-
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 22 Sep, 2013 2 commits
-
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 20 Sep, 2013 6 commits
-
-
Alessandro Rubini authored
We want to turn PPS output on or off when it changes, not each and every time. This is both to avoid wasting CPU cycles and to allow developers to activate pps even when not synced or badly-synced. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This is the true and solid UDP support for WR. It manages both WR and non-WR communication, both as master and slave. The previous commit was wrong: 5c918341 wrs-socket: if UDP is requested, fall back to non-WR the reason is that we can't use Unix timestamps and WR time: to discipline the WR mechanism we need to collect WR timestamps. So now UDP is part of wrs-socket.c, to use the WR timestamps from hardware. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This split out of an helper to enable timestamping is needed to support the UDP protocol, in a later commit. No, it is not needed, but it's useful anyways. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Commit 06cb0670 time-wrs: implement time_set() is changin the seconds leaving the fractional part alone. However, the servo won't time-set again, but will rather converge, and this takes time. We now adjust nanoseconds first, so the servo will still notice a more-than-one-second error and will call our time-set again. Thus, we jump to proper time in a few seconds instead of slowly converging from far away. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 19 Sep, 2013 12 commits
-
-
Alessandro Rubini authored
We definitely need to take care of currentUtcOffset, but the current implementation was wrong: it only used it in modifying receive stamps, thus achieving completely wrong tuples. It's the receive function that must apply the utcOffset, or not, according to how it timestamps frames. Similarly, it's the time setting functions that must use utcOffset, or not, according to whether the time is utc (e.g.: unix) or tai (e.g.: wr). So this just removes a wrong attempt, waiting for good stuff to be written. Anyways, the utcOffset reported by the master is kept in data structures and passed over to slaves. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The servo is now using this bit, so it should be set by all stampers. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The non-wr servo calls time_set when the offset is more than 1second. However, we can't set the time, but we can force a big adjustment. So this code now adjusts the WR seconds, to reach a less-than-one-second error, to let the servo rthen converge with small adjustments. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
When offset from master is more than one second, the code used to time->get, subtract and then time->set. However, in white rabbit we cannot get the WR time and time->get returns the unix time instead. The only way to have hardware time is timestamping a frame. Thus, use the master's "T4" that we just received plus the one-way-delay as an approximation of the current hardware time. Later T1..T4 tuples will complete the fine synchronization. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Suggested by Aurelio and Maciej Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Grzegorz Daniluk authored
-
Alessandro Rubini authored
set to -1 all unused sockets, so FS_SET won't crash if, for example, we request UDP on a port with no IPV4 address, after the message: unix_open_ch: ioctl(SIOCGIFADDR): Cannot assign requested address While at it, I factorized some common code. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 18 Sep, 2013 5 commits
-
-
Alessandro Rubini authored
This commit factorizes some code in lib/conf.c from the two hosted startup files, but the aim is passing "-f <filename>" on the command line, to test with unconventional setups without touching the "real" filesystem. Now ppsi looks for the configuration file is from threee places, in this order: - command line, if any - architecture-specific, if any (e.g. "/wr/etc/ppsi.conf") - compile-time default ("/etc/ppsi.conf") Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The next commit makes a little order in startup files, and config file parsing ends up after all allocations, so we can't reply on ppg->nlinks to be properly set. In hosted environments we have no issues with a few kilobytes more, so allocate the max number of instances even if less are used. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
If we run both Ethernet and UDP services in a 18-port switch, we need 36 logical links. Thus, increase the previous limit of 32 to 64, knowing we have no serious memory constraints in hosted environments. The definition is moved to <ppsi/constants.h> as implementation-specific. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
When running a WR device as non-WR slave, we adjust the clock instead of the phase. When adjusting the counters, timestamps are reported as invalid until two increments of the "seconds" register. So, when T3 is not valid (tx stamp of delay_request), avoid running the non-WR servo. A later iteration of the slave FSM will work. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
When setting time, set Unix time as well. And when asking for the time, return Unix time if the WR inter process communication fails. Currently (and in all past history) the IPC call to get the time is not implemented, so we are sure we fail. But I keep it in place nonetheless in case we'll have it working in the future. Such time_get calls are mainly for timestamping the diagnostic messages anyways. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-