diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2004-12-15 05:48:20 +0000 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2004-12-15 05:48:20 +0000 |
commit | 96d65874af6dbb465d73859b49546e3f334e2a79 (patch) | |
tree | 8223ab568bdadad9578f63e83baa70238d7e9bd5 | |
parent | b6b4d6b3422167f05c1d9780a33b4ef95de1d475 (diff) |
//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>
-rw-r--r-- | hw/xfree86/os-support/bus/linuxPci.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c index 6e33c2550..146dccfd3 100644 --- a/hw/xfree86/os-support/bus/linuxPci.c +++ b/hw/xfree86/os-support/bus/linuxPci.c @@ -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 |