From b737a6cb2a872ab2ac04935954a96189b93d77b6 Mon Sep 17 00:00:00 2001 From: Don Skidmore Date: Mon, 26 Jan 2009 20:57:17 -0800 Subject: [PATCH] --- yaml --- r: 133906 b: refs/heads/master c: 5b9c3cdd55ba57a25ae586373aaff723d8150085 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/ixgbe/ixgbe_main.c | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index a30f4612355d..9079d0979b89 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: afcf12422ec8236dc8b9238fef7a475876eea8da +refs/heads/master: 5b9c3cdd55ba57a25ae586373aaff723d8150085 diff --git a/trunk/drivers/net/ixgbe/ixgbe_main.c b/trunk/drivers/net/ixgbe/ixgbe_main.c index f7b592eff68e..18d4353afa65 100644 --- a/trunk/drivers/net/ixgbe/ixgbe_main.c +++ b/trunk/drivers/net/ixgbe/ixgbe_main.c @@ -3901,16 +3901,27 @@ static void ixgbe_netpoll(struct net_device *netdev) **/ static int ixgbe_link_config(struct ixgbe_hw *hw) { - u32 autoneg = IXGBE_LINK_SPEED_10GB_FULL; + u32 autoneg; + bool link_up = false; + u32 ret = IXGBE_ERR_LINK_SETUP; - /* must always autoneg for both 1G and 10G link */ - hw->mac.autoneg = true; + if (hw->mac.ops.check_link) + ret = hw->mac.ops.check_link(hw, &autoneg, &link_up, false); - if ((hw->mac.type == ixgbe_mac_82598EB) && - (hw->phy.media_type == ixgbe_media_type_copper)) - autoneg = IXGBE_LINK_SPEED_82598_AUTONEG; + if (ret || !link_up) + goto link_cfg_out; - return hw->mac.ops.setup_link_speed(hw, autoneg, true, true); + if (hw->mac.ops.get_link_capabilities) + ret = hw->mac.ops.get_link_capabilities(hw, &autoneg, + &hw->mac.autoneg); + if (ret) + goto link_cfg_out; + + if (hw->mac.ops.setup_link_speed) + ret = hw->mac.ops.setup_link_speed(hw, autoneg, true, true); + +link_cfg_out: + return ret; } static const struct net_device_ops ixgbe_netdev_ops = {