summaryrefslogtreecommitdiffstats
path: root/target/linux/realtek
diff options
context:
space:
mode:
authorHarshal Gohel <hg@simonwunderlich.de>2023-12-13 08:29:36 +0100
committerSander Vanheule <sander@svanheule.net>2024-01-09 21:19:21 +0100
commitfe01435b6933756f4a916e4bccc409a88e3fcc56 (patch)
tree9f18934a897894aa36c5fb2aa86d482eb0c28444 /target/linux/realtek
parent2cfb1ecf103558a23c19ac55721dd4bfb0f7d4c1 (diff)
downloadopenwrt-fe01435b6933756f4a916e4bccc409a88e3fcc56.tar.gz
openwrt-fe01435b6933756f4a916e4bccc409a88e3fcc56.tar.bz2
openwrt-fe01435b6933756f4a916e4bccc409a88e3fcc56.zip
rtl83xx: dsa: Clear duplex bit correctly
Without this, luci shows 10M full duplex when there is no link. So explicitly set half duplex and unknown speed. Acked-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Diffstat (limited to 'target/linux/realtek')
-rw-r--r--target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
index 3b5af72dd6..0e1d64ae69 100644
--- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
@@ -870,6 +870,8 @@ static void rtl93xx_phylink_mac_config(struct dsa_switch *ds, int port,
if (state->duplex == DUPLEX_FULL)
reg |= RTL930X_DUPLEX_MODE;
+ else
+ reg &= ~RTL930X_DUPLEX_MODE; /* Clear duplex bit otherwise */
if (priv->ports[port].phy_is_integrated)
reg &= ~RTL930X_FORCE_EN; /* Clear MAC_FORCE_EN to allow SDS-MAC link */