summaryrefslogtreecommitdiff
path: root/hw/msix.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/msix.c
parenteab70139a6772f1735444d4f1daadc7bcfa7dc47 (diff)
downloadqemu-60ba3cc231d6bc7b802ad4fe6b6fc159ecb112e2.tar.gz
qemu-60ba3cc231d6bc7b802ad4fe6b6fc159ecb112e2.tar.bz2
qemu-60ba3cc231d6bc7b802ad4fe6b6fc159ecb112e2.zip
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/msix.c')
-rw-r--r--hw/msix.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/hw/msix.c b/hw/msix.c
index f47d26bb49..3835eaaf28 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -15,6 +15,7 @@
*/
#include "hw.h"
+#include "msi.h"
#include "msix.h"
#include "pci.h"
#include "range.h"
@@ -35,9 +36,6 @@
#define MSIX_MAX_ENTRIES 32
-/* Flag for interrupt controller to declare MSI-X support */
-int msix_supported;
-
/* Add MSI-X capability to the config space for the device. */
/* Given a bar and its size, add MSI-X table on top of it
* and fill MSI-X capability in the config space.
@@ -238,10 +236,11 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries,
unsigned bar_nr, unsigned bar_size)
{
int ret;
+
/* Nothing to do if MSI is not supported by interrupt controller */
- if (!msix_supported)
+ if (!msi_supported) {
return -ENOTSUP;
-
+ }
if (nentries > MSIX_MAX_ENTRIES)
return -EINVAL;