aboutsummaryrefslogtreecommitdiff
path: root/hw/pcie.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-12-08 17:46:23 +0900
committerMichael S. Tsirkin <mst@redhat.com>2010-12-09 12:48:18 +0200
commit4a9dd6658268a942a8ea230f950a951229355cbb (patch)
tree1273e979fefd46bbe01299a570221121d784bb12 /hw/pcie.c
parentb1aeb92666d2fde413c34578b3b42bbfe5f2a506 (diff)
pci: untangle pci/msi dependency
msi depends on pci but pci should not depend on msi. The only dependency we have is a recent addition of pci_msi_ functions, IMO they add little enough to open-code in the small number of users. Follow-up patches add more cleanups. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Diffstat (limited to 'hw/pcie.c')
-rw-r--r--hw/pcie.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/pcie.c b/hw/pcie.c
index f461c1cfbe..d1f0086559 100644
--- a/hw/pcie.c
+++ b/hw/pcie.c
@@ -167,10 +167,12 @@ static void hotplug_event_notify(PCIDevice *dev)
* The Port may optionally send an MSI when there are hot-plug events that
* occur while interrupt generation is disabled, and interrupt generation is
* subsequently enabled. */
- if (!pci_msi_enabled(dev)) {
+ if (msix_enabled(dev)) {
+ msix_notify(dev, pcie_cap_flags_get_vector(dev));
+ } else if (msi_enabled(dev)) {
+ msi_notify(dev, pcie_cap_flags_get_vector(dev));
+ } else {
qemu_set_irq(dev->irq[dev->exp.hpev_intx], dev->exp.hpev_notified);
- } else if (dev->exp.hpev_notified) {
- pci_msi_notify(dev, pcie_cap_flags_get_vector(dev));
}
}