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: 13561491 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="fHzdW0lH" 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-usb@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 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 */