/* Description: Make sure the PHY is set to supported speeds and duplexes. Drop down by one in this order: 1000/FULL, 1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF.  */
void phy_sanitize_settings(struct phy_device *phydev)
/* Description: Make sure the PHY is set to supported speeds and duplexes. Drop down by one in this order: 1000/FULL, 1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF.  */
void phy_sanitize_settings(struct phy_device *phydev)
{
	u32 features = phydev->supported;
	int idx;
	if ((features & SUPPORTED_Autoneg) == 0)
		phydev->autoneg = AUTONEG_DISABLE;
	idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex),
			features);
	phydev->speed = settings[idx].speed;
	phydev->duplex = settings[idx].duplex;
}