]> mj.ucw.cz Git - pciutils.git/commitdiff
Fix printing the MSI capability.
authorMartin Mares <mj@ucw.cz>
Tue, 26 Aug 2008 11:43:06 +0000 (13:43 +0200)
committerMartin Mares <mj@ucw.cz>
Tue, 26 Aug 2008 11:43:06 +0000 (13:43 +0200)
Contributed by Matthew Wilcox. His changelog says:

I'd like to present this change for your consideration.  I'm not sure
where the original idea comes from that MSI has a 'queue' of interrupts.
It has multiple independent interrupts.  Also, rather than just dumping
the raw values from the register, it makes sense to decode them into
the number of interrupts it supports.

lspci.c

diff --git a/lspci.c b/lspci.c
index 06efc2d67b0a9b5437a7ba9942087b83f75cdd80..5254b752f4c3f8cc0b2430528aa61eadd0446ab6 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -922,11 +922,11 @@ cap_msi(struct device *d, int where, int cap)
   u32 t;
   u16 w;
 
-  printf("Message Signalled Interrupts: Mask%c 64bit%c Queue=%d/%d Enable%c\n",
+  printf("Message Signalled Interrupts: Mask%c 64bit%c Count=%d/%d Enable%c\n",
          FLAG(cap, PCI_MSI_FLAGS_MASK_BIT),
         FLAG(cap, PCI_MSI_FLAGS_64BIT),
-        (cap & PCI_MSI_FLAGS_QSIZE) >> 4,
-        (cap & PCI_MSI_FLAGS_QMASK) >> 1,
+        1 << ((cap & PCI_MSI_FLAGS_QSIZE) >> 4),
+        1 << ((cap & PCI_MSI_FLAGS_QMASK) >> 1),
         FLAG(cap, PCI_MSI_FLAGS_ENABLE));
   if (verbose < 2)
     return;