summaryrefslogtreecommitdiffstats
path: root/libdha
diff options
context:
space:
mode:
authorranma <ranma@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-03-31 00:14:36 +0000
committerranma <ranma@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-03-31 00:14:36 +0000
commite25e1515c08938cf51889390a232cd661eb8019c (patch)
tree3828d17c0a472ea8450bc64f5226e32e13671d17 /libdha
parent3518a6dff2df60847fffbd8d0849d443de449a3c (diff)
downloadmpv-e25e1515c08938cf51889390a232cd661eb8019c.tar.bz2
mpv-e25e1515c08938cf51889390a232cd661eb8019c.tar.xz
Ignore disabled cards. (Jon Burgess <jburgess@uklinux.net>)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9768 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libdha')
-rw-r--r--libdha/libdha.h2
-rw-r--r--libdha/pci.c1
-rw-r--r--libdha/test.c6
3 files changed, 6 insertions, 3 deletions
diff --git a/libdha/libdha.h b/libdha/libdha.h
index 54afad8b8c..3135b34b76 100644
--- a/libdha/libdha.h
+++ b/libdha/libdha.h
@@ -24,10 +24,12 @@ extern "C" {
#define MAX_PCI_DEVICES_PER_BUS 32
#define MAX_PCI_DEVICES 64
#define PCI_MULTIFUNC_DEV 0x80
+#define PCI_COMMAND_IO 0x1 /* Enable response to I/O space */
typedef struct pciinfo_s
{
int bus,card,func; /* PCI/AGP bus:card:func */
+ unsigned short command; /* Device control register */
unsigned short vendor,device; /* Card vendor+device ID */
unsigned base0,base1,base2,baserom; /* Memory and I/O base addresses */
// unsigned base0_limit, base1_limit, base2_limit, baserom_limit;
diff --git a/libdha/pci.c b/libdha/pci.c
index 7520ab8cae..adf0c5db82 100644
--- a/libdha/pci.c
+++ b/libdha/pci.c
@@ -504,6 +504,7 @@ static void identify_card(struct pci_config_reg *pcr, int idx)
pci_lst[idx].bus = pcibus ;
pci_lst[idx].card = pcicard ;
pci_lst[idx].func = pcifunc ;
+ pci_lst[idx].command = pcr->_status_command & 0xFFFF;
pci_lst[idx].vendor = pcr->_vendor ;
pci_lst[idx].device = pcr->_device ;
pci_lst[idx].base0 = 0xFFFFFFFF ;
diff --git a/libdha/test.c b/libdha/test.c
index 41aa466d1d..6538ab28c2 100644
--- a/libdha/test.c
+++ b/libdha/test.c
@@ -16,11 +16,11 @@ int main( void )
}
else
{
- printf(" Bus:card:func vend:dev base0 :base1 :base2 :baserom\n");
+ printf(" Bus:card:func vend:dev command base0 :base1 :base2 :baserom\n");
for(i=0;i<num_pci;i++)
- printf("%04X:%04X:%04X %04X:%04X %08X:%08X:%08X:%08X\n"
+ printf("%04X:%04X:%04X %04X:%04X %04X %08X:%08X:%08X:%08X\n"
,lst[i].bus,lst[i].card,lst[i].func
- ,lst[i].vendor,lst[i].device
+ ,lst[i].vendor,lst[i].device,lst[i].command
,lst[i].base0,lst[i].base1,lst[i].base2,lst[i].baserom);
}
return EXIT_SUCCESS;