Software for White Rabbit PTP Core:d4c72f473af3ebe55f00ceda1e81f01de2fa57e8 commitshttps://ohwr.org/project/wrpc-sw/commits/d4c72f473af3ebe55f00ceda1e81f01de2fa57e82016-04-04T10:27:14Zhttps://ohwr.org/project/wrpc-sw/commit/d4c72f473af3ebe55f00ceda1e81f01de2fa57e8vlan: add "vlan off" command, switch pfilter rule-set at runtime2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.com
This allows a node built with CONFIG_VLAN to choose at run-time
whether vlans are allowed or not. We build both pfilter rule-sets,
and according to the active vlan number we write one or the other.
The case "CONFIG_VLAN is not set" is handled by providing default
NULL pointers for beginning and end of the vlan rule-set.
As a side effect, I renamed the files and the functions in
the pfilter-builder.
This is how it works for me, with CONFIG_PFILTER_VERBOSE set,
so you see different rule-set are used (29 rules vs. 16 rules):
wrc# vlan set 0
0 ("0") out of range
Command "vlan": error -22
wrc# vlan off
fixing MAC adress in rule: use 22:33:44:55:66:77
pfilter rule 00: 4.00000000
pfilter rule 01: 1.e4466013
[...]
pfilter rule 28: 8.00000000
current vlan: 0 (0x0)
wrc# ip set 10.0.0.2
IP-address: 10.0.0.2 (static assignment)
(and I am now reachable by untagged frames)
wrc# vlan set 10
fixing MAC adress in rule: use 22:33:44:55:66:77
fixing VLAN number in rule: use 10
pfilter rule 00: 4.00000000
pfilter rule 01: 1.e4466013
[...]
pfilter rule 15: 8.00000000
current vlan: 10 (0xa)
(and I am now reachable on vlan 10)
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>
Conflicts:
Makefilehttps://ohwr.org/project/wrpc-sw/commit/ab7cb86755c7db144b476463201952e56cb136b2shell: implement vlan command2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.com
This allows a run-time change of the active vlan, if CONFIG_VLAN is
active at build time. The pfilter rules are being rewritten every
time the vlan is changed (and we have one VLAN only for the CPU).
wrc# vlan set 0
0 ("0") out of range
Command "vlan": error -22
wrc# vlan set pippo
0 ("pippo") out of range
Command "vlan": error -22
wrc# vlan
current vlan: 10 (0xa)
wrc# vlan set 20
current vlan: 20 (0x14)
wrc# ip set 192.168.20.2
IP-address: 192.168.20.2 (static assignment)
(and the node now replies to ping on vlan 20)
wrc# vlan set 10
current vlan: 10 (0xa)
wrc# ip set 192.168.10.2
IP-address: 192.168.10.2 (static assignment)
(and the node now replies to ping on vlan 10)
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/33fcb1c08378fb8bb61093581c72d43dd0f89ed6pfilter: patch filter rules at run time for VLAN number2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/a444be3e037223ee23d8bd28d2b39897dc5e1462vlan: add one VLAN in Kconfig as an option2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.com
WARNING: wr_switch_defconfig doesn't build, this is fixed in next commit
Unfortunately this commit makes the internal communication between
minic and lan asymmetric: on receive the tag is discarded (and the
longer header falls into the payload) while on transmit it must be
provided by lan.c.
The reason is that on receive we can trim 4 bytes from the payload,
but on send we can't add 4 bytes without a memmove. The functions
receive pointers to two different header structures, so hopefully
user errors will be signalled by the compiler.
Still, users interact with net.c, which hides vlan completely from
them.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/52ec2a3808fd84b396e646af821a2eede671eeb1net: define wr_ethhdr and use it (no change)2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.com
We used to have "struct ethhdr" local in net.c, passing "void *hdr" to
minic. We exports the structure to an header so to use it in
communicating with the minic. Unfortunaltey, ethhdr is defined elsewhere
too, so we'd better rename to wr_ethhdr.
This is a step towards the introduction of vlans, but has no technical
effect by itself.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/dd612fb9373a542d65fffc378e08407c5efd7973add pfilter_verbose, selected by Kconfig (developer mode)2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.com
Also, this changes how to mac address is retrieved in patching pfilter
rules. I'd better use format_mac(get_mac) for the verbose message,
so get_mac is also the source for patching the rules.
register and get_mac/set_mac are guaranteed to be in-sync.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/22f24ec4b23e8542fc3112bbc93056179c333b5asyslog: report track-phase losses2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/5380a0feefae7cf273ba0fc4ce7c45b7187e9ce1ppsi/wr-servo: loose track-phase when ckoffset is big2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/6ca25c562791b5c3b813983deaa8aa2d08e17ad3ppsi: new master2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.com
This includes a wrs fix by Maciej and a change that prevents warning
when bulding with CONFIG_HOST_PROCESS (which is not there yet). I
prefer to merge this now, so the next commit picks only its own little
change into the ppsi submodule.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/ce0af021eb1bf896f760b51773dcbe36b710921dshell: optionally define a build-time init command2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.com
This commit adds the possibility to build an init command in the
binary. It can be useful to install a number of nodes with a special
configuration, without the need to reach the shell and/or eeprom of
each one.
This is useful, for example, to pass syslog configuration
or the (yet to be implemented) definition of multiple vlans for
etherbone and the wr fabric (frame classes 7 and 6 f the packet
filter). Moreover, I personally love to load a master or slave node
for testing without interacting with the node (or changing the flash
over and over).
This commit also makes reading of commands from storage an optional
feature, but only in the advanced/developer options. Thus, you can
build a wrpc that uses the build-time init commands, or the
flash-stored init commands, both or none of them.
Size effects:
* no effect if you keep the defaults (no build-time init, flash init)
* +248 bytes (+ the command itself) if you enable build-time init
* -1696 bytes if you remove flash-based init (discouraged)
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/4cfc5987fca114e30e90055c40c33c2fe6c8e82bnet: typo in comment2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/765443c760ea2e2db879ba3335762f1579d00dd4udp: bugfix for checksum generation2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.com
the UDP checlsum was miscalculated for odd-sized payload. The last
byte was not used in calculation.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/0887cbbeb1e705e57fc33594ef87d56b98f6b3bbtrivial: remove unused man_phase2016-04-04T10:27:14ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/6993e84d440e67046a5d5b0b5dce933c8c8ce8f7scripts/kconfig: fix "set but unused variable" warnings2016-04-04T10:27:14ZDavide Ciminaghiciminaghi@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9238"><a href="https://ohwr.org/ciminaghi" title="ciminaghi@gnudd.com"><img alt="Davide Ciminaghi's avatar" src="https://secure.gravatar.com/avatar/8efe862214b7d4dc240d822c0c7cac67?s=32&d=identicon" class="avatar s16 avatar-inline" title="Davide Ciminaghi"></a><a href="https://ohwr.org/ciminaghi" title="ciminaghi@gnudd.com">Davide Ciminaghi</a> <<a href="mailto:ciminaghi@gnudd.com" title="ciminaghi@gnudd.com">ciminaghi@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/a86255d3faebed5130b474e62eb0b5c00245bd67Merge branch 'profiling'2016-02-16T15:14:03ZAlessandro Rubinirubini@gnudd.com
This branch introduces the "ps" command, based on a restructuring of
how main() calls the various activities.https://ohwr.org/project/wrpc-sw/commit/b15f0668461a46062fbb458f43cc17de37371e23doc: documented new 'ps' command2016-02-16T15:13:08ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/64dd314011dd6fdb8800c9112802f2d69200bdf2wrc_main and cmd_ps: profile time and report it2016-02-16T14:52:27ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/9983a058f09cfeb4542cc4a28596c8776a4b4cb0shell: new command 'ps'2016-02-16T14:52:27ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/120e952a85a192a359173cfc5bef712ad717f05ewrc_main: turn uptime updating into a task2016-02-16T14:52:27ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/f0575e7393083a19219b09155bf7c6c65c40e126wrc_main: turn link-status polling into a task2016-02-16T14:52:27ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/04898a1e0c732a6241bfd21f615910ff7e0cc412wrc_main: fold init code into init method for task 02016-02-16T14:52:27ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/39edf0a3a66f31952a3398c6b271e1b75208c9d9wrc_main: define the idea of wrc_task2016-02-16T14:52:27ZAlessandro Rubinirubini@gnudd.com
This commit turns individual calls to polling functions into an array
of tasks. On this basis we can add profiling and periodic execution
(instead of continuous polling).
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/f695c5d06d9b63c18fc9c0340c195761b7b08c05net: update_rx_queues returns 1 or 0 too2016-02-16T14:52:27ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/c3c9d67ab43eea89f48386e96ece25d0744e44afpps_gen: avoid a seemingly-64bit division2016-02-16T14:52:26ZAlessandro Rubinirubini@gnudd.com
The compiler is smart enough to turn this into a multiplication by 8:
cf54: 3d c1 00 03 sli r1,r14,3
cf58: 59 a1 00 00 sw (r13+0),r1
and any real division by ll would be trapped by ./check-error.c .
Still, I'd better simplify the code.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/b86b45c766c92fae7285ef3de4273548b428782cnet: link_status is now a global variable2016-02-16T14:52:26ZAlessandro Rubinirubini@gnudd.com
All "tasks" must have the same prototype, so we'd better get
void in all of them at the time being (so we only change the nerwork
function).
Meanwhile, use value "0" for "link down", so it can work as a simple
enable flag for the IP polling code.
(note: we query the link status in wrc_ptp_update() too, and we should
rather refer to the global variable)
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/0378cd6e6b75aca345b1c416a2513efa25611f2dnet: don't run bootp if IP address is static2016-02-16T14:52:26ZAlessandro Rubinirubini@gnudd.com
This solves <a href="http://www.ohwr.org/issues/1218" rel="nofollow noreferrer noopener" target="_blank">http://www.ohwr.org/issues/1218</a>
We used to have a "needIP" variable, but we need three states:
if the address was set by bootp, we run bootp again when the link goes
up, but if it was a static assignment we do not (and keep the static one).
So I renamend needIP to a 3-valued ip_status. The rename ensured the
compiler found all users. Also, the messages are now 3-headed, so
the user know whether the address is static or it comes from bootp.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/c7401a84f0567aa38af827f47d5ad70b61b272fanet: all poll functions return 0/12016-02-16T14:52:26ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/7e3805a693275695ba59c9b7407f5fa28d95565csoftpll: return 0 or 1 in the non-criticall poll function2016-02-16T14:52:26ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/ab59735a6a2280131ad6d66ade9dc06aba02cda6pps: wrc_ptp_update() returns 0 or 12016-02-16T14:52:26ZAlessandro Rubinirubini@gnudd.com
Again, it returns 1 if it did some calculation. For profiling.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/c85e94134391977705aa55f0ed3cff6167ea6af8general: gui/shell return integer2016-02-16T14:52:26ZAlessandro Rubinirubini@gnudd.com
This is a step towards profiling. The functions being polled return
whether or not they did actually work.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/0c72e45257e22ef6a083d32b93d2fbc90e60abd0Merge branch 'network cleanup'2016-02-15T09:43:46ZAlessandro Rubinirubini@gnudd.comhttps://ohwr.org/project/wrpc-sw/commit/03285ba46f01ca32f66618af3fc975e579e1e2d5devel_build_test_defconfig: add CONFIG_IP2016-02-15T09:07:01ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/654dbbbf1f794a58293c9295327442f0a56e2188syslog: report link-up event, and the failure duration2016-02-15T08:52:21ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/ce414c802b3b074b680a3521f355d00805a50ee6wrc_main: call ipv4_poll at link-down event, so it knows2016-02-15T08:52:21ZAlessandro Rubinirubini@gnudd.com
This is needed for the syslog code to know about link up and down
events, to report a link-up with the delay since last link-down.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/d818c48a2f8468c23ffe134f2fdcc31917d638a0syslog: print ip, addr and uptime when up2016-02-15T08:52:21ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/c7de869bbd4b3ebd69103a76a359afa03abd1598general: move link_status to an argument to nework2016-02-15T08:52:21ZAlessandro Rubinirubini@gnudd.com
We are going to have link up messages in syslog, we we'd better
pass it over and not do network thiings in main.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/da67d9280f99cf41dbce285a06fa9117a653b10anet: strange: needed to prevent failutre2016-02-15T08:52:21ZAlessandro Rubinirubini@gnudd.com
I don't know why, but without this the next commit fails with a bad
assert error in the compiler.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/d451f5164101a4a5087930b9fa4b31c06e4922bashell: dont print_ip() but format_ip(). Same for mac2016-02-15T08:52:21ZAlessandro Rubinirubini@gnudd.com
We need the string for IP and MAC in more places than stdout.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/75d7aa72ed14177eb22957cec3e2d9c048dfec63net_verbose: print the socket on tx/rx of frame2016-02-15T08:52:21ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/wrpc-sw/commit/625b21ef992ea9fa81cf1deb88e130d9ca629deflib/util: offer different time formats, for syslog mainly2016-02-15T08:52:21ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>