Skip to content

Commit 2f4e320

Browse files
chejianjwenlingz
authored andcommitted
dm: virtio-input: adapt Windows virtio-input driver
Update PCIR_SUBDEV_0 and PCIR_REVID in PCI configuration space to adapt windows virtio-input driver. Otherwise virtio-input driver on Windows will not be loaded correctly. Tracked-On: #2962 Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com> Acked-by: Yin Fengwei <fengwei.yin@intel.com>
1 parent 8115857 commit 2f4e320

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

devicemodel/hw/pci/virtio/virtio_input.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,9 @@ virtio_input_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
673673
pci_set_cfgdata16(dev, PCIR_VENDOR, VIRTIO_VENDOR);
674674
pci_set_cfgdata8(dev, PCIR_CLASS, PCIC_INPUTDEV);
675675
pci_set_cfgdata8(dev, PCIR_SUBCLASS, PCIS_INPUTDEV_OTHER);
676-
pci_set_cfgdata16(dev, PCIR_SUBDEV_0, 0x1040 + VIRTIO_TYPE_INPUT);
676+
pci_set_cfgdata16(dev, PCIR_SUBDEV_0, 0x1100);
677677
pci_set_cfgdata16(dev, PCIR_SUBVEND_0, VIRTIO_VENDOR);
678+
pci_set_cfgdata16(dev, PCIR_REVID, 1);
678679

679680
if (virtio_interrupt_init(&vi->base, virtio_uses_msix())) {
680681
DPRINTF(("%s, interrupt_init failed!\n", __func__));

0 commit comments

Comments
 (0)