diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2011-05-06 23:22:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-12 18:40:56 -0400 |
commit | afe12cc86b0ba545a01ad8716539ab07ab6e9e89 (patch) | |
tree | edaa2912ae3acab49be8cfbfc75b689fdccd31f3 /net/core | |
parent | 6c60408e33aba6d1d7241bc9be3b8d1b39509291 (diff) |
net: introduce netdev_change_features()
It will be needed by bonding and other drivers changing vlan_features
after ndo_init callback.
As a bonus, this includes kernel-doc for netdev_update_features().
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 25 |
1 files changed, 25 insertions, 0 deletions
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 |