Skip to content

Commit

Permalink
pci: enumeration fixes for real hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Oct 6, 2024
1 parent 55be75a commit 5d966d2
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions devices/pci/src/enumerate.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,18 @@ void pciEnumerate() {
uint16_t device = pciReadWord(bus, slot, function, PCI_DEVICE);

if(!vendor || vendor == 0xFFFF) {
if(function) {
function++;
if(function > 7) {
function = 0;
slot++;
if(slot > 31) {
slot = 0;
bus++;
}
function++;
if(function > 7) {
function = 0;
slot++;
if(slot > 31) {
slot = 0;
bus++;
if(bus > 31) break;
}

continue;
} else {
break;
}

continue;
}

uint8_t header = pciReadByte(bus, slot, function, PCI_HEADER_TYPE);
Expand Down

0 comments on commit 5d966d2

Please sign in to comment.