]> mj.ucw.cz Git - pciutils.git/blobdiff - lspci.c
Released as 3.1.3.
[pciutils.git] / lspci.c
diff --git a/lspci.c b/lspci.c
index d872c75192041bb114f1afeda5fc923c4c8f9282..e453f1bfb23d1855c559175db3319d0f4c56163b 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -17,7 +17,6 @@
 /* Options */
 
 int verbose;                           /* Show detailed information */
-static int opt_buscentric;             /* Show bus addresses/IRQ's instead of CPU-visible ones */
 static int opt_hex;                    /* Show contents of config space as hexadecimal numbers */
 struct pci_filter filter;              /* Device filter */
 static int opt_tree;                   /* Show bus tree */
@@ -140,7 +139,7 @@ scan_device(struct pci_dev *p)
        d->config_cached += 64;
     }
   pci_setup_cache(p, d->config, d->config_cached);
-  pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_CLASS | PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | PCI_FILL_SIZES);
+  pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_CLASS | PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | PCI_FILL_SIZES | PCI_FILL_PHYS_SLOT);
   return d;
 }
 
@@ -351,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++)
     {
@@ -369,6 +369,7 @@ show_bases(struct device *d, int cnt)
        {
          printf("[virtual] ");
          flg = pos;
+         virtual = 1;
        }
       if (flg & PCI_BASE_ADDRESS_SPACE_IO)
        {
@@ -380,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
@@ -402,15 +403,6 @@ show_bases(struct device *d, int cnt)
                {
                  i++;
                  z = get_conf_long(d, PCI_BASE_ADDRESS_0 + 4*i);
-                 if (opt_buscentric)
-                   {
-                     u32 y = a & 0xffffffff;
-                     if (a || z)
-                       printf("%08x%08x", z, y);
-                     else
-                       printf("<unassigned>");
-                     done = 1;
-                   }
                }
            }
          if (!done)
@@ -425,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);
@@ -441,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;
@@ -449,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)
@@ -459,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');
@@ -685,6 +679,9 @@ show_verbose(struct device *d)
       return;
     }
 
+  if (p->phy_slot)
+    printf("\tPhysical Slot: %s\n", p->phy_slot);
+
   if (verbose > 1)
     {
       printf("\tControl: I/O%c Mem%c BusMaster%c SpecCycle%c MemWINV%c VGASnoop%c ParErr%c Stepping%c SERR%c FastB2B%c DisINTx%c\n",
@@ -850,6 +847,8 @@ show_machine(struct device *d)
          printf("SDevice:\t%s\n",
                 pci_lookup_name(pacc, sdbuf, sizeof(sdbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_DEVICE, p->vendor_id, p->device_id, sv_id, sd_id));
        }
+      if (p->phy_slot)
+       printf("PhySlot:\t%s\n", p->phy_slot);
       if (c = get_conf_byte(d, PCI_REVISION_ID))
        printf("Rev:\t%02x\n", c);
       if (c = get_conf_byte(d, PCI_CLASS_PROG))
@@ -938,7 +937,6 @@ main(int argc, char **argv)
        break;
       case 'b':
        pacc->buscentric = 1;
-       opt_buscentric = 1;
        break;
       case 's':
        if (msg = pci_filter_parse_slot(&filter, optarg))