Skip to content

Commit cb178cc

Browse files
committed
Merge branch 'mt7530-fixes'
Merge branch 'mr7530-fixes' Arınç ÜNAL says: ==================== Fix port mirroring on MT7530 DSA subdriver This patch series fixes the frames received on the local port (monitor port) not being mirrored, and port mirroring for the MT7988 SoC switch. ==================== Signed-off-by: Arınç ÜNAL <[email protected]>
2 parents f8bbc07 + 2c606d1 commit cb178cc

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

drivers/net/dsa/mt7530.c

Lines changed: 12 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,
@@ -2480,6 +2482,9 @@ mt7530_setup(struct dsa_switch *ds)
24802482
PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
24812483
}
24822484

2485+
/* Allow mirroring frames received on the local port (monitor port). */
2486+
mt7530_set(priv, MT753X_AGC, LOCAL_EN);
2487+
24832488
/* Setup VLAN ID 0 for VLAN-unaware bridges */
24842489
ret = mt7530_setup_vlan0(priv);
24852490
if (ret)
@@ -2591,6 +2596,9 @@ mt7531_setup_common(struct dsa_switch *ds)
25912596
PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
25922597
}
25932598

2599+
/* Allow mirroring frames received on the local port (monitor port). */
2600+
mt7530_set(priv, MT753X_AGC, LOCAL_EN);
2601+
25942602
/* Flush the FDB table */
25952603
ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
25962604
if (ret < 0)

drivers/net/dsa/mt7530.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ enum mt753x_id {
3232
#define SYSC_REG_RSTCTRL 0x34
3333
#define RESET_MCM BIT(2)
3434

35+
/* Register for ARL global control */
36+
#define MT753X_AGC 0xc
37+
#define LOCAL_EN BIT(7)
38+
3539
/* Registers to mac forward control for unknown frames */
3640
#define MT7530_MFC 0x10
3741
#define BC_FFP(x) (((x) & 0xff) << 24)

0 commit comments

Comments
 (0)