diff options
author | Horatiu Vultur <horatiu.vultur@microchip.com> | 2020-07-14 09:34:52 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-14 13:46:42 -0700 |
commit | 4139d4b51a462135d6368e80a9314b57e57279f2 (patch) | |
tree | ce5c5c8d85c666a52e38bbc15c694bc39584b2c0 /net/bridge/br_mrp_netlink.c | |
parent | 4cc625c63a9274f28f05d5be39a2cbeb48cbfed5 (diff) | |
download | linux-4139d4b51a462135d6368e80a9314b57e57279f2.tar.bz2 |
bridge: mrp: Add br_mrp_in_port_open function
This function notifies the userspace when the node lost the continuity
of MRP_InTest frames.
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_mrp_netlink.c')
-rw-r--r-- | net/bridge/br_mrp_netlink.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/net/bridge/br_mrp_netlink.c b/net/bridge/br_mrp_netlink.c index acce300c0cc2..4bf7aaeb2915 100644 --- a/net/bridge/br_mrp_netlink.c +++ b/net/bridge/br_mrp_netlink.c @@ -389,3 +389,25 @@ int br_mrp_ring_port_open(struct net_device *dev, u8 loc) out: return err; } + +int br_mrp_in_port_open(struct net_device *dev, u8 loc) +{ + struct net_bridge_port *p; + int err = 0; + + p = br_port_get_rcu(dev); + if (!p) { + err = -EINVAL; + goto out; + } + + if (loc) + p->flags |= BR_MRP_LOST_IN_CONT; + else + p->flags &= ~BR_MRP_LOST_IN_CONT; + + br_ifinfo_notify(RTM_NEWLINK, NULL, p); + +out: + return err; +} |