mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
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>
This commit is contained in:
parent
c6e970a04b
commit
96567d5dac
2 changed files with 50 additions and 2 deletions
|
|
@ -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[];
|
||||
|
|
|
|||
Loading…
Reference in a new issue