ixgbe: Fix ethtool output with advertised mode.
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / net / ixgbe / ixgbe_ethtool.c
index 18ecba7f6ecb32951ebb82324da1637aaf5cb9c9..34b4a84d2e77f01bbc68acb76030986315e237bc 100644 (file)
@@ -129,6 +129,15 @@ static int ixgbe_get_settings(struct net_device *netdev,
                        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)))
+                       ecmd->advertising |= (ADVERTISED_10000baseT_Full |
+                                             ADVERTISED_1000baseT_Full);
 
                ecmd->port = PORT_TP;
        } else if (hw->phy.media_type == ixgbe_media_type_backplane) {