Commit 39ed02a4 authored by Anirudh Venkataramanan's avatar Anirudh Venkataramanan Committed by Tony Nguyen

ice: Allow 100M speeds for some devices

For certain devices, 100M speeds are supported. Do not mask off
100M speed for these devices.
Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Co-developed-by: default avatarChinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: default avatarChinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: default avatarMikael Barsehyan <mikael.barsehyan@intel.com>
Tested-by: Kavya AV <kavyax.av@intel.com> (A Contingent worker at Intel)
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent affa1029
...@@ -2775,6 +2775,26 @@ ice_aq_set_port_params(struct ice_port_info *pi, bool double_vlan, ...@@ -2775,6 +2775,26 @@ ice_aq_set_port_params(struct ice_port_info *pi, bool double_vlan,
return ice_aq_send_cmd(hw, &desc, NULL, 0, cd); return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
} }
/**
* ice_is_100m_speed_supported
* @hw: pointer to the HW struct
*
* returns true if 100M speeds are supported by the device,
* false otherwise.
*/
bool ice_is_100m_speed_supported(struct ice_hw *hw)
{
switch (hw->device_id) {
case ICE_DEV_ID_E822C_SGMII:
case ICE_DEV_ID_E822L_SGMII:
case ICE_DEV_ID_E823L_1GBE:
case ICE_DEV_ID_E823C_SGMII:
return true;
default:
return false;
}
}
/** /**
* ice_get_link_speed_based_on_phy_type - returns link speed * ice_get_link_speed_based_on_phy_type - returns link speed
* @phy_type_low: lower part of phy_type * @phy_type_low: lower part of phy_type
......
...@@ -204,6 +204,7 @@ ice_aq_set_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, bool value, ...@@ -204,6 +204,7 @@ ice_aq_set_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, bool value,
int int
ice_aq_get_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, ice_aq_get_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx,
bool *value, struct ice_sq_cd *cd); bool *value, struct ice_sq_cd *cd);
bool ice_is_100m_speed_supported(struct ice_hw *hw);
int int
ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size, ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
......
...@@ -1470,20 +1470,22 @@ ice_get_ethtool_stats(struct net_device *netdev, ...@@ -1470,20 +1470,22 @@ ice_get_ethtool_stats(struct net_device *netdev,
/** /**
* ice_mask_min_supported_speeds * ice_mask_min_supported_speeds
* @hw: pointer to the HW structure
* @phy_types_high: PHY type high * @phy_types_high: PHY type high
* @phy_types_low: PHY type low to apply minimum supported speeds mask * @phy_types_low: PHY type low to apply minimum supported speeds mask
* *
* Apply minimum supported speeds mask to PHY type low. These are the speeds * Apply minimum supported speeds mask to PHY type low. These are the speeds
* for ethtool supported link mode. * for ethtool supported link mode.
*/ */
static static void
void ice_mask_min_supported_speeds(u64 phy_types_high, u64 *phy_types_low) ice_mask_min_supported_speeds(struct ice_hw *hw,
u64 phy_types_high, u64 *phy_types_low)
{ {
/* if QSFP connection with 100G speed, minimum supported speed is 25G */ /* if QSFP connection with 100G speed, minimum supported speed is 25G */
if (*phy_types_low & ICE_PHY_TYPE_LOW_MASK_100G || if (*phy_types_low & ICE_PHY_TYPE_LOW_MASK_100G ||
phy_types_high & ICE_PHY_TYPE_HIGH_MASK_100G) phy_types_high & ICE_PHY_TYPE_HIGH_MASK_100G)
*phy_types_low &= ~ICE_PHY_TYPE_LOW_MASK_MIN_25G; *phy_types_low &= ~ICE_PHY_TYPE_LOW_MASK_MIN_25G;
else else if (!ice_is_100m_speed_supported(hw))
*phy_types_low &= ~ICE_PHY_TYPE_LOW_MASK_MIN_1G; *phy_types_low &= ~ICE_PHY_TYPE_LOW_MASK_MIN_1G;
} }
...@@ -1533,7 +1535,8 @@ ice_phy_type_to_ethtool(struct net_device *netdev, ...@@ -1533,7 +1535,8 @@ ice_phy_type_to_ethtool(struct net_device *netdev,
phy_types_low = le64_to_cpu(pf->nvm_phy_type_lo); phy_types_low = le64_to_cpu(pf->nvm_phy_type_lo);
phy_types_high = le64_to_cpu(pf->nvm_phy_type_hi); phy_types_high = le64_to_cpu(pf->nvm_phy_type_hi);
ice_mask_min_supported_speeds(phy_types_high, &phy_types_low); ice_mask_min_supported_speeds(&pf->hw, phy_types_high,
&phy_types_low);
/* determine advertised modes based on link override only /* determine advertised modes based on link override only
* if it's supported and if the FW doesn't abstract the * if it's supported and if the FW doesn't abstract the
* driver from having to account for link overrides * driver from having to account for link overrides
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment