aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_ethtool.c
diff options
context:
space:
mode:
authorNick Nunley <nicholasx.d.nunley@intel.com>2010-02-03 09:49:28 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-03 22:39:56 -0500
commitb548192acaebcb05d6a87d1e94f19835b1a18a8b (patch)
treed84ebe0a50cbeba290d01525ec14d3c91f713e24 /drivers/net/e1000/e1000_ethtool.c
parent10eec95569513206877769ad9336591c08015cfe (diff)
e1000: Report link status in ethtool when interface is down
With this change ethtool will correctly report link status when the interface is down. Currently ethtool reports the link as not detected when the interface is down. Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000/e1000_ethtool.c')
-rw-r--r--drivers/net/e1000/e1000_ethtool.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 13e9ece16889..c67e93117271 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -215,6 +215,23 @@ static int e1000_set_settings(struct net_device *netdev,
215 return 0; 215 return 0;
216} 216}
217 217
218static u32 e1000_get_link(struct net_device *netdev)
219{
220 struct e1000_adapter *adapter = netdev_priv(netdev);
221
222 /*
223 * If the link is not reported up to netdev, interrupts are disabled,
224 * and so the physical link state may have changed since we last
225 * looked. Set get_link_status to make sure that the true link
226 * state is interrogated, rather than pulling a cached and possibly
227 * stale link state from the driver.
228 */
229 if (!netif_carrier_ok(netdev))
230 adapter->hw.get_link_status = 1;
231
232 return e1000_has_link(adapter);
233}
234
218static void e1000_get_pauseparam(struct net_device *netdev, 235static void e1000_get_pauseparam(struct net_device *netdev,
219 struct ethtool_pauseparam *pause) 236 struct ethtool_pauseparam *pause)
220{ 237{
@@ -1892,7 +1909,7 @@ static const struct ethtool_ops e1000_ethtool_ops = {
1892 .get_msglevel = e1000_get_msglevel, 1909 .get_msglevel = e1000_get_msglevel,
1893 .set_msglevel = e1000_set_msglevel, 1910 .set_msglevel = e1000_set_msglevel,
1894 .nway_reset = e1000_nway_reset, 1911 .nway_reset = e1000_nway_reset,
1895 .get_link = ethtool_op_get_link, 1912 .get_link = e1000_get_link,
1896 .get_eeprom_len = e1000_get_eeprom_len, 1913 .get_eeprom_len = e1000_get_eeprom_len,
1897 .get_eeprom = e1000_get_eeprom, 1914 .get_eeprom = e1000_get_eeprom,
1898 .set_eeprom = e1000_set_eeprom, 1915 .set_eeprom = e1000_set_eeprom,