diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-10-07 09:45:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-08 20:19:56 -0400 |
commit | cf85d08fdf4548ee46657ccfb7f9949a85145db5 (patch) | |
tree | 583e251b0d772c23ca931a207e9ac0995d679f44 /net/dsa/mv88e6123_61_65.c | |
parent | 91da11f870f00a3322b81c73042291d7f0be5a17 (diff) |
dsa: add support for original DSA tagging format
Most of the DSA switches currently in the field do not support the
Ethertype DSA tagging format that one of the previous patches added
support for, but only the original DSA tagging format.
The original DSA tagging format carries the same information as the
Ethertype DSA tagging format, but with the difference that it does not
have an ethertype field. In other words, when receiving a packet that
is tagged with an original DSA tag, there is no way of telling in
eth_type_trans() that this packet is in fact a DSA-tagged packet.
This patch adds a hook into eth_type_trans() which is only compiled in
if support for a switch chip that doesn't support Ethertype DSA is
selected, and which checks whether there is a DSA switch driver
instance attached to this network device which uses the old tag format.
If so, it sets the protocol field to ETH_P_DSA without looking at the
packet, so that the packet ends up in the right place.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Tested-by: Nicolas Pitre <nico@marvell.com>
Tested-by: Peter van Valderen <linux@ddcrew.com>
Tested-by: Dirk Teurlings <dirk@upexia.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/mv88e6123_61_65.c')
-rw-r--r-- | net/dsa/mv88e6123_61_65.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/net/dsa/mv88e6123_61_65.c b/net/dsa/mv88e6123_61_65.c index 147818cc706e..555b164082fc 100644 --- a/net/dsa/mv88e6123_61_65.c +++ b/net/dsa/mv88e6123_61_65.c | |||
@@ -192,15 +192,19 @@ static int mv88e6123_61_65_setup_port(struct dsa_switch *ds, int p) | |||
192 | 192 | ||
193 | /* | 193 | /* |
194 | * Port Control: disable Drop-on-Unlock, disable Drop-on-Lock, | 194 | * Port Control: disable Drop-on-Unlock, disable Drop-on-Lock, |
195 | * configure the EDSA tagging mode if this is the CPU port, | 195 | * configure the requested (DSA/EDSA) tagging mode if this is |
196 | * disable Header mode, enable IGMP/MLD snooping, disable VLAN | 196 | * the CPU port, disable Header mode, enable IGMP/MLD snooping, |
197 | * tunneling, determine priority by looking at 802.1p and IP | 197 | * disable VLAN tunneling, determine priority by looking at |
198 | * priority fields (IP prio has precedence), and set STP state | 198 | * 802.1p and IP priority fields (IP prio has precedence), and |
199 | * to Forwarding. Finally, if this is the CPU port, additionally | 199 | * set STP state to Forwarding. Finally, if this is the CPU |
200 | * enable forwarding of unknown unicast and multicast addresses. | 200 | * port, additionally enable forwarding of unknown unicast and |
201 | * multicast addresses. | ||
201 | */ | 202 | */ |
202 | REG_WRITE(addr, 0x04, | 203 | REG_WRITE(addr, 0x04, |
203 | (p == ds->cpu_port) ? 0x373f : 0x0433); | 204 | (p == ds->cpu_port) ? |
205 | (ds->tag_protocol == htons(ETH_P_DSA)) ? | ||
206 | 0x053f : 0x373f : | ||
207 | 0x0433); | ||
204 | 208 | ||
205 | /* | 209 | /* |
206 | * Port Control 1: disable trunking. Also, if this is the | 210 | * Port Control 1: disable trunking. Also, if this is the |