diff options
Diffstat (limited to 'net/switchdev/switchdev.c')
-rw-r--r-- | net/switchdev/switchdev.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 74b9d916a58b..e109bb97ce3f 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c | |||
@@ -535,6 +535,7 @@ int switchdev_port_obj_del(struct net_device *dev, | |||
535 | EXPORT_SYMBOL_GPL(switchdev_port_obj_del); | 535 | EXPORT_SYMBOL_GPL(switchdev_port_obj_del); |
536 | 536 | ||
537 | static ATOMIC_NOTIFIER_HEAD(switchdev_notif_chain); | 537 | static ATOMIC_NOTIFIER_HEAD(switchdev_notif_chain); |
538 | static BLOCKING_NOTIFIER_HEAD(switchdev_blocking_notif_chain); | ||
538 | 539 | ||
539 | /** | 540 | /** |
540 | * register_switchdev_notifier - Register notifier | 541 | * register_switchdev_notifier - Register notifier |
@@ -576,6 +577,31 @@ int call_switchdev_notifiers(unsigned long val, struct net_device *dev, | |||
576 | } | 577 | } |
577 | EXPORT_SYMBOL_GPL(call_switchdev_notifiers); | 578 | EXPORT_SYMBOL_GPL(call_switchdev_notifiers); |
578 | 579 | ||
580 | int register_switchdev_blocking_notifier(struct notifier_block *nb) | ||
581 | { | ||
582 | struct blocking_notifier_head *chain = &switchdev_blocking_notif_chain; | ||
583 | |||
584 | return blocking_notifier_chain_register(chain, nb); | ||
585 | } | ||
586 | EXPORT_SYMBOL_GPL(register_switchdev_blocking_notifier); | ||
587 | |||
588 | int unregister_switchdev_blocking_notifier(struct notifier_block *nb) | ||
589 | { | ||
590 | struct blocking_notifier_head *chain = &switchdev_blocking_notif_chain; | ||
591 | |||
592 | return blocking_notifier_chain_unregister(chain, nb); | ||
593 | } | ||
594 | EXPORT_SYMBOL_GPL(unregister_switchdev_blocking_notifier); | ||
595 | |||
596 | int call_switchdev_blocking_notifiers(unsigned long val, struct net_device *dev, | ||
597 | struct switchdev_notifier_info *info) | ||
598 | { | ||
599 | info->dev = dev; | ||
600 | return blocking_notifier_call_chain(&switchdev_blocking_notif_chain, | ||
601 | val, info); | ||
602 | } | ||
603 | EXPORT_SYMBOL_GPL(call_switchdev_blocking_notifiers); | ||
604 | |||
579 | bool switchdev_port_same_parent_id(struct net_device *a, | 605 | bool switchdev_port_same_parent_id(struct net_device *a, |
580 | struct net_device *b) | 606 | struct net_device *b) |
581 | { | 607 | { |