1 /* 2 * Virtio input host PCI Bindings 3 * 4 * This work is licensed under the terms of the GNU GPL, version 2 or 5 * (at your option) any later version. See the COPYING file in the 6 * top-level directory. 7 */ 8 9 #include "qemu/osdep.h" 10 11 #include "virtio-pci.h" 12 #include "hw/virtio/virtio-input.h" 13 14 typedef struct VirtIOInputHostPCI VirtIOInputHostPCI; 15 16 #define TYPE_VIRTIO_INPUT_HOST_PCI "virtio-input-host-pci-base" 17 #define VIRTIO_INPUT_HOST_PCI(obj) \ 18 OBJECT_CHECK(VirtIOInputHostPCI, (obj), TYPE_VIRTIO_INPUT_HOST_PCI) 19 20 struct VirtIOInputHostPCI { 21 VirtIOPCIProxy parent_obj; 22 VirtIOInputHost vdev; 23 }; 24 25 static void virtio_host_initfn(Object *obj) 26 { 27 VirtIOInputHostPCI *dev = VIRTIO_INPUT_HOST_PCI(obj); 28 29 virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev), 30 TYPE_VIRTIO_INPUT_HOST); 31 } 32 33 static const VirtioPCIDeviceTypeInfo virtio_input_host_pci_info = { 34 .base_name = TYPE_VIRTIO_INPUT_HOST_PCI, 35 .generic_name = "virtio-input-host-pci", 36 .transitional_name = "virtio-input-host-pci-transitional", 37 .non_transitional_name = "virtio-input-host-pci-non-transitional", 38 .parent = TYPE_VIRTIO_INPUT_PCI, 39 .instance_size = sizeof(VirtIOInputHostPCI), 40 .instance_init = virtio_host_initfn, 41 }; 42 43 static void virtio_input_host_pci_register(void) 44 { 45 virtio_pci_types_register(&virtio_input_host_pci_info); 46 } 47 48 type_init(virtio_input_host_pci_register) 49