diff options
author | Yu Zhao <yu.zhao@intel.com> | 2009-01-04 16:10:39 +0800 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2009-01-18 22:58:06 +0100 |
commit | 659d438b89875f4a141e2e342b9378669b7a8572 (patch) | |
tree | 5cc238cc6ac289f7cd98f758fb54f8f51fbaa4fe /lspci.c | |
parent | 6bd1a04738a9756c1e8e4f8531b076a216918751 (diff) | |
download | pciutils-659d438b89875f4a141e2e342b9378669b7a8572.tar.gz |
Don't display 'disabled' for a virtual base address
Don't display 'disabled' for the virtual base address since the resource
is reported by the OS not the hardware, which means the IO/MEM enable bits
in the command register may be invalid.
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Diffstat (limited to 'lspci.c')
-rw-r--r-- | lspci.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -350,6 +350,7 @@ show_bases(struct device *d, int cnt) struct pci_dev *p = d->dev; word cmd = get_conf_word(d, PCI_COMMAND); int i; + int virtual = 0; for (i=0; i<cnt; i++) { @@ -368,6 +369,7 @@ show_bases(struct device *d, int cnt) { printf("[virtual] "); flg = pos; + virtual = 1; } if (flg & PCI_BASE_ADDRESS_SPACE_IO) { @@ -379,7 +381,7 @@ show_bases(struct device *d, int cnt) printf("<ignored>"); else printf("<unassigned>"); - if (!(cmd & PCI_COMMAND_IO)) + if (!virtual && !(cmd & PCI_COMMAND_IO)) printf(" [disabled]"); } else @@ -415,7 +417,7 @@ show_bases(struct device *d, int cnt) (t == PCI_BASE_ADDRESS_MEM_TYPE_64) ? "64-bit" : (t == PCI_BASE_ADDRESS_MEM_TYPE_1M) ? "low-1M" : "type 3", (flg & PCI_BASE_ADDRESS_MEM_PREFETCH) ? "" : "non-"); - if (!(cmd & PCI_COMMAND_MEMORY)) + if (!virtual && !(cmd & PCI_COMMAND_MEMORY)) printf(" [disabled]"); } show_size(len); @@ -431,6 +433,7 @@ show_rom(struct device *d, int reg) pciaddr_t len = (p->known_fields & PCI_FILL_SIZES) ? p->rom_size : 0; u32 flg = get_conf_long(d, reg); word cmd = get_conf_word(d, PCI_COMMAND); + int virtual = 0; if (!rom && !flg && !len) return; @@ -439,6 +442,7 @@ show_rom(struct device *d, int reg) { printf("[virtual] "); flg = rom; + virtual = 1; } printf("Expansion ROM at "); if (rom & PCI_ROM_ADDRESS_MASK) @@ -449,7 +453,7 @@ show_rom(struct device *d, int reg) printf("<unassigned>"); if (!(flg & PCI_ROM_ADDRESS_ENABLE)) printf(" [disabled]"); - else if (!(cmd & PCI_COMMAND_MEMORY)) + else if (!virtual && !(cmd & PCI_COMMAND_MEMORY)) printf(" [disabled by cmd]"); show_size(len); putchar('\n'); |