net: dsa: push prepare phase in port_fdb_add
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Thu, 8 Oct 2015 15:35:13 +0000 (11:35 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Oct 2015 12:28:50 +0000 (05:28 -0700)
Now that the prepare phase is pushed down to the DSA drivers, propagate
it to the port_fdb_add function.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx.c
drivers/net/dsa/mv88e6xxx.h
include/net/dsa.h
net/dsa/slave.c

index 0da865171798a99e0c2dba1a1b079cb16f5359bd..644fffc6b98b1ba20d611097088970ecfde1b60d 100644 (file)
@@ -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
@@ -1852,16 +1853,17 @@ int mv88e6xxx_port_fdb_prepare(struct dsa_switch *ds, int port,
 }
 
 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;
index 3042869246426d5a744d55884923b2c38f65cc27..86a94dc0d86e9aad9301bc9589efdc24e13b6762 100644 (file)
@@ -478,7 +478,8 @@ int mv88e6xxx_port_fdb_prepare(struct dsa_switch *ds, int port,
                               const struct switchdev_obj_port_fdb *fdb,
                               struct switchdev_trans *trans);
 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 mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port,
                           const unsigned char *addr, u16 vid);
 int mv88e6xxx_port_fdb_getnext(struct dsa_switch *ds, int port,
index 4f66f8411583fa0fc4ae9607a5003864782d1f8d..ce8f9b748a77c7e16ab35dc8ba4b6f38c3661f5d 100644 (file)
@@ -323,7 +323,8 @@ struct dsa_switch_driver {
                                    const struct switchdev_obj_port_fdb *fdb,
                                    struct switchdev_trans *trans);
        int     (*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     (*port_fdb_del)(struct dsa_switch *ds, int port,
                                const unsigned char *addr, u16 vid);
        int     (*port_fdb_getnext)(struct dsa_switch *ds, int port,
index 48e8c15a2611bfc3c8cefa387832ca76380b1260..6f7f27e9410c37bdc15e2e9e5445f5243f0b6728 100644 (file)
@@ -354,7 +354,7 @@ static int dsa_slave_port_fdb_add(struct net_device *dev,
        if (switchdev_trans_ph_prepare(trans))
                ret = ds->drv->port_fdb_prepare(ds, p->port, fdb, trans);
        else
-               ret = ds->drv->port_fdb_add(ds, p->port, fdb->addr, fdb->vid);
+               ret = ds->drv->port_fdb_add(ds, p->port, fdb, trans);
 
        return ret;
 }