IN PPCI_COMMON_CONFIG PciData)
{
PCHAR p, ClassName, Boundary, SubClassName, VendorName, ProductName, SubVendorName;
+ UCHAR HeaderType;
ULONG Length;
CHAR LookupString[16] = "";
CHAR bSubClassName[64] = "Unknown";
CHAR bSubVendorName[128] = "Unknown";
ULONG Size, Mem, b;
+ HeaderType = (PciData->HeaderType & ~PCI_MULTIFUNCTION);
+
/* Isolate the class name */
sprintf(LookupString, "C %02x ", PciData->BaseClass);
ClassName = strstr((PCHAR)ClassTable, LookupString);
p += strlen("\r\n");
}
Boundary = p;
+ SubVendorName = NULL;
- /* Isolate the subvendor and subsystem name */
- sprintf(LookupString,
- "\t\t%04x %04x ",
- PciData->u.type0.SubVendorID,
- PciData->u.type0.SubSystemID);
- SubVendorName = strstr(ProductName, LookupString);
- if (Boundary && SubVendorName >= Boundary)
+ if (HeaderType == PCI_DEVICE_TYPE)
{
- SubVendorName = NULL;
+ /* Isolate the subvendor and subsystem name */
+ sprintf(LookupString,
+ "\t\t%04x %04x ",
+ PciData->u.type0.SubVendorID,
+ PciData->u.type0.SubSystemID);
+ SubVendorName = strstr(ProductName, LookupString);
+ if (Boundary && SubVendorName >= Boundary)
+ {
+ SubVendorName = NULL;
+ }
}
if (SubVendorName)
{
}
/* Print out the data */
- DbgPrint("%02x:%02x.%x %s [%02x%02x]: %s %s [%04x:%04x] (rev %02x)\n"
- "\tSubsystem: %s [%04x:%04x]\n",
+ DbgPrint("%02x:%02x.%x %s [%02x%02x]: %s %s [%04x:%04x] (rev %02x)\n",
i,
j,
k,
bProductName,
PciData->VendorID,
PciData->DeviceID,
- PciData->RevisionID,
- bSubVendorName,
- PciData->u.type0.SubVendorID,
- PciData->u.type0.SubSystemID);
+ PciData->RevisionID);
+
+ if (HeaderType == PCI_DEVICE_TYPE)
+ {
+ DbgPrint("\tSubsystem: %s [%04x:%04x]\n",
+ bSubVendorName,
+ PciData->u.type0.SubVendorID,
+ PciData->u.type0.SubSystemID);
+ }
/* Print out and decode flags */
DbgPrint("\tFlags:");
else if (PciData->u.type0.InterruptPin != 0) DbgPrint(", IRQ assignment required");
DbgPrint("\n");
- if ((PciData->HeaderType & ~PCI_MULTIFUNCTION) == PCI_BRIDGE_TYPE &&
- PciData->BaseClass == PCI_CLASS_BRIDGE_DEV)
+ if (HeaderType == PCI_BRIDGE_TYPE)
{
DbgPrint("\tBridge:");
DbgPrint(" primary bus %d,", PciData->u.type1.PrimaryBus);
/* Scan addresses */
Size = 0;
- for (b = 0; b < PCI_TYPE0_ADDRESSES; b++)
+ for (b = 0; b < (HeaderType == PCI_DEVICE_TYPE ? PCI_TYPE0_ADDRESSES : PCI_TYPE1_ADDRESSES); b++)
{
/* Check for a BAR */
- Mem = PciData->u.type0.BaseAddresses[b];
+ if (HeaderType != PCI_CARDBUS_BRIDGE_TYPE)
+ Mem = PciData->u.type0.BaseAddresses[b];
+ else
+ Mem = 0;
if (Mem)
{
/* Decode the address type */