summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2020-01-22 09:23:27 +0100
committerMartin Mares <mj@ucw.cz>2020-01-22 09:23:27 +0100
commitcb94f26e6933815fe4484cd2697ae7e1ffdcd9ac (patch)
tree71571abbfed3f40e53ea30f5566933e77409532d
parentbf72d3e965c89d318bb85eaf94f47f523fb497a2 (diff)
downloadpciutils-cb94f26e6933815fe4484cd2697ae7e1ffdcd9ac.tar.gz
Cleaned up dumping of expansion ROM regions
"[virtual]" and "[enhanced]" are now printed after the base address along with other flags.
-rw-r--r--lspci.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/lspci.c b/lspci.c
index 9ac164d..4e6196e 100644
--- a/lspci.c
+++ b/lspci.c
@@ -506,26 +506,32 @@ show_rom(struct device *d, int reg)
if (!rom && !flg && !len)
return;
- putchar('\t');
- if (ioflg & PCI_IORESOURCE_PCI_EA_BEI)
- printf("[enhanced] ");
- else if ((rom & PCI_ROM_ADDRESS_MASK) && !(flg & PCI_ROM_ADDRESS_MASK))
+
+ if ((rom & PCI_ROM_ADDRESS_MASK) && !(flg & PCI_ROM_ADDRESS_MASK) && !(ioflg & PCI_IORESOURCE_PCI_EA_BEI))
{
- printf("[virtual] ");
flg = rom;
virtual = 1;
}
- printf("Expansion ROM at ");
+
+ printf("\tExpansion ROM at ");
if (rom & PCI_ROM_ADDRESS_MASK)
printf(PCIADDR_T_FMT, rom & PCI_ROM_ADDRESS_MASK);
else if (flg & PCI_ROM_ADDRESS_MASK)
printf("<ignored>");
else
printf("<unassigned>");
+
+ if (virtual)
+ printf(" [virtual]");
+
if (!(flg & PCI_ROM_ADDRESS_ENABLE))
printf(" [disabled]");
else if (!virtual && !(cmd & PCI_COMMAND_MEMORY))
printf(" [disabled by cmd]");
+
+ if (ioflg & PCI_IORESOURCE_PCI_EA_BEI)
+ printf(" [enhanced]");
+
show_size(len);
putchar('\n');
}