Skip to content

Commit 2c606d1

Browse files
arinc9davem330
authored andcommitted
net: dsa: mt7530: fix port mirroring for MT7988 SoC switch
The "MT7988A Wi-Fi 7 Generation Router Platform: Datasheet (Open Version) v0.1" document shows bits 16 to 18 as the MIRROR_PORT field of the CPU forward control register. Currently, the MT7530 DSA subdriver configures bits 0 to 2 of the CPU forward control register which breaks the port mirroring feature for the MT7988 SoC switch. Fix this by using the MT7531_MIRROR_PORT_GET() and MT7531_MIRROR_PORT_SET() macros which utilise the correct bits. Fixes: 110c18b ("net: dsa: mt7530: introduce driver for MT7988 built-in switch") Signed-off-by: Arınç ÜNAL <[email protected]> Acked-by: Daniel Golle <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d59cf04 commit 2c606d1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/net/dsa/mt7530.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,14 +1883,16 @@ mt7530_port_vlan_del(struct dsa_switch *ds, int port,
18831883

18841884
static int mt753x_mirror_port_get(unsigned int id, u32 val)
18851885
{
1886-
return (id == ID_MT7531) ? MT7531_MIRROR_PORT_GET(val) :
1887-
MIRROR_PORT(val);
1886+
return (id == ID_MT7531 || id == ID_MT7988) ?
1887+
MT7531_MIRROR_PORT_GET(val) :
1888+
MIRROR_PORT(val);
18881889
}
18891890

18901891
static int mt753x_mirror_port_set(unsigned int id, u32 val)
18911892
{
1892-
return (id == ID_MT7531) ? MT7531_MIRROR_PORT_SET(val) :
1893-
MIRROR_PORT(val);
1893+
return (id == ID_MT7531 || id == ID_MT7988) ?
1894+
MT7531_MIRROR_PORT_SET(val) :
1895+
MIRROR_PORT(val);
18941896
}
18951897

18961898
static int mt753x_port_mirror_add(struct dsa_switch *ds, int port,

0 commit comments

Comments
 (0)