From 6666cebc5e306f49a25bd20aa8c1cb8ef8950df5 Mon Sep 17 00:00:00 2001 From: Vladimir Oltean Date: Thu, 2 May 2019 23:23:34 +0300 Subject: net: dsa: sja1105: Add support for VLAN operations VLAN filtering cannot be properly disabled in SJA1105. So in order to emulate the "no VLAN awareness" behavior (not dropping traffic that is tagged with a VID that isn't configured on the port), we need to hack another switch feature: programmable TPID (which is 0x8100 for 802.1Q). We are reprogramming the TPID to a bogus value which leaves the switch thinking that all traffic is untagged, and therefore accepts it. Under a vlan_filtering bridge, the proper TPID of ETH_P_8021Q is installed again, and the switch starts identifying 802.1Q-tagged traffic. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller --- drivers/net/dsa/sja1105/sja1105_static_config.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/net/dsa/sja1105/sja1105_static_config.h') diff --git a/drivers/net/dsa/sja1105/sja1105_static_config.h b/drivers/net/dsa/sja1105/sja1105_static_config.h index 7b0a02fe3147..069ca8fd059c 100644 --- a/drivers/net/dsa/sja1105/sja1105_static_config.h +++ b/drivers/net/dsa/sja1105/sja1105_static_config.h @@ -240,6 +240,9 @@ int sja1105_static_config_init(struct sja1105_static_config *config, u64 device_id); void sja1105_static_config_free(struct sja1105_static_config *config); +int sja1105_table_delete_entry(struct sja1105_table *table, int i); +int sja1105_table_resize(struct sja1105_table *table, size_t new_count); + u32 sja1105_crc32(const void *buf, size_t len); void sja1105_pack(void *buf, const u64 *val, int start, int end, size_t len); -- cgit v1.2.3-59-g8ed1b