summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-01-12 10:15:11 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-01-12 10:15:11 +0000
commite87bb77966fcc38b07761c3f627e40cd906faffa (patch)
tree1b24ddbc59cab4e1e5ac9148ea2596375a9c3040
parentc33e016fa55f8f56d70289739c6668ef5a2aa07a (diff)
downloadmtk-20170518-e87bb77966fcc38b07761c3f627e40cd906faffa.zip
mtk-20170518-e87bb77966fcc38b07761c3f627e40cd906faffa.tar.gz
mtk-20170518-e87bb77966fcc38b07761c3f627e40cd906faffa.tar.bz2
ar8216: use vlan configuration for connecting ports (forced to be untagged) even with vlan_enable=0, but keep them isolated before the switch has been configured this makes enable_vlan=0 practical for vlan passthrough
SVN-Revision: 29719
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 57088a9..3019ace 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -48,6 +48,8 @@ struct ar8216_priv {
bool port4_phy;
char buf[80];
+ bool init;
+
/* all fields below are cleared on reset */
bool vlan;
u16 vlan_id[AR8X16_MAX_VLANS];
@@ -550,7 +552,7 @@ ar8216_hw_apply(struct switch_dev *dev)
ar8216_vtu_op(priv, AR8216_VTU_OP_FLUSH, 0);
memset(portmask, 0, sizeof(portmask));
- if (priv->vlan) {
+ if (!priv->init) {
/* calculate the port destination masks and load vlans
* into the vlan translation unit */
for (j = 0; j < AR8X16_MAX_VLANS; j++) {
@@ -877,6 +879,8 @@ ar8216_config_init(struct phy_device *pdev)
goto done;
}
+ priv->init = true;
+
if (priv->chip == AR8316) {
ret = ar8316_hw_init(priv);
if (ret) {
@@ -912,6 +916,8 @@ ar8216_config_init(struct phy_device *pdev)
dev->netdev_ops = &priv->ndo;
}
+ priv->init = false;
+
done:
return ret;
}