hw/pcie: AER and hot-plug events must use device's interrupt

The fields hpev_intx and aer_intx were removed because
both AER and hot-plug events must use device's interrupt.
Assert/deassert interrupts using pci irq wrappers instead.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Marcel Apfelbaum 2013-10-07 10:36:40 +03:00 committed by Michael S. Tsirkin
parent 9e64f8a3fc
commit 5a03e708f2
3 changed files with 4 additions and 22 deletions

View File

@ -187,7 +187,7 @@ static void hotplug_event_notify(PCIDevice *dev)
} else if (msi_enabled(dev)) { } else if (msi_enabled(dev)) {
msi_notify(dev, pcie_cap_flags_get_vector(dev)); msi_notify(dev, pcie_cap_flags_get_vector(dev));
} else { } else {
qemu_set_irq(dev->irq[dev->exp.hpev_intx], dev->exp.hpev_notified); pci_set_irq(dev, dev->exp.hpev_notified);
} }
} }
@ -195,7 +195,7 @@ static void hotplug_event_clear(PCIDevice *dev)
{ {
hotplug_event_update_event_status(dev); hotplug_event_update_event_status(dev);
if (!msix_enabled(dev) && !msi_enabled(dev) && !dev->exp.hpev_notified) { if (!msix_enabled(dev) && !msi_enabled(dev) && !dev->exp.hpev_notified) {
qemu_set_irq(dev->irq[dev->exp.hpev_intx], 0); pci_irq_deassert(dev);
} }
} }

View File

@ -285,7 +285,7 @@ static void pcie_aer_root_notify(PCIDevice *dev)
} else if (msi_enabled(dev)) { } else if (msi_enabled(dev)) {
msi_notify(dev, pcie_aer_root_get_vector(dev)); msi_notify(dev, pcie_aer_root_get_vector(dev));
} else { } else {
qemu_set_irq(dev->irq[dev->exp.aer_intx], 1); pci_irq_assert(dev);
} }
} }
@ -768,7 +768,7 @@ void pcie_aer_root_write_config(PCIDevice *dev,
uint32_t root_cmd = pci_get_long(aer_cap + PCI_ERR_ROOT_COMMAND); uint32_t root_cmd = pci_get_long(aer_cap + PCI_ERR_ROOT_COMMAND);
/* 6.2.4.1.2 Interrupt Generation */ /* 6.2.4.1.2 Interrupt Generation */
if (!msix_enabled(dev) && !msi_enabled(dev)) { if (!msix_enabled(dev) && !msi_enabled(dev)) {
qemu_set_irq(dev->irq[dev->exp.aer_intx], !!(root_cmd & enabled_cmd)); pci_set_irq(dev, !!(root_cmd & enabled_cmd));
return; return;
} }

View File

@ -64,15 +64,6 @@ struct PCIExpressDevice {
uint8_t exp_cap; uint8_t exp_cap;
/* SLOT */ /* SLOT */
unsigned int hpev_intx; /* INTx for hot plug event (0-3:INT[A-D]#)
* default is 0 = INTA#
* If the chip wants to use other interrupt
* line, initialize this member with the
* desired number.
* If the chip dynamically changes this member,
* also initialize it when loaded as
* appropreately.
*/
bool hpev_notified; /* Logical AND of conditions for hot plug event. bool hpev_notified; /* Logical AND of conditions for hot plug event.
Following 6.7.3.4: Following 6.7.3.4:
Software Notification of Hot-Plug Events, an interrupt Software Notification of Hot-Plug Events, an interrupt
@ -82,15 +73,6 @@ struct PCIExpressDevice {
/* AER */ /* AER */
uint16_t aer_cap; uint16_t aer_cap;
PCIEAERLog aer_log; PCIEAERLog aer_log;
unsigned int aer_intx; /* INTx for error reporting
* default is 0 = INTA#
* If the chip wants to use other interrupt
* line, initialize this member with the
* desired number.
* If the chip dynamically changes this member,
* also initialize it when loaded as
* appropreately.
*/
}; };
/* PCI express capability helper functions */ /* PCI express capability helper functions */