提交 a20e4cf9 编写于 作者: B Bruce Allan 提交者: David S. Miller

e1000e: fix incorrect link status when switch module pulled

On 82571 with SerDes, the true link state is not always correct when read
from the STATUS register; use existing e1000_has_link() function instead.
Signed-off-by: NBruce Allan <bruce.w.allan@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 84527590
...@@ -389,6 +389,7 @@ extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter); ...@@ -389,6 +389,7 @@ extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter);
extern void e1000e_free_rx_resources(struct e1000_adapter *adapter); extern void e1000e_free_rx_resources(struct e1000_adapter *adapter);
extern void e1000e_free_tx_resources(struct e1000_adapter *adapter); extern void e1000e_free_tx_resources(struct e1000_adapter *adapter);
extern void e1000e_update_stats(struct e1000_adapter *adapter); extern void e1000e_update_stats(struct e1000_adapter *adapter);
extern bool e1000_has_link(struct e1000_adapter *adapter);
extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter); extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter); extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
......
...@@ -173,11 +173,8 @@ static int e1000_get_settings(struct net_device *netdev, ...@@ -173,11 +173,8 @@ static int e1000_get_settings(struct net_device *netdev,
static u32 e1000_get_link(struct net_device *netdev) static u32 e1000_get_link(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
u32 status; return e1000_has_link(adapter);
status = er32(STATUS);
return (status & E1000_STATUS_LU) ? 1 : 0;
} }
static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx) static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
......
...@@ -3421,7 +3421,7 @@ static void e1000_print_link_info(struct e1000_adapter *adapter) ...@@ -3421,7 +3421,7 @@ static void e1000_print_link_info(struct e1000_adapter *adapter)
((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" ))); ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" )));
} }
static bool e1000_has_link(struct e1000_adapter *adapter) bool e1000_has_link(struct e1000_adapter *adapter)
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
bool link_active = 0; bool link_active = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册