From 60ba3cc231d6bc7b802ad4fe6b6fc159ecb112e2 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Sat, 15 Oct 2011 14:33:17 +0200 Subject: msi: Generalize msix_supported to msi_supported Rename msix_supported to msi_supported and control MSI and MSI-X activation this way. That was likely to original intention for this flag, but MSI support came after MSI-X. Signed-off-by: Jan Kiszka --- hw/msi.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'hw/msi.c') diff --git a/hw/msi.c b/hw/msi.c index f214fcf579..5d6ceb6df0 100644 --- a/hw/msi.c +++ b/hw/msi.c @@ -36,6 +36,9 @@ #define PCI_MSI_VECTORS_MAX 32 +/* Flag for interrupt controller to declare MSI/MSI-X support */ +bool msi_supported; + /* If we get rid of cap allocator, we won't need this. */ static inline uint8_t msi_cap_sizeof(uint16_t flags) { @@ -116,6 +119,11 @@ int msi_init(struct PCIDevice *dev, uint8_t offset, uint16_t flags; uint8_t cap_size; int config_offset; + + if (!msi_supported) { + return -ENOTSUP; + } + MSI_DEV_PRINTF(dev, "init offset: 0x%"PRIx8" vector: %"PRId8 " 64bit %d mask %d\n", -- cgit v1.2.1