[OpenWrt-Devel] [PATCH 4/5] lantiq/xrx200-net: add FID (filtering identifier) setting

Martin Schiller mschiller at tdt.de
Thu Feb 18 08:13:15 EST 2016


By setting the FID of a VLAN group to a value other then the default (0) it
is possible to switch from Shared VLAN Learning to Independant VLAN Learning.

Signed-off-by: Martin Schiller <mschiller at tdt.de>
---
 .../0025-NET-MIPS-lantiq-adds-xrx200-net.patch     | 39 +++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch b/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
index 531bbd0..9d598a3 100644
--- a/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
+++ b/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
@@ -209,7 +209,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +};
 --- /dev/null
 +++ b/drivers/net/ethernet/lantiq_xrx200.c
-@@ -0,0 +1,1815 @@
+@@ -0,0 +1,1852 @@
 +/*
 + *   This program is free software; you can redistribute it and/or modify it
 + *   under the terms of the GNU General Public License version 2 as published
@@ -778,6 +778,35 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +	return 0;
 +}
 +
++static int xrx200sw_set_vlan_fid(struct switch_dev *dev, const struct switch_attr *attr,
++				 struct switch_val *val)
++{
++	int i;
++	struct xrx200_pce_table_entry tev;
++
++	tev.table = XRX200_PCE_ACTVLAN_IDX;
++
++	tev.index = val->port_vlan;
++	xrx200_pce_table_entry_read(&tev);
++	tev.val[0] = val->value.i;
++	xrx200_pce_table_entry_write(&tev);
++
++	return 0;
++}
++
++static int xrx200sw_get_vlan_fid(struct switch_dev *dev, const struct switch_attr *attr,
++				 struct switch_val *val)
++{
++	struct xrx200_pce_table_entry te;
++
++	te.table = XRX200_PCE_ACTVLAN_IDX;
++	te.index = val->port_vlan;
++	xrx200_pce_table_entry_read(&te);
++	val->value.i = te.val[0];
++
++	return 0;
++}
++
 +static int xrx200sw_set_vlan_ports(struct switch_dev *dev, struct switch_val *val)
 +{
 +	int i, portmap, tagmap, untagged;
@@ -1022,6 +1051,14 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +	},
 +	{
 +		.type = SWITCH_TYPE_INT,
++		.name = "fid",
++		.description = "Filtering Identifier (0-63)",
++		.set = xrx200sw_set_vlan_fid,
++		.get = xrx200sw_get_vlan_fid,
++		.max = 63,
++ 	},
++	{
++		.type = SWITCH_TYPE_INT,
 +		.name = "enable",
 +		.description = "Enable VLAN",
 +		.set = xrx200sw_set_vlan_enable,
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list