Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177163
b: refs/heads/master
c: 734e979
h: refs/heads/master
i:
  177161: 3782d35
  177159: 0539200
v: v3
  • Loading branch information
Mallikarjuna R Chilakala authored and David S. Miller committed Dec 16, 2009
1 parent 6ab9e49 commit 1489a11
Show file tree
Hide file tree
Showing 3 changed files with 41 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: eb985f09b2a189bde80550e410ddfc28c4276c53
refs/heads/master: 734e979f25a74e0d7da4ae0498ecac644db6377d
38 changes: 38 additions & 0 deletions trunk/drivers/net/ixgbe/ixgbe_82598.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,40 @@ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw,
return status;
}

/**
* ixgbe_validate_link_ready - Function looks for phy link
* @hw: pointer to hardware structure
*
* Function indicates success when phy link is available. If phy is not ready
* within 5 seconds of MAC indicating link, the function returns error.
**/
static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw)
{
u32 timeout;
u16 an_reg;

if (hw->device_id != IXGBE_DEV_ID_82598AT2)
return 0;

for (timeout = 0;
timeout < IXGBE_VALIDATE_LINK_READY_TIMEOUT; timeout++) {
hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, &an_reg);

if ((an_reg & MDIO_AN_STAT1_COMPLETE) &&
(an_reg & MDIO_STAT1_LSTATUS))
break;

msleep(100);
}

if (timeout == IXGBE_VALIDATE_LINK_READY_TIMEOUT) {
hw_dbg(hw, "Link was indicated but link is down\n");
return IXGBE_ERR_LINK_SETUP;
}

return 0;
}

/**
* ixgbe_check_mac_link_82598 - Get link/speed status
* @hw: pointer to hardware structure
Expand Down Expand Up @@ -589,6 +623,10 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw,
else
*speed = IXGBE_LINK_SPEED_1GB_FULL;

if ((hw->device_id == IXGBE_DEV_ID_82598AT2) && (*link_up == true) &&
(ixgbe_validate_link_ready(hw) != 0))
*link_up = false;

/* if link is down, zero out the current_mode */
if (*link_up == false) {
hw->fc.current_mode = ixgbe_fc_none;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/ixgbe/ixgbe_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,8 @@
#define IXGBE_MPVC 0x04318
#define IXGBE_SGMIIC 0x04314

#define IXGBE_VALIDATE_LINK_READY_TIMEOUT 50

/* Omer CORECTL */
#define IXGBE_CORECTL 0x014F00
/* BARCTRL */
Expand Down

0 comments on commit 1489a11

Please sign in to comment.