]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ixgbe: add check for supported modes
authorEmil Tantilov <emil.s.tantilov@intel.com>
Fri, 29 Jul 2011 06:46:10 +0000 (06:46 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 14:02:23 +0000 (22:02 +0800)
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 <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/ixgbe/ixgbe_ethtool.c

index ca6f8cfa294a91acc0dbefb8acb54be34e4a73c3..e15f9c2a26cf4ad4310a4f2265417c4016b542f7 100644 (file)
@@ -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)