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: <20231011221242.4180589-4-florian.fainelli@broadcom.com>
Date: Wed, 11 Oct 2023 15:12:41 -0700
From: Florian Fainelli <florian.fainelli@...adcom.com>
To: netdev@...r.kernel.org
Cc: Florian Fainelli <florian.fainelli@...adcom.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Jonathan Corbet <corbet@....net>,
	Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
	Andrew Lunn <andrew@...n.ch>,
	Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	opendmb@...il.com,
	justin.chen@...adcom.com,
	Michal Kubecek <mkubecek@...e.cz>
Subject: [PATCH net-next 2/2] net: phy: broadcom: Add support for WAKE_MDA

Add support for waking-up from a custom MAC destination address which
involves programming the BCM54XX_WOL_MPD_DATA2() and
BCM54XX_WOL_MASK() register groups.

Signed-off-by: Florian Fainelli <florian.fainelli@...adcom.com>
---
 drivers/net/phy/bcm-phy-lib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/bcm-phy-lib.c b/drivers/net/phy/bcm-phy-lib.c
index 876f28fd8256..00c0424f7b63 100644
--- a/drivers/net/phy/bcm-phy-lib.c
+++ b/drivers/net/phy/bcm-phy-lib.c
@@ -827,7 +827,8 @@ EXPORT_SYMBOL_GPL(bcm_phy_cable_test_get_status_rdb);
 					 WAKE_MCAST | \
 					 WAKE_BCAST | \
 					 WAKE_MAGIC | \
-					 WAKE_MAGICSECURE)
+					 WAKE_MAGICSECURE | \
+					 WAKE_MDA)
 
 int bcm_phy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol)
 {
@@ -908,6 +909,8 @@ int bcm_phy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol)
 			eth_broadcast_addr(da);
 		} else if (wol->wolopts & WAKE_MAGICSECURE) {
 			ether_addr_copy(da, wol->sopass);
+		} else if (wol->wolopts & WAKE_MDA) {
+			ether_addr_copy(da, wol->mac_da);
 		} else if (wol->wolopts & WAKE_MAGIC) {
 			memset(da, 0, sizeof(da));
 			memset(mask, 0xff, sizeof(mask));
@@ -1010,6 +1013,8 @@ void bcm_phy_get_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol)
 	}
 
 	if (ctl & BCM54XX_WOL_DIR_PKT_EN) {
+		memcpy(wol->mac_da, da, sizeof(da));
+		wol->wolopts |= WAKE_MDA;
 		if (is_broadcast_ether_addr(da))
 			wol->wolopts |= WAKE_BCAST;
 		else if (is_multicast_ether_addr(da))
-- 
2.34.1


Download attachment "smime.p7s" of type "application/pkcs7-signature" (4221 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ