/* Description: Configures MII_BMCR to force speed/duplex to the values in phydev. Assumes that the values are valid.  */
static int genphy_setup_forced(struct phy_device *phydev)
/* Description: Configures MII_BMCR to force speed/duplex to the values in phydev. Assumes that the values are valid.  */
static int genphy_setup_forced(struct phy_device *phydev)
{
	int err;
	int ctl = BMCR_ANRESTART;
	phydev->pause = 0;
	phydev->asym_pause = 0;
	if (phydev->speed == SPEED_1000)
		ctl |= BMCR_SPEED1000;
	else if (phydev->speed == SPEED_100)
		ctl |= BMCR_SPEED100;
	if (phydev->duplex == DUPLEX_FULL)
		ctl |= BMCR_FULLDPLX;
	err = phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, ctl);
	return err;
}