summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorKevin Jilissen <info@kevinjilissen.nl>2024-05-04 16:12:20 +0200
committerSander Vanheule <sander@svanheule.net>2024-05-10 16:03:51 +0200
commit5a5c52085a5bd0b1b8bc629f3586c7a93dcb4460 (patch)
treef6a45c9beb7cd617cab459f0a42b934a4718755d /target
parent81ab9ef2d166f9914a33d54d4dfd00429511ccb2 (diff)
downloadopenwrt-5a5c52085a5bd0b1b8bc629f3586c7a93dcb4460.tar.gz
openwrt-5a5c52085a5bd0b1b8bc629f3586c7a93dcb4460.tar.bz2
openwrt-5a5c52085a5bd0b1b8bc629f3586c7a93dcb4460.zip
realtek: Trap LLDP packets to the CPU
We should setup the registers for trapping LLDP packets to the CPU. Currently, these packets are forwarded to all ports which is not desired behaviour. Signed-off-by: Kevin Jilissen <info@kevinjilissen.nl>
Diffstat (limited to 'target')
-rw-r--r--target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c7
1 files changed, 7 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 ff81a4c77b..9eb444515f 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
@@ -155,6 +155,12 @@ static void rtl83xx_setup_bpdu_traps(struct rtl838x_switch_priv *priv)
priv->r->set_receive_management_action(i, BPDU, TRAP2CPU);
}
+static void rtl83xx_setup_lldp_traps(struct rtl838x_switch_priv *priv)
+{
+ for (int i = 0; i < priv->cpu_port; i++)
+ priv->r->set_receive_management_action(i, LLDP, TRAP2CPU);
+}
+
static void rtl83xx_port_set_salrn(struct rtl838x_switch_priv *priv,
int port, bool enable)
{
@@ -207,6 +213,7 @@ static int rtl83xx_setup(struct dsa_switch *ds)
rtl83xx_vlan_setup(priv);
rtl83xx_setup_bpdu_traps(priv);
+ rtl83xx_setup_lldp_traps(priv);
ds->configure_vlan_while_not_filtering = true;