init_timer(&cnx->reset_timer); cnx->reset_timer.function = veth_timed_reset; cnx->reset_timer.data = (unsigned long) cnx; cnx->reset_timeout = 5 * HZ * (VETH_ACKTIMEOUT / 1000000);
static int veth_init_connection(u8 rlp){	struct veth_lpar_connection *cnx;	struct veth_msg *msgs;	int i, rc;	if ( (rlp == this_lp)	     || ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) )		return 0;	cnx = kmalloc(sizeof(*cnx), GFP_KERNEL);	if (! cnx)		return -ENOMEM;	memset(cnx, 0, sizeof(*cnx));	cnx->remote_lp = rlp;	spin_lock_init(&cnx->lock);	INIT_WORK(&cnx->statemachine_wq, veth_statemachine, cnx);	init_timer(&cnx->ack_timer);	cnx->ack_timer.function = veth_timed_ack;	cnx->ack_timer.data = (unsigned long) cnx;	memset(&cnx->pending_acks, 0xff, sizeof (cnx->pending_acks));	veth_cnx[rlp] = cnx;	/* This gets us 1 reference, which is held on behalf of the driver	 * infrastructure. It's released at module unload. */	kobject_init(&cnx->kobject);	cnx->kobject.ktype = &veth_lpar_connection_ktype;	rc = kobject_set_name(&cnx->kobject, "cnx%.2d", rlp);	if (rc != 0)		return rc;	msgs = kmalloc(VETH_NUMBUFFERS * sizeof(struct veth_msg), GFP_KERNEL);	if (! msgs) {		veth_error("Can't allocate buffers for LPAR %d.\n", rlp);		return -ENOMEM;	}	cnx->msgs = msgs;	memset(msgs, 0, VETH_NUMBUFFERS * sizeof(struct veth_msg));	for (i = 0; i < VETH_NUMBUFFERS; i++) {		msgs[i].token = i;		veth_stack_push(cnx, msgs + i);	}	cnx->num_events = veth_allocate_events(rlp, 2 + VETH_NUMBUFFERS);	if (cnx->num_events < (2 + VETH_NUMBUFFERS)) {		veth_error("Can't allocate enough events for LPAR %d.\n", rlp);		return -ENOMEM;	}	cnx->local_caps.num_buffers = VETH_NUMBUFFERS;	cnx->local_caps.ack_threshold = ACK_THRESHOLD;	cnx->local_caps.ack_timeout = VETH_ACKTIMEOUT;	return 0;}