diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 0e1b973659b0..e8649abf97c0 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | |||
@@ -160,6 +160,13 @@ static int ixgbe_get_settings(struct net_device *netdev, | |||
160 | bool autoneg = false; | 160 | bool autoneg = false; |
161 | bool link_up; | 161 | bool link_up; |
162 | 162 | ||
163 | /* SFP type is needed for get_link_capabilities */ | ||
164 | if (hw->phy.media_type & (ixgbe_media_type_fiber | | ||
165 | ixgbe_media_type_fiber_qsfp)) { | ||
166 | if (hw->phy.sfp_type == ixgbe_sfp_type_not_present) | ||
167 | hw->phy.ops.identify_sfp(hw); | ||
168 | } | ||
169 | |||
163 | hw->mac.ops.get_link_capabilities(hw, &supported_link, &autoneg); | 170 | hw->mac.ops.get_link_capabilities(hw, &supported_link, &autoneg); |
164 | 171 | ||
165 | /* set the supported link speeds */ | 172 | /* set the supported link speeds */ |
@@ -186,6 +193,11 @@ static int ixgbe_get_settings(struct net_device *netdev, | |||
186 | ecmd->advertising |= ADVERTISED_1000baseT_Full; | 193 | ecmd->advertising |= ADVERTISED_1000baseT_Full; |
187 | if (supported_link & IXGBE_LINK_SPEED_100_FULL) | 194 | if (supported_link & IXGBE_LINK_SPEED_100_FULL) |
188 | ecmd->advertising |= ADVERTISED_100baseT_Full; | 195 | ecmd->advertising |= ADVERTISED_100baseT_Full; |
196 | |||
197 | if (hw->phy.multispeed_fiber && !autoneg) { | ||
198 | if (supported_link & IXGBE_LINK_SPEED_10GB_FULL) | ||
199 | ecmd->advertising = ADVERTISED_10000baseT_Full; | ||
200 | } | ||
189 | } | 201 | } |
190 | 202 | ||
191 | if (autoneg) { | 203 | if (autoneg) { |
@@ -314,6 +326,14 @@ static int ixgbe_set_settings(struct net_device *netdev, | |||
314 | if (ecmd->advertising & ~ecmd->supported) | 326 | if (ecmd->advertising & ~ecmd->supported) |
315 | return -EINVAL; | 327 | return -EINVAL; |
316 | 328 | ||
329 | /* only allow one speed at a time if no autoneg */ | ||
330 | if (!ecmd->autoneg && hw->phy.multispeed_fiber) { | ||
331 | if (ecmd->advertising == | ||
332 | (ADVERTISED_10000baseT_Full | | ||
333 | ADVERTISED_1000baseT_Full)) | ||
334 | return -EINVAL; | ||
335 | } | ||
336 | |||
317 | old = hw->phy.autoneg_advertised; | 337 | old = hw->phy.autoneg_advertised; |
318 | advertised = 0; | 338 | advertised = 0; |
319 | if (ecmd->advertising & ADVERTISED_10000baseT_Full) | 339 | if (ecmd->advertising & ADVERTISED_10000baseT_Full) |
@@ -1805,6 +1825,10 @@ static int ixgbe_run_loopback_test(struct ixgbe_adapter *adapter) | |||
1805 | unsigned int size = 1024; | 1825 | unsigned int size = 1024; |
1806 | netdev_tx_t tx_ret_val; | 1826 | netdev_tx_t tx_ret_val; |
1807 | struct sk_buff *skb; | 1827 | struct sk_buff *skb; |
1828 | u32 flags_orig = adapter->flags; | ||
1829 | |||
1830 | /* DCB can modify the frames on Tx */ | ||
1831 | adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; | ||
1808 | 1832 | ||
1809 | /* allocate test skb */ | 1833 | /* allocate test skb */ |
1810 | skb = alloc_skb(size, GFP_KERNEL); | 1834 | skb = alloc_skb(size, GFP_KERNEL); |
@@ -1857,6 +1881,7 @@ static int ixgbe_run_loopback_test(struct ixgbe_adapter *adapter) | |||
1857 | 1881 | ||
1858 | /* free the original skb */ | 1882 | /* free the original skb */ |
1859 | kfree_skb(skb); | 1883 | kfree_skb(skb); |
1884 | adapter->flags = flags_orig; | ||
1860 | 1885 | ||
1861 | return ret_val; | 1886 | return ret_val; |
1862 | } | 1887 | } |