pci: Disable multiple functions
Every PCI device is exposed as a separate device, on a specific PCI slot, and we explicitely don't support to expose a device as a multi function device. For this reason, this patch makes sure the enumeration of the PCI bus will not find some multi function device. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
f86b9dd95e
commit
b6ae2ccda4
1 changed files with 6 additions and 1 deletions
|
|
@ -125,7 +125,7 @@ impl PciConfigIo {
|
|||
return 0xffff_ffff;
|
||||
}
|
||||
|
||||
let (bus, device, _function, register) =
|
||||
let (bus, device, function, register) =
|
||||
parse_config_address(self.config_address & !0x8000_0000);
|
||||
|
||||
// Only support one bus.
|
||||
|
|
@ -133,6 +133,11 @@ impl PciConfigIo {
|
|||
return 0xffff_ffff;
|
||||
}
|
||||
|
||||
// Don't support multi-function devices.
|
||||
if function > 0 {
|
||||
return 0xffff_ffff;
|
||||
}
|
||||
|
||||
self.devices.get(device).map_or(0xffff_ffff, |d| {
|
||||
d.lock().unwrap().read_config_register(register)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue