From patchwork Wed Feb 1 14:58:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 13124536 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C52B3C636D3 for ; Wed, 1 Feb 2023 14:59:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232557AbjBAO7j (ORCPT ); Wed, 1 Feb 2023 09:59:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232680AbjBAO7I (ORCPT ); Wed, 1 Feb 2023 09:59:08 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A887D6A73F for ; Wed, 1 Feb 2023 06:59:05 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pNEZY-0002rc-0G; Wed, 01 Feb 2023 15:58:52 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pNEZW-001w1N-SO; Wed, 01 Feb 2023 15:58:49 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pNEZT-009hXJ-Ik; Wed, 01 Feb 2023 15:58:47 +0100 From: Oleksij Rempel To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Wei Fang , Heiner Kallweit Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Arun.Ramadoss@microchip.com, intel-wired-lan@lists.osuosl.org Subject: [PATCH net-next v4 19/23] igc: replace EEE ethtool helpers to linkmode variants Date: Wed, 1 Feb 2023 15:58:41 +0100 Message-Id: <20230201145845.2312060-20-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201145845.2312060-1-o.rempel@pengutronix.de> References: <20230201145845.2312060-1-o.rempel@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 --- drivers/net/ethernet/intel/igc/igc_ethtool.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index 5a26a7805ef8..b23e904fc347 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -1582,12 +1582,14 @@ static int igc_ethtool_get_eee(struct net_device *netdev, struct ethtool_eee *edata) { struct igc_adapter *adapter = netdev_priv(netdev); + __ETHTOOL_DECLARE_LINK_MODE_MASK(adv) = {}; struct igc_hw *hw = &adapter->hw; u32 eeer; - if (hw->dev_spec._base.eee_enable) - edata->advertised = - mmd_eee_adv_to_ethtool_adv_t(adapter->eee_advert); + if (hw->dev_spec._base.eee_enable) { + mii_eee_100_10000_adv_mod_linkmode_t(adv, adapter->eee_advert); + ethtool_convert_link_mode_to_legacy_u32(&edata->advertised, adv); + } *edata = adapter->eee; edata->supported = SUPPORTED_Autoneg; @@ -1623,6 +1625,7 @@ static int igc_ethtool_set_eee(struct net_device *netdev, struct ethtool_eee *edata) { struct igc_adapter *adapter = netdev_priv(netdev); + __ETHTOOL_DECLARE_LINK_MODE_MASK(adv) = {}; struct igc_hw *hw = &adapter->hw; struct ethtool_eee eee_curr; s32 ret_val; @@ -1655,7 +1658,8 @@ static int igc_ethtool_set_eee(struct net_device *netdev, return -EINVAL; } - adapter->eee_advert = ethtool_adv_to_mmd_eee_adv_t(edata->advertised); + adv[0] = edata->advertised; + adapter->eee_advert = linkmode_adv_to_mii_eee_100_10000_adv_t(adv); if (hw->dev_spec._base.eee_enable != edata->eee_enabled) { hw->dev_spec._base.eee_enable = edata->eee_enabled; adapter->flags |= IGC_FLAG_EEE;