summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common.h7
-rw-r--r--pciusb.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/common.h b/common.h
index 4cf5eb6..9b6d455 100644
--- a/common.h
+++ b/common.h
@@ -5,7 +5,12 @@
#define NON_EXPORTED __attribute__((visibility("hidden")))
-extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable) NON_EXPORTED;
+typedef enum {
+ LOAD,
+ DO_NOT_LOAD,
+} descr_lookup;
+
+extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable, const descr_lookup) NON_EXPORTED;
extern void pciusb_initialize(struct pciusb_entry *e) NON_EXPORTED;
#define MAX_DEVICES 100
diff --git a/pciusb.c b/pciusb.c
index 949aeee..c47a229 100644
--- a/pciusb.c
+++ b/pciusb.c
@@ -9,7 +9,7 @@
#include <string.h>
#include "common.h"
-extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable) {
+extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable, const descr_lookup descr_lookup) {
fh f;
char buf[2048];
int line;
@@ -51,7 +51,7 @@ extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciu
e->module = strndup(p,q-p-1);
}
/* special case for buggy 0x0 usb entry */
- if (2 < strlen(q+2) && vendor != 0 && device != 0 && e->class_ != 0x90000d) { /* Hub class */
+ if (descr_lookup == LOAD && 2 < strlen(q+2) && vendor != 0 && device != 0 && e->class_ != 0x90000d) { /* Hub class */
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);
}