/* * Read configuration space register */ static u_int32_t pci_do_cfgregread(int bus, int slot, int func, int reg, int bytes) { #ifdef USE_PCI_BIOS_FOR_READ_WRITE return(usebios ? pcibios_cfgread(bus, slot, func, reg, bytes) : pcireg_cfgread(bus, slot, func, reg, bytes)); #else return (pcireg_cfgread(bus, slot, func, reg, bytes)); #endif }
int pcicfgread(pcihdl_t *handle, int off, int *val) { int ret; ret = pcibios_cfgread(*handle, off, val); if (ret) return -1; return 0; }