diff mbox

[OpenWrt-Devel] b53: reset vlans data when setting 'enable_vlan'

Message ID 1456412749-23878-1-git-send-email-aardelean@riverbed.com
State Changes Requested
Delegated to: Rafał Miłecki
Headers show

Commit Message

Alexandru Ardelean Feb. 25, 2016, 3:05 p.m. UTC
From: Alexandru Ardelean <ardeleanalex@gmail.com>

In our case we don't call reset (to reset the chip and the driver)
on each reconfigure.
So, we can re-use the 'enable_vlan' call, because this gets called
once on each switch re-configure and we can reset all previously
set VLANs.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
---
 target/linux/generic/files/drivers/net/phy/b53/b53_common.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
index 676e301..a6bde8f 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
@@ -590,6 +590,8 @@  static int b53_global_set_vlan_enable(struct switch_dev *dev,
 	struct b53_device *priv = sw_to_b53(dev);
 
 	priv->enable_vlan = val->value.i;
+	/* Reset VLANs whenever calling this ; this would set the system to a deterministic state */
+	memset(priv->vlans, 0, sizeof(*priv->vlans) * dev->vlans);
 
 	return 0;
 }