Lines Matching refs:vdev
244 int (*set_vq_address)(struct vdpa_device *vdev,
247 void (*set_vq_num)(struct vdpa_device *vdev, u16 idx, u32 num);
248 void (*kick_vq)(struct vdpa_device *vdev, u16 idx);
249 void (*set_vq_cb)(struct vdpa_device *vdev, u16 idx,
251 void (*set_vq_ready)(struct vdpa_device *vdev, u16 idx, bool ready);
252 bool (*get_vq_ready)(struct vdpa_device *vdev, u16 idx);
253 int (*set_vq_state)(struct vdpa_device *vdev, u16 idx,
255 int (*get_vq_state)(struct vdpa_device *vdev, u16 idx,
258 (*get_vq_notification)(struct vdpa_device *vdev, u16 idx);
263 u32 (*get_vq_align)(struct vdpa_device *vdev);
264 u64 (*get_features)(struct vdpa_device *vdev);
265 int (*set_features)(struct vdpa_device *vdev, u64 features);
266 void (*set_config_cb)(struct vdpa_device *vdev,
268 u16 (*get_vq_num_max)(struct vdpa_device *vdev);
269 u32 (*get_device_id)(struct vdpa_device *vdev);
270 u32 (*get_vendor_id)(struct vdpa_device *vdev);
271 u8 (*get_status)(struct vdpa_device *vdev);
272 void (*set_status)(struct vdpa_device *vdev, u8 status);
273 int (*reset)(struct vdpa_device *vdev);
274 size_t (*get_config_size)(struct vdpa_device *vdev);
275 void (*get_config)(struct vdpa_device *vdev, unsigned int offset,
277 void (*set_config)(struct vdpa_device *vdev, unsigned int offset,
279 u32 (*get_generation)(struct vdpa_device *vdev);
280 struct vdpa_iova_range (*get_iova_range)(struct vdpa_device *vdev);
283 int (*set_map)(struct vdpa_device *vdev, struct vhost_iotlb *iotlb);
284 int (*dma_map)(struct vdpa_device *vdev, u64 iova, u64 size,
286 int (*dma_unmap)(struct vdpa_device *vdev, u64 iova, u64 size);
289 void (*free)(struct vdpa_device *vdev);
317 int vdpa_register_device(struct vdpa_device *vdev, int nvqs);
318 void vdpa_unregister_device(struct vdpa_device *vdev);
320 int _vdpa_register_device(struct vdpa_device *vdev, int nvqs);
321 void _vdpa_unregister_device(struct vdpa_device *vdev);
331 int (*probe)(struct vdpa_device *vdev);
332 void (*remove)(struct vdpa_device *vdev);
354 static inline void *vdpa_get_drvdata(const struct vdpa_device *vdev) in vdpa_get_drvdata() argument
356 return dev_get_drvdata(&vdev->dev); in vdpa_get_drvdata()
359 static inline void vdpa_set_drvdata(struct vdpa_device *vdev, void *data) in vdpa_set_drvdata() argument
361 dev_set_drvdata(&vdev->dev, data); in vdpa_set_drvdata()
364 static inline struct device *vdpa_get_dma_dev(struct vdpa_device *vdev) in vdpa_get_dma_dev() argument
366 return vdev->dma_dev; in vdpa_get_dma_dev()
369 static inline int vdpa_reset(struct vdpa_device *vdev) in vdpa_reset() argument
371 const struct vdpa_config_ops *ops = vdev->config; in vdpa_reset()
373 vdev->features_valid = false; in vdpa_reset()
374 return ops->reset(vdev); in vdpa_reset()
377 static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features) in vdpa_set_features() argument
379 const struct vdpa_config_ops *ops = vdev->config; in vdpa_set_features()
381 vdev->features_valid = true; in vdpa_set_features()
382 return ops->set_features(vdev, features); in vdpa_set_features()
385 static inline void vdpa_get_config(struct vdpa_device *vdev, in vdpa_get_config() argument
389 const struct vdpa_config_ops *ops = vdev->config; in vdpa_get_config()
395 if (!vdev->features_valid) in vdpa_get_config()
396 vdpa_set_features(vdev, 0); in vdpa_get_config()
397 ops->get_config(vdev, offset, buf, len); in vdpa_get_config()