]> git.baikalelectronics.ru Git - kernel.git/commitdiff
i40e: Fix PHY type identifiers for 2.5G and 5G adapters
authorMateusz Palczewski <mateusz.palczewski@intel.com>
Tue, 13 Apr 2021 14:43:07 +0000 (14:43 +0000)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 7 May 2021 16:35:49 +0000 (09:35 -0700)
Unlike other supported adapters, 2.5G and 5G use different
PHY type identifiers for reading/writing PHY settings
and for reading link status. This commit introduces
separate PHY identifiers for these two operation types.

Fixes: cc1846da9d36 ("i40e: Add support for X710 B/P & SFP+ cards")
Signed-off-by: Dawid Lukwinski <dawid.lukwinski@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
drivers/net/ethernet/intel/i40e/i40e_common.c
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_type.h

index ce626eace692a71c403e69e87df956fd7eebcbad..140b677f114dbf61599d9c1a1458f330e830b025 100644 (file)
@@ -1566,8 +1566,10 @@ enum i40e_aq_phy_type {
        I40E_PHY_TYPE_25GBASE_LR                = 0x22,
        I40E_PHY_TYPE_25GBASE_AOC               = 0x23,
        I40E_PHY_TYPE_25GBASE_ACC               = 0x24,
-       I40E_PHY_TYPE_2_5GBASE_T                = 0x30,
-       I40E_PHY_TYPE_5GBASE_T                  = 0x31,
+       I40E_PHY_TYPE_2_5GBASE_T                = 0x26,
+       I40E_PHY_TYPE_5GBASE_T                  = 0x27,
+       I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS    = 0x30,
+       I40E_PHY_TYPE_5GBASE_T_LINK_STATUS      = 0x31,
        I40E_PHY_TYPE_MAX,
        I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP   = 0xFD,
        I40E_PHY_TYPE_EMPTY                     = 0xFE,
index 41b813fe07a55b4cfd596afb186b68f2285a861f..67cb0b47416a0cbf308f6e2dbe6f5a87ae0a8ba4 100644 (file)
@@ -1154,8 +1154,8 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
                break;
        case I40E_PHY_TYPE_100BASE_TX:
        case I40E_PHY_TYPE_1000BASE_T:
-       case I40E_PHY_TYPE_2_5GBASE_T:
-       case I40E_PHY_TYPE_5GBASE_T:
+       case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
+       case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
        case I40E_PHY_TYPE_10GBASE_T:
                media = I40E_MEDIA_TYPE_BASET;
                break;
index 53416787fb7b88642625b07b877fe579ce3a0fc8..bd527eab002b5b056394017a15d3da31318f9f63 100644 (file)
@@ -841,8 +841,8 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,
                                                             10000baseT_Full);
                break;
        case I40E_PHY_TYPE_10GBASE_T:
-       case I40E_PHY_TYPE_5GBASE_T:
-       case I40E_PHY_TYPE_2_5GBASE_T:
+       case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
+       case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
        case I40E_PHY_TYPE_1000BASE_T:
        case I40E_PHY_TYPE_100BASE_TX:
                ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg);
index 5c10faaca790ec478f39f29ce01a553286e609ce..c81109a63e90c242ef58c4c4de35c728973ea0dc 100644 (file)
@@ -239,11 +239,8 @@ struct i40e_phy_info {
 #define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \
                                             I40E_PHY_TYPE_OFFSET)
 /* Offset for 2.5G/5G PHY Types value to bit number conversion */
-#define I40E_PHY_TYPE_OFFSET2 (-10)
-#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \
-                                            I40E_PHY_TYPE_OFFSET2)
-#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \
-                                            I40E_PHY_TYPE_OFFSET2)
+#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T)
+#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T)
 #define I40E_HW_CAP_MAX_GPIO                   30
 /* Capabilities of a PF or a VF or the whole device */
 struct i40e_hw_capabilities {