summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2009-04-10 14:42:07 +0000
committerPascal Terjan <pterjan@mandriva.org>2009-04-10 14:42:07 +0000
commit3d5f4f7383255c4c8612508e6cdf166c86db25c3 (patch)
treed5579bda3492cc2610d3b7a4838d9b5efd3841b5
parent82624de6ba2a009c9cf168c029e19b1f8280a88f (diff)
downloadldetect-3d5f4f7383255c4c8612508e6cdf166c86db25c3.tar
ldetect-3d5f4f7383255c4c8612508e6cdf166c86db25c3.tar.gz
ldetect-3d5f4f7383255c4c8612508e6cdf166c86db25c3.tar.bz2
ldetect-3d5f4f7383255c4c8612508e6cdf166c86db25c3.tar.xz
ldetect-3d5f4f7383255c4c8612508e6cdf166c86db25c3.zip
ignore usb interfaces not active
-rw-r--r--NEWS1
-rw-r--r--usb.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 9123921..a8ee612 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@
That fixed presenting something as usb_storage even if the
device is ignored by usb_storage driver and handled on another
interface by option driver
+- ignore usb interfaces not active
Version 0.8.1 - 3 April 2009, Christophe Fergeau
diff --git a/usb.c b/usb.c
index 856fba3..235b047 100644
--- a/usb.c
+++ b/usb.c
@@ -60,7 +60,7 @@ extern struct pciusb_entries usb_probe(void) {
case 'I': if (e->class_id == 0 || e->module == NULL) {
char driver[50];
int class_id, sub, prot = 0;
- if (sscanf(buf, "I:%*1c If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_id, &sub, &prot, driver) == 4) {
+ if (sscanf(buf, "I:* If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_id, &sub, &prot, driver) == 4) {
unsigned long cid = (class_id * 0x100 + sub) * 0x100 + prot;
if (e->class_id == 0)
e->class_id = cid;
@@ -80,6 +80,8 @@ extern struct pciusb_entries usb_probe(void) {
if (e->class_id == (0x1*0x100+ 0x01)) /* USB_AUDIO_CLASS*0x100 + USB_SUBCLASS_AUDIO_CONTROL*/
e->module = strdup("snd_usb_audio");
+ } else if (sscanf(buf, "I: If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_id, &sub, &prot, driver) == 4) {
+ /* Ignore interfaces not active */
} else fprintf(stderr, "%s %d: unknown ``I'' line\n", proc_usb_path, line);
break;
}