switchdev: push object ID back to object structure
Suggested-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Scott Feldman <sfeldma@gmail.com> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
648b4a995a
commit
9e8f4a548a
@@ -65,6 +65,7 @@ enum switchdev_obj_id {
|
||||
};
|
||||
|
||||
struct switchdev_obj {
|
||||
enum switchdev_obj_id id;
|
||||
};
|
||||
|
||||
/* SWITCHDEV_OBJ_ID_PORT_VLAN */
|
||||
@@ -131,14 +132,11 @@ struct switchdev_ops {
|
||||
struct switchdev_attr *attr,
|
||||
struct switchdev_trans *trans);
|
||||
int (*switchdev_port_obj_add)(struct net_device *dev,
|
||||
enum switchdev_obj_id id,
|
||||
const struct switchdev_obj *obj,
|
||||
struct switchdev_trans *trans);
|
||||
int (*switchdev_port_obj_del)(struct net_device *dev,
|
||||
enum switchdev_obj_id id,
|
||||
const struct switchdev_obj *obj);
|
||||
int (*switchdev_port_obj_dump)(struct net_device *dev,
|
||||
enum switchdev_obj_id id,
|
||||
struct switchdev_obj *obj,
|
||||
switchdev_obj_dump_cb_t *cb);
|
||||
};
|
||||
@@ -170,12 +168,11 @@ int switchdev_port_attr_get(struct net_device *dev,
|
||||
struct switchdev_attr *attr);
|
||||
int switchdev_port_attr_set(struct net_device *dev,
|
||||
struct switchdev_attr *attr);
|
||||
int switchdev_port_obj_add(struct net_device *dev, enum switchdev_obj_id id,
|
||||
int switchdev_port_obj_add(struct net_device *dev,
|
||||
const struct switchdev_obj *obj);
|
||||
int switchdev_port_obj_del(struct net_device *dev, enum switchdev_obj_id id,
|
||||
int switchdev_port_obj_del(struct net_device *dev,
|
||||
const struct switchdev_obj *obj);
|
||||
int switchdev_port_obj_dump(struct net_device *dev, enum switchdev_obj_id id,
|
||||
struct switchdev_obj *obj,
|
||||
int switchdev_port_obj_dump(struct net_device *dev, struct switchdev_obj *obj,
|
||||
switchdev_obj_dump_cb_t *cb);
|
||||
int register_switchdev_notifier(struct notifier_block *nb);
|
||||
int unregister_switchdev_notifier(struct notifier_block *nb);
|
||||
@@ -221,21 +218,18 @@ static inline int switchdev_port_attr_set(struct net_device *dev,
|
||||
}
|
||||
|
||||
static inline int switchdev_port_obj_add(struct net_device *dev,
|
||||
enum switchdev_obj_id id,
|
||||
const struct switchdev_obj *obj)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int switchdev_port_obj_del(struct net_device *dev,
|
||||
enum switchdev_obj_id id,
|
||||
const struct switchdev_obj *obj)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int switchdev_port_obj_dump(struct net_device *dev,
|
||||
enum switchdev_obj_id id,
|
||||
const struct switchdev_obj *obj,
|
||||
switchdev_obj_dump_cb_t *cb)
|
||||
{
|
||||
|
Reference in New Issue
Block a user