mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-05-05 01:46:11 +02:00
realtek: dsa: remove num_lag_ids from family check
num_lag_ids is a device specific constant and must therefore live in the configuration structure. Avoid dynamic assignment. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/22749 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
parent
a3442aa95c
commit
e7738904d8
@ -1595,6 +1595,7 @@ static int rtl83xx_sw_probe(struct platform_device *pdev)
|
||||
priv->ds->needs_standalone_vlan_filtering = true;
|
||||
priv->ds->ops = priv->r->switch_ops;
|
||||
priv->ds->phylink_mac_ops = priv->r->phylink_mac_ops;
|
||||
priv->ds->num_lag_ids = priv->r->num_lag_ids;
|
||||
|
||||
priv->dev = dev;
|
||||
dev_set_drvdata(dev, priv);
|
||||
@ -1611,23 +1612,19 @@ static int rtl83xx_sw_probe(struct platform_device *pdev)
|
||||
priv->id = soc_info.id;
|
||||
switch (soc_info.family) {
|
||||
case RTL8380_FAMILY_ID:
|
||||
priv->ds->num_lag_ids = 8;
|
||||
priv->l2_bucket_size = 4;
|
||||
priv->n_mst = 64;
|
||||
break;
|
||||
case RTL8390_FAMILY_ID:
|
||||
priv->ds->num_lag_ids = 16;
|
||||
priv->l2_bucket_size = 4;
|
||||
priv->n_mst = 256;
|
||||
break;
|
||||
case RTL9300_FAMILY_ID:
|
||||
priv->ds->num_lag_ids = 16;
|
||||
sw_w32(0, RTL930X_ST_CTRL);
|
||||
priv->l2_bucket_size = 8;
|
||||
priv->n_mst = 64;
|
||||
break;
|
||||
case RTL9310_FAMILY_ID:
|
||||
priv->ds->num_lag_ids = 16;
|
||||
sw_w32(0, RTL931x_ST_CTRL);
|
||||
priv->l2_bucket_size = 8;
|
||||
priv->n_mst = 128;
|
||||
|
||||
@ -1809,6 +1809,7 @@ int rtldsa_83xx_lag_setup_algomask(struct rtl838x_switch_priv *priv, int group,
|
||||
const struct rtldsa_config rtldsa_838x_cfg = {
|
||||
.switch_ops = &rtldsa_83xx_switch_ops,
|
||||
.phylink_mac_ops = &rtldsa_83xx_phylink_mac_ops,
|
||||
.num_lag_ids = 8,
|
||||
.cpu_port = RTL838X_CPU_PORT,
|
||||
.fib_entries = 8192,
|
||||
.mask_port_reg_be = rtl838x_mask_port_reg,
|
||||
|
||||
@ -1414,6 +1414,7 @@ struct rtldsa_config {
|
||||
int imr_glb;
|
||||
int n_counters;
|
||||
int n_pie_blocks;
|
||||
u8 num_lag_ids;
|
||||
u8 cpu_port;
|
||||
u8 port_ignore;
|
||||
u32 fib_entries;
|
||||
|
||||
@ -1724,6 +1724,7 @@ int rtldsa_83xx_lag_setup_algomask(struct rtl838x_switch_priv *priv, int group,
|
||||
const struct rtldsa_config rtldsa_839x_cfg = {
|
||||
.switch_ops = &rtldsa_83xx_switch_ops,
|
||||
.phylink_mac_ops = &rtldsa_83xx_phylink_mac_ops,
|
||||
.num_lag_ids = 16,
|
||||
.cpu_port = RTL839X_CPU_PORT,
|
||||
.fib_entries = 16384,
|
||||
.mask_port_reg_be = rtl839x_mask_port_reg_be,
|
||||
|
||||
@ -2795,6 +2795,7 @@ static void rtldsa_930x_qos_init(struct rtl838x_switch_priv *priv)
|
||||
const struct rtldsa_config rtldsa_930x_cfg = {
|
||||
.switch_ops = &rtldsa_93xx_switch_ops,
|
||||
.phylink_mac_ops = &rtldsa_93xx_phylink_mac_ops,
|
||||
.num_lag_ids = 16,
|
||||
.cpu_port = RTL930X_CPU_PORT,
|
||||
.fib_entries = 16384,
|
||||
.mask_port_reg_be = rtl838x_mask_port_reg,
|
||||
|
||||
@ -1936,6 +1936,7 @@ static void rtldsa_931x_qos_init(struct rtl838x_switch_priv *priv)
|
||||
const struct rtldsa_config rtldsa_931x_cfg = {
|
||||
.switch_ops = &rtldsa_93xx_switch_ops,
|
||||
.phylink_mac_ops = &rtldsa_93xx_phylink_mac_ops,
|
||||
.num_lag_ids = 16,
|
||||
.cpu_port = RTL931X_CPU_PORT,
|
||||
.fib_entries = 16384, /* TODO: has 32K but code cannot handle that */
|
||||
.mask_port_reg_be = rtl839x_mask_port_reg_be,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user