All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	kuba@kernel.org
Cc: "Marek Behún" <kabel@kernel.org>
Subject: [PATCH net-next 5/7] net: phy: marvell10g: save MACTYPE instead of rate_matching boolean
Date: Wed, 24 Mar 2021 17:50:21 +0100	[thread overview]
Message-ID: <20210324165023.32352-6-kabel@kernel.org> (raw)
In-Reply-To: <20210324165023.32352-1-kabel@kernel.org>

Save MACTYPE instead of rate_matching boolean. We will need this for
other configurations.

Signed-off-by: Marek Behún <kabel@kernel.org>
---
 drivers/net/phy/marvell10g.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 46e853f2d41b..b4f9831b4db6 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -100,7 +100,7 @@ enum {
 
 struct mv3310_priv {
 	u32 firmware_ver;
-	bool rate_match;
+	u8 mactype;
 
 	struct device *hwmon_dev;
 	char *hwmon_name;
@@ -486,8 +486,7 @@ static int mv3310_config_init(struct phy_device *phydev)
 	val = phy_read_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL);
 	if (val < 0)
 		return val;
-	priv->rate_match = ((val & MV_V2_PORT_CTRL_MACTYPE_MASK) ==
-			MV_V2_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH);
+	priv->mactype = val & MV_V2_PORT_CTRL_MACTYPE_MASK;
 
 	/* Enable EDPD mode - saving 600mW */
 	return mv3310_set_edpd(phydev, ETHTOOL_PHY_EDPD_DFLT_TX_MSECS);
@@ -601,7 +600,7 @@ static void mv3310_update_interface(struct phy_device *phydev)
 	 * 10Gb. The PHY adapts the rate to actual wire speed with help of
 	 * internal 16KB buffer.
 	 */
-	if (priv->rate_match) {
+	if (priv->mactype == MV_V2_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH) {
 		phydev->interface = PHY_INTERFACE_MODE_10GBASER;
 		return;
 	}
-- 
2.26.2


  parent reply	other threads:[~2021-03-24 16:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 16:50 [PATCH net-next 0/7] net: phy: marvell10g updates Marek Behún
2021-03-24 16:50 ` [PATCH net-next 1/7] net: phy: marvell10g: rename register Marek Behún
2021-03-24 16:50 ` [PATCH net-next 2/7] net: phy: marvell10g: fix typo Marek Behún
2021-03-24 16:50 ` [PATCH net-next 3/7] net: phy: marvell10g: allow 5gabse-r and usxgmii Marek Behún
2021-03-24 16:50 ` [PATCH net-next 4/7] net: phy: marvell10g: add MACTYPE definitions for 88X3310/88X3310P Marek Behún
2021-03-24 16:58   ` Russell King - ARM Linux admin
2021-03-24 18:09     ` Marek Behún
2021-03-24 18:11       ` Russell King - ARM Linux admin
2021-03-24 16:50 ` Marek Behún [this message]
2021-03-24 16:59   ` [PATCH net-next 5/7] net: phy: marvell10g: save MACTYPE instead of rate_matching boolean Russell King - ARM Linux admin
2021-03-24 18:12     ` Marek Behún
2021-03-24 16:50 ` [PATCH net-next 6/7] net: phy: marvell10g: support more rate matching modes Marek Behún
2021-03-24 16:50 ` [PATCH net-next 7/7] net: phy: marvell10g: support other MACTYPEs Marek Behún

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210324165023.32352-6-kabel@kernel.org \
    --to=kabel@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.