summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers
diff options
context:
space:
mode:
authorjogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-01-18 15:19:11 +0000
committerjogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-01-18 15:19:11 +0000
commit8d8c86f762063894cde5c92749ee5dfce6bdee58 (patch)
tree35971424933efff6422e77596408193aeecfb760 /target/linux/generic/files/drivers
parent252b4befd76afc00843a42f3cd358d53e8c807e3 (diff)
generic: rtl8366_smi: only assign pvid if no pvid was set yet
Only assign a pvid if the current pvid is 0. Fixes using mixed tagged and untagged traffic on a port and the untagged vlan isn't the last one of which the port is a member. Tested on RTL8366S and RTL8367R. Fixes #8501. Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35227 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/files/drivers')
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8366_smi.c8
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 804e827db..d43390813 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
@@ -1109,6 +1109,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)))
@@ -1118,9 +1119,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);