From: Emil Tantilov Date: Fri, 29 Jul 2011 06:46:10 +0000 (+0000) Subject: ixgbe: add check for supported modes X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~202 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7d9fbf05ebfac7804135c01adccc156178b72731;p=users%2Fjedix%2Flinux-maple.git ixgbe: add check for supported modes When setting advertised speed/duplex with ethtool. Also cleaned up the comment since we also support 100/F. (cherry picked from commit abcc80d26cc0408cad520471a1ada6aa421921ab) Signed-off-by: Emil Tantilov Tested-by: Phil Schmitt Signed-off-by: Jeff Kirsher Signed-off-by: Joe Jin --- diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index ca6f8cfa294a..e15f9c2a26cf 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c @@ -323,12 +323,16 @@ static int ixgbe_set_settings(struct net_device *netdev, if ((hw->phy.media_type == ixgbe_media_type_copper) || (hw->phy.multispeed_fiber)) { - /* 10000/copper and 1000/copper must autoneg - * this function does not support any duplex forcing, but can - * limit the advertising of the adapter to only 10000 or 1000 */ + /* + * this function does not support duplex forcing, but can + * limit the advertising of the adapter to the specified speed + */ if (ecmd->autoneg == AUTONEG_DISABLE) return -EINVAL; + if (ecmd->advertising & ~ecmd->supported) + return -EINVAL; + old = hw->phy.autoneg_advertised; advertised = 0; if (ecmd->advertising & ADVERTISED_10000baseT_Full)