Skip to content

Commit

Permalink
net: dsa: remove port_fdb_getnext
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vivien Didelot authored and David S. Miller committed Oct 22, 2015
1 parent 2c49471 commit 1a49a2f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
3 changes: 0 additions & 3 deletions include/net/dsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,6 @@ struct dsa_switch_driver {
struct switchdev_trans *trans);
int (*port_fdb_del)(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_fdb *fdb);
int (*port_fdb_getnext)(struct dsa_switch *ds, int port,
unsigned char *addr, u16 *vid,
bool *is_static);
int (*port_fdb_dump)(struct dsa_switch *ds, int port,
struct switchdev_obj_port_fdb *fdb,
int (*cb)(struct switchdev_obj *obj));
Expand Down
25 changes: 1 addition & 24 deletions net/dsa/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,34 +378,11 @@ static int dsa_slave_port_fdb_dump(struct net_device *dev,
{
struct dsa_slave_priv *p = netdev_priv(dev);
struct dsa_switch *ds = p->parent;
unsigned char addr[ETH_ALEN] = { 0 };
u16 vid = 0;
int ret;

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

if (!ds->drv->port_fdb_getnext)
return -EOPNOTSUPP;

for (;;) {
bool is_static;

ret = ds->drv->port_fdb_getnext(ds, p->port, addr, &vid,
&is_static);
if (ret < 0)
break;

ether_addr_copy(fdb->addr, addr);
fdb->vid = vid;
fdb->ndm_state = is_static ? NUD_NOARP : NUD_REACHABLE;

ret = cb(&fdb->obj);
if (ret < 0)
break;
}

return ret == -ENOENT ? 0 : ret;
return -EOPNOTSUPP;
}

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

0 comments on commit 1a49a2f

Please sign in to comment.