search for: mdev_device_id

Displaying 5 results from an estimated 5 matches for "mdev_device_id".

2019 Sep 17
1
[RFC PATCH 1/2] mdev: device id support
...mdev_remove(struct device *dev) > return 0; > } > > +static int mdev_match(struct device *dev, struct device_driver *drv) > +{ > + unsigned int i; > + struct mdev_device *mdev = to_mdev_device(dev); > + struct mdev_driver *mdrv = to_mdev_driver(drv); > + const struct mdev_device_id *ids = mdrv->id_table; > + > + for (i = 0; ids[i].id; i++) > + if (ids[i].id == mdev->parent->device_id) > + return 1; > + return 0; > +} > + > struct bus_type mdev_bus_type = { > .name = "mdev", > + .match = mdev_match, > .probe = mdev...
2019 Sep 12
0
[RFC PATCH 1/2] mdev: device id support
.../mdev_driver.c @@ -69,8 +69,22 @@ static int mdev_remove(struct device *dev) return 0; } +static int mdev_match(struct device *dev, struct device_driver *drv) +{ + unsigned int i; + struct mdev_device *mdev = to_mdev_device(dev); + struct mdev_driver *mdrv = to_mdev_driver(drv); + const struct mdev_device_id *ids = mdrv->id_table; + + for (i = 0; ids[i].id; i++) + if (ids[i].id == mdev->parent->device_id) + return 1; + return 0; +} + struct bus_type mdev_bus_type = { .name = "mdev", + .match = mdev_match, .probe = mdev_probe, .remove = mdev_remove, }; diff --git a/driv...
2019 Sep 17
1
[RFC PATCH 1/2] mdev: device id support
...--- a/include/linux/mod_devicetable.h > +++ b/include/linux/mod_devicetable.h > @@ -821,4 +821,10 @@ struct wmi_device_id { > const void *context; > }; > > +/* MDEV */ > + Maybe add some kerneldoc and give vfio as an example of what we're matching here? > +struct mdev_device_id { > + __u8 id; I agree with the suggestion to rename this to 'class_id'. > +}; > + > #endif /* LINUX_MOD_DEVICETABLE_H */
2019 Sep 12
9
[RFC PATCH 0/2] Mdev: support mutiple kinds of devices
Hi all: During the development of virtio-mdev[1]. I find that mdev needs to be extended to support devices other than vfio mdev device. So this series tries to extend the mdev to be able to differ from different devices by: - device id and matching for mdev bus - device speicfic callbacks and move vfio callbacks there Sent for early reivew, compile test only! Thanks [1]
2019 Sep 12
9
[RFC PATCH 0/2] Mdev: support mutiple kinds of devices
Hi all: During the development of virtio-mdev[1]. I find that mdev needs to be extended to support devices other than vfio mdev device. So this series tries to extend the mdev to be able to differ from different devices by: - device id and matching for mdev bus - device speicfic callbacks and move vfio callbacks there Sent for early reivew, compile test only! Thanks [1]