Lines Matching defs:device
12 void vfio_init_device_cdev(struct vfio_device *device)
14 device->device.devt = MKDEV(MAJOR(device_devt), device->index);
15 cdev_init(&device->cdev, &vfio_device_fops);
16 device->cdev.owner = THIS_MODULE;
20 * device access via the fd opened by this function is blocked until
25 struct vfio_device *device = container_of(inode->i_cdev,
31 if (!vfio_device_try_get_registration(device))
34 df = vfio_allocate_device_file(device);
45 vfio_device_put_registration(device);
52 vfio_device_get_kvm_safe(df->device, df->kvm);
59 struct vfio_device *device = df->device;
78 ret = vfio_device_block_group(device);
82 mutex_lock(&device->dev_set->lock);
83 /* one device cannot be bound twice */
97 * Before the device open, get the KVM pointer currently
98 * associated with the device file (if there is) and obtain
99 * a reference. This reference is held until device closed.
100 * Save the pointer in the device for use by drivers.
113 device->cdev_opened = true;
119 mutex_unlock(&device->dev_set->lock);
125 vfio_device_put_kvm(device);
129 mutex_unlock(&device->dev_set->lock);
130 vfio_device_unblock_group(device);
136 struct vfio_device *device = df->device;
146 mutex_lock(&device->dev_set->lock);
148 vfio_device_put_kvm(device);
150 device->cdev_opened = false;
151 mutex_unlock(&device->dev_set->lock);
152 vfio_device_unblock_group(device);
158 struct vfio_device *device = df->device;
171 mutex_lock(&device->dev_set->lock);
172 ret = device->ops->attach_ioas(device, &attach.pt_id);
180 mutex_unlock(&device->dev_set->lock);
185 device->ops->detach_ioas(device);
187 mutex_unlock(&device->dev_set->lock);
194 struct vfio_device *device = df->device;
206 mutex_lock(&device->dev_set->lock);
207 device->ops->detach_ioas(device);
208 mutex_unlock(&device->dev_set->lock);
213 static char *vfio_device_devnode(const struct device *dev, umode_t *mode)