net core: Add protodown support.
[deliverable/linux.git] / net / core / dev.c
index 69445a33ace6583c91eedbde46c1d0d0193c8721..8810b6bbebfea237e33dc952e2ed4175a107fe72 100644 (file)
@@ -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
This page took 0.025676 seconds and 5 git commands to generate.