Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170439
b: refs/heads/master
c: 81fadd8
h: refs/heads/master
i:
  170437: 451ab80
  170435: f027253
  170431: fea1266
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Oct 6, 2009
1 parent b5a9a9f commit 4de7e32
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 42 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: 285b4167458ec7cc49008b2e61cbe0362deed335
refs/heads/master: 81fadd81a5bc897c8d0424d1cd90cb999d8e12b0
40 changes: 1 addition & 39 deletions trunk/drivers/net/igb/e1000_82575.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,6 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
{
u32 ctrl;
s32 ret_val;
bool link;

ctrl = rd32(E1000_CTRL);
ctrl |= E1000_CTRL_SLU;
Expand Down Expand Up @@ -940,44 +939,7 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
if (ret_val)
goto out;

if (hw->mac.autoneg) {
/*
* Setup autoneg and flow control advertisement
* and perform autonegotiation.
*/
ret_val = igb_copper_link_autoneg(hw);
if (ret_val)
goto out;
} else {
/*
* PHY will be set to 10H, 10F, 100H or 100F
* depending on user settings.
*/
hw_dbg("Forcing Speed and Duplex\n");
ret_val = hw->phy.ops.force_speed_duplex(hw);
if (ret_val) {
hw_dbg("Error Forcing Speed and Duplex\n");
goto out;
}
}

/*
* Check link status. Wait up to 100 microseconds for link to become
* valid.
*/
ret_val = igb_phy_has_link(hw, COPPER_LINK_UP_LIMIT, 10, &link);
if (ret_val)
goto out;

if (link) {
hw_dbg("Valid link established!!!\n");
/* Config the MAC and PHY after link is up */
igb_config_collision_dist(hw);
ret_val = igb_config_fc_after_link_up(hw);
} else {
hw_dbg("Unable to establish link!!!\n");
}

ret_val = igb_setup_copper_link(hw);
out:
return ret_val;
}
Expand Down
61 changes: 60 additions & 1 deletion trunk/drivers/net/igb/e1000_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ s32 igb_copper_link_setup_igp(struct e1000_hw *hw)
* and restart the negotiation process between the link partner. If
* autoneg_wait_to_complete, then wait for autoneg to complete before exiting.
**/
s32 igb_copper_link_autoneg(struct e1000_hw *hw)
static s32 igb_copper_link_autoneg(struct e1000_hw *hw)
{
struct e1000_phy_info *phy = &hw->phy;
s32 ret_val;
Expand Down Expand Up @@ -892,6 +892,65 @@ static s32 igb_phy_setup_autoneg(struct e1000_hw *hw)
return ret_val;
}

/**
* igb_setup_copper_link - Configure copper link settings
* @hw: pointer to the HW structure
*
* Calls the appropriate function to configure the link for auto-neg or forced
* speed and duplex. Then we check for link, once link is established calls
* to configure collision distance and flow control are called. If link is
* not established, we return -E1000_ERR_PHY (-2).
**/
s32 igb_setup_copper_link(struct e1000_hw *hw)
{
s32 ret_val;
bool link;


if (hw->mac.autoneg) {
/*
* Setup autoneg and flow control advertisement and perform
* autonegotiation.
*/
ret_val = igb_copper_link_autoneg(hw);
if (ret_val)
goto out;
} else {
/*
* PHY will be set to 10H, 10F, 100H or 100F
* depending on user settings.
*/
hw_dbg("Forcing Speed and Duplex\n");
ret_val = hw->phy.ops.force_speed_duplex(hw);
if (ret_val) {
hw_dbg("Error Forcing Speed and Duplex\n");
goto out;
}
}

/*
* Check link status. Wait up to 100 microseconds for link to become
* valid.
*/
ret_val = igb_phy_has_link(hw,
COPPER_LINK_UP_LIMIT,
10,
&link);
if (ret_val)
goto out;

if (link) {
hw_dbg("Valid link established!!!\n");
igb_config_collision_dist(hw);
ret_val = igb_config_fc_after_link_up(hw);
} else {
hw_dbg("Unable to establish link!!!\n");
}

out:
return ret_val;
}

/**
* igb_phy_force_speed_duplex_igp - Force speed/duplex for igp PHY
* @hw: pointer to the HW structure
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/igb/e1000_phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ enum e1000_smart_speed {

s32 igb_check_downshift(struct e1000_hw *hw);
s32 igb_check_reset_block(struct e1000_hw *hw);
s32 igb_copper_link_autoneg(struct e1000_hw *hw);
s32 igb_copper_link_setup_igp(struct e1000_hw *hw);
s32 igb_copper_link_setup_m88(struct e1000_hw *hw);
s32 igb_phy_force_speed_duplex_igp(struct e1000_hw *hw);
Expand All @@ -57,6 +56,7 @@ s32 igb_phy_sw_reset(struct e1000_hw *hw);
s32 igb_phy_hw_reset(struct e1000_hw *hw);
s32 igb_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data);
s32 igb_set_d3_lplu_state(struct e1000_hw *hw, bool active);
s32 igb_setup_copper_link(struct e1000_hw *hw);
s32 igb_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations,
u32 usec_interval, bool *success);
Expand Down

0 comments on commit 4de7e32

Please sign in to comment.