From: Martin Mares Date: Fri, 27 Dec 2002 19:01:51 +0000 (+0000) Subject: (pci_generic_scan_bus): Added work-around for devices with X-Git-Tag: v3.0.0~186 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=eb6202399437154dd7385ab21dde326f3a79571b;p=pciutils.git (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. --- diff --git a/ChangeLog b/ChangeLog index 08e3e0f..6052a2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-12-27 Martin Mares + + * 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 * lib/header.h, lspci.c: Dump AGP3 flags and speeds. diff --git a/lib/generic.c b/lib/generic.c index d9a9bdd..ee95f26 100644 --- a/lib/generic.c +++ b/lib/generic.c @@ -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; } } }