Commit:     024a0a3cfb4c98cb3c6c81ec70672c6a925cf164
Parent:     2b272221ad3d5c686f1d5ffb3b3c8a45120ad765
Author:     Shan Lu <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 6 02:42:03 2007 -0800
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Sat Apr 28 11:00:57 2007 -0400

    network: add the missing phy_device speed information to phy_mii_ioctl
    Function `phy_mii_ioctl' returns physical device's information based on
    user requests.  When requested to return the basic mode control register
    information (BMCR), the original implementation only returns the physical
    device's duplex information and forgets to return speed information, which
    should not be because BMCR register is used to hold both duplex and speed
    The patch checks the BMCR value against speed-related flags and fills the
    return structure's speed field accordingly.
    Signed-off-by: Shan <[EMAIL PROTECTED]>
    Cc: Jeff Garzik <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
 drivers/net/phy/phy.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index a602d06..eed433d 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -382,6 +382,12 @@ int phy_mii_ioctl(struct phy_device *phydev,
                                        phydev->duplex = DUPLEX_FULL;
                                        phydev->duplex = DUPLEX_HALF;
+                               if ((!phydev->autoneg) &&
+                                               (val & BMCR_SPEED1000))
+                                       phydev->speed = SPEED_1000;
+                               else if ((!phydev->autoneg) &&
+                                               (val & BMCR_SPEED100))
+                                       phydev->speed = SPEED_100;
                        case MII_ADVERTISE:
                                phydev->advertising = val;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to