Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/jkirsher/net-next
  • Loading branch information
David S. Miller committed Feb 13, 2012
2 parents 2132cf6 + 5015e53 commit 16dc459
Show file tree
Hide file tree
Showing 8 changed files with 265 additions and 373 deletions.
36 changes: 11 additions & 25 deletions drivers/net/ethernet/intel/e1000e/80003es2lan.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,8 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
ret_val = e1000e_read_phy_reg_mdic(hw, page_select, &temp);

if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
ret_val = -E1000_ERR_PHY;
e1000_release_phy_80003es2lan(hw);
return ret_val;
return -E1000_ERR_PHY;
}

udelay(200);
Expand Down Expand Up @@ -715,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 @@ -804,9 +800,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
ew32(IMC, 0xffffffff);
er32(ICR);

ret_val = e1000_check_alt_mac_addr_generic(hw);

return ret_val;
return e1000_check_alt_mac_addr_generic(hw);
}

/**
Expand Down Expand Up @@ -1147,9 +1141,7 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
if (ret_val)
return ret_val;

ret_val = e1000e_setup_copper_link(hw);

return 0;
return e1000e_setup_copper_link(hw);
}

/**
Expand Down Expand Up @@ -1225,9 +1217,7 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
else
reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;

ret_val = e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);

return 0;
return e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
}

/**
Expand Down Expand Up @@ -1269,9 +1259,8 @@ static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
} while ((reg_data != reg_data2) && (i < GG82563_MAX_KMRN_RETRY));

reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
ret_val = e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);

return ret_val;
return e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
}

/**
Expand Down Expand Up @@ -1356,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
36 changes: 13 additions & 23 deletions 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 @@ -796,7 +793,7 @@ static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
* otherwise, commit the checksum to the flash NVM.
*/
if (hw->nvm.type != e1000_nvm_flash_hw)
return ret_val;
return 0;

/* Check for pending operations. */
for (i = 0; i < E1000_FLASH_UPDATES; i++) {
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 @@ -1497,9 +1492,7 @@ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw)
if (ret_val)
return ret_val;

ret_val = e1000e_setup_copper_link(hw);

return ret_val;
return e1000e_setup_copper_link(hw);
}

/**
Expand Down Expand Up @@ -1833,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 16dc459

Please sign in to comment.