From: BALATON Zoltan <balaton@eik.bme.hu>
To: qemu-devel@nongnu.org
Cc: Huacai Chen <chenhuacai@kernel.org>,
Gerd Hoffmann <kraxel@redhat.com>, Philippe M-D <f4bug@amsat.org>
Subject: [PATCH 4/6] usb/uhci: Replace pci_set_irq with qemu_set_irq
Date: Mon, 18 Oct 2021 15:27:32 +0200 [thread overview]
Message-ID: <27276ac121f99a4c72c6bb468910ecb9ac4fa2a1.1634563652.git.balaton@eik.bme.hu> (raw)
In-Reply-To: <cover.1634563652.git.balaton@eik.bme.hu>
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>
---
hw/usb/hcd-uhci.c | 4 +++-
hw/usb/hcd-uhci.h | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 7d26e35194..d1b5657d72 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -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];
diff --git a/hw/usb/hcd-uhci.h b/hw/usb/hcd-uhci.h
index 316693f80b..c85ab7868e 100644
--- a/hw/usb/hcd-uhci.h
+++ b/hw/usb/hcd-uhci.h
@@ -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;
--
2.21.4
next prev parent reply other threads:[~2021-10-18 13:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 13:27 [PATCH 0/6] hw/usb/vt82c686-uhci-pci: Use ISA instead of PCI interrupts BALATON Zoltan
2021-10-18 13:27 ` [PATCH 1/6] via-ide: Avoid expensive operations in irq handler BALATON Zoltan
2021-10-18 13:27 ` BALATON Zoltan [this message]
2021-10-18 13:27 ` [PATCH 3/6] usb/uhci: Disallow user creating a vt82c686-uhci-pci device BALATON Zoltan
2021-10-18 13:27 ` [PATCH 5/6] hw/usb/vt82c686-uhci-pci: Use ISA instead of PCI interrupts BALATON Zoltan
2021-10-18 13:27 ` [PATCH 6/6] hw/usb/vt82c686-uhci-pci: Optimise itq handler BALATON Zoltan
2021-10-18 13:27 ` [PATCH 2/6] usb/uhci: Misc clean up BALATON Zoltan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27276ac121f99a4c72c6bb468910ecb9ac4fa2a1.1634563652.git.balaton@eik.bme.hu \
--to=balaton@eik.bme.hu \
--cc=chenhuacai@kernel.org \
--cc=f4bug@amsat.org \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.