Lines Matching refs:vdev
290 int (*set_vq_address)(struct vdpa_device *vdev,
293 void (*set_vq_num)(struct vdpa_device *vdev, u16 idx, u32 num);
294 void (*kick_vq)(struct vdpa_device *vdev, u16 idx);
295 void (*set_vq_cb)(struct vdpa_device *vdev, u16 idx,
297 void (*set_vq_ready)(struct vdpa_device *vdev, u16 idx, bool ready);
298 bool (*get_vq_ready)(struct vdpa_device *vdev, u16 idx);
299 int (*set_vq_state)(struct vdpa_device *vdev, u16 idx,
301 int (*get_vq_state)(struct vdpa_device *vdev, u16 idx,
303 int (*get_vendor_vq_stats)(struct vdpa_device *vdev, u16 idx,
307 (*get_vq_notification)(struct vdpa_device *vdev, u16 idx);
309 int (*get_vq_irq)(struct vdpa_device *vdev, u16 idx);
312 u32 (*get_vq_align)(struct vdpa_device *vdev);
313 u32 (*get_vq_group)(struct vdpa_device *vdev, u16 idx);
314 u64 (*get_device_features)(struct vdpa_device *vdev);
315 int (*set_driver_features)(struct vdpa_device *vdev, u64 features);
316 u64 (*get_driver_features)(struct vdpa_device *vdev);
317 void (*set_config_cb)(struct vdpa_device *vdev,
319 u16 (*get_vq_num_max)(struct vdpa_device *vdev);
320 u16 (*get_vq_num_min)(struct vdpa_device *vdev);
321 u32 (*get_device_id)(struct vdpa_device *vdev);
322 u32 (*get_vendor_id)(struct vdpa_device *vdev);
323 u8 (*get_status)(struct vdpa_device *vdev);
324 void (*set_status)(struct vdpa_device *vdev, u8 status);
325 int (*reset)(struct vdpa_device *vdev);
326 int (*suspend)(struct vdpa_device *vdev);
327 size_t (*get_config_size)(struct vdpa_device *vdev);
328 void (*get_config)(struct vdpa_device *vdev, unsigned int offset,
330 void (*set_config)(struct vdpa_device *vdev, unsigned int offset,
332 u32 (*get_generation)(struct vdpa_device *vdev);
333 struct vdpa_iova_range (*get_iova_range)(struct vdpa_device *vdev);
336 int (*set_map)(struct vdpa_device *vdev, unsigned int asid,
338 int (*dma_map)(struct vdpa_device *vdev, unsigned int asid,
340 int (*dma_unmap)(struct vdpa_device *vdev, unsigned int asid,
342 int (*set_group_asid)(struct vdpa_device *vdev, unsigned int group,
346 void (*free)(struct vdpa_device *vdev);
378 int vdpa_register_device(struct vdpa_device *vdev, u32 nvqs);
379 void vdpa_unregister_device(struct vdpa_device *vdev);
381 int _vdpa_register_device(struct vdpa_device *vdev, u32 nvqs);
382 void _vdpa_unregister_device(struct vdpa_device *vdev);
392 int (*probe)(struct vdpa_device *vdev);
393 void (*remove)(struct vdpa_device *vdev);
415 static inline void *vdpa_get_drvdata(const struct vdpa_device *vdev) in vdpa_get_drvdata() argument
417 return dev_get_drvdata(&vdev->dev); in vdpa_get_drvdata()
420 static inline void vdpa_set_drvdata(struct vdpa_device *vdev, void *data) in vdpa_set_drvdata() argument
422 dev_set_drvdata(&vdev->dev, data); in vdpa_set_drvdata()
425 static inline struct device *vdpa_get_dma_dev(struct vdpa_device *vdev) in vdpa_get_dma_dev() argument
427 return vdev->dma_dev; in vdpa_get_dma_dev()
430 static inline int vdpa_reset(struct vdpa_device *vdev) in vdpa_reset() argument
432 const struct vdpa_config_ops *ops = vdev->config; in vdpa_reset()
435 down_write(&vdev->cf_lock); in vdpa_reset()
436 vdev->features_valid = false; in vdpa_reset()
437 ret = ops->reset(vdev); in vdpa_reset()
438 up_write(&vdev->cf_lock); in vdpa_reset()
442 static inline int vdpa_set_features_unlocked(struct vdpa_device *vdev, u64 features) in vdpa_set_features_unlocked() argument
444 const struct vdpa_config_ops *ops = vdev->config; in vdpa_set_features_unlocked()
447 vdev->features_valid = true; in vdpa_set_features_unlocked()
448 ret = ops->set_driver_features(vdev, features); in vdpa_set_features_unlocked()
453 static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features) in vdpa_set_features() argument
457 down_write(&vdev->cf_lock); in vdpa_set_features()
458 ret = vdpa_set_features_unlocked(vdev, features); in vdpa_set_features()
459 up_write(&vdev->cf_lock); in vdpa_set_features()
464 void vdpa_get_config(struct vdpa_device *vdev, unsigned int offset,
468 void vdpa_set_status(struct vdpa_device *vdev, u8 status);