aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorCatherine Sullivan <catherine.sullivan@intel.com>2015-02-06 03:52:08 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-02-24 23:29:54 -0500
commite827845c7deefbd9b6530ec1c91c0215b0ed4a7a (patch)
tree17eebb8a5f5b5c0596c164d3c9ec23188c9366b1 /drivers/net/ethernet
parentf1abd7dbb38535ab6ac6ba9ac81714118562cadf (diff)
i40e/i40evf: Use advertised speed settings in ethtool and refactor get_settings
Add a requested speed variable to the link_status struct to store the last speeds we requested from the firmware (the speeds the FW will be advertising with if autoneg is enabled). Use the advertised speed settings in get_settings in ethtool now that we have it. Also set the requested speed settings in set_settings in ethtool as they are requested and initialize them in probe based on what the firmware remembers as the last requested speeds. To accommodate some longer lines in this new code, and improve readability I have added two functions i40e_get_settings_link_up and i40e_get_settings_link_down which get_settings now calls first. It then does all of the settings that happen regardless of link state. Some PHY types that supported the same settings were also combined. Also update the copyright year. Change-ID: Ica0c5ac81b6069ea6a7406fce7482f7816d4455c Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_ethtool.c281
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c10
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_type.h3
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_type.h3
4 files changed, 173 insertions, 124 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 8e69caf01efe..5854460a34ff 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 * 2 *
3 * Intel Ethernet Controller XL710 Family Linux Driver 3 * Intel Ethernet Controller XL710 Family Linux Driver
4 * Copyright(c) 2013 - 2014 Intel Corporation. 4 * Copyright(c) 2013 - 2015 Intel Corporation.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -228,73 +228,20 @@ static void i40e_partition_setting_complaint(struct i40e_pf *pf)
228} 228}
229 229
230/** 230/**
231 * i40e_get_settings - Get Link Speed and Duplex settings 231 * i40e_get_settings_link_up - Get the Link settings for when link is up
232 * @hw: hw structure
233 * @ecmd: ethtool command to fill in
232 * @netdev: network interface device structure 234 * @netdev: network interface device structure
233 * @ecmd: ethtool command
234 * 235 *
235 * Reports speed/duplex settings based on media_type
236 **/ 236 **/
237static int i40e_get_settings(struct net_device *netdev, 237static void i40e_get_settings_link_up(struct i40e_hw *hw,
238 struct ethtool_cmd *ecmd) 238 struct ethtool_cmd *ecmd,
239 struct net_device *netdev)
239{ 240{
240 struct i40e_netdev_priv *np = netdev_priv(netdev);
241 struct i40e_pf *pf = np->vsi->back;
242 struct i40e_hw *hw = &pf->hw;
243 struct i40e_link_status *hw_link_info = &hw->phy.link_info; 241 struct i40e_link_status *hw_link_info = &hw->phy.link_info;
244 bool link_up = hw_link_info->link_info & I40E_AQ_LINK_UP;
245 u32 link_speed = hw_link_info->link_speed; 242 u32 link_speed = hw_link_info->link_speed;
246 243
247 /* hardware is either in 40G mode or 10G mode 244 /* Initialize supported and advertised settings based on phy settings */
248 * NOTE: this section initializes supported and advertising
249 */
250 if (!link_up) {
251 /* link is down and the driver needs to fall back on
252 * device ID to determine what kinds of info to display,
253 * it's mostly a guess that may change when link is up
254 */
255 switch (hw->device_id) {
256 case I40E_DEV_ID_QSFP_A:
257 case I40E_DEV_ID_QSFP_B:
258 case I40E_DEV_ID_QSFP_C:
259 /* pluggable QSFP */
260 ecmd->supported = SUPPORTED_40000baseSR4_Full |
261 SUPPORTED_40000baseCR4_Full |
262 SUPPORTED_40000baseLR4_Full;
263 ecmd->advertising = ADVERTISED_40000baseSR4_Full |
264 ADVERTISED_40000baseCR4_Full |
265 ADVERTISED_40000baseLR4_Full;
266 break;
267 case I40E_DEV_ID_KX_B:
268 /* backplane 40G */
269 ecmd->supported = SUPPORTED_40000baseKR4_Full;
270 ecmd->advertising = ADVERTISED_40000baseKR4_Full;
271 break;
272 case I40E_DEV_ID_KX_C:
273 /* backplane 10G */
274 ecmd->supported = SUPPORTED_10000baseKR_Full;
275 ecmd->advertising = ADVERTISED_10000baseKR_Full;
276 break;
277 case I40E_DEV_ID_10G_BASE_T:
278 ecmd->supported = SUPPORTED_10000baseT_Full |
279 SUPPORTED_1000baseT_Full |
280 SUPPORTED_100baseT_Full;
281 ecmd->advertising = ADVERTISED_10000baseT_Full |
282 ADVERTISED_1000baseT_Full |
283 ADVERTISED_100baseT_Full;
284 break;
285 default:
286 /* all the rest are 10G/1G */
287 ecmd->supported = SUPPORTED_10000baseT_Full |
288 SUPPORTED_1000baseT_Full;
289 ecmd->advertising = ADVERTISED_10000baseT_Full |
290 ADVERTISED_1000baseT_Full;
291 break;
292 }
293
294 /* skip phy_type use as it is zero when link is down */
295 goto no_valid_phy_type;
296 }
297
298 switch (hw_link_info->phy_type) { 245 switch (hw_link_info->phy_type) {
299 case I40E_PHY_TYPE_40GBASE_CR4: 246 case I40E_PHY_TYPE_40GBASE_CR4:
300 case I40E_PHY_TYPE_40GBASE_CR4_CU: 247 case I40E_PHY_TYPE_40GBASE_CR4_CU:
@@ -303,6 +250,10 @@ static int i40e_get_settings(struct net_device *netdev,
303 ecmd->advertising = ADVERTISED_Autoneg | 250 ecmd->advertising = ADVERTISED_Autoneg |
304 ADVERTISED_40000baseCR4_Full; 251 ADVERTISED_40000baseCR4_Full;
305 break; 252 break;
253 case I40E_PHY_TYPE_XLAUI:
254 case I40E_PHY_TYPE_XLPPI:
255 ecmd->supported = SUPPORTED_40000baseCR4_Full;
256 break;
306 case I40E_PHY_TYPE_40GBASE_KR4: 257 case I40E_PHY_TYPE_40GBASE_KR4:
307 ecmd->supported = SUPPORTED_Autoneg | 258 ecmd->supported = SUPPORTED_Autoneg |
308 SUPPORTED_40000baseKR4_Full; 259 SUPPORTED_40000baseKR4_Full;
@@ -310,8 +261,6 @@ static int i40e_get_settings(struct net_device *netdev,
310 ADVERTISED_40000baseKR4_Full; 261 ADVERTISED_40000baseKR4_Full;
311 break; 262 break;
312 case I40E_PHY_TYPE_40GBASE_SR4: 263 case I40E_PHY_TYPE_40GBASE_SR4:
313 case I40E_PHY_TYPE_XLPPI:
314 case I40E_PHY_TYPE_XLAUI:
315 ecmd->supported = SUPPORTED_40000baseSR4_Full; 264 ecmd->supported = SUPPORTED_40000baseSR4_Full;
316 break; 265 break;
317 case I40E_PHY_TYPE_40GBASE_LR4: 266 case I40E_PHY_TYPE_40GBASE_LR4:
@@ -333,20 +282,40 @@ static int i40e_get_settings(struct net_device *netdev,
333 case I40E_PHY_TYPE_10GBASE_LR: 282 case I40E_PHY_TYPE_10GBASE_LR:
334 case I40E_PHY_TYPE_1000BASE_SX: 283 case I40E_PHY_TYPE_1000BASE_SX:
335 case I40E_PHY_TYPE_1000BASE_LX: 284 case I40E_PHY_TYPE_1000BASE_LX:
336 ecmd->supported = SUPPORTED_10000baseT_Full; 285 ecmd->supported = SUPPORTED_10000baseT_Full |
337 ecmd->supported |= SUPPORTED_1000baseT_Full; 286 SUPPORTED_1000baseT_Full;
287 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_10GB)
288 ecmd->advertising |= ADVERTISED_10000baseT_Full;
289 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_1GB)
290 ecmd->advertising |= ADVERTISED_1000baseT_Full;
291 break;
292 case I40E_PHY_TYPE_1000BASE_KX:
293 ecmd->supported = SUPPORTED_Autoneg |
294 SUPPORTED_1000baseKX_Full;
295 ecmd->advertising = ADVERTISED_Autoneg |
296 ADVERTISED_1000baseKX_Full;
338 break; 297 break;
339 case I40E_PHY_TYPE_10GBASE_CR1_CU:
340 case I40E_PHY_TYPE_10GBASE_CR1:
341 case I40E_PHY_TYPE_10GBASE_T: 298 case I40E_PHY_TYPE_10GBASE_T:
299 case I40E_PHY_TYPE_1000BASE_T:
300 case I40E_PHY_TYPE_100BASE_TX:
342 ecmd->supported = SUPPORTED_Autoneg | 301 ecmd->supported = SUPPORTED_Autoneg |
343 SUPPORTED_10000baseT_Full | 302 SUPPORTED_10000baseT_Full |
344 SUPPORTED_1000baseT_Full | 303 SUPPORTED_1000baseT_Full |
345 SUPPORTED_100baseT_Full; 304 SUPPORTED_100baseT_Full;
305 ecmd->advertising = ADVERTISED_Autoneg;
306 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_10GB)
307 ecmd->advertising |= ADVERTISED_10000baseT_Full;
308 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_1GB)
309 ecmd->advertising |= ADVERTISED_1000baseT_Full;
310 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_100MB)
311 ecmd->advertising |= ADVERTISED_100baseT_Full;
312 break;
313 case I40E_PHY_TYPE_10GBASE_CR1_CU:
314 case I40E_PHY_TYPE_10GBASE_CR1:
315 ecmd->supported = SUPPORTED_Autoneg |
316 SUPPORTED_10000baseT_Full;
346 ecmd->advertising = ADVERTISED_Autoneg | 317 ecmd->advertising = ADVERTISED_Autoneg |
347 ADVERTISED_10000baseT_Full | 318 ADVERTISED_10000baseT_Full;
348 ADVERTISED_1000baseT_Full |
349 ADVERTISED_100baseT_Full;
350 break; 319 break;
351 case I40E_PHY_TYPE_XAUI: 320 case I40E_PHY_TYPE_XAUI:
352 case I40E_PHY_TYPE_XFI: 321 case I40E_PHY_TYPE_XFI:
@@ -354,34 +323,14 @@ static int i40e_get_settings(struct net_device *netdev,
354 case I40E_PHY_TYPE_10GBASE_SFPP_CU: 323 case I40E_PHY_TYPE_10GBASE_SFPP_CU:
355 ecmd->supported = SUPPORTED_10000baseT_Full; 324 ecmd->supported = SUPPORTED_10000baseT_Full;
356 break; 325 break;
357 case I40E_PHY_TYPE_1000BASE_KX:
358 case I40E_PHY_TYPE_1000BASE_T:
359 ecmd->supported = SUPPORTED_Autoneg |
360 SUPPORTED_10000baseT_Full |
361 SUPPORTED_1000baseT_Full |
362 SUPPORTED_100baseT_Full;
363 ecmd->advertising = ADVERTISED_Autoneg |
364 ADVERTISED_10000baseT_Full |
365 ADVERTISED_1000baseT_Full |
366 ADVERTISED_100baseT_Full;
367 break;
368 case I40E_PHY_TYPE_100BASE_TX:
369 ecmd->supported = SUPPORTED_Autoneg |
370 SUPPORTED_10000baseT_Full |
371 SUPPORTED_1000baseT_Full |
372 SUPPORTED_100baseT_Full;
373 ecmd->advertising = ADVERTISED_Autoneg |
374 ADVERTISED_10000baseT_Full |
375 ADVERTISED_1000baseT_Full |
376 ADVERTISED_100baseT_Full;
377 break;
378 case I40E_PHY_TYPE_SGMII: 326 case I40E_PHY_TYPE_SGMII:
379 ecmd->supported = SUPPORTED_Autoneg | 327 ecmd->supported = SUPPORTED_Autoneg |
380 SUPPORTED_1000baseT_Full | 328 SUPPORTED_1000baseT_Full |
381 SUPPORTED_100baseT_Full; 329 SUPPORTED_100baseT_Full;
382 ecmd->advertising = ADVERTISED_Autoneg | 330 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_1GB)
383 ADVERTISED_1000baseT_Full | 331 ecmd->advertising |= ADVERTISED_1000baseT_Full;
384 ADVERTISED_100baseT_Full; 332 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_100MB)
333 ecmd->advertising |= ADVERTISED_100baseT_Full;
385 break; 334 break;
386 default: 335 default:
387 /* if we got here and link is up something bad is afoot */ 336 /* if we got here and link is up something bad is afoot */
@@ -389,8 +338,118 @@ static int i40e_get_settings(struct net_device *netdev,
389 hw_link_info->phy_type); 338 hw_link_info->phy_type);
390 } 339 }
391 340
392no_valid_phy_type: 341 /* Set speed and duplex */
393 /* this is if autoneg is enabled or disabled */ 342 switch (link_speed) {
343 case I40E_LINK_SPEED_40GB:
344 /* need a SPEED_40000 in ethtool.h */
345 ethtool_cmd_speed_set(ecmd, 40000);
346 break;
347 case I40E_LINK_SPEED_10GB:
348 ethtool_cmd_speed_set(ecmd, SPEED_10000);
349 break;
350 case I40E_LINK_SPEED_1GB:
351 ethtool_cmd_speed_set(ecmd, SPEED_1000);
352 break;
353 case I40E_LINK_SPEED_100MB:
354 ethtool_cmd_speed_set(ecmd, SPEED_100);
355 break;
356 default:
357 break;
358 }
359 ecmd->duplex = DUPLEX_FULL;
360}
361
362/**
363 * i40e_get_settings_link_down - Get the Link settings for when link is down
364 * @hw: hw structure
365 * @ecmd: ethtool command to fill in
366 *
367 * Reports link settings that can be determined when link is down
368 **/
369static void i40e_get_settings_link_down(struct i40e_hw *hw,
370 struct ethtool_cmd *ecmd)
371{
372 struct i40e_link_status *hw_link_info = &hw->phy.link_info;
373
374 /* link is down and the driver needs to fall back on
375 * device ID to determine what kinds of info to display,
376 * it's mostly a guess that may change when link is up
377 */
378 switch (hw->device_id) {
379 case I40E_DEV_ID_QSFP_A:
380 case I40E_DEV_ID_QSFP_B:
381 case I40E_DEV_ID_QSFP_C:
382 /* pluggable QSFP */
383 ecmd->supported = SUPPORTED_40000baseSR4_Full |
384 SUPPORTED_40000baseCR4_Full |
385 SUPPORTED_40000baseLR4_Full;
386 ecmd->advertising = ADVERTISED_40000baseSR4_Full |
387 ADVERTISED_40000baseCR4_Full |
388 ADVERTISED_40000baseLR4_Full;
389 break;
390 case I40E_DEV_ID_KX_B:
391 /* backplane 40G */
392 ecmd->supported = SUPPORTED_40000baseKR4_Full;
393 ecmd->advertising = ADVERTISED_40000baseKR4_Full;
394 break;
395 case I40E_DEV_ID_KX_C:
396 /* backplane 10G */
397 ecmd->supported = SUPPORTED_10000baseKR_Full;
398 ecmd->advertising = ADVERTISED_10000baseKR_Full;
399 break;
400 case I40E_DEV_ID_10G_BASE_T:
401 ecmd->supported = SUPPORTED_10000baseT_Full |
402 SUPPORTED_1000baseT_Full |
403 SUPPORTED_100baseT_Full;
404 /* Figure out what has been requested */
405 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_10GB)
406 ecmd->advertising |= ADVERTISED_10000baseT_Full;
407 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_1GB)
408 ecmd->advertising |= ADVERTISED_1000baseT_Full;
409 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_100MB)
410 ecmd->advertising |= ADVERTISED_100baseT_Full;
411 break;
412 default:
413 /* all the rest are 10G/1G */
414 ecmd->supported = SUPPORTED_10000baseT_Full |
415 SUPPORTED_1000baseT_Full;
416 /* Figure out what has been requested */
417 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_10GB)
418 ecmd->advertising |= ADVERTISED_10000baseT_Full;
419 if (hw_link_info->requested_speeds & I40E_LINK_SPEED_1GB)
420 ecmd->advertising |= ADVERTISED_1000baseT_Full;
421 break;
422 }
423
424 /* With no link speed and duplex are unknown */
425 ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
426 ecmd->duplex = DUPLEX_UNKNOWN;
427}
428
429/**
430 * i40e_get_settings - Get Link Speed and Duplex settings
431 * @netdev: network interface device structure
432 * @ecmd: ethtool command
433 *
434 * Reports speed/duplex settings based on media_type
435 **/
436static int i40e_get_settings(struct net_device *netdev,
437 struct ethtool_cmd *ecmd)
438{
439 struct i40e_netdev_priv *np = netdev_priv(netdev);
440 struct i40e_pf *pf = np->vsi->back;
441 struct i40e_hw *hw = &pf->hw;
442 struct i40e_link_status *hw_link_info = &hw->phy.link_info;
443 bool link_up = hw_link_info->link_info & I40E_AQ_LINK_UP;
444
445 if (link_up)
446 i40e_get_settings_link_up(hw, ecmd, netdev);
447 else
448 i40e_get_settings_link_down(hw, ecmd);
449
450 /* Now set the settings that don't rely on link being up/down */
451
452 /* Set autoneg settings */
394 ecmd->autoneg = ((hw_link_info->an_info & I40E_AQ_AN_COMPLETED) ? 453 ecmd->autoneg = ((hw_link_info->an_info & I40E_AQ_AN_COMPLETED) ?
395 AUTONEG_ENABLE : AUTONEG_DISABLE); 454 AUTONEG_ENABLE : AUTONEG_DISABLE);
396 455
@@ -423,11 +482,13 @@ no_valid_phy_type:
423 break; 482 break;
424 } 483 }
425 484
485 /* Set transceiver */
426 ecmd->transceiver = XCVR_EXTERNAL; 486 ecmd->transceiver = XCVR_EXTERNAL;
427 487
488 /* Set flow control settings */
428 ecmd->supported |= SUPPORTED_Pause; 489 ecmd->supported |= SUPPORTED_Pause;
429 490
430 switch (hw->fc.current_mode) { 491 switch (hw->fc.requested_mode) {
431 case I40E_FC_FULL: 492 case I40E_FC_FULL:
432 ecmd->advertising |= ADVERTISED_Pause; 493 ecmd->advertising |= ADVERTISED_Pause;
433 break; 494 break;
@@ -444,30 +505,6 @@ no_valid_phy_type:
444 break; 505 break;
445 } 506 }
446 507
447 if (link_up) {
448 switch (link_speed) {
449 case I40E_LINK_SPEED_40GB:
450 /* need a SPEED_40000 in ethtool.h */
451 ethtool_cmd_speed_set(ecmd, 40000);
452 break;
453 case I40E_LINK_SPEED_10GB:
454 ethtool_cmd_speed_set(ecmd, SPEED_10000);
455 break;
456 case I40E_LINK_SPEED_1GB:
457 ethtool_cmd_speed_set(ecmd, SPEED_1000);
458 break;
459 case I40E_LINK_SPEED_100MB:
460 ethtool_cmd_speed_set(ecmd, SPEED_100);
461 break;
462 default:
463 break;
464 }
465 ecmd->duplex = DUPLEX_FULL;
466 } else {
467 ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
468 ecmd->duplex = DUPLEX_UNKNOWN;
469 }
470
471 return 0; 508 return 0;
472} 509}
473 510
@@ -600,6 +637,8 @@ static int i40e_set_settings(struct net_device *netdev,
600 config.eeer = abilities.eeer_val; 637 config.eeer = abilities.eeer_val;
601 config.low_power_ctrl = abilities.d3_lpan; 638 config.low_power_ctrl = abilities.d3_lpan;
602 639
640 /* save the requested speeds */
641 hw->phy.link_info.requested_speeds = config.link_speed;
603 /* set link and auto negotiation so changes take effect */ 642 /* set link and auto negotiation so changes take effect */
604 config.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; 643 config.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK;
605 /* If link is up put link down */ 644 /* If link is up put link down */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index d3416a4a8f5a..bb876e310908 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 * 2 *
3 * Intel Ethernet Controller XL710 Family Linux Driver 3 * Intel Ethernet Controller XL710 Family Linux Driver
4 * Copyright(c) 2013 - 2014 Intel Corporation. 4 * Copyright(c) 2013 - 2015 Intel Corporation.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -9099,6 +9099,7 @@ static void i40e_print_features(struct i40e_pf *pf)
9099 **/ 9099 **/
9100static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 9100static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
9101{ 9101{
9102 struct i40e_aq_get_phy_abilities_resp abilities;
9102 struct i40e_pf *pf; 9103 struct i40e_pf *pf;
9103 struct i40e_hw *hw; 9104 struct i40e_hw *hw;
9104 static u16 pfs_found; 9105 static u16 pfs_found;
@@ -9454,6 +9455,13 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
9454 dev_warn(&pdev->dev, "Please move the device to a different PCI-e link with more lanes and/or higher transfer rate.\n"); 9455 dev_warn(&pdev->dev, "Please move the device to a different PCI-e link with more lanes and/or higher transfer rate.\n");
9455 } 9456 }
9456 9457
9458 /* get the requested speeds from the fw */
9459 err = i40e_aq_get_phy_capabilities(hw, false, false, &abilities, NULL);
9460 if (err)
9461 dev_info(&pf->pdev->dev, "get phy abilities failed, aq_err %d, advertised speed settings may not be correct\n",
9462 err);
9463 pf->hw.phy.link_info.requested_speeds = abilities.link_speed;
9464
9457 /* print a string summarizing features */ 9465 /* print a string summarizing features */
9458 i40e_print_features(pf); 9466 i40e_print_features(pf);
9459 9467
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 86a927b88ef4..17f1647ab1d6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 * 2 *
3 * Intel Ethernet Controller XL710 Family Linux Driver 3 * Intel Ethernet Controller XL710 Family Linux Driver
4 * Copyright(c) 2013 - 2014 Intel Corporation. 4 * Copyright(c) 2013 - 2015 Intel Corporation.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -180,6 +180,7 @@ struct i40e_link_status {
180 u16 max_frame_size; 180 u16 max_frame_size;
181 bool crc_enable; 181 bool crc_enable;
182 u8 pacing; 182 u8 pacing;
183 u8 requested_speeds;
183}; 184};
184 185
185struct i40e_phy_info { 186struct i40e_phy_info {
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h
index c8cd8afdbf8f..a2693865594a 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 * 2 *
3 * Intel Ethernet Controller XL710 Family Linux Virtual Function Driver 3 * Intel Ethernet Controller XL710 Family Linux Virtual Function Driver
4 * Copyright(c) 2013 - 2014 Intel Corporation. 4 * Copyright(c) 2013 - 2015 Intel Corporation.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -180,6 +180,7 @@ struct i40e_link_status {
180 u16 max_frame_size; 180 u16 max_frame_size;
181 bool crc_enable; 181 bool crc_enable;
182 u8 pacing; 182 u8 pacing;
183 u8 requested_speeds;
183}; 184};
184 185
185struct i40e_phy_info { 186struct i40e_phy_info {