From 00c25292d7e3fa8bd5a6fdd2bd95aa164ae27469 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 7 Jan 2025 03:50:45 +0000 Subject: [PATCH] devether: print mbps only on link-up To avoid frequent prints of the current link speed, which in case of wifi is adjusted based link quality, print the link speed only on link up events. --- sys/src/9/port/devether.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/src/9/port/devether.c b/sys/src/9/port/devether.c index c185f04a4..557e6e16b 100644 --- a/sys/src/9/port/devether.c +++ b/sys/src/9/port/devether.c @@ -475,7 +475,6 @@ ethersetspeed(Ether *ether, int mbps) return; netifsetlimit(ether, etherqueuesize(ether)); qsetlimit(ether->oq, ether->limit); - print("#l%d: %s: speed %dMbps\n", ether->ctlrno, ether->type, mbps); } void @@ -485,7 +484,12 @@ ethersetlink(Ether *ether, int link) if(!!ether->link == link) return; ether->link = link; - print("#l%d: %s: link %s\n", ether->ctlrno, ether->type, link? "up": "down"); + if(link) + print("#l%d: %s: link up: %dMbps\n", + ether->ctlrno, ether->type, ether->mbps); + else + print("#l%d: %s: link down\n", + ether->ctlrno, ether->type); } static void netconsole(int);