-/*
- * Set the carrier state for the master according to the state of its
- * slaves. If any slaves are up, the master is up. In 802.3ad mode,
- * do special 802.3ad magic.
- *
- * Returns zero if carrier state does not change, nonzero if it does.
- */
-static int bond_set_carrier(struct bonding *bond)
-{
- struct slave *slave;
- int i;
-
- if (bond->slave_cnt == 0)
- goto down;
-
- if (bond->params.mode == BOND_MODE_8023AD)
- return bond_3ad_set_carrier(bond);
-
- bond_for_each_slave(bond, slave, i) {
- if (slave->link == BOND_LINK_UP) {
- if (!netif_carrier_ok(bond->dev)) {
- netif_carrier_on(bond->dev);
- return 1;
- }
- return 0;
- }
- }
-
-down:
- if (netif_carrier_ok(bond->dev)) {
- netif_carrier_off(bond->dev);
- return 1;
- }
- return 0;
-}
-