From patchwork Sun Feb 18 17:06:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 13561902 X-Patchwork-Delegate: kuba@kernel.org Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45FA26EB70; Sun, 18 Feb 2024 17:07:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708276047; cv=none; b=Z6vKF4b3BNw6KorBSimjVP/7A/f4WpvrdF+QTM9he6tFgaLBOHr/plriemaBfI5EUA1GrC9v/ObxtfmoQC3R3na/mDfY/FBPv7LHUaj6HaqPXRTu2qjvgykbk9tgwMpdzBUxl02sXB441amFwFQw3fC1Heu8M7Z91FiTucaNNw0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708276047; c=relaxed/simple; bh=Cpjch1b1D9Jp2vWORWgwbDnErRScd5QZqvv0qT6yMzg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cBvo8KuF6Ay61rNse+hUa51IaIg2xoOddgB/rPZpV+Bhh75mDHSEFRTI7iuZEE4RHqkB/jTFasSngYNLsZJB8m72QeinQZbFj8kY49RPFN+i18XPcmW/x0LresjzubJ7rrKoyMAEoqz23xkoBSeJ1c/7mru30nLBY8rKENh3Gf8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=2OCcl4n5; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="2OCcl4n5" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition: In-Reply-To:References; bh=sauFk9hjjr6pfRUCRoWd8WYck0QUyoBECM2fduhdkgE=; b=2O Ccl4n55jUdwRe7EWrtEpeQbvEYWSaCFLsjWlnk/PNFz/j36fameT2OMiA5WABrYUcdnhoZ7MQGjn6 qNKH3EciRCsNogU0ZUmsUPKultQ7do8thkeajQaEOSgpKbF3pAI/uG4jlVo8plbOUzSos+Wwn7Ocf ptTb6tDXe+gw21A=; Received: from c-76-156-36-110.hsd1.mn.comcast.net ([76.156.36.110] helo=thinkpad.home.lunn.ch) by vps0.lunn.ch with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbkde-0088HX-TH; Sun, 18 Feb 2024 18:07:39 +0100 From: Andrew Lunn Date: Sun, 18 Feb 2024 11:06:59 -0600 Subject: [PATCH net-next v4 2/9] net: usb: ax88179_178a: Use linkmode helpers for EEE Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240218-keee-u32-cleanup-v4-2-71f13b7c3e60@lunn.ch> References: <20240218-keee-u32-cleanup-v4-0-71f13b7c3e60@lunn.ch> In-Reply-To: <20240218-keee-u32-cleanup-v4-0-71f13b7c3e60@lunn.ch> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Ariel Elior , Manish Chopra , Jesse Brandeburg , Tony Nguyen Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Andrew Lunn X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2018; i=andrew@lunn.ch; h=from:subject:message-id; bh=Cpjch1b1D9Jp2vWORWgwbDnErRScd5QZqvv0qT6yMzg=; b=owEBbQKS/ZANAwAKAea/DcumaUyEAcsmYgBl0jk/F2ghMvHESY0ii+p6xLvRfuLi547nM6+PW XzeryVvpmaJAjMEAAEKAB0WIQRh+xAly1MmORb54bfmvw3LpmlMhAUCZdI5PwAKCRDmvw3LpmlM hImtEACou5MOgMSpSoKsDBGzpdDNAR4w+EcZv+ZP4gwiptwXGhZmTI6O9i3noKdzuT6+XAzke3v pgZoDmx3JS+HifsFTz3nNFL1DXmbuZsnZH1Fo8rxo0EZlRVbry1x6DKiGjuttPI8M6KAEYMm7kC gU3Tsokri+d8YxEj5FA69kP6y7dIp67l9g0JMhttq53+5ckwmoyDQKfhGXRZl9kTDSBXaO9I462 xwCSbCj9tJuD+Wv63yLLunQbbwZzxdUcevB06u9B5GljdDsjAaV7GuqGDDOP95kHSvlahGT9PW/ efMRQwYms+6vHmeWnT23Oyig2WtUntvJvnVnhgBg26Q+RldejplSlAgpe6Wd3zH37IxkWJ/45rF QiP7P9oscACkPhiJlBS7ndsTZISSPLRvcjrhv/98Czar4qhSM6VXgl96YWS0sGt9VDS4/oU0vsV WslNc7Lqrw/ZpZxZQF3FKYlx9NrhhRVbtaViK+j6f4eBp4XoprBCn6j8kPWQl9zOXELPMCPMFGw qiIRX4P8Agzf4R5axmnt0daBoyq06mPrieH2ydyczzb/OLkIaQLzIqqqPityuHq4Ni3PrhCS31m iRfAOyYDg+21U3Y+YqyapOAyGEdJMvavQQnEWQpnIrbq/ECwrqeN/ExHRU0YFGpPGxq13+RuTpK ezQxjoPNwKgB93Q== X-Developer-Key: i=andrew@lunn.ch; a=openpgp; fpr=61FB1025CB53263916F9E1B7E6BF0DCBA6694C84 X-Patchwork-Delegate: kuba@kernel.org Make use of the existing linkmode helpers for converting PHY EEE register values into links modes, now that ethtool_keee uses link modes, rather than u32 values. Signed-off-by: Andrew Lunn --- drivers/net/usb/ax88179_178a.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index d6168eaa286f..d4bf9865d87b 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -676,21 +676,21 @@ ax88179_ethtool_get_eee(struct usbnet *dev, struct ethtool_keee *data) MDIO_MMD_PCS); if (val < 0) return val; - data->supported_u32 = mmd_eee_cap_to_ethtool_sup_t(val); + mii_eee_cap1_mod_linkmode_t(data->supported, val); /* Get advertisement EEE */ val = ax88179_phy_read_mmd_indirect(dev, MDIO_AN_EEE_ADV, MDIO_MMD_AN); if (val < 0) return val; - data->advertised_u32 = mmd_eee_adv_to_ethtool_adv_t(val); + mii_eee_cap1_mod_linkmode_t(data->advertised, val); /* Get LP advertisement EEE */ val = ax88179_phy_read_mmd_indirect(dev, MDIO_AN_EEE_LPABLE, MDIO_MMD_AN); if (val < 0) return val; - data->lp_advertised_u32 = mmd_eee_adv_to_ethtool_adv_t(val); + mii_eee_cap1_mod_linkmode_t(data->lp_advertised, val); return 0; } @@ -698,7 +698,7 @@ ax88179_ethtool_get_eee(struct usbnet *dev, struct ethtool_keee *data) static int ax88179_ethtool_set_eee(struct usbnet *dev, struct ethtool_keee *data) { - u16 tmp16 = ethtool_adv_to_mmd_eee_adv_t(data->advertised_u32); + u16 tmp16 = linkmode_to_mii_eee_cap1_t(data->advertised); return ax88179_phy_write_mmd_indirect(dev, MDIO_AN_EEE_ADV, MDIO_MMD_AN, tmp16); @@ -1663,7 +1663,6 @@ static int ax88179_reset(struct usbnet *dev) ax88179_disable_eee(dev); ax88179_ethtool_get_eee(dev, &eee_data); - eee_data.advertised_u32 = 0; ax88179_ethtool_set_eee(dev, &eee_data); /* Restart autoneg */