summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2018-05-27 13:49:55 +0200
committerMartin Mares <mj@ucw.cz>2018-05-27 13:49:55 +0200
commit4cd087d884827e5e4cc493fcbe46e7fb6e331416 (patch)
tree71f6269296ce9cf84791076cc05f0ca0f5d7268e
parenteff08b33c1b689c428260fd9a6b878e96704ea5f (diff)
downloadpciutils-4cd087d884827e5e4cc493fcbe46e7fb6e331416.tar.gz
lspci: "virtual" resource regions recognized properly
We wanted to add a "[virtual]" marker to all resources which are known to the kernel, but not configured in the hardware. That is, those where the BAR is all zero. However, the test was never triggered for I/O regions, since their BAR is never zero: it always has the region type bit set. Now, we test only the address part of the BAR.
-rw-r--r--lspci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lspci.c b/lspci.c
index 748452c..3bf1925 100644
--- a/lspci.c
+++ b/lspci.c
@@ -395,8 +395,9 @@ show_bases(struct device *d, int cnt)
putchar('\t');
if (ioflg & PCI_IORESOURCE_PCI_EA_BEI)
printf("[enhanced] ");
- else if (pos && !flg) /* Reported by the OS, but not by the device */
+ else if (pos && !(flg & ((flg & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)))
{
+ /* Reported by the OS, but not by the device */
printf("[virtual] ");
flg = pos;
virtual = 1;