net: dsa: add port_vlan_dump routine

Similar to port_fdb_dump, add a port_vlan_dump function to DSA drivers
which gets passed the switchdev VLAN object and callback.

This function, if implemented, takes precedence over the soon legacy
vlan_getnext/port_pvid_get approach.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Vivien Didelot
2016-02-23 12:13:54 -05:00
committed by David S. Miller
parent 2a04c7bade
commit 65aebfc002
3 changed files with 10 additions and 0 deletions

View File

@@ -248,6 +248,9 @@ static int dsa_slave_port_vlan_dump(struct net_device *dev,
u16 pvid, vid = 0;
int err;
if (ds->drv->port_vlan_dump)
return ds->drv->port_vlan_dump(ds, p->port, vlan, cb);
if (!ds->drv->vlan_getnext || !ds->drv->port_pvid_get)
return -EOPNOTSUPP;