From 293800bdd2bcaa8133d73d301895f69d0f5739d9 Mon Sep 17 00:00:00 2001 From: landry Date: Mon, 8 Jul 2024 08:07:45 +0000 Subject: [PATCH] octeon/cnmac: assume 1Gbps in the default case avoids a division by 0 when up'ing the non-working cnmac2 on er-poe feedback from visa@: "The cnmac2 link is connected to a discrete Ethernet switch chip on the PoE, and this link does not carry RGMII in-band PHY status. If the code were to support such hardware designs in the future, something like this patch would be needed." this diff from miod@, same diff from visa@ in 2017 (cf https://marc.info/?l=openbsd-bugs&m=151017517115440&w=2) ok visa@ --- sys/arch/octeon/dev/cn30xxgmx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/arch/octeon/dev/cn30xxgmx.c b/sys/arch/octeon/dev/cn30xxgmx.c index 5775a1b8367..fc90edccafb 100644 --- a/sys/arch/octeon/dev/cn30xxgmx.c +++ b/sys/arch/octeon/dev/cn30xxgmx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cn30xxgmx.c,v 1.54 2024/05/20 23:13:33 jsg Exp $ */ +/* $OpenBSD: cn30xxgmx.c,v 1.55 2024/07/08 08:07:45 landry Exp $ */ /* * Copyright (c) 2007 Internet Initiative Japan, Inc. @@ -991,7 +991,8 @@ cn30xxgmx_rgmii_speed(struct cn30xxgmx_port_softc *sc) baudrate = IF_Gbps(1); break; default: - baudrate = 0/* XXX */; + /* Assume 1Gbps for now */ + baudrate = IF_Gbps(1); /* XXX */ break; } ifp->if_baudrate = baudrate; @@ -1202,7 +1203,7 @@ cn30xxgmx_rgmii_speed_speed(struct cn30xxgmx_port_softc *sc) SET(prt_cfg, PRTN_CFG_SPEED); break; default: - /* NOT REACHED! */ + /* THEORETICALLY NOT REACHED! */ /* Following configuration is default value of system. */ tx_clk = 1; -- 2.20.1