aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mii/ip1000phy.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/mii/ip1000phy.c')
-rw-r--r--sys/dev/mii/ip1000phy.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/sys/dev/mii/ip1000phy.c b/sys/dev/mii/ip1000phy.c
index 232e2805826b..b60fab6fc783 100644
--- a/sys/dev/mii/ip1000phy.c
+++ b/sys/dev/mii/ip1000phy.c
@@ -114,6 +114,7 @@ ip1000phy_attach(device_t dev)
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
+ sc->mii_flags = miibus_get_flags(dev);
sc->mii_inst = mii->mii_instance++;
sc->mii_phy = ma->mii_phyno;
sc->mii_service = ip1000phy_service;
@@ -123,6 +124,10 @@ ip1000phy_attach(device_t dev)
isc->model = MII_MODEL(ma->mii_id2);
isc->revision = MII_REV(ma->mii_id2);
+ if (isc->model == MII_MODEL_ICPLUS_IP1000A &&
+ strcmp(mii->mii_ifp->if_dname, "stge") == 0 &&
+ (sc->mii_flags & MIIF_MACPRIV0) != 0)
+ sc->mii_flags |= MIIF_PHYPRIV0;
sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
if (sc->mii_capabilities & BMSR_EXTSTAT)
@@ -412,12 +417,8 @@ ip1000phy_load_dspcode(struct mii_softc *sc)
static void
ip1000phy_reset(struct mii_softc *sc)
{
- struct ip1000phy_softc *isc;
- struct stge_softc *stge_sc;
- struct mii_data *mii;
uint32_t reg;
- isc = (struct ip1000phy_softc *)sc;
mii_phy_reset(sc);
/* clear autoneg/full-duplex as we don't want it after reset */
@@ -425,15 +426,6 @@ ip1000phy_reset(struct mii_softc *sc)
reg &= ~(IP1000PHY_BMCR_AUTOEN | IP1000PHY_BMCR_FDX);
PHY_WRITE(sc, MII_BMCR, reg);
- mii = sc->mii_pdata;
- /*
- * XXX There should be more general way to pass PHY specific
- * data via mii interface.
- */
- if (isc->model == MII_MODEL_ICPLUS_IP1000A &&
- strcmp(mii->mii_ifp->if_dname, "stge") == 0) {
- stge_sc = mii->mii_ifp->if_softc;
- if (stge_sc->sc_rev >= 0x40 && stge_sc->sc_rev <= 0x4e)
- ip1000phy_load_dspcode(sc);
- }
+ if ((sc->mii_flags & MIIF_PHYPRIV0) != 0)
+ ip1000phy_load_dspcode(sc);
}