shithub: riscv

Download patch

ref: 00c25292d7e3fa8bd5a6fdd2bd95aa164ae27469
parent: 5dde462f9642f93032afd72997c3d642fcf30b65
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Jan 6 22:50:45 EST 2025

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.

--- a/sys/src/9/port/devether.c
+++ b/sys/src/9/port/devether.c
@@ -475,7 +475,6 @@
 		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 @@
 	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);
--