Skip to content

Commit a9e3f62

Browse files
LGA1150davem330
authored andcommitted
net: dsa: mt7530: set STP state on filter ID 1
As filter ID 1 is the only one used for bridges, set STP state on it. Signed-off-by: DENG Qingfang <dqfext@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6087175 commit a9e3f62

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drivers/net/dsa/mt7530.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,8 @@ mt7530_stp_state_set(struct dsa_switch *ds, int port, u8 state)
11471147
break;
11481148
}
11491149

1150-
mt7530_rmw(priv, MT7530_SSP_P(port), FID_PST_MASK, stp_state);
1150+
mt7530_rmw(priv, MT7530_SSP_P(port), FID_PST_MASK(FID_BRIDGED),
1151+
FID_PST(FID_BRIDGED, stp_state));
11511152
}
11521153

11531154
static int

drivers/net/dsa/mt7530.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ enum mt7530_vlan_egress_attr {
186186

187187
/* Register for port STP state control */
188188
#define MT7530_SSP_P(x) (0x2000 + ((x) * 0x100))
189-
#define FID_PST(x) ((x) & 0x3)
190-
#define FID_PST_MASK FID_PST(0x3)
189+
#define FID_PST(fid, state) (((state) & 0x3) << ((fid) * 2))
190+
#define FID_PST_MASK(fid) FID_PST(fid, 0x3)
191191

192192
enum mt7530_stp_state {
193193
MT7530_STP_DISABLED = 0,

0 commit comments

Comments
 (0)