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: <20230327170201.2036708-21-andrew@lunn.ch>
Date:   Mon, 27 Mar 2023 19:01:58 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     netdev <netdev@...r.kernel.org>
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <rmk+kernel@...linux.org.uk>,
        Oleksij Rempel <o.rempel@...gutronix.de>,
        Andrew Lunn <andrew@...n.ch>
Subject: [RFC/RFT 20/23] net: phylink: Add MAC_EEE to mac_capabilites

If the MAC supports Energy Efficient Ethernet, it should indicate this
by setting the MAC_EEE bit in the config.mac_capabilities
bitmap. phylink will then enable EEE in the PHY, if it supports it.

Signed-off-by: Andrew Lunn <andrew@...n.ch>
---
 drivers/net/phy/phylink.c | 3 +++
 include/linux/phylink.h   | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 2e9ce6862042..192f9d13d3d1 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1637,6 +1637,9 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,
 	 */
 	phy_support_asym_pause(phy);
 
+	if (pl->config->mac_capabilities & MAC_EEE)
+		phy_support_eee(phy);
+
 	memset(&config, 0, sizeof(config));
 	linkmode_copy(supported, phy->supported);
 	linkmode_copy(config.advertising, phy->advertising);
diff --git a/include/linux/phylink.h b/include/linux/phylink.h
index 6eee6194b5ab..beac34b71343 100644
--- a/include/linux/phylink.h
+++ b/include/linux/phylink.h
@@ -72,6 +72,9 @@ enum {
 	MAC_100000FD	= BIT(16),
 	MAC_200000FD	= BIT(17),
 	MAC_400000FD	= BIT(18),
+	/* MAC_EEE indicates that the MAC is Energy Efficient capable
+	   and that the PHY should negotiate its use, if possible */
+	MAC_EEE		= BIT(31),
 };
 
 static inline bool phylink_autoneg_inband(unsigned int mode)
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ