summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2006-12-02 21:19:54 +0000
committermarius <marius@FreeBSD.org>2006-12-02 21:19:54 +0000
commitdca3fafa7afcd0862ffe415e3a9fd160d8f94bfe (patch)
treefa0cc72a629800eec4375c41f3a413778fdede08 /sys/dev/mii
parent102a50659da16a3c4bb3aa446994ffb996f7b611 (diff)
downloadFreeBSD-src-dca3fafa7afcd0862ffe415e3a9fd160d8f94bfe.zip
FreeBSD-src-dca3fafa7afcd0862ffe415e3a9fd160d8f94bfe.tar.gz
- In acphy_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. - Fix a whitespace nit. - Probe another Altima PHY, which is a AC101 workalike and integrated in at least ADMtek ADM8511 but apparently is not mentioned in any publically available data sheet so the actual identifier is unknown. - Don't set MIIF_NOISOLATE so acphy(4) can be used in configurations with multiple PHYs. There doesn't seem to be a problem with isolating AC101 and workalikes 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 and second item) MFC after: 2 weeks
Diffstat (limited to 'sys/dev/mii')
-rw-r--r--sys/dev/mii/acphy.c37
1 files changed, 7 insertions, 30 deletions
diff --git a/sys/dev/mii/acphy.c b/sys/dev/mii/acphy.c
index fd4c385..963415e 100644
--- a/sys/dev/mii/acphy.c
+++ b/sys/dev/mii/acphy.c
@@ -119,6 +119,8 @@ static void acphy_status(struct mii_softc *);
static const struct mii_phydesc acphys[] = {
MII_PHY_DESC(xxALTIMA, AC101),
MII_PHY_DESC(xxALTIMA, AC101L),
+ /* XXX This is reported to work, but it's not from any data sheet. */
+ MII_PHY_DESC(xxALTIMA, ACXXX),
MII_PHY_END
};
@@ -146,16 +148,15 @@ acphy_attach(device_t dev)
sc->mii_phy = ma->mii_phyno;
sc->mii_service = acphy_service;
sc->mii_pdata = mii;
- sc->mii_flags |= MIIF_NOISOLATE;
-
- acphy_reset(sc);
mii->mii_instance++;
+ acphy_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);
@@ -194,28 +195,10 @@ acphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
/* Wake & deisolate up if necessary */
reg = PHY_READ(sc, MII_BMCR);
- if (reg & (BMCR_ISO | BMCR_PDOWN))
+ if (reg & (BMCR_ISO | BMCR_PDOWN))
PHY_WRITE(sc, MII_BMCR, reg & ~(BMCR_ISO | BMCR_PDOWN));
- 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:
@@ -226,12 +209,6 @@ acphy_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