Skip to content

Commit

Permalink
ixgbe: fix setting and reporting of advertised speeds
Browse files Browse the repository at this point in the history
Add the ability to set 100/F on x540.
Fix reporting of advertised modes by adding check for phy.autoneg_advertised

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Emil Tantilov authored and Jeff Kirsher committed Mar 8, 2011
1 parent da74cd4 commit 2b642ca
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions drivers/net/ixgbe/ixgbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,29 +161,25 @@ static int ixgbe_get_settings(struct net_device *netdev,
}

ecmd->advertising = ADVERTISED_Autoneg;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL)
ecmd->advertising |= ADVERTISED_100baseT_Full;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)
ecmd->advertising |= ADVERTISED_10000baseT_Full;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL)
ecmd->advertising |= ADVERTISED_1000baseT_Full;
/*
* It's possible that phy.autoneg_advertised may not be
* set yet. If so display what the default would be -
* both 1G and 10G supported.
*/
if (!(ecmd->advertising & (ADVERTISED_1000baseT_Full |
ADVERTISED_10000baseT_Full)))
if (hw->phy.autoneg_advertised) {
if (hw->phy.autoneg_advertised &
IXGBE_LINK_SPEED_100_FULL)
ecmd->advertising |= ADVERTISED_100baseT_Full;
if (hw->phy.autoneg_advertised &
IXGBE_LINK_SPEED_10GB_FULL)
ecmd->advertising |= ADVERTISED_10000baseT_Full;
if (hw->phy.autoneg_advertised &
IXGBE_LINK_SPEED_1GB_FULL)
ecmd->advertising |= ADVERTISED_1000baseT_Full;
} else {
/*
* Default advertised modes in case
* phy.autoneg_advertised isn't set.
*/
ecmd->advertising |= (ADVERTISED_10000baseT_Full |
ADVERTISED_1000baseT_Full);

switch (hw->mac.type) {
case ixgbe_mac_X540:
if (!(ecmd->advertising & ADVERTISED_100baseT_Full))
ecmd->advertising |= (ADVERTISED_100baseT_Full);
break;
default:
break;
if (hw->mac.type == ixgbe_mac_X540)
ecmd->advertising |= ADVERTISED_100baseT_Full;
}

if (hw->phy.media_type == ixgbe_media_type_copper) {
Expand Down Expand Up @@ -336,6 +332,9 @@ static int ixgbe_set_settings(struct net_device *netdev,
if (ecmd->advertising & ADVERTISED_1000baseT_Full)
advertised |= IXGBE_LINK_SPEED_1GB_FULL;

if (ecmd->advertising & ADVERTISED_100baseT_Full)
advertised |= IXGBE_LINK_SPEED_100_FULL;

if (old == advertised)
return err;
/* this sets the link speed and restarts auto-neg */
Expand Down

0 comments on commit 2b642ca

Please sign in to comment.