@@ 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);
}
}
}