commit 1c1e4402427b9ef63374ab677c52e7b9b4fee9c4
parent b689c798238981e206011b47bf539c4873967814
Author: Matsuda Kenji <info@mtkn.jp>
Date: Sat, 13 Apr 2024 13:32:53 +0900
check if the device is multifunctional
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sys/src/kernel/amd64/pci.c b/sys/src/kernel/amd64/pci.c
@@ -76,7 +76,10 @@ int
pci_scan_dev(uint8 bus, uint8 dev)
{
int func;
- for (func = 0; func < 8; func++) {
+ if (pci_config_read_vendor_id(bus, dev, 0) == 0xffff) {
+ return pci_scan_func(bus, dev, 0);
+ }
+ for (func = 1; func < 8; func++) {
if (pci_config_read_vendor_id(bus, dev, func) == 0xffff) {
continue;
}