Skip to content

Commit 15395ec

Browse files
mpalczew96anguy11
authored andcommitted
i40e: Fix PHY type identifiers for 2.5G and 5G adapters
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: 2e45d3f ("i40e: Add support for X710 B/P & SFP+ cards") Signed-off-by: Dawid Lukwinski <[email protected]> Signed-off-by: Mateusz Palczewski <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Tested-by: Dave Switzer <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 61343e6 commit 15395ec

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,8 +1566,10 @@ enum i40e_aq_phy_type {
15661566
I40E_PHY_TYPE_25GBASE_LR = 0x22,
15671567
I40E_PHY_TYPE_25GBASE_AOC = 0x23,
15681568
I40E_PHY_TYPE_25GBASE_ACC = 0x24,
1569-
I40E_PHY_TYPE_2_5GBASE_T = 0x30,
1570-
I40E_PHY_TYPE_5GBASE_T = 0x31,
1569+
I40E_PHY_TYPE_2_5GBASE_T = 0x26,
1570+
I40E_PHY_TYPE_5GBASE_T = 0x27,
1571+
I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS = 0x30,
1572+
I40E_PHY_TYPE_5GBASE_T_LINK_STATUS = 0x31,
15711573
I40E_PHY_TYPE_MAX,
15721574
I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP = 0xFD,
15731575
I40E_PHY_TYPE_EMPTY = 0xFE,

drivers/net/ethernet/intel/i40e/i40e_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,8 +1154,8 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
11541154
break;
11551155
case I40E_PHY_TYPE_100BASE_TX:
11561156
case I40E_PHY_TYPE_1000BASE_T:
1157-
case I40E_PHY_TYPE_2_5GBASE_T:
1158-
case I40E_PHY_TYPE_5GBASE_T:
1157+
case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
1158+
case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
11591159
case I40E_PHY_TYPE_10GBASE_T:
11601160
media = I40E_MEDIA_TYPE_BASET;
11611161
break;

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,8 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,
841841
10000baseT_Full);
842842
break;
843843
case I40E_PHY_TYPE_10GBASE_T:
844-
case I40E_PHY_TYPE_5GBASE_T:
845-
case I40E_PHY_TYPE_2_5GBASE_T:
844+
case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
845+
case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
846846
case I40E_PHY_TYPE_1000BASE_T:
847847
case I40E_PHY_TYPE_100BASE_TX:
848848
ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg);

drivers/net/ethernet/intel/i40e/i40e_type.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,8 @@ struct i40e_phy_info {
239239
#define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \
240240
I40E_PHY_TYPE_OFFSET)
241241
/* Offset for 2.5G/5G PHY Types value to bit number conversion */
242-
#define I40E_PHY_TYPE_OFFSET2 (-10)
243-
#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \
244-
I40E_PHY_TYPE_OFFSET2)
245-
#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \
246-
I40E_PHY_TYPE_OFFSET2)
242+
#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T)
243+
#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T)
247244
#define I40E_HW_CAP_MAX_GPIO 30
248245
/* Capabilities of a PF or a VF or the whole device */
249246
struct i40e_hw_capabilities {

0 commit comments

Comments
 (0)