aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--com32/lib/pci/scan.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c
index 7d11399d..06302853 100644
--- a/com32/lib/pci/scan.c
+++ b/com32/lib/pci/scan.c
@@ -256,6 +256,7 @@ int get_name_from_pci_ids(struct pci_domain *domain)
char sub_vendor_id[5];
FILE *f;
struct pci_device *dev;
+ bool skip_to_next_vendor=false;
/* Intializing the vendor/product name for each pci device to "unknown" */
/* adding a dev_info member if needed */
@@ -306,9 +307,19 @@ int get_name_from_pci_ids(struct pci_domain *domain)
/* ffff is an invalid vendor id */
if (strstr(vendor_id,"ffff")) break;
+ skip_to_next_vendor=true;
+ int int_vendor_id=hex_to_int(vendor_id);
+ for_each_pci_func(dev, domain) {
+ if (int_vendor_id == dev->vendor) {
+ skip_to_next_vendor=false;
+ continue;
+ }
+ }
/* if we have a tab + a char, it means this is a product id */
} else if ((line[0] == '\t') && (line[1] != '\t')) {
+ if (skip_to_next_vendor == true) continue;
+
/* the product name the second field */
strlcpy(product,skipspace(strstr(line," ")),255);
remove_eol(product);
@@ -335,6 +346,8 @@ int get_name_from_pci_ids(struct pci_domain *domain)
/* if we have two tabs, it means this is a sub product */
} else if ((line[0] == '\t') && (line[1] == '\t')) {
+ if (skip_to_next_vendor == true) continue;
+
/* the product name is last field */
strlcpy(product,skipspace(strstr(line," ")),255);
strlcpy(product,skipspace(strstr(product," ")),255);