diff options
author | Don Skidmore <donald.c.skidmore@intel.com> | 2010-11-16 22:27:15 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2010-11-16 22:27:15 -0500 |
commit | a391f1d51244b8274920a33c5d11aeebec3aa68f (patch) | |
tree | f550a62c357a6f63ee0dc7b77432d7c681663688 /drivers/net/ixgbe/ixgbe_phy.c | |
parent | 9b55bb038468a7b504ccdc1d956952598ae1b85b (diff) |
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>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_phy.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_phy.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c index 6c0d42e33f21..bc255ec48428 100644 --- a/drivers/net/ixgbe/ixgbe_phy.c +++ b/drivers/net/ixgbe/ixgbe_phy.c | |||
@@ -425,6 +425,39 @@ s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw, | |||
425 | } | 425 | } |
426 | 426 | ||
427 | /** | 427 | /** |
428 | * ixgbe_get_copper_link_capabilities_generic - Determines link capabilities | ||
429 | * @hw: pointer to hardware structure | ||
430 | * @speed: pointer to link speed | ||
431 | * @autoneg: boolean auto-negotiation value | ||
432 | * | ||
433 | * Determines the link capabilities by reading the AUTOC register. | ||
434 | */ | ||
435 | s32 ixgbe_get_copper_link_capabilities_generic(struct ixgbe_hw *hw, | ||
436 | ixgbe_link_speed *speed, | ||
437 | bool *autoneg) | ||
438 | { | ||
439 | s32 status = IXGBE_ERR_LINK_SETUP; | ||
440 | u16 speed_ability; | ||
441 | |||
442 | *speed = 0; | ||
443 | *autoneg = true; | ||
444 | |||
445 | status = hw->phy.ops.read_reg(hw, MDIO_SPEED, MDIO_MMD_PMAPMD, | ||
446 | &speed_ability); | ||
447 | |||
448 | if (status == 0) { | ||
449 | if (speed_ability & MDIO_SPEED_10G) | ||
450 | *speed |= IXGBE_LINK_SPEED_10GB_FULL; | ||
451 | if (speed_ability & MDIO_PMA_SPEED_1000) | ||
452 | *speed |= IXGBE_LINK_SPEED_1GB_FULL; | ||
453 | if (speed_ability & MDIO_PMA_SPEED_100) | ||
454 | *speed |= IXGBE_LINK_SPEED_100_FULL; | ||
455 | } | ||
456 | |||
457 | return status; | ||
458 | } | ||
459 | |||
460 | /** | ||
428 | * ixgbe_reset_phy_nl - Performs a PHY reset | 461 | * ixgbe_reset_phy_nl - Performs a PHY reset |
429 | * @hw: pointer to hardware structure | 462 | * @hw: pointer to hardware structure |
430 | **/ | 463 | **/ |