virtio.h: add virtio_has_feature api for virtio driver
Virtio driver can used this api to judge whether the this feature is supported by both virtio driver and device. Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
parent
8b9c64eecf
commit
449197c188
@ -38,6 +38,9 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#define virtio_has_feature(vdev, fbit) \
|
||||||
|
(((vdev)->features & (1UL << (fbit))) != 0)
|
||||||
|
|
||||||
#define virtio_read_config_member(vdev, structname, member, ptr) \
|
#define virtio_read_config_member(vdev, structname, member, ptr) \
|
||||||
virtio_read_config((vdev), offsetof(structname, member), \
|
virtio_read_config((vdev), offsetof(structname, member), \
|
||||||
(ptr), sizeof(*(ptr)));
|
(ptr), sizeof(*(ptr)));
|
||||||
|
Loading…
Reference in New Issue
Block a user