summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2006-11-28 01:08:45 +0000
committermarius <marius@FreeBSD.org>2006-11-28 01:08:45 +0000
commit7fa64a77b5c7270f9d67efe62a3767caa590c919 (patch)
treed5dc066b70963af72eba92c8f0f77a0315636705 /sys/dev
parent6ea883cd0bd2a875800e8c50a30e248c4579d7f5 (diff)
downloadFreeBSD-src-7fa64a77b5c7270f9d67efe62a3767caa590c919.zip
FreeBSD-src-7fa64a77b5c7270f9d67efe62a3767caa590c919.tar.gz
- In qsphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation doesn't need to be kicked anyway. - Don't set MIIF_NOISOLATE so qsphy(4) can be used in configurations with multiple PHYs. There doesn't seem to be a problem with isolating QS6612 per se nor in combination with the NICs they're used with. - Use mii_phy_add_media() instead of mii_add_media() so the latter can be eventually retired. - Take advantage of mii_phy_setmedia(). Obtained from: NetBSD (except for the first item) MFC after: 2 weeks
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/mii/qsphy.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/sys/dev/mii/qsphy.c b/sys/dev/mii/qsphy.c
index bdd5d68..1d61cef 100644
--- a/sys/dev/mii/qsphy.c
+++ b/sys/dev/mii/qsphy.c
@@ -153,16 +153,15 @@ qsphy_attach(device_t dev)
sc->mii_phy = ma->mii_phyno;
sc->mii_service = qsphy_service;
sc->mii_pdata = mii;
- sc->mii_flags |= MIIF_NOISOLATE;
-
- qsphy_reset(sc);
mii->mii_instance++;
+ qsphy_reset(sc);
+
sc->mii_capabilities =
PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
device_printf(dev, " ");
- mii_add_media(sc);
+ mii_phy_add_media(sc);
printf("\n");
MIIBUS_MEDIAINIT(sc->mii_dev);
@@ -199,25 +198,7 @@ qsphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
- switch (IFM_SUBTYPE(ife->ifm_media)) {
- case IFM_AUTO:
- /*
- * If we're already in auto mode, just return.
- */
- if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
- return (0);
-
- (void) mii_phy_auto(sc);
- break;
-
- default:
- /*
- * BMCR data is stored in the ifmedia entry.
- */
- PHY_WRITE(sc, MII_ANAR,
- mii_anar(ife->ifm_media));
- PHY_WRITE(sc, MII_BMCR, ife->ifm_data);
- }
+ mii_phy_setmedia(sc);
break;
case MII_TICK:
@@ -228,12 +209,6 @@ qsphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
return (0);
/*
- * Only used for autonegotiation.
- */
- if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
- break;
-
- /*
* This PHY's autonegotiation doesn't need to be kicked.
*/
break;
OpenPOWER on IntegriCloud