printk(KERN_ERR "bonding: Error: %s  Illegal value (link=%d)\n", slave->dev->name, slave->link); 
printk(KERN_ERR DRV_NAME ": %s: Error: %s Illegal value (link=%d)\n", bond_dev->name, slave->dev->name, slave->link); 
static void bond_mii_monitor(struct net_device *bond_dev){	struct bonding *bond = bond_dev->priv;	struct slave *slave, *oldcurrent;	int do_failover = 0;	int delta_in_ticks;	int i;	read_lock(&bond->lock);	delta_in_ticks = (bond->params.miimon * HZ) / 1000;	if (bond->kill_timers) {		goto out;	}	if (bond->slave_cnt == 0) {		goto re_arm;	}	/* we will try to read the link status of each of our slaves, and	 * set their IFF_RUNNING flag appropriately. For each slave not	 * supporting MII status, we won't do anything so that a user-space	 * program could monitor the link itself if needed.	 */	read_lock(&bond->curr_slave_lock);	oldcurrent = bond->curr_active_slave;	read_unlock(&bond->curr_slave_lock);	bond_for_each_slave(bond, slave, i) {		struct net_device *slave_dev = slave->dev;		int link_state;		u16 old_speed = slave->speed;		u8 old_duplex = slave->duplex;		link_state = bond_check_dev_link(bond, slave_dev, 0);		switch (slave->link) {		case BOND_LINK_UP:	/* the link was up */			if (link_state == BMSR_LSTATUS) {				/* link stays up, nothing more to do */				break;			} else { /* link going down */				slave->link  = BOND_LINK_FAIL;				slave->delay = bond->params.downdelay;				if (slave->link_failure_count < UINT_MAX) {					slave->link_failure_count++;				}				if (bond->params.downdelay) {					printk(KERN_INFO DRV_NAME					       ": %s: link status down for %s "					       "interface %s, disabling it in "					       "%d ms.\n",					       bond_dev->name,					       IS_UP(slave_dev)					       ? ((bond->params.mode == BOND_MODE_ACTIVEBACKUP)						  ? ((slave == oldcurrent)						     ? "active " : "backup ")						  : "")					       : "idle ",					       slave_dev->name,					       bond->params.downdelay * bond->params.miimon);				}			}			/* no break ! fall through the BOND_LINK_FAIL test to			   ensure proper action to be taken			*/		case BOND_LINK_FAIL:	/* the link has just gone down */			if (link_state != BMSR_LSTATUS) {				/* link stays down */				if (slave->delay <= 0) {					/* link down for too long time */					slave->link = BOND_LINK_DOWN;					/* in active/backup mode, we must					 * completely disable this interface					 */					if ((bond->params.mode == BOND_MODE_ACTIVEBACKUP) ||					    (bond->params.mode == BOND_MODE_8023AD)) {						bond_set_slave_inactive_flags(slave);					}					printk(KERN_INFO DRV_NAME					       ": %s: link status definitely "					       "down for interface %s, "					       "disabling it\n",					       bond_dev->name,					       slave_dev->name);					/* notify ad that the link status has changed */					if (bond->params.mode == BOND_MODE_8023AD) {						bond_3ad_handle_link_change(slave, BOND_LINK_DOWN);					}					if ((bond->params.mode == BOND_MODE_TLB) ||					    (bond->params.mode == BOND_MODE_ALB)) {						bond_alb_handle_link_change(bond, slave, BOND_LINK_DOWN);					}					if (slave == oldcurrent) {						do_failover = 1;					}				} else {					slave->delay--;				}			} else {				/* link up again */				slave->link  = BOND_LINK_UP;				slave->jiffies = jiffies;				printk(KERN_INFO DRV_NAME				       ": %s: link status up again after %d "				       "ms for interface %s.\n",				       bond_dev->name,				       (bond->params.downdelay - slave->delay) * bond->params.miimon,				       slave_dev->name);			}			break;		case BOND_LINK_DOWN:	/* the link was down */			if (link_state != BMSR_LSTATUS) {				/* the link stays down, nothing more to do */				break;			} else {	/* link going up */				slave->link  = BOND_LINK_BACK;				slave->delay = bond->params.updelay;				if (bond->params.updelay) {					/* if updelay == 0, no need to					   advertise about a 0 ms delay */					printk(KERN_INFO DRV_NAME					       ": %s: link status up for "					       "interface %s, enabling it "					       "in %d ms.\n",					       bond_dev->name,					       slave_dev->name,					       bond->params.updelay * bond->params.miimon);				}			}			/* no break ! fall through the BOND_LINK_BACK state in			   case there's something to do.			*/		case BOND_LINK_BACK:	/* the link has just come back */			if (link_state != BMSR_LSTATUS) {				/* link down again */				slave->link  = BOND_LINK_DOWN;				printk(KERN_INFO DRV_NAME				       ": %s: link status down again after %d "				       "ms for interface %s.\n",				       bond_dev->name,				       (bond->params.updelay - slave->delay) * bond->params.miimon,				       slave_dev->name);			} else {				/* link stays up */				if (slave->delay == 0) {					/* now the link has been up for long time enough */					slave->link = BOND_LINK_UP;					slave->jiffies = jiffies;					if (bond->params.mode == BOND_MODE_8023AD) {						/* prevent it from being the active one */						slave->state = BOND_STATE_BACKUP;					} else if (bond->params.mode != BOND_MODE_ACTIVEBACKUP) {						/* make it immediately active */						slave->state = BOND_STATE_ACTIVE;					} else if (slave != bond->primary_slave) {						/* prevent it from being the active one */						slave->state = BOND_STATE_BACKUP;					}					printk(KERN_INFO DRV_NAME					       ": %s: link status definitely "					       "up for interface %s.\n",					       bond_dev->name,					       slave_dev->name);					/* notify ad that the link status has changed */					if (bond->params.mode == BOND_MODE_8023AD) {						bond_3ad_handle_link_change(slave, BOND_LINK_UP);					}					if ((bond->params.mode == BOND_MODE_TLB) ||					    (bond->params.mode == BOND_MODE_ALB)) {						bond_alb_handle_link_change(bond, slave, BOND_LINK_UP);					}					if ((!oldcurrent) ||					    (slave == bond->primary_slave)) {						do_failover = 1;					}				} else {					slave->delay--;				}			}			break;		default:			/* Should not happen */			printk(KERN_ERR "bonding: Error: %s  Illegal value (link=%d)\n",			       slave->dev->name, slave->link);			goto out;		} /* end of switch (slave->link) */		bond_update_speed_duplex(slave);		if (bond->params.mode == BOND_MODE_8023AD) {			if (old_speed != slave->speed) {				bond_3ad_adapter_speed_changed(slave);			}			if (old_duplex != slave->duplex) {				bond_3ad_adapter_duplex_changed(slave);			}		}	} /* end of for */	if (do_failover) {		write_lock(&bond->curr_slave_lock);		bond_select_active_slave(bond);		if (oldcurrent && !bond->curr_active_slave) {			printk(KERN_INFO DRV_NAME			       ": %s: now running without any active "			       "interface !\n",			       bond_dev->name);		}		write_unlock(&bond->curr_slave_lock);	}re_arm:	if (bond->params.miimon) {		mod_timer(&bond->mii_timer, jiffies + delta_in_ticks);	}out:	read_unlock(&bond->lock);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/4e0952c74ee450ded86e8946ce58ea8dfd05b007/bond_main.c/clean/drivers/net/bonding/bond_main.c