Commit 2b642ca5 authored by Emil Tantilov's avatar Emil Tantilov Committed by Jeff Kirsher

ixgbe: fix setting and reporting of advertised speeds

Add the ability to set 100/F on x540.
Fix reporting of advertised modes by adding check for phy.autoneg_advertised
Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
Tested-by: default avatarStephen Ko <stephen.s.ko@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent da74cd4a
...@@ -161,29 +161,25 @@ static int ixgbe_get_settings(struct net_device *netdev, ...@@ -161,29 +161,25 @@ static int ixgbe_get_settings(struct net_device *netdev,
} }
ecmd->advertising = ADVERTISED_Autoneg; ecmd->advertising = ADVERTISED_Autoneg;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL) if (hw->phy.autoneg_advertised) {
ecmd->advertising |= ADVERTISED_100baseT_Full; if (hw->phy.autoneg_advertised &
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL) IXGBE_LINK_SPEED_100_FULL)
ecmd->advertising |= ADVERTISED_10000baseT_Full; ecmd->advertising |= ADVERTISED_100baseT_Full;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) if (hw->phy.autoneg_advertised &
ecmd->advertising |= ADVERTISED_1000baseT_Full; IXGBE_LINK_SPEED_10GB_FULL)
/* ecmd->advertising |= ADVERTISED_10000baseT_Full;
* It's possible that phy.autoneg_advertised may not be if (hw->phy.autoneg_advertised &
* set yet. If so display what the default would be - IXGBE_LINK_SPEED_1GB_FULL)
* both 1G and 10G supported. ecmd->advertising |= ADVERTISED_1000baseT_Full;
*/ } else {
if (!(ecmd->advertising & (ADVERTISED_1000baseT_Full | /*
ADVERTISED_10000baseT_Full))) * Default advertised modes in case
* phy.autoneg_advertised isn't set.
*/
ecmd->advertising |= (ADVERTISED_10000baseT_Full | ecmd->advertising |= (ADVERTISED_10000baseT_Full |
ADVERTISED_1000baseT_Full); ADVERTISED_1000baseT_Full);
if (hw->mac.type == ixgbe_mac_X540)
switch (hw->mac.type) { ecmd->advertising |= ADVERTISED_100baseT_Full;
case ixgbe_mac_X540:
if (!(ecmd->advertising & ADVERTISED_100baseT_Full))
ecmd->advertising |= (ADVERTISED_100baseT_Full);
break;
default:
break;
} }
if (hw->phy.media_type == ixgbe_media_type_copper) { if (hw->phy.media_type == ixgbe_media_type_copper) {
...@@ -336,6 +332,9 @@ static int ixgbe_set_settings(struct net_device *netdev, ...@@ -336,6 +332,9 @@ static int ixgbe_set_settings(struct net_device *netdev,
if (ecmd->advertising & ADVERTISED_1000baseT_Full) if (ecmd->advertising & ADVERTISED_1000baseT_Full)
advertised |= IXGBE_LINK_SPEED_1GB_FULL; advertised |= IXGBE_LINK_SPEED_1GB_FULL;
if (ecmd->advertising & ADVERTISED_100baseT_Full)
advertised |= IXGBE_LINK_SPEED_100_FULL;
if (old == advertised) if (old == advertised)
return err; return err;
/* this sets the link speed and restarts auto-neg */ /* this sets the link speed and restarts auto-neg */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment