From d821161c273a357108df1d4fa0b063bcd3ebacd0 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 26 Aug 2008 13:43:06 +0200 Subject: [PATCH] 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. --- lspci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.39.2