aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorPatrick Mullaney <pmullaney@novell.com>2009-12-03 18:59:22 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-03 18:59:22 -0500
commitfc4a7489663250360cd40d5adf06a08d1c5d54df (patch)
treece8fed0a2dfc175b03834bb94717f5f2970c9146 /net/core
parent012093f6d5d89e6ed6e89c55c383f84b1cff7a78 (diff)
netdevice: provide common routine for macvlan and vlan operstate management
Provide common routine for the transition of operational state for a leaf device during a root device transition. Signed-off-by: Patrick Mullaney <pmullaney@novell.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 0913a08a87d6..c36a17aafcf3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4901,6 +4901,33 @@ unsigned long netdev_fix_features(unsigned long features, const char *name)
4901EXPORT_SYMBOL(netdev_fix_features); 4901EXPORT_SYMBOL(netdev_fix_features);
4902 4902
4903/** 4903/**
4904 * netif_stacked_transfer_operstate - transfer operstate
4905 * @rootdev: the root or lower level device to transfer state from
4906 * @dev: the device to transfer operstate to
4907 *
4908 * Transfer operational state from root to device. This is normally
4909 * called when a stacking relationship exists between the root
4910 * device and the device(a leaf device).
4911 */
4912void netif_stacked_transfer_operstate(const struct net_device *rootdev,
4913 struct net_device *dev)
4914{
4915 if (rootdev->operstate == IF_OPER_DORMANT)
4916 netif_dormant_on(dev);
4917 else
4918 netif_dormant_off(dev);
4919
4920 if (netif_carrier_ok(rootdev)) {
4921 if (!netif_carrier_ok(dev))
4922 netif_carrier_on(dev);
4923 } else {
4924 if (netif_carrier_ok(dev))
4925 netif_carrier_off(dev);
4926 }
4927}
4928EXPORT_SYMBOL(netif_stacked_transfer_operstate);
4929
4930/**
4904 * register_netdevice - register a network device 4931 * register_netdevice - register a network device
4905 * @dev: device to register 4932 * @dev: device to register
4906 * 4933 *