[net-next,3/6] net: phy: update in-band AN mode when changing interface by PHY driver
Message ID | 20230622041905.629430-4-yong.liang.choong@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4826176vqr; Wed, 21 Jun 2023 21:56:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7TsUw/Kv6SzKrkn+D79j0EN2ejf8BZfKi6bDZBOKd6MxWUcaz6sjEMbHL8wvy0WoR12UlT X-Received: by 2002:a05:6a20:158d:b0:123:6af:65bc with SMTP id h13-20020a056a20158d00b0012306af65bcmr5460755pzj.39.1687409804403; Wed, 21 Jun 2023 21:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687409804; cv=none; d=google.com; s=arc-20160816; b=TK4kZjrQmsa6KYMrRymjdOr7xcPMmUQeHytmzjzxLN1mKWpZHmMITp+u7IuxvUXR/u gCHjoXmGCngQzG067q7HE18l9dZfSO66eh3uHHSAVKUodgPbBJ107m9jftmh7ACFuZ0A UUfB/SUTIqJf8Cy65gX17ZZoO3IrGHq44VoXn6UUKfruJRJU3RSi9pl5Fpu9nWYvSobs 1Y8Q+YNvlgHJkKjtfkJrdlDM09XWkOjnxEcuhuDGhZ7qi/lB3ISy+pNHi+uEdTIHfaRW MU96ePQ7lrxaQ7opza7jLenJB7wRCDVHqpI8aE8AgPt7eJ4QyoZt+92gZWZOIkChH4hg X/rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nJ2ZqVhnVKJFlqRJ7jtTN6PVYnxmFFzyfT4tH0HShUo=; b=dye9LXysp0pKY5r8nL0AXnoSusNRX8dgW/gCMR/91jEiBFX7XjNShHGudrvzuYP8oz EiAHWd9/oDN6HJpng2ADHYI9y/5o+F1icK5KgpXXqg1OX6Nn3BHyiuHlCxnO8NCVqREM Pb4lhbdEv7vuRtq4WVA/mpWV6GmoGecihYYoi3BHksE2pwg1y5mSgL9LB3eXm31z52Nk K88H0tScqUv9KxzcckNmzkIzwtHuxMy77A2BZXU4Omf8rhLANu1no8KFpvIwlTVYLgp9 uKWiWFcRwyDsfKSSujYwTbqy/Jbk0DANqCIGkHO0QPZR6sGwApFDOZTascZBBmeiZpD5 YCIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=kOtAbPgX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r9-20020aa79889000000b0066a3679d812si3831352pfl.382.2023.06.21.21.56.32; Wed, 21 Jun 2023 21:56:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=kOtAbPgX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbjFVEUe (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Thu, 22 Jun 2023 00:20:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230364AbjFVEU3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 22 Jun 2023 00:20:29 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCD281BD8; Wed, 21 Jun 2023 21:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687407621; x=1718943621; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F4i3UtkcmjDUIWbcBagEhp8L3tnwaCF2AMJdmaRCNIo=; b=kOtAbPgX80oIyigadgINDlW/xA4hCGZcevak7x10v5ZfiPLg3M5JODMk urCE1ECSCz3rUkrD/rRb+QSQ19vOIA6zWLa+irxIMHVfdxFzQzxCdT1H7 qyaw3+kFe078zhLaazbrGGibXZpaJ31P7qQIAqPSu+F8J/dLkezD9lSnb QWu5di+Cud040asiYWdu6Z9t4+3PyLp/ZTC1+QC7bF/Z+BxyCt/PLCAVd zscH95s2yiB/CIHEA2LeYf8r4retyGUfGZ79oMp1z/yHAp1DT5gCaCb3X 1TwLypfmYzqNxTya0G9zmUQxOT+7xSd34JmzAdSybyHO6Y7GrgT9T226H Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10748"; a="363811950" X-IronPort-AV: E=Sophos;i="6.00,262,1681196400"; d="scan'208";a="363811950" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2023 21:20:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10748"; a="744453782" X-IronPort-AV: E=Sophos;i="6.00,262,1681196400"; d="scan'208";a="744453782" Received: from yongliang-ubuntu20-ilbpg12.png.intel.com ([10.88.229.33]) by orsmga008.jf.intel.com with ESMTP; 21 Jun 2023 21:20:08 -0700 From: Choong Yong Liang <yong.liang.choong@linux.intel.com> To: Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>, David E Box <david.e.box@intel.com>, Hans de Goede <hdegoede@redhat.com>, Mark Gross <markgross@kernel.org>, Jose Abreu <Jose.Abreu@synopsys.com>, Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, =?utf-8?q?Marek_Beh=C3=BAn?= <kabel@kernel.org>, Jean Delvare <jdelvare@suse.com>, Guenter Roeck <linux@roeck-us.net>, Giuseppe Cavallaro <peppe.cavallaro@st.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Jose Abreu <joabreu@synopsys.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Richard Cochran <richardcochran@gmail.com>, Philipp Zabel <p.zabel@pengutronix.de>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Jesper Dangaard Brouer <hawk@kernel.org>, John Fastabend <john.fastabend@gmail.com>, Wong Vee Khee <veekhee@apple.com>, Jon Hunter <jonathanh@nvidia.com>, Jesse Brandeburg <jesse.brandeburg@intel.com>, Revanth Kumar Uppala <ruppala@nvidia.com>, Shenwei Wang <shenwei.wang@nxp.com>, Andrey Konovalov <andrey.konovalov@linaro.org>, Jochen Henneberg <jh@henneberg-systemdesign.com> Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, bpf@vger.kernel.org, Voon Wei Feng <weifeng.voon@intel.com>, Tan@vger.kernel.org, Tee Min <tee.min.tan@linux.intel.com>, Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>, Lai Peter Jun Ann <jun.ann.lai@intel.com> Subject: [PATCH net-next 3/6] net: phy: update in-band AN mode when changing interface by PHY driver Date: Thu, 22 Jun 2023 12:19:02 +0800 Message-Id: <20230622041905.629430-4-yong.liang.choong@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622041905.629430-1-yong.liang.choong@linux.intel.com> References: <20230622041905.629430-1-yong.liang.choong@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769377423287462577?= X-GMAIL-MSGID: =?utf-8?q?1769377423287462577?= |
Series |
TSN auto negotiation between 1G and 2.5G
|
|
Commit Message
Choong Yong Liang
June 22, 2023, 4:19 a.m. UTC
From: "Tan, Tee Min" <tee.min.tan@linux.intel.com> Add cur_link_an_mode into phy_device struct for PHY drivers to communicate the in-band AN mode setting with phylink framework. As there is a mechanism in PHY drivers to switch the PHY interface between SGMII and 2500BaseX according to link speed. In this case, the in-band AN mode should be switching based on the PHY interface as well, if the PHY interface has been changed/updated by PHY driver. For e.g., disable in-band AN in 2500BaseX mode, or enable in-band AN back for SGMII mode (10/100/1000Mbps). Signed-off-by: Tan, Tee Min <tee.min.tan@linux.intel.com> Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com> --- drivers/net/phy/marvell10g.c | 6 ++++++ drivers/net/phy/phylink.c | 3 +++ include/linux/phy.h | 2 ++ 3 files changed, 11 insertions(+)
Comments
On Thu, Jun 22, 2023 at 12:19:02PM +0800, Choong Yong Liang wrote: > From: "Tan, Tee Min" <tee.min.tan@linux.intel.com> > > Add cur_link_an_mode into phy_device struct for PHY drivers to > communicate the in-band AN mode setting with phylink framework. > > As there is a mechanism in PHY drivers to switch the PHY interface > between SGMII and 2500BaseX according to link speed. In this case, > the in-band AN mode should be switching based on the PHY interface > as well, if the PHY interface has been changed/updated by PHY driver. > > For e.g., disable in-band AN in 2500BaseX mode, or enable in-band AN > back for SGMII mode (10/100/1000Mbps). > > Signed-off-by: Tan, Tee Min <tee.min.tan@linux.intel.com> > Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com> ... > diff --git a/include/linux/phy.h b/include/linux/phy.h > index 11c1e91563d4..c685b526e307 100644 > --- a/include/linux/phy.h > +++ b/include/linux/phy.h > @@ -756,6 +756,8 @@ struct phy_device { > /* MACsec management functions */ > const struct macsec_ops *macsec_ops; > #endif > + /* For communicate the AN mode setting with phylink framework. */ > + u8 cur_link_an_mode; > }; Hi Choong Yong Liang, Please consider adding cur_link_an_mode to the kernel doc for struct phy_device - which is above the definition of struct phy_device.
On Thu, Jun 22, 2023 at 04:43:51PM +0200, Simon Horman wrote: > On Thu, Jun 22, 2023 at 12:19:02PM +0800, Choong Yong Liang wrote: > > From: "Tan, Tee Min" <tee.min.tan@linux.intel.com> > > > > Add cur_link_an_mode into phy_device struct for PHY drivers to > > communicate the in-band AN mode setting with phylink framework. > > > > As there is a mechanism in PHY drivers to switch the PHY interface > > between SGMII and 2500BaseX according to link speed. In this case, > > the in-band AN mode should be switching based on the PHY interface > > as well, if the PHY interface has been changed/updated by PHY driver. > > > > For e.g., disable in-band AN in 2500BaseX mode, or enable in-band AN > > back for SGMII mode (10/100/1000Mbps). > > > > Signed-off-by: Tan, Tee Min <tee.min.tan@linux.intel.com> > > Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com> > > ... > > > diff --git a/include/linux/phy.h b/include/linux/phy.h > > index 11c1e91563d4..c685b526e307 100644 > > --- a/include/linux/phy.h > > +++ b/include/linux/phy.h > > @@ -756,6 +756,8 @@ struct phy_device { > > /* MACsec management functions */ > > const struct macsec_ops *macsec_ops; > > #endif > > + /* For communicate the AN mode setting with phylink framework. */ > > + u8 cur_link_an_mode; > > }; > > Hi Choong Yong Liang, > > Please consider adding cur_link_an_mode to the kernel doc > for struct phy_device - which is above the definition of struct phy_device. This looks like it's grabbing something from phylink and stuffing it into phylib. However, I have no idea, because I don't seem to have received the original patches. I'm guessing the reason is: 2023-06-22 05:21:24 1qCBoy-0003ji-G9 H=mga03.intel.com [134.134.136.65]:57703 I=[78.32.30.218]:25 X=TLS1.2:ECDHE_SECP521R1__RSA_SHA512__AES_256_GCM:256 F=<yong.liang.choong@linux.intel.com> rejected after DATA: unqualified address not permitted: failing address in "Cc:" header is: Tan Which I suspect came from: Tan, Tee Min <tee.min.tan@linux.intel.com> and someone doesn't realise that a "," in the display-name part of an address *must* be quoted, otherwise "," is taken to be a separator in the address list. Consequently, it has now become: Tan@web.codeaurora.org, Tee Min <tee.min.tan@linux.intel.com>, It should have been: "Tan, Tee Min" <tee.min.tan@linux.intel.com> with the double-quotes. Please do not review this series further, but instead, please can the author repost it forthwith with correct conformant headers so that a proper review can be undertaken by all? Thanks.
On Thu, Jun 22, 2023 at 04:06:31PM +0100, Russell King (Oracle) wrote: > On Thu, Jun 22, 2023 at 04:43:51PM +0200, Simon Horman wrote: > > On Thu, Jun 22, 2023 at 12:19:02PM +0800, Choong Yong Liang wrote: > > > From: "Tan, Tee Min" <tee.min.tan@linux.intel.com> > > > > > > Add cur_link_an_mode into phy_device struct for PHY drivers to > > > communicate the in-band AN mode setting with phylink framework. > > > > > > As there is a mechanism in PHY drivers to switch the PHY interface > > > between SGMII and 2500BaseX according to link speed. In this case, > > > the in-band AN mode should be switching based on the PHY interface > > > as well, if the PHY interface has been changed/updated by PHY driver. > > > > > > For e.g., disable in-band AN in 2500BaseX mode, or enable in-band AN > > > back for SGMII mode (10/100/1000Mbps). > > > > > > Signed-off-by: Tan, Tee Min <tee.min.tan@linux.intel.com> > > > Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com> > > > > ... > > > > > diff --git a/include/linux/phy.h b/include/linux/phy.h > > > index 11c1e91563d4..c685b526e307 100644 > > > --- a/include/linux/phy.h > > > +++ b/include/linux/phy.h > > > @@ -756,6 +756,8 @@ struct phy_device { > > > /* MACsec management functions */ > > > const struct macsec_ops *macsec_ops; > > > #endif > > > + /* For communicate the AN mode setting with phylink framework. */ > > > + u8 cur_link_an_mode; > > > }; > > > > Hi Choong Yong Liang, > > > > Please consider adding cur_link_an_mode to the kernel doc > > for struct phy_device - which is above the definition of struct phy_device. > > This looks like it's grabbing something from phylink and stuffing it > into phylib. However, I have no idea, because I don't seem to have > received the original patches. I'm guessing the reason is: > > 2023-06-22 05:21:24 1qCBoy-0003ji-G9 H=mga03.intel.com > [134.134.136.65]:57703 I=[78.32.30.218]:25 > X=TLS1.2:ECDHE_SECP521R1__RSA_SHA512__AES_256_GCM:256 > F=<yong.liang.choong@linux.intel.com> rejected after DATA: unqualified > address not permitted: failing address in "Cc:" header is: Tan > > Which I suspect came from: > > Tan, Tee Min <tee.min.tan@linux.intel.com> > > and someone doesn't realise that a "," in the display-name part of > an address *must* be quoted, otherwise "," is taken to be a separator > in the address list. > > Consequently, it has now become: > > Tan@web.codeaurora.org, Tee Min <tee.min.tan@linux.intel.com>, > > It should have been: > > "Tan, Tee Min" <tee.min.tan@linux.intel.com> > > with the double-quotes. > > Please do not review this series further, but instead, please can the > author repost it forthwith with correct conformant headers so that a > proper review can be undertaken by all? Hi Russell, Sorry for not noticing this myself. I agree that we should wait for a properly formed post as you suggest.
Hi Simon, I will update it in v2. Thank you. On 22/6/2023 10:43 pm, Simon Horman wrote: > On Thu, Jun 22, 2023 at 12:19:02PM +0800, Choong Yong Liang wrote: >> From: "Tan, Tee Min" <tee.min.tan@linux.intel.com> >> >> Add cur_link_an_mode into phy_device struct for PHY drivers to >> communicate the in-band AN mode setting with phylink framework. >> >> As there is a mechanism in PHY drivers to switch the PHY interface >> between SGMII and 2500BaseX according to link speed. In this case, >> the in-band AN mode should be switching based on the PHY interface >> as well, if the PHY interface has been changed/updated by PHY driver. >> >> For e.g., disable in-band AN in 2500BaseX mode, or enable in-band AN >> back for SGMII mode (10/100/1000Mbps). >> >> Signed-off-by: Tan, Tee Min <tee.min.tan@linux.intel.com> >> Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com> > > ... > >> diff --git a/include/linux/phy.h b/include/linux/phy.h >> index 11c1e91563d4..c685b526e307 100644 >> --- a/include/linux/phy.h >> +++ b/include/linux/phy.h >> @@ -756,6 +756,8 @@ struct phy_device { >> /* MACsec management functions */ >> const struct macsec_ops *macsec_ops; >> #endif >> + /* For communicate the AN mode setting with phylink framework. */ >> + u8 cur_link_an_mode; >> }; > > Hi Choong Yong Liang, > > Please consider adding cur_link_an_mode to the kernel doc > for struct phy_device - which is above the definition of struct phy_device.
Hi Russell, Thank you for pointing that out. I will fix it and send out version 2. On 22/6/2023 11:06 pm, Russell King (Oracle) wrote: > On Thu, Jun 22, 2023 at 04:43:51PM +0200, Simon Horman wrote: >> On Thu, Jun 22, 2023 at 12:19:02PM +0800, Choong Yong Liang wrote: >>> From: "Tan, Tee Min" <tee.min.tan@linux.intel.com> >>> >>> Add cur_link_an_mode into phy_device struct for PHY drivers to >>> communicate the in-band AN mode setting with phylink framework. >>> >>> As there is a mechanism in PHY drivers to switch the PHY interface >>> between SGMII and 2500BaseX according to link speed. In this case, >>> the in-band AN mode should be switching based on the PHY interface >>> as well, if the PHY interface has been changed/updated by PHY driver. >>> >>> For e.g., disable in-band AN in 2500BaseX mode, or enable in-band AN >>> back for SGMII mode (10/100/1000Mbps). >>> >>> Signed-off-by: Tan, Tee Min <tee.min.tan@linux.intel.com> >>> Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com> >> >> ... >> >>> diff --git a/include/linux/phy.h b/include/linux/phy.h >>> index 11c1e91563d4..c685b526e307 100644 >>> --- a/include/linux/phy.h >>> +++ b/include/linux/phy.h >>> @@ -756,6 +756,8 @@ struct phy_device { >>> /* MACsec management functions */ >>> const struct macsec_ops *macsec_ops; >>> #endif >>> + /* For communicate the AN mode setting with phylink framework. */ >>> + u8 cur_link_an_mode; >>> }; >> >> Hi Choong Yong Liang, >> >> Please consider adding cur_link_an_mode to the kernel doc >> for struct phy_device - which is above the definition of struct phy_device. > > This looks like it's grabbing something from phylink and stuffing it > into phylib. However, I have no idea, because I don't seem to have > received the original patches. I'm guessing the reason is: > > 2023-06-22 05:21:24 1qCBoy-0003ji-G9 H=mga03.intel.com > [134.134.136.65]:57703 I=[78.32.30.218]:25 > X=TLS1.2:ECDHE_SECP521R1__RSA_SHA512__AES_256_GCM:256 > F=<yong.liang.choong@linux.intel.com> rejected after DATA: unqualified > address not permitted: failing address in "Cc:" header is: Tan > > Which I suspect came from: > > Tan, Tee Min <tee.min.tan@linux.intel.com> > > and someone doesn't realise that a "," in the display-name part of > an address *must* be quoted, otherwise "," is taken to be a separator > in the address list. > > Consequently, it has now become: > > Tan@web.codeaurora.org, Tee Min <tee.min.tan@linux.intel.com>, > > It should have been: > > "Tan, Tee Min" <tee.min.tan@linux.intel.com> > > with the double-quotes. > > Please do not review this series further, but instead, please can the > author repost it forthwith with correct conformant headers so that a > proper review can be undertaken by all? > > Thanks. >
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 55d9d7acc32e..5cf26d02841d 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -30,6 +30,7 @@ #include <linux/phy.h> #include <linux/sfp.h> #include <linux/netdevice.h> +#include <linux/phylink.h> #define MV_PHY_ALASKA_NBT_QUIRK_MASK 0xfffffffe #define MV_PHY_ALASKA_NBT_QUIRK_REV (MARVELL_PHY_ID_88X3310 | 0xa) @@ -939,6 +940,9 @@ static void mv3310_update_interface(struct phy_device *phydev) * xaui / rxaui modes according to the speed. * Florian suggests setting phydev->interface to communicate this to the * MAC. Only do this if we are already in one of the above modes. + * In-band Auto-negotiation is not supported in 2500BASE-X. + * Setting phydev->cur_link_an_mode to communicate this to the + * phylink framework. */ switch (phydev->speed) { case SPEED_10000: @@ -949,11 +953,13 @@ static void mv3310_update_interface(struct phy_device *phydev) break; case SPEED_2500: phydev->interface = PHY_INTERFACE_MODE_2500BASEX; + phydev->cur_link_an_mode = MLO_AN_PHY; break; case SPEED_1000: case SPEED_100: case SPEED_10: phydev->interface = PHY_INTERFACE_MODE_SGMII; + phydev->cur_link_an_mode = MLO_AN_INBAND; break; default: break; diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 97c15e1f81de..d5783ea95eee 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1654,6 +1654,7 @@ static void phylink_phy_change(struct phy_device *phydev, bool up) pl->phy_state.pause |= MLO_PAUSE_RX; pl->phy_state.interface = phydev->interface; pl->phy_state.link = up; + pl->cur_link_an_mode = phydev->cur_link_an_mode; mutex_unlock(&pl->state_mutex); phylink_run_resolve(pl); @@ -1758,6 +1759,8 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, if (pl->config->mac_managed_pm) phy->mac_managed_pm = true; + pl->phydev->cur_link_an_mode = pl->cur_link_an_mode; + return 0; } diff --git a/include/linux/phy.h b/include/linux/phy.h index 11c1e91563d4..c685b526e307 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -756,6 +756,8 @@ struct phy_device { /* MACsec management functions */ const struct macsec_ops *macsec_ops; #endif + /* For communicate the AN mode setting with phylink framework. */ + u8 cur_link_an_mode; }; /* Generic phy_device::dev_flags */