aboutsummaryrefslogtreecommitdiff
path: root/net/dsa
diff options
context:
space:
mode:
authorVivien Didelot2016-02-23 12:13:54 -0500
committerDavid S. Miller2016-02-25 15:20:20 -0500
commit65aebfc002abc1827ac7c8644a2bba0459ce3ce2 (patch)
tree60a6298a94bbee916fd1853059b4dff31be40596 /net/dsa
parent2a04c7baded1cb2717ef8d02759e2ce13ae28602 (diff)
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>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/slave.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 14ca9784ec0c..a9cbb72fb155 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -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;