aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatherine Sullivan <catherine.sullivan@intel.com>2014-07-12 03:28:12 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-09-04 04:38:28 -0400
commit124ed15bf126b5bf437c8eee2873ecbeef464146 (patch)
tree477946780a00a2a1bc60cc1c688b874f9dff8f6a
parentb89df95d52d5fd0de5a2ca3f8b49aaaee4675151 (diff)
i40e: Add dual speed module support
Now that fw has implemented dual speed module support, we can add ours. Also, add the phy type for 1G LR/SR and set its media type to fiber. Lastly, instead of a WARN_ON if the phy type is not recognized just print a warning. Change-ID: I2e5227d4a8c2907b0ed423038e5dbce774e466b0 Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_common.c2
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_ethtool.c31
2 files changed, 13 insertions, 20 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 01874c0fff1d..30056b25d94e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -752,6 +752,8 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
752 switch (hw->phy.link_info.phy_type) { 752 switch (hw->phy.link_info.phy_type) {
753 case I40E_PHY_TYPE_10GBASE_SR: 753 case I40E_PHY_TYPE_10GBASE_SR:
754 case I40E_PHY_TYPE_10GBASE_LR: 754 case I40E_PHY_TYPE_10GBASE_LR:
755 case I40E_PHY_TYPE_1000BASE_SX:
756 case I40E_PHY_TYPE_1000BASE_LX:
755 case I40E_PHY_TYPE_40GBASE_SR4: 757 case I40E_PHY_TYPE_40GBASE_SR4:
756 case I40E_PHY_TYPE_40GBASE_LR4: 758 case I40E_PHY_TYPE_40GBASE_LR4:
757 media = I40E_MEDIA_TYPE_FIBER; 759 media = I40E_MEDIA_TYPE_FIBER;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 571d527e7920..e701f42d1529 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -313,7 +313,10 @@ static int i40e_get_settings(struct net_device *netdev,
313 break; 313 break;
314 case I40E_PHY_TYPE_10GBASE_SR: 314 case I40E_PHY_TYPE_10GBASE_SR:
315 case I40E_PHY_TYPE_10GBASE_LR: 315 case I40E_PHY_TYPE_10GBASE_LR:
316 case I40E_PHY_TYPE_1000BASE_SX:
317 case I40E_PHY_TYPE_1000BASE_LX:
316 ecmd->supported = SUPPORTED_10000baseT_Full; 318 ecmd->supported = SUPPORTED_10000baseT_Full;
319 ecmd->supported |= SUPPORTED_1000baseT_Full;
317 break; 320 break;
318 case I40E_PHY_TYPE_10GBASE_CR1_CU: 321 case I40E_PHY_TYPE_10GBASE_CR1_CU:
319 case I40E_PHY_TYPE_10GBASE_CR1: 322 case I40E_PHY_TYPE_10GBASE_CR1:
@@ -352,7 +355,8 @@ static int i40e_get_settings(struct net_device *netdev,
352 break; 355 break;
353 default: 356 default:
354 /* if we got here and link is up something bad is afoot */ 357 /* if we got here and link is up something bad is afoot */
355 WARN_ON(link_up); 358 netdev_info(netdev, "WARNING: Link is up but PHY type 0x%x is not recognized.\n",
359 hw_link_info->phy_type);
356 } 360 }
357 361
358no_valid_phy_type: 362no_valid_phy_type:
@@ -493,11 +497,10 @@ static int i40e_set_settings(struct net_device *netdev,
493 if (status) 497 if (status)
494 return -EAGAIN; 498 return -EAGAIN;
495 499
496 /* Copy link_speed and abilities to config in case they are not 500 /* Copy abilities to config in case autoneg is not
497 * set below 501 * set below
498 */ 502 */
499 memset(&config, 0, sizeof(struct i40e_aq_set_phy_config)); 503 memset(&config, 0, sizeof(struct i40e_aq_set_phy_config));
500 config.link_speed = abilities.link_speed;
501 config.abilities = abilities.abilities; 504 config.abilities = abilities.abilities;
502 505
503 /* Check autoneg */ 506 /* Check autoneg */
@@ -534,33 +537,21 @@ static int i40e_set_settings(struct net_device *netdev,
534 return -EINVAL; 537 return -EINVAL;
535 538
536 if (advertise & ADVERTISED_100baseT_Full) 539 if (advertise & ADVERTISED_100baseT_Full)
537 if (!(abilities.link_speed & I40E_LINK_SPEED_100MB)) { 540 config.link_speed |= I40E_LINK_SPEED_100MB;
538 config.link_speed |= I40E_LINK_SPEED_100MB;
539 change = true;
540 }
541 if (advertise & ADVERTISED_1000baseT_Full || 541 if (advertise & ADVERTISED_1000baseT_Full ||
542 advertise & ADVERTISED_1000baseKX_Full) 542 advertise & ADVERTISED_1000baseKX_Full)
543 if (!(abilities.link_speed & I40E_LINK_SPEED_1GB)) { 543 config.link_speed |= I40E_LINK_SPEED_1GB;
544 config.link_speed |= I40E_LINK_SPEED_1GB;
545 change = true;
546 }
547 if (advertise & ADVERTISED_10000baseT_Full || 544 if (advertise & ADVERTISED_10000baseT_Full ||
548 advertise & ADVERTISED_10000baseKX4_Full || 545 advertise & ADVERTISED_10000baseKX4_Full ||
549 advertise & ADVERTISED_10000baseKR_Full) 546 advertise & ADVERTISED_10000baseKR_Full)
550 if (!(abilities.link_speed & I40E_LINK_SPEED_10GB)) { 547 config.link_speed |= I40E_LINK_SPEED_10GB;
551 config.link_speed |= I40E_LINK_SPEED_10GB;
552 change = true;
553 }
554 if (advertise & ADVERTISED_40000baseKR4_Full || 548 if (advertise & ADVERTISED_40000baseKR4_Full ||
555 advertise & ADVERTISED_40000baseCR4_Full || 549 advertise & ADVERTISED_40000baseCR4_Full ||
556 advertise & ADVERTISED_40000baseSR4_Full || 550 advertise & ADVERTISED_40000baseSR4_Full ||
557 advertise & ADVERTISED_40000baseLR4_Full) 551 advertise & ADVERTISED_40000baseLR4_Full)
558 if (!(abilities.link_speed & I40E_LINK_SPEED_40GB)) { 552 config.link_speed |= I40E_LINK_SPEED_40GB;
559 config.link_speed |= I40E_LINK_SPEED_40GB;
560 change = true;
561 }
562 553
563 if (change) { 554 if (change || (abilities.link_speed != config.link_speed)) {
564 /* copy over the rest of the abilities */ 555 /* copy over the rest of the abilities */
565 config.phy_type = abilities.phy_type; 556 config.phy_type = abilities.phy_type;
566 config.eee_capability = abilities.eee_capability; 557 config.eee_capability = abilities.eee_capability;