summaryrefslogtreecommitdiff
path: root/include/net/switchdev.h
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2015-09-29 19:07:16 +0300
committerDavid S. Miller <davem@davemloft.net>2015-09-30 07:31:59 +0300
commit25f07adc473f05f850efc9414b9da3374563015f (patch)
treeff62d9a8e9c63c48abd034b61156c55c6437a36e /include/net/switchdev.h
parent03d5fb18626aff95426a380aef0d1c6904cac7c9 (diff)
downloadlinux-25f07adc473f05f850efc9414b9da3374563015f.tar.xz
net: switchdev: pass callback to dump operation
Similar to the notifier_call callback of a notifier_block, change the function signature of switchdev dump operation to: int switchdev_port_obj_dump(struct net_device *dev, enum switchdev_obj_id id, void *obj, int (*cb)(void *obj)); This allows the caller to pass and expect back a specific switchdev_obj_* structure instead of the generic switchdev_obj one. Drivers implementation of dump operation can now expect this specific structure and call the callback with it. Drivers have been changed accordingly. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/switchdev.h')
-rw-r--r--include/net/switchdev.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 9ef7c5635769..a2f57fb5f622 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -120,7 +120,8 @@ struct switchdev_ops {
int (*switchdev_port_obj_del)(struct net_device *dev,
struct switchdev_obj *obj);
int (*switchdev_port_obj_dump)(struct net_device *dev,
- struct switchdev_obj *obj);
+ enum switchdev_obj_id id, void *obj,
+ int (*cb)(void *obj));
};
enum switchdev_notifier_type {
@@ -152,7 +153,8 @@ int switchdev_port_attr_set(struct net_device *dev,
struct switchdev_attr *attr);
int switchdev_port_obj_add(struct net_device *dev, struct switchdev_obj *obj);
int switchdev_port_obj_del(struct net_device *dev, struct switchdev_obj *obj);
-int switchdev_port_obj_dump(struct net_device *dev, struct switchdev_obj *obj);
+int switchdev_port_obj_dump(struct net_device *dev, enum switchdev_obj_id id,
+ void *obj, int (*cb)(void *obj));
int register_switchdev_notifier(struct notifier_block *nb);
int unregister_switchdev_notifier(struct notifier_block *nb);
int call_switchdev_notifiers(unsigned long val, struct net_device *dev,
@@ -209,7 +211,8 @@ static inline int switchdev_port_obj_del(struct net_device *dev,
}
static inline int switchdev_port_obj_dump(struct net_device *dev,
- struct switchdev_obj *obj)
+ enum switchdev_obj_id id, void *obj,
+ int (*cb)(void *obj))
{
return -EOPNOTSUPP;
}