summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
authorEmil Tantilov2011-07-29 08:46:10 +0200
committerJeff Kirsher2011-08-29 10:33:52 +0200
commitabcc80d26cc0408cad520471a1ada6aa421921ab (patch)
treee9bb504dbf9922b624358c2d9a70c88b8e48f819 /drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
parentixgbe: fix ixgbe_fc_autoneg_fiber bug (diff)
downloadkernel-qcow2-linux-abcc80d26cc0408cad520471a1ada6aa421921ab.tar.gz
kernel-qcow2-linux-abcc80d26cc0408cad520471a1ada6aa421921ab.tar.xz
kernel-qcow2-linux-abcc80d26cc0408cad520471a1ada6aa421921ab.zip
ixgbe: add check for supported modes
When setting advertised speed/duplex with ethtool. Also cleaned up the comment since we also support 100/F. 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>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 82d4244c6e10..9c12b35232af 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -324,12 +324,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)