Source-Changes-HG archive

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

[src/trunk]: src/sys Don't dry to diving MIIF_NOISOLATE in the PHY drivers. ...



details:   https://anonhg.NetBSD.org/src/rev/5729310f6de2
branches:  trunk
changeset: 481613:5729310f6de2
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Feb 02 17:09:38 2000 +0000

description:
Don't dry to diving MIIF_NOISOLATE in the PHY drivers.  Instead, pass
flags down from the parent to child vi mii_attach().

diffstat:

 sys/arch/macppc/dev/if_bm.c |   4 ++--
 sys/dev/ic/elink3.c         |   4 ++--
 sys/dev/ic/elinkxl.c        |   4 ++--
 sys/dev/ic/hme.c            |   4 ++--
 sys/dev/ic/i82557.c         |   7 +++++--
 sys/dev/ic/smc83c170.c      |   4 ++--
 sys/dev/ic/tulip.c          |  14 +++++++-------
 sys/dev/ic/tulipreg.h       |   9 +++++++--
 sys/dev/mii/dmphy.c         |   3 ++-
 sys/dev/mii/exphy.c         |   3 ++-
 sys/dev/mii/icsphy.c        |   3 ++-
 sys/dev/mii/inphy.c         |  10 ++--------
 sys/dev/mii/iophy.c         |  10 ++--------
 sys/dev/mii/lxtphy.c        |   3 ++-
 sys/dev/mii/mii.c           |   7 ++++---
 sys/dev/mii/miivar.h        |   6 ++++--
 sys/dev/mii/nsphy.c         |  10 ++--------
 sys/dev/mii/nsphyter.c      |   3 ++-
 sys/dev/mii/qsphy.c         |   3 ++-
 sys/dev/mii/sqphy.c         |   3 ++-
 sys/dev/mii/tlphy.c         |   3 ++-
 sys/dev/mii/tqphy.c         |   3 ++-
 sys/dev/mii/ukphy.c         |   3 ++-
 sys/dev/pci/if_rl.c         |   4 ++--
 sys/dev/pci/if_sip.c        |   4 ++--
 sys/dev/pci/if_tl.c         |   4 ++--
 sys/dev/pci/if_vr.c         |   4 ++--
 sys/dev/pcmcia/if_xe.c      |   4 ++--
 sys/dev/usb/if_aue.c        |   4 ++--
 29 files changed, 75 insertions(+), 72 deletions(-)

diffs (truncated from 613 to 300 lines):

diff -r a7f25bcf3d30 -r 5729310f6de2 sys/arch/macppc/dev/if_bm.c
--- a/sys/arch/macppc/dev/if_bm.c       Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/arch/macppc/dev/if_bm.c       Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bm.c,v 1.5 2000/02/02 08:05:31 thorpej Exp $        */
+/*     $NetBSD: if_bm.c,v 1.6 2000/02/02 17:09:43 thorpej Exp $        */
 
 /*-
  * Copyright (C) 1998, 1999, 2000 Tsubai Masanari.  All rights reserved.
@@ -252,7 +252,7 @@
 
        ifmedia_init(&mii->mii_media, 0, bmac_mediachange, bmac_mediastatus);
        mii_attach(&sc->sc_dev, mii, 0xffffffff, MII_PHY_ANY,
-                     MII_OFFSET_ANY);
+                     MII_OFFSET_ANY, 0);
 
        /* Choose a default media. */
        if (LIST_FIRST(&mii->mii_phys) == NULL) {
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/ic/elink3.c
--- a/sys/dev/ic/elink3.c       Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/ic/elink3.c       Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elink3.c,v 1.72 2000/02/02 11:00:48 augustss Exp $     */
+/*     $NetBSD: elink3.c,v 1.73 2000/02/02 17:09:46 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -483,7 +483,7 @@
                 */
                if (sc->ep_flags & ELINK_FLAGS_MII) {
                        mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff,
-                           MII_PHY_ANY, MII_OFFSET_ANY);
+                           MII_PHY_ANY, MII_OFFSET_ANY, 0);
                        if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
                                ifmedia_add(&sc->sc_mii.mii_media,
                                    IFM_ETHER|IFM_NONE, 0, NULL);
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/ic/elinkxl.c
--- a/sys/dev/ic/elinkxl.c      Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/ic/elinkxl.c      Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elinkxl.c,v 1.23 2000/02/02 08:05:26 thorpej Exp $     */
+/*     $NetBSD: elinkxl.c,v 1.24 2000/02/02 17:09:46 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -410,7 +410,7 @@
                bus_space_write_4(iot, ioh, ELINK_W3_INTERNAL_CONFIG, icfg);
 
                mii_attach(&sc->sc_dev, &sc->ex_mii, 0xffffffff,
-                   MII_PHY_ANY, MII_OFFSET_ANY);
+                   MII_PHY_ANY, MII_OFFSET_ANY, 0);
                if (LIST_FIRST(&sc->ex_mii.mii_phys) == NULL) {
                        ifmedia_add(&sc->ex_mii.mii_media, IFM_ETHER|IFM_NONE,
                            0, NULL);
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/ic/hme.c
--- a/sys/dev/ic/hme.c  Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/ic/hme.c  Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hme.c,v 1.6 2000/02/02 08:05:26 thorpej Exp $  */
+/*     $NetBSD: hme.c,v 1.7 2000/02/02 17:09:47 thorpej Exp $  */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -247,7 +247,7 @@
        hme_mifinit(sc);
 
        mii_attach(&sc->sc_dev, mii, 0xffffffff,
-                       MII_PHY_ANY, MII_OFFSET_ANY);
+                       MII_PHY_ANY, MII_OFFSET_ANY, 0);
 
        child = LIST_FIRST(&mii->mii_phys);
        if (child == NULL) {
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/ic/i82557.c
--- a/sys/dev/ic/i82557.c       Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/ic/i82557.c       Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i82557.c,v 1.16 2000/02/02 08:05:27 thorpej Exp $      */
+/*     $NetBSD: i82557.c,v 1.17 2000/02/02 17:09:47 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -401,8 +401,11 @@
        sc->sc_mii.mii_statchg = fxp_statchg;
        ifmedia_init(&sc->sc_mii.mii_media, 0, fxp_mii_mediachange,
            fxp_mii_mediastatus);
+       /*
+        * The i82557 wedges if all of its PHYs are isolated!
+        */
        mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY,
-           MII_OFFSET_ANY);
+           MII_OFFSET_ANY, MIIF_NOISOLATE);
        if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
                ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE, 0, NULL);
                ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE);
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/ic/smc83c170.c
--- a/sys/dev/ic/smc83c170.c    Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/ic/smc83c170.c    Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smc83c170.c,v 1.24 2000/02/02 08:05:27 thorpej Exp $   */
+/*     $NetBSD: smc83c170.c,v 1.25 2000/02/02 17:09:47 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -230,7 +230,7 @@
        ifmedia_init(&sc->sc_mii.mii_media, 0, epic_mediachange,
            epic_mediastatus);
        mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY,
-           MII_OFFSET_ANY);
+           MII_OFFSET_ANY, 0);
        if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
                ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE, 0, NULL);
                ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE);
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/ic/tulip.c
--- a/sys/dev/ic/tulip.c        Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/ic/tulip.c        Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tulip.c,v 1.43 2000/02/02 08:05:27 thorpej Exp $       */
+/*     $NetBSD: tulip.c,v 1.44 2000/02/02 17:09:47 thorpej Exp $       */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -4311,7 +4311,7 @@
                         * search the whole thing anyhow.
                         */
                        mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff,
-                           MII_PHY_ANY, tm->tm_phyno);
+                           MII_PHY_ANY, tm->tm_phyno, 0);
 
                        /*
                         * Now, search for the PHY we hopefully just
@@ -4471,7 +4471,7 @@
                         * search the whole thing anyhow.
                         */
                        mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff,
-                           MII_PHY_ANY, tm->tm_phyno);
+                           MII_PHY_ANY, tm->tm_phyno, 0);
 
                        /*
                         * Now, search for the PHY we hopefully just
@@ -4688,7 +4688,7 @@
        ifmedia_init(&sc->sc_mii.mii_media, 0, tlp_mediachange,
            tlp_mediastatus);
        mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY,
-           MII_OFFSET_ANY);
+           MII_OFFSET_ANY, 0);
        if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
                ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE, 0, NULL);
                ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE);
@@ -4736,7 +4736,7 @@
        ifmedia_init(&sc->sc_mii.mii_media, 0, tlp_mediachange,
            tlp_mediastatus);
        mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY,
-           MII_OFFSET_ANY);
+           MII_OFFSET_ANY, 0);
        if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
                /* XXX What about AUI/BNC support? */
                printf("%s: ", sc->sc_dev.dv_xname);
@@ -5148,7 +5148,7 @@
        if (sc->sc_chip == TULIP_CHIP_MX98713 ||
            sc->sc_chip == TULIP_CHIP_MX98713A) {
                mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff,
-                   MII_PHY_ANY, MII_OFFSET_ANY);
+                   MII_PHY_ANY, MII_OFFSET_ANY, 0);
                if (LIST_FIRST(&sc->sc_mii.mii_phys) != NULL) {
                        sc->sc_flags |= TULIPF_HAS_MII;
                        sc->sc_tick = tlp_mii_tick;
@@ -5216,7 +5216,7 @@
        ifmedia_init(&sc->sc_mii.mii_media, 0, tlp_mediachange,
            tlp_mediastatus);
        mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY,
-           MII_OFFSET_ANY);
+           MII_OFFSET_ANY, 0);
        if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
                ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE, 0, NULL);
                ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE);
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/ic/tulipreg.h
--- a/sys/dev/ic/tulipreg.h     Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/ic/tulipreg.h     Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tulipreg.h,v 1.15 2000/01/22 21:05:53 thorpej Exp $    */
+/*     $NetBSD: tulipreg.h,v 1.16 2000/02/02 17:09:48 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -530,6 +530,10 @@
 #define        OPMODE_BP               0x00010000      /* backpressure enable */
 #define        OPMODE_CA               0x00020000      /* capture effect enable */
 #define        OPMODE_PNIC_TBEN        0x00020000      /* Tx backoff offset enable */
+       /*
+        * On Davicom DM9102, OPMODE_PS and OPMODE_HBD must
+        * always be set.
+        */
 #define        OPMODE_PS               0x00040000      /* port select:
                                                   1 = MII/SYM, 0 = SRL
                                                   (21140) */
@@ -548,7 +552,8 @@
                                                   (21140) */
 #define        OPMODE_PCS              0x00800000      /* PCS function (21140) */
 #define        OPMODE_SCR              0x01000000      /* scrambler mode (21140) */
-#define        OPMODE_MBO              0x02000000      /* must be one (21140) */
+#define        OPMODE_MBO              0x02000000      /* must be one (21140,
+                                                  DM9102) */
 #define        OPMODE_IDAMSB           0x04000000      /* ignore dest addr MSB
                                                   (21142) */
 #define        OPMODE_PNIC_DRC         0x20000000      /* don't include CRC in Rx
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/mii/dmphy.c
--- a/sys/dev/mii/dmphy.c       Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/mii/dmphy.c       Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dmphy.c,v 1.2 2000/02/02 08:05:32 thorpej Exp $        */
+/*     $NetBSD: dmphy.c,v 1.3 2000/02/02 17:09:43 thorpej Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -130,6 +130,7 @@
        sc->mii_phy = ma->mii_phyno;
        sc->mii_service = dmphy_service;
        sc->mii_pdata = mii;
+       sc->mii_flags = mii->mii_flags;
 
        mii_phy_reset(sc);
 
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/mii/exphy.c
--- a/sys/dev/mii/exphy.c       Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/mii/exphy.c       Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exphy.c,v 1.20 2000/02/02 08:05:32 thorpej Exp $       */
+/*     $NetBSD: exphy.c,v 1.21 2000/02/02 17:09:43 thorpej Exp $       */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -134,6 +134,7 @@
        sc->mii_phy = ma->mii_phyno;
        sc->mii_service = exphy_service;
        sc->mii_pdata = mii;
+       sc->mii_flags = mii->mii_flags;
 
        /*
         * The 3Com PHY can never be isolated, so never allow non-zero
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/mii/icsphy.c
--- a/sys/dev/mii/icsphy.c      Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/mii/icsphy.c      Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icsphy.c,v 1.14 2000/02/02 08:05:32 thorpej Exp $      */
+/*     $NetBSD: icsphy.c,v 1.15 2000/02/02 17:09:43 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -130,6 +130,7 @@
        sc->mii_phy = ma->mii_phyno;
        sc->mii_service = icsphy_service;
        sc->mii_pdata = mii;
+       sc->mii_flags = mii->mii_flags;
 
        icsphy_reset(sc);
 
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/mii/inphy.c
--- a/sys/dev/mii/inphy.c       Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/mii/inphy.c       Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inphy.c,v 1.15 2000/02/02 08:05:32 thorpej Exp $       */
+/*     $NetBSD: inphy.c,v 1.16 2000/02/02 17:09:43 thorpej Exp $       */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -130,13 +130,7 @@
        sc->mii_phy = ma->mii_phyno;
        sc->mii_service = inphy_service;
        sc->mii_pdata = mii;
-
-       /*
-        * i82557 wedges if all of its PHYs are isolated!
-        */
-       if (strcmp(parent->dv_cfdata->cf_driver->cd_name, "fxp") == 0 &&
-           mii->mii_instance == 0)
-               sc->mii_flags |= MIIF_NOISOLATE;
+       sc->mii_flags = mii->mii_flags;
 
        mii_phy_reset(sc);
 
diff -r a7f25bcf3d30 -r 5729310f6de2 sys/dev/mii/iophy.c
--- a/sys/dev/mii/iophy.c       Wed Feb 02 16:58:10 2000 +0000
+++ b/sys/dev/mii/iophy.c       Wed Feb 02 17:09:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iophy.c,v 1.5 2000/02/02 08:05:32 thorpej Exp $        */
+/*     $NetBSD: iophy.c,v 1.6 2000/02/02 17:09:44 thorpej Exp $        */
 
 /*
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -132,13 +132,7 @@
        sc->mii_phy = ma->mii_phyno;
        sc->mii_service = iophy_service;
        sc->mii_pdata = mii;
-
-       /*
-        * i82557 wedges if all of its PHYs are isolated!
-        */
-       if (strcmp(parent->dv_cfdata->cf_driver->cd_name, "fxp") == 0 &&
-           mii->mii_instance == 0)
-               sc->mii_flags |= MIIF_NOISOLATE;



Home | Main Index | Thread Index | Old Index