devinfo->revision = gaVPCI_Devices[i].Class & 0xFF;\r
devinfo->class = gaVPCI_Devices[i].Class >> 8;\r
snprintf(devinfo->Name, sizeof(devinfo->Name), "%02x.%02x:%x", 0xFF, i, 0);\r
+ \r
+ #if LIST_DEVICES\r
+ Log_Log("PCI", "Device %i,%i:%i %06x => 0x%04x:0x%04x Rev %i",\r
+ 0xFF, i, 0, devinfo->class,\r
+ devinfo->vendor, devinfo->device, devinfo->revision);\r
+ #endif\r
\r
for(int j = 0; j < 256/4; j ++ )\r
- devinfo->ConfigCache[i] = VPCI_Read(&gaVPCI_Devices[i], j*4, 4);\r
+ devinfo->ConfigCache[j] = VPCI_Read(&gaVPCI_Devices[i], j*4, 4);\r
\r
memset(&devinfo->Node, 0, sizeof(devinfo->Node));\r
devinfo->Node.Inode = giPCI_DeviceCount;\r
case 0: // Vendor[0:15], Device[16:31]
tmp_dword = (Dev->Vendor) | (Dev->Device << 16);
break;
+ // 1: Command[0:15], Status[16:31]
case 2: // Class Code
tmp_dword = Dev->Class;
break;
- // 1: Command[0:15], Status[16:31]
// 3: Cache Line Size, Latency Timer, Header Type, BIST
- // 4-9: BARs
+ case 4 ... 9: // 4-9: BARs
+ tmp_dword = Dev->BARs[ (Offset>>2) - 4 ];
+ break;
// 10: Unused (Cardbus CIS Pointer)
// 11: Subsystem Vendor ID, Subsystem ID
// 12: Expansion ROM Address
// 14: Reserved
// 15: Interrupt Line, Interrupt Pin, Min Grant, Max Latency
default:
- tmp_dword = Dev->Read(Dev->Ptr, Offset >> 2);
+ if( Dev->Read )
+ tmp_dword = Dev->Read(Dev->Ptr, Offset >> 2);
break;
}
return ;
}
- tmp_dword = Dev->Read(Dev->Ptr, Offset>>2);
+ if( Size != 4 && Dev->Read )
+ tmp_dword = Dev->Read(Dev->Ptr, Offset>>2);
+ else
+ tmp_dword = 0;
switch(Size)
{
case 4: tmp_dword = 0; break;
break;
}
tmp_dword |= Data << ((Offset&3)*8);
- Dev->Write(Dev->Ptr, Offset>>2, tmp_dword);
+ if( Dev->Write )
+ Dev->Write(Dev->Ptr, Offset>>2, tmp_dword);
}