aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/phy/bcm-phy-lib.h
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2023-05-08 16:17:49 -0700
committerJakub Kicinski <kuba@kernel.org>2023-05-09 20:25:52 -0700
commit582dbb2cc1a0a7427840f5b1e3c65608e511b061 (patch)
treeb12b7fa0ef79a0e3d6c32364aa00493df61241c9 /drivers/net/phy/bcm-phy-lib.h
parentnet: Fix load-tearing on sk->sk_stamp in sock_recv_cmsgs(). (diff)
downloadwireguard-linux-582dbb2cc1a0a7427840f5b1e3c65608e511b061.tar.xz
wireguard-linux-582dbb2cc1a0a7427840f5b1e3c65608e511b061.zip
net: phy: bcm7xx: Correct read from expansion register
Since the driver works in the "legacy" addressing mode, we need to write to the expansion register (0x17) with bits 11:8 set to 0xf to properly select the expansion register passed as argument. Fixes: f68d08c437f9 ("net: phy: bcm7xxx: Add EPHY entry for 72165") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Link: https://lore.kernel.org/r/20230508231749.1681169-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy/bcm-phy-lib.h')
-rw-r--r--drivers/net/phy/bcm-phy-lib.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/phy/bcm-phy-lib.h b/drivers/net/phy/bcm-phy-lib.h
index 9902fb182099..729db441797a 100644
--- a/drivers/net/phy/bcm-phy-lib.h
+++ b/drivers/net/phy/bcm-phy-lib.h
@@ -40,6 +40,11 @@ static inline int bcm_phy_write_exp_sel(struct phy_device *phydev,
return bcm_phy_write_exp(phydev, reg | MII_BCM54XX_EXP_SEL_ER, val);
}
+static inline int bcm_phy_read_exp_sel(struct phy_device *phydev, u16 reg)
+{
+ return bcm_phy_read_exp(phydev, reg | MII_BCM54XX_EXP_SEL_ER);
+}
+
int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val);
int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum);