aboutsummaryrefslogtreecommitdiff
path: root/pci-arbiter/pcifs.c
diff options
context:
space:
mode:
authorJoan Lledó <jlledom@member.fsf.org>2020-09-13 20:16:16 +0200
committerJoan Lledó <jlledom@member.fsf.org>2020-09-13 20:16:16 +0200
commit88d7363db23f8dba06ed260e10b5c7f40538565c (patch)
tree834dbe1d7ec9d054d484b056c0bfb8ad2353122a /pci-arbiter/pcifs.c
parent7f93e803bf9cbdf9db86d3f718f527880fada358 (diff)
downloadhurd-88d7363db23f8dba06ed260e10b5c7f40538565c.tar.gz
hurd-88d7363db23f8dba06ed260e10b5c7f40538565c.tar.bz2
hurd-88d7363db23f8dba06ed260e10b5c7f40538565c.zip
pci-arbiter: Probe devices and map regions
This adapts the arbiter to a bug fixed in libpciaccess. We were relying on the library to probe devices and map regions but it's the arbiter who should do it. * pci-arbiter/pcifs.c: * create_fs_tree(): probe the device to find regions and rom * pci-arbiter/func_files.c: * io_region_file(): map region on the first access attempt
Diffstat (limited to 'pci-arbiter/pcifs.c')
-rw-r--r--pci-arbiter/pcifs.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/pci-arbiter/pcifs.c b/pci-arbiter/pcifs.c
index 615e8753..0535779e 100644
--- a/pci-arbiter/pcifs.c
+++ b/pci-arbiter/pcifs.c
@@ -180,12 +180,17 @@ create_fs_tree (struct pcifs * fs)
nentries += 2; /* func dir + config */
- for (j = 0; j < 6; j++)
- if (device->regions[j].size > 0)
- nentries++; /* + memory region */
+ /* Probe the device to find regions and rom */
+ err = pci_device_probe (device);
+ if (!err)
+ {
+ for (j = 0; j < 6; j++)
+ if (device->regions[j].size > 0)
+ nentries++; /* + memory region */
- if (device->rom_size)
- nentries++; /* + rom */
+ if (device->rom_size)
+ nentries++; /* + rom */
+ }
}
pci_iterator_destroy(iter);