summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2015-10-01 11:03:46 +0200
committerDavid S. Miller <davem@davemloft.net>2015-10-03 04:49:40 -0700
commit9e8f4a548ab4710002c23c94c4b1bbde91b5e335 (patch)
treec2fe29079ccd3dd3a5218ad966ed0bab047d5e69 /include
parent648b4a995a057187ddd77cdb181e6a0b24ab2959 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/net/switchdev.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 3e1bd14cc0ab..89266a3e473d 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -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)
{