summaryrefslogtreecommitdiff
path: root/net/dsa/port.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-09-20 19:32:14 -0400
committerDavid S. Miller <davem@davemloft.net>2017-09-21 15:24:01 -0700
commitde40fc5d210f2c31f2c25a9b920861276a71b70d (patch)
tree085a2d7298d060e6eb28c2582a60f41170eceb77 /net/dsa/port.c
parent4fa7b718881a5358286903b796968cea80993820 (diff)
net: dsa: add port fdb dump
Dumping a DSA port's FDB entries is not specific to a DSA slave, so add a dsa_port_fdb_dump function, similarly to dsa_port_fdb_add and dsa_port_fdb_del. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/port.c')
-rw-r--r--net/dsa/port.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/dsa/port.c b/net/dsa/port.c
index 659676ba3f8b..76d43a82d397 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -173,6 +173,17 @@ int dsa_port_fdb_del(struct dsa_port *dp, const unsigned char *addr,
return dsa_port_notify(dp, DSA_NOTIFIER_FDB_DEL, &info);
}
+int dsa_port_fdb_dump(struct dsa_port *dp, dsa_fdb_dump_cb_t *cb, void *data)
+{
+ struct dsa_switch *ds = dp->ds;
+ int port = dp->index;
+
+ if (!ds->ops->port_fdb_dump)
+ return -EOPNOTSUPP;
+
+ return ds->ops->port_fdb_dump(ds, port, cb, data);
+}
+
int dsa_port_mdb_add(struct dsa_port *dp,
const struct switchdev_obj_port_mdb *mdb,
struct switchdev_trans *trans)