OSDN Git Service

net: dsa: request drivers to perform FDB isolation
[uclinux-h8/linux.git] / drivers / net / dsa / sja1105 / sja1105_main.c
index abc67b9..3a5e37c 100644 (file)
@@ -1803,7 +1803,8 @@ int sja1105pqrs_fdb_del(struct dsa_switch *ds, int port,
 }
 
 static int sja1105_fdb_add(struct dsa_switch *ds, int port,
-                          const unsigned char *addr, u16 vid)
+                          const unsigned char *addr, u16 vid,
+                          struct dsa_db db)
 {
        struct sja1105_private *priv = ds->priv;
 
@@ -1811,7 +1812,8 @@ static int sja1105_fdb_add(struct dsa_switch *ds, int port,
 }
 
 static int sja1105_fdb_del(struct dsa_switch *ds, int port,
-                          const unsigned char *addr, u16 vid)
+                          const unsigned char *addr, u16 vid,
+                          struct dsa_db db)
 {
        struct sja1105_private *priv = ds->priv;
 
@@ -1869,7 +1871,15 @@ static int sja1105_fdb_dump(struct dsa_switch *ds, int port,
 
 static void sja1105_fast_age(struct dsa_switch *ds, int port)
 {
+       struct dsa_port *dp = dsa_to_port(ds, port);
        struct sja1105_private *priv = ds->priv;
+       struct dsa_db db = {
+               .type = DSA_DB_BRIDGE,
+               .bridge = {
+                       .dev = dsa_port_bridge_dev_get(dp),
+                       .num = dsa_port_bridge_num_get(dp),
+               },
+       };
        int i;
 
        for (i = 0; i < SJA1105_MAX_L2_LOOKUP_COUNT; i++) {
@@ -1897,7 +1907,7 @@ static void sja1105_fast_age(struct dsa_switch *ds, int port)
 
                u64_to_ether_addr(l2_lookup.macaddr, macaddr);
 
-               rc = sja1105_fdb_del(ds, port, macaddr, l2_lookup.vlanid);
+               rc = sja1105_fdb_del(ds, port, macaddr, l2_lookup.vlanid, db);
                if (rc) {
                        dev_err(ds->dev,
                                "Failed to delete FDB entry %pM vid %lld: %pe\n",
@@ -1908,15 +1918,17 @@ static void sja1105_fast_age(struct dsa_switch *ds, int port)
 }
 
 static int sja1105_mdb_add(struct dsa_switch *ds, int port,
-                          const struct switchdev_obj_port_mdb *mdb)
+                          const struct switchdev_obj_port_mdb *mdb,
+                          struct dsa_db db)
 {
-       return sja1105_fdb_add(ds, port, mdb->addr, mdb->vid);
+       return sja1105_fdb_add(ds, port, mdb->addr, mdb->vid, db);
 }
 
 static int sja1105_mdb_del(struct dsa_switch *ds, int port,
-                          const struct switchdev_obj_port_mdb *mdb)
+                          const struct switchdev_obj_port_mdb *mdb,
+                          struct dsa_db db)
 {
-       return sja1105_fdb_del(ds, port, mdb->addr, mdb->vid);
+       return sja1105_fdb_del(ds, port, mdb->addr, mdb->vid, db);
 }
 
 /* Common function for unicast and broadcast flood configuration.