del_timer(&cnx->ack_timer);  
static void veth_statemachine(void *p){	struct veth_lpar_connection *cnx = (struct veth_lpar_connection *)p;	int rlp = cnx->remote_lp;	int rc;	spin_lock_irq(&cnx->lock); restart:	if (cnx->state & VETH_STATE_RESET) {		int i;		del_timer(&cnx->ack_timer);		if (cnx->state & VETH_STATE_OPEN)			HvCallEvent_closeLpEventPath(cnx->remote_lp,						     HvLpEvent_Type_VirtualLan);		/* reset ack data */		memset(&cnx->pending_acks, 0xff, sizeof (cnx->pending_acks));		cnx->num_pending_acks = 0;		cnx->state &= ~(VETH_STATE_RESET | VETH_STATE_SENTMON				| VETH_STATE_OPEN | VETH_STATE_SENTCAPS				| VETH_STATE_GOTCAPACK | VETH_STATE_GOTCAPS				| VETH_STATE_SENTCAPACK | VETH_STATE_READY);		/* Clean up any leftover messages */		if (cnx->msgs)			for (i = 0; i < VETH_NUMBUFFERS; ++i)				veth_recycle_msg(cnx, cnx->msgs + i);		spin_unlock_irq(&cnx->lock);		veth_flush_pending(cnx);		spin_lock_irq(&cnx->lock);		if (cnx->state & VETH_STATE_RESET)			goto restart;	}	if (cnx->state & VETH_STATE_SHUTDOWN)		/* It's all over, do nothing */		goto out;	if ( !(cnx->state & VETH_STATE_OPEN) ) {		if (! cnx->msgs || (cnx->num_events < (2 + VETH_NUMBUFFERS)) )			goto cant_cope;		HvCallEvent_openLpEventPath(rlp, HvLpEvent_Type_VirtualLan);		cnx->src_inst =			HvCallEvent_getSourceLpInstanceId(rlp,							  HvLpEvent_Type_VirtualLan);		cnx->dst_inst =			HvCallEvent_getTargetLpInstanceId(rlp,							  HvLpEvent_Type_VirtualLan);		cnx->state |= VETH_STATE_OPEN;	}	if ( (cnx->state & VETH_STATE_OPEN)	     && !(cnx->state & VETH_STATE_SENTMON) ) {		rc = veth_signalevent(cnx, VethEventTypeMonitor,				      HvLpEvent_AckInd_DoAck,				      HvLpEvent_AckType_DeferredAck,				      0, 0, 0, 0, 0, 0);		if (rc == HvLpEvent_Rc_Good) {			cnx->state |= VETH_STATE_SENTMON;		} else {			if ( (rc != HvLpEvent_Rc_PartitionDead)			     && (rc != HvLpEvent_Rc_PathClosed) )				veth_error("Error sending monitor to LPAR %d, "						"rc = %d\n", rlp, rc);			/* Oh well, hope we get a cap from the other			 * end and do better when that kicks us */			goto out;		}	}	if ( (cnx->state & VETH_STATE_OPEN)	     && !(cnx->state & VETH_STATE_SENTCAPS)) {		u64 *rawcap = (u64 *)&cnx->local_caps;		rc = veth_signalevent(cnx, VethEventTypeCap,				      HvLpEvent_AckInd_DoAck,				      HvLpEvent_AckType_ImmediateAck,				      0, rawcap[0], rawcap[1], rawcap[2],				      rawcap[3], rawcap[4]);		if (rc == HvLpEvent_Rc_Good) {			cnx->state |= VETH_STATE_SENTCAPS;		} else {			if ( (rc != HvLpEvent_Rc_PartitionDead)			     && (rc != HvLpEvent_Rc_PathClosed) )				veth_error("Error sending caps to LPAR %d, "						"rc = %d\n", rlp, rc);			/* Oh well, hope we get a cap from the other			 * end and do better when that kicks us */			goto out;		}	}	if ((cnx->state & VETH_STATE_GOTCAPS)	    && !(cnx->state & VETH_STATE_SENTCAPACK)) {		struct VethCapData *remote_caps = &cnx->remote_caps;		memcpy(remote_caps, &cnx->cap_event.u.caps_data,		       sizeof(*remote_caps));		spin_unlock_irq(&cnx->lock);		rc = veth_process_caps(cnx);		spin_lock_irq(&cnx->lock);		/* We dropped the lock, so recheck for anything which		 * might mess us up */		if (cnx->state & (VETH_STATE_RESET|VETH_STATE_SHUTDOWN))			goto restart;		cnx->cap_event.base_event.xRc = rc;		HvCallEvent_ackLpEvent((struct HvLpEvent *)&cnx->cap_event);		if (rc == HvLpEvent_Rc_Good)			cnx->state |= VETH_STATE_SENTCAPACK;		else			goto cant_cope;	}	if ((cnx->state & VETH_STATE_GOTCAPACK)	    && (cnx->state & VETH_STATE_GOTCAPS)	    && !(cnx->state & VETH_STATE_READY)) {		if (cnx->cap_ack_event.base_event.xRc == HvLpEvent_Rc_Good) {			/* Start the ACK timer */			cnx->ack_timer.expires = jiffies + cnx->ack_timeout;			add_timer(&cnx->ack_timer);			cnx->state |= VETH_STATE_READY;		} else {			veth_error("Caps rejected by LPAR %d, rc = %d\n",					rlp, cnx->cap_ack_event.base_event.xRc);			goto cant_cope;		}	} out:	spin_unlock_irq(&cnx->lock);	return; cant_cope:	/* FIXME: we get here if something happens we really can't	 * cope with.  The link will never work once we get here, and	 * all we can do is not lock the rest of the system up */	veth_error("Unrecoverable error on connection to LPAR %d, shutting down"			" (state = 0x%04lx)\n", rlp, cnx->state);	cnx->state |= VETH_STATE_SHUTDOWN;	spin_unlock_irq(&cnx->lock);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/abfda4719c61550be4efaf277d4a904a7930d410/iseries_veth.c/buggy/drivers/net/iseries_veth.c