Lines Matching refs:vdev
373 int (*set_vq_address)(struct vdpa_device *vdev,
376 void (*set_vq_num)(struct vdpa_device *vdev, u16 idx, u32 num);
377 void (*kick_vq)(struct vdpa_device *vdev, u16 idx);
378 void (*kick_vq_with_data)(struct vdpa_device *vdev, u32 data);
379 void (*set_vq_cb)(struct vdpa_device *vdev, u16 idx,
381 void (*set_vq_ready)(struct vdpa_device *vdev, u16 idx, bool ready);
382 bool (*get_vq_ready)(struct vdpa_device *vdev, u16 idx);
383 int (*set_vq_state)(struct vdpa_device *vdev, u16 idx,
385 int (*get_vq_state)(struct vdpa_device *vdev, u16 idx,
387 int (*get_vendor_vq_stats)(struct vdpa_device *vdev, u16 idx,
391 (*get_vq_notification)(struct vdpa_device *vdev, u16 idx);
393 int (*get_vq_irq)(struct vdpa_device *vdev, u16 idx);
394 u16 (*get_vq_size)(struct vdpa_device *vdev, u16 idx);
397 u32 (*get_vq_align)(struct vdpa_device *vdev);
398 u32 (*get_vq_group)(struct vdpa_device *vdev, u16 idx);
399 u32 (*get_vq_desc_group)(struct vdpa_device *vdev, u16 idx);
400 u64 (*get_device_features)(struct vdpa_device *vdev);
401 u64 (*get_backend_features)(const struct vdpa_device *vdev);
402 int (*set_driver_features)(struct vdpa_device *vdev, u64 features);
403 u64 (*get_driver_features)(struct vdpa_device *vdev);
404 void (*set_config_cb)(struct vdpa_device *vdev,
406 u16 (*get_vq_num_max)(struct vdpa_device *vdev);
407 u16 (*get_vq_num_min)(struct vdpa_device *vdev);
408 u32 (*get_device_id)(struct vdpa_device *vdev);
409 u32 (*get_vendor_id)(struct vdpa_device *vdev);
410 u8 (*get_status)(struct vdpa_device *vdev);
411 void (*set_status)(struct vdpa_device *vdev, u8 status);
412 int (*reset)(struct vdpa_device *vdev);
413 int (*compat_reset)(struct vdpa_device *vdev, u32 flags);
415 int (*suspend)(struct vdpa_device *vdev);
416 int (*resume)(struct vdpa_device *vdev);
417 size_t (*get_config_size)(struct vdpa_device *vdev);
418 void (*get_config)(struct vdpa_device *vdev, unsigned int offset,
420 void (*set_config)(struct vdpa_device *vdev, unsigned int offset,
422 u32 (*get_generation)(struct vdpa_device *vdev);
423 struct vdpa_iova_range (*get_iova_range)(struct vdpa_device *vdev);
424 int (*set_vq_affinity)(struct vdpa_device *vdev, u16 idx,
426 const struct cpumask *(*get_vq_affinity)(struct vdpa_device *vdev,
430 int (*set_map)(struct vdpa_device *vdev, unsigned int asid,
432 int (*dma_map)(struct vdpa_device *vdev, unsigned int asid,
434 int (*dma_unmap)(struct vdpa_device *vdev, unsigned int asid,
436 int (*reset_map)(struct vdpa_device *vdev, unsigned int asid);
437 int (*set_group_asid)(struct vdpa_device *vdev, unsigned int group,
439 struct device *(*get_vq_dma_dev)(struct vdpa_device *vdev, u16 idx);
440 int (*bind_mm)(struct vdpa_device *vdev, struct mm_struct *mm);
441 void (*unbind_mm)(struct vdpa_device *vdev);
444 void (*free)(struct vdpa_device *vdev);
476 int vdpa_register_device(struct vdpa_device *vdev, u32 nvqs);
477 void vdpa_unregister_device(struct vdpa_device *vdev);
479 int _vdpa_register_device(struct vdpa_device *vdev, u32 nvqs);
480 void _vdpa_unregister_device(struct vdpa_device *vdev);
490 int (*probe)(struct vdpa_device *vdev);
491 void (*remove)(struct vdpa_device *vdev);
513 static inline void *vdpa_get_drvdata(const struct vdpa_device *vdev) in vdpa_get_drvdata() argument
515 return dev_get_drvdata(&vdev->dev); in vdpa_get_drvdata()
518 static inline void vdpa_set_drvdata(struct vdpa_device *vdev, void *data) in vdpa_set_drvdata() argument
520 dev_set_drvdata(&vdev->dev, data); in vdpa_set_drvdata()
523 static inline struct device *vdpa_get_dma_dev(struct vdpa_device *vdev) in vdpa_get_dma_dev() argument
525 return vdev->dma_dev; in vdpa_get_dma_dev()
528 static inline int vdpa_reset(struct vdpa_device *vdev, u32 flags) in vdpa_reset() argument
530 const struct vdpa_config_ops *ops = vdev->config; in vdpa_reset()
533 down_write(&vdev->cf_lock); in vdpa_reset()
534 vdev->features_valid = false; in vdpa_reset()
536 ret = ops->compat_reset(vdev, flags); in vdpa_reset()
538 ret = ops->reset(vdev); in vdpa_reset()
539 up_write(&vdev->cf_lock); in vdpa_reset()
543 static inline int vdpa_set_features_unlocked(struct vdpa_device *vdev, u64 features) in vdpa_set_features_unlocked() argument
545 const struct vdpa_config_ops *ops = vdev->config; in vdpa_set_features_unlocked()
548 vdev->features_valid = true; in vdpa_set_features_unlocked()
549 ret = ops->set_driver_features(vdev, features); in vdpa_set_features_unlocked()
554 static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features) in vdpa_set_features() argument
558 down_write(&vdev->cf_lock); in vdpa_set_features()
559 ret = vdpa_set_features_unlocked(vdev, features); in vdpa_set_features()
560 up_write(&vdev->cf_lock); in vdpa_set_features()
565 void vdpa_get_config(struct vdpa_device *vdev, unsigned int offset,
569 void vdpa_set_status(struct vdpa_device *vdev, u8 status);