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 | #include "qemu/module.h" |
14 | |
15 | typedef struct VirtIOInputHostPCI VirtIOInputHostPCI; |
16 | |
17 | #define TYPE_VIRTIO_INPUT_HOST_PCI "virtio-input-host-pci" |
18 | #define VIRTIO_INPUT_HOST_PCI(obj) \ |
19 | OBJECT_CHECK(VirtIOInputHostPCI, (obj), TYPE_VIRTIO_INPUT_HOST_PCI) |
20 | |
21 | struct VirtIOInputHostPCI { |
22 | VirtIOPCIProxy parent_obj; |
23 | VirtIOInputHost vdev; |
24 | }; |
25 | |
26 | static void virtio_host_initfn(Object *obj) |
27 | { |
28 | VirtIOInputHostPCI *dev = VIRTIO_INPUT_HOST_PCI(obj); |
29 | |
30 | virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev), |
31 | TYPE_VIRTIO_INPUT_HOST); |
32 | } |
33 | |
34 | static const VirtioPCIDeviceTypeInfo virtio_input_host_pci_info = { |
35 | .generic_name = TYPE_VIRTIO_INPUT_HOST_PCI, |
36 | .parent = TYPE_VIRTIO_INPUT_PCI, |
37 | .instance_size = sizeof(VirtIOInputHostPCI), |
38 | .instance_init = virtio_host_initfn, |
39 | }; |
40 | |
41 | static void virtio_input_host_pci_register(void) |
42 | { |
43 | virtio_pci_types_register(&virtio_input_host_pci_info); |
44 | } |
45 | |
46 | type_init(virtio_input_host_pci_register) |
47 | |