@@ -2188,6 +2188,9 @@ static int e1000_get_rxnfc(struct net_device *netdev,
static int e1000e_get_eee(struct net_device *netdev, struct ethtool_eee *edata)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(lm_able) = {};
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(lm_adv) = {};
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(lm_lp) = {};
struct e1000_hw *hw = &adapter->hw;
u16 cap_addr, lpa_addr, pcs_stat_addr, phy_data;
u32 ret_val;
@@ -2222,16 +2225,19 @@ static int e1000e_get_eee(struct net_device *netdev, struct ethtool_eee *edata)
ret_val = e1000_read_emi_reg_locked(hw, cap_addr, &phy_data);
if (ret_val)
goto release;
- edata->supported = mmd_eee_cap_to_ethtool_sup_t(phy_data);
+ mii_eee_cap1_mod_linkmode_t(lm_able, phy_data);
+ ethtool_convert_link_mode_to_legacy_u32(&edata->supported, lm_able);
/* EEE Advertised */
- edata->advertised = mmd_eee_adv_to_ethtool_adv_t(adapter->eee_advert);
+ mii_eee_cap1_mod_linkmode_t(lm_adv, adapter->eee_advert);
+ ethtool_convert_link_mode_to_legacy_u32(&edata->advertised, lm_adv);
/* EEE Link Partner Advertised */
ret_val = e1000_read_emi_reg_locked(hw, lpa_addr, &phy_data);
if (ret_val)
goto release;
- edata->lp_advertised = mmd_eee_adv_to_ethtool_adv_t(phy_data);
+ mii_eee_cap1_mod_linkmode_t(lm_lp, phy_data);
+ ethtool_convert_link_mode_to_legacy_u32(&edata->lp_advertised, lm_lp);
/* EEE PCS Status */
ret_val = e1000_read_emi_reg_locked(hw, pcs_stat_addr, &phy_data);
@@ -2264,6 +2270,7 @@ static int e1000e_get_eee(struct net_device *netdev, struct ethtool_eee *edata)
static int e1000e_set_eee(struct net_device *netdev, struct ethtool_eee *edata)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(adv) = {};
struct e1000_hw *hw = &adapter->hw;
struct ethtool_eee eee_curr;
s32 ret_val;
@@ -2287,7 +2294,8 @@ static int e1000e_set_eee(struct net_device *netdev, struct ethtool_eee *edata)
return -EINVAL;
}
- adapter->eee_advert = ethtool_adv_to_mmd_eee_adv_t(edata->advertised);
+ adv[0] = edata->advertised;
+ adapter->eee_advert = linkmode_to_mii_eee_cap1_t(adv);
hw->dev_spec.ich8lan.eee_disable = !edata->eee_enabled;
Replace EEE ethtool helpers with linkmode variants. This will reduce similar code snippets and prepare ethtool EEE interface to linkmode migration. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> --- drivers/net/ethernet/intel/e1000e/ethtool.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)