lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070807101241.GA13994@moe.telargo.com>
Date:	Tue, 7 Aug 2007 12:12:41 +0200
From:	Domen Puncer <domen.puncer@...argo.com>
To:	netdev@...r.kernel.org
Cc:	macro@...ux-mips.org
Subject: [PATCH] phy layer: fix phy_mii_ioctl for autonegotiation

Fix a thinko (?) in setting phydev->autoneg.


Signed-off-by: Domen Puncer <domen.puncer@...argo.com>

---
This fixes my "mii.h -> ethtool.h advertising #defines". I'm not sure
why and how they're translated, but it does work now.
Maybe they're just ignored, since mii-tool directly reads and writes
MII registers.


 drivers/net/phy/phy.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: work-powerpc.git/drivers/net/phy/phy.c
===================================================================
--- work-powerpc.git.orig/drivers/net/phy/phy.c
+++ work-powerpc.git/drivers/net/phy/phy.c
@@ -261,7 +261,7 @@ void phy_sanitize_settings(struct phy_de
 
 	/* 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);
@@ -374,7 +374,7 @@ int phy_mii_ioctl(struct phy_device *phy
 		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;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ