From: Markus Stockhausen Date: Tue, 17 Feb 2026 18:19:22 +0000 (+0100) Subject: realtek: dsa: derive dsa port count and irq mask from cpu port X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F22068%2Fhead;p=thirdparty%2Fopenwrt.git realtek: dsa: derive dsa port count and irq mask from cpu port Avoid a family_id check and derive the values from the cpu port. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/22068 Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c index 0a23329778b..23a37f2bcd7 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c @@ -1411,8 +1411,6 @@ static int rtl83xx_sw_probe(struct platform_device *pdev) priv->cpu_port = RTL838X_CPU_PORT; priv->port_mask = 0x1f; priv->port_width = 1; - priv->irq_mask = 0x0FFFFFFF; - priv->ds->num_ports = RTL838X_CPU_PORT + 1; priv->fib_entries = 8192; priv->ds->num_lag_ids = 8; priv->l2_bucket_size = 4; @@ -1423,8 +1421,6 @@ static int rtl83xx_sw_probe(struct platform_device *pdev) priv->cpu_port = RTL839X_CPU_PORT; priv->port_mask = 0x3f; priv->port_width = 2; - priv->irq_mask = 0xFFFFFFFFFFFFFULL; - priv->ds->num_ports = RTL839X_CPU_PORT + 1; priv->fib_entries = 16384; priv->ds->num_lag_ids = 16; priv->l2_bucket_size = 4; @@ -1435,8 +1431,6 @@ static int rtl83xx_sw_probe(struct platform_device *pdev) priv->cpu_port = RTL930X_CPU_PORT; priv->port_mask = 0x1f; priv->port_width = 1; - priv->irq_mask = 0x0FFFFFFF; - priv->ds->num_ports = RTL930X_CPU_PORT + 1; priv->fib_entries = 16384; priv->ds->num_lag_ids = 16; sw_w32(0, RTL930X_ST_CTRL); @@ -1448,8 +1442,6 @@ static int rtl83xx_sw_probe(struct platform_device *pdev) priv->cpu_port = RTL931X_CPU_PORT; priv->port_mask = 0x3f; priv->port_width = 2; - priv->irq_mask = GENMASK_ULL(priv->cpu_port - 1, 0); - priv->ds->num_ports = RTL931X_CPU_PORT + 1; priv->fib_entries = 16384; priv->ds->num_lag_ids = 16; sw_w32(0, RTL931x_ST_CTRL); @@ -1457,6 +1449,8 @@ static int rtl83xx_sw_probe(struct platform_device *pdev) priv->n_mst = 128; break; } + priv->ds->num_ports = priv->cpu_port + 1; + priv->irq_mask = GENMASK_ULL(priv->cpu_port - 1, 0); err = rtl83xx_mdio_probe(priv); if (err) {