Skip to content

Commit 2c49471

Browse files
viviendavem330
authored andcommitted
net: dsa: mv88e6xxx: remove port_fdb_getnext
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>
1 parent f33475b commit 2c49471

File tree

4 files changed

+0
-77
lines changed

4 files changed

+0
-77
lines changed

drivers/net/dsa/mv88e6171.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ struct dsa_switch_driver mv88e6171_switch_driver = {
122122
.port_fdb_prepare = mv88e6xxx_port_fdb_prepare,
123123
.port_fdb_add = mv88e6xxx_port_fdb_add,
124124
.port_fdb_del = mv88e6xxx_port_fdb_del,
125-
.port_fdb_getnext = mv88e6xxx_port_fdb_getnext,
126125
.port_fdb_dump = mv88e6xxx_port_fdb_dump,
127126
};
128127

drivers/net/dsa/mv88e6352.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ struct dsa_switch_driver mv88e6352_switch_driver = {
349349
.port_fdb_prepare = mv88e6xxx_port_fdb_prepare,
350350
.port_fdb_add = mv88e6xxx_port_fdb_add,
351351
.port_fdb_del = mv88e6xxx_port_fdb_del,
352-
.port_fdb_getnext = mv88e6xxx_port_fdb_getnext,
353352
.port_fdb_dump = mv88e6xxx_port_fdb_dump,
354353
};
355354

drivers/net/dsa/mv88e6xxx.c

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,33 +1559,6 @@ int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port, u16 vid)
15591559
return err;
15601560
}
15611561

1562-
static int _mv88e6xxx_port_vtu_getnext(struct dsa_switch *ds, int port, u16 vid,
1563-
struct mv88e6xxx_vtu_stu_entry *entry)
1564-
{
1565-
int err;
1566-
1567-
do {
1568-
if (vid == 4095)
1569-
return -ENOENT;
1570-
1571-
err = _mv88e6xxx_vtu_vid_write(ds, vid);
1572-
if (err)
1573-
return err;
1574-
1575-
err = _mv88e6xxx_vtu_getnext(ds, entry);
1576-
if (err)
1577-
return err;
1578-
1579-
if (!entry->valid)
1580-
return -ENOENT;
1581-
1582-
vid = entry->vid;
1583-
} while (entry->data[port] != GLOBAL_VTU_DATA_MEMBER_TAG_TAGGED &&
1584-
entry->data[port] != GLOBAL_VTU_DATA_MEMBER_TAG_UNTAGGED);
1585-
1586-
return 0;
1587-
}
1588-
15891562
int mv88e6xxx_vlan_getnext(struct dsa_switch *ds, u16 *vid,
15901563
unsigned long *ports, unsigned long *untagged)
15911564
{
@@ -1864,52 +1837,6 @@ int mv88e6xxx_port_fdb_dump(struct dsa_switch *ds, int port,
18641837
return err;
18651838
}
18661839

1867-
/* get next entry for port */
1868-
int mv88e6xxx_port_fdb_getnext(struct dsa_switch *ds, int port,
1869-
unsigned char *addr, u16 *vid, bool *is_static)
1870-
{
1871-
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
1872-
struct mv88e6xxx_atu_entry next;
1873-
u16 fid = *vid; /* We use one FID per VLAN */
1874-
int ret;
1875-
1876-
mutex_lock(&ps->smi_mutex);
1877-
1878-
do {
1879-
if (is_broadcast_ether_addr(addr)) {
1880-
struct mv88e6xxx_vtu_stu_entry vtu;
1881-
1882-
ret = _mv88e6xxx_port_vtu_getnext(ds, port, *vid, &vtu);
1883-
if (ret < 0)
1884-
goto unlock;
1885-
1886-
*vid = vtu.vid;
1887-
fid = vtu.fid;
1888-
}
1889-
1890-
ret = _mv88e6xxx_atu_mac_write(ds, addr);
1891-
if (ret < 0)
1892-
goto unlock;
1893-
1894-
ret = _mv88e6xxx_atu_getnext(ds, fid, &next);
1895-
if (ret < 0)
1896-
goto unlock;
1897-
1898-
ether_addr_copy(addr, next.mac);
1899-
1900-
if (next.state == GLOBAL_ATU_DATA_STATE_UNUSED)
1901-
continue;
1902-
} while (next.trunk || (next.portv_trunkid & BIT(port)) == 0);
1903-
1904-
*is_static = next.state == (is_multicast_ether_addr(addr) ?
1905-
GLOBAL_ATU_DATA_STATE_MC_STATIC :
1906-
GLOBAL_ATU_DATA_STATE_UC_STATIC);
1907-
unlock:
1908-
mutex_unlock(&ps->smi_mutex);
1909-
1910-
return ret;
1911-
}
1912-
19131840
static void mv88e6xxx_bridge_work(struct work_struct *work)
19141841
{
19151842
struct mv88e6xxx_priv_state *ps;

drivers/net/dsa/mv88e6xxx.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,6 @@ int mv88e6xxx_port_fdb_add(struct dsa_switch *ds, int port,
474474
struct switchdev_trans *trans);
475475
int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port,
476476
const struct switchdev_obj_port_fdb *fdb);
477-
int mv88e6xxx_port_fdb_getnext(struct dsa_switch *ds, int port,
478-
unsigned char *addr, u16 *vid, bool *is_static);
479477
int mv88e6xxx_port_fdb_dump(struct dsa_switch *ds, int port,
480478
struct switchdev_obj_port_fdb *fdb,
481479
int (*cb)(struct switchdev_obj *obj));

0 commit comments

Comments
 (0)