net: dsa: mv88e6xxx: remove port_fdb_getnext
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Thu, 22 Oct 2015 13:34:42 +0000 (09:34 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Oct 2015 14:38:43 +0000 (07:38 -0700)
Now that port_fdb_dump is implemented and even simpler, get rid of
port_fdb_getnext.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6171.c
drivers/net/dsa/mv88e6352.c
drivers/net/dsa/mv88e6xxx.c
drivers/net/dsa/mv88e6xxx.h

index 489deb8853b3114a89a0d1e7ce50e2cc24a5a0db..2c8eb6f76ebe02a54f71539d3799f21f879e01f8 100644 (file)
@@ -122,7 +122,6 @@ struct dsa_switch_driver mv88e6171_switch_driver = {
        .port_fdb_prepare       = mv88e6xxx_port_fdb_prepare,
        .port_fdb_add           = mv88e6xxx_port_fdb_add,
        .port_fdb_del           = mv88e6xxx_port_fdb_del,
-       .port_fdb_getnext       = mv88e6xxx_port_fdb_getnext,
        .port_fdb_dump          = mv88e6xxx_port_fdb_dump,
 };
 
index 6b8fd2468d1aef327ce59350381b833158584297..cbf4dd8721a6a27e4fdd0ed7963304472486cda8 100644 (file)
@@ -349,7 +349,6 @@ struct dsa_switch_driver mv88e6352_switch_driver = {
        .port_fdb_prepare       = mv88e6xxx_port_fdb_prepare,
        .port_fdb_add           = mv88e6xxx_port_fdb_add,
        .port_fdb_del           = mv88e6xxx_port_fdb_del,
-       .port_fdb_getnext       = mv88e6xxx_port_fdb_getnext,
        .port_fdb_dump          = mv88e6xxx_port_fdb_dump,
 };
 
index 8d0acf3f64dea25b883cee7ef268690d280f2230..39664d8667afa6dc44b96c09a52d7e9053040614 100644 (file)
@@ -1559,33 +1559,6 @@ unlock:
        return err;
 }
 
-static int _mv88e6xxx_port_vtu_getnext(struct dsa_switch *ds, int port, u16 vid,
-                                      struct mv88e6xxx_vtu_stu_entry *entry)
-{
-       int err;
-
-       do {
-               if (vid == 4095)
-                       return -ENOENT;
-
-               err = _mv88e6xxx_vtu_vid_write(ds, vid);
-               if (err)
-                       return err;
-
-               err = _mv88e6xxx_vtu_getnext(ds, entry);
-               if (err)
-                       return err;
-
-               if (!entry->valid)
-                       return -ENOENT;
-
-               vid = entry->vid;
-       } while (entry->data[port] != GLOBAL_VTU_DATA_MEMBER_TAG_TAGGED &&
-                entry->data[port] != GLOBAL_VTU_DATA_MEMBER_TAG_UNTAGGED);
-
-       return 0;
-}
-
 int mv88e6xxx_vlan_getnext(struct dsa_switch *ds, u16 *vid,
                           unsigned long *ports, unsigned long *untagged)
 {
@@ -1864,52 +1837,6 @@ unlock:
        return err;
 }
 
-/* get next entry for port */
-int mv88e6xxx_port_fdb_getnext(struct dsa_switch *ds, int port,
-                              unsigned char *addr, u16 *vid, bool *is_static)
-{
-       struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
-       struct mv88e6xxx_atu_entry next;
-       u16 fid = *vid; /* We use one FID per VLAN */
-       int ret;
-
-       mutex_lock(&ps->smi_mutex);
-
-       do {
-               if (is_broadcast_ether_addr(addr)) {
-                       struct mv88e6xxx_vtu_stu_entry vtu;
-
-                       ret = _mv88e6xxx_port_vtu_getnext(ds, port, *vid, &vtu);
-                       if (ret < 0)
-                               goto unlock;
-
-                       *vid = vtu.vid;
-                       fid = vtu.fid;
-               }
-
-               ret = _mv88e6xxx_atu_mac_write(ds, addr);
-               if (ret < 0)
-                       goto unlock;
-
-               ret = _mv88e6xxx_atu_getnext(ds, fid, &next);
-               if (ret < 0)
-                       goto unlock;
-
-               ether_addr_copy(addr, next.mac);
-
-               if (next.state == GLOBAL_ATU_DATA_STATE_UNUSED)
-                       continue;
-       } while (next.trunk || (next.portv_trunkid & BIT(port)) == 0);
-
-       *is_static = next.state == (is_multicast_ether_addr(addr) ?
-                                   GLOBAL_ATU_DATA_STATE_MC_STATIC :
-                                   GLOBAL_ATU_DATA_STATE_UC_STATIC);
-unlock:
-       mutex_unlock(&ps->smi_mutex);
-
-       return ret;
-}
-
 static void mv88e6xxx_bridge_work(struct work_struct *work)
 {
        struct mv88e6xxx_priv_state *ps;
index 3c9cfde0cb0f0ec3fdf767bd083f41cdab200321..430de4fa1fec76be5757f38353a55e31ebc10630 100644 (file)
@@ -474,8 +474,6 @@ int mv88e6xxx_port_fdb_add(struct dsa_switch *ds, int port,
                           struct switchdev_trans *trans);
 int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port,
                           const struct switchdev_obj_port_fdb *fdb);
-int mv88e6xxx_port_fdb_getnext(struct dsa_switch *ds, int port,
-                              unsigned char *addr, u16 *vid, bool *is_static);
 int mv88e6xxx_port_fdb_dump(struct dsa_switch *ds, int port,
                            struct switchdev_obj_port_fdb *fdb,
                            int (*cb)(struct switchdev_obj *obj));