[RFC PATCH net-next 11/11] net: dsa: microchip: lan937x: update multicast table

From: Rakesh Sankaranarayanan
Date: Thu Feb 02 2023 - 08:00:37 EST


Program multicast table for cascaded port in second switch with
default port forward value since it is the host port for second switch.
Current driver program the same for cpu port in first switch.

Signed-off-by: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@xxxxxxxxxxxxx>
---
drivers/net/dsa/microchip/ksz9477.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
index 4c12131098b1..521d8c2e1540 100644
--- a/drivers/net/dsa/microchip/ksz9477.c
+++ b/drivers/net/dsa/microchip/ksz9477.c
@@ -1116,18 +1116,22 @@ void ksz9477_config_cpu_port(struct dsa_switch *ds)

int ksz9477_enable_stp_addr(struct ksz_device *dev)
{
+ u32 fwd_port = BIT(dev->cpu_port);
const u32 *masks;
u32 data;
int ret;

masks = dev->info->masks;

+ if (dev->ds->index == 1)
+ fwd_port = BIT(dev->dsa_port);
+
/* Enable Reserved multicast table */
ksz_cfg(dev, REG_SW_LUE_CTRL_0, SW_RESV_MCAST_ENABLE, true);

/* Set the Override bit for forwarding BPDU packet to CPU */
ret = ksz_write32(dev, REG_SW_ALU_VAL_B,
- ALU_V_OVERRIDE | BIT(dev->cpu_port));
+ ALU_V_OVERRIDE | fwd_port);
if (ret < 0)
return ret;

--
2.34.1