Commit 163642a2 authored by Domen Puncer's avatar Domen Puncer Committed by Jeff Garzik

phy layer: fix phy_mii_ioctl for autonegotiation

Fix a thinko (?) in setting phydev->autoneg.
Signed-off-by: default avatarDomen Puncer <domen.puncer@telargo.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 44a5b3d5
...@@ -261,7 +261,7 @@ void phy_sanitize_settings(struct phy_device *phydev) ...@@ -261,7 +261,7 @@ void phy_sanitize_settings(struct phy_device *phydev)
/* Sanitize settings based on PHY capabilities */ /* Sanitize settings based on PHY capabilities */
if ((features & SUPPORTED_Autoneg) == 0) if ((features & SUPPORTED_Autoneg) == 0)
phydev->autoneg = 0; phydev->autoneg = AUTONEG_DISABLE;
idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex), idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex),
features); features);
...@@ -374,7 +374,7 @@ int phy_mii_ioctl(struct phy_device *phydev, ...@@ -374,7 +374,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
if (mii_data->phy_id == phydev->addr) { if (mii_data->phy_id == phydev->addr) {
switch(mii_data->reg_num) { switch(mii_data->reg_num) {
case MII_BMCR: case MII_BMCR:
if (val & (BMCR_RESET|BMCR_ANENABLE)) if ((val & (BMCR_RESET|BMCR_ANENABLE)) == 0)
phydev->autoneg = AUTONEG_DISABLE; phydev->autoneg = AUTONEG_DISABLE;
else else
phydev->autoneg = AUTONEG_ENABLE; phydev->autoneg = AUTONEG_ENABLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment