net: remove .ndo_change_proto_down
.ndo_change_proto_down was added seemingly to enable out-of-tree implementations. Over 2.5yrs later we still have no real users upstream. Hardwire the generic implementation for now, we can revert once real users materialize. (rocker is a test vehicle, not a user.) We need to drop the optimization on the sysfs side, because unlike ndos priv_flags will be changed at runtime, so we'd need READ_ONCE/WRITE_ONCE everywhere.. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
c384cee14a
commit
2106efda78
@@ -8558,35 +8558,17 @@ bool netdev_port_same_parent_id(struct net_device *a, struct net_device *b)
|
||||
EXPORT_SYMBOL(netdev_port_same_parent_id);
|
||||
|
||||
/**
|
||||
* dev_change_proto_down - update protocol port state information
|
||||
* dev_change_proto_down - set carrier according to proto_down.
|
||||
*
|
||||
* @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)
|
||||
if (!(dev->priv_flags & IFF_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_change_proto_down_generic - generic implementation for
|
||||
* ndo_change_proto_down that sets carrier according to
|
||||
* proto_down.
|
||||
*
|
||||
* @dev: device
|
||||
* @proto_down: new value
|
||||
*/
|
||||
int dev_change_proto_down_generic(struct net_device *dev, bool proto_down)
|
||||
{
|
||||
if (proto_down)
|
||||
netif_carrier_off(dev);
|
||||
else
|
||||
@@ -8594,7 +8576,7 @@ int dev_change_proto_down_generic(struct net_device *dev, bool proto_down)
|
||||
dev->proto_down = proto_down;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(dev_change_proto_down_generic);
|
||||
EXPORT_SYMBOL(dev_change_proto_down);
|
||||
|
||||
/**
|
||||
* dev_change_proto_down_reason - proto down reason
|
||||
|
||||
Reference in New Issue
Block a user