Skip to content

Commit 1a49a2f

Browse files
viviendavem330
authored andcommitted
net: dsa: remove port_fdb_getnext
No driver implements port_fdb_getnext anymore, and port_fdb_dump is preferred anyway, so remove this function from DSA. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2c49471 commit 1a49a2f

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

include/net/dsa.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,6 @@ struct dsa_switch_driver {
328328
struct switchdev_trans *trans);
329329
int (*port_fdb_del)(struct dsa_switch *ds, int port,
330330
const struct switchdev_obj_port_fdb *fdb);
331-
int (*port_fdb_getnext)(struct dsa_switch *ds, int port,
332-
unsigned char *addr, u16 *vid,
333-
bool *is_static);
334331
int (*port_fdb_dump)(struct dsa_switch *ds, int port,
335332
struct switchdev_obj_port_fdb *fdb,
336333
int (*cb)(struct switchdev_obj *obj));

net/dsa/slave.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -378,34 +378,11 @@ static int dsa_slave_port_fdb_dump(struct net_device *dev,
378378
{
379379
struct dsa_slave_priv *p = netdev_priv(dev);
380380
struct dsa_switch *ds = p->parent;
381-
unsigned char addr[ETH_ALEN] = { 0 };
382-
u16 vid = 0;
383-
int ret;
384381

385382
if (ds->drv->port_fdb_dump)
386383
return ds->drv->port_fdb_dump(ds, p->port, fdb, cb);
387384

388-
if (!ds->drv->port_fdb_getnext)
389-
return -EOPNOTSUPP;
390-
391-
for (;;) {
392-
bool is_static;
393-
394-
ret = ds->drv->port_fdb_getnext(ds, p->port, addr, &vid,
395-
&is_static);
396-
if (ret < 0)
397-
break;
398-
399-
ether_addr_copy(fdb->addr, addr);
400-
fdb->vid = vid;
401-
fdb->ndm_state = is_static ? NUD_NOARP : NUD_REACHABLE;
402-
403-
ret = cb(&fdb->obj);
404-
if (ret < 0)
405-
break;
406-
}
407-
408-
return ret == -ENOENT ? 0 : ret;
385+
return -EOPNOTSUPP;
409386
}
410387

411388
static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)

0 commit comments

Comments
 (0)