net: dsa: mt7530: fix link-local frames that ingress vlan filtering ports
[sfrench/cifs-2.6.git] / drivers / net / dsa / mt7530.c
index 6986f538a4d01d75da09f6ba4535ccd6c95ea5c3..2233f28b9fd195e0e313c80c4846f1eadfd00d6f 100644 (file)
@@ -953,16 +953,23 @@ static void mt7530_setup_port5(struct dsa_switch *ds, phy_interface_t interface)
 static void
 mt753x_trap_frames(struct mt7530_priv *priv)
 {
-       /* Trap BPDUs to the CPU port(s) */
-       mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK,
+       /* Trap 802.1X PAE frames and BPDUs to the CPU port(s) and egress them
+        * VLAN-untagged.
+        */
+       mt7530_rmw(priv, MT753X_BPC, MT753X_PAE_EG_TAG_MASK |
+                  MT753X_PAE_PORT_FW_MASK | MT753X_BPDU_EG_TAG_MASK |
+                  MT753X_BPDU_PORT_FW_MASK,
+                  MT753X_PAE_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
+                  MT753X_PAE_PORT_FW(MT753X_BPDU_CPU_ONLY) |
+                  MT753X_BPDU_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
                   MT753X_BPDU_CPU_ONLY);
 
-       /* Trap 802.1X PAE frames to the CPU port(s) */
-       mt7530_rmw(priv, MT753X_BPC, MT753X_PAE_PORT_FW_MASK,
-                  MT753X_PAE_PORT_FW(MT753X_BPDU_CPU_ONLY));
-
-       /* Trap LLDP frames with :0E MAC DA to the CPU port(s) */
-       mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_PORT_FW_MASK,
+       /* Trap LLDP frames with :0E MAC DA to the CPU port(s) and egress them
+        * VLAN-untagged.
+        */
+       mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_EG_TAG_MASK |
+                  MT753X_R0E_PORT_FW_MASK,
+                  MT753X_R0E_EG_TAG(MT7530_VLAN_EG_UNTAGGED) |
                   MT753X_R0E_PORT_FW(MT753X_BPDU_CPU_ONLY));
 }