aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/netdevice.h1
-rw-r--r--net/core/dev.c19
2 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 6997f62cb6a0..ffbddd03242b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3673,6 +3673,7 @@ int dev_get_port_parent_id(struct net_device *dev,
3673 struct netdev_phys_item_id *ppid, bool recurse); 3673 struct netdev_phys_item_id *ppid, bool recurse);
3674bool netdev_port_same_parent_id(struct net_device *a, struct net_device *b); 3674bool netdev_port_same_parent_id(struct net_device *a, struct net_device *b);
3675int dev_change_proto_down(struct net_device *dev, bool proto_down); 3675int dev_change_proto_down(struct net_device *dev, bool proto_down);
3676int dev_change_proto_down_generic(struct net_device *dev, bool proto_down);
3676struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *dev, bool *again); 3677struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *dev, bool *again);
3677struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, 3678struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
3678 struct netdev_queue *txq, int *ret); 3679 struct netdev_queue *txq, int *ret);
diff --git a/net/core/dev.c b/net/core/dev.c
index 8a0da95ff4cc..2b67f2aa59dd 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7954,6 +7954,25 @@ int dev_change_proto_down(struct net_device *dev, bool proto_down)
7954} 7954}
7955EXPORT_SYMBOL(dev_change_proto_down); 7955EXPORT_SYMBOL(dev_change_proto_down);
7956 7956
7957/**
7958 * dev_change_proto_down_generic - generic implementation for
7959 * ndo_change_proto_down that sets carrier according to
7960 * proto_down.
7961 *
7962 * @dev: device
7963 * @proto_down: new value
7964 */
7965int dev_change_proto_down_generic(struct net_device *dev, bool proto_down)
7966{
7967 if (proto_down)
7968 netif_carrier_off(dev);
7969 else
7970 netif_carrier_on(dev);
7971 dev->proto_down = proto_down;
7972 return 0;
7973}
7974EXPORT_SYMBOL(dev_change_proto_down_generic);
7975
7957u32 __dev_xdp_query(struct net_device *dev, bpf_op_t bpf_op, 7976u32 __dev_xdp_query(struct net_device *dev, bpf_op_t bpf_op,
7958 enum bpf_netdev_command cmd) 7977 enum bpf_netdev_command cmd)
7959{ 7978{