try at taking into account the subvendor id and the subsystem id for device info
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18805 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -21,7 +21,8 @@
|
|||||||
|
|
||||||
|
|
||||||
void get_vendor_info(uint16 vendorID, const char **venShort, const char **venFull);
|
void get_vendor_info(uint16 vendorID, const char **venShort, const char **venFull);
|
||||||
void get_device_info(uint16 vendorID, uint16 deviceID, const char **devShort, const char **devFull);
|
void get_device_info(uint16 vendorID, uint16 deviceID, uint16 subvendorID,
|
||||||
|
uint16 subsystemID, const char **devShort, const char **devFull);
|
||||||
const char *get_class_info(uint8 class_base, uint8 class_sub, uint8 class_api);
|
const char *get_class_info(uint8 class_base, uint8 class_sub, uint8 class_api);
|
||||||
const char *get_capability_name(uint8 cap_id);
|
const char *get_capability_name(uint8 cap_id);
|
||||||
|
|
||||||
@@ -172,7 +173,8 @@ print_info_basic(const pci_info *info, bool verbose)
|
|||||||
}
|
}
|
||||||
const char *devShort;
|
const char *devShort;
|
||||||
const char *devFull;
|
const char *devFull;
|
||||||
get_device_info(info->vendor_id, info->device_id, &devShort, &devFull);
|
get_device_info(info->vendor_id, info->device_id, info->u.h0.subsystem_vendor_id, info->u.h0.subsystem_id,
|
||||||
|
&devShort, &devFull);
|
||||||
if (!devShort && !devFull) {
|
if (!devShort && !devFull) {
|
||||||
TRACE(("PCI: device %04x: Unknown\n", info->device_id));
|
TRACE(("PCI: device %04x: Unknown\n", info->device_id));
|
||||||
} else if (devShort && devFull) {
|
} else if (devShort && devFull) {
|
||||||
@@ -679,16 +681,30 @@ get_vendor_info(uint16 vendorID, const char **venShort, const char **venFull)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
get_device_info(uint16 vendorID, uint16 deviceID, const char **devShort, const char **devFull)
|
get_device_info(uint16 vendorID, uint16 deviceID,
|
||||||
|
uint16 subvendorID, uint16 subsystemID, const char **devShort, const char **devFull)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < (int)PCI_DEVTABLE_LEN; i++) {
|
int i;
|
||||||
|
*devShort = NULL;
|
||||||
|
*devFull = NULL;
|
||||||
|
|
||||||
|
// search for the device
|
||||||
|
for (i = 0; i < (int)PCI_DEVTABLE_LEN; i++) {
|
||||||
if (PciDevTable[i].VenId == vendorID && PciDevTable[i].DevId == deviceID ) {
|
if (PciDevTable[i].VenId == vendorID && PciDevTable[i].DevId == deviceID ) {
|
||||||
*devShort = PciDevTable[i].Chip && PciDevTable[i].Chip[0] ? PciDevTable[i].Chip : NULL;
|
*devShort = PciDevTable[i].Chip && PciDevTable[i].Chip[0] ? PciDevTable[i].Chip : NULL;
|
||||||
*devFull = PciDevTable[i].ChipDesc && PciDevTable[i].ChipDesc[0] ? PciDevTable[i].ChipDesc : NULL;
|
*devFull = PciDevTable[i].ChipDesc && PciDevTable[i].ChipDesc[0] ? PciDevTable[i].ChipDesc : NULL;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*devShort = NULL;
|
|
||||||
*devFull = NULL;
|
// search for the subsystem eventually
|
||||||
|
for (; i < (int)PCI_DEVTABLE_LEN; i++) {
|
||||||
|
if (PciDevTable[i].VenId != vendorID || PciDevTable[i].DevId != deviceID)
|
||||||
|
break;
|
||||||
|
if (PciDevTable[i].SubVenId == subvendorID && PciDevTable[i].SubDevId == subsystemID ) {
|
||||||
|
*devShort = PciDevTable[i].Chip && PciDevTable[i].Chip[0] ? PciDevTable[i].Chip : NULL;
|
||||||
|
*devFull = PciDevTable[i].ChipDesc && PciDevTable[i].ChipDesc[0] ? PciDevTable[i].ChipDesc : NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif /* USE_PCI_HEADER */
|
#endif /* USE_PCI_HEADER */
|
||||||
|
|||||||
@@ -58,10 +58,14 @@ BEGIN {
|
|||||||
device = substr($0, 8)
|
device = substr($0, 8)
|
||||||
gsub( /\"/, "\\\"", device )
|
gsub( /\"/, "\\\"", device )
|
||||||
|
|
||||||
|
# store device ID for possible devices afterwards
|
||||||
|
deviceid = $1
|
||||||
devicecount++
|
devicecount++
|
||||||
devices[devicecount, 1] = vendorid
|
devices[devicecount, 1] = vendorid
|
||||||
devices[devicecount, 2] = $1
|
devices[devicecount, 2] = $1
|
||||||
devices[devicecount, 3] = device
|
devices[devicecount, 3] = 0
|
||||||
|
devices[devicecount, 4] = 0
|
||||||
|
devices[devicecount, 5] = device
|
||||||
}
|
}
|
||||||
|
|
||||||
# matches subvendor device
|
# matches subvendor device
|
||||||
@@ -71,9 +75,11 @@ BEGIN {
|
|||||||
gsub( /\"/, "\\\"", device )
|
gsub( /\"/, "\\\"", device )
|
||||||
|
|
||||||
devicecount++
|
devicecount++
|
||||||
devices[devicecount, 1] = $1
|
devices[devicecount, 1] = vendorid
|
||||||
devices[devicecount, 2] = $2
|
devices[devicecount, 2] = deviceid
|
||||||
devices[devicecount, 3] = device
|
devices[devicecount, 3] = $1
|
||||||
|
devices[devicecount, 4] = $2
|
||||||
|
devices[devicecount, 5] = device
|
||||||
}
|
}
|
||||||
|
|
||||||
# match device class - store data for later
|
# match device class - store data for later
|
||||||
@@ -123,7 +129,7 @@ END {
|
|||||||
|
|
||||||
if ( devicecount > 0 ) {
|
if ( devicecount > 0 ) {
|
||||||
|
|
||||||
print "typedef struct _PCI_DEVTABLE\n{\n\tunsigned short VenId ;\n\tunsigned short DevId ;\n\tchar *\tChipDesc ;\n\tchar *\tChip;\n} PCI_DEVTABLE, *PPCI_DEVTABLE ;\n" > ofile
|
print "typedef struct _PCI_DEVTABLE\n{\n\tunsigned short VenId ;\n\tunsigned short DevId ;\n\tunsigned short\tSubVenId ;\n\tunsigned short\tSubDevId ;\n\tchar *\tChipDesc ;\n\tchar *\tChip;\n} PCI_DEVTABLE, *PPCI_DEVTABLE ;\n" > ofile
|
||||||
print "PCI_DEVTABLE\tPciDevTable [] =\n{" > ofile
|
print "PCI_DEVTABLE\tPciDevTable [] =\n{" > ofile
|
||||||
for (i = 1; i <= devicecount; i++) {
|
for (i = 1; i <= devicecount; i++) {
|
||||||
|
|
||||||
@@ -132,7 +138,7 @@ END {
|
|||||||
} else {
|
} else {
|
||||||
formatting = ""
|
formatting = ""
|
||||||
}
|
}
|
||||||
printf formatting "\t{ 0x" devices[i, 1] ", 0x" devices[i, 2] ", \"" devices[i, 3] "\" }" > ofile
|
printf formatting "\t{ 0x" devices[i, 1] ", 0x" devices[i, 2] ", 0x" devices[i, 3] ", 0x" devices[i, 4] ", \"" devices[i, 5] "\" }" > ofile
|
||||||
}
|
}
|
||||||
print "\n} ;\n\n// Use this value for loop control during searching:\n#define PCI_DEVTABLE_LEN (sizeof(PciDevTable)/sizeof(PCI_DEVTABLE))\n" > ofile
|
print "\n} ;\n\n// Use this value for loop control during searching:\n#define PCI_DEVTABLE_LEN (sizeof(PciDevTable)/sizeof(PCI_DEVTABLE))\n" > ofile
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user