Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/neta/if_mvneta.c
Show First 20 Lines • Show All 725 Lines • ▼ Show 20 Lines | if (mii_init == 0) { | ||||
* serializing the bus access should be safe. | * serializing the bus access should be safe. | ||||
*/ | */ | ||||
mtx_init(&mii_mutex, "mvneta_mii", NULL, MTX_DEF); | mtx_init(&mii_mutex, "mvneta_mii", NULL, MTX_DEF); | ||||
mii_init = 1; | mii_init = 1; | ||||
} | } | ||||
/* Attach PHY(s) */ | /* Attach PHY(s) */ | ||||
if ((sc->phy_addr != MII_PHY_ANY) && (!sc->use_inband_status)) { | if ((sc->phy_addr != MII_PHY_ANY) && (!sc->use_inband_status)) { | ||||
error = mii_attach(self, &sc->miibus, ifp, mvneta_mediachange, | error = mii_attach(sc->phy_dev, &sc->miibus, ifp, | ||||
mvneta_mediastatus, BMSR_DEFCAPMASK, sc->phy_addr, | mvneta_mediachange, mvneta_mediastatus, | ||||
MII_OFFSET_ANY, 0); | BMSR_DEFCAPMASK, sc->phy_addr, MII_OFFSET_ANY, 0); | ||||
if (error != 0) { | if (error != 0) { | ||||
if (bootverbose) { | if (bootverbose) { | ||||
device_printf(self, | device_printf(self, | ||||
"MII attach failed, error: %d\n", error); | "MII attach failed, error: %d\n", error); | ||||
} | } | ||||
ether_ifdetach(sc->ifp); | ether_ifdetach(sc->ifp); | ||||
mvneta_detach(self); | mvneta_detach(self); | ||||
return (error); | return (error); | ||||
▲ Show 20 Lines • Show All 2,900 Lines • Show Last 20 Lines |