ixgbe: add 1Gbps support for QSFP+
authorEmil Tantilov <emil.s.tantilov@intel.com>
Tue, 13 Aug 2013 07:22:16 +0000 (07:22 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 29 Aug 2013 10:24:00 +0000 (03:24 -0700)
This patch adds GB speed support for QSFP+ modules.
Autonegotiation is not supported with QSFP+. The user will have to set
the desired speed on both link partners using ethtool advertise setting.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c

index e4f4f4b1878524751bdfe5a4b6fa342c4a04a02b..007a0083a636785fcb473e87aafdc608b213ba51 100644 (file)
@@ -379,8 +379,13 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
 
        if (hw->phy.multispeed_fiber) {
                *speed |= IXGBE_LINK_SPEED_10GB_FULL |
-                         IXGBE_LINK_SPEED_1GB_FULL;
-               *autoneg = true;
+                         IXGBE_LINK_SPEED_1GB_FULL;
+
+               /* QSFP must not enable auto-negotiation */
+               if (hw->phy.media_type == ixgbe_media_type_fiber_qsfp)
+                       *autoneg = false;
+               else
+                       *autoneg = true;
        }
 
 out:
@@ -700,13 +705,18 @@ static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
                        goto out;
 
                /* Set the module link speed */
-               if (hw->phy.media_type == ixgbe_media_type_fiber_fixed) {
-                       ixgbe_set_fiber_fixed_speed(hw,
-                                       IXGBE_LINK_SPEED_10GB_FULL);
-               } else {
+               switch (hw->phy.media_type) {
+               case ixgbe_media_type_fiber:
                        esdp_reg |= (IXGBE_ESDP_SDP5_DIR | IXGBE_ESDP_SDP5);
                        IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
                        IXGBE_WRITE_FLUSH(hw);
+                       break;
+               case ixgbe_media_type_fiber_qsfp:
+                       /* QSFP module automatically detects MAC link speed */
+                       break;
+               default:
+                       hw_dbg(hw, "Unexpected media type.\n");
+                       break;
                }
 
                /* Allow module to change analog characteristics (1G->10G) */
@@ -757,14 +767,23 @@ static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
                        goto out;
 
                /* Set the module link speed */
-               if (hw->phy.media_type == ixgbe_media_type_fiber_fixed) {
+               switch (hw->phy.media_type) {
+               case ixgbe_media_type_fiber_fixed:
                        ixgbe_set_fiber_fixed_speed(hw,
                                                IXGBE_LINK_SPEED_1GB_FULL);
-               } else {
+                       break;
+               case ixgbe_media_type_fiber:
                        esdp_reg &= ~IXGBE_ESDP_SDP5;
                        esdp_reg |= IXGBE_ESDP_SDP5_DIR;
                        IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
                        IXGBE_WRITE_FLUSH(hw);
+                       break;
+               case ixgbe_media_type_fiber_qsfp:
+                       /* QSFP module automatically detects MAC link speed */
+                       break;
+               default:
+                       hw_dbg(hw, "Unexpected media type.\n");
+                       break;
                }
 
                /* Allow module to change analog characteristics (10G->1G) */
index 2d0308ed3bdd84b1b729b1922e82c2d20345c832..0e1b973659b0a006377fc2f4e84526266cdaecff 100644 (file)
@@ -311,9 +311,6 @@ static int ixgbe_set_settings(struct net_device *netdev,
                 * this function does not support duplex forcing, but can
                 * limit the advertising of the adapter to the specified speed
                 */
-               if (ecmd->autoneg == AUTONEG_DISABLE)
-                       return -EINVAL;
-
                if (ecmd->advertising & ~ecmd->supported)
                        return -EINVAL;
 
index 033997b85cb68f01fa040cb20467f3e009c57281..e89b34eae4dbd39a705e3fc81af3b5e66563f1f4 100644 (file)
@@ -1205,6 +1205,12 @@ s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
        if (status != 0)
                goto err_read_i2c_eeprom;
 
+       status = hw->phy.ops.read_i2c_eeprom(hw, IXGBE_SFF_QSFP_1GBE_COMP,
+                                            &comp_codes_1g);
+
+       if (status != 0)
+               goto err_read_i2c_eeprom;
+
        if (comp_codes_10g & IXGBE_SFF_QSFP_DA_PASSIVE_CABLE) {
                hw->phy.type = ixgbe_phy_qsfp_passive_unknown;
                if (hw->bus.lan_id == 0)