]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
usb/uhci: Replace pci_set_irq with qemu_set_irq
authorBALATON Zoltan <balaton@eik.bme.hu>
Mon, 25 Oct 2021 11:33:49 +0000 (13:33 +0200)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 2 Nov 2021 13:32:32 +0000 (14:32 +0100)
Instead of using pci_set_irq, store the irq in the device state and
use it explicitly so variants having different interrupt handling can
use their own.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <b39066e03c8731f4197d50bc79b403f797599999.1635161629.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
hw/usb/hcd-uhci.c
hw/usb/hcd-uhci.h

index 7d26e3519429666474fa1445211d46a9c9d15040..d1b5657d722a3a9463ab78ffd60d677c6bd2f57e 100644 (file)
@@ -31,6 +31,7 @@
 #include "hw/usb/uhci-regs.h"
 #include "migration/vmstate.h"
 #include "hw/pci/pci.h"
+#include "hw/irq.h"
 #include "hw/qdev-properties.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
@@ -299,7 +300,7 @@ static void uhci_update_irq(UHCIState *s)
         (s->status & UHCI_STS_HCPERR)) {
         level = 1;
     }
-    pci_set_irq(&s->dev, level);
+    qemu_set_irq(s->irq, level);
 }
 
 static void uhci_reset(DeviceState *dev)
@@ -1170,6 +1171,7 @@ void usb_uhci_common_realize(PCIDevice *dev, Error **errp)
     /* TODO: reset value should be 0. */
     pci_conf[USB_SBRN] = USB_RELEASE_1; /* release number */
     pci_config_set_interrupt_pin(pci_conf, u->info.irq_pin + 1);
+    s->irq = pci_allocate_irq(dev);
 
     if (s->masterbus) {
         USBPort *ports[NB_PORTS];
index 316693f80bd2dd8a0a3fe9aca547a00c54aa85f9..c85ab7868eee496323a92fd51942cb4e1429c5fc 100644 (file)
@@ -60,7 +60,7 @@ typedef struct UHCIState {
     uint32_t frame_bandwidth;
     bool completions_only;
     UHCIPort ports[NB_PORTS];
-
+    qemu_irq irq;
     /* Interrupts that should be raised at the end of the current frame.  */
     uint32_t pending_int_mask;