/* Returns 1 if the MII reports link status up/ok, 0 otherwise.  */
int mii_link_ok(struct mii_if_info *mii)
/* Returns 1 if the MII reports link status up/ok, 0 otherwise.  */
int mii_link_ok(struct mii_if_info *mii)
{
	mii->mdio_read(mii->dev, mii->phy_id, MII_BMSR);
	if (mii->mdio_read(mii->dev, mii->phy_id, MII_BMSR) & BMSR_LSTATUS)
		return 1;
	return 0;
}