summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorMichael Brown2015-06-25 17:41:39 +0200
committerMichael Brown2015-06-25 17:46:47 +0200
commitf3812395a261b80fe77d19ebb9045e790c434773 (patch)
treed68ece89cfa39a4976b5dad99d2cb466dee704ca /src/usr
parent[ethernet] Add minimal support for receiving LLC frames (diff)
downloadipxe-f3812395a261b80fe77d19ebb9045e790c434773.tar.gz
ipxe-f3812395a261b80fe77d19ebb9045e790c434773.tar.xz
ipxe-f3812395a261b80fe77d19ebb9045e790c434773.zip
[netdevice] Add a generic concept of a "blocked link"
When Spanning Tree Protocol (STP) is used, there may be a substantial delay (tens of seconds) from the time that the link goes up to the time that the port starts forwarding packets. Add a generic concept of a "blocked link" (i.e. a link which is up but which is not expected to communicate successfully), and allow "ifstat" to indicate when a link is blocked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/ifmgmt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/usr/ifmgmt.c b/src/usr/ifmgmt.c
index 3228a487..aefdaa45 100644
--- a/src/usr/ifmgmt.c
+++ b/src/usr/ifmgmt.c
@@ -103,11 +103,12 @@ static void ifstat_errors ( struct net_device_stats *stats,
*/
void ifstat ( struct net_device *netdev ) {
printf ( "%s: %s using %s on %s (%s)\n"
- " [Link:%s, TX:%d TXE:%d RX:%d RXE:%d]\n",
+ " [Link:%s%s, TX:%d TXE:%d RX:%d RXE:%d]\n",
netdev->name, netdev_addr ( netdev ),
netdev->dev->driver_name, netdev->dev->name,
( netdev_is_open ( netdev ) ? "open" : "closed" ),
( netdev_link_ok ( netdev ) ? "up" : "down" ),
+ ( netdev_link_blocked ( netdev ) ? " (blocked)" : "" ),
netdev->tx_stats.good, netdev->tx_stats.bad,
netdev->rx_stats.good, netdev->rx_stats.bad );
if ( ! netdev_link_ok ( netdev ) ) {