提交 e47488b2 编写于 作者: P Peter Mamonov 提交者: Jakub Kicinski

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: 4621bf12 ("phy: Add file missed in previous commit.")
Signed-off-by: NPeter Mamonov <pmamonov@gmail.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
上级 8d3d7c20
...@@ -105,14 +105,17 @@ static void ns_giga_speed_fallback(struct phy_device *phydev, int mode) ...@@ -105,14 +105,17 @@ static void ns_giga_speed_fallback(struct phy_device *phydev, int mode)
static void ns_10_base_t_hdx_loopack(struct phy_device *phydev, int disable) static void ns_10_base_t_hdx_loopack(struct phy_device *phydev, int disable)
{ {
u16 lb_dis = BIT(1);
if (disable) if (disable)
ns_exp_write(phydev, 0x1c0, ns_exp_read(phydev, 0x1c0) | 1); ns_exp_write(phydev, 0x1c0,
ns_exp_read(phydev, 0x1c0) | lb_dis);
else else
ns_exp_write(phydev, 0x1c0, ns_exp_write(phydev, 0x1c0,
ns_exp_read(phydev, 0x1c0) & 0xfffe); ns_exp_read(phydev, 0x1c0) & ~lb_dis);
pr_debug("10BASE-T HDX loopback %s\n", pr_debug("10BASE-T HDX loopback %s\n",
(ns_exp_read(phydev, 0x1c0) & 0x0001) ? "off" : "on"); (ns_exp_read(phydev, 0x1c0) & lb_dis) ? "off" : "on");
} }
static int ns_config_init(struct phy_device *phydev) static int ns_config_init(struct phy_device *phydev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册