jme: Add comment in jme_set_settings
authorGuo-Fu Tseng <cooldavid@cooldavid.org>
Mon, 18 Oct 2010 11:52:27 +0000 (19:52 +0800)
committerGuo-Fu Tseng <cooldavid@cooldavid.org>
Mon, 18 Oct 2010 23:51:46 +0000 (07:51 +0800)
Explains what `fdc` variable is for.

jme.c

diff --git a/jme.c b/jme.c
index d7d2140..e3db53f 100644 (file)
--- a/jme.c
+++ b/jme.c
@@ -2493,6 +2493,10 @@ jme_set_settings(struct net_device *netdev,
        if (ecmd->speed == SPEED_1000 && ecmd->autoneg != AUTONEG_ENABLE)
                return -EINVAL;
 
+       /*
+        * Check If user changed duplex only while force_media.
+        * Hardware would not generate link change interrupt.
+        */
        if (jme->mii_if.force_media &&
        ecmd->autoneg != AUTONEG_ENABLE &&
        (jme->mii_if.full_duplex != ecmd->duplex))
@@ -2502,10 +2506,9 @@ jme_set_settings(struct net_device *netdev,
        rc = mii_ethtool_sset(&(jme->mii_if), ecmd);
        spin_unlock_bh(&jme->phy_lock);
 
-       if (!rc && fdc)
-               jme_reset_link(jme);
-
        if (!rc) {
+               if (fdc)
+                       jme_reset_link(jme);
                set_bit(JME_FLAG_SSET, &jme->flags);
                jme->old_ecmd = *ecmd;
        }