In the "Enumerating PCI Buses" section, the code for checking all the functions of a multi-function device starts at function 0 and breaks as soon as a function isn't detected. This requires all the functions of a multi-function device to be numbered consecutively, which I don't think is always true (Bochs for one doesn't appear to).
Code:
void checkDevice(uint8_t bus, uint8_t device) {
uint8_t function = 0;
vendorID = getVendorID(bus, device, function);
if(vendorID = 0xFFFF) return; // Device doesn't exist
checkFunction(bus, device, function);
headerType = getHeaderType(bus, device, function);
if( (headerType & 0x80) != 0) {
/* It is a multi-function device, so check remaining functions */
for(function = 1; function < 8; function++) {
if(getVendorID(bus, device, function) == 0xFFFF) break; // I don't think this is right
checkFunction(bus, device, function);
}
}
}