diff options
author | Christian Iversen <ci@iversenit.dk> | 2021-01-26 21:46:33 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2021-01-26 21:02:10 +0000 |
commit | f4c3a01470289d450dbe437fdfb1e85309459374 (patch) | |
tree | 58c2ca2863ba293b651263fbcaa068cbd64ac240 /src/usr | |
parent | 42db0bd0417721a026313fc151f36a8ef0bff4e4 (diff) | |
download | ipxe-f4c3a01470289d450dbe437fdfb1e85309459374.zip ipxe-f4c3a01470289d450dbe437fdfb1e85309459374.tar.gz ipxe-f4c3a01470289d450dbe437fdfb1e85309459374.tar.bz2 |
[ifmgmt] Make "ifstat" show the link-layer protocol for each netdev
This is useful on devices that perform auto-detection for ports.
Example output:
iPXE> ifstat
net0: 00:11:22:33:44:55 using mt4099 on 0000:00:03.0 (Ethernet) [open]
[Link:down, TX:0 TXE:0 RX:0 RXE:0]
[Link status: Unknown (http://ipxe.org/1a086101)]
net1: 00:11:22:33:44:56 using mt4099 on 0000:00:03.0 (IPoIB) [open]
[Link:down, TX:0 TXE:0 RX:0 RXE:0]
[Link status: Initialising (http://ipxe.org/1a136101)]
Signed-off-by: Christian Iversen <ci@iversenit.dk>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/ifmgmt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/usr/ifmgmt.c b/src/usr/ifmgmt.c index 2150bff..d87ffff 100644 --- a/src/usr/ifmgmt.c +++ b/src/usr/ifmgmt.c @@ -108,10 +108,11 @@ static void ifstat_errors ( struct net_device_stats *stats, * @v netdev Network device */ void ifstat ( struct net_device *netdev ) { - printf ( "%s: %s using %s on %s (%s)\n" + printf ( "%s: %s using %s on %s (%s) [%s]\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->ll_protocol->name, ( netdev_is_open ( netdev ) ? "open" : "closed" ), ( netdev_link_ok ( netdev ) ? "up" : "down" ), ( netdev_link_blocked ( netdev ) ? " (blocked)" : "" ), |