ixgbe: make silicon specific functions generic
The new MAC type X540 shares much of the same functionality of some silicon specific functions. To reduce duplicate code, made these functions generic. Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
committed by
Jeff Kirsher
parent
9b55bb0384
commit
a391f1d512
@@ -424,6 +424,39 @@ s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_get_copper_link_capabilities_generic - Determines link capabilities
|
||||
* @hw: pointer to hardware structure
|
||||
* @speed: pointer to link speed
|
||||
* @autoneg: boolean auto-negotiation value
|
||||
*
|
||||
* Determines the link capabilities by reading the AUTOC register.
|
||||
*/
|
||||
s32 ixgbe_get_copper_link_capabilities_generic(struct ixgbe_hw *hw,
|
||||
ixgbe_link_speed *speed,
|
||||
bool *autoneg)
|
||||
{
|
||||
s32 status = IXGBE_ERR_LINK_SETUP;
|
||||
u16 speed_ability;
|
||||
|
||||
*speed = 0;
|
||||
*autoneg = true;
|
||||
|
||||
status = hw->phy.ops.read_reg(hw, MDIO_SPEED, MDIO_MMD_PMAPMD,
|
||||
&speed_ability);
|
||||
|
||||
if (status == 0) {
|
||||
if (speed_ability & MDIO_SPEED_10G)
|
||||
*speed |= IXGBE_LINK_SPEED_10GB_FULL;
|
||||
if (speed_ability & MDIO_PMA_SPEED_1000)
|
||||
*speed |= IXGBE_LINK_SPEED_1GB_FULL;
|
||||
if (speed_ability & MDIO_PMA_SPEED_100)
|
||||
*speed |= IXGBE_LINK_SPEED_100_FULL;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_reset_phy_nl - Performs a PHY reset
|
||||
* @hw: pointer to hardware structure
|
||||
|
||||
Reference in New Issue
Block a user