diff options
author | Matthias Hopf <mhopf@suse.de> | 2006-11-02 18:53:41 +0100 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2006-11-10 15:04:51 -0500 |
commit | f816eafa51a6386a96d4e5ca9de5359c66bb3033 (patch) | |
tree | e1fd91e09d18b8c24e7ef20ac4c7674c097275df | |
parent | 6d56600c0ce670cdca3b4f7da3838e1476185916 (diff) |
Fix device path in altixPCI.c to be domain aware.
(cherry picked from d50fc413b39f52663b46084c28e81fc4933a7b49 commit)
-rw-r--r-- | hw/xfree86/os-support/bus/altixPCI.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/xfree86/os-support/bus/altixPCI.c b/hw/xfree86/os-support/bus/altixPCI.c index 010f6619a..7a72ec6e7 100644 --- a/hw/xfree86/os-support/bus/altixPCI.c +++ b/hw/xfree86/os-support/bus/altixPCI.c @@ -41,13 +41,14 @@ static pciDevice *get_dev_on_bus(unsigned int segnum, unsigned int busnum) static void get_bridge_info(pciBusInfo_t *bus_info, pciDevice *pdev) { unsigned int parent_segnum, segnum = PCI_DOM_FROM_TAG(pdev->tag); - unsigned int parent_busnum, busnum = pdev->busnum; + unsigned int parent_busnum, parent_nodombus, busnum = pdev->busnum; + unsigned int nodombus = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(pdev->tag)); char bridge_path[] = "/sys/class/pci_bus/0000:00/bridge"; char bridge_target[] = "../../../devices/pci0000:00"; /* Path to this device's bridge */ sprintf(bridge_path, "/sys/class/pci_bus/%04x:%02x/bridge", segnum, - busnum); + nodombus); if (readlink(bridge_path, bridge_target, strlen(bridge_target)) < 0) { perror("failed to dereference bridge link"); @@ -56,7 +57,9 @@ static void get_bridge_info(pciBusInfo_t *bus_info, pciDevice *pdev) } sscanf(bridge_target, "../../../devices/pci%04x:%02x", &parent_segnum, - &parent_busnum); + &parent_nodombus); + + parent_busnum = PCI_MAKE_BUS(parent_segnum, parent_nodombus); /* * If there's no bridge or the bridge points to the device, use |