diff options
| -rw-r--r-- | include/linux/netdevice.h | 1 | ||||
| -rw-r--r-- | net/core/dev.c | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 00d650c74800..1d9696a9ee4d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -2565,6 +2565,7 @@ u32 netdev_increment_features(u32 all, u32 one, u32 mask); | |||
| 2565 | u32 netdev_fix_features(struct net_device *dev, u32 features); | 2565 | u32 netdev_fix_features(struct net_device *dev, u32 features); |
| 2566 | int __netdev_update_features(struct net_device *dev); | 2566 | int __netdev_update_features(struct net_device *dev); |
| 2567 | void netdev_update_features(struct net_device *dev); | 2567 | void netdev_update_features(struct net_device *dev); |
| 2568 | void netdev_change_features(struct net_device *dev); | ||
| 2568 | 2569 | ||
| 2569 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, | 2570 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, |
| 2570 | struct net_device *dev); | 2571 | struct net_device *dev); |
diff --git a/net/core/dev.c b/net/core/dev.c index 75898a32c038..ea23353e6251 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -5289,6 +5289,14 @@ int __netdev_update_features(struct net_device *dev) | |||
| 5289 | return 1; | 5289 | return 1; |
| 5290 | } | 5290 | } |
| 5291 | 5291 | ||
| 5292 | /** | ||
| 5293 | * netdev_update_features - recalculate device features | ||
| 5294 | * @dev: the device to check | ||
| 5295 | * | ||
| 5296 | * Recalculate dev->features set and send notifications if it | ||
| 5297 | * has changed. Should be called after driver or hardware dependent | ||
| 5298 | * conditions might have changed that influence the features. | ||
| 5299 | */ | ||
| 5292 | void netdev_update_features(struct net_device *dev) | 5300 | void netdev_update_features(struct net_device *dev) |
| 5293 | { | 5301 | { |
| 5294 | if (__netdev_update_features(dev)) | 5302 | if (__netdev_update_features(dev)) |
| @@ -5297,6 +5305,23 @@ void netdev_update_features(struct net_device *dev) | |||
| 5297 | EXPORT_SYMBOL(netdev_update_features); | 5305 | EXPORT_SYMBOL(netdev_update_features); |
| 5298 | 5306 | ||
| 5299 | /** | 5307 | /** |
| 5308 | * netdev_change_features - recalculate device features | ||
| 5309 | * @dev: the device to check | ||
| 5310 | * | ||
| 5311 | * Recalculate dev->features set and send notifications even | ||
| 5312 | * if they have not changed. Should be called instead of | ||
| 5313 | * netdev_update_features() if also dev->vlan_features might | ||
| 5314 | * have changed to allow the changes to be propagated to stacked | ||
| 5315 | * VLAN devices. | ||
| 5316 | */ | ||
| 5317 | void netdev_change_features(struct net_device *dev) | ||
| 5318 | { | ||
| 5319 | __netdev_update_features(dev); | ||
| 5320 | netdev_features_change(dev); | ||
| 5321 | } | ||
| 5322 | EXPORT_SYMBOL(netdev_change_features); | ||
| 5323 | |||
| 5324 | /** | ||
| 5300 | * netif_stacked_transfer_operstate - transfer operstate | 5325 | * netif_stacked_transfer_operstate - transfer operstate |
| 5301 | * @rootdev: the root or lower level device to transfer state from | 5326 | * @rootdev: the root or lower level device to transfer state from |
| 5302 | * @dev: the device to transfer operstate to | 5327 | * @dev: the device to transfer operstate to |
