net core: Add protodown support.
This patch introduces the proto_down flag that can be used by user space applications to notify switch drivers that errors have been detected on the device. The switch driver can react to protodown notification by doing a phys down on the associated switch port. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
07e6a97da1
commit
d746d707a8
@@ -6074,6 +6074,26 @@ int dev_get_phys_port_name(struct net_device *dev,
|
||||
}
|
||||
EXPORT_SYMBOL(dev_get_phys_port_name);
|
||||
|
||||
/**
|
||||
* dev_change_proto_down - update protocol port state information
|
||||
* @dev: device
|
||||
* @proto_down: new value
|
||||
*
|
||||
* This info can be used by switch drivers to set the phys state of the
|
||||
* port.
|
||||
*/
|
||||
int dev_change_proto_down(struct net_device *dev, bool proto_down)
|
||||
{
|
||||
const struct net_device_ops *ops = dev->netdev_ops;
|
||||
|
||||
if (!ops->ndo_change_proto_down)
|
||||
return -EOPNOTSUPP;
|
||||
if (!netif_device_present(dev))
|
||||
return -ENODEV;
|
||||
return ops->ndo_change_proto_down(dev, proto_down);
|
||||
}
|
||||
EXPORT_SYMBOL(dev_change_proto_down);
|
||||
|
||||
/**
|
||||
* dev_new_index - allocate an ifindex
|
||||
* @net: the applicable net namespace
|
||||
|
||||
Reference in New Issue
Block a user