Skip to content

Commit

Permalink
e1000e: fix incorrect link status when switch module pulled
Browse files Browse the repository at this point in the history
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: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Bruce Allan authored and David S. Miller committed Nov 22, 2008
1 parent 8452759 commit a20e4cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions drivers/net/e1000e/e1000.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_tx_resources(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_reset_interrupt_capability(struct e1000_adapter *adapter);

Expand Down
7 changes: 2 additions & 5 deletions drivers/net/e1000e/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,8 @@ static int e1000_get_settings(struct net_device *netdev,
static u32 e1000_get_link(struct net_device *netdev)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
u32 status;

status = er32(STATUS);
return (status & E1000_STATUS_LU) ? 1 : 0;

return e1000_has_link(adapter);
}

static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3421,7 +3421,7 @@ static void e1000_print_link_info(struct e1000_adapter *adapter)
((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;
bool link_active = 0;
Expand Down

0 comments on commit a20e4cf

Please sign in to comment.