summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-04-07 22:43:13 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-04-07 22:43:13 +0000
commit593a4f844b0d6ebc7da70c8631f7efbedda74c7f (patch)
treeef53acc5337ed67af28ac85a852837127e3e7755 /sys/dev
parentd9f24fde36a66dade639b36d882feff53d2abf3a (diff)
Only attach a single PHY if the PHY address isn't specified. This prevents
PHYs that respond at the broadcast address 0 and some other address from attaching twice and isolating themselves from the interface. This makes the network interface on the Theobrama Systems RK3399-Q7 SoM that has a Micrel KZS9031 PHY work. ok patrick@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/dwc_gmac.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ic/dwc_gmac.c b/sys/dev/ic/dwc_gmac.c
index 4a511a0cb0f..78fdbf6d301 100644
--- a/sys/dev/ic/dwc_gmac.c
+++ b/sys/dev/ic/dwc_gmac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc_gmac.c,v 1.8 2017/06/29 17:36:16 deraadt Exp $ */
+/* $OpenBSD: dwc_gmac.c,v 1.9 2018/04/07 22:43:12 kettenis Exp $ */
/* $NetBSD: dwc_gmac.c,v 1.34 2015/08/21 20:12:29 jmcneill Exp $ */
/*-
@@ -222,8 +222,8 @@ dwc_gmac_attach(struct dwc_gmac_softc *sc, uint32_t mii_clk, int phyloc)
ifmedia_init(&mii->mii_media, 0, dwc_gmac_ifmedia_upd,
dwc_gmac_ifmedia_sts);
- mii_attach((void *)sc, mii, 0xffffffff, phyloc, MII_OFFSET_ANY,
- MIIF_DOPAUSE);
+ mii_attach((void *)sc, mii, 0xffffffff, phyloc,
+ (phyloc == MII_PHY_ANY) ? 0 : MII_OFFSET_ANY, MIIF_DOPAUSE);
if (LIST_EMPTY(&mii->mii_phys)) {
printf("%s: no PHY found!\n", sc->sc_dev.dv_xname);