mirror of
https://github.com/ipxe/ipxe
synced 2025-12-28 18:42:53 +03:00
[netdevice] Add mechanism for reporting detailed link status codes
Expand the NETDEV_LINK_UP bit into a link_rc status code field, allowing specific reasons for link failure to be reported via "ifstat". Originally-authored-by: Joshua Oreman <oremanj@rwcr.net>
This commit is contained in:
@@ -94,6 +94,10 @@ void ifstat ( struct net_device *netdev ) {
|
||||
( netdev_link_ok ( netdev ) ? "up" : "down" ),
|
||||
netdev->tx_stats.good, netdev->tx_stats.bad,
|
||||
netdev->rx_stats.good, netdev->rx_stats.bad );
|
||||
if ( ! netdev_link_ok ( netdev ) ) {
|
||||
printf ( " [Link status: %s]\n",
|
||||
strerror ( netdev->link_rc ) );
|
||||
}
|
||||
ifstat_errors ( &netdev->tx_stats, "TXE" );
|
||||
ifstat_errors ( &netdev->rx_stats, "RXE" );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user