Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340468
b: refs/heads/master
c: 59f3010
h: refs/heads/master
v: v3
  • Loading branch information
Carolyn Wyborny authored and Jeff Kirsher committed Oct 23, 2012
1 parent 4360231 commit 6510ae8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6fde11a9dbcf27a2766a1ea0fb5d6267c45af02
refs/heads/master: 59f301046b276f87483b3afa3201a4273def06a9
20 changes: 20 additions & 0 deletions trunk/drivers/net/ethernet/intel/igb/e1000_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,26 @@ s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw)

switch (hw->phy.id) {
case I210_I_PHY_ID:
/* Get cable length from PHY Cable Diagnostics Control Reg */
ret_val = phy->ops.read_reg(hw, (0x7 << GS40G_PAGE_SHIFT) +
(I347AT4_PCDL + phy->addr),
&phy_data);
if (ret_val)
return ret_val;

/* Check if the unit of cable length is meters or cm */
ret_val = phy->ops.read_reg(hw, (0x7 << GS40G_PAGE_SHIFT) +
I347AT4_PCDC, &phy_data2);
if (ret_val)
return ret_val;

is_cm = !(phy_data2 & I347AT4_PCDC_CABLE_LENGTH_UNIT);

/* Populate the phy structure with cable length in meters */
phy->min_cable_length = phy_data / (is_cm ? 100 : 1);
phy->max_cable_length = phy_data / (is_cm ? 100 : 1);
phy->cable_length = phy_data / (is_cm ? 100 : 1);
break;
case I347AT4_E_PHY_ID:
/* Remember the original page select and set it to 7 */
ret_val = phy->ops.read_reg(hw, I347AT4_PAGE_SELECT,
Expand Down

0 comments on commit 6510ae8

Please sign in to comment.