diff options
author | Landry Breuil <landry@cvs.openbsd.org> | 2024-07-08 08:07:46 +0000 |
---|---|---|
committer | Landry Breuil <landry@cvs.openbsd.org> | 2024-07-08 08:07:46 +0000 |
commit | e71f43a3e004e494e85e38aa266fcc6879dcf93b (patch) | |
tree | 3297a09e3e26e1296294c6ea69ce489afa5ae2eb /sys/arch | |
parent | c238d3accdad30800bbc9d3aa47e1b2948864f6c (diff) |
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@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/octeon/dev/cn30xxgmx.c | 7 |
1 files 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; |