@@ -1303,7 +1303,7 @@ int sja1105pqrs_fdb_add(struct dsa_switch *ds, int port,
1303
1303
l2_lookup .vlanid = vid ;
1304
1304
l2_lookup .iotag = SJA1105_S_TAG ;
1305
1305
l2_lookup .mask_macaddr = GENMASK_ULL (ETH_ALEN * 8 - 1 , 0 );
1306
- if (dsa_port_is_vlan_filtering ( dsa_to_port ( ds , port )) ) {
1306
+ if (priv -> vlan_state != SJA1105_VLAN_UNAWARE ) {
1307
1307
l2_lookup .mask_vlanid = VLAN_VID_MASK ;
1308
1308
l2_lookup .mask_iotag = BIT (0 );
1309
1309
} else {
@@ -1366,7 +1366,7 @@ int sja1105pqrs_fdb_del(struct dsa_switch *ds, int port,
1366
1366
l2_lookup .vlanid = vid ;
1367
1367
l2_lookup .iotag = SJA1105_S_TAG ;
1368
1368
l2_lookup .mask_macaddr = GENMASK_ULL (ETH_ALEN * 8 - 1 , 0 );
1369
- if (dsa_port_is_vlan_filtering ( dsa_to_port ( ds , port )) ) {
1369
+ if (priv -> vlan_state != SJA1105_VLAN_UNAWARE ) {
1370
1370
l2_lookup .mask_vlanid = VLAN_VID_MASK ;
1371
1371
l2_lookup .mask_iotag = BIT (0 );
1372
1372
} else {
@@ -1412,7 +1412,7 @@ static int sja1105_fdb_add(struct dsa_switch *ds, int port,
1412
1412
* for what gets printed in 'bridge fdb show'. In the case of zero,
1413
1413
* no VID gets printed at all.
1414
1414
*/
1415
- if (! dsa_port_is_vlan_filtering ( dsa_to_port ( ds , port )) )
1415
+ if (priv -> vlan_state != SJA1105_VLAN_FILTERING_FULL )
1416
1416
vid = 0 ;
1417
1417
1418
1418
return priv -> info -> fdb_add_cmd (ds , port , addr , vid );
@@ -1423,7 +1423,7 @@ static int sja1105_fdb_del(struct dsa_switch *ds, int port,
1423
1423
{
1424
1424
struct sja1105_private * priv = ds -> priv ;
1425
1425
1426
- if (! dsa_port_is_vlan_filtering ( dsa_to_port ( ds , port )) )
1426
+ if (priv -> vlan_state != SJA1105_VLAN_FILTERING_FULL )
1427
1427
vid = 0 ;
1428
1428
1429
1429
return priv -> info -> fdb_del_cmd (ds , port , addr , vid );
@@ -1462,7 +1462,7 @@ static int sja1105_fdb_dump(struct dsa_switch *ds, int port,
1462
1462
u64_to_ether_addr (l2_lookup .macaddr , macaddr );
1463
1463
1464
1464
/* We need to hide the dsa_8021q VLANs from the user. */
1465
- if (! dsa_port_is_vlan_filtering ( dsa_to_port ( ds , port )) )
1465
+ if (priv -> vlan_state == SJA1105_VLAN_UNAWARE )
1466
1466
l2_lookup .vlanid = 0 ;
1467
1467
cb (macaddr , l2_lookup .vlanid , l2_lookup .lockeds , data );
1468
1468
}
@@ -1917,6 +1917,7 @@ static int sja1105_vlan_filtering(struct dsa_switch *ds, int port, bool enabled)
1917
1917
struct sja1105_l2_lookup_params_entry * l2_lookup_params ;
1918
1918
struct sja1105_general_params_entry * general_params ;
1919
1919
struct sja1105_private * priv = ds -> priv ;
1920
+ enum sja1105_vlan_state state ;
1920
1921
struct sja1105_table * table ;
1921
1922
struct sja1105_rule * rule ;
1922
1923
u16 tpid , tpid2 ;
@@ -1940,6 +1941,13 @@ static int sja1105_vlan_filtering(struct dsa_switch *ds, int port, bool enabled)
1940
1941
tpid2 = ETH_P_SJA1105 ;
1941
1942
}
1942
1943
1944
+ if (!enabled )
1945
+ state = SJA1105_VLAN_UNAWARE ;
1946
+ else
1947
+ state = SJA1105_VLAN_FILTERING_FULL ;
1948
+
1949
+ priv -> vlan_state = state ;
1950
+
1943
1951
table = & priv -> static_config .tables [BLK_IDX_GENERAL_PARAMS ];
1944
1952
general_params = table -> entries ;
1945
1953
/* EtherType used to identify inner tagged (C-tag) VLAN traffic */
0 commit comments