//bugs.freedesktop.org/show_bug.cgi?id=1963) attachment #1424

(https://bugs.freedesktop.org/attachment.cgi?id=1424): The OS specific
    PCI code for Linux worked only if bus 0 was populated as it checked for
    the presence of /proc/bus/pci/00. Fixed to check for
    /proc/bus/pci/<bus_to_look_for> instead. Patch by Egbert Eich
    <eich@freedesktop.org>
This commit is contained in:
Roland Mainz 2004-12-15 05:48:20 +00:00
parent b6b4d6b342
commit 96d65874af

View file

@ -113,14 +113,16 @@ linuxPciOpenFile(PCITAG tag)
if (fd != -1)
close(fd);
if (bus < 256) {
if (stat("/proc/bus/pci/00", &ignored) < 0)
sprintf(file,"/proc/bus/pci/%02x",bus);
if (stat(file, &ignored) < 0)
sprintf(file, "/proc/bus/pci/0000:%02x/%02x.%1x",
bus, dev, func);
else
sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
bus, dev, func);
} else {
if (stat("/proc/bus/pci/00", &ignored) < 0)
sprintf(file,"/proc/bus/pci/%04x",bus);
if (stat(file, &ignored) < 0)
sprintf(file, "/proc/bus/pci/0000:%04x/%02x.%1x",
bus, dev, func);
else