summaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorAndrew Lunn2017-03-28 23:45:07 +0200
committerDavid S. Miller2017-03-29 07:46:04 +0200
commit96567d5dacf47fd628bc3115c8a7d81866674cd3 (patch)
tree97674d9de953c26b4ba9b723cdfc4d99af02dfc7 /include/net/dsa.h
parentnet: break include loop netdevice.h, dsa.h, devlink.h (diff)
downloadkernel-qcow2-linux-96567d5dacf47fd628bc3115c8a7d81866674cd3.tar.gz
kernel-qcow2-linux-96567d5dacf47fd628bc3115c8a7d81866674cd3.tar.xz
kernel-qcow2-linux-96567d5dacf47fd628bc3115c8a7d81866674cd3.zip
net: dsa: dsa2: Add basic support of devlink
Register the switch and its ports with devlink. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Tested-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index f80e81912b83..951b5e49e899 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -19,6 +19,7 @@
#include <linux/workqueue.h>
#include <linux/of.h>
#include <linux/ethtool.h>
+#include <net/devlink.h>
struct tc_action;
struct phy_device;
@@ -182,6 +183,7 @@ struct dsa_port {
unsigned int ageing_time;
u8 stp_state;
struct net_device *bridge_dev;
+ struct devlink_port devlink_port;
};
struct dsa_switch {
@@ -237,6 +239,9 @@ struct dsa_switch {
unsigned int ageing_time_min;
unsigned int ageing_time_max;
+ /* devlink used to represent this switch device */
+ struct devlink *devlink;
+
/* Dynamically allocated ports, keep last */
size_t num_ports;
struct dsa_port ports[];