"was reset to BOND_DEFAULT_MAX_BONDS (%d)", 
"was reset to BOND_DEFAULT_MAX_BONDS (%d)\n", 
static int bond_check_params(struct bond_params *params){	/*	 * Convert string parameters.	 */	if (mode) {		bond_mode = bond_parse_parm(mode, bond_mode_tbl);		if (bond_mode == -1) {			printk(KERN_ERR DRV_NAME			       ": Error: Invalid bonding mode \"%s\"\n",			       mode == NULL ? "NULL" : mode);			return -EINVAL;		}	}	if (xmit_hash_policy) {		if ((bond_mode != BOND_MODE_XOR) &&		    (bond_mode != BOND_MODE_8023AD)) {			printk(KERN_INFO DRV_NAME			       ": xor_mode param is irrelevant in mode %s\n",			       bond_mode_name(bond_mode));		} else {			xmit_hashtype = bond_parse_parm(xmit_hash_policy,							xmit_hashtype_tbl);			if (xmit_hashtype == -1) {				printk(KERN_ERR DRV_NAME			       	": Error: Invalid xmit_hash_policy \"%s\"\n",			       	xmit_hash_policy == NULL ? "NULL" :				       xmit_hash_policy);				return -EINVAL;			}		}	}	if (lacp_rate) {		if (bond_mode != BOND_MODE_8023AD) {			printk(KERN_INFO DRV_NAME			       ": lacp_rate param is irrelevant in mode %s\n",			       bond_mode_name(bond_mode));		} else {			lacp_fast = bond_parse_parm(lacp_rate, bond_lacp_tbl);			if (lacp_fast == -1) {				printk(KERN_ERR DRV_NAME				       ": Error: Invalid lacp rate \"%s\"\n",				       lacp_rate == NULL ? "NULL" : lacp_rate);				return -EINVAL;			}		}	}	if (max_bonds < 1 || max_bonds > INT_MAX) {		printk(KERN_WARNING DRV_NAME		       ": Warning: max_bonds (%d) not in range %d-%d, so it "		       "was reset to BOND_DEFAULT_MAX_BONDS (%d)",		       max_bonds, 1, INT_MAX, BOND_DEFAULT_MAX_BONDS);		max_bonds = BOND_DEFAULT_MAX_BONDS;	}	if (miimon < 0) {		printk(KERN_WARNING DRV_NAME		       ": Warning: miimon module parameter (%d), "		       "not in range 0-%d, so it was reset to %d\n",		       miimon, INT_MAX, BOND_LINK_MON_INTERV);		miimon = BOND_LINK_MON_INTERV;	}	if (updelay < 0) {		printk(KERN_WARNING DRV_NAME		       ": Warning: updelay module parameter (%d), "		       "not in range 0-%d, so it was reset to 0\n",		       updelay, INT_MAX);		updelay = 0;	}	if (downdelay < 0) {		printk(KERN_WARNING DRV_NAME		       ": Warning: downdelay module parameter (%d), "		       "not in range 0-%d, so it was reset to 0\n",		       downdelay, INT_MAX);		downdelay = 0;	}	if ((use_carrier != 0) && (use_carrier != 1)) {		printk(KERN_WARNING DRV_NAME		       ": Warning: use_carrier module parameter (%d), "		       "not of valid value (0/1), so it was set to 1\n",		       use_carrier);		use_carrier = 1;	}	/* reset values for 802.3ad */	if (bond_mode == BOND_MODE_8023AD) {		if (!miimon) {			printk(KERN_WARNING DRV_NAME			       ": Warning: miimon must be specified, "			       "otherwise bonding will not detect link "			       "failure, speed and duplex which are "			       "essential for 802.3ad operation\n");			printk(KERN_WARNING "Forcing miimon to 100msec\n");			miimon = 100;		}	}	/* reset values for TLB/ALB */	if ((bond_mode == BOND_MODE_TLB) ||	    (bond_mode == BOND_MODE_ALB)) {		if (!miimon) {			printk(KERN_WARNING DRV_NAME			       ": Warning: miimon must be specified, "			       "otherwise bonding will not detect link "			       "failure and link speed which are essential "			       "for TLB/ALB load balancing\n");			printk(KERN_WARNING "Forcing miimon to 100msec\n");			miimon = 100;		}	}	if (bond_mode == BOND_MODE_ALB) {		printk(KERN_NOTICE DRV_NAME		       ": In ALB mode you might experience client "		       "disconnections upon reconnection of a link if the "		       "bonding module updelay parameter (%d msec) is "		       "incompatible with the forwarding delay time of the "		       "switch\n",		       updelay);	}	if (!miimon) {		if (updelay || downdelay) {			/* just warn the user the up/down delay will have			 * no effect since miimon is zero...			 */			printk(KERN_WARNING DRV_NAME			       ": Warning: miimon module parameter not set "			       "and updelay (%d) or downdelay (%d) module "			       "parameter is set; updelay and downdelay have "			       "no effect unless miimon is set\n",			       updelay, downdelay);		}	} else {		/* don't allow arp monitoring */		if (arp_interval) {			printk(KERN_WARNING DRV_NAME			       ": Warning: miimon (%d) and arp_interval (%d) "			       "can't be used simultaneously, disabling ARP "			       "monitoring\n",			       miimon, arp_interval);			arp_interval = 0;		}		if ((updelay % miimon) != 0) {			printk(KERN_WARNING DRV_NAME			       ": Warning: updelay (%d) is not a multiple "			       "of miimon (%d), updelay rounded to %d ms\n",			       updelay, miimon, (updelay / miimon) * miimon);		}		updelay /= miimon;		if ((downdelay % miimon) != 0) {			printk(KERN_WARNING DRV_NAME			       ": Warning: downdelay (%d) is not a multiple "			       "of miimon (%d), downdelay rounded to %d ms\n",			       downdelay, miimon,			       (downdelay / miimon) * miimon);		}		downdelay /= miimon;	}	if (arp_interval < 0) {		printk(KERN_WARNING DRV_NAME		       ": Warning: arp_interval module parameter (%d) "		       ", not in range 0-%d, so it was reset to %d\n",		       arp_interval, INT_MAX, BOND_LINK_ARP_INTERV);		arp_interval = BOND_LINK_ARP_INTERV;	}	for (arp_ip_count = 0;	     (arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[arp_ip_count];	     arp_ip_count++) {		/* not complete check, but should be good enough to		   catch mistakes */		if (!isdigit(arp_ip_target[arp_ip_count][0])) {			printk(KERN_WARNING DRV_NAME			       ": Warning: bad arp_ip_target module parameter "			       "(%s), ARP monitoring will not be performed\n",			       arp_ip_target[arp_ip_count]);			arp_interval = 0;		} else {			u32 ip = in_aton(arp_ip_target[arp_ip_count]);			arp_target[arp_ip_count] = ip;		}	}	if (arp_interval && !arp_ip_count) {		/* don't allow arping if no arp_ip_target given... */		printk(KERN_WARNING DRV_NAME		       ": Warning: arp_interval module parameter (%d) "		       "specified without providing an arp_ip_target "		       "parameter, arp_interval was reset to 0\n",		       arp_interval);		arp_interval = 0;	}	if (miimon) {		printk(KERN_INFO DRV_NAME		       ": MII link monitoring set to %d ms\n",		       miimon);	} else if (arp_interval) {		int i;		printk(KERN_INFO DRV_NAME		       ": ARP monitoring set to %d ms with %d target(s):",		       arp_interval, arp_ip_count);		for (i = 0; i < arp_ip_count; i++)			printk (" %s", arp_ip_target[i]);		printk("\n");	} else {		/* miimon and arp_interval not set, we need one so things		 * work as expected, see bonding.txt for details		 */		printk(KERN_WARNING DRV_NAME		       ": Warning: either miimon or arp_interval and "		       "arp_ip_target module parameters must be specified, "		       "otherwise bonding will not detect link failures! see "		       "bonding.txt for details.\n");	}	if (primary && !USES_PRIMARY(bond_mode)) {		/* currently, using a primary only makes sense		 * in active backup, TLB or ALB modes		 */		printk(KERN_WARNING DRV_NAME		       ": Warning: %s primary device specified but has no "		       "effect in %s mode\n",		       primary, bond_mode_name(bond_mode));		primary = NULL;	}	/* fill params struct with the proper values */	params->mode = bond_mode;	params->xmit_policy = xmit_hashtype;	params->miimon = miimon;	params->arp_interval = arp_interval;	params->updelay = updelay;	params->downdelay = downdelay;	params->use_carrier = use_carrier;	params->lacp_fast = lacp_fast;	params->primary[0] = 0;	if (primary) {		strncpy(params->primary, primary, IFNAMSIZ);		params->primary[IFNAMSIZ - 1] = 0;	}	memcpy(params->arp_targets, arp_target, sizeof(arp_target));	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/4e0952c74ee450ded86e8946ce58ea8dfd05b007/bond_main.c/clean/drivers/net/bonding/bond_main.c