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>
This commit is contained in:

committed by
David S. Miller

parent
aecbe01e74
commit
38dcf357ae
@@ -31,3 +31,22 @@ int netdev_switch_parent_id_get(struct net_device *dev,
|
||||
return ops->ndo_switch_parent_id_get(dev, psid);
|
||||
}
|
||||
EXPORT_SYMBOL(netdev_switch_parent_id_get);
|
||||
|
||||
/**
|
||||
* netdev_switch_port_stp_update - Notify switch device port of STP
|
||||
* state change
|
||||
* @dev: port device
|
||||
* @state: port STP state
|
||||
*
|
||||
* Notify switch device port of bridge port STP state change.
|
||||
*/
|
||||
int netdev_switch_port_stp_update(struct net_device *dev, u8 state)
|
||||
{
|
||||
const struct net_device_ops *ops = dev->netdev_ops;
|
||||
|
||||
if (!ops->ndo_switch_port_stp_update)
|
||||
return -EOPNOTSUPP;
|
||||
WARN_ON(!ops->ndo_switch_parent_id_get);
|
||||
return ops->ndo_switch_port_stp_update(dev, state);
|
||||
}
|
||||
EXPORT_SYMBOL(netdev_switch_port_stp_update);
|
||||
|
Reference in New Issue
Block a user