summaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorVivien Didelot2017-02-03 19:20:20 +0100
committerDavid S. Miller2017-02-06 22:53:29 +0100
commitf515f192ab4f45bb695146b82432d63d98775787 (patch)
tree5a6fddcbb34e28e6850e63d3023504b46e5ea9c3 /include/net/dsa.h
parentnet: dsa: change state setter scope (diff)
downloadkernel-qcow2-linux-f515f192ab4f45bb695146b82432d63d98775787.tar.gz
kernel-qcow2-linux-f515f192ab4f45bb695146b82432d63d98775787.tar.xz
kernel-qcow2-linux-f515f192ab4f45bb695146b82432d63d98775787.zip
net: dsa: add switch notifier
Add a notifier block per DSA switch, registered against a notifier head in the switch fabric they belong to. This infrastructure will allow to propagate fabric-wide events such as port bridging, VLAN configuration, etc. If a DSA switch driver cares about cross-chip configuration, such events can be caught. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 2cb77e64d648..ac4ea7c3a102 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -13,6 +13,7 @@
#include <linux/if_ether.h>
#include <linux/list.h>
+#include <linux/notifier.h>
#include <linux/timer.h>
#include <linux/workqueue.h>
#include <linux/of.h>
@@ -92,6 +93,9 @@ struct packet_type;
struct dsa_switch_tree {
struct list_head list;
+ /* Notifier chain for switch-wide events */
+ struct raw_notifier_head nh;
+
/* Tree identifier */
u32 tree;
@@ -182,6 +186,9 @@ struct dsa_switch {
struct dsa_switch_tree *dst;
int index;
+ /* Listener for switch fabric events */
+ struct notifier_block nb;
+
/*
* Give the switch driver somewhere to hang its private data
* structure.