printk(KERN_WARNING DRV_NAME ": Trying to unbind an uninitialized port on %s\n", slave->dev->name); 
printk(KERN_WARNING DRV_NAME ": Warning: %s: Trying to " "unbind an uninitialized port on %s\n", slave->dev->master->name, slave->dev->name); 
void bond_3ad_unbind_slave(struct slave *slave){	struct port *port, *prev_port, *temp_port;	struct aggregator *aggregator, *new_aggregator, *temp_aggregator;	int select_new_active_agg = 0;		// find the aggregator related to this slave	aggregator = &(SLAVE_AD_INFO(slave).aggregator);	// find the port related to this slave	port = &(SLAVE_AD_INFO(slave).port);	// if slave is null, the whole port is not initialized	if (!port->slave) {		printk(KERN_WARNING DRV_NAME ": Trying to unbind an uninitialized port on %s\n", slave->dev->name);		return;	}	dprintk("Unbinding Link Aggregation Group %d\n", aggregator->aggregator_identifier);	/* Tell the partner that this port is not suitable for aggregation */	port->actor_oper_port_state &= ~AD_STATE_AGGREGATION;	__update_lacpdu_from_port(port);	ad_lacpdu_send(port);	// check if this aggregator is occupied	if (aggregator->lag_ports) {		// check if there are other ports related to this aggregator except		// the port related to this slave(thats ensure us that there is a		// reason to search for new aggregator, and that we will find one		if ((aggregator->lag_ports != port) || (aggregator->lag_ports->next_port_in_aggregator)) {			// find new aggregator for the related port(s)			new_aggregator = __get_first_agg(port);			for (; new_aggregator; new_aggregator = __get_next_agg(new_aggregator)) {				// if the new aggregator is empty, or it connected to to our port only				if (!new_aggregator->lag_ports || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator)) {					break;				}			}			// if new aggregator found, copy the aggregator's parameters			// and connect the related lag_ports to the new aggregator			if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) {				dprintk("Some port(s) related to LAG %d - replaceing with LAG %d\n", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier);				if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) {					printk(KERN_INFO DRV_NAME ": Removing an active aggregator\n");					// select new active aggregator					 select_new_active_agg = 1;				}				new_aggregator->is_individual = aggregator->is_individual;				new_aggregator->actor_admin_aggregator_key = aggregator->actor_admin_aggregator_key;				new_aggregator->actor_oper_aggregator_key = aggregator->actor_oper_aggregator_key;				new_aggregator->partner_system = aggregator->partner_system;				new_aggregator->partner_system_priority = aggregator->partner_system_priority;				new_aggregator->partner_oper_aggregator_key = aggregator->partner_oper_aggregator_key;				new_aggregator->receive_state = aggregator->receive_state;				new_aggregator->transmit_state = aggregator->transmit_state;				new_aggregator->lag_ports = aggregator->lag_ports;				new_aggregator->is_active = aggregator->is_active;				new_aggregator->num_of_ports = aggregator->num_of_ports;				// update the information that is written on the ports about the aggregator				for (temp_port=aggregator->lag_ports; temp_port; temp_port=temp_port->next_port_in_aggregator) {					temp_port->aggregator=new_aggregator;					temp_port->actor_port_aggregator_identifier = new_aggregator->aggregator_identifier;				}				// clear the aggregator				ad_clear_agg(aggregator);								if (select_new_active_agg) {					ad_agg_selection_logic(__get_first_agg(port));				}			} else {				printk(KERN_WARNING DRV_NAME ": Warning: unbinding aggregator, "				       "and could not find a new aggregator for its ports\n");			}		} else { // in case that the only port related to this aggregator is the one we want to remove			select_new_active_agg = aggregator->is_active;			// clear the aggregator			ad_clear_agg(aggregator);			if (select_new_active_agg) {				printk(KERN_INFO "Removing an active aggregator\n");				// select new active aggregator				ad_agg_selection_logic(__get_first_agg(port));			}		}	}	dprintk("Unbinding port %d\n", port->actor_port_number);	// find the aggregator that this port is connected to	temp_aggregator = __get_first_agg(port);	for (; temp_aggregator; temp_aggregator = __get_next_agg(temp_aggregator)) {		prev_port = NULL;		// search the port in the aggregator's related ports		for (temp_port=temp_aggregator->lag_ports; temp_port; prev_port=temp_port, temp_port=temp_port->next_port_in_aggregator) {			if (temp_port == port) { // the aggregator found - detach the port from this aggregator				if (prev_port) {					prev_port->next_port_in_aggregator = temp_port->next_port_in_aggregator;				} else {					temp_aggregator->lag_ports = temp_port->next_port_in_aggregator;				}				temp_aggregator->num_of_ports--;				if (temp_aggregator->num_of_ports==0) {					select_new_active_agg = temp_aggregator->is_active;					// clear the aggregator					ad_clear_agg(temp_aggregator);					if (select_new_active_agg) {						printk(KERN_INFO "Removing an active aggregator\n");						// select new active aggregator						ad_agg_selection_logic(__get_first_agg(port));					}				}				break;			}		}	}	port->slave=NULL;	}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/4e0952c74ee450ded86e8946ce58ea8dfd05b007/bond_3ad.c/buggy/drivers/net/bonding/bond_3ad.c