]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: l3: add setup callback
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sun, 28 Jun 2026 09:26:10 +0000 (11:26 +0200)
committerMarkus Stockhausen <markus.stockhausen@gmx.de>
Mon, 29 Jun 2026 16:17:08 +0000 (18:17 +0200)
The existin setup calls must be migrated from the DSA code into
the layer 3 code. Provide a new callback for that. Keep it empty
for now.

Link: https://github.com/openwrt/openwrt/pull/23979
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

index 749f0d6edfaefaf9b06b4d6dba559f1da851b22f..dfa30fe42b4b83158cc44c835fc95fb5c69ebe05 100644 (file)
@@ -1375,6 +1375,12 @@ int otto_l3_probe(struct device *dev, struct rtl838x_switch_priv *priv)
                return dev_err_probe(dev, -EINVAL, "No compatible configuration found\n");
        ctrl->cfg = match->data;
 
+       if (ctrl->cfg->setup) {
+               err = ctrl->cfg->setup(ctrl);
+               if (err)
+                       return dev_err_probe(dev, err, "device specific L3 setup failed\n");
+       }
+
        /* Initialize hash table for L3 routing */
        rhltable_init(&ctrl->routes, &otto_l3_route_ht_params);
 
index 0b02bdace949e2c7352d9feef2957d982e2194a4..b322cdea0aa65fb7ecba6d86422ccbb1939033c6 100644 (file)
@@ -95,6 +95,7 @@ struct otto_l3_config {
        int (*route_lookup_hw)(struct otto_l3_ctrl *ctrl, struct otto_l3_route *rt);
        void (*route_read)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt);
        void (*route_write)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt);
+       int (*setup)(struct otto_l3_ctrl *ctrl);
 };
 
 struct otto_l3_ctrl {