Hi, Peter and David,
I add the following patch and VLAN tagging working fine for UBNT RS:
--- ./target/linux/generic-2.6/files/drivers/net/phy/adm6996.c 2011-03-29
16:24:22.869595814 +0800
+++ ./build_dir/linux-ar71xx/linux-2.6.32.27/drivers/net/phy/adm6996.c
2011-04-04 18:32:14.188937710 +0800
@@ -416,6 +418,15 @@ adm6996_apply_vlan_filters(struct adm699
w16(priv->phydev, ADM_VLAN_FILT_L(i), reg);
reg = ADM_VLAN_FILT_VALID | ADM_VLAN_FILT_VID(vid);
w16(priv->phydev, ADM_VLAN_FILT_H(i), reg);
+
+ for (i = 0; i < ADM_PHY_PORTS; i++) {
+ if(tagged & (1<<i)){
+ //printk("Tag: 0x%x, i: %d\n",
adm_portcfg[i], i);
+ reg = r16(priv->phydev, adm_portcfg[i]);
+ reg |= ADM_PORTCFG_OT;
+ w16(priv->phydev, adm_portcfg[i], reg);
+ }
+ }
}
}
config 'switch'
option 'name' 'eth1'
option 'reset' '1'
option 'enable_vlan' '1'
option 'enable' '1'
config 'switch_vlan'
option 'device' 'eth1'
option 'vlan' '1'
option 'vid' '1'
option 'ports' '0t 1t 5t'
config 'switch_vlan'
option 'vlan' '2'
option 'vid' '2'
option 'ports' '0t 1t 5t
TCP dump results:
# tcpdump -eni eth2
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth2, link-type EN10MB (Ethernet), capture size 96 bytes
19:56:57.744360 00:15:6d:c3:81:b1 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q
(0x8100), length 60: vlan 1, p 0, ethertype ARP, arp who-has 192.168.1.2
tell 192.168.1.1
19:56:58.744408 00:15:6d:c3:81:b1 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q
(0x8100), length 60: vlan 1, p 0, ethertype ARP, arp who-has 192.168.1.2
tell 192.168.1.1
19:56:59.744478 00:15:6d:c3:81:b1 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q
(0x8100), length 60: vlan 1, p 0, ethertype ARP, arp who-has 192.168.1.2
tell 192.168.1.1
19:57:01.984613 00:15:6d:c3:81:b1 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q
(0x8100), length 60: vlan 2, p 0, ethertype ARP, arp who-has 192.168.2.2
tell 192.168.2.1
19:57:02.984683 00:15:6d:c3:81:b1 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q
(0x8100), length 60: vlan 2, p 0, ethertype ARP, arp who-has 192.168.2.2
tell 192.168.2.1
19:57:03.984754 00:15:6d:c3:81:b1 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q
(0x8100), length 60: vlan 2, p 0, ethertype ARP, arp who-has 192.168.2.2
tell 192.168.2.1
The only problem nows is the port 1 is activated after port 0 is plugged
with cable. Any idea how to solve this?
One more thing if I try the following /etc/config/network
config 'switch'
option 'name' 'eth1'
option 'reset' '1'
option 'enable_vlan' '1'
option 'enable' '1'
config 'switch_vlan'
option 'device' 'eth1'
option 'vlan' '1'
option 'vid' '1'
option 'ports' '0 1 5t'
config 'switch_vlan'
option 'vlan' '2'
option 'vid' '2'
option 'ports' '0t 1t 5t
The VLAN 2 is not working, any idea why?
Regards,
Chun Yeow
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel