aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2011-02-12 01:48:36 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-13 13:42:07 -0500
commit1765a575334f1a232c1478accdee5c7d19f4b3e3 (patch)
tree6613f53ce9095b799048d891f0b4b6e34a479fe0 /drivers/net/bonding
parentd59cfde2fb960b5970ccb5a38cea25d38b37a8e8 (diff)
net: make dev->master general
dev->master is now tightly connected to bonding driver. This patch makes this pointer more general and ready to be used by others. - netdev_set_master() - bond specifics moved to new function netdev_set_bond_master() - introduced netif_is_bond_slave() to check if device is a bonding slave Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 1df9f0ea9184..9f877878d636 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1594,9 +1594,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1594 } 1594 }
1595 } 1595 }
1596 1596
1597 res = netdev_set_master(slave_dev, bond_dev); 1597 res = netdev_set_bond_master(slave_dev, bond_dev);
1598 if (res) { 1598 if (res) {
1599 pr_debug("Error %d calling netdev_set_master\n", res); 1599 pr_debug("Error %d calling netdev_set_bond_master\n", res);
1600 goto err_restore_mac; 1600 goto err_restore_mac;
1601 } 1601 }
1602 /* open the slave since the application closed it */ 1602 /* open the slave since the application closed it */
@@ -1812,7 +1812,7 @@ err_close:
1812 dev_close(slave_dev); 1812 dev_close(slave_dev);
1813 1813
1814err_unset_master: 1814err_unset_master:
1815 netdev_set_master(slave_dev, NULL); 1815 netdev_set_bond_master(slave_dev, NULL);
1816 1816
1817err_restore_mac: 1817err_restore_mac:
1818 if (!bond->params.fail_over_mac) { 1818 if (!bond->params.fail_over_mac) {
@@ -1992,7 +1992,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1992 netif_addr_unlock_bh(bond_dev); 1992 netif_addr_unlock_bh(bond_dev);
1993 } 1993 }
1994 1994
1995 netdev_set_master(slave_dev, NULL); 1995 netdev_set_bond_master(slave_dev, NULL);
1996 1996
1997#ifdef CONFIG_NET_POLL_CONTROLLER 1997#ifdef CONFIG_NET_POLL_CONTROLLER
1998 read_lock_bh(&bond->lock); 1998 read_lock_bh(&bond->lock);
@@ -2114,7 +2114,7 @@ static int bond_release_all(struct net_device *bond_dev)
2114 netif_addr_unlock_bh(bond_dev); 2114 netif_addr_unlock_bh(bond_dev);
2115 } 2115 }
2116 2116
2117 netdev_set_master(slave_dev, NULL); 2117 netdev_set_bond_master(slave_dev, NULL);
2118 2118
2119 /* close slave before restoring its mac address */ 2119 /* close slave before restoring its mac address */
2120 dev_close(slave_dev); 2120 dev_close(slave_dev);