All of lore.kernel.org
 help / color / mirror / Atom feed
From: Domen Puncer <domen.puncer@telargo.com>
To: netdev@vger.kernel.org
Cc: macro@linux-mips.org
Subject: [PATCH] phy layer: fix phy_mii_ioctl for autonegotiation
Date: Tue, 7 Aug 2007 12:12:41 +0200	[thread overview]
Message-ID: <20070807101241.GA13994@moe.telargo.com> (raw)

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


Signed-off-by: Domen Puncer <domen.puncer@telargo.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;

             reply	other threads:[~2007-08-07 10:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-07 10:12 Domen Puncer [this message]
2007-08-07 21:34 ` [PATCH] phy layer: fix phy_mii_ioctl for autonegotiation Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070807101241.GA13994@moe.telargo.com \
    --to=domen.puncer@telargo.com \
    --cc=macro@linux-mips.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.