net: pass info struct via netdevice notifier
So far, only net_device * could be passed along with netdevice notifier event. This patch provides a possibility to pass custom structure able to provide info that event listener needs to know. Signed-off-by: Jiri Pirko <jiri@resnulli.us> v2->v3: fix typo on simeth shortened dev_getter shortened notifier_info struct name v1->v2: fix notifier_call parameter in call_netdevice_notifier() Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
b1098bbe1b
commit
351638e7de
@@ -1599,6 +1599,19 @@ struct packet_offload {
|
||||
|
||||
extern int register_netdevice_notifier(struct notifier_block *nb);
|
||||
extern int unregister_netdevice_notifier(struct notifier_block *nb);
|
||||
|
||||
struct netdev_notifier_info {
|
||||
struct net_device *dev;
|
||||
};
|
||||
|
||||
static inline struct net_device *
|
||||
netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
|
||||
{
|
||||
return info->dev;
|
||||
}
|
||||
|
||||
extern int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
|
||||
struct netdev_notifier_info *info);
|
||||
extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user