diff options
Diffstat (limited to 'sys/dev/tsec/if_tsec.c')
-rw-r--r-- | sys/dev/tsec/if_tsec.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/sys/dev/tsec/if_tsec.c b/sys/dev/tsec/if_tsec.c index 7ba7dc6..c924419 100644 --- a/sys/dev/tsec/if_tsec.c +++ b/sys/dev/tsec/if_tsec.c @@ -268,11 +268,12 @@ tsec_attach(struct tsec_softc *sc) ifp->if_capabilities |= IFCAP_POLLING; #endif - /* Probe PHY(s) */ - error = mii_phy_probe(sc->dev, &sc->tsec_miibus, tsec_ifmedia_upd, - tsec_ifmedia_sts); + /* Attach PHY(s) */ + error = mii_attach(sc->dev, &sc->tsec_miibus, ifp, tsec_ifmedia_upd, + tsec_ifmedia_sts, BMSR_DEFCAPMASK, sc->phyaddr, MII_OFFSET_ANY, + 0); if (error) { - device_printf(sc->dev, "MII failed to find PHY!\n"); + device_printf(sc->dev, "attaching PHYs failed\n"); if_free(ifp); sc->tsec_ifp = NULL; tsec_detach(sc); @@ -1561,11 +1562,6 @@ tsec_miibus_readreg(device_t dev, int phy, int reg) struct tsec_softc *sc; uint32_t timeout; - sc = device_get_softc(dev); - - if (sc->phyaddr != phy) - return (0); - sc = tsec0_sc; TSEC_WRITE(sc, TSEC_REG_MIIMADD, (phy << 8) | reg); @@ -1589,11 +1585,6 @@ tsec_miibus_writereg(device_t dev, int phy, int reg, int value) struct tsec_softc *sc; uint32_t timeout; - sc = device_get_softc(dev); - - if (sc->phyaddr != phy) - return (0); - sc = tsec0_sc; TSEC_WRITE(sc, TSEC_REG_MIIMADD, (phy << 8) | reg); |