]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: add a "valid" boolean to struct ocelot_vlan
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sat, 31 Oct 2020 10:29:13 +0000 (12:29 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Nov 2020 01:09:06 +0000 (17:09 -0800)
commitf01734f3072b7c13367bc7b62915056e6800cd33
tree2a2436542df870f98bb43c3d13bb3e75b72a33b6
parent3407a11d12d73302a9b5161a33f3b9e0a9ba25b1
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>
drivers/net/ethernet/mscc/ocelot.c
include/soc/mscc/ocelot.h