Commit 57795412 authored by Oleksij Rempel's avatar Oleksij Rempel Committed by Paolo Abeni

net: dsa: microchip: ksz8: Implement add/del_fdb and use static MAC table operations

Add support for add/del_fdb operations and utilize the refactored static
MAC table code. This resolves kernel warnings caused by the lack of fdb
add function support in the current driver.
Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent f6636ff6
...@@ -32,6 +32,10 @@ void ksz8_freeze_mib(struct ksz_device *dev, int port, bool freeze); ...@@ -32,6 +32,10 @@ void ksz8_freeze_mib(struct ksz_device *dev, int port, bool freeze);
void ksz8_port_init_cnt(struct ksz_device *dev, int port); void ksz8_port_init_cnt(struct ksz_device *dev, int port);
int ksz8_fdb_dump(struct ksz_device *dev, int port, int ksz8_fdb_dump(struct ksz_device *dev, int port,
dsa_fdb_dump_cb_t *cb, void *data); dsa_fdb_dump_cb_t *cb, void *data);
int ksz8_fdb_add(struct ksz_device *dev, int port, const unsigned char *addr,
u16 vid, struct dsa_db db);
int ksz8_fdb_del(struct ksz_device *dev, int port, const unsigned char *addr,
u16 vid, struct dsa_db db);
int ksz8_mdb_add(struct ksz_device *dev, int port, int ksz8_mdb_add(struct ksz_device *dev, int port,
const struct switchdev_obj_port_mdb *mdb, struct dsa_db db); const struct switchdev_obj_port_mdb *mdb, struct dsa_db db);
int ksz8_mdb_del(struct ksz_device *dev, int port, int ksz8_mdb_del(struct ksz_device *dev, int port,
......
...@@ -1061,6 +1061,18 @@ int ksz8_mdb_del(struct ksz_device *dev, int port, ...@@ -1061,6 +1061,18 @@ int ksz8_mdb_del(struct ksz_device *dev, int port,
return ksz8_del_sta_mac(dev, port, mdb->addr, mdb->vid); return ksz8_del_sta_mac(dev, port, mdb->addr, mdb->vid);
} }
int ksz8_fdb_add(struct ksz_device *dev, int port, const unsigned char *addr,
u16 vid, struct dsa_db db)
{
return ksz8_add_sta_mac(dev, port, addr, vid);
}
int ksz8_fdb_del(struct ksz_device *dev, int port, const unsigned char *addr,
u16 vid, struct dsa_db db)
{
return ksz8_del_sta_mac(dev, port, addr, vid);
}
int ksz8_port_vlan_filtering(struct ksz_device *dev, int port, bool flag, int ksz8_port_vlan_filtering(struct ksz_device *dev, int port, bool flag,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
......
...@@ -200,6 +200,8 @@ static const struct ksz_dev_ops ksz8_dev_ops = { ...@@ -200,6 +200,8 @@ static const struct ksz_dev_ops ksz8_dev_ops = {
.freeze_mib = ksz8_freeze_mib, .freeze_mib = ksz8_freeze_mib,
.port_init_cnt = ksz8_port_init_cnt, .port_init_cnt = ksz8_port_init_cnt,
.fdb_dump = ksz8_fdb_dump, .fdb_dump = ksz8_fdb_dump,
.fdb_add = ksz8_fdb_add,
.fdb_del = ksz8_fdb_del,
.mdb_add = ksz8_mdb_add, .mdb_add = ksz8_mdb_add,
.mdb_del = ksz8_mdb_del, .mdb_del = ksz8_mdb_del,
.vlan_filtering = ksz8_port_vlan_filtering, .vlan_filtering = ksz8_port_vlan_filtering,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment