aboutsummaryrefslogtreecommitdiffstats
path: root/include/soc/mscc/ocelot.h
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2020-10-31 12:29:13 +0200
committerJakub Kicinski <kuba@kernel.org>2020-11-02 17:09:06 -0800
commite2b2e83e52f756decbaacd8202f28745bab49e07 (patch)
tree2a2436542df870f98bb43c3d13bb3e75b72a33b6 /include/soc/mscc/ocelot.h
parentnet: mscc: ocelot: transform the pvid and native vlan values into a structure (diff)
downloadlinux-dev-e2b2e83e52f756decbaacd8202f28745bab49e07.tar.xz
linux-dev-e2b2e83e52f756decbaacd8202f28745bab49e07.zip
net: mscc: ocelot: add a "valid" boolean to struct ocelot_vlan
Currently we are checking in some places whether the port has a native VLAN on egress or not, by comparing the ocelot_port->vid value with zero. That works, because VID 0 can never be a native VLAN configured by the bridge, but now we want to make similar checks for the pvid. That won't work, because there are cases when we do have the pvid set to 0 (not by the bridge, by ourselves, but still.. it's confusing). And we can't encode a negative value into an u16, so add a bool to the structure. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/soc/mscc/ocelot.h')
-rw-r--r--include/soc/mscc/ocelot.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h
index baf6a498f7d1..67c2af1c4c5c 100644
--- a/include/soc/mscc/ocelot.h
+++ b/include/soc/mscc/ocelot.h
@@ -572,6 +572,7 @@ struct ocelot_vcap_block {
};
struct ocelot_vlan {
+ bool valid;
u16 vid;
};