public void CreatePCIDevices()
{
// Find PCI controller devices
var devices = deviceManager.GetDevices(new IsPCIController(), new IsOnline());
if (devices.Count == 0)
return;
var pciController = devices.First.Value as IPCIController;
// For each controller
for (int bus = 0; bus < 255; bus++)
{
for (int slot = 0; slot < 16; slot++)
{
for (int fun = 0; fun < 7; fun++)
{
if (ProbeDevice(pciController, (byte)bus, (byte)slot, (byte)fun))
{
var pciDevice = new PCI.PCIDevice(pciController, (byte)bus, (byte)slot, (byte)fun);
deviceManager.Add(pciDevice);
}
}
}
}
}