Skip to content

Commit 8efdda4

Browse files
viviendavem330
authored andcommitted
net: dsa: mv88e6xxx: use port 802.1Q mode Secure
This commit changes the 802.1Q mode of each port from Disabled to Secure. This enables the VLAN support, by checking the VTU entries on ingress. Signed-off-by: Vivien Didelot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0d3b33e commit 8efdda4

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

drivers/net/dsa/mv88e6xxx.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,13 +2005,11 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
20052005
goto abort;
20062006
}
20072007

2008-
/* Port Control 2: don't force a good FCS, set the maximum
2009-
* frame size to 10240 bytes, don't let the switch add or
2010-
* strip 802.1q tags, don't discard tagged or untagged frames
2011-
* on this port, do a destination address lookup on all
2012-
* received packets as usual, disable ARP mirroring and don't
2013-
* send a copy of all transmitted/received frames on this port
2014-
* to the CPU.
2008+
/* Port Control 2: don't force a good FCS, set the maximum frame size to
2009+
* 10240 bytes, enable secure 802.1q tags, don't discard tagged or
2010+
* untagged frames on this port, do a destination address lookup on all
2011+
* received packets as usual, disable ARP mirroring and don't send a
2012+
* copy of all transmitted/received frames on this port to the CPU.
20152013
*/
20162014
reg = 0;
20172015
if (mv88e6xxx_6352_family(ds) || mv88e6xxx_6351_family(ds) ||
@@ -2033,6 +2031,8 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
20332031
reg |= PORT_CONTROL_2_FORWARD_UNKNOWN;
20342032
}
20352033

2034+
reg |= PORT_CONTROL_2_8021Q_SECURE;
2035+
20362036
if (reg) {
20372037
ret = _mv88e6xxx_reg_write(ds, REG_PORT(port),
20382038
PORT_CONTROL_2, reg);

drivers/net/dsa/mv88e6xxx.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@
140140
#define PORT_CONTROL_2_JUMBO_1522 (0x00 << 12)
141141
#define PORT_CONTROL_2_JUMBO_2048 (0x01 << 12)
142142
#define PORT_CONTROL_2_JUMBO_10240 (0x02 << 12)
143+
#define PORT_CONTROL_2_8021Q_MASK (0x03 << 10)
144+
#define PORT_CONTROL_2_8021Q_DISABLED (0x00 << 10)
145+
#define PORT_CONTROL_2_8021Q_FALLBACK (0x01 << 10)
146+
#define PORT_CONTROL_2_8021Q_CHECK (0x02 << 10)
147+
#define PORT_CONTROL_2_8021Q_SECURE (0x03 << 10)
143148
#define PORT_CONTROL_2_DISCARD_TAGGED BIT(9)
144149
#define PORT_CONTROL_2_DISCARD_UNTAGGED BIT(8)
145150
#define PORT_CONTROL_2_MAP_DA BIT(7)

0 commit comments

Comments
 (0)