Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327568
b: refs/heads/master
c: e86fd89
h: refs/heads/master
v: v3
  • Loading branch information
Bruce W Allan authored and Jeff Kirsher committed Aug 21, 2012
1 parent 018acc2 commit 17d8717
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 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: 6f6bbc186dc8e4e0c628db7decbd1a5e02cb5fd8
refs/heads/master: e86fd89188abcc3288ca760a064000054110b2bb
31 changes: 29 additions & 2 deletions trunk/drivers/net/ethernet/intel/e1000e/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ static const u16 e1000_igp_2_cable_length_table[] = {
#define I82577_PHY_STATUS2_SPEED_1000MBPS 0x0200

/* I82577 PHY Control 2 */
#define I82577_PHY_CTRL2_AUTO_MDIX 0x0400
#define I82577_PHY_CTRL2_FORCE_MDI_MDIX 0x0200
#define I82577_PHY_CTRL2_MANUAL_MDIX 0x0200
#define I82577_PHY_CTRL2_AUTO_MDI_MDIX 0x0400
#define I82577_PHY_CTRL2_MDIX_CFG_MASK 0x0600

/* I82577 PHY Diagnostics Status */
#define I82577_DSTATUS_CABLE_LENGTH 0x03FC
Expand Down Expand Up @@ -702,6 +703,32 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
if (ret_val)
return ret_val;

/* Set MDI/MDIX mode */
ret_val = e1e_rphy(hw, I82577_PHY_CTRL_2, &phy_data);
if (ret_val)
return ret_val;
phy_data &= ~I82577_PHY_CTRL2_MDIX_CFG_MASK;
/*
* Options:
* 0 - Auto (default)
* 1 - MDI mode
* 2 - MDI-X mode
*/
switch (hw->phy.mdix) {
case 1:
break;
case 2:
phy_data |= I82577_PHY_CTRL2_MANUAL_MDIX;
break;
case 0:
default:
phy_data |= I82577_PHY_CTRL2_AUTO_MDI_MDIX;
break;
}
ret_val = e1e_wphy(hw, I82577_PHY_CTRL_2, phy_data);
if (ret_val)
return ret_val;

return e1000_set_master_slave_mode(hw);
}

Expand Down

0 comments on commit 17d8717

Please sign in to comment.