1 /* 2 * Vhost-user GPIO virtio device 3 * 4 * Copyright (c) 2021 Viresh Kumar <viresh.kumar@linaro.org> 5 * 6 * SPDX-License-Identifier: GPL-2.0-or-later 7 */ 8 9 #ifndef _QEMU_VHOST_USER_GPIO_H 10 #define _QEMU_VHOST_USER_GPIO_H 11 12 #include "hw/virtio/virtio.h" 13 #include "hw/virtio/vhost.h" 14 #include "hw/virtio/vhost-user.h" 15 #include "standard-headers/linux/virtio_gpio.h" 16 #include "chardev/char-fe.h" 17 18 #define TYPE_VHOST_USER_GPIO "vhost-user-gpio-device" 19 OBJECT_DECLARE_SIMPLE_TYPE(VHostUserGPIO, VHOST_USER_GPIO); 20 21 struct VHostUserGPIO { 22 /*< private >*/ 23 VirtIODevice parent_obj; 24 CharBackend chardev; 25 struct virtio_gpio_config config; 26 struct vhost_virtqueue *vhost_vq; 27 struct vhost_dev vhost_dev; 28 VhostUserState vhost_user; 29 VirtQueue *command_vq; 30 VirtQueue *interrupt_vq; 31 bool connected; 32 /*< public >*/ 33 }; 34 35 #endif /* _QEMU_VHOST_USER_GPIO_H */ 36