summaryrefslogtreecommitdiffstats
path: root/libdha/pci.c
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-20 12:12:58 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-20 12:12:58 +0000
commit3611dab34d4ab05e30e9ddcdf3e9ad9f8ee7c8c6 (patch)
treef182388743f2d99487b1d46f184e9b7dcb0e0d4e /libdha/pci.c
parente016034afc0ee81765527ec850759b5902677d7d (diff)
downloadmpv-3611dab34d4ab05e30e9ddcdf3e9ad9f8ee7c8c6.tar.bz2
mpv-3611dab34d4ab05e30e9ddcdf3e9ad9f8ee7c8c6.tar.xz
pci_config_read working
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4278 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libdha/pci.c')
-rw-r--r--libdha/pci.c16
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);
}