diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2017-05-01 20:05:26 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-01 21:03:13 +0200 |
commit | 1ac758648b574d3d01a648fc7018fc8b0bb7454a (patch) | |
tree | b0db4be986c64957038facc6ba4e69d0bff55ba3 /drivers/net/dsa/mv88e6xxx/global1_vtu.c | |
parent | net: dsa: mv88e6xxx: simplify VTU entry getter (diff) | |
download | linux-1ac758648b574d3d01a648fc7018fc8b0bb7454a.tar.xz linux-1ac758648b574d3d01a648fc7018fc8b0bb7454a.zip |
net: dsa: mv88e6xxx: support the VTU Page bit
Newer chips such as the 88E6390 have a VTU Page bit in the VTU VID
register to specify a 13th bit for the VID. This can be used to support
8K VLANs.
When dumping the whole VTU, all VID bits must be set to one, including
this VTU Page bit. Add support for VID greater than 4095.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/global1_vtu.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/global1_vtu.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/global1_vtu.c b/drivers/net/dsa/mv88e6xxx/global1_vtu.c index 469056d0b421..8e77974fb2f8 100644 --- a/drivers/net/dsa/mv88e6xxx/global1_vtu.c +++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c @@ -95,6 +95,10 @@ static int mv88e6xxx_g1_vtu_vid_read(struct mv88e6xxx_chip *chip, return err; entry->vid = val & 0xfff; + + if (val & GLOBAL_VTU_VID_PAGE) + entry->vid |= 0x1000; + entry->valid = !!(val & GLOBAL_VTU_VID_VALID); return 0; @@ -105,6 +109,9 @@ static int mv88e6xxx_g1_vtu_vid_write(struct mv88e6xxx_chip *chip, { u16 val = entry->vid & 0xfff; + if (entry->vid & 0x1000) + val |= GLOBAL_VTU_VID_PAGE; + if (entry->valid) val |= GLOBAL_VTU_VID_VALID; |