From: Martin Mares Date: Tue, 26 Aug 2008 11:43:06 +0000 (+0200) Subject: Fix printing the MSI capability. X-Git-Tag: v3.0.1~7 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=d821161c273a357108df1d4fa0b063bcd3ebacd0;p=pciutils.git Fix printing the MSI capability. 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. --- diff --git a/lspci.c b/lspci.c index 06efc2d..5254b75 100644 --- 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;