Index: sys/dev/mge/if_mge.c =================================================================== --- sys/dev/mge/if_mge.c (revision 208113) +++ sys/dev/mge/if_mge.c (working copy) @@ -606,7 +606,6 @@ mge_attach(device_t dev) { struct mge_softc *sc; - struct mii_softc *miisc; struct ifnet *ifp; uint8_t hwaddr[ETHER_ADDR_LEN]; int i, error ; @@ -690,9 +689,9 @@ } sc->mii = device_get_softc(sc->miibus); - /* Tell the MAC where to find the PHY so autoneg works */ - miisc = LIST_FIRST(&sc->mii->mii_phys); - MGE_WRITE(sc, MGE_REG_PHYDEV, miisc->mii_phy); + /* Tell the MAC where to find the PHY so autoneg works + * We assume a static mapping (see mge_miibus_readreg) */ + MGE_WRITE(sc, MGE_REG_PHYDEV, device_get_unit(dev) + MII_ADDR_BASE); /* Attach interrupt handlers */ for (i = 0; i < 2; ++i) {