|
|
@@ -23,6 +23,7 @@
|
|
|
#include <linux/phy.h>
|
|
|
#include <linux/seq_file.h>
|
|
|
#include <net/dsa.h>
|
|
|
+#include <net/switchdev.h>
|
|
|
#include "mv88e6xxx.h"
|
|
|
|
|
|
/* MDIO bus access can be nested in the case of PHYs connected to the
|
|
|
@@ -1841,30 +1842,41 @@ static int _mv88e6xxx_port_fdb_load(struct dsa_switch *ds, int port,
|
|
|
return _mv88e6xxx_atu_load(ds, &entry);
|
|
|
}
|
|
|
|
|
|
+int mv88e6xxx_port_fdb_prepare(struct dsa_switch *ds, int port,
|
|
|
+ const struct switchdev_obj_port_fdb *fdb,
|
|
|
+ struct switchdev_trans *trans)
|
|
|
+{
|
|
|
+ /* We don't need any dynamic resource from the kernel (yet),
|
|
|
+ * so skip the prepare phase.
|
|
|
+ */
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int mv88e6xxx_port_fdb_add(struct dsa_switch *ds, int port,
|
|
|
- const unsigned char *addr, u16 vid)
|
|
|
+ const struct switchdev_obj_port_fdb *fdb,
|
|
|
+ struct switchdev_trans *trans)
|
|
|
{
|
|
|
- int state = is_multicast_ether_addr(addr) ?
|
|
|
+ int state = is_multicast_ether_addr(fdb->addr) ?
|
|
|
GLOBAL_ATU_DATA_STATE_MC_STATIC :
|
|
|
GLOBAL_ATU_DATA_STATE_UC_STATIC;
|
|
|
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
|
|
|
int ret;
|
|
|
|
|
|
mutex_lock(&ps->smi_mutex);
|
|
|
- ret = _mv88e6xxx_port_fdb_load(ds, port, addr, vid, state);
|
|
|
+ ret = _mv88e6xxx_port_fdb_load(ds, port, fdb->addr, fdb->vid, state);
|
|
|
mutex_unlock(&ps->smi_mutex);
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port,
|
|
|
- const unsigned char *addr, u16 vid)
|
|
|
+ const struct switchdev_obj_port_fdb *fdb)
|
|
|
{
|
|
|
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
|
|
|
int ret;
|
|
|
|
|
|
mutex_lock(&ps->smi_mutex);
|
|
|
- ret = _mv88e6xxx_port_fdb_load(ds, port, addr, vid,
|
|
|
+ ret = _mv88e6xxx_port_fdb_load(ds, port, fdb->addr, fdb->vid,
|
|
|
GLOBAL_ATU_DATA_STATE_UNUSED);
|
|
|
mutex_unlock(&ps->smi_mutex);
|
|
|
|