i40e: Add 10GBaseT support
authorMitch Williams <mitch.a.williams@intel.com>
Sat, 13 Sep 2014 07:40:47 +0000 (07:40 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 24 Oct 2014 03:38:04 +0000 (20:38 -0700)
Add driver support for 10GBaseT device.

Change-ID: I4be6ed847ac0bddd220b9878a95c523b32038174
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_common.c
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_type.h

index c23e3772de58319f469ce7910ea9c84a8c365010..c49416cfe61652a820b19fdcbcd6341208c619c4 100644 (file)
@@ -50,6 +50,7 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw)
                case I40E_DEV_ID_QSFP_A:
                case I40E_DEV_ID_QSFP_B:
                case I40E_DEV_ID_QSFP_C:
+               case I40E_DEV_ID_10G_BASE_T:
                        hw->mac.type = I40E_MAC_XL710;
                        break;
                case I40E_DEV_ID_VF:
index 1dda467ae1ac62bdc5428e4c6086c322fdac597d..12adc08c54dc76b79991c8f8545a65e2aead4cd3 100644 (file)
@@ -264,6 +264,14 @@ static int i40e_get_settings(struct net_device *netdev,
                        ecmd->supported = SUPPORTED_10000baseKR_Full;
                        ecmd->advertising = ADVERTISED_10000baseKR_Full;
                        break;
+               case I40E_DEV_ID_10G_BASE_T:
+                       ecmd->supported = SUPPORTED_10000baseT_Full |
+                                         SUPPORTED_1000baseT_Full |
+                                         SUPPORTED_100baseT_Full;
+                       ecmd->advertising = ADVERTISED_10000baseT_Full |
+                                           ADVERTISED_1000baseT_Full |
+                                           ADVERTISED_100baseT_Full;
+                       break;
                default:
                        /* all the rest are 10G/1G */
                        ecmd->supported = SUPPORTED_10000baseT_Full |
@@ -322,9 +330,13 @@ static int i40e_get_settings(struct net_device *netdev,
        case I40E_PHY_TYPE_10GBASE_CR1:
        case I40E_PHY_TYPE_10GBASE_T:
                ecmd->supported = SUPPORTED_Autoneg |
-                                 SUPPORTED_10000baseT_Full;
+                                 SUPPORTED_10000baseT_Full |
+                                 SUPPORTED_1000baseT_Full |
+                                 SUPPORTED_100baseT_Full;
                ecmd->advertising = ADVERTISED_Autoneg |
-                                   ADVERTISED_10000baseT_Full;
+                                   ADVERTISED_10000baseT_Full |
+                                   ADVERTISED_1000baseT_Full |
+                                   ADVERTISED_100baseT_Full;
                break;
        case I40E_PHY_TYPE_XAUI:
        case I40E_PHY_TYPE_XFI:
@@ -335,14 +347,22 @@ static int i40e_get_settings(struct net_device *netdev,
        case I40E_PHY_TYPE_1000BASE_KX:
        case I40E_PHY_TYPE_1000BASE_T:
                ecmd->supported = SUPPORTED_Autoneg |
-                                 SUPPORTED_1000baseT_Full;
+                                 SUPPORTED_10000baseT_Full |
+                                 SUPPORTED_1000baseT_Full |
+                                 SUPPORTED_100baseT_Full;
                ecmd->advertising = ADVERTISED_Autoneg |
-                                   ADVERTISED_1000baseT_Full;
+                                   ADVERTISED_10000baseT_Full |
+                                   ADVERTISED_1000baseT_Full |
+                                   ADVERTISED_100baseT_Full;
                break;
        case I40E_PHY_TYPE_100BASE_TX:
                ecmd->supported = SUPPORTED_Autoneg |
+                                 SUPPORTED_10000baseT_Full |
+                                 SUPPORTED_1000baseT_Full |
                                  SUPPORTED_100baseT_Full;
                ecmd->advertising = ADVERTISED_Autoneg |
+                                   ADVERTISED_10000baseT_Full |
+                                   ADVERTISED_1000baseT_Full |
                                    ADVERTISED_100baseT_Full;
                break;
        case I40E_PHY_TYPE_SGMII:
@@ -426,6 +446,9 @@ no_valid_phy_type:
                case I40E_LINK_SPEED_1GB:
                        ethtool_cmd_speed_set(ecmd, SPEED_1000);
                        break;
+               case I40E_LINK_SPEED_100MB:
+                       ethtool_cmd_speed_set(ecmd, SPEED_100);
+                       break;
                default:
                        break;
                }
@@ -528,7 +551,7 @@ static int i40e_set_settings(struct net_device *netdev,
                }
                /* If autoneg is currently enabled */
                if (hw->phy.link_info.an_info & I40E_AQ_AN_COMPLETED) {
-                       config.abilities = abilities.abilities |
+                       config.abilities = abilities.abilities &
                                           ~I40E_AQ_PHY_ENABLE_AN;
                        change = true;
                }
index 1fbbe113e8f4442f0dd9b4accefecdec8b29b1f9..9d36d10df868eb9b73cb44f94b3f1be37ef3c73d 100644 (file)
@@ -74,6 +74,7 @@ static const struct pci_device_id i40e_pci_tbl[] = {
        {PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_A), 0},
        {PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_B), 0},
        {PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_C), 0},
+       {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T), 0},
        /* required last entry */
        {0, }
 };
@@ -4449,6 +4450,9 @@ static void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
        case I40E_LINK_SPEED_1GB:
                strlcpy(speed, "1000 Mbps", SPEED_SIZE);
                break;
+       case I40E_LINK_SPEED_100MB:
+               strncpy(speed, "100 Mbps", SPEED_SIZE);
+               break;
        default:
                break;
        }
index ce04d9093db63b99c46a0e055525a347a5f2d48a..3a237c3d0dcbe323ace097302a6110e3c939370e 100644 (file)
@@ -43,6 +43,7 @@
 #define I40E_DEV_ID_QSFP_A             0x1583
 #define I40E_DEV_ID_QSFP_B             0x1584
 #define I40E_DEV_ID_QSFP_C             0x1585
+#define I40E_DEV_ID_10G_BASE_T         0x1586
 #define I40E_DEV_ID_VF                 0x154C
 #define I40E_DEV_ID_VF_HV              0x1571