diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-08-31 19:04:02 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2010-08-31 19:04:02 +0000 |
commit | 72ebc39ba32a46113c193023d39e7a755f0c49fa (patch) | |
tree | 5cd1aea5dc81f09eb15a83ac71a2502ef5e6b572 /target | |
parent | 80340ebdad2685ad2fae2990a2dc089a2cbd3449 (diff) | |
download | upstream-72ebc39ba32a46113c193023d39e7a755f0c49fa.tar.gz upstream-72ebc39ba32a46113c193023d39e7a755f0c49fa.tar.bz2 upstream-72ebc39ba32a46113c193023d39e7a755f0c49fa.zip |
rtl8366_smi: when setting VLAN ports, always initialize the PVID to ensure that the VLAN MC entry gets allocated. Fixes problems with tagged-only ports (#7795)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22856 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/rtl8366_smi.c | 9 |
1 files changed, 9 insertions, 0 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 9b70a9282a..dc83ba7d42 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c @@ -946,6 +946,7 @@ int rtl8366_sw_set_vlan_ports(struct switch_dev *dev, struct switch_val *val) struct switch_port *port; u32 member = 0; u32 untag = 0; + int err; int i; if (!smi->ops->is_vlan_valid(smi, val->port_vlan)) @@ -957,6 +958,14 @@ int rtl8366_sw_set_vlan_ports(struct switch_dev *dev, struct switch_val *val) if (!(port->flags & BIT(SWITCH_PORT_FLAG_TAGGED))) untag |= BIT(port->id); + + /* + * 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); + if (err < 0) + return err; } return rtl8366_set_vlan(smi, val->port_vlan, member, untag, 0); |