Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev/mii Pull up the following revisions, requested by...



details:   https://anonhg.NetBSD.org/src/rev/83a58e83b66e
branches:  netbsd-8
changeset: 461266:83a58e83b66e
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Nov 21 14:06:16 2019 +0000

description:
Pull up the following revisions, requested by msaitoh in ticket #1454:

        sys/dev/mii/atphy.c                     1.22-1.23, 1.25 via patch
        sys/dev/mii/mii_physubr.c               1.88 via patch
        sys/dev/mii/miivar.h                    1.69 via patch

- Fix a bug that atphy(4) can't negotiate correctly when the media
  setting is neither auto nor 1000baseT.
- Code cleanup.

diffstat:

 sys/dev/mii/atphy.c       |  14 +++++++-------
 sys/dev/mii/mii_physubr.c |  15 ++++++---------
 sys/dev/mii/miivar.h      |   4 ++--
 3 files changed, 15 insertions(+), 18 deletions(-)

diffs (116 lines):

diff -r 40bfde34ab69 -r 83a58e83b66e sys/dev/mii/atphy.c
--- a/sys/dev/mii/atphy.c       Wed Nov 20 16:37:46 2019 +0000
+++ b/sys/dev/mii/atphy.c       Thu Nov 21 14:06:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atphy.c,v 1.18 2016/11/02 10:11:32 msaitoh Exp $ */
+/*     $NetBSD: atphy.c,v 1.18.8.1 2019/11/21 14:06:16 martin Exp $ */
 /*     $OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $  */
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.18 2016/11/02 10:11:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.18.8.1 2019/11/21 14:06:16 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -90,7 +90,7 @@
         atphy_service, atphy_status, atphy_reset,
 };
 
-static const struct mii_phydesc etphys[] = {
+static const struct mii_phydesc atphys[] = {
        { MII_OUI_ATHEROS,      MII_MODEL_ATHEROS_F1,
          MII_STR_ATHEROS_F1 },
        { MII_OUI_ATTANSIC,     MII_MODEL_ATTANSIC_L1,
@@ -124,7 +124,7 @@
 {
        struct mii_attach_args *ma = aux;
 
-       if (mii_phy_match(ma, etphys) != NULL)
+       if (mii_phy_match(ma, atphys) != NULL)
                return 10;
 
        return 0;
@@ -139,7 +139,7 @@
        const struct mii_phydesc *mpd;
        uint16_t bmsr;
 
-       mpd = mii_phy_match(ma, etphys);
+       mpd = mii_phy_match(ma, atphys);
        aprint_naive(": Media interface\n");
        aprint_normal(": %s, rev. %d\n", mpd->mpd_name, MII_REV(ma->mii_id2));
 
@@ -231,8 +231,8 @@
                        return EINVAL;
                }
 
-               anar = mii_anar(IFM_SUBTYPE(ife->ifm_media));
-               if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) {
+               anar = mii_anar(ife);
+               if ((ife->ifm_media & IFM_FDX) != 0) {
                        bmcr |= BMCR_FDX;
                        /* Enable pause. */
                        if (sc->mii_flags & MIIF_DOPAUSE)
diff -r 40bfde34ab69 -r 83a58e83b66e sys/dev/mii/mii_physubr.c
--- a/sys/dev/mii/mii_physubr.c Wed Nov 20 16:37:46 2019 +0000
+++ b/sys/dev/mii/mii_physubr.c Thu Nov 21 14:06:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mii_physubr.c,v 1.80.26.1 2018/12/30 12:16:16 martin Exp $     */
+/*     $NetBSD: mii_physubr.c,v 1.80.26.2 2019/11/21 14:06:16 martin Exp $     */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.80.26.1 2018/12/30 12:16:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.80.26.2 2019/11/21 14:06:16 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -692,19 +692,16 @@
 
 
 /*
- * Given an ifmedia word, return the corresponding ANAR value.
+ * Given an ifmedia_entry, return the corresponding ANAR value.
  */
 int
-mii_anar(int media)
+mii_anar(struct ifmedia_entry *ife)
 {
-       int rv;
 
 #ifdef DIAGNOSTIC
-       if (/* media < 0 || */ media >= MII_NMEDIA)
+       if (ife->ifm_data >= MII_NMEDIA)
                panic("mii_anar");
 #endif
 
-       rv = mii_media_table[media].mm_anar;
-
-       return rv;
+       return mii_media_table[ife->ifm_data].mm_anar;
 }
diff -r 40bfde34ab69 -r 83a58e83b66e sys/dev/mii/miivar.h
--- a/sys/dev/mii/miivar.h      Wed Nov 20 16:37:46 2019 +0000
+++ b/sys/dev/mii/miivar.h      Thu Nov 21 14:06:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: miivar.h,v 1.62 2014/05/28 09:49:55 msaitoh Exp $      */
+/*     $NetBSD: miivar.h,v 1.62.20.1 2019/11/21 14:06:16 martin Exp $  */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -235,7 +235,7 @@
 void   mii_tick(struct mii_data *);
 void   mii_pollstat(struct mii_data *);
 void   mii_down(struct mii_data *);
-int    mii_anar(int);
+int    mii_anar(struct ifmedia_entry *);
 
 int mii_ifmedia_change(struct mii_data *);
 



Home | Main Index | Thread Index | Old Index