]> mj.ucw.cz Git - pciutils.git/blobdiff - lspci.c
Reorganized the pci.ids file. Subsystems are listed under devices, classes
[pciutils.git] / lspci.c
diff --git a/lspci.c b/lspci.c
index c18a1b99032178947754b1c1f59cff2552f2a7e3..41b88d32e89f8505c004f700a1c864e41bcae4de 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -1,5 +1,5 @@
 /*
- *     $Id: lspci.c,v 1.22 1999/01/28 20:16:46 mj Exp $
+ *     $Id: lspci.c,v 1.30 1999/10/09 13:26:02 mj Exp $
  *
  *     Linux PCI Utilities -- List All PCI Devices
  *
@@ -56,10 +56,22 @@ static struct pci_access *pacc;
 #define IRQ_FORMAT "%d"
 #endif
 
-#ifdef HAVE_64BIT_LONG_INT
-#define LONG_FORMAT "%016lx"
+#ifdef HAVE_64BIT_ADDRESS
+#ifdef HAVE_LONG_ADDRESS
+#define ADDR_FORMAT "%016Lx"
 #else
-#define LONG_FORMAT "%08lx"
+#define ADDR_FORMAT "%016lx"
+#endif
+#else
+#define ADDR_FORMAT "%08lx"
+#endif
+
+#ifdef ARCH_SPARC64
+#define IO_FORMAT "%016Lx"
+#elif defined(HAVE_64BIT_ADDRESS)
+#define IO_FORMAT "%04Lx"
+#else
+#define IO_FORMAT "%04lx"
 #endif
 
 /* Our view of the PCI bus */
@@ -95,7 +107,7 @@ scan_device(struct pci_dev *p)
     }
   d->config_cnt = how_much;
   pci_setup_cache(p, d->config, d->config_cnt);
-  pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE);
+  pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | PCI_FILL_SIZES);
   return d;
 }
 
@@ -222,17 +234,42 @@ show_terse(struct device *d)
         p->func,
         pci_lookup_name(pacc, classbuf, sizeof(classbuf),
                         PCI_LOOKUP_CLASS,
-                        get_conf_word(d, PCI_CLASS_DEVICE), 0),
+                        get_conf_word(d, PCI_CLASS_DEVICE), 0, 0, 0),
         pci_lookup_name(pacc, devbuf, sizeof(devbuf),
                         PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,
-                        p->vendor_id, p->device_id));
+                        p->vendor_id, p->device_id, 0, 0));
   if (c = get_conf_byte(d, PCI_REVISION_ID))
     printf(" (rev %02x)", c);
   if (verbose && (c = get_conf_byte(d, PCI_CLASS_PROG)))
-    printf(" (prog-if %02x)", c);
+    {
+      char *x = pci_lookup_name(pacc, devbuf, sizeof(devbuf),
+                               PCI_LOOKUP_PROGIF,
+                               get_conf_word(d, PCI_CLASS_DEVICE), c, 0, 0);
+      printf(" (prog-if %02x", c);
+      if (x)
+       printf(" [%s]", x);
+      putchar(')');
+    }
   putchar('\n');
 }
 
+static void
+show_size(pciaddr_t x)
+{
+  if (!x)
+    return;
+  printf(" [size=");
+  if (x < 1024)
+    printf("%d", (int) x);
+  else if (x < 1048576)
+    printf("%dK", (int)(x / 1024));
+  else if (x < 0x80000000)
+    printf("%dM", (int)(x / 1048576));
+  else
+    printf(ADDR_FORMAT, x);
+  putchar(']');
+}
+
 static void
 show_bases(struct device *d, int cnt)
 {
@@ -242,12 +279,12 @@ show_bases(struct device *d, int cnt)
 
   for(i=0; i<cnt; i++)
     {
-      unsigned long pos;
-      unsigned int flg = get_conf_long(d, PCI_BASE_ADDRESS_0 + 4*i);
-      pos = p->base_addr[i];
+      pciaddr_t pos = p->base_addr[i];
+      pciaddr_t len = (p->known_fields & PCI_FILL_SIZES) ? p->size[i] : 0;
+      u32 flg = get_conf_long(d, PCI_BASE_ADDRESS_0 + 4*i);
       if (flg == 0xffffffff)
        flg = 0;
-      if (!pos && !flg)
+      if (!pos && !flg && !len)
        continue;
       if (verbose > 1)
        printf("\tRegion %d: ", i);
@@ -260,10 +297,10 @@ show_bases(struct device *d, int cnt)
        }
       if (flg & PCI_BASE_ADDRESS_SPACE_IO)
        {
-         unsigned long a = pos & PCI_BASE_ADDRESS_IO_MASK;
+         pciaddr_t a = pos & PCI_BASE_ADDRESS_IO_MASK;
          printf("I/O ports at ");
          if (a)
-           printf("%04lx", a);
+           printf(IO_FORMAT, a);
          else if (flg & PCI_BASE_ADDRESS_IO_MASK)
            printf("<ignored>");
          else
@@ -274,7 +311,7 @@ show_bases(struct device *d, int cnt)
       else
        {
          int t = flg & PCI_BASE_ADDRESS_MEM_TYPE_MASK;
-         unsigned long a = pos & PCI_BASE_ADDRESS_MEM_MASK;
+         pciaddr_t a = pos & PCI_ADDR_MEM_MASK;
          int done = 0;
          u32 z = 0;
 
@@ -283,7 +320,7 @@ show_bases(struct device *d, int cnt)
            {
              if (i >= cnt - 1)
                {
-                 printf("<invalid-64bit-slot>\n");
+                 printf("<invalid-64bit-slot>");
                  done = 1;
                }
              else
@@ -293,7 +330,7 @@ show_bases(struct device *d, int cnt)
                  if (buscentric_view)
                    {
                      if (a || z)
-                       printf("%08x%08lx", z, a);
+                       printf("%08x" ADDR_FORMAT, z, a);
                      else
                        printf("<unassigned>");
                      done = 1;
@@ -303,7 +340,7 @@ show_bases(struct device *d, int cnt)
          if (!done)
            {
              if (a)
-               printf(LONG_FORMAT, a);
+               printf(ADDR_FORMAT, a);
              else
                printf(((flg & PCI_BASE_ADDRESS_MEM_MASK) || z) ? "<ignored>" : "<unassigned>");
            }
@@ -315,6 +352,7 @@ show_bases(struct device *d, int cnt)
          if (!(cmd & PCI_COMMAND_MEMORY))
            printf(" [disabled]");
        }
+      show_size(len);
       putchar('\n');
     }
 }
@@ -363,6 +401,7 @@ show_agp(struct device *d, int where, int cap)
         (t & PCI_AGP_STATUS_RATE4) ? "4" : "",
         (t & PCI_AGP_STATUS_RATE2) ? "2" : "",
         (t & PCI_AGP_STATUS_RATE1) ? "1" : "");
+  t = get_conf_long(d, where + PCI_AGP_COMMAND);
   printf("\t\tCommand: RQ=%d SBA%c AGP%c 64bit%c FW%c Rate=%s%s%s\n",
         (t & PCI_AGP_COMMAND_RQ_MASK) >> 24U,
         FLAG(t, PCI_AGP_COMMAND_SBA),
@@ -375,17 +414,72 @@ show_agp(struct device *d, int where, int cap)
 }
 
 static void
-show_htype0(struct device *d)
+show_rom(struct device *d)
 {
-  unsigned long rom = d->dev->rom_base_addr;
+  struct pci_dev *p = d->dev;
+  pciaddr_t rom = p->rom_base_addr;
+  pciaddr_t len = (p->known_fields & PCI_FILL_SIZES) ? p->rom_size : 0;
 
-  show_bases(d, 6);
-  if (rom & 1)
-    printf("\tExpansion ROM at %08lx%s\n", rom & PCI_ROM_ADDRESS_MASK,
-          (rom & PCI_ROM_ADDRESS_ENABLE) ? "" : " [disabled]");
+  if (!rom && !len)
+    return;
+  printf("\tExpansion ROM at ");
+  if (rom & PCI_ROM_ADDRESS_MASK)
+    printf(ADDR_FORMAT, rom & PCI_ROM_ADDRESS_MASK);
+  else
+    printf("<unassigned>");
+  if (!(rom & PCI_ROM_ADDRESS_ENABLE))
+    printf(" [disabled]");
+  show_size(len);
+  putchar('\n');
+}
+
+static void
+show_msi(struct device *d, int where, int cap)
+{
+  int is64;
+  u32 t;
+  u16 w;
+
+  printf("Message Signalled Interrupts: 64bit%c Queue=%d/%d Enable%c\n",
+        FLAG(cap, PCI_MSI_FLAGS_64BIT),
+        (cap & PCI_MSI_FLAGS_QSIZE) >> 4,
+        (cap & PCI_MSI_FLAGS_QMASK) >> 1,
+        FLAG(cap, PCI_MSI_FLAGS_ENABLE));
+  if (verbose < 2)
+    return;
+  is64 = cap & PCI_MSI_FLAGS_64BIT;
+  config_fetch(d, where + PCI_MSI_ADDRESS_LO, (is64 ? PCI_MSI_DATA_64 : PCI_MSI_DATA_32) + 2 - PCI_MSI_ADDRESS_LO);
+  printf("\t\tAddress: ");
+  if (is64)
+    {
+      t = get_conf_long(d, where + PCI_MSI_ADDRESS_HI);
+      w = get_conf_word(d, where + PCI_MSI_DATA_64);
+      printf("%08x", t);
+    }
+  else
+    w = get_conf_word(d, where + PCI_MSI_DATA_32);
+  t = get_conf_long(d, where + PCI_MSI_ADDRESS_LO);
+  printf("%08x  Data: %04x\n", t, w);
+}
+
+static void
+show_slotid(int cap)
+{
+  int esr = cap & 0xff;
+  int chs = cap >> 8;
+
+  printf("Slot ID: %d slots, First%c, chassis %02x\n",
+        esr & PCI_SID_ESR_NSLOTS,
+        FLAG(esr, PCI_SID_ESR_FIC),
+        chs);
+}
+
+static void
+show_caps(struct device *d)
+{
   if (get_conf_word(d, PCI_STATUS) & PCI_STATUS_CAP_LIST)
     {
-      int where = get_conf_byte(d, PCI_CAPABILITY_LIST);
+      int where = get_conf_byte(d, PCI_CAPABILITY_LIST) & ~3;
       while (where)
        {
          int id, next, cap;
@@ -396,7 +490,7 @@ show_htype0(struct device *d)
              break;
            }
          id = get_conf_byte(d, where + PCI_CAP_LIST_ID);
-         next = get_conf_byte(d, where + PCI_CAP_LIST_NEXT);
+         next = get_conf_byte(d, where + PCI_CAP_LIST_NEXT) & ~3;
          cap = get_conf_word(d, where + PCI_CAP_FLAGS);
          printf("[%02x] ", where);
          if (id == 0xff)
@@ -412,18 +506,34 @@ show_htype0(struct device *d)
            case PCI_CAP_ID_AGP:
              show_agp(d, where, cap);
              break;
+           case PCI_CAP_ID_VPD:
+             printf("Vital Product Data\n");
+             break;
+           case PCI_CAP_ID_SLOTID:
+             show_slotid(cap);
+             break;
+           case PCI_CAP_ID_MSI:
+             show_msi(d, where, cap);
+             break;
            default:
-             printf("#%02x [%04x]", id, cap);
+             printf("#%02x [%04x]\n", id, cap);
            }
          where = next;
        }
     }
 }
 
+static void
+show_htype0(struct device *d)
+{
+  show_bases(d, 6);
+  show_rom(d);
+  show_caps(d);
+}
+
 static void
 show_htype1(struct device *d)
 {
-  struct pci_dev *p = d->dev;
   u32 io_base = get_conf_byte(d, PCI_IO_BASE);
   u32 io_limit = get_conf_byte(d, PCI_IO_LIMIT);
   u32 io_type = io_base & PCI_IO_RANGE_TYPE_MASK;
@@ -433,8 +543,8 @@ show_htype1(struct device *d)
   u32 pref_base = get_conf_word(d, PCI_PREF_MEMORY_BASE);
   u32 pref_limit = get_conf_word(d, PCI_PREF_MEMORY_LIMIT);
   u32 pref_type = pref_base & PCI_PREF_RANGE_TYPE_MASK;
-  unsigned long rom = p->rom_base_addr;
   word brc = get_conf_word(d, PCI_BRIDGE_CONTROL);
+  int verb = verbose > 2;
 
   show_bases(d, 2);
   printf("\tBus: primary=%02x, secondary=%02x, subordinate=%02x, sec-latency=%d\n",
@@ -455,43 +565,45 @@ show_htype1(struct device *d)
          io_base |= (get_conf_word(d, PCI_IO_BASE_UPPER16) << 16);
          io_limit |= (get_conf_word(d, PCI_IO_LIMIT_UPPER16) << 16);
        }
-      if (io_base)
+      if (io_base <= io_limit || verb)
        printf("\tI/O behind bridge: %08x-%08x\n", io_base, io_limit+0xfff);
     }
 
   if (mem_type != (mem_limit & PCI_MEMORY_RANGE_TYPE_MASK) ||
       mem_type)
     printf("\t!!! Unknown memory range types %x/%x\n", mem_base, mem_limit);
-  else if (mem_base)
+  else
     {
       mem_base = (mem_base & PCI_MEMORY_RANGE_MASK) << 16;
       mem_limit = (mem_limit & PCI_MEMORY_RANGE_MASK) << 16;
-      printf("\tMemory behind bridge: %08x-%08x\n", mem_base, mem_limit + 0xfffff);
+      if (mem_base <= mem_limit || verb)
+       printf("\tMemory behind bridge: %08x-%08x\n", mem_base, mem_limit + 0xfffff);
     }
 
   if (pref_type != (pref_limit & PCI_PREF_RANGE_TYPE_MASK) ||
       (pref_type != PCI_PREF_RANGE_TYPE_32 && pref_type != PCI_PREF_RANGE_TYPE_64))
     printf("\t!!! Unknown prefetchable memory range types %x/%x\n", pref_base, pref_limit);
-  else if (pref_base)
+  else
     {
       pref_base = (pref_base & PCI_PREF_RANGE_MASK) << 16;
       pref_limit = (pref_limit & PCI_PREF_RANGE_MASK) << 16;
-      if (pref_type == PCI_PREF_RANGE_TYPE_32)
-       printf("\tPrefetchable memory behind bridge: %08x-%08x\n", pref_base, pref_limit + 0xfffff);
-      else
-       printf("\tPrefetchable memory behind bridge: %08x%08x-%08x%08x\n",
-              get_conf_long(d, PCI_PREF_BASE_UPPER32),
-              pref_base,
-              get_conf_long(d, PCI_PREF_LIMIT_UPPER32),
-              pref_limit);
+      if (pref_base <= pref_limit || verb)
+       {
+         if (pref_type == PCI_PREF_RANGE_TYPE_32)
+           printf("\tPrefetchable memory behind bridge: %08x-%08x\n", pref_base, pref_limit + 0xfffff);
+         else
+           printf("\tPrefetchable memory behind bridge: %08x%08x-%08x%08x\n",
+                  get_conf_long(d, PCI_PREF_BASE_UPPER32),
+                  pref_base,
+                  get_conf_long(d, PCI_PREF_LIMIT_UPPER32),
+                  pref_limit);
+       }
     }
 
   if (get_conf_word(d, PCI_SEC_STATUS) & PCI_STATUS_SIG_SYSTEM_ERROR)
     printf("\tSecondary status: SERR\n");
 
-  if (rom & 1)
-    printf("\tExpansion ROM at %08lx%s\n", rom & PCI_ROM_ADDRESS_MASK,
-          (rom & PCI_ROM_ADDRESS_ENABLE) ? "" : " [disabled]");
+  show_rom(d);
 
   if (verbose > 1)
     printf("\tBridgeCtl: Parity%c SERR%c NoISA%c VGA%c MAbort%c >Reset%c FastB2B%c\n",
@@ -502,6 +614,8 @@ show_htype1(struct device *d)
           FLAG(brc, PCI_BRIDGE_CTL_MASTER_ABORT),
           FLAG(brc, PCI_BRIDGE_CTL_BUS_RESET),
           FLAG(brc, PCI_BRIDGE_CTL_FAST_BACK));
+
+  show_caps(d);
 }
 
 static void
@@ -511,6 +625,7 @@ show_htype2(struct device *d)
   word cmd = get_conf_word(d, PCI_COMMAND);
   word brc = get_conf_word(d, PCI_CB_BRIDGE_CONTROL);
   word exca = get_conf_word(d, PCI_CB_LEGACY_MODE_BASE);
+  int verb = verbose > 2;
 
   show_bases(d, 1);
   printf("\tBus: primary=%02x, secondary=%02x, subordinate=%02x, sec-latency=%d\n",
@@ -523,7 +638,7 @@ show_htype2(struct device *d)
       int p = 8*i;
       u32 base = get_conf_long(d, PCI_CB_MEMORY_BASE_0 + p);
       u32 limit = get_conf_long(d, PCI_CB_MEMORY_LIMIT_0 + p);
-      if (limit > base)
+      if (limit > base || verb)
        printf("Memory window %d: %08x-%08x%s%s\n", i, base, limit,
               (cmd & PCI_COMMAND_MEMORY) ? "" : " [disabled]",
               (brc & (PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 << i)) ? " (prefetchable)" : "");
@@ -539,11 +654,10 @@ show_htype2(struct device *d)
          limit &= 0xffff;
        }
       base &= PCI_CB_IO_RANGE_MASK;
-      if (!base)
-       continue;
       limit = (limit & PCI_CB_IO_RANGE_MASK) + 3;
-      printf("I/O window %d: %08x-%08x%s\n", i, base, limit,
-            (cmd & PCI_COMMAND_IO) ? "" : " [disabled]");
+      if (base <= limit || verb)
+       printf("\tI/O window %d: %08x-%08x%s\n", i, base, limit,
+              (cmd & PCI_COMMAND_IO) ? "" : " [disabled]");
     }
 
   if (get_conf_word(d, PCI_CB_SEC_STATUS) & PCI_STATUS_SIG_SYSTEM_ERROR)
@@ -613,11 +727,11 @@ show_verbose(struct device *d)
       return;
     }
 
-  if (verbose && subsys_v && subsys_v != 0xffff)
+  if (subsys_v && subsys_v != 0xffff)
     printf("\tSubsystem: %s\n",
           pci_lookup_name(pacc, ssnamebuf, sizeof(ssnamebuf),
                           PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,
-                          subsys_v, subsys_d));
+                          p->vendor_id, p->device_id, subsys_v, subsys_d));
 
   if (verbose > 1)
     {
@@ -749,17 +863,17 @@ show_machine(struct device *d)
     {
       printf("Device:\t%02x:%02x.%x\n", p->bus, p->dev, p->func);
       printf("Class:\t%s\n",
-            pci_lookup_name(pacc, classbuf, sizeof(classbuf), PCI_LOOKUP_CLASS, get_conf_word(d, PCI_CLASS_DEVICE), 0));
+            pci_lookup_name(pacc, classbuf, sizeof(classbuf), PCI_LOOKUP_CLASS, get_conf_word(d, PCI_CLASS_DEVICE), 0, 0, 0));
       printf("Vendor:\t%s\n",
-            pci_lookup_name(pacc, vendbuf, sizeof(vendbuf), PCI_LOOKUP_VENDOR, p->vendor_id, p->device_id));
+            pci_lookup_name(pacc, vendbuf, sizeof(vendbuf), PCI_LOOKUP_VENDOR, p->vendor_id, p->device_id, 0, 0));
       printf("Device:\t%s\n",
-            pci_lookup_name(pacc, devbuf, sizeof(devbuf), PCI_LOOKUP_DEVICE, p->vendor_id, p->device_id));
+            pci_lookup_name(pacc, devbuf, sizeof(devbuf), PCI_LOOKUP_DEVICE, p->vendor_id, p->device_id, 0, 0));
       if (sv_id && sv_id != 0xffff)
        {
          printf("SVendor:\t%s\n",
-                pci_lookup_name(pacc, svbuf, sizeof(svbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR, sv_id, sd_id));
+                pci_lookup_name(pacc, svbuf, sizeof(svbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR, p->vendor_id, p->device_id, sv_id, sd_id));
          printf("SDevice:\t%s\n",
-                pci_lookup_name(pacc, sdbuf, sizeof(sdbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_DEVICE, sv_id, sd_id));
+                pci_lookup_name(pacc, sdbuf, sizeof(sdbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_DEVICE, p->vendor_id, p->device_id, sv_id, sd_id));
        }
       if (c = get_conf_byte(d, PCI_REVISION_ID))
        printf("Rev:\t%02x\n", c);
@@ -771,19 +885,19 @@ show_machine(struct device *d)
       printf("%02x:%02x.%x ", p->bus, p->dev, p->func);
       printf("\"%s\" \"%s\" \"%s\"",
             pci_lookup_name(pacc, classbuf, sizeof(classbuf), PCI_LOOKUP_CLASS,
-                            get_conf_word(d, PCI_CLASS_DEVICE), 0),
+                            get_conf_word(d, PCI_CLASS_DEVICE), 0, 0, 0),
             pci_lookup_name(pacc, vendbuf, sizeof(vendbuf), PCI_LOOKUP_VENDOR,
-                            p->vendor_id, p->device_id),
+                            p->vendor_id, p->device_id, 0, 0),
             pci_lookup_name(pacc, devbuf, sizeof(devbuf), PCI_LOOKUP_DEVICE,
-                            p->vendor_id, p->device_id));
+                            p->vendor_id, p->device_id, 0, 0));
       if (c = get_conf_byte(d, PCI_REVISION_ID))
        printf(" -r%02x", c);
       if (c = get_conf_byte(d, PCI_CLASS_PROG))
        printf(" -p%02x", c);
       if (sv_id && sv_id != 0xffff)
        printf(" \"%s\" \"%s\"",
-              pci_lookup_name(pacc, svbuf, sizeof(svbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR, sv_id, sd_id),
-              pci_lookup_name(pacc, sdbuf, sizeof(sdbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_DEVICE, sv_id, sd_id));
+              pci_lookup_name(pacc, svbuf, sizeof(svbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR, p->vendor_id, p->device_id, sv_id, sd_id),
+              pci_lookup_name(pacc, sdbuf, sizeof(sdbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_DEVICE, p->vendor_id, p->device_id, sv_id, sd_id));
       else
        printf(" \"\" \"\"");
       putchar('\n');
@@ -988,7 +1102,7 @@ show_tree_dev(struct device *d, byte *line, byte *p)
     p += sprintf(p, "  %s",
                 pci_lookup_name(pacc, namebuf, sizeof(namebuf),
                                 PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,
-                                q->vendor_id, q->device_id));
+                                q->vendor_id, q->device_id, 0, 0));
   print_it(line, p);
 }
 
@@ -1106,13 +1220,16 @@ do_map_bus(int bus)
   for(dev = 0; dev < 32; dev++)
     if (filter.slot < 0 || filter.slot == dev)
       {
-       for(func = 0; func < 8; func++)
+       int func_limit = 1;
+       for(func = 0; func < func_limit; func++)
          if (filter.func < 0 || filter.func == func)
            {
              struct pci_dev *p = pci_get_dev(pacc, bus, dev, func);
              u16 vendor = pci_read_word(p, PCI_VENDOR_ID);
              if (vendor && vendor != 0xffff)
                {
+                 if (!func && (pci_read_byte(p, PCI_HEADER_TYPE) & 0x80))
+                   func_limit = 8;
                  if (verbose)
                    printf("Discovered device %02x:%02x.%d\n", bus, dev, func);
                  bi->exists = 1;