Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290126
b: refs/heads/master
c: 5015e53
h: refs/heads/master
v: v3
  • Loading branch information
Bruce Allan authored and Jeff Kirsher committed Feb 13, 2012
1 parent a788d13 commit 6e4cc28
Show file tree
Hide file tree
Showing 9 changed files with 213 additions and 304 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a31b37a8956154df099400ba93cd6898a629c6d
refs/heads/master: 5015e53a4cf0c88977120faede7eb02b0459d90e
18 changes: 6 additions & 12 deletions trunk/drivers/net/ethernet/intel/e1000e/80003es2lan.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,22 +714,19 @@ static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)

ret_val = e1e_rphy(hw, GG82563_PHY_DSP_DISTANCE, &phy_data);
if (ret_val)
goto out;
return ret_val;

index = phy_data & GG82563_DSPD_CABLE_LENGTH;

if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) {
ret_val = -E1000_ERR_PHY;
goto out;
}
if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5)
return -E1000_ERR_PHY;

phy->min_cable_length = e1000_gg82563_cable_length_table[index];
phy->max_cable_length = e1000_gg82563_cable_length_table[index + 5];

phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;

out:
return ret_val;
return 0;
}

/**
Expand Down Expand Up @@ -1348,12 +1345,9 @@ static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw)
*/
ret_val = e1000_check_alt_mac_addr_generic(hw);
if (ret_val)
goto out;

ret_val = e1000_read_mac_addr_generic(hw);
return ret_val;

out:
return ret_val;
return e1000_read_mac_addr_generic(hw);
}

/**
Expand Down
30 changes: 11 additions & 19 deletions trunk/drivers/net/ethernet/intel/e1000e/82571.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,6 @@ static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw)
static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw)
{
u32 extcnf_ctrl;
s32 ret_val = 0;
s32 i = 0;

extcnf_ctrl = er32(EXTCNF_CTRL);
Expand All @@ -586,12 +585,10 @@ static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw)
/* Release semaphores */
e1000_put_hw_semaphore_82573(hw);
e_dbg("Driver can't access the PHY\n");
ret_val = -E1000_ERR_PHY;
goto out;
return -E1000_ERR_PHY;
}

out:
return ret_val;
return 0;
}

/**
Expand Down Expand Up @@ -1409,27 +1406,25 @@ bool e1000_check_phy_82574(struct e1000_hw *hw)
{
u16 status_1kbt = 0;
u16 receive_errors = 0;
bool phy_hung = false;
s32 ret_val = 0;

/*
* Read PHY Receive Error counter first, if its is max - all F's then
* read the Base1000T status register If both are max then PHY is hung.
*/
ret_val = e1e_rphy(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors);

if (ret_val)
goto out;
return false;
if (receive_errors == E1000_RECEIVE_ERROR_MAX) {
ret_val = e1e_rphy(hw, E1000_BASE1000T_STATUS, &status_1kbt);
if (ret_val)
goto out;
return false;
if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) ==
E1000_IDLE_ERROR_COUNT_MASK)
phy_hung = true;
return true;
}
out:
return phy_hung;

return false;
}

/**
Expand Down Expand Up @@ -1831,23 +1826,20 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
**/
static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw)
{
s32 ret_val = 0;

if (hw->mac.type == e1000_82571) {
s32 ret_val = 0;

/*
* If there's an alternate MAC address place it in RAR0
* so that it will override the Si installed default perm
* address.
*/
ret_val = e1000_check_alt_mac_addr_generic(hw);
if (ret_val)
goto out;
return ret_val;
}

ret_val = e1000_read_mac_addr_generic(hw);

out:
return ret_val;
return e1000_read_mac_addr_generic(hw);
}

/**
Expand Down
Loading

0 comments on commit 6e4cc28

Please sign in to comment.