summaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/slave.c41
1 files changed, 27 insertions, 14 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 6e8dc6a0102c..3f6d79d03457 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -299,7 +299,7 @@ static int dsa_slave_port_vlan_del(struct net_device *dev,
static int dsa_slave_port_vlan_dump(struct net_device *dev,
struct switchdev_obj_port_vlan *vlan,
- int (*cb)(void *obj))
+ switchdev_obj_dump_cb_t *cb)
{
struct dsa_slave_priv *p = netdev_priv(dev);
struct dsa_switch *ds = p->parent;
@@ -332,7 +332,7 @@ static int dsa_slave_port_vlan_dump(struct net_device *dev,
if (test_bit(p->port, untagged))
vlan->flags |= BRIDGE_VLAN_INFO_UNTAGGED;
- err = cb(vlan);
+ err = cb(&vlan->obj);
if (err)
break;
}
@@ -371,7 +371,7 @@ static int dsa_slave_port_fdb_del(struct net_device *dev,
static int dsa_slave_port_fdb_dump(struct net_device *dev,
struct switchdev_obj_port_fdb *fdb,
- int (*cb)(void *obj))
+ switchdev_obj_dump_cb_t *cb)
{
struct dsa_slave_priv *p = netdev_priv(dev);
struct dsa_switch *ds = p->parent;
@@ -394,7 +394,7 @@ static int dsa_slave_port_fdb_dump(struct net_device *dev,
fdb->vid = vid;
fdb->ndm_state = is_static ? NUD_NOARP : NUD_REACHABLE;
- ret = cb(fdb);
+ ret = cb(&fdb->obj);
if (ret < 0)
break;
}
@@ -474,7 +474,8 @@ static int dsa_slave_port_attr_set(struct net_device *dev,
}
static int dsa_slave_port_obj_add(struct net_device *dev,
- enum switchdev_obj_id id, const void *obj,
+ enum switchdev_obj_id id,
+ const struct switchdev_obj *obj,
struct switchdev_trans *trans)
{
int err;
@@ -486,10 +487,14 @@ static int dsa_slave_port_obj_add(struct net_device *dev,
switch (id) {
case SWITCHDEV_OBJ_ID_PORT_FDB:
- err = dsa_slave_port_fdb_add(dev, obj, trans);
+ err = dsa_slave_port_fdb_add(dev,
+ SWITCHDEV_OBJ_PORT_FDB(obj),
+ trans);
break;
case SWITCHDEV_OBJ_ID_PORT_VLAN:
- err = dsa_slave_port_vlan_add(dev, obj, trans);
+ err = dsa_slave_port_vlan_add(dev,
+ SWITCHDEV_OBJ_PORT_VLAN(obj),
+ trans);
break;
default:
err = -EOPNOTSUPP;
@@ -500,16 +505,19 @@ static int dsa_slave_port_obj_add(struct net_device *dev,
}
static int dsa_slave_port_obj_del(struct net_device *dev,
- enum switchdev_obj_id id, const void *obj)
+ enum switchdev_obj_id id,
+ const struct switchdev_obj *obj)
{
int err;
switch (id) {
case SWITCHDEV_OBJ_ID_PORT_FDB:
- err = dsa_slave_port_fdb_del(dev, obj);
+ err = dsa_slave_port_fdb_del(dev,
+ SWITCHDEV_OBJ_PORT_FDB(obj));
break;
case SWITCHDEV_OBJ_ID_PORT_VLAN:
- err = dsa_slave_port_vlan_del(dev, obj);
+ err = dsa_slave_port_vlan_del(dev,
+ SWITCHDEV_OBJ_PORT_VLAN(obj));
break;
default:
err = -EOPNOTSUPP;
@@ -520,17 +528,22 @@ static int dsa_slave_port_obj_del(struct net_device *dev,
}
static int dsa_slave_port_obj_dump(struct net_device *dev,
- enum switchdev_obj_id id, void *obj,
- int (*cb)(void *obj))
+ enum switchdev_obj_id id,
+ struct switchdev_obj *obj,
+ switchdev_obj_dump_cb_t *cb)
{
int err;
switch (id) {
case SWITCHDEV_OBJ_ID_PORT_FDB:
- err = dsa_slave_port_fdb_dump(dev, obj, cb);
+ err = dsa_slave_port_fdb_dump(dev,
+ SWITCHDEV_OBJ_PORT_FDB(obj),
+ cb);
break;
case SWITCHDEV_OBJ_ID_PORT_VLAN:
- err = dsa_slave_port_vlan_dump(dev, obj, cb);
+ err = dsa_slave_port_vlan_dump(dev,
+ SWITCHDEV_OBJ_PORT_VLAN(obj),
+ cb);
break;
default:
err = -EOPNOTSUPP;