aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_3ad.c
diff options
context:
space:
mode:
authorJay Vosburgh <fubar@us.ibm.com>2006-03-27 16:27:43 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-29 17:34:02 -0500
commitff59c4563a8d1b39597aab4917959146c61f09b0 (patch)
tree5be8ad689d944f27a7b4b4bed2942c3ef47d7a98 /drivers/net/bonding/bond_3ad.c
parente21a2b0cc5849e76434b37aff3a4b502c772f191 (diff)
[PATCH] bonding: support carrier state for master
Add support for the bonding master to specify its carrier state based upon the state of the slaves. For 802.3ad, the bond is up if there is an active, parterned aggregator. For other modes, the bond is up if any slaves are up. Updates driver version to 3.0.3. Based on a patch by jamal <hadi@cyberus.ca>. Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r--drivers/net/bonding/bond_3ad.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index f3f5825469d6..6a407070c2e8 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2294,6 +2294,34 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
2294 port->sm_vars |= AD_PORT_BEGIN; 2294 port->sm_vars |= AD_PORT_BEGIN;
2295} 2295}
2296 2296
2297/*
2298 * set link state for bonding master: if we have an active partnered
2299 * aggregator, we're up, if not, we're down. Presumes that we cannot
2300 * have an active aggregator if there are no slaves with link up.
2301 *
2302 * Called by bond_set_carrier(). Return zero if carrier state does not
2303 * change, nonzero if it does.
2304 */
2305int bond_3ad_set_carrier(struct bonding *bond)
2306{
2307 struct aggregator *agg;
2308
2309 agg = __get_active_agg(&(SLAVE_AD_INFO(bond->first_slave).aggregator));
2310 if (agg && MAC_ADDRESS_COMPARE(&agg->partner_system, &null_mac_addr)) {
2311 if (!netif_carrier_ok(bond->dev)) {
2312 netif_carrier_on(bond->dev);
2313 return 1;
2314 }
2315 return 0;
2316 }
2317
2318 if (netif_carrier_ok(bond->dev)) {
2319 netif_carrier_off(bond->dev);
2320 return 1;
2321 }
2322 return 0;
2323}
2324
2297/** 2325/**
2298 * bond_3ad_get_active_agg_info - get information of the active aggregator 2326 * bond_3ad_get_active_agg_info - get information of the active aggregator
2299 * @bond: bonding struct to work on 2327 * @bond: bonding struct to work on