be2net: Fix to apply duplex value as unknown when link is down.
authorSomnath Kotur <somnath.kotur@emulex.com>
Wed, 2 May 2012 03:40:32 +0000 (03:40 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 May 2012 01:07:24 +0000 (21:07 -0400)
Suggested-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_ethtool.c

index c9ba2cbbd51849a686f09744dc655e5ce2f28e2b..747f68fa976d9a3cc92f57a39b9e1e51b0a9c354 100644 (file)
@@ -618,7 +618,7 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
                ecmd->supported = adapter->phy.supported;
        }
 
-       ecmd->duplex = DUPLEX_FULL;
+       ecmd->duplex = netif_carrier_ok(netdev) ? DUPLEX_FULL : DUPLEX_UNKNOWN;
        ecmd->phy_address = adapter->port_num;
 
        return 0;