diff options
Diffstat (limited to 'libdha/pci.c')
-rw-r--r-- | libdha/pci.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libdha/pci.c b/libdha/pci.c index 21ee1b749b..2b54bb2ff7 100644 --- a/libdha/pci.c +++ b/libdha/pci.c @@ -593,6 +593,7 @@ int pci_scan(pciinfo_t *pci_list,unsigned *num_pci) pcr._cardnum,func,PCI_INTERRUPT_REG); pcr._user_config = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx], pcr._cardnum,func,PCI_REG_USERCONFIG); + printf("user_config dword: %x\n", pcr._user_config); /* check for pci-pci bridges */ #define PCI_CLASS_MASK 0xff000000 #define PCI_SUBCLASS_MASK 0x00ff0000 @@ -707,17 +708,24 @@ int pci_scan(pciinfo_t *pci_list,unsigned *num_pci) #endif #endif -int pci_config_read(unsigned char bus, unsigned char dev, - unsigned char offset, int len, unsigned long *val) +int pci_config_read(unsigned char bus, unsigned char dev, unsigned char func, + unsigned char cmd, int len, unsigned long *val) { + int ret; + if (len != 4) { printf("pci_config_read: reading non-dword not supported!\n"); return(ENOTSUP); } - *val = pci_config_read_long(bus, dev, offset, 0); - + ret = enable_os_io(); + if (ret != 0) + return(ret); + ret = pci_config_read_long(bus, dev, func, cmd); + disable_os_io(); + + *val = ret; return(0); } |