[Mplayer-cvslog] CVS: main/libdha pci.c,1.6,1.7 libdha.h,1.4,1.5

Alex Beregszaszi alex at mplayer.dev.hu
Sun Jan 20 13:13:09 CET 2002


Update of /cvsroot/mplayer/main/libdha
In directory mplayer:/var/tmp.root/cvs-serv10342

Modified Files:
	pci.c libdha.h 
Log Message:
pci_config_read working

Index: pci.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/pci.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- pci.c	16 Jan 2002 08:43:22 -0000	1.6
+++ pci.c	20 Jan 2002 12:12:58 -0000	1.7
@@ -593,6 +593,7 @@
 					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 @@
 #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);
 }
 

Index: libdha.h
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/libdha.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- libdha.h	16 Jan 2002 08:43:22 -0000	1.4
+++ libdha.h	20 Jan 2002 12:12:58 -0000	1.5
@@ -30,11 +30,12 @@
   int		bus,card,func;			/* PCI/AGP bus:card:func */
   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;
 }pciinfo_t;
 
 /* needed for mga_vid */
-extern int pci_config_read(unsigned char bus, unsigned char dev, unsigned char offset,
-			int len, unsigned long *val);
+extern int pci_config_read(unsigned char bus, unsigned char dev, unsigned char func,
+			unsigned char cmd, int len, unsigned long *val);
 			/* Fill array pci_list which must have size MAX_PCI_DEVICES
 			   and return 0 if sucessful */
 extern int  pci_scan(pciinfo_t *pci_list,unsigned *num_card);




More information about the MPlayer-cvslog mailing list