aboutsummaryrefslogtreecommitdiffstats
path: root/net/switchdev
diff options
context:
space:
mode:
authorScott Feldman <sfeldma@gmail.com>2014-11-28 08:34:20 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-02 23:01:22 -0500
commit38dcf357aed299186ecb090cc2f5290cc17d637d (patch)
treea5fa0ef8464099c4aad79bd67d1e23759ad8e6c4 /net/switchdev
parentaecbe01e7410ad2de022796472f531ae6941f15e (diff)
bridge: call netdev_sw_port_stp_update when bridge port STP status changes
To notify switch driver of change in STP state of bridge port, add new .ndo op and provide switchdev wrapper func to call ndo op. Use it in bridge code then. Signed-off-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com> Acked-by: Thomas Graf <tgraf@suug.ch> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev')
-rw-r--r--net/switchdev/switchdev.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 66973deaae56..d162b21b14bd 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -31,3 +31,22 @@ int netdev_switch_parent_id_get(struct net_device *dev,
31 return ops->ndo_switch_parent_id_get(dev, psid); 31 return ops->ndo_switch_parent_id_get(dev, psid);
32} 32}
33EXPORT_SYMBOL(netdev_switch_parent_id_get); 33EXPORT_SYMBOL(netdev_switch_parent_id_get);
34
35/**
36 * netdev_switch_port_stp_update - Notify switch device port of STP
37 * state change
38 * @dev: port device
39 * @state: port STP state
40 *
41 * Notify switch device port of bridge port STP state change.
42 */
43int netdev_switch_port_stp_update(struct net_device *dev, u8 state)
44{
45 const struct net_device_ops *ops = dev->netdev_ops;
46
47 if (!ops->ndo_switch_port_stp_update)
48 return -EOPNOTSUPP;
49 WARN_ON(!ops->ndo_switch_parent_id_get);
50 return ops->ndo_switch_port_stp_update(dev, state);
51}
52EXPORT_SYMBOL(netdev_switch_port_stp_update);