changeset 9767:f6d2772efca3

Ignore disabled cards. (Jon Burgess <jburgess@uklinux.net>)
author ranma
date Mon, 31 Mar 2003 00:14:36 +0000
parents afb1150cd5de
children c4f158061abd
files libdha/libdha.h libdha/pci.c libdha/test.c vidix/drivers/cyberblade_vid.c vidix/drivers/mach64_vid.c vidix/drivers/mga_vid.c vidix/drivers/pm3_vid.c vidix/drivers/radeon_vid.c
diffstat 8 files changed, 31 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libdha/libdha.h	Sun Mar 30 21:20:04 2003 +0000
+++ b/libdha/libdha.h	Mon Mar 31 00:14:36 2003 +0000
@@ -24,10 +24,12 @@
 #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;
--- a/libdha/pci.c	Sun Mar 30 21:20:04 2003 +0000
+++ b/libdha/pci.c	Mon Mar 31 00:14:36 2003 +0000
@@ -504,6 +504,7 @@
   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 ;
--- a/libdha/test.c	Sun Mar 30 21:20:04 2003 +0000
+++ b/libdha/test.c	Mon Mar 31 00:14:36 2003 +0000
@@ -16,11 +16,11 @@
   }
   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;
--- a/vidix/drivers/cyberblade_vid.c	Sun Mar 30 21:20:04 2003 +0000
+++ b/vidix/drivers/cyberblade_vid.c	Mon Mar 31 00:14:36 2003 +0000
@@ -183,6 +183,11 @@
 				dname = pci_device_name(VENDOR_TRIDENT, lst[i].device);
 				dname = dname ? dname : "Unknown chip";
 				printf("[cyberblade] Found chip: %s\n", dname);
+				if ((lst[i].command & PCI_COMMAND_IO) == 0)
+				{
+					printf("[cyberblade] Device is disabled, ignoring\n");
+					continue;
+				}
 				cyberblade_cap.device_id = lst[i].device;
 				err = 0;
 				memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
--- a/vidix/drivers/mach64_vid.c	Sun Mar 30 21:20:04 2003 +0000
+++ b/vidix/drivers/mach64_vid.c	Mon Mar 31 00:14:36 2003 +0000
@@ -421,6 +421,11 @@
 	dname = pci_device_name(VENDOR_ATI,lst[i].device);
 	dname = dname ? dname : "Unknown chip";
 	printf("[mach64] Found chip: %s\n",dname);
+	if ((lst[i].command & PCI_COMMAND_IO) == 0)
+	{
+		printf("[mach64] Device is disabled, ignoring\n");
+		continue;
+	}
 	if(force > PROBE_NORMAL)
 	{
 	    printf("[mach64] Driver was forced. Was found %sknown chip\n",idx == -1 ? "un" : "");
--- a/vidix/drivers/mga_vid.c	Sun Mar 30 21:20:04 2003 +0000
+++ b/vidix/drivers/mga_vid.c	Mon Mar 31 00:14:36 2003 +0000
@@ -1196,6 +1196,11 @@
 		    i, lst[i].vendor, lst[i].device);
 	    if (lst[i].vendor == VENDOR_MATROX)
 	    {
+		if ((lst[i].command & PCI_COMMAND_IO) == 0)
+		{
+			printf("[mga] Device is disabled, ignoring\n");
+			continue;
+		}
 		switch(lst[i].device)
 		{
 		    case DEVICE_MATROX_MGA_G550_AGP:
--- a/vidix/drivers/pm3_vid.c	Sun Mar 30 21:20:04 2003 +0000
+++ b/vidix/drivers/pm3_vid.c	Mon Mar 31 00:14:36 2003 +0000
@@ -112,6 +112,11 @@
 		dname = pci_device_name(VENDOR_3DLABS, lst[i].device);
 		dname = dname ? dname : "Unknown chip";
 		printf("[pm3] Found chip: %s\n", dname);
+		if ((lst[i].command & PCI_COMMAND_IO) == 0)
+		{
+			printf("[pm3] Device is disabled, ignoring\n");
+			continue;
+		}
 		pm3_cap.device_id = lst[i].device;
 		err = 0;
 		memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
--- a/vidix/drivers/radeon_vid.c	Sun Mar 30 21:20:04 2003 +0000
+++ b/vidix/drivers/radeon_vid.c	Mon Mar 31 00:14:36 2003 +0000
@@ -925,6 +925,11 @@
 	dname = pci_device_name(VENDOR_ATI,lst[i].device);
 	dname = dname ? dname : "Unknown chip";
 	printf(RADEON_MSG" Found chip: %s\n",dname);
+	if ((lst[i].command & PCI_COMMAND_IO) == 0)
+	{
+		printf("[radeon] Device is disabled, ignoring\n");
+		continue;
+	}
 #ifndef RAGE128	
 	if(idx != -1)
 	{