From ca77089d2d8e73283bfc73f03d954504561e1ce8 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Mon, 6 Sep 2010 16:46:16 +0900 Subject: pci: consolidate pci_add_capability_at_offset() into pci_add_capability(). By making pci_add_capability() the special case of pci_add_capability_at_offset() of offset = 0, consolidate pci_add_capability_at_offset() into pci_add_capability(). Cc: Stefan Weil Cc: Michael S. Tsirkin Signed-off-by: Isaku Yamahata Signed-off-by: Michael S. Tsirkin --- hw/msix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/msix.c') diff --git a/hw/msix.c b/hw/msix.c index d99403a..7ce63eb 100644 --- a/hw/msix.c +++ b/hw/msix.c @@ -73,7 +73,8 @@ static int msix_add_config(struct PCIDevice *pdev, unsigned short nentries, } pdev->msix_bar_size = new_size; - config_offset = pci_add_capability(pdev, PCI_CAP_ID_MSIX, MSIX_CAP_LENGTH); + config_offset = pci_add_capability(pdev, PCI_CAP_ID_MSIX, + 0, MSIX_CAP_LENGTH); if (config_offset < 0) return config_offset; config = pdev->config + config_offset; -- cgit v1.1 From 57c6db2e2dec77a60bcfe6f93d756653f444a1f2 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Wed, 15 Sep 2010 14:38:26 +0900 Subject: msix: clear not only INTA, but all INTx when MSI-X is enabled. clear not only INTA, but all INTx when MSI-X is enabled. Signed-off-by: Isaku Yamahata Signed-off-by: Michael S. Tsirkin --- hw/msix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hw/msix.c') diff --git a/hw/msix.c b/hw/msix.c index 7ce63eb..b202ff7 100644 --- a/hw/msix.c +++ b/hw/msix.c @@ -158,6 +158,7 @@ void msix_write_config(PCIDevice *dev, uint32_t addr, { unsigned enable_pos = dev->msix_cap + MSIX_CONTROL_OFFSET; int vector; + int i; if (!range_covers_byte(addr, len, enable_pos)) { return; @@ -167,7 +168,9 @@ void msix_write_config(PCIDevice *dev, uint32_t addr, return; } - qemu_set_irq(dev->irq[0], 0); + for (i = 0; i < PCI_NUM_PINS; ++i) { + qemu_set_irq(dev->irq[i], 0); + } if (msix_function_masked(dev)) { return; -- cgit v1.1