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: 202812 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp870756dyc; Sun, 18 Feb 2024 09:08:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCURRp5iT/JCuFr6fGy/WfG4Xl5EXcGHJ0L4urgFfCOr/VhIwJvBJEcw8pBbbxwikhbLxqOOuZZCHriA/OR9L4br+j+afg== X-Google-Smtp-Source: AGHT+IFY/Y6FCx9oxfPoQamFEHFRzZXgzKYNs4FZQ4a/uwBbm/IbGHpUAOA8/el+Sn30jqfgvBcM X-Received: by 2002:a05:6a20:d908:b0:1a0:8ce9:1575 with SMTP id jd8-20020a056a20d90800b001a08ce91575mr7357653pzb.5.1708276110327; Sun, 18 Feb 2024 09:08:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708276110; cv=pass; d=google.com; s=arc-20160816; b=bTpXHMsRxSSFxhklKXrYvcwrm1oLMc45u80+wq/Us6V7eE6rRwEJ/H+d+UdUIzQzX1 +5ibJqMPcOexutzWAo1dNMcLyx661yn7WZt6du/zpKxF00VuBkRNbenBcs0YDZ+09Ncq 9B30PyDDakV7AEDsAGixfttfv6AoUbIRT2DYOypqVzt62DNfuMfcsd6GBUbqsZf0K012 GSvbBV4g0yI7VsMi3lfXdIMqRThVh6OPswZpuoVfpiERngX6ivtEQ1JxCA7VBVGEAxoO UmU0QR3lQGydBcJFG+9WHs0c2NFThPT7zEwasuboFTCof2BcQrxTBE0rqv/hZ+i+Z36G pEzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=sauFk9hjjr6pfRUCRoWd8WYck0QUyoBECM2fduhdkgE=; fh=7ogY8TTBnoDyVw0Ew02z/XaZICVahvk3b1eitAEneUQ=; b=LWkBUUSYaTT3cFSuSopP1GJ+8L0TVVGIXHuZETKb8IK4uyBOSS/CGIP1MiISVRDTtp 7NcmDUcI2S7Jd3cnOgpllxfFQ9C7YMTJEwAe7DNtpFaOPbzAHG+i7HJXSCTRNCgcMhG0 9iIxFtFy+j+vFYEUyy6snMHk/3bSGlSdiGS4/TjCDuMAz8d+iYeoY5PMRFong8ynhAql wV3QTapF0VOo5UEO+prU5Fp0lP0JN/9VimmWDW5r1/HRr09M2vDhxsTZ/6aynYAZF6FP /YvoSu8/Rb/SHlxd/IBYmLlpYZauN6ThYYr8jUtkPMj8weF/fujIzmNWwyY23OpO6CdS cznA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=2OCcl4n5; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-70449-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70449-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d25-20020a637359000000b005cdf8b03384si3117730pgn.805.2024.02.18.09.08.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 09:08:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70449-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=2OCcl4n5; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-70449-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70449-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 276442817F9 for ; Sun, 18 Feb 2024 17:08:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 693D76F52F; Sun, 18 Feb 2024 17:07:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="2OCcl4n5" 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 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: linux-kernel@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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791257330610180556 X-GMAIL-MSGID: 1791257330610180556 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 */