summaryrefslogtreecommitdiff
path: root/src/openbsd_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/openbsd_pci.c')
-rw-r--r--src/openbsd_pci.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/openbsd_pci.c b/src/openbsd_pci.c
index b859456..ce3411f 100644
--- a/src/openbsd_pci.c
+++ b/src/openbsd_pci.c
@@ -110,8 +110,7 @@ pci_device_openbsd_read_rom(struct pci_device *device, void *buffer)
pciaddr_t rom_base;
pciaddr_t rom_size;
u_int32_t csr, rom;
- int pci_rom;
- int bus, dev, func;
+ int pci_rom, bus, dev, func;
bus = device->bus;
dev = device->dev;
@@ -385,7 +384,8 @@ pci_device_openbsd_probe(struct pci_device *device)
}
}
}
- /* Expansion ROM if present */
+
+ /* Probe expansion ROM if present */
err = pci_read(bus, dev, func, PCI_ROM_REG, &reg);
if (err)
return err;
@@ -395,6 +395,7 @@ pci_device_openbsd_probe(struct pci_device *device)
return err;
pci_read(bus, dev, func, PCI_ROM_REG, &size);
pci_write(bus, dev, func, PCI_ROM_REG, reg);
+
if (PCI_ROM_ADDR(reg) != 0) {
priv->rom_base = PCI_ROM_ADDR(reg);
device->rom_size = PCI_ROM_SIZE(size);