Kernel/PCI - Fixed bug causing all BARs to be off
authorJohn Hodge <[email protected]>
Fri, 28 Oct 2011 13:36:22 +0000 (21:36 +0800)
committerJohn Hodge <[email protected]>
Fri, 28 Oct 2011 13:36:22 +0000 (21:36 +0800)
Kernel/drv/pci.c

index 4123336..c176f47 100644 (file)
@@ -272,7 +272,7 @@ int PCI_CountDevices(Uint16 vendor, Uint16 device)
 tPCIDev PCI_GetDevice(Uint16 vendor, Uint16 device, int idx)\r
 {\r
         int    i, j=0;\r
-       for(i=0;i<giPCI_DeviceCount;i++)\r
+       for( i = 0; i < giPCI_DeviceCount; i ++ )\r
        {\r
                if(gPCI_Devices[i].vendor != vendor)    continue;\r
                if(gPCI_Devices[i].device != device)    continue;\r
@@ -442,7 +442,7 @@ int PCI_int_EnumDevice(Uint16 bus, Uint16 slot, Uint16 fcn, tPCIDevice *info)
                return 0;\r
 \r
        info->ConfigCache[0] = vendor_dev;\r
-       for( i = 1; i < 256/4; i ++, addr += 4 )\r
+       for( i = 1, addr += 4; i < 256/4; i ++, addr += 4 )\r
        {\r
                info->ConfigCache[i] = PCI_CfgReadDWord(addr);\r
        }       \r
@@ -456,11 +456,11 @@ int PCI_int_EnumDevice(Uint16 bus, Uint16 slot, Uint16 fcn, tPCIDevice *info)
        info->revision = tmp & 0xFFFF;\r
        info->oc = tmp >> 16;\r
        \r
-       //#if LIST_DEVICES\r
-       //Log("BAR0 0x%08x BAR1 0x%08x BAR2 0x%08x", info->ConfigCache[4], info->ConfigCache[5], info->ConfigCache[6]);\r
-       //Log("BAR3 0x%08x BAR4 0x%08x BAR5 0x%08x", info->ConfigCache[7], info->ConfigCache[8], info->ConfigCache[9]);\r
-       //Log("Class: 0x%04x", info->oc);\r
-       //#endif\r
+//     #if LIST_DEVICES\r
+//     Log("BAR0 0x%08x BAR1 0x%08x BAR2 0x%08x", info->ConfigCache[4], info->ConfigCache[5], info->ConfigCache[6]);\r
+//     Log("BAR3 0x%08x BAR4 0x%08x BAR5 0x%08x", info->ConfigCache[7], info->ConfigCache[8], info->ConfigCache[9]);\r
+//     Log("Class: 0x%04x", info->oc);\r
+//     #endif\r
        \r
        // Make node name\r
        info->Name[0] = '0' + bus/10;\r

UCC git Repository :: git.ucc.asn.au