- 05 Mar, 2013 15 commits
-
-
Alessandro Rubini authored
fsm.c corrently decodes the received frame, and error management is built in (even if code in msg.c still needs to be audited to be more careful about rogue frames). However, when a received frame is in error, fsm.c cannot return to the caller because it doesn't know the current delay. Thus, zero the frame and call the current status, so we have back a recalculated ppi->next_delay. Meanwhile, mask with pp_verbose_frames the diagnostic message for received frames -- and be more careful with accessing it's data. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
A number of states were setting ppi->next_delay before re-setting it to a different value, or setting it on a state change (which now occurs immediately) Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
fsm states where we are waitiing for a frame or for a timeout, now correctly set next_delay to the right number of milliseconds. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The new function reports how many ms in the future is a timeout event, to be able to correctly time when we should re-entering the state machine and correctly spread our frames according to the specification. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The function is called by several states, but only state-slave is checking the delay request timeout. Thus, this commit removes the associated lines from the common function and moves them back to state-slave, the only state that issues delay_request frames. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
All archs allocated one foreign master, but the default was 5 and the command line could even change it. Hardwire the number to 5 and skip the allocation by folding the array in pp_instance itself. Anyways, the add_foreign() function needs serious review, later on. 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
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
the pp instance is bound to a network interface, so avoid a separate allocation. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 04 Mar, 2013 17 commits
-
-
Alessandro Rubini authored
By post-incrementing sent_seq we had a value that was not really the "last sent" as the comment claims. Thus, pre-increment it instead, so readers find the "last sent" value and don't need to subtract 1. 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
This commits removes all the additions and subtractions of the protocol offset. Now all recv and send functions, receive the pointer to the actual data being sent, be it the ptp payload or the transport header. This simplification (though based on the two internal pointers within ppsi -- se previous commit) fixed a long standing bug with bare architectures, that didn't receive the frames due to some related problem in offset calculation. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This changes some things to make code more readable (I really didn't know what the tmp_header was: now it is the "received_ptp_header". The commit simplifies allocation, because the tx and rx buffers are now part of ppi itself. We now have tx_ptp and tx_frame, both pointing within tx_buffer (and the same for rx). The pointers are the protocol side (aligned) and the argument passed to send/recv (which may be not be 4-aligned). At this point nothing changes, i.e. both gnu-linux flavours work and bare-i386 is not able to received.
-
Alessandro Rubini authored
Ethernet mode used to reset the time to the epoch. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This commit has no technical effect: what works still works, and what doesn't work still doesn't work. Still, the inlines will do type-checking at a later time when we have a structure for the ptp header. Moreover the renames allow me to trace all uses in order to change them; it also generates build errors in wrpc-sw, forcing me to fix the new use in there as well, when I update ppsi as submodule. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
All fields are zero at startup, unless explicitly inizialized by the caller. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This commit moves the time operations inside the instance. It allows to have different time operations for each instance, which will be useful in the future. For example, one ethernet card may White Rabbit, and another may not be. This commit, like moving network operations inside ppi, requires a change in wrpc-sw. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This is needed for the next commit, where time operations become local to the specific pp instance. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This commit moves the network operations inside the instance. It allows to have different operations for each instance, which will be useful in the future. For example, one ethernet card may have hardware timestamping and another may not. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This unifies all bare-linux common code. It's an out-of-context commit (as I'm not adding bare-arm today) but I prefer to avoid doing the same change twice in things that are going to change these days. BTW: this commit introduces no changes in the binary files generated, with the exception of a small difference between i386 and x86-64 in the receive buffer. This keeps the x86-64 version but i386 was not working anyways (and still doesn't work). That bug fix is in my queue, but I've other things to do first with ppsi. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
pp_timed_printf is a great resource, but we need to temporarily silence diagnostic printing in time_ops.get, in order to be able to tell stamping-related calls to just printf-related ones. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
I'm going to split diagnostics into groups based on flags. And with different diagnostics for each pp instance, to be ready to debug multi-link situations. This commit adds the flags in the proper places and the first flag value, used in the next commit. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Too many messages are confusing: let's make a state change more visible than a re-enter of the same state. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 02 Mar, 2013 8 commits
-
-
Alessandro Rubini authored
By moving calc_timeout into the time functions, we simplify the split-out of ./time-<arch> as a separate subdirectory. As a side effect, calc_timeout disappears from arch-wrpc, and wrpc-sw needs to be adapted to this commit, to provide it inside its own time_ops. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The structure was separately allocated with a size of 16. This avoids the alloc and makes the array the right size from the enum of message types. We thus a remove a number of magic "16" in the code. wrpc-sw must be updated too, in order to use this commit. There's still a problem: the code claims the number to be "last sent", but actually the value is incremented after sending. I'll need to pass again on this thing. ps: I changed name from "sent_seq_id" to "sent_seq" to the compiler complains for previous users, otherwise undetectable. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
We are not even trying to build the complete executable here, so remove crt0.S and any references to it. I forgot these pieces in commit arch-spec: removed unused source files which happened 101 commits ago. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
While some parameters are still there, for future use when we'll put back the pdelay mechanism, the default mechanism is clearly not pdelay, and incorrectly-used parameters are abetter removed. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Actually, there's no need to build with three pp_printf any more: we know pp_printf is sound. So let's just print once with "xint" pp_printf and once with all messages activated, so see the worst size we get to. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This fixes a bug introduced in 44deab24 (97 commits ago), where I split WR_DSPOR(ppi) out of DSPOR(ppi), but not all diagnostics has ever been built. Next commit fixes this, and allowed me to make this very fix. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
If the state just executed switched to a new state, we should enter that new stat immediately, and ignore ppi->next_delay. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The various "goto out" in case of error should report the error. We don't have them at this point, but they are better checked. And, at exit, there's not need to clear the timeouts. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-