/*
 * virt_in.c
 *
 *  Created on: 14-10-2014
 *      Author: Krzysztof Jakubczyk
 */

#include "tdefs.h"
#include "misc.h"

#include "virt_in.h"

int virt_in_initlog(void *arguments, void *logic)
{
	struct virt_in_args *args = (struct virt_in_args *)arguments;
	struct virt_in_logic *log = (struct virt_in_logic *)logic;

	log->out_ptr = log_manager.nets_data + (args->io.out  >> 3);
	log->out_bit_no = args->io.out & 0x07;

	if(log->out_ptr >= (log_manager.nets_data+sizeof(log_manager.nets_data)))
		return -1;

	if(args->params.in_num>=MAX_VIRT_IN_COUNT)
		return -1;

	return 0;
}

