summary refs log tree commit diff stats
path: root/hw/usb/hcd-xhci-pci.c
diff options
context:
space:
mode:
authorPhil Dennis-Jordan <phil@philjordan.eu>2024-12-08 20:16:42 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-12-31 21:21:34 +0100
commit92270bdff02bc6ba77a091f066576f96d5a96f7b (patch)
treedd4caedf10bfbd15f0d8fbaf40fb5ea24475aaf2 /hw/usb/hcd-xhci-pci.c
parent12ed6aca7ca328a12e235f4daa9824873da60315 (diff)
downloadfocaccia-qemu-92270bdff02bc6ba77a091f066576f96d5a96f7b.tar.gz
focaccia-qemu-92270bdff02bc6ba77a091f066576f96d5a96f7b.zip
hw/usb/hcd-xhci-pci: Move msi/msix properties from NEC to superclass
The NEC XHCI controller exposes the underlying PCI device's msi and
msix properties, but the superclass and thus the qemu-xhci device do
not. There does not seem to be any obvious reason for this limitation.
This change moves these properties to the superclass so they are
exposed by both PCI XHCI device variants.

Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20241227121336.25838-3-phil@philjordan.eu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to '')
-rw-r--r--hw/usb/hcd-xhci-pci.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c
index e110840c7a..a069b42338 100644
--- a/hw/usb/hcd-xhci-pci.c
+++ b/hw/usb/hcd-xhci-pci.c
@@ -197,6 +197,11 @@ static void xhci_instance_init(Object *obj)
     qdev_alias_all_properties(DEVICE(&s->xhci), obj);
 }
 
+static const Property xhci_pci_properties[] = {
+    DEFINE_PROP_ON_OFF_AUTO("msi", XHCIPciState, msi, ON_OFF_AUTO_AUTO),
+    DEFINE_PROP_ON_OFF_AUTO("msix", XHCIPciState, msix, ON_OFF_AUTO_AUTO),
+};
+
 static void xhci_class_init(ObjectClass *klass, void *data)
 {
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
@@ -208,6 +213,7 @@ static void xhci_class_init(ObjectClass *klass, void *data)
     k->realize      = usb_xhci_pci_realize;
     k->exit         = usb_xhci_pci_exit;
     k->class_id     = PCI_CLASS_SERIAL_USB;
+    device_class_set_props(dc, xhci_pci_properties);
 }
 
 static const TypeInfo xhci_pci_info = {