Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/mii From FreeBSD:



details:   https://anonhg.NetBSD.org/src/rev/30466b5c0913
branches:  trunk
changeset: 453540:30466b5c0913
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Aug 16 15:24:09 2019 +0000

description:
>From FreeBSD:
- Support ET1011.
- Use mii_phy_flowstatus() to reflect flow status from negotiated result.

diffstat:

 sys/dev/mii/etphy.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r 449d27da2f53 -r 30466b5c0913 sys/dev/mii/etphy.c
--- a/sys/dev/mii/etphy.c       Fri Aug 16 15:20:18 2019 +0000
+++ b/sys/dev/mii/etphy.c       Fri Aug 16 15:24:09 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: etphy.c,v 1.5 2019/08/16 15:17:31 msaitoh Exp $        */
+/*     $NetBSD: etphy.c,v 1.6 2019/08/16 15:24:09 msaitoh Exp $        */
 /*     $OpenBSD: etphy.c,v 1.4 2008/04/02 20:12:58 brad Exp $  */
 
 /*
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.5 2019/08/16 15:17:31 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.6 2019/08/16 15:24:09 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -89,6 +89,7 @@
 
 static const struct mii_phydesc etphys[] = {
        MII_PHY_DESC(AGERE, ET1011),
+       MII_PHY_DESC(AGERE, ET1011C),
        MII_PHY_END,
 };
 
@@ -258,6 +259,11 @@
        uint16_t reg;
        int i;
 
+       if (sc->mii_mpd_model == MII_MODEL_AGERE_ET1011) {
+               mii_phy_reset(sc);
+               return;
+       }
+
        for (i = 0; i < 2; ++i) {
                PHY_READ(sc, MII_PHYIDR1, &reg);
                PHY_READ(sc, MII_PHYIDR2, &reg);
@@ -339,7 +345,7 @@
        }
 
        if (sr & ETPHY_SR_FDX)
-               mii->mii_media_active |= IFM_FDX;
+               mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc);
        else
                mii->mii_media_active |= IFM_HDX;
 }



Home | Main Index | Thread Index | Old Index