diff options
author | Ben Hutchings <ben.hutchings@mind.be> | 2021-08-10 00:59:28 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-08-10 09:58:14 +0100 |
commit | ef3b02a1d79b691f9a354c4903cf1e6917e315f9 (patch) | |
tree | 34841957bcc145c78122a10c8029a2c656c1d70f /drivers/net/dsa/microchip/ksz8795_reg.h | |
parent | net: dsa: microchip: Fix ksz_read64() (diff) | |
download | linux-dev-ef3b02a1d79b691f9a354c4903cf1e6917e315f9.tar.xz linux-dev-ef3b02a1d79b691f9a354c4903cf1e6917e315f9.zip |
net: dsa: microchip: ksz8795: Fix PVID tag insertion
ksz8795 has never actually enabled PVID tag insertion, and it also
programmed the PVID incorrectly. To fix this:
* Allow tag insertion to be controlled per ingress port. On most
chips, set bit 2 in Global Control 19. On KSZ88x3 this control
flag doesn't exist.
* When adding a PVID:
- Set the appropriate register bits to enable tag insertion on
egress at every other port if this was the packet's ingress port.
- Mask *out* the VID from the default tag, before or-ing in the new
PVID.
* When removing a PVID:
- Clear the same control bits to disable tag insertion.
- Don't update the default tag. This wasn't doing anything useful.
Fixes: e66f840c08a2 ("net: dsa: ksz: Add Microchip KSZ8795 DSA driver")
Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/microchip/ksz8795_reg.h')
-rw-r--r-- | drivers/net/dsa/microchip/ksz8795_reg.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/ksz8795_reg.h b/drivers/net/dsa/microchip/ksz8795_reg.h index a32355624f31..6b40bc25f7ff 100644 --- a/drivers/net/dsa/microchip/ksz8795_reg.h +++ b/drivers/net/dsa/microchip/ksz8795_reg.h @@ -631,6 +631,10 @@ #define REG_PORT_4_OUT_RATE_3 0xEE #define REG_PORT_5_OUT_RATE_3 0xFE +/* 88x3 specific */ + +#define REG_SW_INSERT_SRC_PVID 0xC2 + /* PME */ #define SW_PME_OUTPUT_ENABLE BIT(1) |