diff options
author | Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com> | 2009-09-01 09:49:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-01 20:40:14 -0400 |
commit | 8620a103b5e38d952280f3d97b5e1bcce8d7874c (patch) | |
tree | edb7b63d24fe6208529cef8fadffbdcd12972f6e /drivers/net/ixgbe/ixgbe_main.c | |
parent | fd38d7a0a0618656e491ed67af735bc4e3600367 (diff) |
ixgbe: refactor link setup code
Link code cleanup: a number of redundant functions and MAC variables are cleaned up,
with some functions being consolidated into a single-purpose code path.
Removed following deprecated link functions and mac variables
* ixgbe_setup_copper_link_speed_82598
* ixgbe_setup_mac_link_speed_multispeed_fiber
* ixgbe_setup_mac_link_speed_82599
* mac.autoneg, mac.autoneg_succeeded, phy.autoneg_wait_to_complete
Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index f907836eed22..4042d878670e 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -2516,7 +2516,7 @@ static void ixgbe_sfp_link_config(struct ixgbe_adapter *adapter) | |||
2516 | static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) | 2516 | static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) |
2517 | { | 2517 | { |
2518 | u32 autoneg; | 2518 | u32 autoneg; |
2519 | bool link_up = false; | 2519 | bool negotiation, link_up = false; |
2520 | u32 ret = IXGBE_ERR_LINK_SETUP; | 2520 | u32 ret = IXGBE_ERR_LINK_SETUP; |
2521 | 2521 | ||
2522 | if (hw->mac.ops.check_link) | 2522 | if (hw->mac.ops.check_link) |
@@ -2526,13 +2526,12 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) | |||
2526 | goto link_cfg_out; | 2526 | goto link_cfg_out; |
2527 | 2527 | ||
2528 | if (hw->mac.ops.get_link_capabilities) | 2528 | if (hw->mac.ops.get_link_capabilities) |
2529 | ret = hw->mac.ops.get_link_capabilities(hw, &autoneg, | 2529 | ret = hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation); |
2530 | &hw->mac.autoneg); | ||
2531 | if (ret) | 2530 | if (ret) |
2532 | goto link_cfg_out; | 2531 | goto link_cfg_out; |
2533 | 2532 | ||
2534 | if (hw->mac.ops.setup_link_speed) | 2533 | if (hw->mac.ops.setup_link) |
2535 | ret = hw->mac.ops.setup_link_speed(hw, autoneg, true, link_up); | 2534 | ret = hw->mac.ops.setup_link(hw, autoneg, negotiation, link_up); |
2536 | link_cfg_out: | 2535 | link_cfg_out: |
2537 | return ret; | 2536 | return ret; |
2538 | } | 2537 | } |
@@ -4517,14 +4516,14 @@ static void ixgbe_multispeed_fiber_task(struct work_struct *work) | |||
4517 | multispeed_fiber_task); | 4516 | multispeed_fiber_task); |
4518 | struct ixgbe_hw *hw = &adapter->hw; | 4517 | struct ixgbe_hw *hw = &adapter->hw; |
4519 | u32 autoneg; | 4518 | u32 autoneg; |
4519 | bool negotiation; | ||
4520 | 4520 | ||
4521 | adapter->flags |= IXGBE_FLAG_IN_SFP_LINK_TASK; | 4521 | adapter->flags |= IXGBE_FLAG_IN_SFP_LINK_TASK; |
4522 | autoneg = hw->phy.autoneg_advertised; | 4522 | autoneg = hw->phy.autoneg_advertised; |
4523 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) | 4523 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) |
4524 | hw->mac.ops.get_link_capabilities(hw, &autoneg, | 4524 | hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation); |
4525 | &hw->mac.autoneg); | 4525 | if (hw->mac.ops.setup_link) |
4526 | if (hw->mac.ops.setup_link_speed) | 4526 | hw->mac.ops.setup_link(hw, autoneg, negotiation, true); |
4527 | hw->mac.ops.setup_link_speed(hw, autoneg, true, true); | ||
4528 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; | 4527 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; |
4529 | adapter->flags &= ~IXGBE_FLAG_IN_SFP_LINK_TASK; | 4528 | adapter->flags &= ~IXGBE_FLAG_IN_SFP_LINK_TASK; |
4530 | } | 4529 | } |