- 21 Mar, 2013 4 commits
-
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This commit removes the part of wrpc.h that is not used. It was there when we tried to build a main function in ppsi itself, but now we depend on the exteranl wrpc-sewpackage to provide drivers and headers, so wrpc.h is now just for local material. Then, wrc_ptp_ppsi.c is fixed with regard to globals and all the rest. Moreover, I moved most of the initialization of static variables into compile-time assignments instead of run-time, since there's nothing dynamic here in those fields. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
I forgot to fix arch-wrpc when making the time_ops. Code mainly by Tomasz (wrpc-sw/shell/cmd_time.c) Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 20 Mar, 2013 3 commits
-
-
Alessandro Rubini authored
This new file needs some updates over what we imported from wrpc-sw, because we now have pp_globals (in preparation for multi-link, thanks Aurelio). The commit also makes a little order in the inclusions of this file, removing unneeded stuff and grouping hardware-related headers. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
These few lines are a copy of "wrc_ptp.h" as found in ptp-noposix. They are added here because they are the prototypes of now-local functions, and little more. Including the file from wrpc-sw would have required another -I directory, and I'd better not. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This file comes from commit e00d99f of wrpc-sw. It used to live there as an alternative to wrc_ptp_noposix.c, as a top-level entry point to the ptp engine. However, ppsi is quite a moving target these months, and most improvements in modularity of ppsi require a change in the top-level file (like we change the main and startup files in the other architectures). Thus, this commit brings the file into ppsi (and wrpc-sw will remove it when using this version of ppsi as submodule) so we can be work on this repository and build-test everything with no effort, saving us from always committing to wrpc-sw as well. Note: this commit copies the file unchanged, and doesn't even try to build it; later commits make the required adjustments to finally build it. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
- 19 Mar, 2013 8 commits
-
-
Alessandro Rubini authored
While building under ubuntu-12.04 (64 bits, at least), bare builds were failing because of undefined "__stack_chk_fail" and "__strcpy_chk". The former is fixed by passing -ffreestanding to the build of pp_printf (i.e., we now export CFLAGS in the toplevel Makefile), amd the latter is fixing by preventing use of the inline printf function when building for bare architectures. This is from the manpage of gcc under ubuntu-12.04: NOTE: In Ubuntu 8.10 and later versions, -D_FORTIFY_SOURCE=2 is set by default, and is activated when -O is set to 2 or higher. This enables additional compile-time and run-time checks for several libc functions. To disable, specify either -U_FORTIFY_SOURCE or -D_FORTIFY_SOURCE=0. Thanks Aurelio for reporting ./MAKEALL was failing. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This was an error on my side. The result may be undefined in "ntohs(++x)". It had not bad effects so far, but newer compilers correctly warn about it, and this commit fixes the error. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This fixes warnings that either come from a newer compiler than what I routinely use or from building in a 64-bit host. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Our "eval export CC=" needs an exta quoting level under dash, to prevent an error like the following: export: 1: -m32: bad variable name This setup still works under bash. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
When calculating the running average (and the average between two as well), we must first add all items and then divide. Everyone does like this, so we should as well, to avoid loosing the low bits Example: 3 and 5, average is 4: (3+5) / 2 = 4, but 3/2 + 5/2 = 3. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This only has effects on diagnostics: now all exit paths from pp_update_clock() pass through the diagnostics stanza. I also removed a duplicate diagnostic message and a now-unneeded else, so the good code is at the first indentation level. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 18 Mar, 2013 15 commits
-
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
No functional change at all, just rename and make var name shorter. Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Alessandro Rubini authored
This removes some needless local variables related to correction field, but relying on a new "cField" entry in pp_instance, near the t1,t2,t3,t4 status stamps. The commit also adds a FIXME note: it is not clear to me how the correction field can be managed in the back message (t3, t4). Since the correctionField is updated by transparent clocks, I think we need the one of the delay request (the one stamped in t3, t3), *not* the delay response that I don't care about. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
For two-step masters, the code was adding the correction fields of sync and follow-up. This is wrong, since the follow-up message only carries the sender's timestamp for sync. So, the only correction to consider is the one in sync (which accounts for transparent clocks the frames passed through). The approach taken is promoting the current correction to be a ppi field (like t1..t4), while killing the other "temporary" field that was used before this commit to keep the value that was going to be added. Note, however, that how cField is used in the back path (t3,t4) is not clear to me, and the specification is not helping: if the correction is automatically updated by transparent clocks in my path, the master should send back to me the value it received for my delay request. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
I initially looked at int64_to_TimeInternal to swap arguments, since to_TimeInternal as timeinternal (the output) as first argument, and they appeared in pairs. However, int64_to_TimeInternal is only used for correction fields, and they are scaled nanoseconds (page 126), not nanoseconds. Thus, this commit fixes the conversion and renames the function to "cField_to_TimeInternal" to better tell the reader what it is. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
While getting mad with servo.c (which makes little sense to me), and continuously following the long unseless indented stanza of pp_update_delay() I finally decided to kill it. This kills another similar situation, but each of these changes makes no effect on the program flow, only simplifies code as written. You can diff with "-w" to verify I don't change code. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Now that it's clear pp_update_offset() receives t1 and t2, which are fields of ppi itself, avoid passing them. However now it's clear that this function might be seriously wrong, and needs review (ofst_first_updated should die, I think, preferring simply code to unneeded contortions). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This uses the "t1" field, introduced two commits ago, instead of local variables in the functions handling sync/follow_up. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This commit simply reorders the TimeInternal fields of pp_instance, to make the structure more understandable. It also adds t1 that will be used by a later commit. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This renames sync_receive_time to t2, delay_req_send_time to t3 and delay_req_receive_time to t4 (there is "t1" field in ppi yet). Such naming is what the official documents use everywhere, so it's better to respect that naming, that everybody in the field is familiar with. Besides, they are shorter and they can be used unchanged for pdelay operations (the previous pdelay implementation we inherited from ptpd, used a separate set of fields that are not really needed). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 16 Mar, 2013 1 commit
-
-
Aurelio Colosimo authored
This patch introduces struct pp_globals in include/ppsi/pp-instance.h and starts using it in arch-gnu-linux. Actually, the behaviour does not change yet, and only one interface is taken into account. In main-loop.c there is a proposal for interfaces enumeration, based on runtime env variables: - one PPROTO_IF_NUM (number of interfaces); - many PPROTO_IF_XX (each one defining an interface name). Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
- 14 Mar, 2013 9 commits
-
-
Alessandro Rubini authored
This includes the functionality of tools/ptpdump inside the ppsi executable. Each net_ops->send and net_ops->recv must call the dumping functions (gnu-linux and bare-* already to in this branch; arch-wrpc does not, and I'll all it later).
-
Alessandro Rubini authored
I don't want to declare globals in header files by error (see previous commit). So I'd better use this flag to request "multiple definition" errors at build time. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The new diagnostics for frame input/output, based on tools/dump-funcs.c, reports all information, more orderly. The diagnostic prints in msg.c are thus duplicates (provided all architectures use the new diagnostics in ->recv), and this commit removes them. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
In commit 7c14152c I removed some typedef, in my quest for getting rid of them. But I forgot to remove the type name, so we got "TLV" and similar global variables in the object files. This fixes the buglet, then I add -fno-common to prevent this for happening againg. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Like what I did in two commits ago, now if debug level for "frames" is 2 or more, net_ops->send and net_ops->recv now dump the data to stdout. The format is the same of tools/ptpdump, but the time is not showing the local time, as we miss localtime() and I don't want to waste time recoding it. This is an example of a bare-i386 slave requesting its master: send: TIME: (1363278286 - 0x5141f9ce) 1363278286.52969000 send: ETH: 88f7 (00:25:11:86:1f:d2 -> 01:1b:19:00:00:00) send: VERSION: 2 (type 1, len 44, domain 0) send: FLAGS: 0x0002 (correction 0x00000000) send: PORT: 00-25-11-ff-fe-86-1f-d2-00-01 send: REST: seq 2, ctrl 1, log-interval 127 send: MESSAGE: (E) DELAY_REQ send: MSG-DELAY_REQ: 1363278286.052689000 send: DUMP: payload (size 44) send: DUMP: 81 02 00 2c 00 00 02 00 00 00 00 00 00 00 00 00 send: DUMP: 00 00 00 00 00 25 11 ff fe 86 1f d2 00 01 00 02 send: DUMP: 01 7f 00 00 51 41 f9 ce 03 23 f8 68 diag-frames-1-eth0: SENT 44 bytes at 1363278286.052969000 (delay_req) This is a bare-i386 master receiving the same frame: recv: TIME: (1363278286 - 0x5141f9ce) 1363278286.92899000 recv: ETH: 88f7 (00:25:11:86:1f:d2 -> 01:1b:19:00:00:00) recv: VERSION: 2 (type 1, len 44, domain 0) recv: FLAGS: 0x0002 (correction 0x00000000) recv: PORT: 00-25-11-ff-fe-86-1f-d2-00-01 recv: REST: seq 2, ctrl 1, log-interval 127 recv: MESSAGE: (E) DELAY_REQ recv: MSG-DELAY_REQ: 1363278286.052689000 recv: TLV: too short (46 - 44 = 2) recv: DUMP: payload (size 46) recv: DUMP: 81 02 00 2c 00 00 02 00 00 00 00 00 00 00 00 00 recv: DUMP: 00 00 00 00 00 25 11 ff fe 86 1f d2 00 01 00 02 recv: DUMP: 01 7f 00 00 51 41 f9 ce 03 23 f8 68 00 00 diag-frames-1-eth0: RECV 46 bytes at 1363278286.092899000 (type 1) And this is tools/ptprump running on the master, for the same frame: TIME: (1363278286 - 0x5141f9ce) 17:24:46.092814 ETH: 88f7 (00:25:11:86:1f:d2 -> 01:1b:19:00:00:00) VERSION: 2 (type 1, len 44, domain 0) FLAGS: 0x0002 (correction 0x00000000) PORT: 00-25-11-ff-fe-86-1f-d2-00-01 REST: seq 2, ctrl 1, log-interval 127 MESSAGE: (E) DELAY_REQ MSG-DELAY_REQ: 1363278286.052689000 TLV: too short (46 - 44 = 2) DUMP: payload (size 46) DUMP: 81 02 00 2c 00 00 02 00 00 00 00 00 00 00 00 00 DUMP: 00 00 00 00 00 25 11 ff fe 86 1f d2 00 01 00 02 DUMP: 01 7f 00 00 51 41 f9 ce 03 23 f8 68 00 00 Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This file includes data structures that are needed by tools/dump-funcs.c to be built in freestanding environments. It is included by ptpdump.h, but only for freestanding builds. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
If debug level for "frames" is 2 or more, net_ops->send and net_ops->recv now dump the data to stdout. The format is the same of tools/ptpdump, with "send:" and "recv:" in front. This is an example: send: TIME: (1363277414 - 0x5141f666) 17:10:14.748281 send: VERSION: 2 (type 11, len 64, domain 0) send: FLAGS: 0x0002 (correction 0x00000000) send: PORT: 00-22-15-ff-fe-d7-c0-ef-00-01 send: REST: seq 9, ctrl 5, log-interval 1 send: MESSAGE: (G) ANNOUNCE send: MSG-ANNOUNCE: stamp 0.000000000 send: MSG-ANNOUNCE: grandmaster-quality f8-fe-60f0 send: MSG-ANNOUNCE: grandmaster-prio 248 248 send: MSG-ANNOUNCE: grandmaster-id 00-22-15-ff-fe-d7-c0-ef send: DUMP: payload (size 64) send: DUMP: 8b 02 00 40 00 00 02 00 00 00 00 00 00 00 00 00 send: DUMP: 00 00 00 00 00 22 15 ff fe d7 c0 ef 00 01 00 09 send: DUMP: 05 01 00 00 00 00 00 00 00 00 00 00 00 00 11 f8 send: DUMP: f8 fe f0 60 f8 00 22 15 ff fe d7 c0 ef 00 00 a0 diag-frames-1-eth0: SENT 64 bytes at 1363277414.748281517 (announce) And this is the same frame in the other host: recv: TIME: (1363277414 - 0x5141f666) 17:10:14.691032 recv: VERSION: 2 (type 11, len 64, domain 0) recv: FLAGS: 0x0002 (correction 0x00000000) recv: PORT: 00-22-15-ff-fe-d7-c0-ef-00-01 recv: REST: seq 9, ctrl 5, log-interval 1 recv: MESSAGE: (G) ANNOUNCE recv: MSG-ANNOUNCE: stamp 0.000000000 recv: MSG-ANNOUNCE: grandmaster-quality f8-fe-60f0 recv: MSG-ANNOUNCE: grandmaster-prio 248 248 recv: MSG-ANNOUNCE: grandmaster-id 00-22-15-ff-fe-d7-c0-ef recv: DUMP: payload (size 64) recv: DUMP: 8b 02 00 40 00 00 02 00 00 00 00 00 00 00 00 00 recv: DUMP: 00 00 00 00 00 22 15 ff fe d7 c0 ef 00 01 00 09 recv: DUMP: 05 01 00 00 00 00 00 00 00 00 00 00 00 00 11 f8 recv: DUMP: f8 fe f0 60 f8 00 22 15 ff fe d7 c0 ef 00 00 a0 diag-frames-1-eth0: RECV 64 bytes at 1363277414.691032726 (type b) This is what I got for the same frame in a ptpdump running in the master. TIME: (1363277414 - 0x5141f666) 17:10:14.748376 ETH: 0800 (00:22:15:d7:c0:ef -> 01:00:5e:00:01:81) IP: 17 (192.168.16.1 -> 224.0.1.129) len 92 UDP: (320 -> 320) len 72 VERSION: 2 (type 11, len 64, domain 0) FLAGS: 0x0002 (correction 0x00000000) PORT: 00-22-15-ff-fe-d7-c0-ef-00-01 REST: seq 9, ctrl 5, log-interval 1 MESSAGE: (G) ANNOUNCE MSG-ANNOUNCE: stamp 0.000000000 MSG-ANNOUNCE: grandmaster-quality f8-fe-60f0 MSG-ANNOUNCE: grandmaster-prio 248 248 MSG-ANNOUNCE: grandmaster-id 00-22-15-ff-fe-d7-c0-ef DUMP: payload (size 64) DUMP: 8b 02 00 40 00 00 02 00 00 00 00 00 00 00 00 00 DUMP: 00 00 00 00 00 22 15 ff fe d7 c0 ef 00 01 00 09 DUMP: 05 01 00 00 00 00 00 00 00 00 00 00 00 00 11 f8 DUMP: f8 fe f0 60 f8 00 22 15 ff fe d7 c0 ef 00 00 a0 Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This is oh so boring, but I need to differentiate send from receive when dumping from withing ppsi itself. This is a long patch that has no effect on tools/ptpdump, since it pases the empty string as prefix. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-