From: brad Date: Mon, 30 Dec 2013 22:35:29 +0000 (+0000) Subject: Add support for newer integrated Realtek PHY. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=87b0c9bcf9bc0a9546625c27dcb6c7918f55795c;p=openbsd Add support for newer integrated Realtek PHY. Tested with 8168G controllers. --- diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c index bec80159fca..fc42bb18584 100644 --- a/sys/dev/mii/rgephy.c +++ b/sys/dev/mii/rgephy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rgephy.c,v 1.32 2013/12/30 22:25:25 brad Exp $ */ +/* $OpenBSD: rgephy.c,v 1.33 2013/12/30 22:35:29 brad Exp $ */ /* * Copyright (c) 2003 * Bill Paul . All rights reserved. @@ -87,6 +87,8 @@ static const struct mii_phydesc rgephys[] = { MII_STR_xxREALTEK_RTL8169S }, { MII_OUI_xxREALTEK, MII_MODEL_xxREALTEK_RTL8169S, MII_STR_xxREALTEK_RTL8169S }, + { MII_OUI_xxREALTEK, MII_MODEL_xxREALTEK_RTL8251, + MII_STR_xxREALTEK_RTL8251 }, { 0, 0, NULL }, @@ -396,7 +398,8 @@ rgephy_loop(struct mii_softc *sc) u_int32_t bmsr; int i; - if (sc->mii_rev < 2) { + if (sc->mii_model != MII_MODEL_xxREALTEK_RTL8251 && + sc->mii_rev < 2) { PHY_WRITE(sc, RGEPHY_MII_BMCR, RGEPHY_BMCR_PDOWN); DELAY(1000); } @@ -426,7 +429,8 @@ rgephy_load_dspcode(struct mii_softc *sc) { int val; - if (sc->mii_rev > 1) + if (sc->mii_model == MII_MODEL_xxREALTEK_RTL8251 || + sc->mii_rev > 1) return; PHY_WRITE(sc, 31, 0x0001);