diff options
author | Jonas Gorski <jogo@openwrt.org> | 2013-01-18 15:21:59 +0000 |
---|---|---|
committer | Jonas Gorski <jogo@openwrt.org> | 2013-01-18 15:21:59 +0000 |
commit | 2f62c6c150945f8c5fa9525215633618f2dc4aac (patch) | |
tree | 07eaff2f311e1c8bd571aad30865bac74b43fa28 /target | |
parent | b20d85cff7ee8b11bf73fbd8c9d1db2cb5ea8b93 (diff) | |
download | upstream-2f62c6c150945f8c5fa9525215633618f2dc4aac.tar.gz upstream-2f62c6c150945f8c5fa9525215633618f2dc4aac.tar.bz2 upstream-2f62c6c150945f8c5fa9525215633618f2dc4aac.zip |
AA: generic: rtl8366_smi: only assign pvid if no pvid was set yet
Backport or r35227.
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@35228 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/rtl8366_smi.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c index be85274e78..5ad1ff6fe4 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c @@ -1106,6 +1106,7 @@ int rtl8366_sw_set_vlan_ports(struct switch_dev *dev, struct switch_val *val) port = &val->value.ports[0]; for (i = 0; i < val->len; i++, port++) { + int pvid; member |= BIT(port->id); if (!(port->flags & BIT(SWITCH_PORT_FLAG_TAGGED))) @@ -1115,9 +1116,14 @@ int rtl8366_sw_set_vlan_ports(struct switch_dev *dev, struct switch_val *val) * To ensure that we have a valid MC entry for this VLAN, * initialize the port VLAN ID here. */ - err = rtl8366_set_pvid(smi, port->id, val->port_vlan); + err = rtl8366_get_pvid(smi, port->id, &pvid); if (err < 0) return err; + if (pvid == 0) { + err = rtl8366_set_pvid(smi, port->id, val->port_vlan); + if (err < 0) + return err; + } } return rtl8366_set_vlan(smi, val->port_vlan, member, untag, 0); |