aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/e1000/e1000.h1
-rw-r--r--drivers/net/e1000/e1000_ethtool.c19
-rw-r--r--drivers/net/e1000/e1000_main.c2
3 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index e8932db7ee77..9902b33b7160 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -349,6 +349,7 @@ extern int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
349extern void e1000_free_all_rx_resources(struct e1000_adapter *adapter); 349extern void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
350extern void e1000_free_all_tx_resources(struct e1000_adapter *adapter); 350extern void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
351extern void e1000_update_stats(struct e1000_adapter *adapter); 351extern void e1000_update_stats(struct e1000_adapter *adapter);
352extern bool e1000_has_link(struct e1000_adapter *adapter);
352extern void e1000_power_up_phy(struct e1000_adapter *); 353extern void e1000_power_up_phy(struct e1000_adapter *);
353extern void e1000_set_ethtool_ops(struct net_device *netdev); 354extern void e1000_set_ethtool_ops(struct net_device *netdev);
354extern void e1000_check_options(struct e1000_adapter *adapter); 355extern void e1000_check_options(struct e1000_adapter *adapter);
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,
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index b608528f26fc..4ff50d6fe5e4 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2246,7 +2246,7 @@ static void e1000_82547_tx_fifo_stall(unsigned long data)
2246 } 2246 }
2247} 2247}
2248 2248
2249static bool e1000_has_link(struct e1000_adapter *adapter) 2249bool e1000_has_link(struct e1000_adapter *adapter)
2250{ 2250{
2251 struct e1000_hw *hw = &adapter->hw; 2251 struct e1000_hw *hw = &adapter->hw;
2252 bool link_active = false; 2252 bool link_active = false;