net/ixgbe/base: clean up X557 link status check
This patch cleans up the code and clarifies the comment around the X557 PHY link status check in ixgbe_check_link_t_x550em(). Signed-off-by: Wei Dai <wei.dai@intel.com>
This commit is contained in:
parent
5b313c497f
commit
2f8c0a2335
@ -4660,7 +4660,7 @@ s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
|
|||||||
bool *link_up, bool link_up_wait_to_complete)
|
bool *link_up, bool link_up_wait_to_complete)
|
||||||
{
|
{
|
||||||
u32 status;
|
u32 status;
|
||||||
u16 autoneg_status;
|
u16 i, autoneg_status = 0;
|
||||||
|
|
||||||
if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
|
if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
|
||||||
return IXGBE_ERR_CONFIG;
|
return IXGBE_ERR_CONFIG;
|
||||||
@ -4673,21 +4673,18 @@ s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
|
|||||||
return status;
|
return status;
|
||||||
|
|
||||||
/* MAC link is up, so check external PHY link.
|
/* MAC link is up, so check external PHY link.
|
||||||
* Read this twice back to back to indicate current status.
|
* X557 PHY. Link status is latching low, and can only be used to detect
|
||||||
|
* link drop, and not the current status of the link without performing
|
||||||
|
* back-to-back reads.
|
||||||
*/
|
*/
|
||||||
status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
|
for (i = 0; i < 2; i++) {
|
||||||
IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
|
status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
|
||||||
&autoneg_status);
|
IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
|
||||||
|
&autoneg_status);
|
||||||
|
|
||||||
if (status != IXGBE_SUCCESS)
|
if (status != IXGBE_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
|
}
|
||||||
status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
|
|
||||||
IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
|
|
||||||
&autoneg_status);
|
|
||||||
|
|
||||||
if (status != IXGBE_SUCCESS)
|
|
||||||
return status;
|
|
||||||
|
|
||||||
/* If external PHY link is not up, then indicate link not up */
|
/* If external PHY link is not up, then indicate link not up */
|
||||||
if (!(autoneg_status & IXGBE_MDIO_AUTO_NEG_LINK_STATUS))
|
if (!(autoneg_status & IXGBE_MDIO_AUTO_NEG_LINK_STATUS))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user