From: Markus Stockhausen Date: Thu, 25 Jun 2026 08:46:17 +0000 (+0200) Subject: realtek: l3: add private structure X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c2ef13ec60979a8e15cf4016d4f9ace31cabdd7;p=thirdparty%2Fopenwrt.git realtek: l3: add private structure The DSA private structure provides an overwhelming mix of information. L3 data is part of this. Provide a new separated structure that is linked bidirectionally to the old data. For the start it only contains a reference pointer and no L3 specific data. Link: https://github.com/openwrt/openwrt/pull/23937 Signed-off-by: Markus Stockhausen --- diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index 6cacf2252e7..00d46236916 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -705,8 +705,15 @@ void otto_l3_remove(struct rtl838x_switch_priv *priv) int otto_l3_probe(struct device *dev, struct rtl838x_switch_priv *priv) { + struct otto_l3_ctrl *ctrl; int err; + ctrl = devm_kzalloc(dev, sizeof(struct otto_l3_ctrl), GFP_KERNEL); + if (!ctrl) + return -ENOMEM; + priv->l3_ctrl = ctrl; + ctrl->priv = priv; + /* Initialize hash table for L3 routing */ rhltable_init(&priv->routes, &otto_l3_route_ht_params); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h index 82fcbc8549e..ac9ea1664cd 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h @@ -5,6 +5,10 @@ #include "rtl-otto.h" +struct otto_l3_ctrl { + struct rtl838x_switch_priv *priv; +}; + struct otto_l3_route_attr { bool valid; bool hit; diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h index 8a1aca7cfa6..f81156bbd73 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h @@ -1483,6 +1483,7 @@ struct rtl838x_switch_priv { int link_state_irq; int mirror_group_ports[4]; const struct rtldsa_config *r; + struct otto_l3_ctrl *l3_ctrl; u64 irq_mask; struct dentry *dbgfs_dir;