[PATCH v2 net-next 06/15] net: dsa: sja1105: allow VLAN configuration from the bridge in all states

From: Vladimir Oltean
Date: Mon May 11 2020 - 09:54:33 EST


From: Vladimir Oltean <vladimir.oltean@xxxxxxx>

Let the DSA core call our .port_vlan_add methods every time the bridge
layer requests so. We will deal internally with saving/restoring VLANs
depending on our VLAN awareness state.

Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
---
Changes in v2:
Adapt to variable name change.

drivers/net/dsa/sja1105/sja1105_main.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
index c0f11a185f31..d2755ab2853d 100644
--- a/drivers/net/dsa/sja1105/sja1105_main.c
+++ b/drivers/net/dsa/sja1105/sja1105_main.c
@@ -2358,6 +2358,8 @@ static int sja1105_setup(struct dsa_switch *ds)

ds->mtu_enforcement_ingress = true;

+ ds->configure_vlans_while_disabled = true;
+
/* The DSA/switchdev model brings up switch ports in standalone mode by
* default, and that means vlan_filtering is 0 since they're not under
* a bridge, so it's safe to set up switch tagging at this time.
--
2.17.1