@@ -2339,6 +2339,8 @@ static void tg3_phy_apply_otp(struct tg3 *tp)
static void tg3_eee_pull_config(struct tg3 *tp, struct ethtool_eee *eee)
{
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(adv) = {};
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(lp) = {};
u32 val;
struct ethtool_eee *dest = &tp->eee;
@@ -2361,13 +2363,16 @@ static void tg3_eee_pull_config(struct tg3 *tp, struct ethtool_eee *eee)
/* Pull lp advertised settings */
if (tg3_phy_cl45_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_LPABLE, &val))
return;
- dest->lp_advertised = mmd_eee_adv_to_ethtool_adv_t(val);
+ mii_eee_cap1_mod_linkmode_t(lp, val);
+ ethtool_convert_link_mode_to_legacy_u32(&dest->lp_advertised, lp);
+
/* Pull advertised and eee_enabled settings */
if (tg3_phy_cl45_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, &val))
return;
dest->eee_enabled = !!val;
- dest->advertised = mmd_eee_adv_to_ethtool_adv_t(val);
+ mii_eee_cap1_mod_linkmode_t(adv, val);
+ ethtool_convert_link_mode_to_legacy_u32(&dest->advertised, adv);
/* Pull tx_lpi_enabled */
val = tr32(TG3_CPMU_EEE_MODE);
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/broadcom/tg3.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)