summaryrefslogtreecommitdiffstats
path: root/src/net/stp.c
Commit message (Collapse)AuthorAgeFilesLines
* [time] Allow timer to be selected at runtimeMichael Brown2017-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | Allow the active timer (providing udelay() and currticks()) to be selected at runtime based on probing during the INIT_EARLY stage of initialisation. TICKS_PER_SEC is now a fixed compile-time constant for all builds, and is independent of the underlying clock tick rate. We choose the value 1024 to allow multiplications and divisions on seconds to be converted to bit shifts. TICKS_PER_MS is defined as 1, allowing multiplications and divisions on milliseconds to be omitted entirely. The 2% inaccuracy in this definition is negligible when using the standard BIOS timer (running at around 18.2Hz). TIMER_RDTSC now checks for a constant TSC before claiming to be a usable timer. (This timer can be tested in KVM via the command-line option "-cpu host,+invtsc".) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [stp] Fix incorrectly disambiguated errorsMichael Brown2016-01-141-3/+3
| | | | | | | | | The three nominally-disambiguated ENOTSUP errors accidentally all used the same error disambiguator, rendering them identical. Fix by changing all three values. We avoid reusing the 0x01 disambiguator value, since that remains ambiguous in older binaries. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [stp] Fix interpretaton of hello timeMichael Brown2015-06-251-3/+3
| | | | | | Times in STP packets are expressed in units of 1/256 of a second. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [stp] Add support for detecting Spanning Tree Protocol non-forwarding portsMichael Brown2015-06-251-0/+152
A fairly common end-user problem is that the default configuration of a switch may leave the port in a non-forwarding state for a substantial length of time (tens of seconds) after link up. This can cause iPXE to time out and give up attempting to boot. We cannot force the switch to start forwarding packets sooner, since any attempt to send a Spanning Tree Protocol bridge PDU may cause the switch to disable our port (if the switch happens to have the Bridge PDU Guard feature enabled for the port). For non-ancient versions of the Spanning Tree Protocol, we can detect whether or not the port is currently forwarding and use this to inform the network device core that the link is currently blocked. Signed-off-by: Michael Brown <mcb30@ipxe.org>