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>
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);
#include "rtl-otto.h"
+struct otto_l3_ctrl {
+ struct rtl838x_switch_priv *priv;
+};
+
struct otto_l3_route_attr {
bool valid;
bool hit;
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;