예제 #1
0
static int usf_mmap(struct file *file, struct vm_area_struct *vms)
{
	struct usf_type *usf = file->private_data;
	int dir = OUT;
	struct usf_xx_type *usf_xx = &usf->usf_tx;

	if (vms->vm_flags & USF_VM_WRITE) { 
		dir = IN;
		usf_xx = &usf->usf_rx;
	}

	return q6usm_get_virtual_address(dir, usf_xx->usc, vms);
}
예제 #2
0
파일: usf.c 프로젝트: lolhi/ef52-kernel
static int usf_mmap(struct file *file, struct vm_area_struct *vms)
{
	struct usf_type *usf = file->private_data;
	int dir = OUT, rc;
	struct usf_xx_type *usf_xx = &usf->usf_tx;
	mutex_lock(&session_lock);

	if (vms->vm_flags & USF_VM_WRITE) { /* RX buf mapping */
		dir = IN;
		usf_xx = &usf->usf_rx;
	}

	rc = q6usm_get_virtual_address(dir, usf_xx->usc, vms);
	mutex_unlock(&session_lock);
	return rc;
}