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]
Date:   Sat, 2 Jul 2022 15:58:28 -0700
From:   <Tristram.Ha@...rochip.com>
To:     "David S. Miller" <davem@...emloft.net>
CC:     Tristram Ha <Tristram.Ha@...rochip.com>, <netdev@...r.kernel.org>,
        <UNGLinuxDriver@...rochip.com>
Subject: [PATCH net-next 2/2] net: phy: smsc: add EEE support to LAN8740/LAN8742 PHYs.

From: Tristram Ha <Tristram.Ha@...rochip.com>

EEE feature is enabled in LAN8740/LAN8742 during initialization.

Signed-off-by: Tristram Ha <Tristram.Ha@...rochip.com>
---
 drivers/net/phy/smsc.c  | 5 +++++
 include/linux/smscphy.h | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index 5b77f0c..7d485bc 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -272,6 +272,11 @@ static int lan874x_phy_config_init(struct phy_device *phydev)
 	if (rc < 0)
 		return rc;
 
+	/* enable EEE */
+	val = phy_read(phydev, MII_LAN874X_PHY_EEE_CFG);
+	val |= MII_LAN874X_PHY_PHYEEEEN;
+	phy_write(phydev, MII_LAN874X_PHY_EEE_CFG, val);
+
 	return smsc_phy_config_init(phydev);
 }
 
diff --git a/include/linux/smscphy.h b/include/linux/smscphy.h
index f5e123b..645b0f4 100644
--- a/include/linux/smscphy.h
+++ b/include/linux/smscphy.h
@@ -28,6 +28,9 @@
 #define MII_LAN83C185_MODE_POWERDOWN 0xC0 /* Power Down mode */
 #define MII_LAN83C185_MODE_ALL       0xE0 /* All capable mode */
 
+#define MII_LAN874X_PHY_EEE_CFG			16
+#define MII_LAN874X_PHY_PHYEEEEN		BIT(2)
+
 #define MII_LAN874X_PHY_MMD_WOL_WUCSR		0x8010
 #define MII_LAN874X_PHY_MMD_WOL_WUF_CFGA	0x8011
 #define MII_LAN874X_PHY_MMD_WOL_WUF_CFGB	0x8012
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ