search for: mdev_get_dev_ops

Displaying 20 results from an estimated 56 matches for "mdev_get_dev_ops".

2019 Oct 17
0
[PATCH V4 5/6] virtio: introduce a mdev based transport
...to_virtio_mdev_device(vdev); + struct mdev_device *mdev = vm_dev->mdev; + + return mdev; +} + +static void virtio_mdev_get(struct virtio_device *vdev, unsigned offset, + void *buf, unsigned len) +{ + struct mdev_device *mdev = vm_get_mdev(vdev); + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + ops->get_config(mdev, offset, buf, len); +} + +static void virtio_mdev_set(struct virtio_device *vdev, unsigned offset, + const void *buf, unsigned len) +{ + struct mdev_device *mdev = vm_get_mdev(vdev); + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + op...
2019 Oct 11
0
[PATCH V3 6/7] virtio: introduce a mdev based transport
...to_virtio_mdev_device(vdev); + struct mdev_device *mdev = vm_dev->mdev; + + return mdev; +} + +static void virtio_mdev_get(struct virtio_device *vdev, unsigned offset, + void *buf, unsigned len) +{ + struct mdev_device *mdev = vm_get_mdev(vdev); + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + ops->get_config(mdev, offset, buf, len); +} + +static void virtio_mdev_set(struct virtio_device *vdev, unsigned offset, + const void *buf, unsigned len) +{ + struct mdev_device *mdev = vm_get_mdev(vdev); + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + op...
2019 Oct 22
2
[PATCH v2] vhost: introduce mdev based hardware backend
...ack for vhost mdev device. + */ +void mdev_set_vhost_ops(struct mdev_device *mdev, + const struct virtio_mdev_device_ops *vhost_ops) +{ + WARN_ON(mdev->class_id); + mdev->class_id = MDEV_CLASS_ID_VHOST; + mdev->device_ops = vhost_ops; +} +EXPORT_SYMBOL(mdev_set_vhost_ops); + const void *mdev_get_dev_ops(struct mdev_device *mdev) { return mdev->device_ops; diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig index 3d03ccbd1adc..7b5c2f655af7 100644 --- a/drivers/vhost/Kconfig +++ b/drivers/vhost/Kconfig @@ -34,6 +34,15 @@ config VHOST_VSOCK To compile this driver as a module, choose M...
2019 Oct 22
2
[PATCH v2] vhost: introduce mdev based hardware backend
...ack for vhost mdev device. + */ +void mdev_set_vhost_ops(struct mdev_device *mdev, + const struct virtio_mdev_device_ops *vhost_ops) +{ + WARN_ON(mdev->class_id); + mdev->class_id = MDEV_CLASS_ID_VHOST; + mdev->device_ops = vhost_ops; +} +EXPORT_SYMBOL(mdev_set_vhost_ops); + const void *mdev_get_dev_ops(struct mdev_device *mdev) { return mdev->device_ops; diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig index 3d03ccbd1adc..7b5c2f655af7 100644 --- a/drivers/vhost/Kconfig +++ b/drivers/vhost/Kconfig @@ -34,6 +34,15 @@ config VHOST_VSOCK To compile this driver as a module, choose M...
2019 Oct 22
0
[PATCH v2] vhost: introduce mdev based hardware backend
..._vhost_ops(struct mdev_device *mdev, > + const struct virtio_mdev_device_ops *vhost_ops) > +{ > + WARN_ON(mdev->class_id); > + mdev->class_id = MDEV_CLASS_ID_VHOST; > + mdev->device_ops = vhost_ops; > +} > +EXPORT_SYMBOL(mdev_set_vhost_ops); > + > const void *mdev_get_dev_ops(struct mdev_device *mdev) > { > return mdev->device_ops; > diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig > index 3d03ccbd1adc..7b5c2f655af7 100644 > --- a/drivers/vhost/Kconfig > +++ b/drivers/vhost/Kconfig > @@ -34,6 +34,15 @@ config VHOST_VSOCK > To...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...cture. */ + struct mutex mutex; + struct vhost_dev dev; + struct vhost_virtqueue *vqs; + int nvqs; + u64 state; + u64 features; + u64 acked_features; + bool opened; + struct mdev_device *mdev; +}; + +static u8 mdev_get_status(struct mdev_device *mdev) +{ + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + return ops->get_status(mdev); +} + +static void mdev_set_status(struct mdev_device *mdev, u8 status) +{ + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + return ops->set_status(mdev, status); +} + +static void mdev_add_status(struct mdev_device *mdev, u8 stat...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...cture. */ + struct mutex mutex; + struct vhost_dev dev; + struct vhost_virtqueue *vqs; + int nvqs; + u64 state; + u64 features; + u64 acked_features; + bool opened; + struct mdev_device *mdev; +}; + +static u8 mdev_get_status(struct mdev_device *mdev) +{ + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + return ops->get_status(mdev); +} + +static void mdev_set_status(struct mdev_device *mdev, u8 status) +{ + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + return ops->set_status(mdev, status); +} + +static void mdev_add_status(struct mdev_device *mdev, u8 stat...
2019 Oct 23
2
[PATCH v2] vhost: introduce mdev based hardware backend
...; + const struct virtio_mdev_device_ops *vhost_ops) > > +{ > > + WARN_ON(mdev->class_id); > > + mdev->class_id = MDEV_CLASS_ID_VHOST; > > + mdev->device_ops = vhost_ops; > > +} > > +EXPORT_SYMBOL(mdev_set_vhost_ops); > > + > > const void *mdev_get_dev_ops(struct mdev_device *mdev) > > { > > return mdev->device_ops; > > diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig > > index 3d03ccbd1adc..7b5c2f655af7 100644 > > --- a/drivers/vhost/Kconfig > > +++ b/drivers/vhost/Kconfig > > @@ -34,6 +34,...
2019 Oct 23
2
[PATCH v2] vhost: introduce mdev based hardware backend
...; + const struct virtio_mdev_device_ops *vhost_ops) > > +{ > > + WARN_ON(mdev->class_id); > > + mdev->class_id = MDEV_CLASS_ID_VHOST; > > + mdev->device_ops = vhost_ops; > > +} > > +EXPORT_SYMBOL(mdev_set_vhost_ops); > > + > > const void *mdev_get_dev_ops(struct mdev_device *mdev) > > { > > return mdev->device_ops; > > diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig > > index 3d03ccbd1adc..7b5c2f655af7 100644 > > --- a/drivers/vhost/Kconfig > > +++ b/drivers/vhost/Kconfig > > @@ -34,6 +34,...
2019 Oct 23
0
[PATCH v2] vhost: introduce mdev based hardware backend
..._mdev_device_ops *vhost_ops) >>> +{ >>> + WARN_ON(mdev->class_id); >>> + mdev->class_id = MDEV_CLASS_ID_VHOST; >>> + mdev->device_ops = vhost_ops; >>> +} >>> +EXPORT_SYMBOL(mdev_set_vhost_ops); >>> + >>> const void *mdev_get_dev_ops(struct mdev_device *mdev) >>> { >>> return mdev->device_ops; >>> diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig >>> index 3d03ccbd1adc..7b5c2f655af7 100644 >>> --- a/drivers/vhost/Kconfig >>> +++ b/drivers/vhost/Kconfig &gt...
2019 Oct 11
0
[PATCH V3 4/7] mdev: introduce device specific ops
...l: ioctl callback of mediated device + void mdev_set_class(struct mdev_device *mdev, u16 id, const void *ops); + +The class_id is used to be paired with ids in id_table in mdev_driver +structure for probing the correct driver. The device_ops is device +specific callbacks which can be get through mdev_get_dev_ops() +function by mdev bus driver. For vfio-mdev device, its device specific +ops are as follows: + +* open: open callback of vfio mediated device +* close: close callback of vfio mediated device +* ioctl: ioctl callback of vfio mediated device * read : read emulation callback * write: write emulati...
2019 Oct 17
3
[PATCH V4 3/6] mdev: introduce device specific ops
...struct vfio_mdev_ops *vfio_ops); > + > +The class id (set to MDEV_CLASS_ID_VFIO) is used to match a device "(set by this helper function to MDEV_CLASS_ID_VFIO)" ? > +with an mdev driver via its id table. The device specific callbacks > +(specified in *ops) are obtainable via mdev_get_dev_ops() (for use by "(specified in *vfio_ops by the caller)" ? > +the mdev bus driver). A vfio-mdev device (class id MDEV_CLASS_ID_VFIO) > +uses the following device-specific ops: > + > +* open: open callback of vfio mediated device > +* close: close callback of vfio mediated d...
2019 Oct 17
3
[PATCH V4 3/6] mdev: introduce device specific ops
...struct vfio_mdev_ops *vfio_ops); > + > +The class id (set to MDEV_CLASS_ID_VFIO) is used to match a device "(set by this helper function to MDEV_CLASS_ID_VFIO)" ? > +with an mdev driver via its id table. The device specific callbacks > +(specified in *ops) are obtainable via mdev_get_dev_ops() (for use by "(specified in *vfio_ops by the caller)" ? > +the mdev bus driver). A vfio-mdev device (class id MDEV_CLASS_ID_VFIO) > +uses the following device-specific ops: > + > +* open: open callback of vfio mediated device > +* close: close callback of vfio mediated d...
2019 Sep 24
3
[PATCH V2 5/8] mdev: introduce device specific ops
...o/mdev/mdev_core.c > index 8764cf4a276d..6f35f2ced2c9 100644 > --- a/drivers/vfio/mdev/mdev_core.c > +++ b/drivers/vfio/mdev/mdev_core.c > @@ -51,6 +51,18 @@ void mdev_set_class_id(struct mdev_device *mdev, u16 id) > } > EXPORT_SYMBOL(mdev_set_class_id); > > +const void *mdev_get_dev_ops(struct mdev_device *mdev) > +{ > + return mdev->device_ops; > +} > +EXPORT_SYMBOL(mdev_get_dev_ops); > + > +void mdev_set_dev_ops(struct mdev_device *mdev, const void *ops) > +{ > + mdev->device_ops = ops; > +} > +EXPORT_SYMBOL(mdev_set_dev_ops); > + > str...
2019 Sep 24
3
[PATCH V2 5/8] mdev: introduce device specific ops
...o/mdev/mdev_core.c > index 8764cf4a276d..6f35f2ced2c9 100644 > --- a/drivers/vfio/mdev/mdev_core.c > +++ b/drivers/vfio/mdev/mdev_core.c > @@ -51,6 +51,18 @@ void mdev_set_class_id(struct mdev_device *mdev, u16 id) > } > EXPORT_SYMBOL(mdev_set_class_id); > > +const void *mdev_get_dev_ops(struct mdev_device *mdev) > +{ > + return mdev->device_ops; > +} > +EXPORT_SYMBOL(mdev_get_dev_ops); > + > +void mdev_set_dev_ops(struct mdev_device *mdev, const void *ops) > +{ > + mdev->device_ops = ops; > +} > +EXPORT_SYMBOL(mdev_set_dev_ops); > + > str...
2019 Oct 17
0
[PATCH V4 3/6] mdev: introduce device specific ops
...+ + int mdev_set_vfio_ops(struct mdev_device *mdev, + const struct vfio_mdev_ops *vfio_ops); + +The class id (set to MDEV_CLASS_ID_VFIO) is used to match a device +with an mdev driver via its id table. The device specific callbacks +(specified in *ops) are obtainable via mdev_get_dev_ops() (for use by +the mdev bus driver). A vfio-mdev device (class id MDEV_CLASS_ID_VFIO) +uses the following device-specific ops: + +* open: open callback of vfio mediated device +* close: close callback of vfio mediated device +* ioctl: ioctl callback of vfio mediated device * read : read emulation...
2019 Sep 24
0
[PATCH V2 5/8] mdev: introduce device specific ops
...vers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index 8764cf4a276d..6f35f2ced2c9 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c @@ -51,6 +51,18 @@ void mdev_set_class_id(struct mdev_device *mdev, u16 id) } EXPORT_SYMBOL(mdev_set_class_id); +const void *mdev_get_dev_ops(struct mdev_device *mdev) +{ + return mdev->device_ops; +} +EXPORT_SYMBOL(mdev_get_dev_ops); + +void mdev_set_dev_ops(struct mdev_device *mdev, const void *ops) +{ + mdev->device_ops = ops; +} +EXPORT_SYMBOL(mdev_set_dev_ops); + struct device *mdev_dev(struct mdev_device *mdev) { return &...
2019 Sep 26
0
[PATCH] vhost: introduce mdev based hardware backend
...+ struct vhost_virtqueue *vqs; > + int nvqs; > + u64 state; > + u64 features; > + u64 acked_features; > + bool opened; > + struct mdev_device *mdev; > +}; > + > +static u8 mdev_get_status(struct mdev_device *mdev) > +{ > + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); > + > + return ops->get_status(mdev); > +} > + > +static void mdev_set_status(struct mdev_device *mdev, u8 status) > +{ > + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); > + > + return ops->set_status(mdev, status); > +} > + > +s...
2019 Sep 25
3
[PATCH V2 5/8] mdev: introduce device specific ops
...--- a/drivers/vfio/mdev/mdev_core.c > > > +++ b/drivers/vfio/mdev/mdev_core.c > > > @@ -51,6 +51,18 @@ void mdev_set_class_id(struct mdev_device *mdev, > > u16 id) > > > } > > > EXPORT_SYMBOL(mdev_set_class_id); > > > > > > +const void *mdev_get_dev_ops(struct mdev_device *mdev) > > > +{ > > > + return mdev->device_ops; > > > +} > > > +EXPORT_SYMBOL(mdev_get_dev_ops); > > > + > > > +void mdev_set_dev_ops(struct mdev_device *mdev, const void *ops) > > > +{ > > > + mdev-&...
2019 Sep 25
3
[PATCH V2 5/8] mdev: introduce device specific ops
...--- a/drivers/vfio/mdev/mdev_core.c > > > +++ b/drivers/vfio/mdev/mdev_core.c > > > @@ -51,6 +51,18 @@ void mdev_set_class_id(struct mdev_device *mdev, > > u16 id) > > > } > > > EXPORT_SYMBOL(mdev_set_class_id); > > > > > > +const void *mdev_get_dev_ops(struct mdev_device *mdev) > > > +{ > > > + return mdev->device_ops; > > > +} > > > +EXPORT_SYMBOL(mdev_get_dev_ops); > > > + > > > +void mdev_set_dev_ops(struct mdev_device *mdev, const void *ops) > > > +{ > > > + mdev-&...