aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@openwrt.org>2013-11-13 18:04:39 +0000
committerHauke Mehrtens <hauke@openwrt.org>2013-11-13 18:04:39 +0000
commit80e55b973f1aa345456fcfe95155bffda7818687 (patch)
tree050bbc477ebef233e3e9482a905da173fe0736d6 /target/linux/generic/files
parentddc2c451deb1b484f65f71fd289840bae0d0b333 (diff)
downloadupstream-80e55b973f1aa345456fcfe95155bffda7818687.tar.gz
upstream-80e55b973f1aa345456fcfe95155bffda7818687.tar.bz2
upstream-80e55b973f1aa345456fcfe95155bffda7818687.zip
kernel: b53: fix untagged shift for BCM5365
The BCM5365 needs a shift of 7 bits and not 6 bits like the BCM5325 for the untagged ports. Thank you Russell for reporting this and testing the patch. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38793 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/files')
-rw-r--r--target/linux/generic/files/drivers/net/phy/b53/b53_common.c6
-rw-r--r--target/linux/generic/files/drivers/net/phy/b53/b53_regs.h6
2 files changed, 8 insertions, 4 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
index 39027c1771..f5dd068a1b 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
@@ -189,7 +189,8 @@ static void b53_set_vlan_entry(struct b53_device *dev, u16 vid, u16 members,
u32 entry = 0;
if (members) {
- entry = (untag << VA_UNTAG_S) | members;
+ entry = ((untag & VA_UNTAG_MASK_25) << VA_UNTAG_S_25) |
+ members;
if (dev->core_rev >= 3)
entry |= VA_VALID_25_R4 | vid << VA_VID_HIGH_S;
else
@@ -203,7 +204,8 @@ static void b53_set_vlan_entry(struct b53_device *dev, u16 vid, u16 members,
u16 entry = 0;
if (members)
- entry = (untag << VA_UNTAG_S) | members | VA_VALID_65;
+ entry = ((untag & VA_UNTAG_MASK_65) << VA_UNTAG_S_65) |
+ members | VA_VALID_65;
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_WRITE_65, entry);
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_TABLE_ACCESS_65, vid |
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
index 7018ff4ebb..ba509154f6 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
@@ -282,8 +282,10 @@
#define B53_VLAN_WRITE_65 0x0a
#define B53_VLAN_READ 0x0c
#define VA_MEMBER_MASK 0x3f
-#define VA_UNTAG_S 6
-#define VA_UNTAG_MASK (0x3f << VA_UNTAG_S)
+#define VA_UNTAG_S_25 6
+#define VA_UNTAG_MASK_25 0x3f
+#define VA_UNTAG_S_65 7
+#define VA_UNTAG_MASK_65 0x1f
#define VA_VID_HIGH_S 12
#define VA_VID_HIGH_MASK (0xffff << VA_VID_HIGH_S)
#define VA_VALID_25 BIT(20)