- 14 Mar, 2013 11 commits
-
-
Alessandro Rubini authored
This moves some stuff between dump-main.c and dump-funcs.c, preparing for dump-funcs to be used within ppsi itself. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
pp_diag_allow(ppi, thing, level) can be used as a conditional to mask off diagnostic prints that cannot be individually written as pp_diag() (this mainly applies to frame dumping, introduced in later commits). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Since dump-funcs.c is going to be used within ppsi itself, print the empty separating lines, as well as the time difference from the previous frame in main, not in dumping functions. This has no effect on ptpdump itself, it's only a preparation for reuse of the code. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
When building freestanding we need to save space. Avoid printing pdelay messages that are neither sent nor used if received. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
I'm adding generic dump code to the receive and send code paths, so I need the length of the incoming frame when first "unpacking" it, to dump the whole frame using code from tools/dump-funcs.c Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This commit allows dump-funcs.c to be build from a freestanding environment. It uses __STDC_HOSTED__ to select what to include, and relies on "network_types.h" to fill the gaps. Such header is not part of this commit. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Include <ppsi/ieee1588_types.h> in tools/, like the rest of the code does. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This commit removes the "dest" argument to dumpstruct(), which now uses printf() and not fprintf(dest,). I plan to use these functions withing PPSi itself if the "frames" diagnostic level is 2, and I'd better avoid to hack around fprintf. ptpdump is not changed, as it already used dumpstruct() with stdout as destination. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
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
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>
-
- 12 Mar, 2013 3 commits
-
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Commit f9f487ff made ClockIdentity into a structure, but I didn't rebuild the tools, which are affected by the type definitions. This fixes the building of ptpdump. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 11 Mar, 2013 2 commits
-
-
Aurelio Colosimo authored
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 08 Mar, 2013 11 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
This simplifies the dataset_cmp a little more, and adds some comment. Nothing changes in the outcome of this commit but I'm unsure about the code (i.e about the original code). The specification says to compare *port* identities, but we are comparing clock identities instead. This is the same in the original ptpd, so if it is wrong it has always been. We'll be able to see what happens when checking with several masters, after porting ppsi to multi-link setup. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This replaces memcmp(a, b, PP_CLOCK_IDENTITY_LENGTH) with idcmp(a, b) and makes no other changes. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
We should use time operations instead. I forgot the protorype in the header, and now we fail the link step of wrpc-sw with ppsi. Bug introduced in 4b07d444, 106 commits ago. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
We don't have st_com_restart_annrec_timer any more, but I forgot to remove its prototype from the headers. This lead to a link failure in wrpc-sw with the ppsi submodule. But introduced in 415e530e, 96 commits ago. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
the field is used in wrpc-sw, so move it out of "#if 0". Bug introduced by e441b48b, 134 commits ago. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The code, when receiving announce, was setting a flag in order to run bmc at the next iteration, when that happened, the frame just received was discarded in favour for the programmed state update. This commits remove some fields and one helper function, so the new announce is immediately processed and no frame is lost. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
the portState field is probably a relic of ptpd, then the state machine was a single switch() statement. Many places were still setting it, but nobody was ever reading the field. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
There is no need for a "msg_tmp" in the pp-instance. All uses are really temporary to a function, so we can use local variables instead. (This is not the same as what was called tmp_header, which was referenced all over message processing, so it still exists, though renamed). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 07 Mar, 2013 13 commits
-
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
A large number of functions here got hdr and ann, but struct pp_frgn_master includes such fields, and most callers passed hdr and ann from the same structure. So I chose to pass a foreign master instead of the two components, but I'm still unable to remove the two full structures inside until I clean up the msg.c mess. So, at the end, this is not really a step forward, but it helps such later step. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Since WR only needs one byte of information in the announce structure, we can make is generic by calling it differently. This changes only the name (and the size: it is now unsigned long), but has no effect on the marshalling/unmarshalling of such data. I'm touching this because I'm working on announce messages (as related to foreign masters). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
I renamed port_identity to port_id so the compiler helped me. Then, since both fields are used at the same time, compare/copy them in a single shot. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The field was only to be set and reported, not really used. We definitely need a way to age potential masters, but counting announce messages without expiration is not the way. 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
Trivially, return what we have, becuase less than zero is less than zero. No, the wouldn't pass my exam. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
When the "if" branch returns, we don't need an "else" branch. These students wouldn't pass my exam. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
You may be bored by these small changes, but I want to show that I didn't introduce errors. In any case, each such change is reducing both entropy in the source and binary size in the output. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-