diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2002-08-08 15:20:27 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2002-08-08 15:20:27 +0000 |
commit | e3f143bf539e6daf0e83421c5d2c37966288f7fb (patch) | |
tree | 9b8a6f0e464a47d627227acdc4784b5e9de703f5 /pciusb.c | |
parent | cccfcf2e54cb927c0282f076a40b2d327168980e (diff) | |
download | ldetect-e3f143bf539e6daf0e83421c5d2c37966288f7fb.tar ldetect-e3f143bf539e6daf0e83421c5d2c37966288f7fb.tar.gz ldetect-e3f143bf539e6daf0e83421c5d2c37966288f7fb.tar.bz2 ldetect-e3f143bf539e6daf0e83421c5d2c37966288f7fb.tar.xz ldetect-e3f143bf539e6daf0e83421c5d2c37966288f7fb.zip |
- struct pciusb_entrie : add already_found flag
- pciusb::pciusb_initialize() : zero the above flag:
- pciusb::pciusb_find_modules() : use the above flag:
o if device subids matches the table ones,
swtich the already_found flag
o skip already handled device (if already_found==1)
Diffstat (limited to 'pciusb.c')
-rw-r--r-- | pciusb.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -103,6 +103,10 @@ extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciu } for (i = 0; i < entries->nb; i++) { struct pciusb_entry *e = &entries->entries[i]; + if (e->already_found) { + if (e->device == 0x0525 &&e->device == device) + continue; // skip since already found with sub ids + } if (vendor != e->vendor || device != e->device) continue; // main ids differ if (nb == 4 && e->subvendor == 0xffff && e->subdevice == 0xffff && !no_subid) { @@ -113,6 +117,7 @@ extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciu if (nb == 4 && !(subvendor == e->subvendor && subdevice == e->subdevice)) continue; // subids differ + if (!p) { // only calc text & module if not already done p = buf + offset + 1; q = strchr(p, '\t'); @@ -120,6 +125,9 @@ extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciu e->module = strcmp(p, "unknown") ? strndup(p,q-p-1) : NULL; ifree(e->text); /* usb.c set it so that we display something when usbtable doesn't refer that hw*/ e->text = strndup(q+2, strlen(q)-4); + if (e->subvendor != 0xffff && e->subdevice != 0xffff && + subdevice == e->subdevice && subvendor == e->subvendor) + e->already_found = 1; } } fh_close(&f); @@ -137,6 +145,7 @@ extern void pciusb_initialize(struct pciusb_entry *e) { e->pci_function = 0xffff; e->module = NULL; e->text = NULL; + e->already_found = 0; } extern void pciusb_free(struct pciusb_entries *entries) { |