phy layer: fix phy_mii_ioctl for autonegotiation
Fix a thinko (?) in setting phydev->autoneg. Signed-off-by: Domen Puncer <domen.puncer@telargo.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
committed by
Jeff Garzik
parent
44a5b3d539
commit
163642a24a
@@ -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,
|
|||||||
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;
|
||||||
|
Reference in New Issue
Block a user