]> mj.ucw.cz Git - pciutils.git/commitdiff
(pci_generic_scan_bus): Added work-around for devices with
authorMartin Mares <mj@ucw.cz>
Fri, 27 Dec 2002 19:01:51 +0000 (19:01 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:10:53 +0000 (14:10 +0200)
discontiguous numbering of functions. This is already present in the Linux
kernel for several years, but I forgot to update pciutils as well.

ChangeLog
lib/generic.c

index 08e3e0fda25d657d395f67b023631492479671f1..6052a2fa87c80a7c6e5a7558395bdab02068a84e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-12-27  Martin Mares  <mj@ucw.cz>
+
+       * lib/generic.c (pci_generic_scan_bus): Added work-around for devices with
+       discontiguous numbering of functions. This is already present in the Linux
+       kernel for several years, but I forgot to update pciutils as well.
+
 2002-12-26  Martin Mares  <mj@ucw.cz>
 
        * lib/header.h, lspci.c: Dump AGP3 flags and speeds.
index d9a9bdd76ad3950d5ccc8f15b2375df81dbf0217..ee95f260694467d9245d7a2db3268a845b541172 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     $Id: generic.c,v 1.7 2002/03/30 15:39:25 mj Exp $
+ *     $Id: generic.c,v 1.8 2002/12/27 19:01:51 mj Exp $
  *
  *     The PCI Library -- Generic Direct Access Functions
  *
@@ -30,13 +30,13 @@ pci_generic_scan_bus(struct pci_access *a, byte *busmap, int bus)
     {
       t->dev = dev;
       multi = 0;
-      for(t->func=0; t->func<8; t->func++)
+      for(t->func=0; !t->func || multi && t->func<8; t->func++)
        {
          u32 vd = pci_read_long(t, PCI_VENDOR_ID);
          struct pci_dev *d;
 
          if (!vd || vd == 0xffffffff)
-           break;
+           continue;
          ht = pci_read_byte(t, PCI_HEADER_TYPE);
          if (!t->func)
            multi = ht & 0x80;
@@ -61,8 +61,6 @@ pci_generic_scan_bus(struct pci_access *a, byte *busmap, int bus)
            default:
              a->debug("Device %02x:%02x.%d has unknown header type %02x.\n", d->bus, d->dev, d->func, ht);
            }
-         if (!multi)
-           break;
        }
     }
 }