[PATCH rtems-libbsd 1/3] dev/mii: Handle PHY read timeouts

Kinsey Moore kinsey.moore at oarcorp.com
Fri Jul 9 01:14:16 UTC 2021


PHY read timeouts return 0xffffffff and bypass the current bad/no PHY
checks. This adds a check specifically for that read timeout to avoid
probing PHYs that don't exist.
---
 freebsd/sys/dev/mii/mii.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/freebsd/sys/dev/mii/mii.c b/freebsd/sys/dev/mii/mii.c
index d0428f24..8f087cab 100644
--- a/freebsd/sys/dev/mii/mii.c
+++ b/freebsd/sys/dev/mii/mii.c
@@ -474,6 +474,7 @@ mii_attach(device_t dev, device_t *miibus, if_t ifp,
 		 */
 		bmsr = MIIBUS_READREG(dev, ma.mii_phyno, MII_BMSR);
 		if (bmsr == 0 || bmsr == 0xffff ||
+		    bmsr == 0xffffffff ||
 		    (bmsr & (BMSR_EXTSTAT | BMSR_MEDIAMASK)) == 0) {
 			/* Assume no PHY at this address. */
 			continue;
-- 
2.20.1



More information about the devel mailing list