diff options
author | John Crispin <blogic@openwrt.org> | 2014-07-01 13:18:27 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-07-01 13:18:27 +0000 |
commit | 127563a4b388a7c735bda0a480a6d44eb0d16b9d (patch) | |
tree | 7410ff5c0375b1f9762fd22c686b6bd37ba06b49 /target/linux/ramips/patches-3.10/0118-NET-MIPS-add-ralink-SoC-ethernet-driver.patch | |
parent | 5058f19e8435730f50914d77b19cb47a482ea796 (diff) | |
download | upstream-127563a4b388a7c735bda0a480a6d44eb0d16b9d.tar.gz upstream-127563a4b388a7c735bda0a480a6d44eb0d16b9d.tar.bz2 upstream-127563a4b388a7c735bda0a480a6d44eb0d16b9d.zip |
ramips: set default vid of each vlan, so it won't need be set explicitly.
Signed-off-by: Xiongfei Guo <xfguo@credosemi.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41448 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/patches-3.10/0118-NET-MIPS-add-ralink-SoC-ethernet-driver.patch')
-rw-r--r-- | target/linux/ramips/patches-3.10/0118-NET-MIPS-add-ralink-SoC-ethernet-driver.patch | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/target/linux/ramips/patches-3.10/0118-NET-MIPS-add-ralink-SoC-ethernet-driver.patch b/target/linux/ramips/patches-3.10/0118-NET-MIPS-add-ralink-SoC-ethernet-driver.patch index c5d6623d4c..6eb624fb89 100644 --- a/target/linux/ramips/patches-3.10/0118-NET-MIPS-add-ralink-SoC-ethernet-driver.patch +++ b/target/linux/ramips/patches-3.10/0118-NET-MIPS-add-ralink-SoC-ethernet-driver.patch @@ -2814,7 +2814,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org> +#endif --- /dev/null +++ b/drivers/net/ethernet/ralink/mt7530.c -@@ -0,0 +1,571 @@ +@@ -0,0 +1,579 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License @@ -2912,15 +2912,15 @@ Signed-off-by: John Crispin <blogic@openwrt.org> + { + .name = "llllw", + .pvids = { 1, 1, 1, 1, 2, 1, 1 }, -+ .members = { 0x6f, 0x50 }, -+ .etags = { 0x40, 0x40 }, -+ .vids = { 1, 2 }, ++ .members = { 0, 0x6f, 0x50 }, ++ .etags = { 0, 0x40, 0x40 }, ++ .vids = { 0, 1, 2 }, + }, { + .name = "wllll", + .pvids = { 2, 1, 1, 1, 1, 1, 1 }, -+ .members = { 0x7e, 0x41 }, -+ .etags = { 0x40, 0x40 }, -+ .vids = { 1, 2 }, ++ .members = { 0, 0x7e, 0x41 }, ++ .etags = { 0, 0x40, 0x40 }, ++ .vids = { 0, 1, 2 }, + }, +}; + @@ -2961,10 +2961,18 @@ Signed-off-by: John Crispin <blogic@openwrt.org> +mt7530_reset_switch(struct switch_dev *dev) +{ + struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); ++ int i; + + memset(priv->port_entries, 0, sizeof(priv->port_entries)); + memset(priv->vlan_entries, 0, sizeof(priv->vlan_entries)); + ++ /* set default vid of each vlan to the same number of vlan, so the vid ++ * won't need be set explicitly. ++ */ ++ for (i = 0; i < MT7530_NUM_VLANS; i++) { ++ priv->vlan_entries[i].vid = i; ++ } ++ + return 0; +} + @@ -3158,7 +3166,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org> + vid = (u16)val->value.i; + + if (vlan < 0 || vlan >= MT7530_NUM_VLANS) -+ return -EINVAL; ++ return -EINVAL; + + if (vid < MT7530_MIN_VID || vid > MT7530_MAX_VID) + return -EINVAL; |