mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
net: dsa: Store vlan_filtering as a property of dsa_port
This allows drivers to query the VLAN setting imposed by the bridge driver directly from DSA, instead of keeping their own state based on the .port_vlan_filtering callback. Signed-off-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
85478d73c9
commit
33162e9a05
2 changed files with 9 additions and 4 deletions
|
@ -158,15 +158,19 @@ int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering,
|
|||
struct switchdev_trans *trans)
|
||||
{
|
||||
struct dsa_switch *ds = dp->ds;
|
||||
int err;
|
||||
|
||||
/* bridge skips -EOPNOTSUPP, so skip the prepare phase */
|
||||
if (switchdev_trans_ph_prepare(trans))
|
||||
return 0;
|
||||
|
||||
if (ds->ops->port_vlan_filtering)
|
||||
return ds->ops->port_vlan_filtering(ds, dp->index,
|
||||
vlan_filtering);
|
||||
|
||||
if (ds->ops->port_vlan_filtering) {
|
||||
err = ds->ops->port_vlan_filtering(ds, dp->index,
|
||||
vlan_filtering);
|
||||
if (err)
|
||||
return err;
|
||||
dp->vlan_filtering = vlan_filtering;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue