From patchwork Sat Feb 17 18:08:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 202663 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp446613dyc; Sat, 17 Feb 2024 10:10:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXRY948gaOWRTR4jneu9BkOIAX/zzmJ0qxrKm27xOhFU4n5U3+HTVs9CH+L0LZryPx8XWef9U420rKAFkLxEmsSy+QIzg== X-Google-Smtp-Source: AGHT+IFfbACjyBaQvkqGyBwjHjx0T+dWodoWXLoiIjF03ubLp15AzoHWW/O7j9yne06EdPYIzNOo X-Received: by 2002:a05:622a:c4:b0:42d:bfaa:dbb5 with SMTP id p4-20020a05622a00c400b0042dbfaadbb5mr11238519qtw.49.1708193438277; Sat, 17 Feb 2024 10:10:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708193438; cv=pass; d=google.com; s=arc-20160816; b=iltgGuLO1odUZjtlWx9fNwIY2KULzqfswm+918BkBBAhxLkhomwYNR8t+lKJcxD2SE A5T/EQs1lTJYuXAW8uzof97CZxNiac8gJYFNEO9usLGwuuyMkY0Jcovwxl6Y1X05TQxq 1O5QrRw42Q3PLZnYf36YgO/+Ck7wISVtfQ1193f5V2QXtZBb6UViS5/y2tAwjQbtJ2T/ rpo8h5AbUwnSNDty1pJymQwjCteENBxalL90qO4pX40M5m6Jf3vSWQxAdVkDM4xvYGAX rEQeNsx7+kG7ERA5tXBgMYU+aCDJ/3n/zm3Cqu37wO3pUpRpfscfPYs9W4UmODixPonU hlDQ== 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=ihP7AQ+J6izpGPj7OVwl3IzV74sqI16qkj3dcY8EXa1xYeB3j8emHzmEZTAv5IbRcC pK1zk/IXeO42a840JkNs8c6unD2PvjfmAxGB6iIO9K/YMqiESC4ABtFprXKz2M8Ag1CO o5yUWjx95/Ntp20p18mCYFz8tvy0Fgvk7DJiAWqXfN3uJAyk/MIoXqHJhcp6qk02GZga kmiz5pXcw+SiaK27zpiIFTG70YXWr//tRmFPvORPZT+dzgBWCQ6QjVl5ByKBnyu1z8yo vN9IlGKRe3FcNqy1uDd6eEvixnIJXV4/o2BlU31wC6OCn2dN9gP6QDZ9rs5QD+TxsvOV 2aAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=fHzdW0lH; 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-70000-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70000-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o24-20020ac85558000000b0042ddd577a3esi2429912qtr.10.2024.02.17.10.10.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 10:10:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70000-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=fHzdW0lH; 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-70000-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70000-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 16CEA1C20E00 for ; Sat, 17 Feb 2024 18:10:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B77A57E0F2; Sat, 17 Feb 2024 18:09:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="fHzdW0lH" 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 515917E0F6; Sat, 17 Feb 2024 18:09: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=1708193367; cv=none; b=kOm2TkV91Ic2asmxpD91PVK0lJpWxE+l5X1TqvLjueBqz277ztZNB6l1pUOtAZcMGuDTXJG2X5ZNOnVEODRMcGYB/aP363CevxO+eUCc0KadJXtftN2Xp8GRc5uEObrtXaylBo/ffWBC5J2dEpzIhPxPtW2+++anYeGQlwcB1BM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708193367; c=relaxed/simple; bh=Cpjch1b1D9Jp2vWORWgwbDnErRScd5QZqvv0qT6yMzg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jBi2ba3+LeZiuFE8P8KpRgQXAuu+YKE919MkjC4AB4nVvR0NIKzRxpqBLA4+l9g5tlXsR42myPiuMsDv2PW7KbZF6JykA7YaWNbsXl9Lh5DQnBbqaAa4P/Yr0zH3hlyHf9LIfECg1wGIXSbSvYOwMrWyh6+TVAC1SuUsYlx5M6Y= 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=fHzdW0lH; 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=fH zdW0lHWWLc/POW7pCTRFlBPk0DTs51pOcrx5hZAeKc+yuhw66JdOu9liqOCUS6PlwztyVpu2xXFyR fAc4DNDXHYMuwGk2j1/BKViX47ZpsqWTolXVm1CHUxfY0PdZj5/YwIHsVeisJ0cgeM6KmmKFlcBBn 8hvbnIItV7Hhsyw=; 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 1rbP7t-0084hf-4e; Sat, 17 Feb 2024 19:09:25 +0100 From: Andrew Lunn Date: Sat, 17 Feb 2024 12:08:23 -0600 Subject: [PATCH net-next v3 2/8] 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: <20240217-keee-u32-cleanup-v3-2-fcf6b62a0c7f@lunn.ch> References: <20240217-keee-u32-cleanup-v3-0-fcf6b62a0c7f@lunn.ch> In-Reply-To: <20240217-keee-u32-cleanup-v3-0-fcf6b62a0c7f@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/DcumaUyEAcsmYgBl0PY58DYGzHvvkqG4UGjQxMYZTQXXDJTNrQh7C t80oBY825qJAjMEAAEKAB0WIQRh+xAly1MmORb54bfmvw3LpmlMhAUCZdD2OQAKCRDmvw3LpmlM hFOkD/9dZqCRSsbEoUP+e0wgdaogNOGOUIP3TaXJlttrSDQPWatzT5sKf2NInwGIeghthNUwQtN g4oTdX9/RtvbQlE6Eyyy1uvY9ihn0Ef+n8aqukpo10C5oibY8apbB7ARds/QXwLYwZJeHzKu5i7 PMUxda2IqqYKVc5S+ON+69Hn73FXd1FcixOrJJqXh71SC0xxOAwJ/whbLVFthrDlR79LJKw+RTE 10WgYbimMkATPAKjULJ5Lw1oQbohp3uufTgUZIGmRw9yu+7u6pu44TbxAOZvhCFPcYwX3FgSci8 lTMKsk372sAGERmTTf9j1PuDVSwbmdrnVF+vDnwEYjuWYj7KELPdYq9KgtGc5v/mZK4Cif/Jxxv yHEVMdtgVFHdrPJ8gOLdKIhuTdox/4pmCfUHCNkwSWNjD6jgObCzteXnKYhaphpO5MECQrrkO4Y oFp/V1yjg8JB7RZKzwxUSW2UrxyrGLcBkXEW40A5XzSDn8ld3d6f4kt8mLY4zJbazDJNGG/pnH+ vBi2/KDlcc4JNSfn4KignPAP5Rifjv0bXmOsYotpeqjApuJ+8GQZmwCkbdrBoKmtLIwxiNRz+zZ wjXphDf8kZ6cHTvqmr/fgsamquAVDSit8hXWznjJk0QPaomFeOKREGCFqY0iQ1Tks1Ddx/zzNXz Qev5yto7x7TSveA== X-Developer-Key: i=andrew@lunn.ch; a=openpgp; fpr=61FB1025CB53263916F9E1B7E6BF0DCBA6694C84 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791170642892549716 X-GMAIL-MSGID: 1791170642892549716 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 */