[PATCH libpciaccess] Support for 32-bit domains

Keith Busch keith.busch at intel.com
Tue Aug 9 21:39:35 UTC 2016


A pci "domain" is a purely software construct, and need not be limited
to the 16-bit ACPI defined segment. The Linux kernel currently supports
32-bit domains, so this patch matches up with those capabilities to make
it usable on systems exporting such domains.

Reported-by: Pawel Baldysiak <pawel.baldysiak at intel.com>
Signed-off-by: Keith Busch <keith.busch at intel.com>
---
 include/pciaccess.h | 2 +-
 src/linux_sysfs.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/pciaccess.h b/include/pciaccess.h
index 1d7aa4b..93ed76f 100644
--- a/include/pciaccess.h
+++ b/include/pciaccess.h
@@ -321,7 +321,7 @@ struct pci_device {
      * the domain will always be zero.
      */
     /*@{*/
-    uint16_t    domain;
+    uint32_t    domain;
     uint8_t     bus;
     uint8_t     dev;
     uint8_t     func;
diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
index 6367b11..c0c8f2a 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -159,7 +159,7 @@ populate_entries( struct pci_system * p )
 			(struct pci_device_private *) &p->devices[i];
 
 
-		sscanf(devices[i]->d_name, "%04x:%02x:%02x.%1u",
+		sscanf(devices[i]->d_name, "%x:%02x:%02x.%1u",
 		       & dom, & bus, & dev, & func);
 
 		device->base.domain = dom;
-- 
2.7.2



More information about the xorg-devel mailing list