printk(KERN_ERR DRV_NAME ": Port %d (on %s) did not find a suitable aggregator\n", 
printk(KERN_ERR DRV_NAME ": %s: Port %d (on %s) did not find a suitable aggregator\n", port->slave->dev->master->name, 
static void ad_port_selection_logic(struct port *port){	struct aggregator *aggregator, *free_aggregator = NULL, *temp_aggregator;	struct port *last_port = NULL, *curr_port;	int found = 0;	// if the port is already Selected, do nothing	if (port->sm_vars & AD_PORT_SELECTED) {		return;	}	// if the port is connected to other aggregator, detach it	if (port->aggregator) {		// detach the port from its former aggregator		temp_aggregator=port->aggregator;		for (curr_port=temp_aggregator->lag_ports; curr_port; last_port=curr_port, curr_port=curr_port->next_port_in_aggregator) {			if (curr_port == port) {				temp_aggregator->num_of_ports--;				if (!last_port) {// if it is the first port attached to the aggregator					temp_aggregator->lag_ports=port->next_port_in_aggregator;				} else {// not the first port attached to the aggregator					last_port->next_port_in_aggregator=port->next_port_in_aggregator;				}				// clear the port's relations to this aggregator				port->aggregator = NULL;				port->next_port_in_aggregator=NULL;				port->actor_port_aggregator_identifier=0;				dprintk("Port %d left LAG %d\n", port->actor_port_number, temp_aggregator->aggregator_identifier);				// if the aggregator is empty, clear its parameters, and set it ready to be attached				if (!temp_aggregator->lag_ports) {					ad_clear_agg(temp_aggregator);				}				break;			}		}		if (!curr_port) { // meaning: the port was related to an aggregator but was not on the aggregator port list			printk(KERN_WARNING DRV_NAME ": Warning: Port %d (on %s) was "			       "related to aggregator %d but was not on its port list\n",			       port->actor_port_number, port->slave->dev->name,			       port->aggregator->aggregator_identifier);		}	}	// search on all aggregators for a suitable aggregator for this port	for (aggregator = __get_first_agg(port); aggregator;	     aggregator = __get_next_agg(aggregator)) {		// keep a free aggregator for later use(if needed)		if (!aggregator->lag_ports) {			if (!free_aggregator) {				free_aggregator=aggregator;			}			continue;		}		// check if current aggregator suits us		if (((aggregator->actor_oper_aggregator_key == port->actor_oper_port_key) && // if all parameters match AND		     !MAC_ADDRESS_COMPARE(&(aggregator->partner_system), &(port->partner_oper_system)) &&		     (aggregator->partner_system_priority == port->partner_oper_system_priority) &&		     (aggregator->partner_oper_aggregator_key == port->partner_oper_key)		    ) &&		    ((MAC_ADDRESS_COMPARE(&(port->partner_oper_system), &(null_mac_addr)) && // partner answers		      !aggregator->is_individual)  // but is not individual OR		    )		   ) {			// attach to the founded aggregator			port->aggregator = aggregator;			port->actor_port_aggregator_identifier=port->aggregator->aggregator_identifier;			port->next_port_in_aggregator=aggregator->lag_ports;			port->aggregator->num_of_ports++;			aggregator->lag_ports=port;			dprintk("Port %d joined LAG %d(existing LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier);			// mark this port as selected			port->sm_vars |= AD_PORT_SELECTED;			found = 1;			break;		}	}	// the port couldn't find an aggregator - attach it to a new aggregator	if (!found) {		if (free_aggregator) {			// assign port a new aggregator			port->aggregator = free_aggregator;			port->actor_port_aggregator_identifier=port->aggregator->aggregator_identifier;			// update the new aggregator's parameters			// if port was responsed from the end-user			if (port->actor_oper_port_key & AD_DUPLEX_KEY_BITS) {// if port is full duplex				port->aggregator->is_individual = 0;			} else {				port->aggregator->is_individual = 1;			}			port->aggregator->actor_admin_aggregator_key = port->actor_admin_port_key;			port->aggregator->actor_oper_aggregator_key = port->actor_oper_port_key;			port->aggregator->partner_system=port->partner_oper_system;			port->aggregator->partner_system_priority = port->partner_oper_system_priority;			port->aggregator->partner_oper_aggregator_key = port->partner_oper_key;			port->aggregator->receive_state = 1;			port->aggregator->transmit_state = 1;			port->aggregator->lag_ports = port;			port->aggregator->num_of_ports++;			// mark this port as selected			port->sm_vars |= AD_PORT_SELECTED;			dprintk("Port %d joined LAG %d(new LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier);		} else {			printk(KERN_ERR DRV_NAME ": Port %d (on %s) did not find a suitable aggregator\n",			       port->actor_port_number, port->slave->dev->name);		}	}	// if all aggregator's ports are READY_N == TRUE, set ready=TRUE in all aggregator's ports	// else set ready=FALSE in all aggregator's ports	__set_agg_ports_ready(port->aggregator, __agg_ports_are_ready(port->aggregator));	if (!__check_agg_selection_timer(port) && (aggregator = __get_first_agg(port))) {		ad_agg_selection_logic(aggregator);	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/4e0952c74ee450ded86e8946ce58ea8dfd05b007/bond_3ad.c/buggy/drivers/net/bonding/bond_3ad.c