]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: l3: add private structure
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Thu, 25 Jun 2026 08:46:17 +0000 (10:46 +0200)
committerMarkus Stockhausen <markus.stockhausen@gmx.de>
Fri, 26 Jun 2026 16:06:56 +0000 (18:06 +0200)
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 <markus.stockhausen@gmx.de>
target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c
target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h
target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h

index 6cacf2252e762c45c7014eadd5965f0c855b4825..00d462369169df94e901c13421f35d4e2fbba1d2 100644 (file)
@@ -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);
 
index 82fcbc8549e1b743e075bdcb5de57390bf931370..ac9ea1664cdf1b77a33e4010fc4ae2470a05e092 100644 (file)
@@ -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;
index 8a1aca7cfa6d097fddaed84dab58898c2f30b082..f81156bbd73391a4a1fb3b9f1695b371fa60e78a 100644 (file)
@@ -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;