Module Name: src
Committed By: msaitoh
Date: Fri Oct 16 05:53:40 UTC 2020
Modified Files:
src/sys/dev/pci: if_wm.c
Log Message:
Fixes a problem that the attach function reported
"wm_gmii_setup_phytype: Unknown PHY model. OUI=000000, model=0000" and
"PHY type is still unknown." Don't call wm_gmii_setup_phytype() three times if
the interface uses SGMII with internal MDIO.
Tested with I354(Rangeley(SGMII(MDIO))) and I350(SERDES(SFP), SGMII(SFP)).
To generate a diff of this commit:
cvs rdiff -u -r1.690 -r1.691 src/sys/dev/pci/if_wm.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.690 src/sys/dev/pci/if_wm.c:1.691
--- src/sys/dev/pci/if_wm.c:1.690 Thu Sep 24 08:00:59 2020
+++ src/sys/dev/pci/if_wm.c Fri Oct 16 05:53:39 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.690 2020/09/24 08:00:59 msaitoh Exp $ */
+/* $NetBSD: if_wm.c,v 1.691 2020/10/16 05:53:39 msaitoh Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.690 2020/09/24 08:00:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.691 2020/10/16 05:53:39 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -2862,7 +2862,8 @@ alloc_retry:
reg &= ~CTRL_EXT_I2C_ENA;
CSR_WRITE(sc, WMREG_CTRL_EXT, reg);
if ((sc->sc_flags & WM_F_SGMII) != 0) {
- wm_gmii_setup_phytype(sc, 0, 0);
+ if (!wm_sgmii_uses_mdio(sc))
+ wm_gmii_setup_phytype(sc, 0, 0);
wm_reset_mdicnfg_82580(sc);
}
} else if (sc->sc_type < WM_T_82543 ||