Device specific constants belong into the config structure.
No need to initialize them manually during probing within a
family_id switch statement. Although there are lots of constants
that need to be converted start with port_ignore as a simple one.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22026
Signed-off-by: Robert Marko <robimarko@gmail.com>
e.block_sa = false;
e.suspended = false;
e.age = 0; /* With port-ignore */
- e.port = priv->port_ignore;
+ e.port = priv->r->port_ignore;
u64_to_ether_addr(nh->mac, &e.mac[0]);
}
e.next_hop = true;
pr_debug("Route with id %d to %pI4 / %d\n", r->id, &r->dst_ip, r->prefix_len);
r->nh.mac = r->nh.gw = mac;
- r->nh.port = priv->port_ignore;
+ r->nh.port = priv->r->port_ignore;
r->nh.id = r->id;
/* Do we need to explicitly add a DMAC entry with the route's nh index? */
int slot;
route->nh.mac = mac;
- route->nh.port = priv->port_ignore;
+ route->nh.port = priv->r->port_ignore;
route->attr.valid = true;
route->attr.action = ROUTE_ACT_TRAP2CPU;
route->attr.type = 0;
priv->l2_bucket_size = 4;
priv->n_mst = 64;
priv->n_pie_blocks = 12;
- priv->port_ignore = 0x1f;
priv->n_counters = 128;
break;
case RTL8390_FAMILY_ID:
priv->l2_bucket_size = 4;
priv->n_mst = 256;
priv->n_pie_blocks = 18;
- priv->port_ignore = 0x3f;
priv->n_counters = 1024;
break;
case RTL9300_FAMILY_ID:
priv->l2_bucket_size = 8;
priv->n_mst = 64;
priv->n_pie_blocks = 16;
- priv->port_ignore = 0x3f;
priv->n_counters = 2048;
break;
case RTL9310_FAMILY_ID:
priv->l2_bucket_size = 8;
priv->n_mst = 128;
priv->n_pie_blocks = 16;
- priv->port_ignore = 0x3f;
priv->n_counters = 2048;
break;
}
.isr_port_link_sts_chg = RTL838X_ISR_PORT_LINK_STS_CHG,
.imr_port_link_sts_chg = RTL838X_IMR_PORT_LINK_STS_CHG,
.imr_glb = RTL838X_IMR_GLB,
+ .port_ignore = 0x1f,
.vlan_tables_read = rtl838x_vlan_tables_read,
.vlan_set_tagged = rtl838x_vlan_set_tagged,
.vlan_set_untagged = rtl838x_vlan_set_untagged,
int isr_port_link_sts_chg;
int imr_port_link_sts_chg;
int imr_glb;
+ u8 port_ignore;
void (*vlan_tables_read)(u32 vlan, struct rtl838x_vlan_info *info);
void (*vlan_set_tagged)(u32 vlan, struct rtl838x_vlan_info *info);
void (*vlan_set_untagged)(u32 vlan, u64 portmask);
u8 cpu_port;
u8 port_mask;
u8 port_width;
- u8 port_ignore;
u64 irq_mask;
u32 fib_entries;
int l2_bucket_size;
.isr_port_link_sts_chg = RTL839X_ISR_PORT_LINK_STS_CHG,
.imr_port_link_sts_chg = RTL839X_IMR_PORT_LINK_STS_CHG,
.imr_glb = RTL839X_IMR_GLB,
+ .port_ignore = 0x3f,
.vlan_tables_read = rtl839x_vlan_tables_read,
.vlan_set_tagged = rtl839x_vlan_set_tagged,
.vlan_set_untagged = rtl839x_vlan_set_untagged,
.isr_port_link_sts_chg = RTL930X_ISR_PORT_LINK_STS_CHG,
.imr_port_link_sts_chg = RTL930X_IMR_PORT_LINK_STS_CHG,
.imr_glb = RTL930X_IMR_GLB,
+ .port_ignore = 0x3f,
.vlan_tables_read = rtl930x_vlan_tables_read,
.vlan_set_tagged = rtl930x_vlan_set_tagged,
.vlan_set_untagged = rtl930x_vlan_set_untagged,
.isr_port_link_sts_chg = RTL931X_ISR_PORT_LINK_STS_CHG,
.imr_port_link_sts_chg = RTL931X_IMR_PORT_LINK_STS_CHG,
/* imr_glb does not exist on RTL931X */
+ .port_ignore = 0x3f,
.vlan_tables_read = rtl931x_vlan_tables_read,
.vlan_set_tagged = rtl931x_vlan_set_tagged,
.vlan_set_untagged = rtl931x_vlan_set_untagged,