From patchwork Tue May 23 15:55:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13252600 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75D89C7EE23 for ; Tue, 23 May 2023 15:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5WGvY5Q+po/05ocqAMWC409fnMazTmZPYrETTQjLjK0=; b=gAO8lTJLflai1o 85ZYanoU8Y5waMDD5ty8IFbMoOMtMGeAqMhAg+L6zVBYMDwHUdrozV+AUX/BT9dygfsWblpwT7vrZ KQyzSqVDnTnFWcpD92K1xVWye/C6PSNizROt+7XyFr7k/NnLY0Y6BkZgLbuy+4AgaVLotk521qKm3 jYNC+YLSj5mQZ3QljAvFuHdUgkuba5u6rLOIPy+AqWusTEgZx43eqQC8Emj3+eIH2g/r62xCo2wDH s+CLvo5/NW668CfmhM5c9vMmhwVZs7YdT1fLyc/x0o0+s47sstjk4T4spySJejAojG4+BLwSTfgOg cuhjmLvqwu8nFZ9y3JOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1UMk-00AiD5-0i; Tue, 23 May 2023 15:56:02 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1UMY-00Ai5z-0J for linux-arm-kernel@lists.infradead.org; Tue, 23 May 2023 15:55:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FVOoKlcE9wbWI4c+QH+jePyQLl9O41VBGHtZioJCPsQ=; b=wizhLKf3/3+tPK6Z1OYi84b2os DQSOPSSfBjUj8bwXwofOD7sa6gRLE8yxSvG+KKgp3Nc8Rs7nXXzUrOJljvjC2vBFkofPnNCkor97E LAbSdHkM6rsMeXWQut/kLsSl3aSLDtu1vb0Xk4G0Afsx/O8Smwy4vMEv2NnWpjkAvdWQzdWvNyWly sgAsP/87ADszKiRMgusL76iQaihboqkDGtdc1iKexFRLFDhrlxZNzl1eYRwyBvcoHCOHYhqc7AuIE NyYSAk+WglhO6x9nPr8LygscAE5PSFG2deJlQtT8BNcRvBUwEFMuh7HQZPOc5QbGjQBJ6IX8XtUzV HydRRHGg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:51716 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q1UMU-0000lT-LD; Tue, 23 May 2023 16:55:46 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1q1UMT-007FTJ-Ov; Tue, 23 May 2023 16:55:45 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Daniel Machon , "David S. Miller" , Eric Dumazet , Florian Fainelli , Horatiu Vultur , Ioana Ciornei , Jakub Kicinski , Lars Povlsen , linux-arm-kernel@lists.infradead.org, Madalin Bucur , Marcin Wojtas , Michal Simek , netdev@vger.kernel.org, Paolo Abeni , Radhey Shyam Pandey , Sean Anderson , Steen Hegelund , Taras Chornyi , Thomas Petazzoni , UNGLinuxDriver@microchip.com, Vladimir Oltean Subject: [PATCH RFC net-next 8/9] net: lan966x: switch PCS driver to use phylink_pcs_neg_mode() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 23 May 2023 16:55:45 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230523_085550_137175_E2934157 X-CRM114-Status: GOOD ( 10.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use the newly introduced phylink_pcs_neg_mode() to configure whether inband-AN should be used. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c b/drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c index c5f9803e6e63..29bbd642cec8 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c @@ -103,12 +103,16 @@ static int lan966x_pcs_config(struct phylink_pcs *pcs, { struct lan966x_port *port = lan966x_pcs_to_port(pcs); struct lan966x_port_config config; + unsigned int neg_mode; int ret; + neg_mode = phylink_pcs_neg_mode(mode, interface, advertising); + config = port->config; config.portmode = interface; - config.inband = phylink_autoneg_inband(mode); - config.autoneg = phylink_test(advertising, Autoneg); + config.inband = neg_mode == PHYLINK_PCS_NEG_INBAND_DISABLED || + neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED; + config.autoneg = neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED; config.advertising = advertising; ret = lan966x_port_pcs_set(port, &config);