net: dsa: qca8k: Add 802.1q VLAN support
authorJonathan McDowell <noodles@earth.li>
Sat, 1 Aug 2020 17:06:46 +0000 (18:06 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Aug 2020 22:45:39 +0000 (15:45 -0700)
commit69462fe6a39048ec186f60178a3a6ea23ae16e0c
treed26e018c9b038c9297d32e230ec7d1242bfe6e16
parente9d204fde5fd7d8ca1d6490d1b5c3d8d963bcd1a
net: dsa: qca8k: Add 802.1q VLAN support

This adds full 802.1q VLAN support to the qca8k, allowing the use of
vlan_filtering and more complicated bridging setups than allowed by
basic port VLAN support.

Tested with a number of untagged ports with separate VLANs and then a
trunk port with all the VLANs tagged on it.

v3:
- Pull QCA8K_PORT_VID_DEF changes into separate cleanup patch
- Reverse Christmas tree notation for variable definitions
- Use untagged instead of tagged for consistency
v2:
- Return sensible errnos on failure rather than -1 (rmk)
- Style cleanups based on Florian's feedback
- Silently allow VLAN 0 as device correctly treats this as no tag

Signed-off-by: Jonathan McDowell <noodles@earth.li>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/qca8k.c
drivers/net/dsa/qca8k.h