From: Markus Stockhausen Date: Sun, 28 Jun 2026 09:26:10 +0000 (+0200) Subject: realtek: l3: add setup callback X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=658cdf86ada628b2f6fd2ad19b54d63322e4ce5c;p=thirdparty%2Fopenwrt.git realtek: l3: add setup callback 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 --- 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 749f0d6edfa..dfa30fe42b4 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 @@ -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); 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 0b02bdace94..b322cdea0aa 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 @@ -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 {