/* We are going ot alloc a page during init per window for small transfers. Small transfers will go user space -> buffer -> VME. Larger (more than a page) transfers will lock the user space buffer into memory and then transfer the data directly from the user space buffers out to VME.  */
static ssize_t resource_from_user(unsigned int minor, const char *buf, size_t count, loff_t *ppos)
/* We are going ot alloc a page during init per window for small transfers. Small transfers will go user space -> buffer -> VME. Larger (more than a page) transfers will lock the user space buffer into memory and then transfer the data directly from the user space buffers out to VME.  */
static ssize_t resource_from_user(unsigned int minor, const char *buf, size_t count, loff_t *ppos)
{
	ssize_t retval;
	ssize_t copied = 0;
	if (count <= image[minor].size_buf) {
		retval = __copy_from_user(image[minor].kern_buf, buf,
			(unsigned long)count);
		if (retval != 0)
			copied = (copied - retval);
		else
			copied = count;
		copied = vme_master_write(image[minor].resource,
			image[minor].kern_buf, copied, *ppos);
	} else {
		printk("Currently don't support large transfers\n");
		return -EINVAL;
	}
	return copied;
}