From patchwork Sun Feb 4 23:40:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 196608 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp576669dyb; Sun, 4 Feb 2024 15:45:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgGE5ynfSYRWmNYjWW1oQb+j3lk8PV8pcJTjUC7O733SxLYsG7rPgB5QcdsHcSy6m8cSV8 X-Received: by 2002:a05:6358:6a43:b0:178:9b16:5bbe with SMTP id c3-20020a0563586a4300b001789b165bbemr17201641rwh.9.1707090343147; Sun, 04 Feb 2024 15:45:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707090343; cv=pass; d=google.com; s=arc-20160816; b=Uwpi0dm+GOmXtPvA8vGS8SbVkXCEwhWu1gq3HEEmYh2kTGfZ9aT+0/16iZrvh67Jh4 ijEDdBq3eB5gCMYSppQwLzWE1GhGHUwB/N07tsnGBOUOho9TWchiSNJD4oKHU6ximrM5 AKA4eO+jIqLGk1oii3aDshJMcqzk3TbRZJ5MLnRQP0aCyWUcGOfNV7Fhae1GANemc942 ywRRD1X8+NAgwtedIBsF0BsaJ4oyfnwQbVqf7BHd9wRpen6ikHy/8Anh6PKuygCWcwCh D27f6klLbHFYQTTPRvugc3rHo5u8VXzklHKpa2E23FUQ++2laXdAFllyAvmhy1mcDYvG h2LQ== 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=qhzUzBBE/ag86Iuv8pKOl72IzBpodGhMjRQDM/+8K5Y=; fh=nxP7MH+H5ifhg0oDG/qG3P8PJbzAk/HH/dGoP2nUpYQ=; b=DJ9q0sIFJWFBdwidHXHL6IRO5j3RXsPtdlg7libMgCpf/gJRiV3G+/WGHdK4ubFmrc QeKr1RrDeGO8EjHvEipv0JoVFCdd9AOnUrAPTUAYZ8Ioc+WU+jJXjFEj2uqZHmQyg8zw Zbp2MHwlS6EfqBsDfaFq7xp9XEZuqp3tATEQJkCMconQQTjpo4ejRZqY9ZkjWvWASMeh N5E9xthsrQgMQe44qlVV//f4N/m8KpO494Gl84SvlCT0O+DrvAlYcMmc4CUluDJFeqat UzqZw6RYUnBzCPCmTaGYMqsbllk8fuDd4OUvOdANVJpZTs7oU4tWoGBZAvdsTzRQTSiA wezg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=a11NRg3H; 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-51956-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51956-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch X-Forwarded-Encrypted: i=1; AJvYcCUh0c91Fr6jyJyG2gkS6Y1UUEXC8jW9dSDIgRK+NxpIWgFXKbnIkNDNETCTw0cLs+Wo0i+GaPmKsoeE4Kf4Dr73yxdDug== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l11-20020a63da4b000000b005cdf488ba0asi5030042pgj.746.2024.02.04.15.45.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 15:45:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51956-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=a11NRg3H; 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-51956-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51956-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AED8FB216A5 for ; Sun, 4 Feb 2024 23:44:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2A38FBE4; Sun, 4 Feb 2024 23:41:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="a11NRg3H" 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 BDFD7DDBB; Sun, 4 Feb 2024 23:41:03 +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=1707090065; cv=none; b=uOh4KyNkVRiZMrqniXgkW6Xpxa3XB/DA6C0b51IJeZMlOfPtH4t/zCL9u3jNW3BI8q71sIUa3kerKUy99aOnhfQk4Cd/PHG+xoEzb7LtRSI/wZjqWOHLGv7n7yPZNF3RHJ5mtHlsaNtzuzxDYLupFfVLaakrOondnsdtalC2JOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707090065; c=relaxed/simple; bh=GY/i358jYl4X2zeywHliUg8zbjHunLh0+ZONAyCsEDA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aAI++OIheVavLbfGXqVxUnmAvAKR5YQe/WKvqPkiKplhYqoxLFgxVcKvl6sQJtj8olYh27MsTRZ7KCirrGhSRmU5MMl0igljjwrG3xHiwkVFLGAM2K2uq0JzT61JxH/aTnIs2S3rGnA5BtrlS8TiX3ZkLdKdcGxFVBy5Omddj2U= 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=a11NRg3H; 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=qhzUzBBE/ag86Iuv8pKOl72IzBpodGhMjRQDM/+8K5Y=; b=a1 1NRg3H7ioa/uQU6pi/ZYzRyp/9SW1iXD8TQh21Su2H/FGxpmTEIhW/G1CHiBRuLFnRY5iuX1nar71 Vp/lgjZHmQODZsHCwzFL6WN98kX9yVukadk/EWHaVtIb4yyrDBPkzfpz6q9sX59x1yZZD0w8IihVb xM4YFFx/kjoZQLA=; 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 1rWm6a-006z7T-7L; Mon, 05 Feb 2024 00:40:56 +0100 From: Andrew Lunn Date: Sun, 04 Feb 2024 17:40:25 -0600 Subject: [PATCH 8/8] net: intel: igc: 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: <20240204-keee-u32-cleanup-v1-8-fb6e08329d9a@lunn.ch> References: <20240204-keee-u32-cleanup-v1-0-fb6e08329d9a@lunn.ch> In-Reply-To: <20240204-keee-u32-cleanup-v1-0-fb6e08329d9a@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=1638; i=andrew@lunn.ch; h=from:subject:message-id; bh=GY/i358jYl4X2zeywHliUg8zbjHunLh0+ZONAyCsEDA=; b=owEBbQKS/ZANAwAKAea/DcumaUyEAcsmYgBlwCBqchq37ZWAaCXguBx3KZrCunBRHw7lO6YQI BGeHWL/fxmJAjMEAAEKAB0WIQRh+xAly1MmORb54bfmvw3LpmlMhAUCZcAgagAKCRDmvw3LpmlM hP3+EACmrlqVvQVpi8hIGv7u5kcwmZhDfq2v8zuE8ahroCH+WVKmtXgT7ujGkPXLj5rrHSNQ/Tb oc2Gm0y9F67PRPsKstTJE6dA+6MbKjAt6WBUiVEQq/FKf5rRumNLyD1zJa3qQqPckX1QCdLS53R jS5ub1Kl29ZaY1uVJSM6maQ6TLbJDCO0fihwjnPzrQjM8yeRdCakWGGi1zOSmwqqSk53LiIk9/+ szNw6xdTqY5leQVYyCoc+iLPDMCqeO7nMnUzXwzeaPRv9y0EU676Gc06lOKBP2X4xDU6xHZqTcu SKzpM9We/Bgd2sKHPUEiuywZv+OOeKktgaTksyQxG6Q+TXfLXdYAFx0INrkOb1duE9nY5nGZdPG 6/zXaCs2uwEHbGyEowgLAGCli6RLOMmMALU02Ti+Xc7GCXB9RuyiPhe1BMZijpEvi4rDKgTSifB sLkyNIgCwf31Xm/KGlZ/aGdKMS8l0Bnn+ZViQhpfHkWyjtSEEfY+Gu6845mPQt7/FXT4hRo3E0B TL1SUMeyGbGcb4j/OtcSgf3p6Kq1gMJgCaePXLGV5Nd3idrfpE9+LNZVPa0PSq6HvHm4hLnNhMP zZaFrKD+qEymoaFGnDIrjnkeoHcqtpFNI+rza8BkAxh6WVJLybo4W4ECsNFYch9pa5P7XNJOUpc hk4xXG7KVvmucew== X-Developer-Key: i=andrew@lunn.ch; a=openpgp; fpr=61FB1025CB53263916F9E1B7E6BF0DCBA6694C84 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790013963943165657 X-GMAIL-MSGID: 1790013963943165657 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/ethernet/intel/igc/igc_ethtool.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index e9aed4069ebe..e9d78bcb0201 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -1630,8 +1630,8 @@ static int igc_ethtool_get_eee(struct net_device *netdev, u32 eeer; if (hw->dev_spec._base.eee_enable) - edata->advertised_u32 = - mmd_eee_adv_to_ethtool_adv_t(adapter->eee_advert); + mii_eee_cap1_mod_linkmode_t(edata->advertised, + adapter->eee_advert); *edata = adapter->eee; @@ -1653,7 +1653,7 @@ static int igc_ethtool_get_eee(struct net_device *netdev, edata->eee_enabled = false; edata->eee_active = false; edata->tx_lpi_enabled = false; - edata->advertised_u32 &= ~edata->advertised_u32; + linkmode_zero(edata->advertised); } return 0; @@ -1695,7 +1695,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_u32); + adapter->eee_advert = linkmode_to_mii_eee_cap1_t(edata->advertised); + if (hw->dev_spec._base.eee_enable != edata->eee_enabled) { hw->dev_spec._base.eee_enable = edata->eee_enabled; adapter->flags |= IGC_FLAG_EEE;