From eb6202399437154dd7385ab21dde326f3a79571b Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 27 Dec 2002 19:01:51 +0000 Subject: [PATCH] (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. --- ChangeLog | 6 ++++++ lib/generic.c | 8 +++----- 2 files changed, 9 insertions(+), 5 deletions(-) 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; } } } -- 2.39.5