summaryrefslogtreecommitdiff
path: root/hw/msi.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-10-15 14:33:17 +0200
committerJan Kiszka <jan.kiszka@siemens.com>2012-01-19 12:14:39 +0100
commit60ba3cc231d6bc7b802ad4fe6b6fc159ecb112e2 (patch)
tree7368fee5e23cc57ef5c6be971333e48432983c97 /hw/msi.c
parenteab70139a6772f1735444d4f1daadc7bcfa7dc47 (diff)
downloadqemu-60ba3cc231d6bc7b802ad4fe6b6fc159ecb112e2.tar.gz
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 <jan.kiszka@siemens.com>
Diffstat (limited to 'hw/msi.c')
-rw-r--r--hw/msi.c8
1 files changed, 8 insertions, 0 deletions
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",