Skip to content

Commit e47488b

Browse files
pmamonovJakub Kicinski
authored andcommitted
net/phy: fix DP83865 10 Mbps HDX loopback disable function
According to the DP83865 datasheet "the 10 Mbps HDX loopback can be disabled in the expanded memory register 0x1C0.1". The driver erroneously used bit 0 instead of bit 1. Fixes: 4621bf1 ("phy: Add file missed in previous commit.") Signed-off-by: Peter Mamonov <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8d3d7c2 commit e47488b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/net/phy/national.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,17 @@ static void ns_giga_speed_fallback(struct phy_device *phydev, int mode)
105105

106106
static void ns_10_base_t_hdx_loopack(struct phy_device *phydev, int disable)
107107
{
108+
u16 lb_dis = BIT(1);
109+
108110
if (disable)
109-
ns_exp_write(phydev, 0x1c0, ns_exp_read(phydev, 0x1c0) | 1);
111+
ns_exp_write(phydev, 0x1c0,
112+
ns_exp_read(phydev, 0x1c0) | lb_dis);
110113
else
111114
ns_exp_write(phydev, 0x1c0,
112-
ns_exp_read(phydev, 0x1c0) & 0xfffe);
115+
ns_exp_read(phydev, 0x1c0) & ~lb_dis);
113116

114117
pr_debug("10BASE-T HDX loopback %s\n",
115-
(ns_exp_read(phydev, 0x1c0) & 0x0001) ? "off" : "on");
118+
(ns_exp_read(phydev, 0x1c0) & lb_dis) ? "off" : "on");
116119
}
117120

118121
static int ns_config_init(struct phy_device *phydev)

0 commit comments

Comments
 (0)