lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210324165023.32352-6-kabel@kernel.org>
Date:   Wed, 24 Mar 2021 17:50:21 +0100
From:   Marek Behún <kabel@...nel.org>
To:     netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
        "David S . Miller" <davem@...emloft.net>,
        Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <rmk+kernel@...linux.org.uk>, kuba@...nel.org
Cc:     Marek Behún <kabel@...nel.org>
Subject: [PATCH net-next 5/7] net: phy: marvell10g: save MACTYPE instead of rate_matching boolean

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

Signed-off-by: Marek Behún <kabel@...nel.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ