The PCIe functions are now queried, I also fixed a bug where not all devices on a bus were being queried
1 files changed, 7 insertions(+), 5 deletions(-)

M kernel/src/pcie.c
M kernel/src/pcie.c +7 -5
@@ 111,12 111,14 @@ void pcie_init(struct mcfg* mcfg) {
 		struct mcfg_entry* entry = (struct mcfg_entry*) LOW_TO_HIGH((uint64_t) (mcfg->entries + count));
 
 		for(uint64_t count = entry->start_bus; count < entry->end_bus; ++count) {
-			for(uint64_t dev = 0; dev < 8; ++dev) {
-				struct pcie_header* hdr = (struct pcie_header*) LOW_TO_HIGH((entry->base_addr + (0x100000 * (count - entry->start_bus)) + (0x8000 * dev)));
-				if(hdr->vendor_id == 0xFFFF) {
-					continue;
+			for(uint64_t dev = 0; dev < 0x20; ++dev) {
+				for(uint64_t func = 0; func < 8; ++func) {
+					struct pcie_header* hdr = (struct pcie_header*) LOW_TO_HIGH((entry->base_addr + (0x100000 * (count - entry->start_bus)) + (0x8000 * dev) + (func * 0x1000)));
+					if(hdr->vendor_id == 0xFFFF) {
+						continue;
+					}
+					kprintf("PCIe device: %X:%X\n", hdr->vendor_id, hdr->device_id);
 				}
-				kprintf("PCIe device: %X:%X\n", hdr->vendor_id, hdr->device_id);
 			}
 		}
 	}