Felix Singer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46346 )
Change subject: libpayload/libpci: Add parent pointer to pci_dev ......................................................................
libpayload/libpci: Add parent pointer to pci_dev
Change-Id: I4c0aa4f23d4173c09cfc343f657be9eefc8038d1 Signed-off-by: Felix Singer felix.singer@secunet.com --- M payloads/libpayload/include/pci/pci.h M payloads/libpayload/libpci/libpci.c 2 files changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/46346/1
diff --git a/payloads/libpayload/include/pci/pci.h b/payloads/libpayload/include/pci/pci.h index 8c11d6b..37aeafa 100644 --- a/payloads/libpayload/include/pci/pci.h +++ b/payloads/libpayload/include/pci/pci.h @@ -74,6 +74,7 @@ u16 domain; u8 bus, dev, func; u16 vendor_id, device_id; + struct pci_dev *parent; struct pci_dev *next; };
diff --git a/payloads/libpayload/libpci/libpci.c b/payloads/libpayload/libpci/libpci.c index 3e3513c..50cd228 100644 --- a/payloads/libpayload/libpci/libpci.c +++ b/payloads/libpayload/libpci/libpci.c @@ -170,7 +170,11 @@ val == 0x0000ffff || val == 0xffff0000) continue;
+ /* Create new child device */ dev->next = malloc(sizeof(struct pci_dev)); + dev->next->parent = dev; + + /* Configure new child device */ dev = dev->next; dev->domain = 0; dev->bus = bus;