Skip to content

Commit

Permalink
phy layer: fix phy_mii_ioctl for autonegotiation
Browse files Browse the repository at this point in the history
Fix a thinko (?) in setting phydev->autoneg.

Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Domen Puncer authored and Jeff Garzik committed Aug 7, 2007
1 parent 44a5b3d commit 163642a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void phy_sanitize_settings(struct phy_device *phydev)

/* Sanitize settings based on PHY capabilities */
if ((features & SUPPORTED_Autoneg) == 0)
phydev->autoneg = 0;
phydev->autoneg = AUTONEG_DISABLE;

idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex),
features);
Expand Down Expand Up @@ -374,7 +374,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
if (mii_data->phy_id == phydev->addr) {
switch(mii_data->reg_num) {
case MII_BMCR:
if (val & (BMCR_RESET|BMCR_ANENABLE))
if ((val & (BMCR_RESET|BMCR_ANENABLE)) == 0)
phydev->autoneg = AUTONEG_DISABLE;
else
phydev->autoneg = AUTONEG_ENABLE;
Expand Down

0 comments on commit 163642a

Please sign in to comment.